All Products
Search
Document Center

Elastic Compute Service:CreateDiskReplicaPair

Last Updated:Jul 31, 2025

Creates a replication pair to asynchronously replicate data between disks.

Operation description

Usage notes

Async replication is a feature that protects data across regions by using the data replication capability of Elastic Block Storage (EBS). This feature can be used to asynchronously replicate data from a disk in one region to a disk in another region for disaster recovery purposes. You can use this feature to implement disaster recovery for critical business to protect data in your databases and improve business continuity. You are charged on a subscription basis for the bandwidth that is used by the async replication feature.

Currently, the async replication feature can asynchronously replicate data only between enhanced SSDs (ESSDs). The functionality of disks in replication pairs is limited.

Take note of the following items:

  • Make sure that the source disk (primary disk) from which to replicate data and the destination disk (secondary disk) to which to replicate data are created. You can call the CreateDisk operation to create disks.
  • The secondary disk cannot reside in the same region as the primary disk. For information about the regions that support async replication, see Overview .
  • After you call this operation to create a replication pair for the primary disk and the secondary disk, you must call the StartDiskReplicaPair operation to enable async replication to replicate data from the primary disk to the secondary disk cross regions on a periodic basis.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • For mandatory resource types, indicate with a prefix of * .
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
ebs:CreateDiskReplicaPaircreate
*DiskReplicaPair
acs:ebs:{#regionId}:{#accountId}:diskreplicapair/*
    none
  • ram:CreateServiceLinkedRole

Request parameters

ParameterTypeRequiredDescriptionExample
RegionIdstringYes

The ID of the region in which to create the replication pair.

cn-shanghai
SourceZoneIdstringYes

The zone ID of the primary disk.

cn-beijing-f
DiskIdstringYes

The ID of the primary disk.

d-iq80sgp4d0xbk24q****
DestinationRegionIdstringYes

The region ID of the secondary disk. You can call the DescribeRegions operation to query the most recent list of regions in which async replication is supported.

cn-shanghai
DestinationDiskIdstringYes

The ID of the secondary disk.

d-sa1f82p58p1tdw9g****
DestinationZoneIdstringYes

The zone ID of the secondary disk.

cn-shanghai-e
PairNamestringNo

The name of the replication pair. The name must be 2 to 128 characters in length. The name must start with a letter and cannot start with http:// or https://. The name can contain letters, digits, colons (:), underscores (_), periods (.), and hyphens (-).

TestReplicaPair
DescriptionstringNo

The description of the replication pair. The description must be 2 to 256 characters in length and cannot start with http:// or https://.

This is description.
ChargeTypestringNo

The billing method of the replication pair. Valid values:

  • PREPAY: subscription
  • POSTPAY: pay-as-you-go

Default value: POSTPAY.

PREPAY
PeriodlongNo

The subscription duration of the replication pair. When ChargeType is set to PREPAY, this parameter must be specified. Valid values: 1, 2, 3, 6, 12, 24, 36, and 60. The subscription duration unit is specified by PeriodUnit.

1
PeriodUnitstringNo

The unit of the subscription duration of the replication pair. Set the value to Month. Valid value: Month

Month
ClientTokenstringNo

The client token to ensure the idempotency of the request. You can use the client to generate the token, but you must make sure that the token 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-e89b-12d3-a456-42665544****
BandwidthlongNo

The bandwidth to use to asynchronously replicate data from the primary disk to the secondary disk. Unit: Kbit/s. Valid values:

  • 10240
  • 20480
  • 51200
  • 102400

Default value: 10240. When you set the ChargeType parameter to POSTPAY, the Bandwidth parameter is automatically set to 0 and cannot be modified. The value 0 indicates that bandwidth is dynamically allocated based on the volume of data that is asynchronously replicated from the primary disk to the secondary disk.

10240
RPOlongNo

The recovery point objective (RPO) of the replication pair. Unit: seconds. Valid value: 900.

900
ResourceGroupIdstringNo

The ID of the resource group to which the replication pair belongs.

rg-acfmvs****
Tagarray<object>No

The tags to add to the replication pair-consistent group. You can specify up to 20 tags.

objectNo

The tag.

ValuestringNo

The value of the tag.

TestValue
KeystringNo

The key of the tag.

TestKey
EnableRtcbooleanNo

Whether to enable replication time control. By default, this parameter is disabled.

true

Response parameters

ParameterTypeDescriptionExample
object

Schema of Response

RequestIdstring

The request ID.

C123F94F-4E38-19AE-942A-A8D6F44F****
ReplicaPairIdstring

The ID of the replication pair.

pair-cn-dsa****
OrderIdstring

The order ID.

123456****

Examples

Sample success responses

JSONformat

{
  "RequestId": "C123F94F-4E38-19AE-942A-A8D6F44F****",
  "ReplicaPairId": "pair-cn-dsa****",
  "OrderId": "123456****"
}

Error codes

HTTP status codeError codeError messageDescription
400IdempotentParameterMismatchThe specified parameter has changed while using an already used clientToken.The request and a previous request contains the same client token but different parameters.
403OperationDeniedThe operation is not allowed.The operation is not supported.
403OperationDenied.InvalidStatusThe operation is not allowed in current status.The operation is not supported in the current state.
403OperationDenied.QuotaExceedThe operation is not allowed due to quota exceed.The quota for performing this operation has been exceeded.
403LastTokenProcessingThe last token request is processing.The value of clientToken is used in another request that is being processed. Try again later.
403InvalidAccountStatus.NotEnoughBalanceYour account does not have enough balance.-
403ForbiddenUser is not authorized to operate.You are not authorized to manage the resource. Check the account permissions or contact the Alibaba Cloud account.
403Forbidden.ActionUser is not authorized to operate this action.You are not authorized to perform this operation. Check the account permissions or contact the Alibaba Cloud account.
404NoSuchResourceThe specified resource does not exist.The specified resource does not exist.
500InternalErrorThe request processing has failed due to some unknown error, exception or failure.An internal error has occurred.
504RequestTimeoutThe request is timeout, please try again later.The request has timed out. Try again later.

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2023-03-29The Error code has changedView Change Details
2023-03-08The Error code has changedView Change Details