On Tue Jan 20, 2026 at 10:35 AM CET, Fiona Ebner wrote:
> Am 20.01.26 um 10:25 AM schrieb Daniel Kral:
>> Oh wait, just noticed that this would create a circular dependency,
>> because get_resource_motion_info(...) uses get_affinitive_resources(...)
>> from PVE::HA::Rules::ResourceAffinity, and
>> PVE::HA::Rules::ResourceAffinity in turn uses PVE::HA::Rules::Helpers
>> again..
>>
>> I'd tend to let get_resource_motion_info(...) stay in PVE::HA::Helpers,
>> or do you have other ideas?
>
> Okay, so get_resource_motion_info() depends on:
> PVE::HA::Rules::NodeAffinity
> PVE::HA::Rules::ResourceAffinity
>
> And in fact, having a PVE::HA::Helpers depend on those two seems bad for
> moving forward, because it means that those two modules won't be able to
> use PVE::HA::Helpers without creating a circular dependency. Ideally,
> the PVE::HA::Helpers module would not have such dependencies and be
> usable from essentially any other HA module.
>
> So considering the two dependencies, what about putting
> get_resource_motion_info() in PVE::HA::Rules itself? It is a more
> top-level function that depends on the rule submodules, so that seems to
> be a fitting place.
As discussed off-list, unfortunately get_resource_motion_info(...)
cannot be moved to PVE::HA::Rules that easily because it is the base
plugin for PVE::HA::Rules::{NodeAffinity,ResourceAffinity} and therefore
cannot depend on them either..
@Fiona suggested that in the long-term it would be great to split the
plugin-related parts of PVE::HA::Rules out into PVE::HA::Rules::Plugin,
which would make it easier to encapsulate the Rules module, but we
agreed to postpone it to its own patch series.
For now, since PVE::HA::Tools already exists as a module to have
helpers, which do not have any inner HA-related dependencies, we agreed
that PVE::HA::Helpers would be fine as a helper module with HA
dependencies.. albeit I still might change the name to something more
telling in a v2.
_______________________________________________
pve-devel mailing list
[email protected]
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel