Bug 479622
Summary: | libvirt should avoid creating virtual networks with the same bridge name | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Edouard Bourguignon <madko> |
Component: | libvirt | Assignee: | Daniel Veillard <veillard> |
Status: | CLOSED CURRENTRELEASE | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
Severity: | medium | Docs Contact: | |
Priority: | low | ||
Version: | 11 | CC: | berrange, clalance, crobinso, hbrock, markmc, veillard, virt-maint |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2009-11-18 13:52:18 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
Edouard Bourguignon
2009-01-12 08:13:43 UTC
virsh # net-list --all Nom État Démarrage automatique ----------------------------------------- reseau_interne actif yes default inactif yes virsh # net-dumpxml default <network> <name>default</name> <uuid>f3436898-c765-4ac1-8c0c-19c90a4a55af</uuid> <forward mode='nat'/> <bridge name='virbr0' stp='on' forwardDelay='0' /> <ip address='192.168.122.1' netmask='255.255.255.0'> <dhcp> <range start='192.168.122.2' end='192.168.122.254' /> </dhcp> </ip> </network> virsh # net-dumpxml reseau_interne <network> <name>reseau_interne</name> <uuid>10b9aa94-a0cf-ec18-78c2-77c3cd00e253</uuid> <bridge name='virbr0' stp='on' forwardDelay='0' /> <ip address='192.168.100.1' netmask='255.255.255.0'> <dhcp> <range start='192.168.100.128' end='192.168.100.254' /> </dhcp> </ip> </network> Why the bridge name is the same? Okay, there is definitely a legit bug here, not really sure what the proper fix is though. Whenever a virtual network is brought up, it grabs the first available 'virbrX' interface. From that point on, it will _always_ try to grab that same interface, and if it can't, it errors out. The 'default' network is always going to grab 'virbr0'. So what happens if you define a new virtual network and set it to autostart? If its name comes before 'default' alphabetically, when libvirtd starts up, the new network will grab 'virbr0', and then 'default' will fail to come up. I think the reasonable solutions are: 1) Have network_driver.c:networkStartNetworkDaemon or bridge.c:brAddBridge be intelligent enough to fall back to a sequentially allocated bridge name if the hardcoded xml bridge name doesn't fly 2) Add some intelligence somewhere in the stack to not allocate a 'virbrX' interface to a new network if it is already present in another net's xml. I think 2 is probably the way to go. Dan or Mark, any suggestions? Dynamically assigning bridge name on each startup is not desirable - it won't work with Xen, because when we attach a guest to a virtual network, the bridge device name ends up in the Xen config. So we must guarentee that the same bridge device name is used on every boot. Really virt-manager should never create a network XML without an explicit bridge name. libvirt however, should never have allowed 2 configs with the same bridge name to come into existance. When defining a new guest, or auto-allocating a bridge name, it must ensure it doesn't clash with any inactive network config, as well as the existing check against active bridges. > Dynamically assigning bridge name on each startup is not desirable - it won't > work with Xen, because when we attach a guest to a virtual network, the bridge > device name ends up in the Xen config. So we must guarentee that the same > bridge device name is used on every boot. Really virt-manager should never > create a network XML without an explicit bridge name. > Seems reasonable that libvirt could also auto assign an unused bridge name to a network at define time, if the user doesn't specify one. That would save api users the hassle of reimplementing the collision detection. The code for generating a name of 'virbrX' is largely present anyways. > libvirt however, should never have allowed 2 configs with the same bridge name > to come into existance. When defining a new guest, or auto-allocating a bridge > name, it must ensure it doesn't clash with any inactive network config, as well > as the existing check against active bridges. Sounds good. This was posted upstream http://www.redhat.com/archives/libvir-list/2009-February/msg00309.html and included in 0.6.1 release. NB, any existing defined virtual networks with clashing bridge names still won't work, but we have prevented any newly defined networks breaking in this way. libvirt-0.6.1-1.fc10 has been pushed to the Fedora 10 testing repository. If problems still persist, please make note of it in this bug report. If you want to test the update, you can install it with su -c 'yum --enablerepo=updates-testing update libvirt'. You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F10/FEDORA-2009-2396 This message is a reminder that Fedora 10 is nearing its end of life. Approximately 30 (thirty) days from now Fedora will stop maintaining and issuing updates for Fedora 10. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as WONTFIX if it remains open with a Fedora 'version' of '10'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version prior to Fedora 10's end of life. Bug Reporter: Thank you for reporting this issue and we are sorry that we may not be able to fix it before Fedora 10 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora please change the 'version' of this bug to the applicable version. If you are unable to change the version, please add a comment here and someone will do it for you. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete. The process we are following is described here: http://fedoraproject.org/wiki/BugZappers/HouseKeeping libvirt-0.6.1 isn't pushed to stable, and is sitting in updates testing for F10. This bug won't be fixed in the stable f10 package, but is fixed in F11. Moving to F11 and closing as CURRENTRELEASE. |