Check compute state before migration

Novaclient returns list of hypervisors. We should
check state to discard deleted or disabled
(unavailable) compute nodes for instance migration.

Change-Id: I319076e637162d99d33d0f69911ac426d1e08258
Closes-Bug: 1604749
This commit is contained in:
Dmitry Belyaninov 2016-11-17 12:46:14 +00:00 committed by Vladimir Khlyunev
parent 6d9aee8f7c
commit 5f8aed5557
1 changed files with 1 additions and 1 deletions

View File

@ -925,7 +925,7 @@ class NovaNetworkScenarioTest(OfficialClientTest):
for host in available_hosts:
hostname = host.service.get('host')
if host.hypervisor_type != 'VMware vCenter Server' and \
hostname != current_host:
host.state == 'up' and hostname != current_host:
return hostname
def migrate_instance(self, instance, host_to):