summaryrefslogtreecommitdiffstats
path: root/nova/compute
diff options
context:
space:
mode:
authorSandy Walsh <sandy.walsh@rackspace.com>2011-05-06 07:19:57 -0700
committerSandy Walsh <sandy.walsh@rackspace.com>2011-05-06 07:19:57 -0700
commitfa9eeb65533d897f6e81067986dc614582fb310a (patch)
tree645e126202d5e18d343298e4949aedf39c9d09da /nova/compute
parent114a55d0243f79db7ea1ef29830a9428dbf1aa33 (diff)
grabbed from dist-sched branch
Diffstat (limited to 'nova/compute')
-rw-r--r--nova/compute/manager.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/nova/compute/manager.py b/nova/compute/manager.py
index 1ff78007b..473f93170 100644
--- a/nova/compute/manager.py
+++ b/nova/compute/manager.py
@@ -1083,6 +1083,13 @@ class ComputeManager(manager.SchedulerDependentManager):
error_list.append(ex)
try:
+ self._report_driver_status()
+ except Exception as ex:
+ LOG.warning(_("Error during report_driver_status(): %s"),
+ unicode(ex))
+ error_list.append(ex)
+
+ try:
self._poll_instance_states(context)
except Exception as ex:
LOG.warning(_("Error during instance poll: %s"),
@@ -1091,6 +1098,16 @@ class ComputeManager(manager.SchedulerDependentManager):
return error_list
+ def _report_driver_status(self):
+ curr_time = time.time()
+ if curr_time - self._last_host_check > FLAGS.host_state_interval:
+ self._last_host_check = curr_time
+ LOG.info(_("Updating host status"))
+ # This will grab info about the host and queue it
+ # to be sent to the Schedulers.
+ self.update_service_capabilities(
+ self.driver.get_host_stats(refresh=True))
+
def _poll_instance_states(self, context):
vm_instances = self.driver.list_instances_detail()
vm_instances = dict((vm.name, vm) for vm in vm_instances)