autostart fails on boot time host when network devices not ready
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
libvirt (Ubuntu) |
Fix Released
|
High
|
Serge Hallyn | ||
Lucid |
Fix Released
|
Undecided
|
Unassigned | ||
Maverick |
Fix Released
|
Undecided
|
Unassigned | ||
Natty |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
=======
SRU justification:
1. Impact: servers which auto-start libvirt VMs can result in failed
VM boots if network devices involved have not been brought up in
time.
2. How bug is addressed: the libvirt-bin.conf upstart job now waits
until networking.conf (ifup -a) is done, so that all network devices
have been brought up.
3. Minimal patch:
--- libvirt-
+++ libvirt-
@@ -1,7 +1,7 @@
description "libvirt daemon"
author "Dustin Kirkland <email address hidden>"
-start on runlevel [2345]
+start on (runlevel [2345] and stopped networking RESULT=ok)
stop on runlevel [!2345]
expect daemon
4. TEST CASE:
Add an entry to /etc/network/
auto lxcbr0
iface lxcbr0 inet static
pre-up /opt/sleep
bridge_ports none
address 192.168.30.1
netmask 255.255.255.0
where /opt/sleep is an executable script sleeping 1 minute. Then define
a libvirt VM with the following network:
<interface type='bridge'>
<source bridge='lxcbr0'/>
<target dev='veth0'/>
</interface>
If reproducing inside a kvm VM, you can define a minimal non-kvm qemu
vm booting from a debian businesscard iso cdrom, or use an lxc instance.
Make the VM autostart using
virsh autostart vmname # or virsh -c lxc:// autostart vmname
On reboot, the VM will fail to start without this patch. With the patch,
for the first minute after reboot (while lxcbr0 is not yet configured) the
command
status libvirt-bin
will show libvirt is not yet running. When it starts, your vm will be running
as seen by
virsh list # or virsh -c lxc:// list
5. Regression potential: If a site has auto network interfaces which are
defined but always fail to start, then even though those interfaces may
not be needed at all, libvirt will fail to start until the definitions
are removed or fixed.
=======
host OS:
lsb_release -rd:
1. Release of Ubuntu:
Description: Ubuntu 9.10
Release: 9.10
Linux 2.6.31-16-generic #53-Ubuntu SMP Tue Dec 8 04:02:15 UTC 2009 x86_64 GNU/Linux
2. Version of package:
apt-cache policy libvirt-bin
libvirt-bin:
Installed: 0.7.0-1ubuntu13.1
Candidate: 0.7.0-1ubuntu13.1
Version table:
*** 0.7.0-1ubuntu13.1 0
500 http://
100 /var/lib/
0.
500 http://
3. What I expected to happen:
Domains that are marked `autostart' should be running after the host was booted.
4. What happened instead:
- auto starting domains mostly fails when booting the host OS (Ubuntu 9.10)
- auto starting the same domains does work when using Ubuntu 8.04.3 LTS or Ubuntu 9.04 as host OS
- auto starting the same domains does work when invoking `/etc/init.
Libvirtd is running.
There are symlinks in /etc/libvirt/
Mostly none of my domains are running, however sometimes a domain succeeds and is booted (say 1 in 10 attempts a domain succeeds to boot during the host boot process). When, after booting the host, I run `/etc/init.
I'm using Ubuntu 9.04 and 9.10 guest OS'es. Some of them were created under Ubuntu 9.04 and some of them were created on Ubuntu 9.10. Most of the domains are installed on a LVM, but I also tried creating a file based virtual machine that is located on the boot device of the host OS. There is no difference between these domains, all of them are booted only very sporadicly while booting the host OS.
All domains are using a bridge device that I specified myself, and using static IP addresses. I removed the default network created by libvirt, because I don't use it (however: before I deleted that, autostart didn't work either). The bridge device works properly, I can log in my virtual machines via ssh and I use the bridge as well to talk to the internal network.
I tried setting the bug logging level in `/etc/libvirt/
If there is anything else I could try, or any other information I should provide, please let me know.
Changed in libvirt (Ubuntu): | |
importance: | Undecided → Medium |
status: | New → Confirmed |
tags: | added: patch |
Changed in libvirt (Ubuntu): | |
assignee: | Clint Byrum (clint-fewbar) → Serge Hallyn (serge-hallyn) |
Changed in libvirt (Ubuntu): | |
status: | Confirmed → In Progress |
description: | updated |
tags: |
added: verification-failed removed: verification-needed |
description: | updated |
Just rebooted the host, which started checking the file system. Thereafter all domains seemed to be up. Unsure whether this was coincidence (can't remember seeing all domains up after a reboot before), or whether the extra boot time somehow caused the domains to come up as expected.