docs
This commit is contained in:
parent
f670549186
commit
9f1863450e
1 changed files with 5 additions and 5 deletions
|
@ -1,12 +1,9 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
# **exercise.sh** - using the cloud can be fun
|
# we will use the ``euca2ools`` cli tool that wraps the python boto
|
||||||
|
# library to test ec2 compatibility
|
||||||
# we will use the ``nova`` cli tool provided by the ``python-novaclient``
|
|
||||||
# package
|
|
||||||
#
|
#
|
||||||
|
|
||||||
|
|
||||||
# This script exits on an error so that errors don't compound and you see
|
# This script exits on an error so that errors don't compound and you see
|
||||||
# only the first error that occured.
|
# only the first error that occured.
|
||||||
set -o errexit
|
set -o errexit
|
||||||
|
@ -25,10 +22,13 @@ source ./openrc
|
||||||
# Max time till the vm is bootable
|
# Max time till the vm is bootable
|
||||||
BOOT_TIMEOUT=${BOOT_TIMEOUT:-15}
|
BOOT_TIMEOUT=${BOOT_TIMEOUT:-15}
|
||||||
|
|
||||||
|
# find a machine image to boot
|
||||||
IMAGE=`euca-describe-images | grep machine | cut -f2`
|
IMAGE=`euca-describe-images | grep machine | cut -f2`
|
||||||
|
|
||||||
|
# launch it
|
||||||
INSTANCE=`euca-run-instance $IMAGE | grep INSTANCE | cut -f2`
|
INSTANCE=`euca-run-instance $IMAGE | grep INSTANCE | cut -f2`
|
||||||
|
|
||||||
|
# assure it has booted within a reasonable time
|
||||||
if ! timeout $BOOT_TIMEOUT sh -c "while euca-describe-instances $INSTANCE | grep -q running; do sleep 1; done"; then
|
if ! timeout $BOOT_TIMEOUT sh -c "while euca-describe-instances $INSTANCE | grep -q running; do sleep 1; done"; then
|
||||||
echo "server didn't become active within $BOOT_TIMEOUT seconds"
|
echo "server didn't become active within $BOOT_TIMEOUT seconds"
|
||||||
exit 1
|
exit 1
|
||||||
|
|
Loading…
Reference in a new issue