From f9af787ddd24869431785d6326c5f083336bfbe4 Mon Sep 17 00:00:00 2001 From: Joshua Boniface Date: Mon, 11 Jun 2018 18:41:32 -0400 Subject: [PATCH] Fix another weird corner case --- VMInstance.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/VMInstance.py b/VMInstance.py index ca920a9a..3cea3e30 100644 --- a/VMInstance.py +++ b/VMInstance.py @@ -277,6 +277,12 @@ class VMInstance: if not self.domuuid in self.thishypervisor.domain_list: self.thishypervisor.domain_list.append(self.domuuid) + # VM is already running and should be but stuck in migrate state + elif running == libvirt.VIR_DOMAIN_RUNNING and self.state == "migrate" and self.hypervisor == self.thishypervisor.name: + self.zk.set('/domains/{}/state'.format(self.domuuid), 'start'.encode('ascii')) + if not self.domuuid in self.thishypervisor.domain_list: + self.thishypervisor.domain_list.append(self.domuuid) + # VM should be started elif running != libvirt.VIR_DOMAIN_RUNNING and self.state == "start" and self.hypervisor == self.thishypervisor.name and self.instart == False: # Grab the domain information from Zookeeper