You need to enable JavaScript to run this app.
RDS for MySQL

RDS for MySQL

Copy page
Download PDF
Managing instances
MigrateToOtherZone
Copy page
Download PDF
MigrateToOtherZone
Call the MigrateToOtherZone API to migrate nodes of a specified instance to another availability zone within the same region.​
Request type​
Asynchronous request.​
Precautions​
Only the availability zone migration of double-node instance nodes is supported.​
Debug​
API Explorer
You can initiate calls online through API Explorer without paying attention to the signature generation process and quickly obtain the call results.
​
Request parameters​
​
Parameter​
Type​
Is it required?​
Sample value​
Description​
InstanceId​
String​
Yes​
mysql-759174bd****​
Instance ID.​
tip​
Call the DescribeDBInstances API to query the instance summary, including the Instance ID.​
NodeInfo​
Array of NodeInfoObject​
Yes​
See the request example.​
The specifications of the instance.​
tip​
  • You can call the DescribeDBInstanceDetail interface to query the availability zone IDs of all nodes in the specified instance.​
  • You cannot change the node specification or the number of nodes when migrating availability zones.​
SwitchType​
String​
No​
MaintainTime​
Execution time. The valid values are:​
  • Immediate: switch now (default).​
  • MaintainTime: switch during the maintenance window.​
  • SpecifiedTime: switch during the specified time period.​
tip​
  • When the value is SpecifiedTime, you must set the start and end time of the time period in the SpecifiedSwitchStartTime and SpecifiedSwitchEndTime parameters.​
SpecifiedSwitchStartTime​
String​
No​
2024-12-25T14:00:00Z​
The start time of the specific time period for execution(UTC time). The format is yyyy-MM-ddTHH:mm:ssZ.​
tip​
  • When SwitchType is set to SpecifiedTime, this parameter is required.​
  • The start time of the task cannot be later than seven days after the current date.​
SpecifiedSwitchEndTime​
String​
No​
2024-12-25T15:59:00Z​
The end time of the specific time period for execution (UTC time). The format is yyyy-MM-ddTHH:mm:ssZ.​
tip​
  • This parameter is required when the value of SwitchType is SpecifiedTime.​
  • The minimum time period is one hour and fifty-nine minutes.​
  • Time periods cannot be set across days. The task's start and end times must be within a 24-hour window.​
​
NodeInfoObject​
​
Parameter​
Type​
Is it required?​
Sample value​
Description​
NodeId​
String​
No​
mysql-050b3e08****-r6e25​
Node ID.​
tip​
This parameter is not required when you create an instance or add a node, but is required when you modify the node configuration or delete a node.​
NodeType​
String​
Yes​
Primary​
Node type, with values:​
  • Primary: primary node.​
  • Secondary: secondary node.​
  • ReadOnly: read-only node.​
tip​
  • This parameter is optional for the DescribeDBInstancePriceDetail API.​
  • When you add a node by calling the CreateDBNodes API, you can set this parameter only to ReadOnly for a double-node instance or Secondary for a multiple-node instance.​
  • A double-node instance consists of one primary node, one secondary node, and 0 to 10 optional read-only nodes.​
  • A multiple-node instance consists of one primary node, and at least one and up to eight secondary nodes. We recommend that you reserve an independent secondary node that does not handle workloads. This allows you to switch it to the primary node when necessary. RDS for MySQL assumes no responsibility for any risks or losses incurred due to the failure to configure independent secondary nodes or the inability to complete the primary node switching due to excessive latency of all secondary nodes.​
NodeSpec​
String​
Yes​
rds.mysql.1c2g​
Node specification. For details on node specification, refer to Product specification.​
tip​
  • The specification of the secondary node must be the same as that of the primary node.​
  • The read-only node specification can be lower than the primary node specification. However, when the read-only node specification is lower than the primary node specification, the read-only node may be delayed or even experience an OOM error due to the high load on the primary node. It is recommended that the read-only node be selected with the same or higher specification as the primary node.​
  • If StorageType is set to CloudESSD_FlexPL or CloudESSD_PL0, only the general type can be passed for NodeSpec.​
ZoneId​
String​
Yes​
cn-beijing-a​
The availability zone where the node is located. You can call the DescribeAvailabilityZones API to query it. Required when creating an instance or adding a node. Optional when changing node configuration or deleting a node.​
tip​
  • The nodes of an instance can be distributed across a maximum of three availability zones.​
  • During a single configuration change, you can add or delete nodes in up to three availability zones.​
NodeOperateType​
String​
No​
Modify​
Operation type. This parameter is not required when you create an instance but is required when you modify the node configuration. Range:​
  • Create: add.​
  • Modify: modify.​
tip​
  • When adding a node (CreateDBNodes), this field can only be Create.​
  • When you modify the configuration, this parameter can only be set to Modify.​
  • This value has no actual meaning when set to Delete.​
​
Response parameters​
​
Parameter​
Type​
Example​
Description​
InstanceId​
String​
mysql-759174bd****​
Instance ID.​
OrderId​
String​
-​
Order ID.​
​
Sample​
Sample request​
​
POST /?Action=MigrateToOtherZone&Version=2022-01-01 HTTP/1.1​
Accept: application/json​
Content-Type: application/json​
Host: rds-mysql.cn-beijing.volcengineapi.com​
X-Date: 20211202T101010Z​
Authorization: HMAC-SHA256 Credential=AKLTN2I0MmFiNzMxNWE5NDgzMzk4MmVjMTVkODlkZTZ****/20211202/cn-beijing/rds_mysql/request,SignedHeaders=x-date, Signature=71d31fc7bcf990142851c9833c5656391486cda0ae2e0b8ada733b7c6458****​
{​
"InstanceId": "mysql-759174bd****",​
"NodeInfo": [​
{​
"NodeId": "mysql-759174bd****-0",​
"ZoneId": "cn-beijing-c",​
"NodeSpec": "rds.mysql.1c2g",​
"NodeType": "Primary"​
},​
{​
"NodeId": "mysql-759174bd****-1",​
"ZoneId": "cn-beijing-a",​
"NodeSpec": "rds.mysql.1c2g",​
"NodeType": "Secondary",​
"NodeOperateType": "Modify"​
}​
],​
"SwitchType": "Immediate"​
}​
​
Sample response​
​
{​
"ResponseMetadata": {​
"RequestId": "202309201814044BFC1D5B86B1AA249D9D",​
"Action": "MigrateToOtherZone",​
"Version": "2022-01-01",​
"Service": "rds_mysql",​
"Region": "cn-beijing"​
},​
"Result": {​
"InstanceId": "mysql-759174bd8a0f",​
"OrderId": ""​
}​
}​
​
Error code​
For more details, refer to Error codes.​
Last updated: 2026.06.12 17:17:50