Verify instances status before going starting the instances

This commit is contained in:
Camille Rodriguez
2019-08-30 15:01:36 -04:00
parent c05cce5b3e
commit 94e1d8f7ed
+4 -7
View File
@@ -276,13 +276,10 @@ class PerconaClusterColdStartTest(PerconaClusterTest):
logging.info("Stopping instances: {}".format(self.machines))
for uuid in self.machines:
self.nova_client.servers.stop(uuid)
# Unfortunately, juju reports units in workload status "active"
# when they are in fact down. So we have to rely on a simple wait
# and idle check.
logging.debug("Sleep ...")
time.sleep(30)
logging.debug("Wait till model is idle ...")
zaza.model.block_until_all_units_idle()
logging.debug("Wait till all machines are shutoff ...")
for uuid in self.machines:
openstack_utils.resource_reaches_status(self.nova_client.servers, uuid,
expected_status='SHUTOFF', stop_after_attempt=16)
# Start nodes
self.machines.sort(reverse=True)