All Products
Search
Document Center

Elastic Container Instance:Volume overview

Last Updated:Jun 20, 2026

Elastic container instances support volumes for persistent storage. This topic describes the supported volume types and their configuration.

Volumes

Files in a container are temporarily stored on disk, which causes the following problems for applications:

  • When a container crashes, its files are lost when the container is recreated.

  • Multiple containers in the same elastic container instance cannot share files.

To address these issues, Elastic Container Instance (ECI) uses volumes. The following volume types are supported:

Type

Description

OpenAPI

Console

cloud disk

A cloud disk is a block-level storage product provided by Alibaba Cloud. It features low latency, high performance, persistence, and high reliability. For more information, see Cloud disk overview.

cloud disk volumes are suitable for the following use cases:

  • High-I/O, low-latency workloads

    A cloud disk features low latency and high performance, making it ideal for applications with high I/O and latency requirements, such as databases and middleware.

  • Scenarios that do not require shared storage

    A cloud disk provides non-shared storage and can be mounted to only one instance.

Supported

Not supported

NAS

File Storage NAS is a distributed file system provided by Alibaba Cloud that features shared access, elastic scaling, high reliability, and high performance. For more information, see File Storage NAS overview.

NAS volumes are suitable for the following use cases:

  • Data sharing

    Data in a NAS volume persists even after the instance is deleted, enabling data sharing between instances.

  • Big data analytics

    NAS provides high data throughput, meeting the shared storage access requirements of many batch processing jobs.

  • Web applications

    Storage for web applications and content management systems.

  • Log storage

    If you want to store logs persistently, we recommend that you use NAS volumes.

Supported

Supported

OSS

Object Storage Service (OSS) is a service provided by Alibaba Cloud that offers massive, secure, cost-effective, and highly reliable storage. It is suitable for storing unstructured data, such as images, audio, and videos. For more information, see Object Storage Service overview.

An OSS volume is suitable for the following use cases:

  • Data sharing

    Data in an OSS volume persists even after the instance is deleted, enabling data sharing between instances.

  • Read-only scenarios for web and application configuration files

    The network performance of ossfs is suboptimal, but it can support read operations on small files.

  • Read-only scenarios for media files such as images, audio, and videos

    OSS is suitable for storing and reading unstructured data, such as images, audio, and videos.

    Note

    OSS volumes are mounted using ossfs, which relies on Filesystem in Userspace (FUSE). Because ossfs provides limited write stability, use other volume types, such as NAS, for write-intensive scenarios.

Supported

Supported

emptyDir

An emptyDir volume is a temporary directory used to store transient data and share data between containers. The data in an emptyDir volume is lost when the instance is deleted.

Important

Restarting an elastic container instance also clears the data in the emptyDir volume.

Supported

Supported

ConfigFile

A ConfigFile volume injects configuration data into an elastic container instance.

Supported

Supported

Configuration

To use a volume, first declare it, and then mount it to a container.

OpenAPI

When calling the CreateContainerGroup operation, use the Volume.N.Name and Volume.N.Type parameters to define a volume. The value of Volume.N.Type determines the volume type, and each type requires specific additional parameters.

Volume.N.Type value

Description

References

EmptyDirVolume

An emptyDir volume, which is a temporary directory.

Mount an emptyDir volume

ConfigFileVolume

A ConfigFile volume, which is a configuration file.

Mount a ConfigFile volume

NFSVolume

An NFS volume, which is a network file system such as NAS.

Mount a NAS volume

FlexVolume

The FlexVolume plug-in extends storage capabilities, allowing you to mount cloud disks, NAS file systems, and OSS buckets.

Note

DiskVolume is also a valid value for Volume.N.Type, which indicates a cloud disk volume. However, this value is no longer recommended. Use FlexVolume to mount a cloud disk instead.

After declaring a volume, use the Container.VolumeMount parameters to mount it to a container.

Console

When creating an ECI instance on the Elastic Container Instance buy page, declare volumes in the Container Group Configurations section and mount them to containers in the Container Configurations section.

  1. In the Container Group Configurations section, go to the Advanced Settings area and declare a volume.

    In the Storage area, select the NAS Persistence tab and click + Add. Configure a volume name (for example, nas-demo), a NAS mount point (for example, 37f3848bfd-dfh88.cn-shanghai.nas.aliyuncs.com), and a path (for example, /share). You can select the Read-only checkbox if needed.

    Currently, you can configure only the following volume types in the console:

    • ConfigFile

    • emptyDir

    • NAS persistence (NFS)

    • OSS persistence (FlexVolume)

  2. In the Container Configurations section, go to the Advanced Settings of a container to mount the volume.

    In the Storage area, enable the storage switch. Select the nas-demo volume (type: NAS persistence). Set the mount path in the container to /data and the subpath in the volume to /test. Do not select the Read-only checkbox.