This topic describes how to create a scaling configuration for a scaling group that contains Elastic Compute Service (ECS) instances. Auto Scaling uses the scaling configuration as a template to automatically create ECS instances in a scaling group after Auto Scaling triggers scale-out activities based on your configurations such as scheduled tasks.
- A scaling group that contains ECS instances is created. If you select Intelligent Configuration as the instance configuration mode and you do not configure the Instance Type parameter when you create a scaling configuration for a scaling group, make sure that the scaling group resides in a virtual private cloud (VPC). For more information, see Create a scaling group.
- A security group is created. If your scaling group resides in a VPC, make sure that the security group and the scaling group are in the same VPC. For more information, see Create a security group.
- Log on to the Auto Scaling console.
- In the left-side navigation pane, click Scaling Groups.
- In the top navigation bar, select a region.
- Find a scaling group and go to the details page of the scaling group. You can use
one of the following methods to go to the details page:
- Click the ID of the scaling group in the Scaling Group Name/ID column.
- Click Details in the Actions column of the scaling group.
- In the upper part of the page, click the Instance Configuration Sources tab.
- Click the Scaling Configurations tab.
- Click Create Scaling Configuration.
- In the Basic Configurations step, configure the following parameters and click Next: System Configurations. The following table describes the parameters.
Parameter Description References Billing Method Valid values:
- Pay-As-You-Go: Auto Scaling allocates and releases resources on demand. You are charged only for the resources that you use. You do not need to purchase resources before you use them.
- Preemptible Instance: The market price of a preemptible instance fluctuates based on the supply and demand of the instance type. Preemptible instances can be more cost-effective than pay-as-you-go instances. However, preemptible instances may be automatically reclaimed. You can use preemptible instances to reduce costs in specific business scenarios.
Instance Configuration Mode Different instance types are provided to meet a wide range of requirements. Auto Scaling provides the following instance configuration modes:
- Instance Type: You can specify multiple instance types. If there is insufficient inventory in one
instance type, Auto Scaling evaluates the instance types that you specified and creates
instances of the type that has sufficient inventory. This helps increase the success
rate of scale-out.
Note You can configure weights for different instance types based on performance metrics such as the number of vCPUs. For more information, see Use performance metrics to measure Auto Scaling.
By default, Enable Unlimited Mode for Burstable Instances is not selected for burstable instances. You can select Enable Unlimited Mode for Burstable Instances based on your business requirements. For more information about burstable instances, see Overview.
- Intelligent Configuration: If you select Intelligent Configuration, the system selects an instance type that is provided at the lowest price based on your configurations. You need to specify only the number of vCPUs, memory size, instance family, and maximum price. This ensures more intelligent and efficient scale-out activities. Intelligent Configuration is only suitable for scaling groups that reside in VPCs. Intelligent Configuration reduces the chance of a scale-out activity failure due to insufficient inventory of instance types.
Auto Scaling allows you to configure Intelligent Configuration and Instance Type at the same time. If you configure both parameters, you cannot configure weights for instance types. In this case, Auto Scaling uses the instance types that you specified for the Instance Type parameter to execute scaling activities. If the instance type that you specified does not have sufficient resources, Auto Scaling uses the instance type that is matched by using the Intelligent Configuration parameter and is provided at the lowest price to create ECS instances.
Instance family Image An image can provide the data that is required to create ECS instances, such as the system and application environments, and related software configurations. Valid values: Public Image, Custom Image, Shared Image, and Marketplace Image. Image overview Storage Select a system disk or one or more data disks for ECS instances to store data.
- System Disk: You can select ESSD, Standard SSD, and Ultra Disk.
- Data Disk: You can configure the size and number of data disks based on your business requirements.
- To add data disks, click Add Disk or the , and then configure the sizes and number of data disks. To create a data disk from a snapshot, click Create from Snapshot and then select a snapshot.
- To delete a data disk, click the on the left side of the data disk in the Data Disk section.
If the disk category that you configure is not supported by the instance type or zone that you select, the scale-out activity may fail. To improve the success rate of the scale-out activity, you can configure multiple categories for system disks or data disks, such as basic disk, standard SSD, and ultra disk. After you configure multiple disk categories, Auto Scaling selects the disk category that is supported by the instance type or zone based on the configured order to create ECS instances.
Elastic Block Storage devices Public IP Address You can assign IPv4 addresses to ECS instances to connect the instances to the Internet. If you select Assign Public IP Address, you must specify a billing method for public bandwidth. Security Group A security group is a virtual firewall that controls access to ECS instances.
- In the System Configurations (Optional) step, configure the following parameters and
click Next: Preview. The following table describes the parameters.
Parameter Description References Tags Tags can be used to identify resources. You can use tags to categorize ECS instances and related resources by purpose. Then, you can search for and filter resources in a more efficient manner. Resource Group Resource groups allow you to categorize your resources by purpose, permission, or region. This way, you can manage the resources across accounts and projects in a more efficient manner. Resource groups Logon Credentials The supported logon credentials vary based on the OS type.
- Linux: You can select an SSH key pair when you create a scaling configuration. You can also configure logon credentials after you create ECS instances.
- Windows: You can configure logon credentials only after you create ECS instances.
Instance Name This parameter specifies the name of the ECS instance. If you do not set this parameter, a default name is used. None Host This parameter specifies the hostname of the ECS instance. If you do not set this parameter, a default name is used. Set rules for generating sequential and unique hostnames RAM Role You can bind RAM roles to ECS instances. Then, you can use temporary Security Token Service (STS) credentials to call API operations of other Alibaba Cloud services. This ensures the security of your AccessKey pair and helps you perform fine-grained permission control and management by using the RAM roles.Note You can select RAM roles only for scaling configurations in a VPC-type scaling group. User Data User data can be used to configure the startup behavior of an ECS instance or pass data to the ECS instance, for example, to automatically obtain software resource packages, activate services, and print logs. You must write a custom script and pass data to the script by using the User Data feature.Note You can specify user data only for scaling configurations in a VPC-type scaling group. Private Pool This parameter can be used to ensure the availability of resources. Auto Scaling uses resources from the associated private pool to create ECS instances. After an elasticity assurance or a capacity reservation is created, the system generates a private pool to reserve capacity for a specific number of instances that have specific attributes. Valid values:
- Open: The system uses the resources that are allocated to open private pools. If all resources in the open private pools are used, the system uses the resources that are allocated to public pools.
- Do Not Use: The system uses the resources that are allocated to the public pools instead of the resources that are allocated to the private pools to create instances.
- Target: The system uses the resources that are allocated to a specific pool or an open private pool to create instances. If all resources that are allocated to a specific pool or an open private pool are used, no instances can be created.
Overview Dedicated Host To prevent resource contention and ensure security compliance, you can go to the Dedicated Host console to create a dedicated host. Auto Scaling creates ECS instances on the specified dedicated host to provide exclusive physical resources.
- In the Preview step, check your configurations, specify a name for the scaling configuration, and then click Create.
- In the Created dialog box, click Enable Configuration.