Bug 1977798 - RHEL8.5 guest network interface name changed after upgrade to qemu-6.0
Summary: RHEL8.5 guest network interface name changed after upgrade to qemu-6.0
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux Advanced Virtualization
Classification: Red Hat
Component: qemu-kvm
Version: 8.5
Hardware: Unspecified
OS: Linux
unspecified
medium
Target Milestone: rc
: 8.5
Assignee: Igor Mammedov
QA Contact: Lei Yang
URL:
Whiteboard:
Depends On:
Blocks: 1957194
TreeView+ depends on / blocked
 
Reported: 2021-06-30 13:54 UTC by Igor Mammedov
Modified: 2021-11-16 08:52 UTC (History)
4 users (show)

Fixed In Version: qemu-kvm-6.0.0-26.module+el8.5.0+12044+525f0ebc
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-11-16 07:54:28 UTC
Type: Bug
Target Upstream Version: 6.1
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2021:4684 0 None None None 2021-11-16 07:55:15 UTC

Description Igor Mammedov 2021-06-30 13:54:51 UTC
Description of problem:

Commit [1] moved _SUN variable from only hot-pluggable to
all devices. This made linux kernel enumerate extra slots
that weren't present before. If extra slot happens to be
be enumerated first and there is a device in th same slot
but on other bridge, linux kernel will add -N suffix to
slot name of the later, thus changing NIC name compared to
QEMU 5.2. This in some case confuses systemd, if it is
using SLOT NIC naming scheme and interface name becomes
not the same as it was under QEMU-5.2.

1) b7f23f62e40 (pci: acpi: add _DSM method to PCI devices)

Version-Release number of selected component (if applicable):

qemu-kvm-6.0.0-21

How reproducible:
100%

Steps to Reproduce:

use rhel8 guest with following CLI

  -M pc-i440fx-5.2 -nodefaults \
  -device pci-bridge,chassis_nr=1,id=pci.1,bus=pci.0,addr=0x3 \
  -device virtio-net-pci,id=nic1,bus=pci.1,addr=0x1 \
  -device virtio-net-pci,id=nic2,bus=pci.1,addr=0x2 \
  -device virtio-net-pci,id=nic3,bus=pci.1,addr=0x3


Actual results:
  v6.0:
     kernel: virtio_net virtio0 ens1: renamed from eth0
     kernel: virtio_net virtio2 ens3: renamed from eth2
     systemd-udevd[299]: Error changing net interface name 'eth1' to 'ens3': File exists
     systemd-udevd[299]: could not rename interface '3' from 'eth1' to 'ens3': File exists

Expected results:

  v5.2:
     kernel: virtio_net virtio0 ens1: renamed from eth0
     kernel: virtio_net virtio2 ens3: renamed from eth2
     kernel: virtio_net virtio1 enp1s2: renamed from eth1

Additional info:
 5.2   (slot 2 is assigned to empty bus 0 slot and virtio1
       is assigned to 2-2 slot, and renaming falls back,
       for some reason, to path based naming scheme)

 6.0   (with commit [1] kernel assigns virtio2 to 3-2 slot
       since bridge advertises _SUN=0x3 and kernel assigns
       slot 3 to bridge. Still it manages to rename virtio2
       correctly to ens3, however systemd gets confused with virtio1
       where slot allocation exactly the same (2-2) as in 5.2 case
       and tries to rename it to ens3 which is rightfully taken by
       virtio2)

Comment 1 Igor Mammedov 2021-06-30 14:02:55 UTC
Fix posted upstream:

  "[PATCH 2/2] acpi: pc: revert back to v5.2 PCI slot enumeration"
   https://lore.kernel.org/qemu-devel/20210624204229.998824-3-imammedo@redhat.com/

Comment 2 Lei Yang 2021-07-06 03:30:38 UTC
Hi Igor

I tried to reproduce the problem, but I failed. The reason is that neither qemu-kvm-6.0.0-21.module+el8.5.0+11555+e0ab0d09.x86_64 nor qemu-kvm-5.2.0-16.module+el8.4.0+11536+725e25d9.2.x86_64 supports the "pc-i440fx-5.2" machine type. So I would like to confirm a few questions with you. Could you please help me check it?

1. Since neither qemu-kvm-6.0.0-21 nor qemu-kvm-5.2.0-16 supports "pc-i440fx-5.2", Could you help confirm whether the command line is correct?
2. Does this changes affect other PCI devices?


==>Test CLI
/usr/libexec/qemu-kvm \
-name 'rhel'  \
-M pc-i440fx-5.2 \
-nodefaults \
-device VGA,bus=pci.0,addr=0x2 \
-m 7168 \
-smp 6,maxcpus=6,cores=3,threads=1,dies=1,sockets=2  \
-cpu 'Haswell-noTSX',+kvm_pv_unhalt \
-device usb-tablet,id=usb-tablet1,bus=usb1.0,port=1 \
-device virtio-scsi-pci,id=virtio_scsi_pci0,bus=pci.0,addr=0x4 \
-blockdev node-name=file_image1,driver=file,auto-read-only=on,discard=unmap,aio=threads,filename=/home/kvm_autotest_root/images/rhel850-64-virtio-scsi.qcow2,cache.direct=on,cache.no-flush=off \
-blockdev node-name=drive_image1,driver=qcow2,read-only=off,cache.direct=on,cache.no-flush=off,file=file_image1 \
-device scsi-hd,id=image1,drive=drive_image1,write-cache=on \
-device pci-bridge,chassis_nr=1,id=pci.1,bus=pci.0,addr=0x3 \
-device virtio-net-pci,id=nic1,bus=pci.1,addr=0x1 \
-device virtio-net-pci,id=nic2,bus=pci.1,addr=0x2 \
-device virtio-net-pci,id=nic3,bus=pci.1,addr=0x3 \
-vnc :0  \
-rtc base=utc,clock=host,driftfix=slew  \
-boot menu=off,order=cdn,once=c,strict=off \
-enable-kvm \

==>Error info:
qemu-kvm: -M pc-i440fx-5.2: unsupported machine type
Use -machine help to list supported machines

Additional info:
I try to use the latest qemu packages: qemu-kvm-6.0.0-22.module+el8.5.0+11677+542c8d77.x86_64. Use -machine help to list supported machines:
# /usr/libexec/qemu-kiwi -machine help
Supported machines are:
pc-i440fx-4.2        Standard PC (i440FX + PIIX, 1996) (deprecated)
pc-i440fx-2.11       Standard PC (i440FX + PIIX, 1996) (deprecated)
pc                   RHEL 7.6.0 PC (i440FX + PIIX, 1996) (alias of pc-i440fx-rhel7.6.0)
pc-i440fx-rhel7.6.0  RHEL 7.6.0 PC (i440FX + PIIX, 1996) (default)
pc-i440fx-rhel7.5.0  RHEL 7.5.0 PC (i440FX + PIIX, 1996)
pc-i440fx-rhel7.4.0  RHEL 7.4.0 PC (i440FX + PIIX, 1996)
pc-i440fx-rhel7.3.0  RHEL 7.3.0 PC (i440FX + PIIX, 1996)
pc-i440fx-rhel7.2.0  RHEL 7.2.0 PC (i440FX + PIIX, 1996)
pc-i440fx-rhel7.1.0  RHEL 7.1.0 PC (i440FX + PIIX, 1996)
pc-i440fx-rhel7.0.0  RHEL 7.0.0 PC (i440FX + PIIX, 1996)

Machine type 'pc-i440fx-4.2' is deprecated: Not supported by RHEL

Best Regards
Lei

Comment 3 Igor Mammedov 2021-07-07 08:42:19 UTC
The acpi-index feature is available only on PC machine so far,
so for testing on RHEL you can use the latest available PC machine
type (i.e. pc-i440fx-rhel7.6.0).

Comment 4 Lei Yang 2021-07-13 02:09:39 UTC
Hi Igor

I tried to test on RHEL the latest available PC machine(pc-i440fx-rhel7.6.0), I can reproduced this bug. But the premise is that the pci-bridge binding method is used for the nic in the command line.

==Test Steps
1. Install qemu-kvm-5.2.0-11.module+el8.4.0+10268+62bcbbed.x86_64 and boot a guset
/usr/libexec/qemu-kvm \
-name 'avocado-vt-vm1'  \
-sandbox on  \
-machine pc-i440fx-rhel7.6.0 \
-nodefaults \
-device VGA,bus=pci.0,addr=0x2 \
-m 6144 \
-smp 6,maxcpus=6,cores=3,threads=1,dies=1,sockets=2  \
-cpu 'Haswell-noTSX',+kvm_pv_unhalt \
-device virtio-scsi-pci,id=virtio_scsi_pci0,bus=pci.0,addr=0x4 \
-blockdev node-name=file_image1,driver=file,auto-read-only=on,discard=unmap,aio=threads,filename=/home/rhel850-64-virtio-scsi.qcow2,cache.direct=on,cache.no-flush=off \
-blockdev node-name=drive_image1,driver=qcow2,read-only=off,cache.direct=on,cache.no-flush=off,file=file_image1 \
-device scsi-hd,id=image1,drive=drive_image1,write-cache=on \
-vnc :1  \
-rtc base=utc,clock=host,driftfix=slew  \
-boot menu=off,order=cdn,once=c,strict=off \
-monitor stdio \
-device pci-bridge,chassis_nr=1,id=pci.1,bus=pci.0,addr=0x3 \
-device virtio-net-pci,id=nic1,netdev=hostnic1,bus=pci.1,addr=0x1 \
-netdev tap,id=hostnic1,vhost=on \
-device virtio-net-pci,id=nic2,netdev=hostnic2,bus=pci.1,addr=0x2 \
-netdev tap,id=hostnic2,vhost=on \
-device virtio-net-pci,id=nic3,netdev=hostnic3,bus=pci.1,addr=0x3 \
-netdev tap,id=hostnic3,vhost=on \

2.Check guest log
# journalctl |grep virtio
virtio_net virtio1 ens1: renamed from eth0
virtio_net virtio3 ens3: renamed from eth2
virtio_net virtio2 ens2: renamed from eth1

3. shutdown guest

4. Install qemu-kvm-6.0.0-21.module+el8.5.0+11555+e0ab0d09.x86_64 and boot guest again

5. Check the guest log
# journalctl |grep virtio
virtio_net virtio1 ens1: renamed from eth0
virtio_net virtio3 ens3: renamed from eth2
# journalctl |grep exists
systemd-udevd[496]: Error changing net interface name 'eth1' to 'ens3': File exists
systemd-udevd[496]: could not rename interface '3' from 'eth1' to 'ens3': File exists
systemd-udevd[778]: Error changing net interface name 'eth1' to 'ens3': File exists
systemd-udevd[778]: could not rename interface '3' from 'eth1' to 'ens3': File exists

Additional info:
If QE does not use the pci-bridge method to add the nics, but uses the following command line to execute the above steps again, the bug will not reproduce.
qemu CLI:
/usr/libexec/qemu-kvm \
-name 'avocado-vt-vm1'  \
-sandbox on  \
-machine pc-i440fx-rhel7.6.0 \
-nodefaults \
-device VGA,bus=pci.0,addr=0x2 \
-m 6144 \
-smp 6,maxcpus=6,cores=3,threads=1,dies=1,sockets=2  \
-cpu 'Haswell-noTSX',+kvm_pv_unhalt \
-device virtio-scsi-pci,id=virtio_scsi_pci0,bus=pci.0,addr=0x4 \
-blockdev node-name=file_image1,driver=file,auto-read-only=on,discard=unmap,aio=threads,filename=/home/rhel850-64-virtio-scsi.qcow2,cache.direct=on,cache.no-flush=off \
-blockdev node-name=drive_image1,driver=qcow2,read-only=off,cache.direct=on,cache.no-flush=off,file=file_image1 \
-device scsi-hd,id=image1,drive=drive_image1,write-cache=on \
-vnc :1  \
-rtc base=utc,clock=host,driftfix=slew  \
-boot menu=off,order=cdn,once=c,strict=off \
-monitor stdio \
-device virtio-net-pci,mac=9a:61:1f:b8:cd:a2,id=id5r9s2h,netdev=idJ7MN1Z,bus=pci.0,addr=0x5  \
-netdev tap,id=idJ7MN1Z,vhost=on \
-device virtio-net-pci,mac=9a:61:1f:b8:cd:a3,id=idYzDe0T,netdev=idkzcAZj,bus=pci.0,addr=0x6  \
-netdev tap,id=idkzcAZj,vhost=on \
-device virtio-net-pci,mac=9a:61:1f:b8:cd:a4,id=id7UK0tA,netdev=idh0Vjk8,bus=pci.0,addr=0x7  \
-netdev tap,id=idh0Vjk8,vhost=on \

Best Regards
Lei

Comment 5 Igor Mammedov 2021-07-13 07:43:35 UTC
upstream commit 7193d7cdd9  acpi: pc: revert back to v5.2 PCI slot enumeration

Comment 7 Igor Mammedov 2021-07-13 09:44:39 UTC
Martin,
can you give release + dev-ack flags to this bz, pls?

Comment 10 Yanan Fu 2021-07-30 01:39:11 UTC
QE bot(pre verify): Set 'Verified:Tested,SanityOnly' as gating/tier1 test pass.

Comment 13 Lei Yang 2021-08-02 08:41:03 UTC
==Test Steps
1. Install qemu-kvm-5.2.0-16.module+el8.4.0+11923+e8b883e4.4.x86_64 and boot a guset

/usr/libexec/qemu-kvm \
-name 'avocado-vt-vm1'  \
-sandbox on  \
-machine pc-i440fx-rhel7.6.0 \
-nodefaults \
-device VGA,bus=pci.0,addr=0x2 \
-m 6144 \
-smp 6,maxcpus=6,cores=3,threads=1,dies=1,sockets=2  \
-cpu 'Haswell-noTSX',+kvm_pv_unhalt \
-device virtio-scsi-pci,id=virtio_scsi_pci0,bus=pci.0,addr=0x4 \
-blockdev node-name=file_image1,driver=file,auto-read-only=on,discard=unmap,aio=threads,filename=/home/rhel850-64-virtio-scsi.qcow2,cache.direct=on,cache.no-flush=off \
-blockdev node-name=drive_image1,driver=qcow2,read-only=off,cache.direct=on,cache.no-flush=off,file=file_image1 \
-device scsi-hd,id=image1,drive=drive_image1,write-cache=on \
-vnc :1  \
-rtc base=utc,clock=host,driftfix=slew  \
-boot menu=off,order=cdn,once=c,strict=off \
-monitor stdio \
-device pci-bridge,chassis_nr=1,id=pci.1,bus=pci.0,addr=0x3 \
-device virtio-net-pci,id=nic1,netdev=hostnic1,bus=pci.1,addr=0x1 \
-netdev tap,id=hostnic1,vhost=on \
-device virtio-net-pci,id=nic2,netdev=hostnic2,bus=pci.1,addr=0x2 \
-netdev tap,id=hostnic2,vhost=on \
-device virtio-net-pci,id=nic3,netdev=hostnic3,bus=pci.1,addr=0x3 \
-netdev tap,id=hostnic3,vhost=on \

2.Check guest log
# journalctl |grep virtio
Aug 02 15:47:06 localhost.localdomain kernel: virtio_net virtio1 ens1: renamed from eth0
Aug 02 15:47:06 localhost.localdomain kernel: virtio_net virtio3 ens3: renamed from eth2
Aug 02 15:47:06 localhost.localdomain kernel: virtio_net virtio2 ens2: renamed from eth1

3. shutdown guest

4. Install qemu-kvm-6.0.0-21.module+el8.5.0+11555+e0ab0d09.x86_64 and boot guest again

5. Check the guest log
# journalctl |grep virtio
Aug 02 16:22:23 localhost.localdomain kernel: virtio_net virtio1 ens1: renamed from eth0
Aug 02 16:22:23 localhost.localdomain kernel: virtio_net virtio2 ens3: renamed from eth1
# journalctl |grep exists
Aug 02 16:22:23 localhost.localdomain systemd-udevd[486]: Error changing net interface name 'eth2' to 'ens3': File exists
Aug 02 16:22:23 localhost.localdomain systemd-udevd[486]: could not rename interface '4' from 'eth2' to 'ens3': File exists
Aug 02 16:22:27 localhost.localdomain systemd-udevd[780]: Error changing net interface name 'eth2' to 'ens3': File exists
Aug 02 16:22:27 localhost.localdomain systemd-udevd[780]: could not rename interface '4' from 'eth2' to 'ens3': File exists

==Reproduced with qemu-kvm-6.0.0-21.module+el8.5.0+11555+e0ab0d09.x86_64

==Verified with qemu-kvm-6.0.0-26.module+el8.5.0+12044+525f0ebc.x86_64
1. Install qemu-kvm-6.0.0-26.module+el8.5.0+12044+525f0ebc.x86_64 and boot guest
/usr/libexec/qemu-kvm \
-name 'avocado-vt-vm1'  \
-sandbox on  \
-machine pc-i440fx-rhel7.6.0 \
-nodefaults \
-device VGA,bus=pci.0,addr=0x2 \
-m 6144 \
-smp 6,maxcpus=6,cores=3,threads=1,dies=1,sockets=2  \
-cpu 'Haswell-noTSX',+kvm_pv_unhalt \
-device virtio-scsi-pci,id=virtio_scsi_pci0,bus=pci.0,addr=0x4 \
-blockdev node-name=file_image1,driver=file,auto-read-only=on,discard=unmap,aio=threads,filename=/home/rhel850-64-virtio-scsi.qcow2,cache.direct=on,cache.no-flush=off \
-blockdev node-name=drive_image1,driver=qcow2,read-only=off,cache.direct=on,cache.no-flush=off,file=file_image1 \
-device scsi-hd,id=image1,drive=drive_image1,write-cache=on \
-vnc :1  \
-rtc base=utc,clock=host,driftfix=slew  \
-boot menu=off,order=cdn,once=c,strict=off \
-monitor stdio \
-device pci-bridge,chassis_nr=1,id=pci.1,bus=pci.0,addr=0x3 \
-device virtio-net-pci,id=nic1,netdev=hostnic1,bus=pci.1,addr=0x1 \
-netdev tap,id=hostnic1,vhost=on \
-device virtio-net-pci,id=nic2,netdev=hostnic2,bus=pci.1,addr=0x2 \
-netdev tap,id=hostnic2,vhost=on \
-device virtio-net-pci,id=nic3,netdev=hostnic3,bus=pci.1,addr=0x3 \
-netdev tap,id=hostnic3,vhost=on \

2.Check guest log
# journalctl |grep virtio
Aug 02 16:28:03 localhost.localdomain kernel: virtio_net virtio3 ens3: renamed from eth2
Aug 02 16:28:03 localhost.localdomain kernel: virtio_net virtio2 ens2: renamed from eth1
Aug 02 16:28:03 localhost.localdomain kernel: virtio_net virtio1 ens1: renamed from eth0

3.Based on above, move to "VERIFIED".

Best Regards
Lei

Comment 15 errata-xmlrpc 2021-11-16 07:54:28 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (virt:av bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2021:4684


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