list_guests lists all 6
8b5645c2-12e5-4ec7-9350-08adb3e8cb0f
ef55638c-926a-4d43-9790-99aae3010951
119975ea-8d86-4114-84db-02f1f655d279
afe0321b-2deb-44c8-9cd3-727882b140b9
6d0a05d2-b40c-433e-b656-3519626dcbf3
a9224770-a4b7-4044-b4ce-2ceb934c1e4b
All xenial-testshutdown-* get printed to stdout
Listfile gets URI + guests:
+ echo default 8b5645c2-12e5-4ec7-9350-08adb3e8cb0f
ef55638c-926a-4d43-9790-99aae3010951 119975ea-8d86-4114-84db-02f1f655d279
afe0321b-2deb-44c8-9cd3-727882b140b9 6d0a05d2-b40c-433e-b656-3519626dcbf3
a9224770-a4b7-4044-b4ce-2ceb934c1e4b
shutdown_guests_parallel called with:
+ uri=default
+ guests=8b5645c2-12e5-4ec7-9350-08adb3e8cb0f
ef55638c-926a-4d43-9790-99aae3010951 119975ea-8d86-4114-84db-02f1f655d279
afe0321b-2deb-44c8-9cd3-727882b140b9 6d0a05d2-b40c-433e-b656-3519626dcbf3
a9224770-a4b7-4044-b4ce-2ceb934c1e4b
on_shutdown= (empty initially)
loops until
$on_shutdown is empty (again)
AND
$guests is empty (expects remove of handled guests)
Then counts current $on_shutdown vs $PARALLEL_SHUTDOWN target.
Makes $guests the arguments vais "set --"
Picks $1 as guest
Shifts $1 out of the args
guests is assigned the remaining guests.
TL;DR This popped $1 into $guest and shrunk $guests by 1
Checks if this popped val is already in $on_shutdown
Gets a guest name
Calls shutdown_guest_async with that $guest
=> 8b5645c2-12e5-4ec7-9350-08adb3e8cb0f
Extends on_shutdown by $guest
LOOPS UP
$guests still full
Then counts current $on_shutdown vs $PARALLEL_SHUTDOWN target - still some
to go.
Again pops one and shrinks $guests
Checks if this popped val is already in $on_shutdown
Gets a guest name
Calls shutdown_guest_async with that $guest
=> ef55638c-926a-4d43-9790-99aae3010951
Extends on_shutdown by $guest
Now it has 2 (of 2) async shutdowns started
sleep 1
Counts remaining guests = 4
Counts on shutdown = 2
Reports on progress in regard to timeout
# Saves current on_shutdown
on_shutdown_prev=$on_shutdown
# Determines how much of current on_shutdown are still running and sets
$guests_shutting_down to remaining ones
check_guests_shutdown "$uri" "$on_shutdown"
on_shutdown="$guests_shutting_down"
print_guests_shutdown "$uri" "$on_shutdown_prev" "$on_shutdown"
Initially both shutdown guests are still on, so they are kept and nothing is
reported as shut down.
For now the inner loop repetition does not make progress due to on_shutdown
already being 2 matching 2 of $PARALLEL_SHUTDOWN
On the next check of check_guests_shutdown default
8b5645c2-12e5-4ec7-9350-08adb3e8cb0f ef55638c-926a-4d43-9790-99aae3010951 the
guests are down
on_shutdown= is set to an empty value
on_shutdown_prev= 8b5645c2-12e5-4ec7-9350-08adb3e8cb0f
ef55638c-926a-4d43-9790-99aae3010951 (from before the check)
print_guests_shutdown reports the two guests as GONE
LOOPS UP
It detects that on shutdown is now count 0
FIND#1: the check against $guests is not the long VAR
Something modified $guests to the value of on_shutdown and this is what
breaks progress.
From here is is an infnite loop until timeout.
This is a scope bug in this ยง%$/&( script.
I hate to touch it BTW as I did when fixing the last issue, but bugs needs
fixing.
--
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1688508
Title:
libvirt-guests.sh fails to shutdown guests in parallel
To manage notifications about this bug go to:
https://bugs.launchpad.net/libvirt/+bug/1688508/+subscriptions
--
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs