From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [45.144.208.40]) by lore.proxmox.com (Postfix) with ESMTPS id 1AC841FF0A8 for ; Sat, 28 Nov 2026 16:22:05 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 08C4121810; Sat, 28 Nov 2026 16:21:12 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=stuttgart.de; s=s1022; t=1795878688; bh=ANSLs4KG4NHec6YCMhIfGNrRIN5dSA+tbBJIy51fS34=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ziElPOQXMya6zw/vVRgsAH96DAPEKepoH9wffgMiK5PTcwh+0JVA2kmj5w5bGfBU+ A7gMrrygK7R52ZRAHOPLXKdhYy6qMXIGRuxJtfbX56Dk5r3Rk0sZDQpe8wCCGzd96U 0vQUsdLJ4S7VYRhaM8tWT7ROGmNKJIpF6tpc2iHnK9CVIvGuz+Lktfq8yWkQ48Ye7x QlwWX9p6GJU0+QxCRaD9/1DPTP3VzjMSNcA8L6YRHuQbIC7T70cxDjNeCr3w+O5Eie YEHWWUPBgam3Lg+d0cClB4fK38qz9TTz22AZd37x0LBOtNlkxCeShsKCHhQoxXTk4A YiXZzFvb0LCug== From: Jakob-Tobias Winter To: pve-devel@lists.proxmox.com Subject: [RFC PATCH cluster 01/11] datacenter config: add stop-on-poweroff to the HA settings Date: Sat, 28 Nov 2026 16:11:08 +0100 Message-ID: <20261128151118.892037-2-tobias@stuttgart.de> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20261128151118.892037-1-tobias@stuttgart.de> References: <20261128151118.892037-1-tobias@stuttgart.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.027 Adjusted score from AWL reputation of From: address DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain DMARC_PASS -0.1 DMARC pass policy RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_PASS -0.001 SPF: HELO matches SPF record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: EDTRI4R46DQKGKKWDPWFDWZJUWT46WOO X-Message-ID-Hash: EDTRI4R46DQKGKKWDPWFDWZJUWT46WOO X-MailFrom: prvs=7495f99b94=tobias@stuttgart.de X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Jakob-Tobias Winter X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: An HA managed virtual machine that gets powered off from within the guest is started again by the HA stack, as its requested state still is 'started'. This is not what users expect from a guest they have shut down on purpose. Add an option to the cluster wide HA settings, with which the HA stack sets the requested state of such a guest to 'stopped' instead. It is off by default. Make the shutdown policy optional in the property string, so that the new option can be set without also selecting a policy. Signed-off-by: Jakob-Tobias Winter --- A node with a libpve-cluster-perl that does not know the new key drops the whole "ha" property string when it parses datacenter.cfg, the shutdown policy included. That is how every new key in a property string of this file behaves; the documentation patch says to enable the setting only after all nodes got upgraded. src/PVE/DataCenterConfig.pm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/PVE/DataCenterConfig.pm b/src/PVE/DataCenterConfig.pm index cb78fd2..741b977 100644 --- a/src/PVE/DataCenterConfig.pm +++ b/src/PVE/DataCenterConfig.pm @@ -197,7 +197,14 @@ register_standard_option( ); my $ha_format = { - shutdown_policy => get_standard_option('pve-ha-shutdown-policy'), + shutdown_policy => get_standard_option('pve-ha-shutdown-policy', { optional => 1 }), + 'stop-on-poweroff' => { + type => 'boolean', + optional => 1, + default => 0, + description => "Set the requested state of HA managed virtual machines to 'stopped' if" + . " they get powered off from within the guest, instead of starting them again.", + }, }; my $next_id_format = { base-commit: 2a8bc69a99a399771d746d7a76e42ab3ff75cc0e -- 2.53.0