One more note: If you use ZoL (ZFS on Linux), there is currently no Trim support in ZFS
Just to confirm, looking at
proxmox roadmap it seems that since Proxmox VE 6.0 it incorporates ZFS 0.8.1, which already provides full trim support, correct?
So from that version on, trim is supported on ZFS pool, ZVOL KVM/Qemu VM, ZFS LXC Container, correct?
This is wrong. Having this option set means running discard every time you delete something rendering the scheduled trim unnecessary. Either using option discard or run trim on a regular basis.
Thank you for the informative reply.
So a potential recipe can be:
- Schedule fstrim to run weekly on PE hosts
- Use the Virtio SCSI driver for VMs when possible, enabling the discard option each time
- Schedule trim (eg fstrim in Linux) to run weekly in guest VMs
- Schedule fstrim to run weekly in PE containers
I just did some tests, and with the VirtIO SCSI discard option on, deleting a (large) file from the guest DOES NOT reduce the usage on the host.
When fstrim is run in the guest, the usage is then reduced in the host.
As such, the recipe in #4 is the approach I'm taking.
EDIT: Running fstrim in unprivileged containers proves to be a bit of an issue so using the workaround here:
https://forum.proxmox.com/threads/d...-thin-doesnt-release-space.32179/#post-159371
I've been gathering info regarding this subject, I would like to confirm that your recipe is working as expected.
You put the check on discard in every guest VM disk, AND set fstrim on Proxmox VE host system?
In case of Windows VMs, they should be able to manage trim operations by themselves, is it also required the discard check on disks, right? Any other config on those VMs?
For instance, on a Windows VM (which will be migrated to the new server, once it is running), I have the following config:
- SCSI Controller: VirtIO SCSI
- Hard Disk (scsi0): local-lvm:vm-100-disk-0,size=40G
- Hard Disk (scsi1): local-lvm:vm-100-disk-1,size=10G
- Hard Disk (virtio2): /dev/disk/by-id/ata-HGST_HUS7...,size=...
I know I have installed virtio driver on windows guest system in order to properly work with the virtualized controller.
So this is the required VM config with VirtIO driver that will allow me to check "discard" option on each disk and have trim support?