Looking for any pointers anyone may have to introduce a delayed start for KVM guests i.e. 30 seconds between starting each virtual server rather than starting them all at once which thrashes the disks and actually just ends up taking a lot longer to get everything settled.

The approach I have tried is to update /etc/sysconfig/libvirt-guests as follows:

# URIs to check for running guests
# example: URIS='default xen:/// vbox+tcp://host/system lxc:///'
#URIS=default

# action taken on host boot
# - start   all guests which were running on shutdown are started on boot
#           regardless on their autostart settings
# - ignore  libvirt-guests init script won't start any guest on boot, however,
#           guests marked as autostart will still be automatically started by
#           libvirtd
ON_BOOT=ignore

# Number of seconds to wait between each guest start. Set to 0 to allow
# parallel startup.
START_DELAY=180

# action taken on host shutdown
# - suspend   all running guests are suspended using virsh managedsave
# - shutdown  all running guests are asked to shutdown. Please be careful with
#             this settings since there is no way to distinguish between a
#             guest which is stuck or ignores shutdown requests and a guest
#             which just needs a long time to shutdown. When setting
#             ON_SHUTDOWN=shutdown, you must also set SHUTDOWN_TIMEOUT to a
#             value suitable for your guests.
ON_SHUTDOWN=shutdown

# If set to non-zero, shutdown will suspend guests concurrently. Number of
# guests on shutdown at any time will not exceed number set in this variable.
#PARALLEL_SHUTDOWN=0

# Number of seconds we're willing to wait for a guest to shut down. If parallel
# shutdown is enabled, this timeout applies as a timeout for shutting down all
# guests on a single URI defined in the variable URIS. If this is 0, then there
# is no time out (use with caution, as guests might not respond to a shutdown
# request). The default value is 300 seconds (5 minutes).
#SHUTDOWN_TIMEOUT=300

# If non-zero, try to bypass the file system cache when saving and
# restoring guests, even though this may give slower operation for
# some file systems.
#BYPASS_CACHE=0

I have verified the default URIs path in libvirt.conf is correct also and have tried changing the default in the above config file to qemu:///system & qemu:///

All the guests boot at the same time regardless of changes made.

I have also tried removing the contents of /etc/libvirt/qemu/autostart/ incase the symbolic links were overriding the libvirt-guests config however nothing starts then (not surprising).

Anyone got this working or have an alternate method?

I am aware I could redirect the emulator path to introduce a delay within a script however this would impact the creation of new guests which is not an option.

thanks.

  • Why have you got ON_BOOT=ignore? This effectively disables libvirt-guests. – Michael Hampton Aug 23 at 14:20
  • except it does not do any such thing :) the comment next to it states: "libvirt-guests init script won't start any guest on boot, however, guests marked as autostart will still be automatically started by libvirtd" Either way they all start up at the same time anyway with this set to ignore or start, in the incredibly limited reference I found to this function they all state use ignore for delayed start however I am begging to think that is more of a theory rather than something anyone tested now. – Backtogeek Aug 24 at 7:08

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.