From d0c8f006c6bd14aee3fa04b7b859484069770734 Mon Sep 17 00:00:00 2001 From: Joshua Boniface Date: Mon, 11 Jun 2018 21:30:32 -0400 Subject: [PATCH] Forgot to replace state here --- pvc.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pvc.py b/pvc.py index fbd7f9c1..585fb2d4 100755 --- a/pvc.py +++ b/pvc.py @@ -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'))