Recovering EC2 Instances, EBS Volumes and Servers
Instances fail because of hardware faults, operating system problems and software errors, and volumes can be lost or corrupted. This lesson explains EC2 status checks and automatic recovery, EBS snapshots and their recovery features, Amazon Data Lifecycle Manager, Systems Manager runbooks for instance recovery, and AWS Elastic Disaster Recovery for server-level disaster recovery with low RPO and RTO.
Learning outcomes
After completing this lesson, you will be able to:
- Distinguish between system status checks, instance status checks and attached EBS status checks, and the recovery action for each.
- Explain EC2 automatic recovery and CloudWatch alarm recover and reboot actions.
- Describe EBS snapshot features, Data Lifecycle Manager policies and Recycle Bin.
- Explain how AWS Elastic Disaster Recovery replicates servers and supports recovery drills and failback.
Status Checks
EC2 runs automated status checks every minute and publishes the results as CloudWatch metrics. Each type of check points to a different cause and remedy.
| Check | Metric | Detects | Remedy |
|---|---|---|---|
| System status check | StatusCheckFailed_System | Problems with the underlying host: power, network, hardware | Recover the instance onto new hardware (automatic recovery or a recover action), or stop and start |
| Instance status check | StatusCheckFailed_Instance | Problems inside the instance: failed boot, exhausted memory, corrupted file system, network misconfiguration | Reboot, or fix the operating system configuration |
| Attached EBS status check | StatusCheckFailed_AttachedEBS | Attached EBS volumes are unreachable or cannot complete I/O | Investigate the volume; replace the instance |
System or instance check?
Automatic Recovery
Simplified automatic recovery is enabled by default on supported instance types: when a system status check fails because of an underlying hardware problem, EC2 recovers the instance on a different host. A recovered instance keeps its instance ID, private and Elastic IP addresses, instance metadata and attached EBS volumes, but data in memory and on instance store volumes is lost. Automatic recovery can be disabled per instance.
Alternatively, a CloudWatch alarm on StatusCheckFailed_System can use the EC2 recover action, which gives explicit control and notification through SNS. A CloudWatch alarm on StatusCheckFailed_Instance can use the reboot action to restart an instance whose operating system has hung. Recovery applies only to instances that use EBS and supported instance types; instances in Auto Scaling groups should instead be replaced by the group, which marks instances with failed status checks unhealthy.
Matching actions to checks
Recover for system (host) failures, reboot for instance (operating system) failures. A recover action on an instance status check does not fix a hung operating system.
EBS Snapshots and Related Features
An EBS snapshot is an incremental, point-in-time backup of a volume stored in S3-backed storage managed by EBS. Only changed blocks are stored after the first snapshot, but each snapshot can restore the full volume. Snapshots are crash-consistent unless the application is quiesced; for application consistency, Windows VSS snapshots or pre- and post-scripts in Data Lifecycle Manager or AWS Backup are used. Multi-volume snapshots capture all volumes of an instance at the same moment.
- Copying snapshots to other Regions and sharing them with other accounts supports DR; encrypted snapshots require the KMS key to be shared or the copy to be re-encrypted with a key in the destination.
- Fast Snapshot Restore (FSR) removes the latency of first access to blocks of volumes created from a snapshot, so restored volumes deliver full performance immediately, which matters for tight RTOs. Without it, blocks are loaded lazily from S3 on first read.
- Snapshot archive moves rarely needed snapshots to a lower-cost tier with a retrieval time of up to 72 hours.
- Recycle Bin retains deleted snapshots and AMIs for a retention period defined by rules, so accidental deletions can be recovered; rule lock prevents the rules from being weakened.
- EBS encryption by default, set per account and Region, ensures new volumes and their snapshots are encrypted.
Amazon Data Lifecycle Manager
Amazon Data Lifecycle Manager (DLM) automates the creation, retention, copying and deletion of EBS snapshots and EBS-backed AMIs using policies that target volumes or instances by tags. A policy has schedules with frequency and retention by count or age, cross-Region copy rules, cross-account sharing, Fast Snapshot Restore enablement and archiving. Default policies can protect every instance or volume in a Region that has no other backup. DLM is specific to EBS and AMIs and has no additional charge; AWS Backup covers many services and adds vaults, locks and organisation policies. Choose DLM for simple, EBS-only lifecycle automation and AWS Backup for centralised, multi-service, compliance-driven backup.
Systems Manager Runbooks for Instance Recovery
Systems Manager Automation includes runbooks that recover instances that are not reachable. AWSSupport-ExecuteEC2Rescue uses a helper instance to diagnose and fix common operating system problems on an unreachable instance's root volume, such as network configuration or SSH configuration errors. AWS-RestartEC2Instance restarts instances, and AWSSupport-StartEC2RescueWorkflow runs custom repair scripts offline. These runbooks can be triggered automatically by EventBridge rules on status check alarms or used manually in incident response, and they are part of the recovery strategy referred to by the exam guide's mention of Systems Manager for backup and recovery.
AWS Elastic Disaster Recovery
AWS Elastic Disaster Recovery (AWS DRS) replicates servers, whether on premises, in another cloud or on EC2 in another Region, to a staging area in the recovery Region using continuous block-level replication by an agent installed on each source server. The staging area uses low-cost instances and EBS volumes, so the cost is close to storage cost until recovery. RPO is typically seconds, and RTO is typically minutes, because recovery launches full-size EC2 instances from the replicated data with conversion handled automatically. Point-in-time recovery lets the team launch from an earlier state, for example before ransomware encrypted the data.
AWS DRS supports non-disruptive drills, which launch recovery instances without affecting replication, and failback to the original environment after the event. It is the appropriate answer when servers that cannot be re-architected, such as commercial software on Windows or Linux, need a low RPO and RTO in another Region.
Recover servers
Recovering a Legacy Application Server
A licensed accounting application runs on two EC2 instances that cannot be placed in Auto Scaling groups. Instances occasionally hang, hardware failures have caused outages, and the business needs an RPO of one minute and an RTO of 30 minutes if the Region fails.
-
Host failures
Confirm simplified automatic recovery is enabled, and add a CloudWatch alarm with the recover action and SNS notification on StatusCheckFailed_System.
-
Operating system hangs
Add an alarm with the reboot action on StatusCheckFailed_Instance.
-
Regional DR
Install the AWS DRS agent on both servers with replication to the recovery Region, and run quarterly drills.
-
Backups
Assign the instances to an AWS Backup plan for daily backups retained for 35 days.
A volume restored from a snapshot during recovery performs poorly for the first hour. How can this be avoided in future recoveries?
Show answer
Enable Fast Snapshot Restore on the snapshot in the relevant Availability Zones, so restored volumes deliver full performance immediately instead of loading blocks lazily.
Exam Tips
Remember for the exam
- System status check failures (host problems) are fixed by recovery onto new hardware; instance status check failures (operating system problems) by reboot.
- Simplified automatic recovery is on by default for supported types; recovered instances keep their ID, IPs and EBS volumes but lose memory and instance store data.
- EBS snapshots are incremental; Fast Snapshot Restore removes first-access latency; Recycle Bin recovers deleted snapshots and AMIs.
- Data Lifecycle Manager automates EBS snapshot and AMI lifecycles by tag; AWS Backup covers many services with vaults and locks.
- AWS Elastic Disaster Recovery gives server-level DR with RPO of seconds and RTO of minutes, with drills and failback.