Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 906244

Summary: [Hyper-v][RHEL6.4]The Hyper-V guest NIC name(ethN) changed when remove and reload the hv_netvsc driver
Product: Red Hat Enterprise Linux 6 Reporter: Shengnan Wang <shwang>
Component: udevAssignee: Harald Hoyer <harald>
Status: CLOSED CURRENTRELEASE QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.4CC: dnie, jingli, kvolny, leiwang, shwang, udev-maint-list, vkuznets, xuli, yacao
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1032396 (view as bug list) Environment:
Last Closed: 2015-03-27 08:25:03 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:
Embargoed:
Bug Depends On:    
Bug Blocks: 1032396    
Attachments:
Description Flags
udevadm_monitor_output_modprobe_hv_netvsc.jpg
none
udevadm_monitor_output_modprobe_-r_hv_netvsc.jpg
none
var_log_messages_reload_hv_netvsc.txt
none
var_log_messages_remove_hv_netvsc.txt
none
rename_device_log.txt none

Description Shengnan Wang 2013-01-31 09:55:36 UTC
Description of problem:
This issue has been discussed in the bug 834690. 

1) Install the RHEL6.4 guest with 2 nics on hyper-v host. Both of the two NICs have IP and works well. The ifcfg file of the two devices are as below:
# cat ifcfg-eth0
DEVICE="eth0"
BOOTPROTO="dhcp"
HWADDR="00:15:5D:48:0C:28"
IPV6INIT="yes"
MTU="1500"
NM_CONTROLLED="yes"
ONBOOT="yes"
TYPE="Ethernet"
UUID="7e3b55dd-bd46-4476-895f-400f643c94a7"

# cat ifcfg-eth1
DEVICE="eth1"
BOOTPROTO="dhcp"
HWADDR="00:15:5D:48:0C:29"
IPV6INIT="yes"
MTU="1500"
NM_CONTROLLED="yes"
ONBOOT="yes"
TYPE="Ethernet"
#UUID="7e3b55dd-bd46-4476-895f-400f643c94a7"

2) Remove the nic with the name eth0. Now the eth1 has its ip address and the network is avaible(check the network via "ifconfig -a"):
# ifconfig -a
eth1      Link encap:Ethernet  HWaddr 00:15:5D:48:0C:29  
          inet addr:10.66.73.168  Bcast:10.66.73.255  Mask:255.255.254.0
          inet6 addr: fe80::215:5dff:fe48:c29/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:288 errors:0 dropped:0 overruns:0 frame:0
          TX packets:15 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:23247 (22.7 KiB)  TX bytes:1452 (1.4 KiB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

3) After removing and reloading the network driver (hv_netvsc), the guest nic name (ethN) will be changed. 
During removing hv_netvsc (modprobe -r hv_netvsc):
- Output of '# udevadm monitor': see attachment "udevadm_monitor_output_modprobe_-r_hv_netvsc.jpg".
- Var log message of '# udevadm control --log-priority=debug': see "var_log_messages_remove_hv_netvsc.txt"

During reloading hv_netvsc (modprobe hv_netvsc):
- Output of '# udevadm monitor': see attachment "udevadm_monitor_output_modprobe_hv_netvsc.jpg".
- Var log message of '# udevadm control --log-priority=debug': "var_log_messages_reload_hv_netvsc.txt"
- Output of udevadm info:
# udevadm info --query=all --path /sys/class/net/eth0
custom logging function 0x27f7018 registered
selinux=1
calling: info
device 0x2807778 has devpath '/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A03:00/device:07/VMBus:00/vmbus_0_9/net/eth0'
P: /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A03:00/device:07/VMBus:00/vmbus_0_9/net/eth0
E: UDEV_LOG=7
E: DEVPATH=/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A03:00/device:07/VMBus:00/vmbus_0_9/net/eth0
E: INTERFACE=eth0
E: IFINDEX=3
E: SUBSYSTEM=net
- Output of 'strace':
# export INTERFACE=eth0
# strace -f /lib/udev/rename_device
(the output is in the file attached "rename_device_log.txt")

4) Check the guest network with "ifconfig -a" after step 3, the guest fails to get ip with restart the network directly. The only one nic named "eth0". However, its HWADDR is the HWADDR of eth1. So fail to restart the network with "service network restart":
# ifconfig -a
eth0      Link encap:Ethernet  HWaddr 00:15:5D:48:0C:29  
          BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

Version-Release number of selected component (if applicable):
Host: Windows 2008 R2 Hyper-V Server Core
      Windows 2012 Hyper-V Server Core
Guest: Both RHEL6.4 i386 & RHEL6.4 x86_64 (2.6.32-356.el6)
       Udev version: udev-147-2.43.el6

How reproducible:
100%

Steps to Reproduce:
As above.

Actual results:
At step4, the guest doesn't have ip now. And it is useless to restart the network directly. The Hyper-V guest NIC name changed.

Expected results:
At step4, the Hyper-V guest NIC name doesn't change and the network is available after reloading the hv_netvsc driver.

Additional info:
1. This issue has been discussed in the bug 834690 comment 20 ~ comment 53 . 
2. There is a workround that modify the HWADDR in the file ifcfg-eth0 to the "ifconfig -a" output value. Restart the network. Then the guest gets ip. And the network is available.

Comment 1 Shengnan Wang 2013-01-31 09:56:58 UTC
Created attachment 690803 [details]
udevadm_monitor_output_modprobe_hv_netvsc.jpg

Comment 2 Shengnan Wang 2013-01-31 09:58:19 UTC
Created attachment 690804 [details]
udevadm_monitor_output_modprobe_-r_hv_netvsc.jpg

Comment 3 Shengnan Wang 2013-01-31 09:58:50 UTC
Created attachment 690805 [details]
var_log_messages_reload_hv_netvsc.txt

Comment 4 Shengnan Wang 2013-01-31 09:59:41 UTC
Created attachment 690806 [details]
var_log_messages_remove_hv_netvsc.txt

Comment 5 Shengnan Wang 2013-01-31 10:00:15 UTC
Created attachment 690807 [details]
rename_device_log.txt

Comment 6 Karel Volný 2013-01-31 10:59:38 UTC
just a note ...

I've tried the test scenario using qemu instead of hyper-v

the NICs created by qemu are driven by the module 8139cp

it seems that on the first run udev writes /etc/udev/rules.d/70-persistent-net.rules

then this file is responsible for renaming of the interfaces - if eth0 is removed, eth1 becomes the new eth0 but based on the MAC it is renamed back to eth1 (for forgetful like me - you have to specify MACs on qemu commandline, otherwise you'll end up removing eth1 instead of eth0 :-))

this renaming works not just on system boot, but also if the 8139cp module is removed then modprobed again

so, my question would be, why /etc/udev/rules.d/70-persistent-net.rules isn't involved in your scenario?

Comment 7 dnie 2013-09-04 09:21:19 UTC
I encounter the similar issue.
Environment: Hyper-V Manager 2012 + RHEL6.5_x86 kernal: 2.6.32-415.el6.i686
My NIC name is eth2, modprobe -r hv_netvsc and modprobe hv_netvsc
the NIC eth2 disappear and display eth0 then service network restart
It tell "Device eth2 does not seem to be present, delaying initialization", so
you only need reboot OS to receive IP. after reboot eth2 is ok, eth0 disappear(In fact I don't have eth0)
I use "Network Adapter" not "Legacy Network Adapter"

Comment 8 RHEL Program Management 2013-10-14 04:20:10 UTC
This request was not resolved in time for the current release.
Red Hat invites you to ask your support representative to
propose this request, if still desired, for consideration in
the next release of Red Hat Enterprise Linux.

Comment 10 Harald Hoyer 2015-03-04 08:37:12 UTC
(In reply to Shengnan Wang from comment #0)
> 4) Check the guest network with "ifconfig -a" after step 3, the guest fails
> to get ip with restart the network directly. The only one nic named "eth0".

If there is only _one_ NIC with "ifconfig -a", what is the contents of:
# ls -l /sys/class/net/

??

If the kernel module only initializes _one_ NIC, what can udev do about it? udev does not and can not magically remove any interface.

Comment 11 Yaju Cao 2015-03-05 02:43:31 UTC
(In reply to Harald Hoyer from comment #10)
> (In reply to Shengnan Wang from comment #0)
> > 4) Check the guest network with "ifconfig -a" after step 3, the guest fails
> > to get ip with restart the network directly. The only one nic named "eth0".
> 
> If there is only _one_ NIC with "ifconfig -a", what is the contents of:
> # ls -l /sys/class/net/
> 
> ??
> 
> If the kernel module only initializes _one_ NIC, what can udev do about it?
> udev does not and can not magically remove any interface.

I have tried with RHEL6.6, there is no this issue in RHEL6.6 now. After step 3, the second NIC can be renamed correctly after modprobe the hv_netvsc again.

Comment 12 Yaju Cao 2015-03-27 08:25:03 UTC
Close this bug as there is no this issue since RHEL6.6, see Comment 11.