sap_ha_pacemaker_cluster Ansible Role

Ansible Lint for sap_ha_pacemaker_cluster

This role installs pacemaker cluster packages and configures the cluster and SAP cluster resources in a new pacemaker cluster.
The pacemaker installation and cluster setup is done through the ha_cluster Linux System Role.
Ansible role sap_ha_pacemaker_cluster is acting as a wrapper and takes care of the SAP environment parameter definitions, platform specific variables and additional steps to complete the SAP HA configuration in the pacemaker cluster.

:warning: Do not execute this role against already configured cluster nodes,
:warning: unless you know what you are doing and have prepared the role input variables accordingly!

Requirements

Target Systems:

Ansible Control System:

Functionality

All of the following functionality is provided as Technology Preview.

:warning: Platforms not explicitly listed may not work as expected.

2-node pacemaker cluster with SAP HANA System Replication

Platform Usability
:heavy_check_mark: physical server expected to work with any fencing method that is supported by the ha_cluster Linux System Role
:heavy_check_mark: OVirt VM tested and working
:heavy_check_mark: AWS EC2 platform detection and awscli setup included, tested and expected to work
IBM Cloud VPC platform detection included, tested and working (unsupported at this point in time)

Role Input Parameters

Minimum required parameters:

On cloud platforms additional parameters are required:


ha_cluster

Optional host_vars parameter - if defined it must be set for each node.

Dictionary that can contain various node options for the pacemaker cluster configuration.

Supported options can be reviewed in the ha_cluster Linux System Role [https://github.com/linux-system-roles/ha_cluster/blob/master/README.md].

Example:

ha_cluster:
  corosync_addresses:
  - 192.168.1.10
  - 192.168.2.10
  node_name: nodeA

ha_cluster_cluster_name

The name of the pacemaker cluster.

ha_cluster_hacluster_password required

The password of the hacluster user which is created during pacemaker installation.

sap_ha_pacemaker_cluster_aws_access_key_id

AWS access key to allow control of instances (for example for fencing operations).

Required for cluster nodes setup on Amazon cloud.

sap_ha_pacemaker_cluster_aws_region

The AWS region in which the instances to be used for the cluster setup are located.

Required for cluster nodes setup on Amazon cloud.

sap_ha_pacemaker_cluster_aws_secret_access_key

AWS secret key, paired with the access key for instance control.

Required for cluster nodes setup on Amazon cloud.

sap_ha_pacemaker_cluster_cluster_properties

Standard pacemaker cluster properties are configured with recommended settings for cluster node fencing.

Example:

sap_ha_pacemaker_cluster_cluster_properties:
  concurrent-fencing: true
  stonith-enabled: true
  stonith-timeout: 900

sap_ha_pacemaker_cluster_create_config_dest

The pacemaker cluster resource configuration optionally created by this role will be saved in a Yaml file in the current working directory.

Requires sap_ha_pacemaker_cluster_create_config_varfile to be enabled for generating the output file.

Specify a path/filename to save the file in a custom location.

The file can be used as input vars file for an Ansible playbook running the ‘ha_cluster’ Linux System Role.

sap_ha_pacemaker_cluster_create_config_varfile

When enabled, all cluster configuration parameters this role constructs for executing the ‘ha_cluster’ Linux System role will be written into a file in Yaml format.

This allows using the output file later as input file for additional custom steps using the ‘ha_cluster’ role and covering the resource configuration in a cluster that was set up using this ‘sap_ha_pacemaker_cluster’ role.

When enabled this parameters file is also created when the playbook is run in check_mode (--check) and can be used to review the configuration parameters without executing actual changes on the target nodes.

WARNING! This report may include sensitive details like secrets required for certain cluster resources!

sap_ha_pacemaker_cluster_fence_options

STONITH resource common parameters that apply to most fencing agents.

These options are applied to fencing resources this role uses automatically for pre-defined platforms (like AWS EC2, IBM Cloud VPC).

The listed options are set by default.

Additional options can be added by defining this parameter in dictionary format and adding the defaults plus any valid stonith resource key-value pair.

Example:

sap_ha_pacemaker_cluster_fence_options:
  pcmk_reboot_retries: 4
  pcmk_reboot_timeout: 400
  power_timeout: 240

sap_ha_pacemaker_cluster_hana_automated_register

Parameter for the ‘SAPHana’ cluster resource.

Define if a former primary should be re-registered automatically as secondary.

sap_ha_pacemaker_cluster_hana_duplicate_primary_timeout

Parameter for the ‘SAPHana’ cluster resource.

Time difference needed between to primary time stamps, if a dual-primary situation occurs.

If the time difference is less than the time gap, then the cluster holds one or both instances in a “WAITING” status.

This is to give an admin a chance to react on a failover. A failed former primary will be registered after the time difference is passed.

sap_ha_pacemaker_cluster_hana_prefer_site_takeover

Parameter for the ‘SAPHana’ cluster resource.

Set to “false” if the cluster should first attempt to restart the instance on the same node.

When set to “true” (default) a failover to secondary will be initiated on resource failure.

sap_ha_pacemaker_cluster_hana_resource_name

Customize the cluster resource name of the SAP HANA DB resource.

sap_ha_pacemaker_cluster_hana_topology_resource_name

Customize the cluster resource name of the SAP HANA Topology resource.

sap_ha_pacemaker_cluster_ibmcloud_api_key

The API key is required to allow control of instances (for example for fencing operations).

Required for cluster nodes setup in IBM Cloud VPC.

sap_ha_pacemaker_cluster_ibmcloud_region

The cloud region key in which the instances are running.

Required for cluster nodes setup in IBM Cloud VPC.

sap_ha_pacemaker_cluster_replication_type

The type of SAP HANA site replication across multiple hosts.

Not yet supported

sap_ha_pacemaker_cluster_resource_defaults

Set default parameters that will be valid for all pacemaker resources.

Example:

sap_ha_pacemaker_cluster_resource_defaults:
  migration-threshold: 5000
  resource-stickiness: 1000

sap_ha_pacemaker_cluster_sap_type

The SAP landscape to be installed.

Currently only scale-up is supported

sap_ha_pacemaker_cluster_vip_client_interface

OS device name of the network interface to use for the Virtual IP configuration.

This is used for VIP agents that require an interface name, for example in cloud platform environments.

sap_ha_pacemaker_cluster_vip_resource_name

Customize the name of the resource managing the Virtual IP.

sap_ha_pacemaker_cluster_vip_update_rt

List one more routing table IDs for managing Virtual IP failover through routing table changes.

Required for VIP configuration in AWS EC2 environments.

sap_hana_cluster_nodes required

List of cluster nodes and associated attributes to describe the target SAP HA environment.

This is required for the HANA System Replication configuration.

Example:

sap_hana_cluster_nodes:
- hana_site: DC01
  node_ip: 192.168.5.1
  node_name: nodeA
  node_role: primary
- hana_site: DC02
  node_ip: 192.168.5.2
  node_name: nodeB
  node_role: secondary

sap_hana_instance_number required

The instance number of the SAP HANA database which is role will configure in the cluster.

sap_hana_sid required

The SAP System ID of the instance that will be configured in the cluster.

The SAP SID must follow SAP specifications - see SAP Note 1979280.

sap_hana_vip required

One floating IP is required for SAP HANA DB connection by clients.

This main VIP will always run on the promoted HANA node and be moved with it during a failover.

Example:

sap_hana_vip:
  primary: 192.168.10.100