Undo some bugfixes

This commit is contained in:
Joshua Boniface 2018-06-12 22:00:23 -04:00
parent 68f6316c8e
commit c16eb86456
2 changed files with 4 additions and 5 deletions

View File

@ -145,7 +145,6 @@ class NodeInstance():
most_memfree = memfree
target_hypervisor = hypervisor
print('{} {}'.format(dom_uuid, target_hypervisor))
if target_hypervisor == None:
ansiiprint.echo('Failed to find migration target for VM "{}"; shutting down'.format(dom_uuid), '', 'e')
transaction = self.zk.transaction()

View File

@ -252,11 +252,11 @@ class VMInstance:
return 0
# VM should be stopped
if running == libvirt.VIR_DOMAIN_RUNNING and self.state == "stop" and self.hypervisor == self.thishypervisor.name and self.dom != None:
if running == libvirt.VIR_DOMAIN_RUNNING and self.state == "stop" and self.hypervisor == self.thishypervisor.name:
self.stop_vm()
# VM should be shut down
elif running == libvirt.VIR_DOMAIN_RUNNING and self.state == "shutdown" and self.hypervisor == self.thishypervisor.name and self.dom != None:
elif running == libvirt.VIR_DOMAIN_RUNNING and self.state == "shutdown" and self.hypervisor == self.thishypervisor.name:
self.shutdown_vm()
# VM should be migrated to this hypervisor
@ -264,11 +264,11 @@ class VMInstance:
self.receive_migrate()
# VM should be migrated away from this hypervisor
elif running == libvirt.VIR_DOMAIN_RUNNING and self.state == "migrate" and self.hypervisor != self.thishypervisor.name and self.dom != None:
elif running == libvirt.VIR_DOMAIN_RUNNING and self.state == "migrate" and self.hypervisor != self.thishypervisor.name:
self.migrate_vm()
# VM should be running but not on this hypervisor
elif running == libvirt.VIR_DOMAIN_RUNNING and self.state != "migrate" and self.hypervisor != self.thishypervisor.name and self.dom != None:
elif running == libvirt.VIR_DOMAIN_RUNNING and self.state != "migrate" and self.hypervisor != self.thishypervisor.name:
self.terminate_vm()
# VM is already running and should be