I am unfamiliar with MaaS. I have followed the multipass tutorial and seen a VM be launched from the MaaS UI running in a VM. I believe what I’m attempting is possible but I can’t find a starting point for the work I want to do, I’m looking for advice to help me find the start of the process to follow.
I have a machine in which I can install LXD. Using init --minimal on that machine allows me to start an ubuntu 24.04 image but trying to add an lxd host in the UI after filling in a name and address in the Add LXD host dialogue jest re-presents the form.
Purhing the environment (I read re-running lxd init might be problematic) I ran lxd init but this time I specified an address that is reachable from the VM that lxc will create, then created the vm, installed MaaS and tried again. The results were the same.
I think it’s unlikely to be the root cause, but the snap version of MaaS is:
maas 3.4.2-14353-g.5a5221d57 35359 3.4/stable canonical✓ -
My questions are:
- Is my general approach reasonable? Fire up an LXD vm runn MaaS in that VM hve that instance manage sibling VMs in the parent LXD environment.
- Am I trying the right way to break the chicken and egg of enabling VM creating by trying to add the parent LXD to the child MaaS environment?
- Is there some documentation that discribes how to bootstrap the environment I’m trying to create, or should I be trying to reverse engineer the multipass tutorial>
Any help in finding a start on this path would be appreciated, thank you for your time.
It sounds reasonable, as long as those VMs bridge to the same L2 switch, so they can be booted from the MAAS PXE env. But I am not sure whether you can add a deployed LXD host to MAAS.
$ lxc ls
+-------+---------+------------------------+------------------------------------------------+-----------------+-----------+
| NAME | STATE | IPV4 | IPV6 | TYPE | SNAPSHOTS |
+-------+---------+------------------------+------------------------------------------------+-----------------+-----------+
| maas1 | RUNNING | 10.84.107.129 (enp5s0) | fd42:e8e4:725:f347:216:3eff:feea:ad2 (enp5s0) | VIRTUAL-MACHINE | 0 |
+-------+---------+------------------------+------------------------------------------------+-----------------+-----------+
| mini1 | RUNNING | 10.84.107.32 (enp5s0) | fd42:e8e4:725:f347:216:3eff:fe00:ca92 (enp5s0) | VIRTUAL-MACHINE | 0 |
+-------+---------+------------------------+------------------------------------------------+-----------------+-----------+
$ lxc network ls
+------------+----------+---------+----------------+--------------------------+-------------+---------+---------+
| NAME | TYPE | MANAGED | IPV4 | IPV6 | DESCRIPTION | USED BY | STATE |
+------------+----------+---------+----------------+--------------------------+-------------+---------+---------+
| br-int | bridge | NO | | | | 0 | |
+------------+----------+---------+----------------+--------------------------+-------------+---------+---------+
| ens4f0 | physical | NO | | | | 0 | |
+------------+----------+---------+----------------+--------------------------+-------------+---------+---------+
| ens4f0.900 | vlan | NO | | | | 0 | |
+------------+----------+---------+----------------+--------------------------+-------------+---------+---------+
| ens4f1 | physical | NO | | | | 0 | |
+------------+----------+---------+----------------+--------------------------+-------------+---------+---------+
| ens4f1.901 | vlan | NO | | | | 0 | |
+------------+----------+---------+----------------+--------------------------+-------------+---------+---------+
| lxdbr0 | bridge | YES | 10.84.107.1/24 | fd42:e8e4:725:f347::1/64 | | 3 | CREATED |
+------------+----------+---------+----------------+--------------------------+-------------+---------+---------+
I apologies for the formatting but I was hoping to show that the bridge that the host’s initialisation created is where the MaaS VM is created.
I appreciate the laugh check on the idea and I should clarify I don’t expect to try to persuade MasS to manage its own VM. I am hoping to get it to manipulate its peers only. The purpose of the ‘mini’ image is to see what impact non MaaS created VM’s have. And I can see that image in the discovered machines as mini1.lxd.
But using the UI to try and add the LXD instance as an external host fails and I am at a loss as to how to debug it. The LXD log on the host has no mention of an attempt to connect from the MaaS instance.
An intuitional approach would be: you install a MAAS on the VM of your laptop, to provision the machine as an LXD host, and create a Ubuntu image on top of it. Then migrate the PostgreSQL database to the MAAS instance on LXD.
Interesting idea, I might give that try, but if I follow you correctly it seems I still have to register an external LXD instance and that’s the step that fails inscrutably. I think I have to learn more about how to get information about the failure to add an external LXD host from MaaS.
I think you can simply deploy the machine as a LXD host. As all stateful info/config except logs is stored in PostgreSQL, the LXD host will be able to talk with the new MAAS instance.