[pve-devel] [PATCH ha-manager 6/7] sim: hardware: delete static service stats on service deletion
Daniel Kral
d.kral at proxmox.com
Mon Nov 17 18:21:05 CET 2025
Since static service stats can now be set through `service <sid>
set-static-stats <newcpu> <newmem>` at runtime in the simulated
environment, make sure that static service stats are invalidated on HA
resource deletion, e.g. with the `service <sid> delete` command.
pve-ha-simulator does already call set-static-stats on every new HA
resource creation, but other future callers might not and run into
unexpected situations.
Signed-off-by: Daniel Kral <d.kral at proxmox.com>
---
src/PVE/HA/Sim/Hardware.pm | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/PVE/HA/Sim/Hardware.pm b/src/PVE/HA/Sim/Hardware.pm
index baee2018..0848d18a 100644
--- a/src/PVE/HA/Sim/Hardware.pm
+++ b/src/PVE/HA/Sim/Hardware.pm
@@ -226,6 +226,12 @@ sub delete_service {
$self->write_service_config($conf);
+ my $stats = $self->read_static_service_stats();
+
+ delete $stats->{$sid};
+
+ $self->write_static_service_stats($stats);
+
return $conf;
}
--
2.47.3
More information about the pve-devel
mailing list