All Products
Search
Document Center

Elastic Container Instance:Create an instance with local disks

Last Updated:Jun 20, 2026

This topic describes how to create an elastic container instance (ECI) by specifying an ECS instance type that has local disks, and how to mount the local disks.

Specifications

A local disk is a local hard drive on the physical machine where the instance resides. Local disks offer low latency, high random input/output operations per second (IOPS), high throughput, and excellent value. However, because a local disk is part of a single physical machine, it is susceptible to single points of failure. For more information, see Local disks.

Important

Local disks are part of a single physical machine. Therefore, data reliability depends on the reliability of the physical machine. This creates a risk of single points of failure. For more information, see Notes on local disks.

The following ECS instance families with local disks are supported:

Category

Instance family

Local SSD

i4, i4g, i3, i3g, i2, i2g

Big data

d1

Network-enhanced big data

d1ne

GPU-accelerated compute-optimized

gn5

Note

gn5 is a GPU-accelerated instance type. If you select this instance family, you must also specify GPU-related parameters in addition to local disk-related parameters.

For more information about ECS instance types, see the following topics:

Configuration

Note

You can create an ECI with local disks and mount them only by using OpenAPI. This action is not supported in the ECI console.

When you call the CreateContainerGroup API, you can use the InstanceType parameter to specify the instance type and the Volume parameters to mount local disks. The following tables describe the parameters. For more information, see CreateContainerGroup.

  • Create an instance and define a local disk volume

    Parameter

    Type

    Example

    Description

    InstanceType

    String

    ecs.i2g.2xlarge

    Specifies the ECS instance type for the ECI. This instance type must have local disks. Supported instance families: i4, i4g, i3, i3g, i2, i2g, d1, d1ne, and gn5.

    You can specify up to five instance types at a time. Separate multiple instance types with commas (,). Example: ecs.d1.2xlarge,ecs.d1ne.2xlarge.

    Volume.N.Name

    String

    localdisk

    The name of the volume.

    Volume.N.Type

    String

    EmptyDirVolume

    The type of the volume. Set this parameter to EmptyDirVolume to create an EmptyDir volume.

    Volume.N.EmptyDirVolume.Medium

    String

    LocalRaid0

    The storage medium of the EmptyDir volume. Set the value to LocalRaid0 to combine the local disks into a RAID 0 array.

  • Mount the RAID 0 local disk

    Parameter

    Type

    Example

    Description

    Container.N.VolumeMount.N.Name

    String

    localdisk

    The name of the volume to mount to the container. This value must match the value of Volume.N.Name.

    Container.N.VolumeMount.N.MountPath

    String

    /localdisk-test

    The mount path.

    The volume's content overwrites any existing data at the specified mount path within the container. Ensure you specify the correct path.

Sample configuration:

  1. Create an instance with a local disk.

    The following example shows the parameters for a CreateContainerGroup API call:

    ContainerGroupName=test-localdisk
    # Specify the ECS instance type with local disks.
    InstanceType=ecs.i2g.2xlarge
    # Define the RAID 0 volume composed of local disks.
    Volume.1.Name=localdisk
    Volume.1.Type=EmptyDirVolume
    Volume.1.EmptyDirVolume.Medium=LocalRaid0
    # Mount the local disk to the container.
    Container.1.Name=nginx
    Container.1.Image=registry-vpc.cn-hangzhou.aliyuncs.com/eci_open/nginx:1.14.2
    Container.1.VolumeMount.1.Name=localdisk
    Container.1.VolumeMount.1.MountPath=/localdisk-test
  2. Verify that the local disk is mounted.

    Connect to the instance and run the df -h command to view mount details for the RAID 0 local disk. The output shows that a RAID 0 array (/dev/md0) is created from the local disk and mounted to the specified /localdisk-test path.

    root@test-localdisk:/# df -h
    Filesystem      Size  Used Avail Use% Mounted on
    overlay          30G  4.1G   26G  14% /
    tmpfs            64M     0   64M   0% /dev
    tmpfs            16G     0   16G   0% /sys/fs/cgroup
    /dev/md0        879G   77M  835G   1% /localdisk-test
    /dev/vda4        30G  4.1G   26G  14% /etc/hosts
    overlay         8.8G  4.8G  3.6G  58% /etc/hostname
    shm              64M     0   64M   0% /dev/shm
    tmpfs            16G     0   16G   0% /proc/acpi
    tmpfs            16G     0   16G   0% /sys/firmware