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 <[email protected]> --- 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 _______________________________________________ pve-devel mailing list [email protected] https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
