Classic network is no longer recommended. This topic covers the full lifecycle of a classic network endpoint: switching to VPC, setting the retention period of the original classic internal endpoint, and releasing the classic network endpoint.
Switch from classic network to VPC
Prerequisites
The instance uses the classic network.
You can check the network type in the Basic Information section on the instance details page.
Impacts
After switching to VPC, you cannot switch back to the classic network.
The instance briefly disconnects for a few seconds. Perform this operation during off-peak hours and ensure your application supports automatic reconnection.
Network types
Network type | Description |
VPC (Recommended) | A logically isolated private network on Alibaba Cloud with Layer 2 isolation for high security and performance. When your client runs on an ECS instance, connecting to the instance over a VPC provides lower latency and stronger isolation. |
classic network | Cloud services share the network. Use security groups or IP address whitelists to block unauthorized access. |
A VPC client cannot connect to a classic network instance. Switch the instance to the same VPC as the client.
Procedure
Log on to the console and go to the Instances page. In the top navigation bar, select the region in which the instance is deployed. Then, find the instance and click its ID.
In the Connection Information section, click Switch to VPC Network on the right.
In the panel, configure the following parameters.
Parameter
Description
VPC Network
Select the target VPC and vSwitch.
NoteIf no VPCs or vSwitches are listed, none exist in the instance's region and zone. Create and manage a VPC and Create and manage a vSwitch.
For example, if your instance is in China (Hangzhou) Zone E and no vSwitches appear after selecting a VPC, that VPC lacks a vSwitch in Zone E. Create one first, then retry.
Virtual Switch:
Retain Classic Network Address:
Choose whether to keep the classic network endpoint.
Yes: The instance keeps both endpoints. Clients can use either one. Migrate to the VPC endpoint before the classic network endpoint expires.
No: The VPC endpoint reuses the classic network endpoint, so no client-side changes are needed. Clients can only connect over the VPC.
Retention Days:
Number of days to keep the classic network endpoint. You can adjust this after the switch. See Modify the retention period of the classic network endpoint below.
Click OK.
Modify the retention period of the classic network endpoint
Prerequisites
You kept the classic network endpoint when switching the instance to VPC (see Switch from classic network to VPC above).
Usage notes
The new expiration date takes effect immediately after you save the change, and is recounted from the day you make the change. For example, if the endpoint is due to expire in 3 days and you reset the retention period to 14 days, it will instead expire 14 days from the day you make the change.
You can update the expiration date multiple times.
Procedure
Log on to the console and go to the Instances page. In the top navigation bar, select the region in which the instance is deployed. Then, find the instance and click its ID.
On the right side of the Connection Information section, click Modify Expiration Time next to Reserved Classic Network Address.
In the panel, specify a new expiration date and click OK.
Release the classic network endpoint
Prerequisites
The instance has a retained classic network endpoint, which was created when you switched the instance to VPC.
Your application is already using the VPC endpoint. The classic network endpoint becomes unavailable immediately after it is released.
Procedure
Log on to the console and go to the Instances page. In the top navigation bar, select the region in which the instance is deployed. Then, find the instance and click its ID.
On the right side of the Connection Information section, click Modify Expiration Time next to Reserved Classic Network Address.
In the dialog box, select Release Now.
WarningAfter the release, the classic network endpoint becomes unavailable immediately. Update your application's connection string to the VPC endpoint beforehand to ensure connectivity.
Click OK.
FAQ
Q: Why can't I select a vSwitch when I switch to a VPC?
A: No VPC or vSwitch exists in the instance's region and zone. Create and manage a VPC and Create and manage a vSwitch, then retry.
Q: If an ECS instance and a Redis instance are in the same VPC but in different vSwitches (or zones), can they connect over the VPC?
A: Yes. As long as the ECS instance and the Redis instance are in the same region and the same VPC, they can connect regardless of vSwitch or zone. Add the ECS instance's internal IP address to the IP address whitelist of the Redis instance.
Q: Can instances in other VPCs or external servers still connect after switching to a VPC?
A: After the switch, only ECS instances in the same VPC can connect over the internal network. For cross-VPC connectivity, use Cloud Enterprise Network (CEN) or VPC peering. For cross-cloud access (such as from China Telecom Cloud), apply for a public endpoint.
Related APIs
API | Description |
Switches an instance from the classic network to a VPC. | |
Modifies the expiration date of a classic network endpoint. Set the expiration to release immediately to release the endpoint. |