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 2024098 - update-device with "--persistent" will fail when try up update interface setting for a running domain
Summary: update-device with "--persistent" will fail when try up update interface sett...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: libvirt
Version: 9.0
Hardware: Unspecified
OS: Unspecified
high
medium
Target Milestone: rc
: ---
Assignee: Ján Tomko
QA Contact: Yanqiu Zhang
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-11-17 10:15 UTC by yalzhang@redhat.com
Modified: 2022-05-17 13:06 UTC (History)
7 users (show)

Fixed In Version: libvirt-7.10.0-1.el9
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-05-17 12:45:49 UTC
Type: Bug
Target Upstream Version: 7.10.0
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-103021 0 None None None 2021-11-17 10:16:28 UTC
Red Hat Product Errata RHBA-2022:2390 0 None None None 2022-05-17 12:46:14 UTC

Description yalzhang@redhat.com 2021-11-17 10:15:02 UTC
Description of problem:
update-device with "--persistent" will fail when try up update interface setting for a running domain

Version-Release number of selected component (if applicable):
libvirt-7.9.0-1.el9.x86_64

How reproducible:
100%

Steps to Reproduce:
1. start a vm with interface setting as below:# virsh dumpxml rhel | grep /interface -B7
    <interface type='network'>
      <mac address='52:54:00:50:56:b6'/>
      <source network='default' portid='cfebd0ac-aa93-427d-90e3-9f517096b880' bridge='virbr0'/>
      <target dev='vnet5'/>
      <model type='virtio'/>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x03' slot='0x00' function='0x0'/>
    </interface>

2. try to update the interface setting by update-device with "--persistent" which is equal to "--live --config" for a running domain, it failed.# cat interface_new.xml 
<interface type='network'>
      <mac address='52:54:00:50:56:b6'/>
      <source network='default' portid='cfebd0ac-aa93-427d-90e3-9f517096b880' bridge='virbr0'/>
      <target dev='vnet5'/>
      <link state='down'/>
      <model type='virtio'/>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x03' slot='0x00' function='0x0'/>
    </interface>

# virsh update-device rhel interface_new.xml --persistent
error: Failed to update device from interface_new.xml
error: device not found: no device found at address '0000:03:00.0' matching MAC address '52:54:00:50:56:b6' and alias 'net0'

 # cat /var/log/libvirt/libvirtd.log | grep -i error2021-11-17 09:37:12.740+0000: 2748: error : virDomainNetFindIdx:15776 : device not found: no device found at address '0000:03:00.0' matching MAC address '52:54:00:50:56:b6' and alias 'net0'
3. update-device with "--live" or "--config" separately will pass# virsh update-device rhel interface_new.xml --live
Device updated successfully

# virsh update-device rhel interface_new.xml --config
Device updated successfully

Actual results:
Update interface setting by update-device with "--persistent" will fail

Expected results:
The update should succeed as the mac, address, and alias information are all correct in the xml

Additional info:
same issue happens on libvirt-7.6.0-2.el9.x86_64
libvirt-7.9.0-1.module+el8.6.0+13150+28339563.x86_64
libvirt-libs-7.6.0-6.module+el8.5.0+13051+7ddbe958.x86_64

Comment 1 yalzhang@redhat.com 2021-11-17 10:31:22 UTC
It should be a regression brought by bug 1926190, which introduce the feature to detach interface by alias. As the inactive xml has no alias set in comment 0, the error says "no device found at address '0000:03:00.0' matching MAC address '52:54:00:50:56:b6' and alias 'net0' is reasonable. While update-device with "--config" only will succeed, I think it's because when we update the persistent config, the auto-generated alias name in the interface xml will be ignored, which is expected.

Comment 2 yalzhang@redhat.com 2021-11-17 10:33:02 UTC
As it also happens on rhel-av 8.5, Please help to evaluate if it should be a z candidate, Thank you!

Comment 3 Ján Tomko 2021-11-18 15:33:22 UTC
My attempt at an upstream patch:
https://listman.redhat.com/archives/libvir-list/2021-November/msg00520.html

Comment 4 Ján Tomko 2021-11-19 13:16:08 UTC
Pushed as:
commit 28bb7266a05d5e07e532e66c17eac77130d369d7
Author:     Ján Tomko <jtomko>
CommitDate: 2021-11-19 14:06:17 +0100

    conf: match by network alias only if aliases are assigned
    
    Commit 114e3b423210d316b3326816fd2c33335b1167fe added matching by
    aliases for interfaces with same MAC address.
    ( https://bugzilla.redhat.com/show_bug.cgi?id=1926190 )
    
    However, unless the domain is using user aliases (prefixed ua-),
    there are no aliases in the persistent definition.
    
    Only match by MAC/PCI/other addresses in that case, to fix update-device
    with --persistent flag (AFFECT_LIVE | AFFECT_CONFIG).
    
    https://bugzilla.redhat.com/show_bug.cgi?id=2024098
    
    Fixes: 114e3b423210d316b3326816fd2c33335b1167fe
    Signed-off-by: Ján Tomko <jtomko>
    Reviewed-by: Martin Kletzander <mkletzan>

git describe: v7.9.0-188-g28bb7266a0

Comment 5 yalzhang@redhat.com 2021-11-22 03:49:56 UTC
Test on v7.9.0-197-gc7820f1509, the result is as expected, set verified: tested
1. live update interface with auto generated alias with --persistent: pass
2. live update interface with customized alias like "ua-test" with --persistent: pass

Comment 9 Yanqiu Zhang 2022-01-04 12:33:30 UTC
Reproduced with:
libvirt-7.6.0-5.module+el8.5.0+12933+58cb48a1.x86_64
qemu-kvm-6.0.0-29.module+el8.5.0+12386+43574bac.x86_64

Steps:
# virsh start yqz 
Domain 'yqz' started

# virsh dumpxml yqz|grep /interface -B7
    <interface type='network'>
      <mac address='52:54:00:36:f8:ac'/>
      <source network='default' portid='2971eaf0-56c5-4e23-869b-6866e01783cd' bridge='virbr0'/>
      <target dev='vnet4'/>
      <model type='virtio'/>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
    </interface>

# cat iface_new.xml 
    <interface type='network'>
      <mac address='52:54:00:36:f8:ac'/>
      <source network='default' portid='2971eaf0-56c5-4e23-869b-6866e01783cd' bridge='virbr0'/>
      <target dev='vnet4'/>
      <model type='virtio'/>
            <link state='down'/>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
    </interface>

# virsh update-device yqz iface_new.xml --persistent
error: Failed to update device from iface_new.xml
error: device not found: no device found at address '0000:01:00.0' matching MAC address '52:54:00:36:f8:ac' and alias 'net0'


---------
Verified with:
libvirt-7.10.0-1.el9.x86_64
qemu-kvm-6.2.0-1.el9.x86_64

1. Use auto generated alias ‘net0’
# virsh start avocado-bios 
Domain 'avocado-bios' started

]# virsh dumpxml avocado-bios |grep /interface -B8
    </controller>
    <interface type='network'>
      <mac address='52:54:00:44:11:60'/>
      <source network='default' portid='b8fa5e01-f995-4f9a-b007-d9b0dbc690f4' bridge='virbr0'/>
      <target dev='vnet0'/>
      <model type='virtio'/>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
    </interface>

# virsh update-device avocado-bios iface_new.xml --persistent
Device updated successfully

# virsh dumpxml avocado-bios |grep /interface -B8
    <interface type='network'>
      <mac address='52:54:00:44:11:60'/>
      <source network='default' portid='b8fa5e01-f995-4f9a-b007-d9b0dbc690f4' bridge='virbr0'/>
      <target dev='vnet0'/>
      <model type='virtio'/>
      <link state='down'/>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
    </interface>

2.use customized alias ‘ua-’
 # virsh dumpxml avocado-bios |grep /inter -B8
    </controller>
    <interface type='network'>
      <mac address='52:54:00:44:11:60'/>
      <source network='default' portid='5023ee95-a14b-4d7b-86a3-88ca62378e2f' bridge='virbr0'/>
      <target dev='vnet0'/>
      <model type='virtio'/>
      <alias name='ua-1f996e3f-2c91-4b58-a43c-290ea28b754d'/>
      <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
    </interface>

# virsh update-device avocado-bios iface_new.xml --persistent
Device updated successfully

# virsh dumpxml avocado-bios |grep /inter -B8
    <interface type='network'>
      <mac address='52:54:00:44:11:60'/>
      <source network='default' portid='5023ee95-a14b-4d7b-86a3-88ca62378e2f' bridge='virbr0'/>
      <target dev='vnet0'/>
      <model type='virtio'/>
      <link state='down'/>
      <alias name='ua-1f996e3f-2c91-4b58-a43c-290ea28b754d'/>
      <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
    </interface>

3 Regression test for bz1926190, detach same mac + different alias, 
# virsh dumpxml avocado-bios |grep /inter -B8
    </controller>
    <interface type='network'>
      <mac address='52:54:00:44:11:60'/>
      <source network='default' portid='21e3e65d-9d44-4de0-bae8-fe3569b84ae3' bridge='virbr0'/>
      <target dev='vnet1'/>
      <model type='virtio'/>
      <alias name='ua-ne0'/>
      <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
    </interface>
    <interface type='direct'>
      <mac address='52:54:00:44:11:60'/>
      <source network='direct-net' portid='08a84386-fe11-4160-bc81-2c1ace277578' dev='eno1' mode='bridge'/>
      <target dev='macvtap0'/>
      <model type='virtio'/>
      <alias name='ua-net1'/>
      <address type='pci' domain='0x0000' bus='0x07' slot='0x00' function='0x0'/>
    </interface>

# cat net1.xml 
    <interface type='direct'>
      <mac address='52:54:00:44:11:60'/>
      <source network='direct-net' portid='08a84386-fe11-4160-bc81-2c1ace277578' dev='eno1' mode='bridge'/>
      <target dev='macvtap0'/>
      <model type='virtio'/>
      <alias name='ua-net1'/>
    </interface>

# virsh detach-device avocado-bios net1.xml 
Device detached successfully

Dumpxml still has the second iface due to bz2035006, but login guest can see the second nic does not exists anymore.

Results above are as expected.


An issue found about uncoordinated behavior between --live and --persistent update-device with different alias is filed to bz2036895.

Comment 11 errata-xmlrpc 2022-05-17 12:45:49 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 (new packages: libvirt), 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:2390


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