From: Vipin Balachandran Date: Mon, 1 Feb 2016 12:10:00 +0000 (-0800) Subject: Improve logging for volume detach X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=5767a138cc31ef2b7f736351905eb8ed6cafa016;p=openstack-build%2Fcinder-build.git Improve logging for volume detach 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 --- diff --git a/cinder/volume/manager.py b/cinder/volume/manager.py index ddeb809b1..c93f0ee74 100644 --- a/cinder/volume/manager.py +++ b/cinder/volume/manager.py @@ -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():