SAP HANA Installation Automation – by the SAP HANA Academy
Introduction
Recently, we have updated a number of SAP HANA Academy tutorial videos for the playlist
In this blog, I will provide some references and background information about installation automation with the SAP HANA platform lifecycle management tools.
This blog is part of a series:
- SAP HANA 2.0 installation and update
- SAP HANA 2.0 platform lifecycle management
- SAP HANA Installation Automation (this blog)
- SAP HANA 2.0 Server Installation
- SAP HANA 2.0 XS Advanced Installation
- SAP HANA 2.0 Client Installation and Update
- SAP HANA 2.0 Studio Installation and Update
- SAP HANA Cockpit 2.0 Installation and Update
- Installing SAP HANA SHINE
SAP HANA Academy – SAP HANA Installation and Update (YouTube Playlist)
Tutorial Video
SAP HANA Academy – SAP HANA Installation and Update: Installation Automation
Create the Configuration File
In the previous blogs about SAP HANA 2.0 platform lifecycle management and SAP HANA 2.0 Server Installation, I already briefly mentioned installation automation. Using a combination of configuration files together with optional command line options, you can automate installations, that is, create a repeatable process that can be scheduled without any further human intervention.
The process is simple. First, you create a configuration or response file by running the hdblcm installation tool with the dump_configfile_template and action parameter.
The location and name of the file, including the extension (if any), are for you to choose.
./hdblcm --action=install \
--dump_configfile_template=/tmp/install.rsp
This command will generate both the configuration template file and a password template file.
Configure the Configuration File
Next, we need to edit the installation parameters. There are a bit over 100 parameters available so it might take a bit time to get this right, depending on the requirements. However, the good news is that all parameters have a default value, except for the sid (system identifier) and password parameters.
For the parameter reference, see
- Parameter Reference – SAP HANA Server Installation and Update Guide
General and Action
In the General section, you specify where the installation media is located (component_medium, _dirs, _root), whether to use a master password – for the operating system accounts <sid>adm and sapadm and database users SYS and SYSTEM (amongst others, see below) and which components to install.
It also includes the configuration of remote execution which concerns a distributed (multi-host) installation which itself is configured in the AddHosts section (see below).
For remote execution of multiple-host system operations, see
The Action section only has a single parameter, action, which will have been already set with the value you provided on the command line when running the hdblcm command.
As I explained in the SAP HANA 2.0 platform lifecycle management blog, hdblcm is a ‘wrapper’ tool that calls other executables for the different actions. Action=install will call hdbinst and action=update will call hdbupd. In the Client section below, you can see that we can run these tools independently as well with a response file, for example, when installing the SAP HANA client on a client computer.
Server
In the Server section, all the parameters specific to the HANA database server are specified. The sid is required, all others are optional.
For more information about these parameters, see
Storage
The storage_cfg parameter points to the directory where you have placed the customized global.ini file. This makes it possible to set up a storage connector, allowing SAP HANA to use hardware vendor-specific scripts for automated resource allocation and input/output fencing during failover.
For an example of such an implementation, see
- Storage Configuration Best Practices for SAP HANA TDI on Dell EMC VMAX 33 Solution Guide
- Implementing High Availability and Disaster Recovery Solutions with SAP HANA on IBM Power Systems
For the documentation, see
- Tutorial: Using Custom Configuration Files – SAP HANA Server Installation and Update Guide
Note that the hdbparam utility is no longer included with SAP HANA 2.0 and has been deprecated.
- 2267798 – Configuration of the SAP HANA Database during Installation Using hdbparam
- 2399079 – Elimination of hdbparam in HANA 2
Storage Configuration Best Practices for SAP HANA TDI on Dell EMC VMAX 33 Solution Guide
Implementing High Availability and Disaster Recovery Solutions with SAP HANA on IBM Power Systems
The AddHosts section covers the parameters relevant to distributed (multi-host) systems: the hostname of the hosts and the host role.
Optional Components
There is a dedicated section for each of the different host roles (Streaming Analytics, Dynamic Tiering, Accelerator for ASE and Remote Data Synch. When these components are not listed in the General section, these sections are ignored by the installer.
For more information about these features, see
XS Advanced
For the XS Advanced runtime, there is another dedicated parameter section.
For more information about these parameters and about installing XSA, see
Client and Studio
Finally, there is a section about the SAP HANA client and studio. See
Configure the Password File
As we have seen, there are several locations where passwords can be specified in the configuration file. Master password in the General section, operating system accounts (root, sapadm, <sid>adm) and database users in the Server section, accounts for features, and for XS Advanced.
Typically, a security administrator will not be amused when passwords are specified in text files.
For this reason, the read_password_from_stdin=xml parameter is available to indicate to hdblcm when running in batch mode to get the passwords from ‘standard input’, which for UNIX refers to commands entered on the command line.
However, as we still want to automate the installation, we are now going to set the passwords in another configuration file, this time in XML format, which we can secure and include in the installation process as appropriate.
In the vi editor, you can use the substitute command to easily change the asterisks to a new master password.
:%s/\*\*\*/your-master-password/
For more information, see
- Specifying Passwords – SAP HANA Server Installation and Update Guide
Install in Batch Mode
When we are done with editing the configuration and password file, we can simply run the install in batch mode with the -b (or –batch) parameter together with —configfile.
Parameters passed as call options to the installer take precedence over parameter defined in the configuration file.
You could, for example, generate the SID parameter using a script and pass it to the installer in case you need unique values.
#!/bin/bash
# sample script to explain the concept
# do not try this at home or at work
for i in {0..9} do
./hdblcm -b --sid=EZ$i –-configfile=server.cfg
done
exit 0
To include our password parameter file, we are going to make use of more UNIX magic: the pipe. This allows us to pass the passwords to the installer without displaying them on the console or in command history.
cat ~/passwords.xml | ./hdblcm --sid=DB1 \
--read_password_from_stdin=xml \
--configfile=server.cfg -b
SAP HANA Client
To automate installations of the SAP HANA client (or studio) on a system that do not contain an SAP HANA server installation, we can use the same approach.
First, generate a configuration file and edit the parameters. This time, use the hdbinst or hdbupd executable directly (and hence we no longer need to specify the action= parameter). Again, the name and extension of the response file are irrelevant.
To install, run the command specifying –batch (-b) with configfile.
For the parameter reference, see
- Command and Call Option Reference – SAP HANA Client Installation and Update Guide
# Windows in command prompt
hdbinst.exe --dump_configfile_template=c:\temp\client.rsp
hdbinst.exe -b --configfile=c:\temp\client.rsp
# UNIX, Linux, macOS
./hdbinst --dump_configfile_template=/tmp/client.cfg
./hdbinst -b --configfile=/tmp/client.cfg
References
For more information see:
SAP HANA Academy Playlists
SAP Community Blogs
SAP Documentation
- Tutorial: Automating Installation – SAP HANA Server Installation and Update Guide
- Tutorial: Using Custom Configuration Files – SAP HANA Server Installation and Update Guide
- Parameter Reference – SAP HANA Server Installation and Update Guide
- Specifying Passwords – SAP HANA Server Installation and Update Guide
- Command and Call Option Reference – SAP HANA Client Installation and Update Guide
Notes
- 2267798 – Configuration of the SAP HANA Database during Installation Using hdbparam
- 2399079 – Elimination of hdbparam in HANA 2
- 2186744 – FAQ: SAP HANA Parameters
SAP Partner Documentation
- Storage Configuration Best Practices for SAP HANA TDI on Dell EMC VMAX 33 Solution Guide
- Implementing High Availability and Disaster Recovery Solutions with SAP HANA on IBM Power Systems
Thank you for watching
The SAP HANA Academy provides technical enablement, implementation and adoption support for customers and partners with 1000’s of free tutorial videos.
For the full library, see SAP HANA Academy Library – by the SAP HANA Academy
For the full list of blogs, see Blog Posts – by the SAP HANA Academy
- Subscribe to our YouTube channel for updates
- Join us on LinkedIn linkedin.com/in/saphanaacademy
- Follow us on Twitter @saphanaacademy
- Google+ plus.google.com/+saphanaacademy
- Facebook facebook.com/saphanaacademy
Hi Denys,
Can we automate the installation procedure using the above procedure for HANA 1.0 SP12?
Laxmikanth,
Yes, we can!
The installation process has not changed very drastically since SAP HANA 1.0 SPS 10.
For the latest changes, see
Regards,
Denys / SAP HANA Academy
Subscribe to our YouTube Channel
Join us on LinkedIn
Follow us on Twitter
Github code samples
Facebook
Hi Denys,
there are lots of documentations about automation of Installation, but i didn't find anything about automated update/SPS implementation. Do you know useful links/blogs for me?
thank you,
Günther
Hi Günther,
Yes,
Follow above (great) blog from @Denys van Kempen
but just use:
./hdblcm --action=update
instead of
./hdblcm --action=install
to generate the config file at the beginning. All other steps remains the exact same !
cheers, jean
Hi Denys,
Thanks for the tutorial. I have query regarding the root user section. We use the sudo su - option to access root user and we are not provided the password for this user. How do we proceed with creating the config file in this case.
Thanks,
Pradeep
Hi Pradeep,
You do not require access to the (one-and-only) root user account; all you need is access to a user with root user privileges. Just create a "lroot" (or whatever name you prefer) for this purpose (and delete or disable afterwards) / or ask your administrator to create such a user for this purpose. With [sudo su - ] privilege you have all the privileges required to create this user but you might want to check with the admin team for best practices at your company.
Regards,
Denys
Hi Denys,
Is there anyway to download the config file from existing HANA installation?
Thanks,
Sandeep
Hi Sandeep,
... anyway to download?
To download files from the server to your client computer you can use any (S)FTP client. I mostly use WinSCP when working from Windows.
... from existing HANA installation?
The installation log will record any configuration file used and its contents.
Should you have been interested in a sample RSP file, please find it below.
Command =
./hdblcm --action=install --dump_configfile_template=/tmp/install.rsp
Regards,
Denys
===
[General]
# Location of SAP HANA Database Installation Medium
component_medium=
# Comma separated list of component directories
component_dirs=
# Directory root to search for components
component_root=
# Use single master password for all users, created during installation ( Default: n )
use_master_password=n
# Skip all SAP Host Agent calls ( Default: n )
skip_hostagent_calls=n
# Remote Execution ( Default: ssh; Valid values: ssh | saphostagent )
remote_execution=ssh
# Verify the authenticity of SAP HANA components ( Default: n )
verify_signature=n
# Components ( Valid values: all | client | es | ets | lcapps | server | smartda | streaming | rdsync | xs | studio | afl | sca | sop | eml | rme | rtl | trp | vch )
components=
# Ignore failing prerequisite checks
ignore=
# Do not Modify '/etc/sudoers' File ( Default: n )
skip_modify_sudoers=n
[Action]
# Action ( Default: exit; Valid values: install | update | extract_components )
action=install
[Server]
# Enable usage of persistent memory ( Default: n )
use_pmem=n
# Enable the installation or upgrade of the SAP Host Agent ( Default: y )
install_hostagent=y
# Database Isolation ( Default: low; Valid values: low | high )
db_isolation=low
# Create initial tenant database ( Default: y )
create_initial_tenant=y
# Non-standard Shared File System
checkmnt=
# Installation Path ( Default: /hana/shared )
sapmnt=/hana/shared
# Local Host Name ( Default: mo-fc337b361.mo.sap.corp )
hostname=mo-fc337b361.mo.sap.corp
# Install SSH Key ( Default: y )
install_ssh_key=y
# Root User Name ( Default: root )
root_user=root
# Root User Password
root_password=
# SAP Host Agent User (sapadm) Password
sapadm_password=
# Directory containing a storage configuration
storage_cfg=
# Internal Network Address
internal_network=
# SAP HANA System ID
sid=
# Instance Number
number=
# Local Host Worker Group ( Default: default )
workergroup=default
# System Usage ( Default: custom; Valid values: production | test | development | custom )
system_usage=custom
# Location of Data Volumes ( Default: /hana/data/${sid} )
datapath=/hana/data/${sid}
# Location of Log Volumes ( Default: /hana/log/${sid} )
logpath=/hana/log/${sid}
# Location of Persistent Memory Volumes ( Default: /hana/pmem/${sid} )
pmempath=/hana/pmem/${sid}
# Directory containing custom configurations
custom_cfg=
# Restrict maximum memory allocation?
restrict_max_mem=
# Maximum Memory Allocation in MB
max_mem=
# Certificate Host Names
certificates_hostmap=
# Master Password
master_password=
# System Administrator Password
password=
# System Administrator Home Directory ( Default: /usr/sap/${sid}/home )
home=/usr/sap/${sid}/home
# System Administrator Login Shell ( Default: /bin/sh )
shell=/bin/sh
# System Administrator User ID
userid=
# ID of User Group (sapsys)
groupid=
# Database User (SYSTEM) Password
system_user_password=
# Restart system after machine reboot? ( Default: n )
autostart=n
# Enable HANA repository ( Default: y )
repository=y
# Inter Service Communication Mode ( Valid values: standard | ssl )
isc_mode=
[AddHosts]
# Auto Initialize Services ( Default: y )
auto_initialize_services=y
# Additional Hosts
addhosts=
# Additional Local Host Roles ( Valid values: extended_storage_worker | extended_storage_standby | ets_worker | ets_standby | streaming | rdsync | xs_worker | xs_standby )
add_local_roles=
# Automatically assign XS Advanced Runtime roles to the hosts with database roles (y/n) ( Default: y )
autoadd_xs_roles=y
# Import initial content of XS Advanced Runtime ( Default: y )
import_xs_content=y
[Client]
# SAP HANA Database Client Installation Path ( Default: ${sapmnt}/${sid}/hdbclient )
client_path=/hana/shared/${sid}/hdbclient
[Studio]
# SAP HANA Studio Installation Path ( Default: ${sapmnt}/${sid}/hdbstudio )
studio_path=/hana/shared/${sid}/hdbstudio
# Enables copying of SAP HANA Studio repository ( Default: y )
studio_repository=y
# Target path to which SAP HANA Studio repository should be copied
copy_repository=
# Java Runtime ( Default: )
vm=
[Reference_Data]
# Installation Path for Address Directories and Reference Data
reference_data_path=
[XS_Advanced]
# Install XS Advanced in the default tenant database? (y/n) ( Default: n )
xs_use_default_tenant=n
# XS Advanced App Working Path
xs_app_working_path=
# Organization Name For Space "SAP" ( Default: orgname )
org_name=orgname
# XS Advanced Admin User ( Default: XSA_ADMIN )
org_manager_user=XSA_ADMIN
# XS Advanced Admin User Password
org_manager_password=
# Customer Space Name ( Default: PROD )
prod_space_name=PROD
# Routing Mode ( Default: ports; Valid values: ports | hostnames )
xs_routing_mode=ports
# XS Advanced Domain Name (see SAP Note 2245631)
xs_domain_name=
# Run Applications in SAP Space with Separate OS User (y/n) ( Default: y )
xs_sap_space_isolation=y
# Run Applications in Customer Space with Separate OS User (y/n) ( Default: y )
xs_customer_space_isolation=y
# XS Advanced SAP Space OS User ID
xs_sap_space_user_id=
# XS Advanced Customer Space OS User ID
xs_customer_space_user_id=
# XS Advanced Components
xs_components=
# Do not start the selected XS Advanced components after installation ( Default: none )
xs_components_nostart=none
# XS Advanced Components Configurations
xs_components_cfg=
# XS Advanced Certificate
xs_cert_pem=
# XS Advanced Certificate Key
xs_cert_key=
# XS Advanced Trust Certificate
xs_trust_pem=
[streaming]
# Streaming Cluster Manager Password
streaming_cluster_manager_password=
# Location of Streaming logstores and runtime information ( Default: /hana/data_streaming/${sid} )
basepath_streaming=/hana/data_streaming/${sid}
[es]
# Location of Dynamic Tiering Data Volumes ( Default: /hana/data_es/${sid} )
es_datapath=/hana/data_es/${sid}
# Location of Dynamic Tiering Log Volumes ( Default: /hana/log_es/${sid} )
es_logpath=/hana/log_es/${sid}
[ets]
# Location of Data Volumes of the Accelerator for SAP ASE ( Default: /hana/data_ase/${sid} )
ase_datapath=/hana/data_ase/${sid}
# Location of Log Volumes of the Accelerator for SAP ASE ( Default: /hana/log_ase/${sid} )
ase_logpath=/hana/log_ase/${sid}
# SAP ASE Administrator User ( Default: sa )
ase_user=sa
# SAP ASE Administrator Password
ase_user_password=
[rdsync]
# Location of SAP HANA Remote Data Sync file download directory ( Default: /hana/download_rdsync/${sid} )
rdsync_downloadpath=/hana/download_rdsync/${sid}
# Location of SAP HANA Remote Data Sync file upload directory ( Default: /hana/upload_rdsync/${sid} )
rdsync_uploadpath=/hana/upload_rdsync/${sid}
Nice.
Just updated 2.00.044 from SAP ABAP Platform 1909 Developer Edition to 2.00.048 with:
# cat install.rsp.xml | /hana/shared/HDB/SAP_HANA_DATABASE/hdbupd --sid=HDB --read_password_from_stdin=xml --configfile=update.rsp -b
Hello Denys,
Awesome blog, very useful! Where can I specify the <sid>adm user/password in either file? what are the options for automating an hdblcm upgrade via <sid>adm user ID in case getting a root/root-like user is not possible?
Regards,
Vaishakh
Hi Vaishakh,
You can find this documented in the Installation Guide, e.g.
Note that the <sid>adm user is fixed. Only the <SID> part is configurable.