Linux-HA Logo

STONITH Plugins

Configuring STONITH plugins

To see the list of STONITH device types (plugins) that Linux-HA supports for your system, run "stonith -L" which will produce output similar to the following:

apcmaster
apcmastersnmp
apcsmart
baytech
cyclades
external/riloe
external/ssh
ibmbc
ibmhmc
meatware
null
nw_rpc100s
rcd_serial
rps10
ssh
suicide
wti_nps

If you have the hardware to exploit one of the available plugins, you will need to determine what parameters the device requires in order to be successfully configured. To do so, run "stonith -h" which will produce detailed output for all of the available plugins. You are interested in the list of valid parameter names for the STONITH device in question, similar to the following for ibmhmc:

List of valid parameter names for ibmhmc STONITH device:
        ipaddr

Acquire the necessary information to satisfy the listed parameter names. To verify the validity of the information, check it with "stonith -l" to make sure the list of hosts controlled by this plugin is correct. For example, running the R1-style command:

stonith -t ibmhmc -p "9.254.253.252" -l

should produce output similar to the following:

node1
node2
node3

as should the R2-style command:

stonith -t ibmhmc ipaddr=9.254.253.252 -l

If the list of hosts is correct, you are ready to configure your plugin. If not, examine any terminal output and the logs to determine what is amiss.

R1 (legacy) configuration

The following examples are based off the ibmhmc plugin, part of whose -h output is shown above. To configure the plugin on an R1 (legacy) cluster, you will need to use either the stonith[1] or stonith_host[2] directive in ha.cf[3]. For example, to use the stonith directive to configure the ibmhmc device, add a line similar to the following to /etc/ha.d/ha.cf:

stonith ibmhmc /etc/ha.d/ibmhmc.cfg

where /etc/ha.d/ibmhmc.cfg contains a single line with all of the plugin's parameters:

9.254.253.252

To use the stonith_host directive to configure the ibmhmc device, add a line similar to the following to /etc/ha.d/ha.cf:

stonith_host * ibmhmc 9.254.253.252

where all of the plugin's parameters are placed at the end of the line.

Please note that all parameters are accessible to the plugin in name/value form, but in R1 configurations they appear as a list of parameters. They are ordered in the config file or on the stonith_host line according to the ordering specified in the output of the "stonith -h" invocation with any optional parameters defined after required ones.

You are now ready to start Linux-HA and take advantage of your newly configured STONITH device.

R2 configuration

The following example is based off the ibmhmc plugin, part of whose -h output is shown above. To configure the plugin on an R2 cluster, place lines similar to the following into the <resources> section of your CIB, which is contained in /var/lib/heartbeat/crm/cib.xml:

<clone id="DoFencing">
  <instance_attributes>
    <attributes>
      <nvpair name="clone_max" value="2"/>
      <nvpair name="clone_node_max" value="1"/>
    </attributes>
  </instance_attributes>
  <primitive id="child_DoFencing" class="stonith" type="ibmhmc" provider="heartbeat">
    <operations>
      <op name="monitor" interval="5s" timeout="20s" prereq="nothing"/>
      <op name="start" timeout="20s" prereq="nothing"/>
    </operations>
    <instance_attributes>
      <attributes>
        <nvpair name="ipaddr" value="9.254.253.252"/>
      </attributes>
    </instance_attributes>
  </primitive>
</clone>

Whatever <nvpair> parameters specified in the <attributes> section of the CIB are accessible to the plugin as name/value pairs.

You are now ready to start Linux-HA and take advantage of your newly configured STONITH device.


References

[1]http://www.linux-ha.org/ha.cf/StonithDirective
[2]http://www.linux-ha.org/ha.cf/StonithHostDirective
[3]http://www.linux-ha.org/ha.cf


This information provided courtesy of the Linux-HA project at http://linux-ha.org/