EC2 Instance Storage
1. What’s an EBS volume?
Section titled “1. What’s an EBS volume?”An EBS (Elastic Block Store) volume is a network drive you can attach to your instances while they run.
- It allows your instances to persist data, even after their termination.
- They can only be mounted to one instance at a time (at the Cloud Practitioner level).
- They are bound to a specific Availability Zone.
- Analogy: think of them as a “network USB stick”.
Going a level deeper:
- It’s a network drive, not a physical drive — it uses the network to communicate with the instance, so there may be a bit of latency.
- It can be detached from one EC2 instance and attached to another quickly.
- It’s locked to an Availability Zone: an EBS volume in
us-east-1acannot be attached to an instance inus-east-1b. To move a volume across, you first need to snapshot it. - It has provisioned capacity (size in GB, and IOPS). You get billed for all the provisioned capacity, and you can increase the capacity of the drive over time.
2. Delete on Termination attribute
Section titled “2. Delete on Termination attribute”This attribute controls the EBS behaviour when an EC2 instance terminates.
- By default, the root EBS volume is deleted (attribute enabled).
- By default, any other attached EBS volume is not deleted (attribute disabled).
- It can be controlled through the AWS Console or the AWS CLI.
- Use case: preserve the root volume when the instance is terminated.
3. EBS Snapshots
Section titled “3. EBS Snapshots”A snapshot is a backup of your EBS volume at a point in time.
- It is not necessary to detach the volume to take a snapshot, but it is recommended.
- You can copy snapshots across AZ or Region — which is exactly how a volume gets moved.
Snapshot features
Section titled “Snapshot features”- EBS Snapshot Archive — move a snapshot to an “archive tier” that is 75% cheaper; restoring from the archive takes 24 to 72 hours.
- Recycle Bin for EBS Snapshots — set up rules to retain deleted snapshots so you can recover them after an accidental deletion; you specify a retention period from 1 day to 1 year.
4. AMI — Amazon Machine Image
Section titled “4. AMI — Amazon Machine Image”- An AMI is a customization of an EC2 instance: you add your own software, configuration, operating system, monitoring and so on.
- Faster boot / configuration time, because all your software is pre-packaged.
- AMIs are built for a specific Region — and can be copied across Regions.
You can launch EC2 instances from:
- A Public AMI — AWS provided.
- Your own AMI — you make and maintain them yourself.
- An AWS Marketplace AMI — an AMI someone else made (and potentially sells).
The AMI process, from an EC2 instance
Section titled “The AMI process, from an EC2 instance”- Start an EC2 instance and customize it.
- Stop the instance (for data integrity).
- Build an AMI — this will also create EBS snapshots.
- Launch instances from that AMI — including in another AZ.
5. EC2 Image Builder
Section titled “5. EC2 Image Builder”- Used to automate the creation of Virtual Machines or container images.
- Automates the creation, maintenance, validation and testing of EC2 AMIs.
- Can be run on a schedule — weekly, whenever packages are updated, and so on.
- It is a free service — you only pay for the underlying resources.
The flow: EC2 Image Builder creates a Builder EC2 instance, applies build components (customizing the software on the instance), creates a new AMI, launches a Test EC2 instance to run a test suite (is the AMI working, secure?), and then distributes the AMI — potentially to multiple Regions.
6. EC2 Instance Store
Section titled “6. EC2 Instance Store”EBS volumes are network drives with good but “limited” performance. If you need a high-performance hardware disk, use EC2 Instance Store.
- Better I/O performance — very high IOPS, because the disk is physically attached to the host.
- EC2 Instance Stores lose their storage if the instance is stopped — they are ephemeral.
- Good for buffer / cache / scratch data / temporary content.
- Risk of data loss if hardware fails.
- Backups and replication are your responsibility.
7. EFS — Elastic File System
Section titled “7. EFS — Elastic File System”- A managed NFS (network file system) that can be mounted on 100s of EC2 instances.
- Works with Linux EC2 instances, in multi-AZ.
- Highly available, scalable, expensive (3x gp2), pay per use, no capacity planning.
EBS vs EFS
Section titled “EBS vs EFS”| EBS | EFS | |
|---|---|---|
| Attachment | One instance at a time | 100s of instances |
| Scope | One Availability Zone | Multi-AZ, via mount targets in each AZ |
| Moving across AZ | Snapshot and restore | Not needed — it already spans AZs |
| Capacity | Provisioned, and billed for what’s provisioned | No capacity planning, pay per use |
EFS Infrequent Access (EFS-IA)
Section titled “EFS Infrequent Access (EFS-IA)”- A storage class cost-optimized for files not accessed every day.
- Up to 92% lower cost compared to EFS Standard.
- EFS automatically moves your files to EFS-IA based on the last time they were accessed.
- Enabled with a Lifecycle Policy — for example, move files not accessed for 60 days to EFS-IA.
- Transparent to the applications accessing EFS.
8. Shared Responsibility Model for EC2 Storage
Section titled “8. Shared Responsibility Model for EC2 Storage”| AWS | You |
|---|---|
| Infrastructure | Setting up backup / snapshot procedures |
| Replication of data for EBS volumes and EFS drives | Setting up data encryption |
| Replacing faulty hardware | Responsibility for any data on the drives |
| Ensuring their employees cannot access your data | Understanding the risk of using EC2 Instance Store |
9. Amazon FSx
Section titled “9. Amazon FSx”Amazon FSx lets you launch third-party high-performance file systems on AWS, as a fully managed service. The three in the deck: FSx for Lustre, FSx for Windows File Server, and FSx for NetApp ONTAP.
FSx for Windows File Server
Section titled “FSx for Windows File Server”- A fully managed, highly reliable and scalable Windows native shared file system.
- Built on Windows File Server.
- Supports the SMB protocol and Windows NTFS.
- Integrated with Microsoft Active Directory.
- Can be accessed from AWS or from your on-premises infrastructure.
FSx for Lustre
Section titled “FSx for Lustre”- A fully managed, high-performance, scalable file storage for High Performance Computing (HPC).
- The name Lustre is derived from “Linux” and “cluster”.
- Use cases: machine learning, analytics, video processing, financial modeling.
- Scales up to 100s GB/s, millions of IOPS, sub-millisecond latencies.
- Can be linked to Amazon S3, and reached from compute instances in the Region or from a corporate data center.
Quick recap
Section titled “Quick recap”| Concept | What to remember for the exam |
|---|---|
| EBS volume | Network drive attached to one EC2 instance at a time, mapped to one Availability Zone, provisioned capacity, billed on what’s provisioned |
| Delete on Termination | Enabled for the root volume by default, disabled for other attached volumes |
| EBS Snapshots | Point-in-time backup; the way to move a volume across AZ or Region |
| Snapshot Archive / Recycle Bin | Archive is 75% cheaper with a 24–72 hour restore; Recycle Bin retains deleted snapshots for 1 day to 1 year |
| AMI | Ready-to-use image with your customizations; Region-specific, copyable across Regions; Public, your own, or Marketplace |
| EC2 Image Builder | Automatically build, test and distribute AMIs on a schedule; free service, pay only for the underlying resources |
| EC2 Instance Store | High-performance hardware disk on the host; ephemeral — lost if the instance is stopped or terminated |
| EFS | Managed NFS for 100s of Linux instances across multiple AZs; no capacity planning; about 3x the price of gp2 |
| EFS-IA | Cost-optimized class for infrequently accessed files, up to 92% cheaper, driven by a Lifecycle Policy |
| FSx for Windows | Managed Windows shared file system — SMB, NTFS, Active Directory |
| FSx for Lustre | Managed HPC Linux file system — 100s GB/s, millions of IOPS, links to Amazon S3 |