From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id B73E3A1F38 for ; Fri, 16 Jun 2023 13:34:30 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 0A768322A2 for ; Fri, 16 Jun 2023 13:33:59 +0200 (CEST) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS for ; Fri, 16 Jun 2023 13:33:54 +0200 (CEST) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id B696C45B25 for ; Fri, 16 Jun 2023 13:33:50 +0200 (CEST) From: Fiona Ebner To: pve-devel@lists.proxmox.com Date: Fri, 16 Jun 2023 13:33:36 +0200 Message-Id: <20230616113345.65996-1-f.ebner@proxmox.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL -0.097 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment POISEN_SPAM_PILL_3 0.1 random spam to be learned in bayes SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record T_SCC_BODY_TEXT_LINE -0.01 - Subject: [pve-devel] [PATCH-SERIES cluster/(ha-)manager] allow node HA shutdown policy override X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Jun 2023 11:34:30 -0000 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. Still missing: UI part (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). cluster: Fiona Ebner (1): datacenter config: turn shutdown policy into a standard option src/PVE/DataCenterConfig.pm | 50 +++++++++++++++++++------------------ 1 file changed, 26 insertions(+), 24 deletions(-) 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 (1): api: nodes: allow setting HA shutdown policy during shutdown/reboot PVE/API2/Nodes.pm | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) -- 2.39.2