[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] boot time delay for domains?



On Wed, Dec 22, 2010 at 13:32, Harald Dunkel <harald dunkel aixigo de> wrote:
> Is there a global "boot time delay" configuration parameter
> to make sure that the autostart domains are not started all
> in parallel at boot time?

AFAIK there is no such option.

> Any helpful comment would be highly appreciated.

in domain XML you can change <emulator> tag and point to your script,
which will start domain after some random delay

e.g. something like this:

<domain type='kvm'>
  <name>test</name>
  ...
  <devices>
    <emulator>/usr/bin/local/qemu-kvm-with-random-delay</emulator>
  <devices>
</domain>

# cat > /usr/bin/local/qemu-kvm-with-random-delay
#!/bin/bash
# delay running of virtual machine by 0-9 seconds
sleep $(( $RANDOM % 10 ))
exec /usr/bin/qemu-kvm $*
^D

You can also detect if domain is started by libvirtd autostart feature or not.
it could be enough that you will check if [ -f
/var/lock/subsys/libvirtd ]. But I've not tested.

If you'll have some solution share with us, please.

-- 
Pawel


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]