Ok,
lets assume we just did an import of an existing dataset
Code:
root@pve:~# zfs list
NAME USED AVAIL REFER MOUNTPOINT
dataPool 1.73T 5.39T 128K none
dataPool/local 205G 5.39T 139K none
dataPool/local/mma 205G 5.39T 205G /zPool/mma
dataPool/local/pve 128K 5.39T 128K /pvePool
dataPool/local/users 420M 5.39T 139K /zPool/users
dataPool/local/users/henning 29.0M 5.39T 29.0M /zPool/users/henning
dataPool/local/users/moni 391M 5.39T 391M /zPool/users/moni
dataPool/remote 1.53T 5.39T 181K /rPool
dataPool/remote/Backups 198G 5.39T 198G /rPool/Backups
dataPool/remote/Daten-FAM 2.07G 5.39T 2.07G /rPool/Daten-FAM
dataPool/remote/Daten-SEC 11.2G 5.39T 11.2G /rPool/Daten-SEC
dataPool/remote/Medien 1.19T 5.39T 1.19T /rPool/Medien
dataPool/remote/Projekte 16.8G 5.39T 16.8G /rPool/Projekte
dataPool/remote/Software 120G 5.39T 120G /rPool/Software
dataPool/remote/Tmp 1.91G 5.39T 1.91G /rPool/Tmp
To make it visible inside the pve GUI create some entry's in storage.cfg
Code:
root@pve:~# cat /etc/pve/storage.cfg
dir: local
disable
path /var/lib/vz
content vztmpl,iso,backup
btrfs: local-btrfs
path /var/lib/pve/local-btrfs
content images,rootdir,backup,vztmpl,iso
zfspool: pvePool
pool dataPool/local/pve
content rootdir,images
sparse 1
zfsPool: zPool
pool dataPool/local
sparse 1
Now lets try to create a new mountpoint/dataset for an existing unprivileged LXC container.
Following the
wiki, it is only optional but not required to set defaults on the parent dataset.
Code:
Storage Features
... so you can simply set defaults on the parent dataset
But if you try to create a mountpoint via GUI you will get the following error:
Code:
mp1: unable to hotplug mp1: zfs error: cannot mount 'dataPool/local/subvol-205-disk-0' no mountpoint set
And of course, my intention was not to create a subvolume or a raw image, but only a simple dataset.
So let's create it by hand and set the mountpoint
Code:
zfs create dataPool/local/media
zfs set mountpoint=/zPool/media dataPool/local/media
Now we need to add the corresponding mount entry to the container
Code:
root@pve:~# cat /etc/pve/lxc/205.conf |grep mp0
mp0: zPool:media,mp=/mymedia,acl=1,replicate=0,size=8G
But ups, the container did not boot anymore:
Code:
TASK ERROR: unable to parse zfs volume name 'media'
Ok, according the wiki, pve only supports "rootdir,images" as content type. No dataset's !!!
So there is no way to set a native zfs dataset as mountpoint, exept as bind-mount.
Code:
root@pve:~# cat /etc/pve/lxc/205.conf |grep mp0
mp0: /zPool/media,mp=/mymedia,replicate=0
But when doing this there is no way to snapshot the lxc container anymore, reagardless if the underlaying file system like btrfs or zfs is able to do snapshots or not.
Conclusion:
PVE did not support snapshotting of zfs datasets, since "dataset" is not a supported "type".
That wouldn't be so bad if it would be possible to ignore any bind mounts for snapshotting. But no solution for more than 5 Years.
So I had to remove the mountpoint, take a snapshot and restore the mountpoint again in container config
Henning