Merge pull request #141 from cloudbuilders/xen_exercise

Changes to make exercise.sh work with xen
This commit is contained in:
sleepsonthefloor 2011-11-01 12:33:20 -07:00
commit 06ab43b4f9
3 changed files with 74 additions and 16 deletions

View file

@ -164,12 +164,15 @@ ping -c1 -w1 $IP
# dis-allow icmp traffic (ping) # dis-allow icmp traffic (ping)
nova secgroup-delete-rule $SECGROUP icmp -1 -1 0.0.0.0/0 nova secgroup-delete-rule $SECGROUP icmp -1 -1 0.0.0.0/0
# FIXME (anthony): make xs support security groups
if [ "$VIRT_DRIVER" != "xenserver"]; then
# test we can aren't able to ping our floating ip within ASSOCIATE_TIMEOUT seconds # test we can aren't able to ping our floating ip within ASSOCIATE_TIMEOUT seconds
if ! timeout $ASSOCIATE_TIMEOUT sh -c "while ping -c1 -w1 $FLOATING_IP; do sleep 1; done"; then if ! timeout $ASSOCIATE_TIMEOUT sh -c "while ping -c1 -w1 $FLOATING_IP; do sleep 1; done"; then
print "Security group failure - ping should not be allowed!" print "Security group failure - ping should not be allowed!"
echo "Couldn't ping server with floating ip" echo "Couldn't ping server with floating ip"
exit 1 exit 1
fi fi
fi
# de-allocate the floating ip # de-allocate the floating ip
nova floating-ip-delete $FLOATING_IP nova floating-ip-delete $FLOATING_IP

View file

@ -46,6 +46,12 @@ Of course, use real passwords if this machine is exposed.
XENAPI_PASSWORD=my_super_secret XENAPI_PASSWORD=my_super_secret
# Do not download the usual images yet! # Do not download the usual images yet!
IMAGE_URLS="" IMAGE_URLS=""
# Explicitly set virt driver here
VIRT_DRIVER=xenserver
# Explicitly set multi-host
MULTI_HOST=1
# Give extra time for boot
ACTIVE_TIMEOUT=45
EOF EOF
Step 4: Run ./build_domU.sh Step 4: Run ./build_domU.sh

View file

@ -298,6 +298,53 @@ fi
# Start guest # Start guest
$TOP_DIR/scripts/install-os-vpx.sh -f $XVA -v $VM_BR -m $MGT_BR -p $PUB_BR $TOP_DIR/scripts/install-os-vpx.sh -f $XVA -v $VM_BR -m $MGT_BR -p $PUB_BR
# If we have copied our ssh credentials, use ssh to monitor while the installation runs
WAIT_TILL_LAUNCH=${WAIT_TILL_LAUNCH:-1}
if [ "$WAIT_TILL_LAUNCH" = "1" ] && [ -e ~/.ssh/id_rsa.pub ] && [ "$COPYENV" = "1" ]; then
# Done creating the container, let's tail the log
echo
echo "============================================================="
echo " -- YAY! --"
echo "============================================================="
echo
echo "We're done launching the vm, about to start tailing the"
echo "stack.sh log. It will take a second or two to start."
echo
echo "Just CTRL-C at any time to stop tailing."
set +o xtrace
while ! ssh -q stack@$PUB_IP "[ -e run.sh.log ]"; do
sleep 1
done
ssh stack@$PUB_IP 'tail -f run.sh.log' &
TAIL_PID=$!
function kill_tail() {
kill $TAIL_PID
exit 1
}
# Let Ctrl-c kill tail and exit
trap kill_tail SIGINT
echo "Waiting stack.sh to finish..."
while ! ssh -q stack@$PUB_IP "grep -q 'stack.sh completed in' run.sh.log" ; do
sleep 1
done
kill $TAIL_PID
if ! ssh -q stack@$PUB_IP "grep -q 'stack.sh failed' run.sh.log" ; then
exit 1
fi
echo ""
echo "Finished - Zip-a-dee Doo-dah!"
echo "You can then visit the OpenStack Dashboard"
echo "at http://$PUB_IP, and contact other services at the usual ports."
else
echo "################################################################################" echo "################################################################################"
echo "" echo ""
echo "All Finished!" echo "All Finished!"
@ -309,3 +356,5 @@ echo "and then do: 'tail -f /opt/stack/run.sh.log'"
echo "" echo ""
echo "When the script completes, you can then visit the OpenStack Dashboard" echo "When the script completes, you can then visit the OpenStack Dashboard"
echo "at http://$PUB_IP, and contact other services at the usual ports." echo "at http://$PUB_IP, and contact other services at the usual ports."
fi