<resource-agent name="fence_scsi" shortdesc="Fence agent for SCSI persistent reservation">
  <longdesc>
    fence_scsi is an I/O fencing agent that uses SCSI-3 persistent reservations to control access to shared storage devices. These devices must support SCSI-3 persistent reservations (SPC-3 or greater) as well as the "preempt-and-abort" subcommand.
The fence_scsi agent works by having each node in the cluster register a unique key with the SCSI device(s). Once registered, a single node will become the reservation holder by creating a "write exclusive, registrants only" reservation on the device(s). The result is that only registered nodes may write to the device(s). When a node failure occurs, the fence_scsi agent will remove the key belonging to the failed node from the device(s). The failed node will no longer be able to write to the device(s). A manual reboot is required.
  </longdesc>
  <vendor-url/>
  <parameters>
    <parameter name="action" unique="0" required="1">
      <getopt mixed="-o, --action=[action]"/>
      <content type="string" default="off"/>
      <shortdesc lang="en">
        Fencing action
      </shortdesc>
    </parameter>
    <parameter name="aptpl" unique="0" required="0">
      <getopt mixed="-a, --aptpl"/>
      <content type="boolean"/>
      <shortdesc lang="en">
        Use the APTPL flag for registrations. This option is only used for the 'on' action.
      </shortdesc>
    </parameter>
    <parameter name="devices" unique="0" required="0">
      <getopt mixed="-d, --devices=[devices]"/>
      <content type="string"/>
      <shortdesc lang="en">
        List of devices to use for current operation. Devices can be comma-separated list of raw devices (eg. /dev/sdc). Each device must support SCSI-3 persistent reservations.
      </shortdesc>
    </parameter>
    <parameter name="key" unique="0" required="0">
      <getopt mixed="-k, --key=[key]"/>
      <content type="string"/>
      <shortdesc lang="en">
        Key to use for the current operation. This key should be unique to a node. For the "on" action, the key specifies the key use to register the local node. For the "off" action, this key specifies the key to be removed from the device(s).
      </shortdesc>
    </parameter>
    <parameter name="plug" unique="0" required="1" obsoletes="port">
      <getopt mixed="-n, --plug=[nodename]"/>
      <content type="string"/>
      <shortdesc lang="en">
        Name of the node to be fenced. The node name is used to generate the key value used for the current operation. This option will be ignored when used with the -k option.
      </shortdesc>
    </parameter>
    <parameter name="port" unique="0" required="0" deprecated="1">
      <getopt mixed="-n, --plug=[nodename]"/>
      <content type="string"/>
      <shortdesc lang="en">
        Name of the node to be fenced. The node name is used to generate the key value used for the current operation. This option will be ignored when used with the -k option.
      </shortdesc>
    </parameter>
    <parameter name="logfile" unique="0" required="0">
      <getopt mixed="-f, --logfile"/>
      <content type="string"/>
      <shortdesc lang="en">
        Log output (stdout and stderr) to file
      </shortdesc>
    </parameter>
    <parameter name="quiet" unique="0" required="0">
      <getopt mixed="-q, --quiet"/>
      <content type="boolean"/>
      <shortdesc lang="en">
        Disable logging to stderr. Does not affect --verbose or --debug-file or logging to syslog.
      </shortdesc>
    </parameter>
    <parameter name="verbose" unique="0" required="0">
      <getopt mixed="-v, --verbose"/>
      <content type="boolean"/>
      <shortdesc lang="en">
        Verbose mode
      </shortdesc>
    </parameter>
    <parameter name="debug" unique="0" required="0" deprecated="1">
      <getopt mixed="-D, --debug-file=[debugfile]"/>
      <content type="string"/>
      <shortdesc lang="en">
        Write debug information to given file
      </shortdesc>
    </parameter>
    <parameter name="debug_file" unique="0" required="0" obsoletes="debug">
      <getopt mixed="-D, --debug-file=[debugfile]"/>
      <content type="string"/>
      <shortdesc lang="en">
        Write debug information to given file
      </shortdesc>
    </parameter>
    <parameter name="version" unique="0" required="0">
      <getopt mixed="-V, --version"/>
      <content type="boolean"/>
      <shortdesc lang="en">
        Display version information and exit
      </shortdesc>
    </parameter>
    <parameter name="help" unique="0" required="0">
      <getopt mixed="-h, --help"/>
      <content type="boolean"/>
      <shortdesc lang="en">
        Display help and exit
      </shortdesc>
    </parameter>
    <parameter name="delay" unique="0" required="0">
      <getopt mixed="--delay=[seconds]"/>
      <content type="second" default="0"/>
      <shortdesc lang="en">
        Wait X seconds before fencing is started
      </shortdesc>
    </parameter>
    <parameter name="login_timeout" unique="0" required="0">
      <getopt mixed="--login-timeout=[seconds]"/>
      <content type="second" default="5"/>
      <shortdesc lang="en">
        Wait X seconds for cmd prompt after login
      </shortdesc>
    </parameter>
    <parameter name="power_timeout" unique="0" required="0">
      <getopt mixed="--power-timeout=[seconds]"/>
      <content type="second" default="20"/>
      <shortdesc lang="en">
        Test X seconds for status change after ON/OFF
      </shortdesc>
    </parameter>
    <parameter name="power_wait" unique="0" required="0">
      <getopt mixed="--power-wait=[seconds]"/>
      <content type="second" default="0"/>
      <shortdesc lang="en">
        Wait X seconds after issuing ON/OFF
      </shortdesc>
    </parameter>
    <parameter name="shell_timeout" unique="0" required="0">
      <getopt mixed="--shell-timeout=[seconds]"/>
      <content type="second" default="3"/>
      <shortdesc lang="en">
        Wait X seconds for cmd prompt after issuing command
      </shortdesc>
    </parameter>
    <parameter name="retry_on" unique="0" required="0">
      <getopt mixed="--retry-on=[attempts]"/>
      <content type="integer" default="1"/>
      <shortdesc lang="en">
        Count of attempts to retry power on
      </shortdesc>
    </parameter>
    <parameter name="corosync_cmap_path" unique="0" required="0">
      <getopt mixed="--corosync-cmap-path=[path]"/>
      <content type="string" default="/usr/sbin/corosync-cmapctl"/>
      <shortdesc lang="en">
        Path to corosync-cmapctl binary
      </shortdesc>
    </parameter>
    <parameter name="sg_persist_path" unique="0" required="0">
      <getopt mixed="--sg_persist-path=[path]"/>
      <content type="string" default="/usr/bin/sg_persist"/>
      <shortdesc lang="en">
        Path to sg_persist binary
      </shortdesc>
    </parameter>
    <parameter name="sg_turs_path" unique="0" required="0">
      <getopt mixed="--sg_turs-path=[path]"/>
      <content type="string" default="/usr/bin/sg_turs"/>
      <shortdesc lang="en">
        Path to sg_turs binary
      </shortdesc>
    </parameter>
    <parameter name="vgs_path" unique="0" required="0">
      <getopt mixed="--vgs-path=[path]"/>
      <content type="string" default="/usr/sbin/vgs"/>
      <shortdesc lang="en">
        Path to vgs binary
      </shortdesc>
    </parameter>
  </parameters>
  <actions>
    <action name="on" on_target="1" automatic="1"/>
    <action name="off"/>
    <action name="status"/>
    <action name="monitor"/>
    <action name="metadata"/>
    <action name="manpage"/>
    <action name="validate-all"/>
    <action name="stop" timeout="20s"/>
    <action name="start" timeout="20s"/>
  </actions>
</resource-agent>

