DNS/DHCP for vm from LXD

I’m having trouble understanding how dns name’s are set when creating new vm pods from lxd hosts.

My setup is as follows:

  1. maas controller using a laptop
  2. home server node connected to the same switch as the controller
  3. the switch is connected to a tagged vlan port 100
  4. the maas controller uses vlan 100

When installing the above home server, it was correctly given a dns name and ip configured by maas, however when creating vms from that node, something inconsistent happened:

  1. When I click creating vm on the ui, it created one with a ip given by maas’s dhcp and a unique name “somthing-animal”.
    2 When creating a second vm, the dns record is gone for the first vm, and now only the second one is given a dns record, which can be observed in the dns tab in maas.

I would like to understand:

  1. Is this behavior expected?
  2. If not, are there any reasons maas not given the vm dns records?
  3. I’ve create lxd containers manually on that vm host for personal uses, but since they’re under different lxd project I’m not sure if this is related to it.

can you walk me through what you’re doing, with some screenshots – or at least a detailed procedure – and tell me what version of MAAS you’re using? i can’t quite visualise what you’re describing.

in general, the MAAS controller has a hostname, and each machine will have a different hostname, either assigned you (if you specify it) or by the system (if you don’t). when you mention a “something-animal” name, that’s not necessarily broken.

note: there’s a good guide here for the kind of information to gather, but don’t file a bug, just gather the same information. the more you can tell me, the easier it will be for me to help.

Thanks for your reply, my setup is as follows:

[ router ] -|vlan tagged port1|> [ switch ] - maas controller and nodes

MAAS controller installed with snap 3.1.0-10901-g.f1f8f1505, installed on a laptop machine connected to the switch.

Node1(vmhost) on a IPMI enabled machine, and after vlan is tagged on the maas controller, install ubuntu 20.04 on it via maas. After install I manually ssh into the machine to do lxd init and register the lxd server to maas controller. I only need this because I need to create lxd storage pool from my manually created zfs pool. LXD is installed with snap 5.0.0-b0287c1

Steps to reproduce:

  1. when creating a vm from the vmhost, the first vm created have the generated hostname registered in the dns tab in MAAS, can be confirmed by calling $HOSTNAME.maas from the controller.
  2. when creating a second vm from the vmhost, the dns record of the first vm disappeared, which is now not achievable by the $HOSTNAME.maas, and ip address is not present on the subnet’s dhcp list.
  3. in the meantime, the second vm got it’s dns hostname setup and ip obtained.

Expected result:

  1. both vm should have ip assigned by maas if not configured manually
  2. dns record should withhold and not be influenced by consecutive new pods.
1 Like

can you show me a screenshot of the DNS record that disappears?

This is the first deployed vm from lxd vmhost

Which was given the hostname as DNS from MAAS

After create a new vm, the dns record was removed from MAAS

And only the new vm get to be assigned with the DNS record

I think the pattern I observe is that only the last vm created get attributed a DNS record, hope this helps.

so you are looking at this list?

maybe you could show me the whole list? does the machine that “loses” a DNS record switch from “A” to “AAAA” ? and can you tell me what problem this is causing? is something failing to function because of this behavior?

It just disappears so it’s not on the list.
I was installing some workload on the vms, and would like to use the dns name to point to other services.

okay, that sounds like a bug. please file a bug report and make sure to get screenshots of the list with the other VMs missing. thanks.

@extraymond, did you ever file a bug report? if so, can you post the link here?