- Block level storage volumes for use with EC2 instances.
- Well-suited for use as the primary storage for file systems, databases, or for any applications that require fine granular updates and access to raw, unformatted, block-level storage.
- Well-suited to both database-style applications (random reads and writes), and to throughput-intensive applications (long, continuous reads and writes).
- New EBS volumes receive their maximum performance the moment that they are available and do not require initialization (formerly known as pre-warming). However, storage blocks on volumes that were restored from snapshots must be initialized (pulled down from Amazon S3 and written to the volume) before you can access the block.
- Termination protection is turned off by default and must be manually enabled (keeps the volume/data when the instance is terminated)
- You can have up to 5,000 EBS volumes by default
- You can have up to 10,000 snapshots by default
- Different types of storage options: General Purpose SSD (gp2), Provisioned IOPS SSD (io1), Throughput Optimized HDD (st1), and Cold HDD (sc1) volumes up to 16 TiB in size.
- You can mount multiple volumes on the same instance, but each volume can be attached to only one instance at a time.
- You can create a file system on top of these volumes, or use them in any other way you would use a block device (like a hard drive).
- You can use encrypted EBS volumes to meet data-at-rest encryption requirements for regulated/audited data and applications.
- You can create point-in-time snapshots of EBS volumes, which are persisted to Amazon S3. Similar to AMIs. Snapshots can be copied across AWS regions.
- Volumes are created in a specific AZ, and can then be attached to any instances in that same AZ. To make a volume available outside of the AZ, you can create a snapshot and restore that snapshot to a new volume anywhere in that region.
- You can copy snapshots to other regions and then restore them to new volumes there, making it easier to leverage multiple AWS regions for geographical expansion, data center migration, and disaster recovery.
- Performance metrics, such as bandwidth, throughput, latency, and average queue length, provided by Amazon CloudWatch, allow you to monitor the performance of your volumes to make sure that you are providing enough performance for your applications without paying for resources you don’t need.
- You can detach an EBS volume from an instance explicitly or by terminating the instance. However, if the instance is running, you must first unmount the volume from the instance.
- If an EBS volume is the root device of an instance, you must stop the instance before you can detach the volume.
- You can use AWS Backup, an automated and centralized backup service, to protect EBS volumes and your other AWS resources. AWS Backup is integrated with Amazon DynamoDB, Amazon EBS, Amazon RDS, Amazon EFS, and AWS Storage Gateway to give you a fully managed AWS backup solution.
- With AWS Backup, you can configure backups for EBS volumes, automate backup scheduling, set retention policies, and monitor backup and restore activity.
Types of EBS Volumes
- General Purpose SSD (gp2)
- Base performance of 3 IOPS/GiB, with the ability to burst to 3,000 IOPS for extended periods of time.
- Support up to 10,000 IOPS and 160 MB/s of throughput.
- The burst duration of a volume is dependent on the size of the volume, the burst IOPS required, and the credit balance when the burst begins. Burst IO duration is computed using the following formula:
Burst duration = (Credit balance) [(Burst IOPS) – 3 (Volume size in GiB)]
- If your gp2 volume uses all of its I/O credit balance, the maximum IOPS performance of the volume remains at the baseline IOPS performance level and the volume’s maximum throughput is reduced to the baseline IOPS multiplied by the maximum I/O size.
- Throughput for a gp2 volume can be calculated using the following formula, up to the throughput limit of 160 MiB/s:
Throughput in MiB/s = (Volume size in GiB) (IOPS per GiB) × (I/O size in KiB)
- Provisioned IOPS SSD (io1)
- Designed for I/O-intensive workloads, particularly database workloads, which are sensitive to storage performance and consistency.
- Allows you to specify a consistent IOPS rate when you create the volume
- Throughput Optimized HDD (st1)
- Low-cost magnetic storage that focuses on throughput rather than IOPS.
- Throughput of up to 500 MiB/s.
- Subject to throughput and throughput-credit caps, the available throughput of an st1 volume is expressed by the following formula:
(Volume size)(Credit accumulation rate per TiB) = Throughput
- Cold HDD (sc1)
- Low-cost magnetic storage that focuses on throughput rather than IOPS.
- Throughput of up to 250 MiB/s.
Solid-State Drives (SSD)
Hard disk Drives (HDD)
General Purpose SSD (gp2)
Provisioned IOPS SSD (io1)
Throughput Optimized HDD (st1)
Cold HDD (sc1)
-Recommended for most workloads
-System boot volumes
-Low-latency interactive apps
-Development and test environments
-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.
-Streaming workloads requiring consistent, fast throughput at a low price
-Cannot be a boot volume
-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
1 GiB – 16 TiB
4 GiB – 16 TiB
500 GiB – 16 TiB
500 GiB – 16 TiB
Dominant Performance Attribute
- Data stored at rest on an encrypted volume, disk I/O, and snapshots created from it are all encrypted.
- Also provides encryption for data in-transit from EC2 to EBS since encryption occurs on the servers that hosts EC2 instances.
- The following types of data are encrypted:
- Data at rest inside the volume
- All data moving between the volume and the instance
- All snapshots created from the volume
- All volumes created from those snapshots
- Uses AWS Key Management Service (AWS KMS) master keys when creating encrypted volumes and any snapshots created from your encrypted volumes.
- Volumes restored from encrypted snapshots are automatically encrypted.
- EBS encryption is only available on certain instance types.
- There is no direct way to encrypt an existing unencrypted volume, or to remove encryption from an encrypted volume. However, you can migrate data between encrypted and unencrypted volumes.
- Cloudwatch Monitoring two types: Basic and Detailed monitoring
- Volume status checks provide you the information that you need to determine whether your EBS volumes are impaired, and help you control how a potentially inconsistent volume is handled. List of statuses include:
- Ok – normal volume
- Warning – degraded volume
- Impaired – stalled volume
- Insufficient-data – insufficient data
- Volume events include a start time that indicates the time at which an event occurred, and a duration that indicates how long I/O for the volume was disabled. The end time is added to the event when I/O for the volume is enabled.
- Volume events are:
- Awaiting Action: Enable IO
- IO Enabled
- IO Auto-Enabled
- Severely Degraded
Modifying the Size, IOPS, or Type of an EBS Volume on Linux
- If your current-generation EBS volume is attached to a current-generation EC2 instance type, you can increase its size, change its volume type, or (for an io1 volume) adjust its IOPS performance, all without detaching it.
- EBS currently supports a maximum volume size of 16 TiB.
- Two partitioning schemes commonly used on Linux and Windows systems: master boot record (MBR) and GUID partition table (GPT).
- An EBS volume being modified goes through a sequence of states. The volume enters first the Modifying state, then the Optimizing state, and finally the Complete state.
- You can expand a partition to a new size. Expand by using parted or gdisk.
- Use a file system–specific command to resize the file system to the larger size of the new volume. These commands work even if the volume to extend is the root volume. For ext2, ext3, and ext4 file systems, this command is resize2fs. For XFS file systems, this command is xfs_growfs.
- Decreasing the size of an EBS volume is not supported.
- Back up the data on your EBS volumes to S3 by taking point-in-time snapshots.
- Snapshots are incremental backups, which means that only the blocks on the device that have changed after your most recent snapshot are saved. This minimizes the time required to create the snapshot and saves on storage costs by not duplicating data.
- When you delete a snapshot, only the data unique to that snapshot is removed.
- You can share a snapshot across AWS accounts by modifying its access permissions.
- You can make copies of your own snapshots as well as snapshots that have been shared with you.
- A snapshot is constrained to the Region where it was created.
- EBS snapshots broadly support EBS encryption.
- You can’t delete a snapshot of the root device of an EBS volume used by a registered AMI. You must first deregister the AMI before you can delete the snapshot.
- Each account can have up to 5 concurrent snapshot copy requests to a single destination Region.
- User-defined tags are not copied from the source snapshot to the new snapshot.
- Snapshots are constrained to the Region in which they were created. To share a snapshot with another Region, copy the snapshot to that Region.
- Snapshots that you intend to share must instead be encrypted with a custom CMK.
Amazon EBS–Optimized Instances
- Provides the best performance for your EBS volumes by minimizing contention between EBS I/O and other traffic from your instance.
- EBS–optimized instances deliver dedicated bandwidth between 425 Mbps and 14,000 Mbps to EBS.
- For instance types that are EBS–optimized by default, there is no need to enable EBS optimization and no effect if you disable EBS optimization.
- You are charged by the amount you provision in GB per month until you release the storage.
- Provisioned storage for gp2 volumes, provisioned storage and provisioned IOPS for io1 volumes, provisioned storage for st1 and sc1 volumes will be billed in per-second increments, with a 60 second minimum.
- With Provisioned IOPS SSD (io1) volumes, you are also charged by the amount you provision in IOPS per month.
- After you detach a volume, you are still charged for volume storage as long as the storage amount exceeds the limit of the AWS Free Tier. You must delete a volume to avoid incurring further charges.
- Snapshot storage is based on the amount of space your data consumes in Amazon S3.
- Copying a snapshot to a new Region does incur new storage costs.
- When you enable EBS optimization for an instance that is not EBS-optimized by default, you pay an additional low, hourly fee for the dedicated capacity.
- Use EBS-Optimized Instances
- Understand How Performance is Calculated
- Understand Your Workload
- Be Aware of the Performance Penalty When Initializing Volumes from Snapshots
- Factors That Can Degrade HDD Performance
- Increase Read-Ahead for High-Throughput, Read-Heavy Workloads on st1 and sc1
- Use a Modern Linux Kernel
- Use RAID 0 (Redundant Array of Independent Disks) to Maximize Utilization of Instance Resources
- Track Performance Using Amazon CloudWatch
Limits of EBS Per Region
Number of EBS snapshots
Concurrent snapshots allowed for a single volume
5 for io1, gp2, magnetic; 1 for st1, sc1
Concurrent snapshot copy requests to a single destination region
Total volume storage of General Purpose SSD (gp2) volumes
Total volume storage of Provisioned IOPS SSD (io1) volumes
Total volume storage of Throughput Optimized HDD (st1)
Total volume storage of Cold HDD (sc1)
Total volume storage of Magnetic volumes (standard)
Total provisioned IOPS
Free Amazon EBS Tutorials on YouTube:
Other Amazon EBS-related Cheat Sheets:
Validate Your Knowledge
An application which is currently hosted on an On-Demand EC2 instance with an attached EBS volume is scheduled to be decommissioned. Which of the following does not happen to your data when the instance is terminated?
- For EBS-backed instances, the root volume is persisted by default.
- By default, the additional EBS volumes that are created and attached to an instance at launch are not deleted when that instance is terminated.
- For EBS-backed instances, the root volume is deleted by default.
- For Instance Store-Backed AMI, all the data is deleted.
You are working as an IT Consultant for a tech startup that plans to launch its data analytics application, and which uses a MongoDB database and an NGINX server. You are instructed to provision a service that provides more than 200,000 IOPS in 4kB random I/O reads for the database.
Which of the following options will meet this requirement?
- Provisioned IOPS SSD (io1) EBS Volumes
- Storage Optimized Instances
- Throughput Optimized HDD (st1) EBS Volumes
- Cold HDD (sc1) Volumes
For more AWS practice exam questions with detailed explanations, check this out:
AWS Certifications are consistently among the top paying IT certifications in the world, considering that Amazon Web Services is the leading cloud services platform with almost 50% market share! Earn over $150,000 per year with an AWS certification!