CreateScalingConfiguration

更新时间:
复制 MD 格式

Call the CreateScalingConfiguration operation to create an ECS scaling configuration for a scaling group. You must specify the scaling group ID, instance type, and image.

Operation description

A scaling configuration is a template that defines the ECS instances to be created during a scale-out event. You can configure instances in the following ways:

  • InstancePatternInfos: Use the intelligent configuration mode. You do not need to specify an instance type. Instead, you specify the number of vCPUs, memory size, instance family level, and maximum price based on your business needs. The system automatically selects eligible instance types and prioritizes the instance type with the lowest price to create ECS instances. This mode is available only when the network type of the scaling group is VPC. It can effectively reduce the risk of instance creation failures during scale-out events due to an instance type being out of stock.

  • InstanceType: Specify a single instance type.

  • InstanceTypes: Specify multiple instance types.

  • InstanceTypeOverrides: Specify multiple instance types and configure a weight for each instance type.

  • Cpu and Memory: Specify a range of instance types by setting the number of vCPUs and memory size. Auto Scaling determines the available instance types based on factors such as I/O optimization and zone. It then creates the instance with the lowest price. This method is applicable only if the scaling policy of the scaling group is the cost optimization policy and no instance type is specified in the scaling configuration.

  • You can attach a primary network interface controller (NIC) in one of the following ways. Note that you can use only one method in a single call. If you use both methods, the call fails and an error message is returned.

    • Directly configure the primary NIC using parameters such as SecurityGroupId, SecurityGroupIds, and Ipv6AddressCount.

    • Configure the primary and secondary NICs using the NetworkInterfaces parameter. When you use this parameter, you must configure the primary NIC. Set NetworkInterface.InstanceType to Primary to configure the primary NIC. To configure a secondary NIC, set NetworkInterface.InstanceType to Secondary or leave the parameter empty.

Note

You cannot specify `InstanceType`, `InstanceTypes`, `InstanceTypeOverrides`, and `Cpu`/`Memory` at the same time. However, you can specify `InstanceType` or `InstanceTypes` together with `InstancePatternInfos`. If you specify them together, Auto Scaling prioritizes the specified instance types during scale-outs. If the specified instance types are out of stock, Auto Scaling uses instance types that match the `InstancePatternInfos` configuration.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

ess:CreateScalingConfiguration

create

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

ScalingGroupId

string

Yes

The ID of the scaling group to which the scaling configuration belongs.

asg-bp14wlu85wrpchm0****

ImageId

string

No

The ID of the image file to use for creating instances.

centos6u5_64_20G_aliaegis****.vhd

ImageName

string

No

The name of the image file. Image names must be unique within a region. If you specify ImageId, ImageName is ignored.

You cannot use ImageName to specify a Marketplace image.

image****

InstanceType

string

No

The instance type of the ECS instance. For more information, see Instance families.

ecs.g6.large

Cpu

integer

No

The number of vCPUs. Unit: cores.

You can specify both Cpu and Memory to define a range of instance types. For example, if you set Cpu to 2 and Memory to 16, all instance types with 2 vCPUs and 16 GiB of memory are selected. Auto Scaling determines the available instance types based on factors such as I/O optimization and zone, and then creates an instance of the instance type that has the lowest price.

Note

This configuration is effective only when the cost optimization policy is enabled for the scaling group and no instance types are specified in the scaling configuration.

2

Memory

integer

No

The memory size. Unit: GiB.

You can specify both Cpu and Memory to define a range of instance types. For example, if you set Cpu to 2 and Memory to 16, all instance types with 2 vCPUs and 16 GiB of memory are selected. Auto Scaling determines the available instance types based on factors such as I/O optimization and zone, and then creates an instance of the instance type that has the lowest price.

Note

This configuration is effective only when the cost optimization policy is enabled for the scaling group and no instance types are specified in the scaling configuration.

16

DeploymentSetId

string

No

The ID of the deployment set to which the ECS instance belongs.

ds-bp1frxuzdg87zh4pz****

SecurityGroupId

string

No

The ID of the security group to which the ECS instance belongs. ECS instances in the same security group can communicate with each other.

sg-280ih****

IoOptimized

string

No

Specifies whether the instance is I/O optimized. Valid values:

none: The instance is not I/O optimized. optimized: The instance is I/O optimized.

For retired instance types, the default value is none. For other instance types, the default value is optimized.

optimized

InternetChargeType

string

No

The billing method for network usage. Valid values:

  • PayByBandwidth: pay-by-bandwidth. InternetMaxBandwidthOut specifies the fixed bandwidth.

  • PayByTraffic: pay-by-data-transfer. InternetMaxBandwidthOut specifies the maximum bandwidth. You are charged for the actual data transfer.

If you do not specify this parameter, the default value is PayByBandwidth for classic network and PayByTraffic for VPC.

PayByTraffic

InternetMaxBandwidthIn

integer

No

The maximum inbound public bandwidth. Unit: Mbit/s. Valid values:

  • If the purchased outbound public bandwidth is less than or equal to 10 Mbit/s: 1 to 10. Default value: 10.

  • If the purchased outbound public bandwidth is greater than 10 Mbit/s: 1 to the value of InternetMaxBandwidthOut. Default value: the value of InternetMaxBandwidthOut.

10

InternetMaxBandwidthOut

integer

No

The maximum outbound public bandwidth. Unit: Mbit/s. Valid values: 0 to 100.

Default value: 0.

10

SystemDisk.Category

string

No

The category of the system disk. Valid values:

  • cloud: basic disk.

  • cloud_efficiency: ultra disk.

  • cloud_ssd: standard SSD.

  • ephemeral_ssd: local SSD.

  • cloud_essd: ESSD.

  • cloud_auto: ESSD AutoPL disk.

You cannot specify this parameter and SystemDiskCategories at the same time. If you do not specify this parameter or SystemDiskCategories, the default value of this parameter is used:

  • For I/O optimized instances, the default value is cloud_efficiency.

  • For non-I/O optimized instances, the default value is cloud.

cloud_ssd

SystemDisk.Size

integer

No

The size of the system disk. Unit: GiB. Valid values:

  • Basic disk: 20 to 500.

  • ESSD:
    • PL0: 1 to 2048.

    • PL1: 20 to 2048.

    • PL2: 461 to 2048.

    • PL3: 1261 to 2048.

  • ESSD AutoPL disk: 1 to 2048.

  • Other disk categories: 20 to 2048.

The value of this parameter must be greater than or equal to max{1, ImageSize}.

Default value: max{40, ImageSize}.

100

SystemDisk.DiskName

string

No

The name of the system disk. The name must be 2 to 128 characters in length. It must start with a letter or a Chinese character and cannot start with http:// or https://. It can contain digits, colons (:), underscores (_), and hyphens (-).

cloud_ssdSystem

SystemDisk.Description

string

No

The description of the system disk. The description must be 2 to 256 characters in length and cannot start with http:// or https://.

Test system disk.

SystemDisk.AutoSnapshotPolicyId

string

No

The ID of the automatic snapshot policy to apply to the system disk.

sp-bp12m37ccmxvbmi5****

SystemDisk.PerformanceLevel

string

No

The performance level of the ESSD that is used as the system disk. Valid values:

  • PL0: A single ESSD can deliver up to 10,000 random read/write IOPS.

  • PL1: A single ESSD can deliver up to 50,000 random read/write IOPS.

  • PL2: A single ESSD can deliver up to 100,000 random read/write IOPS.

  • PL3: A single ESSD can deliver up to 1,000,000 random read/write IOPS.

Default value: PL1.

PL0

ScalingConfigurationName

string

No

The name of the scaling configuration. The name must be 2 to 64 characters in length, and can contain digits, underscores (_), hyphens (-), and periods (.). It must start with a digit, a letter, or a Chinese character.

The name of a scaling configuration must be unique within a scaling group in a region. If you do not specify this parameter, the ID of the scaling configuration is used.

scalingconfig****

LoadBalancerWeight

integer

No

The weight of the ECS instance as a backend server of the load balancer. Valid values: 1 to 100.

Default value: 50.

50

Tags

string

No

The tags of the ECS instance. You can specify up to 20 tags in key-value pairs. The following limits apply to keys and values:

  • A key can be up to 64 characters in length and cannot start with aliyun or acs:. It cannot contain http:// or https://. If you use tags, the key cannot be an empty string.

  • A value can be up to 128 characters in length and cannot start with aliyun or acs:. It cannot contain http:// or https://. The value can be an empty string.

{"key1":"value1","key2":"value2", ... "key5":"value5"}

UserData

string

No

The custom data of the ECS instance. The data must be Base64 encoded. The raw data can be up to 32 KB in size.

ZWNobyBoZWxsbyBlY3Mh

KeyPairName

string

No

The name of the key pair to use to log on to the ECS instance.

  • For Windows instances, this parameter is ignored. The default value is empty.

  • For Linux instances, password-based logon is disabled.

KeyPairTest

RamRoleName

string

No

The name of the RAM role for the ECS instance. The name is provided and maintained by RAM. You can call the ListRoles operation to query the available RAM roles.

ramrole****

SecurityEnhancementStrategy

string

No

Specifies whether to enable security hardening. Valid values:

  • Active: enables security hardening. This setting is valid only for public images.

  • Deactive: disables security hardening. This setting is valid for all image types.

Active

InstanceName

string

No

The name of the ECS instances that are created using the scaling configuration.

instance****

HostName

string

No

The hostname of the ECS instance. A period (.) or a hyphen (-) cannot be used as the first or last character of a hostname. Consecutive periods (.) or hyphens (-) are not allowed. The naming conventions for different instance types are as follows:

  • For Windows instances, the hostname must be 2 to 15 characters in length and can contain letters, digits, and hyphens (-). It cannot contain periods (.) or be all digits.

  • For other instance types, such as Linux, the hostname must be 2 to 64 characters in length. You can use periods (.) to separate the hostname into multiple segments. Each segment can contain letters, digits, and hyphens (-).

host****

SpotStrategy

string

No

The preemption policy for pay-as-you-go instances. Valid values:

  • NoSpot: The instance is a regular pay-as-you-go instance.

  • SpotWithPriceLimit: The instance is a preemptible instance with a user-defined maximum hourly price.

  • SpotAsPriceGo: The instance is a preemptible instance for which the price is automatically bid based on the current market price.

Default value: NoSpot.

NoSpot

PasswordInherit

boolean

No

Specifies whether to use the password preset in the image. If you use this parameter, make sure that a password is preset in the image. Valid values:

  • true: uses the preset password.

  • false: does not use the preset password.

false

Password

string

No

The password of the ECS instance. The password must be 8 to 30 characters in length and contain at least three of the following character types: uppercase letters, lowercase letters, digits, and special characters. Special characters can be:

`() ~!@#$%^&*-_+=\|{}[]:;'<>,.?/

For Windows instances, the password cannot start with a forward slash (/).

Note

If you specify the Password parameter, we recommend that you send the request over HTTPS to prevent password leaks.

123abc****

ResourceGroupId

string

No

The ID of the resource group to which the ECS instance belongs.

rg-resource****

HpcClusterId

string

No

The ID of the High Performance Computing (HPC) cluster to which the ECS instance belongs.

hpc-clusterid

InstanceDescription

string

No

The description of the ECS instance. The description must be 2 to 256 characters in length and cannot start with http:// or https://.

Test instance.

ClientToken

string

No

Ensures the idempotence of the request. You can use the client to generate a unique parameter value to make sure that the same request is not repeated. The token can contain only ASCII characters and cannot exceed 64 characters in length. For more information, see How to ensure idempotence.

123e4567-e89b-12d3-a456-42665544****

Ipv6AddressCount

integer

No

The number of randomly generated IPv6 addresses to assign to the ENI.

1

CreditSpecification

string

No

The performance mode of the burstable instance. Valid values:

  • Standard: standard mode.

  • Unlimited: unlimited mode.

For more information, see the Performance modes section in Overview of burstable instances.

Standard

ImageFamily

string

No

The name of the image family. You can set this parameter to obtain the latest available image from the specified image family to create the instance. If you have specified the ImageId parameter, you cannot set this parameter.

hangzhou-daily-update

ZoneId

string

No

The ID of the zone to which the ECS instance belongs.

cn-hangzhou-g

DedicatedHostId

string

No

Specifies whether to create the ECS instance on a dedicated host. If you specify the DedicatedHostId parameter, the SpotStrategy and SpotPriceLimit settings in the request are automatically ignored. This is because dedicated hosts do not support creating preemptible instances.

You can call the DescribeDedicatedHosts operation to query the list of dedicated host IDs.

dh-bp67acfmxazb4p****

Affinity

string

No

Specifies whether to associate the instance with the dedicated host. Valid values:

  • default: The instance is not associated with the dedicated host. When you restart an instance that was stopped in economical mode, the instance may be placed on a different dedicated host in the automatic deployment resource pool if the original dedicated host has insufficient resources.

  • host: The instance is associated with the dedicated host. When you restart an instance that was stopped in economical mode, the instance is still placed on the original dedicated host. If the original dedicated host has insufficient resources, the instance fails to restart.

Default value: default.

default

Tenancy

string

No

Specifies whether to create the instance on a dedicated host. Valid values:

  • default: creates the instance on a non-dedicated host.

  • host: creates the instance on a dedicated host. If you do not specify DedicatedHostId, Alibaba Cloud automatically selects a dedicated host for the instance.

Default value: default.

default

SchedulerOptions

object

No

The scheduling options.

["testManagedPrivateSpaceId****"]

PrivatePoolOptions.MatchCriteria

string

No

The private pool capacity option for instance startup. After an Elastic Assurance or a Capacity Reservation service takes effect, a private pool is generated. You can select a private pool to start an instance. Valid values:

  • Open: open mode. The system automatically matches the instance with an open private pool. If no eligible private pool is found, the instance is started using public pool resources. You do not need to set the PrivatePoolOptions.Id parameter in this mode.

  • Target: specified mode. The instance is started using the capacity of a specified private pool. If the specified private pool is unavailable, the instance fails to start. You must set the PrivatePoolOptions.Id parameter in this mode.

  • None: no private pool is used. The instance is started without using a private pool.

Open

PrivatePoolOptions.Id

string

No

The ID of the private pool. This is the ID of the Elastic Assurance or Capacity Reservation service.

eap-bp67acfmxazb4****

SpotDuration

integer

No

The protection period of the preemptible instance. Unit: hours. Valid values:

  • 1: The instance is retained for 1 hour after it is created. After 1 hour, the system compares the bid price with the market price and checks the resource inventory to determine whether to retain or release the instance.

  • 0: The instance is not guaranteed to be retained for 1 hour after it is created. The system compares the bid price with the market price and checks the resource inventory to determine whether to retain or release the instance.

Note

Alibaba Cloud sends a notification to you through an ECS system event 5 minutes before the instance is released. Preemptible instances are billed by the second. We recommend that you select a protection period based on the time required for your task to complete.

Default value: 1.

1

SpotInterruptionBehavior

string

No

The interruption mode of the preemptible instance. Currently, only terminate is supported, which releases the instance by default.

Terminate

InstanceTypes

array

No

Multiple instance types. If you use InstanceTypes, InstanceType is ignored.

If an instance cannot be created from an instance type with a higher priority, Auto Scaling automatically tries the next instance type in the list.

string

No

Multiple instance types. If you use InstanceTypes, InstanceType is ignored.

If an instance cannot be created from an instance type with a higher priority, Auto Scaling automatically tries the next instance type in the list.

ecs.g6.large

InstanceTypeOverrides

array<object>

No

Information about the specified instance types.

object

No

Information about the specified instance types.

InstanceType

string

No

If you want the scaling group to scale based on the capacity of instance types, specify both this parameter and WeightedCapacity.

This parameter specifies the instance type and overwrites the instance type in the launch template. You can specify this parameter up to 20 times. N is an integer from 1 to 20.

Note

This parameter takes effect only when a launch template is specified by the LaunchTemplateId parameter.

Valid values for InstanceType: available ECS instance types.

ecs.c5.xlarge

WeightedCapacity

integer

No

To specify the capacity of an instance type in the scaling configuration, specify this parameter after you specify InstanceTypeOverrides.InstanceType.

This parameter specifies the weight of the instance type. The weight indicates the capacity of a single instance of the specified instance type in the scaling group. A higher weight means that fewer instances of that type are needed to meet the desired capacity.

You can configure different weights for different instance types based on their performance metrics, such as the number of vCPUs and memory size.

For example:

  • Current capacity: 0.

  • Expected capacity: 6.

  • Capacity of ecs.c5.xlarge: 4.

To meet the expected capacity, the scaling group will scale out two ecs.c5.xlarge instances.

Note

During a scale-out, the capacity of the scaling group cannot exceed the sum of MaxSize and the maximum weight of the instance type.

Valid values for WeightedCapacity: 1 to 500.

4

DataDisks

array<object>

No

A collection of data disk information.

object

No

A collection of data disk information.

PerformanceLevel

string

No

The performance level of the ESSD that is used as the data disk. Valid values:

  • PL0: A single ESSD can deliver up to 10,000 random read/write IOPS.

  • PL1: A single ESSD can deliver up to 50,000 random read/write IOPS.

  • PL2: A single ESSD can deliver up to 100,000 random read/write IOPS.

  • PL3: A single ESSD can deliver up to 1,000,000 random read/write IOPS.

Note

For information about how to select an ESSD performance level, see ESSDs.

PL0

AutoSnapshotPolicyId

string

No

The ID of the automatic snapshot policy to apply to the data disk.

sp-bp19nq9enxqkomib****

Encrypted

string

No

Specifies whether to encrypt the data disk. Valid values:

  • true: encrypts the disk.

  • false: does not encrypt the disk.

Default value: false.

false

Description

string

No

The description of the data disk. The description must be 2 to 256 characters in length and cannot start with http:// or https://.

Test data disk.

SnapshotId

string

No

The snapshot to use to create the data disk. If you specify this parameter, DataDisks.Size is ignored. The size of the created disk is the size of the specified snapshot.

If the snapshot was created on or before July 15, 2013, the call is rejected and an InvalidSnapshot.TooOld error is returned.

s-280s7****

Categories

array

No

Multiple disk categories for the data disk. When a disk of a higher-priority category is unavailable, Auto Scaling automatically tries the next lower-priority category. Valid values:

  • cloud: basic disk. The DeleteWithInstance attribute of a basic disk created with an instance is true.

  • cloud_efficiency: ultra disk.

  • cloud_ssd: standard SSD.

  • cloud_essd: ESSD.

Note

If you specify this parameter, you cannot specify DataDisks.Category.

string

No

Multiple disk categories for the data disk. When a disk of a higher-priority category is unavailable, Auto Scaling automatically tries the next lower-priority category. Valid values:

  • cloud: basic disk. The DeleteWithInstance attribute of a basic disk created with an instance is true.

  • cloud_efficiency: ultra disk.

  • cloud_ssd: standard SSD.

  • cloud_essd: ESSD.

Note

If you specify this parameter, you cannot specify DataDisks.Category.

cloud

Size

integer

No

The size of the data disk. Unit: GiB. Valid values:

  • cloud: 5 to 2000.

  • cloud_efficiency: 20 to 32768.

  • cloud_essd: 20 to 32768.

  • ephemeral_ssd: 5 to 800.

If you specify this parameter, the disk size must be greater than or equal to the snapshot size specified by SnapshotId.

100

Device

string

No

The mount point of the data disk. If you do not specify this parameter, the system automatically assigns a mount point when creating the ECS instance, starting from /dev/xvdb and ending at /dev/xvdz.

/dev/xvdb

DiskName

string

No

The name of the data disk. The name must be 2 to 128 characters in length. It must start with a letter or a Chinese character and cannot start with http:// or https://. It can contain digits, colons (:), underscores (_), and hyphens (-).

cloud_ssdData

Category

string

No

The category of the data disk. Valid values:

  • cloud: basic disk.

  • cloud_efficiency: ultra disk.

  • cloud_ssd: standard SSD.

  • cloud_essd: ESSD.

  • ephemeral_ssd: local SSD.

  • cloud_auto: ESSD AutoPL disk.

You cannot specify this parameter and DataDisk.Categories at the same time. If you do not specify this parameter or DataDisk.Categories, the default value of this parameter is used:

  • For I/O optimized instances, the default value is cloud_efficiency.

  • For non-I/O optimized instances, the default value is cloud.

cloud_ssd

DeleteWithInstance

boolean

No

Specifies whether to release the data disk when the instance is released. Valid values:

  • true: releases the disk when the instance is released.

  • false: retains the disk when the instance is released.

This parameter can be set only for separately purchased cloud disks (DataDisks.Category is cloud, cloud_efficiency, cloud_ssd, or cloud_essd). Otherwise, an error occurs.

Default value: true.

true

KMSKeyId

string

No

The ID of the KMS key for the data disk.

0e478b7a-4262-4802-b8cb-00d3fb40****

ProvisionedIops

integer

No

The provisioned IOPS of the data disk.

Note

IOPS (input/output operations per second) indicates the number of I/O operations that a block storage device can process per second. It represents the read and write capabilities of the device.

100

BurstingEnabled

boolean

No

Specifies whether to enable performance burst for the system disk. Valid values:

  • true: Enables performance burst.

  • false: Disables performance burst.

Note

This parameter is available only when SystemDisk.Category is set to cloud_auto.

For more information, see ESSD AutoPL cloud disks.

false

SpotPriceLimits

array<object>

No

A collection of billing information for preemptible instances.

object

No

A collection of billing information for preemptible instances.

PriceLimit

number

No

The bid price for the preemptible instance. This parameter takes effect when SpotStrategy is set to SpotWithPriceLimit.

0.5

InstanceType

string

No

The instance type of the preemptible instance. This parameter takes effect when SpotStrategy is set to SpotWithPriceLimit.

ecs.g6.large

SecurityGroupIds

array

No

Adds the ECS instance to multiple security groups. For more information, see the Security groups section in Limits.

Note

You cannot specify both SecurityGroupId and SecurityGroupIds.

string

No

Adds the ECS instance to multiple security groups. For more information, see the Security groups section in Limits.

Note

You cannot specify both SecurityGroupId and SecurityGroupIds.

sg-bp18kz60mefs****

InstancePatternInfos

array<object>

No

A collection of intelligent configuration information used to filter instance types that meet the requirements.

object

No

A collection of intelligent configuration information used to filter instance types that meet the requirements.

Cores

integer

No

In intelligent configuration mode, the number of vCPU cores of the instance type. This is used to filter instance types that meet the requirements. For more information, see Instance families.

Note the following:

  • The InstancePatternInfos parameter applies only when the network type of the scaling group is VPC.

  • When using InstancePatternInfos, you must specify both InstancePatternInfos.Cores and InstancePatternInfos.Memory.

  • If you have already specified instance types using the InstanceType or InstanceTypes parameter, Auto Scaling prioritizes the specified instance types for scale-outs. If the specified instance types are out of stock, Auto Scaling uses the instance type with the lowest price from the instance types that match the InstancePatternInfos parameter.

2

InstanceFamilyLevel

string

No

The level of the instance family, used to filter instance types that meet the requirements. This parameter takes effect when CostOptimization is enabled. Valid values:

  • EntryLevel: entry-level, which refers to shared-resource instances. This level offers lower costs but cannot guarantee stable computing performance. It is suitable for business scenarios with low CPU utilization. For more information, see Shared-resource instances.

  • EnterpriseLevel: enterprise-level. This level provides stable performance and dedicated resources, suitable for business scenarios that require high stability. For more information, see Instance families.

  • CreditEntryLevel: credit entry-level, which refers to burstable instances. This level uses CPU credits to ensure computing performance and is suitable for business scenarios with low CPU utilization and occasional CPU bursts. For more information, see Overview of burstable instances.

EnterpriseLevel

MaxPrice

number

No

In intelligent configuration mode, the maximum hourly price you are willing to pay for a pay-as-you-go or preemptible instance. This is used to filter instance types that meet the requirements.

Note

This parameter is required when SpotStrategy is set to SpotWithPriceLimit. In other cases, this parameter is optional.

2

Memory

number

No

In intelligent configuration mode, the memory size of the instance type. Unit: GiB. This is used to filter instance types that meet the requirements.

4

ExcludedInstanceTypes

array

No

The instance types to exclude. You can use a wildcard character (*) to exclude a single instance type or an entire instance family. For example:

  • ecs.c6.large: excludes the ecs.c6.large instance type.

  • ecs.c6.*: excludes all instance types in the c6 family.

string

No

The instance types to exclude. You can use a wildcard character (*) to exclude a single instance type or an entire instance family. For example:

  • ecs.c6.large: excludes the ecs.c6.large instance type.

  • ecs.c6.*: excludes all instance types in the c6 family.

ecs.n1.small/ecs.n1.*/*7*

Architectures

array

No

The architecture type of the instance type. Valid values:

  • X86: X86 compute.

  • Heterogeneous: heterogeneous computing, such as GPU or FPGA.

  • BareMental: ECS Bare Metal Instance.

  • Arm: Arm compute.

Default value: all architecture types are included.

string

No

The architecture type of the instance type. Valid values:

  • X86: X86 compute.

  • Heterogeneous: heterogeneous computing, such as GPU or FPGA.

  • BareMental: ECS Bare Metal Instance.

  • Arm: Arm compute.

Default value: all architecture types are included.

X86

BurstablePerformance

string

No

Specifies whether to include burstable instance types. Valid values:

  • Exclude: does not include burstable instance types.

  • Include: includes burstable instance types.

  • Required: includes only burstable instance types.

Default value: Include.

Include

InstanceTypeFamilies

array

No

The instance families to query. You can specify multiple instance families. N is an integer from 1 to 10.

string

No

The instance families to query. You can specify multiple instance families. N is an integer from 1 to 10.

ecs.g6

MinimumCpuCoreCount

integer

No

The minimum number of vCPU cores for the instance type.

2

MaximumCpuCoreCount

integer

No

The maximum number of vCPU cores for the instance type.

Note

MaximumCpuCoreCount cannot be more than four times the value of MinimumCpuCoreCount.

4

GpuSpecs

array

No

The GPU type.

string

No

The GPU type.

NVIDIA V100

InstanceCategories

array

No

The category of the instance. Valid values:

Note

You can specify multiple instance categories. N is an integer from 1 to 10.

  • General-purpose: General-purpose.

  • Compute-optimized: compute-optimized.

  • Memory-optimized: memory-optimized.

  • Big data: big data.

  • Local SSDs : local SSDs.

  • High Clock Speed : high frequency.

  • Enhanced : enhanced instance families.

  • Shared: shared-resource instances.

  • Compute-optimized with GPU : GPU compute-optimized.

  • Visual Compute-optimized : visual compute-optimized.

  • Heterogeneous Service : heterogeneous service.

  • Compute-optimized with FPGA : FPGA compute-optimized.

  • Compute-optimized with NPU : NPU compute-optimized.

  • ECS Bare Metal : ECS Bare Metal Instance.

  • High Performance Compute: high-performance computing.

string

No

The category of the instance. Valid values:

Note

You can specify multiple instance categories. N is an integer from 1 to 10.

  • General-purpose: General-purpose.

  • Compute-optimized: compute-optimized.

  • Memory-optimized: memory-optimized.

  • Big data: big data.

  • Local SSDs : local SSDs.

  • High Clock Speed : high frequency.

  • Enhanced : enhanced instance families.

  • Shared: shared-resource instances.

  • Compute-optimized with GPU : GPU compute-optimized.

  • Visual Compute-optimized : visual compute-optimized.

  • Heterogeneous Service : heterogeneous service.

  • Compute-optimized with FPGA : FPGA compute-optimized.

  • Compute-optimized with NPU : NPU compute-optimized.

  • ECS Bare Metal : ECS Bare Metal Instance.

  • High Performance Compute: high-performance computing.

Compute-optimized with GPU

CpuArchitectures

array

No

The CPU architecture of the instance. Valid values:

Note

You can specify multiple CPU architectures. N is an integer from 1 to 2.

  • X86.

  • ARM.

string

No

The CPU architecture of the instance. Valid values:

Note

You can specify multiple CPU architectures. N is an integer from 1 to 2.

  • X86.

  • ARM.

X86

PhysicalProcessorModels

array

No

The processor model of the instance. You can specify multiple processor models. N is an integer from 1 to 10.

string

No

The processor model of the instance. You can specify multiple processor models. N is an integer from 1 to 10.

Intel Xeon(Ice Lake) Platinum 8369B

MinimumEniQuantity

integer

No

The minimum number of elastic network interfaces (ENIs) that can be attached to an instance.

2

MinimumEniPrivateIpAddressQuantity

integer

No

The minimum number of private IPv4 addresses to assign to a single elastic network interface (ENI) of an instance.

2

MinimumEniIpv6AddressQuantity

integer

No

The minimum number of IPv6 addresses that can be assigned to a single ENI.

1

MinimumInitialCredit

integer

No

The minimum initial vCPU credit for burstable instances of the t5 or t6 family.

12

MinimumBaselineCredit

integer

No

The minimum baseline vCPU performance (the sum of all vCPUs) for burstable instances of the t5 or t6 family.

12

MinimumMemorySize

number

No

The minimum memory size of the instance. Unit: GiB.

4

MaximumMemorySize

number

No

The maximum memory size of the instance. Unit: GiB.

4

MinimumGpuAmount

integer

No

The minimum number of GPUs for the instance. The value must be a positive integer.

2

MaximumGpuAmount

integer

No

The maximum number of GPUs for the instance. The value must be a positive integer.

2

SystemDiskCategories

array

No

Multiple disk categories for the system disk. When a disk of a higher-priority category is unavailable, Auto Scaling automatically tries the next lower-priority category to create the system disk. Valid values:

  • cloud: basic disk.

  • cloud_efficiency: ultra disk.

  • cloud_ssd: standard SSD.

  • cloud_essd: ESSD.

Note

If you specify this parameter, you cannot specify SystemDisk.Category.

string

No

Multiple disk categories for the system disk. When a disk of a higher-priority category is unavailable, Auto Scaling automatically tries the next lower-priority category to create the system disk. Valid values:

  • cloud: basic disk.

  • cloud_efficiency: ultra disk.

  • cloud_ssd: standard SSD.

  • cloud_essd: ESSD.

Note

If you specify this parameter, you cannot specify SystemDisk.Category.

cloud

SystemDisk.Encrypted

boolean

No

Specifies whether to encrypt the system disk. Valid values:

  • true: encrypts the disk.

  • false: does not encrypt the disk.

Default value: false.

false

SystemDisk.KMSKeyId

string

No

The ID of the KMS key to use for the system disk.

0e478b7a-4262-4802-b8cb-00d3fb40****

SystemDisk.EncryptAlgorithm

string

No

The encryption algorithm for the system disk. Valid values:

  • AES-256.

  • SM4-128.

Default value: AES-256.

AES-256

SystemDisk.ProvisionedIops

integer

No

The provisioned IOPS of the system disk.

Note

IOPS (input/output operations per second) indicates the number of I/O operations that a block storage device can process per second. It represents the read and write capabilities of the device.

100

SystemDisk.BurstingEnabled

boolean

No

Specifies whether to enable the performance burst feature for the system disk. Valid values:

  • true: enables the feature.

  • false: disables the feature.

Note

You can set this parameter only when SystemDisk.Category is set to cloud_auto.

For more information, see ESSD AutoPL disks.

false

ImageOptions.LoginAsNonRoot

boolean

No

Specifies whether to use the ecs-user user to log on to the ECS instance. For more information, see Manage logon usernames of ECS instances. Valid values:

  • true: Yes.

  • false: No.

Default value: false.

false

DeletionProtection

boolean

No

The release protection attribute of the instance. This specifies whether you can release the instance through the ECS console or by calling the DeleteInstance API. This prevents accidental release of the instance. Valid values:

  • true: enables release protection. You cannot release the instance through the ECS console or by calling the DeleteInstance API.

  • false: disables release protection. You can release the instance through the ECS console or by calling the DeleteInstance API.

Default value: false.

Note

This attribute applies only to pay-as-you-go instances to prevent accidental release of instances scaled out by Auto Scaling. It does not affect normal scale-in activities. Instances with release protection enabled can be released during scale-in activities.

false

StorageSetId

string

No

The ID of the storage set.

ss-bp67acfmxazb4p****

StorageSetPartitionNumber

integer

No

The maximum number of partitions in the storage set. The value must be greater than or equal to 2.

2

CustomPriorities

array<object>

No

The custom priority for the combination of an ECS instance type and a vSwitch.

Important This is effective only when the scaling policy of the scaling group is set to the priority policy.

If an instance cannot be created from a combination of an instance type and a vSwitch with a higher priority, Auto Scaling automatically tries the next combination in the list.

Note

If you specify custom priorities for only some combinations of instance types and vSwitches, the unspecified combinations have a lower priority than the specified ones. The unspecified combinations are still prioritized based on the order of vSwitches in the scaling group and the order of instance types in the scaling configuration.

  • For example, if the vSwitch order in the scaling group is vsw1, vsw2, the instance type order in the scaling configuration is type1, type2, and the custom priority order is ["vsw2+type2", "vsw1+type2"], the final priority will be: "vsw2+type2" > "vsw1+type2" > "vsw1+type1" > "vsw2+type1".

object

No

InstanceType

string

No

The instance type of the ECS instance.

Important Must be included in the list of instance types in the scaling configuration.

ecs.g6.large

VswitchId

string

No

The ID of the vSwitch.

Important Must be included in the list of vSwitches in the scaling group.

vsw-bp14zolna43z266bq****

NetworkInterfaces

array<object>

No

The list of ENIs.

object

No

The ENI.

InstanceType

string

No

The type of ENI. When using this parameter, you must use NetworkInterfaces to set the primary NIC and cannot set the SecurityGroupId or SecurityGroupIds parameters. Valid values:

  • Primary: primary NIC.

  • Secondary: secondary NIC.

Default value: Secondary.

Primary

NetworkInterfaceTrafficMode

string

No

The communication mode of the NIC. Valid values:

  • Standard: uses TCP communication mode.

  • HighPerformance: enables the Elastic RDMA Interface (ERI) and uses RDMA communication mode.

Default value: Standard.

Note

The number of ENIs in RDMA mode cannot exceed the limit for the instance family. For more information, see Instance families.

HighPerformance

Ipv6AddressCount

integer

No

The number of randomly generated IPv6 addresses to assign to the primary NIC. Note:

  • This parameter takes effect only when NetworkInterface.InstanceType is set to Primary. If NetworkInterface.InstanceType is set to Secondary or is empty, you cannot set this parameter.

  • If you set this parameter, you cannot set Ipv6AddressCount.

1

SecurityGroupIds

array

No

One or more security group IDs to which the ENI belongs.

string

No

One or more security group IDs to which the ENI belongs. Note:

  • If NetworkInterface.InstanceType is set to Primary, you must set this parameter. In this case, it functions the same as SecurityGroupIds, but you cannot set SecurityGroupId or SecurityGroupIds.

  • If NetworkInterface.InstanceType is set to Secondary or is empty, this parameter is optional. The default value is the security group of the ECS instance, which is the security group of the primary NIC.

sg-uf6ij8dwxxxxxx

SecondaryPrivateIpAddressCount

integer

No

The number of secondary private IPv4 addresses to assign to the NIC. Valid values: 1 to 49.

  • The value cannot exceed the IP address limit for the instance type. For more information, see Instance families.

  • NetworkInterface.N.SecondaryPrivateIpAddressCount is used to assign a number of secondary private IPv4 addresses to the NIC (excluding the primary private IP address). The system randomly assigns these addresses from the available CIDR block of the vSwitch (NetworkInterface.N.VSwitchId) where the NIC is located.

6

DedicatedHostClusterId

string

No

The ID of the dedicated host cluster.

dc-2zedxc67zqzt7lb4****

SecurityOptions

object

No

The security options.

ConfidentialComputingMode

string

No

The confidential computing mode. Possible values:

TDX

HttpEndpoint

string

No

Specifies whether to enable the access channel for instance metadata. Valid values:

  • enabled: enables the channel.

  • disabled: disables the channel.

Default value: enabled.

Note

For information about instance metadata, see Overview of instance metadata.

enabled

HttpTokens

string

No

Specifies whether to enforce the security-hardened mode (IMDSv2) when accessing instance metadata. Valid values:

  • optional: does not enforce the mode.

  • required: enforces the mode. If you set this value, you cannot access instance metadata in normal mode.

Default value: optional.

Note

For information about instance metadata access modes, see Instance metadata access modes.

optional

ResourcePoolOptions

object

No

The resource pool policy to use when creating an instance. Note the following when you set this parameter:

  • This parameter takes effect only when creating pay-as-you-go instances.

  • You cannot set this parameter at the same time as PrivatePoolOptions.MatchCriteria and PrivatePoolOptions.Id.

Strategy

string

No

The resource pool, which includes private pools generated after an Elastic Assurance or Capacity Reservation service takes effect, and the public pool, can be selected for instance startup. Valid values:

  • PrivatePoolFirst: Private pool first. When this policy is selected, if you specify ResourcePoolOptions.PrivatePoolIds or meet the PrivatePoolTags conditions, the corresponding private pool is used first. If no private pool is specified or the specified private pool has insufficient capacity, the system automatically matches an open-type private pool. If no eligible private pool is found, the instance is created using the public pool.

  • PrivatePoolOnly: Private pool only. When this policy is selected, you must specify ResourcePoolOptions.PrivatePoolIds. If the specified private pool has insufficient capacity, the instance fails to start.

  • PublicPoolFirst: Public pool resources first. The system prioritizes creating the instance using the public pool. When public pool resources are insufficient, private pool resources are used as a supplement. The system first automatically matches an open-type private pool. If no eligible private pool is found, it uses a Target-type private pool that is specified by ResourcePoolOptions.PrivatePoolIds or meets the PrivatePoolTags conditions. (This policy is in invitational preview and is not yet available for use.)

  • None: No resource pool policy is used.

Default value: None.

PrivatePoolFirst

PrivatePoolIds

array

No

The ID of the private pool. This is the ID of the Elastic Assurance or Capacity Reservation service. This parameter can only accept Target mode private pool IDs and cannot be specified at the same time as the PrivatePoolTags parameter.

string

No

The ID of the private pool. This is the ID of the Elastic Assurance or Capacity Reservation service. This parameter can only accept Target mode private pool IDs and cannot be specified at the same time as the PrivatePoolTags parameter. N is an integer from 1 to 20.

eap-bp67acfmxazb4****

PrivatePoolTags

array<object>

No

Filter available Target private pools by tags. N is an integer from 1 to 20. Note:

  • When this parameter is configured, the system only selects from the associated Target private pools under the account that have matching tags and also meet the scaling group constraints (such as zone, instance type, etc.).

  • Tag matching rule: The private pool must match all specified tags.

  • This parameter cannot be specified at the same time as the PrivatePoolIds parameter.

object

No

Filter available Target private pools by tags. N is an integer from 1 to 20. Note:

  • When this parameter is configured, the system only selects from the associated Target private pools under the account that have matching tags and also meet the scaling group constraints (such as zone, instance type, etc.).

  • Tag matching rule: The private pool must match all specified tags.

  • This parameter cannot be specified at the same time as the PrivatePoolIds parameter.

Key

string

No

The tag key of the private pool.

TestKey

Value

string

No

The tag value of the private pool.

TestValue

InstanceTypeCandidateOptions

object

No

After you enable the candidate mode, if issues such as insufficient inventory occur, the system supplements the currently selected instance types with similar-sized alternatives or creates vSwitches in candidate zones and adds them to the scaling group.

Enabled

boolean

No

Specifies whether to enable the candidate mode.

true

MaxPrice

number

No

The maximum price for candidate instance types.

2.10

AllowDifferentGeneration

boolean

No

Specifies whether to allow supplementing with instance types from other generations.

  • For example, if the current instance type is ecs.c7.large, enabling this allows ecs.c6.large and ecs.c8.large as candidate types.

true

AllowCrossAz

boolean

No

Specifies whether to allow supplementing with vSwitches from other zones.

Note

The instance type remains unchanged; only new zones are considered as candidates. When a scaling group cannot scale out in any of the selected zones due to issues like insufficient inventory, this configuration allows ESS to automatically add a vSwitch from a new zone to the scaling group. For example, if a scaling group is configured for zones cn-hangzhou-h and cn-hangzhou-g, and neither can be scaled out, ESS might create and add a vSwitch in cn-hangzhou-k based on real-time inventory.

true

AllowCidrBlocks

array

No

When supplementing with vSwitches from other zones is allowed, you must specify the CIDR blocks for the candidate vSwitches.

string

No

The vSwitch CIDR block must meet the following requirements:

  • The mask length of the vSwitch CIDR block must be between 16 and 29 bits.

  • The vSwitch CIDR block must be a subset of the CIDR block of the VPC where it is located.

  • The vSwitch CIDR block cannot be the same as the destination CIDR block of a route entry in the VPC, but it can be a subset of the destination CIDR block.

  • The vSwitch CIDR block cannot be 100.64.0.0/10 or any of its subnets.

172.16.0.0/24

Response elements

Element

Type

Description

Example

object

Information about the created scaling configuration.

ScalingConfigurationId

string

The ID of the scaling configuration.

asc-bp1ffogfdauy0nu5****

RequestId

string

The request ID.

473469C7-AA6F-4DC5-B3DB-A3DC0DE3****

Examples

Success response

JSON format

{
  "ScalingConfigurationId": "asc-bp1ffogfdauy0nu5****",
  "RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3****"
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.