all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Jakob-Tobias Winter <tobias@stuttgart.de>
To: pve-devel@lists.proxmox.com
Cc: Jakob-Tobias Winter <tobias@stuttgart.de>
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	[thread overview]
Message-ID: <20261128151118.892037-2-tobias@stuttgart.de> (raw)
In-Reply-To: <20261128151118.892037-1-tobias@stuttgart.de>

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 <tobias@stuttgart.de>
---
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




  reply	other threads:[~2026-11-28 15:22 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-28 15:11 [RFC PATCH cluster/ha-manager/qemu-server/manager/docs 00/11] fix #6314: ha: keep guests stopped that got powered off from within Jakob-Tobias Winter
2026-11-28 15:11 ` Jakob-Tobias Winter [this message]
2026-11-28 15:11 ` [RFC PATCH ha-manager 02/11] fix #6314: config: request stopped state for powered off guests Jakob-Tobias Winter
2026-11-28 15:11 ` [RFC PATCH ha-manager 03/11] lrm: do not start a service again that is about to be stopped Jakob-Tobias Winter
2026-11-28 15:11 ` [RFC PATCH ha-manager 04/11] sim: hardware: add poweroff command for services Jakob-Tobias Winter
2026-11-28 15:11 ` [RFC PATCH ha-manager 05/11] test: add test cases for stop-on-poweroff Jakob-Tobias Winter
2026-11-28 15:11 ` [RFC PATCH ha-manager 06/11] resources: add stop-on-poweroff property for virtual machines Jakob-Tobias Winter
2026-11-28 15:11 ` [RFC PATCH qemu-server 07/11] fix #6314: qm cleanup: report a guest poweroff to the HA stack Jakob-Tobias Winter
2026-11-28 15:11 ` [RFC PATCH manager 08/11] ui: dc options: add stop-on-poweroff to the HA settings Jakob-Tobias Winter
2026-11-28 15:11 ` [RFC PATCH manager 09/11] ui: ha: add stop-on-poweroff selector to the resource edit window Jakob-Tobias Winter
2026-11-28 15:11 ` [RFC PATCH docs 10/11] ha-manager: document the stop-on-poweroff setting Jakob-Tobias Winter
2026-11-28 15:11 ` [RFC PATCH docs 11/11] ha-manager: document the stop-on-poweroff property of resources Jakob-Tobias Winter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261128151118.892037-2-tobias@stuttgart.de \
    --to=tobias@stuttgart.de \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal