All Products
Search
Document Center

Elastic Compute Service:CreateDiskReplicaPair

Last Updated:Mar 01, 2024

Creates a replication pair to asynchronously replicate data between disks.

Operation description

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.

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 on a subscription basis for the bandwidth that is used by the async replication feature.

Before you call this operation, 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 the same region as the primary disk. The async replication feature is supported in the China (Hangzhou), China (Shanghai), China (Beijing), China (Shenzhen), China (Heyuan), China (Chengdu), China (Hong Kong), Singapore, US (Silicon Valley), and US (Virginia) regions.
  • After you call this operation to create a replication pair, you must call the StartDiskReplicaPair operation to enable async replication to periodically replicate data from the primary disk to the secondary disk across regions.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

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:
    • The required resource types are displayed in bold characters.
    • 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:CreateDiskReplicaPairWrite
  • DiskReplicaPair
    acs:ebs:{#regionId}:{#accountId}:diskreplicapair/*
    none
none

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. It must start with a letter and cannot start with http:// or https://. It 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. This parameter is required when the ChargeType parameter is set to PREPAY. The unit of the subscription duration is specified by the PeriodUnit parameter.

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

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

  • Week.
  • Month

Default value: Month.

Month
ClientTokenstringNo

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 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 between the primary disk and secondary disk. 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.

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. Set the value to 900.

900
ResourceGroupIdstringNo

The ID of the resource group to which to assign the replication group.

rg-acfmvs****
Tagobject []No

The resource tags. You can specify up to 20 tags.

KeystringNo

The key of tag N to add to the resource. Valid values of N: 1 to 20. The tag key cannot be an empty string. The tag key can be up to 128 characters in length and cannot contain http:// or https://. It cannot start with acs: or aliyun.

TestKey
ValuestringNo

The value of tag N to add to the resource. Valid values of N: 1 to 20. The tag value can be an empty string. The tag value can be up to 128 characters in length and cannot start with acs: or contain http:// or https://.

TestValue

Response parameters

ParameterTypeDescriptionExample
object

Schema of Response

RequestIdstring

The ID of the request.

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

The ID of the replication pair.

pair-cn-dsa****
OrderIdstring

The ID of the order.

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 changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    delete Error Codes: 403
    Added Error Codes: 400
2023-03-08The Error code has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    delete Error Codes: 403