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 EB90B1FF0AF for ; Fri, 20 Nov 2026 14:49:14 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 7CB5C2176F; Fri, 20 Nov 2026 14:49:13 +0100 (CET) Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Fri, 20 Nov 2026 14:49:08 +0100 Message-Id: Subject: Re: [PATCH pve-manager v2 12/19] fix #7993: ui: form: crs options: add weights From: "Dominik Rusovac" To: "Daniel Kral" , X-Mailer: aerc 0.20.0 References: <20261112094437.1951271-1-d.rusovac@proxmox.com> <20261112094437.1951271-13-d.rusovac@proxmox.com> In-Reply-To: X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1795182548745 X-SPAM-LEVEL: Spam detection results: 0 AWL -0.027 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: 5IZ4ZKKDHNVY26TSCRQNX36VZ3T6YSVM X-Message-ID-Hash: 5IZ4ZKKDHNVY26TSCRQNX36VZ3T6YSVM 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: On Fri Nov 20, 2026 at 2:35 PM CET, Daniel Kral wrote: > On Thu Nov 12, 2026 at 10:44 AM CET, Dominik Rusovac wrote: [snip] >> diff --git a/www/manager6/form/CRSOptions.js b/www/manager6/form/CRSOpti= ons.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 rebalancin= g, so only show a default >> + // value once the other weight is set >> + cpuWeightEmptyText: (get) =3D> >> + Proxmox.Utils.defaultText + (Ext.isNumber(get('memWeigh= t')) ? ' (1)' : ''), >> + memWeightEmptyText: (get) =3D> >> + Proxmox.Utils.defaultText + (Ext.isNumber(get('cpuWeigh= t')) ? ' (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. > right, will use that in v3, thx >> + bind: { >> + value: '{cpuWeight}', >> + emptyText: '{cpuWeightEmptyText}', >> + disabled: '{!canUseAutoRebalancing}', > > bind the last to `hidden` > ack >> + }, >> + }, >> + { >> + 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. > ack >> + bind: { >> + value: '{memWeight}', >> + emptyText: '{memWeightEmptyText}', >> + disabled: '{!canUseAutoRebalancing}', > > bind the last to `hidden` > ack >> + }, >> + }, >> + { >> + xtype: 'displayfield', >> + userCls: 'pmx-hint', >> + value: gettext( >> + 'Weights prioritize balancing the CPU load or t= he 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. > ack, will only show it once either weight is set in v3, thx! [snip]