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.