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

Daniel Kral
2026-03-30T14:41:54Z

- clarify unit for ha-auto-rebalance-hold-duration as suggested by
@Jillian Morgan and @Dominik
- "The threshold for cluster node imbalance" instead of "The threshold
for node load", where the latter is not really representative
- further improve wording a bit, so another read would be very
appreciated!

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

diff --git a/src/PVE/DataCenterConfig.pm b/src/PVE/DataCenterConfig.pm
index 0225bc6..41f56ef 100644
--- a/src/PVE/DataCenterConfig.pm
+++ b/src/PVE/DataCenterConfig.pm
@@ -33,6 +33,47 @@ 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 cluster node imbalance, 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 balancing migrations.",
+ },
+ 'ha-auto-rebalance-hold-duration' => {
+ type => 'number',
+ optional => 1,
+ default => 3,
+ requires => 'ha-auto-rebalance',
+ description => "The number of HA rounds for which the cluster node"
+ . " imbalance threshold must be exceeded before triggering an"
+ . " automatic resource balancing migration.",
+ },
+ '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 balancing migration.",
+ },
};

my $migration_format = {
--
2.47.3