Skip to content

Commit 7a444fe

Browse files
authored
CA-412420: Set vdi-type When Create snapshot on SMAPIv3 SR (#6596)
During the SMAPIv3 migration prepare step, it will create the VDI on the destination based on the source. The source retrieves vdi_info via `copy_into_sr` → `find_vdi` → `SR.scan2` → `sr_scan2_impl` → `COWVolume.ls`, and `sr_ls` extracts all vdi_info from the database. However, when creating a snapshot with `COWVolume.snapshot` on V3, the vdi-type is not stored in the database, which causes getting an empty vdi-type and the migration prepare step to fail and result the folllowing error: `\'INTERNAL_ERROR\', \'Failure("Unknown tag/contents")\']]);S()]]]))]))]))])` This change adds a step to set vdi-type from the original VDI to the snapshot VDI to prevent this issue.
2 parents c185101 + 1a4a339 commit 7a444fe

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

ocaml/xapi-storage-script/main.ml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1447,6 +1447,9 @@ module VDIImpl (M : META) = struct
14471447
set ~dbg ~sr ~vdi:response.Xapi_storage.Control.key
14481448
~key:_vdi_content_id_key ~value:vdi_info.content_id
14491449
>>>= fun () ->
1450+
set ~dbg ~sr ~vdi:response.Xapi_storage.Control.key
1451+
~key:_vdi_type_key ~value:vdi_info.ty
1452+
>>>= fun () ->
14501453
let response =
14511454
{
14521455
(vdi_of_volume response) with

0 commit comments

Comments
 (0)