GitHub user akrasnov-drv added a comment to the discussion: Raw local disks for
CS VMs
First of all I see that even if I upload template in raw format, the image used
for deployment on agents is still qcow:
```
qemu-img info -U b4f0f85b-127a-468f-b6ce-842eeaa5dd54
image: b4f0f85b-127a-468f-b6ce-842eeaa5dd54
file format: qcow2
virtual size: 6 GiB (6442450944 bytes)
disk size: 5.14 GiB
cluster_size: 65536
Format specific information:
compat: 1.1
compression type: zlib
lazy refcounts: false
refcount bits: 16
corrupt: false
extended l2: false
```
Then I caught an interesting thing. When I started VM with fat disk, first I
saw disk create command:
`qemu-img create -o preallocation=full -f qcow2
/var/lib/libvirt/images/9028b1ae-334f-47dd-a85c-4fc27da66946 6442450944`
then convert into preallocated file:
`qemu-img convert -O qcow2 -o preallocation=full -U --image-opts
driver=qcow2,file.filename=/var/lib/libvirt/images/b4f0f85b-127a-468f-b6ce-842eeaa5dd54
/var/lib/libvirt/images/9028b1ae-334f-47dd-a85c-4fc27da66946`
and then
`qemu-img resize /var/lib/libvirt/images/9028b1ae-334f-47dd-a85c-4fc27da66946
64424509440`
As you can see there is a logical issue here. It preallocates the size of
original template, but then does resize without allocating disk space for it.
As a result I get large disk in the same small space
```
image: /var/lib/libvirt/images/9028b1ae-334f-47dd-a85c-4fc27da66946
file format: qcow2
virtual size: 60 GiB (64424509440 bytes)
disk size: 6.01 GiB
cluster_size: 65536
Format specific information:
compat: 1.1
compression type: zlib
lazy refcounts: false
refcount bits: 16
corrupt: false
extended l2: false
```
Should I open an issue for it?
GitHub link:
https://github.com/apache/cloudstack/discussions/10579#discussioncomment-12554793
----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: [email protected]