diff --git a/SOURCES/bz1265426-1-fence_scsi_hard.patch b/SOURCES/bz1265426-1-fence_scsi_hard.patch new file mode 100644 index 0000000..4d57484 --- /dev/null +++ b/SOURCES/bz1265426-1-fence_scsi_hard.patch @@ -0,0 +1,51 @@ +From 8cd85ba88193f9cdb0c933ba9f7261f1c3631868 Mon Sep 17 00:00:00 2001 +From: John Ruemker +Date: Tue, 22 Sep 2015 17:52:56 -0400 +Subject: [PATCH 1/4] fence_scsi: Reset device prior to all uses of sg_persist + +Currently the agent will reset prior to several areas where it runs +sg_persist, to clear out any "Unit Attention" conditions that could +otherwise cause the sg_persist command to report failures. However +several paths remain that could fail if a "Unit Attention" condition +exist, so we should reset before any use of sg_persist. +--- + fence/agents/scsi/fence_scsi.py | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/fence/agents/scsi/fence_scsi.py b/fence/agents/scsi/fence_scsi.py +index e18e473..8680828 100644 +--- a/fence/agents/scsi/fence_scsi.py ++++ b/fence/agents/scsi/fence_scsi.py +@@ -125,6 +125,7 @@ def is_block_device(dev): + + # cancel registration + def preempt_abort(options, host, dev): ++ reset_dev(options,dev) + cmd = options["--sg_persist-path"] + " -n -o -A -T 5 -K " + host + " -S " + options["--key"] + " -d " + dev + return not bool(run_cmd(options, cmd)["err"]) + +@@ -147,11 +148,13 @@ def register_dev(options, dev): + + + def reserve_dev(options, dev): ++ reset_dev(options,dev) + cmd = options["--sg_persist-path"] + " -n -o -R -T 5 -K " + options["--key"] + " -d " + dev + return not bool(run_cmd(options, cmd)["err"]) + + + def get_reservation_key(options, dev): ++ reset_dev(options,dev) + cmd = options["--sg_persist-path"] + " -n -i -r -d " + dev + out = run_cmd(options, cmd) + if out["err"]: +@@ -161,6 +164,7 @@ def get_reservation_key(options, dev): + + + def get_registration_keys(options, dev): ++ reset_dev(options,dev) + keys = [] + cmd = options["--sg_persist-path"] + " -n -i -k -d " + dev + out = run_cmd(options, cmd) +-- +2.4.3 + diff --git a/SOURCES/bz1265426-2-fence_scsi_hard.patch b/SOURCES/bz1265426-2-fence_scsi_hard.patch new file mode 100644 index 0000000..df7b1d9 --- /dev/null +++ b/SOURCES/bz1265426-2-fence_scsi_hard.patch @@ -0,0 +1,52 @@ +From 5c8cf5613f9371b53d1aab6f97db99bdbf9db4b4 Mon Sep 17 00:00:00 2001 +From: John Ruemker +Date: Tue, 22 Sep 2015 18:02:37 -0400 +Subject: [PATCH 2/4] fence_scsi: Offer hard-reboot option for fence_scsi_check + script + +The existing implementation of fence_scsi_check returns an error if any +device is no longer registered properly, and this error return causes +watchdog to use its custom procedure to reboot the host. This procedure +is prone to blocking, especially when GFS2 file systems are mounted or +multipath devices are configured to queue indefinitely, so having the +check be able to hard-reboot the host instead of returning a failure +gives a means for avoiding these blockages. +--- + fence/agents/scsi/fence_scsi.py | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/fence/agents/scsi/fence_scsi.py b/fence/agents/scsi/fence_scsi.py +index 8680828..ff34721 100644 +--- a/fence/agents/scsi/fence_scsi.py ++++ b/fence/agents/scsi/fence_scsi.py +@@ -379,7 +379,7 @@ def scsi_check_get_verbose(): + return bool(match) + + +-def scsi_check(): ++def scsi_check(hardreboot=False): + if len(sys.argv) >= 3 and sys.argv[1] == "repair": + return int(sys.argv[2]) + options = {} +@@ -403,6 +403,9 @@ def scsi_check(): + else: + logging.debug("key " + key + " not registered with device " + dev) + logging.debug("key " + key + " registered with any devices") ++ ++ if hardreboot == True: ++ os.system("reboot -f") + return 2 + + +@@ -423,6 +426,8 @@ def main(): + #fence_scsi_check + if os.path.basename(sys.argv[0]) == "fence_scsi_check.pl": + sys.exit(scsi_check()) ++ elif os.path.basename(sys.argv[0]) == "fence_scsi_check_hardreboot": ++ sys.exit(scsi_check(True)) + + options = check_input(device_opt, process_input(device_opt)) + +-- +2.4.3 + diff --git a/SOURCES/bz1265426-3-fence_scsi_hard.patch b/SOURCES/bz1265426-3-fence_scsi_hard.patch new file mode 100644 index 0000000..ce8cea7 --- /dev/null +++ b/SOURCES/bz1265426-3-fence_scsi_hard.patch @@ -0,0 +1,57 @@ +From c4de19f19121ee44cd9ffb4a307f386ea2b13efc Mon Sep 17 00:00:00 2001 +From: Marek 'marx' Grac +Date: Fri, 25 Sep 2015 11:14:08 +0200 +Subject: [PATCH 3/4] fence_scsi: Install fence_scsi_check_hardreboot and + fence_scsi_check + +--- + fence/agents/scsi/Makefile.am | 10 ++++++++-- + fence/agents/scsi/fence_scsi.py | 2 ++ + 2 files changed, 10 insertions(+), 2 deletions(-) + +diff --git a/fence/agents/scsi/Makefile.am b/fence/agents/scsi/Makefile.am +index 5315215..ad65d1b 100644 +--- a/fence/agents/scsi/Makefile.am ++++ b/fence/agents/scsi/Makefile.am +@@ -7,7 +7,7 @@ SRC = $(TARGET).py + EXTRA_DIST = $(SRC) + + scsidatadir = $(CLUSTERDATA) +-scsidata_SCRIPTS = fence_scsi_check.pl ++scsidata_SCRIPTS = fence_scsi_check fence_scsi_check_hardreboot fence_scsi_check.pl + + sbin_SCRIPTS = $(TARGET) + +@@ -18,9 +18,15 @@ FENCE_TEST_ARGS = -k 1 + fence_scsi_check.pl: $(TARGET) + cp $^ $@ + ++fence_scsi_check: $(TARGET) ++ cp $^ $@ ++ ++fence_scsi_check_hardreboot: $(TARGET) ++ cp $^ $@ ++ + include $(top_srcdir)/make/fencebuild.mk + include $(top_srcdir)/make/fenceman.mk + include $(top_srcdir)/make/agentpycheck.mk + + clean-local: clean-man +- rm -f $(TARGET) $(SYMTARGET) fence_scsi_check.pl ++ rm -f $(TARGET) $(SYMTARGET) $(scsidata_SCRIPTS) +diff --git a/fence/agents/scsi/fence_scsi.py b/fence/agents/scsi/fence_scsi.py +index ff34721..c13d4ed 100644 +--- a/fence/agents/scsi/fence_scsi.py ++++ b/fence/agents/scsi/fence_scsi.py +@@ -426,6 +426,8 @@ def main(): + #fence_scsi_check + if os.path.basename(sys.argv[0]) == "fence_scsi_check.pl": + sys.exit(scsi_check()) ++ elif os.path.basename(sys.argv[0]) == "fence_scsi_check": ++ sys.exit(scsi_check()) + elif os.path.basename(sys.argv[0]) == "fence_scsi_check_hardreboot": + sys.exit(scsi_check(True)) + +-- +2.4.3 + diff --git a/SOURCES/bz1265426-4-fence_scsi_hard.patch b/SOURCES/bz1265426-4-fence_scsi_hard.patch new file mode 100644 index 0000000..4c6a176 --- /dev/null +++ b/SOURCES/bz1265426-4-fence_scsi_hard.patch @@ -0,0 +1,34 @@ +From 463e5bcc58e7c9d49033d0427bdcbc263cf98165 Mon Sep 17 00:00:00 2001 +From: Marek 'marx' Grac +Date: Wed, 16 Dec 2015 13:46:23 +0100 +Subject: [PATCH 4/4] fence_scsi: Replace hard reboot with direct call to libc + +--- + fence/agents/scsi/fence_scsi.py | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/fence/agents/scsi/fence_scsi.py b/fence/agents/scsi/fence_scsi.py +index c13d4ed..11eab73 100644 +--- a/fence/agents/scsi/fence_scsi.py ++++ b/fence/agents/scsi/fence_scsi.py +@@ -8,6 +8,7 @@ import time + import logging + import atexit + import hashlib ++import ctypes + sys.path.append("@FENCEAGENTSLIBDIR@") + from fencing import fail_usage, run_command, atexit_handler, check_input, process_input, show_docs, fence_action, all_opt + from fencing import run_delay +@@ -405,7 +406,8 @@ def scsi_check(hardreboot=False): + logging.debug("key " + key + " registered with any devices") + + if hardreboot == True: +- os.system("reboot -f") ++ libc = ctypes.cdll['libc.so.6'] ++ libc.reboot(0x1234567) + return 2 + + +-- +2.4.3 + diff --git a/SOURCES/bz1299577-fence_compute.patch b/SOURCES/bz1299577-fence_compute.patch new file mode 100644 index 0000000..f3671a7 --- /dev/null +++ b/SOURCES/bz1299577-fence_compute.patch @@ -0,0 +1,347 @@ +From e80e142092c53102a46886e9748b8e25465ce4f6 Mon Sep 17 00:00:00 2001 +From: Marek 'marx' Grac +Date: Wed, 20 Jan 2016 11:32:21 +0100 +Subject: [PATCH] fence_compute: Sync with master branch + +--- + fence/agents/compute/fence_compute.py | 180 ++++++++++++++++++++++++++-------- + tests/data/metadata/fence_compute.xml | 16 +-- + 2 files changed, 150 insertions(+), 46 deletions(-) + +diff --git a/fence/agents/compute/fence_compute.py b/fence/agents/compute/fence_compute.py +index 82d9c46..d9fe54a 100644 +--- a/fence/agents/compute/fence_compute.py ++++ b/fence/agents/compute/fence_compute.py +@@ -19,6 +19,9 @@ REDHAT_COPYRIGHT="Copyright (C) Red Hat, Inc. 2004-2010 All rights reserved." + override_status = "" + nova = None + ++EVACUABLE_TAG = "evacuable" ++TRUE_TAGS = ['true'] ++ + def get_power_status(_, options): + global override_status + +@@ -32,8 +35,8 @@ def get_power_status(_, options): + if nova: + try: + services = nova.services.list(host=options["--plug"]) +- + for service in services: ++ logging.debug("Status of %s is %s" % (service.binary, service.state)) + if service.binary == "nova-compute": + if service.state == "up": + status = "on" +@@ -49,31 +52,91 @@ def get_power_status(_, options): + # NOTE(sbauza); We mimic the host-evacuate module since it's only a contrib + # module which is not stable + def _server_evacuate(server, on_shared_storage): +- success = True ++ success = False + error_message = "" + try: +- nova.servers.evacuate(server=server['uuid'], on_shared_storage=on_shared_storage) ++ logging.debug("Resurrecting instance: %s" % server) ++ (response, dictionary) = nova.servers.evacuate(server=server, on_shared_storage=on_shared_storage) ++ ++ if response == None: ++ error_message = "No response while evacuating instance" ++ elif response.status_code == 200: ++ success = True ++ error_message = response.reason ++ else: ++ error_message = response.reason ++ + except Exception as e: +- success = False + error_message = "Error while evacuating instance: %s" % e + + return { +- "server_uuid": server['uuid'], +- "evacuate_accepted": success, +- "error_message": error_message, ++ "uuid": server, ++ "accepted": success, ++ "reason": error_message, + } + +-def _host_evacuate(host, on_shared_storage): +- hypervisors = nova.hypervisors.search(host, servers=True) +- response = [] +- for hyper in hypervisors: +- if hasattr(hyper, 'servers'): +- for server in hyper.servers: +- response.append(_server_evacuate(server, on_shared_storage)) ++def _is_server_evacuable(server, evac_flavors, evac_images): ++ if server.flavor.get('id') in evac_flavors: ++ return True ++ if server.image.get('id') in evac_images: ++ return True ++ return False ++ ++def _get_evacuable_flavors(): ++ result = [] ++ flavors = nova.flavors.list() ++ # Since the detailed view for all flavors doesn't provide the extra specs, ++ # we need to call each of the flavor to get them. ++ for flavor in flavors: ++ if flavor.get_keys().get(EVACUABLE_TAG).strip().lower() in TRUE_TAGS: ++ result.append(flavor.id) ++ return result ++ ++def _get_evacuable_images(): ++ result = [] ++ images = nova.images.list(detailed=True) ++ for image in images: ++ if hasattr(image, 'metadata'): ++ if image.metadata.get(EVACUABLE_TAG).strip.lower() in TRUE_TAGS: ++ result.append(image.id) ++ return result ++ ++def _host_evacuate(options): ++ result = True ++ servers = nova.servers.list(search_opts={'host': options["--plug"]}) ++ if options["--instance-filtering"] == "False": ++ evacuables = servers ++ else: ++ flavors = _get_evacuable_flavors() ++ images = _get_evacuable_images() ++ # Identify all evacuable servers ++ evacuables = [server for server in servers ++ if _is_server_evacuable(server, flavors, images)] ++ ++ if options["--no-shared-storage"] != "False": ++ on_shared_storage = False ++ else: ++ on_shared_storage = True ++ ++ for server in evacuables: ++ if hasattr(server, 'id'): ++ response = _server_evacuate(server.id, on_shared_storage) ++ if response["accepted"]: ++ logging.debug("Evacuated %s from %s: %s" % ++ (response["uuid"], options["--plug"], response["reason"])) ++ else: ++ logging.error("Evacuation of %s on %s failed: %s" % ++ (response["uuid"], options["--plug"], response["reason"])) ++ result = False ++ else: ++ logging.error("Could not evacuate instance: %s" % server.to_dict()) ++ # Should a malformed instance result in a failed evacuation? ++ # result = False ++ return result + + def set_attrd_status(host, status, options): + logging.debug("Setting fencing status for %s to %s" % (host, status)) +- run_command(options, "attrd_updater -p -n evacute -Q -N %s -v %s" % (host, status)) ++ run_command(options, "attrd_updater -p -n evacuate -Q -N %s -U %s" % (host, status)) + + def set_power_status(_, options): + global override_status +@@ -86,28 +149,53 @@ def set_power_status(_, options): + + if options["--action"] == "on": + if get_power_status(_, options) == "on": ++ # Forcing the service back up in case it was disabled + nova.services.enable(options["--plug"], 'nova-compute') ++ try: ++ # Forcing the host back up ++ nova.services.force_down( ++ options["--plug"], "nova-compute", force_down=False) ++ except Exception as e: ++ # In theory, if foce_down=False fails, that's for the exact ++ # same possible reasons that below with force_down=True ++ # eg. either an incompatible version or an old client. ++ # Since it's about forcing back to a default value, there is ++ # no real worries to just consider it's still okay even if the ++ # command failed ++ logging.info("Exception from attempt to force " ++ "host back up via nova API: " ++ "%s: %s" % (e.__class__.__name__, e)) + else: + # Pretend we're 'on' so that the fencing library doesn't loop forever waiting for the node to boot + override_status = "on" + return + +- # need to wait for nova to update its internal status or we +- # cannot call host-evacuate +- while get_power_status(_, options) != "off": +- # Loop forever if need be. +- # +- # Some callers (such as Pacemaker) will have a timer +- # running and kill us if necessary +- logging.debug("Waiting for nova to update it's internal state") +- time.sleep(1) +- +- if options["--no-shared-storage"] != "False": +- on_shared_storage = False +- else: +- on_shared_storage = True ++ try: ++ nova.services.force_down( ++ options["--plug"], "nova-compute", force_down=True) ++ except Exception as e: ++ # Something went wrong when we tried to force the host down. ++ # That could come from either an incompatible API version ++ # eg. UnsupportedVersion or VersionNotFoundForAPIMethod ++ # or because novaclient is old and doesn't include force_down yet ++ # eg. AttributeError ++ # In that case, fallbacking to wait for Nova to catch the right state. ++ ++ logging.error("Exception from attempt to force host down via nova API: " ++ "%s: %s" % (e.__class__.__name__, e)) ++ # need to wait for nova to update its internal status or we ++ # cannot call host-evacuate ++ while get_power_status(_, options) != "off": ++ # Loop forever if need be. ++ # ++ # Some callers (such as Pacemaker) will have a timer ++ # running and kill us if necessary ++ logging.debug("Waiting for nova to update it's internal state for %s" % options["--plug"]) ++ time.sleep(1) ++ ++ if not _host_evacuate(options): ++ sys.exit(1) + +- _host_evacuate(options["--plug"], on_shared_storage) + return + + def get_plugs_list(_, options): +@@ -117,9 +205,9 @@ def get_plugs_list(_, options): + hypervisors = nova.hypervisors.list() + for hypervisor in hypervisors: + longhost = hypervisor.hypervisor_hostname +- if options["--action"] == "list" and options["--domain"] != "": +- shorthost = longhost.replace("." + options["--domain"], +- "") ++ if options["--domain"] != "": ++ shorthost = longhost.replace("." + options["--domain"], "") ++ result[longhost] = ("", None) + result[shorthost] = ("", None) + else: + result[longhost] = ("", None) +@@ -164,7 +252,7 @@ def define_new_opts(): + "order": 5, + } + all_opt["record-only"] = { +- "getopt" : "", ++ "getopt" : "r:", + "longopt" : "record-only", + "help" : "--record-only Record the target as needing evacuation but as yet do not intiate it", + "required" : "0", +@@ -172,6 +260,15 @@ def define_new_opts(): + "default" : "False", + "order": 5, + } ++ all_opt["instance-filtering"] = { ++ "getopt" : "", ++ "longopt" : "instance-filtering", ++ "help" : "--instance-filtering Only evacuate instances create from images and flavors with evacuable=true", ++ "required" : "0", ++ "shortdesc" : "Only evacuate flagged instances", ++ "default" : "False", ++ "order": 5, ++ } + all_opt["no-shared-storage"] = { + "getopt" : "", + "longopt" : "no-shared-storage", +@@ -187,17 +284,17 @@ def main(): + global nova + atexit.register(atexit_handler) + +- device_opt = ["login", "passwd", "tenant-name", "auth-url", ++ device_opt = ["login", "passwd", "tenant-name", "auth-url", "fabric_fencing", "on_target", + "no_login", "no_password", "port", "domain", "no-shared-storage", "endpoint-type", +- "record-only"] ++ "record-only", "instance-filtering"] + define_new_opts() + all_opt["shell_timeout"]["default"] = "180" + + options = check_input(device_opt, process_input(device_opt)) + + docs = {} +- docs["shortdesc"] = "Fence agent for nova compute nodes" +- docs["longdesc"] = "fence_nova_host is a Nova fencing notification agent" ++ docs["shortdesc"] = "Fence agent for the automatic resurrection of OpenStack compute instances" ++ docs["longdesc"] = "Used to tell Nova that compute nodes are down and to reschedule flagged instances" + docs["vendorurl"] = "" + + show_docs(options, docs) +@@ -213,7 +310,10 @@ def main(): + if options["--action"] != "list" and options["--domain"] != "" and options.has_key("--plug"): + options["--plug"] = options["--plug"] + "." + options["--domain"] + +- if options["--record-only"] != "False": ++ if options["--record-only"] in [ "2", "Disabled", "disabled" ]: ++ sys.exit(0) ++ ++ elif options["--record-only"] in [ "1", "True", "true", "Yes", "yes"]: + if options["--action"] == "on": + set_attrd_status(options["--plug"], "no", options) + sys.exit(0) +@@ -222,7 +322,7 @@ def main(): + set_attrd_status(options["--plug"], "yes", options) + sys.exit(0) + +- elif options["--action"] in ["status", "monitor"]: ++ elif options["--action"] in ["monitor", "status"]: + sys.exit(0) + + # The first argument is the Nova client version +diff --git a/tests/data/metadata/fence_compute.xml b/tests/data/metadata/fence_compute.xml +index 846a861..98bed4e 100644 +--- a/tests/data/metadata/fence_compute.xml ++++ b/tests/data/metadata/fence_compute.xml +@@ -1,6 +1,6 @@ + +- +-fence_nova_host is a Nova fencing notification agent ++ ++Used to tell Nova that compute nodes are down and to reschedule flagged instances + + + +@@ -35,7 +35,7 @@ + + + +- ++ + Fencing Action + + +@@ -48,6 +48,11 @@ + + DNS domain in which hosts live + ++ ++ ++ ++ Only evacuate flagged instances ++ + + + +@@ -55,7 +60,7 @@ + + + +- ++ + Only record the target as needing evacuation + + +@@ -115,9 +120,8 @@ + + + +- ++ + +- + + + +-- +2.4.3 + diff --git a/SOURCES/bz1303698-2-fence_cisco_ucs-Add-missing-as-off.patch b/SOURCES/bz1303698-2-fence_cisco_ucs-Add-missing-as-off.patch new file mode 100644 index 0000000..0ba7e74 --- /dev/null +++ b/SOURCES/bz1303698-2-fence_cisco_ucs-Add-missing-as-off.patch @@ -0,0 +1,43 @@ +From 0a34f115c378ed1791f2aceb5abdb0633c394d6f Mon Sep 17 00:00:00 2001 +From: Marek 'marx' Grac +Date: Tue, 9 Feb 2016 09:49:01 +0100 +Subject: [PATCH 2/4] fence_cisco_ucs: Add --missing-as-off + +--- + fence/agents/cisco_ucs/fence_cisco_ucs.py | 10 ++++++++-- + 1 file changed, 8 insertions(+), 2 deletions(-) + +diff --git a/fence/agents/cisco_ucs/fence_cisco_ucs.py b/fence/agents/cisco_ucs/fence_cisco_ucs.py +index 260925e..08da566 100644 +--- a/fence/agents/cisco_ucs/fence_cisco_ucs.py ++++ b/fence/agents/cisco_ucs/fence_cisco_ucs.py +@@ -32,10 +32,16 @@ def get_power_status(conn, options): + + result = RE_GET_PNDN.search(res) + if result == None: +- fail(EC_STATUS) ++ pndn = "" + else: + pndn = result.group(1) + ++ if pndn.strip() == "": ++ if "--missing-as-off" in options: ++ return "off" ++ else: ++ fail(EC_STATUS) ++ + res = send_command(options, "", int(options["--shell-timeout"])) +@@ -139,7 +145,7 @@ def logout(): + + def main(): + global options_global +- device_opt = ["ipaddr", "login", "passwd", "ssl", "notls", "port", "web", "suborg"] ++ device_opt = ["ipaddr", "login", "passwd", "ssl", "notls", "port", "web", "suborg", "missing_as_off"] + + atexit.register(atexit_handler) + atexit.register(logout) +-- +2.4.3 + diff --git a/SOURCES/bz1303698-3-fence_cisco_ucs-Update-XML-metadata.patch b/SOURCES/bz1303698-3-fence_cisco_ucs-Update-XML-metadata.patch new file mode 100644 index 0000000..8054cbe --- /dev/null +++ b/SOURCES/bz1303698-3-fence_cisco_ucs-Update-XML-metadata.patch @@ -0,0 +1,28 @@ +From ddb6b61ac1ba4d6cb461a7ad8ed75528785f8138 Mon Sep 17 00:00:00 2001 +From: Marek 'marx' Grac +Date: Tue, 9 Feb 2016 09:55:35 +0100 +Subject: [PATCH 3/4] fence_cisco_ucs: Update XML metadata + +--- + tests/data/metadata/fence_cisco_ucs.xml | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/tests/data/metadata/fence_cisco_ucs.xml b/tests/data/metadata/fence_cisco_ucs.xml +index 9834f5a..7114694 100644 +--- a/tests/data/metadata/fence_cisco_ucs.xml ++++ b/tests/data/metadata/fence_cisco_ucs.xml +@@ -108,6 +108,11 @@ + + Wait X seconds for cmd prompt after login + ++ ++ ++ ++ Missing port returns OFF instead of failure ++ + + + +-- +2.4.3 + diff --git a/SOURCES/bz1303698-4-fence_cisco_ucs-Update-XML-metadata.patch b/SOURCES/bz1303698-4-fence_cisco_ucs-Update-XML-metadata.patch new file mode 100644 index 0000000..5550354 --- /dev/null +++ b/SOURCES/bz1303698-4-fence_cisco_ucs-Update-XML-metadata.patch @@ -0,0 +1,65 @@ +From 98f60a846ef12affc612063b733e40be45a9a284 Mon Sep 17 00:00:00 2001 +From: Marek 'marx' Grac +Date: Tue, 9 Feb 2016 10:11:23 +0100 +Subject: [PATCH 4/4] fence_cisco_ucs: Re-order options in XML metadata + +RHEL7 uses different ordering than master branch +--- + tests/data/metadata/fence_cisco_ucs.xml | 20 ++++++++++---------- + 1 file changed, 10 insertions(+), 10 deletions(-) + +diff --git a/tests/data/metadata/fence_cisco_ucs.xml b/tests/data/metadata/fence_cisco_ucs.xml +index 7114694..067966a 100644 +--- a/tests/data/metadata/fence_cisco_ucs.xml ++++ b/tests/data/metadata/fence_cisco_ucs.xml +@@ -13,6 +13,11 @@ + + Disable TLS negotiation, force SSL 3.0 + ++ ++ ++ ++ Additional path needed to access suborganization ++ + + + +@@ -53,11 +58,6 @@ + + SSL connection + +- +- +- +- Additional path needed to access suborganization +- + + + +@@ -108,11 +108,6 @@ + + Wait X seconds for cmd prompt after login + +- +- +- +- Missing port returns OFF instead of failure +- + + + +@@ -123,6 +118,11 @@ + + Wait X seconds before fencing is started + ++ ++ ++ ++ Missing port returns OFF instead of failure ++ + + + +-- +2.4.3 + diff --git a/SOURCES/bz1303698-fence_cisco_ucs-Obtain-status-of-device-from-differe.patch b/SOURCES/bz1303698-fence_cisco_ucs-Obtain-status-of-device-from-differe.patch new file mode 100644 index 0000000..a15fbee --- /dev/null +++ b/SOURCES/bz1303698-fence_cisco_ucs-Obtain-status-of-device-from-differe.patch @@ -0,0 +1,57 @@ +From 8f106de6bed0626787cae79aa2607992f1bbacec Mon Sep 17 00:00:00 2001 +From: Marek 'marx' Grac +Date: Mon, 1 Feb 2016 16:07:48 +0100 +Subject: [PATCH] fence_cisco_ucs: Obtain status of device from different + endpoint + +Resolves: rhbz#1298430 +--- + fence/agents/cisco_ucs/fence_cisco_ucs.py | 18 +++++++++++++++--- + 1 file changed, 15 insertions(+), 3 deletions(-) + +diff --git a/fence/agents/cisco_ucs/fence_cisco_ucs.py b/fence/agents/cisco_ucs/fence_cisco_ucs.py +index 6288207..331f309 100644 +--- a/fence/agents/cisco_ucs/fence_cisco_ucs.py ++++ b/fence/agents/cisco_ucs/fence_cisco_ucs.py +@@ -17,7 +17,9 @@ BUILD_DATE="March, 2008" + RE_COOKIE = re.compile("", int(options["--shell-timeout"])) ++ options["--plug"] + "\"/>", int(options["--shell-timeout"])) + +- result = RE_STATUS.search(res) ++ result = RE_GET_PNDN.search(res) ++ if result == None: ++ fail(EC_STATUS) ++ else: ++ pndn = result.group(1) ++ ++ res = send_command(options, "", int(options["--shell-timeout"])) ++ ++ result = RE_GET_OPERPOWER.search(res) + if result == None: + fail(EC_STATUS) + else: + status = result.group(1) + +- if status == "up": ++ if status == "on": + return "on" + else: + return "off" +-- +2.4.3 + diff --git a/SPECS/fence-agents.spec b/SPECS/fence-agents.spec index 7ea0dbb..e36425a 100644 --- a/SPECS/fence-agents.spec +++ b/SPECS/fence-agents.spec @@ -16,7 +16,7 @@ Name: fence-agents Summary: Fence Agents for Red Hat Cluster Version: 4.0.11 -Release: 27%{?alphatag:.%{alphatag}}%{?dist} +Release: 27%{?alphatag:.%{alphatag}}%{?dist}.5 License: GPLv2+ and LGPLv2+ Group: System Environment/Base URL: http://sourceware.org/cluster/wiki/ @@ -89,6 +89,15 @@ Patch64: bz1256908-fence_ilo-tls_negotiation.patch Patch65: bz1259319-fence_apc_v6.patch Patch66: bz1257137-3-fence_ipmilan_regression.patch Patch67: bz1274432-fence_brocade-fix_incorrect_return.patch +Patch68: bz1265426-1-fence_scsi_hard.patch +Patch69: bz1265426-2-fence_scsi_hard.patch +Patch70: bz1265426-3-fence_scsi_hard.patch +Patch71: bz1265426-4-fence_scsi_hard.patch +Patch72: bz1299577-fence_compute.patch +Patch73: bz1303698-fence_cisco_ucs-Obtain-status-of-device-from-differe.patch +Patch74: bz1303698-2-fence_cisco_ucs-Add-missing-as-off.patch +Patch75: bz1303698-3-fence_cisco_ucs-Update-XML-metadata.patch +Patch76: bz1303698-4-fence_cisco_ucs-Update-XML-metadata.patch %if 0%{?rhel} %global supportedagents apc apc_snmp bladecenter brocade cisco_mds cisco_ucs compute drac5 eaton_snmp emerson eps hpblade ibmblade ifmib ilo ilo_moonshot ilo_mp ilo_ssh intelmodular ipdu ipmilan mpath kdump rhevm rsa rsb scsi vmware_soap wti @@ -182,6 +191,15 @@ BuildRequires: autoconf automake libtool %patch65 -p1 -b .bz1259319 %patch66 -p1 -b .bz1257137-3 %patch67 -p1 -b .bz1274432-1 +%patch68 -p1 -b .bz1265426-1 +%patch69 -p1 -b .bz1265426-2 +%patch70 -p1 -b .bz1265426-3 +%patch71 -p1 -b .bz1265426-4 +%patch72 -p1 -b .bz1299577 +%patch73 -p1 -b .bz1303698 +%patch74 -p1 -b .bz1303698-2 +%patch75 -p1 -b .bz1303698-3 +%patch76 -p1 -b .bz1303698-4 %build ./autogen.sh @@ -686,6 +704,8 @@ The fence-agents-scsi package contains fence agent for SCSI persisent reservatio %defattr(-,root,root,-) %{_sbindir}/fence_scsi %{_datadir}/cluster/fence_scsi_check.pl +%{_datadir}/cluster/fence_scsi_check +%{_datadir}/cluster/fence_scsi_check_hardreboot %{_mandir}/man8/fence_scsi.8* %package virsh @@ -747,6 +767,22 @@ The fence-agents-zvm package contains a fence agent for z/VM hypervisors %endif %changelog +* Tue Feb 09 2016 Marek Grac - 4.0.11-27.5 +- fence_cisco_ucs: Change endpoint for 'status' action + Resolves: rhb#1303698 + +* Tue Feb 02 2016 Marek Grac - 4.0.11-27.4 +- fence_cisco_ucs: Change endpoint for 'status' action + Resolves: rhb#1303698 + +* Wed Jan 20 2016 Marek Grac - 4.0.11-30 +- fence_compute: Replace with current implementation + Resolves: rhbz#1299577 + +* Wed Dec 16 2015 Marek Grac - 4.0.11-27.2 +- fence_scsi: Add fence_scsi_check_hardreboot + Resolves: rhbz#bz1292071 + * Mon Oct 26 2015 Marek Grac - 4.0.11-27 - fence_brocade: Fix return status in get_power_status Resolves: rhbz#1274431 @@ -776,7 +812,6 @@ The fence-agents-zvm package contains a fence agent for z/VM hypervisors Resolves: 1102727 - manual pages now describe 'list-status' properly -bz1102727-3-fence_mpath.patch bz1250586-2-list_status.patch * Tue Aug 11 2015 Marek Grac - 4.0.11-20 - fencing: Fix place where --plug + --port-as-ip are tested Resolves: rhbz#1214522