From 5767a138cc31ef2b7f736351905eb8ed6cafa016 Mon Sep 17 00:00:00 2001 From: Vipin Balachandran Date: Mon, 1 Feb 2016 04:10:00 -0800 Subject: [PATCH] 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 --- cinder/volume/manager.py | 5 +++++ 1 file changed, 5 insertions(+) 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(): -- 2.45.2