Red Hat Bugzilla – Bug 1056902
virsh attach-interface/detach-interface mishandles inactive configuration on device hot(un)plug commands
Last modified: 2015-03-05 02:29:35 EST
Description of problem: virsh attach-interface/detach-interface with option "--config" could not success for running domain vm. Version-Release number of selected component (if applicable): libvirt-1.1.1-19.el7.x86_64 How reproducible: 100% Steps to Reproduce: Attach/detach with --config steps: 1. attach-interface with --config when domain is running # virsh list Id Name State ---------------------------------------------------- 5 rhel6_x86_64 running # virsh attach-interface rhel6_x86_64 --type network --source default --target vnet1 --mac 52:54:00:f9:11:11 --config Interface attached successfully # virsh domiflist rhel6_x86_64 --inactive Interface Type Source Model MAC ------------------------------------------------------- - network default e1000 52:54:00:62:30:ff - network default rtl8139 52:54:00:f9:11:11 2. detach-interface with --config # virsh detach-interface rhel6_x86_64 network --mac 52:54:00:f9:11:11 --config error: No interface with MAC address 52:54:00:f9:11:11 was found Expected Result: Interface could be detached successfully with –config. Additional Info: This issue does not occurs on RHEL6 with libvirt-0.10.2-29.el6.x86_64
Can reproduce with: libvirt-1.1.1-23.el7.x86_64 Steps: 1. [root@mig2 Downloads]# rpm -qa libvirt libvirt-1.1.1-23.el7.x86_64 [root@mig2 Downloads]# virsh list --all Id Name State ---------------------------------------------------- 3 rhel6 running - kiosk-test shut off - new shut off - rhel6u5 shut off [root@mig2 Downloads]# virsh attach-interface rhel6 --type network --source default --target vnet1 --mac 52:54:00:f9:11:11 --config Interface attached successfully [root@mig2 Downloads]# virsh domiflist rhel6 --inactive Interface Type Source Model MAC ------------------------------------------------------- - network default virtio 52:54:00:56:b3:84 - network default rtl8139 52:54:00:f9:11:11 2. [root@mig2 Downloads]# virsh detach-interface rhel6 network --mac 52:54:00:f9:11:11 --config error: Failed to detach interface error: operation failed: no matching network device was found
commit 87388228f47a15308aee4b6416e31596242bab41 Author: Peter Krempa <pkrempa@redhat.com> Date: Fri Jul 4 15:03:07 2014 +0200 virsh: domain: Use inactive XML when unplugging interface with --config Similary to cmdDetachDisk fetch the inactive definition when --config is specified as the active may not contain the network interface if it was plugged with --config. $ git desc v1.2.6-56-g8738822
I can produce this bug on build libvirt-1.1.1-29.el7.x86_64 verify it on build libvirt-1.2.8-9.el7.x86_64 qemu-kvm-rhev-2.1.2-14.el7.x86_64 3.10.0-208.el7.x86_64 1. prepare a guest in running and domiflist # virsh list --all Id Name State ---------------------------------------------------- 96 rhel7new running # virsh domiflist rhel7new --inactive Interface Type Source Model MAC ------------------------------------------------------- - network default rtl8139 52:54:00:c2:c6:e4 2. hot plug a interface to guest with --config # virsh attach-interface rhel7new --type network --source default --target vnet1 --mac 52:54:00:f9:11:11 --config Interface attached successfully # virsh domiflist rhel7new --inactive Interface Type Source Model MAC ------------------------------------------------------- - network default rtl8139 52:54:00:c2:c6:e4 - network default rtl8139 52:54:00:f9:11:11 3. detach it with --config success # virsh detach-interface rhel7new network --mac 52:54:00:f9:11:11 --config Interface detached successfully # virsh domiflist rhel7new --inactive Interface Type Source Model MAC ------------------------------------------------------- - network default rtl8139 52:54:00:c2:c6:e4 4. check guest still in running, works well repeat steps 1-4 on qemu-kvm build, got the same result build for qemu-kvm qemu-kvm-1.5.3-83.el7.x86_64 libvirt-1.2.8-9.el7.x86_64 3.10.0-208.el7.x86_64 the similar steps for command attach-device virsh attach-device rhel7new --file /tmp/network.xml --config Device attached successfully [root@server ~]# virsh domiflist rhel7new --inactive Interface Type Source Model MAC ------------------------------------------------------- - network default rtl8139 52:54:00:c2:c6:e4 - network default rtl8139 52:54:00:f9:11:11 virsh detach-device rhel7new --file /tmp/network.xml --config Device detached successfully [root@server ~]# virsh domiflist rhel7new --inactive Interface Type Source Model MAC ------------------------------------------------------- - network default rtl8139 52:54:00:c2:c6:e4 virsh attach-device rhel7new --file /tmp/network.xml --config Device attached successfully [root@server ~]# virsh detach-device rhel7new --file /tmp/network.xml error: Failed to detach device from /tmp/network.xml error: operation failed: no device matching mac address 52:54:00:f9:11:11 found on 0000:00:08.0 virsh detach-device rhel7new --file /tmp/network.xml --live error: Failed to detach device from /tmp/network.xml error: operation failed: no device matching mac address 52:54:00:f9:11:11 found on 0000:00:08.0 move to verified
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://rhn.redhat.com/errata/RHSA-2015-0323.html