Generated with sparks and insights from 6 sources
Introduction
-
Hibernation in Amazon EC2 allows you to pause and resume instances, preserving the in-memory state (RAM) to the Amazon Elastic Block Store (EBS) root volume.
-
To hibernate an instance, it must be enabled for hibernation and meet specific prerequisites, such as using supported instance types and having an Encrypted EBS Root Volume.
-
Hibernation is useful for Cost Optimization, faster startup times, Data Persistence, and Simplified Maintenance.
-
You can enable hibernation during instance launch or by modifying an existing instance.
-
When hibernated, the instance's EBS root volume and any attached EBS data volumes are persisted, and the instance retains its instance ID.
-
To resume a hibernated instance, the EBS root volume is restored, RAM contents are reloaded, and previously running processes are resumed.
Prerequisites [1]
-
Supported Instance Types: Ensure the instance type supports hibernation (e.g., M3, M4, M5, C3, C4, C5, R3, R4, R5).
-
Encrypted EBS Root Volume: The root volume must be encrypted to protect sensitive data in memory.
-
Operating System: Hibernation is supported on instances running Amazon Linux AMI version 1.
-
Instance Configuration: The instance must be configured to support hibernation during launch or modification.
Enabling Hibernation [2]
-
Launch Instance: Enable hibernation during the instance launch process.
-
Modify Existing Instance: Modify an existing instance to enable hibernation.
-
AWS Management Console: Use the AWS Management Console to configure hibernation settings.
-
CLI Commands: Use AWS CLI commands to enable hibernation (e.g.,
aws ec2 modify-instance-attribute
).
Hibernation Workflow [2]
-
Step 1: Launch the instance with hibernation enabled.
-
Step 2: Bring the instance to the desired state.
-
Step 3: Hibernate the instance to save its current state.
-
Step 4: Resume the instance to restore its previous state, including RAM contents and running processes.
Use Cases [3]
-
Cost Optimization: Hibernate instances during periods of inactivity to reduce costs.
-
Faster Startup: Resume hibernated instances faster than starting from a stopped state.
-
Data Persistence: Preserve in-memory data for long-running processes or applications.
-
Simplified Maintenance: Apply updates and perform maintenance tasks while the instance is paused.
Cost and Performance [2]
-
Cost: Pay only for EBS storage and any Elastic IP addresses attached to the instance during hibernation.
-
Performance: The time to hibernate or resume depends on the memory size, in-memory data, and EBS volume throughput.
-
No Instance Usage Charges: You're not charged for instance usage when it is in the stopped state.
-
Data Transfer: No charges for data transfer when RAM contents are transferred to the EBS root volume.
Supported Instance Types [1]
-
M3: General-purpose instance type.
-
M4: General-purpose instance type.
-
M5: General-purpose instance type.
-
C3: Compute-optimized instance type.
-
C4: Compute-optimized instance type.
-
C5: Compute-optimized instance type.
-
R3: Memory-optimized instance type.
-
R4: Memory-optimized instance type.
-
R5: Memory-optimized instance type.
Troubleshooting [2]
-
Check Hibernation Configuration: Ensure the instance is configured for hibernation.
-
Verify EBS Volume Encryption: Confirm that the EBS root volume is encrypted.
-
Instance Type Compatibility: Ensure the instance type supports hibernation.
-
AWS CLI Commands: Use AWS CLI commands to check hibernation status and troubleshoot issues.
-
AWS Documentation: Refer to AWS documentation for detailed troubleshooting steps.
Related Videos
<br><br>
<div class="-md-ext-youtube-widget"> { "title": "what is stop hibernate option on EC2 and How to Encrypt root ...", "link": "https://www.youtube.com/watch?v=umYTuc0zudc", "channel": { "name": ""}, "published_date": "Dec 5, 2018", "length": "" }</div>
<div class="-md-ext-youtube-widget"> { "title": "EC2 Hibernation| How to configure Hibernation ...", "link": "https://www.youtube.com/watch?v=NlxQhcOahrE", "channel": { "name": ""}, "published_date": "Aug 8, 2023", "length": "" }</div>
<div class="-md-ext-youtube-widget"> { "title": "EC2 Instance Hibernation | Stopping | Use cases | Hands-On", "link": "https://www.youtube.com/watch?v=Er9KE93r6Go", "channel": { "name": ""}, "published_date": "Oct 8, 2023", "length": "" }</div>