Fix another weird corner case

This commit is contained in:
Joshua Boniface 2018-06-11 18:41:32 -04:00
parent 4456d494ee
commit f9af787ddd
1 changed files with 6 additions and 0 deletions

View File

@ -277,6 +277,12 @@ class VMInstance:
if not self.domuuid in self.thishypervisor.domain_list: if not self.domuuid in self.thishypervisor.domain_list:
self.thishypervisor.domain_list.append(self.domuuid) 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 # VM should be started
elif running != libvirt.VIR_DOMAIN_RUNNING and self.state == "start" and self.hypervisor == self.thishypervisor.name and self.instart == False: 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 # Grab the domain information from Zookeeper