@@ -905,6 +905,8 @@ def _snapshot(self, snap_type, cbtlog=None, cbt_consistency=None, is_mirror_dest
905905 leaf_vdi .utilisation = self .utilisation
906906 leaf_vdi .sm_config = {}
907907 leaf_vdi .sm_config ['vhd-parent' ] = dstparent
908+ # TODO: fix the raw snapshot case
909+ leaf_vdi .sm_config ["image-format" ] = getImageStringFromVdiType (self .vdi_type )
908910 # If the parent is encrypted set the key_hash
909911 # for the new snapshot disk
910912 vdi_ref = self .sr .srcmd .params ['vdi_ref' ]
@@ -925,6 +927,8 @@ def _snapshot(self, snap_type, cbtlog=None, cbt_consistency=None, is_mirror_dest
925927 base_vdi .size = self .size
926928 base_vdi .utilisation = self .utilisation
927929 base_vdi .sm_config = {}
930+ # TODO: fix the raw snapshot case
931+ base_vdi .sm_config ["image-format" ] = getImageStringFromVdiType (self .vdi_type )
928932 grandparent = self .cowutil .getParent (newsrc , FileVDI .extractUuid )
929933 if grandparent :
930934 base_vdi .sm_config ['vhd-parent' ] = grandparent
@@ -942,6 +946,8 @@ def _snapshot(self, snap_type, cbtlog=None, cbt_consistency=None, is_mirror_dest
942946 vdi_ref = self .sr .srcmd .params ['vdi_ref' ]
943947 sm_config = self .session .xenapi .VDI .get_sm_config (vdi_ref )
944948 sm_config ['vhd-parent' ] = srcparent
949+ # TODO: fix the raw snapshot case
950+ sm_config ["image-format" ] = getImageStringFromVdiType (self .vdi_type )
945951 self .session .xenapi .VDI .set_sm_config (vdi_ref , sm_config )
946952 except Exception as e :
947953 util .SMlog ("vdi_clone: caught error during VDI.db_introduce: %s" % (str (e )))
0 commit comments