Run VM state actions in a thread
Prevents blocking the main thread(s) while a VM is changing state. In particular, this caused some issues with nodes not responding to cancellation/reversal of a flush/ready state until the previous migration was finished, which could cause issues. This entire subset of actions is now threaded and so can run on its own in the background.
This commit is contained in:
parent
b3483fa810
commit
20ae2186f9
|
@ -133,7 +133,9 @@ class VMInstance(object):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
# Perform a management command
|
# Perform a management command
|
||||||
self.manage_vm_state()
|
self.logger.out('Updating state of VM {}'.format(self.domuuid), state='i')
|
||||||
|
state_thread = threading.Thread(target=self.manage_vm_state, args=(), kwargs={})
|
||||||
|
state_thread.start()
|
||||||
|
|
||||||
# Get data functions
|
# Get data functions
|
||||||
def getstate(self):
|
def getstate(self):
|
||||||
|
|
Loading…
Reference in New Issue