Creates a scaling configuration.

Description

Auto Scaling automatically scales out Elastic Compute Service (ECS) instances based on a scaling configuration. ECS instances can be configured in the following modes:

  • InstancePatternInfo.N: intelligent configuration mode. In this mode, you need to only specify the number of vCPUs, memory size, instance family, and maximum price. The system selects an instance type that is provided at the lowest price based on your configurations to create ECS instances. This mode is available only for scaling groups that reside in virtual private clouds (VPCs). This mode helps reduce the failures of scale-out activities caused by insufficient inventory of instance types.
  • InstanceType: In this mode, you must specify an instance type.
  • InstanceTypes.N: In this mode, you must specify multiple instance types.
  • InstanceTypeOverride.N: In this mode, you must specify multiple instance types and specify weights for the instance types.
  • Cpu and Memory: In this mode, you must specify the number of vCPUs and the memory size. Auto Scaling determines a set of available instance types based on factors such as I/O optimization requirements and zones. Then, Auto Scaling preferentially creates ECS instances of the instance type that is provided at the lowest price. This mode is available only if the Scaling Policy parameter is set to Cost Optimization Policy and no instance type is specified in the scaling configuration.
Note You cannot use InstanceType, InstanceTypes.N, InstanceTypeOverride.N, and Cpu and Memory at the same time. You can use InstanceType and InstancePatternInfo.N or use InstanceTypes.N and InstancePatternInfo.N at the same time. If you use InstanceType and InstancePatternInfo.N or use InstanceTypes.N and InstancePatternInfo.N at the same time, Auto Scaling preferentially uses the instance types that are specified by InstanceType or InstanceTypes.N for scale-out activities. If the instance types that are specified by InstanceType or InstanceTypes.N do not have sufficient inventory, Auto Scaling uses the instance types that are specified by InstancePatternInfo.N for scale-out activities.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameter

Parameter Type Required Example Description
Action String Yes CreateScalingConfiguration

The operation that you want to perform. Set the value to CreateScalingConfiguration.

ScalingGroupId String Yes asg-bp14wlu85wrpchm0****

The ID of the scaling group in which you want to create the scaling configuration.

ImageId String No centos6u5_64_20G_aliaegis****.vhd

The ID of the image that is used by Auto Scaling to create instances.

ImageName String No image****

The name of the image. The name must be unique in a region. If you specify the ImageId parameter, the ImageName parameter is ignored.

You cannot use the ImageName parameter to specify Alibaba Cloud Marketplace images.

InstanceType String No ecs.g6.large

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

Cpu Integer No 2

The number of vCPUs.

You can specify the number of vCPUs and the memory size to determine the range of instance types. For example, you can set the Cpu parameter to 2 and the Memory parameter to 16 to specify the instance types that have 2 vCPUs and 16 GiB of memory. If you specify the Cpu and Memory parameters, Auto Scaling determines the available instance types based on factors such as I/O optimization requirements and zones. Then, Auto Scaling preferentially creates instances of the instance type that is provided at the lowest price.

Note You can specify CPU and memory specifications to determine the range of instance types only if the Scaling Policy parameter is set to Cost Optimization Policy and no instance type is specified in the scaling configuration.
Memory Integer No 16

The size of the memory.

You can specify the number of vCPUs and the memory size to determine the range of instance types. For example, you can set the Cpu parameter to 2 and the Memory parameter to 16 to specify the instance types that have 2 vCPUs and 16 GiB of memory. If you specify the Cpu and Memory parameters, Auto Scaling determines the available instance types based on factors such as I/O optimization requirements and zones. Then, Auto Scaling preferentially creates instances of the instance type that is provided at the lowest price.

Note You can specify CPU and memory specifications to determine the range of instance types only if the Scaling Policy parameter is set to Cost Optimization Policy and 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 with which the ECS instance is associated. The ECS instances that are associated with the same security group can access each other.

IoOptimized String No optimized

Specifies whether to create an I/O optimized instance. Valid values:

  • none: does not create an I/O optimized instance.
  • optimized: creates an I/O optimized instance.

For instances of retired instance types, the default value is none. For instances of other instance types, the default value is optimized. For information about the retired instance types, see Retired instance types.

InternetChargeType String No PayByTraffic

The billing method for network usage. Valid values:

  • PayByBandwidth: You are charged for the maximum available bandwidth that is specified by the InternetMaxBandwidthOut parameter.
  • PayByTraffic: You are charged for the actual traffic that is used. InternetMaxBandwidthOut specifies only the maximum available bandwidth.

Default value for the classic network: PayByBandwidth. Default value for VPCs: PayByTraffic.

InternetMaxBandwidthIn Integer No 100

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

Default value: 200. This parameter is not used for billing because inbound traffic to instances is free of charge.

InternetMaxBandwidthOut Integer No 50

The maximum outbound public bandwidth. Unit: Mbit/s.

  • Valid values if you set the InternetChargeType parameter to PayByBandwidth: 0 to 100. If this parameter is not specified, 0 is used as the value of this parameter.
  • Valid values if you set the InternetChargeType parameter to PayByTraffic: 0 to 100. If this parameter is not specified, an error is reported.
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 standard SSD
  • cloud_essd: enhanced SSD (ESSD)
  • cloud_auto: ESSD AutoPL disk

You cannot specify the SystemDisk.Category and SystemDiskCategories.N parameters at the same time. If you do not specify the SystemDisk.Category and SystemDiskCategories.N parameters, the default value of SystemDisk.Category is used. For non-I/O optimized instances of Generation I instance types, the default value is cloud. For instances of other instance types, the default value is cloud_efficiency.

SystemDisk.Size Integer No 100

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

The value of SystemDisk.Size must be greater than or equal to max{20, 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, digits, colons (:), underscores (_), and hyphens (-). The name must start with a letter but cannot start with http:// or https://.

SystemDisk.Description String No Test system disk.

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

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

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

SystemDisk.PerformanceLevel String No PL0

The performance level (PL) of the system disk of the ESSD category. Valid values:

  • PL0: An ESSD can deliver up to 10,000 random read/write IOPS.
  • PL1: An ESSD can deliver up to 50,000 random read/write IOPS.
  • PL2: An ESSD can deliver up to 100,000 random read/write IOPS.
  • PL3: An ESSD can deliver up to 1,000,000 random read/write IOPS.

Default value: PL0.

Note For more information about how to select ESSD PLs, 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, underscores (_), hyphens (-), and periods (.). The name must start with a letter or a digit.

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

LoadBalancerWeight Integer No 50

The weight of the ECS instance as a backend server of the associated Server Load Balancer (SLB) instance. Valid values: 1 to 100.

Default value: 50.

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

The tags of the ECS instance. The tags must be specified in the key-value pair format. You can specify up to 20 tags. Take note of the following items when you specify tag keys and tag values:

  • A tag key can be up to 64 characters in length. The key cannot start with acs: or aliyun and cannot contain http:// or https://. You cannot specify an empty string as a tag key.
  • A tag value can be up to 128 characters in length. The value cannot start with acs: or aliyun and cannot contain http:// or https://. You can specify an empty string as a tag value.
UserData String No echo hello ecs!

The user data of the ECS instance. The data must be encoded in Base64. The maximum size of the data before encoding is 16 KB.

KeyPairName String No KeyPairTest

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

  • Windows instances do not use this parameter.
  • By default, the username and password authentication method is disabled for Linux instances.
RamRoleName String No ramrole****

The name of the RAM role that is associated with the ECS instance. The name is provided and maintained by Resource Access Management (RAM). You can call the ListRoles operation to query the available RAM roles. You can call the CreateRole operation to create RAM roles.

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 instance that is automatically created based on the scaling configuration.

HostName String No host****

The hostname of the ECS instance. The hostname cannot start or end with a period (.) or a hyphen (-). The hostname cannot contain consecutive periods (.) or hyphens (-). Naming conventions for different types of instances:

  • Windows instances: The hostname must be 2 to 15 characters in length, and can contain letters, digits, and hyphens (-). The hostname cannot contain periods (.) or contain only digits.
  • Other instances such as Linux instances: The hostname must be 2 to 64 characters in length. You can use periods (.) to separate a hostname into multiple segments. Each segment can contain letters, digits, and hyphens (-).
SpotStrategy String No NoSpot

The preemption policy that you want to apply to pay-as-you-go instances and preemptible instances. Valid values:

  • NoSpot: The instance is created as a pay-as-you-go instance.
  • SpotWithPriceLimit: The instance is a preemptible instance that has a user-defined maximum hourly price.
  • SpotAsPriceGo: The instance is created as a preemptible instance for which the market price at the time of purchase is automatically used as the bid price.

Default value: NoSpot.

PasswordInherit Boolean No false

Specifies whether to use the password that is preconfigured in the image. Before you use this parameter, make sure that a password is configured for the image. Valid values:

  • true
  • false
Password String No 123abc****

The password that is used to log on to 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. The following special characters are supported:

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

The password of a Windows instance cannot start with a forward slash (/).

Note If you specify the Password parameter, we recommend that you use HTTPS to send requests for security purposes.
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 Elastic High Performance Computing (E-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. The description can contain letters but cannot start with http:// or https://.

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

The client token that is used to ensure the idempotence of the request. You can use the client to generate the value, but you must ensure that the value is unique among different requests. The token can only contain 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 that you want to allocate to the elastic network interface (ENI).

CreditSpecification String No Standard

The performance mode of the burstable instance. Valid values:

  • Standard: standard mode
  • Unlimited: unlimited mode

For more information, see the "Performance modes" section in the Overview topic.

ImageFamily String No hangzhou-daily-update

The name of the image family. If you specify this parameter, the latest custom images that are available in the specified image family are returned. You can use the images to create instances. If you specify the ImageId parameter, you cannot specify the ImageFamily parameter.

ZoneId String No cn-hangzhou-g

The ID of the zone where the ECS instance resides.

DedicatedHostId String No dh-bp67acfmxazb4p****

The ID of the dedicated host on which the ECS instance runs. You cannot create preemptible instances on dedicated hosts. Therefore, if you configure the DedicatedHostId parameter, the SpotStrategy and SpotPriceLimit parameters are ignored.

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

Affinity String No default

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

  • default: does not associate the instance with the dedicated host. If you start an instance that was stopped in economical mode and the original dedicated host has insufficient resources, the instance is automatically deployed to another dedicated host in the automatic deployment resource pool.
  • host: associates the instance with the dedicated host. If you start an instance that was stopped in economical mode, the instance remains on the original dedicated host. If the original dedicated host has insufficient resources, the instance fails to start.

Default value: default.

Tenancy String No default

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

  • default: does not create the instance on a dedicated host.
  • host: creates the instance on a dedicated host. If you do not specify the DedicatedHostId parameter, the system selects a dedicated host for the instance that you want to create.

Default value: default.

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

The scheduling options.

PrivatePoolOptions.MatchCriteria String No Open

The type of the private pool that you want to use to create instances. A private pool is generated when an elasticity assurance or a capacity reservation takes effect. You can select a private pool when you create instances. Valid values:

  • Open: open private pool. The system selects a matching open private pool to create instances. If no matching open private pools are found, the resources in the public pool are used. In this case, you do not need to specify the PrivatePoolOptions.Id parameter.
  • Target: specified private pool. The system uses the capacity of a specified private pool to create instances. If the specified private pool is unavailable, no instances can be created. If you set this parameter to Target, you must specify the PrivatePoolOptions.Id parameter.
  • None: no private pool. The capacity of private pools is not used.
PrivatePoolOptions.Id String No eap-bp67acfmxazb4****

The ID of the private pool. The ID of a private pool is the same as the ID of the elasticity assurance or capacity reservation for which the private pool is generated.

SpotDuration Integer No 1

The retention period of the preemptible instance. Unit: hours. Valid values: 0, 1, 2, 3, 4, 5, and 6.

  • The following retention periods are available in invitational preview: 2, 3, 4, 5, and 6 hours. If you want to set this parameter to one of these values, submit a ticket.
  • If you set this parameter to 0, no retention period is specified for the preemptible instance.

Default value: 1.

SpotInterruptionBehavior String No Terminate

The interruption mode of the preemptible instance. Default value: Terminate. Set the value to Terminate, which specifies to release the instance.

InstanceTypes.N String No ecs.g6.large

Instance type N. If you specify this parameter, the InstanceType parameter is ignored. You can specify up to 10 instance types in a scaling configuration. Valid values of N: 1 to 10.

A smaller value of N specifies a higher priority. Auto Scaling creates instances based on the priorities of the instance types. If Auto Scaling cannot create instances of the instance type that has the highest priority, Auto Scaling creates instances of the instance type that has the next highest priority.

InstanceTypeOverride.N.InstanceType String No ecs.c5.xlarge

If you want to specify the capacity of instance types in the scaling configuration, you must specify the InstanceTypeOverride.N.InstanceType and InstanceTypeOverride.N.WeightedCapacity parameters.

This parameter is used to specify the instance type. You can specify multiple instance types. The InstanceTypeOverride.N.WeightedCapacity parameter is used to specify weights for instance types. Valid values of N: 1 to 10.

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

For information about the valid values of InstanceType in InstanceTypeOverride.N.InstanceType, see Instance family.

InstanceTypeOverride.N.WeightedCapacity Integer No 4

If you want to specify the capacity of instance types in the scaling configuration, you must specify the InstanceTypeOverride.N.InstanceType and InstanceTypeOverride.N.WeightedCapacity parameters. The values of N in the two parameters must be the same.

This parameter specifies the weight of the instance type. The weight specifies the capacity of an instance of the specified instance type in the scaling group. A higher weight specifies that a smaller number of instances of the specified instance type are required to meet the expected capacity.

Performance metrics such as the number of vCPUs and the memory size of each instance type may vary. You can specify different weights for different instance types based on your business requirements.

Examples:

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

To meet the expected capacity, Auto Scaling must create two ecs.c5.xlarge instances.

Note The capacity of the scaling group cannot exceed the sum of the maximum capacity that is specified by the MaxSize parameter and the maximum weight of the instance type.

Valid values of WeightedCapacity in the InstanceTypeOverride.N.WeightedCapacity parameter: 1 to 500.

DataDisk.N.PerformanceLevel String No PL1

The PL of data disk N that is of the ESSD category. If you set the DataDisk.N.Category parameter to cloud_essd, the N value must be the same as the N value in DataDisk.N.Category. Valid values:

  • PL0: An ESSD can deliver up to 10,000 random read/write IOPS.
  • PL1: An ESSD can deliver up to 50,000 random read/write IOPS.
  • PL2: An ESSD can deliver up to 100,000 random read/write IOPS.
  • PL3: An ESSD can deliver up to 1,000,000 random read/write IOPS.

Default value: PL1.

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

The ID of the automatic snapshot policy that you want to apply to data disk N. Valid values of N: 1 to 16.

DataDisk.N.Encrypted String No false

Specifies whether to encrypt data disk N. Valid values of N: 1 to 16. Valid values:

  • true: encrypts data disk N.
  • false: does not encrypt data disk N.

Default value: false.

DataDisk.N.Description String No Test data disk.

The description of data disk N. Valid values of N: 1 to 16. The description must be 2 to 256 characters in length. The description can contain letters but cannot start with http:// or https://.

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

The ID of the snapshot that you want to use to create data disk N. Valid values of N: 1 to 16. If you specify this parameter, the DataDisk.N.Size parameter is ignored. The size of the disk is the same as the size of the specified snapshot.

If you specify a snapshot created on or before July 15, 2013, the operation fails and the system returns InvalidSnapshot.TooOld.

DataDisk.N.Categories.N String No cloud

Category N of data disk N. The first N in DataDisk.N.Categories.N represents the serial number of the data disk. Valid values of N: 1 to 16. The second N in DataDisk.N.Categories.N represents the serial number of the data disk category. Valid values of N: 1 to 4. You can specify up to four data disk categories in a scaling configuration. A smaller value of N specifies a higher priority. If Auto Scaling cannot create instances by using the data disk that has the highest priority, Auto Scaling creates instances by using the data disk that has the next highest priority. Valid values:

  • cloud: basic disk. The DeleteWithInstance attribute of a basic disk that is created together with the instance is set to true.
  • cloud_efficiency: ultra disk.
  • cloud_ssd: standard SSD.
  • cloud_essd: ESSD.
Note You cannot specify the DataDisk.N.Categories.N and DataDisk.N.Category parameters at the same time.
DataDisk.N.Size Integer No 100

The size of data disk N. Unit: GiB. Valid values of N: 1 to 16.

  • Valid values if you set the DataDisk.N.Category parameter to cloud: 5 to 2000.
  • Valid values if you set the DataDisk.N.Category parameter to cloud_efficiency: 20 to 32768.
  • Valid values if you set the DataDisk.N.Category parameter to cloud_ssd: 20 to 32768.
  • Valid values if you set the DataDisk.N.Category parameter to cloud_essd: 20 to 32768.
  • Valid values if you set the DataDisk.N.Category parameter to ephemeral_ssd: 5 to 800.

The value of the DataDisk.N.Size parameter must be greater than or equal to the size of the snapshot that is specified by the SnapshotId parameter.

DataDisk.N.Device String No /dev/xvdb

The mount target of data disk N. Valid values of N: 1 to 16. If you do not specify this parameter, the system automatically assigns a mount target when you create the ECS instance. The name of the mount target ranges from /dev/xvdb to /dev/xvdz.

DataDisk.N.DiskName String No cloud_ssdData

The name of data disk N. Valid values of N: 1 to 16. The name must be 2 to 128 characters in length and can contain letters, digits, colons (:), underscores (_), and hyphens (-). The name must start with a letter but cannot start with http:// or https://.

DataDisk.N.Category String No cloud_ssd

The category of data disk N. Valid values of N: 1 to 16. Valid values:

  • cloud: basic disk. The DeleteWithInstance attribute of a basic disk that is created together with the instance is set to true.
  • cloud_efficiency: ultra disk.
  • cloud_ssd: standard SSD.
  • ephemeral_ssd: local standard SSD.
  • cloud_essd: ESSD.
  • cloud_auto: ESSD AutoPL disk.

You cannot specify the DataDisk.N.Category and DataDisk.N.Categories.N parameters at the same time. If you do not specify the DataDisk.N.Category and DataDisk.N.Categories.N parameters, the default value of DataDisk.N.Category is:

  • cloud_efficiency for I/O optimized instances.
  • cloud for non-I/O optimized instances.
DataDisk.N.DeleteWithInstance Boolean No true

Specifies whether to release data disk N when the instance to which data disk N is attached is released. Valid values of N: 1 to 16. Valid values:

  • true: releases data disk N when the instance is released.
  • false: retains data disk N when the instance is released.

This parameter is available only for independent disks whose DataDisk.N.Category parameter is set to cloud, cloud_efficiency, cloud_ssd, cloud_essd, or cloud_auto. If you specify this parameter for other disks, an error is reported.

Default value: true.

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

The ID of the Key Management Service (KMS) key that is used to encrypt data disk N. Valid values of N: 1 to 16.

DataDisk.N.ProvisionedIops Long No 100

The preconfigured input/output operations per second (IOPS) for data disk N.

Note IOPS measures the number of read and write operations that an Elastic Block Storage (EBS) device can process per second.
DataDisk.N.BurstingEnabled Boolean No false

Specifies whether to enable the burst feature for data disk N. Valid values:

  • true
  • false
    Note This parameter is available only if you set the DataDisk.Category parameter to cloud_auto.
SpotPriceLimit.N.PriceLimit Float No 0.5

The price limit of preemptible instance N. Valid values of N: 1 to 10. This parameter is available only if you set the SpotStrategy parameter to SpotWithPriceLimit.

SpotPriceLimit.N.InstanceType String No ecs.g6.large

The instance type of preemptible instance N. Valid values of N: 1 to 10. This parameter is available only if you set the SpotStrategy parameter to SpotWithPriceLimit.

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

The ID of security group N with which you want to associate the ECS instance. Valid values of N vary based on the maximum number of security groups with which the instance can be associated. For more information, see the "Security group limits" section in the Limits topic.

Note You cannot specify the SecurityGroupId and SecurityGroupIds.N parameters at the same time.
InstancePatternInfo.N.Cores Integer No 2

The number of vCPUs that is specified for an instance type in intelligent configuration mode. This parameter is used to filter the available instance types that meet the specified criteria. For more information, see Instance family. Valid values of N: 1 to 10.

Take note of the following items:

  • The InstancePatternInfo.N parameter is available only for scaling groups that reside in VPCs.
  • You must specify the InstancePatternInfo.N, InstancePatternInfo.N.Cores, and InstancePatternInfo.N.Memory parameters at the same time.
  • If you specify an instance type by using the InstanceType or InstanceTypes.N parameter, Auto Scaling preferentially uses the instance type that is specified by the InstanceType or InstanceTypes.N parameter for scale-out activities. If the specified instance type does not have sufficient inventory, Auto Scaling creates instances of the instance type that is specified by the InstancePatternInfo.N parameter based on the price in ascending order.
InstancePatternInfo.N.InstanceFamilyLevel String No EnterpriseLevel

The instance family level in intelligent configuration mode. This parameter is used to filter available instance types that meet the specified criteria. Valid values:

  • EntryLevel: shared instance type. Instances of this level are the most cost-effective but may not provide stable computing performance in a consistent manner. Instances of this level are suitable for business scenarios in which the CPU utilization is low. For more information, see Shared instance families.
  • EnterpriseLevel: Instances of this level provide stable performance and dedicated resources, and are suitable for business scenarios that require high stability. For more information, see Instance family.
  • CreditEntryLevel: This value is valid only for burstable instances. CPU credits are used to ensure computing performance. Instances of this level are suitable for scenarios in which the CPU utilization is low but may fluctuate in specific cases. For more information, see What are burstable instances?

Valid values of N: 1 to 10.

InstancePatternInfo.N.MaxPrice Float No 2

The maximum hourly price for a pay-as-you-go instance or a preemptible instance in intelligent configuration mode. This parameter is used to filter the available instance types that meet the specified criteria. Valid values of N: 1 to 10.

Note If you set the SpotStrategy parameter to SpotWithPriceLimit, you must specify this parameter. Otherwise, you do not need to specify this parameter.
InstancePatternInfo.N.Memory Float No 4

The memory size that is specified for an instance type in intelligent configuration mode. Unit: GiB. This parameter is used to filter the available instance types that meet the specified criteria. For more information, see Instance family. Valid values of N: 1 to 10.

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

Instance type N that you want to exclude. You can use wildcard characters such as an asterisk (*) to exclude a single instance type or an instance family. Examples:

  • ecs.c6.large: The ecs.c6.large instance type is excluded.
  • ecs.c6.*: The c6 instance family is excluded.
InstancePatternInfo.N.Architecture.N String No X86

Architecture N of the instance type. Valid values:

  • X86: x86 architecture.
  • Heterogeneous: heterogeneous architecture, such as GPUs or FPGAs.
  • BareMetal: ECS Bare Metal Instance.
  • Arm: ARM architecture.
  • SuperComputeCluster: Super Computing Cluster architecture.

By default, all values are selected.

InstancePatternInfo.N.BurstablePerformance String No Include

Specifies whether to include burstable instance types. Valid values:

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

Default value: Include.

SystemDiskCategories.N String No cloud

Category N of the system disk. Valid values of N: 1 to 4. You can specify up to four system disk categories in a scaling configuration. A smaller value of N specifies a higher priority. If Auto Scaling cannot create instances by using the system disk that has the highest priority, Auto Scaling creates instances by using the system disk that has the next highest priority. Valid values:

  • cloud: basic disk.
  • cloud_efficiency: ultra disk.
  • cloud_ssd: standard SSD.
  • cloud_essd: ESSD.
Note You cannot specify the SystemDiskCategories.N and SystemDisk.Category parameters at the same time.
SystemDisk.Encrypted Boolean No false

Specifies whether to encrypt the system disk. Valid values:

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

Default value: false.

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

The ID of the KMS key that is used to encrypt the system disk.

SystemDisk.EncryptAlgorithm String No AES-256

The algorithm that is used to encrypt the system disk. Valid values:

  • AES-256
  • SM4-128

Default value: AES-256.

SystemDisk.ProvisionedIops Long No 100

The preconfigured IOPS for the system disk.

Note IOPS measures the number of read and write operations that an EBS device can process per second.
SystemDisk.BurstingEnabled Boolean No false

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

  • true
  • false
    Note This parameter is available only if you set the SystemDisk.Category parameter to cloud_auto.

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 requests

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=100
&InternetMaxBandwidthOut=50
&SystemDisk.Category=cloud_ssd
&SystemDisk.Size=100
&SystemDisk.DiskName=cloud_ssdSystem
&SystemDisk.Description=Test system disk.
&SystemDisk.AutoSnapshotPolicyId=sp-bp12m37ccmxvbmi5****
&SystemDisk.PerformanceLevel=PL0
&ScalingConfigurationName=scalingconfig****
&LoadBalancerWeight=50
&Tags={"key1":"value1","key2":"value2", ... "key5":"value5"}
&UserData=echo hello ecs!
&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"}]
&SystemDiskCategories=["cloud"]
&SystemDisk.Encrypted=false
&SystemDisk.KMSKeyId=0e478b7a-4262-4802-b8cb-00d3fb40****
&SystemDisk.EncryptAlgorithm=AES-256
&SystemDisk.ProvisionedIops=100
&SystemDisk.BurstingEnabled=false
&<Common request parameters>

Sample responses

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 a list of error codes, visit the API 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 error message returned because the instance type in the specified scaling configuration is different from the instance type in the current scaling configuration.

404

InvalidDataDiskSnapshotId.NotFound

Snapshot "XXX" does not exist.

The error message returned because the specified snapshot does not exist.

400

InvalidDataDiskSnapshotId.SizeNotSupported

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

The error message returned because the size of the specified snapshot exceeds the maximum size allowed for the specified disk.

403

InvalidDevice.InUse

Device "XXX" has been occupied.

The error message returned because the mount target of the data disk is occupied.

400

InvalidImageId.InstanceTypeMismatch

The specified image does not support the specified instance type.

The error message returned because the specified image does not support the specified instance type.

404

InvalidImageId.NotFound

The specified image does not exist.

The error message returned because the specified image does not exist in your Alibaba Cloud account.

400

InvalidKeyPairName.NotFound

The specified KeyPairName does not exist in our records.

The error message returned because the specified key pair does not exist.

400

InvalidNetworkType.ForRAMRole

RAMRole can't be used For classic instance.

The error message returned because the network type of the instance is classic network. The classic network does not support the RamRoleName parameter.

400

InvalidParameter

The specified value of parameter KeyPairName is not valid.

The error message returned because the OS of the specified instance is Windows. Windows instances do not support the KeyPairName parameter.

400

InvalidParameter.Conflict

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

The error message returned because the specified system disk category conflicts with the data disk category.

400

InvalidRamRole.NotFound

The specified RamRoleName does not exist.

The error message returned because the specified value of the RamRoleName parameter does not exist.

400

InvalidScalingConfigurationName.Duplicate

The specified value of parameter ScalingConfigurationName is duplicated.

The error message returned because the specified scaling configuration name already exists.

404

InvalidScalingGroupId.NotFound

The specified scaling group does not exist.

The error message returned because the specified scaling group does not exist in your Alibaba Cloud account.

400

InvalidSecurityGroupId.IncorrectNetworkType

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

The error message returned because the network type of the specified security group is different from the network type of the scaling group.

404

InvalidSecurityGroupId.NotFound

The specified security group does not exist.

The error message returned because the specified security group does not exist in your Alibaba Cloud account.

400

InvalidSecurityGroupId.VPCMismatch

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

The error message returned because the specified security group and vSwitch do not reside in the same VPC.

403

InvalidSnapshot.TooOld

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

The error message returned because the snapshot was created on or before July 15, 2013. Therefore, the request is rejected.

403

InvalidSystemDiskCategory.ValueUnauthorized

The system disk category is not authorized.

The error message returned because you do not have the permissions to create an ephemeral system disk.

400

InvalidUserData.Base64FormatInvalid

The specified parameter UserData must be base64 encoded.

The error message returned because the specified user data is not encoded in Base64.

400

InvalidUserData.SizeExceeded

The specified parameter UserData exceeds the size.

The error message returned because the user data size exceeds the limit.

403

QuotaExceeded.EphemeralDiskSize

Ephemeral disk size quota exceeded.

The error message returned because the total capacity of mounted ephemeral disks is greater than 2 TiB (2,048 GiB).

400

QuotaExceeded.ScalingConfiguration

Scaling configuration quota exceeded in the specified scaling group.

The error message returned because the maximum number of scaling configurations has been reached.

400

QuotaExceeded.SecurityGroupInstance

Instance quota exceeded in the specified security group.

The error message returned because the maximum number of ECS instances that can be associated with the specified security group has been reached.