Create an ECI instance using a data cache

Updated at:

After you create a data cache, you can use it to create an ECI instance. This allows you to mount pre-loaded data directly to the instance, which eliminates data pull times and accelerates application startup.

Prerequisites

You have created a data cache. For more information, see Create a data cache.

Configuration

When you create an ECI instance by using a data cache, you can specify a data cache bucket and mount the data storage path as a HostPath volume. The system automatically creates and mounts a pay-as-you-go cloud disk. The capacity of this cloud disk matches the size of the data cache. The cloud disk is created and released along with the instance.

API

When you call the CreateContainerGroup API to create an ECI instance, the parameters for the data cache feature are shown in the table below. For more information, see CreateContainerGroup.

Note
  • DataCache parameters: DataCacheBucket is the only required parameter.

  • Volume parameters: This section lists only the required Volume parameters for using a data cache.

Parameter

Type

Example

Description

DataCacheBucket

String

default

Specifies the data cache bucket.

DataCachePL

String

PL1

The performance level of the cloud disk created for the data cache. By default, an ESSD is used, and the default performance level is PL1.

DataCacheProvisionedIops

Long

40000

The provisioned read and write IOPS of the ESSD AutoPL disk. Valid values: 0 to min{50000, 1000 * capacity - baseline performance}. Baseline performance = min{1800 + 50 * capacity, 50000}. For more information, see ESSD AutoPL disk.

If you specify this parameter, the cloud disk created for the data cache is an ESSD AutoPL disk.

DataCacheBurstingEnabled

Boolean

false

Specifies whether to enable performance burst for the ESSD AutoPL disk. For more information, see ESSD AutoPL disk.

If you specify this parameter, the cloud disk created for the data cache is an ESSD AutoPL disk.

Volume.N.Name

String

datacache-demo

A custom name for the volume.

Volume.N.Type

String

HostPathVolume

Set the value to HostPathVolume to create a HostPath volume.

Volume.N.HostPathVolume.Path

String

/test/data

The storage path of the data cache on the host node.

Container.N.VolumeMount.N.Name

String

datacache-demo

Must match the value of Volume.N.Name.

Container.N.VolumeMount.N.MountPath

String

/data

The directory within the container where the volume is mounted.

Mounting a volume overwrites any existing content in this path. Specify the path carefully.

Console

When you create an ECI instance in the Elastic Container Instance console, you can configure the data cache in the Data Cache section.

The Data Cache section includes settings such as the data cache bucket and the burst switch. Enabling burst significantly improves cache loading speed, but incurs additional charges for the loading time.

The following table describes the settings:

Parameter

Description

Data Cache Bucket

Enter the data cache bucket.

+Add

Click +Add. In the dialog box that appears, select a data cache, a target container, and a mount path.

Enable Burst

(Optional) Specifies whether to enable performance burst for an ESSD AutoPL disk. If you enable this option, the cloud disk created for the data cache is an ESSD AutoPL disk. For more information, see ESSD AutoPL disk.