On 03/01/2012 07:23 AM, Peter Krempa wrote:
With this patch, it's possible to shut down guests in parallel. Parallel
startup was possible before, but this functionality was not documented
To enable parallel startup set the START_DELAY to 0.
Parallel shutdown has a configurable parameter PARALLEL_SHUTDOWN that
defines the number of machines being shut down in parallel. Enabling
this feature changes the semantics of SHUTDOWN_TIMEOUT parameter that is
applied as a cumulative timeout to shutdown all guests on a URI.
+# shutdown_guests_parallel URI GUESTS
+# Shutdown guests GUESTS on machine URI in parallel
if [ $timeout -gt 0 ]; then
+ while [ -n "$on_shutdown" ] || [ -n "$guests" ]; do
+ while [ -n "$guests" ]&&
+ [ $(guest_count "$on_shutdown") -lt "$PARALLEL_SHUTDOWN" ]; do
+ set -- $guests
+ shutdown_guest_async "$uri" "$guest"
+ on_shutdown="$on_shutdown $guest"
+ sleep 1
if $check_timeout; then
+ timeout=$(($timeout - 1))
+ if [ $timeout -le 0 ]; then
+ eval_gettext "Timeout expired while shutting down domains"; echo
+ on_shutdown=$(check_guests_shutdown "$uri" "$on_shutdown")
+ print_guests_shutdown "$uri" "$on_shutdown_prev" "$on_shutdown"
-# number of seconds we're willing to wait for a guest to shut down
+# 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.
+# 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. This must be set to
+# a nonzero positive value if the shutdown action is requested.
Change the last sentence:
If this is 0, then there is no time out (use with caution, as guests
might not respond to a shutdown request). (Hmm, maybe we want to
default to 300 [5 minutes], and document our non-zero default, so that
you have to explicitly request 0 to avoid timeouts.)
ACK with those lines added to shutdown_guests_parallel, and the wording
change to the config file, and with the optional change to the timeout