Forgot to replace state here

This commit is contained in:
Joshua Boniface 2018-06-11 21:30:32 -04:00
parent bed701ac38
commit d0c8f006c6
1 changed files with 3 additions and 2 deletions

5
pvc.py
View File

@ -637,8 +637,9 @@ def migrate_vm(dom_name, dom_uuid, target_hypervisor, force_migrate):
hypervisor_list = zk.get_children('/nodes')
most_memfree = 0
for hypervisor in hypervisor_list:
state = zk.get('/nodes/{}/state'.format(hypervisor))[0].decode('ascii')
if state != 'start' or hypervisor == current_hypervisor:
daemon_state = zk.get('/nodes/{}/daemonstate'.format(hypervisor))[0].decode('ascii')
domain_state = zk.get('/nodes/{}/domainstate'.format(hypervisor))[0].decode('ascii')
if daemon_state != 'start' or domain_state != 'ready' or hypervisor == current_hypervisor:
continue
memfree = int(zk.get('/nodes/{}/memfree'.format(hypervisor))[0].decode('ascii'))