Hibernating an EC2 Instance for Quick Startup | Prerequisites for Instance Hibernation

Prerequisites for Hibernating an EC2 Instance

Prev Question Next Question

Question

Your team has owned a web application which is an online ticket booking system.

You are trying to use another m4.xlarge EC2 instance as a backup.

You want to stop the instance to save some cost unless it needs to bring up.

However, it takes a long time for the bootstrap process to bring the system up, which is unacceptable.

The company's cloud architect has suggested hibernating the instance so that it can start up very quickly.

To hibernate the instance, which below prerequisites are needed?

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D. E.

Correct Answer - B, C, E.

Refer to the below for the hibernating process:

It is a process of transferring data inside and outside RAM to Amazon EBS root volume.

However, some prerequisites have to be met.

Refer to https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Hibernate.html for the details.

Option A is incorrect: Because only Windows and Linux are supported for EC2 hibernation.

Please read the description given under 'Important' in the page under the below link.

https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Hibernate.html https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/Hibernate.html

Option B is CORRECT: Because instance store volume will lose data when stopped and is not supported for EC2 hibernation.

Option C is CORRECT: Because when the instance is in an Auto Scaling group, and you try to hibernate it, the Amazon EC2 Auto Scaling service marks the stopped instance as unhealthy and may terminate it and launch a replacement instance.

Option D is incorrect: Because in order to use hibernation, the root volume must be encrypted to ensure the protection of sensitive content that is in memory at the time of hibernation.

Option E is CORRECT: If the root volume is not enough to store the data from RAM, the following message may appear: hibinit-agent: Insufficient disk space.

Cannot create setup for hibernation.

Please allocate a larger root device.

Running

EC2

- Stop - Hibernate
instance

Encrypted
Amazon EBS
root volume

HIBERNATION

Shutdown t 1

To hibernate an EC2 instance, the following prerequisites must be met:

A. The AMI of Mac OS EC2 instances must support hibernation. Hibernation is not supported for macOS instances, so this option is not relevant to the scenario.

B. The instance root volume must be an Amazon EBS volume, not an instance store volume. Hibernation requires an EBS-backed instance, not an instance store-backed instance. EBS volumes persist independently of the lifecycle of the instance, allowing the instance to be stopped and started again while preserving its state.

C. The instance cannot be in an Auto Scaling group or used by Amazon ECS. An instance in an Auto Scaling group or used by Amazon ECS cannot be hibernated because these services are designed to scale up or down dynamically, and hibernation is not supported in this scenario.

D. The root volume must not be encrypted; otherwise, it will cause an issue to transfer data from RAM. If the root volume is encrypted, hibernation will not be successful because the instance cannot write the contents of RAM to the encrypted disk. Therefore, the root volume must not be encrypted.

E. The root volume must be large enough so that the RAM contents can be stored. During hibernation, the instance saves its memory contents to the root volume, and when it starts up again, it restores the memory contents from the root volume. Therefore, the root volume must be large enough to store the contents of the instance's RAM.

In summary, to hibernate an EC2 instance, it must be EBS-backed, not in an Auto Scaling group or used by Amazon ECS, the root volume must not be encrypted, and the root volume must be large enough to store the contents of the instance's RAM.