Bug 1839158 - Cannot set any manual network interface device name in RHCOS4.3.z
Summary: Cannot set any manual network interface device name in RHCOS4.3.z
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: RHCOS
Version: 4.3.z
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
: 4.6.0
Assignee: Dusty Mabe
QA Contact: Michael Nguyen
URL:
Whiteboard:
Depends On:
Blocks: 1186913
TreeView+ depends on / blocked
 
Reported: 2020-05-22 15:27 UTC by Pushpendra Chavan
Modified: 2023-07-20 21:49 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-07-17 18:03:12 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 5222981 0 None None None 2020-07-15 02:13:32 UTC

Description Pushpendra Chavan 2020-05-22 15:27:06 UTC
Description of problem:
We can't force Red Hat CoreOS to accept custom Interface name except "Wired Connection 1". Installation works, whereas post installation, the NIC doesn't get up and post reboot, it gets the DHCP IP on Wired Connection 1 instead of static and the another custom device is down. Implementation is as follows.

Version-Release number of selected component (if applicable):
Red Hat OpenShift Container Platform 4.3

How reproducible:
always

Steps to Reproduce:
1. install RHOCP cluster RHCOS machine with below command line parameters.

coreos.inst=yes coreos.inst.install_dev=sda coreos.inst.image_url=http://192.168.0.11/ocp4/rhcos.raw.gz coreos.inst.ignition_url=http://192.168.0.11/ocp4/boostrap.ign ip=192.168.0.20::192.168.0.254:255.255.255.0:testmachine:pushpendra:none ifname=pushpendra:52:54:00:91:10:fa

2. The interface would be created with name "pushpendra" but wouldn't get IP
3. During next reboot, RHCOS would have an NIC with name Wired Connection 1 with a DHCP IP.

Actual results:
No custom Network interface name available

Expected results:
Customer Network interface names should be available.

Additional info:

The deployment was as follows.

Create a setup on a private kvm network.

DHCP server  =    192.168.0.254
Gateway      =    192.168.0.254
Network Mask =    255.255.255.0
Static IP    =    192.168.0.20
Interface    =    pushpendra
Http Web     =    http://192.168.0.11/rhcos43/
ign          =    http://192.168.0.11/rhcos43/bootstrao.ign
image        =    http://192.168.0.11/rhcos43/rhcos.raw.gz
NIC MAC      =    52:54:00:91:10:fa


Command line:

coreos.inst=yes coreos.inst.install_dev=sda coreos.inst.image_url=http://192.168.0.11/ocp4/rhcos.raw.gz coreos.inst.ignition_url=http://192.168.0.11/ocp4/boostrap.ign ip=192.168.0.20::192.168.0.254:255.255.255.0:testmachine:pushpendra:none ifname=pushpendra:52:54:00:91:10:fa

According to this command line, the interface name should be pushpendra and while firstboot, the interface was created but wasn't up, upon next reboot, the interface was up with _DHCP IP_ on an interface ens3, not on pushpendra which was down itself.

[root@localhost ~]# nmcli connection show 
NAME                UUID                                  TYPE      DEVICE 
Wired connection 1  b40e0973-fd3d-3174-aaf8-0a7f5873bc7d  ethernet  ens3   
pushpendra          d337478f-d433-4921-acd0-35e7315a0239  ethernet  --   

[root@localhost ~]# nmcli connection show pushpendra | egrep -v "\-\-"
connection.id:                          pushpendra
connection.uuid:                        d337478f-d433-4921-acd0-35e7315a0239
connection.type:                        802-3-ethernet
connection.interface-name:              pushpendra
connection.autoconnect:                 yes
connection.autoconnect-priority:        0
connection.autoconnect-retries:         -1 (default)
connection.multi-connect:               0 (default)
connection.auth-retries:                -1
connection.timestamp:                   0
connection.read-only:                   no
connection.autoconnect-slaves:          -1 (default)
connection.gateway-ping-timeout:        0
connection.metered:                     unknown
connection.lldp:                        default
connection.mdns:                        -1 (default)
connection.llmnr:                       -1 (default)
connection.wait-device-timeout:         -1
802-3-ethernet.speed:                   0
802-3-ethernet.auto-negotiate:          no
802-3-ethernet.mac-address:             52:54:00:91:10:FA
802-3-ethernet.mtu:                     auto
802-3-ethernet.wake-on-lan:             default
ipv4.method:                            manual
ipv4.dns-priority:                      0
ipv4.addresses:                         192.168.0.20/24
ipv4.gateway:                           192.168.0.254
ipv4.route-metric:                      -1
ipv4.route-table:                       0 (unspec)
ipv4.ignore-auto-routes:                no
ipv4.ignore-auto-dns:                   no
ipv4.dhcp-timeout:                      0 (default)
ipv4.dhcp-send-hostname:                yes
ipv4.never-default:                     no
ipv4.may-fail:                          yes
ipv4.dad-timeout:                       -1 (default)
ipv6.method:                            ignore
ipv6.dns-priority:                      0
ipv6.route-metric:                      -1
ipv6.route-table:                       0 (unspec)
ipv6.ignore-auto-routes:                no
ipv6.ignore-auto-dns:                   no
ipv6.never-default:                     no
ipv6.may-fail:                          yes
ipv6.ip6-privacy:                       -1 (unknown)
ipv6.addr-gen-mode:                     stable-privacy
ipv6.dhcp-send-hostname:                yes
proxy.method:                           none
proxy.browser-only:                     no

[root@localhost ~]# nmcli connection show Wired\ connection\ 1 | egrep -v "\-\-"
connection.id:                          Wired connection 1
connection.uuid:                        b40e0973-fd3d-3174-aaf8-0a7f5873bc7d
connection.type:                        802-3-ethernet
connection.interface-name:              ens3
connection.autoconnect:                 yes
connection.autoconnect-priority:        -999
connection.autoconnect-retries:         -1 (default)
connection.multi-connect:               0 (default)
connection.auth-retries:                -1
connection.timestamp:                   1588851404
connection.read-only:                   no
connection.autoconnect-slaves:          -1 (default)
connection.gateway-ping-timeout:        0
connection.metered:                     unknown
connection.lldp:                        default
connection.mdns:                        -1 (default)
connection.llmnr:                       -1 (default)
connection.wait-device-timeout:         -1
802-3-ethernet.speed:                   0
802-3-ethernet.auto-negotiate:          no
802-3-ethernet.mtu:                     auto
802-3-ethernet.wake-on-lan:             default
ipv4.method:                            auto
ipv4.dns-priority:                      0
ipv4.route-metric:                      -1
ipv4.route-table:                       0 (unspec)
ipv4.ignore-auto-routes:                no
ipv4.ignore-auto-dns:                   no
ipv4.dhcp-timeout:                      0 (default)
ipv4.dhcp-send-hostname:                yes
ipv4.never-default:                     no
ipv4.may-fail:                          yes
ipv4.dad-timeout:                       -1 (default)
ipv6.method:                            auto
ipv6.dns-priority:                      0
ipv6.route-metric:                      -1
ipv6.route-table:                       0 (unspec)
ipv6.ignore-auto-routes:                no
ipv6.ignore-auto-dns:                   no
ipv6.never-default:                     no
ipv6.may-fail:                          yes
ipv6.ip6-privacy:                       -1 (unknown)
ipv6.addr-gen-mode:                     stable-privacy
ipv6.dhcp-send-hostname:                yes
proxy.method:                           none
proxy.browser-only:                     no
GENERAL.NAME:                           Wired connection 1
GENERAL.UUID:                           b40e0973-fd3d-3174-aaf8-0a7f5873bc7d
GENERAL.DEVICES:                        ens3
GENERAL.STATE:                          activated
GENERAL.DEFAULT:                        yes
GENERAL.DEFAULT6:                       no
GENERAL.VPN:                            no
GENERAL.DBUS-PATH:                      /org/freedesktop/NetworkManager/ActiveConnection/1
GENERAL.CON-PATH:                       /org/freedesktop/NetworkManager/Settings/2
IP4.ADDRESS[1]:                         192.168.0.16/24
IP4.GATEWAY:                            192.168.0.254
IP4.ROUTE[1]:                           dst = 0.0.0.0/0, nh = 192.168.0.254, mt = 100
IP4.ROUTE[2]:                           dst = 192.168.0.0/24, nh = 0.0.0.0, mt = 100
IP4.DNS[1]:                             192.168.0.254
IP4.DOMAIN[1]:                          example.com
DHCP4.OPTION[1]:                        broadcast_address = 192.168.0.255
DHCP4.OPTION[2]:                        dhcp_lease_time = 86342
DHCP4.OPTION[3]:                        dhcp_rebinding_time = 75549
DHCP4.OPTION[4]:                        dhcp_renewal_time = 43171
DHCP4.OPTION[5]:                        dhcp_server_identifier = 192.168.0.254
DHCP4.OPTION[6]:                        domain_name = example.com
DHCP4.OPTION[7]:                        domain_name_servers = 192.168.0.254
DHCP4.OPTION[8]:                        expiry = 1588937746
DHCP4.OPTION[9]:                        ip_address = 192.168.0.16
DHCP4.OPTION[10]:                       ntp_servers = 192.168.0.254
DHCP4.OPTION[11]:                       requested_broadcast_address = 1
DHCP4.OPTION[12]:                       requested_dhcp_server_identifier = 1
DHCP4.OPTION[13]:                       requested_domain_name = 1
DHCP4.OPTION[14]:                       requested_domain_name_servers = 1
DHCP4.OPTION[15]:                       requested_domain_search = 1
DHCP4.OPTION[16]:                       requested_host_name = 1
DHCP4.OPTION[17]:                       requested_interface_mtu = 1
DHCP4.OPTION[18]:                       requested_ms_classless_static_routes = 1
DHCP4.OPTION[19]:                       requested_nis_domain = 1
DHCP4.OPTION[20]:                       requested_nis_servers = 1
DHCP4.OPTION[21]:                       requested_ntp_servers = 1
DHCP4.OPTION[22]:                       requested_rfc3442_classless_static_routes = 1
DHCP4.OPTION[23]:                       requested_root_path = 1
DHCP4.OPTION[24]:                       requested_routers = 1
DHCP4.OPTION[25]:                       requested_static_routes = 1
DHCP4.OPTION[26]:                       requested_subnet_mask = 1
DHCP4.OPTION[27]:                       requested_time_offset = 1
DHCP4.OPTION[28]:                       requested_wpad = 1
DHCP4.OPTION[29]:                       routers = 192.168.0.254
DHCP4.OPTION[30]:                       subnet_mask = 255.255.255.0
IP6.ADDRESS[1]:                         fe80::6014:2f:692e:c6/64
IP6.ROUTE[1]:                           dst = fe80::/64, nh = ::, mt = 100
IP6.ROUTE[2]:                           dst = ff00::/8, nh = ::, mt = 256, table=255

[root@localhost ~]# nmcli device status 
DEVICE  TYPE      STATE      CONNECTION         
ens3    ethernet  connected  Wired connection 1 
lo      loopback  unmanaged  --                 

[root@localhost ~]# nmcli device show   
GENERAL.DEVICE:                         ens3
GENERAL.TYPE:                           ethernet
GENERAL.HWADDR:                         52:54:00:91:10:FA
GENERAL.MTU:                            1500
GENERAL.STATE:                          100 (connected)
GENERAL.CONNECTION:                     Wired connection 1
GENERAL.CON-PATH:                       /org/freedesktop/NetworkManager/ActiveConnection/1
WIRED-PROPERTIES.CARRIER:               on
IP4.ADDRESS[1]:                         192.168.0.16/24
IP4.GATEWAY:                            192.168.0.254
IP4.ROUTE[1]:                           dst = 0.0.0.0/0, nh = 192.168.0.254, mt = 100
IP4.ROUTE[2]:                           dst = 192.168.0.0/24, nh = 0.0.0.0, mt = 100
IP4.DNS[1]:                             192.168.0.254
IP4.DOMAIN[1]:                          example.com
IP6.ADDRESS[1]:                         fe80::6014:2f:692e:c6/64
IP6.GATEWAY:                            --
IP6.ROUTE[1]:                           dst = fe80::/64, nh = ::, mt = 100
IP6.ROUTE[2]:                           dst = ff00::/8, nh = ::, mt = 256, table=255

GENERAL.DEVICE:                         lo
GENERAL.TYPE:                           loopback
GENERAL.HWADDR:                         00:00:00:00:00:00
GENERAL.MTU:                            65536
GENERAL.STATE:                          10 (unmanaged)
GENERAL.CONNECTION:                     --
GENERAL.CON-PATH:                       --
IP4.ADDRESS[1]:                         127.0.0.1/8
IP4.GATEWAY:                            --
IP6.ADDRESS[1]:                         ::1/128
IP6.GATEWAY:                            --
IP6.ROUTE[1]:                           dst = ::1/128, nh = ::, mt = 256

Comment 2 Micah Abbott 2020-05-26 13:48:05 UTC
Setting priority as medium and targeting for 4.6;  we are currently working on fixing BZs for 4.5 and do not believe we will have the ability to address this for the 4.5 release.

Comment 4 Dusty Mabe 2020-06-10 04:31:32 UTC
This bug has not been selected for work in the current sprint.

Comment 5 Dusty Mabe 2020-06-26 18:44:05 UTC
Hey Pushpendra,

Right now we don't persiste the `ifname=` information from the first boot's kargs for subsequent boots. I started a discussion upstream to see if this is something we should change: https://github.com/coreos/fedora-coreos-tracker/issues/553

Though right now you can just persist this information yourself by modifying the Ignition passed to the machine and creating a file like the following (in addition to the `ifname=` karg):


```
$ cat /etc/systemd/network/25-pushpendra.link 
[Match]
MACAddress=52:54:00:91:10:fa
[Link]
Name=pushpendra
```

The `ifname=` karg will make sure the interface gets the right name during the initramfs (though probably not strictly required). The `25-pushpendra.link` will make sure it gets renamed properly for all subsequent boots of the machine.

Comment 7 Dusty Mabe 2020-06-26 20:46:21 UTC
This is being worked on, but is currently awaiting more investigation or more information and won't be completed this sprint.

Comment 9 Dusty Mabe 2020-07-13 13:44:06 UTC
Hi Pushpendra, have you had a chance to try out the workaround to see if that gets you unblocked?

Comment 10 Pushpendra Chavan 2020-07-14 05:06:55 UTC
(In reply to Dusty Mabe from comment #9)
> Hi Pushpendra, have you had a chance to try out the workaround to see if
> that gets you unblocked?

Dusty, 

Apologies for not responding earlier, I had this tested and it works perfectly fine for me.

This was an additional details I have added in my ignition as follows and then appended rest information.

  "storage": {
    "files": [
      {
        "filesystem": "root",
        "path": "/etc/systemd/network/25-pushpendra.link",
        "user": {
          "name": "root"
        },
        "contents": {
          "source": "data:text/plain;charset=utf-8;base64,W01hdGNoXQpNQUNBZGRyZXNzPTUyOjU0OjAwOmJiOmQ5OjFiCltMaW5rXQpOYW1lPXB1c2hwZW5kcmE=",
          "verification": {}
        },
        "mode": 384
      },

The base64 encoding decodes to following for the file /etc/systemd/network/25-pushpendra.link

[Match]
MACAddress=52:54:00:bb:d9:1b
[Link]
Name=pushpendra

And upon deployment, I had this interface name.

[core@bootstrap ~]$ ifconfig -a pushpendra
pushpendra: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.0.2  netmask 255.255.255.0  broadcast 192.168.0.255
        inet6 fe80::cb02:7e3a:a16a:ecca  prefixlen 64  scopeid 0x20<link>
        ether 52:54:00:bb:d9:1b  txqueuelen 1000  (Ethernet)
        RX packets 3124  bytes 3847495 (3.6 MiB)
        RX errors 0  dropped 416  overruns 0  frame 0
        TX packets 2503  bytes 232252 (226.8 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 12412

Thank you!

So right now, we have this functionality, just ifname isn't available yet.

Comment 11 Dusty Mabe 2020-07-15 13:42:17 UTC
No problem. I'm glad it worked for you.

> So right now, we have this functionality, just ifname isn't available yet.

When you say "just ifname isn't available yet." what are you referring to? An outstanding issue?

Comment 12 Pushpendra Chavan 2020-07-16 08:28:48 UTC
> When you say "just ifname isn't available yet." what are you referring to?
> An outstanding issue?

Dusty, I just read through the complete discussion at https://github.com/coreos/fedora-coreos-tracker/issues/553#issuecomment-658949868

So looks like we aren't going to implement ifname in anytime soon, is that correct? If that's the situation, then I think we can live with the solution provided by you as per #5

Comment 13 Dusty Mabe 2020-07-16 13:21:48 UTC
(In reply to Pushpendra Chavan from comment #12)
> > When you say "just ifname isn't available yet." what are you referring to?
> > An outstanding issue?
> 
> Dusty, I just read through the complete discussion at
> https://github.com/coreos/fedora-coreos-tracker/issues/553#issuecomment-
> 658949868
> 
> So looks like we aren't going to implement ifname in anytime soon, is that
> correct? If that's the situation, then I think we can live with the solution
> provided by you as per #5

Hey Pushpendra. Thanks for following along the upstream discussion!

Correct. Since there is an easy workaround of creating a file to do the renaming we've currently decided to wait and see if there is more demand for this feature.

Thank you for confirming the workaround will suffice for now. I'm thinking that we will close this bug as WONTFIX for now and re-open if we get new information.

Comment 14 Dusty Mabe 2023-07-20 21:49:20 UTC
Update: this has now been fixed upstream such that passing `ifname` on first boot (ignition boot) of the machine will propagate rules forward to the real root and subsequent boots will use that NIC name.

See https://github.com/coreos/fedora-coreos-tracker/issues/553#issuecomment-1535341715

Comment 15 Dusty Mabe 2023-07-20 21:49:38 UTC
The code should make it into 4.14.


Note You need to log in before you can comment on or make changes to this bug.