Bug 2084469
Summary: | RFE: static hostname modification | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 9 | Reporter: | Quique Llorente <ellorent> |
Component: | nmstate | Assignee: | Gris Ge <fge> |
Status: | CLOSED ERRATA | QA Contact: | Mingyu Shi <mshi> |
Severity: | medium | Docs Contact: | |
Priority: | unspecified | ||
Version: | 9.1 | CC: | ferferna, fge, jiji, jishi, network-qe, sfaye, till |
Target Milestone: | rc | Keywords: | FutureFeature, Triaged |
Target Release: | --- | ||
Hardware: | x86_64 | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | If docs needed, set a value | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2022-11-15 10:00:45 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
Quique Llorente
2022-05-12 08:25:18 UTC
Patch posted to upstream: https://github.com/nmstate/nmstate/pull/1911 Example yaml: ```yaml --- hostname: running: "nmstate-test.example.org" config: "nmstate-test.example.org" ``` The `running` is the activating hostname. The `config` is the on-disk hostname in /etc/hostname. Then setting empty string to `config`, nmstate will remove on-disk hostname. (In reply to Gris Ge from comment #2) > Patch posted to upstream: https://github.com/nmstate/nmstate/pull/1911 > > Example yaml: > > ```yaml > --- > hostname: > running: "nmstate-test.example.org" > config: "nmstate-test.example.org" > ``` > > The `running` is the activating hostname. The `config` is the on-disk > hostname in /etc/hostname. Then setting empty string to `config`, > nmstate will remove on-disk hostname. There is also the following concept on hostnamectl, don't know if we have that at NM. --transient Only set transient hostname --static Only set static hostname --pretty Only set pretty hostname Tested with integration tests out of a container. It works as expected. Thanks! nmstate-2.1.1-0.alpha.20220602.5accbd1.el9.x86_64 It seems successful according to the output, but nmstatectl got error when applying. @Gris could you please take a look? The original hostname in `nmstatectl show`: hostname: running: sweetpig-8.4a2m.lab.eng.bos.redhat.com config: "" Then I applied such state: hostname: running: sweetpig-8.4a2m.lab.eng.bos.redhat.com config: test.name It reported error(returned 65): [11:12:13@sweetpig-8 ~]0# nmstatectl edit [2022-06-15T03:12:23Z INFO nmstate::nispor::show] Got unsupported interface lo type Loopback [2022-06-15T03:12:23Z INFO nmstate::nm::show] Got unsupported interface type generic: lo, ignoring [2022-06-15T03:12:56Z INFO nmstate::nispor::show] Got unsupported interface lo type Loopback [2022-06-15T03:12:57Z INFO nmstate::nm::show] Got unsupported interface type generic: lo, ignoring [2022-06-15T03:12:57Z INFO nmstate::net_state] Ignoring kernel interface lo [2022-06-15T03:12:57Z INFO nmstate::net_state] Created checkpoint /org/freedesktop/NetworkManager/Checkpoint/6 [2022-06-15T03:12:57Z INFO nmstate::nispor::show] Got unsupported interface lo type Loopback [2022-06-15T03:12:57Z INFO nmstate::nm::show] Got unsupported interface type generic: lo, ignoring [2022-06-15T03:12:57Z ERROR nmstate::hostname] VerificationError: Verification fail, desire hostname.running: sweetpig-8.4a2m.lab.eng.bos.redhat.com, current: Some("test.name") [2022-06-15T03:12:57Z INFO nmstate::net_state] Retrying on verification failure: VerificationError: Verification fail, desire hostname.running: sweetpig-8.4a2m.lab.eng.bos.redhat.com, current: Some("test.name") [2022-06-15T03:12:58Z INFO nmstate::nispor::show] Got unsupported interface lo type Loopback [2022-06-15T03:12:58Z INFO nmstate::nm::show] Got unsupported interface type generic: lo, ignoring [2022-06-15T03:12:58Z ERROR nmstate::hostname] VerificationError: Verification fail, desire hostname.running: sweetpig-8.4a2m.lab.eng.bos.redhat.com, current: Some("test.name") [2022-06-15T03:12:58Z INFO nmstate::net_state] Retrying on verification failure: VerificationError: Verification fail, desire hostname.running: sweetpig-8.4a2m.lab.eng.bos.redhat.com, current: Some("test.name") [2022-06-15T03:12:59Z INFO nmstate::nispor::show] Got unsupported interface lo type Loopback [2022-06-15T03:12:59Z INFO nmstate::nm::show] Got unsupported interface type generic: lo, ignoring [2022-06-15T03:12:59Z ERROR nmstate::hostname] VerificationError: Verification fail, desire hostname.running: sweetpig-8.4a2m.lab.eng.bos.redhat.com, current: Some("test.name") [2022-06-15T03:12:59Z INFO nmstate::net_state] Retrying on verification failure: VerificationError: Verification fail, desire hostname.running: sweetpig-8.4a2m.lab.eng.bos.redhat.com, current: Some("test.name") [2022-06-15T03:13:00Z INFO nmstate::nispor::show] Got unsupported interface lo type Loopback [2022-06-15T03:13:00Z INFO nmstate::nm::show] Got unsupported interface type generic: lo, ignoring [2022-06-15T03:13:00Z ERROR nmstate::hostname] VerificationError: Verification fail, desire hostname.running: sweetpig-8.4a2m.lab.eng.bos.redhat.com, current: Some("test.name") [2022-06-15T03:13:00Z INFO nmstate::net_state] Retrying on verification failure: VerificationError: Verification fail, desire hostname.running: sweetpig-8.4a2m.lab.eng.bos.redhat.com, current: Some("test.name") [2022-06-15T03:13:01Z INFO nmstate::nispor::show] Got unsupported interface lo type Loopback [2022-06-15T03:13:01Z INFO nmstate::nm::show] Got unsupported interface type generic: lo, ignoring [2022-06-15T03:13:01Z ERROR nmstate::hostname] VerificationError: Verification fail, desire hostname.running: sweetpig-8.4a2m.lab.eng.bos.redhat.com, current: Some("test.name") [2022-06-15T03:13:01Z INFO nmstate::net_state] Rollbacked to checkpoint /org/freedesktop/NetworkManager/Checkpoint/6 NmstateError: VerificationError: Verification fail, desire hostname.running: sweetpig-8.4a2m.lab.eng.bos.redhat.com, current: Some("test.name") But it actually succeeded by checking: [11:13:52@sweetpig-8 ~]0# nmstatectl show | yq '.hostname' [2022-06-15T03:14:14Z INFO nmstate::nispor::show] Got unsupported interface lo type Loopback [2022-06-15T03:14:15Z INFO nmstate::nm::show] Got unsupported interface type generic: lo, ignoring running: test.name config: test.name [11:14:15@sweetpig-8 ~]0# hostname test.name In here, "running" and "config" under "hostname" are different, "running" takes effect at runtime(is recovered after rebooting) Mark it as verified, filed a new bug to trace the problem in #comment7 Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (nmstate bug fix and enhancement update), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2022:7991 |