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 7D15C1FF141 for ; Mon, 30 Mar 2026 16:41:54 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 5EFC136211; Mon, 30 Mar 2026 16:41:36 +0200 (CEST) From: Daniel Kral To: pve-devel@lists.proxmox.com Subject: [PATCH cluster v3 19/40] datacenter config: add auto rebalancing options Date: Mon, 30 Mar 2026 16:30:28 +0200 Message-ID: <20260330144101.668747-20-d.kral@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260330144101.668747-1-d.kral@proxmox.com> References: <20260330144101.668747-1-d.kral@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1774881614107 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.064 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: HN55KOELNOQ3ISC73UJ5JW7E7QVSRP7C X-Message-ID-Hash: HN55KOELNOQ3ISC73UJ5JW7E7QVSRP7C 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: Signed-off-by: Daniel Kral --- changes v2 -> v3: - clarify unit for ha-auto-rebalance-hold-duration as suggested by @Jillian Morgan and @Dominik - "The threshold for cluster node imbalance" instead of "The threshold for node load", where the latter is not really representative - further improve wording a bit, so another read would be very appreciated! src/PVE/DataCenterConfig.pm | 41 +++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/src/PVE/DataCenterConfig.pm b/src/PVE/DataCenterConfig.pm index 0225bc6..41f56ef 100644 --- a/src/PVE/DataCenterConfig.pm +++ b/src/PVE/DataCenterConfig.pm @@ -33,6 +33,47 @@ EODESC "Set to use CRS for selecting a suited node when a HA services request-state" . " changes from stop to start.", }, + 'ha-auto-rebalance' => { + type => 'boolean', + optional => 1, + default => 0, + description => "Whether to use CRS for balancing HA resources automatically" + . " depending on the current node imbalance.", + }, + 'ha-auto-rebalance-threshold' => { + type => 'number', + optional => 1, + default => 0.7, + requires => 'ha-auto-rebalance', + description => "The threshold for the cluster node imbalance, which will" + . " trigger the automatic resource balancing system if its value" + . " is exceeded.", + }, + 'ha-auto-rebalance-method' => { + type => 'string', + enum => ['bruteforce', 'topsis'], + optional => 1, + default => 'bruteforce', + requires => 'ha-auto-rebalance', + description => "The method to use for the scoring of balancing migrations.", + }, + 'ha-auto-rebalance-hold-duration' => { + type => 'number', + optional => 1, + default => 3, + requires => 'ha-auto-rebalance', + description => "The number of HA rounds for which the cluster node" + . " imbalance threshold must be exceeded before triggering an" + . " automatic resource balancing migration.", + }, + 'ha-auto-rebalance-margin' => { + type => 'number', + optional => 1, + default => 0.1, + requires => 'ha-auto-rebalance', + description => "The minimum relative improvement in cluster node" + . " imbalance to commit to a resource balancing migration.", + }, }; my $migration_format = { -- 2.47.3