Add restrictions against doing this during migrate

This commit is contained in:
Joshua Boniface 2018-06-11 16:49:46 -04:00
parent 1e4aadc989
commit 7ac3e97daf
1 changed files with 2 additions and 2 deletions

View File

@ -257,11 +257,11 @@ class VMInstance:
self.receive_migrate() self.receive_migrate()
# VM should be migrated away from this hypervisor # VM should be migrated away from this hypervisor
elif running == libvirt.VIR_DOMAIN_RUNNING and self.state == "migrate" and self.hypervisor != self.thishypervisor.name and self.inmigrate == False: elif running == libvirt.VIR_DOMAIN_RUNNING and self.state == "migrate" and self.hypervisor != self.thishypervisor.name and self.inmigrate == False and self.inreceive == False:
self.migrate_vm() self.migrate_vm()
# VM should be running but not on this hypervisor # 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 == "start" and self.hypervisor != self.thishypervisor.name and self.inmigrate == False and self.inreceive == False:
self.terminate_vm() self.terminate_vm()
# VM is already running and should be # VM is already running and should be