Today I will guide you through the deployment of a HANA Express database on ACI – Azure Container Instances. This article is based on the article I have written about the deployment of SAP HANA Express database on AKS.
I have created three PowerShell scripts leveraging the Azure CLI, an Azure Resource Manager template or a YAML file to deploy the HANA express database on ACI. The ACI container instance will use 4x CPUs and 14 GB memory, the current limits for an ACI container instance. The Azure CLI and ARM template variants are doing a direct deployment against Azure. The YAML variant needs to be deployed over AKS with the ACI connector installed. So, we got everything covered and now what do you need to deploy the HANA Express database on ACI?
- Access to an Azure subscription
- Azure Cloud Shell – Bash
- Docker Registry credentials
- deploy_HXE_ACI.ps1, deploy_HXE_ACI_ARM.ps1 or deploy_HXE_ACI_AKS.ps1 file from the following GitHub repo.
Let us start with the first step logging in to the Azure Cloud Shell (https://shell.azure.com). Type in pwsh -noprofile to start a PowerShell Core session. Next step is to download the deploy_HXE_ACI.ps1 to your Azure Cloud Shell session.
Then we kick off the deployment with the command ./deploy_HXE_ACI.ps1.
You will be asked in which region you would like to deploy the ACI container instance. Currently, you can only choose between West US, East US, West Europe and North Europe, because these regions are supporting container instances with 4x CPUs and 14GB memory. The PowerShell script will then create a resource group called “aci-hxe-rg” in the selected region and deploys the container instance called “aci-hxe-instance” into it. Before the container instance deployment, the script creates an Azure storage account with a file share, the password.json for the HANA Express database and uploads the password.json into the Azure file share.
Throughout the setup you will be asked to specify the master password for the HANA Express database installation and your Docker Registry credentials to pull the SAP HANA Express Edition image. The master password for the HANA Express database should have at least 8 characters with one uppercase letter, one lowercase letter, and one number.
The PowerShell script is designed to create the necessary JSON file for the HANA Express database master password and uploads the masterPassword.json file into the created Azure file share.
After the PowerShell script execution switch to the Azure portal to get mode details about the current deployment status. The image pull will take some time.
After the successful image pull have a look at the logs in the Azure portal or with the following command in the Azure Cloud Shell.
az container logs --name aci-hxe-instance --resource-group aci-hxe-rg --follow
Continue showing the logs until you get a Startup finished! as the last output of the logs.
Afterwards we can execute the command az container exec –name aci-hxe-instance –resource-group aci-hxe-rg –exec-command bash to get access to the bash of the container instance. Followed by the command hdbsql -i 90 -d HXE -u SYSTEM -p YOURPASSWORD, we can log in to the SAP HANA Database interactive terminal.
If you want to access the SAP HANA Express database remotely, you must run the following script.
Run az container exec –name aci-hxe-instance –resource-group aci-hxe-rg –exec-command bash from the Azure Cloud Shell to get access to the bash of the container instance. Download the script with wget https://raw.githubusercontent.com/neumanndaniel/kubernetes/master/hxe-aci/configureAciHxeExternalAccess.sh and run it with sh ./configureAciHxeExternalAccess.sh to establish the necessary changes.
Before you exit the bash session, run hostname and copy the output. The final step is to edit the hosts file under C:\Windows\system32\drivers\etc on your local workstation. Add the following entry to the hosts file according to your hostname output and the ACI assigned public IP address.
You get the IP address running the command az container show –name aci-hxe-instance –resource-group aci-hxe-rg –query ipAddress.ip in the Azure Cloud Shell.
Now, you can connect to your HANA Express database on ACI with the SAP HANA DB client from your local workstation.
For the deployment based on an Azure Resource Manager template for the ACI instance start with the login in to the Azure Cloud Shell (https://shell.azure.com). Type in pwsh -noprofile to start a PowerShell Core session. Next step is to download the deploy_HXE_ACI_ARM.ps1 to your Azure Cloud Shell session.
Then kick off the deployment with the command ./deploy_HXE_ACI_ARM.ps1.
The steps are the same and the deployment is nearly identical instead of that we are mounting an additional emptyDir volume under /hana/mounts as hxe-data and the file share mount is set to read-only in the ARM template approach. Otherwise, as with the Azure CLI approach, the HXE setup deletes the masterPassword.json file.
For the deployment over an Azure Kubernetes Service (AKS) cluster for the ACI instance start with the login in to the Azure Cloud Shell (https://shell.azure.com). Type in pwsh -noprofile to start a PowerShell Core session. Assuming you already have an AKS cluster, run the following commands to prepare the ACI connector installation and get the connector installed.
helm init or helm init --upgrade az aks install-connector --resource-group aks-hxe-rg --name aks-hxe-cluster --connector-name hxe
Next step is to download the deploy_HXE_ACI_AKS.ps1 to your Azure Cloud Shell session.
Then kick off the deployment with the command ./deploy_HXE_ACI_AKS.ps1.
The steps are different from the two other deployment variants. First the masterPassword.json file is created as a Kubernetes secret, second the Docker registry login information is also created as a Kubernetes secret and finally the YAML file creates the ACI instance as a Kubernetes pod over the ACI connector on Azure.
It is necessary that you do not change the connector name, if you do so make sure you change the nodeName in the YAML file.