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
Q

Compute Optimized use case

A

CPU Intensive apps/DBs

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

Graphics Intensive use case

A

Video Encoding/3D application streaming

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

Field Programmable Gate Array use case

A

Hardware acceleration for your code

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

Lowest Cost, General Purpose use case

A

Web Servers/small DBs

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

Graphics/General Purpose GPU use case

A

Machine Learning, Bit Coin Mining, etc

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

Memory Optimized use case

A

SAP HANA, Apache Spark, etc

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

What is EBS?

A

EBS allows you to create storage volumes and attach them to EC2 instances.

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

Once a volume is attached…

A

…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

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

EBS volumes are placed…

A

…in a specific AZ, where they are automatically replicated to protect you from the failure of a single component

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

single component?

A

storage array

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

EBS volume types

A
General Purpose SSD (GP2)
Provisioned IOPS SSD (IO1) 
Throughput Optimized HDD (ST1) 
Cold HDD (SC1) 
Magnetic (Standard)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
36
Q

General Purpose SSD (GP2)

A

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

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

Provisioned IOPS SSD (IO1)

A

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

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

Throughput Optimized HDD (ST1)

A
Big data
Data warehousing 
Log processing 
Sequential data 
Cannot be a boot volume
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
39
Q

Cold HDD (SC1)

A

Lowest cost storage for infrequently accessed workloads
File Server
Cannot be boot volumes

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

Magnetic (Standard)

A

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

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

Can you mount 1 EBS volume to multiple EC2 instances?

A

No, use EFS instead

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

General Purpose SSD (GP2) Use Cases

A
  • Recommended for most workloads
  • System boot volumes
  • Virtual desktops
  • Low-latency interactive apps
  • Development and test environments
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
43
Q

Provisioned IOPS SSD (IO1) Use Cases

A

-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

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

Throughput Optimized HDD (ST1) Use Cases

A
  • Streaming workloads requiring consistent, fast throughput at a low price
  • Big data
  • Data warehouses
  • Log processing
  • Cannot be a boot volume
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
45
Q

Cold HDD (SC1) Use Cases

A
  • 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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
46
Q

By default, if an EC2 instance is terminated, what happens to the EBS root volume attached to it?

A

The volume will be deleted since “Delete on Termination” is checked by default

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

Bootstrap scripts are placed in…

A

…User Data under “Advanced Details”

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

AWS tagging best practices

A

Tag everything!

49
Q

Where do you request spot instances?

A

Purchasing Option in Configure Instance Details

50
Q

Where do you request a dedicated host?

A

Tenancy in Configure Instance Details

51
Q

To launch reserved instances…

A

Reserved Instances > Purchased Reserved Instances, add instances to cart

52
Q

Encrypted boot volumes (default)

A

Root volumes cannot be encrypted by default. Other EBS volumes can be encrypted if you check Encrypted

53
Q

Termination protection…

A

…is turned off by default. You must turn it on yourself if you want it.

54
Q

On an EBS-backed instance, what is the default action if the instance is terminated?

A

The root EBS volume is deleted.

55
Q

EBS root volumes of your DEFAULT AMI’s

A

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
Q

A security group is…

A

…a virtual firewall

57
Q

1 instance can have how many security groups?

A

Multiple. Also, multiple instances can be one security group

58
Q

If you change security group rules…

A

…changes take effect immediately

59
Q

If you allow inbound rules (e.g. HTTP, HTTPS, SSH) but don’t allow outbound rules, will those outbound rules affect the request?

A

No; since security groups are stateful, the inbound requests will be allowed back out automatically

60
Q

Can you deny traffic with a security group?

A

No, only allow rules are allowed

61
Q

The default security group…

A

…allows all inbound and outbound traffic by default

62
Q

By default, all inbound traffic is…

A

…blocked

63
Q

By default, all outbound traffic is…

A

…allowed

64
Q

When creating a new volume…

A

…make sure it is in the same AZ as your instance, or you will not be able to attach it to your instance

65
Q

After SSH into instance and elevating privileges, type what to find volumes?

A

lsblk

66
Q

To attach a volume…

A

…you need to format and mount it

67
Q

To check if a volume has data…

A

file -s e.g. file -s /dev/xvdf

“data” = no data

68
Q

To format a volume…

A

mkfs -t ext4 . ext4 is file format for Linux

69
Q

To mount a volume…

A

mount

e.g. mount /dev/xvdf /myfileserver

70
Q

Which directory is created by default when you mount a volume?

A

lost+found

71
Q

To unmount a volume…

A

umount

72
Q

If you forget to unmount a volume when you try to detach it…

A

…use Force Detach

73
Q

Where are snapshots stored?

A

S3

74
Q

When another snapshot is taken…

A

…only changed data since your last snapshot is sent to S3, since snapshots are incremental

75
Q

Can you make a volume from a snapshot?

A

Yes

76
Q

Can you change the volume type, size when you make a volume from a snapshot?

A

Yes

77
Q

What is stored on your root volume?

A

OS

78
Q

Think of a snapshot as…

A

a photograph (point in time copies of volumes)

79
Q

If you create a snapshot for the first time…

A

…it may take some time to create

80
Q

What does RAID stand for?

A

Redundant Array of Independent Disks (putting together a bunch of disks as one disk)

81
Q

RAID types

A

RAID 0, RAID 1, RAID 5, RAID 10

82
Q

RAID 0

A

Striped, No Redundancy (if one disk fails, the entire volume fails), Good Performance (use: gaming)

83
Q

RAID 1

A

Mirrored (take one disk, mirror a copy to another disk), Redundancy

84
Q

RAID 5

A

at least 3 disks, good for reads, bad for writes, AWS does not recommend ever putting RAID 5’s on EBS

85
Q

RAID 10

A

Striped & Mirrored, good redundancy, good performance

86
Q

Where are RAID volumes used on AWS?

A

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
Q

Best practice when launching Windows instances

A

Create a new keypair for Windows instances, separate from Linux instances

88
Q

Username, password for Windows instances

A
User = Administrator
Password = upload private key file into "Retrieve Password" window to obtain password
89
Q

To manage disks…

A

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
Q

How can I take a Snapshot of a RAID array - background?

A

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
Q

How can I take a Snapshot of a RAID array - continued

A

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
Q

What is an AMI?

A

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
Q

AMIs consist of…

A

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
Q

T/F: AMIs are regional.

A

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
Q

select your AMI based on…

A

Region, OS, Architecture, Launch Permissions, Storage for the Root Device

96
Q

Instance Store is also known as

A

Ephemeral Storage

97
Q

EBS

A

Persistent Storage, fast provisioning times, more durability

98
Q

Can you attach EBS volumes after launching an instance?

A

Yes

99
Q

Can you attach instance store volumes after launching an instance?

A

No, but you can attach them before launching

100
Q

Can instances with instance stores be stopped?

A

No, only reboot or terminate

101
Q

Root device for EBS volume is created from

A

an EBS snapshot

102
Q

Root device for instance store volume created from

A

a template stored in S3

103
Q

Can you detach instance store volumes?

A

No

104
Q

Which takes longer to provision, EBS or instance store?

A

Instance store

105
Q

Can Instance store volumes be of any instance type?

A

No, there are limits on instance families

106
Q

On an instance store volume, what happens if the host fails?

A

instance data is gone

107
Q

What happens if you reboot both volume types?

A

You will not lose your data

108
Q

Can volumes be stopped?

A

EBS - Yes

Instance store - No

109
Q

Will root volumes be deleted on termination by default?

A

Yes. With EBS, you can tell AWS to keep the root volume

110
Q

Health check ping path

A

file to test health check i.e. an html file saying that instance is healthy

111
Q

Response timeout

A

how long it takes to do a healthcheck

112
Q

Interval

A

how long to wait between healthchecks

113
Q

Healthy threshold

A

how many consecutive health checks an instance must pass before becoming healthy

114
Q

Unhealthy threshold

A

how many consecutive health checks an instance must fail before becoming unhealthy

115
Q

Is IP address given for ELB?

A

No, a DNS name is given instead since the IP address may change

116
Q

By default, how many AZs is an ELB deployed into?

A

2

117
Q

Instances monitored by ELB are reported as either

A

In service or out of service

118
Q

How do health checks work?

A

they check the instance health by talking to it