#376 cross edition collaboration on default/fallback hostname
Closed: fixed 2 years ago by dustymabe. Opened 2 years ago by dustymabe.

In the Fedora Cloud working group meeting today I met with the team to discuss collaborating on a possible change to the default/fallback hostname in Fedora Cloud in the future.

The pitch for the change/collaboration is as follows:


Back in Fedora 33 the default hostname was changed from localhost to fedora on instances that didn't get the hostname set in any other way (i.e. it's the fallback if it's not set anywhere else). As far as I know this change came in in systemd and was never proposed as a change in Fedora itself.

Here's the original enablement upstream https://github.com/systemd/systemd/pull/5175 and the BZ requesting the change in Fedora: https://bugzilla.redhat.com/show_bug.cgi?id=1392925

Unfortunately, this initiallly caused us in FCOS some pain because setting the hostname via reverse DNS lookups (via NetworkManager) stopped working along with breaking 3rd party tools that set the hostname. The NM problem was subsequently fixed, but it still remains that a lot of third party software will check to see if an instance's hostname is "unset" by checking the current hostname against the string "localhost". Additionally it even seems that this change will never be picked up by CentOS/RHEL (see https://src.fedoraproject.org/rpms/systemd/c/13d1341b108a24d13f5922054307b5c2efc6836a?branch=rawhide).

The open question is, what do we think the fallback hostname should be for server like instances? And.. Should we do anything to change it for a subset of Editions/Working Groups in Fedora?


The meeting attendees today seemed to believe we should make a change. Here is a transcript of the chat:

11:14:27        dustymabe | #topic coordinating default/fallback hostname changes 
11:14:27               -- | zodbot has changed topic for #fedora-meeting-1 from "Action items from
                          | last meeting (Meeting topic: fedora_cloud_meeting)" to "coordinating
                          | default/fallback hostname changes  (Meeting topic:
                          | fedora_cloud_meeting)"
11:15:01          davdunc | Is that handled in cloud-init?
11:15:11        dustymabe | A little background...
11:15:15          davdunc | :) 
11:15:18        dustymabe | Back in Fedora 33 the default hostname was changed from localhost to
                          | fedora on instances that didn't get the hostname set in any other way
                          | (i.e. it's the fallback if it's not set anywhere else). As far as I
                          | know this change came in in systemd and was never proposed as a change
                          | in Fedora itself.
11:15:38          davdunc | i see. 
11:15:44        dustymabe | Here's the original enablement upstream
                          | https://github.com/systemd/systemd/pull/5175 and the BZ requesting the
                          | change in Fedora: https://bugzilla.redhat.com/show_bug.cgi?id=1392925
11:16:02        dustymabe | Unfortunately, this initiallly caused us in FCOS some pain because
                          | setting the hostname via reverse DNS lookups (via NetworkManager)
                          | stopped working along with breaking 3rd party tools that set the
                          | hostname. The NM problem was subsequently fixed, but it still remains
                          | that a lot of third party software will check to see if an instance's
                          | hostname is "unset" by checking the current hostname
11:16:02        dustymabe | against the string "localhost". Additionally it even seems that this
                          | change will never be picked up by CentOS/RHEL (see https://src.fedorapr
                          | oject.org/rpms/systemd/c/13d1341b108a24d13f5922054307b5c2efc6836a?branc
                          | h=rawhide).
11:16:19          davdunc | eww. 
11:16:35        dustymabe | The open question is, what do we think the fallback hostname should be
                          | for server like instances? And.. Should we do anything to change it for
                          | a subset of Editions/Working Groups in Fedora?
11:17:42          davdunc | so... just thinking here, and I am happy to be wrong, but what is wrong
                          | with "fedora" for all of them.
11:17:44          davdunc | ? 
11:18:17          davdunc | if we are setting a default, I wouldn't think that we would want it to
                          | deviate much, if at all.
11:18:22          mhayden | perhaps we could use "deprecate-legacy-bios" as the hostname? 🤭
11:18:28          davdunc | LOL
11:18:31          mhayden | but yes "fedora" would be a decent suggestion
11:18:39        dustymabe | davdunc: the main problem with it is the assumptions that other
                          | software/tools make   
11:18:57          davdunc | i expected as much. 
11:19:15               -- | feborges[m] is now known as feborges_afk[m]
11:19:19          davdunc | so localhost ends up being the typical expectations
11:19:21        dustymabe | we hit this in openshift where tools were checking "if `localhost`; 
                          | then set hostname to xyzfoo" 
11:19:45        dustymabe | the problem with `fedora` is it's hard to know if someone set that 
                          | hostname intentionally or not
11:20:01          davdunc | indeed. 
11:20:23          davdunc | though from the cloud perspective, it's our default username for every
                          | platform, etc. 
11:20:28        dustymabe | there is tooling around that (hostnamectl), but a lot of scripts/tools
                          | don't use it 
11:20:54          davdunc | yea. clearly the OpenShift decision was to look for the expected. 
11:21:19          davdunc | And that code review had a lot of senior eyes on it, I am sure.  
11:21:35        dustymabe | which code review? 
11:21:58          davdunc | the one that let that "if `localhost` . . . " get through. 
11:22:03        dustymabe | :) 
11:22:14        dustymabe | well the thing is, that's the case for RHEL
11:22:18        dustymabe | and RHCOS
11:22:31        dustymabe | see https://src.fedoraproject.org/rpms/systemd/c/13d1341b108a24d13f5922
                          | 054307b5c2efc6836a?branch=rawhide 
11:23:30          davdunc | yes and that proves that anything else but localhost is getting a
                          | kneejerk retooling.
11:24:10        dustymabe | davdunc: right.. IOW you're saying it caused problems and downstream
                          | immediately changed it back? 
11:24:25          davdunc | okay... I am seeing how "fedora" is a great fit for workstation, but
                          | maybe not anywhere else... 
11:24:30        dustymabe | exactly
11:24:55          davdunc | I feel like I am coming around to your way of thinking
11:25:27        dustymabe | The current proposal is that we should work to get back to the
                          | default/fallback being `localhost` for Cloud WG. This matches what FCOS
                          | is currently doing (see
                          | https://github.com/coreos/fedora-coreos-tracker/issues/902)
11:25:52        dustymabe | Depending on the level of buy in we can achieve that goal together
11:26:02          davdunc | okay. Let's put an issue in and then I'll add it to the technical
                          | specification. 
11:26:12        dustymabe | ok I can open an issue
11:26:17          davdunc | super. 
11:26:20              --> | Renault_ (Charles-Antoine Couret)
                          | (~Renault@2a02:578:85c6:1101:619d:6645:6a1c:53d6) has joined
                          | #fedora-meeting-1
11:26:31        dustymabe | and we can vote/comment there on merits 
11:26:38        dustymabe | mhayden: any thoughts on $topic?
11:27:04          davdunc | he gave us his legacy-bios naming preference!
11:27:12          mhayden | i tend to agree with you, dustymabe -- `localhost` makes sense to me

However, let's get input from people who weren't present today.

The current proposal is that we should work to get back to the default/fallback being localhost for Cloud. This matches what FCOS is currently doing (see https://github.com/coreos/fedora-coreos-tracker/issues/902). How we achieve that goal together is an implementation detail that can be discussed after it's decided that's the way we want to go.


Do we know why we don't just go ahead and set the global fallback hostname back to localhost? We can easily have Anaconda just set the hostname for systems it installs to fedora, while systemd's own fallback remains localhost.

@ngompa - I'm not sure. I think there is an argument somewhere (that I currently can't find) that states that localhost is bad for autodiscovery protocols. This was a good argument for Workstation I believe, but less so for server like variants.

If that's the case, we should have Anaconda or gnome-initial-setup default to fedora or make the livesys-scripts change the default, rather than having it encoded in systemd.

@davdunc @mhayden @ngompa - do we have general agreement here that we want localhost as our fallback hostname?

@davdunc would you be willing to be a co-sponsor of a change proposal?

@dustymabe until we find a smooth way to prevent confusion on the other tools, I think it's the right decision to default to localhost. I'm up for co-sponsoring the change. Unless someone has a better answer to the problem.

@dustymabe I support using localhost as well. 👍🏻

The change proposal was accepted for Fedora 37 (see the FESCO issue).

I'll close out this issue and we can all follow the tracking BZ for updates.

Metadata Update from @dustymabe:
- Issue close_status updated to: fixed
- Issue status updated to: Closed (was: Open)

2 years ago

Login to comment on this ticket.

Metadata