- fence_openstack: fix list-action to avoid timeout when
there are 100+ VMs on the hypervisor Resolves: RHEL-154985
This commit is contained in:
parent
3639ee4ce3
commit
7dbf04cad2
@ -0,0 +1,56 @@
|
||||
From 101344d675f5c4f4141a01ec60a3265898cea94d Mon Sep 17 00:00:00 2001
|
||||
From: Arslan Ahmad <arslan.ahmad97@googlemail.com>
|
||||
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 <arslan.ahmad97@googlemail.com>
|
||||
---
|
||||
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
|
||||
|
||||
|
||||
@ -47,7 +47,7 @@
|
||||
Name: fence-agents
|
||||
Summary: Set of unified programs capable of host isolation ("fencing")
|
||||
Version: 4.10.0
|
||||
Release: 115%{?alphatag:.%{alphatag}}%{?dist}
|
||||
Release: 116%{?alphatag:.%{alphatag}}%{?dist}
|
||||
License: GPLv2+ and LGPLv2+
|
||||
URL: https://github.com/ClusterLabs/fence-agents
|
||||
Source0: https://fedorahosted.org/releases/f/e/fence-agents/%{name}-%{version}.tar.gz
|
||||
@ -220,6 +220,7 @@ Patch75: RHEL-128926-2-fence_gce-fix-node-list-limit.patch
|
||||
Patch76: RHEL-145088-fence_ibm_vpc-fix-missing-statuses.patch
|
||||
Patch77: RHEL-146216-fence_kubevirt-report-Succeeded-and-Failed-as-OFF.patch
|
||||
Patch78: RHEL-183892-fence_ibm_vpc-set-proxy-when-token-is-expired-as-well.patch
|
||||
Patch79: RHEL-154985-fence_openstack-fix-list-action-to-avoid-timeout-with-large-number-of-VMs.patch
|
||||
|
||||
### HA support libs/utils ###
|
||||
# all archs
|
||||
@ -422,6 +423,7 @@ BuildRequires: %{systemd_units}
|
||||
%patch -p1 -P 76
|
||||
%patch -p1 -P 77
|
||||
%patch -p1 -P 78
|
||||
%patch -p1 -P 79
|
||||
|
||||
# prevent compilation of something that won't get used anyway
|
||||
sed -i.orig 's|FENCE_ZVM=1|FENCE_ZVM=0|' configure.ac
|
||||
@ -1520,6 +1522,11 @@ are located on corosync cluster nodes.
|
||||
%endif
|
||||
|
||||
%changelog
|
||||
* Wed Jun 17 2026 Arslan Ahmad <arahmad@redhat.com> - 4.10.0-116
|
||||
- fence_openstack: fix list-action to avoid timeout when
|
||||
there are 100+ VMs on the hypervisor
|
||||
Resolves: RHEL-154985
|
||||
|
||||
* Mon Jun 15 2026 Oyvind Albrigtsen <oalbrigt@redhat.com> - 4.10.0-115
|
||||
- fence_ibm_vpc: set proxy when token has expired as well
|
||||
Resolves: RHEL-183892
|
||||
|
||||
Loading…
Reference in New Issue
Block a user