SAP Cloud

Auto Scaling of SAP Systems on Azure – Part VI

This is in continuation of my previous Article Auto Scaling of SAP Systems on Azure – Part V

5. TESTING

Since we have setup the whole setup for SAP Auto-Scaling, hence we need the test this setup. We are doing both tests where AAS will be addition whenever required and delete the same AAS once system is relaxed

5.1 Auto Scaling Out for SAP Systems

Here we will be testing the scaling out of SAP Systems by putting some dummy load on the PAS and let Automation run to perform the actions.

5.1.1 Generating Load on SAP System

For Generating Load on SAP system, the best way is to do it via SGEN tcode without changing any data in the system. this will use all the workprocesses to regenerate the program loads.

Once the load generation is started then we can see here that 22 Dialog work processes are consumed and 8 are left free, which meet our condition to trigger the automation

Once the threshold has been crossed execution should start.

5.1.2 Alert in Azure Monitor

As we have kept the timeline for 10mins hence Azure Monitor will check if this high utilization maintained for 10 mins. Then raise SAP scale out alert as below which we can see from the Azure

5.1.3 Automation Runbook Triggered

As we have configured that Automation Runbook will be triggered once the alert has been raised by the Azure Monitor. We can check the execution under Azure Automation, it will show status as Running

We can check the logs for the commands which were executed inside the Azure Automation Runbook as below:-

Wait for the Automation runbook to finish which can be checked in the same status column of Runbook Overview will be as below:-

We need to make sure that the Azure Automation Runbook has been finished without any errors and screen should be as below:-

So, our execution has been finished without any errors.

5.1.4 Verify New Virtual Machine

As our runbook has finished successfully, hence we can check if the VM has been deployed as per the expectation as below:-

5.1.5 Verify SAP Application Server

Further, we can check if SAP has been installed correctly and it is been recognized by the message server of the existing PAS as below-

We can verify by double clicking on the server that we are able to take the sessions from the newly build application server

5.1.6 Verify Logon Groups

As we can see the application server, hence need to check if the newly build application server has been added to logon groups, so that users can take sessions to that application server

5.1.7 Verify RFC Server Groups

As we can see the application server, hence need to check if the newly build application server has been added to Server groups, so that RFC sessions can take benefit of that application server.

Now, we have tested the Scaling Up of SAP systems.

5.2 Auto Scaling Down for SAP Systems

Now we will be testing the scaling down of SAP Systems by reducing the generated dummy load on the PAS and let Automation run to perform the actions.

5.2.1 Reduce the load on SAP Server

For reducing the load, we have generated by transaction code SGEN, we can stop the load generation from SGEN transaction code, or we can cancel the running job from SM37. The best would be to wait for the load generation to be finished that will free all the used Work Processes

5.2.2 Alert in Azure Monitor

As we have kept the timeline for 10mins hence Azure Monitor will check if this low utilization maintained for 10 mins. Then raise SAP scale down alert as below which we can see from the Azure Monitors

5.2.3 Automation Runbook Triggered for De-Registration

As we have configured to run the Automation runbook for de-registration once the Alert has been triggered, hence we can check the same inside the Runbook

We can see the output of the commands executed during the runbook as below: –

We can also see in logs when App servers are removed from logon groups.

This will Schedule another Runbook which will be responsible for deletion of the VM resources.

We can check below steps, to double check if the execution was successful.

5.2.3.1 Remove Server from Logon Groups

We can check SMLG to make sure application server has been removed from the Groups

5.2.3.2 Remove Server from RFC Server Groups

We can check RZ12 to make sure application server has been removed from the Groups

5.2.3.3 Automation Runbook Scheduled for Resource Deletion

As the resource deletion Runbook has been scheduled by the previous Runbook for the execution, hence we can check the same

5.2.4 Automation Runbook Triggered for Resource Deletion

Deletion of Resources Runbook will be running once the scheduled time has been reached

Once the Runbook has been finished then we can cross-check if the below steps are done as per the execution

5.2.4.1 SAP Application Server is stopped

We need to make sure that application server has been stopped completely from SAP Instance list

5.2.5 Virtual Machines and Respective Resources are deleted

We also need to make sure the resources which are associated to the newly created VM has been removed

6. NOTIFICATION

We can also setup alerts on the data that is being stored in the Log Analytics, we can design the alert as per our thresholds and requirements

6.1 When Load on SAP System crossed Upper Threshold

When Load of the SAP system reach to the defined value which we can provided in the Azure Monitor, then we can set the notification for that Alert to the email as below:-

6.2 When SAP AAS is added to Logon and RFC Server Groups

When Logic app connect SAP system to add new Application server in Logon and RFC server groups then a email can be triggered with the status by adding one step of sending email in logic App:-

Below is the sample email which will be triggered for the same once Logic app is triggered.

6.3 When Load on SAP System reached Lower Threshold

When Load of the SAP system reach to the lower defined value which we can provided in the Azure Monitor, then we can set the notification for that Alert to the email as below:-

6.4 When SAP AAS has been removed from Logon And RFC Server Groups

When Logic app connect SAP system to remove new Application server in Logon and RFC server groups then a email can be triggered with the status by adding one step of sending email in logic App:-

Below is the sample email which will be triggered for the same once Logic app is triggered.

7. LOGS & TROUBLESHOOTING

7.1 Checking SAP Monitoring Data

We can check if SAP is collecting the relevant monitoring data in Analyse Data in tcode /sdf/mon from SAP system: –

7.2 Checking Log Analytics Workspace

We can check if Logic app is successfully collecting the data to the Log Analytics Workspace. To do the same we can goto Custom Logs and we can see that custom table is created automatically

We can also see the fields which are created for collecting the information on from the SAP system.

By querying the Logs we can check if the logs are getting updated regularly, or not.

7.3 Azure Automation Runbook Log

We can check the steps which are carried out by the Automation Runbook by clicking on the Jobs of the Runbook and click on All Logs

7.4 Logs for Logic Apps

From the Logic Apps perspective, we can check the results of the execution in Overview blade

7.5 Logs for On-Premises Data Gateway

For On-premises Data Gateway, we can use Diagnostics blade to download the logs for the gateway to analyze.

This file is saved to the ODGLogs folder on your Windows desktop in .zip format.

Microsoft has provided very good troubleshooting guide for this

7.6 Resource Deployment Logs