Some more debug and a little fix to the terminate check

This commit is contained in:
2018-06-11 22:05:36 -04:00
parent f843f294c9
commit 069696dbd4
2 changed files with 4 additions and 2 deletions

View File

@ -250,6 +250,7 @@ class VMInstance:
print('got there')
print(running)
# VM should be stopped
if running == libvirt.VIR_DOMAIN_RUNNING and self.state == "stop" and self.hypervisor == self.thishypervisor.name:
self.stop_vm()
@ -267,7 +268,7 @@ class VMInstance:
self.migrate_vm()
# VM should be running but not on this hypervisor
elif running == libvirt.VIR_DOMAIN_RUNNING and self.state == "start" and self.hypervisor != self.thishypervisor.name:
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