3.37 E2 Hibernate AWS

In this lesson we look at the EC2 hibernate feature. With a regular instance you can stop it or terminate it: stopping preserves your data on the EBS root volume so the machine restarts cleanly, while terminating destroys both the instance and its storage. The hibernate mode goes further: at stop, the entire RAM is dumped to disk so the operating system itself does not actually shut down — it pauses.

How hibernation works

  • At stop, the contents of RAM are saved as a file at the root of the EBS volume.
  • The EBS root volume must therefore be encrypted and large enough to hold the RAM dump.
  • At restart, the OS state and RAM are reloaded from disk — much faster than a cold boot.
  • The application and caches resume immediately, no service warm-up needed.

Hibernation is supported only on specific instance families: c3, c4, c5, m3, m4, m5, r3, r4, r5 with RAM less than 150 GB. The root volume must be EBS (not instance store) and encrypted at creation. Hibernation is reserved for on-demand and reserved instances; spot instances cannot hibernate because of their ephemeral nature, and an instance cannot stay in hibernation more than 60 days.

This feature is ideal for applications with long startup times — large in-memory databases, fat caches, application servers loading thousands of beans — where a regular cold boot would take minutes. With hibernation, the instance comes back to its previous state in seconds. In the next lesson we will perform a hands-on lab to enable hibernation on a real instance and observe the behavior in the AWS console.

Summary

AWS EC2 Hibernation enables you to pause and resume instances without losing RAM state. When activated, the system saves all RAM contents to encrypted EBS storage and halts the instance, allowing faster startup since the OS and installed services are restored from memory rather than reinitializing. This feature supports only specific instance types (T3, T5, M5, M6, R3, etc.) with encrypted EBS volumes on on-demand instances, with a maximum hibernation period of 60 days.

Key points

  • Hibernation preserves all RAM contents to encrypted EBS disk, enabling rapid instance resumption without reinstalling services or applications
  • Supported only on specific instance families (T3, T5, M5, M6, R3) with on-demand pricing; reserved and spot instances cannot use hibernation
  • EBS volumes must be encrypted, sufficiently sized to hold the memory dump, and cannot be instance store volumes
  • Hibernation differs from instance stop: stopped instances keep EBS data but lose RAM state, while hibernated instances restore from saved RAM for faster startup
  • Maximum hibernation duration is 60 days; instances cannot remain hibernated indefinitely

FAQ

What happens to instance data when using EC2 Hibernation?

All RAM contents are saved to encrypted EBS storage while the instance stops. Services and application state are preserved exactly as they were, allowing instantaneous resumption without startup delays when the instance restarts.

Which AWS EC2 instance types support Hibernation?

Only specific instance families support hibernation, including T3, T5, M5, M6, and R3 families. Older generations and certain specialized instances do not support this feature.

What are the EBS volume requirements for Hibernation?

The EBS volume must be encrypted, cannot be an instance store volume, and must be sufficiently large to accommodate the memory dump file (typically at least 150 GB for supported instance sizes).