public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [RFC manager/container/qemu-server/guest-common 0/4] fix #4474: stop tasks may overrule shutdown tasks
@ 2023-01-26  8:32 Friedrich Weber
  2023-01-26  8:32 ` [pve-devel] [RFC manager 1/4] fix #4474: ui: vm stop: ask if active shutdown tasks should be aborted Friedrich Weber
                   ` (4 more replies)
  0 siblings, 5 replies; 14+ messages in thread
From: Friedrich Weber @ 2023-01-26  8:32 UTC (permalink / raw)
  To: pve-devel

As reported in #4474 [0], a user may attempt to shutdown a VM/CT,
realize that it is unresponsive, and decide to stop it instead. If the
shutdown task has not timed out yet, the stop task will fail. The user
needs to manually abort the shutdown task before stopping the VM,
which is inconvenient.

With this patch series, a stop task can optionally overrule active
shutdown tasks.

Summary of changes:

* Backend: We add a new optional `overrule-shutdown` parameter to
  VM/CT `/stop` endpoints. If it is 1, we query for active
  `qmshutdown`/`vzshutdown` tasks by the current user for the given
  VMID, and abort them before attempting to stop the VM/CT.
* Frontend: Before sending a stop command, we check whether there are
  active shutdown tasks. If yes, we ask the user whether they should
  be aborted, and send `overrule-shutdown=1` accordingly.

Tested with a hung CentOS 7 container and a Debian VM where I edited
/etc/systemd/logind.conf to set `HandlePowerKey=ignore`.

Sending this as RFC, to make a first proposal and iterate from there.
My most important questions:

* Does it make sense to have overruling optional? Or should "stop"
  generally overrule shutdown? This might lead to confusing
  interactions, as Thomas noted [0].
* Backend: Is there a more elegant way to overrule shutdown tasks,
  and a better place than pve-guest-common?
* Frontend: When stopping a VM/CT, we already ask for confirmation.
  Is an (occasional) second modal dialog with a lot of text a good user
  experience? Alternatively, I could imagine a checkbox in the first
  dialog saying "Overrule any active shutdown tasks".
* This patch series forbids `overrule-shutdown=1` for HA-managed VMs/CTs
  because I didn't know how overruling should work in a HA setting. Do
  you have any suggestions?

Since this is my first patch with more than a few lines, I'm especially
happy about feedback regarding coding style, naming, anything. :)

[0]: https://bugzilla.proxmox.com/show_bug.cgi?id=4474

pve-manager:

Friedrich Weber (1):
  fix #4474: ui: vm stop: ask if active shutdown tasks should be aborted

 www/manager6/Utils.js        | 27 +++++++++++++++++++++++++++
 www/manager6/dc/Tasks.js     |  2 +-
 www/manager6/lxc/CmdMenu.js  | 14 +++++++++++++-
 www/manager6/lxc/Config.js   |  6 +++++-
 www/manager6/qemu/CmdMenu.js | 14 +++++++++++++-
 www/manager6/qemu/Config.js  |  9 ++++++++-
 6 files changed, 67 insertions(+), 5 deletions(-)

pve-container:

Friedrich Weber (1):
  fix #4474: lxc api: add overrule-shutdown parameter to stop endpoint

 src/PVE/API2/LXC/Status.pm | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

qemu-server:

Friedrich Weber (1):
  fix #4474: qemu api: add overrule-shutdown parameter to stop endpoint

 PVE/API2/Qemu.pm | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

pve-guest-common:

Friedrich Weber (1):
  guest helpers: add helper to overrule active tasks of a specific type

 src/PVE/GuestHelpers.pm | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)


-- 
2.30.2





^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2024-01-02 13:34 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-26  8:32 [pve-devel] [RFC manager/container/qemu-server/guest-common 0/4] fix #4474: stop tasks may overrule shutdown tasks Friedrich Weber
2023-01-26  8:32 ` [pve-devel] [RFC manager 1/4] fix #4474: ui: vm stop: ask if active shutdown tasks should be aborted Friedrich Weber
2023-01-26  8:32 ` [pve-devel] [RFC container 2/4] fix #4474: lxc api: add overrule-shutdown parameter to stop endpoint Friedrich Weber
2023-11-17 13:09   ` Wolfgang Bumiller
2023-12-01  9:57     ` Friedrich Weber
2024-01-02 13:34       ` Friedrich Weber
2023-01-26  8:32 ` [pve-devel] [RFC qemu-server 3/4] fix #4474: qemu " Friedrich Weber
2023-11-17 13:12   ` Wolfgang Bumiller
2023-01-26  8:32 ` [pve-devel] [RFC guest-common 4/4] guest helpers: add helper to overrule active tasks of a specific type Friedrich Weber
2023-11-17 12:53   ` Wolfgang Bumiller
2023-12-01  9:57     ` Friedrich Weber
2023-09-27  9:04 ` [pve-devel] [RFC manager/container/qemu-server/guest-common 0/4] fix #4474: stop tasks may overrule shutdown tasks Friedrich Weber
2023-11-17 12:31   ` Wolfgang Bumiller
2023-12-01  9:57     ` Friedrich Weber

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal