You can call this operation to modify a scaling configuration.

Description

If you are modifying the name of a scaling configuration, 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
ScalingConfigurationId String Yes asc-****

The ID of the scaling configuration to be modified.

Action String No ModifyScalingConfiguration

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

Cpu Integer No 2

The number of vCPUs.

You can specify the number of vCPUs and the amount of memory to define the range of instance types. For example, to specify instance types that have 2 vCPUs and 16 GiB memory, set the value of Cpu to 2 and the value of Memory to 16. Auto Scaling uses the properties of instances such as its storage I/O performance and zone to determine a set of available instances types. Auto Scaling then creates instances of the type that is the most cost-effective out of the available types.

Note This instance type range takes effect only when cost optimization is enabled and the scaling configuration does not have a specified instance type.
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 created along with the instance is true.
  • cloud_efficiency: ultra disk.
  • cloud_ssd: standard SSD.
  • ephemeral_ssd: local SSD.
  • cloud_essd: Enhanced SSD.
DataDisk.N.DeleteWithInstance Boolean No true

Specifies whether data disk N is to be released with its attached instance. Valid values of N: 1 to 16. Valid values:

  • true: releases the data disk with its attached instance.
  • false: retains the data disk when the attached instance is released.

This parameter is valid only for independently created disks, whose DataDisk.N.Category parameter is set to cloud, cloud_efficiency, or cloud_ssd. An error will be returned if you set this parameter for other disks.

DataDisk.N.Description String No FinanceDept

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.Device String No /dev/xvdb

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

DataDisk.N.DiskName String No cloud_ssdData

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

DataDisk.N.Encrypted String No false

Specifies whether data disk N is to be encrypted. Valid values of N: 1 to 16. Valid values:

  • true: encrypted
  • false: not encrypted
DataDisk.N.KMSKeyId String No 0e478b7a-4262-4802-b8cb-00d3fb40826X

The CMK ID for data disk N. Valid values of N: 1 to 16.

DataDisk.N.Size Integer No 100

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

  • cloud: 5 to 2000
  • cloud_efficiency: 20 to 32768
  • cloud_ssd: 20 to 32768
  • ephemeral_ssd: 5 to 800

If this parameter is specified, the data disk size 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 used to create data disk N. Valid values of N: 1 to 16. After this parameter is specified, the DataDisk.N.Size parameter is ignored. The size of the specified snapshot equals the size of the created data disk.

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

DeploymentSetId String No ds-bp13v7bjnj9gis****

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

HostName String No Joshu****

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

  • Windows instances: The name must be 2 to 15 characters in length. It can contain uppercase or lowercase letters, digits, and hyphens (-). It cannot contain periods (.) or contain only digits.
  • Other instances such as Linux instances: The name must be 2 to 64 characters in length. It can be segments separated by periods (.). Each segment can contain uppercase or lowercase letters, digits, and hyphens (-).
HpcClusterId String No hpc-clusterid

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

ImageId String No centos6u5_64_20G_aliaegis_20140703.vhd

The ID of the image file that you specified when you create the instance.

ImageName String No suse11sp3_64_20G_aliaegis_20150428.vhd

The name of the image file. Image names must be unique within a region. This parameter is ignored if ImageId is specified.

Marketplace images cannot be specified by the ImageName parameter.

InstanceDescription String No FinaceDept

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

InstanceName String No Joshu****

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

InstanceTypes.N RepeatList No ecs.t1.xsmall

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

N represents the priority of the instance type in the scaling configuration. A lower value of N indicates a higher priority. Auto Scaling creates instances in order of priority. If an instance of the highest priority type cannot be created, Auto Scaling will create an instance of the next highest priority type.

InternetChargeType String No PayByBandwidth

The bandwidth billing method of created instances. Valid values:

  • PayByBandwidth: Users pay for the maximum available bandwidth specified by the InternetMaxBandwidthOut parameter.
  • PayByTraffic: Users pay for the actual traffic used. The InternetMaxBandwidthOut parameter only specifies the upper limit of available bandwidth when this parameter is specified.
InternetMaxBandwidthOut Integer No 50

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

  • If InternetChargeType is set to PayByBandwidth and this parameter is not specified, this parameter is automatically set to 0.
  • If InternetChargeType is set to PayByTraffic and this parameter is not specified, an error is returned.
IoOptimized String No none

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

  • none
  • optimized
KeyPairName String No null

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

  • Ignore this parameter if you are creating an ECS Windows instance. The default value is null.
  • By default, the username and password authentication method is disabled for ECS Linux instances.
LoadBalancerWeight Integer No 50

The weight of the backend server. Valid values: 0 to 100.

Memory Integer No 16

The amount of memory.

You can specify the number of vCPUs and the amount of memory to define the range of instance types. For example, to specify instance types that have 2 vCPUs and 16 GiB memory, set the value of Cpu to 2 and the value of Memory to 16. Auto Scaling uses the properties of instances such as its storage I/O performance and zone to determine a set of available instances types. Auto Scaling then creates instances of the type that is the most cost-effective out of the available types.

Note This instance type range takes effect only when cost optimization is enabled and the scaling configuration does not have a specified instance type.
Override Boolean No true

Specifies whether to overwrite the existing data. Valid values:

  • true
  • false
PasswordInherit Boolean No false

Specifies whether to use the preconfigured password of the specified image. To use this parameter, ensure that a password is configured for the specified image.

RamRoleName String No RamRoleTest

The name of the RAM role associated with an ECS instance. This name is provided and maintained by RAM. You can call the ListRoles operation to query the list of RAM role names. For more information about how to create a RAM role, see CreateRole.

ResourceGroupId String No abcd1234abcd****

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

ScalingConfigurationName String No test-modify

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

The name of the scaling configuration must be unique within a scaling group. If this parameter is not specified, the value of ScalingConfigurationId is used.

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.

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

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

Note You cannot specify SecurityGroupId and SecurityGroupIds.N at the same time.
SpotPriceLimit.N.InstanceType String No ecs.t1.small

The instance type of preemptible instance N. Valid values of N: 1 to 10. This parameter takes effect only when the SpotStrategy parameter is set 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 takes effect only when the SpotStrategy parameter is set to SpotWithPriceLimit.

SpotStrategy String No NoSpot

The preemption strategy to be applied to pay-as-you-go instances. Valid values:

  • NoSpot: a pay-as-you-go instance
  • SpotWithPriceLimit: a preemptible instance with a maximum hourly price
  • SpotAsPriceGo: an instance that is billed based on the actual market price
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
  • ephemeral_ssd: local SSD
  • cloud_essd: Enhanced SSD
SystemDisk.Description String No FinanceDept

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

SystemDisk.DiskName String No cloud_ssdSystem

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

SystemDisk.Size Integer No 50

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

  • cloud: 40 to 500
  • cloud_efficiency: 40 to 500
  • cloud_ssd: 40 to 500
  • ephemeral_ssd: 40 to 500

The specified value must be greater than or equal to max{40, ImageSize}.

Tags String No "key1":"value1"

The tag of the ECS instance. Tags must be specified as key-value pairs. A maximum of five tags can be specified. The following rules apply to keys and values:

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

The user data of the ECS instance. It must be encoded in Base64 format. The maximum size of the raw data is 16 KB.

Response parameters

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

The ID of the request.

Examples

Sample requests


http(s)://[Endpoint]/? Action=ModifyScalingConfiguration
&ScalingConfigurationId=asc-****
&<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 more information about error codes, visit API Error Center.

HTTP status code

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 has exceeded the maximum size of the specified disk category.

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 name of 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 that does not support the RamRoleName parameter.

400

InvalidParamter

The specified value of parameter is not valid.

The error message returned because the specified parameter value 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 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 VSwitch are not in the same VPC.

400

InvalidTags.KeyValue

The specified tags key/value cannot be empty.

The error message returned because the Tags parameter is not specified.

400

InvalidTags.ListSize

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

The error message returned because the length of the Tags list has exceeded the upper limit.

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 format.

400

InvalidUserData.SizeExceeded

The specified parameter UserData exceeds the size.

The error message returned because the user data size has exceeded 16 KB.