From 55c5010b34f507d03ef9f8e5371a3f4d23cae85c Mon Sep 17 00:00:00 2001 From: bizhiyuan Date: Thu, 24 Oct 2024 20:50:46 +0800 Subject: [PATCH] Filesystem: dont sleep during stop-action when there are no processes to kill powervs-subnet: Enable access via private endpoint for IBM IAM --- ...sleep-during-stop-action-when-there-.patch | 50 +++++++++++++ ...nable-access-via-private-endpoint-fo.patch | 72 +++++++++++++++++++ resource-agents.spec | 9 ++- 3 files changed, 130 insertions(+), 1 deletion(-) create mode 100644 backport-Filesystem-dont-sleep-during-stop-action-when-there-.patch create mode 100644 backport-powervs-subnet-Enable-access-via-private-endpoint-fo.patch diff --git a/backport-Filesystem-dont-sleep-during-stop-action-when-there-.patch b/backport-Filesystem-dont-sleep-during-stop-action-when-there-.patch new file mode 100644 index 0000000..ae49576 --- /dev/null +++ b/backport-Filesystem-dont-sleep-during-stop-action-when-there-.patch @@ -0,0 +1,50 @@ +From d66a52cfb25f5436255ecc65a407c0166a720146 Mon Sep 17 00:00:00 2001 +From: Oyvind Albrigtsen +Date: Tue, 3 Sep 2024 12:55:28 +0200 +Subject: [PATCH] Filesystem: dont sleep during stop-action when there are no + processes to kill + +Thanks @SatomiOSAWA for the initial code. +--- + heartbeat/Filesystem | 10 ++++++---- + 1 file changed, 6 insertions(+), 4 deletions(-) + +diff --git a/heartbeat/Filesystem b/heartbeat/Filesystem +index 3eb520e0..f54969f2 100755 +--- a/heartbeat/Filesystem ++++ b/heartbeat/Filesystem +@@ -685,12 +685,13 @@ signal_processes() { + pids=$(get_pids "$dir") + if [ -z "$pids" ]; then + ocf_log info "No processes on $dir were signalled. force_unmount is set to '$FORCE_UNMOUNT'" +- return ++ return 1 + fi + for pid in $pids; do + ocf_log info "sending signal $sig to: $(ps -f $pid | tail -1)" + kill -s $sig $pid + done ++ return 0 + } + try_umount() { + local SUB="$1" +@@ -717,12 +718,13 @@ timeout_child() { + return $ret + } + fs_stop_loop() { +- local SUB="$1" signals="$2" sig ++ local SUB="$1" signals="$2" sig send_signal + while true; do ++ send_signal=false + for sig in $signals; do +- signal_processes "$SUB" $sig ++ signal_processes "$SUB" $sig && send_signal=true + done +- sleep $OCF_RESKEY_signal_delay ++ $send_signal && sleep $OCF_RESKEY_signal_delay + try_umount "$SUB" && return $OCF_SUCCESS + done + } +-- +2.25.1 + diff --git a/backport-powervs-subnet-Enable-access-via-private-endpoint-fo.patch b/backport-powervs-subnet-Enable-access-via-private-endpoint-fo.patch new file mode 100644 index 0000000..dedaea9 --- /dev/null +++ b/backport-powervs-subnet-Enable-access-via-private-endpoint-fo.patch @@ -0,0 +1,72 @@ +From 4533539dbaeb3ae47a4d8dfd0012db4c16b79e00 Mon Sep 17 00:00:00 2001 +From: edmund-haefele +Date: Wed, 4 Sep 2024 09:32:39 +0000 +Subject: [PATCH] powervs-subnet: Enable access via private endpoint for IBM + IAM + +--- + heartbeat/powervs-subnet.in | 15 +++++++++------ + 1 file changed, 9 insertions(+), 6 deletions(-) + +diff --git a/heartbeat/powervs-subnet.in b/heartbeat/powervs-subnet.in +index 08762306..83a468e0 100755 +--- a/heartbeat/powervs-subnet.in ++++ b/heartbeat/powervs-subnet.in +@@ -265,6 +265,7 @@ class PowerCloudAPI: + """Provides methods to manage Power Virtual Server resources through its REST API.""" + + _URL_IAM_GLOBAL = "https://iam.cloud.ibm.com/identity/token" ++ _URL_IAM_PRIVATE = "https://private.iam.cloud.ibm.com/identity/token" + _URL_API_PUBLIC = "https://{}.power-iaas.cloud.ibm.com" + _URL_API_PRIVATE = "https://private.{}.power-iaas.cloud.ibm.com" + _URL_API_BASE = "/pcloud/v1/cloud-instances/{}" +@@ -382,7 +383,7 @@ class PowerCloudAPI: + def _set_token(self): + """Use the stored API key to obtain an IBM Cloud IAM access token.""" + +- url = self._URL_IAM_GLOBAL ++ url = self._URL_IAM + + headers = { + "content-type": "application/x-www-form-urlencoded", +@@ -671,6 +672,9 @@ class PowerCloudAPI: + self._URL_API_PRIVATE if api_type == "private" else self._URL_API_PUBLIC + ) + self._url = url_api_fmt.format(self._res_options["region"]) ++ self._URL_IAM = ( ++ self._URL_IAM_PRIVATE if api_type == "private" else self._URL_IAM_GLOBAL ++ ) + self._base = self._URL_API_BASE.format(self._cloud_instance_id) + self._session = None + +@@ -965,15 +969,14 @@ def main(): + Install with @server group to ensure that NetworkManager settings are correct. + Verify that the NetworkManager-config-server package is installed. + +- 2. IBM Cloud API Key: ++ 2. A two-node cluster that is distributed across two different Power Virtual Server workspaces in two data centers in a region. ++ ++ 3. IBM Cloud API Key: + Create a service API key that is privileged for both Power Virtual Server + workspaces. Save the service API key in a file and copy the file to both + cluster nodes. Use same filename and directory location on both cluster nodes. + Reference the path to the key file in the resource definition. + +- 3. The hostname of the virtual server instances must be same as the name +- of the virtual server instances in the Power Virtual Server workspaces. +- + For comprehensive documentation on implementing high availability for + SAP applications on IBM Power Virtual Server, visit https://cloud.ibm.com/docs/sap?topic=sap-ha-overview. + """) +@@ -982,7 +985,7 @@ def main(): + "powervs-subnet", + shortdesc="Manages moving a Power Virtual Server subnet", + longdesc=agent_description, +- version=1.03, ++ version=1.04, + ) + + agent.add_parameter( +-- +2.25.1 + diff --git a/resource-agents.spec b/resource-agents.spec index 4b5636f..a6ffe45 100644 --- a/resource-agents.spec +++ b/resource-agents.spec @@ -1,7 +1,7 @@ Name: resource-agents Summary: Open Source HA Reusable Cluster Resource Scripts Version: 4.15.1 -Release: 5 +Release: 6 License: GPLv2+ and LGPLv2+ URL: https://github.com/ClusterLabs/resource-agents Source0: https://github.com/ClusterLabs/resource-agents/archive/v%{version}.tar.gz @@ -14,6 +14,9 @@ Patch4: backport-powervs-subnet-Add-optional-argument-route_table-1 Patch5: backport-IPsrcaddr-specify-dev-for-default-route-as-e.g.-fe80.patch Patch6: backport-docker-compose-use-docker-compose-when-not-using-old.patch Patch7: backport-nfsserver-also-stop-rpc-statd-for-nfsv4_only-to-avoi.patch +Patch8: backport-Filesystem-dont-sleep-during-stop-action-when-there-.patch +Patch9: backport-powervs-subnet-Enable-access-via-private-endpoint-fo.patch + Obsoletes: heartbeat-resources <= %{version} Provides: heartbeat-resources = %{version} BuildRequires: automake autoconf pkgconfig gcc perl-interpreter perl-generators python3-devel @@ -111,6 +114,10 @@ export CFLAGS="$(echo '%{optflags}')" %{_mandir}/man8/{ocf-tester.8*,ldirectord.8*} %changelog +* Thu Oct 24 2024 bizhiyuan - 4.15.1-6 +- Filesystem: dont sleep during stop-action when there are no processes to kill +- powervs-subnet: Enable access via private endpoint for IBM IAM + * Wed Oct 23 2024 bixiaoyan - 4.15.1-5 - docker-compose: use "docker compose" when not using older docker-compose command - nfsserver: also stop rpc-statd for nfsv4_only to avoid stop failing in some cases -- Gitee