All Products
Search
Document Center

Elastic Container Instance:CreateDataCache

Last Updated:Oct 19, 2026

Creates a data cache.

Operation description

  • Creating an image cache incurs resource fees. Learn about the relevant billing information in advance. For more information, see Data cache billing.

  • Before creating an image cache, you must evaluate the size of the cached data. If the data size exceeds the configured cache size, the creation fails.

  • When you create a data cache, the system initiates the automatic creation of an Elastic Container Instance (ECI) and an ESSD cloud disk for the intermediate creation of the data cache. Do not delete the ECI instance or the cloud disk during the creation process. Otherwise, the data cache creation fails.

  • Creating a data cache generates a corresponding snapshot. Do not delete the snapshot. Otherwise, the data cache becomes invalid.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

eci:CreateDataCache

create

*DataCache

acs:eci:{#regionId}:{#accountId}:datacache/*

  • eci:tag
None

Request parameters

Parameter

Type

Required

Description

Example

RegionId

string

Yes

The region ID.

cn-hangzhou

SecurityGroupId

string

No

The ID of the security group to which the ECI instance generated during the data cache creation process belongs.

sg-2ze81zoc3yl7a3we****

VSwitchId

string

No

The ID of the vSwitch to which the ECI instance generated during the data cache creation process belongs.

vsw-bp1jrgfqqy54kg5hc****

Bucket

string

No

The storage bucket for the data. Default value: default. You can specify a custom bucket to group business data and avoid path conflicts.

Note

eci-system is reserved for ECI and cannot be used.

default

Path

string

No

The path where the data is stored.

/model/test

Name

string

No

The name of the data cache.

test

Size

integer

No

The size of the data cache. Unit: GiB. Default value: 20. Evaluate the required size based on the actual data volume.

30

DataSource

object

No

The data source.

Type

string

No

The type of the data source. Valid values:

  • URL: a URL, or a model or dataset from ModelScope or Hugging Face. Configuration keys include url, accessToken, repoSource, repoId, and revision.

  • NAS: a NAS file system. Configuration keys include server, path, vers, and options.

  • OSS: an OSS bucket. Configuration keys include bucket, url, path, otherOpts, ramRole, akId, and akSecret.

  • SNAPSHOT: an Alibaba Cloud snapshot. The configuration key is snapshotId.

Valid values:

  • NAS :

    NAS

  • SNAPSHOT :

    SNAPSHOT

  • URL :

    URL

  • OSS :

    OSS

URL

Options

object

No

The configuration parameters of the data source.

string

No

The configuration parameters of the data source. The parameters vary based on the data source type. For more information about data source types and their configuration parameters, see Create a data cache.

{ "#10#repoSource": "HuggingFace/Model", "#6#repoId": "stabilityai/stable-diffusion-2-1" }

RetentionDays

integer

No

The retention period in days. The data cache is cleared after it expires. By default, the data cache does not expire.

7

Tag

array<object>

No

The list of tags bound to the data cache.

object

No

The list of tags bound to the data cache.

Key

string

No

The tag key.

testkey

Value

string

No

The tag value.

testvalue

ResourceGroupId

string

No

The ID of the resource group.

rg-2df3isufhi38****

ClientToken

string

No

The client token that is used to ensure the idempotence of the request. You can use the client to generate the value, but you must ensure that it is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length. For more information, see How to ensure idempotence.

123e4567-****-12d3-****-426655440000

EipInstanceId

string

No

The ID of the existing Elastic IP Address (EIP) to bind. If the VPC is not configured with a NAT gateway, you can bind an EIP to pull data from the Internet.

eip-uf66jeqopgqa9hdn****

EipCreateParam

object

No

The configurations for creating and binding an Elastic IP Address (EIP). If the VPC is not configured with a NAT gateway, you can bind an EIP to pull data from the Internet.

Bandwidth

integer

No

The bandwidth of the EIP. Unit: Mbit/s. Default value: 5.

10

CommonBandwidthPackage

string

No

The ID of the existing Internet Shared Bandwidth instance to bind.

cbwp-2zeukbj916scmj51m****

InternetChargeType

string

No

The metering method of the EIP. Valid values:

  • PayByBandwidth: pay-by-bandwidth

  • PayByTraffic: pay-by-traffic

PayByTraffic

PublicIpAddressPoolId

string

No

The ID of the IP address pool. The EIP is allocated from this IP address pool. The IP address pool feature is not enabled by default. To use this feature, apply for the privilege quota of the IP address pool feature in Quota Center.

pippool-2vc4xdtjhwl4t0go5****

ISP

string

No

The line type of the EIP. Valid values:

  • BGP: The BGP (multi-ISP) line. This is the default value.

  • BGP_PRO: The BGP (multi-ISP) Pro line.

BGP

Response elements

Element

Type

Description

Example

object

RequestId

string

The request ID.

D81A4A13-6DCC-4579-AC62-90A6C3EC7BBC

DataCacheId

string

The data cache ID.

edc-bp15l4vvys94oo******

Examples

Success response

JSON format

{
  "RequestId": "D81A4A13-6DCC-4579-AC62-90A6C3EC7BBC",
  "DataCacheId": "edc-bp15l4vvys94oo******"
}

Error codes

HTTP status code

Error code

Error message

Description

400 Account.Arrearage Your account has an outstanding payment. Your account has an outstanding payment.
400 DryRunOperation Request validation has been passed with DryRun flag set. Request validation has been passed with DryRun flag set.
400 InvalidParameter.CPU.Memory The specified cpu and memory are not allowed
400 IncorrectStatus %s The specified instance status is invalid.
400 ServiceNotEnabled %s The service on which this request depends has not been activated. Please activate and try again.
400 DiskVolume.NotSupport The disk volume is not supported. Disk volume does not support your structure. If you want to enable this function, contact us.
400 RamRole.NotSupport The RAM role is not supported. The RAM role is not supported.
400 ImageCache.IncorrectStatus %s The image cache is not in the correct state.
400 ImageCacheNotSupport Image cache is not available for all users. If you want to enable this function, contact us. Container image cache is currently not available to all users. Submit a ticket if you need to use the feature.
400 EipAddressPoolIpNotEnough The ip address of specified PublicIpAddressPool is not enough. The specified EIP public address pool does not have sufficient address resources.
400 DryRun.Success This request is a dryrun request with successful result. The dry run request has passed validation.
403 OperationDenied.VswZoneMisMatch The specified VSwitchId is not in the specified Zone.
403 QuotaExceeded %s quota exceeded.
403 Zone.NotOnSale The specified zone is not available for purchase. The zone in which you want to create the instance is no longer available for purchase. Use a different zone, or the vSwitch of the specified VPC cannot be used in this zone.
403 Forbidden.RiskControl This operation has been identified as an abnormal operation and cannot be processed. This operation has been identified as abnormal and cannot be processed.
403 Forbidden.SubUser The specified action is not available for you.
403 Forbidden.OnlyForInvitedTest Eci create action is only open to invited users during public beta.
403 OperationDenied.SecurityGroupMisMatch The specified VSwitchId and SecurityGroupId are not in the same VPC.
403 InvalidVSwitchId.IpNotEnough The specified VSwitch does not have enough IP addresses.
403 Forbidden.UserBussinessStatus This operation is not allowed, because you have overdue bills. Pay the overdue bill and try again. The operation is forbidden because the account has an overdue payment. Top up your account and try again.
403 Forbidden.UserNotRealNameAuthentication This operation is not allowed, because you have not passed the real-name verification. The operation is forbidden because the user has not completed real-name verification.
403 InvalidUser.PassRoleForbidden The RAM user is not authorized to assume a RAM role. The RAM user is not authorized to assume a RAM role.
403 OperationDenied.NoStock Sales of this resource are temporarily suspended in the specified zone. We recommend that you use the multi-zone creation function to avoid the risk of insufficient resource. For more information, see https://www.alibabacloud.com/help/document_detail/157290.html
403 NoPermission The RAM role AliyunECIContainerGroupRole does not belong to eci.aliyuncs.com. Please check and try again.
403 SecurityRisk.3DVerification We have detected a security risk with your default credit or debit card. Please proceed with verification via the link in your email. A security risk has been detected on your default credit or debit card. Verify your card by using the link in the email.
403 CreateServiceLinkedRole.Denied Please make sure the account has ram:CreateServiceLinkedRole permission. Please make sure the account has ram:CreateServiceLinkedRole permission.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.