Updates some of the extra scripts in contrib and tools to current versions.
This commit is contained in:
commit
e938b698e5
@ -17,7 +17,7 @@ if [ ! -n "$HOST_IP" ]; then
|
|||||||
HOST_IP=`LC_ALL=C ifconfig | grep -m 1 'inet addr:'| cut -d: -f2 | awk '{print $1}'`
|
HOST_IP=`LC_ALL=C ifconfig | grep -m 1 'inet addr:'| cut -d: -f2 | awk '{print $1}'`
|
||||||
fi
|
fi
|
||||||
|
|
||||||
USE_MYSQL=${USE_MYSQL:-0}
|
USE_MYSQL=${USE_MYSQL:-1}
|
||||||
INTERFACE=${INTERFACE:-eth0}
|
INTERFACE=${INTERFACE:-eth0}
|
||||||
FLOATING_RANGE=${FLOATING_RANGE:-10.6.0.0/27}
|
FLOATING_RANGE=${FLOATING_RANGE:-10.6.0.0/27}
|
||||||
FIXED_RANGE=${FIXED_RANGE:-10.0.0.0/24}
|
FIXED_RANGE=${FIXED_RANGE:-10.0.0.0/24}
|
||||||
@ -159,10 +159,6 @@ NOVA_CONF_EOF
|
|||||||
mkdir -p $NOVA_DIR/instances
|
mkdir -p $NOVA_DIR/instances
|
||||||
rm -rf $NOVA_DIR/networks
|
rm -rf $NOVA_DIR/networks
|
||||||
mkdir -p $NOVA_DIR/networks
|
mkdir -p $NOVA_DIR/networks
|
||||||
if [ ! -d "$NOVA_DIR/images" ]; then
|
|
||||||
ln -s $DIR/images $NOVA_DIR/images
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$TEST" == 1 ]; then
|
if [ "$TEST" == 1 ]; then
|
||||||
cd $NOVA_DIR
|
cd $NOVA_DIR
|
||||||
python $NOVA_DIR/run_tests.py
|
python $NOVA_DIR/run_tests.py
|
||||||
@ -181,8 +177,18 @@ NOVA_CONF_EOF
|
|||||||
# create some floating ips
|
# create some floating ips
|
||||||
$NOVA_DIR/bin/nova-manage floating create `hostname` $FLOATING_RANGE
|
$NOVA_DIR/bin/nova-manage floating create `hostname` $FLOATING_RANGE
|
||||||
|
|
||||||
|
if [ ! -d "$NOVA_DIR/images" ]; then
|
||||||
|
if [ ! -d "$DIR/converted-images" ]; then
|
||||||
# convert old images
|
# convert old images
|
||||||
|
mkdir $DIR/converted-images
|
||||||
|
ln -s $DIR/converted-images $NOVA_DIR/images
|
||||||
$NOVA_DIR/bin/nova-manage image convert $DIR/images
|
$NOVA_DIR/bin/nova-manage image convert $DIR/images
|
||||||
|
else
|
||||||
|
ln -s $DIR/converted-images $NOVA_DIR/images
|
||||||
|
fi
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
# nova api crashes if we start it with a regular screen command,
|
# nova api crashes if we start it with a regular screen command,
|
||||||
# so send the start command by forcing text into the window.
|
# so send the start command by forcing text into the window.
|
||||||
|
@ -21,5 +21,5 @@ 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 ifconfig foo down
|
||||||
sudo ifconfig -a | grep br | grep -v bridge | cut -f1 -d" " | xargs -n1 -ifoo brctl delbr foo
|
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 | 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 vconfig rem foo
|
||||||
|
@ -30,13 +30,15 @@ cd $INSTANCES_PATH/$1
|
|||||||
if [ $CMD != "umount" ] && [ $CMD != "launch" ]; then
|
if [ $CMD != "umount" ] && [ $CMD != "launch" ]; then
|
||||||
# destroy the instance
|
# destroy the instance
|
||||||
virsh destroy $1
|
virsh destroy $1
|
||||||
|
virsh undefine $1
|
||||||
|
|
||||||
# mount the filesystem
|
# mount the filesystem
|
||||||
mkdir t
|
mkdir t
|
||||||
DEVICE=`losetup --show -f disk`
|
DEVICE=/dev/nbd0
|
||||||
echo $DEVICE
|
echo $DEVICE
|
||||||
kpartx -a $DEVICE
|
qemu-nbd -c $DEVICE disk
|
||||||
mount /dev/mapper/${DEVICE:4}p1 t
|
sleep 3
|
||||||
|
mount $DEVICE t
|
||||||
|
|
||||||
fi
|
fi
|
||||||
if [ $CMD != "mount" ] && [ $CMD != "umount" ]; then
|
if [ $CMD != "mount" ] && [ $CMD != "umount" ]; then
|
||||||
@ -66,11 +68,13 @@ sed -i "s/<serial type=\"file\">.*<\/serial>/<serial type=\"pty\"><source path=\
|
|||||||
|
|
||||||
umount t
|
umount t
|
||||||
|
|
||||||
virsh create debug.xml
|
virsh define debug.xml
|
||||||
|
virsh start $1
|
||||||
virsh console $1
|
virsh console $1
|
||||||
virsh destroy $1
|
virsh destroy $1
|
||||||
|
virsh undefine $1
|
||||||
|
|
||||||
mount /dev/mapper/${DEVICE:4}p1 t
|
mount $DEVICE t
|
||||||
|
|
||||||
# clear debug root password
|
# clear debug root password
|
||||||
chroot t passwd -l root
|
chroot t passwd -l root
|
||||||
@ -83,10 +87,11 @@ if [ $CMD != "mount" ] && [ $CMD != "launch" ]; then
|
|||||||
|
|
||||||
# unmount the filesystem
|
# unmount the filesystem
|
||||||
umount t
|
umount t
|
||||||
kpartx -d $DEVICE
|
qemu-nbd -d $DEVICE
|
||||||
losetup -d $DEVICE
|
|
||||||
rmdir t
|
rmdir t
|
||||||
|
|
||||||
# recreate the instance
|
# recreate the instance
|
||||||
virsh create libvirt.xml
|
virsh define libvirt.xml
|
||||||
|
virsh start $1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user