There is a wide variety of methods through which Elastic Compute Service (ECS) instances can be provisioned. You can create instances individually, in batch, across regions, or through auto scaling groups for automated deployment. You can use these methods both on the console and by calling APIs.
Manually create one or more instances
Scenario: Create one instance or multiple instances that have the same configurations such as instance types, zones, and billing methods.
Quantity: The number of instances that can be created varies with the creation methods.
Creation method:
Use the ECS console
The following table describes the methods to create ECS instances on the console and their corresponding scenarios. When you are creating the instances, you can configure the Quantity parameter to specify the number of instances to be created.
NoteFor information about the states that an ECS instance goes through during its creation, see Instance lifecycle.
Method
Scenario
Create subscription instances with a few clicks. This method simplifies the instance creation process and allows you to create a subscription instance within minutes.
Customize instance configurations, such as the image type, instance type, storage, bandwidth, and security groups, based on your business requirements when you create an instance.
If you require an instance that has custom configurations such as a specific operating system and pre-installed applications, you can create a custom image that includes the configurations and use the custom image to quickly create an instance that meets your requirements.
You can use a community image to quickly deploy instances whose operating systems, applications, and data suit your business needs.
If you need a new instance that has the same configuration as an existing instance, you can this method to quickly create an instance similar to the existing instance.
A launch template contains the configuration information required to create an instance. You can use a launch template to create an instance with a few clicks.
Call API operations
You can call API operations to create a specific number of ECS instances.
RunInstances: Creates up to 100 instances in batch. For more information, see RunInstances or Batch create ECS instances.
NoteFor information about the states that an ECS instance goes through during its creation, see Instance lifecycle.
CreateInstance: Creates a single instance. For more information, see CreateInstance.
ImportantECS instances created through the CreateInstance operation are in the Stopped state after they are created, and you need to manually start the instances for use. For information about how to start an ECS instance, see StartInstance.
Use deployment sets
Scenario: Create ECS instances across multiple physical servers to ensure high availability of the business running on the instances and the disaster tolerance of the underlying physical servers.
Quantity: The number of instances that can be created in a deployment set varies with the deployment policies. For more information, see Overview of deployment sets.
Limitations:
Only pay-as-you-go and subscription instances can be created. Preemptible instances cannot be created.
Only specific ECS instance types are supported. For more information, see Overview of deployment sets.
For information about the usage limitations and quota of deployment sets, see the Deployment set limits section of the "Limits" topic.
Creation method:
Use the ECS console
You can create a deployment set and then create instances in that deployment set. Procedure:
NoteYou can also specify to use that deployment set when you are creating ECS instances on the console. To do this, you select an existing deployment set for the Deployment Set parameter in the Advanced Settings section on the instance buy page. You can also click Manage Deployment Set and create a new deployment set. For more information, see Create an instance on the Custom Launch tab.
Create a deployment set.
For more information, see Create a deployment set.
Create ECS instances by using that deployment set.
For more information, see Create an ECS instance in a deployment set.
Call API operations
You can create a deployment set and specify to use that deployment set when you create ECS instances. Procedure:
Call the CreateDeploymentSet operation to create a deployment set.
Call RunInstances or CreateInstance to create one or more instances in that deployment set.
After the ECS instances are created, you can change the deployment set to which they belong. For more information, see Change the deployment set of an instance or ModifyInstanceDeployment.
Use auto provisioning groups
Scenario: Automatically create instance clusters that use different billing methods and are deployed across instance types and zones. This method is suitable for scenarios where stable computing power must be provisioned in a quick manner and preemptible instances are used to reduce costs.
Quantity: Up to 1,000 instances can be created by an auto provisioning group.
Limitation: Only pay-as-you-go instances and preemptible instances are supported. Subscription instances are not supported.
Creation method: You need to create an auto provisioning group that will automatically create ECS instances in batch.
Use the ECS console: For more information, see Create an auto provisioning group.
Call API operations: For more information, see CreateAutoProvisioningGroup or Use auto provisioning group-related API operations to batch create ECS instances.
Use Auto Scaling
Scenarios: Automatically maintain instance clusters that use different billing methods and are deployed across instance types and zones. This service is suitable for scenarios that involve business fluctuations.
Quantity:
NoteFor information about the quota of Auto Scaling, see Limits.
Up to 1,000 ECS instances can be created during a single scaling activity.
Up to 1,000 ECS instances can be created by a single scaling group.
Limitations:
Only pay-as-you-go and preemptible instances can be automatically created in a scaling group.
Only subscription instances can be manually added to a scaling group.
Creation method:
Use the ECS console
You need to create a scaling group and trigger a task to automatically create or release ECS instances in the scaling group. For more information, see Quickly scale ECS instances.
Call API operations
You need to create a scaling group and trigger a task to automatically create or release ECS instances in the scaling group. Procedure:
Call CreateScalingGroup to create a scaling group.
Call CreateScalingConfiguration to create a scaling configuration of the ECS type.
Call EnableScalingGroup to enable a scaling group.
Call CreateScalingRule to create a rule to scale in and out ECS instances.
(Optional) Call CreateAlarm to create an alert rule or call CreateScheduledTask to create a scheduled task.
You can leverage Auto Scaling to ensure fast response to computing requirements. For example, you can configure lifecycle hooks for and apply custom configurations to ECS instances such as automatic association with Server Load Balancer (SLB) instances and ApsaraDB RDS instances. They can help your ECS instances better meet your business requirements. The following are examples of what you can do with Auto Scaling:
Build web applications underpinned by elastic computing resources that ensure stable provisioning of resources in day-to-day scenarios and fast response to traffic surges during major events. For more information, see Build a scalable web application.
Purchase a combination of pay-as-you-go and preemptible instances to reduce cost while handling periodic business fluctuations. For more information, see Save your money with Auto Scaling.
Deploy ECS instances across zones and leverage preemptible instances to deploy high-availability compute clusters at lower cost. For more information, see Deploy a high-availability compute cluster.