]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Send notifications when extending volume
authorMathieu Gagné <mgagne@iweb.com>
Sat, 31 Aug 2013 02:30:56 +0000 (22:30 -0400)
committerMathieu Gagné <mgagne@iweb.com>
Tue, 3 Sep 2013 14:39:55 +0000 (10:39 -0400)
- Send resize.start when volume extension begins.
- Send resize.end with new size when volume extension ends.

Fixes: bug #1219106
Change-Id: I729da1604668080ec1a5d096df211aa55913dc48

cinder/volume/manager.py

index 4dea45a4f6eca4c61e90586426b0f895726b59ea..b48887ba79e7e5680cc3026e6463a7d50b35b6d0 100644 (file)
@@ -795,6 +795,7 @@ class VolumeManager(manager.SchedulerDependentManager):
                                  'd_quota': quotas['gigabytes']})
             return
 
+        self._notify_about_volume_usage(context, volume, "resize.start")
         try:
             LOG.info(_("volume %s: extending"), volume['id'])
             self.driver.extend_volume(volume, new_size)
@@ -812,3 +813,6 @@ class VolumeManager(manager.SchedulerDependentManager):
         QUOTAS.commit(context, reservations)
         self.db.volume_update(context, volume['id'], {'size': int(new_size),
                                                       'status': 'available'})
+        self._notify_about_volume_usage(
+            context, volume, "resize.end",
+            extra_usage_info={'size': int(new_size)})