From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <f.weber@proxmox.com>
Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256)
 (No client certificate requested)
 by lists.proxmox.com (Postfix) with ESMTPS id 4AFA090EA6
 for <pve-devel@lists.proxmox.com>; Wed,  3 Apr 2024 08:56:28 +0200 (CEST)
Received: from firstgate.proxmox.com (localhost [127.0.0.1])
 by firstgate.proxmox.com (Proxmox) with ESMTP id 2B8B4129D3
 for <pve-devel@lists.proxmox.com>; Wed,  3 Apr 2024 08:55:58 +0200 (CEST)
Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com
 [94.136.29.106])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256)
 (No client certificate requested)
 by firstgate.proxmox.com (Proxmox) with ESMTPS
 for <pve-devel@lists.proxmox.com>; Wed,  3 Apr 2024 08:55:56 +0200 (CEST)
Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1])
 by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 5D5D744C57
 for <pve-devel@lists.proxmox.com>; Wed,  3 Apr 2024 08:55:56 +0200 (CEST)
Message-ID: <c4c1a37f-1093-47cd-b0a0-d6e0b387fb4b@proxmox.com>
Date: Wed, 3 Apr 2024 08:55:55 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
From: Friedrich Weber <f.weber@proxmox.com>
To: pve-devel@lists.proxmox.com
Reply-To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>
References: <20240130171057.438025-1-f.weber@proxmox.com>
Content-Language: en-US
In-Reply-To: <20240130171057.438025-1-f.weber@proxmox.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-SPAM-LEVEL: Spam detection results:  0
 AWL -0.077 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DMARC_MISSING             0.1 Missing DMARC policy
 KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment
 SPF_HELO_NONE           0.001 SPF: HELO does not publish an SPF Record
 SPF_PASS               -0.001 SPF: sender matches SPF record
 URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See
 http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more
 information. [proxmox.com, qemu.pm, status.pm, guesthelpers.pm]
Subject: Re: [pve-devel] [PATCH guest-common/container/qemu-server/manager
 v2 0/6] fix #4474: stop tasks may overrule shutdown tasks
X-BeenThere: pve-devel@lists.proxmox.com
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Proxmox VE development discussion <pve-devel.lists.proxmox.com>
List-Unsubscribe: <https://lists.proxmox.com/cgi-bin/mailman/options/pve-devel>, 
 <mailto:pve-devel-request@lists.proxmox.com?subject=unsubscribe>
List-Archive: <http://lists.proxmox.com/pipermail/pve-devel/>
List-Post: <mailto:pve-devel@lists.proxmox.com>
List-Help: <mailto:pve-devel-request@lists.proxmox.com?subject=help>
List-Subscribe: <https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel>, 
 <mailto:pve-devel-request@lists.proxmox.com?subject=subscribe>
X-List-Received-Date: Wed, 03 Apr 2024 06:56:28 -0000

ping -- still applies.

On 30/01/2024 18:10, Friedrich Weber wrote:
> 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:
> ** In the LXC status API handlers, we move config locking from the API
>    handlers into workers to avoid blocking, as suggested by Wolfgang on v1.
> ** 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: Issuing a stop command shows a confirmation message box that, if an
>   active shutdown task for that guest is detected, shows a default-on checkbox
>   that offers to overrule active shutdown tasks. If it is checked, the API
>   request is sent with `overrule-shutdown=1`.
> 
> Tested with a hung CentOS 7 container and a SeaBIOS VM without a bootable disk.
> 
> Changes v1 -> v2:
> * fixed patch ordering, as suggested by Wolfgang on v1
> * added a pve-container patch that moves config locking from API handlers
>   into workers for start/stop/shutdown/suspend, as suggested by Wolfgang on v1
> * instead of showing a second modal dialog when stopping a guest, show a "guest
>   stop" message box that has an optional checkbox offering to overrule shutdown
>   tasks
> * split pve-manager patch in two
> 
> [0]: https://bugzilla.proxmox.com/show_bug.cgi?id=4474
> 
> 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(+)
> 
> 
> container:
> 
> Friedrich Weber (2):
>   api: status: move config locking from API handler into worker
>   fix #4474: lxc api: add overrule-shutdown parameter to stop endpoint
> 
>  src/PVE/API2/LXC/Status.pm | 107 ++++++++++++++++++++-----------------
>  1 file changed, 59 insertions(+), 48 deletions(-)
> 
> 
> 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(-)
> 
> 
> manager:
> 
> Friedrich Weber (2):
>   ui: fix typo to make pve-cluster-tasks store globally available
>   fix #4474: ui: guest stop: offer to overrule active shutdown tasks
> 
>  www/manager6/Makefile            |  1 +
>  www/manager6/dc/Tasks.js         |  2 +-
>  www/manager6/lxc/CmdMenu.js      |  8 +++-
>  www/manager6/lxc/Config.js       |  8 ++--
>  www/manager6/qemu/CmdMenu.js     |  8 +++-
>  www/manager6/qemu/Config.js      |  8 ++--
>  www/manager6/window/GuestStop.js | 75 ++++++++++++++++++++++++++++++++
>  7 files changed, 101 insertions(+), 9 deletions(-)
>  create mode 100644 www/manager6/window/GuestStop.js
> 
> 
> Summary over all repositories:
>   10 files changed, 193 insertions(+), 0 deletions(-)
>