From a73de83bd13482f33066fc27524a58f194dcbe50 Mon Sep 17 00:00:00 2001 From: Johannes Erdfelt Date: Thu, 20 Sep 2012 22:46:46 +0000 Subject: libvirt: return after soft reboot successfully completes A soft reboot shuts down an instance, waits for the instance to shutdown, then starts the instance and waits for the instance to finish starting. However, instead of returning success, it continues back into the loop and waits for the instance to be shutdown again. That will continue until the soft reboot times out, which is by default 120 seconds. This manifested itself as a unit test that would consistently take 120 seconds to run, but could possibly affect deployed environments by restarting instances that are shutdown shortly after a soft reboot. Change-Id: I012c53343be4b4eb943643903fc47c7fe70a594d --- nova/virt/libvirt/driver.py | 1 + 1 file changed, 1 insertion(+) diff --git a/nova/virt/libvirt/driver.py b/nova/virt/libvirt/driver.py index 41bbd2d22..567ed6ec8 100644 --- a/nova/virt/libvirt/driver.py +++ b/nova/virt/libvirt/driver.py @@ -900,6 +900,7 @@ class LibvirtDriver(driver.ComputeDriver): self._create_domain(domain=dom) timer = utils.LoopingCall(self._wait_for_running, instance) timer.start(interval=0.5).wait() + return True greenthread.sleep(1) return False -- cgit