Is qemu guest agent required to TRIM thin provisioned storage?

alyarb

Well-Known Member
Feb 11, 2020
140
25
48
37
I have a 15GB pfSense machine that has about 1 GB used on its UFS file system. Back-end is NVMe Ceph RBD.

Ceph shows the disk is 15 GB with 14 GB used.

There is currently no option for qemu guest agent on pfSense, and I've noticed in the few hours its been running that it has not been TRIMmed.

Is there a FreeBSD command I can run to manually trim the empty space of a file system?

do I need a way to get the guest agent first in order for TRIM to work?
 
I don't think the agent is needed. The guest OS and filesystem need to support it and you need discard and possibly ssd emulation enabled in in the VM options.

I don't know freebsd so maybe someone else knows if there is a counterpart to fstrim on Linux. On Linux you can alternatively mount the fs with the discard option.
 
The VM has been powered on for 100 hours and has not been trimmed.

FreeBSD says the file system has trim enabled, however.


[2.4.5-RELEASE][root@fw00]/root: tunefs -p /dev/da0p3

tunefs: POSIX.1e ACLs: (-a) disabled
tunefs: NFSv4 ACLs: (-N) disabled
tunefs: MAC multilabel: (-l) disabled
tunefs: soft updates: (-n) enabled
tunefs: soft update journaling: (-j) enabled
tunefs: gjournal: (-J) disabled
tunefs: trim: (-t) enabled
tunefs: maximum blocks per file in a cylinder group: (-e) 4096
tunefs: average file size: (-f) 16384
tunefs: average number of files in a directory: (-s) 64
tunefs: minimum percentage of free space: (-m) 8%
tunefs: space to hold for metadata blocks: (-k) 6408
tunefs: optimization preference: (-o) time
tunefs: volume label: (-L)



In the VMware VMDK world, you could fill the free space in the guest file system with zeroes, and then power off the machine and run

vmkfstools -K /path/to/disk.vmdk

and all that empty space would be reclaimed back into the host storage.

Does something like this exist for Ceph RBD?
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!