diff --git a/RHEL-186317-fence_openstack-fix-list-action-to-avoid-timeout-with-large-number-of-VMs.patch b/RHEL-186317-fence_openstack-fix-list-action-to-avoid-timeout-with-large-number-of-VMs.patch new file mode 100644 index 0000000..9526e6c --- /dev/null +++ b/RHEL-186317-fence_openstack-fix-list-action-to-avoid-timeout-with-large-number-of-VMs.patch @@ -0,0 +1,56 @@ +From 101344d675f5c4f4141a01ec60a3265898cea94d Mon Sep 17 00:00:00 2001 +From: Arslan Ahmad +Date: Tue, 16 Jun 2026 21:02:53 +0530 +Subject: [PATCH] fence_openstack: fix list-action to avoid timeout when there + are 100+ VMs on the hypervisor + +Routine `monitor` actions internally translate to a full `list` command. +On large deployments, fetching all VMs from the Nova API creates massive +payloads that cause the agent to timeout. + +Changes in this patch: +* Fetch only 1 VM (`limit=1`) during `monitor` operations to eliminate +API overhead and prevent timeouts. + +Signed-off-by: Arslan Ahmad +--- + agents/openstack/fence_openstack.py | 25 +++++++++++++++++-------- + 1 file changed, 17 insertions(+), 8 deletions(-) + +diff --git a/agents/openstack/fence_openstack.py b/agents/openstack/fence_openstack.py +index 4054e5149..b90d80d6a 100644 +--- a/agents/openstack/fence_openstack.py ++++ b/agents/openstack/fence_openstack.py +@@ -52,15 +52,24 @@ def get_cloud(options): + + + def get_nodes_list(conn, options): +- logging.info("Running %s action", options["--action"]) ++ logging.info("Running %s action", options.get("--original-action", options.get("--action"))) + result = {} +- response = conn.servers.list(detailed=True) +- if response is not None: +- for item in response: +- instance_id = item.id +- instance_name = item.name +- instance_status = item.status +- result[instance_id] = (instance_name, translate_status(instance_status)) ++ search_opts = {} ++ max_results = 1 if options.get("--original-action") == "monitor" else None ++ ++ if "--plug" in options: ++ search_opts["uuid"] = options["--plug"] ++ ++ try: ++ response = conn.servers.list(detailed=True, search_opts=search_opts, limit=max_results) ++ if response is not None: ++ for item in response: ++ instance_id = item.id ++ instance_name = item.name ++ instance_status = item.status ++ result[instance_id] = (instance_name, translate_status(instance_status)) ++ except Exception as e: ++ logging.error("Failed to retrieve node list: %s", e) + return result + + diff --git a/fence-agents.spec b/fence-agents.spec index c87cad6..fe96ea5 100644 --- a/fence-agents.spec +++ b/fence-agents.spec @@ -87,7 +87,7 @@ Name: fence-agents Summary: Set of unified programs capable of host isolation ("fencing") Version: 4.2.1 -Release: 129%{?alphatag:.%{alphatag}}%{?dist}.25 +Release: 129%{?alphatag:.%{alphatag}}%{?dist}.26 License: GPLv2+ and LGPLv2+ Group: System Environment/Base URL: https://github.com/ClusterLabs/fence-agents @@ -323,6 +323,7 @@ Patch150: RHEL-96179-fence_kubevirt-force-off.patch Patch151: RHEL-110964-1-fence_nutanix_ahv.patch Patch152: RHEL-110964-2-fence_nutanix_ahv-update-metadata.patch Patch153: RHEL-145087-fence_ibm_vpc-fix-missing-statuses.patch +Patch154: RHEL-186317-fence_openstack-fix-list-action-to-avoid-timeout-with-large-number-of-VMs.patch ### HA support libs/utils ### # all archs @@ -576,6 +577,7 @@ BuildRequires: python3-google-api-client python3-pip python3-wheel python3-jinja %patch -p1 -P 151 %patch -p1 -P 152 %patch -p1 -P 153 +%patch -p1 -P 154 # prevent compilation of something that won't get used anyway sed -i.orig 's|FENCE_ZVM=1|FENCE_ZVM=0|' configure.ac @@ -1648,6 +1650,11 @@ Fence agent for IBM z/VM over IP. %endif %changelog +* Fri Jun 19 2026 Arslan Ahmad - 4.2.1-129.26 +- fence_openstack: fix list-action to avoid timeout when + there are 100+ VMs on the hypervisor + Resolves: RHEL-186317 + * Mon Apr 27 2026 Oyvind Albrigtsen - 4.2.1-129.25 - bundled cryptography: replace with dependency to fix CVE-2026-26007 - bundled PyJWT: replace with dependency to fix CVE-2026-32597