diff options
| author | Dan Smith <danms@us.ibm.com> | 2013-01-04 09:01:29 -0800 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2013-01-05 03:26:30 +0000 |
| commit | ba2a0565a6451ee3227b6e11bbdd8ea75cbf1fc3 (patch) | |
| tree | 1fb950f9c010e317bff621da557ca39d9219cd76 /nova/compute | |
| parent | 6323c80323d01e042558bd78e74c5d6da66a1e17 (diff) | |
| download | nova-ba2a0565a6451ee3227b6e11bbdd8ea75cbf1fc3.tar.gz nova-ba2a0565a6451ee3227b6e11bbdd8ea75cbf1fc3.tar.xz nova-ba2a0565a6451ee3227b6e11bbdd8ea75cbf1fc3.zip | |
Move vol_usage methods to conductor
This patch moves the compute/manager's use of the following methods
to conductor:
- vol_usage_update()
- vol_get_usage_by_time()
Related to blueprint no-db-compute-manager
Change-Id: I51a30d66be51eb532cb19c8b06b87ad07387dd54
Diffstat (limited to 'nova/compute')
| -rw-r--r-- | nova/compute/manager.py | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/nova/compute/manager.py b/nova/compute/manager.py index f01fa265b..588e437f9 100644 --- a/nova/compute/manager.py +++ b/nova/compute/manager.py @@ -2430,9 +2430,11 @@ class ComputeManager(manager.SchedulerDependentManager): if vol_stats: LOG.debug(_("Updating volume usage cache with totals")) rd_req, rd_bytes, wr_req, wr_bytes, flush_ops = vol_stats - self.db.vol_usage_update(context, volume_id, rd_req, rd_bytes, - wr_req, wr_bytes, instance['id'], - update_totals=True) + self.conductor_api.vol_usage_update(context, volume_id, + rd_req, rd_bytes, + wr_req, wr_bytes, + instance, + update_totals=True) self._detach_volume(context, instance, bdm) volume = self.volume_api.get(context, volume_id) @@ -3056,11 +3058,13 @@ class ComputeManager(manager.SchedulerDependentManager): for usage in vol_usages: # Allow switching of greenthreads between queries. greenthread.sleep(0) - self.db.vol_usage_update(context, usage['volume'], usage['rd_req'], - usage['rd_bytes'], usage['wr_req'], - usage['wr_bytes'], - usage['instance']['uuid'], - last_refreshed=refreshed) + self.conductor_api.vol_usage_update(context, usage['volume'], + usage['rd_req'], + usage['rd_bytes'], + usage['wr_req'], + usage['wr_bytes'], + usage['instance'], + last_refreshed=refreshed) def _send_volume_usage_notifications(self, context, start_time): """Queries vol usage cache table and sends a vol usage notification""" @@ -3068,7 +3072,8 @@ class ComputeManager(manager.SchedulerDependentManager): # the last run of get_all_volume_usage and this one # but detach stats will be recorded in db and returned from # vol_get_usage_by_time - vol_usages = self.db.vol_get_usage_by_time(context, start_time) + vol_usages = self.conductor_api.vol_get_usage_by_time(context, + start_time) for vol_usage in vol_usages: notifier.notify(context, 'volume.%s' % self.host, 'volume.usage', notifier.INFO, |
