A question about zfs compression and disk usage in VMs

Saahib

Member
May 2, 2021
84
3
13
Hi,
If we have zstd or lz4 compression enabled on ZFS, what user of VM will see it ?
For example, if I have created a virtual machine with 40 GB disk space, since compression is there, on actual node it will occupy lesser space but from inside VM, will it report actual usage or it will be compressed usage inside too ?

Or in other way, say I have 40GB VM, a user copies a file a while which is 7GB in size but after compression its 5.5GB, so if a user copies that 7GB file into VM, how much used space will be reported inside VM, will it be 7GB or 5.5GB ?
 
The compression happens in ZFS. Only the host does know that ZFS (and compression) is used. The guest sees a virtual representation of a very normal and stupid block device - a harddisk.

So in your example the guest will see a file 7GB in size.

(Everything else would be strange: the guest would write 7GB but it sees only 5.5GB? When it reads the file back - would it get 7GB or 5.5? This idea just would'nt work...)
 

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!