Blame SOURCES/bz1337236-fence_sbd.patch

e4ffb1
diff -uNr a/configure.ac b/configure.ac
e4ffb1
--- a/configure.ac	2017-01-16 16:20:32.299438841 +0100
e4ffb1
+++ b/configure.ac	2017-01-16 16:19:09.079326886 +0100
e4ffb1
@@ -309,6 +309,7 @@
e4ffb1
 		 fence/agents/xenapi/Makefile
e4ffb1
 		 fence/agents/hds_cb/Makefile
e4ffb1
 		 fence/agents/zvm/Makefile
e4ffb1
+		 fence/agents/sbd/Makefile
e4ffb1
 		 doc/Makefile])
e4ffb1
 
e4ffb1
 AC_OUTPUT
e4ffb1
diff -uNr a/fence/agents/sbd/fence_sbd.py b/fence/agents/sbd/fence_sbd.py
e4ffb1
--- a/fence/agents/sbd/fence_sbd.py	1970-01-01 01:00:00.000000000 +0100
e4ffb1
+++ b/fence/agents/sbd/fence_sbd.py	2017-01-16 16:22:39.273080656 +0100
e4ffb1
@@ -0,0 +1,422 @@
e4ffb1
+#!/usr/bin/python -tt
e4ffb1
+
e4ffb1
+import sys, stat
e4ffb1
+import logging
e4ffb1
+import os
e4ffb1
+import atexit
e4ffb1
+sys.path.append("@FENCEAGENTSLIBDIR@")
e4ffb1
+from fencing import fail_usage, run_command, fence_action, all_opt
e4ffb1
+from fencing import atexit_handler, check_input, process_input, show_docs
e4ffb1
+from fencing import run_delay
e4ffb1
+
e4ffb1
+#BEGIN_VERSION_GENERATION
e4ffb1
+RELEASE_VERSION=""
e4ffb1
+REDHAT_COPYRIGHT=""
e4ffb1
+BUILD_DATE=""
e4ffb1
+#END_VERSION_GENERATION
e4ffb1
+
e4ffb1
+DEVICE_INIT = 1
e4ffb1
+DEVICE_NOT_INIT = -3
e4ffb1
+PATH_NOT_EXISTS = -1
e4ffb1
+PATH_NOT_BLOCK = -2
e4ffb1
+
e4ffb1
+def is_block_device(filename):
e4ffb1
+    """Checks if a given path is a valid block device
e4ffb1
+
e4ffb1
+    Key arguments:
e4ffb1
+    filename -- the file to check
e4ffb1
+
e4ffb1
+    Return codes:
e4ffb1
+    True if it's a valid block device
e4ffb1
+    False, otherwise
e4ffb1
+    """
e4ffb1
+
e4ffb1
+    try:
e4ffb1
+        mode = os.lstat(filename).st_mode
e4ffb1
+    except OSError:
e4ffb1
+        return False
e4ffb1
+    else:
e4ffb1
+        return stat.S_ISBLK(mode)
e4ffb1
+
e4ffb1
+def is_link(filename):
e4ffb1
+    """Checks if a given path is a link.
e4ffb1
+
e4ffb1
+    Key arguments:
e4ffb1
+    filename -- the file to check
e4ffb1
+
e4ffb1
+    Return codes:
e4ffb1
+    True if it's a link
e4ffb1
+    False, otherwise
e4ffb1
+    """
e4ffb1
+
e4ffb1
+    try:
e4ffb1
+        mode = os.lstat(filename).st_mode
e4ffb1
+    except OSError:
e4ffb1
+        return False
e4ffb1
+    else:
e4ffb1
+        return stat.S_ISLNK(mode)
e4ffb1
+
e4ffb1
+def check_sbd_device(options, device_path):
e4ffb1
+    """checks that a given sbd device exists and is initialized
e4ffb1
+
e4ffb1
+    Key arguments:
e4ffb1
+    options -- options dictionary
e4ffb1
+    device_path -- device path to check
e4ffb1
+
e4ffb1
+    Return Codes:
e4ffb1
+    1 / DEVICE_INIT if the device exists and is initialized
e4ffb1
+    -1 / PATH_NOT_EXISTS if the path does not exists
e4ffb1
+    -2 / PATH_NOT_BLOCK if the path exists but is not a valid block device
e4ffb1
+    -3 / DEVICE_NOT_INIT if the sbd device is not initialized
e4ffb1
+    """
e4ffb1
+
e4ffb1
+    # First of all we need to check if the device is valid
e4ffb1
+    if not os.path.exists(device_path):
e4ffb1
+        return PATH_NOT_EXISTS
e4ffb1
+
e4ffb1
+    # We need to check if device path is a symbolic link. If so we resolve that
e4ffb1
+    # link.
e4ffb1
+    if is_link(device_path):
e4ffb1
+        link_target = os.readlink(device_path)
e4ffb1
+        device_path = os.path.join(os.path.dirname(device_path), link_target)
e4ffb1
+
e4ffb1
+    # As second step we make sure it's a valid block device
e4ffb1
+    if not is_block_device(device_path):
e4ffb1
+        return PATH_NOT_BLOCK
e4ffb1
+
e4ffb1
+    cmd = "%s -d %s dump" % (options["--sbd-path"], device_path)
e4ffb1
+
e4ffb1
+    (return_code, out, err) = run_command(options, cmd)
e4ffb1
+
e4ffb1
+    for line in out.split("\n"):
e4ffb1
+        if len(line) == 0:
e4ffb1
+            continue
e4ffb1
+
e4ffb1
+        # If we read "NOT dumped" something went wrong, e.g. the device is not
e4ffb1
+        # initialized.
e4ffb1
+        if "NOT dumped" in line:
e4ffb1
+            return DEVICE_NOT_INIT
e4ffb1
+
e4ffb1
+    return DEVICE_INIT
e4ffb1
+
e4ffb1
+def generate_sbd_command(options, command, arguments=None):
e4ffb1
+    """Generates a sbd command based on given arguments.
e4ffb1
+
e4ffb1
+    Return Value:
e4ffb1
+    generated sbd command (string)
e4ffb1
+    """
e4ffb1
+    cmd = options["--sbd-path"]
e4ffb1
+
e4ffb1
+    # add "-d" for each sbd device
e4ffb1
+    for device in parse_sbd_devices(options):
e4ffb1
+        cmd += " -d %s" % device
e4ffb1
+
e4ffb1
+    cmd += " %s %s" % (command, arguments)
e4ffb1
+
e4ffb1
+    return cmd
e4ffb1
+
e4ffb1
+def send_sbd_message(conn, options, plug, message):
e4ffb1
+    """Sends a message to all sbd devices.
e4ffb1
+
e4ffb1
+    Key arguments:
e4ffb1
+    conn -- connection structure
e4ffb1
+    options -- options dictionary
e4ffb1
+    plug -- plug to sent the message to
e4ffb1
+    message -- message to send
e4ffb1
+
e4ffb1
+    Return Value:
e4ffb1
+    (return_code, out, err) Tuple containing the error code,
e4ffb1
+    """
e4ffb1
+
e4ffb1
+    del conn
e4ffb1
+
e4ffb1
+    arguments = "%s %s" % (plug, message)
e4ffb1
+    cmd = generate_sbd_command(options, "message", arguments)
e4ffb1
+
e4ffb1
+    (return_code, out, err) = run_command(options, cmd)
e4ffb1
+
e4ffb1
+    return (return_code, out, err)
e4ffb1
+
e4ffb1
+def get_msg_timeout(options):
e4ffb1
+    """Reads the configured sbd message timeout from each device.
e4ffb1
+
e4ffb1
+    Key arguments:
e4ffb1
+    options -- options dictionary
e4ffb1
+
e4ffb1
+    Return Value:
e4ffb1
+    msg_timeout (integer, seconds)
e4ffb1
+    """
e4ffb1
+
e4ffb1
+    # get the defined msg_timeout
e4ffb1
+    msg_timeout = -1 # default sbd msg timeout
e4ffb1
+
e4ffb1
+    cmd = generate_sbd_command(options, "dump")
e4ffb1
+
e4ffb1
+    (return_code, out, err) = run_command(options, cmd)
e4ffb1
+
e4ffb1
+    for line in out.split("\n"):
e4ffb1
+        if len(line) == 0:
e4ffb1
+            continue
e4ffb1
+
e4ffb1
+        if "msgwait" in line:
e4ffb1
+            tmp_msg_timeout = int(line.split(':')[1])
e4ffb1
+            if -1 != msg_timeout and tmp_msg_timeout != msg_timeout:
e4ffb1
+                logging.warn(\
e4ffb1
+                        "sbd message timeouts differ in different devices")
e4ffb1
+            # we only save the highest timeout
e4ffb1
+            if tmp_msg_timeout > msg_timeout:
e4ffb1
+                msg_timeout = tmp_msg_timeout
e4ffb1
+
e4ffb1
+    return msg_timeout
e4ffb1
+
e4ffb1
+def set_power_status(conn, options):
e4ffb1
+    """send status to sbd device (poison pill)
e4ffb1
+
e4ffb1
+    Key arguments:
e4ffb1
+    conn -- connection structure
e4ffb1
+    options -- options dictionary
e4ffb1
+
e4ffb1
+    Return Value:
e4ffb1
+    return_code -- action result (bool)
e4ffb1
+    """
e4ffb1
+
e4ffb1
+    target_status = options["--action"]
e4ffb1
+    plug = options["--plug"]
e4ffb1
+    return_code = 99
e4ffb1
+    out = ""
e4ffb1
+    err = ""
e4ffb1
+
e4ffb1
+    # Map fencing actions to sbd messages
e4ffb1
+    if "on" == target_status:
e4ffb1
+        (return_code, out, err) = send_sbd_message(conn, options, plug, "clear")
e4ffb1
+    elif "off" == target_status:
e4ffb1
+        (return_code, out, err) = send_sbd_message(conn, options, plug, "off")
e4ffb1
+    elif "reboot" == target_status:
e4ffb1
+        (return_code, out, err) = send_sbd_message(conn, options, plug, "reset")
e4ffb1
+
e4ffb1
+    if 0 != return_code:
e4ffb1
+        logging.error("sending message to sbd device(s) \
e4ffb1
+                failed with return code %d", return_code)
e4ffb1
+        logging.error("DETAIL: output on stdout was \"%s\"", out)
e4ffb1
+        logging.error("DETAIL: output on stderr was \"%s\"", err)
e4ffb1
+
e4ffb1
+    return not bool(return_code)
e4ffb1
+
e4ffb1
+def reboot_cycle(conn, options):
e4ffb1
+    """" trigger reboot by sbd messages
e4ffb1
+
e4ffb1
+    Key arguments:
e4ffb1
+    conn -- connection structure
e4ffb1
+    options -- options dictionary
e4ffb1
+
e4ffb1
+    Return Value:
e4ffb1
+    return_code -- action result (bool)
e4ffb1
+    """
e4ffb1
+
e4ffb1
+    plug = options["--plug"]
e4ffb1
+    return_code = 99
e4ffb1
+    out = ""
e4ffb1
+    err = ""
e4ffb1
+
e4ffb1
+    (return_code, out, err) = send_sbd_message(conn, options, plug, "reset")
e4ffb1
+    return not bool(return_code)
e4ffb1
+
e4ffb1
+def get_power_status(conn, options):
e4ffb1
+    """Returns the status of a specific node.
e4ffb1
+
e4ffb1
+    Key arguments:
e4ffb1
+    conn -- connection structure
e4ffb1
+    options -- option dictionary
e4ffb1
+
e4ffb1
+    Return Value:
e4ffb1
+    status -- status code (string)
e4ffb1
+    """
e4ffb1
+
e4ffb1
+    status = "UNKWNOWN"
e4ffb1
+    plug = options["--plug"]
e4ffb1
+
e4ffb1
+    nodelist = get_node_list(conn, options)
e4ffb1
+
e4ffb1
+    # We need to check if the specified plug / node a already a allocated slot
e4ffb1
+    # on the device.
e4ffb1
+    if plug not in nodelist:
e4ffb1
+        logging.error("node \"%s\" not found in node list", plug)
e4ffb1
+    else:
e4ffb1
+        status = nodelist[plug][1]
e4ffb1
+
e4ffb1
+
e4ffb1
+    return status
e4ffb1
+
e4ffb1
+def translate_status(sbd_status):
e4ffb1
+    """Translates the sbd status to fencing status.
e4ffb1
+
e4ffb1
+    Key arguments:
e4ffb1
+    sbd_status -- status to translate (string)
e4ffb1
+
e4ffb1
+    Return Value:
e4ffb1
+    status -- fencing status (string)
e4ffb1
+    """
e4ffb1
+
e4ffb1
+    status = "UNKNOWN"
e4ffb1
+
e4ffb1
+
e4ffb1
+    # Currently we only accept "clear" to be marked as online. Eventually we
e4ffb1
+    # should also check against "test"
e4ffb1
+    online_status = ["clear"]
e4ffb1
+
e4ffb1
+    offline_status = ["reset", "off"]
e4ffb1
+
e4ffb1
+    if any(online_status_element in sbd_status \
e4ffb1
+            for online_status_element in online_status):
e4ffb1
+        status = "on"
e4ffb1
+
e4ffb1
+    if any(offline_status_element in sbd_status \
e4ffb1
+            for offline_status_element in offline_status):
e4ffb1
+        status = "off"
e4ffb1
+
e4ffb1
+    return status
e4ffb1
+
e4ffb1
+def get_node_list(conn, options):
e4ffb1
+    """Returns a list of hostnames, registerd on the sbd device.
e4ffb1
+
e4ffb1
+    Key arguments:
e4ffb1
+    conn -- connection options
e4ffb1
+    options -- options
e4ffb1
+
e4ffb1
+    Return Value:
e4ffb1
+    nodelist -- dictionary wich contains all node names and there status
e4ffb1
+    """
e4ffb1
+
e4ffb1
+    del conn
e4ffb1
+
e4ffb1
+    nodelist = {}
e4ffb1
+
e4ffb1
+    cmd = generate_sbd_command(options, "list")
e4ffb1
+
e4ffb1
+    (return_code, out, err) = run_command(options, cmd)
e4ffb1
+
e4ffb1
+    for line in out.split("\n"):
e4ffb1
+        if len(line) == 0:
e4ffb1
+            continue
e4ffb1
+
e4ffb1
+        # if we read "unreadable" something went wrong
e4ffb1
+        if "NOT dumped" in line:
e4ffb1
+            return nodelist
e4ffb1
+
e4ffb1
+        words = line.split()
e4ffb1
+        port = words[1]
e4ffb1
+        sbd_status = words[2]
e4ffb1
+        nodelist[port] = (port, translate_status(sbd_status))
e4ffb1
+
e4ffb1
+    return nodelist
e4ffb1
+
e4ffb1
+def parse_sbd_devices(options):
e4ffb1
+    """Returns an array of all sbd devices.
e4ffb1
+
e4ffb1
+    Key arguments:
e4ffb1
+    options -- options dictionary
e4ffb1
+
e4ffb1
+    Return Value:
e4ffb1
+    devices -- array of device paths
e4ffb1
+    """
e4ffb1
+
e4ffb1
+    devices = [str.strip(dev) \
e4ffb1
+            for dev in str.split(options["--devices"], ",")]
e4ffb1
+
e4ffb1
+    return devices
e4ffb1
+
e4ffb1
+def define_new_opts():
e4ffb1
+    """Defines the all opt list
e4ffb1
+    """
e4ffb1
+    all_opt["devices"] = {
e4ffb1
+        "getopt" : ":",
e4ffb1
+        "longopt" : "devices",
e4ffb1
+        "help":"--devices=[device_a,device_b] \
e4ffb1
+Comma separated list of sbd devices",
e4ffb1
+        "required" : "1",
e4ffb1
+        "shortdesc" : "SBD Device",
e4ffb1
+        "order": 1
e4ffb1
+        }
e4ffb1
+
e4ffb1
+    all_opt["sbd_path"] = {
e4ffb1
+        "getopt" : ":",
e4ffb1
+        "longopt" : "sbd-path",
e4ffb1
+        "help" : "--sbd-path=[path]              Path to SBD binary",
e4ffb1
+        "required" : "0",
e4ffb1
+        "default" : "/usr/sbin/sbd",
e4ffb1
+        "shortdesc" : "Path to SBD binary",
e4ffb1
+        "order": 200
e4ffb1
+        }
e4ffb1
+
e4ffb1
+def main():
e4ffb1
+    """Main function
e4ffb1
+    """
e4ffb1
+    # We need to define "no_password" otherwise we will be ask about it if
e4ffb1
+    # we don't provide any password.
e4ffb1
+    device_opt = ["no_password", "devices", "port", "method", "sbd_path"]
e4ffb1
+
e4ffb1
+    # close stdout if we get interrupted
e4ffb1
+    atexit.register(atexit_handler)
e4ffb1
+
e4ffb1
+    define_new_opts()
e4ffb1
+
e4ffb1
+    all_opt["method"]["default"] = "cycle"
e4ffb1
+    all_opt["method"]["help"] = "-m, --method=[method]          Method to fence (onoff|cycle) (Default: cycle)"
e4ffb1
+
e4ffb1
+    options = check_input(device_opt, process_input(device_opt))
e4ffb1
+
e4ffb1
+    # fill the needed variables to generate metadata and help text output
e4ffb1
+    docs = {}
e4ffb1
+    docs["shortdesc"] = "Fence agent for sbd"
e4ffb1
+    docs["longdesc"] = "fence_sbd is I/O Fencing agent \
e4ffb1
+which can be used in environments where sbd can be used (shared storage)."
e4ffb1
+    docs["vendorurl"] = ""
e4ffb1
+    show_docs(options, docs)
e4ffb1
+
e4ffb1
+    # We need to check if --devices is given and not empty.
e4ffb1
+    if "--devices" not in options:
e4ffb1
+        fail_usage("No SBD devices specified. \
e4ffb1
+                At least one SBD device is required.")
e4ffb1
+
e4ffb1
+    run_delay(options)
e4ffb1
+
e4ffb1
+    # We need to check if the provided sbd_devices exists. We need to do
e4ffb1
+    # that for every given device.
e4ffb1
+    for device_path in parse_sbd_devices(options):
e4ffb1
+        logging.debug("check device \"%s\"", device_path)
e4ffb1
+
e4ffb1
+        return_code = check_sbd_device(options, device_path)
e4ffb1
+        if PATH_NOT_EXISTS == return_code:
e4ffb1
+            logging.error("\"%s\" does not exist", device_path)
e4ffb1
+        elif PATH_NOT_BLOCK == return_code:
e4ffb1
+            logging.error("\"%s\" is not a valid block device", device_path)
e4ffb1
+        elif DEVICE_NOT_INIT == return_code:
e4ffb1
+            logging.error("\"%s\" is not initialized", device_path)
e4ffb1
+        elif DEVICE_INIT != return_code:
e4ffb1
+            logging.error("UNKNOWN error while checking \"%s\"", device_path)
e4ffb1
+
e4ffb1
+        # If we get any error while checking the device we need to exit at this
e4ffb1
+        # point.
e4ffb1
+        if DEVICE_INIT != return_code:
e4ffb1
+            exit(return_code)
e4ffb1
+
e4ffb1
+    # we check against the defined timeouts. If the pacemaker timeout is smaller
e4ffb1
+    # then that defined within sbd we should report this.
e4ffb1
+    power_timeout = int(options["--power-timeout"])
e4ffb1
+    sbd_msg_timeout = get_msg_timeout(options)
e4ffb1
+    if power_timeout <= sbd_msg_timeout:
e4ffb1
+        logging.warn("power timeout needs to be \
e4ffb1
+                greater then sbd message timeout")
e4ffb1
+
e4ffb1
+    result = fence_action(\
e4ffb1
+                None, \
e4ffb1
+                options, \
e4ffb1
+                set_power_status, \
e4ffb1
+                get_power_status, \
e4ffb1
+                get_node_list, \
e4ffb1
+                reboot_cycle)
e4ffb1
+
e4ffb1
+    sys.exit(result)
e4ffb1
+
e4ffb1
+if __name__ == "__main__":
e4ffb1
+    main()
e4ffb1
diff -uNr a/fence/agents/sbd/Makefile.am b/fence/agents/sbd/Makefile.am
e4ffb1
--- a/fence/agents/sbd/Makefile.am	1970-01-01 01:00:00.000000000 +0100
e4ffb1
+++ b/fence/agents/sbd/Makefile.am	2017-01-16 16:19:09.079326886 +0100
e4ffb1
@@ -0,0 +1,17 @@
e4ffb1
+MAINTAINERCLEANFILES	= Makefile.in
e4ffb1
+
e4ffb1
+TARGET			= fence_sbd
e4ffb1
+
e4ffb1
+SRC			= $(TARGET).py
e4ffb1
+
e4ffb1
+EXTRA_DIST		= $(SRC)
e4ffb1
+
e4ffb1
+sbin_SCRIPTS		= $(TARGET)
e4ffb1
+
e4ffb1
+man_MANS		= $(TARGET).8
e4ffb1
+
e4ffb1
+FENCE_TEST_ARGS         = -n test --devices test
e4ffb1
+
e4ffb1
+include $(top_srcdir)/make/fencebuild.mk
e4ffb1
+include $(top_srcdir)/make/fenceman.mk
e4ffb1
+include $(top_srcdir)/make/agentpycheck.mk
e4ffb1
diff -uNr a/tests/data/metadata/fence_sbd.xml b/tests/data/metadata/fence_sbd.xml
e4ffb1
--- a/tests/data/metadata/fence_sbd.xml	1970-01-01 01:00:00.000000000 +0100
e4ffb1
+++ b/tests/data/metadata/fence_sbd.xml	2017-01-16 16:31:45.855219543 +0100
e4ffb1
@@ -0,0 +1,101 @@
e4ffb1
+
e4ffb1
+<resource-agent name="fence_sbd" shortdesc="Fence agent for sbd" >
e4ffb1
+<longdesc>fence_sbd is I/O Fencing agent which can be used in environments where sbd can be used (shared storage).</longdesc>
e4ffb1
+<vendor-url></vendor-url>
e4ffb1
+<parameters>
e4ffb1
+	<parameter name="action" unique="0" required="1">
e4ffb1
+		<getopt mixed="-o, --action=[action]" />
e4ffb1
+		<content type="string" default="reboot"  />
e4ffb1
+		<shortdesc lang="en">Fencing action</shortdesc>
e4ffb1
+	</parameter>
e4ffb1
+	<parameter name="devices" unique="0" required="1">
e4ffb1
+		<getopt mixed="--devices=[device_a,device_b]" />
e4ffb1
+		<content type="string"  />
e4ffb1
+		<shortdesc lang="en">SBD Device</shortdesc>
e4ffb1
+	</parameter>
e4ffb1
+	<parameter name="method" unique="0" required="0">
e4ffb1
+		<getopt mixed="-m, --method=[method]" />
e4ffb1
+		<content type="select" default="cycle"  >
e4ffb1
+			<option value="onoff" />
e4ffb1
+			<option value="cycle" />
e4ffb1
+		</content>
e4ffb1
+		<shortdesc lang="en">Method to fence</shortdesc>
e4ffb1
+	</parameter>
e4ffb1
+	<parameter name="port" unique="0" required="1">
e4ffb1
+		<getopt mixed="-n, --plug=[id]" />
e4ffb1
+		<content type="string"  />
e4ffb1
+		<shortdesc lang="en">Physical plug number on device, UUID or identification of machine</shortdesc>
e4ffb1
+	</parameter>
e4ffb1
+	<parameter name="verbose" unique="0" required="0">
e4ffb1
+		<getopt mixed="-v, --verbose" />
e4ffb1
+		<content type="boolean"  />
e4ffb1
+		<shortdesc lang="en">Verbose mode</shortdesc>
e4ffb1
+	</parameter>
e4ffb1
+	<parameter name="debug" unique="0" required="0">
e4ffb1
+		<getopt mixed="-D, --debug-file=[debugfile]" />
e4ffb1
+		<content type="string"  />
e4ffb1
+		<shortdesc lang="en">Write debug information to given file</shortdesc>
e4ffb1
+	</parameter>
e4ffb1
+	<parameter name="version" unique="0" required="0">
e4ffb1
+		<getopt mixed="-V, --version" />
e4ffb1
+		<content type="boolean"  />
e4ffb1
+		<shortdesc lang="en">Display version information and exit</shortdesc>
e4ffb1
+	</parameter>
e4ffb1
+	<parameter name="help" unique="0" required="0">
e4ffb1
+		<getopt mixed="-h, --help" />
e4ffb1
+		<content type="boolean"  />
e4ffb1
+		<shortdesc lang="en">Display help and exit</shortdesc>
e4ffb1
+	</parameter>
e4ffb1
+	<parameter name="separator" unique="0" required="0">
e4ffb1
+		<getopt mixed="-C, --separator=[char]" />
e4ffb1
+		<content type="string" default=","  />
e4ffb1
+		<shortdesc lang="en">Separator for CSV created by 'list' operation</shortdesc>
e4ffb1
+	</parameter>
e4ffb1
+	<parameter name="delay" unique="0" required="0">
e4ffb1
+		<getopt mixed="--delay=[seconds]" />
e4ffb1
+		<content type="string" default="0"  />
e4ffb1
+		<shortdesc lang="en">Wait X seconds before fencing is started</shortdesc>
e4ffb1
+	</parameter>
e4ffb1
+	<parameter name="login_timeout" unique="0" required="0">
e4ffb1
+		<getopt mixed="--login-timeout=[seconds]" />
e4ffb1
+		<content type="string" default="5"  />
e4ffb1
+		<shortdesc lang="en">Wait X seconds for cmd prompt after login</shortdesc>
e4ffb1
+	</parameter>
e4ffb1
+	<parameter name="power_timeout" unique="0" required="0">
e4ffb1
+		<getopt mixed="--power-timeout=[seconds]" />
e4ffb1
+		<content type="string" default="20"  />
e4ffb1
+		<shortdesc lang="en">Test X seconds for status change after ON/OFF</shortdesc>
e4ffb1
+	</parameter>
e4ffb1
+	<parameter name="power_wait" unique="0" required="0">
e4ffb1
+		<getopt mixed="--power-wait=[seconds]" />
e4ffb1
+		<content type="string" default="0"  />
e4ffb1
+		<shortdesc lang="en">Wait X seconds after issuing ON/OFF</shortdesc>
e4ffb1
+	</parameter>
e4ffb1
+	<parameter name="sbd_path" unique="0" required="0">
e4ffb1
+		<getopt mixed="--sbd-path=[path]" />
e4ffb1
+		<content type="string" default="/usr/sbin/sbd"  />
e4ffb1
+		<shortdesc lang="en">Path to SBD binary</shortdesc>
e4ffb1
+	</parameter>
e4ffb1
+	<parameter name="shell_timeout" unique="0" required="0">
e4ffb1
+		<getopt mixed="--shell-timeout=[seconds]" />
e4ffb1
+		<content type="string" default="3"  />
e4ffb1
+		<shortdesc lang="en">Wait X seconds for cmd prompt after issuing command</shortdesc>
e4ffb1
+	</parameter>
e4ffb1
+	<parameter name="retry_on" unique="0" required="0">
e4ffb1
+		<getopt mixed="--retry-on=[attempts]" />
e4ffb1
+		<content type="string" default="1"  />
e4ffb1
+		<shortdesc lang="en">Count of attempts to retry power on</shortdesc>
e4ffb1
+	</parameter>
e4ffb1
+</parameters>
e4ffb1
+<actions>
e4ffb1
+	<action name="on" automatic="0"/>
e4ffb1
+	<action name="off" />
e4ffb1
+	<action name="reboot" />
e4ffb1
+	<action name="status" />
e4ffb1
+	<action name="list" />
e4ffb1
+	<action name="list-status" />
e4ffb1
+	<action name="monitor" />
e4ffb1
+	<action name="metadata" />
e4ffb1
+	<action name="validate-all" />
e4ffb1
+</actions>
e4ffb1
+</resource-agent>