AWS EBS vs Instance Store
- EC2 instances support two types for block level storage
- EC2 Instances can be launched using either Elastic Block Store (EBS) or Instance Store volume as root volumes and additional volumes.
- EC2 instances can be launched by choosing between AMIs backed by EC2 instance store and AMIs backed by EBS. However, AWS recommends using EBS backed AMIs because they launch faster and use persistent storage.
Instance Store (Ephemeral storage)
- An Instance store backed instance is an EC2 instance using an Instance store as root device volume created from a template stored in S3.
- Instance store volumes access storage from disks that are physically attached to the host computer.
- When an Instance stored instance is launched, the image that is used to boot the instance is copied to the root volume (typically sda1).
- Instance store provides temporary block-level storage for instances.
- Data on an instance store volume persists only during the life of the associated instance; if an instance is stopped or terminated, any data on instance store volumes is lost.
Key points for Instance store backed Instance
- Boot time is slower than EBS backed volumes and usually less than 5 min
- Can be selected as Root Volume and attached as additional volumes
- Instance store backed Instances can be of a maximum 10GiB volume size
- Instance store volume can be attached as additional volumes only when the instance is being launched and cannot be attached once the Instance is up and running.
- Instance store backed Instances cannot be stopped, as when stopped and started AWS does not guarantee the instance would be launched in the same host, and hence the data is lost.
- Data on Instance store volume is LOST in the following scenarios:-
- Failure of an underlying drive
- Stopping an EBS-backed instance where instance stores are attached as additional volumes
- Termination of the Instance
- Data on Instance store volume is NOT LOST when the instance is rebooted
- For EC2 instance store-backed instances AWS recommends to
- distribute the data on the instance stores across multiple AZs
- back up critical data from the instance store volumes to persistent storage on a regular basis.
- AMI creation requires the usage of AMI tools and needs to be executed from within the running instance.
- Instance store backed Instances cannot be upgraded
Elastic Block Store (EBS)
- An “EBS-backed” instance means that the root device for an instance launched from the AMI is an EBS volume created from an EBS snapshot
- An EBS volume behaves like a raw, unformatted, external block device that can be attached to a single instance and is not physically attached to the Instance host computer (more like network-attached storage).
- Volume persists independently from the running life of an instance.
- After an EBS volume is attached to an instance, you can use it like any other physical hard drive.
- EBS volume can be detached from one instance and attached to another instance
- EBS volumes can be created as encrypted volumes using the EBS encryption feature
Key points for EBS backed Instance
- Boot time is very fast usually less than a min
- Can be selected as Root Volume and attached as additional volumes
- EBS backed Instances can be of maximum 64TiB volume size depending upon the OS,
- EBS volume can be attached as additional volumes when the Instance is launched and even when the Instance is up and running
- Data on the EBS volume is LOST for
- EBS Root volume, if Delete On Termination flag is enabled, which is the default.
- Attached EBS volumes, if the Delete On Termination flag is enabled. It’s disabled, by default.
- Data on EBS volume is NOT LOST in the following scenarios:-
- Reboot on the Instance
- Stopping an EBS-backed instance
- Termination of the Instance for the additional EBS volumes. Additional EBS volumes are detached with their data intact
- When an EBS-backed instance is in a stopped state, various instance– and volume-related tasks can be done for e.g. you can modify the properties of the instance, you can change the size of your instance or update the kernel it is using, or you can attach your root volume to a different running instance for debugging or any other purpose
- EBS volumes are AZ scoped and tied to a single AZ where created.
- EBS volumes are automatically replicated within that zone to prevent data loss due to the failure of any single hardware component
- AMI creation is easy using a Single command
- EBS backed Instances can be upgraded for instance type, Kernel, RAM disk, and user data
EBS vs Instance Store Comparision
Boot Times
- EBS-backed AMIs launch faster than EC2 instance store-backed AMIs.
- When an EC2 instance store-backed AMI is launched, all the parts have to be retrieved from S3 before the instance is available.
- When an EBS-backed AMI is launched, parts are lazily loaded and only the parts required to boot the instance need to be retrieved from the snapshot before the instance is available.
- However, the performance of an instance that uses an EBS volume for its root device is slower for a short time while the remaining parts are retrieved from the snapshot and loaded into the volume.
- When you stop and restart the instance, it launches quickly, because the state is stored in an EBS volume.
AWS Certification Exam Practice Questions
- Questions are collected from Internet and the answers are marked as per my knowledge and understanding (which might differ with yours).
- AWS services are updated everyday and both the answers and questions might be outdated soon, so research accordingly.
- AWS exam questions are not updated to keep up the pace with AWS updates, so even if the underlying feature has changed the question might not be updated
- Open to further feedback, discussion and correction.
- EC2 EBS-backed (EBS root) instance is stopped, what happens to the data on any ephemeral store volumes?
- Data is automatically saved in an EBS volume.
- Data is unavailable until the instance is restarted.
- Data will be deleted and will no longer be accessible.
- Data is automatically saved as an EBS snapshot.
- When an EC2 instance that is backed by an S3-based AMI is terminated, what happens to the data on the root volume?
- Data is automatically saved as an EBS snapshot.
- Data is automatically saved as an EBS volume.
- Data is unavailable until the instance is restarted.
- Data is automatically deleted.
- Which of the following will occur when an EC2 instance in a VPC (Virtual Private Cloud) with an associated Elastic IP is stopped and started? (Choose 2 answers)
- The Elastic IP will be dissociated from the instance
- All data on instance-store devices will be lost
- All data on EBS (Elastic Block Store) devices will be lost
- The ENI (Elastic Network Interface) is detached
- The underlying host for the instance is changed
- Which of the following provides the fastest storage medium?
- Amazon S3
- Amazon EBS using Provisioned IOPS (PIOPS)
- SSD Instance (ephemeral) store (SSD Instance Storage provides 100,000 IOPS on some instance types, much faster than any network-attached storage)
- AWS Storage Gateway
References
AWS_EC2_Root_Device_Storage
Hi Jayendra
>>Data on the EBS volume is LOST only if the Root Volume is EBS backed and the Delete On Termination flag is *** disabled *** (enabled by default)
I think the statement should read “Delete On Termination flag is *** enabled ***”.
Cheers,
Satish
Thanks Satish, its different for Root EBS volumes and Attached EBS volumes. Simplified the description.
Hi Jayendra,
Data on the EBS volume is LOST
for EBS Root volume, if Delete On Termination flag is disabled (enabled, by default)
for attached EBS volumes, if the Delete On Termination flag is disabled, which is the default.
I understand the default behavior is different. Still data will be lost IFF the flag is enabled in both the cases correct ? if flag is “disabled” then data will not be “lost”. Correct ?
Thats right, the default selection of the flag differs. However, if the flag is disabled, meaning – Do Not Delete On Termination, the EBS volumes will not loss the data for Root or for Attach Volumes.
>> Data on the EBS volume is LOST
for attached EBS volumes, if the Delete On Termination flag is disabled, which is the default.
>> Data on EBS volume is NOT LOST in following scenarios :-
Termination of the Instance for the additional EBS volumes. Additional EBS volumes are detached with their data intact.
What’s the difference is both scenarios?
If the EBS backed instance has an additional EBS volume, on the termination of the actual instance, by default will the additional EBS vol data will be lost or kept intact?
The Delete on Termination flag value is different for the Root EBS Volume and the Attached EBS Volume. By default, the Root volume is deleted and the attached EBS volumes are just detached.
Data on the EBS volume is LOST
for EBS Root volume, if Delete On Termination flag is disabled (enabled, by default)
for attached EBS volumes, if the Delete On Termination flag is disabled, which is the default.
Data will not be LOST in both the cases.
– On EBS root volume, if the “Delete on Termination flag” is disabled – Data will not be lost.
– On EBS as attached volumes, “Delete on Termination flag” is disabled by default – Data will not be lost.
If the flag is disabled data will not be lost in either case.
– Flag is enabled by default on “EBS as root volume” and disabled on “EBS as attached volume” by default. If you want the data to persist, flag should be unchecked (disabled).
Your blog is awesome!!
For Root Volumes, the flag is enabled by default – meaning when the instance is terminated the volume is deleted on termination
However for Attached volumes, the flag is disable by default, so the volumes are not deleted on instance termination.
Default Behavior is different.
I believe that we are on the same page, but the wording is so confusing that it is meaning different and incorrect.
If possible can you please change point 5 and 6 (Ashish explanation seems to be more easy to read and understand).
Sure Malli, let me check and simply the sentences ….
In “Key points for EBS backed Instance”
5. Data on the EBS volume is LOST
a) for EBS Root volume, if Delete On Termination flag is disabled (enabled, by default)
b) for attached EBS volumes, if the Delete On Termination flag is disabled, which is the default.
Why will the data be lost on either root or attached volumes if “DeleteOnTermination” is disabled. As per my understanding the data is lost(the volume is deleted) only if the flag is enabled and the instance gets terminated.
Please correct me if I’m wrong.
Which of the following will occur when an EC2 instance in a VPC (Virtual Private Cloud) with an associated Elastic IP is stopped and started? (Choose 2 answers)
a. The Elastic IP will be dissociated from the instance
b. All data on instance-store devices will be lost
c. All data on EBS (Elastic Block Store) devices will be lost
d. The ENI (Elastic Network Interface) is detached
e. The underlying host for the instance is changed
According to you the answer is b and e
A user has launched an EBS backed EC2 instance. The user has rebooted the instance. Which of the below mentioned statements is not true with respect to the reboot action?
a. The private and public address remains the same
b. The Elastic IP remains associated with the instance
c. The volume is preserved
d. The instance runs on a new host computer
According to you the answer is d(why???)
Isn’t it contradicting with the above question???
I think the answer will be (A) because the public address will change as this question is not talking about VPC.
Instances launched outside a VPC, will get a new IP address.
the latter question asks for statement not being true. Hence the answer is D as the instance does not run a new host computer.
Stop and Start changes the underlying host.
But the public address will be changed after a restart… right?
Public address will not remain the same.
Got it.. Instance has been rebooted, not stopped.
But the public address will be changed after a restart… right?
Public address will not remain the same.
Q1, EC2 EBS-backed (EBS root) instance is stopped, what happens to the data on any ephemeral store volumes?
First part says root volume is EBS. So how come an “ephemeral store volumes” will be attached that instance??
You can have instance store attached to the EBS backed instances. These are data disks and not the root disks.
Statement from you:
An Instance store backed instance is an EC2 instance using an Instance store as root device volume created from a template stored in Amazon S3.
Answer for Q4 is
SSD Instance (ephemeral) store – which is ideally stored S3. !!??. So why the not the option 1?
I assume Option 3 provides more precision. !!
Instance store instance is created from S3 image. Once the instance is created it has actual SSD disks to work on it attached to the machine and hence they are the fastest.
as many people already noticed,
Data on the EBS volume is LOST
for EBS Root volume, if Delete On Termination flag is disabled (enabled, by default)
for attached EBS volumes, if the Delete On Termination flag is disabled, which is the default.
is incorrect. if the Delete On Termination flag is disabled, data will NOT be lost.
Please fix that.
the Delete on Termination flag has different defaults based on the root and attached volumes.
4. Which of the following provides the fastest storage medium?
a) Amazon S3
b) Amazon EBS using Provisioned IOPS (PIOPS)
c) SSD Instance (ephemeral) store (SSD Instance Storage provides 100,000 IOPS on some instance types, much faster than any network-attached storage)
d) AWS Storage Gateway
you marked answer C for this question, but there is not single reference to this in the article, can you provide relevant notes or links to that? putting a question that related to information you have not placed in the article doesn’t take much sense imo – of course you one google for details regarding that, but you could then separate such questions so people that are learning from your articles are aware, that they need external knowledge to answer questions in a dedicated section.
Instance store is Ephemeral store and the fastest storage medium. Will check on the missing pieces to make sure it is covered for better reference.