Skip to Content

Manual Page of sap_vendor_cluster_connector

Manual Page of the sap_suse_cluster_connector


This document includes the original manual page of the sap_suse_cluster_connector. All other sap_vendor_cluster_connector implementations should be able to accept the same commands and parameters and have to be designed to provide the same return codes and output.

NAME

sap_suse_cluster_connector - handle sapstartsrv cluster calls

SYNOPSIS

   sap_suse_cluster_connector cmd options-and-params

sap_vendor_cluster_connector cmd options-and-params

DESCRIPTION

sap_suse_cluster_connector (or in general sap_vendor_cluster_connector) is the interface between the SAP HA cluster library 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    
          print help text and usage.

  init      
          check cluster installation and do some optional initialization.      

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

     fra --res SAPRESID --act ACT [ --node NODE ]
    
fire/start a cluster action like start/stop/migrate a resource.

     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 INSTNO
    
perform ha configuration checks. This command is needed since version 2 of the sap script connector API.

     lsn --out FILE --res SAPRESID
    
list sap nodes for specified resource. This command is used since version 2 of the sap script connector API.

   lsr --out FILE --sid SID --ino INSTNO
    
list sap resources matching the search criteria for the actual (calling) host.

   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)

     INSTNO SAP Instance Number (2 digits)

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

     FILE Outputfile for result parsing

     NODE Cluster Node Name

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

     SAPRESID SAP Cluster Resource Identifier. This parameter is set by the calling library as follows:

lsr returns

Action is Start or Stop

Action is Migrate

Only GRPID

SAPRESID=GRPID

SAPRESID=GRPID

Only RESID

SAPRESID=RESID

SAPRESID=RESID

RESID and GRPID

SAPRESID=RESID

SAPRESID=GRPID

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 (initialization)

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 started?” 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.

Optionally: 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 stated 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.

cpa (check for pending cluster 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 SAPRESID 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 a 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 – all parameters except –nod NODE are mandatory.

--res SAPRESID Cluster resource to be controlled.

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

[--node NODE] For migrations this defines the destination node. If the parameter --node NODE is omitted for migrations, the cluster software has to define the destination node. If destination nodes different from the current node are available, one of these nodes has to be used.

Return Codes

0: success;

1: no success / internal error;

2: script notified bad parameters

Output None.

gvi (get version info)

This command prints the version info of the HA product and the SAP HA interface as wee as a URL for the documentation and a SAP note

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 checked.
--ino INSTNO SAP instance number to be checked.

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

lsr (list sap resources)

This command is used to figure out the cluster resource and optionally resource group name for a specific SAP system and instance. Beginning with API2: Only local instances located on the calling host should be listed to allow instances with same instance number on different hosts in the same cluster. However the HA vendor could limit the support to scenarios with unique instance numbers.

Parameters - all parameters are mandatory

--out FILE Output file to be used.

--sid SID SAP system identifier to be queried.

--ino INSTNO SAP instance number to be queried.

Return Codes

0: success

1: no success / internal error

2: script notified bad parameters

3: clustered instance found, but cluster control is disabled (Output file is written)

Output Formatted query answer to given FILE.

  • Multiple rows (data sets) allowed even if typically there should only be one resource matching the query. Only the first entry is interpreted by the calling library.

    Each row / data set covers its values in a colon-separated (':') list.
  • Format: SID:INO:RESID:GRPID:CLUSTER_NODES

lsn (list sap nodes)

This command should list the current node running a specific SAP resource and a prioritized 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 SAPRESID 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: RESID:GRPID:CURR_NODE:PRIO_NODES

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_suse_cluster_connector init

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

sap_suse_cluster_connector lsr –out /tmp/myfile00.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_suse_cluster_connector fra –res rsc_sap_C11_D02 –act start

Start the cluster resource rsc_sap_C11_D02.

sap_suse_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_suse_cluster_connector lsn –out /tmp/myfile01.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/myfile.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 bad parameters

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

Former Member

No comments