Bug 1948536

Summary: [DDF] Predictable NIC names for the undercloud, It seems this is done overly complex.
Product: Red Hat OpenStack Reporter: Direct Docs Feedback <ddf-bot>
Component: documentationAssignee: Vlada Grosu <vgrosu>
Status: CLOSED NEXTRELEASE QA Contact: Jose Luis Franco <jfrancoa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 16.2 (Train)CC: afariasa, gregraka, hjensas, jfrancoa, jpretori, kthakre, lbezdick, svigan, vgrosu
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1987261 (view as bug list) Environment:
Last Closed: 2021-07-29 16:05:27 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1975448, 1987261    

Description Direct Docs Feedback 2021-04-12 11:52:32 UTC
It seems this is done overly complex.

A) If you just stick the current "ethX" name in 70-rhosp-persistent-net.rules the nic's would be named "ethX" after Leapp and there would be no need to change manipulate all the config files in network-scripts.

Also, it seems quite possible to figure out the predictable naming that would be used automatically after Leapp by using the udevadm command, for example:

$ udevadm test-builtin net_id /sys/class/net/eth0 2>/dev/null
ID_NET_NAME_MAC=enxfa163e44e79f
ID_NET_NAME_PATH=enp0s3
ID_NET_NAME_SLOT=ens3

$ udevadm test-builtin net_id /sys/class/net/eth1 2>/dev/null
ID_NET_NAME_MAC=enxfa163e8d5fd6
ID_NET_NAME_PATH=enp0s4
ID_NET_NAME_SLOT=ens4

$ udevadm test-builtin net_id /sys/class/net/eth2 2>/dev/null
ID_NET_NAME_MAC=enxfa163e1adf79
ID_NET_NAME_PATH=enp0s5
ID_NET_NAME_SLOT=ens5


B) This does'nt update the local_interface in undercloud.conf, and it does not change from "ethX" in /etc/os-net-config/config.json

Reported by: rhn-gps-hjensas

https://access.redhat.com/documentation/en-us/red_hat_openstack_platform/16.1/html/framework_for_upgrades_13_to_16.1/preparing-for-the-undercloud-upgrade#annotations:a041ae21-e033-4a83-99aa-fa3a4771570e

Comment 2 Jose Luis Franco 2021-05-05 10:07:03 UTC
Hello Harald,

Thanks a lot for your suggestion. As discussed, I have two comments:

A) Regarding the first approach, this would be a good solution if Leapp didn't have a blocking mechanism. If you run leapp upgrade and the system has one single interface with unpredictable naming (ethX) then Leapp will block the upgrade. For that reason we are required to convert to a predictable name schema before upgrading to RHEL8.

B) This is something which has been reported already by multiple customers and even internally. We will add this script to our CI and add the modification of undercloud.conf and /etc/os-net-config/config.json as part of it. Once it will be properly tested we will update the docs.

Comment 4 Jose Luis Franco 2021-05-11 10:37:12 UTC
After adding it into our CI jobs, the following task seems to be working when renaming the interfaces from non-predictable to predictable:

    - name: Replace interface name in undercloud.conf and /etc/os-net-config/config.json
      replace:
        path: "{{ item }}"
        regexp: 'eth'
        replace: "{{ prefix }}"
      loop:
        - "{{ undercloud_conf }}"
        - "/etc/os-net-config/config.json"

We can solve this BZ by either adding this task in playbook-nics.yaml (but this would be valid only when running it on the Undercloud, another way to make sure it's running only for the Undercloud would be checking if the undercloud.conf file exists and if it does, run the replacement for that file. The /etc/os-net-config/config.json is present in all nodes, so it won't harm in the overcloud nodes) https://access.redhat.com/documentation/en-us/red_hat_openstack_platform/16.1/html-single/framework_for_upgrades_13_to_16.1/index#using-predictable-nic-names-preparing-undercloud or we could include some paragraph to suggest the user to replace it via sed command in both files:

* Section 4.3: https://access.redhat.com/documentation/en-us/red_hat_openstack_platform/16.1/html-single/framework_for_upgrades_13_to_16.1/index#using-predictable-nic-names-preparing-undercloud

4. Replace any reference to the old non-predictable interface names in undercloud.conf and /etc/os-net-config/config.json:
 
 sed -i -Ee "s/eth([0..9]+)/em\\1/g" undercloud.conf
 sed -i -Ee "s/eth([0..9]+)/em\\1/g" /etc/os-net-config/config.json

5. Reboot the undercloud node using the standard reboot procedures. For more information, see "Rebooting nodes".

Comment 5 Jose Luis Franco 2021-05-11 10:44:00 UTC
*** Bug 1945861 has been marked as a duplicate of this bug. ***