AWS – EBS vs Instance Store – Exam Tips

EBS (Elastic Block Storage) – persistence storage

Instance Store – ephemeral storage

There are two types of volumes:

  • Root volumes (where OS is installed .e.g. C drive on windows)
  • Additional volumes (e.g. D:\, E:\ on windows and /dev/sdb, /dev/sdc on linux)

 

Root volumes can be both EBS backed or instance store backed volumes.

Root Volume Size:

Root Volume Type Max Size Limit
Instance Store Root Volume 10 GB
EBS Root Volume 16 TB

Terminating an Instance – EBS

EBS root volumes are terminated by default when EC2 instance is terminated. However this can be altered by unselecting “Delete on Termination” option when creating an instance or by setting “deleteontermination” flag to false via command line:

Delete on  Termination” option is checked off by default. If you want to stop this behavior you will have to unselect this option.

Using the AWS CLI, you can change the DeleteOnTermination attribute when you launch an instance or while the instance is running.

Use the modify-instance-attribute command to preserve the root volume by including a block device mapping that sets its DeleteOnTermination attribute to false.

in mapping.json you can specify the false flag for DeleteOnTermination :

 

Other EBS volumes (non root volumes that is) attached to an instance are preserved when an instance is terminated.

 

Terminating an Instance – Instance Store

Instance Store root volumes are terminated by default when an instance is terminated. This behavior cannot be changed.

Other instance store volumes (non root volumes) will also be deleted upon instance termination.

However EBS volumes attached to an instance with root device that is instance store backed will persist automatically.

 

 Stopping an Instance

EBS (root) backed instances – can be stopped.

Instance Store (root) backed instances – cannot be stopped. They can only be rebooted or terminated.

 

Instance Store Data

Data on Instance Store devices persists for the life of an instance. If instance reboots, data persists. However data on instance store volumes is lost under following circumstances:

  • Failure of underlying drive
  • Stopping of an Amazon EBS backed instances (with additional non-root volumes that are instance store backed)
  • Termination of Instance Store (root) backed instance

 

Instance store volumes are not reliable option for long-term and valuable data. Instead use EBS volumes for data needing longer term persistence.

Ephemeral storage (instance store) – don’t store core production or valuable data on it. Put such data on S3 or EBS.

Characteristic Amazon EBS-Backed Amazon Instance Store-Backed
Boot time Usually less than 1 minute Usually less than 5 minutes
Size limit 16 TiB 10 GiB
Root device volume Amazon EBS volume Instance store volume
Data persistence By default, the root volume is deleted when the instance terminates.* Data on any other Amazon EBS volumes persists after instance termination by default. Data on any instance store volumes persists only during the life of the instance. Data on any instance store volumes persists only during the life of the instance. Data on any Amazon EBS volumes persists after instance termination by default.
Upgrading The instance type, kernel, RAM disk, and user data can be changed while the instance is stopped. Instance attributes are fixed for the life of an instance.
Charges You’re charged for instance usage, Amazon EBS volume usage, and storing your AMI as an Amazon EBS snapshot. You’re charged for instance usage and storing your AMI in Amazon S3.
AMI creation/bundling Uses a single command/call Requires installation and use of AMI tools
Stopped state Can be placed in stopped state where instance is not running, but the root volume is persisted in Amazon EBS Cannot be in stopped state; instances are running or terminated

Source: AWS

Specific Exam Tips:

For Instance with Instance Store backed root devices– instance type, kernel, RAM etc. cannot modified because Instance attributes are fixed for life of the instance.

Whereas for instances with EBS backed root device – instance type, kernel, RAM etc. can be upgraded.

DeleteOnTermination is default for all EBS root device volume. This flag can be turned off at instance creation. However after instance has been created you can only modify this via the CLI and cannot be done via the console. Steps are listed above on how to do this.

Additional EBS volumes persist automatically when an instance is terminated. You will need to manually delete these volumes. Instance volumes will not persist instance termination.

Instance store is ephemeral storage. Data will always be deleted when an instance store (root) backed instance is terminated.

Leave a Reply

Your email address will not be published. Required fields are marked *