ZFS Storage with and without mountpoint in /etc/pve/storage.cfg

cave

Renowned Member
Feb 18, 2016
57
10
73
Vienna
Hi,

I want to add a zfs storage to an LXC client. done that before, now it fails. :confused:

created the dataset, set a quota, added it in pve as a storage.

now i want to add it to my LXC Client as a resource/mp0. but the container fails to start with mp0. when i remove mp0, it boots without issues.

1678868485094.png

Like i did it before with other LXC Containers, for PBS and an APT-Mirror,... where i decided to keep it similar. i did not have that issues there, just a few weeks earlier.

just in case, settings/options/features are common for all compared LXC Containers.
pve-manager/7.3-6/723bb6ec (running kernel: 5.15.85-1-pve)
1678869010615.png
  • nesting=1
  • unpriviledged=YES
  • keyctl=0

root@pve3:~# pct start 311 --debug

run_buffer: 322 Script exited with status 2
lxc_init: 844 Failed to run lxc.hook.pre-start for container "311"
__lxc_start: 2027 Failed to initialize container "311"
id 0 hostid 100000 range 65536
INFO lsm - ../src/lxc/lsm/lsm.c:lsm_init_static:38 - Initialized LSM security driver AppArmor
INFO conf - ../src/lxc/conf.c:run_script_argv:338 - Executing script "/usr/share/lxc/hooks/lxc-pve-prestart-hook" for container "311", config section "lxc"
DEBUG conf - ../src/lxc/conf.c:run_buffer:311 - Script exec /usr/share/lxc/hooks/lxc-pve-prestart-hook 311 lxc pre-start produced output: cannot open directory //pve-pool1/ssh: No such file or directory

ERROR conf - ../src/lxc/conf.c:run_buffer:322 - Script exited with status 2
ERROR start - ../src/lxc/start.c:lxc_init:844 - Failed to run lxc.hook.pre-start for container "311"
ERROR start - ../src/lxc/start.c:__lxc_start:2027 - Failed to initialize container "311"
INFO conf - ../src/lxc/conf.c:run_script_argv:338 - Executing script "/usr/share/lxcfs/lxc.reboot.hook" for container "311", config section "lxc"
startup for container '311' failed

root@pve3:~#

so i rechecked my zfs dataset if i created it different, have redone it.
so i rechecked my pve storages, if there are differences. have deleted and recreated them.

could not find any mistakes or differences to the others before. even checked the commands in my .bash_history for diff's


root@pve3:~# cat /etc/pve/storage.cfg
...
zfspool: pve3-apt
pool pve-pool1/apt
content rootdir,images
mountpoint /mnt/apt
nodes pve3
sparse 1

zfspool: pbs1-storage
pool pve-pool1/pbs1-storage
content rootdir,images
mountpoint /mnt/pbs1-storage
nodes pve2
sparse 1

zfspool: pve3-ssh
pool pve-pool1/ssh
content rootdir,images
nodes pve3
sparse 1
...

I guess i have found the issue, the mountpoint is missing for my pve3-ssh storage.

matches also the line in the debug output:
DEBUG conf - ../src/lxc/conf.c:run_buffer:311 - Script exec /usr/share/lxc/hooks/lxc-pve-prestart-hook 311 lxc pre-start produced output: cannot open directory //pve-pool1/ssh: No such file or directory

Thats how my pve zfs storage looks like.
1678868333678.png


root@pve3:~# zfs list
...
pve-pool1 84.9G 814G 96K /pve-pool1
pve-pool1/apt 84.5G 115G 96K /mnt/apt
pve-pool1/apt/subvol-140-disk-0 84.5G 65.5G 84.5G /mnt/apt/subvol-140-disk-0
pve-pool1/ssh 192K 25.0G 96K /mnt/ssh
pve-pool1/ssh/subvol-311-disk-0 96K 24.0G 96K /mnt/ssh/subvol-311-disk-0

pretty similar.

on the dataset pve-pool1/ssh is already the subvol for the mp0 mountpoint available.
1678868444182.png

I cannot find any mistake or diff in my procedures between pbs/apt creation of zfs/dataset and pve/storage vs the new one.

I'm pretty sure it has to do with the missing mountpoint setting in
/etc/pve/storage.cfg


Any idea where i made a mistake?
Why is mountpoint missing in storage.cfg
How to let my cotainer 311 boot with zfs/subvol/mp0 from pve-pool1/ssh storage?
 
So,

reset everything, started from scratch. new try

root@pve3:~# zfs create -o mountpoint=/mnt/ssh pve-pool1/ssh
root@pve3:~# zfs list | grep ssh
pve-pool1/ssh 96K 814G 96K /mnt/ssh
root@pve3:~# df -hTl | grep ssh
pve-pool1/ssh zfs 815G 128K 815G 1% /mnt/ssh

Added the Storage via GUI as a ZFS .
1678903054406.png

1678903116218.png

root@pve3:~# cat /etc/pve/storage.cfg

zfspool: pve3-ssh
pool pve-pool1/ssh
content images,rootdir
nodes pve3
sparse 1

Still the following line is not reflected in the storage.cfg - missing
mountpoint /mnt/ssh

From:
https://pve2.cavebeat.lan:8006/pve-docs/chapter-pvesm.html#storage_zfspool

1678903401574.png


Is this a Bug? At least it's reproducible for me. unfortunately.
 
Yep, very interesting to know what mountpoint option is used for and why it can be missing for part of zfs pools.
 

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!