Classic handling on 3 guests (normal, paused, uncooperative) is currently like:
# /usr/lib/libvirt/libvirt-guests.sh stop
Running guests on default URI: testguest-normal, testguest-paused, 
testguest-nocoop
Shutting down guests on default URI...
Starting shutdown on guest: testguest-normal
Starting shutdown on guest: testguest-paused
error: Failed to shutdown domain 50ee425f-899e-4489-b5b0-22a97c2a2f42
error: Requested operation is not valid: domain is not running
Starting shutdown on guest: testguest-nocoop
Waiting for 3 guests to shut down, 120 seconds left
Shutdown of guest testguest-normal complete.
Waiting for 2 guests to shut down, 115 seconds left
Waiting for 2 guests to shut down, 110 seconds left
...
Waiting for 2 guests to shut down, 10 seconds left
Waiting for 2 guests to shut down, 5 seconds left
Timeout expired while shutting down domains

And it would leave all but testguest-normal normal up as-is


Since this - if set as a default - would change behavior it is not backportable 
easily.
In general I'd not want to change the "normal" stop code nor the behavior of 
the current config.
Unless I'm convinced otherwise by people here or on the upstreaming.
IMHO we could make the config of NEW Ubuntu releases default to the new way, 
but only drop the code to older releases leaving it as opt-in for those users.

In my experimental code I tried to define a third option to shutdown/suspend 
which would fallback to suspend for those who won't shut down.
I tried but failed to cover the uncooperative guests in an easy way - and the 
code should be upstreamable so I keep the non cooperative case out of this fix.

Not sure yet if/what we should do with a guest that crashed or is
uncooperative.

On my example with the three guests the new code handles the paused
guest fine:

# /usr/lib/libvirt/libvirt-guests.sh stop
Running guests on default URI: testguest-nocoop, testguest-paused, 
testguest-normal
Shutting down guests on default URI...
Starting shutdown on guest: testguest-nocoop
Starting managedsave on guest: testguest-paused
Starting shutdown on guest: testguest-normal
Waiting for 3 guests to shut down, 120 seconds left
Shutdown of guest testguest-paused complete.
Shutdown of guest testguest-normal complete.
Waiting for 1 guests to shut down, 115 seconds left
Waiting for 1 guests to shut down, 110 seconds left
...
Waiting for 1 guests to shut down, 10 seconds left
Waiting for 1 guests to shut down, 5 seconds left
Timeout expired while shutting down domains


I have put this in a PPA [1].
Would you mind testing that PPA with your case?
To do so install the libvirt from the PPA and then set ON_SHUTDOWN=auto in 
/etc/default/libvirt-guests
Then run your case and let me know if that would resolve it.

Maybe I also have an idea until then how to cover uncooperative guests
in a less invasive way than my tries so far.

[1]: https://launchpad.net/~ci-train-ppa-service/+archive/ubuntu/3545

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1803741

Title:
  libvirt-guests.sh cannot stop Paused domains

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/1803741/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to