1. Deep Dive into EC2
Hiroshi Wada
Jul 24, 2013
NICTA Software Dev Tools Series #10
2. Many many building blocks ...
AWS resources/services are relatively low level
Pick right resources and build your app
Steep learning curve
Similar services with different nature
Non-obvious restrictions
Dependency among services/resources
Easy to understand them by going *behind* the API
3. Region and
Availability Zone
Region: location where a set of services are provided
Regions are completely isolated from each other
Different API endpoints, no replication across, ...
Regions may provide different services
Availability Zone: a collection of data centers
A region has ~4 AZs
Isolated to prevent outage from spreading
Resources may or may not be replicated
aws.amazon.com/about-aws/globalinfrastructure/
4. Region-bound and AZ-bound
resources
Resources bound to an account
DNS, Access Management, ...
Resources bound to a Region
S3, machine images, DynamoDB, Elastic IP, LB, ...
Replicated across AZs - highly available/durable
Resources bound to an AZ
Instance (VM), EBS (disk volume), ...
Building fault tolerance is your job
5. Architecture in AZ (guess!)
Region
AZ-"a"
Rack servers
operating VMs
(IP network)
No persistent disk
for users
(only ephemeral disks)
Storage Area
Network
provisioning
EBS
(redundancy,
RAID, ...)
Fibre
Channel
Internet
Rack servers
operating resources
shared among AZs
(S3, LB, etc)
Communication
and replication
across AZs
(internal IP network)
Internet
AZ-"b"
6. Architecture in AZ (guess!)
Region
AZ-"a"
Rack servers
operating VMs
(IP network)
No persistent disk
for users
(only ephemeral disks)
Storage Area
Network
provisioning
EBS
(redundancy,
RAID, ...)
Fibre
Channel
Internet
Rack servers
operating resources
shared among AZs
(S3, LB, etc)
Communication
and replication
across AZs
(internal IP network)
Internet
AZ-"b"
7. Architecture in AZ (guess!)
Region
AZ-"a"
Rack servers
operating VMs
(IP network)
No persistent disk
for users
(only ephemeral disks)
Storage Area
Network
provisioning
EBS
(redundancy,
RAID, ...)
Fibre
Channel
Internet
Rack servers
operating resources
shared among AZs
(S3, LB, etc)
Communication
and replication
across AZs
(internal IP network)
Internet
AZ-"b"
8. Architecture in AZ (guess!)
Region
AZ-"a"
Rack servers
operating VMs
(IP network)
No persistent disk
for users
(only ephemeral disks)
Storage Area
Network
provisioning
EBS
(redundancy,
RAID, ...)
Fibre
Channel
Internet
Rack servers
operating resources
shared among AZs
(S3, LB, etc)
Communication
and replication
across AZs
(internal IP network)
Internet
AZ-"b"
9. Two types of instances: EBS backed
Root disk is in SAN and directly attached to machine
Stop/restart to change underlying machine in an AZ
Life cycle: start <-> stop -> terminate
Charge for the use of EBS (capacity and I/O)
attach directly
EBS volume
(virtual disk)
SAN
VM
servers and hypervisors
10. Two types of instances:
instance store
Root disk is loaded from S3 to an ephemeral disk
No persistent storage (only ephemeral)
Life cycle: start -> terminate
Customization
Re-create image or use cloud-init on boot
Image
S3 load into ephemeral disk
VM
servers and hypervisors
11. Lifecycle of disks/images
A machine image is stored in S3
=> you can launch instances in any AZ in the region
An instance is running on a physical machine
=> bound to an AZ. Not highly available.
Image
S3
replicated among AZs
(not visible to users)
load into an EBS volume
attach directly
EBS volume
(virtual disk)
SAN
load into
ephemeral disk
VM
AZ
12. Lifecycle of disks/images
An EBS volume is in SANs
=> bound to an AZ
Only attachable to an instance in same AZ
Not durable compared to S3
Image
S3
replicated among AZs
(not visible to users)
load into an EBS volume
attach directly
EBS volume
(virtual disk)
SAN
load into
ephemeral disk
VM
AZ
13. Lifecycle of disks/images
Snapshot (or machine image) of an EBS volume
=> stored in S3. Bound to region. High durability
Creating instance-store images is not trivial ...
Snapshot,
image
S3
EBS volume
(virtual disk)
SAN
AZ
Create an image from VM
EBS VM
Take a snapshot of a volume
14. Storage options - two flavors
"Regular" disk
Pros: you're familiar with it. random access.
Cons: less available/durable (AZ bound)
Services: EBS, ephemeral disks, RDS, ...
Key-value, NoSQL
Pros: high durability via distribution
Cons: proprietary interface
Services: S3, Dynamo DB, SQS, ...