Section 6: EC2 Instance Storage
Table of contents
- EBS Overview
- What is EBS volume
- EBS volume
- EBS - Delete on Termination attribute
- EBS Snapshots
- EBS Snapshots Feature
- AMI Overview
- AMI process (from EC2 instance)
- EC2 image builder
- EC2 Instance Store
- EFS - Elastic File System
- EFS Infrequent Access (EFS-IA)
- Shared Responsibility Model for EC2 Storage
- Amazon FSx - Overview
- EC2 Instance Storage - Summery
- Extra
- Quiz
Disclaimer: This blog is a quick rundown of the theory for the AWS Certified Cloud Practitioner (CCP) exam. I’d recommend hands-on practice to really get the hang of things! Hands-on experience is highly recommended
EBS Overview
What is EBS volume
Elastic Block Storage volume is a network drive you can attach to your instance while they run
It allows your instance to persist (preserve) even after termination
EBS is bound to an availability zone
It can be attached/mounted on one instance at a time (at the CCP level)
Analogy: You can think it of an virtual USB connector
FREE TIER: 30GB of free EBS storage of type GENERAL PURPOSE (SSD) or Magnetic per month
EBS volume
It’s a network drive (i.e. not a physical one)
It uses the network to communicate the instance, it means there could be a little bit of latency
It can be detached from an instance and attached to another instance quickly
It is locked to an Availability zone (AZ)
An EBS volume in us-east-i a cannot be attached to another instance in us-east-i b
But to do so, you have to snapshot it first
Have a provisioned capacity (size in GBs and IOPS)
You get billed for all the provisioned capacity
You can increase the capacity of the drive over time
EBS - Delete on Termination attribute
When we create an EBS volume through EC2 instances, there is a thing called Delete on Termination attribute (this can come up in thee exam)
Column term: Delete on termination
By default it is ticked for the root volume, not ticked for an EBS volume
This controls the EBS behavior when a EC2 instance terminates.
By default, the root EBS volume is deleted (attribute disabled)
By default, any other attached EBS volume is not deleted (attribute disable)
This can be controlled by AWS console / AWS CLI
Use case: preserve root volume when instance is terminated
EBS Snapshots
Make a backup (snapshot) of your EBS volume at a point in time
Not necessary to detach volume to do snapshot. but recommended
Can copy snapshots acorss AZ or region
EBS Snapshots Feature
EBS Snapshot Archive
Move a snapshot to an archive tier that is 75% cheaper
Takes within 24 to 72hrs for restoring the archive
Recycle Bin for EBS Snapshots
Setup rules to retain deleted snapshots so you can recover them after an accidental deletion
Specify retention (from 1 day to 1yr)
AMI Overview
AMI - Amazon Machine Image
AMI are customization of an EC2 instance
you add your own software, configuration, operating system, monitoring….
Faster boot/ configuration time because all your software is pre-packed
AMI 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 yourself
An AWS marketplace AMI: an AMI someone else made (and potentially sells)
AMI process (from EC2 instance)
Start an EC2 instance and customize it
Stop the instance (for data integrity)
(we can) Build and AMI - this will also create EBS snapshots
(we can) Launch instances from other AMIs
EC2 image builder
[Exam]
Used to automate the creation of Virtual Machines or container images
\=> Automate the creation, maintain, validate and test EC2 AMIs
Can be run on a schedule (weekly, whenever packages are updated)
Free service (only pay for the underlying resources)
EC2 image builder → Builder EC2 instance(customize software on instance) → new AMI → Test EC2 instance (is the AMI working, secure?) → AMI is distributed(can be multiple regions)
EC2 Instance Store
- EBS volumes are network drives with good but “limited” performance
But, if you need a high performance hardware disk, use EC2 Instance store
Better I/O performance
EC2 Instance Store lose their storage if they’ve stopped (ephemeral)
Good for buffer/cache/ scratch data/ temporary content
Risk of data loss if hardware fails
Backups and replications are your responsibility.
EFS - Elastic File System
Fully Managed NFS (network file system) that can be mounted on 100s of EC2
EFS works with Linux EC2 instances in multi AZ
Highly available, scalable, pretty expensive (3x gp2), pay per use, no capacity planning
Amazon EFS is a fully managed service that makes it easy to set up, scale, and cost-optimize file storage in the Amazon Cloud.
EFS Infrequent Access (EFS-IA)
Storage class that is cost-optimized for files which are not often accessed
Up to 92% lower cost compared to EFS standards
EFS will automatically move your files to EFS-IA based on the last time they were accessed
Enabled EDS-IA with a lifecycle policy
Example: move files that are not accessed for 60 days to EFS-IA
Transparent to the applications accessing EFS
Shared Responsibility Model for EC2 Storage
AWS
Infrastructure
Replication for data for EBS volumes and EFS drives
(so one day if the hardware not working, you are not affected)
Replacing faulty hardware
Ensuring their employees cannot access your data
YOU
Setting up backup/snapshot procedures (don;t loose your data)
Setting up data encryption (so that people can’t have access to your data, 2nd layer security)
Responsible of any data on the drives (whatever you write is your responsibility)
Understanding the risk of using EC2 Instance Store (you can loose the drive due to faulty hardware/ terminate the instance with instance store. It is your responsibility to back it up in the first place)
Amazon FSx - Overview
If you don’t wanna use EFS or S3, you want something else, then you can use FSX
Launch 3rd-party high performance file system on AWS
Fully managed service
FSx for Lustre, FSx for Windows File Server, FSx for NetApp ONTAP
Amazon FSx for Windows File Server
A fully managed, highly reliable, and scalable Windows native shared file system
Built on Windows File Server (meant for windows instances only)
Supports SMB protocol and Windows NTFS (it allows you to mount this file system on your windows machines)
Integrated with Microsoft Active Directory (cause it’s a Microsoft offering)
Can be accessed from AWS or your on-premise infrastructure
Amazon 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 Modelling…..
Scales extremly high traffic, upto 100s GB/s. millions of IOPS, sub-ms latencies
It’s really a high performance file system. So the way it works is that Amazon FSx for Lustre. You can connect to your corporate data center or directly to your compute instances within AWS. In the background, Amazon FSx for Lustre stores your data, possibly in an Amazon S3 bucket. That's all you need to know about Amazon FSx. There's no simple hands-on exercise for it, so we'll skip that. Just remember the two types of Amazon FSx for the exam.
EC2 Instance Storage - Summery
EBS volume
network drives attached to one EC2 instance at a time
Mapped to and AZ
Can use EBS snapshots for backups/ transferring EBS volumes across AZ
AMI: create ready-to-use EC2 instances with out customizations
EC2 Image Builder: automatically build, test and distribute AMIs
EC2 Instance Store:
High performance hardware disk attached to our EC2 instance
Lost if our instance is stopped/terminated
EFS: network file ststem, can be attached to 100s of instances in a region.
EFS-IA: cost optimized storage class for infrequent accessed files
FSx for Windows: Network File System for windows server
FSx for Lustre: High Performance Computing Linux file system
Extra
EBS Snapshots are backup of your EBS volume at a point in time, not a shared network file system.
EC2 Image Builder is an automated pipeline for the creation, maintenance, validation, sharing, and deployment of Linux or Windows images for use on AWS and on-premises.
Quiz
Subscribe to my newsletter
Read articles from Fatima Jannet directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by