The behaviour you observe looks similar to the one mentioned in the doc:
The bridge LXD creates is isolated and not managed by MAAS. If this bridge is used, you would be able to add the LXD VM host and compose virtual machines, but commissioning, deploying, and any other MAAS action which uses the network will fail – so yes is the correct answer here.
The bridge LXD creates is isolated and not managed by MAAS. If this bridge is used, you would be able to add the LXD VM host and compose virtual machines, but commissioning, deploying, and any other MAAS action which uses the network will fail – so yes is the correct answer here.
So should i disable creation of lxdbr0 ?
Looks like lxdbr0 is doing NAT which will not help MAAS to perform certain tasks. If I have to use VMs which are directly connected to my MAAS controlled DHCP server then which networking option I should use ?
If I try the VM creation manually in maas-project it fails saying cant download the image because of name resolution issue. But in the case of default project it just works.
On server2 (ubuntu-server-22.04), I removed the previous VM which failed in the creation and tried creating new one from MAAS. This time it just worked. Not sure what is different from previous case.
When I am trying to launch a VM from CLI it still fails in maas-project.
root@op2:/home/ubuntu# lxc ls --project maas-project
+------+---------+----------------------+------+-----------------+-----------+
| NAME | STATE | IPV4 | IPV6 | TYPE | SNAPSHOTS |
+------+---------+----------------------+------+-----------------+-----------+
| vm01 | RUNNING | 10.10.10.18 (enp5s0) | | VIRTUAL-MACHINE | 0 |
+------+---------+----------------------+------+-----------------+-----------+
root@op2:/home/ubuntu#
root@op2:/home/ubuntu#
root@op2:/home/ubuntu#
root@op2:/home/ubuntu# lxc profile show default --project maas-project
config: {}
description: Default LXD profile for project maas-project
devices: {}
name: default
used_by: []
root@op2:/home/ubuntu# lxc launch --vm ubuntu:22.04 vm02 --project maas-project
Creating vm02
Error: Failed instance creation: Failed creating instance record: Failed initialising instance: Failed getting root disk: No root device could be found
root@op2:/home/ubuntu#
root@op2:/home/ubuntu#
root@op2:/home/ubuntu# lxc ls --project maas-project
+------+---------+----------------------+------+-----------------+-----------+
| NAME | STATE | IPV4 | IPV6 | TYPE | SNAPSHOTS |
+------+---------+----------------------+------+-----------------+-----------+
| vm01 | RUNNING | 10.10.10.18 (enp5s0) | | VIRTUAL-MACHINE | 0 |
+------+---------+----------------------+------+-----------------+-----------+
Good to know that there is some progress! Wondering what was the difference…
I think thats fine. When MAAS triggers LXD API it also specifies network device, storage profile and something else. So I was wrong with assumptions that you can launch new VM in MAAS project manually. Instead we should start existing VM that failed (for troubleshooting).
So everything works now? Or there is still something failing?
Well it still does not work with server1 (running ubuntu-core-22) which I need to try again from scratch.
I do have one question though, as shown below lxdbr0 has DHCP disabled but NAT is enabled. When I create a new VM in default project, it is assigned with the ipaddress from the lxdbr0 subnet. Is this proper or DHCP is enabled in background ?
I can see that this issue is still present in ubuntu-core-22.
I deployed a new machine with Ubuntu-core-22 [lets call SERVER3] using MAAS. Then I installed LXD manually and added the LXD host in MAAS.
codingfreak@mlin01:~$ snap list
Name Version Rev Tracking Publisher Notes
core22 20230801 864 latest/stable canonical✓ base
pc 22-0.3 146 22/stable canonical✓ gadget
pc-kernel 5.15.0-86.96.1 1433 22/stable canonical✓ kernel
snapd 2.60.4 20290 latest/stable canonical✓ snapd
codingfreak@mlin01:~$
codingfreak@mlin01:~$ snap install lxd
lxd 5.18-da72b8b from Canonical✓ installed
codingfreak@mlin01:~$
codingfreak@mlin01:~$
codingfreak@mlin01:~$ snap list
Name Version Rev Tracking Publisher Notes
core22 20230801 864 latest/stable canonical✓ base
lxd 5.18-da72b8b 25945 latest/stable canonical✓ -
pc 22-0.3 146 22/stable canonical✓ gadget
pc-kernel 5.15.0-86.96.1 1433 22/stable canonical✓ kernel
snapd 2.60.4 20290 latest/stable canonical✓ snapd
codingfreak@mlin01:~$
codingfreak@mlin01:~$ sudo -s
root@mlin01:/home/codingfreak#
root@mlin01:/home/codingfreak#
root@mlin01:/home/codingfreak# lxd init
Would you like to use LXD clustering? (yes/no) [default=no]:
Do you want to configure a new storage pool? (yes/no) [default=yes]:
Name of the new storage pool [default=default]: lxd-storage
Name of the storage backend to use (dir, lvm, zfs, btrfs, ceph) [default=zfs]:
Create a new ZFS pool? (yes/no) [default=yes]:
Would you like to use an existing empty block device (e.g. a disk or partition)? (yes/no) [default=no]:
Size in GiB of the new loop device (1GiB minimum) [default=30GiB]: 500GiB
Would you like to connect to a MAAS server? (yes/no) [default=no]:
Would you like to create a new local network bridge? (yes/no) [default=yes]:
What should the new bridge be called? [default=lxdbr0]:
What IPv4 address should be used? (CIDR subnet notation, “auto†or “noneâ€) [default=auto]:
What IPv6 address should be used? (CIDR subnet notation, “auto†or “noneâ€) [default=auto]:
Would you like the LXD server to be available over the network? (yes/no) [default=no]: yes
Address to bind LXD to (not including port) [default=all]:
Port to bind LXD to [default=8443]:
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]:
root@mlin01:/home/codingfreak#
Now if I try to create new VM from MAAS UI it fails as shown below