diff --git a/karbor/services/protection/protection_plugins/volume/volume_glance_plugin.py b/karbor/services/protection/protection_plugins/volume/volume_glance_plugin.py index f04d4860..773a1e50 100644 --- a/karbor/services/protection/protection_plugins/volume/volume_glance_plugin.py +++ b/karbor/services/protection/protection_plugins/volume/volume_glance_plugin.py @@ -170,7 +170,9 @@ class ProtectOperation(protection_plugin.Operation): force=True, image_name='temporary_image_of_{0}'.format(temporary_volume.id), container_format="bare", - disk_format="raw" + disk_format="raw", + visibility="private", + protected=False ) image_id = image[1]['os-volume_upload_image']['image_id'] is_success = utils.status_poll( diff --git a/karbor/tests/unit/protection/test_cinder_glance_plugin.py b/karbor/tests/unit/protection/test_cinder_glance_plugin.py index 433ea6a5..b3613b60 100644 --- a/karbor/tests/unit/protection/test_cinder_glance_plugin.py +++ b/karbor/tests/unit/protection/test_cinder_glance_plugin.py @@ -211,6 +211,15 @@ class VolumeGlanceProtectionPluginTest(base.TestCase): call_hooks(protect_operation, self.checkpoint, resource, self.cntxt, {}) + self.cinder_client.volumes.upload_to_image.assert_called_with( + volume=Volume(id='2345', status='available', size=1), + force=True, + image_name='temporary_image_of_2345', + container_format="bare", + disk_format="raw", + visibility="private", + protected=False + ) def test_delete_backup(self): resource = Resource(id="123",