An instance configuration source is an instance configuration template that a scaling group uses to scale out ECS or ECI instances. During a scale-out, the scaling group creates ECS or ECI instances based on the instance configuration source and adds them to the scaling group.
Introduction
A scaling group can have only one active instance configuration source at a time. For example, if you apply a new scaling configuration, the active launch template or scaling configuration becomes inactive.
Types
Instance configuration sources include launch templates and scaling configurations. Launch templates can be used only with ECS scaling groups. The following table provides details.
Type | Applicable scaling group | Description |
Launch template | ECS | A launch template is a feature of ECS. To use a launch template, you must first create one in the ECS console or by calling an API. For more information, see Overview of launch templates or CreateLaunchTemplate. Note When you create a scaling group, you specify a VPC and a vSwitch. If you select Launch Template as the Instance Configuration Source for the scaling group, the VPC and vSwitch specified for the scaling group override those specified in the launch template during scale-out events. |
Scaling configuration | ECS, ECI | A scaling configuration is an instance template created for a scaling group in the Auto Scaling console. You can create a scaling configuration in one of the following two ways: Note You do not need to specify a VPC or vSwitch when you create a scaling configuration. The scaling group itself specifies these network settings. The zone of the scaled-out ECS or ECI instances is determined by the vSwitches that are configured in the scaling group.
|
Selection guidelines
For ECS scaling groups, refer to the following table to choose a suitable instance configuration source.
Criteria | Launch template | Scaling configuration |
Parameter validation | Because launch templates do not validate parameters, creating an ECS instance will fail if required parameters, such as an image, are missing. | Parameter validation is supported. You cannot create a scaling configuration if required parameters such as an image are missing. This prevents ECS instance creation failures caused by missing parameters. |
Configuration order | First, create a launch template in the ECS console or by calling an API. Then, in the Auto Scaling console, select the launch template as the instance configuration source for the scaling group. | When you create a scaling group, you can select an existing instance to automatically create a scaling configuration, or you can manually create one after the scaling group is created. |
Versioning | A launch template cannot be modified. However, you can create and select new versions to track changes over time, which makes changes traceable. | You can create multiple scaling configurations for different requirements. However, you can only modify individual scaling configurations manually, and the changes are not versioned or traceable. Note The number of scaling configurations that you can create in a scaling group depends on your Auto Scaling quotas. To view your quota value, go to Quota Center. |
Multiple instance types | This is not supported by the initial launch template. However, you can modify the launch template in the Auto Scaling console and use the extended launch template configurations to select multiple instance types. For more information, see Use a launch template to configure multiple instance types and increase the scale-out success rate. | You can select multiple instance types. This is useful when the instance configuration is more important than a specific instance type, as it increases the scale-out success rate. Note You can select up to 20 instance types in a single scaling configuration. |
In addition to specifying multiple instance types at the scaling configuration level, you can also configure multiple zones for a scaling group within a VPC. This helps avoid resource shortages in a single zone and improves the success rate of scale-out events. For more information, see Configure a scaling group.
Parameter comparison
For ECS scaling groups, you can switch the instance configuration source between a launch template and a scaling configuration after creation. Before switching, understand the parameter differences between launch templates and scaling configurations.
The parameters for creating a launch template or a scaling configuration differ significantly from those for creating a standalone ECS instance. The following table highlights these differences.
For instructions on how to create an ECS instance, a launch template, or a scaling configuration, see Create an instance by using the wizard, Create a launch template, or Create a scaling configuration for ECS instances.
Parameter | Launch template | Scaling configuration |
Billing method | Matches the options for creating an ECS instance: subscription, pay-as-you-go, and Spot Instance. | Only pay-as-you-go and Spot Instance are supported. |
Region and zone | Only the zone parameter is supported. | The region and zone parameters are not supported. |
Instance type | Same as creating an ECS instance. For more information, see Instance families. | This parameter appears only when you select Specify Instance Type for Instance Configuration Mode. Note This parameter also appears if you select Intelligent Configuration for Instance Configuration Mode and select Specify Instance Types that Must Be Included. |
Number of instances to purchase | Not supported. | |
Image | Same as creating an ECS instance. Public, custom, shared, Marketplace, and community images are supported. | Only public, custom, shared, and Marketplace images are supported. |
Storage | Same as creating an ECS instance. You can configure the system disk, data disks, and Apsara File Storage NAS. | Only the system disk and data disks can be configured. You can configure Apsara File Storage NAS when you create an ECS instance, but you cannot configure it directly in Auto Scaling. However, you can use OOS templates and a lifecycle hook to attach a NAS file system. For more information, see Mount a NAS file system on an ECS instance. |
Snapshot service, Network, Public IP address, Security group, Elastic network interface | Same as creating an ECS instance. For more information, see Snapshot overview, Network types, Elastic IP addresses, Security group overview, and Elastic network interface overview. | The snapshot service parameter is not supported. |
IPv6 | The IPv6 parameter is not supported. | Same as creating an ECS instance. For more information, see IP addresses. |
Logon credentials | Unlike creating an ECS instance, the following options are supported: Key Pair, using the preset image password, and Set later. | Unlike creating an ECS instance, the following options are supported: Key Pair and Set later. |
Instance name, Description | Similar to creating an ECS instance. However, launch templates and scaling configurations do not support adding sequential suffixes to instance names or hostnames. For information about how to customize sequential hostnames in a scaling configuration, see Set sequential and unique instance names or hostnames. | |
Hostname, Sequential Suffix | ||
Tags, Resource group | Same as creating an ECS instance. For more information, see tags and resource groups. | |
Deployment set | Not supported. | |
Dedicated host, Private pool type | This parameter is not supported. | Same as creating an ECS instance. For more information, see Dedicated Host (DDH) and View reserved resources in a private pool. |
Auto-renewal, Terms of service | Not supported. | |
Save As | You can save configurations as a new template or a new version of an existing one. | You can specify a name for the scaling configuration. |
Supported parameters
When creating a scaling group, you can use an existing instance or a launch template as the instance configuration source. Alternatively, you can manually create a scaling configuration after the group is created. The parameters supported by each method differ, as shown in the following table.
Manual creation | From an existing instance | From a launch template |
When you manually create a scaling configuration, the following parameters are supported. Note For a full list of parameters supported when you manually create a scaling configuration, see CreateScalingConfiguration.
| A scaling group can inherit some parameters from an existing instance to automatically create a scaling configuration. Note For a full list of parameters supported by ECS instances, see RunInstances.
| A scaling group can inherit some parameters from a launch template. Note For a full list of parameters supported by launch templates, see CreateLaunchTemplateVersion.
|
Operations
The following table describes common operations related to instance configuration sources.
Console guide | Use case | Actions | API reference |
When you need scaled-out instances to have the same configuration as an existing one. | When you create the scaling group, select Select Existing Instance as the Instance Configuration Source. After the scaling group is created, it inherits some parameters from the instance, automatically creates a scaling configuration, and enables itself automatically. Note The scaling configuration uses the original image ID from the source ECS instance, not a new image created from that instance. If the original image no longer exists, you cannot use the instance as a template. | ||
|
| ||
When a scaling group lacks an instance configuration source and you need to apply a specific launch template version. | After you create the scaling group, manually create a scaling configuration, or modify the scaling group to select a launch template. Then, enable the scaling group. | ||
You need to use a different scaling configuration. | After the scaling group is created, create and apply a new scaling configuration, or apply an existing one. | ||
The current scaling configuration no longer meets your business needs or is no longer in use. | Modify or delete the scaling configuration. | ||
You need to update the image in a scaling configuration due to business changes. | Manually or automatically update the image in the scaling configuration. | None |