cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Cost Optimization for SAP Cloud-Based Environments

RamchanderBaikan
Discoverer
0 Kudos
219

 

RamBaikan_0-1747922314234.png

The transition from on-premises to cloud infrastructure brings numerous advantages, including scalability, flexbility, and enhanced performance. However, these benefits can be undermined by poor resource management, lack of cost visibility, and inefficient configurations. To address these challenges, organizations must adopt targeted strategies that not only reduce costs but also ensure optimal system performance and reliability. This article delves into key techniques for cost optimization in SAP Cloud Infrastructure, including resource right-sizing, auto-scaling policies, and the use of Reserved Instances and Savings Plans. It also highlights the importance of leveraging advanced monitoring tools to track resource usage and identify cost-saving opportunities.

RamBaikan_1-1747922314242.png

This article explains how to Reduce the cost of SAP cloud-based servers (like SAP S/4 HANA Cloud, or running SAP on IaaS, QA or Dev providers like AWS, Azure, or Google Cloud) depends on how your environment is set up and what your needs are.

  • Shut Down Non-Production Systems When Not in Use
  • Clean Up Unused Systems or Services
  • Monitor Usage with Cloud Cost Tools

 Shut Down Non-Production Systems When Not in Use:-

 Use automation or scheduling tools to stop Dev, QA, and sandbox systems during off-hours (nights/weekends).

A Stop/Start policy automatically stops AWS EC2 instances at a scheduled time and starts them again later. This helps save costs since stopped instances don’t incur compute charges, though you still pay for EBS volumes.

 Example: EventBridge + Lambda Setup for AWS

 

  1. Create a Lambda Function

Python example to stop EC2 instances:

RamBaikan_2-1747922314243.jpeg

  1. Create an EventBridge Rule
    • Use cron expressions like:
      • Stop at 7 PM UTC: cron(0 19 * * ? *)
      • Start at 7 AM UTC: cron(0 7 * * ? *)

RamBaikan_3-1747922314244.png

RamBaikan_4-1747922314246.png

 

RamBaikan_5-1747922314247.png

This function initiates the EC2 instance at 9:00 AM IST. We can configure the same scheduling pattern to stop the instance according to our specified times.

For: Azure VM

To schedule start and stop of Azure VMs, you can utilize Azure Automation’s “Start/Stop VMs during off-hours” feature or Logic Apps. Azure Automation allows you to create an Automation Account, deploy a solution, and configure schedules and runbooks to automate the start and stop processes. Logic Apps offer a visual designer to build workflows that integrate with Azure VM resources.

RamBaikan_6-1747922314249.png

 

RamBaikan_7-1747922314250.png

Imp Note : If the QA, Dev, and S4HANA schedules have started but the SAP MMC is not functioning to resolve this issue, please refer to the article :

 this article explains how to automatically start the SAP Management Consol (SAP Service) when booting up the SAP cloud or physical system. Generally, to ensure that any program starts automatically during the boot process, we need to add that application to the scheduled tasks and assign a specific time for it to launch. However, while the SAP Management application may open, the SAP necessary services will not start automatically and will need to be initiated manually.

 After installing the SAP application, we need to check two settings in the Windows Services.

 Step 1:

 If the startup type is (Automatic Delayed Start) in Windows Services, the option will only start the application but will not initiate the SAP service. To run the SAP service, we must log into the system and start the service manually using the service username and password.

RamBaikan_8-1747922314251.png

Step 2

 If the service associated with the account name and instance name does not start at startup, we need to log into the system and manually start the SAP MMC service.

RamBaikan_9-1747922314252.png

 Solution for this issue:  We should select two options: one is Type: Automatic on General Tab, and the other is to log on with the.\SAP service.

RamBaikan_10-1747922314253.png

For S4 HANA:

After starting the instance or virtual machine (VM) in AWS, Azure, or any cloud server, the HANA database and application do not start automatically. We must start them manually using commands by connecting to the system with PuTTY, where we execute the database and application start commands. The information below pertains to how to configure automatic startup when the system is initiated in the cloud at a specific time.

Connect the system thorough PuTTY.

# cd /opt

# sudo vi start-hana.sh   ( Copy the below code and paste it on start-hana.sh file)

RamBaikan_11-1747922314253.png

 

# sudo vi stop-hana.sh   ( Copy the below code and paste it on stop-hana.sh file)

RamBaikan_12-1747922314254.png

 After saving the file. Go to shell and execute the below commands.

 RamBaikan_13-1747922314255.png

Clean Up Unused Systems or Services

 Decommission old systems, backups, or logs that are no longer needed.

  • Archive historical data to lower-cost storage tiers (e.g., Amazon S3 Glacier, Azure Cool Blob Storage).

Monitoring Usage and Cost

 Cost Allocation & Tagging

  •          Use tags or labels to allocate costs by project, department, or team.
  • Budgets & Alerts
  •          Define spending limits and trigger notifications when thresholds are breached.
  • Forecasting & Trend Analysis
  •          Predict future usage and budget accordingly.
  • Usage Anomaly Detection
  •          Identify spikes or unexpected changes in usage.
  • Rightsizing & Recommendations
  •          Suggest instance downsizing or idle resource termination.

Accepted Solutions (0)

Answers (0)