All Products
Search
Document Center

Auto Scaling:Create a scaling configuration of the ECS type

Last Updated:Apr 18, 2024

If your scaling group is of the Elastic Compute Service (ECS) type, you can refer to this topic to create a scaling configuration for your scaling group. When a scale-out is triggered, Auto Scaling uses the scaling configuration as a template to automatically scale out ECS instances in your scaling group. This helps simplify instance creation and management and improves the success rate of scale-outs.

Prerequisites

  • A scaling group of the ECS type is created. If you set Instance Configuration Mode to Specify Instance Pattern to filter available instance types when you create a scaling configuration, make sure that the network type of the scaling group is virtual private cloud (VPC). For more information, see Manage scaling groups.

  • A security group is created. If the network type of the scaling group is VPC, make sure that the security group and the scaling group reside in the same VPC. For more information, see Create a security group.

Procedure

  1. Log on to the Auto Scaling console.

  2. In the left-side navigation pane, click Scaling Groups.

  3. In the top navigation bar, select the region where Auto Scaling is activated.

  4. Find a scaling group and use one of the following methods to go to the scaling group details page:

    • Click the ID of the scaling group in the Scaling Group Name/ID column.

    • Click Details in the Actions column.

  5. In the upper part of the scaling group details page, click the Instance Configuration Sources tab.

  6. On the Scaling Configurations tab, click Create Scaling Configuration.

  7. In the Basic Information section, configure parameters based on your business requirements.

    The following table describes the parameters.

    Parameter

    Description

    References

    Scaling Configuration Name

    You can specify an informative name for the scaling configuration. The name of a scaling configuration must meet the following requirements:

    • The name must be 2 to 40 characters in length.

    • The name must start with a letter or digit.

    • The name can contain letters, digits, periods (.), underscores(_), and hyphens (-).

    None

    Billing Method

    The following billing methods are supported:

    • 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 in advance.

    • Preemptible Instance: The market price of a preemptible instance fluctuates based on the supply of and demand for the instance type. Preemptible instances are 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.

  8. In the Instance and Image section, configure parameters based on your business requirements.

    The following table describes the parameters.

    Parameter

    Description

    References

    Instance Configuration Mode

    Different business scenarios require different instance types. Auto Scaling supports the following instance configuration modes:

    • Specify Instance Pattern (Recommended): In this instance configuration mode, you do not need to specify instance types. You need to specify only computing attributes such as the number of vCPUs, memory size, instance family level, and maximum acceptable price based on your business requirements. Auto Scaling automatically filters the instance types that meet your business requirements based on the specified computing attributes and displays the instance types in the Preview Instance Type section. You can choose from the displayed instance types. This instance configuration mode effectively improves the success rate of scale-outs.

    • Specify Instance Type: In this instance configuration mode, you can specify multiple instance types at the same time. If one of the specified instance types does not have sufficient resources, Auto Scaling uses another instance type that has sufficient resources to create ECS instances. This instance configuration mode also greatly improves the success rate of scale-outs.

      Note

      You can specify weights for the instance types in the scaling configuration based on performance metrics such as the number of vCPUs. For more information, see Use performance metrics to measure Auto Scaling.

      If you specify burstable instance types in the scaling configuration, Enable Unlimited Mode for Burstable Instances is not selected. You can select Enable Unlimited Mode for Burstable Instances based on your business requirements. For information about burstable instances, see Overview.

    Overview of instance families

    Select Instance Type

    This parameter is available only if you set Instance Configuration Mode to Specify Instance Type.

    You can select instance types by instance type name or vCPU.

    Note

    You can select up to 10 instance types at the same time. Auto Scaling preferentially uses the instance type that is higher up on the list.

    After you select instance types, you can enable the following features based on your business requirements:

    • Enable Unlimited Mode for Burstable Instances: This feature takes effect only after you select burstable instances. This feature allows the burstable instance that hosts your application to exceed the baseline performance at any time. For more information, see Performance modes.

    • Measure Scaling Group Capacity By Using vCPUs: You can specify weights for the selected instance types. After you enable this feature, the current capacity of the scaling group is recalculated. This may trigger a scale-in or scale-out in the scaling group. You can also use other performance metrics that are related to instance types, such as memory size, to measure the capacity of your scaling group. For more information, see Use performance metrics to measure Auto Scaling.

    Overview of instance families

    Instance Attribute Combination

    This parameter is available only if you set Instance Configuration Mode to Specify Instance Pattern.

    You can filter the available instance types by the following attributes: vCPU, memory, instance family level, and maximum acceptable price. In the Preview Instance Type section, you can view the available instance types that meet your business requirements.

    Note

    You can select Add Attribute Filters to add attribute filters, such as instance type architectures and burstable instance attributes, to filter the instance types that meet your business requirements. You can also select Specify Required Instance Type to select the required instance types.

    Overview of instance families

    Select Image

    An image can provide data, such as system and application environments and related software configurations, that is required to create ECS instances. Valid values:

    • Public Images: Public images are basic system images that are provided by Alibaba Cloud or its third-party partners and contain only initial system environments. If you use a public image, configure the application environment or related software based on your business requirements.

    • Custom Images: Custom images are the images that are created from existing instances or snapshots and contain initial system environments, application environments, and related software configurations. A custom image can be used to reduce the time required to create ECS instances.

      • If you manually modify the custom image in the scaling configuration, Auto Scaling does not automatically adjust the size of the current system disk. For more information, see Manually update an image in a scaling configuration.

      • If you create an image update task in the Auto Scaling console, Auto Scaling automatically creates a custom image for the source ECS instance and replaces the image that you specify in the scaling configuration when the image update task is executed. For more information, see Automatically update an image in a scaling configuration.

    • Shared Images: If another Alibaba Cloud user shares a custom image with you, the custom image is a shared image. Alibaba Cloud cannot ensure the security and integrity of shared images.

    • Marketplace Images: Alibaba Cloud Marketplace provides images that contain pre-installed operating systems, application environments, and software. Marketplace images are thoroughly reviewed by Alibaba Cloud to ensure quality and stability. You can use these images to create instances without additional configurations in scenarios such as website creation, application development, and visualized management.

  9. In the Storage section, configure parameters based on your business requirements.

    The following table describes the parameters.

    Parameter

    Description

    References

    System Disk

    You can select the following types of system disks for ECS instances to store data: Enhanced SSD (ESSD), Standard SSD, Ultra Disk, and ESSD AutoPL.

    More Disk Categories

    You can specify multiple system disk categories in the Auto Scaling console to reduce the risk of scale-out failures caused by mismatch between disk categories and instance types or between disk categories and zones. Valid values: Basic Disk, Standard SSD, Ultra Disk, ESSD, and ESSD AutoPL. After you specify multiple disk categories, Auto Scaling preferentially uses the first specified disk category. The priority of the disk categories decreases based on their specified order.

    Data Disk

    You can specify the number of data disks based on your business requirements.

    • If you want to add data disks, click Add Data Disk (0/16) or the 图标 icon and specify the number and storage size of data disks. If you want to use a snapshot to create a data disk, click Create from Snapshot and select a snapshot.

    • If you want to delete a data disk, click the 图标 icon in the row of the data disk.

    More Disk Categories

    You can specify multiple data disk categories in the Auto Scaling console to reduce the risk of scaling failures caused by mismatch between disk categories and instance types or between disk categories and zones. Valid values: Basic Disk, Standard SSD, Ultra Disk, Enhanced SSD (ESSD), and ESSD AutoPL.

  10. In the Network and Security Group section, configure parameters based on your business requirements.

    The following table describes the parameters.

    Parameter

    Description

    References

    Public IP Address

    You can assign IPv4 addresses to ECS instances to enable the Internet Access feature.

    If you select Assign public network IPv4 address, you must also configure Bandwidth Billing. Valid values of Bandwidth Billing: Pay-by-bandwidth and Pay-by-traffic.

    • Pay-by-traffic: You are charged for the outbound public bandwidth. This bandwidth billing method is suitable for scenarios in which your business has variable bandwidth requirements. For example, in most cases, your business requires a small bandwidth but occasionally requires a bandwidth increase due to bursts of access traffic. To prevent unexpected bandwidth fees caused by bursts of access traffic, we recommend that you configure Max. Bandwidth to specify the allowed maximum bandwidth.

      Important

      If you use this bandwidth billing method, you are charged for the actual data transfer on a pay-as-you-go basis. Fees are deducted from your Alibaba Cloud account on an hourly basis. Make sure that your Alibaba Cloud account has sufficient balance.

    • Pay-by-bandwidth: You must configure Bandwidth for the outbound public bandwidth. For example, you can set Bandwidth to 10 Mbit/s. This bandwidth billing method is suitable for scenarios in which your business traffic is stable and is more cost-effective than Pay-by-traffic.

    Security Group

    A security group is a virtual firewall that controls access to ECS instances.

  11. (Optional) In the Management Settings section, configure parameters based on your business requirements.

    The following table describes the parameters.

    Parameter

    Description

    References

    Logon Credentials

    The setting of this parameter varies based on the operating system type of an ECS instance.

    • For Linux, you can set this parameter to Key Pair, Custom Password, or Set Later. A value of Set Later indicates that the logon password is configured only after you create the ECS instance.

    • For Windows, you can set this parameter to Custom Password or Set Later. A value of Set Later indicates that the logon password is configured only after you create the ECS instance.

    Key Pair

    This parameter is required only if you set Logon Credentials to Key Pair.

    A key pair consists of a public key and a private key. Only I/O optimized instances support this parameter. If you set Logon Credentials to Key Pair, the username and password-based logon method is disabled.

    Create an SSH key pair

    Tag

    You can use tags to identify resources. For example, you can use tags to categorize ECS instances and related resources by purpose. This way, you can search for and filter resources efficiently.

    Note

    A tag consists of a case-sensitive tag key and a tag value. The tag that you specify is added to all ECS instances and cloud disks that are created based on the scaling configuration.

  12. (Optional) In the Advanced Settings section, configure parameters based on your business requirements.

    The following table describes the parameters.

    Parameter

    Description

    References

    Resource Group

    Resource groups allow you to categorize your resources by purpose, permission, or ownership. This way, you can manage the resources across accounts and projects efficiently.

    Resource groups

    Instance Name

    The name of the ECS instance. You can use this parameter to specify a unique and sequential instance name series. In this case, ECS instances that are created during scale-outs can be automatically named based on this series. This helps you better manage ECS instances.

    If you do not configure this parameter, Auto Scaling provides a default instance name.

    Configure naming rules for ECS instances

    Host Name

    The hostname within the operating system of the ECS instance. You can use this parameter to specify a unique and sequential hostname series. In this case, ECS instances that are created during scale-outs can be assigned hostnames based on this series. This helps you better manage ECS instances.

    If you do not configure this parameter, Auto Scaling provides a default hostname.

    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 of scaling groups that reside in VPCs.

    Instance User Data

    You can use the Instance User Data feature to configure the startup behavior of an ECS instance or pass data to the ECS instance to automatically obtain software packages, activate services, and print logs. You must write a custom script and pass data to the script by using the Instance User Data feature.

    Note

    You can configure the Instance User Data feature only for scaling configurations of scaling groups that reside in VPCs.

    Instance user data

    SLB Weight

    The weight of ECS instances that are added as backend servers of the associated Server Load Balancer (SLB) instance. The ECS instances must be created based on the scaling configuration. Valid values: 1 to 100. If you already specify a weight when you associate the SLB instance with the scaling group, the weight overrides the value of SLB Weight.

    Attach or detach SLB instances to or from scaling groups

    Private Pool

    You can use this parameter to ensure the availability of resources. Auto Scaling uses resources in the associated private pool to create ECS instances. After an elasticity assurance or a capacity reservation is created, Auto Scaling generates a private pool to reserve capacity for a specific number of instances that have specific attributes. Valid values:

    • Open: The resources in open private pools are given priority over the resources in public pools. If no resource is available in private pools, Auto Scaling uses the resources in public pools.

    • Do Not Use: Auto Scaling uses the resources in public pools instead of the resources in private pools to create instances.

    • Target: Auto Scaling uses the resources in a specific private pool or an open private pool to create instances. If all resources that are allocated to the specific private pool are used, instances cannot 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 ensure that the ECS instances have exclusive physical resources.

  13. Click Create, confirm the parameter settings, and then click Create.

  14. Click Enable.