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 F26AF1FF0DF for ; Thu, 19 Nov 2026 11:00:34 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 8769E217D0; Thu, 19 Nov 2026 10:59:43 +0100 (CET) From: Dominik Rusovac To: pve-devel@lists.proxmox.com Subject: [PATCH pve-ha-manager v5 08/10] api: status: report maintenance mode request for lrm entries Date: Thu, 19 Nov 2026 10:59:29 +0100 Message-ID: <20261119095931.1748970-9-d.rusovac@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261119095931.1748970-1-d.rusovac@proxmox.com> References: <20261119095931.1748970-1-d.rusovac@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1795082375670 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.028 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: MXLQCK5V2SO2UAMZVWQDF2OBGIRAGKD3 X-Message-ID-Hash: MXLQCK5V2SO2UAMZVWQDF2OBGIRAGKD3 X-MailFrom: d.rusovac@proxmox.com 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: Thomas Skinner X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: expose whether maintenance mode was manually requested for a node, as recorded by the CRM Originally-by: Thomas Skinner Signed-off-by: Dominik Rusovac Reviewed-by: Daniel Kral --- Notes: changes since v4: * reword commit subject src/PVE/API2/HA/Status.pm | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/PVE/API2/HA/Status.pm b/src/PVE/API2/HA/Status.pm index aecef0f..2622ec1 100644 --- a/src/PVE/API2/HA/Status.pm +++ b/src/PVE/API2/HA/Status.pm @@ -107,6 +107,12 @@ __PACKAGE__->register_method({ type => "integer", optional => 1, }, + 'maintenance-requested' => { + description => "For type 'lrm'. Whether maintenance mode was manually" + . " requested for the node.", + type => "boolean", + optional => 1, + }, crm_state => { description => "For type 'service'. Service state as seen by the CRM.", type => "string", @@ -265,6 +271,8 @@ __PACKAGE__->register_method({ PVE::HA::Tools::count_active_services($status->{service_status}, $node); my $lrm_status = PVE::HA::Config::read_lrm_status($node); my $id = "lrm:$node"; + my $node_request = $status->{node_request} // {}; + my $maintenance_requested = $node_request->{$node}->{maintenance} ? 1 : 0; if (!$lrm_status->{timestamp}) { push @$res, { @@ -272,6 +280,7 @@ __PACKAGE__->register_method({ type => 'lrm', node => $node, status => "$node (unable to read lrm status)", + 'maintenance-requested' => $maintenance_requested, }; } else { my $status_str = &$timestamp_to_status($ctime, $lrm_status->{timestamp}); @@ -315,6 +324,7 @@ __PACKAGE__->register_method({ node => $node, status => $status_text, timestamp => $lrm_status->{timestamp}, + 'maintenance-requested' => $maintenance_requested, }; } } -- 2.47.3