SAP HANA Express Edition – Deploy HANA Express database on ACI – Azure Container Instances

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.

-> https://www.danielstechblog.io/sap-hana-express-edition-deploy-hana-express-database-aks-managed-kubernetes-azure/

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?

  1. Access to an Azure subscription
  2. Azure Cloud Shell – Bash
  3. Docker Registry credentials
  4. deploy_HXE_ACI.ps1, deploy_HXE_ACI_ARM.ps1 or deploy_HXE_ACI_AKS.ps1 file from the following GitHub repo.

-> https://github.com/neumanndaniel/kubernetes/tree/master/hxe-aci

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.

wget https://raw.githubusercontent.com/neumanndaniel/kubernetes/master/hxe-aci/deploy_HXE_ACI.ps1

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.

acihxe01acihxe02

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.

acihxe03

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.

acihxe04acihxe05

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.

acihxe06acihxe07

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.

acihxe08acihxe09

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.

acihxe10

If you want to access the SAP HANA Express database remotely, you must run the following script.

-> https://github.com/neumanndaniel/kubernetes/blob/master/hxe-aci/configureAciHxeExternalAccess.sh

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.

acihxe11

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.

51.144.91.80 caas-7916fab2eca647ab94190b71f44177ca-1393385064-wrjww

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.

acihxe14

ARM Template

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.

wget https://raw.githubusercontent.com/neumanndaniel/kubernetes/master/hxe-aci/deploy_HXE_ACI_ARM.ps1

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.

-> https://docs.microsoft.com/en-us/azure/container-instances/container-instances-volume-emptydir

acihxe15acihxe16

YAML Template

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.

wget https://raw.githubusercontent.com/neumanndaniel/kubernetes/master/hxe-aci/deploy_HXE_ACI_AKS.ps1

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.

acihxe17acihxe18acihxe19

Facebooktwittergoogle_pluslinkedinmail