Support hostnames for BMC addresses

It would be nice to be able to specify hostnames instead of IP addresses for the bmc_address in power parameters for a machine.

At some organizations, it’s standard operating procedure to create DNS entries for machine BMC addresses and this can make managing machines within MAAS a little more convenient.

As I understand it, determining which controller can talk to a particular machine is done once when you add a machine. For this to work, that determination would either need to be done every time MAAS communicates with the BMC (since the IP could change) or re-evaluate the controlling controller periodically. Perhaps this could be tuned to check whenever the DNS record TTL expires and do the ipmi-ping only when the resolving IP changes. Of course that means we’d have to keep track of the IP associated with the DNS name.

It might also make sense to resolve CNAMES in case the hostname is just a convenience name that points to a standard hostname such as a hostname that represents the serial number or asset tag.

In situations where the dns resolves to multiple IPs (which does seem unlikely) we could just use the first that works but since dns records are returned in basically a random order, this could change with every lookup. Perhaps we would have to sort the results?

3 Likes

I’m with you 100%, but unfortunately, until Feb 2024 this feature has not been released yet (MAAS 3.4 stable) :frowning:
I manually added BMC as a “Device” entry in MAAS, with the name {hostname}-mgmt.maas, then wrote a script based on python-libmaas to update the BMC IP in power_parameters of each machine, based on the DNS resolution. Crontab runs the script every 5 minutes.