[Bug 495394] Re: autostart almost always fails on boot time host

Serge Hallyn 495394 at bugs.launchpad.net
Thu Jul 7 21:10:58 UTC 2011


** Description changed:

+ =====================================================
+ 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-0.9.2/debian/libvirt-bin.upstart    2011-06-23 10:12:47.000000000 -0500
+ +++ libvirt-0.9.2/debian/libvirt-bin.upstart    2011-07-07 10:23:20.000000000 -0500
+ @@ -1,7 +1,7 @@
+  description "libvirt daemon"
+  author "Dustin Kirkland <kirkland at canonical.com>"
+  
+ -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/interfaces like:
+ 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>
+ 
+ (an lxc instance can be used as well as qemu) and link its definition
+ under /etc/libvirt/qemu/autostart/ or /etc/libvirt/lxc/autostart/.
+ On reboot, the VM will fail to start without this patch.
+ 
+ 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://nl.archive.ubuntu.com karmic-updates/main Packages
-         100 /var/lib/dpkg/status
-      0.7.0-1ubuntu13 0
-         500 http://nl.archive.ubuntu.com karmic/main Packages
+   Installed: 0.7.0-1ubuntu13.1
+   Candidate: 0.7.0-1ubuntu13.1
+   Version table:
+  *** 0.7.0-1ubuntu13.1 0
+         500 http://nl.archive.ubuntu.com karmic-updates/main Packages
+         100 /var/lib/dpkg/status
+      0.7.0-1ubuntu13 0
+         500 http://nl.archive.ubuntu.com karmic/main Packages
  
  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.d/libvirt-bin restart'
  
  Libvirtd is running.
  There are symlinks in /etc/libvirt/qemu/autostart.
  
  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.d/libvirt-bin restart' all of my domains are coming up as
  expected.  Autostart works for all domains while using Ubuntu 8.04.3 LTS
  or Ubuntu 9.04 as host OS.
  
  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/libvirt.conf' to
  1, but I don't see anything in the files in `/var/log' that explains why
  my domains are not auto-starting during boot time of the host OS (or at
  least, nothing that I recognize).
  
  If there is anything else I could try, or any other information I should
  provide, please let me know.

-- 
You received this bug notification because you are a member of Ubuntu
Server Team, which is subscribed to libvirt in Ubuntu.
https://bugs.launchpad.net/bugs/495394

Title:
  autostart almost always fails on boot time host

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/495394/+subscriptions



More information about the Ubuntu-server-bugs mailing list