Allow alternate machine name on deploy for dynamic instance hostname

In our environment we have 2 hostnames, the first hostname is the name of the machine in MAAS. We call this the DC hostname (Data Center hostname). When we deploy, we use a generated hostname (instance hostname) which only lives until the machine is released and never used again.

For Linux this is ok, because renaming the host doesn’t require a reboot. For Windows however, it makes automating things difficult when you also need to join it to the domain as that ‘instance’ hostname and not the DC hostname.

At deploy time, it would be nice to be able to specify an ‘alternate’ hostname which will only live within the curtin setup for that particular deploy.

Let’s check if I understood it correctly.

MAAS identifies the machines by the DC hostname, e.g. the name of the physical host, but the deployed OS should identify itself with an instance hostname, a random name that for example identifies the workload running there at this moment.

correct?

Yes, the hostname in MaaS (e.g. CHMAAS2147643) is what we call the DC Hostname, this name never changes and it’s how the data center people know it.

Once a customer deploys this machine, we generate a hostname (e.g. pchxchas085af) and give the newly deployed OS that newly generated name.

The issue with Windows is that, by default, MaaS will give the newly deployed host the ‘MaaS’ hostname (CHMAAS2147643), but we need it to be: pchxchas085af. Which is the name the customer knows it as.

When we make the deploy API call, it would be great if we could specify the hostname that curtin will use (while leaving the DC Hostname alone in MaaS), this way, we don’t have rename the machine and then reboot (we have to do this today and get unreliable results with Windows).

Hope this makes sense.