From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id 2B97D1FF13A for ; Wed, 15 Apr 2026 11:17:19 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 484FEA9B2; Wed, 15 Apr 2026 11:16:49 +0200 (CEST) From: Daniel Kral To: pve-devel@lists.proxmox.com Subject: [PATCH manager v2 05/19] ui: form/CRSOptions: allow auto rebalancing only for static and dynamic mode Date: Wed, 15 Apr 2026 11:15:32 +0200 Message-ID: <20260415091635.162224-6-d.kral@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260415091635.162224-1-d.kral@proxmox.com> References: <20260415091635.162224-1-d.kral@proxmox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1776244521816 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.081 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: 7D5BAYKHQIG7IG4IRXXC56TPSHYBXIA2 X-Message-ID-Hash: 7D5BAYKHQIG7IG4IRXXC56TPSHYBXIA2 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: The HA auto rebalancing system can only be used with the static and dynamic load usage information, so constrain the web interface accordingly. Signed-off-by: Daniel Kral Reviewed-by: Michael Köppl Tested-by: Michael Köppl --- changes v1 -> v2: - none I stuck with not removing the contents from the disabled fields as we're not really consistent whether we do this, but most of the time let it stay in the fields. Also user would be rather frustrated if their previously set values would be removed if they changed the scheduling mode from 'static'/'dynamic' to 'basic'. Another idea is to always preserve these values, even though this doesn't clue in the users what configuration is valid in the end. But let's see what users think. www/manager6/form/CRSOptions.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/www/manager6/form/CRSOptions.js b/www/manager6/form/CRSOptions.js index 3f3b4fea..3b539fda 100644 --- a/www/manager6/form/CRSOptions.js +++ b/www/manager6/form/CRSOptions.js @@ -19,10 +19,14 @@ Ext.define('PVE.form.CRSOptions', { viewModel: { data: { + crsMode: '__default__', autoRebalancing: 0, }, formulas: { - autoRebalancingDisabled: (get) => !get('autoRebalancing'), + canUseAutoRebalancing: (get) => + get('crsMode') === 'static' || get('crsMode') === 'dynamic', + autoRebalancingDisabled: (get) => + !get('autoRebalancing') || !get('canUseAutoRebalancing'), }, }, @@ -42,14 +46,15 @@ Ext.define('PVE.form.CRSOptions', { name: 'ha', fieldLabel: gettext('Scheduling Mode'), deleteEmpty: false, - value: '__default__', comboItems: [ ['__default__', Proxmox.Utils.defaultText + ' (basic)'], ['basic', gettext('Basic (Resource Count)')], ['static', gettext('Static Load')], ['dynamic', gettext('Dynamic Load')], ], - defaultValue: '__default__', + bind: { + value: '{crsMode}', + }, }, { xtype: 'proxmoxcheckbox', @@ -67,6 +72,7 @@ Ext.define('PVE.form.CRSOptions', { boxLabel: gettext('Automatically rebalance HA resources'), bind: { value: '{autoRebalancing}', + disabled: '{!canUseAutoRebalancing}', }, }, { -- 2.47.3