From 8662f6dabfbc0caa2a445cb6af5cd04e8bd0d3dd Mon Sep 17 00:00:00 2001 From: Minh Doan Date: Sun, 8 Jul 2018 23:20:04 -0700 Subject: [PATCH] add waiter after creating instances --- aws-experiment-launch/create_instances.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/aws-experiment-launch/create_instances.py b/aws-experiment-launch/create_instances.py index de34b9faf..b5d2f7f71 100644 --- a/aws-experiment-launch/create_instances.py +++ b/aws-experiment-launch/create_instances.py @@ -77,6 +77,11 @@ def create_instances(config, ec2_client, region_number, number_of_instances): ], ) + instance_ids = utils.get_instance_ids2(ec2_client, node_name_tag) + LOGGER.info("Waiting for all %d instances in region %s to be in RUNNING" % (len(instance_ids), region_number)) + waiter = ec2_client.get_waiter('instance_running') + waiter.wait(InstanceIds=instance_ids) + count = 0 while count < 40: time.sleep(5)