zpool won't auto mount anymore after kernel update

I'm actually thinking about it now, and I believe that the default action for PVE really should be not to mount those ZFS pools that have not been configured in PVE storage.cfg as storage types used by Proxmox. Let's face it, on any other OS, unless I tell it to mount something - I don't want it to happen. Yes some OS's are setup that when you plug in a USB drive/stick it will automount, some or not. But if I have 6 drives connected at boot - on most OS's these will not mount automatically. I believe this is the norm that most Linux users enjoy. (MS Windows differs in this respect).
Thats just my 2 cents on what I consider the "normal" action should be.

Just to add another workaround to those mentioned above; you could add a cronjob entry with:
Code:
@reboot <full_path_to command>/zpool import tank && <full_path_to command>/zfs mount tank
I guess this should work, (you may need a small sleep delay added - I don't know your system).
 
How is this `tank` pool used exactly in your setup (as it's not a storage for vm-images)? How is it used inside a VM?

else pools in PVE get imported by various mechanisms:
* per default: if it is listed in /etc/zfs/zpool.cache (this happens if you manually import a pool on the cli, but can be racy, because it gets removed there when the pool is exported
* for pools that are used as VM-disk storage and listed in storage.cfg - by pvestatd (which calls activate_storage)
* when a guest-disk is on that pool and the guest gets started (also activate_storage)
* when you create the pool through the GUI a systemd-unit is enabled `zfs-import@<poolname>.service` which runs the import command on boot (maybe this would be the least invasive way for you to get your pool imported)

Currently I don't see where there is a bug here?

I hope this helps!

Tank uses NFS inside a VM to talk back to the PVE host for tank. So when the VM starts, it's expecting that PVE has mounted tank and wishes to talk to it via NFS. This used to work just fine until the kernel update a couple of days ago. Now I have to manually import the tank every time pve reboots.
 
You may be right - BUT - the OP seeks to know, what changed with the kernel update.
most likely nothing - older boot logs (e.g., journalctl -b-X where X is 1, 2, 3, ..) might show whether before the update the import at boot services were executed differently. one thing that can happen is that the system accidentally switched to using a cachefile, and that cachefile might not have the info for all pools. by default, ZFS does either cache- or scan-based importing at boot, not both. this "brittleness" is also the reason why for PVE-managed zpools, we have an additional import unit and the storage layer will actively try to import pools that are missing..
 
I'm actually thinking about it now, and I believe that the default action for PVE really should be not to mount those ZFS pools that have not been configured in PVE storage.cfg as storage types used by Proxmox. Let's face it, on any other OS, unless I tell it to mount something - I don't want it to happen.

the cache- and scan-based imports are upstream's, not PVE specific. the behaviour is the same when you install ZFS on Debian for example ;) but you can disable them if you don't like that behaviour, and either manually import, or use the (PVE specific) zfs-import@ template unit to select which pools are imported at boot time, or write your own import-at-boot logic.
 
  • Like
Reactions: gfngfn256

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!