Xcp-ng and zfs, needs modprobe and remount pool every boot

I’ve been trying to install a XCP-NG instance on my lab, with a ZFS pool as backend storage

After the installation of XCP-NG, following the guides on xcp website, i do

yum install zfs
modprobe zfs
reboot

after reboot

modprobe zfs
zpool create -f -o ashift=12 -m /mnt/zfs tank raidz  /dev/sda /dev/sdb /sdv/sdc
zfs set compression=lz4 tank
xe sr-create type=zfs content-type=user name-label=localZFS device-config:location/mnt/zfs

at this point the pool is created and it is showing as a storage in ZFS which I can create new VMs normally.

Upon rebooting though, I lost all my configuration:

  • ZFS modules is not loaded. Need to modprobe zfs again
  • The SR shows no PBD attached
  • zpool import tank returns no pool available
  • nothing is mounted on /mnt/zfs

to fix it, I need:

modprobe zfs
zpool import -a -d /dev/sda
xe sr-forget uuid=[localZFS uuid]
xe sr-create type=zfs content-type=user name-label=localZFS device-config:location/mnt/zfs

And reconfigure all the VMs to look at the new SR

Is it something wrong I’m doing while building the zpool? Which information I need to help troubleshoot this?

im not familiar with xcp-ng but if it uses dracut… maybe rebuild the initramfs might help?

1 Like

Same thing happened to me. Installing the package and rebooting did not make the module auto load. The doccumentation says it will auto load.
After creating the zpool and doing ‘xe sr-create …’ it did load on reboot.
I’m on xcp-ng 8.2.1 (latest as of writing).

1 Like