ZFS snapshot / replication disk usage

drjaymz@

Member
Jan 19, 2022
124
5
23
102
All, hopefully a quick question, I am looking at using pve in HA and I am still playing at it at the moment. I have setup 3 VM's on a 128Gb* disk and I have joined two other nodes to that cluster. I configured replication and 2 of the VM's went fine but the final "fat" one fails at the snapshot stage. Its about 60Gb and it looks like it creates a full copy first (the snapshot) and then replicates that, but because that VM is half the entire disk it doesn't fit and thus fails.

So, under Hyper-V the snapshots are tiny shadows and I assumed it was doing something similar.
Moving forward I read its only doing differencing so the next replication disk space is far more modest.

1) have I done it right but didn't have enough disk space?
2) a better way?

*reason I was being stingy with disk space is because all 3 nodes are actually nested VM's on hyper-v and I wanted to see this working and I only have 1TB of fast SSD. I could increase that master node data disk size, but I'm not entirely sure yet how provision calculation goes.
 
ZFS can do both, be thin or thick provisioned. What was the setting in the storage config when you created the "fat" VM?
 
I think "allow thin provisioning" was not checked.

The imported images I have are RAW format and fixed at 25Gb even though I don't think they are using much of that. So I hope there is a way I can get better efficiency.
 
I scrapped that installation and created one with slightly larger drives and enabled thin provisioning and it all worked well and disk space was much more modest.

I am still in the dark on best practices with this, ZFS is new to me and I don't trust it, and I don't know what the performance and compression options mean for a deployment yet - but thats the point of setting up this lab system.
 
  • Like
Reactions: aaron
One thing I can recommend if you use thin provisioned ZFS is to enable the "Discard" option for the VMs disks. This way, if the VMs want to trim/discard their disk, it will be passed through to the underlying storage and it can also free up space.
 
One thing I can recommend if you use thin provisioned ZFS is to enable the "Discard" option for the VMs disks. This way, if the VMs want to trim/discard their disk, it will be passed through to the underlying storage and it can also free up space.
Where is the discard option? What does it do and can I apply it retrospectively?

Thanks.
 
Where is the discard option? What does it do and can I apply it retrospectively?

Thanks.
If you edit the disk of a VM, you should see it on the right side.

It will need a clean boot of the VM to be active. If the issues a trim/discard on its disks, marking areas where data used to be stored but has been removed, that will be passed through to the storage layer underneath and it can free up these blocks again.

To run a trim manually in a Linux VM, just run fstrim -a. To manully issue it on Windows, run the following Optimize-Volume -DriveLetter YourDriveLetter -ReTrim -Verbose