[precise] virbr0 not created during fresh install when dnsmasq is running with --except-interface=virbr0

Bug #918807 reported by Brad Figg
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
dnsmasq (Ubuntu)
New
Low
Unassigned
libvirt (Ubuntu)
Confirmed
Low
Unassigned

Bug Description

On a fresh precise server install, I also installed koan, virtinst and quemu-kvm. I then got errors from koan trying to instantiate a VM due to a missing virbr0.

Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

I'm afraid I can't reproduce this. Can you say exactly how you installed libvirt-bin? Was it listed in the preseed? Installed with 'virtualization host' in tasksel?

Does /etc/libvirt/qemu/networks/autostart/ have default.xml? What does 'virsh net-list' show? And is there anything of interest in /var/log/libvirt/libvirtd.log?

Changed in libvirt (Ubuntu):
importance: Undecided → High
status: New → Incomplete
Revision history for this message
Brad Figg (brad-figg) wrote :

@serge

I had installed it via "apt-get install vertinst". I was trying to get koan working.

However, since encountering this bug and some other issues, I reinstalled this server from scratch with Oneiric server. I followed the exact same process. I first installed ubuntu-orchestra-server. After verifying that was working fairly well I installed vertinst and qemu-kvm and koan.

At this point I ran into a different issue and was instructed to install the Precise version of the vertinst package which I did by downloading the .deb and using "dpkg -i" to install it.

I'm very motivated to get this resolved so if there is anything I can do to assist in debugging it, let me know.

Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

So you installed the precise virtinst package on an uptodate oneiric system? That oneiric system already had libvirt fully installed?

I can try to reproduce based on that. Please let me know if I misunderstood.

Revision history for this message
Brad Figg (brad-figg) wrote :

@serge,

You have the correct. Andres told me to do that due to another bug that I ran into which had been fixed in the Precise version but was not backported/SRU'd for Oneiric.

Revision history for this message
Brad Figg (brad-figg) wrote :

@serge,

I'm attaching the default.xml file the libvirtd.log file.

Running "virsh net-list" returns:

> virsh net-list
Name State Autostart
-----------------------------------------

Revision history for this message
Brad Figg (brad-figg) wrote :
Revision history for this message
Brad Figg (brad-figg) wrote :
Revision history for this message
Brad Figg (brad-figg) wrote :

> sudo su -
[sudo] password for bradf:
root@red:~# virsh net-list
Name State Autostart
-----------------------------------------

root@red:~# virsh net-list --all
Name State Autostart
-----------------------------------------
default inactive yes

root@red:~# virsh net-autostart default
Network default marked as autostarted

root@red:~#

Revision history for this message
Serge Hallyn (serge-hallyn) wrote : Re: [Bug 918807] Re: [precise] virbr0 not created during fresh install

Quoting Brad Figg (<email address hidden>):
> > sudo su -
> [sudo] password for bradf:
> root@red:~# virsh net-list
> Name State Autostart
> -----------------------------------------
>
> root@red:~# virsh net-list --all
> Name State Autostart
> -----------------------------------------
> default inactive yes
>
> root@red:~# virsh net-autostart default
> Network default marked as autostarted

Sorry, I meant

 virsh net-start default

here. It was already marked autostart. We want to see if libvirt is
able to start it at this point.

Revision history for this message
Serge Hallyn (serge-hallyn) wrote : Re: [precise] virbr0 not created during fresh install

From libvirtd.log:

14:14:46.066: 17275: error : virCommandWait:1991 : internal error Child process (dnsmasq --strict-order --bind-interfaces --pid-file=/var/run/libvirt/network/default.pid --conf-file= --except-interface lo --listen-address 192.168.122.1 --dhcp-range 192.168.122.2,192.168.122.254 --dhcp-leasefile=/var/lib/libvirt/dnsmasq/default.leases --dhcp-lease-max=253 --dhcp-no-override) status unexpected: exit status 2

The dnsmasq manpage says error 2 means :
       A problem with network access occurred (address in use, attempt to use privileged ports without permission).

(I tried to reproduce this on a canonistack instance, by installing
libvirt-bin and then installing
 http://archive.ubuntu.com/ubuntu/pool/main/v/virtinst/virtinst_0.600.0-1ubuntu4_all.deb
with dpkg -i, then doing 'apt-get install -f', but after reboot virbr0 did come up)

Is it possible to do 'apport-collect 918807' from that machine?

Otherwise, please post the output of 'ps -ef', 'dpkg -l | grep dnsmasq', 'dpkg -l libvirt-bin', 'ps -ef | grep libvirt', 'ps -ef | grep dnmasq', 'ifconfig -a', and the files /etc/network/interfaces and /etc/libvirt/libvirtd.conf.

Thanks.

Revision history for this message
Brad Figg (brad-figg) wrote :

> apport-collect 918807
Package libvirt not installed and no hook available, ignoring

*** Updating problem report

No additional information collected.

Press any key to continue...

No pending crash reports. Try --help for more information.

Revision history for this message
Brad Figg (brad-figg) wrote :

[~]
> dpkg -l | grep dnsmasq
ii dnsmasq 2.57-1ubuntu1 A small caching DNS proxy and DHCP/TFTP server
ii dnsmasq-base 2.57-1ubuntu1 A small caching DNS proxy and DHCP/TFTP server

[~]
> dpkg -l libvirt-bin
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Description
+++-======================-=========================-====================================
ii libvirt-bin 0.9.2-4ubuntu15.1 the programs for the libvirt library

[~]
> sudo ps -ef | grep libvirt
root 1017 1 0 Jan25 ? 00:00:00 /usr/sbin/libvirtd -d
bradf 2508 2137 0 10:28 pts/0 00:00:00 grep --color=auto libvirt

[~]
> sudo ps -ef | grep dnsmask
bradf 2511 2137 0 10:28 pts/0 00:00:00 grep --color=auto dnsmask

Revision history for this message
Brad Figg (brad-figg) wrote :
Revision history for this message
Brad Figg (brad-figg) wrote :
Revision history for this message
Brad Figg (brad-figg) wrote :
Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

So if you do

   virsh net-start default

does that succeed and bring up virbr0?

What does 'ifconfig -a' show?

Revision history for this message
Brad Figg (brad-figg) wrote :

[~]
> sudo virsh net-start default
error: Failed to start network default
error: internal error Child process (dnsmasq --strict-order --bind-interfaces --pid-file=/var/run/libvirt/network/default.pid --conf-file= --except-interface lo --listen-address 192.168.122.1 --dhcp-range 192.168.122.2,192.168.122.254 --dhcp-leasefile=/var/lib/libvirt/dnsmasq/default.leases --dhcp-lease-max=253 --dhcp-no-override) status unexpected: exit status 2

[~]
> ifconfig -a
eth0 Link encap:Ethernet HWaddr 00:23:54:9e:5e:c8
          inet addr:192.168.1.6 Bcast:192.168.1.255 Mask:255.255.255.0
          inet6 addr: fe80::223:54ff:fe9e:5ec8/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
          RX packets:7266810 errors:0 dropped:0 overruns:0 frame:0
          TX packets:3971503 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:3480412144 (3.4 GB) TX bytes:6937280997 (6.9 GB)
          Interrupt:18

eth1 Link encap:Ethernet HWaddr 00:23:54:9e:5e:c7
          BROADCAST MULTICAST MTU:1500 Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
          Interrupt:17

lo Link encap:Local Loopback
          inet addr:127.0.0.1 Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING MTU:16436 Metric:1
          RX packets:252185 errors:0 dropped:0 overruns:0 frame:0
          TX packets:252185 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:30386239 (30.3 MB) TX bytes:30386239 (30.3 MB)

Revision history for this message
Serge Hallyn (serge-hallyn) wrote : Re: [Bug 918807] Re: [precise] virbr0 not created during fresh install

Thanks. So it's not a race with networking setup - dnsmasq simply refuses
to run. Odd!

I'll try a bit more to reproduce with a vm with two nics and with an
interfaces file like yours.

Revision history for this message
Serge Hallyn (serge-hallyn) wrote : Re: [precise] virbr0 not created during fresh install

Still could not reproduce.

Changed in libvirt (Ubuntu):
status: Incomplete → New
Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

Looking at ps -ef output,

/usr/sbin/dnsmasq -x /var/run/dnsmasq/dnsmasq.pid -u dnsmasq -7 /etc/dnsmasq.d,.dpkg-dist,.dpkg-old,.dpkg-new

I'm convinced that's the problem. Is there a reason this dnsmasq is running, and not binding just certain interfaces?

If you can change this dnsmasq to run with "--except-interface=virbr0", that should suffice.

Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

There you go. 'sudo apt-get install dnsmasq' lets me reproduce.

Setting 'except-interface=virbr0' in /etc/default/dnsmasq *should* fix it. But it doesn't. I'm not sure whether we should consider it a bug in libvirt that it is trying to grab more bridges than it should.

You should be able to work around this at any rate by doing "apt-get purge dnsmasq"

Changed in libvirt (Ubuntu):
status: New → Confirmed
summary: - [precise] virbr0 not created during fresh install
+ [precise] virbr0 not created during fresh install when dnsmasq is
+ running with --except-interface=virbr0
Changed in libvirt (Ubuntu):
importance: High → Low
Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

Following text in libvirt source explains why libvirt does it:

    /*
     * --interface does not actually work with dnsmasq < 2.47,
     * due to DAD for ipv6 addresses on the interface.
     *
     * virCommandAddArgList(cmd, "--interface", ipdef->bridge, NULL);
     *
     * So listen on all defined IPv[46] addresses
     */

I'm changing the priority to low because there is a workaround. However, it's possible that the workaround is not always acceptable, in which case priority here should be raised.

Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

For precise, we coudl actually fix this (at the cost of a delta from upstream and debian), since precise has dnsmasq 2.59.

Revision history for this message
Brad Figg (brad-figg) wrote :

Indeed, purging dnsmasq fixed this problem.

Dave Walker (davewalker)
Changed in dnsmasq (Ubuntu):
importance: Undecided → Low
Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

I think we can mark this a dup of bug 928524 ?

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.