This document provides an overview of using Amazon EBS snapshots to back up Amazon EC2 instances. It discusses what EBS is, how snapshots work, pricing, and how snapshots can be used for backup and disaster recovery, creating AMIs, and accessing public datasets. It also covers automating snapshot management using services like AWS Lambda, CloudWatch, and DynamoDB as well as solutions like the EBS Snapshot Scheduler.
2. What to expect from this session
1. Introduction to AWS block storage
2. What is Elastic Bock Store (EBS)?
3. What are EBS snapshots and how do they work?
4. Granular monitoring of EBS snapshot costs
5. Automating snapshot management and replication
across region with (Lambda)
3. The AWS Storage Portfolio
Cloud Data Migration
Direct ConnectSnowball
Snowball Edge
Snow Mobile
3rd Party
Connectors
Transfer
Acceleration
Storage
Gateway
Kinesis
Firehose
Amazon GlacierAmazon S3Amazon EBS
(persistent)
Amazon EC2
Instance Store
(ephemeral)
ObjectBlock File
Amazon EFS
4. What is Amazon EBS?
EBS
volume
Availability Zone Availability Zone
AWS region
Replica
5. EBS is designed for:
What is Amazon EBS?
99.999% Service Availability
0.1% to 0.2% Annual Failure Rate (AFR)
6. Instance Store vs EBS
Elastic Block Store
io1gp2 st1 sc1
• Persistent block storage volumes
• 99.999% availability
• Automatically replicated within its
Availability Zone (AZ)
• Point-in-time snapshot support
• Modify volume type as needs change
• SSD or HDD
• Auto recovery
EC2 Instance Store
HDDSSD
• Local to instance
• Non-persistent data store
• Data not replicated (by default)
• No snapshot support
• SSD or HDD
7. EBS enables EC2 auto recovery
RECOVER Instance
Instance ID
Instance metadata
Private IP addresses
Elastic IP addresses
EBS volume attachments
Instance retains:
* Supported on C3, C4, M3, M4, P2, R3, T2, and X1 instance types with EBS-only storage
StatusCheckFailed_System
Amazon CloudWatch
per-instance metric alarm:
When alarm triggers?
8. EBS Volume Types & Performance
HDD BasedSSD Based
io1
Critical & I/O intensive
databases requiring
99.9% consistent
performance
Relational Databases
gp2
IOPS performance for
most workloads with
predictable baseline &
burst
NoSQL Databases,
OS boot volumes
st1
Big data & analytics
workloads requiring
consistent high throughput
(EMR, Hadoop, Kafka)
Big Data
sc1
Colder volumes
requiring fewer scans
(Colder log processing
workloads, Splunk)
Media
9. What is an EBS snapshot?
EBS
volume
Availability Zone
AWS region
Amazon
S3
EBS snapshot
Availability Zone
Replica
10. Snapshot pricing
• $0.05/GiB/Month*
• Current pricing across all regions is 47%
lower then previous pricing
• Additional TCO savings:
• Incremental behavior of snapshots
• Empty EBS blocks are not backed up
*Pricing based on us-east-1 region
11. How do EBS snapshots work?
EBS volume
A B C
snapshot 1
A B C
12. EBS volume
A B C
snapshot 1
A B C
snapshot 2
C’
How do EBS snapshots work?
C’
13. How do EBS snapshots work?
EBS volume
A B C’
D E
snapshot 1
A B C
snapshot 2
C’
snapshot 3
D E
14. snapshot 2
C’
How do EBS snapshots work?
EBS volume snapshot 1
A B C
snapshot 3
D EA B C’
D E
15. Availability Zone ”a”
Availability Zone “b” Availability Zone “c”
EC2
Elastic Block Store (EBS)
/data
Snap 1
Snap 2
Snap 3
EC2
Elastic Block Store (EBS)
/data
Region 1
Simple Storage
Service
What can you do with a snapshot? Backup & DR
Snap 1
Snap 2
Snap 3
Region 2
Note: Can also be
across accounts
16. Oregon
AZ1
AZ2 AZ3
Region
S3
Linux
Windows
What can you do with a snapshot? … AMIs
EC2
root
Custom
EC2
root
EC2
root
Region
S3
Linux
Windows
Custom
Sydney
Note: behavior of non-market place AMIs
(Quick Start, Community and Private AMIs)
17. What can you do with a snapshot?
AWS region
Public Datasets on
AWS available as
EBS snapshots:
Availability Zone
EBS
volume
https://aws.amazon.com/public-data-sets/
• Genomic
• Census
• Global weather
• Transportation
Replica
18. Tracking snapshots and costs (Tagging)
• Custom tags provide the ability to assign key / value pairs to AWS
resources
• EBS snapshots supports custom tags for identification and
management
• Tags assigned to EBS snapshots can be activated as “cost
allocation” tags. Allowing for greater visibility into snapshot storage
costs
EBS
snapshots
Development
EBS volume
Key = usage
Value = dev
Key = usage
Value = dev
EBS
snapshots
Production
EBS volume
Key = usage
Value = backup
Key = usage
Value = backup
19. Tracking snapshots and costs (Tagging)
• Tags can be added to existing snapshot using:
• AWS Console
• API Call:
• CLI command: aws ec2 create-tags --resources
snap-06d43f58bce0f49d9 --tags
Key=usage,Value=dev
CreateTags
Key = usage Value = dev
20. Tracking snapshots and costs (Cost Explorer)
• First, activate customer tag for cost allocation
• Generate reports with …..
• View usage and costs broken down by “usage” tag value
(example : metrics, dev, backup)
21. Automating protection (AWS services)
Amazon CloudWatch is a monitoring service for AWS cloud
resources and the applications you run on AWS.
AWS
Lambda
Amazon
CloudWatch
Amazon
DynamoDB
AWS Lambda lets you run code without provisioning or
managing servers. You pay only for the compute time you
consume
Amazon DynamoDB is a fast and flexible NoSQL database
service for all applications that need consistent, single-digit
millisecond latency at any scale.
22. Automating protection (snapshot custodian)
https://github.com/awslabs/aws-ebs-custodian
delete-snapshot.js
CloudWatch
event
Lambda
Delete Old
EBS
Snapshot
snapshot-state-change.js
Inventory
(Snapshot Status)
CloudWatch
event
Lambda
EBS-Snapshot-EC2.js
Inventory
(EBS volumes with tags)
CloudWatch
event
Lambda Run Command
(pre-snapshot freeze)
EBS
Snapshot
Store State
Store
Snapshot &
Retention
Get Snapshot &
Retention
Check EBS
snapshot
creation time
23. Automating protection (EBS Snapshot Scheduler)
• EBS Snapshot Scheduler is an AWS-provided solution that enables
customers to create daily automated snapshots
• Easy deployment & configuration through CloudFormation and
custom tags
• Automated snapshot retention
https://aws.amazon.com/answers/infrastructure-management/ebs-snapshot-scheduler/
25. Automating protection (example: DR replication)
Amazon
CloudWatch
Event
EBS
Snapshot
AWS
Lambda
us-west-2
EBS
Snapshot
us-east-1
EBS
volume
AWS
Lambda
1. (requirement) snapshots are already being generated in us-west-2 region
2. CloudWatch rule can trigger when new snapshots are successfully created
3. A Lambda function will then initiate a cross region copy of the snapshot for DR