Bug 1660179

Summary: rhel-guest-image using Predictable Device Names rather than eth
Product: Red Hat Enterprise Linux 8 Reporter: Robert Locke <rlocke>
Component: rhel-guest-imageAssignee: Mohammed Gamal <mmorsy>
Status: CLOSED CURRENTRELEASE QA Contact: Wei Shi <wshi>
Severity: unspecified Docs Contact:
Priority: medium    
Version: 8.0CC: ftaylor, jgreguske, jwboyer, linl, ribarry, wshi
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-07-09 10:46:17 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:
Bug Depends On: 1643347    
Bug Blocks:    

Description Robert Locke 2018-12-17 17:37:56 UTC
Description of problem:
The updating of Grub2 according to /root/anaconda-ks.cfg to use net.ifnames did not take effect for the initial kernel.

Version-Release number of selected component (if applicable):
8.0 Beta and 8.0 Beta Snapshot 2

How reproducible:
Every time

Steps to Reproduce:
1. Boot the VM on top of RHEL 8 host
2. Inside the VM, the 2 VirtIO NICs will have names of ens3 and ens4

Actual results:
The NICs are using the newer "Predictable Network Interface Device Names" which is helpful in physical environments, but less so in virtual environments.

Expected results:
Continue the eth0 style naming as used in RHEL 7.x

Additional info:
This is related to the shift in RHEL 8 to use BLS (Boot Loader Spec).

The following three lines are affected in anaconda-ks.cfg:
# reorder console entries
sed -i 's/console=tty0/console=tty0 console=ttyS0,115200n8/' /boot/grub2/grub.cfg

# add additional flags for the running image
sed -i -e 's/115200n8/115200n8 no_timer_check net.ifnames=0/' /boot/grub2/grub.cfg

# make grub changes persistent
sed -i -e 's/^\{GRUB_CMDLINE_LINUX=.*\}"/\1 no_timer_check net.ifnames=0 console=ttyS0m115200n8"/' /etc/default/grub

It is the first two sed's that are having no effect because they need to edit the /boot/grub2/grubenv file and the kernelopts line to update the "existing" BLS entries. In fact, I *think* a line like:
# adjust existing BLS entries
sed -i -e 's/^\{kernelopts=.*\}/\1 no_timer_check net.ifnames=0 console=ttyS0m115200n8/' /boot/grub2/grubenv

I'll do some testing to see if that last line helps/works for me.

Comment 1 Robert Locke 2018-12-17 21:51:06 UTC
FYI, I would also be happy if we adopted shifting to using prefixdevname with RHEL8.

Change the above lines to be:
# adjust existing BLS entries
sed -i -e 's/^\(kernelopts=.*\)/\1 no_timer_check net.ifnames.prefix=net/' /boot/grub2/grubenv

# make grub changes persistent
sed -i -e 's/^\(GRUB_CMDLINE_LINUX=.*\)"/\1 no_timer_check net.ifnames.prefix=net"/' /etc/default/grub

Comment 2 Robert Locke 2019-03-13 14:22:55 UTC
This is different in the Snapshot 6 qcow2 made available where the net.ifnames=0 has been fully implemented for both initial boot and subsequent kernel updates.

The shift to net.ifnames.prefix=net had further complications, so I am glad we are not going that direction at this point.

Presuming the net.ifnames=0 persists to GA, I think this bug can be closed based on the work accomplished in https://bugzilla.redhat.com/show_bug.cgi?id=1643347

Comment 3 Mohammed Gamal 2019-07-09 10:46:17 UTC
Closing this as the requested change is already implemented. We should consider removing net.ifnames=0 altogether in the future. See BZ#1660122