Decide hostname of auto enlisted machine by self at enlistment

Background

After the server is installed in the rack, the BMC with IPMI is set up and the machine is booted, PXE boot runs and the machine is enlisted. At this time, the newly enlisted machine will have a name generated by the python petname library.

In an enterprise environment, the server name is managed by a prefix that you decide + sequential number, or by a serial number. The ability to determine the name of the machine based on the BMC metadata during the enlistment phase of MAAS would make server construction much easier.

About feature

[must]
If some string can be obtained from ipmitool mc getsysinfo system_name command when discover unenlisted machines, use it as the machine’s hostname at enlistment process.

[optional]
Considering that some bmc’s with default strings, you can set enable or disable this feature.

Thank you for your consideration.

@sugaf1204 , would my patches that allow you to set link type to DHCP by default and use DNS hostnames be at all useful for you? We’re currently using both of them to get consistent name sequences for our machines. See:

Merge into master : default_boot_interface_link_type

Allow MAAS to use DNS hostnames - Features

It’s not quite as handy as your idea of using BMC info to set the hostname, but it was easy to implement and we can at least put sensible hostname sequences into DNS and have MAAS use those.

To get things properly ordered in DHCP, we boot the nodes up one at a time in the correct order and then convert the leases to reservations - again, not as handy as your proposal, but it’s getting the job done for us.

Let me know what you think, and leave a comment on Allow MAAS to use DNS hostnames if you think it might have potential.