diff --git a/drivers/FileSR.py b/drivers/FileSR.py index f54c7d1ad..60e0f09ca 100755 --- a/drivers/FileSR.py +++ b/drivers/FileSR.py @@ -905,6 +905,8 @@ def _snapshot(self, snap_type, cbtlog=None, cbt_consistency=None, is_mirror_dest leaf_vdi.utilisation = self.utilisation leaf_vdi.sm_config = {} leaf_vdi.sm_config['vhd-parent'] = dstparent + # TODO: fix the raw snapshot case + leaf_vdi.sm_config["image-format"] = getImageStringFromVdiType(self.vdi_type) # If the parent is encrypted set the key_hash # for the new snapshot disk 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 base_vdi.size = self.size base_vdi.utilisation = self.utilisation base_vdi.sm_config = {} + # TODO: fix the raw snapshot case + base_vdi.sm_config["image-format"] = getImageStringFromVdiType(self.vdi_type) grandparent = self.cowutil.getParent(newsrc, FileVDI.extractUuid) if grandparent: base_vdi.sm_config['vhd-parent'] = grandparent @@ -942,6 +946,8 @@ def _snapshot(self, snap_type, cbtlog=None, cbt_consistency=None, is_mirror_dest vdi_ref = self.sr.srcmd.params['vdi_ref'] sm_config = self.session.xenapi.VDI.get_sm_config(vdi_ref) sm_config['vhd-parent'] = srcparent + # TODO: fix the raw snapshot case + sm_config["image-format"] = getImageStringFromVdiType(self.vdi_type) self.session.xenapi.VDI.set_sm_config(vdi_ref, sm_config) except Exception as e: util.SMlog("vdi_clone: caught error during VDI.db_introduce: %s" % (str(e))) diff --git a/drivers/LVMSR.py b/drivers/LVMSR.py index 9d65080e3..5e60f53e6 100755 --- a/drivers/LVMSR.py +++ b/drivers/LVMSR.py @@ -1894,6 +1894,8 @@ def _createSnap(self, snapUuid, snapVdiType, snapSizeLV, isNew, is_mirror_destin snapVDI.sm_config[key] = val snapVDI.sm_config["vdi_type"] = snapVdiType snapVDI.sm_config["vhd-parent"] = snapParent + # TODO: fix the raw snapshot case + snapVDI.sm_config["image-format"] = getImageStringFromVdiType(self.vdi_type) snapVDI.lvname = snapLV return snapVDI