Automated SAP Deployments in Azure Cloud
This repository contains a set of highly customizable templates that can be used to automatically deploy complex SAP landscapes in the Azure Cloud. The templates are split into:
- Terraform modules which deploy the infrastructure components (such as VMs, network, storage) in Azure and then call the:
- Ansible playbooks which run different roles to install and configure SAP HANA and required applications on the already deployed infrastructure.
Table of contents
- Getting Started
- Supported Applications
- Required SAP Downloads
- License & Copyright
- single-node HANA instance
- single-node HANA instance, two-tier HSR (primary/secondary)
- Pacemaker high-availability cluster, fully configured with SBD and SAP/Azure resource agents
A typical deployment lifecycle will require the following steps:
- Preparing your Azure Cloud Shell (this has to be done only once)
- Getting the SAP packages
- Adjusting the templates
- Running the deployment
- Verifying the deployment
- Deleting the deployment (optional)
In this simple example, we'll deploy a simple single-node SAP HANA instance (specifically, HANA DB 1.0 SPS12 PL17).
Preparing your Azure Cloud Shell
From your Azure Portal, open your Cloud Shell (
>_button in top bar).
Clone this repository:
git clone https://github.com/Azure/sap-hana.git
Getting the SAP packages
Navigate to the SAP Software Download Center (SWDC).
Search for the following packages required for the single-node HANA scenario and download them to your local machine:
|SWDC filename||Package name||OS||Version||Template parameter|
||HANA DB Server||Linux x86_64||122.17 (SPS12) for HANA DB 1.00||
(Note: See the section on Required SAP Downloads for a full list of SAP packages, if you want to install additional applications on top of HANA, such as XSA.)
In the Azure Portal, create a Storage Account. (Note: Please make sure to choose a region close to you to improve transfer speed; the SAP bits are quite large.)
In the storage account you just created, create a new Blob Storage.
In the new Blob Storage that you just created, create a new Container and name it
Upload each of the SAP packages you downloaded in step 2 and take note of the download URL.
Adjusting the templates
Change into the directory for the HANA single-node scenario:
Use a text editor to create a Terraform variables file
terraform.tfvars, adapting the download URLs accordingly:
# Azure region to deploy resource in; please choose the same region as your storage from step 3 (example: "westus2") az_region = "westus2" # Name of resource group to deploy (example: "demo1") az_resource_group = "demo1" # Unique domain name for easy VM access (example: "hana-on-azure1") az_domain_name = "hana-on-azure1" # Set your Azure service principal id. azure_service_principal_id = "XXX" # Set your Azure service principal password azure_service_principal_pw = "XXX" # Size of the VM to be deployed (example: "Standard_E8s_v3") # For HANA platform edition, a minimum of 32 GB of RAM is recommended vm_size = "Standard_E8s_v3" # Path to the public SSH key to be used for authentication (e.g. "~/.ssh/id_rsa.pub") sshkey_path_public = "~/.ssh/id_rsa.pub" # Path to the corresponding private SSH key (e.g. "~/.ssh/id_rsa") sshkey_path_private = "~/.ssh/id_rsa" # OS user with sudo privileges to be deployed on VM (e.g. "demo") vm_user = "demo" # SAP system ID (SID) to be used for HANA installation (example: "HN1") sap_sid = "HN1" # SAP instance number to be used for HANA installation (example: "01") sap_instancenum = "01" # URL to download SAPCAR binary from (see step 6) url_sap_sapcar = "https://XXX" # URL to download HANA DB server package from (see step 6) url_sap_hdbserver = "https://XXX" # Password for the OS sapadm user pw_os_sapadm = "XXX" # Password for the OS <sid>adm user pw_os_sidadm = "XXX" # Password for the DB SYSTEM user # (In MDC installations, this will be for SYSTEMDB tenant only) pw_db_system = "XXX" # Password for the DB XSA_ADMIN user pwd_db_xsaadmin = "XXX" # Password for the DB SYSTEM user for the tenant DB (MDC installations only) pwd_db_tenant = "XXX" # Password for the DB SHINE_USER user (SHINE demo content only) pwd_db_shine = "XXX" # e-mail address used for the DB SHINE_USER user (SHINE demo content only) email_shine = "email@example.com" # Set this flag to true when installing HANA 2.0 (or false for HANA 1.0) useHana2 = false # Set this flag to true when installing the XSA application server install_xsa = false # Set this flag to true when installing SHINE demo content (requires XSA) install_shine = false # Set this flag to true when installing Cockpit (requires XSA) install_cockpit = false
Running the deployment
Log into your Azure subscription and configure Ansible and Terraform:
export AZURE_SUBSCRIPTION_ID='XXX' export AZURE_CLIENT_ID='XXX' export AZURE_SECRET='XXX' export AZURE_TENANT='XXX'
export ARM_SUBSCRIPTION_ID='XXX' export ARM_TENANT_ID='XXX' export ARM_CLIENT_ID='XXX' export ARM_CLIENT_SECRET='XXX'
(Note: Please note that you will need to create a service principal. If you don't have a service principal, please follow the instructions to create one, How to create a service principal)
Trigger the deployment:
When prompted if you want to deploy the resources, answer
yes. The deployment will start and take approx. 30 minutes (actual times may vary depending on region and other parameters).
Once the deployment has finished, take note of the last three lines on your console; they should look like this:
Apply complete! Resources: 19 added, 0 changed, 0 destroyed. Outputs: ip = Connect using firstname.lastname@example.org
Verifying the deployment
Connect to your newly deployed HANA instance via SSH:
Switch to the adm user:
sudo su - su - xs1adm
hdbsqlto execute a simple query:
hdbsql -i 01 -u SYSTEM -p Initial1 "SELECT CURRENT_TIME FROM DUMMY"
Deleting the deployment
If you don't need the deployment anymore, you can remove it just as easily. In your Azure Cloud Shell, run the following command to remove all deployed resources:
Currently, the templates are capable of deploying the following applications on top of the HANA base install:
Required SAP Downloads
Depending on your application requirements, you may need to download additional SAP packages and adjust the templates accordingly:
|Name||OS||Version||SWDC filename||Scenario||Template parameter|
||Windows bastion host||
|SAP Host Agent||Linux x86_64||7.21 SP36||
|HANA DB Server||Linux x86_64||122.17 (SPS12) for HANA DB 1.00||
||HANA 1.0 landscapes||
|HANA DB Server||Linux x86_64||2.00.32 for HANA DB 2.00||
||HANA 2.0 landscapes||
|HANA Studio||Windows 64-bit||122.20 (SPS12) for HANA DB 1.00||
||Windows bastion host||
|XS Advanced Runtime||SP00 Patch87||
|DI Core||SP12 Patch9||
|Portal Services||SP02 Patch3||
|XS Services||SP06 Patch9||
|HANA Cockpit 2.0||SP07 Patch11||
||XSA + Cockpit||
|SHINE Content (XSA)||SP05 Patch3||
||XSA + SHINE||
License & Copyright
Copyright © 2018 Microsoft Azure.
Licensed under the MIT License.
We look forward to your feedback and welcome any contributions!