Discovered hosts running image version 3.4.4 have hostnames of "fdi"

Problem:
We run discovery image version 3.1.1 and advertise a DHCP host name parameter of mac address.
We set discovery_hostname parameter in foreman to discovery_bootif

After upgrading to version 3.4.4 machines now with hostname set to “fdi”

Expected outcome:
machines in discovery have their mac address as their hostname

Foreman and Proxy versions:
Foreman: 1.14.3

Foreman and Proxy plugin versions:
Discovery plugin: 8.0.1

Hello, this is on purpose, the moment when hostname is set is not during discovery phase, but during provisioning phase. That’s the Edit Host / Provision form or Discovery Rules.

If you use Quick Provision form, you can’t set hostname tho. Might be good idea to add that field if needed.

Hi lzap,

I was referring to machines that are in discovery and that should stay in discovery (these are not machines that are planned for provisioning)

all our discovery hosts run version 3.1.1 and once we reboot them to the newer version (3.4.4) they boot with hostname “fdi”.

We cannot have all machines in discovery set with the same hostname and this is currently blocking us from upgrading to version 3.4.4

We did not change the discovery_hostname parameter in foreman and it’s value is: discovery_bootif

I don’t understand how local hostname would affect anything, hostnames are configured not to be advertised via DHCP client, therefore it should never leave the local system.

Can you explain in more detail how fdi hostname is blocking you? What component gives you error and what error?

We have many servers running discovery image waiting to be provisioned. Each machine is running Chef (while in discovery) periodically. The registration to Chef is done based on hostname (each node has it’s own client key)

If all machines are named “fdi” only one machine at a time can have a Chef client key and node. This does not scale for us as when all machines are named “fdi” we need to manually delete the node and client that were created by Chef in order to register another.

We relay on Chef for provisioning.
Just to be clear, we dont use the hostname to resolve machines while in discovery, only for Chef registration.

Ok that makes things clear. Then don’t use hostname for client registration in Chef or simply change hostname to something unique prior registering with Chef?

It should be possible to set hostname via /usr/bin/nm-configure script which is called during boot before NetworkManager starts up and after network is initialized from TUI, you could use primary interface MAC address to construct something unique. Patches accepted.