only attempt to ping private ip for single node deployments
This commit is contained in:
parent
e959d83325
commit
8ecd2948ad
1 changed files with 10 additions and 6 deletions
16
exercise.sh
16
exercise.sh
|
@ -91,14 +91,18 @@ nova show $NAME | grep status | grep -q ACTIVE
|
||||||
# get the IP of the server
|
# get the IP of the server
|
||||||
IP=`nova show $NAME | grep "private network" | cut -d"|" -f3`
|
IP=`nova show $NAME | grep "private network" | cut -d"|" -f3`
|
||||||
|
|
||||||
# ping it once (timeout of a second)
|
# for single node deployments, we can ping private ips
|
||||||
ping -c1 -w1 $IP || true
|
MULTI_HOST=${MULTI_HOST:-0}
|
||||||
|
if [ "$MULTI_HOST" = "0"]; then
|
||||||
|
# ping it once (timeout of a second)
|
||||||
|
ping -c1 -w1 $IP || true
|
||||||
|
|
||||||
# sometimes the first ping fails (10 seconds isn't enough time for the VM's
|
# sometimes the first ping fails (10 seconds isn't enough time for the VM's
|
||||||
# network to respond?), so let's wait 5 seconds and really test ping
|
# network to respond?), so let's wait 5 seconds and really test ping
|
||||||
sleep 5
|
sleep 5
|
||||||
|
|
||||||
ping -c1 -w1 $IP
|
ping -c1 -w1 $IP
|
||||||
|
fi
|
||||||
|
|
||||||
# Security Groups & Floating IPs
|
# Security Groups & Floating IPs
|
||||||
# ------------------------------
|
# ------------------------------
|
||||||
|
|
Loading…
Reference in a new issue