libvirt fails to autostart VM attached to a bridged port

Bug #850309 reported by Robert Lange
6
Affects Status Importance Assigned to Milestone
ifupdown (Ubuntu)
Fix Released
Medium
Unassigned
Lucid
Won't Fix
Undecided
Unassigned
Maverick
Won't Fix
Undecided
Unassigned
Natty
Won't Fix
Medium
Scott Moser
libvirt (Ubuntu)
Fix Released
Medium
Unassigned
Lucid
Won't Fix
Low
Unassigned
Maverick
Won't Fix
Undecided
Unassigned
Natty
Won't Fix
Medium
Unassigned

Bug Description

I have assigned my eth0 as the sole bridge port on bridge device br0. I have my VMs set to connect to br0. When I manually start them, everything works well. I have set one VM to autostart on bootup, but it fails.

I found bug #495394, particularly comment 49 to be what I see happening. In that bug, the person who wrote comment 49 was told to file a new bug report, but it seems he did not do that. I am now filing the report.

Attached is a syslog snippet that shows autostart failing.

ProblemType: Bug
DistroRelease: Ubuntu 11.04
Package: libvirt-bin 0.8.8-1ubuntu6.5
ProcVersionSignature: Ubuntu 2.6.38-11.48-generic 2.6.38.8
Uname: Linux 2.6.38-11-generic x86_64
Architecture: amd64
Date: Wed Sep 14 15:24:19 2011
InstallationMedia: Ubuntu 11.04 "Natty Narwhal" - Release amd64 (20110427.1)
SourcePackage: libvirt
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Robert Lange (rcl24) wrote :
Revision history for this message
Robert Lange (rcl24) wrote :

I used a simple non-lvm setup. Vanilla partitioning, no mucking about.

Revision history for this message
Robert Lange (rcl24) wrote :

I created a bridge interface br0 and assigned eth0 as the only real bridge port. The VMs are configured to connect to this port as well.

Revision history for this message
Robert Lange (rcl24) wrote :

This is the virtual machine config. It works fine when I start it manually. I believe that the problem is that libvirt starts it before br0 has come up, but I thought that bug was supposed to have been fixed.

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

Thanks for taking the time to submit this bug. This certainly shouldn't be happening.

To make sure nothing went wrong with a package update, could you append your /etc/init/libvirt-bin.conf file?

I'll try to reproduce on a natty setup...

Changed in libvirt (Ubuntu):
importance: Undecided → Medium
status: New → Incomplete
Revision history for this message
Robert Lange (rcl24) wrote :

Attached /etc/init/libvirt-bin.conf as requested.

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

Thanks. That's the right version. I'll try to reproduce.

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

I believe this is due to bug 838968 in ifupdown. We should probably SRU that fix to natty. I'll build a test package with the proposed fix.

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

This should be fixed in oneiric. However I'm not sure what the simplest way is to fix it in natty and downward.

Changed in libvirt (Ubuntu):
status: New → Fix Released
Changed in libvirt (Ubuntu Lucid):
status: New → Confirmed
Changed in libvirt (Ubuntu Maverick):
status: New → Confirmed
Changed in libvirt (Ubuntu Natty):
status: New → Confirmed
Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

What we need is to have the static-network-up (plus subsequent fixes) SRUd to lucid..natty, and to have libvirt-bin wait on static-network-up rather than on 'stopped networking'.

@Robert,

as a workaround, I would suggest you change your /etc/init/libvirt-bin.conf to add a 'sleep 5'.

So in place of

# If you used to set $libvirtd_opts in /etc/default/libvirt-bin,
# change the 'exec' line here instead.
exec /usr/sbin/libvirtd $libvirtd_opts

You would now have

# If you used to set $libvirtd_opts in /etc/default/libvirt-bin,
# change the 'exec' line here instead.
script
    sleep 5
    exec /usr/sbin/libvirtd $libvirtd_opts
end script

Changed in ifupdown (Ubuntu):
status: New → Fix Released
Changed in ifupdown (Ubuntu Lucid):
status: New → Confirmed
Changed in ifupdown (Ubuntu Maverick):
status: New → Confirmed
Changed in ifupdown (Ubuntu Natty):
status: New → Confirmed
Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

For natty, the linked ifupdown tree (a compiled package of which is at http://people.canonical.com/~serge/ifupdown_0.6.10ubuntu4.1_amd64.deb) works for me. Installing that, and then changing the 'start on' line in /etc/init/libvirt-bin.conf to

start on (runlevel [2345] and static-network-up)

makes libvirt wait for all network devices to really be up and have ip addresses. As discussed on irc, if dhclient times out, then libvirt will start anyway, but this is still a big improvement.

I'm assigning this to smoser for a quick sanity check. smoser, if you think it better than SpamapS take a look, please assign him, or assign to me to bounce back to me.

Changed in ifupdown (Ubuntu Natty):
assignee: nobody → Scott Moser (smoser)
Changed in ifupdown (Ubuntu):
importance: Undecided → Medium
Changed in ifupdown (Ubuntu Natty):
importance: Undecided → Medium
Changed in libvirt (Ubuntu Natty):
importance: Undecided → Medium
Revision history for this message
Robert Lange (rcl24) wrote :

The temporary workaround from comment 10 did not work for me. No matter how big I made the sleep, it did not wait. Also, it broke `stop libvirt-bin`. Attached is a modified init file that seems to work.

Revision history for this message
Robert Lange (rcl24) wrote :

After upgrading to 11.10, I no longer see this bug.

Revision history for this message
Robert Lange (rcl24) wrote :

Can we get an official word that this is a "Won't fix" for Natty and below? I would like to retire this bug from my active bugs tracker, but I cannot make the change to "Won't fix" and I would rather not set it to "Invalid".

Changed in ifupdown (Ubuntu Maverick):
status: Confirmed → Won't Fix
Changed in ifupdown (Ubuntu Natty):
status: Confirmed → Won't Fix
Changed in libvirt (Ubuntu Maverick):
status: Confirmed → Won't Fix
Changed in libvirt (Ubuntu Natty):
status: Confirmed → Won't Fix
Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

Marked wontfix for maverick and natty. Not sure about lucid.

Note that comment #5 is not quite right - we don't need to wait on static-network-up, because runlevel 2 already waits on it. So the fix simply depends on static-network-up being in lucid.

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

The static-network-up event will not be added to lucid, so this is also wontfix.

To work around this, the recommendation is:

16:56 < SpamapS> hallyn: for lucid, people have to edit /etc/init/rc-sysinit.conf to delay runlevel 2 until after the appropriate network is up

Changed in ifupdown (Ubuntu Lucid):
status: Confirmed → Won't Fix
Changed in libvirt (Ubuntu Lucid):
status: Confirmed → Won't Fix
importance: Undecided → Low
Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

(marked low priority for libvirt per guidelines since there is a workaround)

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.