From: Avishay Traeger Date: Tue, 3 Dec 2013 08:47:33 +0000 (+0200) Subject: Add more logging to migrate_volume_completion X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=fea9ebc68ffa60e732201e36eca84ea26b2e0910;p=openstack-build%2Fcinder-build.git 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 --- 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})