ZFS Compression Makes VM Think It's More Full Than It Is

gabriel101x

New Member
Jul 25, 2024
2
0
1
Hi everyone,

I've got a head scratcher of an issue I've encountered with a Debian VM on a Proxmox server. I have a secondary ZFS pool setup on the Proxmox host using a 1TB SSD. 95% of this is being used to hold a VM disk for extra storage for that Debian VM. I've set the zvol for this VM disk to use ZFS's zstd compression and the VM is running an ext4 filesystem on it. The data the VM is writing is highly compressible which has resulted in a nearly 4x compression ratio.

But the problem is that the VM is not aware of this. So the VM is currently reporting that it has used 174GB/836GB. Whereas ZFS in Proxmox says it has only used 44.2GB. This poses a pretty serious issue as I'm imagining that the VM is eventually going to reach 100% usage and then complain and stop being able to write to the disk. When in reality it's only used 1/4 of the drive.

I've attached screenshots of what the VM reports when running df -h, as well all the ZFS properties of the zvol, and the disk settings in Proxmox. It has discard enabled in the Proxmox disk settings and I've confirmed the VM is running fstrim. How can I make sure the VM is able to use up the whole disk quota assigned to it? Is there a way I can make the VM see the real disk usage and take the ZFS compression into account? Or do I need to somehow trick the VM into thinking the disk is larger than it is?
 

Attachments

  • Screenshot 2025-07-03 144655.png
    Screenshot 2025-07-03 144655.png
    12.9 KB · Views: 6
  • Screenshot 2025-07-03 144828.png
    Screenshot 2025-07-03 144828.png
    247.9 KB · Views: 6
  • Screenshot 2025-07-03 150531.png
    Screenshot 2025-07-03 150531.png
    54.6 KB · Views: 6
Is there a way I can make the VM see the real disk usage and take the ZFS compression into account?
No.
VM can't know the underlying host disk neither its fs.
do I need to somehow trick the VM into thinking the disk is larger than it is?
Will works, but VM will crash when underlying will be full, that's why over allocation isn't recommended.
 
  • Like
Reactions: RealPjotr
No.
VM can't know the underlying host disk neither its fs.

Will works, but VM will crash when underlying will be full, that's why over allocation isn't recommended.
Thanks for the response. So is there seriously no way for me to allow the VM to use up the whole disk without wasting 75% of it? It seems like I can over-allocate multiple VM disks in Proxmox/ZFS but not a single one as each zvol is limited to the size of the drive. Hardware passthrough of the drive isn't an option due to IOMMU group limitations on the machine unfortunately.
 
If you enable Thin Provisioning in Datacenter > Storage it will allow you to do that. I recommend you read this and this before.
Please don't quote whole posts. Especially not if it is the latest/previous one.
 
Last edited: