From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id AEE6F1FF13C for ; Thu, 02 Apr 2026 15:14:52 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id CBAB919A0D; Thu, 2 Apr 2026 15:15:21 +0200 (CEST) Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Thu, 02 Apr 2026 15:14:47 +0200 Message-Id: Subject: Re: [PATCH ha-manager v4 19/28] implement automatic rebalancing From: "Dominik Rusovac" To: "Daniel Kral" , X-Mailer: aerc 0.20.0 References: <20260402124817.416232-1-d.kral@proxmox.com> <20260402124817.416232-20-d.kral@proxmox.com> In-Reply-To: <20260402124817.416232-20-d.kral@proxmox.com> X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1775135629122 X-SPAM-LEVEL: Spam detection results: 0 AWL -1.008 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 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 1 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_RPBL_BLOCKED 1 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_SAFE_BLOCKED 1 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. 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: YFCRMUS3SPXNUHHWJCQB7LJLZQ3CHJIV X-Message-ID-Hash: YFCRMUS3SPXNUHHWJCQB7LJLZQ3CHJIV 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 X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: lgtm, consider this On Thu Apr 2, 2026 at 2:44 PM CEST, Daniel Kral wrote: > If the automatic load balancing system is enabled, it checks whether the > cluster node imbalance exceeds some user-defined threshold for some HA > Manager rounds ("hold duration"). If it does exceed on consecutive HA > Manager rounds, it will choose the best resource motion to improve the > cluster node imbalance and queue it if it significantly improves it by > some user-defined imbalance improvement ("margin"). > > This patch introduces resource bundles, which ensure that HA resources > in strict positive resource affinity rules are considered as a whole > "bundle" instead of individual HA resources. > > Specifically, active and stationary resource bundles are resource > bundles, that have at least one resource running and all resources > located on the same node. This distinction is needed as newly created > strict positive resource affinity rules may still require some resource > motions to enforce the rule. > > Additionally, the migration candidate generation prunes any target > nodes, which do not adhere to the HA rules of these resource bundles > before scoring these migration candidates. > > Signed-off-by: Daniel Kral > --- > changes v3 -> v4: > - change imbalance threshold default value from 0.7 to 0.3 > - use sprintf() for float number printing instead of perly rounding > logic > - print before and expected after values > - implement PVE::HA::Usage::Basic rebalancing methods as well with > sensible return values, but which are only used to not throw errors if > a failback from 'dynamic'/'static' to 'basic' happens in > recompute_online_node_usage() > [snip] Reviewed-by: Dominik Rusovac