public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: "Daniel Kral" <d.kral@proxmox.com>
To: "Thomas Lamprecht" <t.lamprecht@proxmox.com>,
	"Proxmox VE development discussion" <pve-devel@lists.proxmox.com>
Subject: Re: [pve-devel] [PATCH ha-manager v5 06/23] config: delete services from rules if services are deleted from config
Date: Thu, 31 Jul 2025 10:15:19 +0200	[thread overview]
Message-ID: <DBQ3A9G116T4.3N8C2UAZHHGBE@proxmox.com> (raw)
In-Reply-To: <05b4b279-bb6f-4977-8519-8e9252c3432d@proxmox.com>

On Thu Jul 31, 2025 at 6:59 AM CEST, Thomas Lamprecht wrote:
> Am 30.07.25 um 20:00 schrieb Daniel Kral:
>> Remove HA resources from rules, where these HA resources are used, if
>> they are removed by delete_service_from_config(...), which is called by
>> the HA resources' delete API endpoint and possibly external callers,
>> e.g. if the HA resource is removed externally.
>> 
>> If all of the rules' HA resources have been removed, the rule itself
>> must be removed as it would result in an erroneous rules config, which
>> would become user-visible at the next read and parse of the rules
>> config.
>
> Do we the same for groups? Would be worth mentioning for such a case
> where we add new infra to replace existing one.
>
> And FWIW (definitively not a blocker), optionally keeping rules would be
> nice too, albeit since we got the "ignore" request-state for resources
> this probably doesn't really matter that much anymore, as one doesn't
> have to remove a service from HA anymore if one wants to temporarily
> control the resource directly.

Indeed for HA groups we do it the "other way" around: The HA group can
only be deleted if no HA resource references them anymore in their
config, but HA resources can be removed freely without interfering with
the HA groups.

This doesn't work as nicely for HA rules anymore, because now the nodes
and the HA resources are referenced in the HA rules config instead of
having that relationship encoded in the HA resource config and HA group
config.

This slightly changes things, as now rules do not make much sense if
there are no HA resources left in them (albeit fields like the comment,
... could still hold valuable information). I thought of it similarily
as we delete ACLs if a user/group is removed, even though that's
different because every ACL is only "owned" by one user/group.

AFAICT it shouldn't be a severe problem if a unmanaged/non-existant is
left in the HA rules config as for node affinity rules it doesn't matter
at all and for resource affinity rules it will just set the
unmanaged/non-existant ha resource's node as undef, which means that it
won't put any constraints on the other ha resources that are part of the
resource affinity rule.

Still, with your other reply in mind, it would make sense to disallow
removing a HA resource either if it's the last one in a HA rule or if
it's referenced in any HA rule. The error message would point the user
so they know that they should remove the HA resource from any HA rule
referencing them. If that's good, I'll send a follow-up patch doing just
that.

AFAICS a `--purge` option or something similar can always be added later
too if it helps the user experience.


_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


  reply	other threads:[~2025-07-31  8:13 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-30 17:59 [pve-devel] [PATCH docs/ha-manager/manager v5 00/29] HA Rules Daniel Kral
2025-07-30 17:59 ` [pve-devel] [PATCH ha-manager v5 01/23] tree-wide: make arguments for select_service_node explicit Daniel Kral
2025-07-30 17:59 ` [pve-devel] [PATCH ha-manager v5 02/23] manager: improve signature of select_service_node Daniel Kral
2025-07-30 17:59 ` [pve-devel] [PATCH ha-manager v5 03/23] introduce rules base plugin Daniel Kral
2025-07-30 17:59 ` [pve-devel] [PATCH ha-manager v5 04/23] rules: introduce node affinity rule plugin Daniel Kral
2025-07-30 17:59 ` [pve-devel] [PATCH ha-manager v5 05/23] config, env, hw: add rules read and parse methods Daniel Kral
2025-07-30 17:59 ` [pve-devel] [PATCH ha-manager v5 06/23] config: delete services from rules if services are deleted from config Daniel Kral
2025-07-31  4:59   ` Thomas Lamprecht
2025-07-31  8:15     ` Daniel Kral [this message]
2025-07-31  5:03   ` Thomas Lamprecht
2025-07-30 17:59 ` [pve-devel] [PATCH ha-manager v5 07/23] manager: read and update rules config Daniel Kral
2025-07-30 17:59 ` [pve-devel] [PATCH ha-manager v5 08/23] test: ha tester: add test cases for future node affinity rules Daniel Kral
2025-07-30 17:59 ` [pve-devel] [PATCH ha-manager v5 09/23] resources: introduce failback property in ha resource config Daniel Kral
2025-07-30 17:59 ` [pve-devel] [PATCH ha-manager v5 10/23] manager: migrate ha groups to node affinity rules in-memory Daniel Kral
2025-07-31  8:35   ` Daniel Kral
2025-07-30 17:59 ` [pve-devel] [PATCH ha-manager v5 11/23] manager: apply node affinity rules when selecting service nodes Daniel Kral
2025-07-31  5:26   ` Thomas Lamprecht
2025-07-31  8:21     ` Daniel Kral
2025-07-30 17:59 ` [pve-devel] [PATCH ha-manager v5 12/23] test: add test cases for rules config Daniel Kral
2025-07-31  5:30   ` Thomas Lamprecht
2025-07-30 17:59 ` [pve-devel] [PATCH ha-manager v5 13/23] api: introduce ha rules api endpoints Daniel Kral
2025-07-31  5:36   ` Thomas Lamprecht
2025-07-30 17:59 ` [pve-devel] [PATCH ha-manager v5 14/23] cli: expose ha rules api endpoints to ha-manager cli Daniel Kral
2025-07-30 17:59 ` [pve-devel] [PATCH ha-manager v5 15/23] sim: do not create default groups config Daniel Kral
2025-07-30 17:59 ` [pve-devel] [PATCH ha-manager v5 16/23] test: ha tester: migrate groups to service and rules config Daniel Kral
2025-07-30 17:59 ` [pve-devel] [PATCH ha-manager v5 17/23] test: ha tester: replace any reference to groups with node affinity rules Daniel Kral
2025-07-30 17:59 ` [pve-devel] [PATCH ha-manager v5 18/23] env: add property delete for update_service_config Daniel Kral
2025-07-30 17:59 ` [pve-devel] [PATCH ha-manager v5 19/23] manager: persistently migrate ha groups to ha rules Daniel Kral
2025-07-30 17:59 ` [pve-devel] [RFC ha-manager v5 20/23] api: groups: disallow calls to ha groups endpoints if fully migrated Daniel Kral
2025-07-30 17:59 ` [pve-devel] [RFC ha-manager v5 21/23] api: resources: exclude group property in reading endpoints if migrated Daniel Kral
2025-07-30 17:59 ` [pve-devel] [RFC ha-manager v5 22/23] api: resources: disallow group prop in modifying " Daniel Kral
2025-07-30 17:59 ` [pve-devel] [PATCH ha-manager v5 23/23] api: rules: disallow modifying api calls if ha groups not migrated Daniel Kral
2025-07-30 17:59 ` [pve-devel] [PATCH docs v5 1/2] ha: add documentation about ha rules and ha node affinity rules Daniel Kral
2025-07-30 17:59 ` [pve-devel] [PATCH docs v5 2/2] ha: crs: add effects of ha node affinity rule on the crs scheduler Daniel Kral
2025-07-30 17:59 ` [pve-devel] [PATCH manager v5 1/4] api: ha: add ha rules api endpoints Daniel Kral
2025-07-30 17:59 ` [pve-devel] [PATCH manager v5 2/4] ui: ha: remove ha groups from ha resource components Daniel Kral
2025-07-30 17:59 ` [pve-devel] [PATCH manager v5 3/4] ui: ha: show failback flag in resources status view Daniel Kral
2025-07-30 17:59 ` [pve-devel] [PATCH manager v5 4/4] ui: ha: replace ha groups with ha node affinity rules Daniel Kral
2025-07-31  7:17 ` [pve-devel] partially-applied-series: [PATCH docs/ha-manager/manager v5 00/29] HA Rules Thomas Lamprecht

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DBQ3A9G116T4.3N8C2UAZHHGBE@proxmox.com \
    --to=d.kral@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    --cc=t.lamprecht@proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal