TMCnet Feature
March 24, 2021

Deploying SAP HANA on Azure Spot Instances

SAP (News - Alert) HANA is a high performance database that powers many mission critical applications. It is increasingly common to migrate SAP HANA to the cloud, but the costs can be prohibitive, because HANA needs to run on high-capacity compute instances, or in some cases on dedicated Large Instances running on specially designed SAP-compliant hardware.

Infrastructure as a service (IaaS) providers like Microsoft Azure have created specially-configured hardware inside their data centers to support SAP applications.

An attractive option is to run SAP HANA on spot instances - these are compute instances that leverage spare capacity on the cloud provider, and grant discounts of up to 90%. In this article I’ll describe how to run SAP HANA on spot instances in the Microsoft (News - Alert) (News - Alert) Azure cloud, known as “spot VMs”.

What is SAP HANA?

SAP HANA is an in-memory database and application development platform that processes large amounts of data with very high performance. SAP HANA allows data analysts to query large amounts of data in real time, eliminating the need to pre-load data.

HANA's columnar data store complies with the ACID requirements and fully supports industry standards such as SQL and Multidimensional Expressions (MDX).

SAP HANA is not just a database—it also includes built-in analytics capabilities. HANA provides a set of predictive, spatial and text analytics libraries, as well as programming components that let you create and run custom applications on HANA.

What are Azure Spot Virtual Machines?

Microsoft Azure is a leading public cloud provider. With Azure Spot virtual machines (VMs), you can take advantage of Azure’s unused capacity and save on VM costs. Spot instance discounts go up to 90% of the pay-as-you-go fee, depending on the type of the VM and the available capacity. Available capacity varies by region, VM type, and time of day.

Whenever Azure needs to reclaim capacity, the Azure infrastructure shuts down the Azure Spot virtual machine with short notice. Due to their low reliability, Spot VMs are primarily used for workloads like batch jobs, development/testing environments, and high performance computing (HPC), which are distributed or fault tolerant by nature.

You can use Azure Spot VM for non-essential workloads or workloads that do not need to run 24/7. Common use cases include batch processing, scalable stateless applications, and short-term jobs that can be run again after a spot instance has been terminated.

Some important things to consider when using Azure Spot VM:

  • There are no SLAs or availability guarantees for spot VMs, so you may not be able to access resources, especially during periods of peak load
  • Virtual machines will be deleted when there is no capacity or the market price exceeds the maximum bidding price
  • B series VMs and promotional versions are not supported (for example, Dv2, NV and H)
  • You cannot convert a Spot VM to a regular VM or vice versa—you need to delete the virtual machine and attach the disk to the new virtual machine
  • Deleted and reallocated VMs will not be restarted once capacity or price is restored to acceptable limits, you’ll need to handle this yourself
  • You cannot create a spot VM unless capacity is available and bidding price is above market price

Considerations Before Deploying SAP HANA on Azure VM

There are different considerations when executing SAP HANA on a cloud VM, compared to on-premises deployment:

  • Deployment scenarios—before deploying SAP HANA, make sure it supports the scenarios required for Azure VMs. If the scenario does not appear on the list, it is probably untested and therefore not supported.
  • Memory requirements—locate an appropriate Azure VM, based on the memory you require for the SAP HANA deployment. The SAP HANA hardware directory is a good resource; it details which Azure VM types are HANA-certified.
  • Operating system versions—Azure VMs differ, among others, in their minimum OS version requirements for Linux SUS or Linux Red Hat (News - Alert). Consult SAP HANA hardware directory to see which specific operating system versions are supported.
  • SAP product availability—consult the SAP product availability matrix and make sure SAP HANA database is certified for the VM you want to use.

For more information on how to deploy SAP HANA on Azure VMs, read the official Microsoft documentation.

Deploying SAP HANA on Azure Spot Instances

Here is a quick guide to deploying a SAP HANA database on Azure spot instances.

Connect Into SAP Virtual Machines on Azure

Before you deploy a SAP HANA database on a VM, you need to prepare a way to connect to the VM from your on-premises data center.

You can connect through a public endpoint on a Jump VM, or connect directly via the Internet to the VM running SAP HANA, although this can raise security concerns.

A more secure approach, appropriate for production scenarios, is to connect via VPN or a dedicated Azure ExpressRoute connection.

Choose Azure VM Types

Once you have selected an Azure VM type that is certified for use by HANA, there are several ways to deploy the VM. You can use the Azure portal, Azure PowerShell commands, or the Azure CLI. Another option is to use SAP Cloud Platform to deploy a managed SAP HANA instance in an Azure VM.

When deploying the VM, you can choose to use an Azure spot instance, as shown in the screenshot below. Select Yes under Azure Spot instance, and you can choose the following spot VM options:

  • Eviction type specifies whether you are prepared to pay a higher price than your original bidding price for the spot instance (Capacity only), or if you want the VM to be terminated if the price exceeds your bid (Price or capacity).
  • Eviction policy specifies what should happen when the spot instance is terminated—if you want to stop the instance, with the ability to restart it later, or delete it completely.

Select View pricing history to compare spot VM pricing with other Azure regions.

Dealing with Interruptions

An Azure spot instance can be interrupted with short notice. To plan for this occurrence, you may want to run HANA in scale out mode. This is illustrated below—the architecture is based on Azure NetApp Files (ANF), and uses high performance ANF file shares to share data between multiple HANA instances.

You can run some of the worker nodes on spot instances, and then if they are interrupted, the other workers will take over the load. Ensure that the master node is running on a regular instance so it is not interrupted.

For more details on configuring a scale out HANA architecture on Azure, see the Azure documentation.


In this article I showed how to run SAP HANA on spot VMs in Azure, to dramatically cut the costs of your cloud migration. While this is not easy to set up, it is well worth the effort, because it can allow you to save up to 90% on at least some of the VMs used to run SAP HANA in the Azure cloud. I hope this will be of help are you plan your SAP HANA architecture in Azure.

» More TMCnet Feature Articles


» More TMCnet Feature Articles