309

I am trying to stop a Amazon EC2 instance and get the warning message

Warning: Please note that any data on the ephemeral storage of your instance will be lost when it is stopped.

My Question

What data is stored in ephemeral storage of an Amazon EC2 instance?

7 Answers 7

278
Answer recommended by AWS Collective

Basically, root volume (your entire virtual system disk) is ephemeral, but only if you choose to create AMI backed by Amazon EC2 instance store.

If you choose to create AMI backed by EBS then your root volume is backed by EBS and everything you have on your root volume will be saved between reboots.

If you are not sure what type of volume you have, look under EC2->Elastic Block Store->Volumes in your AWS console and if your AMI root volume is listed there then you are safe. Also, if you go to EC2->Instances and then look under column "Root device type" of your instance and if it says "ebs", then you don't have to worry about data on your root device.

More details here: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/RootDeviceStorage.html

Sign up to request clarification or add additional context in comments.

8 Comments

This probably wouldn't confuse people so much, if AWS wasn't giving the unnecessary warning message "that any data on the ephemeral storage of your instance will be lost" even when attempting to stop an instance, that IS using an EBS backed root device, and there is actually no reason to worry about any data loss.
the warning applies because you can have both an BS backed root AND an ephemeral storage attached (manually as aws doesnt do so by default)
Just to follow up, for some reason mysqld service stopped running. Support said this is not normal, but that was the only issue.
@Tilman Exactly what I was thinking. The warning is not only unnecessary, it is misleading as well. Thanks for pointing it out.
Keep in mind that NVMe SSD volumes are going to be lost when the instance is stopped: docs.aws.amazon.com/AWSEC2/latest/UserGuide/… The data on NVMe instance storage is encrypted using an XTS-AES-256 block cipher implemented in a hardware module on the instance. The encryption keys are generated using the hardware module and are unique to each NVMe instance storage device. All encryption keys are destroyed when the instance is stopped or terminated and cannot be recovered. You cannot disable this encryption and you cannot provide your own encryption key.
|
156

Anything that is not stored on an EBS volume that is mounted to the instance will be lost.

For example, if you mount your EBS volume at /mystuff, then anything not in /mystuff will be lost. If you don't mount an ebs volume and save stuff on it, then I believe everything will be lost.

You can create an AMI from your current machine state, which will contain everything in your ephemeral storage. Then, when you launch a new instance based on that AMI it will contain everything as it is now.

Update: to clarify based on comments by mattgmg1990 and glenn bech:

Note that there is a difference between "stop" and "terminate". If you "stop" an instance that is backed by EBS then the information on the root volume will still be in the same state when you "start" the machine again. According to the documentation, "By default, the root device volume and the other Amazon EBS volumes attached when you launch an Amazon EBS-backed instance are automatically deleted when the instance terminates" but you can modify that via configuration.

13 Comments

Can you help me with how can I see the content of ephemeral storage at any point in time?
everything on the instance would be in ephermeral storage unless you have configured and mounted an ebs volume and are consciously putting your data on it.
Does this only apply to instance store devices? That is, on an ebs device, is my root storage drive ephemeral or not?
This answer is not exactly correct, where your data is stored depends on what type of AMI you chose to create. The below answer by @nidalpres is more complete. If you chose to create an AMI backed by EBS, then your root directory is NOT stored in ephemeral storage.
I would just like to add that I think that @nidalpres wrote a better answer, or at the very least one that is a lot easier to grasp.
|
7

To be clear and answer @Dean's question: EBS-type root storage doesn't seem to be ephemeral. Data is persistent across reboots and actually it doesn't make any sense to use ebs-backed root volume which is 'ephemeral'. This wouldn't be different from image-based root volume.

1 Comment

All EBS-backed storage is persistent, eg non-ephemeral, after you "Stop" the instance. If you "Terminate" you will lose the data. Please see stackoverflow.com/a/11566285/46249.
1

For EC2 instance

Stop & Start != Reboot

so for ephemeral storage (Instance Store) Stop cause data lost Reboot will not

Comments

1

refer: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/InstanceStorage.html#instance-store-volumes

The data in an instance store persists only during the lifetime of
 its associated instance. If an instance reboots (intentionally or
 unintentionally), data in the instance store persists. However, 
data in the instance store is lost under any of the following
 circumstances:

- The underlying disk drive fails

- The instance stops

- The instance hibernates

- The instance terminates

Comments

0

According to AWS documentation [https://aws.amazon.com/premiumsupport/knowledge-center/instance-store-vs-ebs/] instance store volumes is not persistent through instance stops, terminations, or hardware failures. Any AMI created from instance stored disk doesn't contain data present in instance store so all instances launched by this AMI will not have data stored in instance store. Instance store can be used as cache for applications running on instance, for all persistent data you should use EBS.

Comments

0

ephemeral is just another name of root volume when you launch Instance from AMI backed from Amazon EC2 instance store

So Everything will be stored on ephemeral.

if you have launched your instance from AMI backed by EBS volume then your instance does not have ephemeral.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.