Bug 1660179 - rhel-guest-image using Predictable Device Names rather than eth
Summary: rhel-guest-image using Predictable Device Names rather than eth
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: rhel-guest-image
Version: 8.0
Hardware: Unspecified
OS: Unspecified
medium
unspecified
Target Milestone: rc
: ---
Assignee: Mohammed Gamal
QA Contact: Wei Shi
URL:
Whiteboard:
Depends On: 1643347
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-12-17 17:37 UTC by Robert Locke
Modified: 2019-07-09 10:46 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-07-09 10:46:17 UTC
Type: Bug
Target Upstream Version:


Attachments (Terms of Use)

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


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