libvirt fails work if virbr0 exists when it is started

Bug #185598 reported by Rick Clark
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
libvirt (Ubuntu)
Fix Released
Medium
Soren Hansen

Bug Description

If for some reason libvirt fails to delete virbr0 when it is shutdown, it will neither use the existing bridge nor create a new bridge. This causes libvirt to not use any bridge and not bring up the 'default' network.

Rick Clark (dendrobates)
Changed in libvirt:
assignee: nobody → shawarma
importance: Undecided → Medium
milestone: none → hardy-alpha-4
status: New → Confirmed
Revision history for this message
Soren Hansen (soren) wrote :

There are two possible workarounds/fixes:

a) Ignore failure of creating the new bridge, and just use the existing one.
b) Change the default bridge device from virbr0 to virbr%d. This will make libvirt try virbr0, virbr1, etc. until it finds a free one.

a) is useful if libvirt died for some reason without shutting down the bridge, since newly started vm's (after you start libvirtd again, obviously) will be attached to the same virtual network as the other vm's. b) is useful if for some reason the user already had a virbr0 before libvirt came along, as we avoid imposing on his existing network.

Naturally, we should do whatever we can to make sure libvirt never dies without shutting down the bridge, but if that fails, what do we prefer? a) causes the least problems, but is only really sane if we consider "virbr0" to be unique enough (i.e. is it reasonable to expect the user to *not* have set up such a bridge beforehand?).

Revision history for this message
Rick Clark (dendrobates) wrote :

This is the relevant error.
* Starting libvirt management daemon libvirtd
 libvir: QEMU error : cannot create bridge 'virbr0' : File exists
 Failed to autostart network 'default': cannot create bridge 'virbr0' : File exists [fail]

Steve Langasek (vorlon)
Changed in libvirt:
milestone: hardy-alpha-4 → hardy-alpha-5
Revision history for this message
Soren Hansen (soren) wrote :

libvirt now creates a new bridge if virbr0 is already taken.

Changed in libvirt:
status: Confirmed → Fix Released
Revision history for this message
Jean Daniel Browne (jeandaniel.browne) wrote :

The default network is set to be autostarted but the start fails. The libvirt-bin package tries to install a NAT network, is it desirable considering the fact that many users will use a physical shared device in a bridged configuration and will have to deconfigure this default network?

The default network should be installed with 'autostart' disabled, and left in tha package as an example.

~$ sudo virsh net-list --all
Connecting to uri: qemu:///system
Name State Autostart
-----------------------------------------
default inactive no

~$ sudo virsh net-start default
Connecting to uri: qemu:///system
error: Failed to start network default
error: internal error 'brctl setfd virbr%d 0' exited with non-zero status 1 and signal 0: set forward delay failed: No such device

~$ sudo virsh net-start default
j@j:~$ sudo virsh net-start default

~$ ip a

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo

    [ ... ]

7: virbr0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN
    link/ether e6:84:07:b8:86:ae brd ff:ff:ff:ff:ff:ff

8: virbr1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN
    link/ether 0e:ce:30:f3:d8:fa brd ff:ff:ff:ff:ff:ff

9: virbr2: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN
    link/ether ae:d0:f3:36:d8:34 brd ff:ff:ff:ff:ff:ff

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.