using/passing zfs storage to virtual machines.

rcd

Well-Known Member
Jul 12, 2019
246
25
58
63
So, I create an encrypted+compressed pool, secdata. I used pvesm to add it as a zfspool, so now I see it with pvesm status:

Code:
root@pve3:~# pvesm status
Name             Type     Status           Total            Used       Available        %
..
secdata       zfspool     active     14354464013             178     14354463834    0.00%

root@pve3:~# zfs list
NAME           USED  AVAIL  REFER  MOUNTPOINT
..
poolz/secdata  179K  13.4T   179K  /poolz/secdata

From a running VM, if I "add disk" I can see this volume, but if I add it, it turns up as a drive on the VM, here /dev/sdc, so I have to create a new filesystem on it etc.

From the hyperviser I can go directly to /poolz/vmdata and store files, so isn't there a way to pass this through directly to the VM, and avoid another level of partitioning/filesystems with all the overhead and inconvenience this carries?

Hope this makes sense, otherwise let me know...
 
For LXC containers it seems possible to bind mount a pool, (pct set CTID -mp0 /poolz/secdata,mp=/secdata) but for QEMU the only way to avoid having to duplicate filesystems would be to NFS share the pool.

It doesn't seem very practical. How are peeps setting up VM/CT as NAS with a large part of ZFS used for data?