Updated on 2022-03-04 GMT+08:00

Formatting Disks

Scenarios

The data volumes of SAP HANA and SAP Business One nodes can be used only after they are formatted and attached to required directories.

Procedure

  1. Log in to an SAP HANA and SAP Business One node.

    Use PuTTY to log in to the NAT server with an EIP bound. Ensure that user root and the key file (.ppk file) are used for authentication. Then, use SSH to switch to the SAP HANA and SAP Business One nodes.

  2. Format disks.

    1. Run the following command to query the disks to be formatted:

      fdisk -l

    2. Determine the disks of the /usr/sap, data, log, and shared volumes according to the disk capacity.
    3. Download the configuration script.

      Taking CN-Hong Kong as an example, you can download the readme.txt file from https://obs-sap-ap-southeast-1.obs.ap-southeast-1myhuaweicloud.com/readme.txt on the local PC. Then, obtain the paths where the software and installation configuration scripts are stored.

      The download address of the configuration script varies depending on the region. Run the following commands based on the region:

      • CN-Hong Kong: wget https://obs-sap-ap-southeast-1.obs.ap-southeast-1.myhuaweicloud.com/ha_auto_script/ha_auto_script.zip -P ~
      • AP-Bangkok: wget https://obs-sap-ap-southeast-2.obs.ap-southeast-2.myhuaweicloud.com/ha_auto_script/ha_auto_script.zip -P ~
    4. Run the following commands to switch to the folder and decompress the software package:

      cd ~

      unzip scale_out_script.zip

    5. Run the following command to modify the soh.cfg file:

      vi ~/scale_out_script/soh.cfg

    6. Enter i to enter editing mode and write the disk information into the file.

      The parameters are as follows:

      • usrsap: You do not need to configure this parameter.
      • shared: specifies the disk of the shared volume.
      • backup: specifies the disk of the backup volume. If the backup volume if provided by SFS, its path is the shared path of SFS.
      • uselvm: Set this parameter to False.
      • log: specifies the disk of the log volume.
      • data: specifies the disk of the data volume.
      • disks: You do not need to configure this parameter.
      • dataSize: You do not need to configure this parameter.
      • logSize: You do not need to configure this parameter.

      An example is provided as follows:

      usrsap=
      shared=/dev/xvdb
      backup=/dev/xvdc
      uselvm=False
      #Set log and data if not using lvm
      log=/dev/sdd
      data=/dev/sde
      #Set disks, dataSize and logSize if using lvm
      disks=
      dataSize=
      logSize=
    7. After you complete editing, press Esc, enter :x, and press Enter to exit the soh.cfg file.
    8. Run the following commands to switch to the directory where the soh.cfg file is stored and convert the file format:

      cd ~/scale_out_script

      dos2unix installSoh.sh soh.cfg

    9. Assign operation permissions to the soh.cfg file and run installSoh.sh to format disks.

      chmod 777 installSoh.sh soh.cfg

      sh installSoh.sh