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

Fix creating a preallocated qcow2 disk #292

Closed
aesteve-rh opened this issue Aug 1, 2022 · 1 comment · Fixed by #304
Closed

Fix creating a preallocated qcow2 disk #292

aesteve-rh opened this issue Aug 1, 2022 · 1 comment · Fixed by #304
Assignees
Labels
bug Issue is a bug or fix for a bug storage
Milestone

Comments

@aesteve-rh
Copy link
Member

aesteve-rh commented Aug 1, 2022

Running the command:

$ ./ovirt-img upload-disk -c engine --storage-domain nfs-01 /data/tmp/fedora-34.qcow2 --preallocated

...does not create preallocated file (with qemu-img info):
Virtual Size: 50 GiB
Actual Size: 23 GiB

So, for qcow2 format we don't do preallocation even if engine asked for preallocated format.
Needs investigation. There may be a good reason why we don't preallocate, but it may also be an error.

@aesteve-rh aesteve-rh added bug Issue is a bug or fix for a bug storage labels Aug 1, 2022
@aesteve-rh
Copy link
Member Author

For block storage:

if preallocate == sc.SPARSE_VOL:
...
else:
    # Preallocated qcow2
    alloc_size = initial_size if initial_size else capacity

So upload-disk was (should not in the latest version) requesting a new preallocated qcow2 disk with initial_size 23 GiB, and virtual_size 50 GiB. With this request, Vdsm takes into consideration the initial_size that engine has sent in the request and creates the disk, even for preallocated disks.

For file storage (as in the initial message):

preallocate is not considered at all for COW volumes (?).

aesteve-rh added a commit to aesteve-rh/vdsm that referenced this issue Aug 26, 2022
File volume create calls do not consider
preallocation policy for qcow2 format, which
are thin provisioned regardless.

Vdsm should do as commanded by the engine and
create a preallocated volume, both for raw and
qcow2 volumes.

Fixes: oVirt#292
Signed-off-by: Albert Esteve <aesteve@redhat.com>
aesteve-rh added a commit to aesteve-rh/vdsm that referenced this issue Aug 26, 2022
File volume create calls do not consider
preallocation policy for qcow2 format, which
are thin provisioned regardless.

Vdsm should do as commanded by the engine and
create a preallocated volume, both for raw and
qcow2 volumes.

Fixes: oVirt#292
Signed-off-by: Albert Esteve <aesteve@redhat.com>
aesteve-rh added a commit to aesteve-rh/vdsm that referenced this issue Aug 29, 2022
File volume create calls do not consider
preallocation policy for qcow2 format, which
are thin provisioned regardless.

Vdsm should do as commanded by the engine and
create a preallocated volume, both for raw and
qcow2 volumes.

Fixes: oVirt#292
Signed-off-by: Albert Esteve <aesteve@redhat.com>
aesteve-rh added a commit to aesteve-rh/vdsm that referenced this issue Aug 29, 2022
File volume create calls do not consider
preallocation policy for qcow2 format, which
are thin provisioned regardless.

Vdsm should do as commanded by the engine and
create a preallocated volume, both for raw and
qcow2 volumes.

Fixes: oVirt#292
Signed-off-by: Albert Esteve <aesteve@redhat.com>
aesteve-rh added a commit to aesteve-rh/vdsm that referenced this issue Sep 6, 2022
File volume create calls do not consider
preallocation policy for qcow2 format, which
are thin provisioned regardless.

Vdsm should do as commanded by the engine and
create a preallocated volume, both for raw and
qcow2 volumes.

Fixes: oVirt#292
Signed-off-by: Albert Esteve <aesteve@redhat.com>
aesteve-rh added a commit to aesteve-rh/vdsm that referenced this issue Sep 6, 2022
File volume create calls do not consider
preallocation policy for qcow2 format, which
are thin provisioned regardless.

Vdsm should do as commanded by the engine and
create a preallocated volume, both for raw and
qcow2 volumes.

Fixes: oVirt#292
Signed-off-by: Albert Esteve <aesteve@redhat.com>
aesteve-rh added a commit to aesteve-rh/vdsm that referenced this issue Sep 6, 2022
File volume create calls do not consider
preallocation policy for qcow2 format, which
are thin provisioned regardless.

Vdsm should do as commanded by the engine and
create a preallocated volume, both for raw and
qcow2 volumes.

Fixes: oVirt#292
Signed-off-by: Albert Esteve <aesteve@redhat.com>
aesteve-rh added a commit to aesteve-rh/vdsm that referenced this issue Sep 8, 2022
File volume create calls do not consider
preallocation policy for qcow2 format, which
are thin provisioned regardless.

Vdsm should do as commanded by the engine and
create a preallocated volume, both for raw and
qcow2 volumes.

Fixes: oVirt#292
Signed-off-by: Albert Esteve <aesteve@redhat.com>
aesteve-rh added a commit to aesteve-rh/vdsm that referenced this issue Sep 8, 2022
File volume create calls do not consider
preallocation policy for qcow2 format, which
are thin provisioned regardless.

Vdsm should do as commanded by the engine and
create a preallocated volume, both for raw and
qcow2 volumes.

Fixes: oVirt#292
Signed-off-by: Albert Esteve <aesteve@redhat.com>
@aesteve-rh aesteve-rh self-assigned this Sep 9, 2022
@aesteve-rh aesteve-rh added this to the ovirt-4.5.3 milestone Sep 9, 2022
nirs pushed a commit to aesteve-rh/vdsm that referenced this issue Sep 12, 2022
File volume create calls do not consider
preallocation policy for qcow2 format, which
are thin provisioned regardless.

Vdsm should do as commanded by the engine and
create a preallocated volume, both for raw and
qcow2 volumes.

Fixes: oVirt#292
Signed-off-by: Albert Esteve <aesteve@redhat.com>
@nirs nirs closed this as completed in #304 Sep 12, 2022
nirs pushed a commit that referenced this issue Sep 12, 2022
File volume create calls do not consider
preallocation policy for qcow2 format, which
are thin provisioned regardless.

Vdsm should do as commanded by the engine and
create a preallocated volume, both for raw and
qcow2 volumes.

Fixes: #292
Signed-off-by: Albert Esteve <aesteve@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue is a bug or fix for a bug storage
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant