From e4a65230a1b428bf81e8637a72621b75c87f1542 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Tue, 15 Jun 2021 02:32:14 -0400 Subject: [PATCH] Just do the shutdown command itself --- node-daemon/pvcnoded/VMInstance.py | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/node-daemon/pvcnoded/VMInstance.py b/node-daemon/pvcnoded/VMInstance.py index e00f967e..634f72dd 100644 --- a/node-daemon/pvcnoded/VMInstance.py +++ b/node-daemon/pvcnoded/VMInstance.py @@ -528,23 +528,7 @@ class VMInstance(object): def migrate_shutdown(): self.logger.out('Shutting down VM for offline migration', state='i', prefix='Domain {}'.format(self.domuuid)) - self.zkhandler.write([ - (('domain.state', self.domuuid), 'shutdown') - ]) - - ticks = 0 - while self.zkhandler.read(('domain.state', self.domuuid)) != 'stop': - ticks += 1 - if ticks > self.config['vm_shutdown_timeout'] * 2: - # We've hit the timeout, forcibly stop the VM and continue - self.zkhandler.write([ - (('domain.state', self.domuuid), 'stop') - ]) - # Wait 1/2 of a second for the state propagation - time.sleep(0.5) - break - time.sleep(0.5) - + self.shutdown_vm() return True do_migrate_shutdown = False