The instance configuration source specifies the configuration template that can be used to create Elastic Compute Service (ECS) instances or elastic container instances in scaling groups during scale-outs. Auto Scaling automatically creates ECS instances or elastic container instances based on the specified instance configuration source, and then adds the created instances to scaling groups during scale-outs.
Note
Each scaling group can have only one active instance configuration source. For example, after you enable a new scaling configuration source, the current launch template or scaling configuration becomes invalid.
Categories
Instance configuration sources include launch templates and scaling configurations. You can use launch templates only for scaling groups of the ECS type. The following table describes launch templates and scaling configurations.
Category | Scaling group type | Description |
Launch template | ECS | ECS provides the launch template feature. Before you use a launch template, you must create the template in the ECS console or by calling an API operation. For more information, see Overview or CreateLaunchTemplate. Note When you create a scaling group, you must specify at least one virtual private cloud (VPC) and one vSwitch for the scaling group. If you specify a launch template as the instance configuration source for the scaling group and the launch template has VPCs and vSwitches, the VPCs and vSwitches that you specified for the scaling group overwrite the VPCs and vSwitches of the launch template during scale-outs. |
Scaling configuration | Scaling groups of the ECS type and scaling groups of the Elastic Container Instance type | A scaling configuration specifies the configuration template that is used to create instances in the Auto Scaling console. You can create a scaling configuration by using one of the following methods: Note When you create a scaling configuration for a scaling group, you do not need to specify a VPC or vSwitch in the scaling configuration because the scaling group has VPCs and vSwitches. During scale-outs, ECS instances or elastic container instances are created in the zones where the vSwitches of the scaling group reside.
|
Reference for selecting an instance configuration source
The following table describes the instance configuration sources that you can select when you create scaling groups of the ECS type.
Item | Launch template | Scaling configuration |
Parameter verification | Launch templates do not support parameter verification. All parameters are optional. If the launch template that you want to use does not contain the required parameters, such as image parameters, you cannot use the template to create ECS instances. | Scaling configurations support parameter verification. You cannot create a scaling configuration if the required parameters, such as image parameters, are missing. If you fail to create ECS instances by using a scaling configuration, it is sure that the failure is not caused by the missing image parameters. |
Configuration steps | Create a launch template in the ECS console or by calling an API operation. Then, use the launch template as the instance configuration source when you create a scaling group in the Auto Scaling console. | Select an existing instance to automatically create a scaling configuration when you create a scaling group. You can also manually create a scaling configuration after you create a scaling group. |
Limits | You cannot modify launch templates, but you can create and use new template versions. | You can create multiple scaling configurations based on different business requirements. You can manually modify a scaling configuration. All modifications are irreversible. Note You can create only a limited number of scaling configurations for a scaling group. To view the quota of scaling configurations, go to Quota Center. |
Multiple instance types | The initial launch template does not support multiple instance types. However, you can configure the parameters in the Extend Configurations of Launch Template section to select multiple instance types in the Auto Scaling console. For more information, see Use a launch template to configure multiple instance types for a scaling group. | You can select multiple instance types. If you have specific requirements for instance specifications, we recommend that you select multiple instance types to increase the success rate of scale-outs. Note You can select up to 10 instance types when you create a scaling configuration. |
A scaling group of the VPC network type supports multiple zones. This reduces the risk of insufficient resources in a zone and increases the success rate of scale-outs. For more information, see Manage scaling groups.
Compare the parameter settings for launch templates and scaling configurations
After you create scaling groups of the ECS type, you can modify the setting of the Instance Configuration Source parameter for the scaling groups. Before you modify the setting of the Instance Configuration Source parameter, we recommend that you understand the difference in the parameter settings between launch templates and scaling configurations.
The parameters that are required to create launch templates and scaling configurations are different from the parameters that are required to create ECS instances. The following table describes the differences between the parameter settings.
For information about how to create ECS instances, launch templates, and scaling configurations, see Create an instance by using the wizard, Create a launch template, and Create a scaling configuration of the ECS type.
Parameter | Launch template | Scaling configuration |
Billing Method | You can set the Billing Method parameter to Subscription, Pay-as-you-go, or Preemptible Instance. You can configure this parameter in the same manner when you create ECS instances. | You can set the Billing Method parameter to Pay-as-you-go or Preemptible Instance. |
Region and Zone | You can configure only the Zone parameter. | The Region and Zone parameters are not supported. |
Instance Type | You can configure the Instance Type parameter in the same manner when you create ECS instances. For more information, see Overview of instance families. | This parameter is supported only in the following scenarios: You set the Instance Configuration Mode parameter to Specify Instance Type. Note You set the Instance Configuration Mode parameter to Intelligent Configuration and select the Specify Instance Types That Must Be Included check box, |
Quantity | This parameter is not supported. | |
Image | You can specify the following types of images: public images, custom images, shared images, marketplace images, and community images. You have the same options for this parameter when you create ECS instances. | You can specify the following types of images: public images, custom images, shared images, and marketplace images. |
Storage | You can specify system disks, data disks, and Apsara File Storage (NAS) file systems as the storage media. You have the same options for this parameter when you create ECS instances. | You can specify only system disks and data disks as the storage media. You can specify NAS file systems in the ECS console. You cannot specify NAS file systems in the Auto Scaling console. You can create CloudOps Orchestration Service (OOS) templates and lifecycle hooks in the Auto Scaling console to specify NAS file systems. For more information, see Mount NAS file systems to ECS instances. |
Snapshot, Network Type, Public IP Address, Security Group, and Elastic Network Interface | For more information, see Snapshot overview, Network types, Elastic IP addresses, Overview, and Overview. You can configure these parameters in the same manner when you create ECS instances. | The Snapshot parameter is not supported. |
IPv6 | The IPv6 parameter is not supported. | For more information, see Overview. You can configure this parameter in the same manner when you create ECS instances. |
Logon Credentials | You can set the Logon Credentials parameter to Key Pair, Inherit Password From Image, or Set Later. The options for this parameter are different when you create ECS instances. | You can set the Logon Credentials parameter to Key Pair or Set Later. The options for this parameter are different when you create ECS instances. |
Instance Name and Description | You can configure these parameters in the same manner when you create ECS instances. However, you cannot add sequential suffixes to instance names or hostnames when you create launch templates and scaling configurations. For information about how to specify custom sequential hostnames in scaling configurations, see Configure naming rules for ECS instances. | |
Host and Sequential Suffix | ||
Tags and Security Group | For more information, see Overview and Resource groups. You can configure these parameters in the same manner when you create ECS instances. | |
Deployment Set | The Deployment Set parameter is not supported. | |
Dedicated Host and Private Pool | The Dedicated Host and Private Pool parameters are not supported. | For more information, see Dedicated hosts and View a private pool. You can configure these parameters in the same manner when you create ECS instances. |
Automatic Renewal and Terms of Service | The Automatic Renewal parameter is not supported, and a Terms of Service check box is not displayed. | |
Save As and Save Auto Scaling Configuration | The Save As parameter is supported. You can set the Save As parameter to New Template or New Template Version. | The Save Auto Scaling Configuration parameter is supported. You can specify a name for the scaling configuration that is being created. |
Compare the parameter settings for different types of instance configuration sources
You can use existing instances or a launch template as the instance configuration source when you create a scaling group. You can also manually create and use a scaling configuration as the instance configuration source after you create the scaling group. The following table describes the parameters of the three types of instance configuration sources.
Scaling configuration | Existing instance | Launch template |
The following parameters are supported when you manually create a scaling configuration: Note For more information about the parameters of scaling configurations, see CreateScalingConfiguration.
| If you specify an existing instance as the instance configuration source when you create a scaling group, the following parameters are supported. Auto Scaling automatically creates a scaling configuration based on the configurations of the specified existing instances. Note For more information about the parameters of an existing instance, see RunInstances.
| If you specify a launch template as the instance configuration source when you create a scaling group, the following parameters are supported. Auto Scaling creates instances based on the parameter settings of the specified launch template. Note For more information about the parameters of a launch template, see CreateLaunchTemplateVersion.
|
Operations on instance configuration sources
The following table describes the common operations that you can perform on instance configuration sources.
User guide | Description | Action | API references |
You want to use the configuration information of an existing instance to create ECS instances or elastic container instances. | When you create a scaling group, set the Instance Configuration Source parameter to Select Existing Instance. After you create the scaling group, Auto Scaling automatically creates a scaling configuration based on specific parameters of the selected instance. The scaling group is automatically enabled. Note No image is created. The image in the scaling configuration is the image that you specified when you created the ECS instance. If the ID of the instance image does not exist, you cannot use the instance to create new instances. | ||
|
| ||
You do not have an instance configuration source in your scaling group and you want to use a launch template. | After you create a scaling group, create a scaling configuration. You can specify a launch template when you modify a scaling group. Then, enable the scaling group. | ||
You want to use other scaling configurations. | After you create a scaling group, create a scaling configuration and apply the scaling configuration to the scaling group. You can also apply an existing scaling configuration. | ||
The current scaling configuration does not meet your business requirements or you no longer require the current scaling configuration. | Modify or delete the scaling configuration. | ||
You want to update the image in your scaling configuration to meet changing business requirements. | Update the image in a scaling configuration. You can also enable Auto Scaling to automatically update the image in a scaling configuration. | None |