Creates a replication pair to asynchronously replicate data between disks.

Description

Async replication is a feature that protects data across regions based on the data replication capability of Elastic Block Storage (EBS). This feature can asynchronously replicate data from a disk in one region to a disk in another region for geo-disaster recovery. You can use this feature to implement disaster recovery for critical business to protect your databases and improve business continuity.

Currently, the async replication feature can asynchronously replicate data only between enhanced SSDs (ESSDs). The functionality of disks in replication pairs is limited. You are charged for the use of async replication on a subscription basis and must pay bandwidth fees.

Before you create a replication pair, take note of the following items:

  • 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 primary and secondary disks cannot be located with the same region. Currently, replication pairs can be created in the following regions:
    • China (Shanghai): Zone B, Zone E, and Zone F
    • China (Beijing): Zone F, Zone G, and Zone J
    • China (Heyuan): Zone A and Zone B
    • China (Chengdu): Zone A and Zone B
  • After you call this operation to create a replication pair, you must call the StartDiskReplicaPair operation to activate the replication pair to replicate data from the primary disk to the secondary disk cross regions on a regular basis.

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 CreateDiskReplicaPair

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

SourceRegionId String Yes cn-beijing

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

DiskId String Yes d-iq80sgp4d0xbk24q****

The ID of the primary disk.

DestinationRegionId String Yes cn-shanghai

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.

DestinationDiskId String Yes d-sa1f82p58p1tdw9g****

The ID of the secondary disk.

SourceZoneId String No cn-beijing-f

The zone ID of the primary disk.

DestinationZoneId String No cn-shanghai-e

The zone ID of the secondary disk.

PairName String No TestReplicaPair

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

Description String No This is description.

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

ChargeType String No PrePaid

The billing method of the replication pair. Only the subscription billing method is supported. Set the value to PrePaid.

Default value: PrePaid.

Period Long No 1

The subscription duration of the replication pair. If you set ChargeType to PrePaid, you must specify this parameter. The unit of the subscription duration is specified by the PeriodUnit parameter.

  • Valid values when PeriodUnit is set to Week: 1, 2, 3, and 4.
  • Valid values when PeriodUnit is set to Month: 1, 2, 3, 4, 5, 6, 7, 8, 9, 12, 24, 36, 48, and 60.
PeriodUnit String No Month

The unit of the subscription duration of the replication pair. Valid values:

  • Week
  • Month

Default value: Month.

ClientToken String No 123e4567-e89b-12d3-a456-426655440000

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 make sure 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.

Bandwidth Long No 10240

The bandwidth used to asynchronously replicate data between the primary and secondary disks. Unit: Kbit/s. Valid values:

  • 10240 : equal to 10 Mbit/s
  • 20480 : equal to 20 Mbit/s
  • 51200 : equal to 50 Mbit/s
  • 102400 : equal to 100 Mbit/s

Default value: 10240.

Response parameters

Parameter Type Example Description
RequestId String C123F94F-4E38-19AE-942A-A8D6F44F0450

The ID of the request.

ReplicaPairId String pair-cn-dsa****

The ID of the replication pair.

OrderId String 1234567890

The ID of the order. This parameter has a value only when the ChargeType request parameter was set to PrePaid.

Examples

Sample requests

https://ebs.cn-beijing.aliyuncs.com/?Action=CreateDiskReplicaPair
&RegionId=cn-beijing
&DiskId=d-iq80sgp4d0xbk24q****
&DestinationRegionId=cn-shanghai
&DestinationDiskId=d-sa1f82p58p1tdw9g****
&ZoneId=cn-beijing-f
&DestinationZoneId=cn-shanghai-e
&Period=1
&PeriodUnit=Month
&Bandwidth=10240
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<CreateDiskReplicaPairResponse>
    <RequestId>C123F94F-4E38-19AE-942A-A8D6F44F0450</RequestId>
    <ReplicaPairId>pair-cn-dsa****</ReplicaPairId>
    <OrderId>1234567890</OrderId>
</CreateDiskReplicaPairResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

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

Error codes

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