summaryrefslogtreecommitdiffstats
path: root/nova/compute
diff options
context:
space:
mode:
authorDan Smith <danms@us.ibm.com>2012-11-05 09:35:24 -0800
committerDan Smith <danms@us.ibm.com>2012-11-05 11:40:39 -0800
commitcfceed71dabfbac538e65bd1d5a95197beb94001 (patch)
tree3b32305181b8065089ede4d791ab893e004f377e /nova/compute
parent10979da33ca790b86976c1909624c1440020abe0 (diff)
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
Diffstat (limited to 'nova/compute')
-rw-r--r--nova/compute/manager.py5
1 files changed, 4 insertions, 1 deletions
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):