Fix vm_by_host bug
When get the vm from the host,It shoud skip the vms of which the state is not 'active'.Because the error one can't be migrated. Change-Id: I56c3d9d00f521a909f17f8c63cf9d5a9f5d77144
This commit is contained in:
parent
f1a8fb44b9
commit
618fdc6133
@ -704,7 +704,7 @@ def vms_by_host(nova, host):
|
||||
:rtype: list(str)
|
||||
"""
|
||||
return [str(vm.id) for vm in nova.servers.list()
|
||||
if vm_hostname(vm) == host]
|
||||
if (vm_hostname(vm) == host and str(getattr(vm, 'OS-EXT-STS:vm_state')) == 'active')]
|
||||
|
||||
|
||||
@contract
|
||||
|
Loading…
x
Reference in New Issue
Block a user