Bug 1310672

Summary: Custom udev rules not renaming interfaces as expected - /etc/udev/rules.d/71-net-mrf.rules
Product: Red Hat Enterprise Linux 6 Reporter: Fani Orestiadou <forestia>
Component: biosdevnameAssignee: Michal Sekletar <msekleta>
Status: CLOSED INSUFFICIENT_DATA QA Contact: Release Test Team <release-test-team>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.4CC: forestia, harald, jruemker, msekleta, ppostler, shobbs, udev-maint-list
Target Milestone: rcKeywords: Reopened
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-08-12 18:25:04 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:    
Bug Blocks: 1269194, 1356047    
Attachments:
Description Flags
Sosreports after the suggested changes of udev rules
none
traces level "debug" /etc/udev/udev.conf
none
Sosreport with devug packages installed none

Description Fani Orestiadou 2016-02-22 13:41:48 UTC
Description of problem: Udev rules are created to rename the interfaces, but one of them stays "renameX" instead of "ethX"


Version-Release number of selected component (if applicable):
Red Hat Enterprise Linux Server release 6.4
2.6.32-358.28.1.el6.x86_64

How reproducible: After reboot but issue disappears after power cycle


Actual results:
DMSEG output
udev: renamed network interface eth2 to rename4
udev: renamed network interface eth1 to rename3
udev: renamed network interface eth0 to rename2
udev: renamed network interface eth8 to rename10
udev: renamed network interface eth9 to rename11
udev: renamed network interface eth1 to eth2
udev: renamed network interface eth0 to eth10
udev: renamed network interface rename10 to eth0
udev: renamed network interface rename11 to eth1
udev: renamed network interface eth4 to rename6 <---
udev: renamed network interface eth7 to eth8
udev: renamed network interface eth6 to eth9
udev: renamed network interface rename4 to eth7
udev: renamed network interface rename2 to eth4
udev: renamed network interface eth5 to eth6 <---
udev: renamed network interface rename3 to eth5


Expected results:
udev: renamed network interface eth2 to rename4
udev: renamed network interface eth1 to rename3
udev: renamed network interface eth0 to rename2
udev: renamed network interface eth8 to eth10
udev: renamed network interface eth5 to eth11
udev: renamed network interface eth7 to eth8
udev: renamed network interface rename4 to eth7
udev: renamed network interface eth4 to rename6 
udev: renamed network interface rename3 to eth5
udev: renamed network interface rename2 to eth4
udev: renamed network interface eth6 to eth9
udev: renamed network interface rename6 to eth6

Additional info:

Udev rules

$ cat etc/udev/rules.d/71-net-mrf.rules 
# IP Network Device Naming Rules for MRF

SUBSYSTEM!="net", GOTO="net_mrf_rules_end"
KERNEL!="eth*",   GOTO="net_mrf_rules_end"
ACTION!="add",    GOTO="net_mrf_rules_end"

# Check for model types of MRF that require net device remapping
ATTR{[dmi/id]product_name}=="ProLiant DL380p Gen8", GOTO="dl380g8"
ATTR{[dmi/id]product_name}=="ProLiant DL380 G6",    GOTO="dl380g6"
GOTO="net_mrf_rules_end"

############################################
# ProLiant DL380 G6 RMS Shelf with 2 x NC365T
LABEL="dl380g6"
PROGRAM="/sbin/biosdevname -i %k",NAME="%c",OPTIONS+="string_escape=replace"

# Top-Down Left-Right

# Top    slot#1 (if any Emmerson board)
NAME=="p1p4",NAME="eth15"
NAME=="p1p3",NAME="eth14"
NAME=="p1p2",NAME="eth13"
NAME=="p1p1",NAME="eth12"

# Medium slot#2 (labs: may be empty)
NAME=="p2p4",NAME="eth7"
NAME=="p2p3",NAME="eth6"
NAME=="p2p2",NAME="eth5"
NAME=="p2p1",NAME="eth4"

# Bottom slot#3 (mandatory)
NAME=="p3p4",NAME="eth11"
NAME=="p3p3",NAME="eth10"
NAME=="p3p2",NAME="eth9"
NAME=="p3p1",NAME="eth8"

# Embedded in mother board
NAME=="em4",NAME="eth3"
NAME=="em3",NAME="eth2"
NAME=="em2",NAME="eth1"
NAME=="em1",NAME="eth0"

GOTO="net_mrf_rules_end"

############################################
# ProLiant DL380 Gen8 RMS Shelf
LABEL="dl380g8"
PROGRAM="/sbin/biosdevname -i %k",NAME="%c",OPTIONS+="string_escape=replace"

# Top-Down Left-Right

# Top    slot#1 (if any Emmerson board)
NAME=="p1p4",NAME="eth15"
NAME=="p1p3",NAME="eth14"
NAME=="p1p2",NAME="eth13"
NAME=="p1p1",NAME="eth12"

# Medium slot#2 (labs: may be empty)
NAME=="p2p4",NAME="eth3"
NAME=="p2p3",NAME="eth7"
NAME=="p2p2",NAME="eth5"
NAME=="p2p1",NAME="eth4"

# Bottom slot#3 (mandatory)
NAME=="p3p4",NAME="eth8"
NAME=="p3p3",NAME="eth9"
NAME=="p3p2",NAME="eth11"
NAME=="p3p1",NAME="eth6"

# Embedded in mother board
NAME=="em4",NAME="eth10"
NAME=="em3",NAME="eth2"
NAME=="em2",NAME="eth1"
NAME=="em1",NAME="eth0"

GOTO="net_mrf_rules_end"

############################################

LABEL="net_mrf_rules_end"

Comment 1 Harald Hoyer 2016-02-22 13:47:39 UTC
reminds me of https://bugzilla.redhat.com/show_bug.cgi?id=1308420

Comment 2 Harald Hoyer 2016-02-22 13:49:29 UTC
Well, general rule of thumb:
1. do not rename in the "eth*" namespace
2. if you do, you have to specify every interface, which will appear
3. don't forget to generate ifcfg-* files with HWADDR for every interface, which will appear
4. see 1.

Comment 4 Harald Hoyer 2016-02-22 14:19:33 UTC
In essence: use "net[0-9]" and you will have no "rename*" problems

Comment 12 Fani Orestiadou 2016-03-01 08:09:07 UTC
Created attachment 1131815 [details]
Sosreports after the suggested changes of udev rules

Comment 13 Fani Orestiadou 2016-03-01 08:11:46 UTC
Created attachment 1131816 [details]
traces level "debug" /etc/udev/udev.conf

Comment 16 Harald Hoyer 2016-03-01 17:13:59 UTC
(In reply to Fani Orestiadou from comment #13)
> Created attachment 1131816 [details]
> traces level "debug" /etc/udev/udev.conf

not very helpful

Comment 19 Harald Hoyer 2016-03-08 12:10:17 UTC
In the error case, what is the output of:

# cd /sys/class/net
# for i in *; do biosdevname -i "$i";done

Comment 28 Fani Orestiadou 2016-04-05 13:27:49 UTC
Created attachment 1143842 [details]
Sosreport with devug packages installed

Comment 33 John Ruemker 2016-08-12 18:25:04 UTC
By my reading of the comments here and the case, we have narrowed down the issue to a problem in biosdevname, but we require additional input from the customer's reproduction of this issue in order to properly diagnose it.  The customer case has been closed due to inactivity, so we are not expecting any forthcoming details.  As such, I am closing this bug.  If there are any customers actively experiencing this issue, you may reopen the bug report with details.