From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id 6B2321FF146 for ; Tue, 12 May 2026 11:34:25 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 4D0C6BE93; Tue, 12 May 2026 11:34:23 +0200 (CEST) Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Tue, 12 May 2026 11:34:15 +0200 Message-Id: To: "Dominik Rusovac" , Subject: Re: [PATCH pve-ha-manager v3 5/6] api: status: add load imbalance to status From: "Daniel Kral" X-Mailer: aerc 0.21.0-136-gdb9fe9896a79-dirty References: <20260430114845.151174-1-d.rusovac@proxmox.com> <20260430114845.151174-6-d.rusovac@proxmox.com> In-Reply-To: <20260430114845.151174-6-d.rusovac@proxmox.com> X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1778578343938 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.076 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 Message-ID-Hash: VWAUP3SS4I4ROU3XDXRTKNIPZAH4SYYE X-Message-ID-Hash: VWAUP3SS4I4ROU3XDXRTKNIPZAH4SYYE X-MailFrom: d.kral@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 X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On Thu Apr 30, 2026 at 1:48 PM CEST, Dominik Rusovac wrote: > This is a very basic measure to enable users to detect the prevailing > load imbalance in the UI, which atm reveals nothing about the latter. > > Load imbalance should appear in status if CRS mode is not basic and > auto-rebalance is enabled. > > imo, enabling users to track how the load imbalance changed over time > (using RRD graphs, for example) should be considered, in the long run. > > Signed-off-by: Dominik Rusovac > --- > > Notes: > changes since v2: > * correct extra_status handling > * check definedness of imbalance > > src/PVE/API2/HA/Status.pm | 11 +++++++++-- > 1 file changed, 9 insertions(+), 2 deletions(-) > > diff --git a/src/PVE/API2/HA/Status.pm b/src/PVE/API2/HA/Status.pm > index 4894f3b..feb1419 100644 > --- a/src/PVE/API2/HA/Status.pm > +++ b/src/PVE/API2/HA/Status.pm > @@ -199,8 +199,15 @@ __PACKAGE__->register_method({ > } > my $datacenter_config =3D eval { cfs_read_file('datacenter.c= fg') } // {}; > if (my $crs =3D $datacenter_config->{crs}) { > - $extra_status .=3D " - $crs->{ha} load CRS" > - if $crs->{ha} && $crs->{ha} ne 'basic'; > + my $mode =3D $crs->{ha}; > + > + if ($mode && $mode ne 'basic') { > + $extra_status .=3D " - $mode load CRS "; nit: the whitespace at the end should be added with the statement below instead of this one, else it becomes a trailing white-space if the auto-rebalance isn't enabled. Can be fixed on apply though. > + > + my $imbalance =3D $status->{imbalance}; > + $extra_status .=3D sprintf("(load imbalance: %.2f", = 100 * $imbalance) . "%)" > + if $crs->{'ha-auto-rebalance'} && defined($imbal= ance); > + } > } > my $time_str =3D localtime($status->{timestamp}); > my $status_text =3D "$master ($status_str, $time_str)$extra_= status";