From c82e645f9d99feadc91df69053544d05fbd0151a Mon Sep 17 00:00:00 2001 From: Mikael Hammarin Date: Sun, 23 Aug 2015 13:39:01 +0200 Subject: [PATCH] Elastic IP need to be assigned after the instance is in running state. Currently always fails with "The pending instance x is not in a valid state for this operation" and defaults to public ip. Fix: Moved assign-elastic-ip to run after wait-for-instance-running --- cluster/aws/util.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cluster/aws/util.sh b/cluster/aws/util.sh index c7e4cb717a6..a3722c8457a 100644 --- a/cluster/aws/util.sh +++ b/cluster/aws/util.sh @@ -869,13 +869,13 @@ function kube-up { exit 1 fi else + # We are not able to add an elastic ip, a route or volume to the instance until that instance is in "running" state. + wait-for-instance-running $master_id + KUBE_MASTER=${MASTER_NAME} KUBE_MASTER_IP=$(assign-elastic-ip $ip $master_id) echo -e " ${color_green}[master running @${KUBE_MASTER_IP}]${color_norm}" - # We are not able to add a route or volume to the instance until that instance is in "running" state. - wait-for-instance-running $master_id - # This is a race between instance start and volume attachment. There appears to be no way to start an AWS instance with a volume attached. # To work around this, we wait for volume to be ready in setup-master-pd.sh echo "Attaching persistent data volume (${MASTER_DISK_ID}) to master"