AWS EBS - Elastic Block Storage

Amazon Elastic Block Store (Amazon EBS) allows you to create storage volumes and attach them to Amazon EC2 instances. Once attached, you can create a file system on top of these volumes, run a database, or use them in any other way you would use a block device. Amazon EBS volumes are places in specific Availability Zone, where they are automatically replicated to protect you from the failure of a single component.

AWS Elastic Block Storage

Amazon EBS Features

  • High Performance Volumes: Choose between solid-state disk (SSD)-backed or hard disk drive (HDD)-backed volumes that can deliver the performance you need for your most demanding applications.
  • Availability: Each Amazon EBS volume is designed for 99.999% availability and automatically replicates within its Availability Zone to protect your applications from component failure.
  • Encryption: Amazon EBS encryption provides seamless support for data-at-rest and data-in-transit between EC2 instances and EBS volumes.
  • Access Management: Amazon’s flexible access control policies allow you to specify who can access which EBS volumes ensuring secure access to your data.
  • Snapshots: Protect your data by creating point-in-time snapshots of EBS volumes, which are backed up to Amazon S3 for long-term durability

EBS Volume Types

Total 5 types of Volumes 2 SSD and 3 Magnetic.

IOPS: Input/output operations per second

  • General Purpose SSD(GP2)
    • General purpose, balances both price and performance.
    • A general-purpose SSD volume can range in size from 1 GB to 16 TB and provides a baseline performance of 3 IOPS per gigabyte provisioned, capping at 10,000 IOPS.
    • For instance, if you provision a 1 TB volume, you can expect a baseline performance of 3,000 IOPS. A 5 TB volume will not provide a 15,000 IOPS baseline, as it would hit the cap at 10,000 IOPS.
    • General-purpose SSD volumes under 1 TB also feature the ability to burst to up to 3,000 IOPS for extended periods of time.
    • General-purpose SSD volumes are billed based on the amount of data space provisioned, regardless of how much data you actually store on the volume.
  • Provisioned IOPS SSD(IO1)
    • A Provisioned IOPS SSD volume can range in size from 4 GB to 16 TB.
    • Designed for I/O intensive applications such as large relational or NoSQL databases.
    • Use if need more than 10,000 IOPS.
    • Can provision up to 20,000 IOPS per volume.
  • Throughput Optimized HDD(ST1)
    • Big Data
    • Data warehouses
    • Log processing
    • Cannot be a boot volume.
  • Cold HDD(SC1)
    • Lowest cost storage for infrequently accessed workloads.
    • File server
    • cannot be a boot volume.
  • Magnetic(Standard)
    • Lowest cost per gigabyte of all EBS volume types.
    • Magnetic volumes are ideal for workloads where data is accessed infrequently, and apps where the lowest storage cost is important.
    • Termination protection is turned off by default, you must turn it on

AWS Elastic Block Storage
AWS Elastic Block Storage

EBS Lifecycle

AWS Elastic Block Storage

EBS Protecting Data

  • Backup/Recovery (Snapshots)

    • You can back up the data on your Amazon EBS volumes, regardless of volume type, by taking point-in-time snapshots.
    • Snapshots are incremental backups, which means that only the blocks on the device that have changed since your most recent snapshot are saved.
    • You can take snapshots in many ways:
      • Through the AWS Management Console
      • Through the CLI
      • Through the API
      • By setting up a schedule of regular snapshots
    • Data for the snapshot is stored using Amazon S3 technology. The action of taking a snapshot is free. You pay only the storage costs for the snapshot data.
    • It’s important to know that while snapshots are stored using Amazon S3 technology, they are stored in AWS-controlled storage and not in your account’s Amazon S3 buckets. This means you cannot manipulate them like other Amazon S3 objects.
    • Snapshots are constrained to the region in which they are created, meaning you can use them to create new volumes only in the same region. If you need to restore a snapshot in a different region, you can copy a snapshot to another region.
  • Creating a Volume from a Snapshot

    • you create a new Amazon EBS volume from the snapshot.
    • When you do this, the volume is created immediately but the data is loaded lazily. This means that the volume can be accessed upon creation, and if the data being requested has not yet been restored, it will be restored upon first request.
    • Snapshots can also be used to increase the size of an Amazon EBS volume. To increase the size of an Amazon EBS volume, take a snapshot of the volume, then create a new volume of the desired size from the snapshot. Replace the original volume with the new volume.
  • Recovering Volumes:

    • DeleteOnTermination flag for the volume has been set to false, the volume should be detached before the instance is terminated. The volume can then be attached as a data volume to another instance and the data read and recovered.
  • Encryption Options:

    • Amazon EBS offers native encryption on all volume types.
    • Amazon uses the AWS Key Management Service (KMS) to handle key management.

EBS Labs

Encrypted Root Device Volumes And Snapshots

EBS Exam Tips

  • EBS Volumns can be changed on the fly (except for magnetic standard).
  • Best practice to stop the EC2 instance and then change the volume.
  • You can change volume types by taking a snapshot and then using the snapshot to create new volume.
  • If you change the volume on the fly you must wait for 6 hours before making another change.
  • You can scale EBS volumes up only.
  • Volume must be in the same AZ as EC2 instances.
  • EBS is not a standalone storage service like Amazon S3 so you can use it only in combination with Amazon EC2.
  • Performance for EBS is primarily measured in input/output operations per second (IOPS).
  • You cannot mount 1 EBS volume to multiple EC2 instances, instead use EFS.