Pxe boot image with zfs included

Hi,
I just managed to build my first custom kernel+os image to include the disk drivers I required on my servers but now I am facing another issue:
I deally I wish to boot rancheros from the pxe image and then dedicate the disks for dockers, is there a way to include the zfs service directly into my os image so that zfs is available right from the boot ?

You can edit os-config.tpl.yml to include the ZFS container with the bootstrap services. I had a lot of issues getting a ZFS root this way and ended up using EXT4 on a ZVOL with this strategy. If you want to actually get ZFS on the base image I think you’ll need to look into the Rancher os-base project which uses buildroot.

I ended up building my own rancheros images with zfs included and a few tweaks, my servers boots from pxe and use zfs as storage, so far everything works fine.
I had to switch to the latest docker version 18.xx to fix a few issues with zfs when a docker was removed, the docker version is considered experimental and it show in the ui but I don’t really care since it works.

Did you actually get ZFS setup as root or system-docker or just integrated in order to use it right away for the regular docker service?

I am not sure what your exact question is but my disk is only formatted as zfs, I don’t have any non zfs storage.

I am not entirely clear how the pxe image boots up but the system dockers are not stored on disk, the user dockers are saved on zfs, I use these boot parameters for the rancheros image: rancher.docker.storage_driver=zfs rancher.docker.graph=/mnt/pool1/docker/ and my zfs pool looks like this:

NAME                    MOUNTPOINT
pool1                   /mnt/pool1
pool1/docker            /mnt/pool1/docker
pool1/etc_ssh           /etc/ssh
pool1/var_lib_rancher   /var/lib/rancher/state

it took a bit of experimenting but I managed to make sure the ssh host key is reused, that the rancher state is kept and the user docker saved too.

Hi there, are you able to share how you went about building your own rancheros images to include ZFS?