As none of the existing HA test cases rely on the default HA groups created by the simulated hardware anymore, create them only for the ha-simulator hardware.
This is done, because in an upcoming patch, which persistently migrates HA groups to node affinity rules, it would unnecessarily fire the migration for every default group config. Signed-off-by: Daniel Kral <d.k...@proxmox.com> --- src/PVE/HA/Sim/Hardware.pm | 16 ---------------- src/PVE/HA/Sim/RTHardware.pm | 18 ++++++++++++++++++ 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/src/PVE/HA/Sim/Hardware.pm b/src/PVE/HA/Sim/Hardware.pm index 579be2ad..35107446 100644 --- a/src/PVE/HA/Sim/Hardware.pm +++ b/src/PVE/HA/Sim/Hardware.pm @@ -375,20 +375,6 @@ sub read_static_service_stats { return $stats; } -my $default_group_config = <<__EOD; -group: prefer_node1 - nodes node1 - nofailback 1 - -group: prefer_node2 - nodes node2 - nofailback 1 - -group: prefer_node3 - nodes node3 - nofailback 1 -__EOD - sub new { my ($this, $testdir) = @_; @@ -415,8 +401,6 @@ sub new { if (-f "$testdir/groups") { copy("$testdir/groups", "$statusdir/groups"); - } else { - PVE::Tools::file_set_contents("$statusdir/groups", $default_group_config); } if (-f "$testdir/service_config") { diff --git a/src/PVE/HA/Sim/RTHardware.pm b/src/PVE/HA/Sim/RTHardware.pm index 0dfe0b21..611f9386 100644 --- a/src/PVE/HA/Sim/RTHardware.pm +++ b/src/PVE/HA/Sim/RTHardware.pm @@ -24,6 +24,20 @@ use PVE::HA::LRM; use PVE::HA::Sim::RTEnv; use base qw(PVE::HA::Sim::Hardware); +my $default_group_config = <<__EOD; +group: prefer_node1 + nodes node1 + nofailback 1 + +group: prefer_node2 + nodes node2 + nofailback 1 + +group: prefer_node3 + nodes node3 + nofailback 1 +__EOD + sub new { my ($this, $testdir) = @_; @@ -31,6 +45,10 @@ sub new { my $self = $class->SUPER::new($testdir); + if (!-f "$testdir/groups") { + PVE::Tools::file_set_contents("$self->{statusdir}/groups", $default_group_config); + } + my $logfile = "$testdir/log"; $self->{logfh} = IO::File->new(">$logfile") || die "unable to open '$logfile' - $!"; -- 2.47.2 _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel