Amazon EC2 instance store - Amazon Elastic Compute Cloud
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Amazon EC2 instance store

An instance store provides temporary block-level storage for your instance. This storage is located on disks that are physically attached to the host computer. Instance store is ideal for temporary storage of information that changes frequently, such as buffers, caches, scratch data, and other temporary content. It can also be used to store temporary data that you replicate across a fleet of instances, such as a load-balanced pool of web servers.

An instance store consists of one or more instance store volumes exposed as block devices. The size of an instance store as well as the number of devices available varies by instance type and instance size. For more information, see Instance store volumes.

The virtual devices for instance store volumes are ephemeral[0-23]. Instance types that support one instance store volume have ephemeral0. Instance types that support two or more instance store volumes have ephemeral0, ephemeral1, and so on.


      Amazon EC2 instance storage
Instance store pricing

Instance store volumes are included as part of the instance's usage cost.

Instance store volume and data lifetime

The number, size, and type of instance store volumes are determined by the instance type and instance size. For more information, see Instance store volumes.

Instance store volumes are attached only at instance launch. You can't attach instance store volumes after launch. You can’t detach an instance store volume from one instance and attach it to a different instance.

An instance store volume exists only during the lifetime of the instance to which it is attached. You can’t configure an instance store volume to persist beyond the lifetime of its associated instance.

The data on an instance store volume persists even if the instance is rebooted. However, the data does not persist if the instance is stopped, hibernated, or terminated. When the instance is stopped, hibernated, or terminated, every block of the instance store volume is cryptographically erased.

Therefore, do not rely on instance store volumes for valuable, long-term data. If you need to retain the data stored on an instance store volume beyond the lifetime of the instance, you need to manually copy that data to more persistent storage, such as an Amazon EBS volume, an Amazon S3 bucket, or an Amazon EFS file system.

There are some events that can result in your data not persisting throughout the lifetime of the instance. The following table indicates whether data on instance store volumes is persisted during specific events, for both virtualized and bare metal instances.

Event What happens to your data?
User-initiated instance lifecycle events
The instance is rebooted The data persists
The instance is stopped The data does not persist
The instance is hibernated The data does not persist
The instance is terminated The data does not persist
The instance type is changed The data does not persist *
A Windows AMI is created from the instance The data does not persist in the created AMI **
An EBS-backed AMI is created from the instance The data does not persist in the created AMI **
An instance store-backed AMI is created from the instance The data persists in the AMI bundle uploaded to Amazon S3 ***
User-initiated OS events
A shutdown is initiated The data does not persist †
A restart is initiated The data persists
Amazon scheduled events
Instance stop The data does not persist
Instance reboot The data persists
System reboot The data persists
Instance retirement The data does not persist
Unplanned events
Simplified automatic recovery The data does not persist
CloudWatch action based recovery The data does not persist
The underlying disk fails The data on the failed disk does not persist
Power failure The data persists upon reboot

* If the new instance type supports instance store, the instance gets the number of instance store volumes supported by the new instance type, but the data does not transfer to the new instance. If the new instance type does not support instance store, the instance does not get the instance store volumes.

** The data is not included in the EBS-backed AMI, and it is not included on instance store volumes attached to instances launched from that AMI.

*** The data is included in the AMI bundle that is uploaded to Amazon S3. When you launch an instance from that AMI, the instance gets the instance store volumes bundled in the AMI with the data they contained at the time the AMI was created.

† Termination protection and stop protection do not protect instances against instance stops or terminations as a result of shutdowns initiated through the operating system on the instance. Data stored on instance store volumes does not persist in both instance stop and termination events.

Instance store volumes

The number, size, and type of instance store volumes are determined by the instance type and instance size. Some instance types, such as M6, C6, and R6, do not support instance store volumes, while other instance types, such as M5d, C6gd, and R6gd, do support instance store volumes. You can’t attach more instance store volumes to an instance than is supported by its instance type. For the instance types that do support instance store volumes, the number and size of the instance store volumes vary by instance size. For example, m5d.large supports 1 x 75 GB instance store volume, while m5d.24xlarge supports 4 x 900 GB instance store volumes.

For instance types with NVMe instance store volumes, all of the supported instance store volumes are automatically attached to the instance at launch. For instance types with non-NVMe instance store volumes, such as C1, C3, M1, M2, M3, R3, D2, H1, I2, X1, and X1e, you must manually specify the block device mappings for the instance store volumes that you want to attach at launch. Then, after the instance has launched, you must format and mount the attached instance store volumes before you can use them. You can't attach an instance store volume after you launch the instance.

Some instance types use NVMe or SATA-based solid state drives (SSD), while others use SATA-based hard disk drives (HDD). SSDs deliver high random I/O performance with very low latency, but you don't need the data to persist when the instance terminates or you can take advantage of fault-tolerant architectures. For more information, see SSD instance store volumes.

The data on NVMe instance store volumes and some HDD instance store volumes is encrypted at rest. For more information, see Data protection in Amazon EC2.

To retrieve instance store volume information using the Amazon CLI

You can use the describe-instance-types Amazon CLI command to display information about an instance type, such as its instance store volumes. The following example displays the total size of instance storage for all R5 instances with instance store volumes.

aws ec2 describe-instance-types \ --filters "Name=instance-type,Values=r5*" "Name=instance-storage-supported,Values=true" \ --query "InstanceTypes[].[InstanceType, InstanceStorageInfo.TotalSizeInGB]" \ --output table

Example output

--------------------------- | DescribeInstanceTypes | +----------------+--------+ | r5ad.24xlarge | 3600 | | r5ad.12xlarge | 1800 | | r5dn.8xlarge | 1200 | | r5ad.8xlarge | 1200 | | r5ad.large | 75 | | r5d.4xlarge | 600 | . . . | r5dn.2xlarge | 300 | | r5d.12xlarge | 1800 | +----------------+--------+

The following example displays the complete instance storage details for the specified instance type.

aws ec2 describe-instance-types \ --filters "Name=instance-type,Values=r5d.4xlarge" \ --query "InstanceTypes[].InstanceStorageInfo"

The example output shows that this instance type has two 300 GB NVMe SSD volumes, for a total of 600 GB of instance storage.

[ { "TotalSizeInGB": 600, "Disks": [ { "SizeInGB": 300, "Count": 2, "Type": "ssd" } ], "NvmeSupport": "required" } ]