SAP on AWS
EDI for SAP
Automatically Recover an SAP Instance with AWS CloudWatch
by Timothy Carioscio
How to react quickly to failures and automate disaster recovery.
No matter how hard one tries to prevent them, outages and hardware failures will occur. This is true regardless of whether that instance is hosted on premise, in a colocation facility, or in the cloud. Unlike on premise or colocated hosting, cloud computing offers the ability to react quickly to those failures and automate the disaster recovery process.
AWS Auto-Recovery by CONTAX
As an AWS Partner, as well as an AWS customer, CONTAX Inc. uses AWS CloudWatch and auto-recovery to protect against hardware failure by automating instance recovery. Additionally, we suggest auto recovery for all of our customers who run SAP workloads on AWS.
AWS CloudWatch is AWS’ built-in monitoring and management service, which is able to track the health of a number of AWS products. It is a robust tool with may applications. Perhaps the simplest and most important for running SAP workloads in the cloud is auto recovery.
Auto recovery is an option within CloudWatch which will detect instance failures and automatically relaunch the workload onto new, healthy hardware. AWS lists the typical cause of these instance failures to include:
- Loss of network connectivity
- Loss of system power
- Software issues on the physical host
- Hardware issues on the physical host that impact network reachability
Though most AWS EC2 instance types and configurations support auto recovery, it’s important to confirm that the instance you’re setting up fits the following criteria:
- The instance uses one of the following instance types: A1, C3, C4, C5, C5n, M3, M4, M5, M5a, P3, R3, R4, R5, R5a, T2, T3, T3a, X1, or X1e
- The instance uses default or dedicated instance tenancy
- The instance uses EBS volumes only (do not configure instance store volumes).
In addition to taking much of the headache out of system faults, auto recovery is also cost effective and easy to set up. Configuring a CloudWatch alarm to auto recover your instance is included within the AWS Free Tier of 10 free CloudWatch alarms, but if your organisation is already exceeding the free tier, each additional alarm costs just pennies per month (link to CloudWatch pricing).
Setting Up Auto-Recovery
As mentioned above, configuring AWS CloudWatch to auto-recover an EC2 instance is a quick and painless undertaking. It can be done through the AWS Management Console in three easy steps.
After logging onto the AWS Management Console, select the EC2 instance for which you’d like to configure auto recovery, and choose “Add/Edit Alarms” from the “Actions” dropdown
There will be popup showing the previously configured alarms for this instance. Feel free to review those alarms, then choose “Create Alarm”
There will be yet another popup in which you can the instance state to monitor and the resulting action. For auto recovery, the settings should be:
- Take the action - “Recover this instance”
- Whenever - Status Check Failed (System) - Is Failing
- For at least 2 consecutive periods of 1 Minute
- (Optional, but recommended) - Configure an email address or email list to receive a notification that the auto recovery occurred.
And click “Create Alarm”
With these settings in place, AWS CloudWatch with check on the status of the AWS Instance every minute and if the instance fails two status checks in a row, CloudWatch will automatically re-launch the instance onto new, healthy hardware.
If you’d like to learn more about AWS CloudWatch, auto recovery, or running SAP workloads on AWS, we’d love to have a chat. Please reach out to us at firstname.lastname@example.org and we can organise a discussion.
About the Author: Timothy Carioscio
Tim is an AWS evalengist. Rather than having his head in the clouds, he lives with the Cloud in his head.