Creates a persistent memory-optimized or storage-optimized instance of ApsaraDB for Redis Enhanced Edition (Tair) that uses cloud disks.

For more information about instance selection, see Select ApsaraDB for Redis instances.

Before you call this operation, make sure that you understand the billing methods and prices of ApsaraDB for Redis. For more information, see Billable items and prices.

Note
  • For more information about how to create a persistent memory-optimized or storage-optimized instance of ApsaraDB for Redis Enhanced Edition (Tair) that uses cloud disks in the ApsaraDB for Redis console, see Step 1: Create an ApsaraDB for Redis instance.
  • If you want to create other types of instances, such as ApsaraDB for Redis Community Edition instances or performance-enhanced instances of ApsaraDB for Redis Enhanced Edition (Tair), you can call the CreateInstance operation.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes CreateTairInstance

The operation that you want to perform. Set the value to CreateTairInstance.

InstanceClass String Yes tair.scm.standard.4m.32d

The type of the ApsaraDB for Redis instance. For more information, see the following topics:

InstanceType String Yes tair_scm

The series of the ApsaraDB for Redis instance. Valid values:

  • tair_scm: persistent memory-optimized
  • tair_essd: storage-optimized
RegionId String Yes cn-hangzhou

The ID of the region in which you want to create the ApsaraDB for Redis instance. You can call the DescribeRegions operation to query region IDs.

VpcId String Yes vpc-bp1nme44gek34slfc****

The ID of the virtual private cloud (VPC). You can call the DescribeVpcs operation to query VPC IDs.

VSwitchId String Yes vsw-bp1e7clcw529l773d****

The ID of the vSwitch that belongs to the VPC. You can call the DescribeVpcs operation to query vSwitch IDs.

ZoneId String Yes cn-hangzhou-e

The ID of the primary zone in which you want to create the ApsaraDB for Redis instance. You can call the DescribeRegions operation to query zone IDs.

Note If you want to create an instance that adopts the zone-disaster recovery architecture, you can deploy the master node and replica node of the instance in different zones. You can set the SecondaryZoneId parameter to specify the secondary zone. In this case, do not set the ZoneId parameter to multiple zone IDs.
InstanceName String No apitest

The name of the ApsaraDB for Redis instance. The format of the name must meet the following requirements:

  • The name must be 2 to 128 characters in length.
  • The name must start with a letter and cannot contain spaces or the following special characters:

    @ / : = " < > { [ ] }

Password String No Pass!123456

The password of the ApsaraDB for Redis 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 types of the following characters: uppercase letters, lowercase letters, digits, and the following special characters:

    !@ # $ % ^ & * ( ) _ + - =

ChargeType String No PrePaid

The billing method. Set the value to PrePaid. This value indicates subscription.

Period Integer No 1

The subscription duration. Valid values: 1 to 9, 12, 24,36, and 60. Unit: months.

Note This parameter is required only if you set the ChargeType parameter to PrePaid.
BusinessInfo String No 000000000

The ID of the promotional event or the business information.

CouponNo String No youhuiquan_promotion_option_id_for_blank

The coupon ID.

SrcDBInstanceId String No r-bp1zxszhcgatnx****

The ID of the source ApsaraDB for Redis instance.

Note To create an instance based on the backup set of an existing instance, set this parameter to the ID of the source instance and the BackupId parameter to the backup set to be used.
BackupId String No 11111111

The ID of the backup set of the source instance. You can call the DescribeBackups to query backup set IDs.

Note If you want to create an instance based on the backup set of an existing instance, you must set this parameter after you set the SrcDBInstanceId parameter. The system creates an instance based on the backup set that is specified by this parameter.
PrivateIpAddress String No 172.16.88.***

The private IP address of the ApsaraDB for Redis instance.

Note The IP address must be within the CIDR block of the vSwitch to which the instance belongs. You can call the DescribeVSwitches operation of the VPC API to query the CIDR block information.
AutoUseCoupon String No true

Specifies whether to use a coupon. Valid values:

  • true: uses a coupon.
  • false: does not use a coupon. This is the default value.
AutoRenew String No true

Specifies whether to enable auto-renewal. Valid values:

  • true: enables auto-renewal.
  • false: disables auto-renewal. This is the default value.
AutoRenewPeriod String No 3

The auto-renewal period. Unit: months. Valid values: 1, 2, 3, 6, and 12.

Note This parameter is required if the AutoRenew parameter is set to true.
AutoPay Boolean No true

Specifies whether to enable automatic payment. Set the value to true.

ClientToken String No ETnLKlblzczshOTUbOCz****

The token that is used to ensure the idempotence of the request. You can use the client to generate the token. Make sure that the token is unique among different requests. The token is case-sensitive. The token can contain only ASCII characters and cannot exceed 64 characters in length.

StorageType String No essd_pl1

The storage type. Set the value to essd_pl1.

Note This parameter takes effect only if the InstanceType parameter is set to tair_essd.
Storage Integer No 60

The storage space of the disk. Valid values vary with specifications. For more information, see Storage-optimized instances.

Note This parameter is valid and required only if the InstanceType parameter is set to tair_essd.
ShardType String No MASTER_SLAVE

The node type of the instance. set the value to MASTER_SLAVE. This value indicates that the instance contains the master and replica nodes to ensure service availability.

ShardCount Integer No 1

The number of data nodes in the instance. Valid values:

  • 1: You can create an instance in the standard architecture that contains only one data node. This is the default value.
  • 2 to 32: You can create an instance in the cluster architecture that contains the specified number of data nodes.
Note Only a persistent memory-optimized instance can use the cluster architecture. Therefore, you can set this parameter to an integer from 2 to 32 only if you set the InstanceType parameter to tair_scm.
EngineVersion String No 1.0

The database engine version of the instance. Default value: 1.0. V1.0 is developed by Alibaba Cloud and compatible with Redis 5.0.

SecondaryZoneId String No cn-hangzhou-h

The ID of the secondary zone. You can call the DescribeRegions operation to query region IDs.

Note
  • You cannot specify multiple regions IDs or set this parameter to a value the same as that of the ZoneId parameter.
  • If you set both the SecondaryZoneId and ZoneId parameters, the master node is deployed in the primary zone and the replica node is deployed in the secondary zone. In this case, the instance adopts the zone-disaster recovery architecture.

Response parameters

Parameter Type Example Description
Bandwidth Long 96

The maximum bandwidth of the instance. Unit: MB/s.

ChargeType String PrePaid

The billing method. The return value is PrePaid that indicates subscription.

Config String {\"EvictionPolicy\":\"volatile-lru\",\"hash-max-ziplist-entries\":512,\"zset-max-ziplist-entries\":128,\"list-max-ziplist-entries\":512,\"list-max-ziplist-value\":64,\"zset-max-ziplist-value\":64,\"set-max-intset-entries\":512,\"hash-max-ziplist-value\":64}

The detailed configurations of the instance. The value is a JSON string. For more information about parameter description, see Modify the parameters of an ApsaraDB for Redis instance.

ConnectionDomain String r-bp13ac3d047b****.tairpena.rds.aliyuncs.com

The internal endpoint of the instance.

Connections Long 10000

The maximum number of connections supported by the instance.

InstanceId String r-bp13ac3d047b****

The ID of the instance.

InstanceName String redistest

The name of the instance.

Note This parameter is returned only if the InstanceName parameter is set in the request.
InstanceStatus String Creating

The status of the instance. The return value is Creating.

Port Integer 6379

The port number of the instance.

QPS Long 100000

The maximum number of read and write operations that can be processed by the instance per second. The value is a theoretical value.

RegionId String cn-hangzhou

The ID of the region.

RequestId String 12123216-4B00-4378-BE4B-08005BFC****

The ID of the request.

TaskId String 10****

The ID of the task.

ZoneId String cn-hangzhou-h

The ID of the zone.

Examples

Sample requests

http(s)://r-kvstore.aliyuncs.com/?Action=CreateTairInstance
&InstanceClass=tair.scm.standard.4m.32d
&InstanceType=tair_scm
&RegionId=cn-hangzhou
&VpcId=vpc-bp1nme44gek34slfc****
&VSwitchId=vsw-bp1e7clcw529l773d****
&ZoneId=cn-hangzhou-e
&Period=1
&<Common request parameters>

Sample success responses

XML format

<CreateTairInstanceResponse>
      <Connections>10000</Connections>
      <TaskId>10****</TaskId>
      <RequestId>F371C892-2143-4640-810E-74553F37****</RequestId>
      <ZoneId>cn-hangzhou-h</ZoneId>
      <InstanceId>r-bp13ac3d047b****</InstanceId>
      <Config>{"EvictionPolicy":"volatile-lru","hash-max-ziplist-entries":512,"zset-max-ziplist-entries":128,"list-max-ziplist-entries":512,"list-max-ziplist-value":64,"zset-max-ziplist-value":64,"set-max-intset-entries":512,"hash-max-ziplist-value":64}</Config>
      <Port>6379</Port>
      <InstanceName>redistest</InstanceName>
      <ConnectionDomain>r-bp13ac3d047b****.tairpena.rds.aliyuncs.com</ConnectionDomain>
      <QPS>100000</QPS>
      <InstanceStatus>Creating</InstanceStatus>
      <ChargeType>PrePaid</ChargeType>
      <Bandwidth>96</Bandwidth>
      <RegionId>cn-hangzhou</RegionId>
</CreateTairInstanceResponse>

JSON format

{
    "Connections": 10000,
    "TaskId": "10****",
    "RequestId": "F371C892-2143-4640-810E-74553F37****",
    "ZoneId": "cn-hangzhou-h",
    "InstanceId": "r-bp13ac3d047b****",
    "Config": "{\"EvictionPolicy\":\"volatile-lru\",\"hash-max-ziplist-entries\":512,\"zset-max-ziplist-entries\":128,\"list-max-ziplist-entries\":512,\"list-max-ziplist-value\":64,\"zset-max-ziplist-value\":64,\"set-max-intset-entries\":512,\"hash-max-ziplist-value\":64}",
    "Port": 6379,
    "InstanceName": "redistest",
    "ConnectionDomain": "r-bp13ac3d047b****.tairpena.rds.aliyuncs.com",
    "QPS": 100000,
    "InstanceStatus": "Creating",
    "ChargeType": "PrePaid",
    "Bandwidth": 96,
    "RegionId": "cn-hangzhou"
}

Error codes

HttpCode Error code Error message Description
400 InsufficientBalance Your account does not have enough balance. The error message returned because your Alibaba Cloud account does not have a sufficient balance. Add funds to your Alibaba Cloud account and try again.
403 RealNameAuthenticationError Your account has not passed the real-name authentication yet. The error message returned because your Alibaba Cloud account has not passed real-name verification.
400 QuotaExceed.AfterpayInstance Living afterpay instances quota exceeded. The error message returned because the maximum number of instances is reached.
400 InvalidCapacity.NotFound The Capacity provided does not exist in our records. The error message returned because the specified capacity is invalid.
400 ResourceNotAvailable Resource you requested is not available for finance user. The error message returned because the requested resource is unavailable to users of Alibaba Finance Cloud.
400 PaymentMethodNotFound No payment method has been registered on the account. The error message returned because no payment method is specified for your account.
400 IdempotentParameterMismatch Request uses a client token in a previous request but is not identical to that request. The error message returned because the current request uses a token that has been used in an earlier request but the two requests are not identical.
400 QuotaNotEnough Quota not enough in this zone. The error message returned because the maximum number of instances for this zone is reached.
400 QuotaExceed Living afterpay instances quota exceed. The error message returned because the maximum number of instances is reached.
400 IzNotSupportVpcError Specify iz not support vpc. The error message returned because the specified iz does not support VPCs.

For a list of error codes, visit the API Error Center.