From cfceed71dabfbac538e65bd1d5a95197beb94001 Mon Sep 17 00:00:00 2001 From: Dan Smith Date: Mon, 5 Nov 2012 09:35:24 -0800 Subject: Look up stuck-in-rebooting instances in manager The poll_rebooting_instances() method for a virt driver can be called periodically from the manager to handle instances that may be stuck in a rebooting state. The only information passed to the virt driver is the configured timeout, which means any driver implementing this will have to do the same database query: db.instance_get_all_hung_un_rebooting (..., timeout). This patch makes the manager do this before calling the virt driver, passing the appropriate set of instances, which avoids the need for the driver to make that call. Related to bp/no-db-compute Change-Id: I152cb8cd9a107f2d2b1df39401ab7bbe7ff366f1 --- nova/compute/manager.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'nova/compute') diff --git a/nova/compute/manager.py b/nova/compute/manager.py index 39c3faddf..74304a038 100644 --- a/nova/compute/manager.py +++ b/nova/compute/manager.py @@ -2667,7 +2667,10 @@ class ComputeManager(manager.SchedulerDependentManager): @manager.periodic_task def _poll_rebooting_instances(self, context): if FLAGS.reboot_timeout > 0: - self.driver.poll_rebooting_instances(FLAGS.reboot_timeout) + instances = self.db.instance_get_all_hung_in_rebooting( + context, FLAGS.reboot_timeout) + self.driver.poll_rebooting_instances(FLAGS.reboot_timeout, + instances) @manager.periodic_task def _poll_rescued_instances(self, context): -- cgit