The cross-zone instance type change feature allows you to migrate an Elastic Compute Service (ECS) instance across zones in a region and change the instance type (vCPUs and memory) of the ECS instance to another instance type in the same instance family to meet your business requirements.
Scenarios
Change the instance type of an ECS instance
If the current configurations of your ECS instance cannot meet your business requirements and the required instance type is sold out in the current zone, you can change the number of vCPUs and the memory size of instances within the same instance family while migrating the ECS instance across zones. For example, you can change the instance type of
2 vCPUs and 8 GiB of ecs.g6e.large
to4 vCPUs and 16 GiB of ecs.g6e.xlarge
.Change the zone of an ECS instance
You can deploy your application on ECS instances across different zones in a region to ensure that when a zone fails, services can be quickly switched to another zone to continue running. This improves the overall availability and stability of your system. For example, migrate an instance from Hangzhou Zone H to Hangzhou Zone K.
If you want to migrate your ECS instance to another region, we recommend the following solutions:
Utilize the server migration feature to migrate your ECS instance from one region to another. For more information, see Migrate data between ECS instances that belong to the same Alibaba Cloud account or different Alibaba Cloud accounts.
Create a custom image of your current instance, copy the custom image to the destination region, and use this custom image to create an instance there. For more information, see Create a custom image from an instance, Copy a custom image, and Create an instance by using a custom image.
How the cross-zone instance type change feature works
The following figure shows how the cross-zone instance type change feature works.
Limits
Preemptible instances do not support cross-zone migration.
You can change the number of vCPUs and the memory size of an ECS instance within the same instance family. For more information about instance families, see Overview of instance families.
NoteIf you want to change the instance type of an ECS instance to a different family across zones, we recommend that you perform a cross-zone migration first, and then change the instance type. For more information, see Upgrade the instance types of subscription instances or Change the instance type of a pay-as-you-go instance.
The following instance families do not support instance type changes across zones:
Heterogeneous computing instance families
ECS Bare Metal Instance families
Super Computing Cluster (SCC) instance families
u1, universal instance family
e, economy instance family
x86-based instance families
Big data instance families
Instance families with local SSDs
Security-enhanced instance families
Instance families of the eighth generation, including g8ise, g8a, g8i, g8ae, g8y, c8a, c8i, c8ae, c8y, r8a, r8i, r8ae, and r8y
Migration impacts
Item | Description |
Amount of time that is required to migrate an ECS instance | Approximately 15 minutes are required from the time when an instance is stopped until the time when the instance is migrated and started. Important After the computing and network resources of an ECS instance are migrated, the instance is started. After the instance is started, the system continues to migrate the disk data of the instance. In most cases, approximately 4 hours are required to migrate 100 GiB of disk data. During the migration, the I/O performance of disks degrades and you cannot perform snapshot-related and disk-related operations. |
Instance status | During the migration, the ECS instance is stopped and then restarted. We recommend that you migrate the instance during off-peak hours. |
Software authorization codes | After an ECS instance is migrated, its software authorization codes may change. If the software vendor did not approve 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. |
Public/private IP address |
|
Other |
|
Billing
When you migrate an ECS instance, if you do not change its instance type, no fee changes are involved.
Otherwise, fees are changed based on the following rules:
If you downgrade the instance type of a subscription ECS instance, the instance type downgrade may result in a refund. The refund amount is calculated by using the following formula: Refund amount = Remaining amount of the configuration price before the downgrade - Price of the new configurations.
ImportantA monthly quota is enforced on instance type downgrades of subscription instances. The monthly quota is determined based on your historical consumption. The actual quota is displayed in the ECS console. If the monthly downgrade quota is exhausted, you cannot downgrade instance types until the quota is reset on the first day of the next month.
If you upgrade the instance type of a subscription ECS instance, you must pay for the price difference between the original instance type and the new instance type for the remainder of the current billing cycle. Actual fees are displayed in the ECS console.
If you change the instance type of a pay-as-you go ECS instance, you are charged based on the new instance type.
Preparations
Create snapshots for the disks of the ECS instances to ensure data security during the migration. For more information, see Create a snapshot.
Make sure that the ECS instances are deployed in virtual private clouds (VPCs). If you want to change the instance type of an ECS instance that resides in the classic network, you must migrate the instance from the classic network to a VPC. For more information, see Migrate ECS instances from the classic network to a VPC.
Make sure that applications deployed on the ECS instances do not depend on the current private IP addresses of the instances. If you select a new vSwitch when you change the instance type of an ECS instance across zones, the system assigns a new private IP address to the instance.
If security software such as Safedog, Huweishen, and Yunsuo is installed on the ECS instances whose instance types you want to change, disable the software before you make cross-zone instance type changes. Otherwise, virtualization drivers may fail to be installed and the instances cannot be started. You can enable the software after the cross-zone instance type changes.
Make sure that the system disks of the ECS instances have more than 500 MiB of available space. Otherwise, virtualization drivers may fail to be installed and the instances cannot be started.
Make sure that Alibaba Cloud Global Accelerator is disabled and the following items are not configured for the instances: IPv6 addresses, high-availability virtual IP addresses (HAVIPs), elastic network interfaces (ENIs), reverse proxies, and route tables.
Procedure
Step 1: Change instance types across zones
Go to ECS console - Instance.
In the top navigation bar, select the region and resource group of the resource that you want to manage.
Click the ID of the ECS instance whose instance type you want to change to go to the instance details page. In the upper-right corner of the page, choose All Actions > Network and Security Group > Migrate Instance Across Zones.
NoteAlibaba Cloud also allows you to perform batch operations on the Instance page. You can select up to five instances at a time and choose in the lower-left corner of the page. In the Change Configurations dialog box, select Change Instance Type Across Zones.
In the Migrate Instance Across Zones dialog box, configure the parameters described in the following table and click OK.
Parameter
Description
Migration Task Type
By default, ECS Instance Migration is selected. The setting cannot be changed.
Current Region
The region of the ECS instance that you want to migrate.
Preferred Destination Zone
Select the zone to which you want to migrate the ECS instance.
Preferred Network Settings
Select a destination vSwitch. After the instance is migrated, a new private IP address that belongs to the CIDR block of the vSwitch is randomly assigned to the instance.
You need to create a VPC and vSwitch in the zone to which you want to migrate the instance in advance. For more information, see Create and manage a VPC.
ImportantAfter the instance type of an instance is changed across zones, the original private IP address of the instance is not retained. Make sure that applications deployed on the instance do not depend on the original private IP address.
You can modify the private IP address after the migration is complete. For more information, see Change the primary private IPv4 address for an existing ECS instance.
Instance to Be Migrated
Select a new instance type from the Destination Instance Type column.
NoteThe system automatically displays supported destination instance types. If a supported instance type is not displayed, its inventory may be insufficient in the current zone.
Instance to Be Migrated
Display information about the ECS instance, including Instance ID/Name, Destination Zone, Destination Instance Type, and Destination vSwitch.
Note
Select I have backed up data.
In the dialog box that appears, click Pay to complete the payment as prsompted.
Step 2: Verify the migration result
Go back to the ECS console to check the instance status.
A specific period of time is required to change the instance types. If the instance type of an ECS instance is changed, the status of the instance changes from Migrating to Running. You can check the progress of the cross-zone instance type change in the Server Migration Center (SMC) console. Perform the following steps:
Log on to the SMC console.
In the left-side navigation pane, choose
.View the migration progress in the Real-Time Migration Status column. If Completed is displayed in the Real-Time Migration Status column, the instance type is changed.
FAQ
During cross-zone migration, a prompt as shown in the following figure is displayed.
To troubleshoot the issue, perform the following operations:
Check for Workbench private links.
Log on to the Workbench console, choose , and check whether there is a private link for the ECS instance.
NoteWhen logging in to the Workbench console, you need to click Show/Hide Instance Navigation Pane to display the Workbench menu bar.
If yes, click Release Link and proceed to the next step.
If no, proceed to the next step.
Check whether there is a custom route entry whose next hop is an ECS instance.
Log on to the VPC Console, find the route table used by the ECS instance based on its VPC, and check whether there is a custom route entry whose next hop is an ECS instance.
If yes, delete the custom route entry and proceed to the next step.
If no, proceed to the next step.
Check whether there is a DTS migration task whose source database is Self-managed Database on ECS.
Log on to the DTS console and check whether there is a DTS migration task whose source database is Self-managed Database on ECS.
If yes, delete the migration task and proceed to the next step.
ImportantBefore deleting a DTS task, make sure that the data transfer is complete and backups are made.
If no, proceed to the next step.
Check for associated VPC resources.
Log on to the VPC Console and check whether associated VPC resources (including DHCP options sets, network ACLs, route tables, and IPv4 gateways) exist. If yes, delete the resources before proceeding with the operations in this topic.
For more information about the associated VPC resources, see DHCP options sets, Create and manage a network ACL, Use custom route tables to manage network traffic, and Create and manage an IPv4 gateway.