]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Improve logging for volume detach
authorVipin Balachandran <vbala@vmware.com>
Mon, 1 Feb 2016 12:10:00 +0000 (04:10 -0800)
committerVipin Balachandran <vbala@vmware.com>
Mon, 1 Feb 2016 12:13:58 +0000 (04:13 -0800)
Currently the volume manager doesn't log the instance ID during
volume detach. This is missing in cinder-api log as well. This
patch adds a log statement to print a message with volume ID and
instance ID before calling driver detach.

Change-Id: I6e765124c4e737e64cff39ec82cb81749bca28ab

cinder/volume/manager.py

index ddeb809b1956beed68755661d99dac958e0150bb..c93f0ee74cb49a85a508b020cb1f16e954dbb78c 100644 (file)
@@ -997,6 +997,11 @@ class VolumeManager(manager.SchedulerDependentManager):
             # and the volume status updated.
             utils.require_driver_initialized(self.driver)
 
+            LOG.debug('Detaching volume %(volume_id)s from instance '
+                      '%(instance)s.',
+                      {'volume_id': volume_id,
+                       'instance': attachment.get('instance_uuid')},
+                      resource=volume)
             self.driver.detach_volume(context, volume, attachment)
         except Exception:
             with excutils.save_and_reraise_exception():