Lxd cluster can only create ONE container

After creating a primary container, creating second container fails with this message:

Error: Failed instance creation: Failed creating instance record: Failed initialising instance: Failed to add device "eth0": open /var/snap/lxd/common/lxd/networks/lxdfan0/dnsmasq.hosts/secondary.eth0: no such file or directory

Cluster running in different subnets on aws

Please show lxc config show (container) --expanded for the first container as well as the command you’re using to create the 2nd container.

Finally please show lxc profile show (profile)

Hey man thanks for the quick reply! I am getting this error on aws

lxc config show primary --expanded

architecture: x86_64
config:
  image.architecture: amd64
  image.description: ubuntu 20.04 LTS amd64 (release) (20220322)
  image.label: release
  image.os: ubuntu
  image.release: focal
  image.serial: "20220322"
  image.type: squashfs
  image.version: "20.04"
  volatile.base_image: 7e8bbf2f24234c9414314019cfa275870f945a6a2ed52c944c3c11a16a98e4ef
  volatile.eth0.host_name: vethf4ce6c29
  volatile.eth0.hwaddr: 00:16:3e:6a:2e:9b
  volatile.idmap.base: "0"
  volatile.idmap.current: '[{"Isuid":true,"Isgid":false,"Hostid":1000000,"Nsid":0,"Maprange":1000000000},{"Isuid":false,"Isgid":true,"Hostid":1000000,"Nsid":0,"Maprange":1000000000}]'
  volatile.idmap.next: '[{"Isuid":true,"Isgid":false,"Hostid":1000000,"Nsid":0,"Maprange":1000000000},{"Isuid":false,"Isgid":true,"Hostid":1000000,"Nsid":0,"Maprange":1000000000}]'
  volatile.last_state.idmap: '[]'
  volatile.last_state.power: RUNNING
  volatile.uuid: abadc771-f188-4ba0-93fb-4a4dffcc0a5e
devices:
  eth0:
    name: eth0
    network: lxdfan0
    type: nic
  root:
    path: /
    pool: local
    type: disk
ephemeral: false
profiles:
- default
stateful: false
description: ""

lxc profile show default

config: {}
description: Default LXD profile
devices:
  eth0:
    name: eth0
    network: lxdfan0
    type: nic
  root:
    path: /
    pool: local
    type: disk
name: default
used_by:
- /1.0/instances/primary

launching within same instance gives error as well

lxc launch ubuntu:20.04 secondary

Error: Failed instance creation: Failed creating instance record: Failed initialising instance: Failed to add device "eth0": open /var/snap/lxd/common/lxd/networks/lxdfan0/dnsmasq.hosts/secondary.eth0: no such file or directory

Your help is much appreciated!

MORE

lxc cluster list

+---------------+----------------------------+----------+--------+-------------------+--------------+
|     NAME      |            URL             | DATABASE | STATE  |      MESSAGE      | ARCHITECTURE |
+---------------+----------------------------+----------+--------+-------------------+--------------+
| microk8s-1    | https://10.0.131.249:8443  | YES      | ONLINE | Fully operational | x86_64       |
+---------------+----------------------------+----------+--------+-------------------+--------------+
| microk8s-prod | https://197.100.5.162:8443 | YES      | ONLINE | Fully operational | x86_64       |
+---------------+----------------------------+----------+--------+-------------------+--------------+

lxc network ls

+---------+----------+---------+-------------+---------+---------+
|  NAME   |   TYPE   | MANAGED | DESCRIPTION | USED BY |  STATE  |
+---------+----------+---------+-------------+---------+---------+
| eth0    | physical | NO      |             | 0       |         |
+---------+----------+---------+-------------+---------+---------+
| lxdfan0 | bridge   | YES     |             | 2       | CREATED |
+---------+----------+---------+-------------+---------+---------+

3 different subnet resulted in only being able to create 1 container (eth0 network issue)
Resolved this by installing tinc vpn and share subnet between 3 hosts.

If anyone runs into the same problem check out tinc here
https://www.linode.com/docs/guides/how-to-set-up-tinc-peer-to-peer-vpn/

now i have a 3 node cluster containers being able to ping each other with internet access