The Elastic Compute Service (ECS) instance cloning feature helps you quickly create instances that are the same as or similar to the source instances. The instance cloning feature can be used in scenarios such as replication and test environments, application extensions, disaster recovery, backup, migration, and upgrade. This feature can improve service reliability, scalability, and efficiency. This topic describes how to clone instances and the billing method and limits of the cloned instances.
Prerequisites
The image used by the instance that you want to clone (source instance) is displayed on the Images page of the ECS console or by calling the DescribeImages operation. Otherwise, you cannot clone the instance. For information about how to find an image, see Find an image.
Billing methods
The billing method of the clone instance is the same as the billing method of the source instance.
When you clone an instance, a custom image is generated. The name of the custom image starts with
TemplateScratch-
. For information about the billing of custom images, see Images.If you want to clone the source instance to create a clone instance in the same region as the source instance, the system creates a custom image from the source instance and creates the clone instance from the image.
If you want to clone the source instance to create a clone instance in a different region, the system creates a custom image from the source instance, copies the custom image to the destination region, and then creates the clone instance from the image.
If you no longer require the custom image, you can delete the image in the source or destination region after the cloning task is completed.
Limits
Only ECS instances in virtual private clouds (VPCs) support the instance cloning feature.
You can clone up to 20 ECS instances in a cloning task.
Procedure
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.
You can clone instances based on your business requirements.
To clone a single instance, find the instance that you want to clone and choose
in the Actions column.To clone multiple instances, select the instances that you want to clone and choose
in the lower part of the Instance page. You can clone up to 20 ECS instances.
In the Clone Instance dialog box, configure parameters and click Next.
Parameter
Description
Destination Region
Select the region in which you want to create the clone instance.
Destination Zone
Select the zone to which you want to create the clone instance.
Destination VPC
If you do not specify a destination vSwitch, ECS assigns a private IP address to the clone instance.
If you specify a destination vSwitch and the private IP address of the source instance is not within the CIDR block of the destination vSwitch, ECS assigns a private IP address to the clone instance.
If you do not specify a vSwitch or a VPC when you clone the source instance across regions, the system creates a VPC based on the VPC of the source instance and selects a zone to create a vSwitch based on the vSwitch of the source instance.
If you specify a destination VPC or region that is different from the VPC or region of the source instance, the system creates security groups for the clone instance in the specified VPC or region based on the security groups of the source instance. If you specify the VPC or region of the source instance as the destination VPC or region, the system uses the security groups of the source instance for the clone instance.
Destination vSwitch
Destination Instance Quantity
Configure the number of clone instances that you want to create.
You can create up to 100 clone instances at a time. If the specified number of clone instances that you want to create exceeds the maximum number of additional instances that you can create, the number of clone instances created is equal to the maximum number of additional instances that you can create.
Contain Instance Data
If you do not select Contain Instance Data, the system creates a clone instance that is of the same instance type as the source instance.
ImportantIf the instance type of the source instance is out of stock, the system selects another instance type that is similar to the instance type of the source instance.
If you select Contain Instance Data, the system creates a clone instance that is of the same instance type as the source instance, also containing the same instance data. We recommend that you stop the source instance before you clone the instance to ensure data consistency.
In the Configuration Preview step, confirm basic information about the clone instance, read and select I have read and agreed to ECS Terms of Service, and then click Start.
The cloning feature is implemented by Resource Orchestration Service (ROS). You can log on to the ROS console to view the cloning progress.
View cloning results.
In the Clone Result step, the clone task is completed if the following message is displayed: The instance is cloned. You can verify whether the business data of the clone instance is consistent with the business data of the source instance.