Further to the great idea to install a k8s control plane in virtual machines using MAAS, it seems that the MAAS v.3.5 snap is broken. It is impossible to create LXD VMs with MAAS (details below).
Having spent 5 days since last friday to investigate and nail down the issue on an isolated hardware setup, clean Ubuntu v 24 LTS and most recent MAAS software channel 3.5, I am stuck.
Could someone in the community please give me some pointers to get back on the yellow brickroad? That would be awesome. Thanks already.
The problem:
=====
What is broken is that it is not possible to get VMs working on a MAAS controlled VM host.
I am trying to replicate the great Way Of Work of Anton Smith to slash on-prem cost with cluster API and MAAS for bare metal k8s. (Link: https://www.youtube.com/watch?v=rvDQl_1b4VM)
In the comment section of said video there are others complaining that this does not work anymore with newer versions of MAAS & LXD software.
Some details below:
=====
Creating a LXD host in MAAS completes without problems. Attempting to create LXD VMs on any MAAS controlled LXD host fails and results in a cryptic message.
See errors below
{start snip}
example 1:
Error:
Pod unable to compose machine: (b’UNHANDLED’, ‘Unknown Error [maasplex1:pid=996:cmd=ComposeMachine:ask=3]’)
example 2:
Error:
Pod unable to compose machine: (b’UNHANDLED’, ‘Unknown Error [maasplex1:pid=1020:cmd=ComposeMachine:ask=2]’)
example 3:
Error:
Pod unable to compose machine: (b’UNHANDLED’, ‘Unknown Error [maasplex1:pid=966:cmd=ComposeMachine:ask=12]’)
{end snip}
The root cause seems to be that during install of Ubuntu 24 LTS and the MAAS v.3.5 snap the LXD v.5.21 is installed but sadly not the required bridge named “lxdbr0". Upon checkup LXD has not installed any network or bridge at all. Manually installing said lxdbr0 bridge with “lxd init” ends in an error message every time.
Any time the “lxd init” command is started, the moment the dialogue attempts to create a bridge, the dialogue breaks off with the following message:
{start snip}
Error: Failed to create local member network “lxdbr0” in project “default”: The DNS and DHCP service exited prematurely: exit status 2 (“dnsmasq: failed to create listening socket for 10.94.147.1: Address already in use”)
{end snip}
Actually, in whatever way the questions from the lxd init dialogue are answered, it always results in NOT creating that lxdbr0 bridge; Upon checking with “lxc network show lxdbr0” if lxdbr0 actually exists, it responds with the following message:
{start snip}
Error: Network not found
{end snip}
To isolate the problem I have created an isolated test network and it fails every time. Meanwhile I have completely reinstalled the maas controller 4 times on a new fresh Ubuntu server 24 LTS. The test network looks like this (see picture)
The commands used for installation are listed below:
{start snip}
based on sevral vids and articles from syncbrick and linux genie
tep 0: preparing
Dell Optiplex, KVM capable, 16GB RAM, 256Gb SSD
Fresh install of Ubuntu 24 LTS, fixed IP address.
Maas shall execute the DHCP and DNS on the subnetwork.
sudo apt update
sudo apt dist-upgrade
sudo reboot
sudo snap install --channel=3.5 maas
sudo systemctl disable --now systemd-timesyncd
sudo apt install -y postgresql
sudo reboot
sudo -i -u postgres psql -c “CREATE USER "maas" WITH ENCRYPTED PASSWORD ‘secret_password’”
sudo -i -u postgres createdb -O “maas” “maasdb”
sudo nano /etc/postgresql/16/main/pg_hba.conf
then add below lines in the existing configuration at the end of the above file
host maasdb maas 0/0 md5
sudo maas init region+rack --database-uri “postgres://maas:secret_password@localhost/maasdb”
sudo maas createadmin
step5: complete the create admin dialogue interactively, like for example:
Username : maasuser
Password : NotKnownPassword
Again : NotKnownPassword
Email : pogo.theclown@circus1.be
Import SSH Keys
sudo maas status
step 6: Once installed, log into Maas via browser using port 5240
http://192.168.6.25:5240/MAAS
change region name in welcome screen from “maas” to whatever.
region name = maas-test
change connectivity DNS servers: enter external and own
8.8.8.8 192.168.6.1
then select ‘save and continue’
next select the images to be downloaded
thereafter install SSH keys manually, so select keys->source->upload
open a terminal to the home directory and create keys
sudo ssh-keygen and enter the filename to save the key
sudo ssh-keygen -t rsa -b 2048 -C “pogoid-ssh-key”
when asked for filename enter ‘pogoed’ and enter the passphrase “NotGonnaTellYou”
check with ls for 2 files: file ‘pogoed’ is the private key and file ‘pogoid.pub’ is the public key.
show content and copy paste into MAAS browserpage and select button ímport SSH key’
cat pogoid.pub
click “finish setup”
next set DHCP on the default fabric
Select sidebar->Subnets. Then select from list with networks in the fabrics list the IPv4 network.
then select the desired VLAN HYPERLINK (!) to open the VLAN summary window.
select “configure DHCP”, select the rack controller and finish by pressing button "Configure
next step is network discoveries from sidebar menu, select update frequency
subsequently select settings from sidebar menu; settings->commissioning->machine settings
then select default ubuntu release used for commissioning
etc. etc.
{end snip}
Hope somebody can give me some essential information or point me to some stupid mistake.
Have a nice day.