Skip to content

Unclear how to create dataset #18

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
backupandforkacc opened this issue Feb 6, 2023 · 2 comments
Open

Unclear how to create dataset #18

backupandforkacc opened this issue Feb 6, 2023 · 2 comments

Comments

@backupandforkacc
Copy link

I am not sure how to use the plugin.

~$ docker volume create testsimon
creates the volume, but no dataset.

The example from github leads to an error:

~$ docker volume create -d zfs -o compression=lz4 -o dedup=on --name=rpool/docker/testsimon
Error response from daemon: create rpool/docker/testsimon: error looking up volume plugin zfs: plugin "zfs" not found

It seems correctly installed:

~$ systemctl list-unit-files --type=service | grep docker-zfs-plugin
docker-zfs-plugin.service                  enabled         enabled

$ ls -lh /usr/local/bin/ | grep zfs
-rw-r--r-- 1 root root 11M Feb  5 09:32 docker-zfs-plugin
@backupandforkacc
Copy link
Author

backupandforkacc commented Feb 8, 2023

I first created the dataset rpool/docker/testsimon, so this is there. Also downloaded the plugin again and put it in /usr/local/bin/, but still get the error.

When I have a look at the status of the service, it says:

$ systemctl status docker-zfs-plugin.service
○ docker-zfs-plugin.service - zfs plugin
     Loaded: loaded (/etc/systemd/system/docker-zfs-plugin.service; enabled; vendor preset: enabled)
     Active: inactive (dead)
  Condition: start condition failed at Thu 2023-02-09 17:03:18 CET; 7min ago

Feb 08 08:21:22 simon-itx systemd[1]: Condition check resulted in zfs plugin being skipped.
Feb 08 10:31:00 simon-itx systemd[1]: Condition check resulted in zfs plugin being skipped.
Feb 09 17:03:18 simon-itx systemd[1]: Condition check resulted in zfs plugin being skipped.

@UntouchedWagons
Copy link

UntouchedWagons commented Apr 28, 2025

You have to edit the ConditionPathIsMountPoint line in docker-zfs-plugin.service to reflect where your dataset is mounted.

In my case I have

[Unit]
Description=zfs plugin
After=zfs-mount.service zfs-import-cache.service
Before=docker.service
Requires=zfs-mount.service zfs-import-cache.service

#Recommended condition for each pool you intend to use
ConditionPathIsMountPoint=/mnt/docker/volumes


[Service]
ExecStart=/usr/local/bin/docker-zfs-plugin --dataset-name docker/volumes

[Install]
WantedBy=docker.service

I changed the docker pool's mountpoint to /mnt/docker then made a dataset just for volumes.

Then my docker compose is like so:

volumes:
  data:
    name: "docker/volumes/openspeedtest"
    driver: "zfs"
    driver_opts:
      atime: "off"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants