Instances in the classic network and VPCs can communicate with each other by using ClassicLink. You can also migrate an instance from the classic network to a virtual private cloud (VPC) and use Cloud Enterprise Network (CEN) to enable the instance to communicate with other instances in other VPCs. This topic describes how to migrate multiple instances from the classic network to a VPC and enable the instances to communicate with other instances in other VPCs.
Prerequisites
Make sure that the instances in the classic network meet the following requirements:
- The instances are not of instance families that have local disks attached.
- The instances are not in Hangzhou Zone C where the network type of some ECS instances cannot be changed.
- All application services required by your business are configured to run on system startup.
- Check whether the software required by your business is registered based on the MAC addresses of network interface controllers (NICs). After the instances are migrated to a VPC, the public NICs of the instances are removed and the MAC addresses of the NICs are lost. You can contact the software vendor to check whether the software was registered to the MAC addresses of the NICs. If so, you must rebind the NICs to the instances.
Background information
- Precautions on migrating an instance from the classic network to a VPC. For more information, see the "Background information" section in Migrate ECS instances from the classic network to a VPC.
- Limits on the usage of CEN. For more information, see Limits.
- ECS instances in the classic network:
ECS-1
andECS-2
- An ECS instance in a VPC:
ECS-3
- A VPC created in the migration plan:
VPC-1
- The VPC to which the ECS-3 instance belongs:
VPC-2
- Create a migration plan to migrate the instances from the classic network to a VPC.
- Use Cloud Enterprise Network (CEN) to enable instances in
VPC-1
andVPC-2
to communicate with each other.
The VPCs used in this tutorial belong to the same account and region. Therefore, you do not need to configure features such as cross-region interconnection of CEN. If you want to configure cross-account or cross-region communication, you can also use CEN. For more information, see CEN.
If your resources are in the same account and region and are not frequently accessed, you do not need to migrate your classic network-type resources to VPCs. You can use the ClassicLink feature to enable communication between resources in the classic network and VPCs. For more information, see Connect a classic network to a VPC.
Step 2: Migrate the instances from the classic network to a VPC
Create a migration plan to migrate the ECS-1 and ECS-2 instances from the classic network to VPC-1. You can create a VPC in the migration plan. For example, you can set Destination VPC to ID/Name: (Default) Automatically create a VPC CIDR block: 10.0.0.0/8.
For more information, see Migrate ECS instances from the classic network to a VPC.
Step 2: Create a CEN instance and attach the VPCs to the CEN instance
After the instances are migrated to VPC-1, perform the following steps to enable communication between VPC-1
and VPC-2
:
- Log on to the CEN console.
- Click Create CEN Instance.
- In the Attach Network section, complete the following configurations:
- Network Type: Select VPC.
- Region: Select the same region as
VPC-1
. Example: China (Shanghai). - Networks: Select
VPC-1
created in Step 1.
- After you configure the other parameters, click OK.For more information, see Create a CEN instance.
- Log on to the VPC console.
- In the top navigation bar, select the region of
VPC-2
to which theECS-3
instance belongs. - Find
VPC-2
, click its name to go to the VPC Details page. - Click Attach to CEN and select the created CEN instance from the drop-down list.
Step 3: Test the connectivity
ECS-1
, ECS-2
, and ECS-3
instances can communicate with each other. The ECS-1
and ECS-2
instances are migrated to the same VPC, and can communicate with each other over the internal network. You only need to connect to the ECS-3
instance in VPC-2
and run the following command to check whether the instance can communicate with the other two instances: ping <Private IP address of the instance>
ping 10.0. **. **
command. If a command output similar to the following figure is returned, the instance can communicate with the other two instances.