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 supports migrating availability zones for nodes in dual-node instances.

Request parameters

Name
Type
Required
Example
Description
InstanceId
String
Yes
mysql-759174bd****

Instance ID.

tip

You can call the DescribeDBInstances API to query instance information, including the instance ID.

NodeInfo
Object[]
Yes
Refer to the request example.

Instance specification configuration.

tip

  • You can call the DescribeDBInstanceDetail API to query the availability zone IDs of all nodes for a specified instance.
  • Node specifications and quantity cannot be changed during availability zone migration.
NodeId
String
No
mysql-050b3e08****-r6e25

Node ID.

tip

It is not required to pass in when creating an instance or adding a new node, and it is required to pass in when changing the node configuration or deleting a node.

NodeType
String
Yes
Primary

Node type, with the following values:

  • Primary: The primary node.
  • Secondary: The standby node.
  • ReadOnly: The read-only node.

tip

  • In the interface for querying instance price details (DescribeDBInstancePriceDetail), this field is optional.
  • When adding a node (CreateDBNodes), the value of this field can only be ReadOnly (for a two-node instance) or Secondary (for a multi-node instance).
  • For a two-node instance, there is exactly one primary node and one standby node, and 0 to 10 read-only nodes are optional.
  • For a multi-node instance, there is exactly one primary node, a maximum of 8 standby nodes can be added, and at least 1 standby node is required. It is recommended to reserve an independent standby node that does not carry business so that it can be switched to the primary node when necessary. If the master-slave delay of all standby nodes is too high due to the lack of an independent standby node, resulting in a failure to switch the primary node, the Cloud Database MySQL Edition will not bear the relevant responsibilities.
NodeSpec
String
Yes
rds.mysql.1c2g

Node Specifications. For detailed information about node specifications, please refer to Product Specifications.

tip

  • The specifications of the standby node need to be consistent with those of the primary node.
  • The specifications of the read-only node can be lower than those of the primary node. However, it should be noted that when the specifications of the read-only node are lower than those of the primary node, there may be a delay in the read-only node or even OOM of the read-only node due to the high load of the primary node. It is recommended to select the same or higher specifications for the read-only node as the primary node.
ZoneId
String
Yes
cn-beijing-a

The availability zone where the node is located can be queried by calling the DescribeAvailabilityZones interface. It must be passed when creating an instance and adding a new node, and it may not be passed when changing the node configuration or deleting a node.

tip

  • The nodes of an instance can be distributed in up to three availability zones.
  • In one configuration change, nodes in up to three availability zones can be added or deleted.
NodeOperateType
String
No
Modify

Operation type. It is not required to be passed in when creating an instance, but is required to be passed in when modifying the node configuration. Value range:

  • Create: Add.
  • Modify: Modify.

tip

  • When adding a node (CreateDBNodes), this field can only take the value of Create.
  • When changing the configuration, this field can only take the value of Modify.
SwitchType
String
No
MaintainTime

Execution time, values:

  • Immediate: Switch immediately (default).
  • MaintainTime: Switch within the maintainable time period.
  • SpecifiedTime: Switch within the specified time period.

tip

  • You can call the DescribeDBInstanceDetail interface to query the maintainable time period of the instance.
  • When the value is SpecifiedTime, you need to set the start and end time of the time period in the parameters SpecifiedSwitchStartTime and SpecifiedSwitchEndTime.
SpecifiedSwitchStartTime
String
No
2024-12-25T14:00:00Z

Start time of the specified execution time window. The time format is yyyy-MM-ddTHH:mm:ssZ.

tip

This parameter is required when SwitchType is set to SpecifiedTime.

SpecifiedSwitchEndTime
String
No
2024-12-25T15:59:00Z

End time of the specified execution time window. The time format is yyyy-MM-ddTHH:mm:ssZ.

tip

  • This parameter is required when SwitchType is set to SpecifiedTime.
  • The minimum duration of the specified time window is one hour and fifty-nine minutes.

Response parameters

Name
Type
Example
Description
InstanceId
String
mysql-759174bd****
Instance ID.
OrderId
String
-
Order ID.

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 codes

For more details, refer to Error codes.

Last updated: 2025.12.04 11:25:44