The size of Virtualization Station’s .img file grows dynamically when we put data inside the VM, but never shrinks when we delete data from the VM. It saves a lot of storage space (and money) if it provides some manual or automatic way to compact .img file to release some space.
Upstream QEMU now provides an option discard=unmap to pass discard request from the guest OS to the filesystem. When the guest OS sends discard request to the virtual block device, the driver will deallocate the region of file from the sparse image file, returning space to our disks. See references:
- Discard (TRIM) with KVM Virtual Machines | Chris Irwin
- Recover Space From VM Disk Images By Using Discard/FSTRIM -
It will be good if QNAP exposes that feature through the GUI. At least, we should have a “compact” button like we have on VMWare Workstation Pro.