#aws #awsservices #cloud #programming #devops
Welcome to our AWS Solution Architect exam preparation series! In this video, we discuss a key cost optimization strategy: enabling hibernation on EC2 instances. Learn how this approach can help you save costs and prepare effectively for the AWS Solution Architect exam. 🌟
Here is a step-by-step guide on how to enable hibernation for EC2 instances:
Step 1: Check Instance Requirements
1. Instance Type: Ensure your EC2 instance type supports hibernation. Hibernation is supported on certain instance types such as T2, T3, M3, M4, M5, C3, C4, C5, R3, R4, and R5.
2. Operating System: Hibernation is supported on Amazon Linux, Amazon Linux 2, Ubuntu, and Windows Server.
Step 2: Prepare the EC2 Instance
1. Stop the Instance:
◦ Open the Amazon EC2 Console.
◦ Select the instance you want to enable hibernation for.
◦ Click Instance State and then Stop.
2. Modify the Instance:
◦ With the instance stopped, select it and click Actions, then Instance Settings, and Change Instance Type.
◦ Choose an instance type that supports hibernation, if not already compatible.
◦ Click Apply.
Step 3: Enable Hibernation
1. Edit Instance Settings:
◦ Select the instance and click Actions, then Instance Settings, and Edit Hibernation Settings.
◦ Check the box to Enable Hibernation.
◦ Click Save.
Step 4: Configure Instance for Hibernation
1. Adjust RAM Allocation:
◦ Make sure your instance has a maximum RAM size of 150 GiB. Instances with more than 150 GiB of RAM are not supported for hibernation.
2. Amazon EBS Volume:
◦ Ensure your instance root volume is an Amazon Elastic Block Store (EBS) volume. The root volume must be an encrypted EBS volume.
Step 5: Launch the Instance
1. Start the Instance:
◦ Select the instance and click Instance State, then Start.
◦ Wait for the instance to start and ensure it is functioning correctly.
Step 6: Use Hibernation
1. Hibernate the Instance:
◦ Select the running instance, click Instance State, and then Hibernate.
2. Resume the Instance:
◦ To resume the instance from hibernation, select the instance and click Instance State, then Start.
Additional Configuration (Optional)
1. Configure Hibernation Settings in the OS:
◦ For Linux: Ensure hibinit-agent is installed and running on the instance. This agent helps manage the hibernation process.
◦ For Windows: Configure the Windows paging file to be large enough to hold the contents of the instance's RAM.
Summary
By following these steps, you will:
1. Verify and prepare your EC2 instance for hibernation.
2. Enable hibernation through the EC2 console.
3. Start and stop the instance to apply changes.
4. Hibernate and resume the instance as needed.
Enabling hibernation allows you to save the state of your EC2 instance, including in-memory data, making it possible to quickly resume from where you left off.