To change the vSwitch of an ApsaraDB RDS for PostgreSQL instance, you can use the console or call an API.
Prerequisites
The ApsaraDB RDS for PostgreSQL instance must use cloud disks.
Limitations
-
If no vSwitch is available in the current zone, go to the VPC console to create a vSwitch.
-
ApsaraDB RDS for PostgreSQL does not support changing the VPC.
-
To change the VPC, purchase a new instance in the target VPC and then migrate your data to the new instance. For more information, see Use the one-click cloud migration feature to migrate an instance or Use DTS to migrate data.
-
If you cannot migrate the instance, you can connect the VPCs by using a VPC peering connection to enable private network connectivity between VPCs. VPC peering connections within the same region are free of charge, whereas cross-region VPC peering connections incur fees.
-
Impacts
-
The switchover causes a transient connection interruption of about 30 seconds. Ensure that your application has an automatic reconnection mechanism.
-
Because switching the vSwitch changes the virtual IP (VIP) address, use an endpoint instead of an IP address in your application to connect to the instance.
-
The VIP address change temporarily affects the use of Data Management (DMS) and Data Transmission Service (DTS). All services automatically resume after the switchover is complete.
-
The DNS cache on the client may prevent write operations, allowing only read operations. You must clear the cache as soon as possible.
Procedure
Go to the Instances page. In the top navigation bar, select the region in which the RDS instance resides. Then, find the RDS instance and click the ID of the instance.
-
In the left-side navigation pane, click Connectivity and Security.
-
Click Switch to another vSwitch.
-
Select a vSwitch and click OK.
If no vSwitch is available in the current zone, go to the VPC console to create a vSwitch.
-
In the dialog box, review the risks and click OK.
FAQ
Q: How do I change the VPC of an instance?
A: You cannot change the VPC of an ApsaraDB RDS for PostgreSQL instance.
-
To change the VPC, purchase a new instance in the target VPC and then migrate your data to the new instance. For more information, see Use the one-click cloud migration feature to migrate an instance or Use DTS to migrate data.
-
If you cannot migrate the instance, you can connect the VPCs by using a VPC peering connection to enable private network connectivity between VPCs. VPC peering connections within the same region are free of charge, whereas cross-region VPC peering connections incur fees.
Related operations
To switch an instance to a vSwitch in another availability zone, see Change the zone of an instance.
Related API
|
API |
Description |
|
Switches the vSwitch of an ApsaraDB RDS for PostgreSQL instance. Important
The VpcId parameter must be set to the ID of the instance's current VPC because VPC changes are not supported. |