Bug 2024098
| Summary: | update-device with "--persistent" will fail when try up update interface setting for a running domain | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 9 | Reporter: | yalzhang <yalzhang> |
| Component: | libvirt | Assignee: | Ján Tomko <jtomko> |
| libvirt sub component: | General | QA Contact: | Yanqiu Zhang <yanqzhan> |
| Status: | CLOSED ERRATA | Docs Contact: | |
| Severity: | medium | ||
| Priority: | high | CC: | jdenemar, jsuchane, jtomko, laine, virt-maint, xuzhang, yanqzhan |
| Version: | 9.0 | Keywords: | Regression, Triaged |
| Target Milestone: | rc | Flags: | pm-rhel:
mirror+
|
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | libvirt-7.10.0-1.el9 | Doc Type: | If docs needed, set a value |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2022-05-17 12:45:49 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: | 7.10.0 |
| Embargoed: | |||
|
Description
yalzhang@redhat.com
2021-11-17 10:15:02 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. As it also happens on rhel-av 8.5, Please help to evaluate if it should be a z candidate, Thank you! My attempt at an upstream patch: https://listman.redhat.com/archives/libvir-list/2021-November/msg00520.html 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
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 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.
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 |