Monday, 21 November 2022

Automating SAP HANA Installation in Minutes (AWS) – Part 1

This blog describes installing HANA database automatically in less than 15 minutes in AWS with some prerequisite like VPC, AMI, Subnet, Security Group, IG, EC2, EBS, AWS CLI, AWS Access Keys and SAP HANA media  others mandatory services available in place to host the HANA workloads in AWS cloud.

Operating System (AMI):

AMI is created with SUSE Linux environment (SLES-15 with SP4) with the latest OS update, with the following packages amazon-ssm-agent.rpm, nfs-utility, insserv-compat and libltdl7.

Terraform & AWS CLI :

Terraform v0.15.5 for Windows (64) bit has been installed for building the workloads though API with AWS CLI.

Generate Configuration File:


Generate configuration file by using the below command for batch installation through a different machine so that the installation can be carried out in batch mode.

SAP HANA, SAP HANA Career, SAP HANA Jobs, SAP HANA Skills, SAP HANA Installation

This will generate two files server.xml and server.cfg, the server.xml for maintain the master passwords and server.cfg for maintaining the following parameter

Componet_medium=/path/to/the/media

User_master_password=y

Components=server

Hostname=hanadev

Terraform Configuration File (Main.tf):


Create the EC2 resource through terraform with the following configuration.

SAP HANA, SAP HANA Career, SAP HANA Jobs, SAP HANA Skills, SAP HANA Installation

AMI-contains the following OS & packages pre-installed:

◉ SLES-15 with SP4 latest OS update,
◉ nfs-utility
◉ insserv-compat
◉ libltdl7
◉ amazon-ssm-agent.rpm (optional)
◉ AWS Backint agent (optional)

EBS-Volume: Type of volume is of your choice (GP2/GP3/io1/io2/st1)

SAP HANA, SAP HANA Career, SAP HANA Jobs, SAP HANA Skills, SAP HANA Installation

EBS Volume (Attachment):

SAP HANA, SAP HANA Career, SAP HANA Jobs, SAP HANA Skills, SAP HANA Installation

User_data: (init-script.sh):

SAP HANA, SAP HANA Career, SAP HANA Jobs, SAP HANA Skills, SAP HANA Installation

Mount the media which is available in the EFS folder

1. sudo mkdir -p /mnt/efs
2. sudo mount -t nfs4 -o nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport 123.456.78.160:/ /efs

Create the Physical Volume & Volume Group, FS and Mount

3. sudo pvcreate /dev/xvdh
4. sudo vgcreate datavg /dev/xvdh

Create logical volume for installing SAP HANA

5. sudo lvcreate -n lvshared -L 50G datavg
6. sudo lvcreate -n lvdata -L 50G datavg
7. sudo lvcreate -n lvlog -L 50G datavg
8. sudo lvcreate -n lvusrsap -L 50G datavg

Create “xfs” file system

9.  sudo mkfs.xfs /dev/datavg/lvshared
10. sudo mkfs.xfs /dev/datavg/lvdata
11. sudo mkfs.xfs /dev/datavg/lvlog
12. sudo mkfs.xfs /dev/datavg/lvusrsap
13. sudo mkdir -p /hana

Create directory and mount the file system

14. sudo mkdir -p /hana/shared
15. sudo mkdir -p /hana/data
16. sudo mkdir -p /hana/log
17. sudo mkdir -p /usr/sap
18. mount /dev/datavg/lvshared /hana/shared
19. mount /dev/datavg/lvdata /hana/data
20. mount /dev/datavg/lvlog /hana/log
21. mount /dev/datavg/lvusrsap /usr/sap

Trigger the batch command with pre-generated files for silent/batch installation with SID

22. cat /efs/hanafiles/configfile.xml | /efs/hanafiles/DATA_UNITS/HDB_LCM_LINUX_X86_64/hdblcm –read_password_from_stdin=xml –sid=DE2 –components=server –use_master_password=yes -b

No comments:

Post a Comment