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 1554962 - User-aliases not cleared on detach-device [rhel-7.5.z]
Summary: User-aliases not cleared on detach-device [rhel-7.5.z]
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.6
Hardware: Unspecified
OS: Unspecified
urgent
urgent
Target Milestone: rc
: ---
Assignee: Michal Privoznik
QA Contact: jiyan
URL:
Whiteboard:
Depends On: 1553075
Blocks: 1552693
TreeView+ depends on / blocked
 
Reported: 2018-03-13 16:16 UTC by Oneata Mircea Teodor
Modified: 2018-04-10 19:14 UTC (History)
15 users (show)

Fixed In Version: libvirt-3.9.0-14.el7_5.1
Doc Type: Bug Fix
Doc Text:
Previously, the libvirt service used the incorrect XML configuration when checking for a duplicate user alias. As a consequence, hot-plugging a device with a unique alias to a guest virtual machine in some cases failed with a "non unique alias" error message. With this update, libvirt uses the correct XML files for verifying the device alias, which prevents the problem from occurring.
Clone Of: 1553075
Environment:
Last Closed: 2018-04-10 19:13:42 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2018:1056 0 None None None 2018-04-10 19:14:07 UTC

Description Oneata Mircea Teodor 2018-03-13 16:16:17 UTC
This bug has been copied from bug #1553075 and has been proposed to be backported to 7.5 z-stream (EUS).

Comment 5 jiyan 2018-03-19 03:18:22 UTC
Scenaro-1: Disk device, Cold-plugging a virtual disk with same alias as one optional virtual disk should fail, Hot-plugging should succeed.
Step1: Prepare a shutdown VM with the following configuration and a xml file
# virsh domstate test1
shut off

# virsh dumpxml test1 |grep "<disk" -A6
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2'/>
      <source file='/var/lib/libvirt/images/test1RHEL-7.5-x86_64-latest.qcow2'/>
      <target dev='hda' bus='ide'/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2'/>
      <source file='/var/lib/libvirt/images/0.qcow2' startupPolicy='optional'/>
      <target dev='hdc' bus='usb'/>
      <alias name='ua-disk2'/>
      <address type='usb' bus='0' port='4'/>
    </disk>

# cat diskaliasclear.xml 
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2'/>
      <source file='/var/lib/libvirt/images/optionalRHEL-7.5-x86_64-latest.qcow2'/>
      <target dev='hdb' bus='usb'/>
      <alias name= **'ua-disk2'**/>
    </disk>

Step2: Start the VM and check the dumpxml file info
# virsh start test1
Domain test1 started

# virsh dumpxml test1 |grep "<disk" -A7
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2'/>
      <source file='/var/lib/libvirt/images/test1RHEL-7.5-x86_64-latest.qcow2'/>
      <backingStore/>
      <target dev='hda' bus='ide'/>
      <alias name='ide0-0-0'/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>

Step3: Cold-plug the disk to VM, that operation should fail and check the dumpxml file info
# virsh attach-device test1 diskaliasclear.xml --config
error: Failed to attach device from diskaliasclear.xml
error: XML error: non unique alias detected: ua-disk2

# virsh dumpxml test1 --inactive|grep "<disk" -A6
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2'/>
      <source file='/var/lib/libvirt/images/test1RHEL-7.5-x86_64-latest.qcow2'/>
      <target dev='hda' bus='ide'/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2'/>
      <source file='/var/lib/libvirt/images/0.qcow2' startupPolicy='optional'/>
      <target dev='hdc' bus='usb'/>
      <alias name='ua-disk2'/>
      <address type='usb' bus='0' port='4'/>
    </disk>

Step4:  Hot-plug the disk to VM, that operation should succeed. and then hot-unplug it, check the dumpxml file info
# virsh attach-device test1 diskaliasclear.xml 
Device attached successfully

# virsh dumpxml test1 |grep "<disk" -A7
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2'/>
      <source file='/var/lib/libvirt/images/test1RHEL-7.5-x86_64-latest.qcow2'/>
      <backingStore/>
      <target dev='hda' bus='ide'/>
      <alias name='ide0-0-0'/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2'/>
      <source file='/var/lib/libvirt/images/optionalRHEL-7.5-x86_64-latest.qcow2'/>
      <backingStore/>
      <target dev='hdb' bus='usb'/>
      <alias name='ua-disk2'/>
      <address type='usb' bus='0' port='5'/>
    </disk>

# virsh detach-device test1 diskaliasclear.xml 
Device detached successfully

# virsh dumpxml test1 |grep "<disk" -A7
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2'/>
      <source file='/var/lib/libvirt/images/test1RHEL-7.5-x86_64-latest.qcow2'/>
      <backingStore/>
      <target dev='hda' bus='ide'/>
      <alias name='ide0-0-0'/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>

Scenaro-2: Interface device
Step1: Prepare a shutdown VM with the following configuration and a xml file
# virsh domstate test1
shut off

# virsh dumpxml test1 |grep "<interface" -A6
    <interface type='network'>
      <mac address='52:54:00:32:e6:35'/>
      <source network='default'/>
      <model type='rtl8139'/>
      <alias name='ua-interface'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>
    <interface type='network'>
      <mac address='22:54:00:32:e6:35'/>
      <source network='default'/>
      <model type='rtl8139'/>
      <alias name='ua-myinterface'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
    </interface>

# cat interface.xml 
    <interface type='network'>
      <mac address='22:54:00:32:e6:35'/>
      <source network='default'/>
      <model type='rtl8139'/>
      <alias name='ua-myinterface'/>
    </interface>

Step2: Start VM and hot-unplug the interface with mac address '22:54:00:32:e6:35' through 'interface.xml' file
# virsh start test1
Domain test1 started

# virsh dumpxml test1 |grep "<interface" -A7
    <interface type='network'>
      <mac address='52:54:00:32:e6:35'/>
      <source network='default' bridge='virbr0'/>
      <target dev='vnet0'/>
      <model type='rtl8139'/>
      <alias name='ua-interface'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>
    <interface type='network'>
      <mac address='22:54:00:32:e6:35'/>
      <source network='default' bridge='virbr0'/>
      <target dev='vnet1'/>
      <model type='rtl8139'/>
      <alias name='ua-myinterface'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
    </interface>

# virsh detach-device test1 interface.xml 
Device detached successfully

# virsh dumpxml test1 |grep "<interface" -A7
    <interface type='network'>
      <mac address='52:54:00:32:e6:35'/>
      <source network='default' bridge='virbr0'/>
      <target dev='vnet0'/>
      <model type='rtl8139'/>
      <alias name='ua-interface'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>

Step3: Hot-plug the device again
# virsh attach-device test1 interface.xml 
Device attached successfully

# virsh dumpxml test1 |grep "<interface" -A7
    <interface type='network'>
      <mac address='52:54:00:32:e6:35'/>
      <source network='default' bridge='virbr0'/>
      <target dev='vnet0'/>
      <model type='rtl8139'/>
      <alias name='ua-interface'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>
    <interface type='network'>
      <mac address='22:54:00:32:e6:35'/>
      <source network='default' bridge='virbr0'/>
      <target dev='vnet1'/>
      <model type='rtl8139'/>
      <alias name='ua-myinterface'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
    </interface>

Step4: Cold-plugging the interface should fail, cold-unplug the interface then restart the VM
# virsh attach-device test1 interface.xml --config
error: Failed to attach device from interface.xml
error: XML error: non unique alias detected: ua-myinterface

# virsh dumpxml test1 --inactive|grep "<interface" -A7
    <interface type='network'>
      <mac address='52:54:00:32:e6:35'/>
      <source network='default'/>
      <model type='rtl8139'/>
      <alias name='ua-interface'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>
    <interface type='network'>
      <mac address='22:54:00:32:e6:35'/>
      <source network='default'/>
      <model type='rtl8139'/>
      <alias name='ua-myinterface'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
    </interface>

# virsh detach-device test1 interface.xml --config
Device detached successfully

# virsh dumpxml test1 --inactive|grep "<interface" -A7
    <interface type='network'>
      <mac address='52:54:00:32:e6:35'/>
      <source network='default'/>
      <model type='rtl8139'/>
      <alias name='ua-interface'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>

# virsh destroy test1;virsh start test1
Domain test1 destroyed
Domain test1 started

# virsh dumpxml test1 |grep "<interface" -A7
    <interface type='network'>
      <mac address='52:54:00:32:e6:35'/>
      <source network='default' bridge='virbr0'/>
      <target dev='vnet0'/>
      <model type='rtl8139'/>
      <alias name='ua-interface'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>

All the results are as expected, move this bug to 'verified'.

Comment 6 jiyan 2018-03-22 05:14:59 UTC
Hi, Arik.
Could you please help to check this issue in RHV? Thanks in advance.

Comment 7 Arik 2018-03-25 09:02:35 UTC
(In reply to jiyan from comment #6)
> Hi, Arik.
> Could you please help to check this issue in RHV? Thanks in advance.

That would be checked as part of the verification of bz 1552693

Comment 10 errata-xmlrpc 2018-04-10 19:13:42 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, 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-2018:1056


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