diff --git a/cinder/tests/unit/volume/test_volume_reimage.py b/cinder/tests/unit/volume/test_volume_reimage.py index b37380cc070..6902cd0e77c 100644 --- a/cinder/tests/unit/volume/test_volume_reimage.py +++ b/cinder/tests/unit/volume/test_volume_reimage.py @@ -86,7 +86,7 @@ class VolumeReimageTestCase(base.BaseVolumeTestCase): volume.status = status volume.save() self.assertEqual(volume.status, status) - # The available or error volume can be reimage directly + # The available or error volume can be reimaged directly self.volume_api.reimage(self.context, volume, self.image_meta['id']) mock_check.assert_called_once_with(self.image_meta, volume.size) mock_reimage.assert_called_once_with(self.context, volume, @@ -97,7 +97,7 @@ class VolumeReimageTestCase(base.BaseVolumeTestCase): def test_volume_reimage_api_with_reimage_reserved(self, mock_reimage, mock_check): volume = tests_utils.create_volume(self.context) - # The reserved volume can not be reimage directly, and only can + # The reserved volume can not be reimaged directly, and only can # be reimaged with reimage_reserved flag volume.status = 'reserved' volume.save() @@ -110,7 +110,7 @@ class VolumeReimageTestCase(base.BaseVolumeTestCase): def test_volume_reimage_api_with_invaild_status(self): volume = tests_utils.create_volume(self.context) - # The reserved volume can not be reimage directly, and only can + # The reserved volume can not be reimaged directly, and only can # be reimaged with reimage_reserved flag volume.status = 'reserved' diff --git a/cinder/volume/manager.py b/cinder/volume/manager.py index ee582750c60..3b5bef71791 100644 --- a/cinder/volume/manager.py +++ b/cinder/volume/manager.py @@ -5342,7 +5342,7 @@ class VolumeManager(manager.CleanableManager, for attachment in attachments] nova_api.reimage_volume(context, instance_uuids, volume.id) - LOG.debug("Re-image %(image_id)s" + LOG.debug("Re-imaged %(image_id)s" " to volume %(volume_id)s successfully.", {'image_id': image_id, 'volume_id': volume.id}) except Exception: diff --git a/releasenotes/notes/add-volume-re-image-api-6f02dcefd4975a66.yaml b/releasenotes/notes/add-volume-re-image-api-6f02dcefd4975a66.yaml index 802ef269962..4469c043abc 100644 --- a/releasenotes/notes/add-volume-re-image-api-6f02dcefd4975a66.yaml +++ b/releasenotes/notes/add-volume-re-image-api-6f02dcefd4975a66.yaml @@ -1,22 +1,22 @@ --- features: - | - Add microversion 3.68 to support ability to re-image a volume with a + Add microversion 3.68 to support the ability to re-image a volume with a specific image. Specify the ``os-reimage`` action in the request body. - The 'available' and 'error' volume can be re-imaged directly, and the - 'reserved' volume can only be re-imaged when the `reimage_reserved` - parameter is set to 'true'. When reimaging a volume, the volume state - will be changed to ``downloading`` first. + A volume in ``available`` or ``error`` status can be re-imaged directly. + To re-image a volume in ``reserved`` status, you must include the + ``reimage_reserved`` parameter set to ``true``. When reimaging a volume, + the volume state will be changed to ``downloading`` first. Note that this is a destructive action, that is, all data currently contained in a volume is destroyed when the volume is re-imaged. Two new policies are introduced to govern this functionality: - * ``REIMAGE_POLICY`` - users who satisfy this policy may re-image a volume + * ``volume:reimage`` - users who satisfy this policy may re-image a volume in status ``available`` or ``error`` - * ``REIMAGE_RESERVED_POLICY`` - users who satisfy this policy may re-image + * ``volume:reimage_reserved`` - users who satisfy this policy may re-image a volume in status ``reserved`` The default setting for both policies allow an administrator or the volume @@ -29,9 +29,9 @@ upgrade: Two new policies are introduced to govern the volume reimage functionality introduced with microversion 3.68: - * ``REIMAGE_POLICY`` - users who satisfy this policy may re-image a volume + * ``volume:reimage`` - users who satisfy this policy may re-image a volume in status ``available`` or ``error`` - * ``REIMAGE_RESERVED_POLICY`` - users who satisfy this policy may re-image + * ``volume:reimage_reserved`` - users who satisfy this policy may re-image a volume in status ``reserved`` The default setting for both policies allow an administrator or the volume