EC2 - EC2 101 Flashcards

1
Q

Amazon EC2 is…

A

…a web service that provides resizable compute capacity in the cloud

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

EC2 reduces the time required to obtain and boot new server instances to…

A

…minutes, allowing you to quickly scale capacity, both up and down, as your computing requirements change

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

EC2 changes the economies of computing by…

A

…allowing you to pay only for the capacity that you actually use

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

EC2 provides developers the tools to…

A

…build failure resilient apps and isolate themselves from common failure scenarios

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

EC2 pricing options

A

On Demand, Reserved, Spot, Dedicated Hosts

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

On Demand

A

allow you to pay a fixed rate by the hour with no commitment.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

On Demand use case example

A

If you’re a startup, you can pay for instances by the hour with no long term commitment for experimentation, terminate instances when you are complete.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Reserved

A

provide you with a capacity reservation, and offer a significant discount on the hourly charge for an instance. 1-year or 3-year terms

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Reserved use case example

A

If you need a minimum of 2 webservers to serve your customers

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Spot

A

enable you to bid whatever price you want for instance capacity, providing for even greater savings if your apps have flexible start and end times. engineering, pharma companies use these

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

If bid price > spot price…

A

…instances can be provisioned

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

If spot price > bid price…

A

…instances will be terminated

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Dedicated Hosts

A

physical EC2 server dedicated for your use (hourly rate). Dedicated hosts can help you reduce costs by allowing you to use your existing server-bound software licenses

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

On Demand Use Cases

A

Users that want the low cost and flexibility of EC2 without any up-front payment or long-term commitment

Apps with short term, spiky, or unpredictable workloads that cannot be interrupted

Apps being developed or tested on EC2 for the first time

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Reserved Use Cases

A

Apps with steady state or predictable usage

Apps that require reserved capacity

users able to make upfront payments to reduce their total computing costs even further

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Example of combining reserved + on demand instances

A

2 webservers = reserved. Need more for Black Friday = on demand

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

Spot Use Cases

A

Apps that have flexible start and end times

Apps that are only feasible at very low compute prices

Users with urgent computing needs for large amounts of additional capacity

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

Spot Use Case Examples

A

Large pharma company saves money by using compute capacity during very low demand times

Large world events, e.g. Brexit, analysts need to find solutions really quickly

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

Dedicated Hosts Use Cases

A

Useful for regulatory requirements that may not support multi-tenant virtualization

Great for licensing which does not support multi-tenancy or cloud deployments (e.g. Microsoft, SQL, Oracle)

Can be purchased on demand (hourly)

can be purchased as a reservation for up to 70% off the on-demand price

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

Termination of Spot Instances - EXAM TIP

A

If the spot instance is terminated by Amazon EC2, you will not be charged for a partial hour of usage. However, if you terminate the instance yourself, you will be charged for any hour in which the instance ran

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

Instance Types

A
D = Dense
R = Memory-optimized (RAM)
M = General Purpose (main choice)
C = Compute-optimized
G = Graphics-Intensive
I = High Speed Storage (I/O)
F = Field Programmable Gate Array
T = Lowest Cost, General Purpose (t2 micro)
P = Graphics/General Purpose CPU (pics)
X = Memory-optimized (extreme RAM)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

Dense Storage use case

A

Fileservers/Data Warehousing/Hadoop

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

Memory Optimized use case

A

Memory Intensive apps/DBs

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

General Purpose use case

A

Application Servers

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Compute Optimized use case
CPU Intensive apps/DBs
26
Graphics Intensive use case
Video Encoding/3D application streaming
27
Field Programmable Gate Array use case
Hardware acceleration for your code
28
Lowest Cost, General Purpose use case
Web Servers/small DBs
29
Graphics/General Purpose GPU use case
Machine Learning, Bit Coin Mining, etc
30
Memory Optimized use case
SAP HANA, Apache Spark, etc
31
What is EBS?
EBS allows you to create storage volumes and attach them to EC2 instances.
32
Once a volume is attached...
...you can create a file system on top of these volumes, run a database, or use them in any other way you would use a block device
33
EBS volumes are placed...
...in a specific AZ, where they are automatically replicated to protect you from the failure of a single component
34
single component?
storage array
35
EBS volume types
``` General Purpose SSD (GP2) Provisioned IOPS SSD (IO1) Throughput Optimized HDD (ST1) Cold HDD (SC1) Magnetic (Standard) ```
36
General Purpose SSD (GP2)
General purpose, balances both price and performance Ratio of 3 IOPS per GB with up to 10K IOPS and the ability to burst up to 3000 IOPS for extended periods of time for volumes under 1 Gib
37
Provisioned IOPS SSD (IO1)
Designed for I/O intensive apps such as large relational or NoSQL databases Use if you need more than 10K IOPS Can provision up to 20K IOPS per volume Highest-performance SSD volume designed for mission-critical applications
38
Throughput Optimized HDD (ST1)
``` Big data Data warehousing Log processing Sequential data Cannot be a boot volume ```
39
Cold HDD (SC1)
Lowest cost storage for infrequently accessed workloads File Server Cannot be boot volumes
40
Magnetic (Standard)
Lowest cost per GB of all EBS volumes types that is bootable. Ideal for workloads where data is accessed infrequently, and apps where the lowest storage cost is important
41
Can you mount 1 EBS volume to multiple EC2 instances?
No, use EFS instead
42
General Purpose SSD (GP2) Use Cases
- Recommended for most workloads - System boot volumes - Virtual desktops - Low-latency interactive apps - Development and test environments
43
Provisioned IOPS SSD (IO1) Use Cases
-Critical business applications that require sustained IOPS performance, or more than 10,000 IOPS or 160 MiB/s of throughput per volume -Large database workloads, such as: MongoDB Cassandra Microsoft SQL Server MySQL PostgreSQL Oracle
44
Throughput Optimized HDD (ST1) Use Cases
- Streaming workloads requiring consistent, fast throughput at a low price - Big data - Data warehouses - Log processing - Cannot be a boot volume
45
Cold HDD (SC1) Use Cases
- Throughput-oriented storage for large volumes of data that is infrequently accessed - Scenarios where the lowest storage cost is important - Cannot be a boot volume
46
By default, if an EC2 instance is terminated, what happens to the EBS root volume attached to it?
The volume will be deleted since "Delete on Termination" is checked by default
47
Bootstrap scripts are placed in...
...User Data under "Advanced Details"
48
AWS tagging best practices
Tag everything!
49
Where do you request spot instances?
Purchasing Option in Configure Instance Details
50
Where do you request a dedicated host?
Tenancy in Configure Instance Details
51
To launch reserved instances...
Reserved Instances > Purchased Reserved Instances, add instances to cart
52
Encrypted boot volumes (default)
Root volumes cannot be encrypted by default. Other EBS volumes can be encrypted if you check Encrypted
53
Termination protection...
...is turned off by default. You must turn it on yourself if you want it.
54
On an EBS-backed instance, what is the default action if the instance is terminated?
The root EBS volume is deleted.
55
EBS root volumes of your DEFAULT AMI's
cannot be encrypted, but you can use a third party tool to encrypt the root volume, or this can be done when creating AMIs using the console or API
56
A security group is...
...a virtual firewall
57
1 instance can have how many security groups?
Multiple. Also, multiple instances can be one security group
58
If you change security group rules...
...changes take effect immediately
59
If you allow inbound rules (e.g. HTTP, HTTPS, SSH) but don't allow outbound rules, will those outbound rules affect the request?
No; since security groups are stateful, the inbound requests will be allowed back out automatically
60
Can you deny traffic with a security group?
No, only allow rules are allowed
61
The default security group...
...allows all inbound and outbound traffic by default
62
By default, all inbound traffic is...
...blocked
63
By default, all outbound traffic is...
...allowed
64
When creating a new volume...
...make sure it is in the same AZ as your instance, or you will not be able to attach it to your instance
65
After SSH into instance and elevating privileges, type what to find volumes?
lsblk
66
To attach a volume...
...you need to format and mount it
67
To check if a volume has data...
file -s e.g. file -s /dev/xvdf "data" = no data
68
To format a volume...
mkfs -t ext4 . ext4 is file format for Linux
69
To mount a volume...
mount | e.g. mount /dev/xvdf /myfileserver
70
Which directory is created by default when you mount a volume?
lost+found
71
To unmount a volume...
umount
72
If you forget to unmount a volume when you try to detach it...
...use Force Detach
73
Where are snapshots stored?
S3
74
When another snapshot is taken...
...only changed data since your last snapshot is sent to S3, since snapshots are incremental
75
Can you make a volume from a snapshot?
Yes
76
Can you change the volume type, size when you make a volume from a snapshot?
Yes
77
What is stored on your root volume?
OS
78
Think of a snapshot as...
a photograph (point in time copies of volumes)
79
If you create a snapshot for the first time...
...it may take some time to create
80
What does RAID stand for?
Redundant Array of Independent Disks (putting together a bunch of disks as one disk)
81
RAID types
RAID 0, RAID 1, RAID 5, RAID 10
82
RAID 0
Striped, No Redundancy (if one disk fails, the entire volume fails), Good Performance (use: gaming)
83
RAID 1
Mirrored (take one disk, mirror a copy to another disk), Redundancy
84
RAID 5
at least 3 disks, good for reads, bad for writes, AWS does not recommend ever putting RAID 5's on EBS
85
RAID 10
Striped & Mirrored, good redundancy, good performance
86
Where are RAID volumes used on AWS?
If you do not get disk I/O you require, add multiple volumes and create RAID array (usually RAID 0 or RAID 10 on AWS)
87
Best practice when launching Windows instances
Create a new keypair for Windows instances, separate from Linux instances
88
Username, password for Windows instances
``` User = Administrator Password = upload private key file into "Retrieve Password" window to obtain password ```
89
To manage disks...
Right-click, Disk Management. Right-click on an unallocated volume and choose volume type you want to create, select drive you want the RAID volume assigned to
90
How can I take a Snapshot of a RAID array - background?
Problem - Take a snapshot, the snapshot excludes data held in the cache by apps and the OS. This tends not to matter on a single volume; however, using multiple volumes in a RAID array, this can be a problem due to interdependencies of the array.
91
How can I take a Snapshot of a RAID array - continued
Stop the application from writing to disk. Flush all caches to the disk. How can we do this? Freeze the file system, unmount the RAID array, shut down the associated EC2 instance (easiest)
92
What is an AMI?
AMI provides the info required to launch a virtual server in the cloud. Specify an AMI when you launch an instance, and you can launch as many instances from the AMI you need. You can also launch instances from as many different AMIs as you need
93
AMIs consist of...
a template for the root volume for the instance launch permissions that control which AWS accounts can use the AMI to launch instances a block device mapping that specifies the volumes to attach to the instance when it's launched
94
T/F: AMIs are regional.
Yes, you can only launch an AMI from the region in which it is stored. However, you can copy AMIs to other regions using the console, command line, or EC2 API
95
select your AMI based on...
Region, OS, Architecture, Launch Permissions, Storage for the Root Device
96
Instance Store is also known as
Ephemeral Storage
97
EBS
Persistent Storage, fast provisioning times, more durability
98
Can you attach EBS volumes after launching an instance?
Yes
99
Can you attach instance store volumes after launching an instance?
No, but you can attach them before launching
100
Can instances with instance stores be stopped?
No, only reboot or terminate
101
Root device for EBS volume is created from
an EBS snapshot
102
Root device for instance store volume created from
a template stored in S3
103
Can you detach instance store volumes?
No
104
Which takes longer to provision, EBS or instance store?
Instance store
105
Can Instance store volumes be of any instance type?
No, there are limits on instance families
106
On an instance store volume, what happens if the host fails?
instance data is gone
107
What happens if you reboot both volume types?
You will not lose your data
108
Can volumes be stopped?
EBS - Yes | Instance store - No
109
Will root volumes be deleted on termination by default?
Yes. With EBS, you can tell AWS to keep the root volume
110
Health check ping path
file to test health check i.e. an html file saying that instance is healthy
111
Response timeout
how long it takes to do a healthcheck
112
Interval
how long to wait between healthchecks
113
Healthy threshold
how many consecutive health checks an instance must pass before becoming healthy
114
Unhealthy threshold
how many consecutive health checks an instance must fail before becoming unhealthy
115
Is IP address given for ELB?
No, a DNS name is given instead since the IP address may change
116
By default, how many AZs is an ELB deployed into?
2
117
Instances monitored by ELB are reported as either
In service or out of service
118
How do health checks work?
they check the instance health by talking to it