We are happy to share with the SAP on Azure community a concept to automate your SAP system start / stop in Azure.
This concept as introduced in this blog has all the necessary parts (including PaaS Azure automation runtime environment, scripts, and runbooks, tagging process etc.) in a public GitHub repository that enables you to adapt functionality like:
This way you achieve cost savings both on the compute and on the storage side!
SAP systems stop and SAP application servers stop is specially designed for a graceful shutdown, allowing SAP users and batch jobs to finish. This way you can minimize the SAP system or the SAP application server’s downtime impact. The approach is similar on the DBMS side.
To further enhance the user experience, you can consume this functionality using a cool SAP Azure Power App . For more information you can check a great blog of Martin Pankraz - Hey, SAP Systems! My PowerApp says Freeze! But only if you’re done yet .
This solution is the product of a joint effort of the SAP on Azure CAT Team (Cloud Advisory Team) andthe SAP on Azure FastTrack Team (Robert Biro and Martin Pankraz).
In details, with this solution you can do the following:
Although we did not test with all these DBMSs, the expectation is that this approach will work.
The solution is using Azure automation account PaaS as an automation platform to execute the SAP shutdown/startup jobs.
Runbooks are written in PowerShell. A PowerShell module SAPAzurePowerShellModules is used by all runbooks. These runbooks and the module are stored in PowerShell Gallery, and are easy to import.
Information about the SAP landscape and instances are stored in VM Tags. VM tagging can be done either manually or even better - using prepared tag runbooks.
<sid>adm password is needed on Windows OS and is stored securely in the Credentials area of the Azure automation account.
Secure assets in Azure Automation include credentials, certificates, connections, and encrypted variables. These assets are encrypted and stored in Azure Automation using a unique key that is generated for each Automation account. Azure Automation stores the key in the system-managed Key Vault.
The Starting and Stopping of:
The stopping of the SAP system or SAP application server will be done using an SAP soft shutdown or graceful shutdown procedure, within a specified timeout. The SAP soft shutdown is handling gracefully SAP processes, users, etc. within the specified downtime time, during the stop of the whole SAP system or one SAP application server.
Users will get a popup to log off, SAP application instance(s) will not be considered for scheduling from the different logon groups (users, batch, RFC, etc.), the procedure will wait for SAP batch jobs to complete (until the specified timeout is reached). This functionality is implemented in the SAP kernel.
INFO: You can specify the value for SAP soft shutdown time as a parameter. The default value is 300.
For SAP HANA and SQL Server, DB soft shutdown is also implemented, which will gracefully stop these DBMS, so DB will have time to flush consistently all content from memory to storage and stop all DB processes.
A user can trigger start / stop in two ways:
The non-production SAP systems, like dev, test, demo, training etc., typically do not run 24/7. Lets assume you would run them 8 hours per day, Monday through Friday. This means you run and pay for each VM 8 hours x 5 days = 40 hours. The rest of the time of 128 hours per week you don't need to pay, which translates into approximatelly 76 % of savings on compute!
Productive SAP system run typically 24/7 and you never completely shut them down. Still, there is a huge potential for savings in the SAP application layer. The SAP application layer constitutes the largest portion of SAPS in an SAP system.
INFO: SAP Application Performance Standard (SAPS) is a hardware-independent unit of measurement that describes the performance of a system configuration in the SAP environment. It is derived from the Sales and Distribution (SD) benchmark, where 100 SAPS is defined as 2,000 fully business processed order line items per hour. SAPS is an SAP measure of compute process power.
In an on-premises environment, an SAP system is often oversized, so that it can process the required peak loads. But the reality is, these peaks are rare (maybe few days in 3 months). Most of the time such systems are underutilized. I’ve seen prod systems that have 5 – 10 % of total CPU utilization most of the time.
In the cloud we have the possibility to run only what we need, and pay for what we used – hence, the SAP application servers’ layer is a perfect candidate to bring down the cost for SAP productive systems!
Here, this solution offers jobs to start / stop an SAP application server and VMs. It is using a soft shut down, allowing SAP users and processes enough time to complete.
If you use Premium storage, there is an opportunity for cost savings, by converting such managed storage to standard, while the system is not running.
Let’s say you need to use Premium storage (especially for the DBMS layer) to get a good SAP performance during the runtime. But once the SAP system (and VMs) is stopped, if you choose to convert the disks from Premium to Standard disks, you will pay much less on the storage during the time the system and the VMs are stopped.
During the start procedure, you can decide to convert the disks back to premium, to have good performance while the SAP systems are running , and only pay for the more expensive Premium storage, while the system is running.
For example, if the SAP system would run 8 hours x 5 days = 40 hours, and the SAP system is stopped for 128 hours per week, that means that 128 hours per week, you will not pay the price for Premium storage, but the reduced price for Standard storage.
For example, price of 1 TB P30 disk approximately 2 times higher than 1 TB S30 Standard HDD disk. For above mentioned scenario, savings on 1 TB managed disk would be approximately 54 %!
For the exact updated pricing for managed disks, check here.
The cost of using Azure automaton service is extremely low. Billing for jobs is based on the number of job run time minutes, used in the month. And for watchers, billing is based on the number of hours used in a month. Charges for process automation are incurred whenever a job or watcher runs. You will be billed only for minutes/hours that exceed the free included units (500 min for free). If you exceed the monthly free limit of 500 min, you will pay per minute €0.002/minute.
Let’s say one SAP system start or stop takes on average 15 minutes. And let’s assume you scheduled your SAP system to start every morning from Monday to Friday and stop in the evening as well. That will be 10 executions per week, and 40 per month for one SAP system.
This means that in 500 free minutes you can execute 33 start or stop procedures for free.
Everything extra you need to pay. For one start or stop (of 15 min), you would pay 15 min * €0.002 = €0.03. And for 40 start / stop of ONE SAP system you would pay € 1.2 per month!
For uptodate pricing, you can check here.
Often, when you use a solution which offers you specific functionality, you need to manage it as well, learn it, etc. All this generates additional costs, which can be quite high.
As Azure automation account is a PaaS service, you have here ZERO management costs!
Plus, it is easy to set it up and use it.
All documentation and scripts can be found here on GitHub. All job scripts and SAP on Azure PowerShell Module is available on PowerShell Gallery.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.