Skip to content

IBM/ansible-power-linux-sap

Repository files navigation

Power LPAR Configuration for SAP HANA and SAP NetWeaver using Ansible collection

Sections

  1. Introduction
  2. Roles Description
  3. Installation Guide
  4. Execution Details
  5. Requirements, Dependencies and Testing

1. Introduction

This ansible collection simplifies IBM PowerVS LPAR configuration for installing SAP HANA and SAP NetWeaver on SLES and RHEL environments. It doesn't install SAP HANA or NETWEAVER applications but, prepares the OS with correct configurations for SAP HANA/NetWeaver installations for best performance. They can be executed on same LPAR or different LPARs.

This collection has 4 modules, which are independent of each other and can be run individually.

  1. Preparing Operating System for SAP installations.
  2. Creating Filesystems for SAP installations.
  3. Configuring SWAP spaces.
  4. Installing Management Services (SQUID, NTP, NFS, DNS)

Ansible Roles Summary

Role Name Input Variable Name Mandatory or Optional Variable description Variable Values
powervs_prepare_sles_sap
1. sap_solution Mandatory Saptune is executed based on this value HANA or NETWEAVER or NETWEAVER+HANA
2. host_ip Optional If this variable is included then mtu 9000 will not be set for this interface IP. e.g.: 192.168.1.1
3. suse_subscription : {
username: "",
key: "",
release: ""
}
Optional SUSE subscription information. It is a dictionary. Should be set only if subscription is not already set or subscription has to be updated e.g.: {
username: "XYZ",
key: "ABC" ,
release: "12"
}
4. full_linux_subscription Optional If this variable is set to True, full linux subscription is done. Applying, Full Linux subscription is also depended on another variable private_proxy_ip_port True or False ( default )
5. private_proxy_ip_port Optional If this variable is passed, proxy server entries are made in /etc/bash.bashrc file. This variable should also be passed if full linux subscription is desired e.g.: 172.23.0.12:3128
powervs_prepare_rhel_sap
1. sap_solution Mandatory RHEL system roles for HANA or NETWEAVER will be executed HANA or NETWEAVER
2. host_ip Optional If this variable is included then mtu 9000 will not be set for this interface IP. e.g.: 192.168.1.1
3. sap_domain Mandatory sap domain name e.g.: xyz.com
4. rhel_subscription : {
username: "",
password: "" ,
release: ""
}
Optional RHEL subscription information. It is a dictionary. Should be set only if subscription is not already set or subscription has to be updated e.g.: {
username: "XYZ",
password: "ABC" ,
release: "8.2"
}
5. full_linux_subscription Optional If this variable is set to True, full linux subscription is done. Applying, Full Linux subscription is also depended on another variable private_proxy_ip_port True or False ( default )
6. private_proxy_ip_port Optional If this variable is passed, network proxy server entries are made in /etc/bashrc file. This variable should also be passed if full linux subscription is desired e.g.: 172.23.0.12:3128
powervs_fs_creation
1.a. disks_configuration: { counts: [ ], names: [ ], mounts: [ ], wwns: [ ] }
1.b. disks_configuration: [ { name: "", mount: "", wwns: ""}...]
Mandatory Disks configuration value to create and mount filesystems. Supports 2 data structures. First data structure is a single dictionary. Second data structure is a list of dictionaries. see example A and example B below
2. stripe_size Optional stripe size for disks Default is 64K
powervs_swap_creation
swap_disk_wwn Mandatory wwn id of swap disk. Required only for SAP Netweaver configuration wwn value
powervs_install_services
1. server_config: {
squid: { enable:"" },
ntp: { enable:"" },
nfs: { enable:""
nfs_directory: "" },
dns: { enable: "", dns_servers: "" } }
Mandatory server_config is a dictionary. Services are installed and enabled based on value passed for each service. e.g.: {
squid: { enable: false },
ntp: { enable: false },
nfs: { enable: true, nfs_directory: "/NFS; /hana/software" },
dns: { enable: false, dns_servers: "161.26.0.7; 161.26.0.8; 9.9.9.9;" } }
powervs_client_enable_services
1. client_config: {
squid: { enable: "", squid_server_ip_port: "", no_proxy_hosts: "" },
ntp: { enable: "", ntp_server_ip: "" },
nfs: { nfs: { enable: false, nfs_file_system: [ { name: nfs, mount_path: "/nfs", size: 300 } ] },
dns: { enable: "", dns_servers_ip: "" }
}
Mandatory client_config is a dictionary. Services are installed and enabled based on value passed for each service. e.g.: {
squid: { enable: true, squid_server_ip_port: "172.23.0.12:3128", no_proxy_hosts: "161.0.0.0/8" },
ntp: { enable: true, ntp_server_ip: "172.23.0.12" },
nfs: { enable: true, nfs_server_path: "172.23.0.12:/NFS;172.23.0.12:/hana/software", nfs_client_path: "/mnt;/hana" },
dns: { enable: true, dns_server_ip: "172.23.0.12" }
}

2. Roles Description

2.1. Preparing Operating System for SAP installations

This module is different for SLES and RHEL and hence should be selected as per operating system in use.

2.1.1 powervs_prepare_sles_sap:

This role performs the following tasks:

  • Enables multipathd daemon
  • Enables NFS Service
  • Enables rpcbind daemon
  • Sets MTU value to 9000 for SAP network interfaces
  • TSO is enabled for SAP network interfaces
  • SAPTUNE SOLUTION for HANA or NETWEAVER or NETWEAVER+HANA is applied based on parameter passed. Only Saptune v3 is supported.
  • Activates SUSE subscription or Full Linux Subscription
  • Set up network proxy on client. Modifies /etc/bash.bashrc file**

All settings applied remain persistent across reboot.

2.1.2 powervs_prepare_rhel_sap:

This role performs the following tasks:

  • Enables multipathd daemon
  • Enables NFS Service
  • Enables rpcbind daemon
  • Sets MTU value to 9000 for SAP network interfaces
  • Activates RHEL subscription or Full Linux Subscription
  • Set up network proxy on client. Modifies /etc/bashrc and /etc/dnf/dnf.conf files
  • Setting transparent_hugepage to never.

This role is followed by execution of following Red Hat Enterprise Linux System Roles

All settings applied remain persistent across reboot.

Note: Ansible playbook may report Failure/Warning, if scripts analyse reboot is required for settings applied by it. User should reboot their LPAR, in that case.

2.2. Creating Filesystems for SAP installations

This module is same for both SLES and RHEL.

powervs_fs_creation

This role performs the following tasks:

  • Creates filesystems with user defined stripe size using ansible built-in LVM logical volumes modules.
  • Mounts the filesystems on provided mount points
  • Adds an entry to /etc/fstab for automount on reboot.
  • Optional : Converts the input data structure of disks_configuration variable from dictionary to a general data structure.

A separate task called disks-dict2list.yml is used to handle disks_configuration variable values passed as dictionary to execute this role.

The input variable disks_configuration for this role supports 2 data structures. Only then disks_configuration will convert the disks_configuration variable data structure in example A to general data structure in example B below.

Example A. Data structure for disks_configuration variable as dictionary value example:

disks_configuration:
{
counts: [2,2,1],
names: [data,log,shared],
mounts: [/hana/data,/hana/log,/hana/shared],
wwns: [600507681082018bc8000000000057e4,600507681082018bc8000000000057e8,600507681082018bc8000000000057e5,600507681082018bc8000000000057e6,600507681082018bc8000000000057e7]
}

Example B. Data structure for disks_configuration variable as list value example:

disks_configuration: [
{
name: data,
mount: /hana/data,
wwns: 600507681082018bc8000000000057e4,600507681082018bc8000000000057e8
},
{
name: log,
mount: /hana/log,
wwns: 600507681082018bc8000000000057d9,600507681082018bc8000000000057ed7
},
{
name: shared,
mount: /hana/shared,
wwns: 600507681082018bc8000000000057f1
}
.
.
.
]

2.3. Configuring SWAP spaces

This module configures swap space on LPAR, and is same for both RHEL and SLES. This role is applicable for only for SAP Netweaver.

powervs_swap_creation

This role performs the following tasks:

  • Removes previous swap device configured
  • Creates a new swap device on disk provided with swap_disk_wwn variable.

Note:

For RHEL, swap disk of size >= 24GB is required for RHEL system role sap-netweaver-preconfigure to succeed.

2.4. Installing Services

This module is same for both SLES and RHEL.

powervs_install_services

This role performs the following tasks:

  • Installs SQUID package, and configures squid.conf file as described in this link https://cloud.ibm.com/docs/power-iaas?topic=power-iaas-set-full-Linux.
  • Installs DNS packages and configure DNS server forwarders based on the dns_servers input provided.
  • Installs NTP packages and configure ntp forwarder.
  • Installs NFS server packages, creates NFS mountable directories as provided with nfs_directory variable.

This role will start and enable all above mentioned services.

The input variable server_config is needed to be provided for this role to be executed. The variable file is defined as below

server_config: {
squid: { enable: false },
ntp: { enable: false },
nfs: { enable: false, nfs_file_system: [ { name: nfs, mount_path: "/nfs", size: 300 } ] },
dns: { enable: false, dns_servers: "161.26.0.7; 161.26.0.8; 9.9.9.9;" }
}

Each service can be enabled separately. Disabling service is not supported. With the variable file, users can enable one or many services on one or multiple hosts, as desired.

For NFS services, additional variable nfs_file_system is required. nfs_file_system is a list of dictionaries, which is used to create a NFS mountable filesystem named as per name variable, of provided size and mounted on mount_path.

For DNS services, additional variable dns_servers is required. These are user-defined DNS servers IPs. In example, 161.26.0.7 and 161.26.0.8 are default IBM Cloud DNS servers and 9.9.9.9 is default IBM Public DNS server. Please note, ;(semicolon) as a separator, in example.

2.5. Enabling Services on SAP instances

This module is same for both SLES and RHEL.

Role: powervs_client_enable_services

This role performs the following tasks:

  • Configures SQUID proxy.
  • Configures DNS server.
  • Installs NTP packages and updates named.conf file with ntp server to configure ntp services.
  • Installs NFS client packages, and mounts nfs exported directories as mentioned in variable file.

This role will also start and enable all above mentioned services.

The input variable client_config is needed to be provided for this role to be executed. The variable file looks like below

client_config: {
squid: { enable: false, squid_server_ip_port: "172.23.0.12:3128", no_proxy_hosts: "161.0.0.0/8" },
ntp: { enable: false, ntp_server_ip: "172.23.0.12" },
nfs: { enable: false, nfs_server_path: "172.23.0.12:/USER;172.23.0.12:/EXAMPLE", nfs_client_path: "/nfs;/HANA" },
dns: { enable: false, dns_server_ip: "172.23.0.12" }
}

Each services can be chosen to be enabled or not. Disabling is not supported. This variable file enables users, to enable one or many services on one or multiple SAP instances, as desired.

For NFS services, nfs_server_path, which are already network shared, and can be mounted on client should be provided. nfs_client_path are directories where NFS shared directory will be locally mounted.


3. Installation Guide

Install collection from Ansible Galaxy using below command

ansible-galaxy collection install ibm.power_linux_sap

A folder will be created in root directory : /root/.ansible/collections/ansible_collections/ibm/power_linux_sap/

To install RHEL system roles, follow the steps provided here


4. Execution Details

To execute playbook, cd to playbooks directory of collection.

Sample Ansible Playbook Execution

Local Host Execution

ansible-playbook --connection=local -i "localhost," power-linux-configure.yml -e "<Variable>"

Target Host Execution

ansible-playbook -i "<target-host>," power-linux-configure.yml -e "<Variable>"

4.1 Execution examples

  1. To run all roles powervs_prepare_sles_sap, powervs_fs_creation and powervs_swap_creation using variable file sample_linux_configuration_variable_file.yml inside directory playbooks/vars.
ansible-playbook --connection=local -i "localhost," power-linux-configure.yml -e @vars/sample_linux_configuration_variable_file.yml
  1. To run only powervs_prepare_sles_sap role without SUSE subscription variable,
ansible-playbook --connection=local -i "localhost," power-linux-configure.yml -e '{sap_solution: "HANA", host_ip: "192.168.1.1" }'
  1. To run only powervs_prepare_sles_sap role with SUSE subscription variable,
ansible-playbook --connection=local -i "localhost," power-linux-configure.yml -e '{sap_solution: "HANA", host_ip: "192.168.1.1", suse_subscription: { username: "XYZ", key: "ABC", release: "15"} }'
  1. To run only powervs_prepare_rhel_sap role without RHEL Subscription variable,
ansible-playbook --connection=local -i "localhost," power-linux-configure.yml -e '{sap_solution: "NETWEAVER", host_ip: "192.168.1.1" }'
  1. To run only powervs_prepare_rhel_sap role with RHEL Subscription variable,
ansible-playbook --connection=local -i "localhost," power-linux-configure.yml -e '{sap_solution: "NETWEAVER", sap_domain: xyz.com, rhel_subscription: { username: "XYZ",password: "ABC", release: "8.2"}, host_ip: "192.168.1.1" }'
  1. To run only powervs_fs_creation role to create filesystems using data structure example A above for disks_configuration:
ansible-playbook --connection=local -i "localhost," power-linux-configure.yml -e '{ disks_configuration: {counts:[8,8,1,1], names:[data,log,shared,usrsap], mounts:[/hana/data,/hana/log,/hana/shared,/usr/sap], wwns:[6005076810810261F800000000004094,6005076810810261F800000000004096,6005076810810261F80000000000409D,6005076810810261F8000000000040A3,6005076810810261F80000000000409A,6005076810810261F8000000000040A0,6005076810810261F8000000000040A4,6005076810810261F800000000004097,6005076810810261F800000000004098,6005076810810261F80000000000409E,6005076810810261F80000000000409B,6005076810810261F80000000000409F,6005076810810261F8000000000040A2,6005076810810261F8000000000040A1,6005076810810261F800000000004095,6005076810810261F800000000004093,6005076810810261F80000000000409C,6005076810810261F800000000004099] } }'
  1. To run only powervs_fs_creation role to create filesystems using data structure example B above for disks_configuration:
ansible-playbook --connection=local -i "localhost," power-linux-configure.yml -e '{disks_configuration: [{ name: log, mount: /hana/log, wwns: 6005076810810261F800000000004098,6005076810810261F80000000000409E,6005076810810261F80000000000409B,6005076810810261F80000000000409F,6005076810810261F8000000000040A2,6005076810810261F8000000000040A1,6005076810810261F800000000004095,6005076810810261F800000000004093},{ name: shared, mount: /hana/shared, wwns: 6005076810810261F80000000000409C},{ name: usrsap, mount: /usr/sap, wwns: 6005076810810261F800000000004099}]}'
  1. To run only powervs_swap_creation role:
ansible-playbook --connection=local -i "localhost," power-linux-configure.yml -e '{swap_disk_wwn: 6005076810810261F80000000000409H}'
  1. To run all roles powervs_prepare_sles_sap, powervs_fs_creation and powervs_swap_creation using data structure example B above for disks_configuration:
ansible-playbook --connection=local -i "localhost," power-linux-configure.yml -e '{ sap_solution: "NETWEAVER", host_ip: "192.168.1.1", suse_subscription: { username: "XYZ", key: "ABC", release: "15"},  disks_configuration: [{ name: log, mount: /hana/log, wwns:   6005076810810261F800000000004098,6005076810810261F80000000000409E,6005076810810261F80000000000409B,6005076810810261F80000000000409F,6005076810810261F8000000000040A2,6005076810810261F8000000000040A1,6005076810810261F800000000004095,6005076810810261F800000000004093},{ name: shared, mount: /hana/shared, wwns: 6005076810810261F80000000000409C},{ name: usrsap, mount: /usr/sap, wwns: 6005076810810261F800000000004099}], swap_disk_wwn: 6005076810810261F80000000000409H }'

4.2. Installing management services (SQUID, NTP, NFS, DNS).

  1. To run powervs_install_services role, to configure all services on one host, using variable file sample_services_variable_file.yml inside directory playbooks/vars. Variable file should be modified like below:
server_config: {
squid: { enable: true },
ntp: { enable: true },
nfs: { enable: false, nfs_file_system: [ { name: nfs, mount_path: "/nfs", size: 300 } ] },
dns: { enable: true, dns_servers: "161.26.0.7; 161.26.0.8; 9.9.9.9;" }
}
ansible-playbook --connection=local -i "localhost," powervs-services.yml -e @vars/sample_services_variable_file.yml

  1. To run powervs_install_services role, to configure squid service only, using variable file sample_services_variable_file.yml inside directory playbooks/vars. Variable file should be modified like below:
server_config: {
squid: { enable: true }
}

For localhost execution:

ansible-playbook --connection=local -i "localhost," powervs-services.yml -e @vars/sample_services_variable_file.yml

For remote host ( host on which service has to be enabled ) execution:

ansible-playbook -i "remote_host_name," powervs-services.yml -e @vars/sample_services_variable_file.yml

4.3. Enabling services.

  1. To run powervs_client_enable_services role, to enable services on client, using variable file sample_client_services_variable_file.yml inside directory playbooks/vars. Variable file should be modified like below:
client_config: {
squid: { enable: true, squid_server_ip_port: "172.23.0.12:3128", no_proxy_hosts: "161.0.0.0/8" },
ntp: { enable: true, ntp_server_ip: "172.23.0.12" },
nfs: { enable: true, nfs_server_path: "172.23.0.12:/NFS;172.23.0.12:/hana/software", nfs_client_path: "/nfs;/hana" },
dns: { enable: true, dns_server_ip: "172.23.0.12" }
}
ansible-playbook --connection=local -i "localhost," powervs-services.yml -e @vars/sample_client_services_variable_file.yml

  1. To run powervs_client_enable_services role, to enable squid service only, using variable file sample_client_services_variable_file.yml inside directory playbooks/vars. Variable file should be modified like below:
client_config: {
squid: { enable: true, squid_server_ip_port: "172.23.0.12:3128", no_proxy_hosts: "161.0.0.0/8" }
}

For localhost execution:

ansible-playbook --connection=local -i "localhost," powervs-services.yml -e @vars/sample_client_services_variable_file.yml

For remote host ( host on which service has to be enabled ) execution:

ansible-playbook -i "remote_host_name," powervs-services.yml -e @vars/sample_client_services_variable_file.yml


5. Requirements, Dependencies and Testing

5.1 Operating System requirements

Designed for Linux operating systems, RHEL and SLES.

This role has not been tested and amended for SAP NetWeaver Application Server instantiations on IBM AIX or Windows Server.

Assumptions for executing this role include:

  • Registered OS license and OS package repositories are available (from the relevant content delivery network of the OS vendor)

5.2 Python requirements

Python 3 from the execution/controller host.

5.3 Testing on execution/controller host

Tests with Ansible Core release versions:

  • Ansible Core 2.9.19 community edition

Tests with Python release versions:

  • Python 3.6.8

Testing on target/remote host

Tests with Operating System release versions:

  • RHEL 8.2 for SAP
  • SLES 15 for SAP
  • SLES 12 for SAP

License

Contributors

Contributors to the Ansible Roles within this Ansible Collection, are shown within /docs/contributors.

About

Provide Ansible roles for administrator tasks in the context of SAP installations on the IBM PowerVS.

Resources

License

Stars

Watchers

Forks

Packages

No packages published