[pve-devel] [PATCH-SERIES v2 (ha-)manager] allow node HA shutdown policy override

Fiona Ebner f.ebner at proxmox.com
Tue Jun 20 12:54:29 CEST 2023


Make it possible to specify the HA shutdown policy for the
/nodes/{node}/status POST API enpoint for user flexibilty and
convenience.

The override is written to the LRM service's (new dedicated) runtime
directory. The LRM will check and honor the override when it receives
a shutdown/reboot request.


(Build-)depedency bump pve-manager -> libpve-cluster-perl needed.

If patch ha-manager 5/7 is applied: (build-)depedency bump
pve-ha-manager -> libpve-cluster-perl needed.

Dependency bump pve-manager -> pve-ha-manager needed (to have the
runtime directory exist and LRM honor the new param).

Changes in v2:
    * Also check for Sys.Modify permisson when shutdown policy
      parameter is used.
    * Add UI patch.
    * Drop already applied cluster patch.


ha-manager:

Fiona Ebner (7):
  lrm service: add runtime directory
  lrm service: move PID file to service's runtime directory
  pve2 env: get shutdown policy override set by node's shutdown API
    endpoint
  lrm: honor shutdown policy override set by node's shutdown API
    endpoint
  pve2 env: validate shutdown policy from override file
  sim env: add support for datacenter config overrides
  tests: add test for shutdown policy override

 debian/pve-ha-lrm.service                     |  3 +-
 src/PVE/HA/Env/PVE2.pm                        | 19 +++++++
 src/PVE/HA/LRM.pm                             |  5 +-
 src/PVE/HA/Sim/Env.pm                         |  1 +
 src/PVE/Service/pve_ha_lrm.pm                 |  5 +-
 src/test/test-shutdown-policy-override/README |  3 +
 .../test-shutdown-policy-override/cmdlist     |  4 ++
 .../datacenter.cfg                            | 10 ++++
 .../hardware_status                           |  5 ++
 .../test-shutdown-policy-override/log.expect  | 57 +++++++++++++++++++
 .../manager_status                            |  1 +
 .../service_config                            |  6 ++
 12 files changed, 116 insertions(+), 3 deletions(-)
 create mode 100644 src/test/test-shutdown-policy-override/README
 create mode 100644 src/test/test-shutdown-policy-override/cmdlist
 create mode 100644 src/test/test-shutdown-policy-override/datacenter.cfg
 create mode 100644 src/test/test-shutdown-policy-override/hardware_status
 create mode 100644 src/test/test-shutdown-policy-override/log.expect
 create mode 100644 src/test/test-shutdown-policy-override/manager_status
 create mode 100644 src/test/test-shutdown-policy-override/service_config


manager:

Fiona Ebner (2):
  api: nodes: allow setting HA shutdown policy during shutdown/reboot
  ui: allow specifying shutdown policy during node shutdown/reboot

 PVE/API2/Nodes.pm                   |  18 +++-
 www/manager6/Makefile               |   1 +
 www/manager6/node/Config.js         |  32 +++----
 www/manager6/window/NodeShutdown.js | 126 ++++++++++++++++++++++++++++
 4 files changed, 156 insertions(+), 21 deletions(-)
 create mode 100644 www/manager6/window/NodeShutdown.js

-- 
2.39.2






More information about the pve-devel mailing list