Scroll to navigation

sap_cluster_connector(8) SAP High Availability sap_cluster_connector(8)

NAME

sap_cluster_connector - handle sapstartsrv cluster calls

SYNOPSIS

sap_cluster_connector command options-and-parameters

DESCRIPTION

sap_cluster_connector is the interface between the SAP HA Interface and the cluster software. Currently it needs to serve calls like queries about cluster status or to request cluster resource actions.

COMMANDS

help or --help or -h or -? print help text and usage.

init check cluster installation and do some optional initialization.

gvi --out FILE get version info. This command is needed since version 2 of the sap script connector API.

hcc --out FILE --sid SID --ino INO perform ha configuration checks. This command is needed since version 2 of the sap script connector API.

lsn --out FILE --res RES list sap nodes for specified resource.

lsr --out FILE --sid SID --ino INO list sap resources matching the search criteria.

cpa --res RES --act ACT check for specified pending/active actions in the cluster.

fra --res RES --act ACT [ --nod NODE ] fire/start a cluster action like start/stop/migrate a resource

smm --out FILE --sid SID --ino INSTNO --mod NMODE set/get maintenance mode. This command is used since version 3 of the sap script connector API.

PARAMS

SID SAP System Identifier (3 alphanum)

INO SAP Instance Number (2 digits)

ACT Cluster action "start", "stop" or "migrate"

FILE Outputfile for result parsing

RES Cluster Resource Identifier

NODE Cluster Node Name

NMODE Maintenance mode action (-1: don't set mode, just return actual mode, 0: deactivate mode, 1: activate mode)

OUTPUT FIELDS

Some commands need to generate formatted output to be parsed by the SAP library calling this script. The fields of such output are:

CHK-STATE Status of an HA check (see SAP Interface description)

CHK-CATEGORY Category of an HA check (see SAP Interface description)

CHK-DESCRIPTION Description of an HA check (see SAP Interface description)

CHK-COMMENT Comment about HA check result (see SAP Interface description)

CLUSTER_NODES List of NODE (separated with comma (,)) within the cluster that could run the resource

CURR_NODE NODE which is currently running the resource

GRPID Cluster Group Identifier

HAPROD HA product and version

HAPROD-DOC Documentation URL and SAP Note

HAPROD-SAP SAP-HA Interface product and version

HASCRIPTCO-VERS HA script connector protocol version. Must be 3 for current version.

INSTNO SAP Instance Number (2 digits)

MM-STATE Status of maintenance mode (0: inactive, 1: active, 2: divergent); in case the mode is set, the previous mode is returned

PRIO_NODES Priorized List of NODE (separated with comma (,)) within the cluster that could run the resource

RESID Cluster Resource Identifier

SID SAP system identifier (3 alphanum)

COMMANDS IN DETAIL

init (initialize)

Perform some basic tests, if the cluster software is installed and the cluster framework is started. This is not intended to do a cluster validation. The command should only check, whether the cluster commands used are available. The check "cluster framework strarted?" might be ignored - maybe it does not fit for some cluster architectures. In that case the check only needs to test the availability of the external and needed cluster commands.

Optionaly: This command could also implement some initializations, if needed.

Parameters

None.

Return Codes

0: cluster software seams to be installed proper and cluster framework is started on local node.

1: error during detection of cluster status

2: script notified bad parameters

3: cluster commands are not installed correctly (missing commands)

4: cluster commands are installed correctly but cluster framework is not running (optional)

Output

None.

gvi (get version info)

This command prints the version info of the HA product and the SAP HA interface and where to find additional information.

Parameters - all parameters are mandatory.

--out FILE Output file to be used.

Return Codes

0: success;

1: no success / internal error;

2: script notified bad parameters

Output Formatted query answer to given FILE.

- One single answer (data set) is allowed

- Multiline answer

- Format: HASCRIPTCO-VERS

HAPROD

HAPROD-SAP

HAPROD-DOC

hcc (HA config check)

This command performs some HA configuration checks defined by the HA vendor and prints formatted output with test results.

Parameters - all parameters are mandatory.

--out FILE Output file to be used.

--sid SID SAP system identifier to be queried.

--ino INO SAP instance number to be queried.

Return Codes

0: success;

1: no success / internal error;

2: script notified bad parameters

Output Formatted query answer to given FILE.

- Multiple rows (data sets) are allowed

- Each row / data set covers its values in a colon-separated (’:’) list.

- Format: CHK-STATE:CHK-CATEGORY:CHK-DESCRIPTION:CHK-COMMENT

lsn (list sap nodes)

This command should list the current node and a priorized list of possible cluster nodes for a specific SAP instance. In this case the SAP instance is queried by the cluster resource name.

Parameters

--out FILE Output file for results.

--res RES Cluster resource to be queried.

Return Codes

0: success;

1: no success / internal error;

2: script notified bad parameters;

Output Formatted query answer to given FILE.

- One single row (data set).

- Values are separated by a colon (':').

- Format: RES:GRP:CURR_NODE:PRIO_NODES

lsr (list sap resources)

This command is used to figure out the cluster resource and optionally group name for a specific SAP system and instance.

Parameters - all parameters are mandatory

--out FILE Output file to be used.

--sid SID SAP system identifier to be queried.

--ino INO SAP instance number to be queried.

Return Codes

0: success

1: no success / internal error

2: script notified bad parameters

Output Formatted query answer to given FILE.

- Multiple rows (data sets) allowed even if typically there should only be one resource matching the query.

- Each row / data set covers its values in a colon-separated (':') list.

- Format: SID:INO:RES:GRP:CLUSTER_NODES

cpa (check for pending actions)

This command should check properly against the running cluster, if a given action on a SAP Instance is already running

Parameters - all parameters are mandatory.

--res RES Cluster resource to be queried

--act ACT Action type (start/stop) to be queried.

Return Codes

0: found pending action of queried type

1: did not found pending action of queried type

2: script notified bad parameters

Output None.

fra (fire resource action)

This command fires a cluster change like "stop resource XX" or "start resource XX". It is not intended to wait till the cluster has processed the resource change. The SAP instance is specified by the cluster resource name.

Parameters - only NODE is optional.

--res RES Cluster resource to be controlled.

--act ACT Cluster action (start/stop/migrate) to be "fired".

[ --nod NODE ] For migrations this defines the destination node.

Return Codes

0: success;

1: no success / internal error;

2: script notified bad parameters

Output None.

smm (set/get maintenance mode)

This command activates or deactivates the maintenance mode for the specified clustered instance or delivers its status concerning the maintenance mode. In case this command is implemented, as a minimal requirement the cluster software has to (de)activate the maintenance mode when the resources are online. It is allowed to refuse the (de)activation otherwise. In case the mode is set, the previous mode is returned.

Parameters

--out FILE Output file to be used.

--sid SID SAP system identifier to be queried.

--ino INSTNO SAP instance number to be queried.

--mod NMODE action type to be done (-1: get / 0: deactivate / 1: activate)

Return Codes

0: success;

1: no success / internal error;

2: script notified bad parameters;

3: not clustered

Output Formatted query answer to given FILE. One single row. Format: MM-STATE.

EXAMPLES

sap_cluster_connector init

Do a minor check, if the cluster framework command line interface is available.

sap_cluster_connector lsr --out /tmp/lsr.txt --sid C11 --ino 02

Look-up for the SAP instance number 02 of the SAP system C11 and return the cluster resource name. C11:02:rsc_sap_C11_D02:grp_sap_C11_Dialog2:ls3198,ls3199

sap_cluster_connector fra --res rsc_sap_C11_D02 --act start

Start the cluster resource rsc_sap_C11_D02. While the lsr command returned the resource name rsc_sap_C11_D02 the matching SAP instance is C11, instance number 02 (see example before).

sap_cluster_connector cpa --res rsc_sap_C11_D02 --act start

Check, if the cluster action to start the SAP instance for system C11 and instance number 02 is already in progress.

sap_cluster_connector lsn --out /tmp/lsn.txt --res rsc_sap_C11_D02

Look-up for the current cluster node and all possible cluster nodes to run the cluster resource named rsc_sap_C11_D02. rsc_sap_C11_D02:grp_sap_C11_Dialog2:ls3198:ls3198,ls3199

sap_suse_cluster_connector smm --out /tmp/smm.txt --sid C11 --ino 02 --mod 1

Activate the maintenance mode for the SAP instance number 02 of the SAP system C11 and return the previous mode. 0 (previously, the maintenance mode was deactivated)

EXIT STATUS

See detailed description of the command. In general:

0 - successful command termination or "yes" to a yes-no-query

1 - unsuccessful command termination or "no" to a yes-no-query

2 - error occurred during command termination - mostly due to bad parameters

Exit code 2 must be used, if an unknown command has been detected on the command line. The script-library calling sap_cluster_connector could use this return code to check/probe the availability of a sap_cluster_connector command.

BUGS

See https://github.com/fdanapfel/sap_cluster_connector/issues

SEE ALSO

pacemaker(8), crm_resource(8), crm_resource(8), crm_simulate(8)

AUTHORS

Fabian Herschel fabian.herschel@suse.com SAP Architect & Technical Manager

Frank Danapfel frank.danapfel@redhat.com Senior Software Engineer

COPYRIGHT

For details see the GNU General Public License at http://www.gnu.org/licenses/gpl.html

1 January 2019 sap_cluster_connector