import fence-agents-4.2.1-81.el8
This commit is contained in:
parent
0a64f9c765
commit
c82e7f897a
@ -1,7 +1,35 @@
|
|||||||
|
3297473a9d57e93ff378eab173990c1b64673c01 SOURCES/Jinja2-3.0.2.tar.gz
|
||||||
|
e1b766b2b1601fde67b3b19ed2f13b9746bb1cca SOURCES/MarkupSafe-2.0.1.tar.gz
|
||||||
|
a8c40a3ae9d4c159382a58db3153d83e5521c51e SOURCES/PyYAML-6.0.tar.gz
|
||||||
0a56f6d9ed2014a363486d33b63eca094379be06 SOURCES/aliyun-python-sdk-core-2.13.1.tar.gz
|
0a56f6d9ed2014a363486d33b63eca094379be06 SOURCES/aliyun-python-sdk-core-2.13.1.tar.gz
|
||||||
c2a98b9a1562d223a76514f05028488ca000c395 SOURCES/aliyun-python-sdk-ecs-4.9.3.tar.gz
|
c2a98b9a1562d223a76514f05028488ca000c395 SOURCES/aliyun-python-sdk-ecs-4.9.3.tar.gz
|
||||||
f14647a4d37a9a254c4e711b95a7654fc418e41e SOURCES/aliyun-python-sdk-vpc-3.0.2.tar.gz
|
f14647a4d37a9a254c4e711b95a7654fc418e41e SOURCES/aliyun-python-sdk-vpc-3.0.2.tar.gz
|
||||||
|
0d12f48faa727f0979e9ad5c4c80dfa32b73caff SOURCES/cachetools-4.2.4.tar.gz
|
||||||
|
b13e22d55867e2ca5f92e5289cfdc21ba6e343aa SOURCES/certifi-2021.10.8.tar.gz
|
||||||
|
865df92e66e5dc7b940144cbad8115c07dc8784f SOURCES/charset-normalizer-2.0.7.tar.gz
|
||||||
e2561df8e7ff9113dab118a651371dd88dab0142 SOURCES/fence-agents-4.2.1.tar.gz
|
e2561df8e7ff9113dab118a651371dd88dab0142 SOURCES/fence-agents-4.2.1.tar.gz
|
||||||
|
f4e578dc0ed68d6667d7b36cdfc2647d55e9858f SOURCES/google-auth-2.3.0.tar.gz
|
||||||
74ec77d2e2ef6b2ef8503e6e398faa6f3ba298ae SOURCES/httplib2-0.19.1-py3-none-any.whl
|
74ec77d2e2ef6b2ef8503e6e398faa6f3ba298ae SOURCES/httplib2-0.19.1-py3-none-any.whl
|
||||||
|
08c0449533fc94462f78652dea209099754d9ee4 SOURCES/idna-3.3.tar.gz
|
||||||
|
d06a9547b1a87e9c51b0a7c708189d993f2e3d89 SOURCES/kubernetes-12.0.1.tar.gz
|
||||||
|
f6efa66f6106b069b5c0e0cf8cc677e4e96c91ca SOURCES/oauthlib-3.1.1.tar.gz
|
||||||
|
570d69d8c108ebb8aee562389d13b07dfb61ce25 SOURCES/openshift-0.12.1.tar.gz
|
||||||
|
6ba3b8ff3ee43d1d4c0b658241f4fd6036ee7c78 SOURCES/packaging-21.0.tar.gz
|
||||||
|
e0fa19f8fda46a1fa2253477499b116b33f67175 SOURCES/pyasn1-0.4.8.tar.gz
|
||||||
|
43b89feb6864fe359aae89120627165219de313b SOURCES/pyasn1-modules-0.2.8.tar.gz
|
||||||
326a73f58a62ebee00c11a12cfdd838b196e0e8e SOURCES/pycryptodome-3.6.4.tar.gz
|
326a73f58a62ebee00c11a12cfdd838b196e0e8e SOURCES/pycryptodome-3.6.4.tar.gz
|
||||||
c8307f47e3b75a2d02af72982a2dfefa3f56e407 SOURCES/pyparsing-2.4.7-py2.py3-none-any.whl
|
c8307f47e3b75a2d02af72982a2dfefa3f56e407 SOURCES/pyparsing-2.4.7-py2.py3-none-any.whl
|
||||||
|
6082312a090f5be5e796e0854294da0738ec0379 SOURCES/pyparsing-3.0.1.tar.gz
|
||||||
|
c2ba10c775b7a52a4b57cac4d4110a0c0f812a82 SOURCES/python-dateutil-2.8.2.tar.gz
|
||||||
|
1dc2fa004aa6517f1620e55d8a7b8e68a9cf2a47 SOURCES/python-string-utils-1.0.0.tar.gz
|
||||||
|
8c7a89d183d3e9b70bf91ba5b75eccf7111b9d8d SOURCES/requests-2.26.0.tar.gz
|
||||||
|
f139aed770519b6a095b8fdc888d03955cbe9d8e SOURCES/requests-oauthlib-1.3.0.tar.gz
|
||||||
|
e8a53067e03fe1b6682fd99a40a7359396a06daa SOURCES/rsa-4.7.2.tar.gz
|
||||||
|
d1011ff44cd5a045de0460c1b79ec65592e86860 SOURCES/ruamel.yaml-0.17.16.tar.gz
|
||||||
|
27de97227bbbde5a9f571f9fad223578d7bdf7cc SOURCES/ruamel.yaml.clib-0.2.6.tar.gz
|
||||||
|
d5354718cb8c9330d3abc27445467ce8a5ed9d70 SOURCES/setuptools-58.3.0.tar.gz
|
||||||
|
a4f02fddae697614e356cadfddb6241cc7737f38 SOURCES/setuptools_scm-6.3.2.tar.gz
|
||||||
|
06fa0bb50f2a4e2917fd14c21e9d2d5508ce0163 SOURCES/six-1.16.0.tar.gz
|
||||||
|
b42b7960047441db7dc021cc20e14279bd836f8d SOURCES/tomli-1.0.1.tar.gz
|
||||||
|
eb35c3fd8b0867ae988a15917d6b80e8bdf60222 SOURCES/urllib3-1.26.7.tar.gz
|
||||||
|
540f083782c584989c1a0f69ffd69ba7aae07db6 SOURCES/websocket-client-1.2.1.tar.gz
|
||||||
|
28
.gitignore
vendored
28
.gitignore
vendored
@ -1,7 +1,35 @@
|
|||||||
|
SOURCES/Jinja2-3.0.2.tar.gz
|
||||||
|
SOURCES/MarkupSafe-2.0.1.tar.gz
|
||||||
|
SOURCES/PyYAML-6.0.tar.gz
|
||||||
SOURCES/aliyun-python-sdk-core-2.13.1.tar.gz
|
SOURCES/aliyun-python-sdk-core-2.13.1.tar.gz
|
||||||
SOURCES/aliyun-python-sdk-ecs-4.9.3.tar.gz
|
SOURCES/aliyun-python-sdk-ecs-4.9.3.tar.gz
|
||||||
SOURCES/aliyun-python-sdk-vpc-3.0.2.tar.gz
|
SOURCES/aliyun-python-sdk-vpc-3.0.2.tar.gz
|
||||||
|
SOURCES/cachetools-4.2.4.tar.gz
|
||||||
|
SOURCES/certifi-2021.10.8.tar.gz
|
||||||
|
SOURCES/charset-normalizer-2.0.7.tar.gz
|
||||||
SOURCES/fence-agents-4.2.1.tar.gz
|
SOURCES/fence-agents-4.2.1.tar.gz
|
||||||
|
SOURCES/google-auth-2.3.0.tar.gz
|
||||||
SOURCES/httplib2-0.19.1-py3-none-any.whl
|
SOURCES/httplib2-0.19.1-py3-none-any.whl
|
||||||
|
SOURCES/idna-3.3.tar.gz
|
||||||
|
SOURCES/kubernetes-12.0.1.tar.gz
|
||||||
|
SOURCES/oauthlib-3.1.1.tar.gz
|
||||||
|
SOURCES/openshift-0.12.1.tar.gz
|
||||||
|
SOURCES/packaging-21.0.tar.gz
|
||||||
|
SOURCES/pyasn1-0.4.8.tar.gz
|
||||||
|
SOURCES/pyasn1-modules-0.2.8.tar.gz
|
||||||
SOURCES/pycryptodome-3.6.4.tar.gz
|
SOURCES/pycryptodome-3.6.4.tar.gz
|
||||||
SOURCES/pyparsing-2.4.7-py2.py3-none-any.whl
|
SOURCES/pyparsing-2.4.7-py2.py3-none-any.whl
|
||||||
|
SOURCES/pyparsing-3.0.1.tar.gz
|
||||||
|
SOURCES/python-dateutil-2.8.2.tar.gz
|
||||||
|
SOURCES/python-string-utils-1.0.0.tar.gz
|
||||||
|
SOURCES/requests-2.26.0.tar.gz
|
||||||
|
SOURCES/requests-oauthlib-1.3.0.tar.gz
|
||||||
|
SOURCES/rsa-4.7.2.tar.gz
|
||||||
|
SOURCES/ruamel.yaml-0.17.16.tar.gz
|
||||||
|
SOURCES/ruamel.yaml.clib-0.2.6.tar.gz
|
||||||
|
SOURCES/setuptools-58.3.0.tar.gz
|
||||||
|
SOURCES/setuptools_scm-6.3.2.tar.gz
|
||||||
|
SOURCES/six-1.16.0.tar.gz
|
||||||
|
SOURCES/tomli-1.0.1.tar.gz
|
||||||
|
SOURCES/urllib3-1.26.7.tar.gz
|
||||||
|
SOURCES/websocket-client-1.2.1.tar.gz
|
||||||
|
@ -0,0 +1,23 @@
|
|||||||
|
From b220f963934f69044a39109fa065a95cd0972183 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Hideo Yamauchi <renayama19661014@ybb.ne.jp>
|
||||||
|
Date: Fri, 2 Jul 2021 09:09:49 +0900
|
||||||
|
Subject: [PATCH] Mid: fence_sbd: A warning message is output when
|
||||||
|
disable-timeout is enabled.
|
||||||
|
|
||||||
|
---
|
||||||
|
agents/sbd/fence_sbd.py | 2 +-
|
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/agents/sbd/fence_sbd.py b/agents/sbd/fence_sbd.py
|
||||||
|
index 3ae8df6e3..0c876b16e 100644
|
||||||
|
--- a/agents/sbd/fence_sbd.py
|
||||||
|
+++ b/agents/sbd/fence_sbd.py
|
||||||
|
@@ -398,7 +398,7 @@ def main():
|
||||||
|
# then that defined within sbd we should report this.
|
||||||
|
power_timeout = int(options["--power-timeout"])
|
||||||
|
sbd_msg_timeout = get_msg_timeout(options)
|
||||||
|
- if power_timeout <= sbd_msg_timeout:
|
||||||
|
+ if 0 < power_timeout <= sbd_msg_timeout:
|
||||||
|
logging.warn("power timeout needs to be \
|
||||||
|
greater then sbd message timeout")
|
||||||
|
|
22
SOURCES/bz1977588-1-fencing-add-EC_FETCH_VM_UUID.patch
Normal file
22
SOURCES/bz1977588-1-fencing-add-EC_FETCH_VM_UUID.patch
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
diff --color -uNr a/lib/fencing.py.py b/lib/fencing.py.py
|
||||||
|
--- a/lib/fencing.py.py 2021-11-01 10:14:04.045398051 +0100
|
||||||
|
+++ b/lib/fencing.py.py 2021-11-01 10:24:47.111235305 +0100
|
||||||
|
@@ -29,6 +29,7 @@
|
||||||
|
EC_STATUS_HMC = 9
|
||||||
|
EC_PASSWORD_MISSING = 10
|
||||||
|
EC_INVALID_PRIVILEGES = 11
|
||||||
|
+EC_FETCH_VM_UUID = 12
|
||||||
|
|
||||||
|
LOG_FORMAT = "%(asctime)-15s %(levelname)s: %(message)s"
|
||||||
|
|
||||||
|
@@ -574,7 +575,9 @@
|
||||||
|
EC_STATUS_HMC : "Failed: Either unable to obtain correct plug status, "
|
||||||
|
"partition is not available or incorrect HMC version used",
|
||||||
|
EC_PASSWORD_MISSING : "Failed: You have to set login password",
|
||||||
|
- EC_INVALID_PRIVILEGES : "Failed: The user does not have the correct privileges to do the requested action."
|
||||||
|
+ EC_INVALID_PRIVILEGES : "Failed: The user does not have the correct privileges to do the requested action.",
|
||||||
|
+ EC_FETCH_VM_UUID : "Failed: Can not find VM UUID by its VM name given in the <plug> parameter."
|
||||||
|
+
|
||||||
|
}[error_code] + "\n"
|
||||||
|
logging.error("%s\n", message)
|
||||||
|
if stop:
|
144
SOURCES/bz1977588-2-fence_kubevirt.patch
Normal file
144
SOURCES/bz1977588-2-fence_kubevirt.patch
Normal file
@ -0,0 +1,144 @@
|
|||||||
|
diff --color -uNr a/agents/kubevirt/fence_kubevirt.py b/agents/kubevirt/fence_kubevirt.py
|
||||||
|
--- a/agents/kubevirt/fence_kubevirt.py 1970-01-01 01:00:00.000000000 +0100
|
||||||
|
+++ b/agents/kubevirt/fence_kubevirt.py 2021-10-25 13:25:59.904501348 +0200
|
||||||
|
@@ -0,0 +1,140 @@
|
||||||
|
+#!@PYTHON@ -tt
|
||||||
|
+
|
||||||
|
+import sys
|
||||||
|
+import logging
|
||||||
|
+sys.path.append("@FENCEAGENTSLIBDIR@")
|
||||||
|
+from fencing import *
|
||||||
|
+from fencing import fail, fail_usage, run_delay, EC_STATUS
|
||||||
|
+
|
||||||
|
+try:
|
||||||
|
+ sys.path.insert(0, '/usr/lib/fence-agents/bundled/kubevirt')
|
||||||
|
+ from kubernetes.client.exceptions import ApiException
|
||||||
|
+except ImportError:
|
||||||
|
+ logging.error("Couldn\'t import kubernetes.client.exceptions.ApiException - not found or not accessible")
|
||||||
|
+
|
||||||
|
+def get_nodes_list(conn, options):
|
||||||
|
+ logging.debug("Starting list/monitor operation")
|
||||||
|
+ result = {}
|
||||||
|
+ try:
|
||||||
|
+ apiversion = options.get("--apiversion")
|
||||||
|
+ namespace = options.get("--namespace")
|
||||||
|
+ include_uninitialized = True
|
||||||
|
+ vm_api = conn.resources.get(api_version=apiversion, kind='VirtualMachine')
|
||||||
|
+ vm_list = vm_api.get(namespace=namespace)
|
||||||
|
+ for vm in vm_list.items:
|
||||||
|
+ result[vm.metadata.name] = ("", None)
|
||||||
|
+ except Exception as e:
|
||||||
|
+ logging.error("Exception when calling VirtualMachine list: %s", e)
|
||||||
|
+ return result
|
||||||
|
+
|
||||||
|
+def get_power_status(conn, options):
|
||||||
|
+ logging.debug("Starting get status operation")
|
||||||
|
+ try:
|
||||||
|
+ apiversion = options.get("--apiversion")
|
||||||
|
+ namespace = options.get("--namespace")
|
||||||
|
+ name = options.get("--plug")
|
||||||
|
+ vmi_api = conn.resources.get(api_version=apiversion,
|
||||||
|
+ kind='VirtualMachineInstance')
|
||||||
|
+ vmi = vmi_api.get(name=name, namespace=namespace)
|
||||||
|
+ if vmi is not None:
|
||||||
|
+ phase = vmi.status.phase
|
||||||
|
+ if phase == "Running":
|
||||||
|
+ return "on"
|
||||||
|
+ return "off"
|
||||||
|
+ except ApiException as e:
|
||||||
|
+ if e.status == 404:
|
||||||
|
+ return "off"
|
||||||
|
+ logging.error("Failed to get power status, with API Exception: %s", e)
|
||||||
|
+ fail(EC_STATUS)
|
||||||
|
+ except Exception as e:
|
||||||
|
+ logging.error("Failed to get power status, with Exception: %s", e)
|
||||||
|
+ fail(EC_STATUS)
|
||||||
|
+
|
||||||
|
+def set_power_status(conn, options):
|
||||||
|
+ logging.debug("Starting set status operation")
|
||||||
|
+ try:
|
||||||
|
+ apiversion= options.get("--apiversion")
|
||||||
|
+ namespace = options.get("--namespace")
|
||||||
|
+ name = options.get("--plug")
|
||||||
|
+ action = 'start' if options["--action"] == "on" else 'stop'
|
||||||
|
+ virtctl_vm_action(conn, action, namespace, name, apiversion)
|
||||||
|
+ except Exception as e:
|
||||||
|
+ logging.error("Failed to set power status, with Exception: %s", e)
|
||||||
|
+ fail(EC_STATUS)
|
||||||
|
+
|
||||||
|
+def define_new_opts():
|
||||||
|
+ all_opt["namespace"] = {
|
||||||
|
+ "getopt" : ":",
|
||||||
|
+ "longopt" : "namespace",
|
||||||
|
+ "help" : "--namespace=[namespace] Namespace of the KubeVirt machine",
|
||||||
|
+ "shortdesc" : "Namespace of the KubeVirt machine.",
|
||||||
|
+ "required" : "1",
|
||||||
|
+ "order" : 2
|
||||||
|
+ }
|
||||||
|
+ all_opt["kubeconfig"] = {
|
||||||
|
+ "getopt" : ":",
|
||||||
|
+ "longopt" : "kubeconfig",
|
||||||
|
+ "help" : "--kubeconfig=[kubeconfig] Kubeconfig file path",
|
||||||
|
+ "shortdesc": "Kubeconfig file path",
|
||||||
|
+ "required": "0",
|
||||||
|
+ "order": 4
|
||||||
|
+ }
|
||||||
|
+ all_opt["apiversion"] = {
|
||||||
|
+ "getopt" : ":",
|
||||||
|
+ "longopt" : "apiversion",
|
||||||
|
+ "help" : "--apiversion=[apiversion] Version of the KubeVirt API",
|
||||||
|
+ "shortdesc" : "Version of the KubeVirt API.",
|
||||||
|
+ "required" : "0",
|
||||||
|
+ "default" : "kubevirt.io/v1",
|
||||||
|
+ "order" : 5
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+def virtctl_vm_action(conn, action, namespace, name, apiversion):
|
||||||
|
+ path = '/apis/subresources.{api_version}/namespaces/{namespace}/virtualmachines/{name}/{action}'
|
||||||
|
+ path = path.format(api_version=apiversion, namespace=namespace, name=name, action=action)
|
||||||
|
+ return conn.request('put', path, header_params={'accept': '*/*'})
|
||||||
|
+
|
||||||
|
+def validate_options(required_options_list, options):
|
||||||
|
+ for required_option in required_options_list:
|
||||||
|
+ if required_option not in options:
|
||||||
|
+ fail_usage("Failed: %s option must be provided" % required_option)
|
||||||
|
+
|
||||||
|
+# Main agent method
|
||||||
|
+def main():
|
||||||
|
+ conn = None
|
||||||
|
+
|
||||||
|
+ device_opt = ["port", "namespace", "kubeconfig", "ssl_insecure", "no_password", "apiversion"]
|
||||||
|
+ define_new_opts()
|
||||||
|
+ options = check_input(device_opt, process_input(device_opt))
|
||||||
|
+
|
||||||
|
+ docs = {}
|
||||||
|
+ docs["shortdesc"] = "Fence agent for KubeVirt"
|
||||||
|
+ docs["longdesc"] = "fence_kubevirt is an I/O Fencing agent for KubeVirt."
|
||||||
|
+ docs["vendorurl"] = "https://kubevirt.io/"
|
||||||
|
+ show_docs(options, docs)
|
||||||
|
+
|
||||||
|
+ run_delay(options)
|
||||||
|
+
|
||||||
|
+ validate_options(['--namespace'], options)
|
||||||
|
+
|
||||||
|
+ # Disable insecure-certificate-warning message
|
||||||
|
+ if "--ssl-insecure" in options:
|
||||||
|
+ import urllib3
|
||||||
|
+ urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
|
||||||
|
+
|
||||||
|
+ try:
|
||||||
|
+ from kubernetes import config
|
||||||
|
+ from openshift.dynamic import DynamicClient
|
||||||
|
+ kubeconfig = options.get('--kubeconfig')
|
||||||
|
+ k8s_client = config.new_client_from_config(config_file=kubeconfig)
|
||||||
|
+ conn = DynamicClient(k8s_client)
|
||||||
|
+ except ImportError:
|
||||||
|
+ logging.error("Couldn\'t import kubernetes.config or "
|
||||||
|
+ "openshift.dynamic.DynamicClient - not found or not accessible")
|
||||||
|
+
|
||||||
|
+ # Operate the fencing device
|
||||||
|
+ result = fence_action(conn, options, set_power_status, get_power_status, get_nodes_list)
|
||||||
|
+ sys.exit(result)
|
||||||
|
+
|
||||||
|
+if __name__ == "__main__":
|
||||||
|
+ main()
|
55
SOURCES/bz1977588-3-fence_kubevirt-fix-status.patch
Normal file
55
SOURCES/bz1977588-3-fence_kubevirt-fix-status.patch
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
From c23bfc3b9fc6e1dc7b1350e340171f3827fb6fb7 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Nir Argaman <nargaman@redhat.com>
|
||||||
|
Date: Mon, 1 Nov 2021 08:34:00 +0200
|
||||||
|
Subject: [PATCH] fence_kubevirt: Fix kubevirt VM status
|
||||||
|
|
||||||
|
---
|
||||||
|
agents/kubevirt/fence_kubevirt.py | 19 +++++++++++++------
|
||||||
|
1 file changed, 13 insertions(+), 6 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/agents/kubevirt/fence_kubevirt.py b/agents/kubevirt/fence_kubevirt.py
|
||||||
|
index 70c14d89a..61ffcaa09 100755
|
||||||
|
--- a/agents/kubevirt/fence_kubevirt.py
|
||||||
|
+++ b/agents/kubevirt/fence_kubevirt.py
|
||||||
|
@@ -4,7 +4,7 @@
|
||||||
|
import logging
|
||||||
|
sys.path.append("@FENCEAGENTSLIBDIR@")
|
||||||
|
from fencing import *
|
||||||
|
-from fencing import fail, fail_usage, run_delay, EC_STATUS
|
||||||
|
+from fencing import fail, fail_usage, run_delay, EC_STATUS, EC_FETCH_VM_UUID
|
||||||
|
|
||||||
|
try:
|
||||||
|
from kubernetes.client.exceptions import ApiException
|
||||||
|
@@ -35,13 +35,15 @@ def get_power_status(conn, options):
|
||||||
|
vmi_api = conn.resources.get(api_version=apiversion,
|
||||||
|
kind='VirtualMachineInstance')
|
||||||
|
vmi = vmi_api.get(name=name, namespace=namespace)
|
||||||
|
- if vmi is not None:
|
||||||
|
- phase = vmi.status.phase
|
||||||
|
- if phase == "Running":
|
||||||
|
- return "on"
|
||||||
|
- return "off"
|
||||||
|
+ return translate_status(vmi.status.phase)
|
||||||
|
except ApiException as e:
|
||||||
|
if e.status == 404:
|
||||||
|
+ try:
|
||||||
|
+ vm_api = conn.resources.get(api_version=apiversion, kind='VirtualMachine')
|
||||||
|
+ vm = vm_api.get(name=name, namespace=namespace)
|
||||||
|
+ except ApiException as e:
|
||||||
|
+ logging.error("VM %s doesn't exist", name)
|
||||||
|
+ fail(EC_FETCH_VM_UUID)
|
||||||
|
return "off"
|
||||||
|
logging.error("Failed to get power status, with API Exception: %s", e)
|
||||||
|
fail(EC_STATUS)
|
||||||
|
@@ -49,6 +51,11 @@ def get_power_status(conn, options):
|
||||||
|
logging.error("Failed to get power status, with Exception: %s", e)
|
||||||
|
fail(EC_STATUS)
|
||||||
|
|
||||||
|
+def translate_status(instance_status):
|
||||||
|
+ if instance_status == "Running":
|
||||||
|
+ return "on"
|
||||||
|
+ return "unknown"
|
||||||
|
+
|
||||||
|
def set_power_status(conn, options):
|
||||||
|
logging.debug("Starting set status operation")
|
||||||
|
try:
|
35
SOURCES/bz1977588-4-fence_kubevirt-power-timeout-40s.patch
Normal file
35
SOURCES/bz1977588-4-fence_kubevirt-power-timeout-40s.patch
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
From a3d8ce78ed5687954847560f77daafe6474de33f Mon Sep 17 00:00:00 2001
|
||||||
|
From: Oyvind Albrigtsen <oalbrigt@redhat.com>
|
||||||
|
Date: Tue, 2 Nov 2021 09:44:33 +0100
|
||||||
|
Subject: [PATCH] fence_kubevirt: set default power-timeout to 40s
|
||||||
|
|
||||||
|
---
|
||||||
|
agents/kubevirt/fence_kubevirt.py | 6 ++++++
|
||||||
|
tests/data/metadata/fence_kubevirt.xml | 2 +-
|
||||||
|
2 files changed, 7 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/agents/kubevirt/fence_kubevirt.py b/agents/kubevirt/fence_kubevirt.py
|
||||||
|
index 61ffcaa09..8392b75a0 100755
|
||||||
|
--- a/agents/kubevirt/fence_kubevirt.py
|
||||||
|
+++ b/agents/kubevirt/fence_kubevirt.py
|
||||||
|
@@ -2,6 +2,7 @@
|
||||||
|
|
||||||
|
import sys
|
||||||
|
import logging
|
||||||
|
+import atexit
|
||||||
|
sys.path.append("@FENCEAGENTSLIBDIR@")
|
||||||
|
from fencing import *
|
||||||
|
from fencing import fail, fail_usage, run_delay, EC_STATUS, EC_FETCH_VM_UUID
|
||||||
|
@@ -110,7 +111,12 @@ def main():
|
||||||
|
conn = None
|
||||||
|
|
||||||
|
device_opt = ["port", "namespace", "kubeconfig", "ssl_insecure", "no_password", "apiversion"]
|
||||||
|
+
|
||||||
|
+ atexit.register(atexit_handler)
|
||||||
|
define_new_opts()
|
||||||
|
+
|
||||||
|
+ all_opt["power_timeout"]["default"] = "40"
|
||||||
|
+
|
||||||
|
options = check_input(device_opt, process_input(device_opt))
|
||||||
|
|
||||||
|
docs = {}
|
@ -28,11 +28,58 @@
|
|||||||
# google cloud
|
# google cloud
|
||||||
%global httplib2 httplib2
|
%global httplib2 httplib2
|
||||||
%global httplib2_version 0.19.1
|
%global httplib2_version 0.19.1
|
||||||
|
# kubevirt
|
||||||
|
%global openshift openshift
|
||||||
|
%global openshift_version 0.12.1
|
||||||
|
%global ruamelyamlclib ruamel.yaml.clib
|
||||||
|
%global ruamelyamlclib_version 0.2.6
|
||||||
|
%global kubernetes kubernetes
|
||||||
|
%global kubernetes_version 12.0.1
|
||||||
|
%global certifi certifi
|
||||||
|
%global certifi_version 2021.10.8
|
||||||
|
%global googleauth google-auth
|
||||||
|
%global googleauth_version 2.3.0
|
||||||
|
%global cachetools cachetools
|
||||||
|
%global cachetools_version 4.2.4
|
||||||
|
%global pyasn1modules pyasn1-modules
|
||||||
|
%global pyasn1modules_version 0.2.8
|
||||||
|
%global pyasn1 pyasn1
|
||||||
|
%global pyasn1_version 0.4.8
|
||||||
|
%global dateutil dateutil
|
||||||
|
%global dateutil_version 2.8.2
|
||||||
|
%global pyyaml PyYAML
|
||||||
|
%global pyyaml_version 6.0
|
||||||
|
%global six six
|
||||||
|
%global six_version 1.16.0
|
||||||
|
%global urllib3 urllib3
|
||||||
|
%global urllib3_version 1.26.7
|
||||||
|
%global websocketclient websocket-client
|
||||||
|
%global websocketclient_version 1.2.1
|
||||||
|
%global jinja2 Jinja2
|
||||||
|
%global jinja2_version 3.0.2
|
||||||
|
%global markupsafe MarkupSafe
|
||||||
|
%global markupsafe_version 2.0.1
|
||||||
|
%global stringutils string-utils
|
||||||
|
%global stringutils_version 1.0.0
|
||||||
|
%global requests requests
|
||||||
|
%global requests_version 2.26.0
|
||||||
|
%global chrstnormalizer charset-normalizer
|
||||||
|
%global chrstnormalizer_version 2.0.7
|
||||||
|
%global idna idna
|
||||||
|
%global idna_version 3.3
|
||||||
|
%global reqstsoauthlib requests-oauthlib
|
||||||
|
%global reqstsoauthlib_version 1.3.0
|
||||||
|
%global oauthlib oauthlib
|
||||||
|
%global oauthlib_version 3.1.1
|
||||||
|
%global ruamelyaml ruamel.yaml
|
||||||
|
%global ruamelyaml_version 0.17.16
|
||||||
|
%global setuptools setuptools
|
||||||
|
%global setuptools_version 58.3.0
|
||||||
|
|
||||||
Name: fence-agents
|
Name: fence-agents
|
||||||
Summary: Set of unified programs capable of host isolation ("fencing")
|
Summary: Set of unified programs capable of host isolation ("fencing")
|
||||||
Version: 4.2.1
|
Version: 4.2.1
|
||||||
Release: 79%{?alphatag:.%{alphatag}}%{?dist}
|
Release: 81%{?alphatag:.%{alphatag}}%{?dist}
|
||||||
License: GPLv2+ and LGPLv2+
|
License: GPLv2+ and LGPLv2+
|
||||||
Group: System Environment/Base
|
Group: System Environment/Base
|
||||||
URL: https://github.com/ClusterLabs/fence-agents
|
URL: https://github.com/ClusterLabs/fence-agents
|
||||||
@ -45,6 +92,42 @@ Source4: %{aliyunsdkvpc}-%{aliyunsdkvpc_version}.tar.gz
|
|||||||
# google cloud
|
# google cloud
|
||||||
Source5: %{httplib2}-%{httplib2_version}-py3-none-any.whl
|
Source5: %{httplib2}-%{httplib2_version}-py3-none-any.whl
|
||||||
Source6: pyparsing-2.4.7-py2.py3-none-any.whl
|
Source6: pyparsing-2.4.7-py2.py3-none-any.whl
|
||||||
|
# kubevirt
|
||||||
|
## pip download --no-binary :all: openshift "ruamel.yaml.clib>=0.1.2"
|
||||||
|
### BEGIN
|
||||||
|
Source7: %{openshift}-%{openshift_version}.tar.gz
|
||||||
|
Source8: %{ruamelyamlclib}-%{ruamelyamlclib_version}.tar.gz
|
||||||
|
Source9: %{kubernetes}-%{kubernetes_version}.tar.gz
|
||||||
|
Source10: %{certifi}-%{certifi_version}.tar.gz
|
||||||
|
Source11: %{googleauth}-%{googleauth_version}.tar.gz
|
||||||
|
Source12: %{cachetools}-%{cachetools_version}.tar.gz
|
||||||
|
Source13: %{pyasn1modules}-%{pyasn1modules_version}.tar.gz
|
||||||
|
Source14: %{pyasn1}-%{pyasn1_version}.tar.gz
|
||||||
|
Source15: python-%{dateutil}-%{dateutil_version}.tar.gz
|
||||||
|
Source16: %{pyyaml}-%{pyyaml_version}.tar.gz
|
||||||
|
## rsa is dependency for "pip install",
|
||||||
|
## but gets removed to use cryptography lib instead
|
||||||
|
Source17: rsa-4.7.2.tar.gz
|
||||||
|
Source18: %{six}-%{six_version}.tar.gz
|
||||||
|
Source19: %{urllib3}-%{urllib3_version}.tar.gz
|
||||||
|
Source20: %{websocketclient}-%{websocketclient_version}.tar.gz
|
||||||
|
Source21: %{jinja2}-%{jinja2_version}.tar.gz
|
||||||
|
Source22: %{markupsafe}-%{markupsafe_version}.tar.gz
|
||||||
|
Source23: python-%{stringutils}-%{stringutils_version}.tar.gz
|
||||||
|
Source24: %{requests}-%{requests_version}.tar.gz
|
||||||
|
Source25: %{chrstnormalizer}-%{chrstnormalizer_version}.tar.gz
|
||||||
|
Source26: %{idna}-%{idna_version}.tar.gz
|
||||||
|
Source27: %{reqstsoauthlib}-%{reqstsoauthlib_version}.tar.gz
|
||||||
|
Source28: %{oauthlib}-%{oauthlib_version}.tar.gz
|
||||||
|
Source29: %{ruamelyaml}-%{ruamelyaml_version}.tar.gz
|
||||||
|
Source30: %{setuptools}-%{setuptools_version}.tar.gz
|
||||||
|
## required for installation
|
||||||
|
Source31: setuptools_scm-6.3.2.tar.gz
|
||||||
|
Source32: packaging-21.0.tar.gz
|
||||||
|
Source33: pyparsing-3.0.1.tar.gz
|
||||||
|
Source34: tomli-1.0.1.tar.gz
|
||||||
|
### END
|
||||||
|
|
||||||
Patch0: fence_impilan-fence_ilo_ssh-add-ilo5-support.patch
|
Patch0: fence_impilan-fence_ilo_ssh-add-ilo5-support.patch
|
||||||
Patch1: fence_mpath-watchdog-support.patch
|
Patch1: fence_mpath-watchdog-support.patch
|
||||||
Patch2: fence_ilo3-fence_ipmilan-show-correct-default-method.patch
|
Patch2: fence_ilo3-fence_ipmilan-show-correct-default-method.patch
|
||||||
@ -146,9 +229,14 @@ Patch97: bz1470827-all-agents-log-exceptions-fail.patch
|
|||||||
Patch98: bz2010710-1-fence_amt_ws-fix-or-dead-code.patch
|
Patch98: bz2010710-1-fence_amt_ws-fix-or-dead-code.patch
|
||||||
Patch99: bz2010710-2-fence_amt_ws-boot-option.patch
|
Patch99: bz2010710-2-fence_amt_ws-boot-option.patch
|
||||||
Patch100: bz1969953-fence_gce-3-fix-httplib2-import.patch
|
Patch100: bz1969953-fence_gce-3-fix-httplib2-import.patch
|
||||||
|
Patch101: bz1971683-fence_sbd-dont-spam-logs-disable-timeout.patch
|
||||||
|
Patch102: bz1977588-1-fencing-add-EC_FETCH_VM_UUID.patch
|
||||||
|
Patch103: bz1977588-2-fence_kubevirt.patch
|
||||||
|
Patch104: bz1977588-3-fence_kubevirt-fix-status.patch
|
||||||
|
Patch105: bz1977588-4-fence_kubevirt-power-timeout-40s.patch
|
||||||
|
|
||||||
%if 0%{?fedora} || 0%{?rhel} > 7
|
%if 0%{?fedora} || 0%{?rhel} > 7
|
||||||
%global supportedagents amt_ws apc apc_snmp bladecenter brocade cisco_mds cisco_ucs compute drac5 eaton_snmp emerson eps evacuate hds_cb hpblade ibmblade ibm_powervs ibm_vpc ifmib ilo ilo_moonshot ilo_mp ilo_ssh intelmodular ipdu ipmilan kdump lpar mpath redfish rhevm rsa rsb sbd scsi vmware_rest vmware_soap wti
|
%global supportedagents amt_ws apc apc_snmp bladecenter brocade cisco_mds cisco_ucs compute drac5 eaton_snmp emerson eps evacuate hds_cb hpblade ibmblade ibm_powervs ibm_vpc ifmib ilo ilo_moonshot ilo_mp ilo_ssh intelmodular ipdu ipmilan kdump kubevirt lpar mpath redfish rhevm rsa rsb sbd scsi vmware_rest vmware_soap wti
|
||||||
%ifarch x86_64
|
%ifarch x86_64
|
||||||
%global testagents virsh heuristics_ping aliyun aws azure_arm gce
|
%global testagents virsh heuristics_ping aliyun aws azure_arm gce
|
||||||
%endif
|
%endif
|
||||||
@ -216,7 +304,7 @@ BuildRequires: gnutls-utils
|
|||||||
BuildRequires: python3-devel
|
BuildRequires: python3-devel
|
||||||
BuildRequires: python3-pexpect python3-pycurl python3-requests
|
BuildRequires: python3-pexpect python3-pycurl python3-requests
|
||||||
BuildRequires: python3-suds openwsman-python3 python3-boto3
|
BuildRequires: python3-suds openwsman-python3 python3-boto3
|
||||||
BuildRequires: python3-google-api-client
|
BuildRequires: python3-google-api-client python3-pip python3-wheel python3-jinja2
|
||||||
# google cloud
|
# google cloud
|
||||||
%ifarch x86_64
|
%ifarch x86_64
|
||||||
BuildRequires: python3-pip
|
BuildRequires: python3-pip
|
||||||
@ -330,6 +418,11 @@ BuildRequires: python3-pip
|
|||||||
%patch98 -p1
|
%patch98 -p1
|
||||||
%patch99 -p1
|
%patch99 -p1
|
||||||
%patch100 -p1
|
%patch100 -p1
|
||||||
|
%patch101 -p1
|
||||||
|
%patch102 -p1
|
||||||
|
%patch103 -p1
|
||||||
|
%patch104 -p1 -F1
|
||||||
|
%patch105 -p1
|
||||||
|
|
||||||
# prevent compilation of something that won't get used anyway
|
# prevent compilation of something that won't get used anyway
|
||||||
sed -i.orig 's|FENCE_ZVM=1|FENCE_ZVM=0|' configure.ac
|
sed -i.orig 's|FENCE_ZVM=1|FENCE_ZVM=0|' configure.ac
|
||||||
@ -420,6 +513,11 @@ popd
|
|||||||
%{__python3} -m pip install --target %{buildroot}/usr/lib/fence-agents/%{bundled_lib_dir}/google --no-index --find-links %{_sourcedir} httplib2
|
%{__python3} -m pip install --target %{buildroot}/usr/lib/fence-agents/%{bundled_lib_dir}/google --no-index --find-links %{_sourcedir} httplib2
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
|
# kubevirt
|
||||||
|
%{__python3} -m pip install --user --no-index --find-links %{_sourcedir} setuptools-scm
|
||||||
|
%{__python3} -m pip install --target %{buildroot}/usr/lib/fence-agents/%{bundled_lib_dir}/kubevirt --no-index --find-links %{_sourcedir} openshift
|
||||||
|
rm -rf %{buildroot}/usr/lib/fence-agents/%{bundled_lib_dir}/kubevirt/rsa*
|
||||||
|
|
||||||
## tree fix up
|
## tree fix up
|
||||||
# fix libfence permissions
|
# fix libfence permissions
|
||||||
chmod 0755 %{buildroot}%{_datadir}/fence/*.py
|
chmod 0755 %{buildroot}%{_datadir}/fence/*.py
|
||||||
@ -1014,6 +1112,41 @@ Fence agent for use with kdump crash recovery service.
|
|||||||
%{_mandir}/man8/fence_kdump.8*
|
%{_mandir}/man8/fence_kdump.8*
|
||||||
%{_mandir}/man8/fence_kdump_send.8*
|
%{_mandir}/man8/fence_kdump_send.8*
|
||||||
|
|
||||||
|
%package kubevirt
|
||||||
|
License: GPLv2+ and LGPLv2+ and ASL 2.0 and BSD and BSD-2-Clause and BSD-3-Clause and ISC and MIT and MPL-2.0
|
||||||
|
Summary: Fence agent for KubeVirt platform
|
||||||
|
Requires: fence-agents-common = %{version}-%{release}
|
||||||
|
Provides: bundled(python3-%{openshift}) = %{openshift_version}
|
||||||
|
Provides: bundled(python3-%{ruamelyamlclib}) = %{ruamelyamlclib_version}
|
||||||
|
Provides: bundled(python3-%{kubernetes}) = %{kubernetes_version}
|
||||||
|
Provides: bundled(python3-%{certifi}) = %{certifi_version}
|
||||||
|
Provides: bundled(python3-%{googleauth}) = %{googleauth_version}
|
||||||
|
Provides: bundled(python3-%{cachetools}) = %{cachetools_version}
|
||||||
|
Provides: bundled(python3-%{pyasn1modules}) = %{pyasn1modules_version}
|
||||||
|
Provides: bundled(python3-%{pyasn1}) = %{pyasn1_version}
|
||||||
|
Provides: bundled(python3-%{dateutil}) = %{dateutil_version}
|
||||||
|
Provides: bundled(python3-%{pyyaml}) = %{pyyaml_version}
|
||||||
|
Provides: bundled(python3-%{six}) = %{six_version}
|
||||||
|
Provides: bundled(python3-%{urllib3}) = %{urllib3_version}
|
||||||
|
Provides: bundled(python3-%{websocketclient}) = %{websocketclient_version}
|
||||||
|
Provides: bundled(python3-%{jinja2}) = %{jinja2_version}
|
||||||
|
Provides: bundled(python3-%{markupsafe}) = %{markupsafe_version}
|
||||||
|
Provides: bundled(python3-%{stringutils}) = %{stringutils_version}
|
||||||
|
Provides: bundled(python3-%{requests}) = %{requests_version}
|
||||||
|
Provides: bundled(python3-%{chrstnormalizer}) = %{chrstnormalizer_version}
|
||||||
|
Provides: bundled(python3-%{idna}) = %{idna_version}
|
||||||
|
Provides: bundled(python3-%{reqstsoauthlib}) = %{reqstsoauthlib_version}
|
||||||
|
Provides: bundled(python3-%{oauthlib}) = %{oauthlib_version}
|
||||||
|
Provides: bundled(python3-%{ruamelyaml}) = %{ruamelyaml_version}
|
||||||
|
Provides: bundled(python3-%{setuptools}) = %{setuptools_version}
|
||||||
|
%description kubevirt
|
||||||
|
Fence agent for KubeVirt platform.
|
||||||
|
%files kubevirt
|
||||||
|
%{_sbindir}/fence_kubevirt
|
||||||
|
%{_mandir}/man8/fence_kubevirt.8*
|
||||||
|
# bundled libraries
|
||||||
|
/usr/lib/fence-agents/%{bundled_lib_dir}/kubevirt
|
||||||
|
|
||||||
%package lpar
|
%package lpar
|
||||||
License: GPLv2+ and LGPLv2+
|
License: GPLv2+ and LGPLv2+
|
||||||
Group: System Environment/Base
|
Group: System Environment/Base
|
||||||
@ -1235,6 +1368,14 @@ Fence agent for IBM z/VM over IP.
|
|||||||
%endif
|
%endif
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Wed Nov 3 2021 Oyvind Albrigtsen <oalbrigt@redhat.com> - 4.2.1-81
|
||||||
|
- fence_kubevirt: new fence agent
|
||||||
|
Resolves: rhbz#1977588
|
||||||
|
|
||||||
|
* Tue Nov 2 2021 Oyvind Albrigtsen <oalbrigt@redhat.com> - 4.2.1-80
|
||||||
|
- fence_sbd: dont spam logs when disable_timeout is enabled
|
||||||
|
Resolves: rhbz#1971683
|
||||||
|
|
||||||
* Wed Oct 27 2021 Oyvind Albrigtsen <oalbrigt@redhat.com> - 4.2.1-79
|
* Wed Oct 27 2021 Oyvind Albrigtsen <oalbrigt@redhat.com> - 4.2.1-79
|
||||||
- fence_amt_ws: fix "or" causing dead code
|
- fence_amt_ws: fix "or" causing dead code
|
||||||
Resolves: rhbz#2010710
|
Resolves: rhbz#2010710
|
||||||
|
Loading…
Reference in New Issue
Block a user