cri-o / cri-o

Open Container Initiative-based implementation of Kubernetes Container Runtime Interface
https://cri-o.io
Apache License 2.0
5.24k stars 1.06k forks source link

cri-o fails to start with zfs driver and graphroot set to a root of a dataset #8771

Open ghormoon opened 1 day ago

ghormoon commented 1 day ago

What happened?

I had a dataset with mountpoint=/var/lib/crio cri-o fails to start with

msg="validating root config: failed to get store to set defaults: no zfs dataset found for rootdir '/var/lib/crio': prerequisites for driver not satisfied (wrong filesystem?)"

it does create some files like storage.lock, userns.lock and zfs folder.

changing graphroot to /var/lib/crio/containers makes it start properly

What did you expect to happen?

use /var/lib/crio as as a storage folder instead of having to add additional subfolder

How can we reproduce it (as minimally and precisely as possible)?

apt-get install cri-o

zfs create pool/crio zfs set mountpoint=/var/lib/crio pool/crio

/etc/containers/storage.conf:

[storage]
driver = "zfs"
graphroot = "/var/lib/crio"
runroot = "/var/run/crio"

systemctl start crio

Anything else we need to know?

happened on crio 1.31, OS Debian 12, repo https://pkgs.k8s.io/addons:/cri-o:/stable:/v1.31/deb/, zfs 2.1

CRI-O and Kubernetes version

```console $ crio --version crio version 1.31.2 GitCommit: 920af25f2b6fd4f52bced0e73f696e48464da543 GitCommitDate: 2024-11-01T10:41:59Z GitTreeState: dirty BuildDate: 1970-01-01T00:00:00Z GoVersion: go1.22.5 Compiler: gc Platform: linux/amd64 Linkmode: static BuildTags: static netgo osusergo exclude_graphdriver_btrfs seccomp apparmor selinux exclude_graphdriver_devicemapper LDFlags: unknown SeccompEnabled: true AppArmorEnabled: true ``` ```console { "clientVersion": { "major": "1", "minor": "31", "gitVersion": "v1.31.2", "gitCommit": "5864a4677267e6adeae276ad85882a8714d69d9d", "gitTreeState": "clean", "buildDate": "2024-10-22T20:35:25Z", "goVersion": "go1.22.8", "compiler": "gc", "platform": "linux/amd64" }, "kustomizeVersion": "v5.4.2", "serverVersion": { "major": "1", "minor": "31", "gitVersion": "v1.31.2", "gitCommit": "5864a4677267e6adeae276ad85882a8714d69d9d", "gitTreeState": "clean", "buildDate": "2024-10-22T20:28:14Z", "goVersion": "go1.22.8", "compiler": "gc", "platform": "linux/amd64" } } ```

OS version

```console # On Linux: $ cat /etc/os-releasePRETTY_NAME="Debian GNU/Linux 12 (bookworm)" NAME="Debian GNU/Linux" VERSION_ID="12" VERSION="12 (bookworm)" VERSION_CODENAME=bookworm ID=debian HOME_URL="https://www.debian.org/" SUPPORT_URL="https://www.debian.org/support" BUG_REPORT_URL="https://bugs.debian.org/" $ uname -a Linux lab.atollon.net 6.1.0-26-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.112-1 (2024-09-30) x86_64 GNU/Linux ```

Additional environment details (AWS, VirtualBox, physical, etc.)

physical, zfs 2.1