Installing SAP HANA or SAP S/4HANA with the RHEL System Roles for SAP

Updated

Contents

1. Overview

The RHEL System Roles for SAP are delivered as RHEL package rhel-system-roles-sap and as Red Hat Automation Hub collection redhat.sap_install.

Package rhel-system-roles-sap version 3.3 and Automation Hub collection redhat.sap_install version 1.1.0
contain roles for the following SAP software installations:

  • SAP HANA (any RHEL 8 and RHEL 9 supported version)
  • A two-node Pacemaker Cluster for managing HANA Scale-Up System Replication

Starting with version 1.2.1 of Automation Hub collection redhat.sap_install, the following additional SAP software installations can be performed:

  • SAP S/4HANA 2021 and 2022, either SAP HANA Foundation or SAP HANA Core.

For instructions on how to automatically configure a 2 node Pacemaker cluster for managing HANA Scale-Up System Replication, refer to This content is not included.this document.

The roles for installing SAP software are supported as follows:

Role NameSupport StatusRemote Host ManagementControl Node
sap_hana_installFully supportedRHEL 7.6 and later, RHEL 8, RHEL 9RHEL 8, RHEL 9
sap_ha_install_hana_hsrTechnology PreviewRHEL 8, RHEL 9RHEL 8, RHEL 9
sap_ha_pacemaker_clusterTechnology PreviewRHEL 8, RHEL 9RHEL 8, RHEL 9
sap_swpmTechnology Preview for certain functionality, unsupported for all other functionality (*)RHEL 8, RHEL 9RHEL 8, RHEL 9

(*) This version of the RHEL System Roles for SAP contains the role sap_swpm with a support scope of Technology Preview for the role's default mode only and only for the following deployment scenarios:

S/4HANA 2021 and S/4HANA 2022 single-host installation on x86_64: RHEL 8.4, 8.6, 9.0 and ppc64le: RHEL 8.4 and 8.6.

All other functionality of the role sap_swpm is not supported.

2. Installing the RHEL System Roles for SAP

Use the following procedure for installing Ansible Core and the RHEL System Roles for SAP package or collection.

Note: For installing packages on a Red Hat Satellite system, do not use the plain dnf command but follow the instructions in How to install or update packages in Red Hat Satellite 6?.

  1. Install Ansible Core:

# dnf install ansible-core

Continue with step 2 for installing the RHEL package rhel-system-roles-sap or with step 3 for installing the Automation Hub collection redhat.sap_install.

  1. For installing the RHEL package rhel-system-roles-sap:

a) Enable the RHEL for SAP Solutions repository using Red Hat Subscription Manager:

# subscription-manager repos --enable=rhel-$(rpm -E %rhel)-for-$(uname -m)-sap-solutions-rpms

b) Install the RHEL System Roles for SAP:

# dnf install rhel-system-roles-sap

The rhel-system-roles-sap package is installed to /usr/share/ansible/roles/<role>, where <role> is the name of the individual role, for example, sap_hana_preconfigure. Each role includes a README.md file which explains all variables and how to use the role.

  1. For installing the Automation Hub collection redhat.sap_install: You can either directly install the collection from Automation Hub or first download it and then install it from the downloaded file.

a) To install the collection directly from Automation Hub, follow the instructions on This content is not included.this page. The essential steps are:

i) Make a copy of your Offline token, the Server URL, and the SSO URL from this page and note the Server URL and SSO URL on the same page. If needed (e.g. because it expired), recreate the token.

ii) Use these values to configure file /etc/ansible/ansible.cfg according to the instructions in Content from docs.ansible.com is not included.this chapter. Use the Server URL for variable url, the SSO URL for variable auth_url, and the Offline token for variable token, as in the following example (replace the sample token string by the actual token):

[galaxy]
server_list = automation_hub_install

[galaxy_server.automation_hub_install]
url = https://console.redhat.com/api/automation-hub/
auth_url = https://sso.redhat.com/auth/realms/redhat-external/protocol/openid-connect/token
token = 123567890abcdef...abcdef1234

Install the collection by running the following command as the user which will use the collection (=the user which will run the playbooks to install software or configure settings on managed nodes):

# ansible-galaxy collection install redhat.sap_install

This will install the collection into the default location for the user (necessary directories will be created recursively), which is: ~/.ansible/collections/ansible_collections/redhat/sap_install.

b) To download the collection from Automation Hub and then install it, perform the following step:

i) Download the collection tar file from This content is not included.this page (use the Download tarball link) and then run the following command as the user which will use the collection:

# ansible-galaxy collection install ./redhat-sap_install-1.2.1.tar.gz

This will also install the collection into the default location for the user, as described before.
The file README.md in each role's subdirectory below sap_install, e.g. roles/sap_general_preconfigure, contains the documentation for each of the roles.

3. Installing SAP HANA

The role sap_hana_install is used to install SAP HANA scale-up or scale-out on your RHEL system using the noninteractive hdblcm installation method with a configuration file. Before starting the installation, the role performs necessary preparation steps like modifying directory permissions, selecting the correct SAPCAR executable, extracting the SAR files, and creating a customized hdblcm configuration file. After the installation has finished, the role performs some additional steps like setting the log_mode to overwrite, and also can perform some optional steps like setting firewall ports.

Use this procedure to install SAP HANA scale-up or scale-out on your RHEL system.

  1. Make sure that your RHEL system(s) fulfill(s) all the requirements for the Installation of SAP HANA as per available SAP HANA planning and installation guides and release notes.

  2. Configure the storage and network of your RHEL system(s) for SAP HANA. For example, create large enough file systems /hana/shared, /hana/data, and /hana/log. For a scale-out installation, configure the NFS exports list on the NFS server (e.g. the primary node) with the options (rw,no_root_squash) and make sure that the additional nodes have mounted the required file systems from the NFS server.

  3. Follow the instructions in This content is not included.Red Hat Enterprise Linux System Roles for SAP to prepare your RHEL system(s) for the installation of SAP HANA.

Note: For preparing a RHEL system for the installation of the SAP HANA database only, use the following preconfigure roles in the order as shown below:

  • sap_general_preconfigure
  • sap_hana_preconfigure
  1. Download the latest version of the SAPCAR executable which matches your hardware platform, as well as the SAP HANA software SAR files, from the SAP Software Downloads web page. Copy the files to the directory specified by the role variable sap_hana_install_software_directory (default: /software/hana). In case of a scale-out installation, this directory only needs to be available on the primary node.

  2. If you wish to verify the checksums of each of these files, create a file named .sha256 for each of the files you downloaded in the previous step, in the same directory. These checksums can be viewed on the SAP Software Downloads page, after clicking on the "Content Info" link in the "Related Info" tab for each file. The format of the <FILE>.sha256 file needs to be compliant with the output of the sha256sum command, so it must have two records separated by a space, with the first string being the checksum and the second field being the file name of the file to verify.

Example: Assuming the sha256 checksum for file SAPCAR_1115-70006178.EXE is 123456abcd (note that the real length of the sha256 checksum is much longer), then the file SAPCAR_1115-70006178.EXE.sha256 must contain the following single line:

123456abcd SAPCAR_1115-70006178.EXE

You can also store all the checksums and file names, line by line, in a central checksum file which you can configure with the variable sap_hana_install_global_checksum_file.

  1. View the role's README.md document and the file defaults/main.yml to get an overview of the primary role variables and of the variables used by the hdblcm command.
    The following is a list of minimum required settings:
VariableMeaningExample
sap_hana_install_sidSAP HANA system IDHD1
sap_hana_install_numberSAP HANA instance number11
sap_hana_install_master_passwordMaster password, e.g. for the database userNewPass$321

See also the inventory file in the next section for an example.

  1. Create a playbook (sample name: hana-install.yml) with at least these parameters. For each of the hdblcm parameters, you can additionally configure a matching role variable by prepending the variable name by sap_hana_install_, as in the following example:

For restricting the amount of RAM used by the SAP HANA database, the hdblcm parameter restrict_max_mem has to be set to y and the parameter max_mem has to be set to the maximum amount of MB (example: 40000). Add the following variables to your playbook or host variables file:

sap_hana_install_restrict_max_mem: 'y'
sap_hana_install_max_mem: 40000

Note that the values of the hdblcm related role variables might follow a different naming scheme. For example, boolean role variables have to be set to yes or no (or true or false) whereas boolean hdblcm parameters have to be set to y or n.

  1. You can check if you set all hdblcm related role variables correctly before actually starting the SAP HANA installation. In this case, perform the following steps. Otherwise, continue with step 9.

a) Run the role as follows:

# ansible-playbook hana-install.yml -l <hostname> --tags=sap_hana_install_preinstall

This will only run the preinstall steps of the role, which, among other actions, will:

  • Expand the SAR files to a newly created directory /software/hana/extracted.
  • Create an hdblcm configfile template, using the hdblcm command with the option --dump_configfile_template.
  • Convert the template to a Jinja2 template to be used by the role.
  • Create a hdblcm configfile by processing the Jinja2 template using the role variables.
    The role will display the full path names of each of these files. SAP HANA will not be installed in this step.

b) Verify if the hdblcm configfile matches your desired SAP HANA configuration. You can compare the hdblcm configfile template with the hdblcm configfile created by the role to find out which hdblcm parameters are different from the default. The following diff commands can be useful for comparing.
For displaying only the modified default lines, in two columns, use:

# diff -y --suppress-common-lines hdblcm_configfile_template.cfg TEMPLATING_RESULT

where TEMPLATING_RESULT is the hdblcm configfile created by the role as displayed at the end of the previous step.

For checking and comparing all non-empty hdblcm parameter settings, use:

# diff -y <(awk 'BEGIN{FS="="}/^[a-z]/&&length($2)>0{print $0}' hdblcm_configfile_template.cfg) <(awk 'BEGIN{FS="="}/^[a-z]/&&length($2)>0{print $0}' TEMPLATING_RESULT)

If necessary, modify the role variables to meet your requirements, taking into account the variable name conversion explained before.

  1. Run the role as in the following example:

# ansible-playbook hana-install.yml -l <hostname>

This will create a fresh hdblcm configfile and then install SAP HANA.
For a SAP HANA scale-out installation, the role has to be run against the primary node only.

  1. Verify if your SAP HANA system is working as expected.

4. Installing SAP S/4HANA 2021 or 2022

The role sap_swpm is used to install SAP S/4HANA on your RHEL system using SAP SWPM 2, with the SAP HANA database running on the same host or on another host.

Use this procedure to install SAP S/4HANA on your RHEL system with SAP HANA running on the same host.

  1. Install the SAP HANA database on your host as explained in Install SAP HANA.

Note: For preparing a RHEL system for the installation of S/4HANA, use all three preconfigure roles, in the following order:

  • sap_general_preconfigure
  • sap_netweaver_preconfigure
  • sap_hana_preconfigure
  1. Configure your inventory for the host as in the following example:

Note: For a host with hostname test01, the inventory file would be ~/host_vars/test01.

# Password to be used for SAP HANA and S/4HANA (if desired):
sap_global_password: 'NewPass$321'

sap_hana_install_sid: 'H01'    # SID of the SAP HANA database system, 'H01' in this example
sap_hana_install_instance_number: '11'  # Instance number of the SAP HANA database system, '11' in this example
sap_hana_install_common_master_password: "{{ sap_global_password }}"

sap_swpm_product_catalog_id: 'NW_ABAP_OneHost:S4HANA2022.CORE.HDB.ABAP'
# sap_swpm_product_catalog_id: 'NW_ABAP_OneHost:S4HANA2021.CORE.HDB.ABAP'
# sap_swpm_product_catalog_id: 'NW_ABAP_OneHost:S4HANA2022.FNDN.HDB.ABAP'
# sap_swpm_product_catalog_id: 'NW_ABAP_OneHost:S4HANA2021.FNDN.HDB.ABAP'

sap_swpm_ansible_role_mode: 'default'

sap_swpm_sapcar_path: '/software/sapcar'
sap_swpm_swpm_path: '/software/swpm'
sap_swpm_software_path: '/software/s4hana'
sap_swpm_generic: 'true'
sap_swpm_configure_tms: 'false'

# NW Passwords
sap_swpm_master_password: "{{ sap_global_password }}"
sap_swpm_ddic_000_password: "{{ sap_global_password }}"

# HDB Passwords
sap_swpm_db_system_password: "{{ sap_global_password }}"
sap_swpm_db_systemdb_password: "{{ sap_global_password }}"
sap_swpm_db_schema_abap: 'SAPHANADB'
sap_swpm_db_schema_abap_password: "{{ sap_global_password }}"
sap_swpm_db_sidadm_password: "{{ sap_global_password }}"

# NW Instance Parameters
sap_swpm_sid: 'HS4'                 # SID of the SAP S/4HANA system, 'HS4' in this example
sap_swpm_pas_instance_nr: '01'      # PAS instance number, '01' in this example
sap_swpm_pas_instance_hostname: "{{ ansible_hostname }}"
# sap_swpm_pas_instance_hostname: 'test01'  # PAS hostname
sap_swpm_ascs_instance_nr: '00'     # ASCS instance number, '00' in this example
sap_swpm_ascs_instance_hostname: "{{ ansible_hostname }}"
# sap_swpm_ascs_instance_hostname: 'test01' # ASCS hostname
sap_swpm_fqdn: "{{ ansible_domain }}"
# sap_swpm_fqdn: 'example.com'      # DNS domain name (not FQDN) of the S/4HANA host

# Linux User IDs
sap_swpm_sapadm_uid: '3000'       # uid for sapadm, 3000 in this example
sap_swpm_sapsys_gid: '3001'       # gid for sapsys, 3001 in this example
sap_swpm_sidadm_uid: '3001'       # uid for sidadm, 3001 in this example

# HDB Instance Parameters for sap_swpm
sap_swpm_db_sid: "{{ sap_hana_install_sid }}"
sap_swpm_db_instance_nr: "{{ sap_hana_install_instance_number }}"
sap_swpm_db_ip: "{{ ansible_default_ipv4.address }}"
# sap_swpm_db_ip: 'xxx.yyy.zzz.aaa' # IP address of the SAP HANA database system
sap_swpm_db_host: "{{ ansible_hostname }}"
# sap_swpm_db_host: 'test01'        # hostname of the HANA database system

sap_swpm_update_etchosts: 'true'

For installing S/4HANA and using an SAP HANA system running on another host, adapt the two parameters sap_swpm_db_ip and sap_swpm_db_host accordingly.

  1. Download all required SAP S/4HANA files (e.g. taken from the SAP Maintenance Planner) to the following directories on your S/4HANA system (can also be an NFS mounted directory):
    sap_swpm_sapcar_path: The SAPCAR*EXE file, e.g. SAPCAR_1115-70006178.EXE
    sap_swpm_swpm_path: The latest SWPM2 SAR file, e.g. SWPM20SP13_5-80003424.SAR
    sap_swpm_software_path: All necessary S/4HANA software SAR and zip files except the HANA database SAR file (e.g. IMDB_SERVER20_066_0-80002031.SAR). This file is not needed because the SAP HANA database is in a different directory and installed by the role sap_hana_install.

The directory structure and file list for SAP S/4HANA Foundation 2022 would look like the following:

# pwd
/software/hana/sapcar
# ls -l SAPCAR*
-rwxr-xr-x. 1 root root 4507168 Feb  6  2022 SAPCAR_1115-70006178.EXE
# pwd
/software/hana/swpm
# ls -l SWPM*
-rwxr-xr-x. 1 root root 178276694 Oct 23 21:24 SWPM20SP13_0-80003424.SAR
# pwd
/software/hana/s4hana
# ls -l
total 10226900
-rwxr-xr-x. 1 root root  140057156 Oct 23 21:20 igsexe_1-70005417.sar
-rwxr-xr-x. 1 root root   62964377 Oct 23 21:24 igshelper_17-10010245.sar
-rwxr-xr-x. 1 root root  192223876 Oct 23 21:24 IMDB_CLIENT20_014_22-80002082.SAR
-rwxr-xr-x. 1 root root   10536069 Oct 23 21:24 KD75783.SAR
-rwxr-xr-x. 1 root root       5483 Oct 23 21:20 S4FND107_INST_EXPORT_1.zip
-rwxr-xr-x. 1 root root       5269 Oct 23 21:21 S4FND107_INST_EXPORT_2.zip
-rwxr-xr-x. 1 root root     202852 Oct 23 21:21 S4FND107_INST_EXPORT_3.zip
-rwxr-xr-x. 1 root root 2081509899 Oct 23 21:26 S4FND107_INST_EXPORT_4.zip
-rwxr-xr-x. 1 root root 2077862753 Oct 23 21:27 S4FND107_INST_EXPORT_5.zip
-rwxr-xr-x. 1 root root 1218750963 Oct 23 21:25 S4FND107_INST_EXPORT_6.zip
-rwxr-xr-x. 1 root root 1665317003 Oct 23 21:26 S4FND107_INST_EXPORT_7.zip
-rwxr-xr-x. 1 root root 1082298957 Oct 23 21:25 S4FND107_INST_EXPORT_8.zip
-rwxr-xr-x. 1 root root   21459645 Oct 23 21:23 S4FND107_INST_EXPORT_9.zip
-rwxr-xr-x. 1 root root  113989990 Oct 23 21:23 S4FND107_NW_LANG_DE.SAR
-rwxr-xr-x. 1 root root   83069674 Oct 23 21:23 S4FND107_NW_LANG_EN.SAR
-rwxr-xr-x. 1 root root  340960362 Oct 28 19:24 SAPEXE_60-70006642.SAR
-rwxr-xr-x. 1 root root    7600533 Oct 28 19:22 SAPEXEDB_60-70006641.SAR
-rwxr-xr-x. 1 root root   80135513 Oct 23 21:24 SAPHOSTAGENT58_58-80004822.SAR
-rwxr-xr-x. 1 root root  419542634 Oct 23 21:20 SUM20SP15_0-80002456.SAR
  1. Create a playbook named s4hana-install.yml as follows:
  • When using the RHEL package rhel-system-roles-sap:
- hosts: all
  become: true
  roles:
    - sap_swpm
  • When using the Automation Hub collection redhat.sap_install:
- hosts: all
  collections:
    - redhat.sap_install
  become: true
  roles:
    - sap_swpm

Note: Using the inventory file ~/host_vars/test01 as shown in the example above, you can also call the roles sap_hana_install and sap_swpm one after the other, as in the following example:

- hosts: all
  become: true
  roles:
    - sap_hana_install
    - sap_swpm
  1. Run the role as follows:
    # ansible-playbook s4hana-install.yml -l <hostname>

This will start the S/4HANA installation. The typical run times are:

  • for an S/4HANA Foundation system: 45 minutes
  • for an S/4HANA Core system: ca. 3 hours.
Article Type