Compared with Elastic Compute Service (ECS) instances located in the classic network, ECS instances located in virtual private clouds (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 instances do not have local disks attached. If the instances have local disks attached, submit a ticket to seek advice from Alibaba Cloud on how to migrate the instances.
- The instances have a public bandwidth greater than 0 Mbit/s. If an instance has a public IP address and a public bandwidth of 0 Mbit/s, you must upgrade the public bandwidth before you can migrate the instance. For more information, see Modify public bandwidth.
- The instances are located in one of the following regions that support the migration
plan feature: China (Qingdao), China (Beijing), China (Hangzhou), China (Shanghai),
China (Shenzhen), China (Hong Kong), US (Silicon Valley), and Singapore (Singapore).
Note Some instances located in Hangzhou Zone C cannot be migrated from the classic network to VPCs.
Impacts of migrating an ECS instance from the classic network to a VPC
Item | Description |
---|---|
Amount of time required to migrate the instance | It takes about 15 minutes from when the instance in the classic network is stopped
until when it is migrated and started in the VPC.
Note After the computing and network resources of an instance are migrated, the instance
is started in the VPC. If the instance is migrated across zones, the system continues
to migrate disk data of the instance after the instance is started. Typically, it
takes about 4 hours to migrate 100 GiB of disk data. During the migration, the I/O
performance of disks degrades and snapshot- and disk-related features are not supported.
|
Instance state | During migration, the instance is stopped and then started again. We recommend that you schedule to migrate your instance during off-peak hours. |
Network type | After the instance is migrated, its network type changes from classic network to VPC. For information about VPCs, see What is a VPC?. |
Software authorization code | After the instance is migrated, its software authorization codes may change. |
IP address |
|
Disk name | Some ECS instances have their underlying virtualization technology upgraded when they
are migrated from the classic network to VPCs. This may cause the disk names on the
instances to change. On Linux instances, disks names follow a naming convention of
vd?, such as vda, vdb, and vdc.
|
Fee |
|
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 of a disk.
- (Optional) If an ECS instance to be migrated is associated with an Alibaba Cloud database
service, you must enable the hybrid access mode for the database service beforehand.
In hybrid access mode, Alibaba Cloud database services are accessible to ECS instances regardless of whether the instances are located in the classic network or in VPCs. For more information, see Overview of the hybrid access mode of ApsaraDB.
- (Optional) If an ECS instance to be migrated 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 the corresponding whitelists of the database
service beforehand.
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.
Note The 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 beforehand.
- Reserve at least 500 MiB of free space on the system disk of each ECS instance to be migrated.
- Make sure that the destination vSwitch has sufficient internal IP addresses available. The number of the available internal IP addresses must be greater than that of ECS instances to be migrated.
Step 1: Create a migration plan
Step 2: Migrate the ECS instances

- Stop the ECS instances to be migrated.
- Migrate the computing and network resources of the ECS instances.
- Start the migrated ECS instances.
- Continue to migrate the disk data of the ECS instances.
- Complete the migration.
Step 3: Check the migration results
Post-migration considerations
- If an ECS instance runs a Linux operating system and is assigned a different internal
IP address after the instance is migrated, you must modify the /etc/hosts file of the instance.
- Run the
vi /etc/hosts
command to open the hosts file. - Press the I key to enter the edit mode.
- Change the original internal IP address to the new internal IP address for the instance.
- Press the Esc key to exit the edit mode.
- Enter :wq and press the Enter key.
- Run the
- 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, Object Storage Service (OSS), and Container Service for Kubernetes.
- If an instance is migrated across zones, its connectivity with other Alibaba Cloud
services such as ApsaraDB RDS, ApsaraDB for Redis, and ApsaraDB for MongoDB may be
affected. Adjust application configurations in a timely manner. 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 in the same region.
- If you have not restarted an instance or upgraded its kernel for an extended period of time, problems 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.
- (Optional) Software authorization codes change because NICs are deleted.
If software is associated with a MAC address on your ECS instance and the software vendor approves the migration certificate issued by Alibaba Cloud, you can re-authorize the instance to use the software. If an error occurs, you must modify the configurations or roll back the instance.
- (Optional) If you have not restarted an ECS instance for an extended period of time or if you have not restarted an instance after its 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 in a timely manner to contact Alibaba Cloud.
FAQ
- Why am I unable to open websites, use services, or read data from or write data to
databases on an instance after the instance is migrated from the classic network to
a VPC?
This may be because traffic is not allowed on the required communication ports in the new security groups of your instance. We recommend that you clone the original security groups. For more information, see Clone a security group.
- After an instance is migrated, some software cannot be used and I am prompted that
the authorization code is expired or invalid or that no authorization code exists
for the software. Why?
This issue may occur due to one of the following reasons:
- The software vendor has not approved the migration certificate issued by Alibaba Cloud. We recommend that you contact the software vendor or channel partner to submit a verification form for re-authorization.
- The software was associated with a MAC address to register to your instance. Some software is registered to a valid environment by associating MAC addresses. After an ECS instance is migrated to a VPC, only the public or private MAC address of the instance is retained. If the MAC address with which a piece of software was associated to register is deleted, an authorization error occurs. We recommend that you contact the software vendor to check whether the software was associated with a MAC address to register to your instance. If yes, you must re-associate the MAC address of the instance with the software. For more information, see Overview.
- Why am I no longer able to use the FTP service on an instance after the instance is
migrated?
After your ECS instance is migrated, its public NIC is deleted and the FTP service becomes unavailable. We recommend that you perform the following operations:
- Convert the system-assigned public IP address of an instance that is located in a VPC to an EIP.
- Associate an EIP with a secondary ENI in cut-through mode.
Note Some retired instance types and entry-level instance types of the previous generation do not support ENIs. If the instance type of your instance does not support ENIs, upgrade the instance to an instance type that supports ENIs before you perform the preceding operations. For more information, see Overview of instance configuration changes. - I cannot find data disks on some Windows instances after the instances are migrated.
What do I do?
After some Windows instances are migrated, the disks attached to them go offline. We recommend that you perform the following steps to configure the disks to automatically go back online. For more information, see Methods for processing offline disks on Windows ECS instances.
- Log on to the ECS console.
- In the left-side navigation pane, choose .
- Click Create or Run Command to create and run a Cloud Assistant command.
In the Create Command panel, configure parameters described in the following table. For the parameters that are not described in the table, accept the default values. For more information, see Use the immediate execution feature.
Parameter Value Command Type PowerShell Command @("san policy=onlineall") |diskpart
Select Instances One or more Windows instances. - Click Execute and Save.
- Why am I unable to transfer files to or from an instance over FTP after the instance
is migrated from the classic network to a VPC?
ECS instances in the classic network have both public and private NICs, whereas ECS instances in VPCs have only ENIs, which are private NICs. If your applications are configured to recognize only public IP addresses, you must reconfigure the applications.
Most FTP clients access FTP servers in passive mode. In passive mode, FTP servers must communicate their IP addresses to FTP clients. In VPCs, public IP addresses cannot be recognized and FTP servers send their internal IP addresses to FTP clients. When the clients use the internal IP addresses to access the servers, errors occur.
When you use an ECS instance located in a VPC as an FTP server, we recommend that you communicate the public IP address of the instance to the FTP server program. The procedures to communicate the public IP addresses of ECS instances vary based on the types of FTP server programs. Select a procedure that is suitable for your FTP server program. In the following example, vsftpd is used. Open the configuration file of vsftpd and add the following content to the file:listen_ipv6=NO pasv_address=<PublicIP>
Note Replace <PublicIP> with the system-assigned public IP address or EIP of your instance. If an EIP is associated with the instance, we recommend that you use the EIP.