diff --git a/backport-fence_ibm_powervs-fix-plaintext-token-file-support.patch b/backport-fence_ibm_powervs-fix-plaintext-token-file-support.patch new file mode 100644 index 0000000000000000000000000000000000000000..c073755d9298f880a7b32fa031bb383ff3e3d63a --- /dev/null +++ b/backport-fence_ibm_powervs-fix-plaintext-token-file-support.patch @@ -0,0 +1,24 @@ +From 988cbd9fb600261106d5da1db6a7bf9cde218eaa Mon Sep 17 00:00:00 2001 +From: Oyvind Albrigtsen +Date: Fri, 25 Apr 2025 16:38:03 +0200 +Subject: [PATCH] fence_ibm_powervs: fix plaintext token file support + +--- + agents/ibm_powervs/fence_ibm_powervs.py | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/agents/ibm_powervs/fence_ibm_powervs.py b/agents/ibm_powervs/fence_ibm_powervs.py +index ec9a0c11..d408e872 100755 +--- a/agents/ibm_powervs/fence_ibm_powervs.py ++++ b/agents/ibm_powervs/fence_ibm_powervs.py +@@ -35,6 +35,7 @@ def get_token(conn, options): + api_key = keys.get("apikey", "") + # data is text, return as is + except ValueError: ++ f.seek(0) + api_key = f.read().strip() + except FileNotFoundError: + logging.debug("Failed: Cannot open file {}".format(key_file)) +-- +2.25.1 + diff --git a/backport-fence_sbd-Dump-more-information-when-crashdump-optio.patch b/backport-fence_sbd-Dump-more-information-when-crashdump-optio.patch new file mode 100644 index 0000000000000000000000000000000000000000..3d6f8966e7e566dcb4231970a1f0d593da074874 --- /dev/null +++ b/backport-fence_sbd-Dump-more-information-when-crashdump-optio.patch @@ -0,0 +1,112 @@ +From a6c4b9f5a07949c81f52622d3d1f3cbe9b601ac6 Mon Sep 17 00:00:00 2001 +From: xin liang +Date: Mon, 31 Mar 2025 15:10:31 +0800 +Subject: [PATCH] fence_sbd: Dump more information when crashdump option is + enabled + +When the crashdump option is enabled, the fence_sbd agent will dump: +- the current action +- sbd watchdog timeout +- sbd crashdump timeout +--- + agents/sbd/fence_sbd.py | 41 ++++++++++++++++++++++++++++++++++------- + 1 file changed, 34 insertions(+), 7 deletions(-) + +diff --git a/agents/sbd/fence_sbd.py b/agents/sbd/fence_sbd.py +index 1fc20aa3..80f2db86 100644 +--- a/agents/sbd/fence_sbd.py ++++ b/agents/sbd/fence_sbd.py +@@ -4,6 +4,7 @@ import sys, stat + import logging + import os + import atexit ++import re + sys.path.append("@FENCEAGENTSLIBDIR@") + from fencing import fail_usage, run_commands, fence_action, all_opt + from fencing import atexit_handler, check_input, process_input, show_docs +@@ -147,18 +148,19 @@ def send_sbd_message(conn, options, plug, message): + + return (return_code, out, err) + +-def get_msg_timeout(options): ++def get_sbd_header_timeout(options): + """Reads the configured sbd message timeout from each device. + + Key arguments: + options -- options dictionary + + Return Value: +- msg_timeout (integer, seconds) ++ (msg_timeout, watchdog_timeout) + """ + + # get the defined msg_timeout + msg_timeout = -1 # default sbd msg timeout ++ watchdog_timeout = -1 # default sbd watchdog timeout + + cmd = generate_sbd_command(options, "dump") + +@@ -174,10 +176,26 @@ def get_msg_timeout(options): + logging.warning(\ + "sbd message timeouts differ in different devices") + # we only save the highest timeout +- if tmp_msg_timeout > msg_timeout: +- msg_timeout = tmp_msg_timeout ++ msg_timeout = max(msg_timeout, tmp_msg_timeout) ++ elif "watchdog" in line: ++ tmp_watchdog_timeout = int(line.split(':')[1]) ++ if -1 != watchdog_timeout and tmp_watchdog_timeout != watchdog_timeout: ++ logging.warning(\ ++ "sbd watchdog timeouts differ in different devices") ++ # we only save the highest timeout ++ watchdog_timeout = max(watchdog_timeout, tmp_watchdog_timeout) ++ ++ return msg_timeout, watchdog_timeout + +- return msg_timeout ++def get_crashdump_timeout(): ++ crashdump_timeout = -1 ++ sbd_opts = os.getenv("SBD_OPTS", None) ++ if sbd_opts: ++ # parse '-C N' ++ match = re.search(r'-C\s+(\d+)', sbd_opts) ++ if match: ++ crashdump_timeout = int(match.group(1)) ++ return crashdump_timeout + + def set_power_status(conn, options): + """send status to sbd device (poison pill) +@@ -404,7 +422,6 @@ def sbd_daemon_is_running(): + + return True + +- + def main(): + """Main function + """ +@@ -469,11 +486,21 @@ which can be used in environments where sbd can be used (shared storage)." + # we check against the defined timeouts. If the pacemaker timeout is smaller + # then that defined within sbd we should report this. + power_timeout = int(options["--power-timeout"]) +- sbd_msg_timeout = get_msg_timeout(options) ++ sbd_msg_timeout, sbd_watchdog_timeout = get_sbd_header_timeout(options) + if 0 < power_timeout <= sbd_msg_timeout: + logging.warning("power timeout needs to be \ + greater then sbd message timeout") + ++ action = options.get("--action", None) ++ if "--crashdump" in options and action in ("reboot", "off"): ++ target_node = options.get("--plug", "UNKNOWN") ++ crashdump_timeout = get_crashdump_timeout() ++ logging.warning("crashdump option is enabled while doing action %s on node %s", action, target_node) ++ logging.warning( ++ "sbd watchdog timeout: %d, crashdump timeout(compare to setting on target-node %s): %d", ++ sbd_watchdog_timeout, target_node, crashdump_timeout ++ ) ++ + result = fence_action(\ + None, \ + options, \ +-- +2.25.1 + diff --git a/fence-agents.spec b/fence-agents.spec index 17ab2ddaeef0a218af07f43e7c79f99a93cf341f..13d433fc9af862e8dca3f3263a21e01d8ad4b42a 100644 --- a/fence-agents.spec +++ b/fence-agents.spec @@ -6,7 +6,7 @@ Name: fence-agents Summary: Set of unified programs capable of host isolation ("fencing") Version: 4.16.0 -Release: 6 +Release: 7 License: GPL-2.0-or-later and LGPL-2.0-or-later Group: System Environment/Base URL: https://github.com/ClusterLabs/fence-agents @@ -23,6 +23,8 @@ Patch8: backport-fence_ibm_vpc-refresh-bearer-token-in-connect-if-tok.patch Patch9: backport-fence_sbd-Add-crashdump-option.patch Patch10: backport-fence_sbd-Send-crashdump-msg-when-crashdump-option-i.patch Patch11: backport-build-make-INITCONFDIR-available-for-agents.patch +Patch12: backport-fence_sbd-Dump-more-information-when-crashdump-optio.patch +Patch13: backport-fence_ibm_powervs-fix-plaintext-token-file-support.patch # skipped: pve, raritan, rcd-serial, virsh %global allfenceagents %(cat < - 4.16.0-7 +- fence_sbd: Dump more information when crashdump option isenabled +- fence_ibm_powervs: fix plaintext token file support + * Wed Nov 12 2025 bizhiyuan - 4.16.0-6 - fence_sbd: Send crashdump msg when crashdump option is set inreboot_cycle function - build: make INITCONFDIR available for agents