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 918851FF13C for ; Thu, 02 Apr 2026 14:50:41 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 5757217E43; Thu, 2 Apr 2026 14:49:26 +0200 (CEST) From: Daniel Kral To: pve-devel@lists.proxmox.com Subject: [PATCH manager v4 28/28] ui: form: add crs auto rebalancing options Date: Thu, 2 Apr 2026 14:44:22 +0200 Message-ID: <20260402124817.416232-29-d.kral@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260402124817.416232-1-d.kral@proxmox.com> References: <20260402124817.416232-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: 1775134044330 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.082 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: SAASXR55SN63QNRHILQT5KF254BPN2GD X-Message-ID-Hash: SAASXR55SN63QNRHILQT5KF254BPN2GD 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: ha-auto-rebalance-{method,margin,hold-duration,margin} require ha-auto-rebalance to be enabled in the schema, therefore they are disabled here unless ha-auto-rebalance is enabled. The label width was enlared a bit, so that the longer labels for the auto rebalancing options are more readable. Signed-off-by: Daniel Kral --- changes v3 -> v4: - new! - only changes from v1 are that a separate component is used now, it uses a viewModel to disable fields that shouldn't be set, and widen the label width a bit; - also 'Margin' is 'Minimum Imbalance Improvement' in the UI www/manager6/form/CRSOptions.js | 62 ++++++++++++++++++++++++++++++++- 1 file changed, 61 insertions(+), 1 deletion(-) diff --git a/www/manager6/form/CRSOptions.js b/www/manager6/form/CRSOptions.js index b22c5c99..b5476bd5 100644 --- a/www/manager6/form/CRSOptions.js +++ b/www/manager6/form/CRSOptions.js @@ -7,7 +7,7 @@ Ext.define('PVE.form.CRSOptions', { onlineHelp: 'ha_manager_crs', fieldDefaults: { - labelWidth: 120, + labelWidth: 150, }, setValues: function (values) { @@ -16,6 +16,8 @@ Ext.define('PVE.form.CRSOptions', { }); }, + viewModel: {}, + items: [ { xtype: 'inputpanel', @@ -50,6 +52,64 @@ Ext.define('PVE.form.CRSOptions', { ), value: 0, }, + { + xtype: 'proxmoxcheckbox', + name: 'ha-auto-rebalance', + fieldLabel: gettext('Automatic Rebalance'), + boxLabel: gettext('Automatically rebalance HA resources'), + value: 0, + reference: 'enableAutoRebalance', + }, + { + xtype: 'numberfield', + name: 'ha-auto-rebalance-threshold', + fieldLabel: gettext('Imbalance Threshold'), + emptyText: '0.3', + minValue: 0.0, + step: 0.01, + bind: { + disabled: '{!enableAutoRebalance.checked}', + }, + }, + { + xtype: 'proxmoxKVComboBox', + name: 'ha-auto-rebalance-method', + fieldLabel: gettext('Rebalancing Method'), + deleteEmpty: false, + value: '__default__', + comboItems: [ + ['__default__', Proxmox.Utils.defaultText + ' (bruteforce)'], + ['bruteforce', 'Bruteforce'], + ['topsis', 'TOPSIS'], + ], + defaultValue: '__default__', + bind: { + disabled: '{!enableAutoRebalance.checked}', + }, + }, + { + xtype: 'numberfield', + name: 'ha-auto-rebalance-hold-duration', + fieldLabel: gettext('Hold Duration'), + emptyText: '3', + minValue: 0, + step: 1, + bind: { + disabled: '{!enableAutoRebalance.checked}', + }, + }, + { + xtype: 'numberfield', + name: 'ha-auto-rebalance-margin', + fieldLabel: gettext('Minimum Imbalance Improvement'), + emptyText: '0.1', + minValue: 0.0, + maxValue: 1.0, + step: 0.01, + bind: { + disabled: '{!enableAutoRebalance.checked}', + }, + }, ], }, ], -- 2.47.3