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 CC62A1FF0AF for ; Fri, 20 Nov 2026 14:35:47 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id BD5F92174E; Fri, 20 Nov 2026 14:35:46 +0100 (CET) Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Fri, 20 Nov 2026 14:35:40 +0100 Message-Id: Subject: Re: [PATCH pve-manager v2 12/19] fix #7993: ui: form: crs options: add weights From: "Daniel Kral" To: "Dominik Rusovac" , X-Mailer: aerc 0.22.0-45-gc30c872fde7b-dirty References: <20261112094437.1951271-1-d.rusovac@proxmox.com> <20261112094437.1951271-13-d.rusovac@proxmox.com> In-Reply-To: <20261112094437.1951271-13-d.rusovac@proxmox.com> X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1795181740987 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.378 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: MFBEWJZHN5WUGMXIAH5DAJFED36UVU6B X-Message-ID-Hash: MFBEWJZHN5WUGMXIAH5DAJFED36UVU6B 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 Nov 12, 2026 at 10:44 AM CET, Dominik Rusovac wrote: > 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/CRSOptio= ns.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) =3D> > get('crsMode') =3D=3D=3D 'static' || get('crsMode') =3D= =3D=3D 'dynamic', > autoRebalancingDisabled: (get) =3D> > !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) =3D> > + Proxmox.Utils.defaultText + (Ext.isNumber(get('memWeight= ')) ? ' (1)' : ''), > + memWeightEmptyText: (get) =3D> > + Proxmox.Utils.defaultText + (Ext.isNumber(get('cpuWeight= ')) ? ' (1)' : ''), > }, > }, > =20 > @@ -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, AFAIK xtype: 'proxmoxintegerfield' should work here too, which sets both `allowDecimals` and `allowExponentials` to false. > + bind: { > + value: '{cpuWeight}', > + emptyText: '{cpuWeightEmptyText}', > + disabled: '{!canUseAutoRebalancing}', bind the last to `hidden` > + }, > + }, > + { > + xtype: 'numberfield', > + name: 'ha-mem-weight', > + fieldLabel: gettext('Memory Weight'), > + minValue: 0, > + step: 1, > + allowDecimals: false, AFAIK xtype: 'proxmoxintegerfield' should work here too, which sets both `allowDecimals` and `allowExponentials` to false. > + bind: { > + value: '{memWeight}', > + emptyText: '{memWeightEmptyText}', > + disabled: '{!canUseAutoRebalancing}', bind the last to `hidden` > + }, > + }, > + { > + xtype: 'displayfield', > + userCls: 'pmx-hint', > + value: gettext( > + 'Weights prioritize balancing the CPU load or th= e memory usage of nodes. Only their ratio matters.', > + ), > + bind: { > + hidden: '{!canUseAutoRebalancing}', > + }, > + }, Hm, this is a pretty 'bold' hint, which is only relevant for the last field but is still shown to everybody, even if they don't use it... Maybe only show it if either memWeight/cpuWeight is set? Another way would probably be to put the CPU and MEM weight fields side to side and put `:` inbetween to make it clearer that it's a ratio without too much explanation, but not important and might not be that intuitive for users anyway. > ], > }, > ],