Skip to content

ZFS module/units fail to load on boot with Beta 4426.1.0 #1908

@Codelica

Description

@Codelica

Description

Unlike the current Stable, Beta 4426.1.0 fails to load the ZFS kernel module on boot (when pool devices are available), resulting in ZFS units being skipped and no pools mounted.

Impact

ZFS pools won't be re-mounted automatically, which would be unexpected.

Environment and steps to reproduce

  • Given the following Butane config to create a ZFS pool and dataset on first boot:
variant: flatcar
version: 1.1.0

storage:
  files:
    - path: /etc/flatcar/enabled-sysext.conf
      mode: 0644
      contents:
        inline: |
          zfs

systemd:
  units:
    - name: format-zfs.service
      enabled: true
      contents: |
        [Unit]
        ConditionFirstBoot=1
        Before=first-boot-complete.target
        Wants=first-boot-complete.target
        [Service]
        Type=oneshot
        ExecStart=zpool create zdata /dev/vdb
        ExecStart=zfs create -o mountpoint=/zfs-test zdata/zfs-test
        [Install]
        WantedBy=multi-user.target
  • Compile to ignition.json and test using QEMU:
# Create an extra blank file device:
qemu-img create -f qcow2 zfs-disk.qcow2 100M

# Start Flatcar
flatcar_production_qemu.sh  -i ignition.json -- \
  -nographic \
  -drive file=zfs-disk.qcow2,if=virtio,format=qcow2
  • Both Stable and Beta 4426.1.0 will create the zdata pool with zfs-test dataset mounted at /zfs-test on first boot -- as the ZFS module is dynamically loaded when zfs/zpool commands are run. Can verify with:
zfs list
df /zfs-test
  • Now reboot the Flatcar VM:
    • Stable will load the ZFS module automatically via udev seeing ZFS devices and ZFS units are run resulting in /zfs-test being mounted.
    • Beta 4426.1.0 will fail loading the ZFS module with the following logged:
Oct 08 17:25:18 localhost (udev-worker)[1754]: vdb1: Process '/sbin/modprobe zfs' failed with exit.

And all ZFS units will be skipped due to unmet condition (ConditionPathIsDirectory=/sys/module/zfs), resulting in ZFS not being loaded and /zfs-data not being automatically mounted. You can verify with df /zfs-test or see the failures via journalctl |grep zfs Running a manual zfs list will trigger dynamic loading of the ZFS module and mount the dataset again.

Expected behavior

Beta should automatically start ZFS module and run units when ZFS devices are present.

Additional information

Please add any information here that does not fit the above format.

Metadata

Metadata

Assignees

No one assigned

    Labels

    channel/betaIssue concerns the Beta channel.kind/bugSomething isn't working

    Type

    No type

    Projects

    Status

    Implemented

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions