This chapter tells you how to define a new resource type:
It also tells you how to test the results in Section 4.4.
To define a new resource type, you must have the following information:
Name of the resource type. The name can consist of alphanumeric characters and any of the following:
- (hyphen)
_ (underscore)
/
.
:
"
=
@
,
The name cannot contain a space, an unprintable character, or any of the following characters:
*
?
\
#
Name of the cluster to which the resource type will apply.
If the resource type is to be restricted to a specific node, you must know the node name.
Order of performing the action scripts for resources of this type in relation to resources of other types:
Resources are started in the increasing order of this value
Resources are stopped in the decreasing order of this value
Ensure that the number you choose for a new resource type permits the resource types on which it depends to be started before it is started, or stopped after it is stopped, as appropriate.
Table 4-1 shows the conventions used for order ranges. The values available for customer use are 201-400 and 701-999.
Table 4-1. Order Ranges
Range | Reservation |
|---|---|
1-100 | SGI-provided basic system resource types, such as MAC_address |
101-200 | SGI-provided system plug-ins that can be started before IP_address |
201-400 | User-defined resource types that can be started before IP_address |
401-500 | SGI-provided basic system resource types, such as IP_address |
501-700 | SGI-provided system plug-ins that must be started after IP_address |
701-999 | User-defined resource types that must be started after IP_address |
Table 4-2 shows the order numbers of the resource types provided with the release or available as plug-ins from SGI.
Restart mode, which can be one of the following values:
0 = Do not restart on monitoring failures
1 = Restart a fixed number of times
Number of local restarts (when restart mode is 1).
Location of the executable script. This is always /usr/lib/failsafe/resource_types/resource_type_tname .
Monitoring interval, which is the time period (in milliseconds) between successive executions of the monitor action script; this is only valid for the monitor action script.
Starting time for monitoring. When the resource group is made online in a cluster node, Linux FailSafe will start monitoring the resources after the specified time period (in milliseconds).
Action scripts to be defined for this resource type. You must specify scripts for start, stop, exclusive, and monitor, although the monitor script may contain only a return-success function if you wish. If you specify 1 for the restart mode, you must specify a restart script.
Type-specific attributes to be defined for this resource type. The action scripts use this information to start, stop, and monitor a resource of this resource type. For example, NFS requires the following resource keys:
export-info which takes a value that defines the export options for the file system. These options are used in the kexportfs command. For example:
export-info = rw,wsync,anon=root |
filesystem which takes a value that defines the raw file system. This name is used as input to the mount command. For example:
filesystem = /dev/xlv/xlv_object |