This guide describes how to deploy and configure Google Cloud NetApp Volumes to provide storage for an SAP HANA workload that runs on Google Cloud.

<br />

The procedure described in this guide deploys NetApp Volumes
to replace the block storage that is provisioned
for the `/hana/data` and `/hana/log` directories of an SAP HANA scale-up
workload. If you're running a scale-out workload, then repeat this procedure
for all the nodes in your scale-out workload.

## Before you begin

Before you deploy NetApp Volumes for SAP HANA, ensure that you
complete the following prerequisites:

- Review the list of Compute Engine machine types and the type of SAP
  HANA workloads with which SAP has certified the use of
  NetApp Volumes.

  To view this information, see the table in
  [Certified Compute Engine machine types for SAP HANA](https://docs.cloud.google.com/sap/docs/sap-hana-planning-guide.md.txt#certified-vms).
- Deploy an SAP HANA workload on Linux on Google Cloud on SAP-certified
  Compute Engine machine types, with Hyperdisk or
  Persistent Disk volumes providing block storage for the `/hana/data` and
  `/hana/log` directories.

  To deploy this workload, you can use the Terraform configurations provided by
  Google Cloud. For more information, see the deployment guide for your
  scenario in
  [Supported SAP solutions](https://docs.cloud.google.com/sap/docs/tf-for-sap.md.txt#supported_sap_solutions).
- Review the guidance provided by Google Cloud for using
  NetApp Volumes with SAP HANA, which is described in the
  [Google Cloud NetApp Volumes](https://docs.cloud.google.com/sap/docs/sap-hana-planning-guide.md.txt#netapp_cvs)
  section of the SAP HANA planning guide.

## Deploy NetApp Volumes

To deploy volumes of NetApp Volumes and use them to provide
storage for your SAP HANA workload, complete the following steps:

1. Create volumes of NetApp Volumes to host the `/hana/data` and
   `/hana/log` directories.

   For information about how to create a NetApp Volumes volume, see
   [Create a volume](https://docs.cloud.google.com/netapp/volumes/docs/configure-and-use/volumes/create-volume.md.txt).
2. Mount the volumes of NetApp Volumes to a temporary mount point
   by using the `mount` command with the following settings:

   ```bash
   mount -t nfs -o rw,bg,hard,timeo=600,vers=NFS_VERSION,rsize=262144,wsize=262144,tcp,nconnect=16,noatime,nodiratime,sec=sys server:path mountpoint
   ```
   - Replace `NFS_VERSION` with the NFS version that you want to use. We recommend that you use NFSv4.1 by setting the value `4.1`. You can also use NFSv3 by setting the value `3`.
   - For database persistence, we recommend that you set `rsize=262144` and `wsize=262144`. These settings help optimize random I/O latency and prevent head-of-line blocking. For directories such as `/hana/shared` and `/sapmnt`, the standard mount value defaults are sufficient.
3. On the compute instance that runs your SAP HANA workload, stop the SAP HANA
   database and any related services that are using the Hyperdisk
   or Persistent Disk volumes that host the `/hana/data` and `/hana/log`
   directories.

4. Copy the contents of the Hyperdisk or Persistent Disk
   volumes to the volumes of NetApp Volumes that you created.

5. Detach the Hyperdisk or Persistent Disk volumes from the
   compute instance.

   For information about how to detach these disks, follow the instructions described in
   [Detach a non-boot disk from an instance](https://docs.cloud.google.com/compute/docs/disks/detach-reattach-boot-disk.md.txt#detach_non_boot_disk).
6. Remount the volumes of NetApp Volumes to the permanent mount
   points by updating the `/etc/fstab` with the following settings:

   ```bash
   server:path   /mountpoint   nfs   vers=NFS_VERSION,hard,tcp,timeo=600,rsize=262144,wsize=262144,nconnect=16,noatime,nodiratime,sec=sys,_netdev   0 0
   ```

   Replace `NFS_VERSION` with the NFS version that you
   want to use. We recommend that you use `4.1`. You can also use
   `3`.

   For information about how to update the `/etc/fstab` file, see the
   `nfs` page in the Linux file formats manual.
7. To optimize the performance of your SAP HANA workload, we recommend that you
   update the `fileio` category in the SAP HANA `global.ini` file with the
   following parameters and values:

   | Parameter | Value |
   |---|---|
   | `async_read_submit` | `on` |
   | `async_write_submit_active` | `on` |
   | `async_write_submit_blocks` | `all` |
   | `max_parallel_io_requests` | `128` |
   | `max_parallel_io_requests[data]` | `128` |
   | `max_parallel_io_requests[log]` | `128` |
   | `num_completion_queues` | `4` |
   | `num_completion_queues[data]` | `4` |
   | `num_completion_queues[log]` | `4` |
   | `num_submit_queues` | `8` |
   | `num_submit_queues[data]` | `8` |
   | `num_submit_queues[log]` | `8` |

8. Save your changes.

9. Restart the SAP HANA database.

10. After confirming that everything works as expected, delete the detached
    Hyperdisk or Persistent Disk volumes. This helps you avoid
    incurring charges for them.

## What's next

- For information about how to administer and monitor the compute instances that run your SAP HANA workload, see the [SAP HANA operations guide](https://docs.cloud.google.com/sap/docs/sap-hana-operations-guide.md.txt).