I have a Proxmox 6 host that has a ZFS mirror consisting of 2 NVME drives and 4 spinners in a "raid10-like" ZFS configuration (a stripe of 2 mirrors)
It has 1 Linux server VM acting as an iSCSI target. The VM has an OS drive, a datadrive thats on the NVME pool and a datadrive thats on the spinner pool. ALL drives of this VM have the "discard" option enabled in Proxmox. If I write data to OS drive, I see data usage grow in the underlying ZFS volume on Proxmox host. If I delete data on OS drive of the VM, I see space freed up on the host and not just the VM.
Now the tricky part:
The datadrives of this VM are exported via iSCSI to a secondary bare metal Linux server. The LUNs are utilizing bare block devices with no partition/filesystem. The exported drives are formatted as XFS and mounted on the secondary server. Before setting emulate_tpu=1 on both LUNs, attempting to run fstrim on the secondary server would result in an "operation not supported" error. After enabling it, it LOOKS as if it's working:
fstrim -v /mnt/iscsi-podman-fast
/mnt/iscsi-podman-fast: 255.9 GiB (274743492608 bytes) trimmed
But neither simply deleting the data nor running the fstrim command ends up actually reducing data use on the Proxmox host. Can't run fstrim on the Linux VM running iSCSI target either, since it wants to be run on against a mounted filesystem, not a dumb block device. Would this work if instead of block devices, iSCSI was running on top of a file? Is "iSCSI on top of sparse files" even a thing?
It has 1 Linux server VM acting as an iSCSI target. The VM has an OS drive, a datadrive thats on the NVME pool and a datadrive thats on the spinner pool. ALL drives of this VM have the "discard" option enabled in Proxmox. If I write data to OS drive, I see data usage grow in the underlying ZFS volume on Proxmox host. If I delete data on OS drive of the VM, I see space freed up on the host and not just the VM.
Now the tricky part:
The datadrives of this VM are exported via iSCSI to a secondary bare metal Linux server. The LUNs are utilizing bare block devices with no partition/filesystem. The exported drives are formatted as XFS and mounted on the secondary server. Before setting emulate_tpu=1 on both LUNs, attempting to run fstrim on the secondary server would result in an "operation not supported" error. After enabling it, it LOOKS as if it's working:
fstrim -v /mnt/iscsi-podman-fast
/mnt/iscsi-podman-fast: 255.9 GiB (274743492608 bytes) trimmed
But neither simply deleting the data nor running the fstrim command ends up actually reducing data use on the Proxmox host. Can't run fstrim on the Linux VM running iSCSI target either, since it wants to be run on against a mounted filesystem, not a dumb block device. Would this work if instead of block devices, iSCSI was running on top of a file? Is "iSCSI on top of sparse files" even a thing?
Last edited: