CreateAutoProvisioningGroup

更新时间:
复制 MD 格式

Create an auto provisioning group.

Operation description

  • Auto provisioning is a solution that uses spot instances and pay-as-you-go instances to quickly deploy instance clusters. It supports one-click deployment of instance clusters across billing methods, zones, and instance families. For more information, see Use the auto provisioning group API to create multiple ECS instances.

  • Auto provisioning schedules and maintains compute resources through provisioning groups. Use auto provisioning groups to provide stable computing power and mitigate instability caused by the spot instance reclamation mechanism.

  • Auto provisioning is a free feature. You pay only for the instance resources created through the auto provisioning group. For more information, see Spot instance billing and Pay-as-you-go.

  • When you specify both a launch template (LaunchTemplateId) and launch configuration parameters (LaunchConfiguration.*), the system prioritizes the launch template.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

ecs:CreateAutoProvisioningGroup

create

*All Resource

*

None
  • ram:CreateServiceLinkedRole

Request parameters

Parameter

Type

Required

Description

Example

RegionId

string

Yes

The region ID of the auto provisioning group. Call DescribeRegions to view the latest Alibaba Cloud region list.

cn-hangzhou

ResourceGroupId

string

No

The resource group ID of the auto provisioning group.

rg-bp67acfmxazb4p****

AutoProvisioningGroupName

string

No

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

apg-test

AutoProvisioningGroupType

string

No

The delivery type of the auto provisioning group. Valid values:

  • request: One-time asynchronous delivery. The group delivers the instance cluster only at startup. If scheduling fails, no retry occurs.

  • instant: One-time synchronous delivery. The group creates instances synchronously at startup and returns the list of successfully created instances and reasons for failures in the response.

  • maintain: Continuous provisioning. The group attempts to deliver the instance cluster at startup and monitors real-time capacity. If the target capacity is not met, it continues creating ECS instances.

Default value: maintain.

maintain

SpotAllocationStrategy

string

No

The strategy for creating spot instances. Valid values:

  • lowest-price: Cost optimization strategy. Selects the instance type with the lowest price.

  • diversified: Balanced zone distribution strategy. Creates instances across the zones specified in the launch template configurations and distributes them evenly.

  • capacity-optimized: Capacity optimization strategy. Selects the optimal instance type and zone based on inventory availability.

Default value: lowest-price.

diversified

SpotInstanceInterruptionBehavior

string

No

The behavior when a spot instance is interrupted. Valid values:

  • stop: Stops the instance.

  • terminate: Releases the instance.

Default value: terminate.

terminate

SpotInstancePoolsToUseCount

integer

No

Takes effect only when SpotAllocationStrategy is set to lowest-price. Specifies the number of lowest-priced instance types from which the auto provisioning group creates instances.

Valid values: Less than the value of N in LaunchTemplateConfig.N.

2

PayAsYouGoAllocationStrategy

string

No

The strategy for creating pay-as-you-go instances. Valid values:

  • lowest-price: Cost optimization strategy. Selects the instance type with the lowest price.

  • prioritized: Priority-based strategy. Creates instances based on the priority specified in LaunchTemplateConfig.N.Priority.

Default value: lowest-price.

prioritized

ExcessCapacityTerminationPolicy

string

No

Specifies whether to release instances when the real-time capacity of the auto provisioning group exceeds the target capacity and scale-in is triggered. Valid values:

  • termination: Releases scaled-in instances.

  • no-termination: Only removes scaled-in instances from the auto provisioning group.

Default value: no-termination.

termination

ValidFrom

string

No

The start time of the auto provisioning group. Used together with ValidUntil to define the validity period.

Specify the time in ISO 8601 format using UTC+0 time. Format: yyyy-MM-ddTHH:mm:ssZ.

Default value: The timestamp when the API call takes effect immediately.

2019-04-01T15:10:20Z

ValidUntil

string

No

The expiration time of the auto provisioning group. Used together with ValidFrom to define the validity period.

Specify the time in ISO 8601 format using UTC+0 time. Format: yyyy-MM-ddTHH:mm:ssZ.

Default value: 2099-12-31T23:59:59Z.

2019-06-01T15:10:20Z

TerminateInstancesWithExpiration

boolean

No

Specifies whether to release instances in the group when the auto provisioning group expires. Valid values:

  • true: Releases instances in the group.

  • false: Only removes instances from the auto provisioning group.

Default value: false.

true

TerminateInstances

boolean

No

Specifies whether to release instances in the group when you delete the auto provisioning group. Valid values:

  • true: Releases instances in the group.

  • false: Retains instances in the group.

Default value: false.

true

MaxSpotPrice

number

No

The maximum price for spot instances in the auto provisioning group.

Note

If both MaxSpotPrice and LaunchTemplateConfig.N.MaxPrice are set, the lower value takes effect.

2

TotalTargetCapacity

string

Yes

The total target capacity of the auto provisioning group. Valid values: Positive integers.

The total capacity must be greater than or equal to the sum of PayAsYouGoTargetCapacity (target capacity for pay-as-you-go instances) and SpotTargetCapacity (target capacity for spot instances).

60

PayAsYouGoTargetCapacity

string

No

The target capacity for pay-as-you-go instances in the auto provisioning group. Valid values: Integers less than or equal to the value of TotalTargetCapacity.

30

SpotTargetCapacity

string

No

The target capacity for spot instances in the auto provisioning group. Valid values: Integers less than or equal to the value of TotalTargetCapacity.

20

DefaultTargetCapacityType

string

No

Specifies the billing method for the capacity difference when the sum of PayAsYouGoTargetCapacity and SpotTargetCapacity is less than TotalTargetCapacity. Valid values:

  • PayAsYouGo: Pay-as-you-go instances.

  • Spot: Spot instances.

Default value: Spot.

Spot

LaunchTemplateId

string

No

The ID of the launch template associated with the auto provisioning group. Call DescribeLaunchTemplates to query available launch templates. When both a launch template and launch configuration parameters (LaunchConfiguration.*) are specified, the launch template takes precedence.

lt-bp1fgzds4bdogu03****

LaunchTemplateVersion

string

No

The version of the launch template associated with the auto provisioning group. Call DescribeLaunchTemplateVersions to query available launch template versions.

Default value: The default version of the launch template.

1

Description

string

No

The description of the auto provisioning group.

testDescription

ClientToken

string

No

Ensures request idempotence. Generate a unique value from your client for this parameter to ensure uniqueness across different requests. ClientToken supports only ASCII characters and cannot exceed 64 characters. For more information, see How to ensure idempotence.

0c593ea1-3bea-11e9-b96b-88e9fe637760

LaunchConfiguration.ImageId

string

No

The image ID. This is the image used when launching instances. Call DescribeImages to query available images. When both a launch template and launch configuration parameters are specified, the launch template takes precedence.

m-bp1g7004ksh0oeuc****

LaunchConfiguration.SecurityGroupId

string

No

The security group ID of the instance. When both a launch template and launch configuration parameters are specified, the launch template takes precedence.

sg-bp15ed6xe1yxeycg****

LaunchConfiguration.IoOptimized

string

No

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

  • none: Not I/O optimized.

  • optimized: I/O optimized.

For retired instance types, the default value is none. For other instance types, the default value is optimized.

When both a launch template and launch configuration parameters are specified, the launch template takes precedence.

optimized

LaunchConfiguration.InternetChargeType

string

No

The network billing type. Valid values:

  • PayByBandwidth: Pay-by-bandwidth.

  • PayByTraffic: Pay-by-traffic.

Note

For pay-by-traffic, inbound and outbound bandwidth peaks represent upper limits and are not service-level commitments. Bandwidth may be throttled during resource contention. Use pay-by-bandwidth if your workload requires guaranteed bandwidth.

When both a launch template and launch configuration parameters are specified, the launch template takes precedence.

PayByTraffic

LaunchConfiguration.InternetMaxBandwidthIn

integer

No

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

  • When outbound public bandwidth is ≤ 10 Mbit/s: 1–10. Default: 10.

  • When outbound public bandwidth is > 10 Mbit/s: 1–LaunchConfiguration.InternetMaxBandwidthOut. Default: LaunchConfiguration.InternetMaxBandwidthOut.

When both a launch template and launch configuration parameters are specified, the launch template takes precedence.

10

LaunchConfiguration.InternetMaxBandwidthOut

integer

No

The maximum outbound public bandwidth, in Mbit/s. Valid values: 0–100.

Default value: 0.

When both a launch template and launch configuration parameters are specified, the launch template takes precedence.

10

LaunchConfiguration.InstanceName

string

No

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

Default value: The instance InstanceId.

To create multiple ECS instances, you can batch configure sequential instance names. For more information, see Batch configure sequential instance names or hostnames.

When both a launch template and launch configuration parameters are specified, the launch template takes precedence.

k8s-node-[1,4]-alibabacloud

LaunchConfiguration.HostName

string

No

The hostname of the instance. Requirements:

  • Periods (.) and hyphens (-) cannot be the first or last character and cannot appear consecutively.

  • Windows instances: 2–15 characters. Periods (.) are not supported. Cannot consist of only digits. Can contain letters, digits, and hyphens (-).

  • Other instances (such as Linux): 2–64 characters. Multiple periods (.) are supported. Each segment between periods can contain letters, digits, and hyphens (-).

  • Do not set both LaunchConfiguration.HostName and LaunchConfiguration.HostNames.N. Otherwise, an error is returned.

  • When both a launch template and launch configuration parameters are specified, the launch template takes precedence.

k8s-node-[1,4]-ecshost

LaunchConfiguration.InstanceDescription

string

No

The instance description. The description must be 2 to 256 characters in length and cannot start with http:// or https://. When both a launch template and launch configuration parameters are specified, the launch template takes precedence.

Instance_Description

LaunchConfiguration.KeyPairName

string

No

The key pair name.

  • For Windows instances, this parameter is ignored. Default value: empty.

  • For Linux instances, password logon is disabled after initialization.

When both a launch template and launch configuration parameters are specified, the launch template takes precedence.

KeyPair_Name

LaunchConfiguration.RamRoleName

string

No

The RAM role name of the instance. Use the RAM API ListRoles to query your created RAM roles. When both a launch template and launch configuration parameters are specified, the launch template takes precedence.

RAM_Name

LaunchConfiguration.SecurityEnhancementStrategy

string

No

Specifies whether to enable security hardening. Valid values:

  • Active: Enables security hardening. Applies only to public images.

  • Deactive: Disables security hardening. Applies to all image types.

When both a launch template and launch configuration parameters are specified, the launch template takes precedence.

Active

LaunchConfiguration.UserData

string

No

The instance user data. Encode the data in Base64. The raw data cannot exceed 32 KB. When both a launch template and launch configuration parameters are specified, the launch template takes precedence.

ZWNobyBoZWxsbyBlY3Mh

LaunchConfiguration.SystemDiskCategory

string

No

The category of the system disk. Valid values:

  • cloud_efficiency: Ultra disk.

  • cloud_ssd: Standard SSD.

  • cloud_essd: ESSD.

  • cloud: Basic disk.

For retired instance types that are not I/O optimized, the default value is cloud. Otherwise, the default value is cloud_efficiency.

When both a launch template and launch configuration parameters are specified, the launch template takes precedence.

cloud_ssd

LaunchConfiguration.SystemDiskSize

integer

No

The size of the system disk, in GiB. Valid values: 20–500. The value must be greater than or equal to max{20, size of the image specified by LaunchConfiguration.ImageId}.

Default value: max{40, size of the image specified by LaunchConfiguration.ImageId}.

When both a launch template and launch configuration parameters are specified, the launch template takes precedence.

40

LaunchConfiguration.SystemDiskName

string

No

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

Default value: empty.

When both a launch template and launch configuration parameters are specified, the launch template takes precedence.

cloud_ssdSystem

LaunchConfiguration.SystemDiskDescription

string

No

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

When both a launch template and launch configuration parameters are specified, the launch template takes precedence.

SystemDisk_Description

LaunchConfiguration.SystemDiskPerformanceLevel

string

No

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

  • PL0 (default): 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.

For more information about selecting ESSD performance levels, see ESSD.

When both a launch template and launch configuration parameters are specified, the launch template takes precedence.

PL0

LaunchConfiguration.PasswordInherit

boolean

No

Specifies whether to use the password preset in the image. Valid values:

  • true: Uses the preset password.

  • false: Does not use the preset password.

When both a launch template and launch configuration parameters are specified, the launch template takes precedence.

true

LaunchConfiguration.ResourceGroupId

string

No

The resource group ID of the instance. When both a launch template and launch configuration parameters are specified, the launch template takes precedence.

rg-bp67acfmxazb4p****

LaunchConfiguration.CreditSpecification

string

No

The running mode of burstable instances. Valid values:

Default value: None.

When both a launch template and launch configuration parameters are specified, the launch template takes precedence.

Standard

LaunchConfiguration.Password

string

No

The instance password. The password must be 8 to 30 characters in length and include at least three of the following: uppercase letters, lowercase letters, digits, and special characters. Valid special characters:

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

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

When both a launch template and launch configuration parameters are specified, the launch template takes precedence.

EcsV587!

LaunchConfiguration.DeploymentSetId

string

No

The deployment set ID.

ds-bp1frxuzdg87zh4p****

LaunchTemplateConfig

array<object>

No

The list of extended launch template configurations.

object

No

Extended launch template configuration.

VSwitchId

string

No

The ID of the virtual switch to which the ECS instance belongs in the extended launch template. The zone of the ECS instance launched from this template is determined by the virtual switch.

Note

After LaunchTemplateConfig is set, LaunchTemplateConfig.N.VSwitchId is required.

vsw-sn5bsitu4lfzgc5o7****

MaxPrice

number

No

The maximum hourly price for spot instances in the extended launch template.

Note

After LaunchTemplateConfig is set, LaunchTemplateConfig.N.MaxPrice is required.

3

Priority

integer

No

The priority of the extended launch template. A value of 0 indicates the highest priority. Valid values: 0 to +∞.

1

InstanceType

string

No

The instance type corresponding to the extended launch template. N ranges from 1 to 20. For more information, see Instance families.

ecs.g5.large

WeightedCapacity

number

No

The weight of the instance type in the extended launch template. A higher value indicates greater computing power per instance and fewer instances needed. Valid values: Greater than 0.

You can calculate the weight based on the computing power of the specified instance type and the minimum computing power required per node in the cluster. For example, if the minimum computing power per node is 8 vCPUs and 60 GiB memory:

  • An instance type with 8 vCPUs and 60 GiB memory can have a weight of 1.

  • An instance type with 16 vCPUs and 120 GiB memory can have a weight of 2.

2

MaxQuantity

integer

No

Note

This parameter is in invitational preview and is not supported.

false

Cores

array

No

The list of vCPU counts for instance types.

integer

No

The vCPU count of the instance type, used to filter eligible instance types. For more information, see Instance families. N ranges from 1 to 10.

2

Memories

array

No

The list of memory sizes for instance types.

number

No

The memory size of the instance type, in GiB, used to filter eligible instance types. For more information, see Instance families. N ranges from 1 to 10.

4

InstanceFamilyLevel

string

No

The instance family level, used to filter eligible instance types. Valid values:

  • EntryLevel: Entry-level, or shared-resource instances. Lower cost but no guaranteed stable computing performance. Suitable for workloads with low average CPU usage. For more information, see Shared-resource instances.

  • EnterpriseLevel: Enterprise-level. Stable performance with dedicated resources. Suitable for workloads requiring high stability. For more information, see Instance families.

  • CreditEntryLevel: Credit entry-level, or burstable instances. Uses CPU credits to guarantee computing performance. Suitable for workloads with low average CPU usage and occasional bursts. For more information, see Burstable instances.

N ranges from 1 to 10.

EnterpriseLevel

ExcludedInstanceTypes

array

No

The list of instance types to exclude.

string

No

The instance type to exclude. 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 in the c6 family.

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

Architectures

array

No

The list of architecture types for instance types.

string

No

The architecture type of the instance type. Valid values:

  • X86: X86 computing.

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

  • BareMental: ECS Bare Metal Instance.

  • Arm: Arm computing.

  • SuperComputeCluster: Super Computing Cluster.

Default value: Includes all architecture types.

X86

BurstablePerformance

string

No

Specifies whether the instance type supports performance bursts. Valid values:

  • Exclude: Excludes burstable instance types.

  • Include: Includes burstable instance types.

  • Required: Includes only burstable instance types.

Default value: Include.

Include

ImageId

string

No

The image ID. Use this parameter to specify the image for the current resource pool. If not set, the image specified in LaunchConfiguration.ImageId or the launch template is used by default. Call DescribeImages to query available images. Note: This parameter is supported only when AutoProvisioningGroupType = instant.

aliyun_3_x64_20G_alibase_20210425.vhd

LaunchConfiguration.DataDisk

array<object>

No

The list of data disk configurations for the extended launch template.

object

No

Data disk configuration for the extended launch template.

PerformanceLevel

string

No

The performance level of the ESSD used as a data disk. The value of N must match the N in LaunchConfiguration.DataDisk.N.Category. Valid values:

  • PL0: Up to 10,000 random read/write IOPS per disk.

  • PL1 (default): 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.

For more information about selecting ESSD performance levels, see ESSD.

When both a launch template and launch configuration parameters are specified, the launch template takes precedence.

PL1

KmsKeyId

string

No

The KMS key ID for the data disk. When both a launch template and launch configuration parameters are specified, the launch template takes precedence.

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

Description

string

No

The description of the data disk. The description must be 2 to 256 characters in length and cannot start with http:// or https://. When both a launch template and launch configuration parameters are specified, the launch template takes precedence.

DataDisk_Description

SnapshotId

string

No

The snapshot used to create data disk N. N ranges from 1 to 16.

After this parameter is specified, LaunchConfiguration.DataDisk.N.Size is ignored. The actual disk size equals the size of the specified snapshot. Snapshots created on or before July 15, 2013 are not supported and will cause the request to fail.

When both a launch template and launch configuration parameters are specified, the launch template takes precedence.

s-bp17441ohwka0yuh****

Size

integer

No

The size of data disk N, in GiB. N ranges from 1 to 16. Valid values:

  • cloud_efficiency: 20–32768.

  • cloud_ssd: 20–32768.

  • cloud_essd: The valid range depends on the value of LaunchConfiguration.DataDisk.N.PerformanceLevel.
    • PL0: 40–32768.

    • PL1: 20–32768.

    • PL2: 461–32768.

    • PL3: 1261–32768

  • cloud: 5–2000.

Note

The value must be greater than or equal to the size of the snapshot specified by LaunchConfiguration.DataDisk.N.SnapshotId.

When both a launch template and launch configuration parameters are specified, the launch template takes precedence.

20

Device

string

No

The mount point of the data disk. When both a launch template and launch configuration parameters are specified, the launch template takes precedence.

/dev/vd1

DiskName

string

No

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

Default value: empty.

When both a launch template and launch configuration parameters are specified, the launch template takes precedence.

cloud_ssdData

Category

string

No

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

  • cloud_efficiency: Ultra disk.

  • cloud_ssd: Standard SSD.

  • cloud_essd: ESSD.

  • cloud: Basic disk.

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

When both a launch template and launch configuration parameters are specified, the launch template takes precedence.

cloud_ssd

DeleteWithInstance

boolean

No

Specifies whether to release the data disk when the instance is released. Valid values:

  • true: Releases the data disk with the instance.

  • false: Does not release the data disk with the instance.

Default value: true.

When both a launch template and launch configuration parameters are specified, the launch template takes precedence.

true

Encrypted

boolean

No

Specifies whether to encrypt data disk N. Valid values:

  • true: Encrypts the disk.

  • false: Does not encrypt the disk.

Default value: false.

When both a launch template and launch configuration parameters are specified, the launch template takes precedence.

false

EncryptAlgorithm

string

No

Note

This parameter is not yet available.

null

ProvisionedIops

integer

No

The provisioned read/write IOPS for ESSD AutoPL disks. Valid values: 0 to min{50,000, 1000 × capacity - baseline performance}.

Baseline performance = min{1,800 + 50 × capacity, 50,000}.

Note

This parameter is supported only when DiskCategory is set to cloud_auto. For more information, see ESSD AutoPL.

40000

BurstingEnabled

boolean

No

Specifies whether to enable performance burst. Valid values:

  • true: Enables performance burst.

  • false: Disables performance burst.

Note

This parameter is supported only when DiskCategory is set to cloud_auto. For more information, see ESSD AutoPL.

false

AutoSnapshotPolicyId

string

No

The automatic snapshot policy ID applied to the data disk.

Note:

  • This parameter takes effect only when creating an auto provisioning group with AutoProvisioningGroupType=instant.

sp-bp67acfmxazb4p****

LaunchConfiguration.Tag

array<object>

No

The list of tags for the extended launch template.

object

No

Tag information for the extended launch template.

Key

string

No

The tag key of the instance. N ranges from 1 to 20. If specified, the value cannot be an empty string. The key can be up to 128 characters in length and cannot start with aliyun or acs:. It also cannot contain http:// or https://. When both a launch template and launch configuration parameters are specified, the launch template takes precedence.

TestKey

Value

string

No

The tag value of the instance. N ranges from 1 to 20. If specified, the value can be an empty string. The value can be up to 128 characters in length and cannot start with acs:. It also cannot contain http:// or https://. When both a launch template and launch configuration parameters are specified, the launch template takes precedence.

TestValue

SystemDiskConfig

array<object>

No

The list of system disk configurations for instances.

object

No

System disk configuration for instances.

DiskCategory

string

No

The system disk type. You can specify multiple candidate disk types. The order specifies their priority. If one disk type is unavailable, the system automatically switches to the next type. Valid values:

  • cloud_efficiency: Ultra disk.

  • cloud_ssd: Standard SSD.

  • cloud_essd: ESSD.

  • cloud: Basic disk.

cloud_ssd

DataDiskConfig

array<object>

No

The list of data disk configurations for instances.

object

No

Data disk configuration for instances.

DiskCategory

string

No

The data disk type. You can specify multiple candidate disk types. The order specifies their priority. If one disk type is unavailable, the system automatically switches to the next type. Valid values:

  • cloud_efficiency: Ultra disk.

  • cloud_ssd: Standard SSD.

  • cloud_essd: ESSD.

  • cloud: Basic disk.

cloud_efficiency

LaunchConfiguration.HostNames

array

No

The list of hostnames for one or more instances. Requirements:

  • This parameter takes effect only when creating an auto provisioning group with AutoProvisioningGroupType=instant.

  • N indicates the number of instances. Valid values: 1 to 1000. The value must match TotalTargetCapacity.

  • Periods (.) and hyphens (-) cannot be the first or last character and cannot appear consecutively.

  • When both a launch template and launch configuration parameters are specified, the launch template takes precedence.

ecs-host-01

string

No

The hostname. Requirements:

  • Periods (.) and hyphens (-) cannot be the first or last character and cannot appear consecutively.

  • Windows instances: 2–15 characters. Periods (.) are not supported. Cannot consist of only digits. Can contain letters, digits, and hyphens (-).

  • Other instances (such as Linux): 2–64 characters. Multiple periods (.) are supported. Each segment between periods can contain letters, digits, and hyphens (-).

  • Do not set both LaunchConfiguration.HostName and LaunchConfiguration.HostNames.N. Otherwise, an error is returned.

ecs-host-01

MinTargetCapacity

string

No

The minimum target capacity of the auto provisioning group. Valid values: Positive integers.

Note:

  • This parameter takes effect only when creating an auto provisioning group with AutoProvisioningGroupType=instant.

  • If the instance inventory in the region is less than this value, the API call fails and no instances are created.

  • If the instance inventory in the region is greater than this value, instances are created based on other configured parameters.

20

LaunchConfiguration.SecurityGroupIds

array

No

The list of security groups to which the instance belongs.

string

No

The security group ID of the instance. When both a launch template and launch configuration parameters are specified, the launch template takes precedence.

sg-bp15ed6xe1yxeycg****

LaunchConfiguration.SystemDisk

object

No

System disk information for the instance. When both a launch template and launch configuration parameters are specified, the launch template takes precedence.

Encrypted

string

No

Specifies whether to encrypt system disk N. Valid values:

  • true: Encrypts the disk.

  • false: Does not encrypt the disk.

Default value: false.

When both a launch template and launch configuration parameters are specified, the launch template takes precedence.

false

KMSKeyId

string

No

The KMS key ID for the system disk.

When both a launch template and launch configuration parameters are specified, the launch template takes precedence.

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

EncryptAlgorithm

string

No

The encryption algorithm for the system disk. Valid values:

  • aes-256.

  • sm4-128.

Default value: aes-256.

When both a launch template and launch configuration parameters are specified, the launch template takes precedence.

Note

This parameter is not yet available.

aes-256

ProvisionedIops

integer

No

The provisioned read/write IOPS for ESSD AutoPL disks. Valid values: 0 to min{50,000, 1000 × capacity - baseline performance}.

Baseline performance = min{1,800 + 50 × capacity, 50,000}.

Note

This parameter is supported only when SystemDisk.Category is set to cloud_auto. For more information, see ESSD AutoPL.

40000

BurstingEnabled

boolean

No

Specifies whether to enable performance burst. Valid values:

  • true: Enables performance burst.

  • false: Disables performance burst.

Note

This parameter is supported only when SystemDisk.Category is set to cloud_auto. For more information, see ESSD AutoPL.

false

AutoSnapshotPolicyId

string

No

The automatic snapshot policy ID applied to the system disk.

Note:

  • This parameter takes effect only when creating an auto provisioning group with AutoProvisioningGroupType=instant.

sp-bp67acfmxazb4p****

LaunchConfiguration.Arn

array<object>

No

Note

This parameter is in invitational preview and is not supported.

object

No

Note

This parameter is in invitational preview and is not supported.

Rolearn

string

No

Note

This parameter is in invitational preview and is not supported.

acs:ram::123456789012****:role/adminrole

RoleType

string

No

Note

This parameter is in invitational preview and is not supported.

34458433936495****:alice

AssumeRoleFor

integer

No

Note

This parameter is in invitational preview and is not supported.

123456789012****

HibernationOptionsConfigured

boolean

No

Note

This parameter is in invitational preview and is not yet available.

false

LaunchConfiguration.AutoReleaseTime

string

No

The automatic release time for pay-as-you-go instances. Specify the time in ISO 8601 format using UTC+0 time. Format: yyyy-MM-ddTHH:mm:ssZ.

  • If seconds (ss) are not 00, the time is rounded down to the start of the current minute (mm).

  • The earliest release time is 30 minutes after the current time.

  • The latest release time cannot exceed three years from the current time.

2018-01-01T12:05:00Z

LaunchConfiguration.ImageFamily

string

No

The image family name. The name must be 2 to 128 characters in length and can contain letters, digits, colons (:), underscores (_), and hyphens (-). It must start with a letter and cannot start with aliyun or acs:. It also cannot contain http:// or https://.

hangzhou-daily-update

Tag

array<object>

No

The list of tags bound to the auto provisioning group.

object

No

Tags bound to the auto provisioning group.

Key

string

No

The tag key of the auto provisioning group.

N ranges from 1 to 20. If specified, the value cannot be an empty string. The key can be up to 128 characters in length and cannot start with aliyun or acs:. It also cannot contain http:// or https://.

TestKey

Value

string

No

The tag value of the auto provisioning group.

N ranges from 1 to 20. If specified, the value can be an empty string. The value can be up to 128 characters in length and cannot contain http:// or https://.

TestValue

ResourcePoolOptions

object

No

The resource pool strategy used when creating instances. Note:

  • This parameter takes effect only when creating pay-as-you-go instances.

  • This parameter takes effect only when creating an auto provisioning group with AutoProvisioningGroupType=instant.

Strategy

string

No

Resource pools include private pools generated by Elastic Guaranteed or Capacity Reservation services, and public pools. Instances select from these pools at startup. Valid values:

  • PrivatePoolFirst: Private pools first. With this strategy, if ResourcePoolOptions.PrivatePoolIds is specified, the specified private pools are prioritized. If no private pool is specified or the specified private pools lack capacity, open private pools are automatically matched. If no eligible private pools exist, instances are created from the public pool.

  • PrivatePoolOnly: Private pools only. With this strategy, you must specify ResourcePoolOptions.PrivatePoolIds. If the specified private pools lack capacity, instance startup fails.

  • PublicPoolOnly: Use the public pool to create instances.

Default value: PublicPoolOnly.

PrivatePoolFirst

PrivatePoolIds

array

No

The list of private pool IDs. Valid values: 1 to 20.

string

No

The private pool ID. This is the Elastic Guaranteed service ID or Capacity Reservation service ID. This parameter accepts only Target-mode private pool IDs.

eap-bp67acfmxazb4****

LaunchConfiguration

object

No

Launch configuration parameters.

Period

integer

No

The subscription duration. The unit is specified by PeriodUnit. Required when creating subscription instances. Valid values:

  • When PeriodUnit=Week, Period values: 1, 2, 3, 4.

  • When PeriodUnit=Month, Period values: 1, 2, 3, 4, 5, 6, 7, 8, 9, 12, 24, 36, 48, 60.

1

PeriodUnit

string

No

The time unit for subscription billing. Valid values:

  • Week.

  • Month (default).

Month

AutoRenew

boolean

No

Specifies whether to enable auto-renewal. Takes effect when creating subscription instances. Valid values:

  • true: Enables auto-renewal.

  • false (default): Disables auto-renewal.

true

AutoRenewPeriod

integer

No

The auto-renewal duration per cycle. Valid values:

  • When PeriodUnit=Week: 1, 2, 3.

  • When PeriodUnit=Month: 1, 2, 3, 6, 12, 24, 36, 48, 60.

Default value: 1.

1

SpotDuration

integer

No

The reserved duration for spot instances, in hours. Default value: 1. Valid values:

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

  • 0: Alibaba Cloud does not guarantee that the instance runs for 1 hour. The system immediately compares your bid price with the market price and checks inventory to decide whether to retain or reclaim the instance.

Alibaba Cloud sends an ECS system event notification 5 minutes before reclaiming a spot instance. Spot instances are billed per second. Choose the reserved duration based on your task execution time.

Note:

  • This parameter takes effect only when creating an auto provisioning group with AutoProvisioningGroupType=instant.

1

SpotInterruptionBehavior

string

No

The interruption behavior for spot instances. Valid values:

  • Terminate: Releases the instance immediately.

  • Stop: Puts the instance into economical mode.

For more information about economical mode, see Economical mode.

Default value: Terminate.

Note:

  • This parameter takes effect only when creating an auto provisioning group with AutoProvisioningGroupType=instant.

Terminate

ImageOptions

object

No

Image-related properties.

Note:

  • This parameter takes effect only when creating an auto provisioning group with AutoProvisioningGroupType=instant.

LoginAsNonRoot

boolean

No

Specifies whether instances using this image support logging on as the ecs-user. Valid values:

  • true: Supported.

  • false: Not supported.

false

SchedulerOptions

object

No

DedicatedHostId

string

No

DedicatedHostClusterId

string

No

SecurityOptions

object

No

TrustedSystemMode

string

No

CpuOptions

object

No

CPU configuration.

Core

integer

No

The number of CPU cores.

Default value: See Customize CPU options.

2

ThreadsPerCore

integer

No

The number of CPU threads. The vCPU count of an ECS instance equals CpuOptions.Core × CpuOptions.ThreadsPerCore.

CpuOptions.ThreadsPerCore=1 disables CPU hyper-threading.

Only specific instance types support setting the number of CPU threads.

Valid values and default values: See Customize CPU options.

2

PrePaidOptions

object

No

Detailed capacity configuration for subscription instances.

SpecifyCapacityDistribution

array<object>

No

The minimum capacity set for different instance types. This parameter is supported only when AutoProvisioningGroupType = request.

object

No

The minimum capacity for instance types.

InstanceTypes

array

No

The set of instance types. Duplicates are not allowed, and the types must be within the range of LaunchTemplateConfig.InstanceType.

string

No

The instance type.

ecs.c6.large

MinTargetCapacity

integer

No

The minimum number of instances to deliver within the InstanceTypes range.

Note

sum(MinTargetCapacity)<= TotalTargetCapacity. The sum of MinTargetCapacity across all instance type sets cannot exceed TotalTargetCapacity. If any instance type set fails to meet its MinTargetCapacity due to inventory issues, the entire request fails.

5

ExecutionMode

string

No

Response elements

Element

Type

Description

Example

object

AutoProvisioningGroupId

string

The ID of the auto provisioning group.

apg-sn54avj8htgvtyh8****

RequestId

string

The request ID.

745CEC9F-0DD7-4451-9FE7-8B752F39****

LaunchResults

object

LaunchResult

array<object>

The collection of instances created by the auto provisioning group. This collection is returned only when the delivery type of the auto provisioning group is instant (one-time synchronous delivery).

array<object>

Information about instances created by the auto provisioning group.

ZoneId

string

The zone ID of the instance.

cn-hangzhou-g

ErrorMsg

string

The error message returned when instance creation fails.

Specific parameter is not valid.

InstanceType

string

The instance type.

ecs.g5.large

ErrorCode

string

The error code returned when instance creation fails.

InvalidParameter

SpotStrategy

string

The spot strategy for pay-as-you-go instances. Valid values:

  • NoSpot: Standard pay-as-you-go instance.

  • SpotWithPriceLimit: Spot instance with a maximum price limit.

  • SpotAsPriceGo: System automatically bids based on the current market price.

NoSpot

Amount

integer

The number of instances in the successfully created instance ID list.

1

InstanceIds

object

InstanceId

array

The list of successfully created instance IDs.

string

The list of successfully created instance IDs.

["i-bp67acfmxazb4p****"]

CandidateEvaluateLevel

string

Low

Examples

Success response

JSON format

{
  "AutoProvisioningGroupId": "apg-sn54avj8htgvtyh8****",
  "RequestId": "745CEC9F-0DD7-4451-9FE7-8B752F39****",
  "LaunchResults": {
    "LaunchResult": [
      {
        "ZoneId": "cn-hangzhou-g",
        "ErrorMsg": "Specific parameter is not valid.",
        "InstanceType": "ecs.g5.large",
        "ErrorCode": "InvalidParameter",
        "SpotStrategy": "NoSpot",
        "Amount": 1,
        "InstanceIds": {
          "InstanceId": [
            "[\"i-bp67acfmxazb4p****\"]"
          ]
        },
        "CandidateEvaluateLevel": "Low"
      }
    ]
  }
}

Error codes

HTTP status code

Error code

Error message

Description

400 InvalidParameter %s The specified parameter is invalid.
400 InvalidAutoProvisioningGroupName.Malformed The specified parameter "AutoProvisioningGroupName" is not valid. The specified elastic provisioning group name AutoProvisioningGroupName is invalid.
400 InvalidAutoProvisioningGroupType.ValueNotSupported The specified parameter "AutoProvisioningGroupType" is not supported.
400 InvalidFleetExcessCapacityTerminationPolicy.ValueNotSupported The specified parameter "ExcessCapacityTerminationPolicy" is not supported.
400 InvalidDefaultTargetCapacityType.ValueNotSupported The specified parameter "DefaultTargetCapacityType" is not supported.
400 InvalidSpotAllocationStrategy.ValueNotSupported The specified parameter "SpotAllocationStrategy" is not supported.
400 InvalidSpotInstanceInterruptionBehavior.ValueNotSupported The specified parameter "SpotInstanceInterruptionBehavior" is not supported.
400 InvalidPayAsYouGoAllocationStrategy.ValueNotSupported The specified parameter "PayAsYouGoAllocationStrategy" is not supported.
400 MissingParameter.SpotAllocationStrategy The specified parameter "SpotAllocationStrategy" is empty.
400 MissingParameter.LaunchTemplateConfigs The specified parameter "LaunchTemplateConfigs" is empty. The specified LaunchTemplateConfigs parameter is empty
400 InvalidValidTime.MalFormed The specified parameter "ValidTime" is not supported.
400 InvalidLaunchTemplateVersion.ValueNotSupported The specified parameter "LaunchTemplateVersion" is not valid.
400 MissingParameter The specified parameter "AutoProvisioningGroup" should not be null.
400 InvalidRegion.ValueNotSupported The specified Region does not exist.
400 InvalidDescription.ValueNotSupported The specified description is illegal.
400 InvalidLaunchTemplate.ValueNotSupported The SecurityGroupId or imageId in LaunchTemplate is not exists. The security group ID or image ID in the launch template does not exist.
400 InvalidCapacity.ValueNotSupported The Capacity is illegal, or the TargetCapacity is large than SpotCapacity + PayAsYouGoCapacity.
400 InvalidInstanceType.ValueNotSupported The instanceType is illegal.
400 InternalError The request processing has failed due to some unknown error. An internal error has occurred. Try again later.
400 InvalidLaunchTemplateConfigs.SizeExceed The size of LaunchTemplateConfigs exceeds limit. The number of LaunchTemplateConfig in the elastic supply group exceeds the limit.
400 InvalidParameter.SpotInstancePoolsToUseCount The specified parameter "SpotInstancePoolsToUseCount" is not valid.
400 InvalidParameter.ResourceGroupId The specified parameter "ResourceGroupId" is not valid.
400 InvalidParameter.TargetCapacity The Capacity is illegal, TotalTargetCapacity, PayAsYouGoTargetCapacity, SpotTargetCapacity must be specified, meanwhile, the TargetCapacity must be larger than or equal to the sum of SpotCapacity and OnDemandCapacity.
400 MissingParameter.WeightedCapacity The WeightedCapacity of LaunchTemplateConfig should not be empty.
400 InvalidParameter.WeightedCapacityBeyondRange The WeightedCaTpacity of LaunchTemplateConfig beyond permitted range.
400 InvalidParameter.MaxPrice The specified parameter "MaxSpotPrice" or "MaxPrice" of LaunchTemplateConfig is not valid.
400 NoPermission %s
400 Duplicate.DiskCategory The specified disk configs contains duplicate DiskCategory.
400 InvalidImageFamily.Confict The specified parameter ImageFamily should be empty when the parameter ImageId is specified. The specified parameter ImageFamily should be empty when the parameter ImageId is specified.
400 Invalid.ResourcePoolOptions.PrivatePoolIds The zone or instancetype of the ResourcePoolOptions.PrivatePoolIds does not match the LaunchTemplateConfig. The zone or instancetype of the ResourcePoolOptions.PrivatePoolIds does not match the LaunchTemplateConfig.
400 Invalid.ResourcePoolOptions.Strategy The specified ResourcePoolOptions.Strategy is invalid. The specified ResourcePoolOptions.Strategy is invalid.
400 Invalid.ResourcePoolOptionsPrivatePoolIds.SizeExceed The size of ResourcePoolOptions.PrivatePoolIds exceeds limit. The size of ResourcePoolOptions.PrivatePoolIds exceeds limit.
400 MissingParameter.ResourcePoolOptions.PrivatePoolIds The specified ResourcePoolOptions.PrivatePoolIds should not be null when ResourcePoolOptions.Strategy is PrivatePoolOnly. The specified ResourcePoolOptions.PrivatePoolIds should not be null when ResourcePoolOptions.Strategy is PrivatePoolOnly.
400 InvalidSpotDuration The specified SpotDuration is not valid. The specified SpotDuration parameter is invalid.
400 InvalidSpotInterruptionBehavior %s The specified SpotInterruptionBehavior parameter is not supported.
400 InvalidParameter.SecurityGroupIdRepeated The SecurityGroupId is repeated. Duplicate security group.
400 VpcMismatch.SecurityGroupAndVSwitch Specified security group and virtual switch are not in the same VPC. The specified security group is not in the same VPC as the VSwitch.
400 InvalidMinTargetCapacity.NotSatisfied The inventory of specified InstanceType does not meet the MinTargetCapacity. The inventory of specified InstanceType does not meet the MinTargetCapacity.
400 InvalidParameterRange.MinTargetCapacity The MinTargetCapacity exceeds the limit[0-TotalTargetCapacity].
400 InvalidUserData.Base64FormatInvalid The specified parameter UserData must be base64 encoded. The specified parameter UserData must be base64-encoded.
400 InvalidUserData.SizeExceeded The specified parameter UserData exceeds the size. The size of user data specified by the UserData parameter exceeds the upper limit.
400 InvalidAutoReleaseTime.Malformed The specified parameter AutoReleaseTime is not valid. The specified automatic release time AutoReleaseTime is invalid.
400 QuotaExceeded.AutoProvisioningGroup The count of AutoProvisioningGroup exceeds the limit. The count of AutoProvisioningGroup exceeds the limit.
500 InternalError The request processing has failed due to some unknown error.
403 TotalTargetCapacityLimitExceed The TotalTargetCapacity exceeds the limit[0-2000]. The TotalTargetCapacity value exceeds the limit [0~2000].
403 SpotTargetCapacityLimitExceed The SpotTargetCapacity exceeds the limit[0-2000]. SpotTargetCapacity exceeds limit [0-2000].
403 PayAsYouGoTargetCapacityLimitExceed The PayAsYouGoTargetCapacity exceeds the limit[0-2000]. PayAsYouGoTargetCapacity capacity exceeds limit [0~2000].
403 OperationDenied.NoStock The resource is out of stock in the specified zone. Please try other types, or choose other regions and zones. The requested resources are unavailable in the specified zone. Try a different resource type or select a different region or zone.
403 CandidateDenied.NoStock The resource is out of stock and there are no candidate resources in the specified zone. Please try other types, or choose other regions and zones. The resources of the current instance type have been sold out and there are no candidate resources in the near future. Please select another instance type or zone as required.
404 InvalidResourcePoolOptionsPrivatePoolIds.NotFound The ResourcePoolOptions.PrivatePoolIds do not exist. The ResourcePoolOptions.PrivatePoolIds do not exist.
404 InvalidSecurityGroupId.NotFound The SecurityGroupId %s provided does not exist in our records. The security group provided does not exist.
404 InvalidVSwitchId.NotFound The specified virtual switch %s does not exist. The specified switch does not exist.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.