[PATCH cluster v2 19/40] datacenter config: add auto rebalancing options

Daniel Kral
2026-03-24T18:34:19Z

- slightly changed wording here (as suggested by @Maximiliano)

src/PVE/DataCenterConfig.pm | 39 +++++++++++++++++++++++++++++++++++++
1 file changed, 39 insertions(+)

diff --git a/src/PVE/DataCenterConfig.pm b/src/PVE/DataCenterConfig.pm
index 396c962..52682aa 100644
--- a/src/PVE/DataCenterConfig.pm
+++ b/src/PVE/DataCenterConfig.pm
@@ -33,6 +33,45 @@ EODESC
"Set to use CRS for selecting a suited node when a HA services request-state"
. " changes from stop to start.",
},
+ 'ha-auto-rebalance' => {
+ type => 'boolean',
+ optional => 1,
+ default => 0,
+ description => "Whether to use CRS for balancing HA resources automatically"
+ . " depending on the current node imbalance.",
+ },
+ 'ha-auto-rebalance-threshold' => {
+ type => 'number',
+ optional => 1,
+ default => 0.7,
+ requires => 'ha-auto-rebalance',
+ description => "The threshold for the node load, which will trigger the automatic"
+ . " resource balancing system if its value is exceeded.",
+ },
+ 'ha-auto-rebalance-method' => {
+ type => 'string',
+ enum => ['bruteforce', 'topsis'],
+ optional => 1,
+ default => 'bruteforce',
+ requires => 'ha-auto-rebalance',
+ description => "The method to use for the scoring of rebalancing migrations.",
+ },
+ 'ha-auto-rebalance-hold-duration' => {
+ type => 'number',
+ optional => 1,
+ default => 3,
+ requires => 'ha-auto-rebalance',
+ description => "The duration the threshold must be exceeded for to trigger an automatic"
+ . " resource balancing migration in HA rounds.",
+ },
+ 'ha-auto-rebalance-margin' => {
+ type => 'number',
+ optional => 1,
+ default => 0.1,
+ requires => 'ha-auto-rebalance',
+ description => "The minimum relative improvement in cluster node imbalance to commit to"
+ . " a resource rebalancing migration.",
+ },
};

my $migration_format = {
--
2.47.3