EC2 Instance Storage Flashcards
What is an EBS
Elastic Block Store
EBS Volume is a network drive you can attach to your EC2 instance while they run
What does an EBS allow?
For instance data to persist after termination
In how many instances can EBS volumes be attached at the same time?
Only one
Are EBS bound to specific AZ?
Yes
EBS Analogy?
Network USB stick
Why is there latency for an EBS volume?
Because it is a network drive
Benefit of using an EBS volume and many EC2 instances?
Can detach & attach quickly to different EC2
Downside of EBS in regard to AZ?
They are locked to 1 AZ at a time.
If you want to move it to another AZ you need to snap shot it and use the snap shot
How do you get billed for EBS volumes?
Provisioned Capacity (size in GBs & IOPS)
Can increase capacity over time
EBS and different EC2
Cannot attach 1 EBS to 2 instances at a time but can attach 2 EBS to 1 instance.
Do EBS have to be attached?
No, they can remain unattached
Delete on Termination attribute
Root volume is deleted by default when EC2 is terminated.
Any other EBS (other than root) is not
EBS Snapshot
Backup at point in time
Can you copy snapshots across AZ or Regions?
Yes
How do you transfer an EBS volume from one AZ or Region to another?
Snapshot it first
What is EBS Snapshot Archive?
You archive your snapshot (tier) and it is 75% cheaper
How long does EBS Snapshot Archive take to restore?
24 to 72 hours
What is Recycle Bin for EBS Snapshots
Rule to retain deleted snapshots for recovering them later
How long can you retain EBS Snapshots in Recycle Bin?
1 day to 1 year
What is Fast Snapshot Restore (FSR)
Force full initialisation of snapshot to have no latency on first use ($$$)
When do you use Fast Snapshot Restore (FSR)?
If your snapshot it big and it takes time to initialise
What does AMI mean?
Amazon Machine Image
What is an AMI?
Customisation of an EC2 instance
What can you control with AMI?
OS, config, monitoring
What are some benefits of using an AMI when building an EC2 machine?
Faster boot / config time - everything is pre packaged
What do you do if you want to move an AMI across region?
First you create it to a specific region, and then copy it across another region
Which AMI can you lunch instances from?
Public AMI (AWS Provided)
Own AMI (make and maintain it)
Marketplace AMI (someone else made it)
AMI Process (from EC2)
Start EC2 and customise it
Stop instance
Build AMI - creates EBS snapshots
Lunch instance from other AMI
What is EC2 Instance Store?
It is a physical storage drive that can be attached to your EC2’s physical hardware
What is EBS performance?
It is limited
Which storage do you use if you want high performance?
EC2 Instance Store
Unlike EBS (Elastic Block Store) what happens to EC2 Instance store when the instance is terminated?
It loses all their storage (ephemeral)
The physical drive gets detached and released so it can be attached to a new EC2 instance
Good use case for EC2 Instance Store?
Buffer
Cache
Scratch data
temporary content
Which is better for longterm storage? EBS or EC2 instance store?
EBS
What is a risk that EC2 instance store has?
Data loss if hardware fails
How many types of EBS are there?
6
What are gp2 / gp3 (SSD) EBS volumes used for?
General purpose SSD volume that balances price and performance a wide variety of workload
What are io 1 / io2 (SSD) EBS volumes used for?
Highest-performance SSD volume for mission-critical low-latency or high-throughput workloads
What is st 1 (HDD) EBS volume used for
low cost HDD volume designed for frequently accessed, throughput-intensive workload
What is sc 1 (HDD) EBS volume used for
lowest cost HDD volume designed for less frequently accessed workloads
What are EBS Volumes characterised in?
Size
Throughput
IOS (I/O Ops Per Sec)
Which EBS volume types can be used as boot volumes?
gp2/gp3 & io1/io2 ONLY
gp2/gp3 use cases
Coste efective storage, low-latency
System boot volumes, VMs, Dev and test env
Storage size of gp2/gp3
1 GiB - 16 TiB
What is the baseline of IPS and throughput of gp3?
3000 IOPS and 12 MiB/s throughput
How high can IOPS and Throughput go for gp3?
16000 IOPS, and 1000 MiB/s throughput
What is the baseline of IPS and throughput of gp2?
3000
Is size of volume and IOPS linked or independent for gp2?
Linked, with max IOPS of 16000
what does 3 IOPS per GB mean at 5,334 GB for gp2?
max IOPS it can do
What are provisioned IOPS used for?
Critical business applications with sustained IOPS performance
When do you use provisioned IOPS ?
apps that need more than 16000 IOPS
What are Provisioned IOPS great for?
database workloads (sensitive to storage performance and consistency)
io 1 / io2 Gib - Tib?
4 GiB to 16 TiB)
Max PIOPS for io1/io2?
64000 for Nitro EC2 instances & 32000 for other
Can you increase PIOPS independently from storage size?
Yes
Why would you prefer io2?
more durable and more IOPS per GiB at same price of io1
io2 Block Express (4 GiB - 64 TiB) benefits
sub millisecond latency
Max PIOPS for io2 block express?
256,000 with an IOPS:GiB ratio of 1,000:1
EBS Volume Types support EBS Multi-Attach (Provisioned IOPS)
True
What can st 1 and sc1 not be?
boot volumes
size of st 1 & sc 1?
125 GiB to 16TiB
What are st 1 best used for
Big data, data warehouses, log processing
Max throughput of st1?
500 MiBs with max IOPS of 500
What is sc1 used for
data infrequently accessed
Best scenario for sc1?
lower cost is important
max throughput of sc1?
250 MiB/s - max IOPS 250
What is EBS Multi-Attach?
Allows to attach same EBS volume to multiple EC2 instances in the same AZ
Which instance family does EBS multi-attach use?
io 1 / io2
What does EBS-Multi attach offer to the instances it is connected to?
full read/write permissions to the high-perf volume
What are EBS-Multi attach use cases?
High App Availability in clustered Linux applications
Do applications that use EBS-Multi attach must manage concurrent write operations?
Yes
What is the concurrent Instance limit for an EBS Multi-Attach?
16 EC2 instances at a time
What does the file system have to be in order to use EBS Multi-attach?
Cluster-aware
What do you get when you encrypt an EBS volume?
Data at rest/transit encryption
Snapshot encryption
Volumes created from snapshot are encrypted
Do you have to do anything to encrypt/decrypt an EBS volume?
No, it is handled transparently.
What keys does Encryption of EBS leverage from?
KMS (AES-256)
KMS = Key Management Service
What happens when you copy an unencrypted snapshot?
If you create a snapshot from an unencrypted EBS it will also be unencrypted.
You can encrypt it after it is created by copying it
Are snapshots of encrypted volumes encrypted?
Yes
How do you encrypt and unencrypted EBS volume?
- Create EBS snapshot
- Encrypt EBS snapshot (using copy)
- Create new EBS volume from snapshot (volume will also be encrypted
- Attach encrypted volume to original instance
What is EFS?
Elastic File System and it is an NFS (Network File System)
What is a managed NFS?
EFS is a network file system. It can be mounted on many EC2 instances in multi AZ
What can you do with EFS that you cannot do with EBS multi-attach?
It can work with EC2 instances in multi-AZ
Benefits of using EFS?
Highly available
Scalable
Downside of using EFS?
Expensive (3x gp2)
Do you have to plan the capacity of EFS in advance?
No - You pay per use
EFS use cases
Content Management, web serving, data sharing, Wordpress
Uses NFSv4.1 protocol
How do you control access to EFS?
Security Group
What OS is EFS compatible with?
Linux
How can you encrypt EFS at rest?
Using KMS (Key Management System)
What is the scale of EFS?
1000s of concurrent NFS (Network File System) clients
10GB+/s throughput
What are the performance modes of EFS?
General Purpose (default)
Max I/O
What is the General Purpose (default) EFS performance mode used for?
latency-sensitive use cases (web server, CMS)
What is the Max I/O EFS performance mode used for?
higher latency/throughput, highly parallel (big data, media processing)
What are the throughput modes that EFS can provide?
Bursting
Provisioned
Elastic
What does Bursting throughput mode of EFS include?
1 TB = 50MiB/s + burst up to 100MiB/s
What does Provisioned throughput mode of EFS include?
set your throughput regardless of storage size, e.g. 1 GiB/s for 1TB storage
What does Elastic throughput mode of EFS include?
automatically scales throughput up or down based on your workloads
up to 3GiB/s reads and 1GiB/s writes
used for unpredictable workloads
What is Elastic Throughput Mode of EFS used for?
Unpredictable workloads
What are Storage Tiers?
It is a lifecycle management feature - move file after N days
What are the different storage tiers types?
Standard and Infrequent Access
What is the Standard storage tier of EFS for?
Frequently accessed files
What is the Infrequent Access (EFS-IA) EFS storage tier for?
less frequently accessed files
How do you get charged for EFS-IA?
per file retrieval
lower price to just store but charges you when your retrieve files
What is a Lifecycle policy?
Allows you to set rules for files that have not been accessed in a while
EFS-IA architecture example
You have a file in EFS standard that have not been accessed for 60 days. LifeCycle Policy moves it to EFS IA
What do you need to enable EFS-IA?
Lifecycle Policy
Options of Availability and Durability for EFS?
Regional - Multi-AZ for prod
One Zone - One AZ great for dev back up enabled by default. Compatible with IA (EFS One Zone-IA)
What is the cost of using EFS?
Over 90% in cost saving
What is the cost of using EFS?
Over 90% in cost saving
What does EFS need in regard to Security Groups?
It needs its own Security Group
EBS - How many instances can you connect one EBS?
one instance except if the type is io 1/ io2, then you can multi attach
Can you connect an EBS in AZ1 to an instance in AZ2?
No - locked in AZ
What happens to the IO of gp2 EBS if the disk size increases?
It also increases
Which EBS type can you increase IO and Size independently?
io 1
How do you migrate EBS volume across AZ?
Snapshot
Restore to another AZ
EBS backups use IO and you shouldn’t run them while your app is handling a lot of traffic
What happens to Root EBS volumes when instance is terminated?
They get deleted, by default but can be disabled
What can you benefit from when using EFS (AZ)
Can be mounted across 100s of instances across the multiple AZ
What do EFS share?
Website files (word press)
What instances is EFS for?
Only for Linux (POSIX)
Which is more expensive, EFS or EBS?
EFS
How can you make EFS cheaper?
EFS-IA for cost savings
EFS vs EBS vs Instance Store
EFS - ENS, multiple EC2 across AZ
EBS - one EC2 and AZ bound (can use multi attach in io 1/2)
Instance Store - temporary gets deleted with instance termination
Are AMI region locked?
Yes
What can you do if you have an AMI in region 1 and want to launch it in region 2?
Copy the AMI and then launch instances from there
Which volume provides the highest IOPS?
Instance Store