[pve-devel] [PATCH ha-manager 04/11] manager: select service node: add $sid to parameters

Thomas Lamprecht t.lamprecht at proxmox.com
Wed Nov 16 08:17:50 CET 2022


Am 10/11/2022 um 15:37 schrieb Fiona Ebner:
> In preparation for scheduling based on static information, where the
> scoring of nodes depends on information from the service's
> VM/CT configuration file (and the $sid is required to query that).
> 
> Signed-off-by: Fiona Ebner <f.ebner at proxmox.com>
> ---
>  src/PVE/HA/Manager.pm      | 4 +++-
>  src/test/test_failover1.pl | 2 +-
>  2 files changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/src/PVE/HA/Manager.pm b/src/PVE/HA/Manager.pm
> index 518f64f..63c94af 100644
> --- a/src/PVE/HA/Manager.pm
> +++ b/src/PVE/HA/Manager.pm
> @@ -119,7 +119,7 @@ sub get_node_priority_groups {
>  }
>  
>  sub select_service_node {
> -    my ($groups, $online_node_usage, $service_conf, $current_node, $try_next, $tried_nodes, $maintenance_fallback) = @_;
> +    my ($groups, $online_node_usage, $sid, $service_conf, $current_node, $try_next, $tried_nodes, $maintenance_fallback) = @_;

ok for now, but we seriously need to clean this method signature up, as idea for
some future patch:

$service -> { sid => .., conf => .., current_node => ... }
$affinity -> { groups => ..., usage => ..., tried_nodes => .., maintenance_fallback }

(but not $try_next, that is no info struct but a control flag to the "algorithm
behavior", so it needs to stay separate).

May then also be sensible to adapt the way we save that info in the manager $self,
but not all change at once :)





More information about the pve-devel mailing list