all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: "Daniel Kral" <d.kral@proxmox.com>
To: "Dominik Rusovac" <d.rusovac@proxmox.com>, <pve-devel@lists.proxmox.com>
Subject: Re: [PATCH pve-manager v2 12/19] fix #7993: ui: form: crs options: add weights
Date: Fri, 20 Nov 2026 14:35:40 +0100	[thread overview]
Message-ID: <DN02TEQB5Y6B.2BPS6G6KX459R@proxmox.com> (raw)
In-Reply-To: <20261112094437.1951271-13-d.rusovac@proxmox.com>

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 <d.rusovac@proxmox.com>
> ---
>
> 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,

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 the 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.

>              ],
>          },
>      ],






  reply	other threads:[~2026-11-20 13:35 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-12  9:44 [RFC PATCH-SERIES cluster/ha-manager/manager/proxmox{,-perl-rs} v2 00/19] fix #7993: implement weighted crs load balancing Dominik Rusovac
2026-11-12  9:44 ` [PATCH proxmox v2 01/19] resource-scheduling: fix typos Dominik Rusovac
2026-11-19 12:27   ` Daniel Kral
2026-11-12  9:44 ` [PATCH proxmox v2 02/19] resource-scheduling: scheduler: refine score_* docs Dominik Rusovac
2026-11-19 12:27   ` Daniel Kral
2026-11-19 12:47     ` Dominik Rusovac
2026-11-12  9:44 ` [PATCH proxmox v2 03/19] resource-scheduling: scheduler: abstract post-migration stats logic Dominik Rusovac
2026-11-19 12:28   ` Daniel Kral
2026-11-19 12:47     ` Dominik Rusovac
2026-11-12  9:44 ` [PATCH proxmox v2 04/19] fix #7993: resource-scheduling: node: add weighted node load Dominik Rusovac
2026-11-19 12:28   ` Daniel Kral
2026-11-19 12:50     ` Dominik Rusovac
2026-11-12  9:44 ` [PATCH proxmox v2 05/19] resource-scheduling: scheduler: make imbalance with candidate public Dominik Rusovac
2026-11-19 12:41   ` Daniel Kral
2026-11-19 12:52     ` Dominik Rusovac
2026-11-12  9:44 ` [PATCH proxmox v2 06/19] fix #7993: resource-scheduling: scheduler: add weights Dominik Rusovac
2026-11-19 12:40   ` Daniel Kral
2026-11-19 13:52     ` Dominik Rusovac
2026-11-12  9:44 ` [PATCH proxmox v2 07/19] workspace,resource-scheduling: add proptest as dev-dependency Dominik Rusovac
2026-11-12  9:44 ` [PATCH proxmox v2 08/19] resource-scheduling: scheduler: add property tests for weights Dominik Rusovac
2026-11-12  9:44 ` [PATCH proxmox-perl-rs v2 09/19] fix #7993: pve-rs: resource-scheduling: add scheduler options Dominik Rusovac
2026-11-19 12:45   ` Daniel Kral
2026-11-19 13:28     ` Dominik Rusovac
2026-11-12  9:44 ` [PATCH pve-cluster v2 10/19] fix #7993: datacenter config: ad ha-{cpu,mem}-weight crs options Dominik Rusovac
2026-11-20  8:43   ` Daniel Kral
2026-11-20 10:05     ` Dominik Rusovac
2026-11-12  9:44 ` [PATCH pve-manager v2 11/19] ui: form: crs options: make fine-tuning options advanced Dominik Rusovac
2026-11-20 13:37   ` Daniel Kral
2026-11-20 13:55     ` Dominik Rusovac
2026-11-12  9:44 ` [PATCH pve-manager v2 12/19] fix #7993: ui: form: crs options: add weights Dominik Rusovac
2026-11-20 13:35   ` Daniel Kral [this message]
2026-11-20 13:49     ` Dominik Rusovac
2026-11-12  9:44 ` [PATCH pve-ha-manager v2 13/19] manager: remove obsolete argument Dominik Rusovac
2026-11-12  9:44 ` [PATCH pve-ha-manager v2 14/19] manager: rename update_crs_scheduler_mod to update_crs_settings Dominik Rusovac
2026-11-20 13:39   ` Daniel Kral
2026-11-12  9:44 ` [PATCH pve-ha-manager v2 15/19] manager: factor out crs option update helper Dominik Rusovac
2026-11-20 13:46   ` Daniel Kral
2026-11-20 14:02     ` Dominik Rusovac
2026-11-12  9:44 ` [PATCH pve-ha-manager v2 16/19] manager: log changes to crs settings Dominik Rusovac
2026-11-20 13:54   ` Daniel Kral
2026-11-12  9:44 ` [PATCH pve-ha-manager v2 17/19] sim: hardware: allow changing datacenter settings at runtime Dominik Rusovac
2026-11-12  9:44 ` [PATCH pve-ha-manager v2 18/19] fix #7993: manager,usage: use weights for static and dynamic mode Dominik Rusovac
2026-11-12  9:44 ` [PATCH pve-ha-manager v2 19/19] test: add automatic rebalancing test cases with weights Dominik Rusovac

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DN02TEQB5Y6B.2BPS6G6KX459R@proxmox.com \
    --to=d.kral@proxmox.com \
    --cc=d.rusovac@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal