How to manage LXD Container in Maas on Same Host

I would like to install Maas on a bare metal host using Snaps or Packages and then be able to register LXD containers that are running on the same host. This Github post seems to indicate some changes were made to support this but I’m still running into an issue where LXD Init can’t find the host in Maas. Presumably because the controller doesn’t show up as a host. The end goal is to be able to colocate some containers for some other services like FreeIPA on the same host and have those containers show up in Maas.

config:
  maas.api.key: CFrysYtgAQsU9Z8rFs:fT6RZdAaz7NLmFwXe8:WMmkWVbGVHNKnbRebQ24femqjdDZAhHL
  maas.api.url: http://192.168.1.76:5240/MAAS
  maas.machine: ubuntu.maas
networks:
- config:
    ipv4.address: auto
    ipv6.address: auto
  description: ""
  managed: false
  name: lxdbr0
  type: ""
storage_pools:
- config:
    size: 24GB
  description: ""
  name: default
  driver: zfs
profiles:
- config: {}
  description: ""
  devices:
    eth0:
      name: eth0
      nictype: bridged
      parent: lxdbr0
      type: nic
    root:
      path: /
      pool: default
      type: disk
  name: default
cluster: null

Error: Failed to update server configuration: Couldn't find the specified machine: ubuntu.maas
3 Likes

have you found any solution?

I landed here with the same issue this evening, after trying to set up a machine running both maas and lxd concurrently.

This error message is right at the end of the lxd init process, without any indication as to what’s going wrong, so I’ll go file a bug report asking at least to make a message to people trying to do the same thing so they don’t have to wade through the init process several times over thinking it’s an issue with hostname or the controller not being on its own network, like I did.

Edit: I think the solution (at least for the time being) is that it’s not possible to run maas and lxd on the same machine, since the server running lxd needs to be discoverable as a machine on the maas network, apart from the server running the mass controller.

I did try adding the controller as a machine manually, and maas says it’s already added since it’s listed as the controller. But AFAICT, since the lxd machine can’t show up as a machine separately on the controller because it’s on the controller, this is the crux of the issue (please correct me if I’m wrong).

One could run maas in a VM as detailed in this quick exercise, which is a great demo to run through, but I am personally going to conect my maas VM on a physical NIC enslaved by a linux bridge, and run it on the same subnet as the LAN.