| « PreviousNext » | |
![]() ![]() ![]() | Did this page help you? Yes | No | Tell us about it... |
Topics
Amazon Elastic Block Store (Amazon EBS) provides block level storage volumes for use with Amazon EC2 instances. Amazon EBS volumes are highly available and reliable storage volumes that can be attached to any running instance in the same Availability Zone. The Amazon EBS volumes attached to an Amazon EBS instance are exposed as storage volumes that persist independently from the life of the instance. With Amazon EBS, you only pay for what you use. For more information about Amazon EBS pricing, see the Projecting Costs section of the Amazon Elastic Block Store page.
Amazon EBS is recommended when data changes frequently and requires long-term persistence. Amazon EBS is particularly well-suited for use as the primary storage for a file system, database, or for any applications that require fine granular updates and access to raw, unformatted block-level storage. Amazon EBS is particularly helpful for database-style applications that frequently encounter many random reads and writes across the data set.
You can attach multiple volumes to the same instance within the limits specified by your AWS account. Your account has a limit on the number of Amazon EBS volumes that you can use, and the total storage available to you. For more information about these limits, and how to request an increase in your limits, see Request to Increase the Amazon EBS Volume Limit.
All Amazon EBS volumes offer the following features:
Data availability from replication across an Availability Zone
Data persistence independent of the life of the instance
The ability to create snapshots and incremental backups
Data Availability
When you create an Amazon EBS volume in an Availability Zone, it is automatically replicated within that zone to prevent data loss due to failure of any single hardware component. After you create a volume, you can attach it to any Amazon EC2 instance in the same Availability Zone. After you attach a volume, it appears as a native block device similar to a hard drive or other physical device. At that point, the instance can interact with the volume just as it would with a local drive; the instance can format the EBS volume with a file system such as ext3 (Linux) or NTFS (Windows) and install applications. You use the file system to access the stored files.
An EBS volume can be attached to only one instance at a time within the same Availability Zone. However, multiple volumes can be attached to a single instance. If you attach multiple volumes to a device that you have named, you can stripe data across the volumes for increased I/O and throughput performance.
You can get monitoring data for your Amazon EBS volumes at no additional charge (this includes data for the root device volumes for Amazon EBS-backed instances). For more information, see Monitoring Volumes with CloudWatch.
Data Persistence
An Amazon EBS volume is off-instance storage that can persist independently from the life of an instance. You continue to pay for the volume usage as long as the data persists.
By default, EBS volumes that are attached to a running instance automatically detach from the instance with their data intact when that instance is terminated. The volume can then be reattached to a new instance, enabling quick recovery. If you are using an EBS-backed instance, you can stop and restart that instance without affecting the data stored in the attached volume. The volume remains attached throughout the stop-start cycle. This enables you to process and store the data set indefinitely, only using the processing and storage resources when required. The data set persists on the volume until the volume is deleted explicitly. After a volume is deleted, it can't be attached to any instance.
By default, EBS volumes that are created and attached to an instance
at launch are deleted when that instance is terminated. You can modify this behavior by
changing the value of the flag DeleteOnTermination to false when you
launch the instance. This modified value causes the volume to persist even after the instance
is terminated, and enables you to attach the volume to another instance.
Snapshots
Amazon EBS provides the ability to create snapshots (backups) of any Amazon EC2 volume and write a copy of the data in the volume to Amazon S3, where it is stored redundantly in multiple Availability Zones. The volume does not need be attached to a running instance in order to take a snapshot. As you continue to write data to a volume, you can periodically create a snapshot of the volume to use as a baseline for new volumes. These snapshots can be used to create multiple new Amazon EBS volumes, expand the size of a volume, or move volumes across Availability Zones. When you create a new volume using a snapshot, it's an exact copy of the original volume. By optionally specifying a different volume size or a different Availability Zone, you can use this functionality to increase the size of an existing volume or to create duplicate volumes in new Availability Zones. The snapshots can be shared with specific AWS accounts or made public. When you create snapshots, you incur charges in Amazon S3 based on the volume's total size. For a successive snapshot of the volume, you are only charged for any additional data beyond the volume's original size.
Amazon EBS snapshots are incremental backups, meaning that only the blocks on the volume that have changed since your last snapshot will be saved. If you have a volume with 100 GiB of data, but only 5 GiB of data have changed since your last snapshot, only the 5 GiB of modified data is written to Amazon S3. Even though snapshots are saved incrementally, the snapshot deletion process is designed so that you need to retain only the most recent snapshot in order to restore the volume.
To help categorize and manage your volumes and snapshots, you can tag them with metadata of your choice. For more information, see Tagging Your Amazon EC2 Resources.
There are two types of EBS volumes:
Standard
Provisioned IOPS (input/output operations per second)
Standard volumes offer cost effective storage that is ideal for applications with light or bursty I/O requirements.
These volumes deliver approximately 100 IOPS on average, with burst capability of up to hundreds of IOPS.
Standard volumes are well suited for use as boot volumes, as their burst capability improves instance start-up times.
To maximize the performance of your I/O-intensive applications, you can use Provisioned IOPS volumes. Provisioned IOPS volumes are designed to meet the needs of I/O-intensive workloads, particularly database workloads, that are sensitive to storage performance and consistency in random access I/O throughput. You specify an IOPS rate when you create the volume, and Amazon EBS provisions that rate for the lifetime of the volume. Amazon EBS currently supports up to 4000 IOPS per volume. You can stripe multiple volumes together to deliver thousands of IOPS per instance to your application.
A Provisioned IOPS volume must be at least 10 GB in size. The ratio of IOPS provisioned to the volume size requested can be a maximum of 10. For example, a volume with 1000 IOPS must be at least 100 GB.
Provisioned IOPS volumes are designed to offer consistent high performance. They deliver within 10 percent of the provisioned IOPS performance 99.9 percent of the time over a given year, if the following guidelines are met:
The volume is attached to an EBS-Optimized instance. For more information, see EBS-Optimized Instances.
The average queue length is at least 1 per 200 IOPS provisioned.
The queue length is the number of pending I/O requests on the volume. If you set the queue length to less than 1 per 200 IOPS provisioned, then your volume will not consistently deliver the IOPS that you've provisioned. Setting the queue length too far above the recommended setting won't affect the IOPS your volume delivers, however per-request latencies will increase.
The read and write operations have a block size of 16 KB or less. If the I/O increases above 16 KB, the IOPS delivered drop in proportion to the increase in the size of the I/O. For example, a 1000 IOPS volume can deliver 1000 16 KB writes per second, 500 32 KB writes per second, or 250 64 KB writes per second.
As with standard EBS volumes, there is up to a 50 percent reduction in IOPS when you first access the data. Performance is restored after the data is accessed once. For maximum performance consistency with new volumes, we recommend that you read or write to all the blocks on your volume before you use it for a workload.
Note that taking a snapshot can reduce the rate of IOPS you get from your volume while the snapshot is pending. To minimize the impact of snapshots on performance of a master node, create snapshots from a read replica of your data. Ideally, create these snapshots during off-peak usage.
For more information about volume performance, see Increasing EBS Performance.
This section describes some of the common tasks performed when using Amazon EBS.
Adding Multiple Copies of Your Volume to Your EC2 Instances
|
1 |
Create a snapshot of the volume attached to your running instance. |
|
2 |
Create the new volumes you need using the snapshot. |
|
3 |
Attach the newly created volumes to your EC2 instances. |
Reducing Use of Storage Resources When Traffic Decreases
|
1 |
Identify the volume or volumes that are not currently needed. |
|
2 |
[optional] Create snapshots of the identified volumes. Any AWS Marketplace product codes from the volume are propagated to the snapshot. |
|
3 |
Detach the volume(s) from the instance. Note The volume data persists in the detached volume. You can attach a detached volume to any running instance. |
|
4 |
To remove the data from the volume, delete the volume. Note The data in this volume is deleted. You can't attach this volume to any instance. |
Data Persistence after Instance Termination
By default, any volumes that you attach as you launch the instance are automatically
deleted when the instance terminates. However, any volumes that you attached to a running
instance persist even after the instance terminates. You can change the default behavior
using the DeleteOnTermination flag. For an example of how to change this flag
when launching an instance, see Changing the Root Device Volume to Persist.
The following diagram and task list describe the different states of a volume from the time it is attached to an instance until the time the instance terminates.

Persisting Data after Instance Termination
|
1 |
Launch an instance from an EBS-backed AMI and set the value of
|
|
2 |
Create snapshots of the volume at regular intervals. |
|
3 |
Make changes to the data in the volume by doing some processing. The volume is now in a modified state. |
|
4 |
Terminate the instance. The volume is detached from the instance. |
The volume, after instance termination, persists in its modified state. This is a new and different volume; it's no longer in its initial state or associated with its original AMI.
When you launch an instance of a particular AMI and then terminate the instance, the detached volume retains its original volume ID. If you launch another instance of the same AMI, the volume associated with the newly launched instance has a different volume ID.
Using the Modified Volume (Volume B) after Instance Termination
|
1 |
Create a new EBS-backed AMI from the snapshot of the detached volume. |
|
2 |
Launch an instance using the newly created AMI. The modified (Volume B) volume is attached to the instance. |
Using the Initial Volume (Volume A) after Instance Terminates
|
Launch an instance from EBS-backed AMI and set the value of
Note The instance launches with the EBS volume (Volume A) in its initial state with a new volume ID. |
Data Availability
A single Amazon EBS volume is constrained to the single Availability Zone where it is created and becomes unavailable if the Availability Zone itself is unavailable. However, a snapshot of an Amazon EBS volume is available across all of the Availability Zones within a Region. You can use these snapshots to create volumes and make them available in more than one Availability Zone.
Making Your Data Available in Multiple Availability Zones
|
1 |
Create a snapshot of the volume that you want to make available in another Availability Zone. |
|
2 |
Create a new volume using the snapshot created in the previous step, and specify a different Availability Zone. |
|
3 |
Launch a new instance in that Availability Zone and attach the new volume. |