I think I am hitting this bug, or at least a variant of it. I am trying my best to configure a lxd deployment that use directory backed storage. If I create 10 concurrent models, ~50% fail with:
$ sudo lxc storage list
+------------+-------------+--------+------------------------------------------------+---------+
| NAME | DESCRIPTION | DRIVER | SOURCE | USED BY |
+------------+-------------+--------+------------------------------------------------+---------+
| default | | dir | /var/snap/lxd/common/lxd/storage-pools/default | 3 |
+------------+-------------+--------+------------------------------------------------+---------+
| juju-btrfs | | btrfs | /var/snap/lxd/common/lxd/disks/juju-btrfs.img | 0 |
+------------+-------------+--------+------------------------------------------------+---------+
$ for i in `seq 0 9`; do juju add-model m$i --no-switch & done
...
ERROR failed to create new model: failed to create new model: adding default storage pools for "lxd": creating default pool "lxd-zfs": validating storage provider config: creating LXD storage pool "juju-zfs": creating storage pool "juju-zfs": the "zfs" tool is not enabled
I can work around this by pre-creating a dummy pool called juju-zfs:
$ sudo mkdir /var/snap/lxd/common/lxd/storage-pools/juju-zfs
$ sudo lxc storage create juju-zfs dir source=/var/snap/lxd/common/lxd/storage-pools/juju-zfs
Storage pool juju-zfs created
$ for i in `seq 0 9`; do juju add-model m$i --no-switch & done
I think I am hitting this bug, or at least a variant of it. I am trying my best to configure a lxd deployment that use directory backed storage. If I create 10 concurrent models, ~50% fail with:
$ sudo lxc storage list ------+ ------- ------+ ------- -+----- ------- ------- ------- ------- ------- ------- -+----- ----+ ------+ ------- ------+ ------- -+----- ------- ------- ------- ------- ------- ------- -+----- ----+ lxd/common/ lxd/storage- pools/default | 3 | ------+ ------- ------+ ------- -+----- ------- ------- ------- ------- ------- ------- -+----- ----+ lxd/common/ lxd/disks/ juju-btrfs. img | 0 | ------+ ------- ------+ ------- -+----- ------- ------- ------- ------- ------- ------- -+----- ----+
+------
| NAME | DESCRIPTION | DRIVER | SOURCE | USED BY |
+------
| default | | dir | /var/snap/
+------
| juju-btrfs | | btrfs | /var/snap/
+------
$ for i in `seq 0 9`; do juju add-model m$i --no-switch & done
...
ERROR failed to create new model: failed to create new model: adding default storage pools for "lxd": creating default pool "lxd-zfs": validating storage provider config: creating LXD storage pool "juju-zfs": creating storage pool "juju-zfs": the "zfs" tool is not enabled
I can work around this by pre-creating a dummy pool called juju-zfs:
$ sudo mkdir /var/snap/ lxd/common/ lxd/storage- pools/juju- zfs /var/snap/ lxd/common/ lxd/storage- pools/juju- zfs
$ sudo lxc storage create juju-zfs dir source=
Storage pool juju-zfs created
$ for i in `seq 0 9`; do juju add-model m$i --no-switch & done
all 10 models are created no problem