diff options
| author | Brian Waldon <brian.waldon@rackspace.com> | 2011-07-11 14:41:29 -0400 |
|---|---|---|
| committer | Brian Waldon <brian.waldon@rackspace.com> | 2011-07-11 14:41:29 -0400 |
| commit | 2aacfcbef233113ce25c52f1504bde9dd49f758e (patch) | |
| tree | 96349a78a121d228f1a94e6dcc7fe957c90b6da5 /tools | |
| parent | 02b0ca3e44626623c70d04ccaa50af8c75d640af (diff) | |
| parent | 11be49aa59efc2d0d991d70546899b3625270af6 (diff) | |
| download | nova-2aacfcbef233113ce25c52f1504bde9dd49f758e.tar.gz nova-2aacfcbef233113ce25c52f1504bde9dd49f758e.tar.xz nova-2aacfcbef233113ce25c52f1504bde9dd49f758e.zip | |
merging trunk
Diffstat (limited to 'tools')
| -rwxr-xr-x | tools/clean-vlans | 6 | ||||
| -rwxr-xr-x | tools/nova-debug | 21 |
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 + |
