akrasnov-drv opened a new issue, #10589: URL: https://github.com/apache/cloudstack/issues/10589
### problem Currently (v.4.20.0.0) I see that sparse and fat disk result in the same local disk format/size/type. After digging into it I found the following flow for fat disks: ``` qemu-img create -o preallocation=full -f qcow2 newdisk template_size qemu-img convert -O qcow2 -o preallocation=full -U --image-opts driver=qcow2,file.filename=template_file newdisk qemu-img resize newdisk newsize ``` as a result new disk size is set to newsize, but its actual disk size is just of template_size To be honest I see no reason to do `create` at all, it's overwritten by convert. And to have fat newdisk there should be `--preallocation=full` in resize command too ``` qemu-img resize --preallocation=full newdisk newsize ``` This affects disk performance. In our CI environment CS disk becomes very fragmented, `qemu-img map` shows some 10K entries. Also please consider using preallocated raw disks in place of preallocated qcow Thanks, Alex. ### versions CloudStack 4.20.0.0 Ubuntu 22.04.5 LTS QEMU 1:6.2+dfsg-2ubuntu6.24 libvirt 8.0.0-1ubuntu7.10 ### The steps to reproduce the bug 1. Create VM with large fat disk from small template 2. Check qemu-img info to see virtual size is correct according to 1. but disk size is still of original template ### What to do about it? Add `--preallocation=full` to resize command for fat disk Use raw instead of qcow -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
