Hi… As indicated in the topic, can I do thin provisioned disks with zfs or is there an equivalent feature in zfs that will give me thin provisioned disks. I don’t want disk files taking up all the provisioned space from the start
Thanks
Yes. zfs set refreservation=0
on the zvol for the VM in question, IIRC.
I thought it was effectively thin provisioned by default. If you put a proxmox VM disk on zfs storage it creates a zvol for that VM and only uses the space that the VM disk uses (plus whatever overhead proxmox and zfs impose). For example, on my 2T zfs pool I have a bunch of VM disks, 5 of which are 500G. When I do zfs list -ro space
for that pool it shows 194G used.
For example, on my 2T zfs pool I have a bunch of VM disks, 5 of which are 500G. When I do
zfs list -ro space
for that pool it shows 194G used.
The ZVOLs themselves are thin provisioned, as you demonstrated here. However, snapshots of them… kind of aren’t. Basically, if you’ve got 2.5T of volume size worth of ZVOLs on a 2T pool–and you’re not already talking about the refserervation
property–that tells me you’re probably not taking snapshots, and that makes me a sad panda!
See, although ZVOLs are thin, by default they have refreservation=100%
set. This means that the system won’t allow you to snapshot that zvol unless you’ve got the entire size of the zvol available. (This is intended to prevent you from filling the pool with snapshots, then asking an eg 50% “empty” ZVOL to write data, which it cannot because the pool itself has no free space, even though the ZVOL isn’t anywhere near its volume size.)
TL;DR zvols are sorta thin, sorta not-thin, and you should always be taking regular snapshots, and if you don’t change the default refreservation
value on ZVOLs, you likely won’t be able to snapshot them sooner or later.
Here’s the zfs get:
fastpool/VMs/vm-112-disk-1 refreservation none default
You are correct that I am not currently using snapshots–I use proxmox backup server to backup all of my VMs because it does incremental backups and compression and dedupe. But before rolling that out I used sanoid/syncoid and I didn’t run into space issues with snapshots.
Took me a while to even begin to understand the answers. The answer I was looking for is the one provided by @notadman I’ll mark that as the answer.
However, the sparse comment made me go looking into my storage.cfg file and sure enough the property “sparse” was conspicuously missing. The “thin” checkbox for creating a local zfs store via the UI is unchecked by default in Proxmox 7. 4-3. At least in mine
If i could go for 2 answers, I’ll go for @mercenary_sysadmin 's. Helped me understand what knobs to touch to confidently scratch my own itch. After a lot of reading to understand what a refreservation is and how it differs from a reservation and a quota, I can now appreciate what Proxmox does under the hood. It does the job too. So thanks, everyone. Much appreciated