Tried to migrate volume using openstack cinder driver, It fails with following stack trace:
23-03-01 01:41:22.233 188499 ERROR cinder.volume.drivers.hpe.hpe_3par_common [req-9a148c2c-84ba-4b32-b6ae-b56400195810 38c48571d2a449a4961bab3245931a7d 38bfeb802369419391b14d61bbdb52fe - - -] Changing the migrating volume name from osv-yaFqp-.iPS.U3oE.Jvsj4FA to osv-3NcxHxxxxtttzzzzZYcT6w failed because 'comment'
2023-03-01 01:41:22.264 188499 ERROR cinder.volume.manager [req-9a148c2c-84ba-4b32-b6ae-b56400195810 38c48571d2a449a4961bab3245931a7d 38bfeb802369419391b14d61bbdb52fe - - -] Failed to copy volume ca516ca7-ffa2-492f-94de-813e2468f814 to dcd7311e-d842-4e8a-97df-80e8658713eb: KeyError: 'comment'
2023-03-01 01:41:22.264 188499 ERROR cinder.volume.manager Traceback (most recent call last):
2023-03-01 01:41:22.264 188499 ERROR cinder.volume.manager File "/usr/lib/python3.9/site-packages/cinder/volume/manager.py", line 2395, in _migrate_volume_generic
2023-03-01 01:41:22.264 188499 ERROR cinder.volume.manager self.migrate_volume_completion(ctxt, volume, new_volume,
2023-03-01 01:41:22.264 188499 ERROR cinder.volume.manager File "/usr/lib/python3.9/site-packages/cinder/volume/manager.py", line 2539, in migrate_volume_completion
2023-03-01 01:41:22.264 188499 ERROR cinder.volume.manager self.update_migrated_volume(ctxt, new_volume, volume,
2023-03-01 01:41:22.264 188499 ERROR cinder.volume.manager File "/usr/lib/python3.9/site-packages/powervc_cinder/volume/manager.py", line 2913, in update_migrated_volume
2023-03-01 01:41:22.264 188499 ERROR cinder.volume.manager super(PowerVCVolumeManager, self).update_migrated_volume(
2023-03-01 01:41:22.264 188499 ERROR cinder.volume.manager File "/usr/lib/python3.9/site-packages/cinder/volume/manager.py", line 4623, in update_migrated_volume
2023-03-01 01:41:22.264 188499 ERROR cinder.volume.manager model_update = self.driver.update_migrated_volume(ctxt,
2023-03-01 01:41:22.264 188499 ERROR cinder.volume.manager File "/usr/lib/python3.9/site-packages/cinder/volume/volume_utils.py", line 1473, in trace_logging_wrapper
2023-03-01 01:41:22.264 188499 ERROR cinder.volume.manager return f(*args, **kwargs)
2023-03-01 01:41:22.264 188499 ERROR cinder.volume.manager File "/usr/lib/python3.9/site-packages/cinder/volume/drivers/hpe/hpe_3par_base.py", line 266, in update_migrated_volume
2023-03-01 01:41:22.264 188499 ERROR cinder.volume.manager return self.common.update_migrated_volume(context, volume, new_volume,
2023-03-01 01:41:22.264 188499 ERROR cinder.volume.manager File "/usr/lib/python3.9/site-packages/cinder/volume/drivers/hpe/hpe_3par_common.py", line 2990, in update_migrated_volume
2023-03-01 01:41:22.264 188499 ERROR cinder.volume.manager self._update_comment(current_name, volume_id=volume['id'],
2023-03-01 01:41:22.264 188499 ERROR cinder.volume.manager File "/usr/lib/python3.9/site-packages/cinder/volume/drivers/hpe/hpe_3par_common.py", line 3010, in _update_comment
2023-03-01 01:41:22.264 188499 ERROR cinder.volume.manager comment = self._get_updated_comment(vol_name, **values)
2023-03-01 01:41:22.264 188499 ERROR cinder.volume.manager File "/usr/lib/python3.9/site-packages/cinder/volume/drivers/hpe/hpe_3par_common.py", line 3003, in _get_updated_comment
2023-03-01 01:41:22.264 188499 ERROR cinder.volume.manager comment = json.loads(vol['comment']) if vol['comment'] else {}
2023-03-01 01:41:22.264 188499 ERROR cinder.volume.manager KeyError: 'comment'
2023-03-01 01:41:22.264 188499 ERROR cinder.volume.manager
2023-03-01 01:41:23.382 188499 WARNING py.warnings
Changing :
def _get_updated_ comment( self, vol_name, **values): getVolume( vol_name) vol['comment' ]) if vol['comment'] else {}
comment. update( values)
vol = self.client.
comment = json.loads(
to
def _get_updated_ comment( self, vol_name, **values): getVolume( vol_name) vol['comment' ]) if vol.get('comment') else {}
comment. update( values)
vol = self.client.
comment = json.loads(
resolves the issue.