All Products
Search
Document Center

Tair (Redis® OSS-Compatible):CreateInstances

Last Updated:Mar 30, 2026

Creates classic edition instances of ApsaraDB for Tair (Redis-compatible) in a batch.

Operation description

Before calling this API, review the billing methods and [pricing](54532) of ApsaraDB for Tair (Redis-compatible). > This API supports only creating Classic Edition instances. To create a single instance, use one of the following APIs: > - [CreateInstance](473757): Creates open source Redis instances or DRAM-based Classic Edition instances of Tair. > - [CreateTairInstance](473770): Creates Cloud-native Edition instances of Tair, including DRAM-based, persistent memory-optimized, and ESSD-based instances.

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

kvstore:CreateInstances

create

*DBInstance

acs:kvstore:{#regionId}:{#accountId}:instance/*

  • kvstore:InstanceClass
  • kvstore:InstanceType
  • kvstore:Appendonly
None

Request parameters

Parameter

Type

Required

Description

Example

Instances

string

Yes

The configurations of the new instances, specified in JSON format. For more information, see the details of the Instances parameter.

[{ "RegionId": "cn-hangzhou", "izNo": "cn-hangzhou-b", "quantity": 1, "instanceType": "Redis", "instanceClass": "redis.logic.sharding.1g.2db.0rodb.4proxy.default", "EngineVersion": "5.0", "ChargeType":"PrePaid", "Period":"1", "networkType": "VPC" , "vpcId": "vpc-2zex6u1nu32k3ux35oxxx", "vSwitchId": "vsw-2zesk464e647104kw3xxx" }]

Token

string

No

A client-generated token to ensure request idempotence. The value must be unique across requests, case-sensitive, and up to 64 ASCII characters long.

ETnLKlblzczshOTUbOCz****

AutoPay

boolean

No

Specifies whether to enable automatic payment. Valid values: * true: Enables automatic payment. This is the default value. * false: Disables automatic payment. You must go to the console to complete the payment. In the top navigation bar, choose Expenses > Renewal Management. In the navigation pane on the left, click Or*er Management > My Or*ers, find the or*er, and then complete the payment. > This parameter is valid only when ChargeType is set to PrePaid in Instances.

true

BusinessInfo

string

No

Additional business information.

000000000

CouponNo

string

No

The coupon code. The default value is youhuiquan_promotion_option_id_for_blank.

youhuiquan_promotion_option_id_for_blank

EngineVersion

string

No

The Redis-compatible engine version for the instance. Valid values: 4.0 and 5.0. The default value is 5.0.

5.0

RebuildInstance

boolean

No

Specifies whether to rebuild an instance from the recycle bin. Valid values: * true: Rebuilds the instance. * false: Does not rebuild the instance. This is the default value. > This parameter is valid only when SrcDBInstanceId is specified in Instances.

false

AutoRenew

string

No

Specifies whether to enable auto-renewal for the instance. Valid values: * true: Enables auto-renewal. * false: Disables auto-renewal. This is the default value. > This parameter is valid only when ChargeType is set to PrePaid in Instances.

false

ResourceGroupId

string

No

The resource group ID.

rg-resourcegroupid1

Parameter Type Required Example value Description
RegionId String Yes cn-hangzhou The ID of the region in which to create the instance. You can call the DescribeRegions operation to query the latest list of available regions.
izNo String Yes cn-hangzhou-b The ID of the primary availability zone for the instance. You can find available availability zones by calling the DescribeRegions operation.
quantity Integer No 1 The number of instances to create. Valid values: 1 to 300. Default value: 1.
instanceType String No Redis The instance type. Valid values:
  • Redis (default): An ApsaraDB for Tair (Redis-compatible) instance.
  • Memcache: A Memcache instance.
instanceClass String No redis.master.small.default The instance class. For example, redis.master.small.default specifies a 1 GB dual-replica Community Edition (Classic Edition) instance that uses a standard architecture. For details, see Specification Query Guide.
Note You must specify either this parameter or Capacity.

Capacity Long No 16384 The storage capacity of the instance, in MB. For details, see Specification Query Guide.
Note You must specify either this parameter or InstanceClass.

EngineVersion String No 5.0 The engine version of the instance. Valid values:
  • 5.0 (default)
  • 4.0
ChargeType String No PrePaid The billing method. Valid values:
  • PrePaid: Subscription.
  • PostPaid (default): Pay-as-you-go.
Period Long No 12 The subscription duration in months. Valid values: 1 to 9, 12, 24, 36, and 60.
Note This parameter is required only when the ChargeType parameter is set to PrePaid.

AutoRenew String No true Specifies whether auto-renewal is enabled. Valid values:
  • true: Enables auto-renewal.
  • false (default): Disables auto-renewal.
Note This parameter is effective only when the ChargeType parameter is set to PrePaid.
InstanceName String No apitest The name of the instance. The name must meet the following requirements:
  • Must be 2 to 80 characters long and start with an uppercase or lowercase letter or a Chinese character.
  • Cannot contain spaces or the following special characters: @/:=<>{[]}
Password String No Pass!123456 The password for the instance. The password must meet the following requirements:
  • Must be 8 to 32 characters in length.
  • Must contain at least three of the following character types: uppercase letters, lowercase letters, digits, and special characters.
  • Supported special characters: !@#$%^&*()_+-=
networkType String No VPC The network type. Valid value: VPC.
vpcId String No vpc-bp1nme44gek34slfc**** The ID of the VPC for the instance. You can call the VPC operation DescribeVpcs to query available VPCs.
vSwitchId String No vsw-bp1e7clcw529l773d**** The ID of the vSwitch that belongs to the specified VPC. You can call the VPC operation DescribeVSwitches to query available vSwitches.
NodeType String No MASTER_SLAVE The node type. Valid values:
  • STAND_ALONE: single-replica.
  • MASTER_SLAVE (default): high availability (dual-replica).
SrcDBInstanceId String No r-bp1zxszhcgatnx**** The ID of the source instance. You can call the DescribeInstances operation to find instance IDs.
Note This parameter is required only when creating an instance from a source instance's backup.

BackupId String No 111111111 The ID of the backup set. You can call the DescribeBackups operation to find backup set IDs.
Note When creating an instance from a source instance's backup, you must specify both this parameter and SrcDBInstanceId.

RebuildInstance String No false Specifies whether to restore the source instance from the Recycle Bin. Valid values:
  • true: Rebuilds and restores the source instance.
  • false (default): Does not rebuild and restore the source instance.
Note If you specify this parameter, you must also specify the SrcDBInstanceId parameter.
[{
    "RegionId": "cn-hangzhou",
    "izNo": "cn-hangzhou-b",
    "quantity": 1,
    "instanceType": "Redis",
    "instanceClass": "redis.logic.sharding.1g.2db.0rodb.4proxy.default",
    "EngineVersion": "5.0",
    "ChargeType": "PrePaid",
    "Period": 1,
    "networkType": "VPC" , 
    "vpcId": "vpc-2zex6u1nu32k3ux35xxxx", 
    "vSwitchId": "vsw-2zesk464e647104kwxxxx"
}]

Response elements

Element

Type

Description

Example

object

OrderId

string

The order ID.

20905403119****

RequestId

string

The request ID.

561AFBF1-BE20-44DB-9BD1-6988B53E****

InstanceIds

object

InstanceId

array

The IDs of the instances that are created.

string

The ID of the instance.

r-bp16e70a4338****

Examples

Success response

JSON format

{
  "OrderId": "20905403119****",
  "RequestId": "561AFBF1-BE20-44DB-9BD1-6988B53E****",
  "InstanceIds": {
    "InstanceId": [
      "r-bp16e70a4338****"
    ]
  }
}

Error codes

HTTP status code

Error code

Error message

Description

400 Zone.Closed Specified zone is closed. The specified Availability Zone is closed
400 MissingParameter Period is mandatory for this action.
400 InvalidToken.Malformed The Specified parameter "Token" is not valid.
400 InvalidInstanceName.Malformed The Specified parameter "InstanceName" is not valid.
400 InvalidPassword.Malformed The Specified parameter "Password" is not valid. The specified Password parameters do not meet the requirements
400 InvalidInstances.Malformed The Specified parameter "Instances" is not valid. The Instances parameter passed in is invalid.
400 InsufficientBalance Your account does not have enough balance.
400 QuotaExceed.AfterpayInstance Living afterpay instances quota exceeded.
400 InvalidCapacity.NotFound The Capacity provided does not exist in our records.
400 ResourceNotAvailable Resource you requested is not available for finance user.
400 PaymentMethodNotFound No payment method has been registered on the account.
400 IdempotentParameterMismatch Request uses a client token in a previous request but is not identical to that request. Idempotent check.
400 QuotaNotEnough Quota not enough in this zone.
400 QuotaExceed Living afterpay instances quota exceed.
400 VpcServiceError Invoke vpc service failed.
400 IzNotSupportVpcError Specify iz not support vpc.
400 InvalidVpcIdRegion.NotSupported The Specified vpcId or vSwitchId not supported.
400 ResourceGroupNotExist The Specified ResourceGroupId does not exist.
403 RealNameAuthenticationError Your account has not passed the real-name authentication yet.
404 InvalidCapacity.NotFound The Capacity provided does not exist in our records. The specified storage specification does not exist.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.