Elastic Compute Service (ECS) instances in the classic network will reach end of life (EOL) on February 28, 2025. For more information, see EOL notice for Alibaba Cloud ECS instances in the classic network. If you have ECS instances that are deployed in the classic network, we recommend that you migrate the instances to virtual private clouds (VPCs) at the earliest opportunity. Compared with ECS instances in the classic network, ECS instances in VPCs are more secure and support additional features such as associating elastic IP addresses (EIPs). This topic describes how to use a migration plan to migrate one or more ECS instances from the classic network to a VPC.
Prerequisites
The Migration Plan feature is supported in the following regions: China (Qingdao), China (Beijing), China (Hangzhou), China (Shanghai), China (Shenzhen), China (Hong Kong), US (Silicon Valley), and Singapore. In the China (Hangzhou) region, you cannot migrate specific ECS instances in Hangzhou Zone C from the classic network to a VPC.
The ECS instances that you want to migrate from the classic network to a VPC meet the following requirements:
No local disks are attached to the ECS instances.
The ECS instances do not expire. If an ECS instance in the classic network expired and cannot be renewed, submit a ticket.
Understand the impacts of the classic network-to-VPC migration
The classic network-to-VPC migration affects the status, network type, and IP addresses of ECS instances. Before you migrate ECS instances, make sure that you are familiar with the migration impacts that are described in the following table.
Item | Description |
Period of time that is required to migrate an ECS instance | Approximately 15 minutes are required from the time when an ECS instance in the classic network is stopped until the time when the instance is migrated to and started in a specific VPC. Important
|
Instance status | During the migration, the ECS instance that is migrated is stopped and then restarted. We recommend that you migrate your instance during off-peak hours. |
Network type | After an ECS instance is migrated, the network type of the instance changes from classic network to VPC. For information about VPCs, see What is a VPC? Important After you migrate an ECS instance from the classic network to a VPC, you cannot migrate the instance back to the classic network. |
Software authorization codes | After an ECS instance is migrated, the authorization codes of software on the instance may change. |
Public and internal IP addresses |
|
Device names of disks |
|
Billing |
|
Regions and zones |
|
Hostnames |
|
Others |
|
Preparations
Create snapshots for the disks on the ECS instances to be migrated to back up data.
For more information, see Create a snapshot.
NoteYou are charged for the snapshots. For more information, see Billing of snapshots.
If an ECS instance that you want to migrate is associated with an Alibaba Cloud database service, you must enable the hybrid access mode for the database service before you migrate the instance.
In hybrid access mode, Alibaba Cloud database services can be accessed by ECS instances that reside in the classic network or VPCs. For more information, see Hybrid access to ApsaraDB services and Configure the hybrid access solution.
If an ECS instance that you want to migrate is associated with an Alibaba Cloud database service (such as ApsaraDB RDS) that provides the whitelist feature, you must add the CIDR block of the destination vSwitch to a whitelist of the database service before you migrate the instance.
For more information, see Configure a whitelist.
(Optional) To ensure that services can be rapidly restored after migration, we recommend that you configure application services to run on instance startup and monitor service availability.
Disable or uninstall server security software on the ECS instances to be migrated.
NoteThe device drivers of ECS instances are updated when the instances are migrated. You must disable or uninstall security software such as Safedog, Huweishen, and Yunsuo on the instances before you migrate the instances.
Reserve at least 500 MiB of free space on the system disk of each ECS instance that you want to migrate. If less than 500 MiB of free space is available on the system disk of each ECS instance that you want to migrate, virtualization drivers may fail to be installed and the instances may be unable to start.
Make sure that the destination vSwitch has sufficient internal IP addresses available. The number of available internal IP addresses must be greater than the number of ECS instances to be migrated.
If an ECS instance has a public IP address and a public bandwidth of 0 Mbit/s, you must upgrade the public bandwidth to a public bandwidth of more than 0 Mbit/s before you migrate the instance. A public bandwidth of 0 Mbit/s results in the loss of the public IP address after you migrate the instance. For more information, see the Modify the maximum public bandwidth section of the "Overview of instance configuration changes" topic.
Procedure
Migration process overview
Step 1: Create a migration plan
Log on to the ECS console.
In the left-side navigation pane, choose .
In the top navigation bar, select the region and resource group to which the resource belongs.
Click Create Migration Plan.
In the Precautions dialog box, select I have read and understood the precautions and click Create Migration Plan.
In the Configure Migration Plan step, configure the destination zone and VPC, network properties, and network connectivity settings, and click Next.
In the Destination Zone and VPC section, configure the parameters. The following table describes the parameters.
Parameter
Description
Plan Name
Enter a name for the migration plan.
Select a destination zone
Select a destination zone from the drop-down list. The available zones are automatically planned and displayed based on resource availability. If the zone to which you want to migrate ECS instances is not in the drop-down list, select another available zone from the drop-down list or submit a ticket to contact technical support. In most cases, a zone is missing from the drop-down list if the ECS instance resources in the zone are sold out.
NoteOnly one zone can be specified in each migration plan. If you want to migrate multiple ECS instances to different zones, you must create multiple migration plans.
Destination VPC or Create a VPC
Select a destination VPC from the drop-down list. The CIDR block of the selected VPC determines whether the internal IP addresses of the ECS instances from the classic network can be retained.
If you want to retain the internal IP addresses of the ECS instances, you must select a VPC that is associated with the 10.0.0.0/8 CIDR block. You can select the default option or a VPC that you created.
If you have not created VPCs that are associated with the 10.0.0.0/8 CIDR block, select (Default) Automatically create a VPC, CIDR block: 10.0.0.0/8. Then, a VPC that is associated with the 10.0.0.0/8 CIDR block is automatically created.
If you have created a VPC that is associated with the 10.0.0.0/8 CIDR block, select the VPC.
If you do not want to retain the internal IP addresses of the ECS instances, you must select a VPC that is associated with a CIDR block other than 10.0.0.0/8.
In the Instance Network Properties section, configure the parameters. The following table describes the parameters.
Parameter
Description
Destination Security Group
Specify destination security groups. Valid values:
(Default) Clone Security Groups of Classic Network-type Instances: The security groups of the ECS instances are automatically cloned from the classic network to the destination VPC. The rules of the new security groups (clone security groups) in the VPC are the same as the rules of the original security groups in the classic network.
ImportantIf the original security groups in the classic network are referenced by managed security groups or contain rules that reference a managed security group, the original security groups cannot be cloned to the destination VPC.
If you set Destination VPC or Create a VPC to (Default) Automatically create a VPC, CIDR block: 10.0.0.0/8, Destination Security Group is automatically set to (Default) Clone Security Groups of Classic Network-type Instances and cannot be modified.
Specify Security Groups: Select one or more existing security groups from the drop-down list.
ImportantImproper security group settings affect the connectivity of ECS instances. Make sure that your security group rules meet your connectivity requirements.
Mac Address Retention Policy
Select the media access control (MAC) address that you want to retain for each ECS instance from the classic network. In the classic network, an ECS instance that is assigned a public IP address has a public MAC address and a private MAC address. In a VPC, each ECS instance has only a private MAC address and can use a NAT device to map the internal IP address of the instance to a public IP address for Internet access.
You can select (Default) Private Mac Address or Public Mac Address based on your business requirements.
If your business system is associated with a MAC address, retain the MAC address. For example, this situation applies when your software is associated with a MAC address for registration.
(Default) Private Mac Address: The private MAC addresses of the ECS instances are retained regardless of whether the instances have public MAC addresses.
Public Mac Address: If the ECS instances have public MAC addresses, the public MAC addresses are retained. If the ECS instances do not have public MAC addresses, the private MAC addresses of the instances are retained.
If your business system is not associated with a MAC address, select (Default) Private Mac Address or Public Mac Address.
In the Instance Network Connectivity section, configure the parameters. Then, click Next. The following table describes the parameters.
Parameter
Description
Retain Internal IP Address
Specify whether to retain the internal IP addresses of the ECS instances from the classic network. If you want to retain the internal IP addresses of the ECS instances, you must specify how to create a vSwitch. If you do not want to retain the internal IP addresses of the ECS instances, you must select a vSwitch from the drop-down list.
(Default) Yes: retains the internal IP addresses of the ECS instances from the classic network. If you select (Default) Yes, you must configure vSwitch Creation Policy.
If you set vSwitch Creation Policy to Automatic, a vSwitch is automatically created and associated with a CIDR block based on the internal IP addresses of the ECS instances. Make sure that the CIDR block corresponding to the internal IP addresses of the ECS instances is not used by other vSwitches. If the CIDR block is used by other vSwitches, the vSwitch cannot be created.
NoteIf you set Destination VPC or Create a VPC to (Default) Automatically create a VPC, CIDR block: 10.0.0.0/8, Retain Internal IP Address is automatically set to (Default) Yes, and vSwitch Creation Policy is automatically set to Automatic and cannot be modified.
If you set vSwitch Creation Policy to Manual, you must create a vSwitch in the specified destination zone based on the internal IP addresses of the ECS instances.
NoteYou can set vSwitch Creation Policy to Manual only when you select a user-created VPC that is associated with the 10.0.0.0/8 CIDR block for Destination VPC or Create a VPC.
No: does not retain the internal IP addresses of the ECS instances from the classic network. You must select a vSwitch from the drop-down list.
NoteIf you cannot find the vSwitches that you created in the drop-down list, the reason may be that the vSwitches do not reside in the specified destination zone. Create a vSwitch in the destination zone. For more information, see Create and manage a vSwitch.
Ensure interconnections between the migrated instances and the classic network-type instances
Specify whether to allow mutual access over the internal network between migrated instances and unmigrated instances that are included in the migration plan. Configure this parameter based on the value of Retain Internal IP Address.
Retain Internal IP Address set to (Default) Yes:
If you do not want to allow mutual access over the internal network between migrated instances and unmigrated instances that are included in the migration plan, select (Default) No.
If you want to allow mutual access over the internal network between migrated instances and unmigrated instances that are included in the migration plan, select Yes. Then, select all ECS instances in the classic network that require mutual access over the internal network in the Select Instances step. You can schedule different migration times for the instances to specify the order in which to migrate the instances.
NoteECS instances in the classic network that are not included in the migration plan cannot communicate with the ECS instances that are migrated to the specified VPC over the internal network. After this migration plan is created, ECS instances cannot be added to the plan.
Retain Internal IP Address set to No:
If you do not want to allow mutual access over the internal network between migrated instances and unmigrated instances that are included in the migration plan, proceed to the Select Instances step.
If you want to allow mutual access over the internal network between migrated instances and unmigrated instances that are included in the migration plan, configure ClassicLink to link the instances to the specified VPC before you migrate the instances. For more information, see Connect an instance in a classic network to a VPC.
In the Select Instances step, select ECS instances and click Next.
If you set Retain Internal IP Address to (Default) Yes and want to allow mutual access over the internal network between migrated instances and unmigrated instances that are included in the migration plan, you must select all ECS instances in the classic network that require mutual access over the internal network. You can schedule different migration times for the instances to specify the order in which to migrate the instances. After the migration plan is created, you cannot add ECS instances to the plan.
In the following figure, the section that is labeled ① indicates the instances that you want to migrate in the first batch, and the section that is labeled ② indicates the instances that you want to migrate in subsequent batches.
In the Scheduled Migration step, specify the migration time for the instances and click Verify.
The instances are stopped and then started again during the migration process. We recommend that you schedule the migration task for your instances during off-peak hours. A unique migration time can be specified for each instance.
To specify a migration time for only a single instance, click Schedule Migration Time in the Actions column corresponding to the instance.
To specify a migration time for multiple instances that you want to migrate in a batch, select the instances and click Batch Schedule Migration Time.
ImportantFor ECS instances that need to remain in the classic network and communicate with the ECS instances that are migrated by this migration plan, specify a later migration time. Before the migration time, you can reevaluate whether to migrate the ECS instances from the classic network.
The following limits apply to the migration time that can be specified for each instance:
The migration time cannot be earlier than the local time.
The migration time cannot be later than the expiration time of the instance.
After the migration plan is created, the replicas of some disks are checked. The period of time that is required by the check is determined based on the disk size and the number of disks that are queued for the check. The migration starts after the check is complete. Set migration times as prompted.
In the Verify dialog box, read the migration considerations and verify whether your migration plan meets the specified requirements.
If your migration plan meets the specified requirements, select options and click Confirm and Create.
If your migration plan does not meet the requirements, error messages are displayed. You can troubleshoot the errors based on the error messages and modify the relevant parameters to create the migration plan again.
Step 2: Migrate the ECS instances
After the migration plan is created, the system migrates the specified ECS instances from the classic network to the destination VPC at the specified times.
If an ECS instance is migrated across zones, the system continues to migrate disk data of the instance after the instance is started. In most cases, approximately 4 hours are required to migrate 100 GiB of disk data. During the migration of disk data, the I/O performance of disks degrades and snapshot-related and disk-related operations cannot be performed. The disk data migration does not affect the running of your business. If your business is not highly sensitive to I/O performance degradation, the reduction in I/O performance is imperceptible.
Step 3: Check the migration results
In the left-side navigation pane, choose .
Find the migrated ECS instances and click the ID of each of these instances.
On the Instance Details page, check whether the network type of the instance is VPC.
If the instance is migrated to the specified VPC, the network type of the instance changes to VPC.
Check the internal network and business runtime environments.
Scenario
Migration plan
What to do next
Migrate all ECS instances from the classic network to a VPC
Set Destination VPC or Create a VPC to (Default) Automatically create a VPC, CIDR block: 10.0.0.0/8.
Set Ensure interconnections between the migrated instances and the classic network-type instances to (Default) No.
Check whether your business system runs as expected.
Migrate some ECS instances to a VPC and retain other ECS instances in the classic network
Set Destination VPC or Create a VPC to (Default) Automatically create a VPC, CIDR block: 10.0.0.0/8.
Set Ensure interconnections between the migrated instances and the classic network-type instances to Yes.
Check whether your business system runs as expected.
Other scenario
Set Destination VPC or Create a VPC to a VPC that is associated with a CIDR block other than 10.0.0.0/8.
Check network connectivity.
In this scenario, Retain Internal IP Address is unsupported. If your business is connected by using internal IP addresses, you must configure new internal IP addresses.
Check whether your business system runs as expected.
(Required) Handle post-migration issues
If you do not retain the internal IP addresses of ECS instances, but the associated services use domain names that were bound to the original internal IP addresses, modify the /etc/hosts file on the corresponding instances and change the original internal IP addresses to the new internal IP addresses.
If you have set Retain Internal IP Address to No in the migration plan, remove the internal IP addresses that are no longer used from the whitelists of other cloud services after the migration,
such as AparaDB RDS, SLB, and Object Storage Service (OSS).
If an ECS instance is migrated across zones, its connectivity with other Alibaba Cloud services, such as ApsaraDB RDS, Tair (Redis OSS-compatible), and ApsaraDB for MongoDB, may be affected. Adjust application configurations at the earliest opportunity. For example, you can migrate the corresponding RDS instances to the same zone as the ECS instance to ensure connectivity. For more information, see Migrate an ApsaraDB RDS for MySQL instance across zones.
If you have not restarted an ECS instance or upgraded its kernel for an extended period of time, issues may occur after the instance is migrated. For example, a file system check (fsck) may be performed, configuration changes may become invalid, or the instance may be unable to start.
If you have not restarted an ECS instance for an extended period of time or after the kernel is upgraded, the system checks the file systems of the instance and updates the configurations of the instance when the instance is restarted. If your ECS instance cannot be started, submit a ticket at the earliest opportunity to contact Alibaba Cloud.
If a NAS file system is mounted on an ECS instance, you must replace classic network mount targets with VPC mount targets. For more information, see Replace a classic network mount target with a VPC mount target for a NAS file system.