diff --git a/NodeInstance.py b/NodeInstance.py index 9f7109fc..16f1761c 100644 --- a/NodeInstance.py +++ b/NodeInstance.py @@ -117,7 +117,7 @@ class NodeInstance(): def flush(self): self.inflush = True ansiiprint.echo('Flushing node "{}" of running VMs'.format(self.name), '', 'i') - self.zk.set('/nodes/{}/domainstate'.format(self.name), 'flushed'.encode('ascii')) + ansiiprint.echo('Domain list: ' + ', '.join(self.domain_list), '', 'i') for dom_uuid in self.domain_list: most_memfree = 0 target_hypervisor = None @@ -157,6 +157,7 @@ class NodeInstance(): # Wait 2s between migrations time.sleep(2) + self.zk.set('/nodes/{}/domainstate'.format(self.name), 'flushed'.encode('ascii')) self.inflush = False def unflush(self): diff --git a/VMInstance.py b/VMInstance.py index 605a1abc..d0d05587 100644 --- a/VMInstance.py +++ b/VMInstance.py @@ -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