public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: "Daniel Kral" <d.kral@proxmox.com>
To: "Thomas Skinner" <thomas@atskinner.net>,
	"Thomas Lamprecht" <t.lamprecht@proxmox.com>
Cc: Proxmox VE development discussion <pve-devel@lists.proxmox.com>
Subject: Re: [pve-devel] [PATCH ha-manager 2/2] add api getter/setter for node maintenance mode
Date: Mon, 01 Sep 2025 10:52:33 +0200	[thread overview]
Message-ID: <DCHC47ASHB2A.168OVVJ2II58C@proxmox.com> (raw)
In-Reply-To: <CALn9RMcFSeGEbf9qdYEbysfd_cDLeHY_P7r4OnyV008Um=gasQ@mail.gmail.com>

On Fri Aug 29, 2025 at 10:13 PM CEST, Thomas Skinner wrote:
> On Wed, Aug 27, 2025 at 3:25 AM Daniel Kral <d.kral@proxmox.com> wrote:
>> Hm, I've only looked at the PVE API now, but one similar feature is the
>> PBS's maintenance mode for datastores [0], which are set by a single,
>> enum property 'maintenance-mode' in a PUT request.
>>
>> Maybe we could add the same PUT method to @Thomas' proposed
>> /nodes/{node}/maintenance API endpoint, because AFAICT for non-HA use
>> cases we'd need some way to enable and disable maintenance mode there
>> too. That's also cleaner than introducing two very similar endpoints
>> with quite long, weirdly-cased names.
>>
>> [0] https://pbs.proxmox.com/docs/api-viewer/index.html#/config/datastore/{name}
>>
>
> If the API for maintenance mode is under the /nodes/{node}/maintenance
> as @Thomas proposed, does it still make sense to put the code for the
> API into the ha-manager package instead of the manager package? I like
> the idea of the enum under this endpoint e.g. something like PUT
> /nodes/{node}/maintenance --maintenance-mode enable|disable. To be
> more specific to HA, could use something like --lrm-maintenance
> enable|disable that way the maintenance-mode enum could stay free if
> it was wanted for the more generic maintenance mode and it would
> convey to the user that it was specific to HA only.

If it is under /nodes/{node}/maintenance, then yes, I also think it
should go in the pve-manager package.

IMO for the maintenance-mode parameter it's fine to make it generic
already but stating in the description that it's only affecting the HA
for now, as introducing `lrm-maintenance` might cause confusion later on
when users want to put the whole node under maintenance.. Except if
there are use cases to only 'partially' put the node in maintenance
through the API.

Then it should be rather straight-forward to implement the functionality
with issuing the CRM commands to the HA Manager with

    run_command(['ha-manager', 'crm-command', 'node-maintenance', $maintenance_mode]);

where $maintenance_mode is either 'enable' or 'disable'.


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

  reply	other threads:[~2025-09-01  8:52 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-25  4:11 [pve-devel] [PATCH SERIES docs/ha-manager/manager] close #6144: add ui button + api " Thomas Skinner
2025-08-25  4:11 ` [pve-devel] [PATCH ha-manager 1/2] add additional api field for lrm_mode in status check Thomas Skinner
2025-08-25  4:11 ` [pve-devel] [PATCH manager 1/2] add api path map for node HA endpoints Thomas Skinner
2025-08-26  9:38   ` Daniel Kral
2025-08-26 10:26     ` Thomas Lamprecht
2025-08-26 11:34       ` Daniel Kral
2025-08-25  4:11 ` [pve-devel] [PATCH docs 1/1] add docs for maintenance mode buttons in UI Thomas Skinner
2025-08-26  9:44   ` Daniel Kral
2025-08-26 16:05     ` Thomas Skinner
2025-08-27  7:50       ` Daniel Kral
2025-08-25  4:11 ` [pve-devel] [PATCH ha-manager 2/2] add api getter/setter for node maintenance mode Thomas Skinner
2025-08-26  9:38   ` Daniel Kral
2025-08-26 16:00     ` Thomas Skinner
2025-08-27  7:31       ` Thomas Lamprecht
2025-08-27  8:25       ` Daniel Kral
2025-08-27  9:20         ` Thomas Lamprecht
2025-08-29 20:13         ` Thomas Skinner
2025-09-01  8:52           ` Daniel Kral [this message]
2025-08-29 20:17     ` Thomas Skinner
2025-08-25  4:11 ` [pve-devel] [PATCH manager 2/2] add UI for node maintenance enable/disable Thomas Skinner
2025-08-26 10:00   ` Daniel Kral
2025-08-26 17:34     ` Thomas Skinner

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=DCHC47ASHB2A.168OVVJ2II58C@proxmox.com \
    --to=d.kral@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    --cc=t.lamprecht@proxmox.com \
    --cc=thomas@atskinner.net \
    /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