All Products
Search
Document Center

Auto Scaling:CreateScalingConfiguration

更新时间:Dec 15, 2025

You can call the CreateScalingConfiguration operation to create a scaling configuration for Elastic Compute Service (ECS) instances in a scaling group. You must specify the scaling group ID, instance type, image, and other required information.

Usage notes

A scaling configuration is a template for the ECS instances that are created during scale-out events. The following instance configuration methods are supported:

  • InstancePatternInfo.N: In the intelligent configuration mode, you do not need to specify an instance type. Instead, you can specify the number of vCPUs, memory size, instance family level, and maximum price. The system automatically selects eligible instance types and prioritizes the one with the lowest price to create ECS instances. This mode applies only when the network type of the scaling group is a VPC. This mode helps reduce scale-out failures that are caused by insufficient instance type inventory.

  • InstanceType: Specify a single instance type.

  • InstanceTypes.N: Specify multiple instance types.

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

  • Cpu and Memory: Specify the number of vCPUs and the memory size to define a range of instance types. Auto Scaling determines the set of available instance types based on factors such as I/O optimization and zones. Then, it creates instances of the instance type with the lowest price. This method applies only when the scaling policy of the scaling group is the cost optimization policy and no instance type is specified in the scaling configuration.

  • You can bind a primary elastic network interface (ENI) in one of the following ways. Note that you can use only one method to configure the primary ENI in each API call. If you use both methods at the same time, the call fails and an error message is returned.

    • Directly configure the primary ENI by setting parameters such as SecurityGroupId, SecurityGroupIds.N, and Ipv6AddressCount.

    • Configure the primary and secondary ENIs by setting the NetworkInterfaces.N parameter. When you use this parameter, you must configure the primary ENI. If you set NetworkInterfaces.N.InstanceType to Primary, a primary ENI is configured. If you set NetworkInterfaces.N.InstanceType to Secondary or leave it empty, a secondary ENI is configured.

Note

You cannot specify InstanceType, InstanceTypes.N, InstanceTypeOverride.N, Cpu, and Memory at the same time. However, you can specify InstanceType or InstanceTypes.N together with InstancePatternInfo.N. In this case, Auto Scaling prioritizes the instance types that you specify. If the specified instance types are out of stock, Auto Scaling uses instance types that match the InstancePatternInfo.N configuration.

Try it now

You can call this operation directly in OpenAPI Explorer to simplify signature calculation. After a successful call, OpenAPI Explorer automatically generates sample SDK code.

Request parameters

Parameter

Type

Required

Example

Description

Action

String

Yes

CreateScalingConfiguration

A required parameter. Set the value to CreateScalingConfiguration.

ScalingGroupId

String

Yes

asg-bp14wlu85wrpchm0****

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

ImageId

String

No

centos6u5_64_20G_aliaegis****.vhd

The ID of the image file that is used to create instances.

Note

This parameter and the ImageName parameter serve the same purpose. You can specify either of them. If you specify ImageName, this parameter is ignored. This parameter is not required.

ImageName

String

No

image****

The name of the image file. The image name must be unique within a region. You cannot use this parameter to specify an image from Alibaba Cloud Marketplace.

Note

This parameter and the ImageId parameter serve the same purpose. You can specify either of them. If you specify ImageId, this parameter is ignored. This parameter is not required.

InstanceType

String

No

ecs.g6.large

An ECS instance type. For more information, see Instance families.

Note

You cannot specify InstanceType, InstanceTypes, InstanceTypeOverrides, Cpu, and Memory at the same time. However, you can specify InstanceType together with InstancePatternInfo. In this case, Auto Scaling prioritizes the instance type that you specify for scale-outs. If the specified instance type is out of stock, Auto Scaling uses an instance type that matches the InstancePatternInfo configuration.

Cpu

Integer

No

2

The number of vCPUs. Unit: cores.

If you specify both Cpu and Memory, you can 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 defined. Auto Scaling determines the set of available instance types based on factors such as I/O optimization and zones, and then creates the instance with the lowest price.

Note

This range-based configuration takes effect only in cost optimization mode and when no instance type is specified in the scaling configuration.

Memory

Integer

No

16

The memory size. Unit: GiB.

If you specify both Cpu and Memory, you can 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 defined. Auto Scaling determines the set of available instance types based on factors such as I/O optimization and zones, and then creates the instance with the lowest price.

Note

This range-based configuration takes effect only in cost optimization mode and when no instance type is specified in the scaling configuration.

DeploymentSetId

String

No

ds-bp1frxuzdg87zh4pz****

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

SecurityGroupId

String

No

sg-280ih****

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

IoOptimized

String

No

optimized

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.

The default value for instances of retired instance types is none. For other instance types, the default value is optimized.

InternetChargeType

String

No

PayByTraffic

The billing method for network usage. Valid values:

  • PayByBandwidth: pay-by-bandwidth. In this mode, InternetMaxBandwidthOut is the selected fixed bandwidth.

  • PayByTraffic: pay-by-data-transfer. In this mode, InternetMaxBandwidthOut is only a bandwidth cap. Billing is based on the actual network traffic.

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

InternetMaxBandwidthIn

Integer

No

10

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. The default value is 10.

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

InternetMaxBandwidthOut

Integer

No

10

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

Default value: 0.

SystemDisk.Category

String

No

cloud_ssd

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.N at the same time. If neither this parameter nor SystemDiskCategories.N is specified, this parameter has a default value. If the instance type is a Generation I instance type and the instance is not I/O optimized, the default value is cloud. Otherwise, the default value is cloud_efficiency.

SystemDisk.Size

Integer

No

100

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 types: 20 to 2048.

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

Default value: max{40, ImageSize}.

SystemDisk.DiskName

String

No

cloud_ssdSystem

The name of the system disk. The name must be 2 to 128 characters in length and can contain letters and Chinese characters. 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 (-).

SystemDisk.Description

String

No

Test system disk.

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

SystemDisk.AutoSnapshotPolicyId

String

No

sp-bp12m37ccmxvbmi5****

The ID of the automatic snapshot policy that is applied to the system disk.

SystemDisk.PerformanceLevel

String

No

PL1

The PL of the ESSD system disk. Valid values:

  • PL0: An ESSD can provide up to 10,000 random read/write IOPS.

  • PL1: An ESSD can provide up to 50,000 random read/write IOPS.

  • PL2: An ESSD can provide up to 100,000 random read/write IOPS.

  • PL3: An ESSD can provide up to 1,000,000 random read/write IOPS.

Default value: PL1.

Note

For more information about how to select an ESSD PL, see ESSDs.

ScalingConfigurationName

String

No

scalingconfig****

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

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

LoadBalancerWeight

Integer

No

50

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

Default value: 50.

Tags

String

No

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

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

  • A key can be up to 64 characters in length. It cannot start with aliyun or acs: and 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. It cannot start with aliyun or acs: and cannot contain http:// or https://. The value can be an empty string.

UserData

String

No

ZWNobyBoZWxsbyBlY3Mh

The user data of the ECS instance. The user data must be Base64-encoded. The raw data cannot exceed 32 KB in size.

KeyPairName

String

No

KeyPairTest

The name of the key pair that is used to log on to the ECS instance.

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

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

RamRoleName

String

No

ramrole****

The name of the RAM role of the ECS instance. The name of a RAM role is provided and maintained by RAM. You can call the ListRoles operation to query the available RAM roles. For information about how to create a RAM role, see CreateRole.

SecurityEnhancementStrategy

String

No

Active

Specifies whether to enable security hardening. Valid values:

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

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

InstanceName

String

No

instance****

The name of the ECS instances that are automatically created based on this scaling configuration.

HostName

String

No

host****

The hostname of the ECS instance. A period (.) or a hyphen (-) cannot be used as the first or last character of a hostname. A period (.) or a hyphen (-) cannot appear consecutively. The naming conventions vary based on the instance type:

  • Windows instances: The hostname must be 2 to 15 characters in length and can contain letters, digits, and hyphens (-). It cannot contain periods (.) or consist of only digits.

  • Other types of instances (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 (-).

SpotStrategy

String

No

NoSpot

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

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

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

  • SpotAsPriceGo: a preemptible instance for which the system automatically bids based on the current market price.

Default value: NoSpot.

PasswordInherit

Boolean

No

false

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

  • true: Use the preset password of the image.

  • false: Do not use the preset password of the image.

Password

String

No

123abc****

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 pass the Password parameter, we recommend that you use HTTPS to send the request to prevent password leakage.

ResourceGroupId

String

No

rg-resource****

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

HpcClusterId

String

No

hpc-clusterid

The ID of the HPC cluster to which the ECS instance belongs.

InstanceDescription

String

No

Test instance.

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

ClientToken

String

No

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

Ensures the idempotence of the request.

Generate a parameter value from your client to make sure that the value is unique among different requests. This parameter supports only ASCII characters and cannot exceed 64 characters in length. For more information, see How to ensure idempotence.

Ipv6AddressCount

Integer

No

1

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

CreditSpecification

String

No

Standard

The performance mode of the burstable instance. Valid values:

  • Standard: the standard mode.

  • Unlimited: the unlimited mode.

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

ImageFamily

String

No

hangzhou-daily-update

The name of the image family. By setting this parameter, you can obtain the latest available image within the current image family to create an instance. If you have already set the ImageId parameter, you cannot set this parameter.

ZoneId

String

No

cn-hangzhou-g

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

DedicatedHostId

String

No

dh-bp67acfmxazb4p****

Specifies whether to create an ECS instance on a dedicated host. Because dedicated hosts do not support the creation of spot instances, if you specify the DedicatedHostId parameter, the SpotStrategy and SpotPriceLimit settings in the request are automatically ignored.

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

Affinity

String

No

default

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

  • default: The instance is not associated with the dedicated host. If you restart an instance that was stopped in economical mode and the original dedicated host has insufficient resources, the instance is placed on another dedicated host in the automatic deployment resource pool.

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

Default value: default.

Tenancy

String

No

default

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

  • default: Create a non-dedicated host instance.

  • host: Create a dedicated host instance. If you do not specify DedicatedHostId, Alibaba Cloud automatically selects a dedicated host to place the instance.

Default value: default.

SchedulerOptions

Map

No

["testManagedPrivateSpaceId****"]

The scheduling options.

PrivatePoolOptions.MatchCriteria

String

No

Open

The private pool option for instance launch. An elasticity assurance or a capacity reservation generates a private pool after it takes effect. You can select the private pool to launch an instance. Valid values:

  • Open: open mode. This automatically matches open private pool capacity. If no eligible private pool is found, public pool resources are used. In this mode, you do not need to set the PrivatePoolOptions.Id parameter.

  • Target: specified mode. This uses the specified private pool capacity to launch the instance. If the private pool capacity is unavailable, the instance fails to launch. In this mode, you must specify a private pool ID. The PrivatePoolOptions.Id parameter is required.

  • None: no-use mode. The instance launch will not use private pool capacity.

PrivatePoolOptions.Id

String

No

eap-bp67acfmxazb4****

The ID of the private pool. This is the ID of the elasticity assurance or capacity reservation.

SpotDuration

Integer

No

1

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

  • 1: After creation, Alibaba Cloud ensures that the instance runs for 1 hour without being automatically released. After 1 hour, the system automatically compares the bid price with the market price and checks the resource inventory to decide whether to retain or reclaim the instance.

  • 0: After creation, Alibaba Cloud cannot ensure that the instance runs for 1 hour. The system automatically compares the bid price with the market price and checks the resource inventory to decide whether to retain or reclaim the instance.

    Note

    Alibaba Cloud sends you a notification through ECS system events 5 minutes before the instance is reclaimed. Spot instances are billed by the second. We recommend that you select an appropriate protection period based on the duration of your tasks.

Default value: 1.

SpotInterruptionBehavior

String

No

Terminate

The interruption mode of the spot instance. Only Terminate (default) is supported, which directly releases the instance.

InstanceTypes.N

String

No

ecs.g6.large

Multiple instance type parameters. The value of N can range from 1 to 20. This means you can set up to 20 instance types in a scaling configuration.

N represents the priority of the instance type in the current scaling configuration. The instance type with N=1 has the highest priority. The priority of instance types decreases as N increases. If an instance cannot be created with a higher-priority instance type, Auto Scaling automatically selects the next-priority instance type to create the instance.

Note

You cannot specify InstanceType, InstanceTypes, InstanceTypeOverrides, Cpu, and Memory at the same time. However, you can specify InstanceTypes together with InstancePatternInfo. In this case, Auto Scaling prioritizes the instance types that you specify for scale-outs. If the specified instance types are out of stock, Auto Scaling uses an instance type that matches the InstancePatternInfo configuration.

InstanceTypeOverride.N.InstanceType

String

No

ecs.c5.xlarge

To specify the capacity of an instance type in the scaling configuration, specify both this parameter and InstanceTypeOverride.N.WeightedCapacity.

This parameter specifies the instance type. You can specify N of this parameter, combined with the InstanceTypeOverride.N.WeightedCapacity parameter, to extend multi-instance type support for custom weights. The value of N can range from 1 to 20.

Note

When you specify this parameter, you cannot specify InstanceTypes.N or InstanceType at the same time.

For the valid values of InstanceType, see Instance families.

InstanceTypeOverride.N.WeightedCapacity

Integer

No

4

To specify the capacity of an instance type in the scaling configuration, specify this parameter after specifying InstanceTypeOverride.N.InstanceType. The two parameters correspond one-to-one, and N must be consistent.

This parameter specifies the weight of the instance type. This indicates the capacity size of a single instance of this type in the scaling group. The larger the weight, the fewer instances of this type are needed to meet the desired capacity.

Because performance metrics such as the number of vCPUs and memory size vary for each instance type, you can configure different weights for different instance types based on your needs.

For example:

  • Current capacity: 0.

  • Desired capacity: 6.

  • ecs.c5.xlarge capacity: 4.

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

Note

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

The value of WeightedCapacity can range from 1 to 500.

DataDisk.N.PerformanceLevel

String

No

PL1

The PL of the ESSD data disk. The value of N must be consistent with the N in DataDisk.N.Category=cloud_essd. Valid values:

  • PL0: An ESSD can provide up to 10,000 random read/write IOPS.

  • PL1: An ESSD can provide up to 50,000 random read/write IOPS.

  • PL2: An ESSD can provide up to 100,000 random read/write IOPS.

  • PL3: An ESSD can provide up to 1,000,000 random read/write IOPS.

Default value: PL1.

Note

For more information about how to select an ESSD PL, see ESSDs.

DataDisk.N.AutoSnapshotPolicyId

String

No

sp-bp19nq9enxqkomib****

The ID of the automatic snapshot policy that is applied to the data disk. The value of N can range from 1 to 16.

DataDisk.N.Encrypted

String

No

false

Specifies whether to encrypt data disk N. The value of N can range from 1 to 16. Valid values:

  • true: Encrypt.

  • false: Do not encrypt.

Default value: false.

DataDisk.N.Description

String

No

Test data disk.

The description of data disk N. The value of N can range from 1 to 16. The description must be 2 to 256 characters in length and can contain letters and Chinese characters. It cannot start with http:// or https://.

DataDisk.N.SnapshotId

String

No

s-280s7****

The snapshot that is used to create the data disk. The value of N can range from 1 to 16. After you specify this parameter, DataDisk.N.Size is ignored, and the actual disk size created is the size of the specified snapshot.

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

DataDisk.N.Categories.N

String

No

cloud

Multiple disk types for data disk N. The first N indicates the Nth data disk, with a value range of 1 to 16. The second N indicates the Nth disk type for the Nth data disk, with a value range of 1 to 4. This means you can specify up to four disk types for a data disk in a scaling configuration. A smaller N indicates a higher priority. If a disk cannot be created using a higher-priority disk type, Auto Scaling automatically tries the next-priority disk type. Valid values:

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

  • cloud_efficiency: ultra disk.

  • cloud_ssd: standard SSD.

  • cloud_essd: ESSD.

Note

When you specify this parameter, you cannot specify DataDisk.N.Category at the same time.

DataDisk.N.Size

Integer

No

100

The size of data disk N. The value of N can range from 1 to 16. Unit: GiB. Valid values:

  • cloud: 5 to 2000.

  • cloud_efficiency: 20 to 32768.

  • cloud_ssd: 20 to 32768.

  • cloud_essd: 20 to 32768.

  • ephemeral_ssd: 5 to 800.

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

DataDisk.N.Device

String

No

/dev/xvdb

The mount point of the data disk. The value of N can range from 1 to 16. 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.

DataDisk.N.DiskName

String

No

cloud_ssdData

The name of data disk N. The value of N can range from 1 to 16. The name must be 2 to 128 characters in length and can contain letters and Chinese characters. 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 (-).

DataDisk.N.Category

String

No

cloud_ssd

The category of data disk N. The value of N can range from 1 to 16. Valid values:

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

  • 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 DataDisk.N.Categories.N at the same time. If neither this parameter nor DataDisk.N.Categories.N is specified, this parameter has a default value:

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

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

DataDisk.N.DeleteWithInstance

Boolean

No

true

Specifies whether to release the data disk when the instance is released. The value of N can range from 1 to 16. Valid values:

  • true: The disk is released with the instance.

  • false: The disk is retained when the instance is released.

This parameter can only be set for standalone disks (DataDisk.N.Category is cloud, cloud_efficiency, cloud_ssd, cloud_essd, or cloud_auto). Otherwise, an error occurs.

Default value: true.

DataDisk.N.KMSKeyId

String

No

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

The ID of the KMS key for the data disk. The value of N can range from 1 to 16.

DataDisk.N.ProvisionedIops

Long

No

100

The provisioned IOPS of the data disk.

Note

IOPS refers to the number of I/O operations that a block storage device can process per second. It represents the read and write capability of the block storage, measured in operations per second.

DataDisk.N.BurstingEnabled

Boolean

No

false

Specifies whether to enable Burst (performance bursting) for the data disk. Valid values:

  • true: Enable.

  • false: Do not enable.

    Note

    This parameter is supported only when DataDisk.Category is set to cloud_auto.

For more information, see ESSD AutoPL disks.

SpotPriceLimit.N.PriceLimit

Float

No

0.5

The bid price for the spot instance. The value of N can range from 1 to 20. This parameter takes effect only when SpotStrategy is set to SpotWithPriceLimit.

SpotPriceLimit.N.InstanceType

String

No

ecs.g6.large

The instance type of the spot instance. The value of N can range from 1 to 20. This parameter takes effect only when SpotStrategy is set to SpotWithPriceLimit.

SecurityGroupIds.N

String

No

sg-bp18kz60mefs****

Adds the ECS instance to multiple security groups at the same time. The value range of N is related to the maximum number of security groups an instance can join. For more information, see the Security group section in Limits.

Note

You cannot specify SecurityGroupId and SecurityGroupIds.N at the same time.

InstancePatternInfo.N.Cores

Integer

No

2

In intelligent configuration mode, this is the number of vCPU cores for the instance type, used to filter the range of eligible instance types. For more information, see Instance families. The value of N can range from 1 to 10.

Note the following:

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

  • The InstancePatternInfo.N parameter requires both InstancePatternInfo.N.Cores and InstancePatternInfo.N.Memory to be configured.

  • If you have already specified an instance type using the InstanceType or InstanceTypes.N parameter, Auto Scaling prioritizes the specified instance type for scale-outs. If the specified instance type is out of stock, Auto Scaling then uses the instance type with the lowest price from those that match the InstancePatternInfo.N parameter values.

InstancePatternInfo.N.InstanceFamilyLevel

String

No

EnterpriseLevel

In intelligent configuration mode, this is the instance family level, used to filter the range of eligible instance types. Valid values:

  • EntryLevel: entry-level, which refers to shared instance types. They are more cost-effective but cannot guarantee stable instance computing performance. They are suitable for business scenarios with low CPU usage. For more information, see Shared instance families.

  • EnterpriseLevel: enterprise-level. These instances offer stable performance and dedicated resources, suitable for business scenarios with high stability requirements. For more information, see Instance families.

  • CreditEntryLevel: credit entry-level, which refers to burstable instances. They use CPU credits to ensure computing performance and are suitable for scenarios with low CPU usage and occasional CPU bursts. For more information, see Burstable instances.

The value of N can range from 1 to 10.

InstancePatternInfo.N.MaxPrice

Float

No

2

In intelligent configuration mode, this is the maximum hourly price you can accept for a pay-as-you-go or spot instance. It is used to filter the range of eligible instance types. The value of N can range from 1 to 10.

Note

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

InstancePatternInfo.N.Memory

Float

No

4

In intelligent configuration mode, this is the memory size of the instance type, used to filter the range of eligible instance types. Unit: GiB. For more information, see Instance families. The value of N can range from 1 to 10.

InstancePatternInfo.N.ExcludedInstanceType.N

String

No

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

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

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

  • ecs.c6.*: Excludes the entire c6 instance family.

InstancePatternInfo.N.Architecture.N

String

No

X86

The architecture type of the instance type. Valid values:

  • X86: X86 compute.

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

  • BareMetal: ECS Bare Metal Instance.

  • Arm: Arm compute.

Default value: Includes all architecture types.

InstancePatternInfo.N.BurstablePerformance

String

No

Include

Specifies whether the instance type is a burstable instance. Valid values:

  • Exclude: Does not include burstable instance types.

  • Include: Includes burstable instance types.

  • Required: Includes only burstable instance types.

Default value: Include.

InstancePatternInfo.N.InstanceTypeFamilies.N

String

No

ecs.g6

The specified instance families. N indicates that you can set multiple instance families. The value of N can range from 1 to 10.

InstancePatternInfo.N.MinimumCpuCoreCount

Integer

No

2

The minimum number of vCPU cores for the instance type.

InstancePatternInfo.N.MaximumCpuCoreCount

Integer

No

4

The maximum number of vCPU cores for the instance type.

Note

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

InstancePatternInfo.N.GpuSpecs.N

String

No

NVIDIA V100

The GPU type.

InstancePatternInfo.N.InstanceCategories.N

String

No

Compute-optimized with GPU

The instance classification. Valid values:

Note

N indicates that you can set multiple instance classifications. The value of N can range 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.

  • Shared: shared.

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

  • Visual Compute-optimized: visual compute-optimized.

  • Heterogeneous Service: heterogeneous service.

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

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

  • ECS Bare Metal: ECS Bare Metal Instance.

  • High Performance Compute: high-performance computing (HPC).

InstancePatternInfo.N.CpuArchitectures.N

String

No

X86

The CPU architecture of the instance. Valid values:

Note

N indicates that you can set multiple CPU architectures. The value of N can range from 1 to 2.

  • X86.

  • ARM.

InstancePatternInfo.N.PhysicalProcessorModels.N

String

No

Intel Xeon(Ice Lake) Platinum 8369B", "Intel Xeon(Skylake) Platinum 8163", … "Intel Xeon(Cascade Lake) Platinum 8269CY

The processor model of the instance. N indicates that you can set multiple processor models. The value of N can range from 1 to 10.

InstancePatternInfo.N.MinimumEniQuantity

Integer

No

2

The minimum number of ENIs that an instance can have attached.

InstancePatternInfo.N.MinimumEniPrivateIpAddressQuantity

Integer

No

2

The minimum number of IPv4 addresses that can be assigned to a single ENI for an instance.

InstancePatternInfo.N.MinimumEniIpv6AddressQuantity

Integer

No

1

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

InstancePatternInfo.N.MinimumInitialCredit

Integer

No

12

The minimum initial vCPU credits for a t5 or t6 burstable instance.

InstancePatternInfo.N.MinimumBaselineCredit

Integer

No

12

The minimum baseline vCPU computing performance (sum of all vCPUs) for a t5 or t6 burstable instance.

InstancePatternInfo.N.MinimumMemorySize

Float

No

4

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

InstancePatternInfo.N.MaximumMemorySize

Float

No

4

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

InstancePatternInfo.N.MinimumGpuAmount

Integer

No

2

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

InstancePatternInfo.N.MaximumGpuAmount

Integer

No

2

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

SystemDiskCategories.N

String

No

cloud

Multiple disk types for the system disk. The value of N can range from 1 to 4. This means you can specify up to four disk types for the system disk in a scaling configuration. A smaller N indicates a higher priority. If a disk cannot be created using a higher-priority disk type, Auto Scaling automatically tries the next-priority disk type. Valid values:

  • cloud: basic disk.

  • cloud_efficiency: ultra disk.

  • cloud_ssd: standard SSD.

  • cloud_essd: ESSD.

Note

When you specify this parameter, you cannot specify SystemDisk.Category at the same time.

SystemDisk.Encrypted

Boolean

No

false

Specifies whether to encrypt the system disk. Valid values:

  • true: Encrypt.

  • false: Do not encrypt.

Default value: false.

SystemDisk.KMSKeyId

String

No

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

The ID of the KMS key used for the system disk.

SystemDisk.EncryptAlgorithm

String

No

AES-256

The encryption algorithm used for the system disk. Valid values:

  • AES-256.

  • SM4-128.

Default value: AES-256.

SystemDisk.ProvisionedIops

Long

No

100

The provisioned IOPS of the system disk.

Note

IOPS refers to the number of I/O operations that a block storage device can process per second. It represents the read and write capability of the block storage, measured in operations per second.

SystemDisk.BurstingEnabled

Boolean

No

false

Specifies whether to enable Burst (performance bursting) for the system disk. Valid values:

  • true: Enable.

  • false: Do not enable.

    Note

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

For more information, see ESSD AutoPL disks.

ImageOptions.LoginAsNonRoot

Boolean

No

false

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

  • true: Yes.

  • false: No.

Default value: false.

DeletionProtection

Boolean

No

false

The release protection attribute of the ECS instance. This item applies only to pay-as-you-go instances and indicates whether the instance can be directly released through the ECS console or by calling the API (DeleteInstance). Valid values:

  • true: Enables instance release protection. This prevents the instance from being released directly through the ECS console or API, which helps prevent accidental deletion of scaled-out instances in Auto Scaling.

  • false: Disables instance release protection. This allows the instance to be released directly through the ECS console or API.

Default value: false.

Note

This attribute does not affect normal scale-in activities in Auto Scaling. When a scale-in event occurs, a pay-as-you-go instance with release protection enabled can still be released normally.

StorageSetId

String

No

ss-bp67acfmxazb4p****

The ID of the storage set.

StorageSetPartitionNumber

Integer

No

2

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

CustomPriorities.N.InstanceType

String

No

ecs.g6.large

The CustomPriorities field indicates the custom priority of an ECS instance type + vSwitch combination. The CustomPriorities.N.InstanceType parameter indicates the instance type of the ECS instance in the custom priority.

Note

This parameter is valid only when the scaling policy of the scaling group is set to priority policy, and the instance type must be included in the list of instance types in the scaling configuration.

If an ECS instance cannot be created based on a higher-priority ECS instance type + vSwitch combination, Auto Scaling automatically selects the next-priority ECS instance type + vSwitch combination to create the ECS instance.

Note

If you specify custom priorities for only some ECS instance type + vSwitch combinations, 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, assume the vSwitch order in the scaling group is vsw1, vsw2, and the instance type order in the scaling configuration is type1, type2. If the custom priority order for the combination is ["vsw2+type2", "vsw1+type2"], the final priority is vsw2+type2 > vsw1+type2 > vsw1+type1 > vsw2+type1.

CustomPriorities.N.VswitchId

String

No

vsw-bp14zolna43z266bq****

The CustomPriorities.N.VswitchId parameter indicates the ID of the vSwitch in the custom priority.

Note

This parameter is valid only when the scaling policy of the scaling group is set to priority policy, and the vSwitch must be included in the list of vSwitches in the scaling group.

NetworkInterfaces.N.InstanceType

String

No

Primary

The type of the ENI. When using NetworkInterfaces.N, you must set a primary ENI, but you cannot set the SecurityGroupId or SecurityGroupIds.N parameters at the same time. Valid values:

  • Primary: primary ENI.

  • Secondary: secondary ENI.

Default value: Secondary.

NetworkInterfaces.N.NetworkInterfaceTrafficMode

String

No

HighPerformance

The communication mode of the network interface card. Valid values:

  • Standard: uses the TCP communication mode.

  • HighPerformance: enables the Elastic RDMA Interface (ERI) and uses the 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.

NetworkInterfaces.N.Ipv6AddressCount

Integer

No

1

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

  • This parameter takes effect only if NetworkInterfaces.N.InstanceType is set to Primary.

  • You cannot set this parameter if NetworkInterface.N.InstanceType is set to Secondary or is empty.

  • After you set this parameter, you cannot set the Ipv6AddressCount parameter.

NetworkInterfaces.N.SecurityGroupIds.N

String

No

sg-uf6ij8dwxh****

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

  • If NetworkInterfaces.N.InstanceType is set to Primary, you must set this parameter. In this case, this parameter has the same effect as SecurityGroupIds.N, but you cannot set the SecurityGroupId or SecurityGroupIds.N parameters at the same time.

  • If NetworkInterfaces.N.InstanceType is set to Secondary or is empty, this parameter is optional. The default value is the security group of the ECS instance (that is, the security group of the primary ENI).

DedicatedHostClusterId

String

No

dc-2zedxc67zqzt7lb4****

The ID of the dedicated host cluster.

SecurityOptions.ConfidentialComputingMode

String

No

TDX

The confidential computing mode. Possible values:

HttpEndpoint

String

No

enabled

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

  • enabled: Enable.

  • disabled: Disable.

Default value: enabled.

Note

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

HttpTokens

String

No

optional

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

  • optional: Do not enforce.

  • required: Enforce. 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.

ResourcePoolOptions.Strategy

String

No

PrivatePoolFirst

The resource pool, which includes the private pool generated after an elasticity assurance or capacity reservation takes effect and the public pool, can be selected for instance startup. Valid values:

  • PrivatePoolFirst: Private pool first. When this strategy is selected, if ResourcePoolOptions.PrivatePoolIds is specified, the specified private pools are used first. If no private pool is specified or the specified private pools have insufficient capacity, open-type private pools are automatically matched. If no eligible private pools are found, instances are created from the public pool.

  • PrivatePoolOnly: Private pool only. When this strategy is selected, you must specify ResourcePoolOptions.PrivatePoolIds. If the specified private pools have insufficient capacity, the instance fails to launch.

  • None: Do not use a resource pool strategy.

Default value: None.

ResourcePoolOptions.PrivatePoolIds.N

String

No

eap-bp67acfmxazb4****

The ID of the private pool. This is the ID of the elasticity assurance or capacity reservation. This parameter can only be used to pass the ID of a private pool in Target mode. The value of N can range from 1 to 20.

Response parameters

Parameter

Type

Example

Description

ScalingConfigurationId

String

asc-bp1ffogfdauy0nu5****

The ID of the scaling configuration.

RequestId

String

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

The ID of the request.

Examples

Sample request

http(s)://ess.aliyuncs.com/?Action=CreateScalingConfiguration
&ScalingGroupId=asg-bp14wlu85wrpchm0****
&ImageId=centos6u5_64_20G_aliaegis****.vhd
&ImageName=image****
&InstanceType=ecs.g6.large
&Cpu=2
&Memory=16
&DeploymentSetId=ds-bp1frxuzdg87zh4pz****
&SecurityGroupId=sg-280ih****
&IoOptimized=optimized
&InternetChargeType=PayByTraffic
&InternetMaxBandwidthIn=10
&InternetMaxBandwidthOut=10
&SystemDisk.Category=cloud_ssd
&SystemDisk.Size=100
&SystemDisk.DiskName=cloud_ssdSystem
&SystemDisk.Description=Test system disk.
&SystemDisk.AutoSnapshotPolicyId=sp-bp12m37ccmxvbmi5****
&SystemDisk.PerformanceLevel=PL1
&ScalingConfigurationName=scalingconfig****
&LoadBalancerWeight=50
&Tags={"key1":"value1","key2":"value2", ... "key5":"value5"}
&UserData=ZWNobyBoZWxsbyBlY3Mh
&KeyPairName=KeyPairTest
&RamRoleName=ramrole****
&SecurityEnhancementStrategy=Active
&InstanceName=instance****
&HostName=host****
&SpotStrategy=NoSpot
&PasswordInherit=false
&Password=123abc****
&ResourceGroupId=rg-resource****
&HpcClusterId=hpc-clusterid
&InstanceDescription=Test instance.
&ClientToken=123e4567-e89b-12d3-a456-42665544****
&Ipv6AddressCount=1
&CreditSpecification=Standard
&ImageFamily=hangzhou-daily-update
&ZoneId=cn-hangzhou-g
&DedicatedHostId=dh-bp67acfmxazb4p****
&Affinity=default
&Tenancy=default
&PrivatePoolOptions.MatchCriteria=Open
&PrivatePoolOptions.Id=eap-bp67acfmxazb4****
&SpotDuration=1
&SpotInterruptionBehavior=Terminate
&InstanceTypes=["ecs.g6.large"]
&InstanceTypeOverride=[{"InstanceType":"ecs.c5.xlarge","WeightedCapacity":4}]
&DataDisk=[{"PerformanceLevel":"PL1","AutoSnapshotPolicyId":"sp-bp19nq9enxqkomib****","Encrypted":"false","Description":"Test data disk.","SnapshotId":"s-280s7****","Categories":["cloud"],"Size":100,"Device":"/dev/xvdb","DiskName":"cloud_ssdData","Category":"cloud_ssd","DeleteWithInstance":true,"KMSKeyId":"0e478b7a-4262-4802-b8cb-00d3fb40****","ProvisionedIops":100,"BurstingEnabled":false}]
&SpotPriceLimit=[{"PriceLimit":0.5,"InstanceType":"ecs.g6.large"}]
&SecurityGroupIds=["sg-bp18kz60mefs****"]
&InstancePatternInfo=[{"Cores":2,"InstanceFamilyLevel":"EnterpriseLevel","MaxPrice":2.0,"Memory":4.0,"ExcludedInstanceType":["ecs.n1.small/ecs.n1.*/*7*"],"Architecture":["X86"],"BurstablePerformance":"Include","InstanceTypeFamilies":["ecs.g6"],"MinimumCpuCoreCount":2,"MaximumCpuCoreCount":4,"GpuSpecs":["NVIDIA V100"],"InstanceCategories":["Compute-optimized with GPU"],"CpuArchitectures":["X86"],"PhysicalProcessorModels":["Intel Xeon(Ice Lake) Platinum 8369B\", \"Intel Xeon(Skylake) Platinum 8163\", … \"Intel Xeon(Cascade Lake) Platinum 8269CY"],"MinimumEniQuantity":2,"MinimumEniPrivateIpAddressQuantity":2,"MinimumEniIpv6AddressQuantity":1,"MinimumInitialCredit":12,"MinimumBaselineCredit":12,"MinimumMemorySize":4.0,"MaximumMemorySize":4.0,"MinimumGpuAmount":2,"MaximumGpuAmount":2}]
&SystemDiskCategories=["cloud"]
&SystemDisk.Encrypted=false
&SystemDisk.KMSKeyId=0e478b7a-4262-4802-b8cb-00d3fb40****
&SystemDisk.EncryptAlgorithm=AES-256
&SystemDisk.ProvisionedIops=100
&SystemDisk.BurstingEnabled=false
&ImageOptions.LoginAsNonRoot=false
&DeletionProtection=false
&StorageSetId=ss-bp67acfmxazb4p****
&StorageSetPartitionNumber=2
&CustomPriorities=[{"InstanceType":"ecs.g6.large","VswitchId":"vsw-bp14zolna43z266bq****"}]
&NetworkInterfaces=[{"InstanceType":"Primary","NetworkInterfaceTrafficMode":"HighPerformance","Ipv6AddressCount":1,"SecurityGroupIds":["sg-uf6ij8dwxh****"]}]
&DedicatedHostClusterId=dc-2zedxc67zqzt7lb4****
&SecurityOptions={"ConfidentialComputingMode":"TDX"}
&HttpEndpoint=enabled
&HttpTokens=optional
&ResourcePoolOptions={"Strategy":"PrivatePoolFirst","PrivatePoolIds":["eap-bp67acfmxazb4****"]}
&<Common request parameters>

Sample success response

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<CreateScalingConfigurationResponse>
    <ScalingConfigurationId>asc-bp1ffogfdauy0nu5****</ScalingConfigurationId>
    <RequestId>473469C7-AA6F-4DC5-B3DB-A3DC0DE3****</RequestId>
</CreateScalingConfigurationResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

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

Error codes

For more information about error codes, see the Error Center.

HTTP status code

Error code

Error message

Description

400

InstanceType.Mismatch

The specified scaling configuration and existing active scaling configuration have different instance type.

The instance type of the specified scaling configuration does not match the instance type of the current scaling configuration.

404

InvalidDataDiskSnapshotId.NotFound

Snapshot "XXX" does not exist.

The specified snapshot does not exist.

400

InvalidDataDiskSnapshotId.SizeNotSupported

The capacity of snapshot "XXX" exceeds the size limit of the specified disk category.

The size of the specified snapshot exceeds the disk size limit.

403

InvalidDevice.InUse

Device "XXX" has been occupied.

The mount point of the data disk is already in use.

400

InvalidImageId.InstanceTypeMismatch

The specified image does not support the specified instance type.

The specified image cannot be used with the specified instance type.

404

InvalidImageId.NotFound

The specified image does not exist.

The specified image does not exist under this account.

400

InvalidKeyPairName.NotFound

The specified KeyPairName does not exist in our records.

The specified KeyPairName does not exist.

400

InvalidNetworkType.ForRAMRole

RAMRole can't be used For classic instance.

The RamRoleName parameter is not supported for instances in the classic network.

400

InvalidParameter

The specified value of parameter KeyPairName is not valid.

The KeyPairName parameter is not supported for Windows.

400

InvalidParameter.Conflict

The value of parameter SystemDisk.Category and parameter DataDisk.N.Category are conflict.

The specified system disk type conflicts with the data disk type.

400

InvalidRamRole.NotFound

The specified RamRoleName does not exist.

The specified RamRoleName does not exist.

400

InvalidScalingConfigurationName.Duplicate

The specified value of parameter ScalingConfigurationName is duplicated.

A scaling configuration with the same name already exists.

404

InvalidScalingGroupId.NotFound

The specified scaling group does not exist.

The specified scaling group does not exist under this account.

400

InvalidSecurityGroupId.IncorrectNetworkType

The network type of specified security Group does not support this action.

The network type of the specified security group is inconsistent with the network type specified for the scaling group.

404

InvalidSecurityGroupId.NotFound

The specified security group does not exist.

The specified security group does not exist under this account.

400

InvalidSecurityGroupId.VPCMismatch

The specified security group and the specified virtual switch are not in the same VPC.

The specified security group and vSwitch do not belong to the same VPC.

403

InvalidSnapshot.TooOld

This operation is denied because the specified snapshot is created before 2013-07-15.

The snapshot was created on or before July 15, 2013, and the call is rejected.

403

InvalidSystemDiskCategory.ValueUnauthorized

The system disk category is not authorized.

You do not have the permissions to create a system disk of the ephemeral disk type.

400

InvalidUserData.Base64FormatInvalid

The specified parameter UserData must be base64 encoded.

The UserData is not Base64-encoded.

400

InvalidUserData.SizeExceeded

The specified parameter UserData exceeds the size.

The specified UserData is too long.

403

QuotaExceeded.EphemeralDiskSize

Ephemeral disk size quota exceeded.

The total capacity of ephemeral data disks exceeds 2 TiB (2,048 GiB).

400

QuotaExceeded.ScalingConfiguration

Scaling configuration quota exceeded in the specified scaling group.

The number of scaling configurations you own has reached the upper limit.

400

QuotaExceeded.SecurityGroupInstance

Instance quota exceeded in the specified security group.

The number of ECS instances added to the specified security group has reached the upper limit.

400

InvalidSecurityGroupId.IncorrectType

The managed security group "XXX" is not supported.

The managed security group "XXX" is not supported.