MigrateToOtherZone

Updated at: 2025-03-27 11:24

Migrates a Tair (Redis OSS-compatible) instance to another zone in the same region.

Operation description

Before you call this operation, you must release the public endpoint (if any) of the instance. For more information, see Migrate an instance across zones.

Note
  • If the network type of an Tair (Redis OSS-compatible) instance is switched from classic network to Virtual Private Cloud (VPC), and the classic network endpoint is retained, you can migrate the instance across zones only after the classic network endpoint is released upon expiration.

  • After the instance is migrated, the endpoint of the instance remains unchanged. However, the virtual IP address (VIP) is changed. We recommend that you use the endpoint instead of the VIP to connect to the instance.

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
OperationAccess levelResource typeCondition keyAssociated operation
kvstore:MigrateToOtherZoneupdate
*DBInstance
acs:kvstore:{#regionId}:{#accountId}:instance/{#instanceId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
ParameterTypeRequiredDescriptionExample
DBInstanceIdstringYes

The ID of the Tair (Redis OSS-compatible) instance.

r-bp1zxszhcgatnx****
ZoneIdstringYes

The ID of the destination primary zone. You can call the DescribeZones operation to query zone IDs.

cn-hangzhou-g
VSwitchIdstringNo

The ID of the vSwitch.

Note
  • The zone where the vSwitch resides must be the same as the ID of the destination zone.

  • If the network type of the instance is VPC, this parameter is required.

vsw-bp1e7clcw529l773d****
EffectiveTimestringNo

The time when the database is switched after the instance is migrated. Valid values:

  • Immediately: The database is immediately switched after the instance is migrated.
  • MaintainTime: The database is switched within the maintenance window.
Note
Default value: Immediately.
Enumeration Value:
  • 0
  • 1
  • Immediately
  • MaintainTime
Immediately
SecondaryZoneIdstringNo

The ID of the secondary zone to which you want to migrate the instance. You can call the DescribeZones operation to query zone IDs.

Note
If you specify this parameter, the master node and replica node of the instance can be deployed in different zones and disaster recovery is implemented across zones. The instance can withstand failures in data centers.
cn-hangzhou-h
ReplicaCountintegerNo

The number of replica nodes in the primary zone.

Note
  • The ReplicaCount and SlaveReplicaCount parameters are applicable only to cloud-native instances. When you migrate an instance to multiple zones, you can use these parameters to adjust the distribution of replica nodes in the primary and secondary zones of the instance. This operation does not allow you to increase or decrease the number of nodes. Therefore, the sum of the values of ReplicaCount and SlaveReplicaCount must be the same as that before the migration.

  • If you do not specify these parameters when you migrate an instance from a single zone to multiple zones, one replica node is migrated to the secondary zone, and all other replica nodes remain in the primary zone.

  • If the instance is a cluster instance, the preceding parameters indicate the number of replica nodes per shard in the primary and secondary zones of the instance.

1
SlaveReplicaCountintegerNo

The number of replica nodes in the secondary zone.

1
ReadOnlyCountintegerNo

The number of read replicas in the primary zone.

Note
  • The ReadOnlyCount and SlaveReadOnlyCount parameters are applicable only to cloud-native instances for which read/write splitting is enabled. When you migrate an instance to multiple zones, you can use these parameters to adjust the distribution of read replicas in the primary and secondary zones of the instance. This operation does not allow you to increase or decrease the number of nodes. Therefore, the sum of the values of ReadOnlyCount and SlaveReadOnlyCount must be the same as that before the migration.

  • If you do not specify these parameters when you migrate an instance from a single zone to multiple zones, one read replica is migrated to the secondary zone, and all other read replicas remain in the primary zone.

  • If the instance is a cluster instance, the preceding parameters indicate the number of read replicas per shard in the primary and secondary zones of the instance.

1
SlaveReadOnlyCountintegerNo

The number of read replicas in the secondary zone.

1

Response parameters

ParameterTypeDescriptionExample
ParameterTypeDescriptionExample
object
RequestIdstring

The ID of the request.

29B0BF34-D069-4495-92C7-FA6D9452****

Examples

Sample success responses

JSONformat

{
  "RequestId": "29B0BF34-D069-4495-92C7-FA6D9452****"
}

Error codes

HTTP status codeError codeError messageDescription
HTTP status codeError codeError messageDescription
400NetworkType.NotSupportSpecified network type does not support this operation.The operation cannot be performed on an instance that has a public endpoint or a private endpoint. Release the endpoint and try again.
400InstanceStatus.NotSupportInstance status does not support this operation.The error message returned because the operation is not supported while the instance is in the current state.
400MissingSwitchIdVSwitchId is mandatory for this action.-
400IzNotSupportVpcErrorSpecify zone not support VPC.-
400InvalidReginAvzNotFoundSpecified user does not find the region and zone.-
400ClusterNotSupportThe Specified cluster does not support.-
400InvalidVSwitchId.MismatchThe Specified vSwitchId does not matched VPC.The specified vSwitch does not belong to the specified VPC. Check the vSwitch settings.
400InvalidIzNo.NotSupportedThe Specified Zone does not supported.-
404DBInstanceNotFoundSpecified instance does not exist.-
500VpcServiceErrorInvoke VPC service failed.-
500ZoneMigrationError.StillingRunningZone migration task is still running.-

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

Change history

Change timeSummary of changesOperation
Change timeSummary of changesOperation
2025-02-19The Error code has changed. The request parameters of the API has changedView Change Details
2023-07-20API Description Update. The Error code has changedView Change Details
  • On this page (1)
  • Operation description
  • Debugging
  • Authorization information
  • Request parameters
  • Response parameters
  • Examples
  • Error codes
  • Change history
Feedback
phone Contact Us