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 1867478

Summary: [machines] There will be an error when deleting the network interface which has the same mac address with the other network interface
Product: Red Hat Enterprise Linux 8 Reporter: YunmingYang <yunyang>
Component: cockpit-appstreamAssignee: Simon Kobyda <skobyda>
Status: CLOSED ERRATA QA Contact: YunmingYang <yunyang>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 8.3CC: leiwang, mpitt, skobyda, wshi, xchen, ymao
Target Milestone: rcFlags: pm-rhel: mirror+
Target Release: 8.7   
Hardware: s390x   
OS: Linux   
Whiteboard:
Fixed In Version: cockpit-appstream-269-1.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-11-08 09:38:48 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:

Description YunmingYang 2020-08-10 06:45:00 UTC
Description of problem:
When a VM with two network interfaces which have the same mac address, there will be an error if deleting one of them.

Version-Release number of selected component (if applicable):
cockpit-machines-224.1-1.el8.noarch
libvirt-dbus-1.3.0-2.module+el8.3.0+6423+e4cb6418.s390x

How reproducible:
100%

Steps to Reproduce:
1. Create a VM with two network interfaces which have the same mac address
2. Delete one of the network interfaces

Actual results:
1. There will be an error which is “multiple devices matching MAC address xx:xx:xx:xx:xx:xx found”

Expected results: 
1. Maybe we can check whether the mac address is took when creating

Additional info:
On x86_64, no such error

Comment 1 Simon Kobyda 2020-08-10 10:59:57 UTC
Hi. I cannot reproduce this. Usually libvirt identifies network interface by a MAC address and additionally PCI if MACs are same. In my case, libvirt always generates a PCI number if I create network interfaces with same MACs. Perhaps they already fixed it in never version. (If no, this whole sounds like libvirt bug). Which version of libvirt are you using?
Can you tell me how do you create these network interfaces? Also could you attach "$virsh dumpxml" of said domain?

Comment 2 YunmingYang 2020-08-10 12:36:28 UTC
Sure,
1 The version of libvirt is 'libvirt-6.0.0-25.module+el8.3.0+7176+57f10f42.s390x'
2 I create the network by UI, 'Add Network Interface' button, and set address by 'Set Manually'
3 <domain type='kvm' id='1'>
  <name>test</name>
  <uuid>df49693c-5eb3-4112-ace9-17de3cf7815d</uuid>
  <metadata>
    <libosinfo:libosinfo xmlns:libosinfo="http://libosinfo.org/xmlns/libvirt/domain/1.0">
      <libosinfo:os id="http://alpinelinux.org/alpinelinux/3.8"/>
    </libosinfo:libosinfo>
  </metadata>
  <memory unit='KiB'>786432</memory>
  <currentMemory unit='KiB'>786432</currentMemory>
  <vcpu placement='static'>1</vcpu>
  <resource>
    <partition>/machine</partition>
  </resource>
  <os>
    <type arch='s390x' machine='s390-ccw-virtio-rhel8.2.0'>hvm</type>
    <boot dev='hd'/>
  </os>
  <cpu mode='custom' match='exact' check='partial'>
    <model fallback='forbid'>z13.2-base</model>
    <feature policy='require' name='aen'/>
    <feature policy='require' name='aefsi'/>
    <feature policy='require' name='msa5'/>
    <feature policy='require' name='msa4'/>
    <feature policy='require' name='msa3'/>
    <feature policy='require' name='msa2'/>
    <feature policy='require' name='msa1'/>
    <feature policy='require' name='sthyi'/>
    <feature policy='require' name='edat'/>
    <feature policy='require' name='vx'/>
    <feature policy='require' name='ap'/>
    <feature policy='require' name='esop'/>
    <feature policy='require' name='apft'/>
    <feature policy='require' name='apqci'/>
    <feature policy='require' name='cte'/>
    <feature policy='require' name='ais'/>
    <feature policy='require' name='bpb'/>
    <feature policy='require' name='ppa15'/>
    <feature policy='require' name='zpci'/>
    <feature policy='require' name='te'/>
  </cpu>
  <clock offset='utc'/>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>destroy</on_crash>
  <devices>
    <emulator>/usr/libexec/qemu-kvm</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2'/>
      <source file='/tmp/s390xmini.qcow2' index='1'/>
      <backingStore/>
      <target dev='vda' bus='virtio'/>
      <alias name='virtio-disk0'/>
      <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0000'/>
    </disk>
    <controller type='pci' index='0' model='pci-root'>
      <alias name='pci.0'/>
    </controller>
    <controller type='virtio-serial' index='0'>
      <alias name='virtio-serial0'/>
      <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0003'/>
    </controller>
    <interface type='network'>
      <mac address='52:54:00:ab:81:64'/>
      <source network='default' portid='0b657353-94a7-45ca-9bfa-7f2686615787' bridge='virbr0'/>
      <target dev='vnet0'/>
      <model type='virtio'/>
      <alias name='net0'/>
      <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0001'/>
    </interface>
    <interface type='network'>
      <mac address='1a:2b:3e:4d:5e:6f'/>
      <source network='default' portid='8bb1011c-54d7-400d-aec5-d41e0026c161' bridge='virbr0'/>
      <target dev='vnet1'/>
      <model type='virtio'/>
      <alias name='net1'/>
      <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0005'/>
    </interface>
    <interface type='network'>
      <mac address='1a:2b:3e:4d:5e:6f'/>
      <source network='default' portid='a121e6fe-0a28-4fdb-89a8-7ebceaa279ce' bridge='virbr0'/>
      <target dev='vnet2'/>
      <model type='virtio'/>
      <alias name='net2'/>
      <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0006'/>
    </interface>
    <console type='pty' tty='/dev/pts/1'>
      <source path='/dev/pts/1'/>
      <target type='sclp' port='0'/>
      <alias name='console0'/>
    </console>
    <channel type='unix'>
      <source mode='bind' path='/var/lib/libvirt/qemu/channel/target/domain-1-test/org.qemu.guest_agent.0'/>
      <target type='virtio' name='org.qemu.guest_agent.0' state='disconnected'/>
      <alias name='channel0'/>
      <address type='virtio-serial' controller='0' bus='0' port='1'/>
    </channel>
    <graphics type='vnc' port='5900' autoport='yes' listen='127.0.0.1'>
      <listen type='address' address='127.0.0.1'/>
    </graphics>
    <video>
      <model type='virtio' heads='1' primary='yes'/>
      <alias name='video0'/>
      <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0002'/>
    </video>
    <memballoon model='virtio'>
      <alias name='balloon0'/>
      <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0004'/>
    </memballoon>
    <panic model='s390'/>
  </devices>
  <seclabel type='dynamic' model='selinux' relabel='yes'>
    <label>system_u:system_r:svirt_t:s0:c599,c911</label>
    <imagelabel>system_u:object_r:svirt_image_t:s0:c599,c911</imagelabel>
  </seclabel>
  <seclabel type='dynamic' model='dac' relabel='yes'>
    <label>+107:+107</label>
    <imagelabel>+107:+107</imagelabel>
  </seclabel>
</domain>

Comment 5 Simon Kobyda 2022-01-25 01:37:50 UTC
PR sent upstream: https://github.com/cockpit-project/cockpit-machines/pull/538

Comment 7 Martin Pitt 2022-02-24 09:33:20 UTC
Moving to 8.7. Running out of time for 8.6 now, and we currently have very little dev capacity for c-machines.

Comment 10 YunmingYang 2022-05-23 15:48:54 UTC
Test Versions:
cockpit-269-1.el8.s390x
cockpit-machines-269-1.el8.noarch
libvirt-dbus-1.3.0-2.module+el8.6.0+12861+13975d62.s390x

Test Steps:
1 Create a VM with two network interfaces which have the same MAC address
2 Delete one of the network interfaces

Test Results:
1 After step 2, there is no error which is “multiple devices matching MAC address xx:xx:xx:xx:xx:xx found”
2 After step 2, the deleted network interface disappear
3 After step 2, check with "virsh dumpxml ${vm}", there is only one <interface> element


According to the results, move status to VERIFIED.

Comment 12 errata-xmlrpc 2022-11-08 09:38:48 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 (cockpit-appstream 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-2022:7554