Trim for haos VMs on thin provisioned disks

Hey party people, is there some secret way to run fstrim -av for those of us running haos as a VM? I would really like to reclaim the dead space on the storage array and also not have to replicate it off-site as part of my backup strategy.

In shared storage land, specifically in ESXi/VMFS6, the discard command is pushed all the way down the stack, so, VM > Datastore > LUN then the array will free the blocks when it feels like it. If I can believe df -h, I should only be using ~10.3G after moving backups to an NFS share. But the VM is still consuming 277.32G on the array/vmdk as I can not free those blocks.

If I do try to issue a fstrim all I get is the below

[core-ssh ~]$ fstrim -v /backup
fstrim: ioctl 0xc0185879 failed: Operation not permitted
[core-ssh ~]$

Login to your HA host (with the CLI) and enter login. Then run systemctl start fstrim.service to free up space and systemctl status fstrim.service to check the result.

AFAIK the fstrim command is already run weekly.

Well, maybe it was a touch broken? My HA VM had been up for quite a bit.

Much better now, 246.89G saved :tada: