I have a 19.10 server running on SSD. I have 2 WD 1TB HDDs, which I want to get mirrored and to create 1 partition there, where I’ll put LXD pool with multiple containers. Should I create mirror with LVM first and then LXD pool there? Which filesystem to use?
Also, I need to be sure that if I’d like to move mirror to another server it won’t be super hard. Plus, if 1 hdd fails, I’d like to be able to connect another one to another PC with Windows to perform a backup.
Yeah, LXD API doesn’t let you configure that directly so you either need to add the second drive after the fact or configure the whole thing yourself and just tell LXD to use it.
Yeah, giving an existing VG to the LXD LVM driver is perfectly fine.
Just make sure you never have anything else use that VG. It must be completely dedicated to LXD (we have a check for that at creation time but we can’t detect later tempering).
LVM isn’t our favorite storage driver since it relies on a block device per container, making it a bit slower to create containers, also not quite as nice to migrate between systems (a full rsync is used). But it does support all our features and is actively tested.
Okay, so I have the following problem.
I have a pool of zfs:
zpool list NAME SIZE ALLOC FREE CAP DEDUP HEALTH ALTROOT zfs_lxd 464G 1.59G 462G 0% 1.00x ONLINE -
After lxd init:
lxd init
Would you like to use LXD clustering? (yes / no) [default = no]: no
Do you want to configure a new storage pool? (yes / no) [default = yes]: yes
Name of the new storage pool [default = default]: zfs_lxd
Name of the storage backend to use (btrfs, dir, lvm, zfs, ceph) [default = zfs]: zfs
Create a new ZFS pool? (yes / no) [default = yes]: no
Name of the existing ZFS pool or dataset: zfs_lxd
Would you like to connect to a MAAS server? (yes / no) [default = no]: no
Would you like to create a new local network bridge? (yes / no) [default = yes]: no
Would you like to configure LXD to use an existing bridge or host interface? (yes / no) [default = no]: yes
Name of the existing bridge or host interface: lxdbr0
Would you like LXD to be available over the network? (yes / no) [default = no]:
Would you like stale cached images to be updated automatically? (yes / no) [default = yes]
Would you like a YAML “lxd init” preseed to be printed? (yes / no) [default = no]: yes
config: {}
networks: []
storage_pools:
config:
source: zfs_lxd
description: “”
name: local
driver: zfs
profiles:
Error: Failed to create storage pool ‘zfs_lxd’: Failed to run: zpool import zfs_lxd: cannot import ‘zfs_lxd’: pool was previously in use from another system.
And this error occurs all the time.
If I do zpool export zfs_lxd
All ends without any errors.
Is there a better way?
Also I don’t know why I must set name zfs_lxd for storage pool or i have similar error.
EDIT:
I think I solved the problem by changing
ZFS mountpoint
zfs set mountpoint = none zfs_lxd