Amazon EBS

  • 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

Features

  • 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 16,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

IT Certification Category (English)728x90
  • 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)

Volume Type

General Purpose SSD (gp2)

Provisioned IOPS SSD (io1)

Throughput Optimized HDD (st1)

Cold HDD (sc1)

Use Cases

-Recommended for most workloads

-System boot volumes

-Virtual desktops

-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

-Big data

-Data warehouse

-Log processing

-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

Volume Size

1 GiB – 16 TiB

4 GiB – 16 TiB

500 GiB – 16 TiB

500 GiB – 16 TiB

Max. IOPS/Volume

10,000

32,000

500

250

Max. Throughput/Volume

160 MiB/s

500 MiB/s

500 MiB/s

250 MiB/s

Max. IOPS/Instance

80,000

80,000

80,000

80,000

Max. Throughput/Instance

1,750 MiB/s

1,750 MiB/s

1,750 MiB/s

1,750 MiB/s

Dominant Performance Attribute

IOPS

IOPS

MiB/s

MiB/s

 

Encryption

  • 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.

Monitoring

  • 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
    • Normal
    • Degraded
    • Severely Degraded
    • Stalled

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.

EBS Snapshots

  • 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.

AWS Training Amazon EBS 2

  • 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.

Pricing

  • 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.

Improving Performance

  • 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

Resource

Default Limit

Number of EBS snapshots

100,000

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

5

Total volume storage of General Purpose SSD (gp2) volumes

300 TiB

Total volume storage of Provisioned IOPS SSD (io1) volumes

300 TiB

Total volume storage of Throughput Optimized HDD (st1)

300 TiB

Total volume storage of Cold HDD (sc1)

300 TiB

Total volume storage of Magnetic volumes (standard)

300 TiB

Total provisioned IOPS

300,000

Free Amazon EBS Tutorials on YouTube:

https://www.youtube.com/user/AmazonWebServices/search?query=ebs

 

Other Amazon EBS-related Cheat Sheets:

 

Validate Your Knowledge

Question 1

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?

  1. For EBS-backed instances, the root volume is persisted by default.
  2. By default, the additional EBS volumes that are created and attached to an instance at launch are not deleted when that instance is terminated.
  3. For EBS-backed instances, the root volume is deleted by default.
  4. For Instance Store-Backed AMI, all the data is deleted.

Correct Answer: 1

An 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 on your volume indefinitely, only using the processing and storage resources when required. The data persists on the volume until the volume is deleted explicitly. The physical block storage used by deleted EBS volumes is overwritten with zeroes before it is allocated to another account. If you are dealing with sensitive data, you should consider encrypting your data manually or storing the data on a volume protected by Amazon EBS encryption

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.

The statement conveyed in option 1 is not true, making it the correct answer for this particular question. When the instance is terminated, the volume of an EBS-backed instance is deleted by default unless the DeleteOnTermination flag is set to false.

Reference: 
http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumes.html

Question 2

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?

  1. Provisioned IOPS SSD (io1) EBS Volumes
  2. Storage Optimized Instances
  3. Throughput Optimized HDD (st1) EBS Volumes
  4. Cold HDD (sc1) Volumes

Correct Answer: 2

Storage optimized instances are designed for workloads that require high, sequential read and write access to very large data sets on local storage. They are optimized to deliver tens of thousands of low-latency, random I/O operations per second (IOPS) to applications compared with EBS-backed EC2 instances.

If you use a Linux AMI with kernel version 4.4 or later and use all the SSD-based instance store volumes available to your instance, you get the IOPS (in 4kB block size) performance of over 100,000 IOPS depending on the instance types. For example, an i3.4xlarge instance can provide you with 825,000 Random Read IOPS and 360,000 Write IOPS.

Reference:
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/storage-optimized-instances.html#i2-instances-diskperf

See Storage-Optimized Instance Types:
https://aws.amazon.com/ec2/instance-types/

For more AWS practice exam questions with detailed explanations, check this out:

Tutorials Dojo AWS Practice Exams

X

Sources:
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AmazonEBS.html
https://aws.amazon.com/ebs/faqs/

***

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!

Subscribe to our newsletter and notifications for more helpful AWS cheat sheets and study guides like this and answer as many AWS practice exams as you can.🙂