Discussion:
ZFS configuration
(too old to reply)
Stephen Brown Jr
2018-08-21 18:40:12 UTC
Permalink
Hello,
I am just getting started with LXD. I have an existing zfs pool, and
want to use a ZFS dataset on that pool to store my containers on.

I ran the command lxc storage create pool1 zfs source=fast/containers, and
it appeared to create it, however, I do not see it in the /fast directory
nor does zpool status list this.

It's possible that I don't understand how this works however. I do see it
created if I run the command lxc storage list, it does indeed show up:

| pool1 | | zfs | fast/containers | 0


I created a container for testing thinking it would show up, but no go on
that either.

Would like to understand how this is implemented and what I should expect?

Thanks,
Stephen
Stéphane Graber
2018-08-21 18:52:16 UTC
Permalink
Post by Stephen Brown Jr
Hello,
I am just getting started with LXD. I have an existing zfs pool, and
want to use a ZFS dataset on that pool to store my containers on.
I ran the command lxc storage create pool1 zfs source=fast/containers, and
it appeared to create it, however, I do not see it in the /fast directory
nor does zpool status list this.
It's not visible under /fast because LXD configures the dataset it
creates to get mounted under its own directory.

It also wouldn't show up in "zpool" because it's a dataset within your
"fast" zpool. You will see it in "zfs list" though.
Post by Stephen Brown Jr
It's possible that I don't understand how this works however. I do see it
| pool1 | | zfs | fast/containers | 0
I created a container for testing thinking it would show up, but no go on
that either.
Would like to understand how this is implemented and what I should expect?
Thanks,
Stephen
--
Stéphane Graber
Ubuntu developer
http://www.ubuntu.com
Mike Wright
2018-08-21 19:42:14 UTC
Permalink
Post by Stephen Brown Jr
Hello,
    I am just getting started with LXD. I have an existing zfs pool,
and want to use a ZFS dataset on that pool to store my containers on.
I ran the command lxc storage create pool1 zfs source=fast/containers,
and it appeared to create it, however, I do not see it in the /fast
directory nor does zpool status list this.
It's possible that I don't understand how this works however. I do see
| pool1   |             | zfs    | fast/containers                    | 0
I created a container for testing thinking it would show up, but no go
on that either.
Would like to understand how this is implemented and what I should expect?
Hi,

I'm also new to zfs and lxd so my help is limited.

Did you mount your zfs dataset anywhere? My ubuntu system is like

/var
/lib
/lxd
/containers
...
/storage-pools
/lxd <-- my lxc pool name; zfs dataset name; mountpoint
/containers
...
/snapshots

For this to work you *must* mount your dataset before you create any
containers. If you already have containers you won't be able to mount
over the top of them. zfs wants an empty mountpoint AFAIK

I mounted one level above /containers so I could get all the images,
snapshots, deleted, and containers, etc in one place and allow for
moving them as a "set".

Note that /lxd was put there by the lxc storage command. Your pool1 is
probably there, too.

Continue reading on narkive:
Loading...