Please see my comments inline.

On Mon Mar 9, 2026 at 10:57 PM CET, Thomas Lamprecht wrote:

[snip]

     Extend the fencing status entry with disarming/disarmed states and
     the active resource mode. Each LRM entry shows 'watchdog released'
     once in disarm mode. The master and service status lines include the
     disarm state when applicable.


These status extensions provide useful information in the web UI, which
is very nice!

[snip]


     +__PACKAGE__->register_method({
     +    name => 'disarm-ha',
     +    path => 'disarm-ha',
     +    method => 'POST',


       protected => 1,

cfs-lock requires root privileges to create lock directory, thus
endpoint needs to be protected.

     +    description => "Request disarming the HA stack, releasing all 
watchdogs cluster-wide.",
     +    permissions => {
     +        check => ['perm', '/', ['Sys.Console']],
     +    },
     +    parameters => {
     +        additionalProperties => 0,
     +        properties => {
     +            'resource-mode' => {
     +                description => "Controls how HA managed resources are 
handled while disarmed."
     +                    . " The current state of resources is not affected."
     +                    . " 'freeze': new commands and state changes are not 
applied."
     +                    . " 'ignore': resources are removed from HA tracking 
and can be"
     +                    . " managed as if they were not HA managed.",
     +                type => 'string',
     +                enum => ['freeze', 'ignore'],
     +            },
     +        },
     +    },
     +    returns => { type => 'null' },
     +    code => sub {
     +        my ($param) = @_;
     +


nit: Adding a guard that checks on prohibited use, e.g., some node is in
maintenance state in combination with resource mode is 'ignore'; and
returning some information as to why the disarming command was ignored,
increases usability. This would of course entail the need for a
different return type.

     +        PVE::HA::Config::queue_crm_commands("disarm-ha 
$param->{'resource-mode'}");
     +
     +        return undef;
     +    },
     +});
     +
     +__PACKAGE__->register_method({
     +    name => 'arm-ha',
     +    path => 'arm-ha',
     +    method => 'POST',


       protected => 1,

cfs-lock requires root privileges to create lock directory, thus
endpoint needs to be protected.

     +    description => "Request re-arming the HA stack after it was 
disarmed.",


[snip]



Reply via email to