When you create an ECI instance, you can use an image cache to speed up image pulls and reduce the ECI instance startup time. This topic describes how to use an image cache to accelerate ECI instance creation.
Background information
You can use an image cache to create an ECI instance in one of the following ways:
-
Automatic Match
The system automatically matches the optimal image cache to create the instance based on a matching policy. If no match is found, the system automatically creates an image cache while creating the instance.
-
Explicit Specification
You explicitly specify an image cache to create the instance. The image cache must be in the Ready state.
For more information, see Image cache overview.
Automatically match an image cache
Create an instance by using OpenAPI
When you call the CreateContainerGroup operation to create an ECI instance, you can set the AutoMatchImageCache parameter to enable automatic image cache matching. The following table describes the parameter. For more information, see CreateContainerGroup.
|
Parameter |
Type |
Example |
Description |
|
AutoMatchImageCache |
Boolean |
true |
Specifies whether to enable automatic image cache matching. |
Create an instance by using the console
-
In the Elastic Container Instance console, go to the Container Group page and click Create Container Group.
-
Configure the instance parameters.
In the Container Group Configuration section, expand Advanced Settings, and then select Automatically Match Image Cache. The system automatically matches and uses the optimal image cache. If no match is found, the system automatically creates an image cache.
The Automatically Match Image Cache feature does not incur additional fees.
-
Click Confirm Configuration and complete the instance creation process.
Explicitly specify an image cache
When you call the CreateContainerGroup operation to create an ECI instance, you can use the ImageSnapshotId parameter to explicitly specify an image cache. The following table describes the parameter. For more information, see CreateContainerGroup.
You can explicitly specify an image cache only by using OpenAPI. This option is not available in the console.
|
Parameter |
Type |
Example |
Description |
|
ImageSnapshotId |
String |
imc-2zebxkiifuyzzlhl**** |
Specifies the ID of the image cache. |
Verify the result
In the Elastic Container Instance console, go to the Container Group page and click the ID of the ECI instance to open its details page. On the Events tab, an event shows that an image cache was matched. The image pull time is nearly zero, and the instance starts within seconds.