3.38 How AWS Hibernation Mode Works
This lab walks through enabling hibernation on a real EC2 instance. We start by launching an instance whose type supports the feature — for example an m5.large with the Amazon Linux 2 AMI. In the instance details step, we tick the Stop-Hibernate behavior option. A warning reminds us that the EBS root volume must be encrypted for hibernation to work, so we enable encryption on the root volume.
Storage and steps
- Increase the root volume size (around 26 GB) so it can store the RAM dump.
- Keep the default security group, attach the existing key pair, then launch.
- Connect to the instance with EC2 Instance Connect to verify it is running.
- Run
uptimein the shell — the machine shows it has been up for a few minutes.
From the EC2 console, right-click the instance and choose Instance state > Hibernate. The instance enters the stopping state. Wait until it is fully stopped, then start it again from the console. Once it is back to running, reconnect with EC2 Instance Connect and run uptime again: the value continues from where we left it (a few minutes total, not a fresh boot), proving that the OS was paused and resumed instead of restarted.
This is the key benefit of hibernation: the application, caches, and OS state survive a stop. After validating the behavior, we terminate the instance to avoid further billing. Note that hibernation requires an encrypted EBS root volume and is restricted to specific instance families with RAM smaller than 150 GB. You now know how to enable, trigger, and validate EC2 hibernation in practice.
Summary
AWS Hibernation Mode is a feature that allows EC2 instances to enter a deep sleep state, preserving the instance's memory to disk and maintaining system continuity. This lesson demonstrates the practical requirements for enabling hibernation—including instance type compatibility and hardware prerequisites—and includes a hands-on demonstration proving that system uptime continues even when a hibernating instance is in a stopped state.
Key points
- Hibernation mode is not supported on all EC2 instance types; specific instance families must be selected for compatibility
- Sufficient RAM is required to store the instance's memory contents to disk during hibernation
- Adequate EBS storage must be provisioned to accommodate hibernation data during stopped periods
- When hibernation is enabled, the system's state and uptime are preserved during the instance's stopped state
- Upon restart, instances recover from hibernation state rather than performing a cold boot, enabling faster recovery
- Security groups and network configurations must be properly set before enabling hibernation mode
FAQ
What hardware prerequisites are needed for AWS Hibernation Mode?
Your EC2 instance must have sufficient RAM to store its memory to disk, adequate EBS volume storage (typically 26GB or more of GP volumes), and must use an instance type that supports hibernation mode.
How can you verify that Hibernation Mode is working correctly?
You can verify hibernation by checking system uptime before and after stopping a hibernation-enabled instance. If uptime continues increasing during the stopped period, it confirms the system remained active in hibernation rather than fully shutting down.
Are there any limitations when using Hibernation Mode on EC2 instances?
Hibernation mode is not available for all instance types—only specific families support it. You also need sufficient disk space to store RAM contents and sufficient RAM capacity to enable the feature in the instance configuration.