From fea9ebc68ffa60e732201e36eca84ea26b2e0910 Mon Sep 17 00:00:00 2001 From: Avishay Traeger Date: Tue, 3 Dec 2013 10:47:33 +0200 Subject: [PATCH] Add more logging to migrate_volume_completion Add a debug message on entering the function, and an info message if it was called to clean up an error. This is useful because Nova copies the data of in-use volumes, and if it fails there will only be a message in the Nova logs. Change-Id: I546d0bae8639072727ebe23394885d40255ba1d4 --- cinder/volume/manager.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cinder/volume/manager.py b/cinder/volume/manager.py index fcfd80dc8..97e4e61ac 100644 --- a/cinder/volume/manager.py +++ b/cinder/volume/manager.py @@ -731,11 +731,18 @@ class VolumeManager(manager.SchedulerDependentManager): def migrate_volume_completion(self, ctxt, volume_id, new_volume_id, error=False): + msg = _("migrate_volume_completion: completing migration for " + "volume %(vol1)s (temporary volume %(vol2)s") + LOG.debug(msg % {'vol1': volume_id, 'vol2': new_volume_id}) volume = self.db.volume_get(ctxt, volume_id) new_volume = self.db.volume_get(ctxt, new_volume_id) rpcapi = volume_rpcapi.VolumeAPI() if error: + msg = _("migrate_volume_completion is cleaning up an error " + "for volume %(vol1)s (temporary volume %(vol2)s") + LOG.info(msg % {'vol1': volume['id'], + 'vol2': new_volume['id']}) new_volume['migration_status'] = None rpcapi.delete_volume(ctxt, new_volume) self.db.volume_update(ctxt, volume_id, {'migration_status': None}) -- 2.45.2