Day 71 of 90 Days of DevOps Challenge: AMI & Snapshot


On Day 70, I explored one of the most essential AWS services: EC2 (Elastic Compute Cloud).
I learned how to launch, configure, and secure EC2 instances, and gained an understanding of the importance of instance types, key pairs, security groups, and EBS volumes in real-world deployments.
Today, I took a deeper dive into two foundational components of EC2 instance management: Amazon Machine Images (AMI) and EBS Snapshots. These tools are essential not just for launching and replicating instances, but also play a crucial role in automation, scaling applications efficiently, creating consistent environments across deployments, and ensuring reliable backups and disaster recovery strategies in cloud infrastructure.
AMI: Amazon Machine Image
An Amazon Machine Image (AMI) is a pre-configured virtual machine template used to launch EC2 instances in AWS. It serves as a blueprint for creating instances with specific operating systems, software, settings, and configurations.
An AMI includes:
A root volume image (usually an EBS snapshot) with:
The operating system (e.g., Amazon Linux, Ubuntu, Windows)
Any installed applications or packages
System settings and file configurations
Launch permissions: Controls who can use the AMI (just you, or shared with others, or made public).
Block device mapping: Defines volumes (EBS or instance store) that will be attached to the instance at launch.
Where Is the AMI Stored?
AMI data is stored in Amazon S3 (behind the scenes by AWS, you don't manage it directly).
EBS-backed AMIs store snapshots in Amazon EBS.
When you create an AMI from an instance, AWS takes a snapshot of its EBS volumes and stores the metadata (like OS type, architecture, permissions) to define the image.
Why Is AMI Important?
Quick instance creation: Launch multiple identical EC2 instances.
Auto Scaling: Use AMIs in launch templates for scaling fleets.
Disaster recovery: Rebuild systems quickly from saved AMIs.
Environment consistency: Ensure uniform infrastructure across dev, staging, and production.
How to Create an AMI from an EC2 Instance
Select your EC2 instance
Go to Actions > Image and templates > Create image
Provide image name and description
Choose whether to reboot during creation
Click Create Image
Your AMI will now be listed under the AMIs tab and can be used to launch new EC2 instances.
Snapshot
A Snapshot in AWS refers to a backup of an Amazon EBS volume, captured at a specific point in time. It allows you to save the state of your data and restore or clone that data later, making it a core part of backup, disaster recovery, and AMI creation.
What Does a Snapshot Contain?
All data from the volume at that moment
If it's a root volume, it includes OS files, application data, configurations, etc.
Metadata like volume ID, size, and time of creation
Where Are Snapshots Stored?
Snapshots are stored in Amazon S3 (managed by AWS, not in your S3 bucket).
You can view and manage them in the EC2 console under Snapshots or via the AWS CLI.
Why Use Snapshots?
Backup & restore: Recover your data in case of accidental deletion or system failure.
Create AMIs: AMIs are built using snapshots of root volumes.
Clone volumes: Launch a new volume (and instance) with the same data/state.
Region-to-region copy: Snapshots can be copied to other regions for DR.
Typical Use Cases
Taking regular backups of EC2 volumes
Saving system state before making major updates
Creating golden images for teams
Migrating environments between AWS regions
How to Create a Snapshot
Go to EC2 Dashboard
Open the Volumes section under "Elastic Block Store"
Choose your volume and click Actions > Create Snapshot
Add a description and click Create Snapshot
Find your snapshot under the Snapshots section
You can automate snapshot creation using Lifecycle Manager.
Final Thoughts
Understanding AMIs and EBS Snapshots is essential for any DevOps engineer working in the cloud. They support automation, backup, scaling, and disaster recovery, helping maintain reliable and consistent infrastructure. AMIs enable quick deployment of identical EC2 instances, while Snapshots secure your data for future restoration.
Tomorrow, I’ll be exploring Elastic Load Balancers (ELB) and how they efficiently distribute traffic to ensure high availability.
Stay tuned for Day 72 of the #90DaysOfDevOps challenge!
Subscribe to my newsletter
Read articles from Vaishnavi D directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
