Bug#810247: Hyper-V network adapters are mapped to a different interface (ethN) on every boot
Package: linux-image-3.16.0-4-amd64
Version: 3.16.7-ckt20-1+deb8u2
On a Hyper-V VM with more than one network adapter, the NIC devices are being mapped to different ethN on every boot.
If you are using dhcp reservation or static IPs, you will likely lose connectivity to the VM.
Expected behavior is that the NICs are always detected in the same order and consistently mapped to the same interface.
The udev persistent rules could be a workaround, but they are created for virtual environment.
To reproduce:
Add more than one NIC to the Hyper-V VM (I can consistently reproduce with 3 NICs - I have tried only with synthetic NICs, not legacy).
Reboot the server and check that the interface MACs are switched - apparently in a random order.
The issue reproduced on both Hyper-V 2008 R2 and Hyper-V 2012 R2.
The issue was not observed on Debian Wheezy (kernel 3.2).
After upgrading to kernel 4.2 from jessie-backports, the issue is also not reproducible.
Kernel:
Linux debian 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt20-1+deb8u2 (2016-01-02) x86_64 GNU/Linux
Libc6
root@debian:~# dpkg -s libc6 | grep Version
Version: 2.19-18+deb8u1
Example of one boot:
=========================================================
eth0 - vmbus_0_16 - MAC 00:15:5d:0a:e2:ad
eth1 - vmbus_0_15 - MAC 00:15:5d:0a:e2:ac
eth2 - vmbus_0_14 - MAC 00:15:5d:0a:e2:ab
>From syslog:
Jan 7 09:32:00 debian kernel: [ 0.975823] hv_netvsc vmbus_0_16: Send section size: 6144, Section count:170
Jan 7 09:32:00 debian kernel: [ 0.976904] hv_netvsc vmbus_0_16: Device MAC 00:15:5d:0a:e2:ad link state down
Jan 7 09:32:00 debian kernel: [ 1.178541] hv_netvsc vmbus_0_15: Send section size: 6144, Section count:170
Jan 7 09:32:00 debian kernel: [ 1.178913] hv_netvsc vmbus_0_15: Device MAC 00:15:5d:0a:e2:ac link state down
Jan 7 09:32:00 debian kernel: [ 1.497795] hv_netvsc vmbus_0_14: Send section size: 6144, Section count:170
Jan 7 09:32:00 debian kernel: [ 1.498031] hv_netvsc vmbus_0_14: Device MAC 00:15:5d:0a:e2:ab link state up
Output of 'ip a':
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 00:15:5d:0a:e2:ad brd ff:ff:ff:ff:ff:ff
inet 172.16.10.118/24 brd 172.16.10.255 scope global eth0
valid_lft forever preferred_lft forever
inet6 fe80::215:5dff:fe0a:e2ad/64 scope link
valid_lft forever preferred_lft forever
3: eth1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether 00:15:5d:0a:e2:ac brd ff:ff:ff:ff:ff:ff
4: eth2: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether 00:15:5d:0a:e2:ab brd ff:ff:ff:ff:ff:ff
=========================================================
Then next boot:
=========================================================
eth0 - vmbus_0_16 - MAC 00:15:5d:0a:e2:ab
eth1 - vmbus_0_15 - MAC 00:15:5d:0a:e2:ad
eth2 - vmbus_0_14 - MAC 00:15:5d:0a:e2:ac
>From syslog:
Jan 7 09:40:36 debian kernel: [ 1.637628] hv_netvsc vmbus_0_14: Send section size: 6144, Section count:170
Jan 7 09:40:36 debian kernel: [ 1.637855] hv_netvsc vmbus_0_14: Device MAC 00:15:5d:0a:e2:ab link state up
Jan 7 09:40:36 debian kernel: [ 2.037576] hv_netvsc vmbus_0_16: Send section size: 6144, Section count:170
Jan 7 09:40:36 debian kernel: [ 2.037869] hv_netvsc vmbus_0_16: Device MAC 00:15:5d:0a:e2:ad link state up
Jan 7 09:40:36 debian kernel: [ 2.349817] hv_netvsc vmbus_0_15: Send section size: 6144, Section count:170
Jan 7 09:40:36 debian kernel: [ 2.350153] hv_netvsc vmbus_0_15: Device MAC 00:15:5d:0a:e2:ac link state up
Output of 'ip a':
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 00:15:5d:0a:e2:ab brd ff:ff:ff:ff:ff:ff
inet 172.16.10.118/24 brd 172.16.10.255 scope global eth0
valid_lft forever preferred_lft forever
inet6 fe80::215:5dff:fe0a:e2ab/64 scope link
valid_lft forever preferred_lft forever
3: eth1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether 00:15:5d:0a:e2:ad brd ff:ff:ff:ff:ff:ff
4: eth2: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether 00:15:5d:0a:e2:ac brd ff:ff:ff:ff:ff:ff
=========================================================
After upgrading to linux-image-4.2.0-0.bpo.1-amd64 (kernel 4.2.6-3~bpo8+2), the issue is no longer reproducible.
The order is always maintained:
Jan 7 10:31:48 debian kernel: [ 0.984851] hv_netvsc vmbus_14: Send section size: 6144, Section count:2560
Jan 7 10:31:48 debian kernel: [ 0.986469] hv_netvsc vmbus_14: Device MAC 00:15:5d:0a:e2:ab link state up
Jan 7 10:31:48 debian kernel: [ 1.129932] hv_netvsc vmbus_15: Send section size: 6144, Section count:2560
Jan 7 10:31:48 debian kernel: [ 1.130500] hv_netvsc vmbus_15: Device MAC 00:15:5d:0a:e2:ac link state up
Jan 7 10:31:48 debian kernel: [ 1.274065] hv_netvsc vmbus_16: Send section size: 6144, Section count:2560
Jan 7 10:31:48 debian kernel: [ 1.274790] hv_netvsc vmbus_16: Device MAC 00:15:5d:0a:e2:ad link state up
Reply to: