Hey everyone !
We were moving disks from a storage to another and noticed that when they arrive on the new storage, the thin provisioning expanded to full space.
Before, when we had a few VMs, we could use the old method to empty the disks (using dd to fill the disk with zeros and deleting this file afterward), but now we have dozens of huge drives and it's quite long to zero the entire thing then convert it.
We found that the page in the wiki concerning this problem was updated two months ago : https://pve.proxmox.com/wiki/Shrink_Qcow2_Disk_Files
So we tried the "Recommended Solution" but couldn't make it work.
We have :
And even after a reboot, the VM that is supposed to do ~2Go max :
I really don't know what we are missing so any idea is welcome !
Thanks in advance !
We were moving disks from a storage to another and noticed that when they arrive on the new storage, the thin provisioning expanded to full space.
Before, when we had a few VMs, we could use the old method to empty the disks (using dd to fill the disk with zeros and deleting this file afterward), but now we have dozens of huge drives and it's quite long to zero the entire thing then convert it.
We found that the page in the wiki concerning this problem was updated two months ago : https://pve.proxmox.com/wiki/Shrink_Qcow2_Disk_Files
So we tried the "Recommended Solution" but couldn't make it work.
We have :
- A guest host with Debian 8.7.1
- A qcow drive
- A scsi controller with discard enabled
fstrim -av
/: 189,4 GiB (203339558912 bytes) trimmed
/: 189,4 GiB (203339558912 bytes) trimmed
And even after a reboot, the VM that is supposed to do ~2Go max :
df -h
/dev/sda1 191G 1,5G 180G 1% /
udev 10M 0 10M 0% /dev
tmpfs 1,2G 8,3M 1,2G 1% /run
tmpfs 3,0G 0 3,0G 0% /dev/shm
tmpfs 5,0M 0 5,0M 0% /run/lock
tmpfs 3,0G 0 3,0G 0% /sys/fs/cgroup
Is almost 5Go big :/dev/sda1 191G 1,5G 180G 1% /
udev 10M 0 10M 0% /dev
tmpfs 1,2G 8,3M 1,2G 1% /run
tmpfs 3,0G 0 3,0G 0% /dev/shm
tmpfs 5,0M 0 5,0M 0% /run/lock
tmpfs 3,0G 0 3,0G 0% /sys/fs/cgroup
du -h vm-20002-disk-1.qcow2
4,7G vm-20002-disk-1.qcow2
4,7G vm-20002-disk-1.qcow2
I really don't know what we are missing so any idea is welcome !
Thanks in advance !