Merge pull request #141 from cloudbuilders/xen_exercise
Changes to make exercise.sh work with xen
This commit is contained in:
commit
06ab43b4f9
3 changed files with 74 additions and 16 deletions
|
@ -164,11 +164,14 @@ 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
|
||||||
|
|
||||||
# test we can aren't able to ping our floating ip within ASSOCIATE_TIMEOUT seconds
|
# FIXME (anthony): make xs support security groups
|
||||||
if ! timeout $ASSOCIATE_TIMEOUT sh -c "while ping -c1 -w1 $FLOATING_IP; do sleep 1; done"; then
|
if [ "$VIRT_DRIVER" != "xenserver"]; then
|
||||||
|
# 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
|
||||||
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
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -298,14 +298,63 @@ 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
|
||||||
|
|
||||||
echo "################################################################################"
|
# If we have copied our ssh credentials, use ssh to monitor while the installation runs
|
||||||
echo ""
|
WAIT_TILL_LAUNCH=${WAIT_TILL_LAUNCH:-1}
|
||||||
echo "All Finished!"
|
if [ "$WAIT_TILL_LAUNCH" = "1" ] && [ -e ~/.ssh/id_rsa.pub ] && [ "$COPYENV" = "1" ]; then
|
||||||
echo "Now, you can monitor the progress of the stack.sh installation by "
|
# Done creating the container, let's tail the log
|
||||||
echo "tailing /opt/stack/run.sh.log from within your domU."
|
echo
|
||||||
echo ""
|
echo "============================================================="
|
||||||
echo "ssh into your domU now: 'ssh stack@$PUB_IP' using your password"
|
echo " -- YAY! --"
|
||||||
echo "and then do: 'tail -f /opt/stack/run.sh.log'"
|
echo "============================================================="
|
||||||
echo ""
|
echo
|
||||||
echo "When the script completes, you can then visit the OpenStack Dashboard"
|
echo "We're done launching the vm, about to start tailing the"
|
||||||
echo "at http://$PUB_IP, and contact other services at the usual ports."
|
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 "All Finished!"
|
||||||
|
echo "Now, you can monitor the progress of the stack.sh installation by "
|
||||||
|
echo "tailing /opt/stack/run.sh.log from within your domU."
|
||||||
|
echo ""
|
||||||
|
echo "ssh into your domU now: 'ssh stack@$PUB_IP' using your password"
|
||||||
|
echo "and then do: 'tail -f /opt/stack/run.sh.log'"
|
||||||
|
echo ""
|
||||||
|
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."
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
Loading…
Reference in a new issue