[ {"DeviceName":"/dev/sda1","Ebs":
{"VolumeSize":50,"VolumeType":"gp2","DeleteOnTermination":false}},
If the DeleteOnTermination flag is set to false, Amazon EBS volumes are not deleted when you terminate your Amazon EC2 instance. This helps preserve your data from accidental termination of your Amazon EC2 instance. When you terminate the instance, you need to manually delete the Amazon EBS volumes that are associated with the terminated instance to stop incurring storage cost.
See Appendix A (p. 81) for more examples of block device mappings for other Amazon EC2 instance types and Amazon EBS volume types.
NoteIf you plan to deploy scale-out workloads, you don’t have to include Amazon EBS volumes for SAP HANA shared and backup volumes. You can use Amazon EFS and Network File System (NFS) to mount the SAP HANA shared and backup volumes to your master and worker nodes.
Step 2. Launch the Amazon EC2 instance
Use AWS CLI to launch the Amazon EC2 instance for SAP HANA, including Amazon EBS storage, in the VPC in your target AWS Region by using the information you gathered during the preparation steps; for example:
Important
Be sure to enter the command on a single line.
$ aws ec2 run-instances --image-id ami-xxxxxxxx
• The --placement parameter is optional and needed only when you use a dedicated host with host tenancy or you want to place all your Amazon EC2 instances in close proximity. You may also pass
Deployment steps using the console
additional parameters like private-ip-address, disable-api-termination, etc., as needed for your environment. For additional details, see run-instances in the AWS CLI Command Reference.
• After the instance and volumes are created, you can adjust the values of Amazon EBS volume tags to be more specific for ease of management. You can also add any additional tags that you need.
• For scale-out workloads, you can use the --count parameter to specify the total number of required nodes.
• Amazon EC2 High Memory Instances can be launched only through AWS CLI or APIs. After launch, however, you can manage them by using the console, AWS CLI, or APIs.
Deployment steps using the AWS Management Console
1. Log in to the console with appropriate permissions and ensure that you have the right Region selected.
2. Choose Services, and then choose EC2 (under Compute).
3. Choose Launch Instance.
4. Search for the image that you want to use:
• Choose AWS Marketplace to search for RHEL for SAP and SLES for SAP images.
• Choose My AMIs to search for your BYOS or custom AMI ID.
When you find the image, choose Select, and then confirm to continue.
5. On the Choose an Instance Type page, select the instance type that you identified when planning the deployment (p. 67), and choose Configure Instance Details to proceed with instance
configuration.
6. On the Configure Instance Details page, do the following:
a. Enter the number of instances (typically 1). For scale-out workloads, specify the number of nodes.
b. Select the VPC ID and subnet for the network.
c. Turn off the Auto-assign Public IP option.
d. Select Add instance to placement group if needed (recommended for scale-out workloads; for details, see the AWS documentation).
e. Select any IAM role that you want to assign to the instance to access AWS services from the instance.
f. Select Stop for Shutdown behavior.
g. Enable termination protection if needed (strongly recommended).
h. Enable Amazon CloudWatch detailed monitoring (strongly recommended; for details, see the AWS documentation).
i. Select the Tenancy or proceed with the default (Shared). For dedicated hosts, select the Dedicated host option.
j. Choose Add Storage to proceed with storage configuration.
7. On the Add Storage page, choose Add New Volume to add volumes required for SAP HANA with the appropriate device, size, volume type, IOPS (for io1 only), and the Delete on Termination flag.
Ensure that you follow the storage guidance (p. 68) discussed earlier in this document. Add volumes for SAP HANA data, log, shared, backup, and binaries.
Figure 3 shows the storage configuration for x1.32xlarge instance type with io1 volume type for SAP HANA data and log.
Operating system and storage configuration
Figure 3: SAP HANA Storage Configuration with the console Note
If you are planning to deploy scale-out workloads, you don’t have to include Amazon EBS volumes for SAP HANA shared and backup volumes. You can use Amazon EFS with NFS to mount the HANA shared and backup volumes to your master and worker nodes.
Choose Add Tags to proceed with configuring tags
8. Choose Add Tag and add the key-value pair to track and manage your resources. We recommend adding Name as a minimum key to easily identify your resources.
Next, choose Configure Security Group.
9. Choose Select an existing security group and select a security group, if you have one, to attach to your instance. Otherwise, choose Create a new security group and configure the Type, Protocol, Port Range, and the Source IP address from where you want to allow traffic to your SAP HANA instance. Refer to Appendix C of the SAP HANA on AWS Quick Start guide for a list of ports that we recommend. You can change the port as needed to meet your security requirements.
10. Choose Review and Launch to review your selections, and then choose Launch.
11. Select an existing key pair if you have one. Otherwise, create a new key pair, acknowledge it, and choose Launch Instances.
12. Your instance should be launching now with the selected configuration. After the instance is launched, you can proceed with the operating system and storage configuration steps.
NoteAmazon EBS volumes are presented as NVME block devices on Nitro-based instances. You need to perform additional mapping at the operating system level when you configure these volumes.
Operating System and Storage Configuration
Use the instructions for your operating system:
• SLES for SAP 12.x (p. 72)
• RHEL for SAP 7.x (p. 74)
NoteFor scale-out workloads, repeat these steps for every node in the cluster.
Configure operating system – SLES
Configure Operating System – SLES for SAP 12.x
Important
In the following steps, you need to update several configuration files. We recommend taking a backup of the files before you modify them. This will help you to revert to the previous configuration if needed.
1. After your instance is up and running, connect to the instance by using Secure Shell (SSH) and the key pair that you used to launch the instance.
NoteDepending on your network and security settings, you might have to first connect by using SSH to a bastion host before accessing your SAP HANA instance, or you might have to add IP addresses or ports to the security group to allow SSH access.
2. Switch to root user.
Alternatively, you can use sudo to execute the following commands as ec2-user.
3. Set a hostname and fully qualified domain name (FQDN) for your instance by executing the hostnamectl command and updating the /etc/hostname file.
# hostnamectl set-hostname --static your_hostname # echo your_hostname.example.com > /etc/hostname
Open a new session to verify the hostname change.
4. Ensure that the DHCLIENT_SET_HOSTNAME parameter is set to no to prevent DHCP from changing the hostname during restart.
# grep DHCLIENT_SET_HOSTNAME /etc/sysconfig/network/dhcp
5. Set the preserve_hostname parameter to true to ensure your hostname is preserved during restart.
# sed -i '/preserve_hostname/ c\preserve_hostname: true' /etc/cloud/cloud.cfg 6. Add an entry to the /etc/hosts file with the new hostname and IP address.
ip_address hostname.example.com hostname
7. If you are using a BYOS SLES for SAP image, register your instance with SUSE. Ensure that your subscription is for SLES for SAP.
# SUSEConnect -r Your_Registration_Code # SUSEConnect -s
8. Ensure that the following packages are installed:
systemd, tuned, saptune, libgcc_s1, libstdc++6, cpupower, autofs, nvme-cli You can use the rpm command to check whether a package is installed.
# rpm -qi package_name
You can then use the zypper install command to install the missing packages.
Configure operating system – SLES
# zypper install package_name
NoteIf you are importing your own SLES image, additional packages might be required to ensure that your instance is optimally setup. For the latest information, refer to the Package List section in the SLES for SAP Application Configuration Guide for SAP HANA, which is attached to SAP OSS Note 1944799
9. Ensure that your instance is running on a kernel version that is recommended in SAP OSS Note 2205917. If needed, update your system to meet the minimum kernel version. You can check the version of the kernel and other packages by using the following command:
# rpm -qi kernel*
10. Start saptune daemon and use the following command to set it to automatically start when the system reboots.
# saptune daemon start
11. Check whether the force_latency parameter is set in the saptune configuration file.
# grep force_latency /usr/lib/tuned/saptune/tuned.conf
If the parameter is set, skip the next step and proceed with activating the HANA profile with saptune.
12. Update the saptune HANA profile according to SAP OSS Note 2205917, and then run the following commands to create a custom profile for SAP HANA. This step is not required if the force_latency parameter is already set.
# mkdir /etc/tuned/saptune
# cp /usr/lib/tuned/saptune/tuned.conf /etc/tuned/saptune/tuned.conf # sed -i "/\[cpu\]/ a force_latency=70" /etc/tuned/saptune/tuned.conf # sed -i "s/script.sh/\/usr\/lib\/tuned\/saptune\/script.sh/"
13. Switch the tuned profile to HANA and verify that all settings are configured appropriately.
# saptune solution apply HANA # saptune solution verify HANA
14. Configure and start the Network Time Protocol (NTP) service. You can adjust the NTP server pool based on your requirements; for example:
NoteRemove any existing invalid NTP server pools from /etc/ntp.conf before adding the following.
# echo "server 0.pool.ntp.org" >> /etc/ntp.conf # echo "server 1.pool.ntp.org" >> /etc/ntp.conf # echo "server 2.pool.ntp.org" >> /etc/ntp.conf # echo "server 3.pool.ntp.org" >> /etc/ntp.conf # systemctl enable ntpd.service
# systemctl start ntpd.service
Configure operating system – RHEL
TipInstead of connecting to the global NTP server pool, you can connect to your internal NTP server if needed. Or you can use Amazon Time Sync Service to keep your system time in sync.
15. Set the clocksource to tsc by updating the current_clocksource file and the GRUB2 boot loader.
# echo "tsc" > /sys/devices/system/clocksource/*/current_clocksource # cp /etc/default/grub /etc/default/grub.backup
# sed -i '/GRUB_CMDLINE_LINUX/ s|"| clocksource=tsc"|2' /etc/default/grub # grub2-mkconfig -o /boot/grub2/grub.cfg
16. Reboot your system for the changes to take effect.
17. Continue with storage configuration for SAP HANA (p. 76).
Configure Operating System – RHEL for SAP 7.x
Important
In the following steps, you need to update several configuration files. We recommend taking a backup of the files before you modify them. This will help you to revert to the previous configuration if needed.
1. After your instance is up and running, connect to the instance by using Secure Shell (SSH) and the key pair that you used to launch the instance.
NoteDepending on your network and security settings, you might have to first connect by using SSH to a bastion host before accessing your SAP HANA instance, or you might have to add IP addresses or ports to the security group to allow SSH access.
2. Switch to root user.
Alternatively, you can use sudo to execute the following commands as ec2-user.
3. Set a hostname for your instance by executing the hostnamectl command and update the /etc/
cloud/cloud.cfg file to ensure that your hostname is preserved during system reboots.
# hostnamectl set-hostname --static your_hostname
# echo "preserve_hostname: true" >> /etc/cloud/cloud.cfg
Open a new session to verify the hostname change.
4. Add an entry to the /etc/hosts file with the new hostname and IP address.
ip address hostname.example.com hostname
Ensure that the following packages are installed:
xfsprogs, gcc, compat-sap-c++-5, compat-sap-c++-6, tuned-profiles-sap-hana, glibc.x86_64, autofs, and nvme-cli
Note that your instance should have access to the SAP HANA channel to install libraries requires for SAP HANA installations.
You can use the rpm command to check whether a package is installed:
Configure operating system – RHEL
# rpm -qi package_name
You can then install any missing packages by using the yum –y install command.
# yum -y install package name
NoteDepending on your base RHEL image, additional packages might be required to ensure that your instance is optimally setup. (You can skip this step if you are using the RHEL for SAP with HA & US image.) For the latest information, refer to the RHEL configuration guide that is attached to SAP OSS Note 2009879. Review the packages in the Install Additional Required Packages section and the Appendix–Required Packages for SAP HANA on RHEL 7 section.
5. Ensure that your instance is running on a kernel version that is recommended in SAP OSS Note 2292690. If needed, update your system to meet the minimum kernel version. You can check the version of the kernel and other packages using the following command.
# rpm -qi kernel*
6. Start tuned daemon and use the following commands to set it to automatically start when the system reboots.
# systemctl start tuned
# systemctl enable tuned
7. Configure the tuned HANA profile to optimize your instance for SAP HANA workloads.
Check whether the force_latency parameter is already set in the /usr/lib/tuned/sap-hana/
tuned.conf file. If the parameter is set, execute the following commands to apply and activate the sap-hana profile.
# tuned-adm profile sap-hana # tuned-adm active
If the force_latency parameter is not set, execute the following steps to modify and activate the sap-hana profile.
# mkdir /etc/tuned/sap-hana
# cp /usr/lib/tuned/sap-hana/tuned.conf /etc/tuned/sap-hana/tuned.conf # sed -i '/force_latency/ c\force_latency=70' /etc/tuned/sap-hana/tuned.conf # tuned-adm profile sap-hana
# tuned-adm active
8. Disable Security-Enhanced Linux (SELinux) by running the following command. (Skip this step if you are using the RHEL for SAP with HA & US image.)
# sed -i 's/\(SELINUX=enforcing\|SELINUX=permissive\)/SELINUX=disabled/g' \/etc/
selinux/config
9. Disable Transparent Hugepages (THP) at boot time by adding the following to the line that starts with GRUB_CMDLINE_LINUX in the /etc/default/grub file. Execute the following commands to add the required parameter and to re-configure grub (Skip this step if you are using the RHEL for SAP with HA & US image.)
Configure storage
# sed -i '/GRUB_CMDLINE_LINUX/ s|"| transparent_hugepage=never"|2' /etc/default/grub # cat /etc/default/grub
# grub2-mkconfig -o /boot/grub2/grub.cfg
10. Add symbolic links by executing following commands. (Skip this step if you are using the RHEL for SAP with HA & US image.)
# ln -s /usr/lib64/libssl.so.10 /usr/lib64/libssl.so.1.0.1 # ln -s /usr/lib64/libcrypto.so.10 /usr/lib64/libcrypto.so.1.0.1
11. Configure and start the Network Time Protocol (NTP) service. You can adjust the NTP server pool based on your requirements. The following is just an example.
NoteRemove any existing invalid NTP server pools from /etc/ntp.conf before adding the following.
# echo "server 0.pool.ntp.org" >> /etc/ntp.conf # echo "server 1.pool.ntp.org" >> /etc/ntp.conf # echo "server 2.pool.ntp.org" >> /etc/ntp.conf # echo "server 3.pool.ntp.org" >> /etc/ntp.conf # systemctl enable ntpd.service
# systemctl start ntpd.service
# systemctl restart systemd-timedated.service
TipInstead of connecting to the global NTP server pool, you can connect to your internal NTP server if needed. Alternatively, you can also use Amazon Time Sync Service to keep your system time in sync.
12. Set clocksource to tsc by the updating the current_clocksource file and the GRUB2 boot loader.
# echo "tsc" > /sys/devices/system/clocksource/*/current_clocksource # cp /etc/default/grub /etc/default/grub.backup
# sed -i '/GRUB_CMDLINE_LINUX/ s|"| clocksource=tsc"|2' /etc/default/grub # grub2-mkconfig -o /boot/grub2/grub.cfg
13. Reboot your system for the changes to take effect.
14. After the reboot, log in as root and execute the tuned-adm command to verify that all SAP recommended settings are in place.
# tuned-adm verify
“tuned-adm verify” creates a log file under /var/log/tuned/tuned.log Review this log file and ensure that all checks have passed.
15. Continue with storage configuration.
Configure Storage for SAP HANA
1. Amazon EBS volumes should have been created and attached when you launched the Amazon EC2 instance. Confirm that all the required volumes are attached to the instance by running the lsblk command, which returns a list of the storage devices that are attached to the instance.
Configure storage
NoteOn Nitro-based instances, Amazon EBS volumes are presented as NVME block devices. You need to perform additional mapping when configuring these volumes.
Depending on the instance and storage volume types, your block device mapping will look similar to the following examples.
Example from a non-Nitro instance
# lsblk
Example from a Nitro instance
## lsblk
2. Initialize the volumes of SAP HANA data, log, and backup to use with Linux Logical Volume Manager (LVM).
Note
Ensure you are choosing the devices that are associated with the SAP HANA data, log, and backup volumes. The device names might be different in your environment.
Example from a non-Nitro instance
# pvcreate /dev/xvdb /dev/xvdc /dev/xvdd /dev/xvdf /dev/xvdh Physical volume "/dev/xvdb" successfully created.
Physical volume "/dev/xvdc" successfully created.
Physical volume "/dev/xvdd" successfully created.
Physical volume "/dev/xvdf" successfully created.
Physical volume "/dev/xvdh" successfully created.
#
Example from a Nitro instance
# pvcreate /dev/nvme2n1 /dev/nvme3n1 /dev/nvme4n1 /dev/nvme5n1 /dev/nvme1n1 Physical volume "/dev/nvme2n1" successfully created.
Physical volume "/dev/nvme3n1" successfully created.
Configure storage
Physical volume "/dev/nvme4n1" successfully created.
Physical volume "/dev/nvme5n1" successfully created.
Physical volume "/dev/nvme1n1" successfully created.
#
3. Create volume groups for SAP HANA data, log, and backup. Ensure that device IDs are associated correctly with the appropriate volume group.
Example from a non-Nitro instance
# vgcreate vghanadata /dev/xvdb /dev/xvdc /dev/xvdd Volume group "vghanadata" successfully created # vgcreate vghanalog /dev/xvdh
Volume group "vghanalog" successfully created # vgcreate vghanaback /dev/xvdf
Volume group "vghanaback" successfully created #
Example from a Nitro instance
# vgcreate vghanadata /dev/nvme2n1 /dev/nvme3n1 /dev/nvme4n1 Volume group "vghanadata" successfully created
# vgcreate vghanalog /dev/nvme5n1
Volume group "vghanalog" successfully created # vgcreate vghanaback /dev/nvme1n1
Volume group "vghanaback" successfully created #
4. Create a logical volume for SAP HANA data.
In the following command, -i 3 represents stripes based on the number of volumes that are used
In the following command, -i 3 represents stripes based on the number of volumes that are used