fence_scsi - Man Page
Fence agent for SCSI persistent reservation
Description
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). Reservation key is generated from "node id" (default) or from "node name hash" (RECOMMENDED) by adjusting "key_value" option. Using hash is recommended to prevent issues when removing nodes from cluster without full cluster restart. 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.
When used as a watchdog device you can define e.g. retry=1, retry-sleep=2 and verbose=yes parameters in /etc/sysconfig/stonith if you have issues with it failing.
The fence agent accepts options on the command line as well as from stdin. Fenced sends parameters through stdin when it execs the agent. The agent can be run by itself with command line options. This is useful for testing and for turning outlets on or off from scripts.
Vendor URL:
Parameters
- -o, --action=[action]
Fencing action (Default Value: off)
- -a, --aptpl
Use the APTPL flag for registrations. This option is only used for the 'on' action.
- -d, --devices=[devices]
List of devices to use for current operation. Devices can be comma or space separated list of raw devices (eg. /dev/sdc). Each device must support SCSI-3 persistent reservations. Optional if cluster is configured with clvm or lvmlockd.
- -k, --key=[key]
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).
- -n, --plug=[nodename]
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. This parameter is always required.
- --readonly
Open DEVICE read-only.
- --suppress-errors
Error log suppression.
- -f, --logfile
Log output (stdout and stderr) to file
- -q, --quiet
Disable logging to stderr. Does not affect --verbose or --debug-file or logging to syslog.
- -v, --verbose
Verbose mode. Multiple -v flags can be stacked on the command line (e.g., -vvv) to increase verbosity.
- --verbose-level
Level of debugging detail in output. Defaults to the number of --verbose flags specified on the command line, or to 1 if verbose=1 in a stonith device configuration (i.e., on stdin).
- -D, --debug-file=[debugfile]
Write debug information to given file
- -V, --version
Display version information and exit
- -h, --help
Display help and exit
- --plug-separator=[char]
Separator for plug parameter when specifying more than 1 plug (Default Value: ,)
- --delay=[seconds]
Wait X seconds before fencing is started (Default Value: 0)
- --disable-timeout=[true/false]
Disable timeout (true/false) (default: true when run from Pacemaker 2.0+)
- --login-timeout=[seconds]
Wait X seconds for cmd prompt after login (Default Value: 5)
- --power-timeout=[seconds]
Test X seconds for status change after ON/OFF (Default Value: 20)
- --power-wait=[seconds]
Wait X seconds after issuing ON/OFF (Default Value: 0)
- --shell-timeout=[seconds]
Wait X seconds for cmd prompt after issuing command (Default Value: 3)
- --stonith-status-sleep=[seconds]
Sleep X seconds between status calls during a STONITH action (Default Value: 1)
- --retry-on=[attempts]
Count of attempts to retry power on (Default Value: 1)
- --corosync-cmap-path=[path]
Path to corosync-cmapctl binary (Default Value: /usr/sbin/corosync-cmapctl)
- --key-value=<id|hash>
Method used to generate the SCSI key. "id" (default) uses the positional ID from "corosync-cmactl nodelist" output which can get inconsistent when nodes are removed from cluster without full cluster restart. "hash" uses part of hash made out of node names which is not affected over time but there is theoretical chance that hashes can collide as size of SCSI key is quite limited. (Default Value: id)
- --sg_persist-path=[path]
Path to sg_persist binary (Default Value: /usr/bin/sg_persist)
- --sg_turs-path=[path]
Path to sg_turs binary (Default Value: /usr/bin/sg_turs)
- --vgs-path=[path]
Path to vgs binary (Default Value: /usr/sbin/vgs)
Actions
- on
Power on machine.
- off
Power off machine.
- status
This returns the status of the plug/virtual machine.
- monitor
Check the health of fence device
- metadata
Display the XML metadata describing this resource.
- manpage
The operational behavior of this is not known.
- validate-all
Validate if all required parameters are entered.
Stdin Parameters
- action
Fencing action (Default Value: off)
- aptpl
Use the APTPL flag for registrations. This option is only used for the 'on' action.
- devices
List of devices to use for current operation. Devices can be comma or space separated list of raw devices (eg. /dev/sdc). Each device must support SCSI-3 persistent reservations. Optional if cluster is configured with clvm or lvmlockd.
- key
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).
- plug
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. This parameter is always required. Obsoletes: port
- readonly
Open DEVICE read-only.
- suppress_errors
Error log suppression. Obsoletes: suppress-errors
- logfile
Log output (stdout and stderr) to file
- quiet
Disable logging to stderr. Does not affect --verbose or --debug-file or logging to syslog.
- verbose
Verbose mode. Multiple -v flags can be stacked on the command line (e.g., -vvv) to increase verbosity.
- verbose_level
Level of debugging detail in output. Defaults to the number of --verbose flags specified on the command line, or to 1 if verbose=1 in a stonith device configuration (i.e., on stdin).
- debug_file
Write debug information to given file Obsoletes: debug
- version
Display version information and exit
- help
Display help and exit
- plug_separator
Separator for plug parameter when specifying more than 1 plug (Default Value: ,)
- delay
Wait X seconds before fencing is started (Default Value: 0)
- disable_timeout
Disable timeout (true/false) (default: true when run from Pacemaker 2.0+)
- login_timeout
Wait X seconds for cmd prompt after login (Default Value: 5)
- power_timeout
Test X seconds for status change after ON/OFF (Default Value: 20)
- power_wait
Wait X seconds after issuing ON/OFF (Default Value: 0)
- shell_timeout
Wait X seconds for cmd prompt after issuing command (Default Value: 3)
- stonith_status_sleep
Sleep X seconds between status calls during a STONITH action (Default Value: 1)
- retry_on
Count of attempts to retry power on (Default Value: 1)
- corosync_cmap_path
Path to corosync-cmapctl binary (Default Value: /usr/sbin/corosync-cmapctl)
- key_value
Method used to generate the SCSI key. "id" (default) uses the positional ID from "corosync-cmactl nodelist" output which can get inconsistent when nodes are removed from cluster without full cluster restart. "hash" uses part of hash made out of node names which is not affected over time but there is theoretical chance that hashes can collide as size of SCSI key is quite limited. (Default Value: id)
- sg_persist_path
Path to sg_persist binary (Default Value: /usr/bin/sg_persist)
- sg_turs_path
Path to sg_turs binary (Default Value: /usr/bin/sg_turs)
- vgs_path
Path to vgs binary (Default Value: /usr/sbin/vgs)