EC2 Basics Flashcards
Virtualization
The process of running more than one OS on a piece of physical hardware
What is an EC2 Instance ?
virtual machines (os + Resources)
Ec2 Host
where the EC2 instance runs from shared Host or dedicated Hosts
Name at least 3 things EC2 instances are good for ?
traditional os and application compute
long-runing computer
server style applications
either burst or steady-state loads
monolithic applications statcks
migration application or disaster recovery
EC2 Categories and When they would be used?
General Purpose - Default Diverse workloads, equal resource ratio
computer optimized - Media processing, HPC, scientific modeling, gaming, Machine Learning
Memory optimized - Processing Large in-memory datasets, some database workloads
Accelerated Computing - Hardware GPU, field programmable gate array(FPGAs)
storage optimized - sequential and random 10- scale-out transactional databases, data warehousing, Elastic Search, analytics workloads
Direct(Local) attached Storage on EC2 instance
attached storage on EC2 Host
cons if the disk,hardware,dails the storage can be lost if the EC2 instances moves between Host the storage can be lost
pros really fast
Network attached storage
EBS volumes delivered over network
highly resilient and separate from the instance hardware
Ephemeral storage
Temporary storage
Persistent Storage
Permanent storage - lives on past the lifetime of the instance
Block storage Volume
presented to the os as a collection of block no structure provided it can be mounted and os can be booted from it
File storage
presented as a file share has structure mountable but not bootable
Object storage (S3)
collection of objects flat not mountable not bootable
How is storage performance calculated?
IO x IOPS = Throughput
Block Storage
raw disk allocation (volume) can be encrypted using KMS
What does an EC2 instance do with a block storage device
instances see block device and create file systems on the device
What is the resiliency of EBS volumes ?
EBS is provisioned in one AZ and resilient in that AZ
When an EC2 instance is terminated is the EBS volume attached to that instance terminated ?
EBS is not lifecycle linked to one instance it’s persistent
And EC2 instance was terminated with an EBS volume and not you want to replace that instance could the volume be attached to the new instance?
yes EBS volumes can be detached and rethatched to any instance
How is EBS volumes billed ?
billed based on GB-month (and some cases performance)
Names all the EBS Volume Types
EBS - General Purpose SSD GP2
EBS-General Purpose SSD GP3
EBS-Provisioned IOPS SSD (iO1 /2 )
EBS- HDD-based
Instance Store Volumes
temporary block storage device that is physically connected to one EC2 Host instance on that host can access them highest storage performance in AWS included with instance price attached at launch
What would cause loss of Data in an EC2 instance attached to an instance store ?
if an EC2 instance moves between hosts
if the instance is stopped and started , or if instance type is changed, or hardware failure
Types of EC2 instances with instance store ?
D3 - 4.6gb/s throughput
i3 - 16gb/second of sequential throughput
more IOPs and throughput vs EBS
If persistence is a priority what would you choose Instance store vs EBS
EBS
If resilience is a priority what would you choose Instance store vs EBS
EBS
If you want your storage to be isolated from instance lifecycle what would you choose Instance store vs EBS
EBS
If you wanted resilience within application and in-built replication what would you choose Instance store vs EBS
it depends
If High Performance is a priority what would you choose Instance store vs EBS
it depends
If super high performance is needed what would you choose Instance store vs EBS
instance store
If cost is a priority what would you choose Instance store vs EBS
instance store because it’s included with the instance
What EBS volumes would you use if cost was priority ?
EBS HDD STI or SCI
What EBS volumes would you use if you need to boot EC2 instance from that volume is ?
Not ST1 or SC1
your not able to boot EC2 instances from EBS HDD based volumes
Max performance for GP 2/ 3
16,000 IOPS
Max performance for IO 1/ 2
up to 64,000 or 256,000 if using IO2 block express with a larger instance type
RAID0 set plus EBS Max performance
you can combines EBS volumes and create a RAID0 set which could give you a combined performance for up tp 260,00 IOPs (IO 1/ 2 - BE/GP 2/ 3)
What options would you have if your need more performance that 260,000 IOPS
instance store
Explain How EBS snapshots work ?
snapshots are incremental volumes copies to s2
the first is full copy of ‘data on the volume ’
future snaps are incremental
What is the biggest benefit of EBS snapshot
volumes can be create (restored) from snapshots
How would you create a volume from a snapshot in a different region than where you created the snapshot ?
snapshots can be copied to another region
You just created an EBS volume snapshot and shortly after your EC2 instance failed would you be able to restore that instance with the snapshot you created ? if yes how is this done and how is performance effected?
yes, your snapshot would be available but snaps are restore lazily fetched gradually
which could cause degrade performance because they are return from s3 bucket until they are requested then they are restored
requested blocks are fetched immediately you could perform a force read of all data immediately via OS using DD
How would you perform an immediate restore from a EBS snapshot?
Fast snapshot Restore(FSR)
Is there any limit to how many snapshots you can create ?
up to 50 snaps per region
How are Snaps shots billed ?
GB per month charge and you are charged for used data not allocated data
How can you remove the encryption from an encrypted EBS volume ?
you can’t but you can in theory mount an non-Encrypted volume to the same instance and copy that data across but you can’t unencrypted an EBS Volume once encrypted
Is there any performance loss when an EBS volume is encrypted
os isn’t aware of the encryption so there is no performance loss
Could you enable encryption on all EBS volumes ?
yes, accounts can be sett to encrypt by default which would user default CMK or chosen CMK
You have two volumes on which you enabled encryption on would they use the same data encryption Key (CMK)?
no Each volume has it’s own unique DEK
If you have a Encrypted EBS Volume and make a snapshot or restore from a snap shot would the resulting EBS volume or snapshot use the same key as the original Encrypted EBS Volume ?
yes they would use the same DEK
Elastic Network Interface
What security groups, mac address and IPS are attached to controls networking
Amazon Machine Image (AMI)
A template for launching EC2 instances
Does an AMI contain the boot volumes to be used in an Instance ? and if so How is it store the data ?
No, AMI contain a reference to snapshots that are created from the original EBS volumes. AMI doesn’t contain any data themselves they can be considered a container.
Can you create an AMI in one region and use it in another ? If Not how can you?
no, AMI are region linked only works in the region it was created. But they can be copied from one region to another.
It possible to change an AMI once it’s been created ? and if not how can you?
An AMi can’t be edited you can launch an instance and update configuration and make a new AMI
Defualt permissions for AMI ?
just your account
What is the cost for an AMI?
the snapshots that were created when creating AMI
EC2 Purchase option -On Demand
Per-second billing while instance is running. Resources like storage consumed capacity and disk are billed regardless of instance state.
What are EC2 Purchase option -On Demand good for ?
short term Workloads, unknown workloads and Apps which can’t be interrupted
EC2 Purchase option -Spot
spot pricing is AWS selling unused EC2 host capacity for up to 90% discount spot prices is based on the spare capacity at a given time
when would you use EC2 Purchase option -Spot
non- time critical anything which can be rerun bursty capacity needs cost sensitive workloads anything which is stateless.
EC2 Purchase option - Reserved
Reservations are for 1 year or 3 year terms, you pay for the entire term.
3 Payment options :
Partial Upfront Reduced per/s fee
All UpFront means no per second fee
EC2 Purchase option - Dedicated Hosts
No Instance Charge you pay for Host
capacity management required.
EC2 Purchase option- Dedicated Instances
You don’t own, or share the host. Extra charges for instances, but dedicated hardware.
You have a business that requires and EC2 instance to be continuously running how can you safe guard that EC2 instance ?
shutdown, Terminate & Termination Protection
What are the two status checks that run on an EC2 instance ?
system status check
Instance status check
Vertical Scaling
moving to a bigger instance
each resize would require a reboot
Horizontal Scaling
adding more instances
requires application support or off-host sessions
Instance Metadata
Ec2 service provides data to instance
accessible inside all instances
address for accessing EC2 meta-data
https://169.254.169.254