Browse Source

Merge "Not able to upload volume to image"

Zuul 6 months ago
parent
commit
4ec11e181e

+ 3
- 1
karbor/services/protection/protection_plugins/volume/volume_glance_plugin.py View File

@@ -170,7 +170,9 @@ class ProtectOperation(protection_plugin.Operation):
170 170
             force=True,
171 171
             image_name='temporary_image_of_{0}'.format(temporary_volume.id),
172 172
             container_format="bare",
173
-            disk_format="raw"
173
+            disk_format="raw",
174
+            visibility="private",
175
+            protected=False
174 176
         )
175 177
         image_id = image[1]['os-volume_upload_image']['image_id']
176 178
         is_success = utils.status_poll(

+ 9
- 0
karbor/tests/unit/protection/test_cinder_glance_plugin.py View File

@@ -211,6 +211,15 @@ class VolumeGlanceProtectionPluginTest(base.TestCase):
211 211
 
212 212
         call_hooks(protect_operation, self.checkpoint, resource, self.cntxt,
213 213
                    {})
214
+        self.cinder_client.volumes.upload_to_image.assert_called_with(
215
+            volume=Volume(id='2345', status='available', size=1),
216
+            force=True,
217
+            image_name='temporary_image_of_2345',
218
+            container_format="bare",
219
+            disk_format="raw",
220
+            visibility="private",
221
+            protected=False
222
+        )
214 223
 
215 224
     def test_delete_backup(self):
216 225
         resource = Resource(id="123",

Loading…
Cancel
Save