Creates an auto provisioning group.
Usage notes
- Auto Provisioning is a service that allows quick deployment of an instance cluster that consists of preemptible and pay-as-you-go instances. Auto Provisioning supports push-button deployment of instance clusters across different billing methods, instance families, and zones. For more information, see Use auto provisioning group-related API operations to create multiple Elastic Compute Service (ECS) instances at the same time.
- Auto Provisioning uses auto provisioning groups to schedule and maintain computing resources. You can use auto provisioning groups to obtain a steady supply of computing resources. This helps reduce the impact on compute capacity when preemptible instances are reclaimed.
- Auto Provisioning is provided free-of-charge. However, you are charged for instance resources that are created in auto provisioning groups. For more information, see Overview of preemptible instances and Pay-as-you-go.
- When you specify both a launch template (
LaunchTemplateId
) and extended configurations (LaunchConfiguration.*
parameters), LaunchTemplateId takes precedence.
Debugging
Request parameters
Parameter |
Type |
Required |
Example |
Description |
Action | String | Yes | CreateAutoProvisioningGroup | The operation that you want to perform. Set the value to CreateAutoProvisioningGroup. |
RegionId | String | Yes | cn-hangzhou | The ID of the region in which to create the auto provisioning group. You can call the DescribeRegions operation to query the most recent region list. |
ResourceGroupId | String | No | rg-bp67acfmxazb4p**** | The ID of the resource group to which to assign the auto provisioning group. |
AutoProvisioningGroupName | String | No | apg-test | The name of the auto provisioning group. The name must be 2 to 128 characters in length. The name must start with a letter and cannot start with |
AutoProvisioningGroupType | String | No | maintain | The delivery type of the auto provisioning group. Valid values:
Default value: maintain. |
SpotAllocationStrategy | String | No | diversified | The policy for creating preemptible instances. Valid values:
Default value: lowest-price. |
SpotInstanceInterruptionBehavior | String | No | terminate | The operation to be performed on the preemptible instance when it is interrupted. Valid values:
Default value: terminate. |
SpotInstancePoolsToUseCount | Integer | No | 2 | The number of preemptible instances of the lowest-priced instance type to be created by the auto provisioning group. This parameter takes effect when The value must be less than the N value specified in |
PayAsYouGoAllocationStrategy | String | No | prioritized | The policy for creating pay-as-you-go instances. Valid values:
Default value: lowest-price. |
ExcessCapacityTerminationPolicy | String | No | termination | Specifies whether to release scaled-in instances when the real-time capacity of the auto provisioning group exceeds the target capacity and the group is triggered to scale in. Valid values:
Default value: no-termination. |
ValidFrom | String | No | 2019-04-01T15:10:20Z | The time at which to start the auto provisioning group. The period of time between this point in time and the point in time specified by Specifies the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC. By default, an auto provisioning group is started immediately after it is created. |
ValidUntil | String | No | 2019-06-01T15:10:20Z | The time at which the auto provisioning group expires. The period of time between this point in time and the point in time specified by Specifies the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC. Default value: 2099-12-31T23:59:59Z. |
TerminateInstancesWithExpiration | Boolean | No | true | Specifies whether to release instances in the auto provisioning group when the auto provisioning group expires. Valid values:
Default value: false. |
TerminateInstances | Boolean | No | true | Specifies whether to release instances in the auto provisioning group when the auto provisioning group is deleted. Valid values:
Default value: false. |
MaxSpotPrice | Float | No | 2 | The maximum price of preemptible instances in the auto provisioning group. Note When both MaxSpotPrice and LaunchTemplateConfig.N.MaxPrice are specified, the smaller one of the two parameter values is used. |
TotalTargetCapacity | String | Yes | 60 | The total target capacity of the auto provisioning group. The value must be a positive integer. The total target capacity of the auto provisioning group must be greater than or equal to the sum of the target capacity of pay-as-you-go instances specified by |
PayAsYouGoTargetCapacity | String | No | 30 | The target capacity of pay-as-you-go instances in the auto provisioning group. The value must be less than or requal to the |
SpotTargetCapacity | String | No | 20 | The target capacity of preemptible instances in the auto provisioning group. The value must be less than or requal to the |
DefaultTargetCapacityType | String | No | Spot | The billing method of supplemental instances. When the sum of the
Default value: Spot. |
LaunchTemplateId | String | No | lt-bp1fgzds4bdogu03**** | The ID of the launch template associated with the auto provisioning group. You can call the DescribeLaunchTemplates operation to query available launch templates. When both LaunchTemplateId and |
LaunchTemplateVersion | String | No | 1 | The version of the launch template associated with the auto provisioning group. You can call the DescribeLaunchTemplateVersions operation to query the versions of available launch templates. Default value: the default version of the launch template. |
Description | String | No | testDescription | The description of the auto provisioning group. |
ClientToken | String | No | 0c593ea1-3bea-11e9-b96b-88e9fe637760 | The client token that is used to ensure the idempotence of the request. You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length. For more information, see How to ensure idempotence. |
LaunchConfiguration.ImageId | String | No | m-bp1g7004ksh0oeuc**** | The ID of the image to use to create the instance. You can call the DescribeImages operation to query available image resources. When both LaunchTemplateId and LaunchConfiguration.* parameters are specified, LaunchTemplateId takes precedence. |
LaunchConfiguration.SecurityGroupId | String | No | sg-bp15ed6xe1yxeycg**** | The ID of the security group to which to assign the instance. When both LaunchTemplateId and LaunchConfiguration.* parameters are specified, LaunchTemplateId takes precedence. |
LaunchConfiguration.IoOptimized | String | No | optimized | Specifies whether the instance is I/O optimized. Valid values:
For instances of retired instance types, the default value is none. For instances of other instance types, the default value is optimized. When both LaunchTemplateId and LaunchConfiguration.* parameters are specified, LaunchTemplateId takes precedence. |
LaunchConfiguration.InternetChargeType | String | No | PayByTraffic | The billing method for network usage. Valid values:
Note When the pay-by-traffic billing method for network usage is used, the maximum inbound and outbound bandwidth values are used as the upper limits of bandwidth instead of guaranteed performance specifications. In scenarios where demand outstrips resource supplies, the maximum bandwidth values may be limited. If you want guaranteed bandwidth for your instance, use the pay-by-bandwidth billing method. When both LaunchTemplateId and LaunchConfiguration.* parameters are specified, LaunchTemplateId takes precedence. |
LaunchConfiguration.InternetMaxBandwidthIn | Integer | No | 10 | The maximum inbound public bandwidth. Unit: Mbit/s. Valid values:
When both LaunchTemplateId and LaunchConfiguration.* parameters are specified, LaunchTemplateId takes precedence. |
LaunchConfiguration.InternetMaxBandwidthOut | Integer | No | 10 | The maximum outbound public bandwidth. Unit: Mbit/s. Valid values: 0 to 100. Default value: 0. When both LaunchTemplateId and LaunchConfiguration.* parameters are specified, LaunchTemplateId takes precedence. |
LaunchConfiguration.InstanceName | String | No | k8s-node-[1,4]-alibabacloud | The name of the instance. The name must be 2 to 128 characters in length. The name must start with a letter and cannot start with The default value of this parameter is the When you batch create instances, you can batch configure sequential names for the instances. For more information, see Batch configure sequential names or hostnames for multiple instances. When both LaunchTemplateId and LaunchConfiguration.* parameters are specified, LaunchTemplateId takes precedence. |
LaunchConfiguration.HostName | String | No | k8s-node-[1,4]-ecshost | The instance hostname. Take note of the following items:
|
LaunchConfiguration.InstanceDescription | String | No | Instance_Description | The instance description. The description must be 2 to 256 characters in length. The description can contain letters and cannot start with |
LaunchConfiguration.KeyPairName | String | No | KeyPair_Name | The key pair name.
When both LaunchTemplateId and LaunchConfiguration.* parameters are specified, LaunchTemplateId takes precedence. |
LaunchConfiguration.RamRoleName | String | No | RAM_Name | The name of the instance Resource Access Management (RAM) role. You can call the ListRoles operation provided by RAM to query the instance RAM roles that you created. When both LaunchTemplateId and LaunchConfiguration.* parameters are specified, LaunchTemplateId takes precedence. |
LaunchConfiguration.SecurityEnhancementStrategy | String | No | Active | Specifies whether to enable security hardening. Valid values:
When both LaunchTemplateId and LaunchConfiguration.* parameters are specified, LaunchTemplateId takes precedence. |
LaunchConfiguration.UserData | String | No | ZWNobyBoZWxsbyBlY3Mh | The instance user data. The user data must be encoded in Base64. The raw data can be up to 16 KB in size. When both LaunchTemplateId and LaunchConfiguration.* parameters are specified, LaunchTemplateId takes precedence. |
LaunchConfiguration.SystemDiskCategory | String | No | cloud_ssd | The category of the system disk. Valid values:
For non-I/O optimized instances of retired instance types, the default value is cloud. For instances of other instance types, the default value is cloud_efficiency. When both LaunchTemplateId and LaunchConfiguration.* parameters are specified, LaunchTemplateId takes precedence. |
LaunchConfiguration.SystemDiskSize | Integer | No | 40 | The size of the system disk. Valid values: 20 to 500. Unit: GiB. The value must be at least 20 and greater than or equal to the size of the image specified by LaunchConfiguration.ImageId. Default value: 40 or the size of the image specified by LaunchConfiguration.ImageId, whichever is greater. When both LaunchTemplateId and LaunchConfiguration.* parameters are specified, LaunchTemplateId takes precedence. |
LaunchConfiguration.SystemDiskName | String | No | cloud_ssdSystem | The name of the system disk. The name must be 2 to 128 characters in length. The name must start with a letter and cannot start with This parameter is empty by default. When both LaunchTemplateId and LaunchConfiguration.* parameters are specified, LaunchTemplateId takes precedence. |
LaunchConfiguration.SystemDiskDescription | String | No | SystemDisk_Description | The description of the system disk. The description must be 2 to 256 characters in length. The description can contain letters and cannot start with When both LaunchTemplateId and LaunchConfiguration.* parameters are specified, LaunchTemplateId takes precedence. |
LaunchConfiguration.SystemDiskPerformanceLevel | String | No | PL0 | The performance level of the ESSD to use as the system disk. Valid values:
For more information about ESSD performance levels, see ESSDs. When both LaunchTemplateId and LaunchConfiguration.* parameters are specified, LaunchTemplateId takes precedence. |
LaunchConfiguration.PasswordInherit | Boolean | No | true | Specifies whether to use the password preset in the image. Valid values:
When both LaunchTemplateId and LaunchConfiguration.* parameters are specified, LaunchTemplateId takes precedence. |
LaunchConfiguration.ResourceGroupId | String | No | rg-bp67acfmxazb4p**** | The ID of the resource group to which to assign the instance. When both LaunchTemplateId and LaunchConfiguration.* parameters are specified, LaunchTemplateId takes precedence. |
LaunchConfiguration.CreditSpecification | String | No | Standard | The performance mode of the burstable instance. Valid values:
This parameter is empty by default. When both LaunchTemplateId and LaunchConfiguration.* parameters are specified, LaunchTemplateId takes precedence. |
LaunchConfiguration.Password | String | No | EcsV587! | The instance password. 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 password can contain the following special characters:
|
LaunchConfiguration.DeploymentSetId | String | No | ds-bp1frxuzdg87zh4p**** | The ID of the deployment set. |
LaunchTemplateConfig.N.VSwitchId | String | No | vsw-sn5bsitu4lfzgc5o7**** | The ID of the vSwitch in extended configuration N. The zone of the ECS instances created from the extended configuration is determined by the vSwitch. Note If you specify one or more other LaunchTemplateConfig.N.* parameters, you must also specify LaunchTemplateConfig.N.VSwitchId . |
LaunchTemplateConfig.N.MaxPrice | double | No | 3 | The maximum price of preemptible instances in extended configuration N. Note If you specify one or more other LaunchTemplateConfig.N.* parameters, you must also specify LaunchTemplateConfig.N.MaxPrice . |
LaunchTemplateConfig.N.Priority | Integer | No | 1 | The priority of extended configuration N. A value of 0 indicates the highest priority. Valid values: 0 to + ∞. |
LaunchTemplateConfig.N.InstanceType | String | No | ecs.g5.large | The instance type in extended configuration N. Valid values of N: 1 to 20. For more information about the valid values of this parameter, see Overview of instance families. |
LaunchTemplateConfig.N.WeightedCapacity | double | No | 2 | The weight of the instance type in extended configuration N. A greater weight indicates that a single instance has more computing power and fewer instances are required. The value must be greater than 0. The weight is calculated based on the computing power of the specified instance type and the minimum computing power of a single instance in the cluster to be created by the auto provisioning group. For example, assume that the minimum computing power of a single instance is 8 vCPUs and 60 GiB of memory.
|
LaunchTemplateConfig.N.MaxQuantity | Integer | No | false | Note This parameter is in invitational preview and is not publicly available. |
LaunchTemplateConfig.N.Cores.N | Integer | No | 2 | The number of vCPUs of the instance type in extended configuration N. This parameter is used to filter instance types. For more information, see Overview of instance families. Valid values of N: 1 to 10. |
LaunchTemplateConfig.N.Memories.N | Float | No | 4 | The memory size of the instance type in extended configuration N. Unit: GiB. This parameter is used to filter instance types. For more information, see Overview of instance families. Valid values of N: 1 to 10. |
LaunchTemplateConfig.N.InstanceFamilyLevel | String | No | EnterpriseLevel | The instance family level of the instance type in extended configuration N. This parameter is used to filter instance types. Valid values:
Valid values of N: 1 to 10. |
LaunchTemplateConfig.N.ExcludedInstanceTypes.N | String | No | ecs.n1.small/ecs.n1.*/*7* | Instance type N that you want to exclude in extended configuration N. You can use wildcard characters such as an asterisk (*) to exclude an instance type or an instance family. Examples:
|
LaunchTemplateConfig.N.Architectures.N | String | No | X86 | Architecture N of the instance type in extended configuration N. Valid values:
By default, all values are included. |
LaunchTemplateConfig.N.BurstablePerformance | String | No | Include | Specifies whether to include burstable instance types. Valid values:
Default value: Include. |
LaunchConfiguration.DataDisk.N.PerformanceLevel | String | No | PL1 | The performance level of the ESSD to use as data disk N. The value of N in this parameter must be the same as the value of N in
For more information about ESSD performance levels, see ESSDs. When both LaunchTemplateId and LaunchConfiguration.* parameters are specified, LaunchTemplateId takes precedence. |
LaunchConfiguration.DataDisk.N.KmsKeyId | String | No | 0e478b7a-4262-4802-b8cb-00d3fb40**** | The ID of the Key Management Service (KMS) key to use for data disk N. When both LaunchTemplateId and LaunchConfiguration.* parameters are specified, LaunchTemplateId takes precedence. |
LaunchConfiguration.DataDisk.N.Description | String | No | DataDisk_Description | The description of data disk N. The description must be 2 to 256 characters in length. The description can contain letters and cannot start with |
LaunchConfiguration.DataDisk.N.SnapshotId | String | No | s-bp17441ohwka0yuh**** | The ID of the snapshot to use to create data disk N. Valid values of N: 1 to 16. After this parameter is specified, When both LaunchTemplateId and LaunchConfiguration.* parameters are specified, LaunchTemplateId takes precedence. |
LaunchConfiguration.DataDisk.N.Size | Integer | No | 20 | The size of data disk N. Valid values of N: 1 to 16. Unit: GiB. Valid values:
Note The value of LaunchConfiguration.DataDisk.N.Size must be greater than or equal to the size of the snapshot specified by LaunchConfiguration.DataDisk.N.SnapshotId . When both LaunchTemplateId and LaunchConfiguration.* parameters are specified, LaunchTemplateId takes precedence. |
LaunchConfiguration.DataDisk.N.Device | String | No | /dev/vd1 | The mount point of data disk N. When both LaunchTemplateId and LaunchConfiguration.* parameters are specified, LaunchTemplateId takes precedence. |
LaunchConfiguration.DataDisk.N.DiskName | String | No | cloud_ssdData | The name of data disk N. The name must be 2 to 128 characters in length. The name must start with a letter and cannot start with This parameter is empty by default. When both LaunchTemplateId and LaunchConfiguration.* parameters are specified, LaunchTemplateId takes precedence. |
LaunchConfiguration.DataDisk.N.Category | String | No | cloud_ssd | The category of data disk N. Valid values of N: 1 to 16. Valid values:
For I/O optimized instances, the default value is cloud_efficiency. For non-I/O optimized instances, the default value is cloud. When both LaunchTemplateId and LaunchConfiguration.* parameters are specified, LaunchTemplateId takes precedence. |
LaunchConfiguration.DataDisk.N.DeleteWithInstance | Boolean | No | true | Specifies whether to release data disk N when its associated instance is released. Valid values:
Default value: true. When both LaunchTemplateId and LaunchConfiguration.* parameters are specified, LaunchTemplateId takes precedence. |
LaunchConfiguration.DataDisk.N.Encrypted | Boolean | No | false | Specifies whether to encrypt data disk N. Valid values:
Default value: false. When both LaunchTemplateId and LaunchConfiguration.* parameters are specified, LaunchTemplateId takes precedence. |
LaunchConfiguration.Tag.N.Key | String | No | TestKey | The key of tag N to add to the instance. Valid values of N: 1 to 20. The tag key cannot be an empty string. The tag key can be up to 128 characters in length and cannot start with acs: or aliyun. The tag key cannot contain |
LaunchConfiguration.Tag.N.Value | String | No | TestValue | The value of tag N to add to the instance. Valid values of N: 1 to 20. The tag value can be an empty string. The tag value can be up to 128 characters in length and cannot contain |
SystemDiskConfig.N.DiskCategory | String | No | cloud_ssd | The category of system disk N. You can use this parameter to specify multiple disk categories, and the disk categories are prioritized in the order in which they are specified. If a specified disk category is unavailable, the system uses the next available disk category. Valid values:
|
DataDiskConfig.N.DiskCategory | String | No | cloud_efficiency | The category of data disk N. You can use this parameter to specify multiple disk categories, and the disk categories are prioritized in the order in which they are specified. If a specified disk category is unavailable, the system uses the next available disk category. Valid values:
|
LaunchConfiguration.HostNames.N | String | No | ecs-host-01 | The hostname of instance N. You can use this parameter to specify different hostnames for multiple instances. Take note of the following items:
|
MinTargetCapacity | String | No | 20 | The minimum target capacity of the auto provisioning group. The value must be a positive integer. When you specify this parameter, take note of the following items:
|
LaunchConfiguration.SecurityGroupIds.N | String | No | sg-bp15ed6xe1yxeycg**** | The ID of security group N to which to assign the instance. When both LaunchTemplateId and LaunchConfiguration.* parameters are specified, LaunchTemplateId takes precedence. |
LaunchConfiguration.SystemDisk.Encrypted | String | No | false | Specifies whether to encrypt the system disk. Valid values:
Default value: false. When both LaunchTemplateId and LaunchConfiguration.* parameters are specified, LaunchTemplateId takes precedence. |
LaunchConfiguration.SystemDisk.KMSKeyId | String | No | 0e478b7a-4262-4802-b8cb-00d3fb40**** | The ID of the KMS key to use for the system disk. When both LaunchTemplateId and LaunchConfiguration.* parameters are specified, LaunchTemplateId takes precedence. |
LaunchConfiguration.SystemDisk.EncryptAlgorithm | String | No | aes-256 | The algorithm to use to encrypt the system disk. Valid values:
Default value: aes-256. When both LaunchTemplateId and LaunchConfiguration.* parameters are specified, LaunchTemplateId takes precedence. |
LaunchConfiguration.Arn.N.Rolearn | String | No | acs:ram::123456789012****:role/adminrole | This parameter is not publicly available. |
LaunchConfiguration.Arn.N.RoleType | String | No | 34458433936495****:alice | This parameter is not publicly available. |
LaunchConfiguration.Arn.N.AssumeRoleFor | Long | No | 123456789012**** | This parameter is not publicly available. |
HibernationOptionsConfigured | Boolean | No | false | Note This parameter is in invitational preview and is not publicly available. |
LaunchConfiguration.AutoReleaseTime | String | No | 2018-01-01T12:05:00Z | The time when to automatically release the pay-as-you-go instance. Specifies the time in the ISO 8601 standard in the
|
LaunchConfiguration.ImageFamily | String | No | hangzhou-daily-update | The name of the image family. The name must be 2 to 128 characters in length. The name must start with a letter and cannot start with |
Response parameters
Parameter |
Type |
Example |
Description |
AutoProvisioningGroupId | String | apg-sn54avj8htgvtyh8**** | The ID of the auto provisioning group. |
RequestId | String | 745CEC9F-0DD7-4451-9FE7-8B752F39**** | The ID of the request. |
LaunchResults | Array of LaunchResult | The instances created by the auto provisioning group. The values of parameters in this array are returned only when AutoProvisioningGroupType is set to |
|
LaunchResult | |||
ZoneId | String | cn-hangzhou-g | The zone ID of the instance. |
ErrorMsg | String | Specific parameter is not valid. | The error message returned when the instance cannot be created. |
InstanceType | String | ecs.g5.large | The instance type. |
ErrorCode | String | InvalidParameter | The error code returned when the instance cannot be created. |
SpotStrategy | String | NoSpot | The bidding policy for the pay-as-you-go instance. Valid values:
|
Amount | Integer | 1 | The number of created instances. |
InstanceIds | Array of String | ["i-bp67acfmxazb4p****"] | The IDs of created instances. |
Examples
Sample requests
http(s)://ecs.aliyuncs.com/?Action=CreateAutoProvisioningGroup
&LaunchTemplateId=lt-bp1fgzds4bdogu03****
&RegionId=cn-hangzhou
&TotalTargetCapacity=60
&SpotInstancePoolsToUseCount=2
&ExcessCapacityTerminationPolicy=termination
&TerminateInstancesWithExpiration=true
&TerminateInstances=false
&PayAsYouGoTargetCapacity=30
&SpotTargetCapacity=20
&DefaultTargetCapacityType=Spot
&LaunchTemplateConfig.1.InstanceType=ecs.g5.large
&LaunchTemplateConfig.1.MaxPrice=3
&LaunchTemplateConfig.1.VSwitchId=vsw-sn5bsitu4lfzgc5o7****
&LaunchTemplateConfig.1.WeightedCapacity=2
&LaunchTemplateConfig.1.Priority=1
&<Common request parameters>
Sample success responses
XML
format
HTTP/1.1 200 OK
Content-Type:application/xml
<CreateAutoProvisioningGroupResponse>
<AutoProvisioningGroupId>apg-sn54avj8htgvtyh8****</AutoProvisioningGroupId>
<RequestId>745CEC9F-0DD7-4451-9FE7-8B752F39****</RequestId>
</CreateAutoProvisioningGroupResponse>
JSON
format
HTTP/1.1 200 OK
Content-Type:application/json
{
"AutoProvisioningGroupId" : "apg-sn54avj8htgvtyh8****",
"RequestId" : "745CEC9F-0DD7-4451-9FE7-8B752F39****"
}
Error codes
HTTP status code |
Error code |
Error message |
Description |
400 | InvalidParameter | %s | Invalid parameter value. |
400 | InternalError | The request processing has failed due to some unknown error. | An internal error occurred. Try again later. |
400 | MissingParameter | %s | A required parameter is not specified. |
400 | InvalidVSwitchId.NotFound | %s | The specified vSwitch is not found. |
400 | InvalidImageFamily.Confict | The specified parameter ImageFamily should be empty when the parameter ImageId is specified. | ImageFamily must be left empty if an image ID is specified. |
For a list of error codes, see Service error codes.