Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ISO images by default are uploaded as Raw/Thin Provision. And if you … #963

Merged

Conversation

sermakov-orion
Copy link
Contributor

@sermakov-orion sermakov-orion commented Sep 25, 2024

ISO images by default are uploaded as Raw/Thin Provision. And if you 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.

Are you the owner of the code you are sending in, or do you have permission of the owner?

y

Copy link
Member

@sandrobonazzola sandrobonazzola left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This branch has conflicts that must be resolved

@sermakov-orion
Copy link
Contributor Author

@sandrobonazzola
The conflicts were resolved. The branch is up to date now

@sandrobonazzola sandrobonazzola requested review from sandrobonazzola and removed request for sgratch October 4, 2024 12:12
Copy link
Member

@dupondje dupondje left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can be rewritten more shortly.

VolumeFormat.COW : getImageInfoModel().getFormat();
diskImage.setVolumeFormat(volumeFormat);
DiskContentType contentType = getImageInfoModel().getContentType();
if (volumeFormat != VolumeFormat.COW && contentType == DiskContentType.ISO) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can just add the additional if:

if (diskImage.getVolumeFormat() != VolumeFormat.COW && getImageInfoModel().getContentType() == DiskContentType.ISO) {
                diskImage.setVolumeType(VolumeType.Preallocated);
            }

And skip the other changes :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dupondje Thanks for the suggestion.
I applied the changes (with additional comments).
Could you please review once more?
Thanks in advance.

…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>
@sandrobonazzola sandrobonazzola added this to the ovirt-4.5.7 milestone Oct 24, 2024
@sandrobonazzola sandrobonazzola merged commit 15bc8eb into oVirt:master Oct 24, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants