From 95ba50581aaacdf2602a5bbf4b7d7105129ffb01 Mon Sep 17 00:00:00 2001 From: Kien Nguyen Date: Fri, 13 Oct 2017 10:36:48 +0700 Subject: [PATCH] Improve attach/detach volume logging Change-Id: I7569624ec1cfa8e47f8758996cd1fa66a99be67c --- zun/compute/manager.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/zun/compute/manager.py b/zun/compute/manager.py index c16e0aa68..a2d80585d 100644 --- a/zun/compute/manager.py +++ b/zun/compute/manager.py @@ -210,6 +210,10 @@ class Manager(periodic_task.PeriodicTasks): self.driver.attach_volume(context, volume) except Exception: with excutils.save_and_reraise_exception(): + LOG.error("Failed to attach volume %(volume_id)s to " + "container %(container_id)s", + {'volume_id': volume.volume_id, + 'container_id': volume.container_uuid}) volume.destroy() def _detach_volumes(self, context, container, reraise=True): @@ -224,8 +228,10 @@ class Manager(periodic_task.PeriodicTasks): self.driver.detach_volume(context, volume) except Exception: with excutils.save_and_reraise_exception(reraise=reraise): - LOG.error("Failed to detach %(volume_id)s", - {'volume_id': volume.volume_id}) + LOG.error("Failed to detach volume %(volume_id)s from " + "container %(container_id)s", + {'volume_id': volume.volume_id, + 'container_id': volume.container_uuid}) volume.destroy() def _use_sandbox(self):