[pve-devel] [PATCH perl-rs v3 1/2] pve-rs: resource_scheduling: allow granular usage changes

Thomas Lamprecht t.lamprecht at proxmox.com
Wed Nov 12 11:49:20 CET 2025


nicer commit subject would be:

pve resource scheduling: allow granular usage changes

Am 27.10.25 um 17:46 schrieb Daniel Kral:
> Implements a simple bidirectional map to track which service usages have
> been added to nodes, so that these can be removed later individually.
> 
> The `StaticNodeUsage` is newly initialized on every invocation of
> score_nodes_to_start_service(...) instead of updating the values on
> every call of `add_service_usage_to_node(...)` to reduce the likelihood
> of introducing numerical instability caused by floating-point operations
> done on the `cpu` field.
> 
> The StaticServiceUsage is added to the HashMap<> in StaticNodeInfo to
> reduce unnecessary indirection when summing these values in
> score_nodes_to_start_service(...).
> 
> Signed-off-by: Daniel Kral <d.kral at proxmox.com>
> Reviewed-by: Fiona Ebner <f.ebner at proxmox.com>
> ---
> Needs a build dependency bump for
> librust-proxmox-resource-scheduling-dev and a versioned breaks for
> pve-ha-manager.

The latter only due to the (signature) change to add_service_usage_to_node, or?
While versioned breaks can be done, if it's somewhat easy to avoid them it's
always better to do so, especially as it makes downgrades much easier 

Can we keep backward compat without having to bend to
much backwards? E.g. adding a new method for the new more granular way while
keeping add_service_usage_to_node as is, like "record_service_usage_for_node" (or
just slap a 2 at the end of the method name is also a simple trick that, while not
beautiful, works and avoids bikeshedding).




More information about the pve-devel mailing list