Closed aesteve-rh closed 2 years ago
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.
preallocate
is not considered at all for COW volumes (?).
Running the command:
...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.