- fence_kubevirt: report Succeeded and Failed as OFF

Resolves: RHEL-81658
This commit is contained in:
Oyvind Albrigtsen 2026-05-21 12:34:14 +02:00
parent 092e246cf7
commit 90ef034988
2 changed files with 37 additions and 1 deletions

View File

@ -0,0 +1,30 @@
From 083b61cdc849962c665d906c57a98ece3fe9ee0b Mon Sep 17 00:00:00 2001
From: Oyvind Albrigtsen <oalbrigt@redhat.com>
Date: Tue, 12 May 2026 13:37:49 +0200
Subject: [PATCH] fence_kubevirt: report Succeeded and Failed as OFF
With specific settings like RunStrategy: Manual and
failure to start up or manual shutdown from within,
the VMI object may exist while the VM is not running,
and it needs to be correctly parsed to provide the
right VM status.
---
agents/kubevirt/fence_kubevirt.py | 3 +++
1 file changed, 3 insertions(+)
diff --git a/agents/kubevirt/fence_kubevirt.py b/agents/kubevirt/fence_kubevirt.py
index c0b865bb8..d4e65b8cd 100755
--- a/agents/kubevirt/fence_kubevirt.py
+++ b/agents/kubevirt/fence_kubevirt.py
@@ -65,8 +65,11 @@ def get_power_status(conn, options):
fail(EC_STATUS)
def translate_status(instance_status):
+ logging.debug(f"translate_status(): {instance_status}")
if instance_status == "Running":
return "on"
+ elif instance_status in ["Succeeded", "Failed"]:
+ return "off"
return "unknown"
def set_power_status(conn, options):

View File

@ -13,7 +13,7 @@
Name: fence-agents
Summary: Set of unified programs capable of host isolation ("fencing")
Version: 4.16.0
Release: 25%{?alphatag:.%{alphatag}}%{?dist}
Release: 26%{?alphatag:.%{alphatag}}%{?dist}
License: GPL-2.0-or-later AND LGPL-2.0-or-later
URL: https://github.com/ClusterLabs/fence-agents
Source0: https://fedorahosted.org/releases/f/e/fence-agents/%{name}-%{version}.tar.gz
@ -120,6 +120,7 @@ Patch18: RHEL-128925-fence_gce-fix-node-list-limit.patch
Patch19: RHEL-125959-fence_virt-print-errors-to-stderr.patch
Patch20: RHEL-145086-fence_ibm_vpc-fix-missing-statuses.patch
Patch21: RHEL-170614-fence_virtd-fix-discard-const-error-with-GCC-16.patch
Patch22: RHEL-81658-fence_kubevirt-report-Succeeded-and-Failed-as-OFF.patch
%global supportedagents amt_ws apc apc_snmp bladecenter brocade cisco_mds cisco_ucs drac5 eaton_snmp emerson eps hpblade ibmblade ibm_powervs ibm_vpc ifmib ilo ilo_moonshot ilo_mp ilo_ssh intelmodular ipdu ipmilan kdump kubevirt lpar mpath nutanix_ahv redfish rhevm rsa rsb sbd scsi vmware_rest vmware_soap wti
%ifarch x86_64
@ -250,6 +251,7 @@ BuildRequires: %{systemd_units}
%patch -p1 -P 19
%patch -p1 -P 20
%patch -p1 -P 21
%patch -p1 -P 22
# prevent compilation of something that won't get used anyway
sed -i.orig 's|FENCE_ZVM=1|FENCE_ZVM=0|' configure.ac
@ -1222,6 +1224,10 @@ are located on corosync cluster nodes.
%endif
%changelog
* Thu May 21 2026 Oyvind Albrigtsen <oalbrigt@redhat.com> - 4.16.0-26
- fence_kubevirt: report Succeeded and Failed as OFF
Resolves: RHEL-81658
* Mon May 4 2026 Oyvind Albrigtsen <oalbrigt@redhat.com> - 4.16.0-25
- fence_virtd: fix discard-const error with GCC 16
Resolves: RHEL-170614