All Products
Search
Document Center

Tair (Redis® OSS-Compatible):CreateInstances

Last Updated:Oct 12, 2026

Creates multiple ApsaraDB for Tair (Redis OSS-compatible) database Classic Edition instances.

Operation description

Make sure that you fully understand the billing methods and pricing of the ApsaraDB for Tair (Redis OSS-compatible) database before you call this API operation.

Note

This API operation only supports creating Classic Edition instances. Use the following operations to create a single instance:

  • CreateInstance: creates an open-source Redis instance or a Tair memory-optimized Classic Edition instance.

  • CreateTairInstance: creates a Tair cloud-native instance (including memory-optimized, persistent memory-optimized, and disk-optimized 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 configuration information of the new instances. The value must be in JSON format. For more information, see the supplementary description 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

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 is case-sensitive and can be up to 64 ASCII characters in length.

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 manually pay for the order. In the top navigation bar of the console, choose Billing > Renewal Management. In the left-side navigation pane, choose Order Management > My Orders, find the order, and then complete the payment.

Note

This parameter is available only when the ChargeType parameter in the Instances array is set to PrePaid.

true

BusinessInfo

string

No

The extended business information.

000000000

CouponNo

string

No

The coupon code. Default value: youhuiquan_promotion_option_id_for_blank.

youhuiquan_promotion_option_id_for_blank

EngineVersion

string

No

The Redis-compatible engine version of the instance. Valid values: 4.0 and 5.0.

Note

Default value: 5.0.

Valid values:

  • 4.0 :

    4.0

  • 5.0 :

    5.0

5.0

RebuildInstance

boolean

No

Specifies whether to rebuild and restore the source instance from the recycle bin. Valid values:

  • true: yes.

  • false: no. This is the default value.

Note

This parameter is available only when the SrcDBInstanceId parameter is specified in the Instances array.

false

AutoRenew

string

No

Specifies whether to enable auto-renewal. Valid values:

  • true: enables auto-renewal.

  • false: disables auto-renewal. This is the default value.

Note

This parameter is available only when the ChargeType parameter in the Instances array is set to PrePaid.

false

ResourceGroupId

string

No

The ID of the resource group.

rg-resourcegroupid1

Supplementary description of the Instances parameter

Name Type Required Example Description
RegionId String Yes cn-hangzhou The region ID. You can call the DescribeRegions operation to query the most recent region list. Use this parameter to specify the region where you want to create the instance.
IzNo String Yes cn-hangzhou-b The primary zone ID. You can call the DescribeRegions operation to query the most recent zone list. Use this parameter to specify the zone where you want to create the instance.
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): ApsaraDB for Tair (Redis OSS-compatible) database instance.

  • Memcache: Memcache instance.

InstanceClass String No redis.master.small.default The instance type. For example, redis.master.small.default indicates a 1 GB Community Edition (Classic Edition) standard master-replica instance. For more information, see Instance types.
Note You must specify this parameter or the Capacity parameter.

Capacity Long No 16384 The storage capacity of the instance. Unit: MB. For more information, see Instance types.
Note You must specify this parameter or the InstanceClass parameter.

EngineVersion String No 5.0 The Redis-compatible engine version of the instance. Valid values:
  • 5.0 (default)

  • 4.0

ChargeType String No PrePaid The billing method. Valid values:
  • PrePaid: upfront.

  • PostPaid (default): pay-as-you-go.

Period Long No 12 The upfront period. Unit: months. Valid values: 1 to 9, 12, 24, 36, and 60.
Note This parameter is active and required only when the ChargeType parameter is set to PrePaid.

AutoRenew String No true Specifies whether to enable auto-renewal. Valid values:
  • true: enables auto-renewal.

  • false (default): disables auto-renewal.

Note This parameter is active 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:
  • The name must be 2 to 80 characters in length and start with a letter or Chinese character.

  • The name cannot contain spaces or the following special characters: @/:="<>{[]}

Password String No Pass!123456 The password of the instance. The password must meet the following requirements:
  • The password must be 8 to 32 characters in length.

  • The password must contain at least three of the following character types: uppercase letters, lowercase letters, special characters, and digits.

  • Supported special characters: !@#$%^&*()_+-=

NetworkType String No VPC The network type. Valid value: VPC (Virtual Private Cloud). Currently, only VPC instances can be created.
VpcId String No vpc-bp1nme44gek34slfc**** The ID of the VPC. You can call the DescribeVpcs operation to query the VPC ID.
VSwitchId String No vsw-bp1e7clcw529l773d**** The ID of the vSwitch in the VPC. You can call the DescribeVpcs operation to query the vSwitch ID.
NodeType String No MASTER_SLAVE The node type. Valid values:
  • STAND_ALONE: standalone.

  • MASTER_SLAVE (default): master-replica (high availability).

SrcDBInstanceId String No r-bp1zxszhcgatnx**** The ID of the source instance. You can call the DescribeInstances operation to query the instance ID.
Note Specify this parameter only when you want to create an instance based on the backup data of the source instance.

BackupId String No 111111111 The ID of the backup set. You can call the DescribeBackups operation to query the backup set ID.
Note If you want to create an instance based on the backup data of a specific instance, you must specify the SrcDBInstanceId parameter to identify the source instance and specify this parameter to identify the backup set. The system creates the instance based on the data in the backup set.

RebuildInstance String No false Specifies whether to rebuild and recover the source instance from the revoke bin. Valid values:
  • true: yes.

  • false (default): no.

Note If you specify this parameter, you must also specify the SrcDBInstanceId parameter.

Sample request for 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-2zex6u1nu32k3ux35xxxx", 
    "vSwitchId": "vsw-2zesk464e647104kwxxxx"
}]

Response elements

Element

Type

Description

Example

object

OrderId

string

The ID of the order.

20905403119****

RequestId

string

The ID of the request.

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

InstanceIds

object

InstanceId

array

The list of instance IDs of the created instances.

string

The instance ID.

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.