TL;DR: Generally you should research what is trim/discard and is your setup capable of handling it.
Most probably the data discarded by the guest filesystem is not propagated to the storage on the host.
There are several things that should be stacked to achieve space reduction on the storage:
Discards enabled for the VM disks in the VM configuration
Use virtio disk type that support discards. The propagation of the discards for the virtio-block backend (the /dev/vd* disks) is relatively a “new thing” so maybe not yet supported by the packages provided by the OS distribution. The virtio-scsi backend works.
the filesystem in the guest OS should be configured to issue discards to the storage layer
So, you should check/research:
? Are the VM instances having a configuration that support discards?
? Is your storage supporting discard calls?
? Inside the VM(s) - is the filesystem mounted to issue discards to the disks -or- are there periodic discards trggered by a timer?
Hi!
disk must be qcow2 format to support trim
1st you must enable discard on opennebula <qemu:commandline> <qemu:arg value='-set'/> <qemu:arg value='device.virtio-disk0.discard_granularity=512'/> </qemu:commandline>
2nd. check if it is enabled inside vm by running command lsblk -D
if you received something like this - it is enabled NAME DISC-ALN DISC-GRAN DISC-MAX DISC-ZERO vda 0 512B 2G 0
3rd - turn on discard on fs inside VM in file /etc/fstab add discard option. reboot vm.