Skip to content

Commit

Permalink
ISO images by default are uploaded as Raw/Thin Provision. And if you …
Browse files Browse the repository at this point in the history
…later move such disk to a block storage (FC/iSCSI) then it will be converted to Cow/Thin Provision. And this might corrupt the disk. To avoid this issue we suggested to always upload ISO images as Raw/Preallocated. In this case no conversion needed while moving to a block storage. And disk works fine in both types (block and non-block) storages.

Signed-off-by: Stepan Ermakov <sermakov@orionsoft.ru>
  • Loading branch information
sermakov-orion committed Sep 25, 2024
1 parent 7d868bf commit 6ed3a7e
Showing 1 changed file with 13 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import org.ovirt.engine.core.common.businessentities.storage.TransferClientType;
import org.ovirt.engine.core.common.businessentities.storage.TransferType;
import org.ovirt.engine.core.common.businessentities.storage.VolumeFormat;
import org.ovirt.engine.core.common.businessentities.storage.VolumeType;
import org.ovirt.engine.core.compat.Guid;
import org.ovirt.engine.core.compat.StringHelper;
import org.ovirt.engine.ui.frontend.Frontend;
Expand Down Expand Up @@ -330,12 +331,18 @@ public boolean flush() {
DiskImage diskImage = (DiskImage) getDiskModel().getDisk();
diskImage.setSize(getVirtualSize());
diskImage.setActualSizeInBytes(imageInfoModel.getActualSize());
diskImage.setVolumeFormat(diskModel.getIsIncrementalBackup().getEntity() ?
VolumeFormat.COW : getImageInfoModel().getFormat());
diskImage.setVolumeType(AsyncDataProvider.getInstance().getVolumeType(
diskImage.getVolumeFormat(),
getDiskModel().getStorageDomain().getSelectedItem().getStorageType(), null, null));
diskImage.setContentType(getImageInfoModel().getContentType());
VolumeFormat volumeFormat = diskModel.getIsIncrementalBackup().getEntity() ?
VolumeFormat.COW : getImageInfoModel().getFormat();
diskImage.setVolumeFormat(volumeFormat);
DiskContentType contentType = getImageInfoModel().getContentType();
if (volumeFormat != VolumeFormat.COW && contentType == DiskContentType.ISO) {
diskImage.setVolumeType(VolumeType.Preallocated);
} else {
diskImage.setVolumeType(AsyncDataProvider.getInstance().getVolumeType(
volumeFormat,
getDiskModel().getStorageDomain().getSelectedItem().getStorageType(), null, null));
}
diskImage.setContentType(contentType);
return true;
} else {
setIsValid(false);
Expand Down

0 comments on commit 6ed3a7e

Please sign in to comment.