Create an ECI instance using a data cache
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.
DataCache parameters:
DataCacheBucketis the only required parameter.Volume parameters: This section lists only the required Volume parameters for using a data cache.
Parameter | Type | Example | Description |
| String |
| Specifies the data cache bucket. |
| String |
| 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. |
| Long |
| 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. |
| Boolean |
| 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. |
| String |
| A custom name for the volume. |
| String |
| Set the value to |
| String |
| The storage path of the data cache on the host node. |
| String |
| Must match the value of |
| String |
| 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. |