Configure Amazon EBS storage for SAP HANA - SAP HANA on AWS

Configure Amazon EBS storage for SAP HANA

This topic explains how to configure scale-up and scale-out workloads with Amazon EBS.

In SAP HANA benchmark testing, the best performance is achieved using a 256 KB stripe size for data volumes and a 64 KB stripe size for log volumes.

To configure workloads with Amazon EBS
  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.

    Note

    On 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 NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT xvda 202:0 0 50G 0 disk ├─xvda1 202:1 0 1M 0 part └─xvda2 202:2 0 50G 0 part / xvdb 202:16 0 800G 0 disk xvdc 202:32 0 800G 0 disk xvdd 202:48 0 800G 0 disk xvde 202:64 0 1T 0 disk xvdf 202:80 0 4T 0 disk xvdh 202:112 0 525G 0 disk xvdr 202:4352 0 50G 0 disk #

    Example from a Nitro instance

    ## lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT nvme0n1 259:0 0 50G 0 disk └─nvme0n1p1 259:1 0 50G 0 part / nvme1n1 259:2 0 4T 0 disk nvme2n1 259:3 0 800G 0 disk nvme3n1 259:4 0 800G 0 disk nvme4n1 259:5 0 800G 0 disk nvme5n1 259:6 0 525G 0 disk nvme6n1 259:7 0 1T 0 disk nvme7n1 259:8 0 50G 0 disk #
  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. 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 for a HANA data volume group. Adjust the number depending on the number of volumes that are allocated to the HANA data volume group, based on instance and storage type.

    # lvcreate -n lvhanadata -i 3 -I 256 -L 2350G vghanadata Rounding size 2.29 TiB (601600 extents) up to stripe boundary size 2.29 TiB (601602 extents). Logical volume "lvhanadata" created. #
  5. Create a logical volume for SAP HANA log.

    In the following command, -i 1 represents stripes based on the number of volumes that are used for a HANA log volume group. Adjust the number depending on the number of volumes that are allocated to the HANA log volume group, based on instance and storage type.

    # lvcreate -n lvhanalog -i 1 -I 64 -L 512G vghanalog Ignoring stripesize argument with single stripe. Logical volume "lvhanalog" created. #
  6. Create a logical volume for SAP HANA backup.

    # lvcreate -n lvhanaback -i 1 -I 256 -L 4095G vghanaback Ignoring stripesize argument with single stripe. Logical volume "lvhanaback" created. #
  7. Construct XFS file systems with the newly created logical volumes for HANA data, log, and backup by using the following commands:

    # mkfs.xfs -f /dev/mapper/vghanadata-lvhanadata # mkfs.xfs -f /dev/mapper/vghanalog-lvhanalog # mkfs.xfs -f /dev/mapper/vghanaback-lvhanaback
  8. Construct XFS file systems for HANA shared and HANA binaries.

    # mkfs.xfs -f /dev/xvde -L HANA_SHARE # mkfs.xfs -f /dev/xvdr -L USR_SAP
    Note

    On Nitro-based instance types, device names can change during instance restarts. To prevent file system mount issues, it is important to create labels for devices that aren’t part of logical volumes so that the devices can be mounted by using labels instead of the actual device names.

  9. Create directories for HANA data, log, backup, shared, and binaries.

    # mkdir /hana /hana/data /hana/log /hana/shared /backup /usr/sap
  10. Use the echo command to add entries to the /etc/fstab file with the following mount options to automatically mount these file systems during restart.

    # echo "/dev/mapper/vghanadata-lvhanadata /hana/data xfs noatime,nodiratime,logbsize=256k 0 0" >> /etc/fstab # echo "/dev/mapper/vghanalog-lvhanalog /hana/log xfs noatime,nodiratime,logbsize=256k 0 0" >> /etc/fstab # echo "/dev/mapper/vghanaback-lvhanaback /backup xfs noatime,nodiratime,logbsize=256k 0 0" >> /etc/fstab # echo "/dev/disk/by-label/HANA_SHARE /hana/shared xfs noatime,nodiratime,logbsize=256k 0 0" >> /etc/fstab # echo "/dev/disk/by-label/USR_SAP /usr/sap xfs noatime,nodiratime,logbsize=256k 0 0" >> /etc/fstab
  11. Mount the file systems.

    # mount -a
  12. Check to make sure that all file systems are mounted appropriately; for example, here is the output from an x1.32xlarge system:

    # df -h Filesystem Size Used Avail Use% Mounted on /dev/xvda2 50G 1.8G 49G 4% / devtmpfs 961G 0 961G 0% /dev tmpfs 960G 0 960G 0% /dev/shm tmpfs 960G 17M 960G 1% /run tmpfs 960G 0 960G 0% /sys/fs/cgroup tmpfs 192G 0 192G 0% /run/user/1000 /dev/mapper/vghanadata-lvhanadata 2.3T 34M 2.3T 1% /hana/data /dev/mapper/vghanalog-lvhanalog 512G 33M 512G 1% /hana/log /dev/mapper/vghanaback-lvhanaback 4.0T 33M 4.0T 1% /backup /dev/xvde 1.0T 33M 1.0T 1% /hana/shared /dev/xvdr 50G 33M 50G 1% /usr/sap #
  13. At this time, we recommend rebooting the system and confirming that all the file systems mount automatically after the restart.

  14. If you are deploying a scale-out workload, follow the steps specified in Configure NFS for scale-out workloads to set up SAP HANA shared and backup NFS file systems with Amazon EFS.

    If you are not deploying a scale-out workload, you can now proceed with your SAP HANA software installation.