Skip to content
Markus Koch edited this page Jun 2, 2017 · 9 revisions

Welcome to the ansible-hana-sysprep wiki!

The current release of ansible-hana-sysprep has evolved into a more complex setup. Therefore the current README file is not sufficient any more.

What is ansible-hana-sysprep

This collection of playbooks should help to verify and setup your environment with SAP HANA databases in an automated fashion.

Possible deployment options of SAP HANA covered by this collection:

hana scale-up

  • one instance
  • multi instance installation (not multi-container)
  • hana scale-up system-replication (one and multiinstance)

hana scale-out

  • one instance
  • multi instance installation (not multi-container)
  • hana scale-out system-replication (one and multiinstance)

The following figure illustrates the intended workflow: << Workflow Picture missing >>

Configuration

The following playbooks are part of this ansible collection:

  • base-host-setup
  • preconfigure
  • deployment
  • hsr

base-host-setup

The scope of this role is to do some common things which every customer typically does on an individual basis in satellite, kickstart or with other configuration methods , such as more sophisticated ansible roles. This role is basically sufficient for quickly setting up a demo or test system with little environmental constraints. It also requires internet access or at least satellite access to work.

In production environments you most likely will replace this role with something more sophisticated

Currently it fulfills the following basic setup

  • register a system against satellite 6 or RHN with an activation key, which you site administrator should have configure
  • controls that the required EUS channels are available (using RedHat naming conventions)
  • TODO: disk-setup, preconfigure role should only do a disk-check
  • TODO: ntpserver setup (should only be controlled in the preconfigure role)
  • TODO: network setup (we currently assume networking is working correctly after installation)
  • TODO: DNS, hostname configuration (This will only be controlled in the preconfigure role)

You can define the following variable to make sure this ntpserver is added to your NTP-Config. If you leave it empty or undefined your ntp configuration stays untouched.

  • ntpserver: pool.ntp.org

preconfigure

The scope of this role is to fully prepare your system according to the SAP Notes, so that the system is ready to get SAP HANA installed. If you figure out some required changes for your environment, thatare different to the SAP recommendation, please file a pull request and/or leave a comment, why this is important.

deployment

This does the unattended HANA installation according to the defined variables and installation scenrios (scale-up/scale-out)

HSR

This executes the setup of HANA System Replication in case you have defined the appropriate variables

Howto configure the variable files

Configuratuion variables for system-registration (only used in the base-host-setup role)

  • reg_activation_key : Defines the activation key to use in RHN or Satellite 6
  • reg_organization_id : Enter the organisation in Satellite (e.g. Default) or in RHN. Run subscription-manager orgs to see the available options
  • satellite_server: Enter the name of the Satellite Server you want to register against. Don't use this variable or leave it empty if you want to register against RHN
  • force_repo_reset: [true|false] : If set to true it will disable all prior existing repositories.
  • check_repos: [true|false] : If set to true it will enable all required repositories for HANA installation according to https://access.redhat.com/solutions/2262851 or https://access.redhat.com/solutions/2318061

NOTE: If you provide your own repositories, make sure you use EUS packages. HANA certifications do not allow a diffrent minor release than stated in the PAM.

Configuration for SAP-Media-Check (preconfiguration role)

The scope of this check is to make sure that the HANA installation files are available on the host. Normally you have your own setup to do this, e.g. automounter or local copy. It figures out the HANA version you provided to make installation decsions based on this information. So you need to define the path to your HANA installation directory here:

  • hana_installdir : /path/to/hana/installdir

If you want the media-check to mount the nfs share for you define the follwoing variables:

  • install_nfs: "<ip-address>:/export/directory" : NFS Share that holds installation tree
  • installroot: /somepath : Mountpoint, where to mount the above share
  • hana_installdir: {{ installroot + '/wherever/the/files/are' }} : path to HANA install dir

Furthermore the media check allows you to provide an NFS Share where your installation files or freshly download HANA rar archives live. In case you want to unpack the rar files that live on an NFS-Share, define the following variables:

  • install_nfs: "<ip-address>:/export/directory" : NFS Share that holds the rar files
  • installroot: /install where to unpack the Hana install binaries
  • installversion: "51051151" : Hana Install version. basically the numeric prefix of the first rar archive In addition you need to provide an unrar binary to unpack the rar archives. Red Hat cannot provide an unrar command, due to license restrictions, so that you need to provide it externally. If you have an appropriate package on your satellite server or internet access you can provide the name of the package in the varaible * unrar_pkg, here are some examples where to get working unrar packages:
  • unrar_pkg: http://apt.sw.be/redhat/el6/en/x86_64/rpmforge/RPMS/unrar-4.2.3-1.el6.rf.x86_64.rpm RHEL 6
  • unrar_pkg: https://forensics.cert.org/centos/cert/7/x86_64/unrar-5.3.0-1.el7.x86_64.rpm RHEL 7
  • unrar_pkg: unrar use this if you have this package available through a configured yum.repo

If you do not have an unrar package you can also provide a path to the unrar command in the variable unrar_cmd. I prefer putting it on the NFS-Share where my archives live, which is mounted to /tmp/install. So define the variable similar to this:

  • unrar_cmd: /tmp/install/bin/unrar

When you unpack your installation archives like this, it is save to define hana_install dir like this

  • hana_installdir: "{{ installroot + '/' + installversion }}"

Variables to configure HANA deployment

  • deployment_instance: [true|false] : set this to true, on the host where you want to kick off the HANA installation
  • hostname: system hostname, needed for internal tests for Scale-Out and SAP Host Agent, and for multihomed systems. Use "{{ ansible_hostname }}" as default value
  • hana_pw_hostagent_ssl: Password for SAP Host Agent
  • id_user_sapadm: System user ID for Linux user sapadm
  • id_group_shm: System Group ID for shm
  • id_group_sapsys: System group ID for Linux group sapsys
  • pw_user_sapadm_clear: Password for Linux system user sapadm in clear text

For parallel (not multi-container) instance installation the following dictionary needs to be configured for each member of the scaleout cluster. Look in the examples folder for examples for complete setups

instances:
 _sid_:                                                        # HANA SID
   id_user_sidadm: "_numeric_id_"                              # sidadm UID
   pw_user_sidadm: "_cleartext_password_"                      # SIDadm password
   # The following parameters are identical to parameters in the HANA deployment file
   hana_components: "client,server"                            # HANA components to install
   hana_system_type: "Master"                                  # HANA System type
   id_group_shm: "_numeric_id_"                                # SHM GID
   hana_sid_small: hxe                                         # SID in small CAPS (NOTE: redundant info)
   hana_addhosts: additional_hostnames                         # list of hosts for Scale-Out deployments, leave it undefined or empty for scale-up configs
   hana_instance_hostname: _local_hostname_                    # name of host
   hana_sid: _SID_                                             # again the HANA SID
   hana_instance_number: 90                                    # HANA instance number
   hana_system_usage: custom                                   # System Usage ( Default: custom; Valid values: production | test | development | custom )  
   hana_pw_system_user_clear: "_cleartext_password_"           # Database User (SYSTEM) Password 

If you want to install HANA System Replication (HSR) your configuration need to define the following additional dictionaries. The first one is the primary side, the second the secondary side. Three parameters need to be different for each server in System replication:

  • hsr_type_remote_host
  • hsr_name
  • hana_instance_hostname

The following dictionary needs to be defined for system replication:

 hsr:
   _sid_:                                   # SID for deployment
     hana_instance_hostname: primary_host   # Instance Hostname for Initial Configuration (Only used on configure System)
     hana_sid: SID                          # HANA SID (Capital letters, redundant)
     hana_sid_small: sid                    # HANA SID (lower, redundant)
     hana_instance_number: 90               # HANA instance Number
     hana_pw_system_user_clear: _password_  # System User Password needed for Configuration of HANA System Replication
     hsr_name: _freetext_                     # HSR Name used for unique Systemname in HANA System Replication       
     hsr_type: PRIMARY                      # Old Type for definition Type (PRIMARY, SECONDARY) (unsued)   
     hsr_configure: yes                     # Should HSR be configured (unsued)
     hsr_type_remote_host: _secondary_host_ # Remote Host for HANA System Replication 
     hsr_operation_mode: logreplay          # HSR Operation Mode        
     hsr_replicationmode: sync              # HSR Replication Mode
     hsr_backup_directory: /hana/shared/{{SID}}/HDB{{hana_instance_number}}/backup/data  # HSR Backup Directory is needed to configure initial HANA System Replication