[pve-devel] [PATCH ha-manager 03/15] usage: add get_service_node and pin_service_node methods

Daniel Kral d.kral at proxmox.com
Fri Apr 25 09:39:48 CEST 2025


On 4/24/25 14:29, Fiona Ebner wrote:
> Am 25.03.25 um 16:12 schrieb Daniel Kral:
>> Add methods get_service_node() and pin_service_node() to the Usage class
>> to retrieve and pin the current node of a specific service.
> 
> Hmm, not sure about calling it "pin", why not "set"?
> 
>>
>> This is used to retrieve the current node of a service for colocation
>> rules inside of select_service_node(), where there is currently no
>> access to the global services state.
>>
>> Signed-off-by: Daniel Kral <d.kral at proxmox.com>
>> ---
>> For me this is more of a temporary change, since I don't think putting
>> this information here is very useful in the future. It was more of a
>> workaround for the moment, since `select_service_node()` doesn't have
>> access to the global service configuration data, which is needed here.
>>
>> I would like to give `select_service_node()` the information from e.g.
>> $sc directly post-RFC.
> 
> Yes, this sounds cleaner than essentially tracking the same things twice
> in different places. Can't we do this as preparation to avoid such
> temporary workarounds?

Yes, we can definitely do this as I'm also not a fan of copying 
information at all. I just did it here for the RFC as I wanted to focus 
on implementing the core functionality first and making it pretty 
afterwards.

So this patch will be dropped/changed to restructure the signature of 
select_service_node(...) to have more information where the services are 
currently configured to run in the next revision.




More information about the pve-devel mailing list