Your SAP on Azure – Part 1 – ARM Templates
I remember my first experience of Microsoft Azure. It was around 2011, so not too long after the public release. It already offered a lot of features and since then offerings in cloud computing have been growing rapidly. I believe I can say with confidence that today Microsoft provides around 600 cloud services and the revenue from those surpass sales of traditional licenses.
Before we get into details I would like to summarize the Cloud Services models with one graphic:
I decided that instead of going through the theory and guidance of how to create your first VM, (this has already been well documented) I would focus on how to use the Azure features that are useful from an SAP system administrator perspective. Today we will have a closer look at some aspects of IaaS model, but in future posts, I will jump into PaaS as well (and not only from Microsoft).
Do you still remember how difficult it was to provision hardware when you had an upcoming project? I recall that it could take ages until the server was finally mounted to the rack and you could get on with the real work. It has changed over recent years, mainly because of the common availability of virtualization, but it is still not perfect (you need to buy the hardware eventually). What would you say if I could show you how to build the entire SAP NetWeaver production landscape within an hour? And I’m not talking about the easy, one server deployment.
As you probably already know, through Azure Portals you can build VM’s or other cloud components using the GUI, which is ok if you want a single instance. It becomes more complex when you suddenly need 5 or 10 servers. The high-level steps are:
- Choose VM image (what is the pre-installed software)
- Configure basic VM setting (name, password, location)
- Choose VM size (decide about server performance)
- Configure VM optional features (assign to network and install add-ons.
Based on these options we can build a high performing server within few moments. However, it is still a single server – and the true power of the cloud is when you build a very “dynamic” environment, where creating, shutting down and deleting VM’s are your daily basis tasks. You need the capability to automate the process and there is a way to do it! With the use of ARM Templates.
“With Resource Manager, you can create a template (in JSON format) that defines the infrastructure and configuration of your Azure solution. By using a template, you can repeatedly deploy your solution throughout its lifecycle and have confidence your resources are deployed in a consistent state. When you create a solution from the portal, the solution automatically includes a deployment template. You do not have to create your template from scratch because you can start with the template for your solution and customize it to meet your specific needs.” – From Microsoft.com
So now does this make it even easier to build a cloud environment? Yes, it does! It continues to get better because there is a public repository of ARM Templates, where you can explore the landscapes for different solutions. If this still isn’t adequate, you will be pleased to hear that there are specific SAP templates:
How do you use it?
Firstly, let’s download and install the Visual Studio Community Edition. When completed, execute it and create a new project, choosing type Azure Resource Group.
Directly after, we need to decide which Quick-Start template we want to use. Each template has a brief description of what components are deployed. We can filter it with the word SAP to see what choices we have.
I promised to show you how you can quickly deploy several VMs, so I choose SAP NW 3-tier compatible Marketplace image. I always recommend reading the template description contained in the readme.md file. For the one we have chosen, the description reads as follows:
This template takes a minimum amount of parameters and deploys a VM that is customized for use with SAP NetWeaver, using the latest patched version of the selected operating system. This is a template for a 3-tier configuration. It deploys 1 (no HA) or 2 (HA) ASCS/SCS servers, 1 (no HA) or 2 (HA) database servers and several virtual machines that can host dialog instances. In case of a HA deployment, the ASCS/SCS and DB servers are placed in Availability Sets and a Load Balancer is added to the ASCS/SCS and DB server to allow HA configurations in the operating system (e.g. Windows Failover Cluster).
Do you need to know the template JSON syntax? To be able to do a major customization it is beneficial, but you can learn on-the-fly. The basic configuration is available from the GUI during the template deployment, which you can start by choosing Deploy -> New from the Project menu.
After we have authenticated to our Azure Account, we can configure the template.
Each resource (an individual component of the template like network interface, disk or firewall rule) must be assigned to a Resource Group. We can create a new one or we can choose one already in existence. We can now decide how to manage the resource group. We can combine all components of the whole SAP landscape into a single group or we can split them based on the environment purpose and create three resource groups, one for development, one for test and one for production.
After clicking on the Edit Parameters button, we can decide on further environment settings:
- SAP System ID – is required to configure the firewall rules
- Operating System Type
- VM Size – we can choose in SAPS, no need for Benchmark Comparison 🙂
- System Availability – determines whether this is HA deployment
- Username and password
- Network – we can attach solution to existing network or choose a new one
Click save and deploy to start the actual build. After several minutes, I received a message with deployment status:
Successfully deployed template ‘azuredeploy.json’ to resource group ‘BJ_SAP_SampleTemplate’.
Let’s log in to the portal, to see what VMs we have available now:
As the template shows, there are three deployed VMs:
- 020-ascs-0 – ASCS instance
- 020-db-0 – Database instance
- 020-di-0 – Dialog instance
Select ASCS instance and click on Connect to download the remote desktop settings file. This VM is ready to download the SAP Installation Media and deploy the SAP system.
Now, when you need another copy of the environment, it suffices to open the previously saved template file, choose a different resource group name and deploy again. You can use this method to automate your tasks and quickly create new environments whenever you need them. You only pay for what you use, so it is important to remember to delete the elements which you’re not using (or at least shut down the VM).
Thanks for reading the post. If you like it and you want to see the next part, simply click on the Like button!