summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorChris Behrens <cbehrens@codestud.com>2011-07-12 16:13:01 -0700
committerChris Behrens <cbehrens@codestud.com>2011-07-12 16:13:01 -0700
commite547f4bde48a0142fbdb407a4c51f4b6f8fa56e2 (patch)
tree36b98fac8f2890294d0a1fb42f72545652227fb7 /tools
parentbbd8f482b916168871d1d83192b354355858e77c (diff)
parent11611716e30f368df77816b40c4c77de0e0e047f (diff)
downloadnova-e547f4bde48a0142fbdb407a4c51f4b6f8fa56e2.tar.gz
nova-e547f4bde48a0142fbdb407a4c51f4b6f8fa56e2.tar.xz
nova-e547f4bde48a0142fbdb407a4c51f4b6f8fa56e2.zip
merged trunk
Diffstat (limited to 'tools')
-rwxr-xr-xtools/clean-vlans6
-rwxr-xr-xtools/nova-debug21
2 files changed, 16 insertions, 11 deletions
diff --git a/tools/clean-vlans b/tools/clean-vlans
index 820a9dbe5..a26ad86ad 100755
--- a/tools/clean-vlans
+++ b/tools/clean-vlans
@@ -17,9 +17,9 @@
# License for the specific language governing permissions and limitations
# under the License.
-export LC_ALL=C
+export LC_ALL=C
sudo ifconfig -a | grep br | grep -v bridge | cut -f1 -d" " | xargs -n1 -ifoo ifconfig foo down
sudo ifconfig -a | grep br | grep -v bridge | cut -f1 -d" " | xargs -n1 -ifoo brctl delbr foo
-sudo ifconfig -a | grep vlan | grep -v vlan124 | grep -v vlan5 | cut -f1 -d" " | xargs -n1 -ifoo ifconfig foo down
-sudo ifconfig -a | grep vlan | grep -v vlan124 | grep -v vlan5 | cut -f1 -d" " | xargs -n1 -ifoo vconfig rem foo
+sudo ifconfig -a | grep vlan | cut -f1 -d" " | xargs -n1 -ifoo ifconfig foo down
+sudo ifconfig -a | grep vlan | cut -f1 -d" " | xargs -n1 -ifoo vconfig rem foo
diff --git a/tools/nova-debug b/tools/nova-debug
index 3ff68ca35..0a78af16a 100755
--- a/tools/nova-debug
+++ b/tools/nova-debug
@@ -30,13 +30,15 @@ cd $INSTANCES_PATH/$1
if [ $CMD != "umount" ] && [ $CMD != "launch" ]; then
# destroy the instance
virsh destroy $1
+virsh undefine $1
# mount the filesystem
mkdir t
-DEVICE=`losetup --show -f disk`
+DEVICE=/dev/nbd0
echo $DEVICE
-kpartx -a $DEVICE
-mount /dev/mapper/${DEVICE:4}p1 t
+qemu-nbd -c $DEVICE disk
+sleep 3
+mount $DEVICE t
fi
if [ $CMD != "mount" ] && [ $CMD != "umount" ]; then
@@ -66,11 +68,13 @@ sed -i "s/<serial type=\"file\">.*<\/serial>/<serial type=\"pty\"><source path=\
umount t
-virsh create debug.xml
+virsh define debug.xml
+virsh start $1
virsh console $1
virsh destroy $1
+virsh undefine $1
-mount /dev/mapper/${DEVICE:4}p1 t
+mount $DEVICE t
# clear debug root password
chroot t passwd -l root
@@ -83,10 +87,11 @@ if [ $CMD != "mount" ] && [ $CMD != "launch" ]; then
# unmount the filesystem
umount t
-kpartx -d $DEVICE
-losetup -d $DEVICE
+qemu-nbd -d $DEVICE
rmdir t
# recreate the instance
-virsh create libvirt.xml
+virsh define libvirt.xml
+virsh start $1
fi
+