SAPHanaSR-showAttr(8)

NAME
SAPHanaSR-showAttr - Shows Linux cluster attributes for SAP HANA system replication.

SYNOPSIS
SAPHanaSR-showAttr [ --help | --version | --path2table ]
SAPHanaSR-showAttr [ --sid=SID[:INO] ] [ --sort=FIELD ] [ --format=FORMAT ] [ --cib=OFFLINE_CIB_FILE ]

DESCRIPTION
SAPHanaSR-showAttr shows Linux cluster attributes for SAP HANA system replication automation. The overall system replication (SR) state is shown as well as the HANA state on each node. Because the HANA srHook methods srConnectionChanged() and preTakeover() are used, the respective information shows up as well. The information is fetched from the Linux cluster information base (CIB), not from HANA directly.

The output shows four sections, containing all or some of the listed fields:

Global section
    HANA system identifier (Global)
    date and time of record (cib-time)
    maintenance status of Linux cluster (maintenance)
    filter for resource agent logging (filter)
    Linux cluster scale-out multi-target support (mts)
    HANA primary replication site (prim)
    HANA secondary replication site (sec)
    HANA replication channel state, indicated by srConnectionChanged (srHook)
    HANA replication state of secondary site, indicated by systemReplicationStatus.py (sync_state)
    Linux cluster update status (upd)

Resource section
    name of Linux cluster resource (Resource)
    maintenance status of Linux cluster resource (maintenance)

Site section
    HANA site name (Site)
    SAPHanaSR last primary timestamp (lpt)
    HANA landscape status (lss)
    HANA current master nameserver for that site (mns)
    HANA system replication role (srr)

Hosts section
    Linux hostname (Hosts)
    state of the Linux cluster resource (clone_state)
    state of Linux cluster node (node_state)
    actual and configured roles for HANA on that node (roles)
    actual master score on that node (score)
    generation of resource agent (gra)
    generation of srHook (gsh)
    HANA site where the host sits (site)
    HANA system replication mode (srmode)
    maintenance state of Linux cluster node (standby)
    HANA system replication status (sync_state)
    Linux cluster node fence status (terminate)
    HANA version (version)
    HANA virtual host name (vhost)
    HANA system replication takeover action, indicated by preTakeover() (sra)
    HANA system replication takeover action history, (srah)

Some fields are generated dynamically from the CIB. That fields are missing, if no corresponding attribute exists, e.g. the standby field. An incomplete compilation on field details and purpose follows below.

clone_state - clone state of the Linux cluster resource Value: [ PROMOTED | DEMOTED | UNDEFINED | WAITING4LPA | WAITING4PRIM | WAITING4NODES | WAITING4REG ] This variable is set by the SAPHanaController or SAPHana resource agent.
PROMOTED marks on scale-up the master state of an instance, which makes an HANA SR primary. On scale-out it indicates the master nameserver of the primary site.
DEMOTED makes on scale-up an HANA SR secondary. On scale-out all running nodes except the primary master nameserver are marked as DEMOTED. The DEMOTED state can be transient, on the way to promoting.
WAITING4LPA indicates potential risk of a dual primary situation. The cluster is waiting for DUPLICATE_PRIMARY_TIMEOUT seconds before registering the former HANA primary as new secondary.
WAITING4PRIM indicates the cluster is waiting for the HANA primary becoming ready in order to register the HANA secondary.
WAITING4NODES indicates on scale-out that not enough nodes are available to bring up a functional site, according to the HANA landscape configuration.
WAITING4REG indicates potential risk of a dual primary situation. The cluster is waiting for the administrator to manually register the former HANA primary as new secondary.
See also AUTOMATED_REGISTER and DUPLICATE_PRIMARY_TIMEOUT in ocf_suse_SAPHana(7) and ocf_suse_SAPHanaController(7).

gra - generation of resource agent Value: [ generation ] The RA generation attribute identifies which generation of the RA is running. It helps determing RA's capabilities and performing cluster-wide upgrades of RA and srHook. The generation should be same for both on all nodes of the Linux cluster after successful upgrade. See also gsh below and SAPHanaSR-manageAttr(8).

gsh - generation of srHook Value: [ generation ] The srHook generation attribute identifies which generation of the srHook is running. It helps determing srHook's capabilities and performing cluster-wide upgrades of RA and srHook. E.g. starting with generation 2.0 the RA supports scale-out multi-target system replication, which needs replacement of the old SAPHanaSR.py by new SAPHanaSrMultiTarget.py. See also gra above and SAPHanaSR-manageAttr(8).

mts - Linux cluster scale-out multi-target support Value: [ true | false ] The multi-target support attribute identifies whether the Linux cluster supports HANA scale-out multi-target system replication. This needs consistently updated RA and srHook to be active on all Linux cluster nodes, including the majority maker. See also gra, gsh and SAPHanaSR-manageAttr(8).

upd - Linux cluster update status Value: [ ok | nok ] The update status attribute identifies whether the whole cluster has successfully passed an update procedure. See also mts above and SAPHanaSR-manageAttr(8).

maintenance - maintenance status of Linux cluster or cluster resource Value: [ true | false ] This is a Linux cluster node attribute. It is set by an admin. The attribute is shown after it has been changed from the default. The field might appear or disappear, depending on cluster maintenance tasks. See also the standby attribute below.

filter - SAPHanaController or SAPHana filter for logging Value: [ filter ] The filter is defined by hana_<sid>_glob_filter . See ocf_suse_SAPHana(7) and ocf_suse_SAPHanaController(7) for details.

Global - HANA system identifier Value: [ SID ] The SID is the same for the pair of HANA system replication databases in the cluster.

Hosts - Linux hostname Value: [ HOSTNAME ] The hostname has to follow UNIX RFC 1178. Additional rules specific to SAP apply. E.g. length of hostname is limited to 13 characters. See also the fields remoteHost and vhost.

lpt - last primary timestamp Value: [ UNIX_EPOCH | 30 | 10 | 0 ] The node attribute lpa_<sid>_lpt or cluster attribute hana_<sid>_site_lpt_<site> is set by the SAPHanaController or SAPHana resource agent. When the RA detects a running HANA SR primary on the node, it records the Unix Epoch time. See section DUPLICATE_PRIMARY_TIMEOUT of ocf_suse_SAPHana(7) and ocf_suse_SAPHanaController(7).
Auxiliary values are set for an HANA SR secondary. 30 means the instance is evictable for primary. 10 means: not yet ready.

lss - landscape status Value: [ 4 | 3 | 2 | 1 | 0 ] The site attribute lss shows the return code of HANA's landscapeHostConfiguration.py. See field A of the roles section below and ocf_suse_SAPHanaController(7).

mns - master nameserver Value: [ HANA_MASTERNAMESERVER ] The cluster attribute hana_<sid>_site_mns_<site> shows the current HANA master nameserver for the given site. It is empty for sites outside the Linux cluster.

srr - system replication role Value: [ "P"rimary | "S"econdary | "N"one ] The site attribute srr shows the current HANA system replication role for the given scale-out site. It is empty for sites outside the Linux cluster. For scale-up see roles sub-field B of the Hosts section.

node_state - state of the Linux cluster node Value: [ online | offline ]

op_mode - HANA SR operations mode Value: [ logreplay | delta_datashipping | logreplay_readaccess ] The node attribute hana_<sid>_op_mode is set by SAPHanaTopology, according to the running HANA. The attribute is used by the SAPHanaController or SAPHana resource agent for setting up system replication. delta_datashipping is not recommended in the context of Linux clusters.

remoteHost - HANA SR remote host Value: [ HOSTNAME ] The node attribute hana_<sid>_remoteHost is set by SAPHanaTopology, according to the running HANA. The attribute is used by the SAPHanaController or SAPHana resource agent for setting up system replication. See also the fields Hosts and vhost.

Resource - name of Linux cluster resource Value: [ RESOURCENAME ] Name of the multi-state resource controlled by SAPHanaController or SAPHana.

roles - actual and configured roles for HANA on that node The roles field in the Hosts section has six sub-fields for scale-up (A:B:C:D:E:F). It has four sub-fields for scale-out (C:D:E:F). The sub-fields C:D:E:F are primarily useful for HANA scale-out. For scale-up that four fields C:D:E:F should be master1:master:worker:master.
Field A: return code of landscapeHostConfiguration.py
Value: [ 4 | 3 | 2 | 1 | 0 ]
This field contains the return code of landscapHostConfiguration.py. The parameter does not tell you if the secondary system is ready for a takeover. The meaning is different from common Linux return codes.
4 = OK - Everything looks perfect on the HANA primary.
3 = WARNING - A HANA Host Auto-Failover is taking place.
2 = INFO - The landscape is completely functional, but the actual role of the host differs from the configured role.
1 = DOWN - There are not enough active hosts.
0 = FATAL - Internal script error, the state could not be determined.
See landscapeHostConfiguration.py.
Field B: HANA System Replication Role
Value: [ "P"rimary | "S"econdary | "N"one ]
See field srr of the Site section for scale-out.
Field C: NameServer Config Role
Value: [ master1 | master2 | master3 | worker | slave | standby | shtdown ]
Field D: NameServer Actual Role
Value: [ master | slave | standby | shtdown ]
Field E: IndexServer Config Role
Value: [ master1 | master2 | master3 | worker | slave | standby | shtdown ]
Field F: IndexServer Actual Role
Value: [ master | worker | slave | standby | shtdown ]

score - actual master score on that node Value: [ 150 | 145 | 140 | 115 | 110 | 100 | 90 | 80 | 70 | 60 | 10 | 5 | 0 | -1 | -9000 | -10000 | -12200 | -22100 | -22200 | -32300 | -33333 | -INFINITY ] This is a variable of the SAPHanaController or SAPHana resource agent. It is calculated based on an internal scoring table. A value of 150 should cause the Linux cluster promoting the local resource instance to HANA SR primary master nameserver. 140 indicates a HANA primary master nameserver candidate. 100 indicates the HANA secondary master nameserver. This field should not be empty. Note: The effective resource scoring used by the Linux cluster differs from the above values because the cluster engine takes into account other factors as well.

site - HANA site where the host sits Value: [ HANA_SITE ] The node attribute hana_<sid>_site is set by SAPHanaTopology, according to the running HANA. The attribute is used by the SAPHanaController or SAPHana resource agent for setting up system replication. A dash (-) indicates the RA did not run or did not recognize the site.

srmode - HANA SR mode Value: [ sync | syncmem ] The node attribute hana_<sid>_srmode or cluster attribute hana_<sid>_glob_srmode is set by SAPHanaTopology, according to the running HANA. The attribute is used by the SAPHanaController or SAPHana resource agent for setting up system replication. SAP HANA knows also async and fullsync (see URLs below). Those do not make sense for automating HANA system replication by an Linux cluster.

standby - maintenance state of Linux cluster node Value: [ on | off ] This is a Linux cluster node attribute. It is set by an admin. The attribute is shown after it has been changed from the default. The field might appear or disappear, depending on cluster maintenance tasks. See also the maintenance attribute above.

sync_state - HANA SR status Value: [ SOK | SFAIL | SWAIT | SREG | PRIM ] The cluster property hana_<sid>_glob_sync_state is set by the SAPHanaController or SAPHana resource agent. The first three values are representing an HANA system replication status, recognized at latest RA run, see ocf_suse_SAPHana(7), ocf_suse_SAPHanaController(7) and systemReplicationStatus.py .
The 4th value (PRIM) just indicates an HANA SR primary.

sra - HANA system replication action Value: [ T | R | - ] The node attribute system replication action is checked by the HA/DR provider susTkOver.py using the API method preTakeover(). It is set by the resource agent SAPHana or SAPHanaController. It indicates whether a takeover or registration is ongoing. This attribute may not be persisted in pengine files.
T = Takeover on new primary (sr_takeover) ongoing.
R = Registration on new secondary (sr_register) ongoing.
- = No action pending.

srah - HANA system replication action history Value: [ T | R | - ] The node attribute system replication action history stores actions in CIB attributes for later use, for root cause analysis.

srHook - HANA replication channel state, indicated by srConnectionChanged Value: [ SOK | SFAIL | SWAIT | SREG | PRIM ] The cluster attributes related to srHook are hana_<sid>_site_srHook_<site> for the multi-tier enabled hook and hana_<sid>_glob_srHook for the old-style hook. It represents the HANA SR status from HA/DR provider API method srConnectionChanged(). See SAPHanaSR-ScaleOut(7) for supported API versions and scenarios. The attribute is not updated if the cluster is not running. Thus if the cluster is shut down while HANA remains running, the content of srHook might be outdated on cluster start until the next srConnectionChanged() event. See SAPHanaSR.py(7) and SAPHanaSrMultiTarget.py(7) for details.
The cluster property hana_<sid>_glob_srHook shows one HANA SR status. It does not work for multi-tier and multi-target system replication. hana_<sid>_site_srHook_<site> shows the HANA SR status specific to the respective site.
Note: Global and site-specific properties must not appear at same time.

terminate - Linux cluster node fence status Value: [ true ] Indicates whether that node is requested for being fenced from outside the Linux cluster. The attribute is removed as soon as the node has been successfully fenced.

version - HANA version Value: [ HANA_VERSION ] Version of the HANA instance on that node. Of course, should be supported for the given Linux version. Should be same on all nodes, except during specific HANA upgrade procedure.

vhost - HANA virtual hostname Value: [ HANA_VIRT_HOSTNAME ] The virtual hostname is used by the HANA instance instead of Linux hostname. The node attribute hana_<sid>_vhost is set by SAPHanaTopology, according to the running HANA. The attribute is used by the SAPHanaController or SAPHana resource agent for setting up system replication. See also the fields Hosts and remoteHost. SAPHanaToplogy needs the SAPHOSTAGENT to map from the local hostname to the HANA virtual hostname.

OPTIONS

--help
    show help.

--version
    show version.

--path2table
    convert script-style input pipe back into normal output.

--sid=SID[:INO]
    use SAP system ID SID. Should be autodetected, if there is only one SAP HANA instance installed on the local cluster node. The SAP system ID is a 3 alphanum string with a valid SAP system name like SLE, HAE, FH1, C11, or P42. Optional: Use SAP instance number INO. Should be autodetected, if there is only one SAP HANA instance installed on the local cluster node. The SAP instance number must be represented by a two digit numer like 00, 05 or 42. Some numbers ares not allowed, e.g. 98.

--sort FIELD
    sort Hosts section table by field. Allowed values: roles, site. The default sort is by hostnames.

--cib=OFFLINE_CIB_FILE
    read data from given offline CIB file.

RETURN CODES
0 Successful program execution.
>0 Usage, syntax or execution errors.

EXAMPLES

# SAPHanaSR-showAttr
    show all SAPHanaSR attributes and relevant cluster maintenance states.
    If the roles sub-fields are 1:P:::: landscapeHostConfiguration.py has not been able to detect the HANA roles during last recent RA monitor operation. Likely HANA was down or sudo <sid>adm failed.

# SAPHanaSR-showAttr --sort roles
    show all SAPHanaSR attributes in the cluster and sort host table output by roles.

# SAPHanaSR-showAttr --sid=HA1:10 --cib=./hb_report-17-07-2019/grauenstein01/cib.xml
    show all SAPHanaSR attributes for SAP System ID HA1 and instance number 10 from given CIB file.

# SAPHanaSR-showAttr | grep -e master: -e worker: -e slave:
    show SAPHanaSR promotion scores on running nodes.

# SAPHanaSR-showAttr --format=script | egrep -v '/(version|op_mode|vhost|remoteHost|node_state|site)=' | SAPHanaSR-showAttr --path2table
    reduce output to selected fields.

FILES

/usr/sbin/SAPHanaSR-showAttr
    the program itself.

/usr/lib/SAPHanaSR-ScaleOut/SAPHanaSRTools.pm
    needed functions.

/usr/sap/hostctrl/exe/saphostctrl
    the SAP host control command.

BUGS
Formatting and content of this script's output will change, since this script is under development. This script is not intended to be called from monitoring tools. For monitoring please use SAPHanaSR-monitor instead.
In case of any problem, please use your favourite SAP support process to open a request for the component BC-OP-LNX-SUSE. Please report any other feedback and suggestions to feedback@suse.com.

SEE ALSO
ocf_suse_SAPHanaController(7) , ocf_suse_SAPHanaTopology(7) , SAPHanaSR-ScaleOut(7) , SAPHanaSR-replay-archive(8) , SAPHanaSR-filter(8) , SAPHanaSR-monitor(8) , SAPHanaSR_maintenance_examples(7) , SAPHanaSR-manageAttr(8) , crm_simulate(8) , crm_report(8) , cibadmin(8) , crm_mon(8) , crm_attribute(8) , cs_convert_time(8) , cs_clusterstate(8) , cs_show_hana_info(8) , cs_show_scores(8) ,
https://documentation.suse.com/sbp/all/?context=sles-sap ,
https://documentation.suse.com/sles-sap/ ,
https://www.susecon.com/doc/2015/sessions/TUT19921.pdf ,
https://www.susecon.com/doc/2016/sessions/TUT90846.pdf ,
https://www.susecon.com/archive-2020.html

AUTHORS
F.Herschel, L.Pinne.

COPYRIGHT
(c) 2014 SUSE Linux Products GmbH, Germany.
(c) 2015-2017 SUSE Linux GmbH, Germany.
(c) 2018-2022 SUSE LLC
SAPHanaSR-showAttr comes with ABSOLUTELY NO WARRANTY.
For details see the GNU General Public License at http://www.gnu.org/licenses/gpl.html