All Products
Search
Document Center

Elastic Container Instance:Overview of data volumes

Last Updated:Apr 01, 2026

Elastic Container Instance (ECI) supports mounting volumes for persistent and temporary storage. This topic describes the supported volume types and how to declare and mount them using the API or the ECI console.

Why you need volumes

By default, container filesystems are ephemeral: data written inside a container exists only as long as the container itself. This creates two practical problems:

  • Data loss on restart: When a container crashes and restarts, all files written during the previous run are gone.

  • No cross-container sharing: Containers in the same elastic container instance cannot share files through the local filesystem.

Volumes solve both problems by providing storage that persists independently of the container lifecycle.

Volume types

ECI supports five volume types to cover different storage needs. Common use cases include:

  • Persisting database files so data survives container restarts

  • Sharing configuration files or log data across containers in the same instance

  • Storing unstructured data such as images and media files in object storage

  • Providing temporary scratch space for intermediate processing results

  • Injecting configuration data into a container

Choose a volume type based on two key criteria: whether data must survive a restart, and whether multiple instances need simultaneous access.

Volume typeDescriptionPersistenceAPI modeConsole mode
DiskBlock storage with low latency, high performance, high durability, and high reliability. Suitable for databases and middleware. Can be mounted to one instance only — not a shared storage type.PersistentSupportedNot supported
NASDistributed file system (File Storage NAS) with shared access and auto scaling. Suitable for data sharing across instances, big data analysis, web applications, and log storage. Data is retained when the instance is deleted.PersistentSupportedSupported
OSSObject storage (Object Storage Service) for unstructured data such as images and media files. Supports shared access across instances. Mounted via ossfs (a FUSE-based client). Optimized for reads — avoid write-intensive workloads. Data is retained when the instance is deleted.PersistentSupportedSupported
emptyDirTemporary scratch space scoped to the container group. Data is cleared when the elastic container instance restarts.EphemeralSupportedSupported
ConfigFilePasses configuration data into the container group.EphemeralSupportedSupported
OSS volumes are mounted using ossfs, which is implemented as a Filesystem in Userspace (FUSE). For write-intensive workloads, use NAS or other volumes instead.

Configure volumes

Configuring a volume is a two-step process: declare the volume at the container group level, then mount it into a specific container. The declaration uses Volume.N.Name and Volume.N.Type; the mount uses Container.VolumeMount-related parameters.

API mode

When calling the CreateContainerGroup operation, declare each volume using the Volume.N.Name and Volume.N.Type parameters, then mount it using the Container.VolumeMount-related parameters.

The following table lists the supported values for Volume.N.Type.

Volume.N.Type valueVolume typeReferences
EmptyDirVolumeemptyDir (temporary directory)Mount an emptyDir volume
ConfigFileVolumeConfigFile (configuration file)Mount a ConfigFile volume
NFSVolumeNFS (NAS file system)Mount a NAS volume
FlexVolumeFlexVolume plug-in — supports Disk, NAS, and OSSMount a disk volume, Mount a NAS volume, and Mount an OSS bucket to an elastic container instance as a volume
DiskVolume is also a valid Volume.N.Type value, but it is not recommended. Use FlexVolume to mount a disk.

Console mode

When creating an elastic container instance on the Elastic Container Instance buy page, configure volumes in Container Group Configurations, then mount them in Container Configurations.

  1. In the Container Group Configurations section, click Advanced Settings and specify a volume. The console supports the following volume types:

    • Configuration item (ConfigFile)

    • Temporary directories (emptyDir)

    • NAS persistence (NFS)

    • OSS persistence (FlexVolume)

    Volumes

  2. In the Container Configurations section, click Advanced Settings next to a container to mount the volume.

    Volume mount settings

Disk volumes are not supported in the console. Use the API to mount a disk.