Signed-off-by: Daniel Kral <[email protected]>
---
src/PVE/HA/Env/PVE2.pm | 3 ++-
src/PVE/HA/Resources.pm | 2 +-
src/PVE/HA/Resources/PVECT.pm | 4 ++--
src/PVE/HA/Resources/PVEVM.pm | 4 ++--
src/PVE/HA/Sim/Resources.pm | 3 +--
src/PVE/HA/Usage/Static.pm | 4 ++--
6 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/src/PVE/HA/Env/PVE2.pm b/src/PVE/HA/Env/PVE2.pm
index 78ece447..1a9dc4ea 100644
--- a/src/PVE/HA/Env/PVE2.pm
+++ b/src/PVE/HA/Env/PVE2.pm
@@ -527,10 +527,11 @@ sub update_static_service_stats {
my $type = eval {
PVE::HA::Tools::get_ha_resource_type($idlist->{$id}->{type}) };
next if $@; # silently ignore unknown pve types
+ my $sid = "$type:$id";
my $conf = $confs->{$id} // {};
my $plugin = PVE::HA::Resources->lookup($type);
- $stats->{$id} = $plugin->get_static_stats_from_config($conf);
+ $stats->{$sid} = $plugin->get_static_stats_from_config($conf);
}
return $stats;
diff --git a/src/PVE/HA/Resources.pm b/src/PVE/HA/Resources.pm
index c40c260f..ea7655e5 100644
--- a/src/PVE/HA/Resources.pm
+++ b/src/PVE/HA/Resources.pm
@@ -183,7 +183,7 @@ sub get_static_stats_from_config {
}
sub get_static_stats {
- my ($class, $haenv, $id) = @_;
+ my ($class, $haenv, $sid) = @_;
die "implement in subclass";
}
diff --git a/src/PVE/HA/Resources/PVECT.pm b/src/PVE/HA/Resources/PVECT.pm
index 0dc500d1..bda33717 100644
--- a/src/PVE/HA/Resources/PVECT.pm
+++ b/src/PVE/HA/Resources/PVECT.pm
@@ -169,9 +169,9 @@ sub get_static_stats_from_config {
}
sub get_static_stats {
- my ($class, $haenv, $id) = @_;
+ my ($class, $haenv, $sid) = @_;
- return $haenv->get_static_service_stats($id);
+ return $haenv->get_static_service_stats($sid);
}
1;
diff --git a/src/PVE/HA/Resources/PVEVM.pm b/src/PVE/HA/Resources/PVEVM.pm
index 579a7fca..786c5130 100644
--- a/src/PVE/HA/Resources/PVEVM.pm
+++ b/src/PVE/HA/Resources/PVEVM.pm
@@ -190,9 +190,9 @@ sub get_static_stats_from_config {
}
sub get_static_stats {
- my ($class, $haenv, $id) = @_;
+ my ($class, $haenv, $sid) = @_;
- return $haenv->get_static_service_stats($id);
+ return $haenv->get_static_service_stats($sid);
}
1;
diff --git a/src/PVE/HA/Sim/Resources.pm b/src/PVE/HA/Sim/Resources.pm
index 2bde9aa3..f91d3ea2 100644
--- a/src/PVE/HA/Sim/Resources.pm
+++ b/src/PVE/HA/Sim/Resources.pm
@@ -138,9 +138,8 @@ sub remove_locks {
}
sub get_static_stats {
- my ($class, $haenv, $id) = @_;
+ my ($class, $haenv, $sid) = @_;
- my $sid = $class->type() . ":$id";
my $hardware = $haenv->hardware();
return $hardware->get_static_service_stats($sid);
diff --git a/src/PVE/HA/Usage/Static.pm b/src/PVE/HA/Usage/Static.pm
index 2304139c..acc3533c 100644
--- a/src/PVE/HA/Usage/Static.pm
+++ b/src/PVE/HA/Usage/Static.pm
@@ -65,10 +65,10 @@ my sub get_service_usage {
return $self->{'service-stats'}->{$sid} if
$self->{'service-stats'}->{$sid};
- my (undef, $type, $id) = $self->{haenv}->parse_sid($sid);
+ my (undef, $type, undef) = $self->{haenv}->parse_sid($sid);
my $plugin = PVE::HA::Resources->lookup($type);
- my $stats = eval { $plugin->get_static_stats($self->{haenv}, $id) };
+ my $stats = eval { $plugin->get_static_stats($self->{haenv}, $sid) };
die "did not get static service usage information for '$sid'\n" if !$stats;
my $service_stats = {
--
2.47.3