CreateScalingConfiguration

Updated at:
Copy as MD

Creates a scaling configuration.

API

A scaling configuration is a template for creating ECS instances during scale-out events. You can configure instances in one of the following ways:

  • InstancePatternInfo.N: The intelligent configuration mode. In this mode, you do not need to specify exact instance types. Instead, you can define requirements such as the number of vCPUs, memory size, instance family level, and a maximum price. Auto Scaling automatically selects instance types that meet your requirements and prioritizes the lowest-priced options when creating ECS instances. This mode is available only when the scaling group is deployed in a VPC and helps reduce the risk of stockouts for specific instance types during scale-out events.
  • InstanceType: Specify a single instance type.
  • InstanceTypes.N: Specify multiple instance types.
  • InstanceTypeOverride.N: Specify multiple instance types and assign a weight to each type.
  • Cpu and Memory: Specify a range of instance types by defining vCPU and memory requirements. Auto Scaling identifies a set of suitable instance types based on factors such as I/O optimization and availability zones, and then creates an instance using the lowest-priced option from the set. This method applies only when the scaling group uses a cost optimization policy and no specific instance types are defined in the scaling configuration.
  • You can attach the primary network interface in one of the following ways. Note that you can use only one method to configure the primary network interface in each API call. If you use both methods simultaneously, the call fails and an error message is returned.
    • Configure the primary network interface directly by using parameters such as SecurityGroupId, SecurityGroupIds.N, and Ipv6AddressCount.
    • Configure both the primary and secondary network interfaces by using the NetworkInterfaces.N parameter. When you use this parameter, you must configure the primary network interface. If you set NetworkInterfaces.N.InstanceType to Primary, the configuration applies to the primary network interface. If you set it to Secondary or omit the parameter, the configuration applies to a secondary network interface.
Note You cannot specify InstanceType, InstanceTypes.N, InstanceTypeOverride.N, and a combination of Cpu and Memory at the same time. However, you can specify InstanceType or InstanceTypes.N with InstancePatternInfo.N. When specified together, Auto Scaling prioritizes the instance types that you specified for scale-out. If your specified instance types are out of stock, Auto Scaling uses instance types that match the InstancePatternInfo.N configuration.

Debug

You can run this API directly in OpenAPI Explorer without the need to calculate a signature. After a successful call, OpenAPI Explorer automatically generates SDK code samples.

Parameters

Parameter

Type

Required

Example

Description

Action String Yes CreateScalingConfiguration

A system-defined 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 used to create ECS instances.

Note This parameter has the same effect as the ImageName parameter. You can specify either parameter. If you specify ImageName, this parameter is ignored.
ImageName String No image****

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

Note This parameter has the same effect as the ImageId parameter. You can specify either parameter. If you specify ImageId, this parameter (ImageName) is ignored.
InstanceType String No ecs.g6.large

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

Note You cannot specify InstanceType, InstanceTypes, InstanceTypeOverrides, or a combination of Cpu and Memory at the same time. However, you can specify both InstanceType and InstancePatternInfo. If you do, Auto Scaling prioritizes the specified InstanceType for scale-outs. If instances of that type are unavailable, Auto Scaling uses instance types that match the InstancePatternInfo configuration.
Cpu Integer No 2

The number of vCPUs.

When you specify both Cpu and Memory, you define a range of instance types. For example, if you set Cpu to 2 and Memory to 16, you define all instance types with 2 vCPUs and 16 GiB of memory. Auto Scaling determines the available instance types based on factors such as I/O optimization and availability zones, and then creates an instance of the lowest-priced instance type.

Note This configuration takes effect only when the cost optimization policy is enabled for the scaling group and no instance types are specified in the scaling configuration.
Memory Integer No 16

The memory size. Unit: GiB.

When you specify both Cpu and Memory, you define a range of instance types. For example, if you set Cpu to 2 and Memory to 16, you define all instance types with 2 vCPUs and 16 GiB of memory. Auto Scaling determines the available instance types based on factors such as I/O optimization and availability zones, and then creates an instance of the lowest-priced instance type.

Note This configuration takes effect only when the cost optimization policy is enabled for the scaling group and no instance types are specified in the scaling configuration.
DeploymentSetId String No ds-bp1frxuzdg87zh4pz****

The ID of the deployment set for the ECS instance.

SecurityGroupId String No sg-280ih****

The ID of the security group for the ECS instance. ECS instances within the same security group can communicate with 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. The default value for other instance types is optimized.

InternetChargeType String No PayByTraffic

The billing method for network usage. Valid values:

  • PayByBandwidth: You are charged based on a fixed bandwidth specified by InternetMaxBandwidthOut.
  • PayByTraffic: You are charged based on actual data transfer. InternetMaxBandwidthOut specifies the peak bandwidth.

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

InternetMaxBandwidthIn Integer No 10

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

  • If InternetMaxBandwidthOut is set to a value from 0 to 10: 1 to 10. The default is 10.
  • If InternetMaxBandwidthOut is set to a value greater than 10: 1 to InternetMaxBandwidthOut. The default 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 you do not specify this parameter or SystemDiskCategories.N, a default value is used. If the instance type belongs to instance family I and 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 2,048.
    • PL1: 20 to 2,048.
    • PL2: 461 to 2,048.
    • PL3: 1,261 to 2,048.
  • ESSD AutoPL disk: 1 to 2,048.
  • Other disk categories: 20 to 2,048.

The value 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 long, 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 long and cannot start with http:// or https://.

SystemDisk.AutoSnapshotPolicyId String No sp-bp12m37ccmxvbmi5****

The ID of the automatic snapshot policy for the system disk.

SystemDisk.PerformanceLevel String No PL1

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

  • PL0: up to 10,000 random read/write IOPS per disk.
  • PL1: up to 50,000 random read/write IOPS per disk.
  • PL2: up to 100,000 random read/write IOPS per disk.
  • PL3: up to 1,000,000 random read/write IOPS per disk.

Default value: PL1.

Note For information about how to select an ESSD performance level, see ESSDs.
ScalingConfigurationName String No scalingconfig****

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

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

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 to apply to the ECS instance. You can specify up to 20 tags. The following limits apply to keys and values:

  • The key can be up to 64 characters long, cannot start with aliyun or acs:, and cannot contain http:// or https://. When you specify a tag, the key cannot be an empty string.
  • The value can be up to 128 characters long, 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 for the ECS instance. The data must be Base64-encoded, and its raw size cannot exceed 32 KB.

KeyPairName String No KeyPairTest

The name of the key pair to use for logging in to the ECS instance.

  • This parameter is ignored for Windows instances. The value is empty by default.
  • For Linux instances, password-based logon is disabled by default after initialization.
RamRoleName String No ramrole****

The name of the RAM role for the ECS instance. You can call ListRoles to query the available RAM roles. For more 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 applies only to public images.
  • Deactive: disables security hardening. This applies to all image types.
InstanceName String No instance****

The name of the ECS instance that is automatically created by using this scaling configuration.

HostName String No host****

The hostname of the ECS instance. Periods (.) and hyphens (-) cannot be used as the first or last characters and cannot be used consecutively. The naming conventions vary based on the instance OS:

  • For Windows instances, the hostname must be 2 to 15 characters long and can contain letters, digits, and hyphens (-). It cannot contain periods (.) or consist of only digits.
  • For other instance types (such as Linux), the hostname must be 2 to 64 characters long. You can use periods (.) to separate the hostname into segments. Each segment can contain letters, digits, and hyphens (-).
SpotStrategy String No NoSpot

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

  • NoSpot: a regular pay-as-you-go instance.
  • SpotWithPriceLimit: a spot instance with a user-defined maximum price.
  • SpotAsPriceGo: a spot instance for which the bid price follows the real-time market price.

Default value: NoSpot.

PasswordInherit Boolean No false

Specifies whether to use the password that is preset for the image. You must ensure that the image has a password set. Valid values:

  • true: Uses the password preset in the image.
  • false: Does not use the password preset in the image.
Password String No 123abc****

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

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

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

Note If you specify the Password parameter, send the request over HTTPS to prevent the password from being leaked.
ResourceGroupId String No rg-resource****

The ID of the resource group for the ECS instance.

HpcClusterId String No hpc-clusterid

The ID of the High-Performance Computing (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 long and cannot start with http:// or https://.

ClientToken String No 123e4567-e89b-12d3-a456-42665544****

A client token to ensure request idempotence.

You can use the client to generate a token, but you must make sure that the token is unique across different requests. The value can contain 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 elastic network interface.

CreditSpecification String No Standard

The performance mode of the burstable performance instance. Valid values:

  • Standard: standard mode.
  • Unlimited: unlimited mode.

For more information, see the "Performance modes" section in Burstable performance instances.

ImageFamily String No hangzhou-daily-update

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 specify this parameter.

ZoneId String No cn-hangzhou-g

The ID of the availability zone where the ECS instance resides.

DedicatedHostId String No dh-bp67acfmxazb4p****

The ID of the dedicated host on which to create the ECS instance. If you specify this parameter, the SpotStrategy and SpotPriceLimit parameters are ignored because dedicated hosts do not support spot instances.

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

Affinity String No default

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

  • default: The instance is not associated with the dedicated host. When you restart a stopped instance that is 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 a stopped instance that is 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.

Tenancy String No default

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

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

Default value: default.

SchedulerOptions Map No ["testManagedPrivateSpaceId****"]

The scheduling options.

PrivatePoolOptions.MatchCriteria String No Open

The capacity option of the private pool for launching instances. An Elastic Assurance or Capacity Reservation service generates a private pool of capacity after the service takes effect. You can select this capacity when you launch an instance. Valid values:

  • Open: open mode. The system automatically matches private pool capacity of the Open type. If no matching private pool capacity is available, public pool resources are used to launch the instance. You do not need to set the PrivatePoolOptions.Id parameter in this mode.
  • Target: specified mode. The instance is launched by using the capacity of a specified private pool. If the capacity of this private pool is unavailable, the instance fails to be launched. In this mode, you must specify the private pool ID by setting the PrivatePoolOptions.Id parameter.
  • None: no usage mode. The instance is launched without using private pool capacity.
PrivatePoolOptions.Id String No eap-bp67acfmxazb4****

The ID of the private pool. The ID can be the ID of an Elastic Assurance or a Capacity Reservation service.

SpotDuration Integer No 1

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

  • 1: Alibaba Cloud ensures that the instance runs for 1 hour without being automatically released. After 1 hour, the system compares the bid price with the market price and checks the resource inventory to decide whether to retain or reclaim the instance.
  • 0: Alibaba Cloud does not guarantee a 1-hour run time after the instance is created. The system 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 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 execution time of your tasks.

Default value: 1.

SpotInterruptionBehavior String No Terminate

The interruption mode of the spot instance. Only Terminate is supported, which directly releases the instance. Default value: Terminate.

InstanceTypes.N String No ecs.g6.large

A list of instance types. N can be from 1 to 20, which means you can specify up to 20 instance types in a scaling configuration.

N indicates the priority of the instance type in the scaling configuration. The instance type with N=1 has the highest priority. The priority of an instance type decreases as N increases. If Auto Scaling cannot create an instance of a higher-priority instance type, it automatically tries to create an instance of the next-priority instance type.

Note You cannot specify InstanceType, InstanceTypes, InstanceTypeOverrides, or a combination of Cpu and Memory at the same time. However, you can specify InstanceTypes and InstancePatternInfo at the same time. In this case, Auto Scaling prioritizes the instance types that you specify for scale-outs. If the specified instance types are unavailable, Auto Scaling uses instance types that match the InstancePatternInfo configuration.
InstanceTypeOverride.N.InstanceType String No ecs.c5.xlarge

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

This parameter specifies the instance type. You can specify this parameter N times, in conjunction with the InstanceTypeOverride.N.WeightedCapacity parameter, to support multiple instance types with custom weights. N can be from 1 to 20.

Note If you specify this parameter, you cannot specify InstanceTypes.N or InstanceType.

For a list of available instance types, see Instance families.

InstanceTypeOverride.N.WeightedCapacity Integer No 4

After you specify InstanceTypeOverride.N.InstanceType, specify this parameter to define the capacity of the instance type. The value of N for both parameters must be the same.

This parameter specifies the weight of the instance type. The weight defines the capacity that a single instance of the specified type represents in the scaling group. A higher weight means that fewer instances of that type are required 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.

Example:

  • Current capacity: 0.
  • Desired capacity: 6.
  • Capacity of ecs.c5.xlarge: 4.

To meet the desired capacity, the scaling group scales out two ecs.c5.xlarge instances.

Note The total weighted capacity of instances in the scaling group cannot exceed the maximum capacity (MaxSize).

Valid values for WeightedCapacity: 1 to 500.

DataDisk.N.PerformanceLevel String No PL1

The performance level of the ESSD if it is used as a data disk. The value of N must be the same as the N in DataDisk.N.Category=cloud_essd. Valid values:

  • PL0: up to 10,000 random read/write IOPS per disk.
  • PL1: up to 50,000 random read/write IOPS per disk.
  • PL2: up to 100,000 random read/write IOPS per disk.
  • PL3: up to 1,000,000 random read/write IOPS per disk.

Default value: PL1.

Note For information about how to select an ESSD performance level, see ESSDs.
DataDisk.N.AutoSnapshotPolicyId String No sp-bp19nq9enxqkomib****

The ID of the automatic snapshot policy for data disk N. The value of N is from 1 to 16.

DataDisk.N.Encrypted String No false

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

  • true: encrypts the disk.
  • false: does not encrypt the disk.

Default value: false.

DataDisk.N.Description String No Test data disk.

The description of data disk N. The value of N can be from 1 to 16. The description must be 2 to 256 characters long and cannot start with http:// or https://.

DataDisk.N.SnapshotId String No s-280s7****

The snapshot used to create data disk N. The value of N can be from 1 to 16. If you specify this parameter, DataDisk.N.Size is ignored, and the disk is created with the same size as the snapshot.

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

DataDisk.N.Categories.N String No cloud

A prioritized list of up to four disk categories for data disk N. The DataDisk.N index specifies the data disk (1-16). The Categories.N index specifies the priority (1-4). A lower Categories.N index indicates a higher priority. If a higher-priority disk category is unavailable, Auto Scaling automatically tries the next-priority disk category. Valid values:

  • cloud: basic disk. The DeleteWithInstance attribute of a basic disk created with an instance is set to true.
  • cloud_efficiency: ultra disk.
  • cloud_ssd: standard SSD.
  • cloud_essd: ESSD.
Note If you specify this parameter, you cannot specify DataDisk.N.Category.
DataDisk.N.Size Integer No 100

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

  • cloud: 5 to 2,000.
  • cloud_efficiency: 20 to 32,768.
  • cloud_ssd: 20 to 32,768.
  • cloud_essd: 20 to 32,768.
  • ephemeral_ssd: 5 to 800.

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

DataDisk.N.Device String No /dev/xvdb

The mount point of the data disk. The value of N can be from 1 to 16. If you do not specify this parameter, the system automatically allocates a mount point, 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 be from 1 to 16. The name must be 2 to 128 characters long, 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 be from 1 to 16. Valid values:

  • cloud: basic disk. The DeleteWithInstance attribute of a basic disk created with an instance is set to 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 parameter is specified, a default value is used:

  • 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 data disk N when the instance is released. The value of N can be from 1 to 16. 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 standalone cloud disks (where 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 data disk N. The value of N can be from 1 to 16.

DataDisk.N.ProvisionedIops Long No 100

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.
DataDisk.N.BurstingEnabled Boolean No false

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

  • true: enables performance bursting.
  • false: disables performance bursting.

    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 be 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 be from 1 to 20. This parameter takes effect only when SpotStrategy is set to SpotWithPriceLimit.

SecurityGroupIds.N String No sg-bp18kz60mefs****

The IDs of security groups to associate with the ECS instance. The number of security groups that you can specify is limited by the maximum number of security groups that an instance can join. For more information, see the "Security groups" section in Limits.

Note You cannot specify both SecurityGroupId and SecurityGroupIds.N.
InstancePatternInfo.N.Cores Integer No 2

The number of vCPU cores of the instance type. This parameter is used in intelligent configuration mode to filter instance types. For more information, see Instance families. The value of N can be from 1 to 10.

Note the following:

  • The InstancePatternInfo.N parameters apply only to scaling groups in a VPC.
  • You must specify both InstancePatternInfo.N.Cores and InstancePatternInfo.N.Memory.
  • If you have specified instance types by using the InstanceType or InstanceTypes.N parameter, Auto Scaling prioritizes those instance types for scale-outs. If the specified instance types are unavailable, Auto Scaling uses the lowest-priced instance type from the instance types that match the InstancePatternInfo.N criteria.
InstancePatternInfo.N.InstanceFamilyLevel String No EnterpriseLevel

The level of the instance family. This parameter is used in intelligent configuration mode to filter instance types. Valid values:

  • EntryLevel: Entry-level (shared instance types). This level offers lower costs but cannot guarantee stable computing performance. Suitable for business scenarios with low CPU utilization. For more information, see Shared instance types.
  • 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 (burstable performance instances). This level uses CPU credits to guarantee computing performance. Suitable for scenarios with low average CPU utilization and occasional bursts. For more information, see Burstable performance instances.

The value of N can be from 1 to 10.

InstancePatternInfo.N.MaxPrice Float No 2

The maximum hourly price for a pay-as-you-go or spot instance. This parameter is used in intelligent configuration mode to filter instance types. The value of N can be from 1 to 10.

Note This parameter is required when SpotStrategy is set to SpotWithPriceLimit. In other cases, it is optional.
InstancePatternInfo.N.Memory Float No 4

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

InstancePatternInfo.N.ExcludedInstanceType.N String No ecs.n1.small/ecs.n1.*/*7*

The instance types to exclude. You can use wildcards (*) to exclude a single instance type or an entire instance family. Examples:

  • ecs.c6.large: excludes the ecs.c6.large instance type.
  • ecs.c6.*: excludes all instance types of the c6 instance family.
InstancePatternInfo.N.Architecture.N String No X86

The architecture of the instance type. Valid values:

  • X86: X86 compute.
  • Heterogeneous: heterogeneous compute, such as GPU or FPGA.
  • BareMetal: ECS Bare Metal Server.
  • Arm: Arm compute.

Default value: All architecture types are included.

InstancePatternInfo.N.BurstablePerformance String No Include

Specifies whether to include burstable performance instance types. Valid values:

  • Exclude: does not include burstable performance instance types.
  • Include: includes burstable performance instance types.
  • Required: includes only burstable performance instance types.

Default value: Include.

InstancePatternInfo.N.InstanceTypeFamilies.N String No ecs.g6

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

InstancePatternInfo.N.MinimumCpuCoreCount Integer No 2

The minimum number of vCPU cores of the instance type.

InstancePatternInfo.N.MaximumCpuCoreCount Integer No 4

The maximum number of vCPU cores of the instance type.

Note The value of MaximumCpuCoreCount cannot be more than four times the value of MinimumCpuCoreCount.
InstancePatternInfo.N.GpuSpecs.N String No NVIDIA V100

The GPU type.

InstancePatternInfo.N.InstanceCategories.N String No Compute-optimized with GPU

The instance category. Valid values:

Note N indicates that you can specify multiple instance categories. The value of N can be from 1 to 10.
  • General-purpose
  • Compute-optimized
  • Memory-optimized
  • Big data
  • Local SSDs
  • High Clock Speed
  • Enhanced
  • Shared
  • Compute-optimized with GPU
  • Visual Compute-optimized
  • Heterogeneous Service
  • Compute-optimized with FPGA
  • Compute-optimized with NPU
  • ECS Bare Metal
  • High Performance Compute
InstancePatternInfo.N.CpuArchitectures.N String No X86

The CPU architecture of the instance. Valid values:

Note N indicates that you can specify multiple CPU architectures. The value of N can be 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 specify multiple processor models. The value of N can be from 1 to 10.

InstancePatternInfo.N.MinimumEniQuantity Integer No 2

The minimum number of elastic network interfaces for the instance.

InstancePatternInfo.N.MinimumEniPrivateIpAddressQuantity Integer No 2

The minimum number of private IPv4 addresses that can be assigned to a single elastic network interface.

InstancePatternInfo.N.MinimumEniIpv6AddressQuantity Integer No 1

The minimum number of IPv6 addresses that can be assigned to a single elastic network interface.

InstancePatternInfo.N.MinimumInitialCredit Integer No 12

The minimum initial vCPU credits for t5 or t6 burstable performance instances.

InstancePatternInfo.N.MinimumBaselineCredit Integer No 12

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

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

A prioritized list of disk categories for the system disk. N can be from 1 to 4. A lower value for N indicates a higher priority. If a higher-priority disk category is unavailable, Auto Scaling automatically tries the next-priority disk category. 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.
SystemDisk.Encrypted Boolean No false

Specifies whether to encrypt the system disk. Valid values:

  • true: encrypts the disk.
  • false: does not encrypt the disk.

Default value: false.

SystemDisk.KMSKeyId String No 0e478b7a-4262-4802-b8cb-00d3fb40****

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

SystemDisk.EncryptAlgorithm String No AES-256

The encryption algorithm 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 (input/output operations per second) indicates the number of I/O operations that a block storage device can process per second.
SystemDisk.BurstingEnabled Boolean No false

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

  • true: enables performance bursting.
  • false: disables performance bursting.

    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 an ECS instance. Valid values:

  • true: Yes.
  • false: No.

Default value: false.

DeletionProtection Boolean No false

The release protection attribute of the ECS instance. This parameter applies only to pay-as-you-go instances and specifies whether the instance can be released through the ECS console or by calling the DeleteInstance operation. Valid values:

  • true: enables release protection. This prevents the instance from being released in the ECS console or by calling the DeleteInstance operation. This helps prevent accidental deletion of instances scaled out by Auto Scaling.
  • false: disables release protection. This allows the instance to be released in the ECS console or by calling the DeleteInstance operation.

Default value: false.

Note This attribute does not affect normal scale-in activities. Pay-as-you-go instances with release protection enabled can still be released during a scale-in event.
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

This parameter, along with CustomPriorities.N.VswitchId, allows you to set a custom priority for a specific combination of an ECS instance type and vSwitch.

Note This parameter applies only when the scaling policy of the scaling group is set to Priority, and the specified instance type must be included in the instance type list of the scaling configuration.

If an instance cannot be created using a higher-priority ECS instance type and vSwitch combination, Auto Scaling automatically tries the next combination in your priority list.

Note If you specify custom priorities for only some ECS instance type and vSwitch combinations, the unspecified combinations have lower priority than the specified ones. The unspecified combinations are still prioritized based on the vSwitch order in the scaling group and the instance type order in the scaling configuration. For example, if the vSwitches are vsw1 and vsw2, the instance types are type1 and type2, and the custom priority is ["vsw2+type2", "vsw1+type2"], the final priority order 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 applies only when the scaling policy of the scaling group is set to Priority, and the specified vSwitch must be included in the vSwitch list of the scaling group.
NetworkInterfaces.N.InstanceType String No Primary

The type of the elastic network interface. When you use NetworkInterfaces.N, you must specify a primary network interface, but you cannot specify the SecurityGroupId or SecurityGroupIds.N parameter at the same time. Valid values:

  • Primary: The primary elastic network interface.
  • Secondary: The secondary elastic network interface.

Default value: Secondary.

NetworkInterfaces.N.NetworkInterfaceTrafficMode String No HighPerformance

The communication mode of the network interface. 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 RDMA-capable elastic network interfaces 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 network interface. Note the following:

  • This parameter takes effect only when NetworkInterfaces.N.InstanceType is set to Primary.
  • If NetworkInterface.N.InstanceType is set to Secondary or is not specified, you cannot specify this parameter.
  • If you set this parameter, you cannot also set the Ipv6AddressCount parameter.
NetworkInterfaces.N.SecurityGroupIds.N String No sg-uf6ij8dwxh****

The IDs of one or more security groups to which the elastic network interface belongs. Note the following:

  • If NetworkInterfaces.N.InstanceType is set to Primary, this parameter is required. In this case, its function is equivalent to SecurityGroupIds.N, but you cannot specify SecurityGroupId or SecurityGroupIds.N at the same time.
  • If NetworkInterfaces.N.InstanceType is set to Secondary or is not specified, this parameter is optional. By default, the security group of the ECS instance (which is the security group of the primary network interface) is used.
NetworkInterfaces.N.SecondaryPrivateIpAddressCount Integer No 2

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

  • The value cannot exceed the IP address limit for the instance type. For more information, see Instance families.
  • The NetworkInterface.N.SecondaryPrivateIpAddressCount parameter specifies the number of secondary private IPv4 addresses to assign to the network interface. This number does not include the primary private IP address of the interface. The system randomly allocates the addresses from the available CIDR blocks of the vSwitch where the network interface is located (NetworkInterface.N.VSwitchId).
DedicatedHostClusterId String No dc-2zedxc67zqzt7lb4****

The ID of the dedicated host cluster.

SecurityOptions.ConfidentialComputingMode String No TDX

The confidential computing mode. Valid values:

HttpEndpoint String No enabled

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

  • enabled: enables the access channel.
  • disabled: disables the access channel.

Default value: enabled.

Note For more information about instance metadata, see Overview of instance metadata.
HttpTokens String No optional

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

  • optional: does not enforce the use of IMDSv2.
  • required: enforces the use of IMDSv2. If you set this value, you cannot access instance metadata in normal mode.

Default value: optional.

Note For more information about instance metadata access modes, see Instance metadata access modes.
ResourcePoolOptions.Strategy String No PrivatePoolFirst

The resource pool selection policy. Resource pools include private pools generated after an Elastic Assurance or Capacity Reservation service takes effect, and the public pool. Valid values:

  • PrivatePoolFirst: The private pool is prioritized. If you specify ResourcePoolOptions.PrivatePoolIds or meet the PrivatePoolTags conditions, the corresponding private pool is prioritized. 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 matching private pool is found, the instance is created by using the public pool.
  • PrivatePoolOnly: Only the private pool is used. When this policy is selected, you must specify ResourcePoolOptions.PrivatePoolIds. If the specified private pool has insufficient capacity, the instance fails to be launched.
  • PublicPoolFirst: Public pool resources are prioritized. The instance is created by using the public pool first. If public pool resources are insufficient, private pool resources are used. The system preferentially matches an open-type private pool. If no matching private pool is found, a Target-type private pool that meets the ResourcePoolOptions.PrivatePoolIds or PrivatePoolTags conditions is used.

    Note This policy is available by invitation only.

  • None: No resource pool policy is used.

Default value: None.

ResourcePoolOptions.PrivatePoolIds.N String No eap-bp67acfmxazb4****

The ID of the private pool, which can be the ID of an Elastic Assurance or a Capacity Reservation service. This parameter can only contain Target-mode private pool IDs and cannot be specified at the same time as the PrivatePoolTags parameter. The value of N can be from 1 to 20.

ResourcePoolOptions.PrivatePoolTags.N.Key String No TestKey

The tag key of the private pool.

This parameter filters available Target-type private pools by tags. The value of N can be from 1 to 20.

When this parameter is configured, the system filters only the Target-type private pools associated with the account that match the specified tags and meet the scaling group constraints, such as availability zone and instance type.

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

You cannot specify this parameter and the PrivatePoolIds parameter at the same time.

ResourcePoolOptions.PrivatePoolTags.N.Value String No TestValue

The tag value of the private pool.

Returned data

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

In XML format

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

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

In JSON format

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

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

Error codes

See the Error Center for more error codes.

HTTP status code

Error code

Error message

Description

400

InstanceType.Mismatch

The specified scaling configuration and the active scaling configuration have different instance types.

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

404

InvalidDataDiskSnapshotId.NotFound

Snapshot "XXX" does not exist.

The specified snapshot does not exist.

400

InvalidDataDiskSnapshotId.SizeNotSupported

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

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

403

InvalidDevice.InUse

The mount point "XXX" is already in use.

The specified mount point for the data disk is already in use.

400

InvalidImageId.InstanceTypeMismatch

The specified image does not support the specified instance type.

The specified image does not support the specified instance type.

404

InvalidImageId.NotFound

The specified image does not exist.

The specified image does not exist in your account.

400

InvalidKeyPairName.NotFound

The specified key pair does not exist.

The specified key pair does not exist.

400

InvalidNetworkType.ForRAMRole

A RAM role cannot be used for an instance in the classic network.

Instances in the classic network do not support the RamRoleName parameter.

400

InvalidParameter

The specified value of parameter KeyPairName is not valid.

The KeyPairName parameter is not supported for Windows instances.

400

InvalidParameter.Conflict

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

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

400

InvalidRamRole.NotFound

The specified RAM role does not exist.

The specified RAM role does not exist.

400

InvalidScalingConfigurationName.Duplicate

A scaling configuration with the specified name already exists.

A scaling configuration with the specified name already exists.

404

InvalidScalingGroupId.NotFound

The specified scaling group does not exist.

The specified scaling group does not exist in your account.

400

InvalidSecurityGroupId.IncorrectNetworkType

The network type of the specified security group does not match that of the scaling group.

The network type of the specified security group does not match that of the scaling group.

404

InvalidSecurityGroupId.NotFound

The specified security group does not exist.

The specified security group does not exist in your account.

403

InvalidSnapshot.TooOld

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

The request is denied because the specified snapshot was created on or before 2013-07-15.

403

InvalidSystemDiskCategory.ValueUnauthorized

The system disk category is not authorized.

You are not authorized to create a system disk of the ephemeral disk category.

400

InvalidUserData.Base64FormatInvalid

The value of the UserData parameter is not in a valid Base64 format.

The specified user data is not in a valid Base64 format.

400

InvalidUserData.SizeExceeded

The size of the specified user data exceeds the limit.

The size of the specified user data exceeds the limit.

403

QuotaExceeded.EphemeralDiskSize

Ephemeral disk size quota exceeded.

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

400

QuotaExceeded.ScalingConfiguration

The scaling configuration quota has been exceeded for the specified scaling group.

You have reached the maximum number of scaling configurations.

400

QuotaExceeded.SecurityGroupInstance

The instance quota has been exceeded in the specified security group.

The number of ECS instances in the specified security group has reached the limit.

400

InvalidSecurityGroupId.IncorrectType

The managed security group "XXX" is not supported.

The specified managed security group is not supported.

400

InvalidSecurityGroupId.IncorrectType

The managed security group "XXX" is not supported.

"XXX" managed security groups are not supported.