Add way out of receive migration

This commit is contained in:
Joshua Boniface 2018-06-11 02:03:23 -04:00
parent 0dfae84be7
commit 236d472008
1 changed files with 9 additions and 5 deletions

View File

@ -210,14 +210,18 @@ class VMInstance:
time.sleep(0.2) time.sleep(0.2)
continue continue
if self.dom.state()[0] == libvirt.VIR_DOMAIN_RUNNING: if self.dom.state()[0] == libvirt.VIR_DOMAIN_RUNNING or self.state != 'migrate':
break break
self.zk.set('/domains/{}/state'.format(self.domuuid), 'start'.encode('ascii')) if self.dom.state()[0] == libvirt.VIR_DOMAIN_RUNNING:
if not self.domuuid in self.thishypervisor.domain_list: self.zk.set('/domains/{}/state'.format(self.domuuid), 'start'.encode('ascii'))
self.thishypervisor.domain_list.append(self.domuuid) if not self.domuuid in self.thishypervisor.domain_list:
self.thishypervisor.domain_list.append(self.domuuid)
ansiiprint.echo('Successfully migrated VM', '{}:'.format(self.domuuid), 'o')
else:
ansiiprint.echo('Failed to receive migrated VM', '{}:'.format(self.domuuid), 'e')
ansiiprint.echo('Successfully migrated VM', '{}:'.format(self.domuuid), 'o')
self.inreceive = False self.inreceive = False
# #