Bug 1905986
Summary: | Hostname can not persist when installing RHCOS | ||
---|---|---|---|
Product: | OpenShift Container Platform | Reporter: | yhe |
Component: | RHCOS | Assignee: | Micah Abbott <miabbott> |
Status: | CLOSED NOTABUG | QA Contact: | Michael Nguyen <mnguyen> |
Severity: | medium | Docs Contact: | |
Priority: | low | ||
Version: | 4.6 | CC: | bbreard, dornelas, imcleod, jligon, jnordell, miabbott, nstielau |
Target Milestone: | --- | ||
Target Release: | 4.8.0 | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | If docs needed, set a value | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2021-02-25 16:52:23 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
yhe
2020-12-09 13:18:07 UTC
The `--copy-network` command only copies the configurations under /etc/NetworkManager/system-connections. When setting the hostname via `nmtui`, the hostname is configured in /etc/hostname. Therefore, the `--copy-network` operation is insufficient for configuring the hostname. The recommended way to configure the hostname would be to provide an Ignition config that writes out `/etc/hostname` with the desired value for the system. We can pursue improving the UX in this case; I'll link to an upstream issue where input can be gathered. Here's the upstream issue discussing support for persiting the hostname - https://github.com/coreos/fedora-coreos-tracker/issues/697 The preferred way of modifying nodes at install time would be to use MachineConfigs. However, it is not possible to create per-node MachineConfigs at this time, so you would have to provide unique Ignition configs during install time. Using the UPI bare metal instructions as a guide: https://docs.openshift.com/container-platform/4.6/installing/installing_bare_metal/installing-bare-metal-network-customizations.html For example: ``` $ mkdir modify_hostname $ vi modify_hostname/install-config.yaml $ ./openshift-install create ignition-configs --dir=modify_hostname INFO Consuming Install Config from target directory WARNING Making control-plane schedulable by setting MastersSchedulable to true for Scheduler cluster settings INFO Ignition-Configs created in: modify_hostname and modify_hostname/auth $ cp modify_hostname/worker.ign modify_hostname/worker0.ign $ vi modify_hostname/worker0.ign $ jq . < modify_hostname/worker0.ign { "ignition": { "config": { "merge": [ { "source": "https://api-int.test.example.com:22623/config/worker" } ] }, "security": { "tls": { "certificateAuthorities": [ { "source": "data:text/plain;charset=utf-8;base64,LS0tLS1CR...." } ] } }, "version": "3.1.0" }, "storage": { "files": [ { "path": "/etc/hostname", "contents": { "source": "data:,worker0.example.com" }, "mode": 420 } ] } } ``` In the example worker0.ign, you can see that a `storage` section has been added to the Igntion config. This section instructs Ignition to write out `/etc/hostame` with the contents `worker0.example.com` Users will need to create modified Ignition configurations for each node they need to configure the hostname for and then make them available via HTTP or HTTPS. When installing RHCOS to disk from the ISO, the command would look like: `coreos-installer install --copy-network --insecure-igntion --ignition-url=http://<ip address>/worker0.ign /dev/sda` We have provided steps for configuring the hostname via Igntion config and are discussing how this can improved when using `coreos-installer` upstream. This will not be able to be implemented for 4.7, so resetting the Target Release until we have more consensus upstream. Higher priority work has prevented this issue from being solved; adding the UpcomingSprint keyword Discussing options in upstream issue Since it is possible to set the hostname via Ignition and expanding the functionality of `coreos-installer` to persist the hostname is an RFE, I am going to close this BZ. Please follow the upstream issue for additional progress - https://github.com/coreos/fedora-coreos-tracker/issues/697 |