Solved Trim unused blocks on qcow2 thin provisiones virtual machine

Martin Garcia

New Member


Messages: 19

#1
Hello again,
I'm new to FreeBSD
Currently I have some FreeBSD (ZFS) VMs running great on KVM.
This VMs were virt-sparsified or thin-provisioned, however, in time, there were some GB files in and out

###This is the current size of my FreeBSD VM
Code:
-rw-r--r--  1 root root 425G jul 24 00:56 SPARSE-WEB02.qcow2
### This is the actual use of the vm
Code:
root@WEB02:~ # df -h
Filesystem            Size    Used   Avail Capacity  Mounted on
zroot/ROOT/default    954G     71G    884G     7%    /
root@WEB02:~ # df -h
Filesystem            Size    Used   Avail Capacity  Mounted on
zroot/ROOT/default    954G     71G    884G     7%    /
 trim
I'm looking for a way to reclaim this unused blocks, as in Linux there is a fstrim which trim all the unused blocks to return to the hypervisor. I didn't found something similar for ZFS/FreeBSD.

As an additional information, my VM is using virtio-SCSI driver and it has the discard option in the libvirt conf, without luck
Code:
      <driver name='qemu' type='qcow2" discard='unmap'/>
Thanks in advance for the help,

Martin
 
Top