Add the availability_zone to the volume.usage notifications

The volume.usage notifications are used to enable traffic based billing
on volumes. The availability_zone of the instance is an important piece of
information that can enable more specialized billing of customers.

This makes the volume.usage events consistent with the volume.create.start/end
snapshot.create.start/end, etc. emitted from cinder, which contain the
availability_zone field.

Change-Id: I9b6b03174cd03235d0e6cf01e34a6da13bd9bb70
This commit is contained in:
Michael Kerrin
2013-03-29 10:19:31 +00:00
parent 83f6fc8469
commit 2cf1f39d9e
10 changed files with 105 additions and 15 deletions

View File

@@ -297,6 +297,7 @@ def usage_volume_info(vol_usage):
volume_id=vol_usage['volume_id'],
tenant_id=vol_usage['project_id'],
user_id=vol_usage['user_id'],
availability_zone=vol_usage['availability_zone'],
instance_id=vol_usage['instance_uuid'],
last_refreshed=null_safe_str(last_refreshed_time),
reads=vol_usage['tot_reads'] + vol_usage['curr_reads'],