From 3f25f893244991c5f24760ccf25251127facbebb Mon Sep 17 00:00:00 2001 From: Joshua Boniface Date: Wed, 6 Jun 2018 21:45:03 -0400 Subject: [PATCH] Add additional state - vm should be stopped as it shouldn't run on that node --- VMInstance.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/VMInstance.py b/VMInstance.py index 5129913d..bfbeb3fa 100644 --- a/VMInstance.py +++ b/VMInstance.py @@ -227,6 +227,10 @@ class VMInstance: elif running == libvirt.VIR_DOMAIN_RUNNING and self.state == "migrate" and self.hypervisor != self.thishypervisor.name and self.inmigrate == False: 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: + self.stop_vm() + # VM is already running and should be elif running == libvirt.VIR_DOMAIN_RUNNING and self.state == "start" and self.hypervisor == self.thishypervisor.name: if not self.domuuid in self.thishypervisor.domain_list: