Destination Host of VM during migration now notify Source host of exact socket path

This commit is contained in:
ahmadbilalkhalid 2019-12-29 23:48:04 +05:00
commit 29e938dc74
4 changed files with 17 additions and 8 deletions

View file

@ -42,12 +42,11 @@ class VMQMPHandles:
class TransferVM(Process):
def __init__(self, src_uuid, dest_uuid, host, socket_dir):
def __init__(self, src_uuid, dest_sock_path, host, socket_dir):
self.src_uuid = src_uuid
self.dest_uuid = dest_uuid
self.host = host
self.src_sock_path = os.path.join(socket_dir, self.src_uuid)
self.dest_sock_path = os.path.join(socket_dir, self.dest_uuid)
self.dest_sock_path = dest_sock_path
super().__init__()
@ -203,6 +202,12 @@ class VMM:
return output['return']['service']
return None
def transfer(self, src_uuid, dest_uuid, host):
p = TransferVM(src_uuid, dest_uuid, socket_dir=self.socket_dir, host=host)
def transfer(self, src_uuid, destination_sock_path, host):
p = TransferVM(src_uuid, destination_sock_path, socket_dir=self.socket_dir, host=host)
p.start()
# TODO: the following method should clean things that went wrong
# e.g If VM migration fails or didn't start for long time
# i.e 15 minutes we should stop the waiting VM.
def maintenace(self):
pass