This topic describes how to change the vSwitch of an ApsaraDB RDS for PostgreSQL instance in the ApsaraDB RDS console or by calling an API operation.
Prerequisites
The RDS instance uses standard SSDs or enhanced SSDs (ESSDs).
Limits
If no vSwitch is available in the current zone in which the instance resides, go to the VPC console to create one.
You cannot change the virtual private cloud (VPC) of an RDS for PostgreSQL instance. However, you can use one of following solutions to achieve the same goal:
Create an RDS instance that resides in the required VPC and then migrate the data of the original RDS instance to the new RDS instance. For more information, see Use the cloud migration feature to migrate data between ApsaraDB RDS for PostgreSQL instances or Use DTS to migrate data between ApsaraDB RDS for PostgreSQL instances.
If you do not want to migrate your instance, you can create a VPC peering connection to connect your instance with the required VPC. If the VPC of your instance and the required VPC are in the same region, you are not charged fees for the peering connection. Otherwise, the peering connection incurs fees. For more information, see Use VPC peering connection for private communication.
Impacts
When you switch your RDS instance to a different vSwitch, a transient connection that lasts approximately 30 seconds occurs. Make sure that your application is configured to automatically reconnect to your RDS instance.
After you switch your RDS instance to a different vSwitch, the virtual IP address (VIP) of your RDS instance changes. We recommend that you connect your application to your RDS instance by using an endpoint. For more information, see Configure endpoints.
The VIP change interrupts the connection between your RDS instance and Data Management (DMS) and the connection between your RDS instance and Data Transmission Service (DTS) for a short period of time. After you switch your RDS instance to a different vSwitch and the VIP of the RDS instance is changed, the connections are automatically resumed.
The DNS cache on your database client may prevent you from writting data to the database. After you switch your RDS instance to a different vSwitch, we recommend that you immediately clear the DNS cache on the database client.
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 Database Connection.
Click Switch vSwitch.
Select the required vSwitch and click OK.
If no vSwitch is available in the current zone in which the instance resides, go to the VPC console to create one.
In the dialog box that appears, click OK.
FAQ
How do I change the VPC of an RDS instance?
You cannot change the virtual private cloud (VPC) of an RDS for PostgreSQL instance. However, you can use one of following solutions to achieve the same goal:
Create an RDS instance that resides in the required VPC and then migrate the data of the original RDS instance to the new RDS instance. For more information, see Use the cloud migration feature to migrate data between ApsaraDB RDS for PostgreSQL instances or Use DTS to migrate data between ApsaraDB RDS for PostgreSQL instances.
If you do not want to migrate your instance, you can create a VPC peering connection to connect your instance with the required VPC. If the VPC of your instance and the required VPC are in the same region, you are not charged fees for the peering connection. Otherwise, the peering connection incurs fees. For more information, see Use VPC peering connection for private communication.
Reference
For more information about how to change the vSwitch of an RDS instance to a vSwitch that belongs to a different zone, see Migrate an ApsaraDB RDS for PostgreSQL instance across zones in the same region.
Related API operation
Operation | Description |
Changes the vSwitch of an RDS for PostgreSQL instance. Important You cannot directly change the VPC of an RDS for PostgreSQL instance. Therefore, you must set the VPCId parameter to the VPC of the current instance. |