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 803E41FF0B7 for ; Fri, 13 Nov 2026 16:26:49 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id C941821733; Fri, 13 Nov 2026 16:26:31 +0100 (CET) From: Dominik Rusovac To: pve-devel@lists.proxmox.com Subject: [PATCH pve-ha-manager v4 3/4] api: status: report node maintenance request for lrm entries Date: Fri, 13 Nov 2026 16:26:19 +0100 Message-ID: <20261113152620.2662417-4-d.rusovac@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261113152620.2662417-1-d.rusovac@proxmox.com> References: <20261113152620.2662417-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: 1794583586031 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: N3GBEHF6GKGLQZJUHKBVZ6PA2S2VU7P5 X-Message-ID-Hash: N3GBEHF6GKGLQZJUHKBVZ6PA2S2VU7P5 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 --- Notes: changes since v3: * reword commit subject and body * replace the lrm_mode field with maintenance-requested, which reflects the manual maintenance request recorded by the CRM instead of the mode the LRM reports, as the LRM might also go to maintenance with the 'migrate' shutdown policy without a manual request * drop 'unknown' values 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