Bug 671050
Summary: | Libvirt hot unplug the 1st guest nic silently when not specifying --mac | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 6 | Reporter: | zhanghaiyan <yoyzhang> |
Component: | libvirt | Assignee: | Michal Privoznik <mprivozn> |
Status: | CLOSED ERRATA | QA Contact: | Virtualization Bugs <virt-bugs> |
Severity: | medium | Docs Contact: | |
Priority: | low | ||
Version: | 6.1 | CC: | berrange, crobinso, dallan, dyuan, eblake, jdenemar, jyang, llim, maurizio.antillon, mjenner, mzhan, veillard, xen-maint |
Target Milestone: | rc | ||
Target Release: | --- | ||
Hardware: | x86_64 | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | libvirt-0.8.7-4.el6 | Doc Type: | Bug Fix |
Doc Text: |
If the "virsh detach-interface" command was used on a domain with multiple NICs, but a particular MAC address was not specified with "--mac", virsh detached the first interface without error. The "--mac" option is now required where a domain has multiple NICs, and an appropriate error message has been added.
|
Story Points: | --- |
Clone Of: | Environment: | ||
Last Closed: | 2011-05-19 13:25:55 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
zhanghaiyan
2011-01-20 03:31:30 UTC
Well I don't think it's a bug, it's a normal behaviour in some sense, you ask to remove a network device, don't specify which one and virsh just does it, just it decides which one to pick ! Actually libvirt API requires the user to give a precise definition for the interface, it's just virsh behaviour here which is questionable. I agree that --all is a good idea, and this could be fixed, but it's an upstream request for enhancement, not something to target for 6.1, Daniel Actually this is a bug IMHO. The virDomainDetachDevice API expects to receive an XML blob that matches one of the NICs in its existing XML. If the mac address was not included in that XML, then it should have rejected it as not matching since there was no unique identifier to match with. I agree with Daniel B. here. The current behavior is non-deterministic and I also think it should be rejected. The patch has already been posted to rhvirt-patches: http://post-office.corp.redhat.com/archives/rhvirt-patches/2011-January/msg01310.html It makes sense to me to just take it into 6.1 instead of waiting for 6.2. I updated BZ flags accordingly. I'm fine with that as long as it's been accepted upstream. Verified with Passed in below environment: # uname -a Linux dhcp-65-85.nay.redhat.com 2.6.32-99.el6.x86_64 #1 SMP Fri Jan 14 10:46:00 EST 2011 x86_64 x86_64 x86_64 GNU/Linux libvirt-0.8.7-4.el6.x86_64 kernel-2.6.32-99.el6.x86_64 qemu-kvm-0.12.1.2-2.132.el6.x86_64 According to bug description, I also hotplug interface with network type for 3 times. When I hot unplug the interface without --mac, just like step 6, then libvirt reject to detach as following: And nothing will be changed for this guest interfaces. # virsh detach-interface rhel6 --type network error: Domain has 3 interfaces. Please specify which one to detach using --mac # virsh dumpxml rhel6 |grep network <interface type='network'> <source network='default'/> <interface type='network'> <source network='default'/> <interface type='network'> <source network='default'/> Technical note added. If any revisions are required, please edit the "Technical Notes" field accordingly. All revisions will be proofread by the Engineering Content Services team. New Contents: Cause: detach-interface via virsh without mac being specified on domain with multiple NICs Consequence: virsh detached the first interface without error Fix: make --mac required in cases where domain have more than one NICs Result: virsh prints error message suggesting --mac Technical note updated. If any revisions are required, please edit the "Technical Notes" field accordingly. All revisions will be proofread by the Engineering Content Services team. Diffed Contents: @@ -1,8 +1 @@ -Cause: +If the "virsh detach-interface" command was used on a domain with multiple NICs, but a particular MAC address was not specified with "--mac", virsh detached the first interface without error. The "--mac" option is now required where a domain has multiple NICs, and an appropriate error message has been added.- detach-interface via virsh without mac being specified on domain with multiple NICs -Consequence: - virsh detached the first interface without error -Fix: - make --mac required in cases where domain have more than one NICs -Result: - virsh prints error message suggesting --mac * The problem was: libvirt API requires to give full XML description on devices being detached. Virsh therefore got domain XML and tried to find those snippets which are the most close to given arguments. But this can result in many interfaces which can be distinguished by MAC. * Running virsh detach-interface against domain with multiple interfaces, but without any MAC specified, silently detached the domain's first interface. * When there are many interfaces left after elimination phase, require --mac, so exactly one interface is selected * Users gets error message suggesting --mac An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on therefore solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHBA-2011-0596.html |