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 207D61FF0B6 for ; Thu, 12 Nov 2026 10:45:54 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 2C2962178D; Thu, 12 Nov 2026 10:44:53 +0100 (CET) From: Dominik Rusovac To: pve-devel@lists.proxmox.com Subject: [PATCH pve-manager v2 12/19] fix #7993: ui: form: crs options: add weights Date: Thu, 12 Nov 2026 10:44:30 +0100 Message-ID: <20261112094437.1951271-13-d.rusovac@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261112094437.1951271-1-d.rusovac@proxmox.com> References: <20261112094437.1951271-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: 1794476686087 X-SPAM-LEVEL: Spam detection results: 0 AWL -0.012 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) PROLO_LEO1 0.1 Meta Catches all Leo drug variations so far 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: QGXLC2AXYL4NJZDRVOMTZ5Z3WOHN6FOF X-Message-ID-Hash: QGXLC2AXYL4NJZDRVOMTZ5Z3WOHN6FOF 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: add the ha-cpu-weight and ha-mem-weight options as advanced options. they are enabled for the static and dynamic scheduling modes, also without automatic rebalancing, as they are used for selecting a node to start or recover a resource on as well if neither weight is set, the previous behavior is kept, where the TOPSIS method and selecting a node favor memory usage over CPU load, while the bruteforce method weighs both equally. as there is no single default then, only show the default value of a weight once the other one is set Signed-off-by: Dominik Rusovac --- Notes: changes since v1: * use the new option names * enable weights for the static and dynamic modes, independent of automatic rebalancing * add weights as advanced options directly * show the default of a weight only if the other one is set, as the effective weights depend on the method if neither is set * add a hint that only the ratio of the weights matters www/manager6/form/CRSOptions.js | 45 +++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/www/manager6/form/CRSOptions.js b/www/manager6/form/CRSOptions.js index 05c5e222..4713bbb3 100644 --- a/www/manager6/form/CRSOptions.js +++ b/www/manager6/form/CRSOptions.js @@ -21,12 +21,21 @@ Ext.define('PVE.form.CRSOptions', { data: { crsMode: '__default__', autoRebalancing: 0, + cpuWeight: null, + memWeight: null, }, formulas: { canUseAutoRebalancing: (get) => get('crsMode') === 'static' || get('crsMode') === 'dynamic', autoRebalancingDisabled: (get) => !get('autoRebalancing') || !get('canUseAutoRebalancing'), + // with neither weight set, the effective weights depend on the rebalancing method and + // differ between selecting a node and automatic rebalancing, so only show a default + // value once the other weight is set + cpuWeightEmptyText: (get) => + Proxmox.Utils.defaultText + (Ext.isNumber(get('memWeight')) ? ' (1)' : ''), + memWeightEmptyText: (get) => + Proxmox.Utils.defaultText + (Ext.isNumber(get('cpuWeight')) ? ' (1)' : ''), }, }, @@ -128,6 +137,42 @@ Ext.define('PVE.form.CRSOptions', { disabled: '{autoRebalancingDisabled}', }, }, + { + xtype: 'numberfield', + name: 'ha-cpu-weight', + fieldLabel: gettext('CPU Weight'), + minValue: 0, + step: 1, + allowDecimals: false, + bind: { + value: '{cpuWeight}', + emptyText: '{cpuWeightEmptyText}', + disabled: '{!canUseAutoRebalancing}', + }, + }, + { + xtype: 'numberfield', + name: 'ha-mem-weight', + fieldLabel: gettext('Memory Weight'), + minValue: 0, + step: 1, + allowDecimals: false, + bind: { + value: '{memWeight}', + emptyText: '{memWeightEmptyText}', + disabled: '{!canUseAutoRebalancing}', + }, + }, + { + xtype: 'displayfield', + userCls: 'pmx-hint', + value: gettext( + 'Weights prioritize balancing the CPU load or the memory usage of nodes. Only their ratio matters.', + ), + bind: { + hidden: '{!canUseAutoRebalancing}', + }, + }, ], }, ], -- 2.47.3