SAP Start/Stop Automation using Azure Center for SAP Solutions
Published Jun 15 2023 08:00 AM 7,479 Views
Microsoft

SAP Start/Stop Automation using Azure Center for SAP Solutions

 

Introduction

Last month at the SAP Sapphire 2023 event, we announced the General Availability of Azure Center for SAP Solutions (ACSS).  ACSS enables you to create a logical representation of your SAP system on Azure referred to as Virtual Instance for SAP solutions (VIS).  This in turn makes several SAP management tasks like start/stop, cost management, monitoring, configuration checks etc. possible at the SAP SID level rather than at the Virtual Machine level.  In this blog we will look at how ACSS simplifies the SAP System Start/Stop automation process.

 

SAP Start/Stop Automation - Use cases

Before we get into the details of the solution, a quick recap of the most common scenarios where SAP Stop/Start automation can come in handy:

  • Snoozing SAP systems whose virtual machines (VMs) are running on PAYG pricing model outside of the core business hours - Setup the non-production SAP subscriptions in such a way that all SAP systems are snoozed outside business hours by default.  Use tagging to create exceptions where SAP system is required outside business hours or has VMs with Reserved Instance pricing model.
  • Create adhoc schedules of runbook to automatically Stop/Start SAP systems (with VMs) for scheduled maintenance activities like patching - This can reduce the overall downtime of such activities by running the operation in parallel, as well as reduce operational overhead of passing responsibilities between teams i.e. Basis stops SAP systems, hands over to OS team etc.

 

Existing Solution

Currently SAP Start/Stop automation on Azure can be achieved by making use of the SAPAzurePowerShellModule published by my colleagues Goran Condric and Martin Pankraz. Details of this PS module along with an accompanying PowerApp can be referenced here 

 

Using ACSS for SAP Start/Stop Automation

When you register your SAP systems with ACSS (or deploy them with ACSS) you can execute Start/Stop commands for the individual components of the SAP instance like DB, central services, app servers or the whole SAP application at the SAP SID level.  This can be done from the Azure portal or can be done at scale, in an automated manner using the Az.Workloads PS module or the az workloads Azure CLI extension.

 

One of the key benefits of using this approach is that you can now use tagging at the SAP SID (Virtual Instance) level to determine which SAP systems needs to be stopped/started instead of adding tags at the VM level, which can be cumbersome for a large number of SAP systems, each running on multiple VMs. 

High-level steps to achieve this are:

  • Register existing SAP systems (only ABAP systems are supported currently) with Azure Center for SAP Solutions.
  • Add tags to the SAP Virtual Instance resources on Azure which needs to be part of the Snoozing schedule.
  • Create child runbooks to Stop/Start SAP systems using PS cmdlets for ACSS
  • ACSS currently supports Start/Stop operations for HANA databases only.  For non-HANA databases, add custom commands to start/stop any other databases within the runbook.
  • Create a parent runbook which orchestrates the child runbooks to stop/start SAP systems in parallel and also takes care of VM startup/shutdown in the right sequence.
  • Schedule the runbooks at subscription level to identify and stop/start SAP systems with VMs on schedule.

Sample Implementation

In this GitHub repo karthikvenkat17/SAPStopStartACSS (github.com) , we have 4 sample runbooks which demonstrates this process

 

Stop-SAPSystemUsingACSS.ps1, Start-SAPSystemUsingACSS.ps1 - These 2 runbooks can be used for Stopping/Starting individual SAP Virtual instances.  Note that the currently Start/Stop operation for database instance is supported for HANA database only.  So, in the PS runbooks we check the type of database and if its non-HANA exit the process. You could add the steps required for Start/Stop of the non-HANA database of your choice, using the Invoke-AzVMRunCommand option.

 

Start-SAPSystemByTag.ps1, Stop-SAPSystemByTag.ps1 - These 2 runbooks are used to Start/Stop all SAP systems in a particular subscription based on a specific tag name and value.  The runbooks identify the SAP systems to be Started/Stopped using the specified tag and schedule child jobs of Stop-SAPSystemUsingACSS.ps1 or Start-SAPSystemUsingACSS.ps1 for each SAP system in parallel.  We then wait for all the jobs to complete and output the final status of the SAP systems. This modular approach is useful if you have a large number of SAP systems which you want to Start/Stop for cost savings regularly during certain time windows.

2 Comments
Co-Authors
Version history
Last update:
‎Jun 14 2023 03:42 PM
Updated by: