Comment 27 for bug 495394

Revision history for this message
Clint Byrum (clint-fewbar) wrote : Re: [Bug 495394] Re: autostart almost always fails on boot time host

Excerpts from Heiko Harders's message of Tue May 24 18:01:58 UTC 2011:
> I changed my upstart script to ensure both the bridge and the md0 device
> (on which the LVM volume is located) are started before libvirt is
> started. In my situation this makes sure all my virtual machines can be
> started. However, different virtual machines can have different
> dependencies on (possibly slow) hardware being available or not. Perhaps
> it is a good idea to create separate upstart scripts for each virtual
> machine? This way it could be ensured that the hardware a specific
> virtual machine is relying on is brought up.

Another option is to make the start on more broad (start on
net-device-added or block-device-added) and then in the pre-start or
daemon's own code, check for the hardware and gracefully refuse to start
if its not available yet.

This can actually get racey though w/o instance specifiers though
because if block-device-added happens between the pre-start deciding
the block device it needed was not there, and the pre-start exitting,
upstart will just consider its job done (its already in a goal of start
so upstart won't change it).