Create ECS instances manually or automatically
Create ECS instances individually or in bulk, deploy them across physical servers for high availability, or use auto provisioning and Auto Scaling to elastically manage instance clusters.
Manually create instances
-
Scenarios: Create one or more instances with the same configurations, such as instance type, zone, and billing method.
-
Quantity: The number of instances that you can create depends on the creation method.
-
Creation methods:
Use the console
The following methods are available in the console. Set Quantity to specify how many instances to create. The console displays the maximum allowed number.
NoteFor instance states during the lifecycle, see Instance lifecycle.
Method
Scenarios
Quick purchase provides instance types with four preset configurations and multiple packages. You can purchase a ECS instance in just a few minutes. This is the simplest method and improves configuration efficiency.
You can flexibly select configurations such as the billing method, image type, instance type, storage, bandwidth, and security group to meet your business requirements.
If you have preferred configurations for operating systems and applications, you can first create a custom image. Then, you can create an instance from the custom image to improve configuration efficiency.
You can use a community image to quickly deploy an ECS instance with a suitable operating system, applications, and data. This improves configuration efficiency.
If you need an instance with the same configuration as an existing one, you can create a new instance with that configuration. This improves the efficiency of horizontal scaling in specific scenarios.
You can quickly create an identical or similar instance by cloning a source instance. This method is useful for scenarios such as copying a staging environment, scaling applications, disaster recovery and backup, migration, and upgrades. Cloning improves the reliability, scalability, and efficiency of your services.
You can create a launch template in advance. After you configure the template, you can use it to create instances with one click. This method is fast and convenient.
Use the Auto Provisioning Group API to create ECS instances in batches
To create many pay-as-you-go instances, you can call an API operation to create them. This method is more efficient.
Use API operations
Call API operations to create ECS instances:
-
Call RunInstances to create 1 to 100 instances at a time. See RunInstances or Create ECS instances in batches.
NoteFor instance states during the lifecycle, see Instance lifecycle.
-
Call CreateInstance to create a single instance. See CreateInstance.
ImportantInstances created with CreateInstance start in the Stopped state. You must manually start them. See StartInstance.
-
Deploy instances for high availability with deployment sets
-
Scenarios: Distribute instances across physical servers for application high availability and physical server disaster recovery.
-
Quantity: Depends on the deployment policy. See Deployment sets.
-
Limits:
-
Subscription and pay-as-you-go instances are supported. Spot instances are not supported.
-
Only specific instance types are supported. See Deployment sets.
-
For limits and quotas, see Deployment set limits.
-
-
Creation methods:
Use the console
Create a deployment set, then specify it when creating instances:
NoteYou can also specify a deployment set during instance creation. In Advanced Options, select an existing deployment set or click Manage Deployment Set to create one. See Create an instance using the custom launch wizard.
-
Create a deployment set.
-
Create ECS instances in the deployment set.
Use API operations
Create a deployment set, then specify it when creating instances:
-
Call CreateDeploymentSet to create a deployment set.
-
Call RunInstances or CreateInstance to create ECS instances and specify the deployment set.
After creating instances, you can change their deployment set as needed. See Change the deployment set for an instance or ModifyInstanceDeployment.
-
Create low-cost elastic clusters with auto provisioning
-
Scenarios: Deploy an instance cluster spanning multiple billing methods, zones, and instance types with a single click. Suitable for quickly provisioning stable computing power while using spot instances to reduce costs.
-
Quantity: An auto provisioning group can contain 1 to 1,000 ECS instances.
-
Limits: Pay-as-you-go and spot instances are supported. Subscription instances are not supported.
-
Creation methods: Create an auto provisioning group, which then automatically creates instances in batches:
-
Use the console: Create an auto provisioning group
-
Use API operations: Create an auto provisioning group or Use auto provisioning group API operations to create ECS instances in batches
-
Automatically create and release instances with Auto Scaling
-
Scenarios: Continuously maintain an instance cluster spanning multiple billing methods, zones, and instance types. Suitable for fluctuating workloads.
-
Quantity:
NoteFor Auto Scaling (ESS) quotas, see Limits.
-
A single scaling activity can create up to 1,000 instances.
-
A single scaling group can contain up to 1,000 instances.
-
-
Limits:
-
Pay-as-you-go and spot instances can be automatically created.
-
Subscription instances can only be manually added to a scaling group.
-
-
Creation methods:
Use the console
Create a scaling group and a trigger task. The scaling group then automatically creates or releases instances in batches. See Quickly scale ECS instances.
Use API operations
Create a scaling group and a trigger task. The scaling group then automatically creates or releases instances in batches:
-
Call CreateScalingGroup to create a scaling group.
-
Call CreateScalingConfiguration to create an ECS-type scaling configuration.
-
Call EnableScalingGroup to enable the scaling group.
-
Call CreateScalingRule to create a scaling rule for scaling out or scaling in instances.
-
(Optional) Call CreateAlarm to create an event-triggered task or call CreateScheduledTask to create a scheduled task.
-
Auto Scaling (ESS) also provides features to improve provisioning efficiency and reduce computing power delivery time. For example, you can automatically associate instances with Server Load Balancer (SLB) instances and ApsaraDB RDS instances, or configure lifecycle hooks for custom operations. See the following tutorials:
-
Build a scalable web application that auto-scales to handle daily traffic and promotional surges. See Build a scalable web application.
-
Combine pay-as-you-go and spot instances with ESS to handle periodic workload fluctuations at lower cost. See Reduce costs with Auto Scaling.
-
Evenly distribute instances and use spot instances to deploy a high-availability compute cluster at lower cost. See Deploy a high-availability compute cluster using a balanced distribution policy.