Merge lp:~bcsaller/pyjuju/local-troubleshooting into lp:pyjuju

Proposed by Benjamin Saller
Status: Merged
Approved by: Kapil Thangavelu
Approved revision: 407
Merge reported by: Benjamin Saller
Merged at revision: not available
Proposed branch: lp:~bcsaller/pyjuju/local-troubleshooting
Merge into: lp:pyjuju
Diff against target: 175 lines (+120/-15)
4 files modified
docs/source/provider-configuration-local.rst (+48/-8)
juju/lib/lxc/data/juju-create (+2/-0)
juju/providers/local/__init__.py (+7/-7)
misc/devel-tools/juju-inspect-local-provider (+63/-0)
To merge this branch: bzr merge lp:~bcsaller/pyjuju/local-troubleshooting
Reviewer Review Type Date Requested Status
Kapil Thangavelu (community) Approve
William Reade (community) Approve
Review via email: mp+79193@code.launchpad.net

Description of the change

local provider troubleshooting aid

Includes docs and a small script to collect information about the local machines lxc environment for bug reports.

To post a comment you must log in.
406. By Benjamin Saller

note about container name on troubleshooting script

407. By Benjamin Saller

fixed some typos in the script

Revision history for this message
William Reade (fwereade) wrote :

[0]

+When providing bug reports or including issues the output of the both
+the master-customize.log mentioned above and the result of the
+devel-tools/juju-inspect-local-provider script.

Parse error. Perhaps "When reporting bugs or issues, please include both the master-customize.log (described above) and the output of the devel-tools/juju-inspect-local-provider script."?

Otherwise LGTM

review: Approve
Revision history for this message
Kapil Thangavelu (hazmat) wrote :

[0]
37 +When you first attempt to deploy a unit the time consuming process of
38 +creating a unit will begin

Services are deployed, service units are added/created

[1]

144 +virsh net-list --all

This should probably be delocalized LC_ALL="C"

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'docs/source/provider-configuration-local.rst'
2--- docs/source/provider-configuration-local.rst 2011-10-07 20:04:21 +0000
3+++ docs/source/provider-configuration-local.rst 2011-10-14 23:44:24 +0000
4@@ -41,11 +41,51 @@
5 Provider specific options
6 =========================
7
8- data-dir:
9- Directory for zookeeper state and log files.
10-
11-
12-
13-
14-
15-
16+ data-dir:
17+ Directory for zookeeper state and log files.
18+
19+
20+
21+Troubleshooting
22+===============
23+
24+Local development is still a young and evolving feature and because of
25+the many complex system interactions its possible you'll encounter
26+some speed bumps along your path. There are a number of log files you
27+should be aware of when trying to understand how the system behaves.
28+
29+Once``juju bootstrap`` has run you'll have a directory in place on
30+your filesystem at the location specified in your
31+environments.yaml. In here you'll find a number of files related to
32+the runtime of the local deployment system. The first step is to
33+verify that the machine-agent.log includes a line similar to::
34+
35+ 2011-10-05 14:43:56,327: juju.agents.machine@INFO: Machine agent started id:0 deploy:<class 'juju.machine.unit.UnitContainerDeployment'> provider:'local'
36+
37+When you first attempt to deploy a unit the time consuming process of
38+creating a unit will begin. The first time you run this it can taGke
39+quite some time and if your impatient and need to check on the process
40+`lxc-ls` will show you which templates are created or being created
41+and::
42+
43+ pgrep lxc| head -1| xargs watch pstree -alU
44+
45+will give you a refeshing view of the first container as its built.
46+
47+Once a container is built you should have access to it via ssh through
48+the `juju ssh` as normal.
49+
50+If services are not running properly as exposed by `juju status` the
51+log file in *data-dir/units/master-customize.log* should provide insight
52+into the nature of the error.
53+
54+When providing bug reports or including issues the output of the both
55+the master-customize.log mentioned above and the result of the
56+devel-tools/juju-inspect-local-provider script. If you are not running
57+a development checkout this script should be located at
58+*/usr/lib/juju/juju/misc/devel-tools/juju-inspect-local-provider*
59+
60+By passing the name of the container as an argument to that script
61+additional information abou the container will be included in the
62+output as well. To find the name of the container in question `lxc-ls`
63+can be used.
64
65=== modified file 'juju/lib/lxc/data/juju-create'
66--- juju/lib/lxc/data/juju-create 2011-10-12 18:08:30 +0000
67+++ juju/lib/lxc/data/juju-create 2011-10-14 23:44:24 +0000
68@@ -146,3 +146,5 @@
69 setup_juju
70 # setup_juju ensures sudo is installed which is needed for setup_users
71 setup_users
72+
73+echo "Container Customization Complete"
74\ No newline at end of file
75
76=== modified file 'juju/providers/local/__init__.py'
77--- juju/providers/local/__init__.py 2011-10-12 18:08:30 +0000
78+++ juju/providers/local/__init__.py 2011-10-14 23:44:24 +0000
79@@ -70,6 +70,13 @@
80 raise ProviderError("Missing packages %s" % (
81 ", ".join(sorted(list(missing)))))
82
83+ # Store user credentials from the running user
84+ try:
85+ public_key = get_user_authorized_keys(self.config)
86+ public_key = public_key.strip()
87+ except LookupError, e:
88+ raise ProviderError(str(e))
89+
90 # Get/create directory for zookeeper and files
91 zookeeper_dir = os.path.join(self._directory, "zookeeper")
92 if not os.path.exists(zookeeper_dir):
93@@ -122,13 +129,6 @@
94 hierarchy = StateHierarchy(client, admin_identity, "local", "local")
95 yield hierarchy.initialize()
96
97- # Store user credentials from the running user
98- try:
99- public_key = get_user_authorized_keys(self.config)
100- public_key = public_key.strip()
101- except LookupError, e:
102- raise ProviderError(str(e))
103-
104 # Startup the machine agent
105 pid_file = os.path.join(self._directory, "machine-agent.pid")
106 log_file = os.path.join(self._directory, "machine-agent.log")
107
108=== added directory 'misc/devel-tools'
109=== added file 'misc/devel-tools/juju-inspect-local-provider'
110--- misc/devel-tools/juju-inspect-local-provider 1970-01-01 00:00:00 +0000
111+++ misc/devel-tools/juju-inspect-local-provider 2011-10-14 23:44:24 +0000
112@@ -0,0 +1,63 @@
113+#!/bin/bash -x
114+
115+# Gather a collection of data into an output file to make
116+# debugging any possible issues with the local provider simpler
117+
118+if [ ! `id -u` == '0' ]; then
119+ echo "This script should be run as root"
120+ exit 1;
121+fi
122+
123+if [ ${#} = 1 ]; then
124+ image_name=$1
125+fi
126+
127+# 11.10 (Oneiric) is the first supported release for the local provider due
128+# to its improved LXC support
129+source /etc/lsb-release
130+major_release=`echo $DISTRIB_RELEASE | cut -d . -f 1`
131+minor_release=`echo $DISTRIB_RELEASE | cut -d . -f 2`
132+
133+if [ $major_release -lt 11 -o $minor_release -lt 10 ]; then
134+ echo "Oneiric 11.10 is the first supported release of the local provider"
135+ exit 1;
136+fi
137+
138+
139+# Collect various status information about the system
140+echo "#Local provider inspection"
141+uname -a
142+
143+ifconfig
144+virsh net-list --all
145+
146+ls /var/cache/lxc
147+ls /var/cache/lxc/*
148+
149+lxc-ls
150+
151+# guess about the users data-dir
152+if [ -n "${SUDO_USER}" ]; then
153+ user=$SUDO_USER
154+fi
155+
156+
157+image=/var/lib/lxc/$image_name
158+if [ -n "$image_name" -a -e "$image" ]; then
159+ cat "$image/config"
160+ chroot "$image/rootfs" bash -xc "
161+ cat /etc/juju/juju.conf;
162+ ls /usr/lib/juju/juju;
163+ dpkg-query -s juju;
164+ cat /etc/hostname
165+ cat /etc/resolv.conf
166+ cat /etc/hosts
167+ tail -n 100 /var/log/juju/*.log
168+ "
169+fi
170+
171+
172+
173+
174+
175+

Subscribers

People subscribed via source and target branches

to status/vote changes: