Skip to content

Commit 243b26a

Browse files
committed
Wait for instance termination to complete.
This patch waits for instance termination to complete before trying to delete the security group. The last change to simply move the security group deletion to after euca-terminate-instance was not sufficient, as it has to wait until the termination is complete. Change-Id: Icba579534f324afb4d44abd42d8c755834dd2a57
1 parent e7ed17e commit 243b26a

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

exercises/euca.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,5 +95,11 @@ fi
9595
# Terminate instance
9696
euca-terminate-instances $INSTANCE
9797

98+
# Assure it has terminated within a reasonable time
99+
if ! timeout $TERMINATE_TIMEOUT sh -c "while euca-describe-instances $INSTANCE | grep -q running; do sleep 1; done"; then
100+
echo "server didn't terminate within $TERMINATE_TIMEOUT seconds"
101+
exit 1
102+
fi
103+
98104
# Delete group
99105
euca-delete-group $SECGROUP

openrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,3 +89,6 @@ export RUNNING_TIMEOUT=${RUNNING_TIMEOUT:-$(($BOOT_TIMEOUT + $ACTIVE_TIMEOUT))}
8989

9090
# Max time to wait for proper IP association and dis-association.
9191
export ASSOCIATE_TIMEOUT=${ASSOCIATE_TIMEOUT:-15}
92+
93+
# Max time to wait for a vm to terminate
94+
export TERMINATE_TIMEOUT=${TERMINATE_TIMEOUT:-30}

0 commit comments

Comments
 (0)