The /nodes/<node>/status API endpoint in pve-manager allows to specify
the shutdown policy now. This change is required for it to have any
effect of course.

Being able to choose the shutdown policy on a per-node/per-shutdown
is more flexible and user-friendly.

Signed-off-by: Fiona Ebner <[email protected]>
---

No changes in v2.

 src/PVE/HA/LRM.pm | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/PVE/HA/LRM.pm b/src/PVE/HA/LRM.pm
index b6ac0fe..b8b842f 100644
--- a/src/PVE/HA/LRM.pm
+++ b/src/PVE/HA/LRM.pm
@@ -60,7 +60,10 @@ sub shutdown_request {
     my ($shutdown, $reboot) = $haenv->is_node_shutdown();
 
     my $dc_cfg = $haenv->get_datacenter_settings();
-    my $shutdown_policy = $dc_cfg->{ha}->{shutdown_policy} // 'conditional';
+    my $dc_ha_overrides = $dc_cfg->{'local-overrides'}->{ha} // {};
+
+    my $shutdown_policy =
+       $dc_ha_overrides->{shutdown_policy} // $dc_cfg->{ha}->{shutdown_policy} 
// 'conditional';
 
     if ($shutdown) { # don't log this on service restart, only on node shutdown
        $haenv->log('info', "got shutdown request with shutdown policy 
'$shutdown_policy'");
-- 
2.39.2



_______________________________________________
pve-devel mailing list
[email protected]
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to