Modifies a scaling configuration.

Description

If you change the name of a scaling configuration in a scaling group, make sure that the new name is unique within the scaling group.

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 parameters

Parameter Type Required Example Description
Action String Yes ModifyScalingConfiguration

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

ScalingConfigurationId String Yes asc-bp16har3jpj6fjbx****

The ID of the scaling configuration that you want to modify.

IoOptimized String No none

Specifies whether the instance that you want to create is I/O optimized. Valid values:

  • none: The instance is not I/O optimized.
  • optimized: The instance is I/O optimized.
DataDisk.N.Size Integer No 100

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

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

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

DataDisk.N.SnapshotId String No s-snapshot****

The ID of the snapshot that you want to use to create data disk N. Valid values of N: 1 to 16. If you configure 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 that was created on or before July 15, 2013, the operation fails and the system returns InvalidSnapshot.TooOld.

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 value of the DeleteWithInstance attribute of a basic disk that is created together with the instance is true.
  • cloud_efficiency: ultra disk.
  • cloud_ssd: standard SSD.
  • cloud_essd: enhanced SSD (ESSD).
  • ephemeral_ssd: local SSD.
DataDisk.N.Device String No /dev/xvdb

The mount point of data disk N. Valid values of N: 1 to 16. If you do not configure this parameter, the system automatically allocates a mount point to the ECS instances that are created. The name of the mount point ranges from /dev/xvdb to /dev/xvdz in alphabetical order.

DataDisk.N.DeleteWithInstance Boolean No true

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

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

This parameter is valid only for independent disks whose DataDisk.N.Category parameter is set to cloud, cloud_efficiency, cloud_ssd, or cloud_essd. An error is reported if you configure this parameter for other disks.

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.
DataDisk.N.KMSKeyId String No 0e478b7a-4262-4802-b8cb-00d3fb40****

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

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

DataDisk.N.AutoSnapshotPolicyId String No sp-bp19nq9enxqkomib****

The ID of the automatic snapshot policy that is applied to data disk N. Valid values of N: 1 to 16.

DataDisk.N.PerformanceLevel String No PL1

Specifies the performance level of the system disk that is an ESSD. The value of N must be the same as the value of N in DataDisk.N.Category that is set to cloud_essd. Valid values:

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

Default value: PL1.

Note For more information about how to select ESSD performance levels, see ESSDs.
SpotStrategy String No NoSpot

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

  • NoSpot: The policy applies to regular pay-as-you-go instances.
  • SpotWithPriceLimit: The policy applies to preemptible instances with a maximum hourly price.
  • SpotAsPriceGo: The policy applies to preemptible instances whose prices are based on the current market price.
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 SpotStrategy to SpotWithPriceLimit.

SpotPriceLimit.N.PriceLimit Float No 0.125

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

ScalingConfigurationName String No test-modify

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 within a scaling group in a region. If you do not configure this parameter, the value of ScalingConfigurationId is used.

InstanceName String No inst****

The name of the instance that is automatically created based on the scaling configuration.

HostName String No hos****

The name of the host on which the created ECS instances reside. The name cannot start or end with a period (.) or a hyphen (-). The name also cannot contain consecutive periods (.) or hyphens (-). Naming conventions:

  • Windows instances: The name must be 2 to 15 characters in length and can contain letters, digits, and hyphens (-). The name cannot contain periods (.) or contain only digits.
  • Other instances such as Linux instances: The name must be 2 to 64 characters in length. The name can be segments that are separated by periods (.). Each segment can contain letters, digits, and hyphens (-).
ImageId String No centos6u5_64_20G_aliaegis_2014****.vhd

The ID of the image that is used to create the instance.

Note If the image that is specified in the scaling configuration contains a system disk and data disks, the data that is stored in the data disks is cleared after you modify the image.
ImageName String No suse11sp3_64_20G_aliaegis_20150428.vhd

The name of the image. Each image name must be unique within a region. If you configure the ImageId parameter, this parameter is ignored.

Alibaba Cloud Marketplace images cannot be specified by using the ImageName parameter.

InstanceTypes.N RepeatList No ecs.g6.large

The instance type N of the ECS instances that can be created. If you configure this parameter, InstanceType is ignored. You can specify up to 10 instance types for a scaling configuration. Valid values of N: 1 to 10.

N represents the priority of an instance type in the scaling configuration. A smaller value of N specifies a higher priority. Auto Scaling creates instances based on the priorities of instance types. If Auto Scaling cannot create instances based on the instance type of the highest priority, the instance type of the next highest priority is used.

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

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

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

Note If you configure the InstanceTypeOverride.N.InstanceType parameter, you cannot configure the InstanceTypes parameter.

For information about the valid values of the InstanceType parameter, see Instance families.

InstanceTypeOverride.N.WeightedCapacity Integer No 4

If you want to specify the capacity of instance types in the scaling configuration, you must configure the InstanceTypeOverride.N.InstanceType and InstanceTypeOverride.N.WeightedCapacity parameters. The two parameters have a one-to-one correspondence. The value of N of both parameters must be the same.

This parameter specifies the weight of the instance type. The weight specifies the capacity of a single instance of the specified instance type in the scaling group. A greater weight specifies a smaller number of instances of the specified instance type 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 configure different weights for different instance types based on your business requirements.

Example:

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

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

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

Valid values of the WeightedCapacity parameter: 1 to 500.

Cpu Integer No 2

The number of vCPUs.

You can specify the number of vCPUs and memory size to specify the range of instance types. For example, you can set CPU to 2 and Memory to 16 to specify instance types that have 2 vCPUs and 16 GiB of memory. Auto Scaling determines a set of available instance types based on factors such as I/O optimization and zone. Then, Auto Scaling creates instances based on the unit prices of instance types in ascending order.

Note The range of instance types is valid only if cost optimization is enabled and the scaling configuration does not have a specified instance type.
Memory Integer No 16

The size of the memory.

You can specify the number of vCPUs and memory size to specify the range of instance types. For example, you can set CPU to 2 and Memory to 16 to specify instance types that have 2 vCPUs and 16 GiB of memory. Auto Scaling determines a set of available instance types based on factors such as I/O optimization and zone. Then, Auto Scaling creates instances based on the unit prices of instance types in ascending order.

Note The range of instance types is valid only if cost optimization is enabled and the scaling configuration does not have a specified instance type.
InternetChargeType String No PayByBandwidth

The billing method for network usage. Valid values:

  • PayByBandwidth: You are charged for the maximum available bandwidth specified by the InternetMaxBandwidthOut parameter.
  • PayByTraffic: You are charged for the actual traffic used. The InternetMaxBandwidthOut parameter specifies only the upper limit of available bandwidth.
InternetMaxBandwidthOut Integer No 50

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

  • If you set InternetChargeType to PayByBandwidth and you leave this parameter empty, this parameter is automatically set to 0.
  • If you set InternetChargeType to PayByTraffic and you leave this parameter empty, an error is reported.
SystemDisk.Category String No cloud_efficiency

The category of the system disk. Valid values:

  • cloud: basic disk
  • cloud_efficiency: ultra disk
  • cloud_ssd: standard SSD
  • cloud_essd: ESSD
  • ephemeral_ssd: local SSD
SystemDisk.Size Integer No 50

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

  • Valid values if SystemDisk.Category is set to cloud: 20 to 500
  • Valid values if SystemDisk.Category is set to cloud_efficiency: 20 to 500
  • Valid values if SystemDisk.Category is set to cloud_ssd: 20 to 500
  • Valid values if SystemDisk.Category is set to cloud_essd: 20 to 500
  • Valid values if SystemDisk.Category is set to ephemeral_ssd: 20 to 500

The value that you specify must be greater than or equal to max{20, 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 and cannot start with http:// or https://.

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

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

SystemDisk.PerformanceLevel String No PL0

Specifies the performance level of the system disk that is an ESSD. Valid values:

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

Default value: PL0.

Note For more information about how to select ESSD performance levels, see ESSDs.
LoadBalancerWeight Integer No 50

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

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 raw data is 16 KB.

KeyPairName String No KeyPair_Name

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

  • This parameter is ignored if you are creating a Windows instance. This parameter is empty by default.
  • By default, the username and password authentication method is disabled for Linux instances.
RamRoleName String No RamRoleTest

The name of the RAM role that is associated with an ECS instance. This name is provided and maintained by Resource Access Management (RAM). You can call the ListRoles operation to query the available RAM roles. For more information about how to create a RAM role, see CreateRole.

PasswordInherit Boolean No false

Specifies whether to use the predefined password of the image. To use this parameter, make sure that a password is configured for the specified image.

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

The tags of the ECS instance. Tags must be specified as key-value pairs. You can specify up to 20 tags. Take note of the following limits on tag keys and tag values:

  • A tag key can be up to 64 characters in length and cannot start with acs: or aliyun. A key 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 and cannot start with acs: or aliyun. A tag value cannot contain http:// or https://. You can specify an empty string as a tag value.
DeploymentSetId String No ds-bp13v7bjnj9gis****

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

SecurityGroupId String No sg-F876F****

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

Override Boolean No true

Specifies whether to overwrite the existing data. Valid values:

  • true: overwrites the existing data.
  • false: does not overwrite the existing data.
ResourceGroupId String No abcd1234abcd****

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

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

Specifies the ID of security group N to which you want to add ECS instances. The valid values of N vary based on the maximum number of security groups to which an instance can be added. For more information, see the "Security group limits" section in Limits.

Note You cannot configure the SecurityGroupId and SecurityGroupIds.N parameters at the same time.
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 and cannot start with http:// or https://.

Ipv6AddressCount Integer No 1

The number of randomly generated IPv6 addresses that you want to assign to the elastic network interface (ENI).

CreditSpecification String No Standard

The performance mode of the burstable instance. Valid values:

  • Standard: the standard mode. For more information, see the "Standard mode" section in Burstable instances.
  • Unlimited: the unlimited mode. For more information, see the "Unlimited mode" section in Burstable instances.
ImageFamily String No hangzhou-daily-update

The name of the image family. You can configure this parameter to obtain the latest custom images that are available in the specified image family. The images are used to create ECS instances. If the ImageId parameter is configured, you cannot configure the ImageFamily parameter.

ZoneId String No cn-hangzhou-g

The zone ID of the ECS instance.

DedicatedHostId String No dh-bp67acfmxazb4p****

The ID of the dedicated host on which you want to create instances. Preemptible instances cannot be created on dedicated hosts. Therefore, if the DedicatedHostId parameter is configured, 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 an instance on a dedicated host with the dedicated host. Valid values:

  • default: does not associate the instance with the dedicated host. When an instance that is in the Economical Mode state restarts, the instance is automatically deployed to another dedicated host in the automatic deployment resource pool if resources of the original dedicated host are insufficient.
  • host: associates the instance with the dedicated host. When an instance that is in the Economical Mode state restarts, the instance still resides on the original dedicated host. If resources of the original dedicated host are insufficient, the instance fails to restart.
Tenancy String No default

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

  • default: creates the instance on a non-dedicated host.
  • host: creates the instance on a dedicated host. If you do not configure the DedicatedHostId parameter, Alibaba Cloud automatically selects a dedicated host for the instance.
PrivatePoolOptions.MatchCriteria String No Open

The type of the private pool. After an elasticity assurance or a capacity reservation takes effect, a private pool is generated. You can select a private pool when you start an instance. Valid values:

  • Open: the open mode. In this mode, the system automatically selects a matched private pool of the open type to start the instance. If no matched private pool exists, the instance uses public pool resources. In this case, you do not need to configure the PrivatePoolOptions.Id parameter.
  • Target: the specified mode. The instance uses resources in a specified private pool to start. If the specified private pool is unavailable, the instance fails to start. If this parameter is set to Target, the PrivatePoolOptions.Id parameter must be specified.
  • None: the no-private-pool mode. In this mode, no private pools are used to start the instance.
Note This parameter is in invitational preview. For more information, submit a ticket.
PrivatePoolOptions.Id String No eap-bp67acfmxazb4****

The ID of the private pool. Set the value to the ID of the elasticity assurance or capacity reservation based on which the private pool is generated.

Note This parameter is in invitational preview. For more information, submit a ticket.
SpotDuration Integer No 1

The retention period of the preemptible instance. Unit: hours. Valid values: 0 to 6.

  • Retention periods of 2 to 6 hours are in invitational preview. If you want to set this parameter to a value in this range, submit a ticket.
  • If this parameter is set 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. Only Terminate is supported, which means that the instance is directly released.

Response parameters

Parameter Type Example Description
RequestId String 473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E

The ID of the request.

Examples

Sample requests

https://ess.aliyuncs.com/?Action=ModifyScalingConfiguration
&ScalingConfigurationId=asc-bp16har3jpj6fjbx****
&InstanceName=instan****
&<Common request parameters>

Sample success responses

XML format

<ModifyScalingConfigurationResponse>
    <RequestId>473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E</RequestId>
</ModifyScalingConfigurationResponse>

JSON format

{
    "RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E"
}

Error codes

For a list of error codes, visit the API Error Center.

HttpCode

Error code

Error message

Description

403

Forbidden.Unauthorized

A required authorization for the specified action is not supplied.

The error message returned because you are not authorized to perform the specified operation.

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.

404

InvalidImageId.NotFound

The specified image does not exist.

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

400

InvalidKeyPairName.NotFound

The specified KeyPairName does not exist in our records.

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

400

InvalidNetworkType.ForRAMRole

RAMRole can't be used For classic instance.

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

400

InvalidParamter

The specified value of parameter is not valid.

The error message returned because the value specified for a parameter is invalid.

400

InvalidScalingConfigurationName.Duplicate

The specified value of parameter is duplicated.

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

400

InvalidSecurityGroupId.IncorrectNetworkType

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

The error message returned because the network types of the specified security group and the scaling group are different.

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 the vSwitch do not belong to the same VPC.

400

InvalidTags.KeyValue

The specified tags key/value cannot be empty.

The error message returned because no value is specified for the Tags parameter.

400

InvalidTags.ListSize

The specified tags list size cannot be more than "20".

The error message returned because the maximum number of tags that can be specified for the ECS instances is reached.

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 size of user data exceeds the upper limit.