Tweak the delays slightly on receive

This commit is contained in:
Joshua Boniface 2020-10-20 15:38:07 -04:00
parent 7cb0241a12
commit 70f3fdbfb9
1 changed files with 5 additions and 2 deletions

View File

@ -514,17 +514,20 @@ class VMInstance(object):
if self.node == self.lastnode: if self.node == self.lastnode:
return return
# Slight delay before firing
time.sleep(0.2)
# Wait for any in-progress migrations # Wait for any in-progress migrations
if zkhandler.readdata(self.zk_conn, '/locks/domain_migrate') != '': if zkhandler.readdata(self.zk_conn, '/locks/domain_migrate') != '':
self.logger.out('Queueing for completion of existing migration', state='i', prefix='Domain {}'.format(self.domuuid)) self.logger.out('Queueing for completion of existing migration', state='i', prefix='Domain {}'.format(self.domuuid))
while zkhandler.readdata(self.zk_conn, '/locks/domain_migrate') != '': while zkhandler.readdata(self.zk_conn, '/locks/domain_migrate') != '':
time.sleep(0.1) time.sleep(0.1)
time.sleep(0.5) time.sleep(0.3)
self.inreceive = True self.inreceive = True
live_receive = True live_receive = True
self.logger.out('Migrating VM to node "{}"'.format(self.node), state='i', prefix='Domain {}'.format(self.domuuid)) self.logger.out('Receiving VM migration from node "{}"'.format(self.node), state='i', prefix='Domain {}'.format(self.domuuid))
# Ensure our lock key is populated # Ensure our lock key is populated
zkhandler.writedata(self.zk_conn, { '/locks/domain_migrate': self.domuuid }) zkhandler.writedata(self.zk_conn, { '/locks/domain_migrate': self.domuuid })