Do not force live migration outside of Availability zone
If live migration tests are ran on environment with multiple AZ and
destination host for live migration is chosen from different AZ then
nova scheduler would stop such migration and live migration tests
would fail so in the case of CONF.compute.compute_volume_common_az
being set in config file, choose destination host from the same
availability zone (the same happens with cinder AZ).
Change-Id: I6bfad96ae3aa6cd8efd7ae2a0ce01c53140f617a
diff --git a/tempest/api/compute/base.py b/tempest/api/compute/base.py
index d7ee39c..8d0962d 100644
--- a/tempest/api/compute/base.py
+++ b/tempest/api/compute/base.py
@@ -631,8 +631,14 @@
svcs = self.os_admin.services_client.list_services(
binary='nova-compute')['services']
- hosts = [svc['host'] for svc in svcs
- if svc['state'] == 'up' and svc['status'] == 'enabled']
+ hosts = []
+ for svc in svcs:
+ if svc['state'] == 'up' and svc['status'] == 'enabled':
+ if CONF.compute.compute_volume_common_az:
+ if svc['zone'] == CONF.compute.compute_volume_common_az:
+ hosts.append(svc['host'])
+ else:
+ hosts.append(svc['host'])
for target_host in hosts:
if source_host != target_host: