I have 2 disks and would like to create one ZFS raid0 pool on Ubuntu 16.04 for everyday use and to keep LXC containers on it. Will it be ok to manage this pool by myself and allow LXD to manage it at the same time? I just want ZFS to work with bare metal and don't want to use loop files for LXD.
Asked
Active
Viewed 1,102 times
2 Answers
3
Rather than use a naming convention to avoid conflicts, use a dataset:
root@vm:~# zfs create test/data
root@vm:~# zfs create test/lxd
root@vm:~# lxd init
Name of the storage backend to use (dir or zfs) [default=zfs]:
Create a new ZFS pool (yes/no) [default=yes]? no
Name of the existing ZFS pool or dataset: test/lxd
...
root@vm:~# zfs list
NAME USED AVAIL REFER MOUNTPOINT
test 492K 38.5G 96K /mnt/test
test/data 96K 38.5G 96K /mnt/test/data
test/lxd 96K 38.5G 96K none
Datasets have their own ZFS properties and this allows LXD to do what it wants inside the dataset and it won't affect other datasets. Also it looks like lxd manages the dataset properties: disabling auto-mounting with mountpoint=none.
Samuel Harmer
- 285
- 3
- 10
2
After tests I can report that it works with no problems, just don't use fs names such as containers, images, deleted and snapshots. I decided to use prefix "z-" for non-lxd filesystems to prevent any collissions in future.
Lisio
- 161
- 1
- 5
-
I'm glad it's working for you. I'm using Proxmox, with LXC containers and VMs both on (separate) ZFS filesystems (not pools) and it's working fine as well. – Tim Kennedy Mar 28 '17 at 20:59
-
I didn't notice this comment before posting, but Tim and I are describing the same thing. – Samuel Harmer Jun 23 '17 at 14:43