You can call this operation to create an auto provisioning group.
Description
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 one-click deployment of instance clusters with specified billing methods, zones, and instance families.
Auto Provisioning uses auto provisioning groups to schedule and maintain computing resources. You can use auto provisioning groups to provide stable computing power. This alleviates the instability problem caused by reclaiming preemptible instances.
Auto Provisioning is free to use. However, you are charged for instance resources created in auto provisioning groups. For more information about billing, see Preemptible instance and Pay-as-you-go.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | CreateAutoProvisioningGroup |
The operation that you want to perform. Set the value to CreateAutoProvisioningGroup. |
LaunchTemplateId | String | Yes | lt-bp1fgzds4bdogu03**** |
The ID of the instance launch template associated with the auto provisioning group. You can call the DescribeLaunchTemplates operation to query available instance launch templates. |
RegionId | String | Yes | cn-hangzhou |
The region ID of the auto provisioning group. You can call the DescribeRegions operation to query the most recent region list. |
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 at least the sum
of the target capacity of pay-as-you-go instances specified by the |
ResourceGroupId | String | No | rg-bp67acfmxazb4p**** |
The ID of the resource group to which to add 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 and can contain letters, digits, colons (:), underscores (_), and hyphens (-). It must start with a letter and cannot start with http:// or https://. |
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 action to take on the excess preemptible instances after the instances are stopped. Valid values:
Default value: stop. |
SpotInstancePoolsToUseCount | Integer | No | 2 |
The number of preemptible instances of the lowest-priced instance type that Auto Provisioning
creates. This parameter takes effect when the The parameter value must be less than N specified in the |
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 stop excess preemptible instances when the target capacity of the auto provisioning group is exceeded. Valid values:
Default value: no-termination. |
ValidFrom | String | No | 2019-04-01T15:10:20Z |
The time when to start the auto provisioning group. The period of time between this
point in time and the point in time specified by the Specify 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 immediately started after it is created. |
ValidUntil | String | No | 2019-06-01T15:10:20Z |
The time when the auto provisioning group expires. The period of time between this
point in time and the point in time specified by the Specify 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 immediately started after it is created. |
TerminateInstancesWithExpiration | Boolean | No | true |
Specifies whether to stop preemptible instances 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. Default value: false. |
MaxSpotPrice | Float | No | 2 |
The maximum price of preemptible instances in the auto provisioning group. Note When the
MaxSpotPrice and LaunchTemplateConfig.N.MaxPrice parameters are both specified, the maximum price is the lower value of the two parameters.
|
PayAsYouGoTargetCapacity | String | No | 30 |
The target capacity of pay-as-you-go instances in the auto provisioning group. Valid
values: The value of this parameter must be smaller than that of |
SpotTargetCapacity | String | No | 20 |
The target capacity of preemptible instances in the auto provisioning group. Valid
values: The value of this parameter must be smaller than that of |
DefaultTargetCapacityType | String | No | Spot |
Specifies the billing method of the capacity difference when the sum of the values
of the
Default value: Spot. |
LaunchTemplateVersion | String | No | 1 |
The version of the instance launch template associated with the auto provisioning group. You can call the DescribeLaunchTemplateVersions operation to query the versions of available instance launch templates. Default value: the default version of the instance launch template. |
LaunchTemplateConfig.N.InstanceType | String | No | ecs.g5.large |
The instance type of extended configuration N. Valid values of N: 1 to 20. For more information about valid values of this parameter, see Instance families. |
LaunchTemplateConfig.N.MaxPrice | Double | No | 3 |
The maximum price of preemptible instances in extended configuration N. Note If you specify the
LaunchTemplateConfig parameter, you must also specify the LaunchTemplateConfig.N.MaxPrice parameter.
|
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 configurations is determined by the VSwitch. Note If you specify the
LaunchTemplateConfig parameter, you must also specify the LaunchTemplateConfig.N.VSwitchId parameter.
|
LaunchTemplateConfig.N.WeightedCapacity | Double | No | 2 |
The weight of the instance type specified in extended configuration N. A greater weight indicates that a single instance has more computing power, and as a result fewer instances are required. The value of this parameter 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 node of the cluster. For example, if the minimum computing power of a single node is 8 vCPUs and 60 GiB:
|
LaunchTemplateConfig.N.Priority | Integer | No | 1 |
The priority of extended configuration N. A value of 0 indicates the highest priority. Valid values: 0 to ∞. |
Description | String | No | testDescription |
The description of the auto provisioning group. |
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. |
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
<CreateAutoProvisioningGroupResponse>
<CreateAutoProvisioningGroupId>apg-sn54avj8htgvtyh8****</CreateAutoProvisioningGroupId>
<RequestId>745CEC9F-0DD7-4451-9FE7-8B752F39****</RequestId>
</CreateAutoProvisioningGroupResponse>
JSON
format
{
"CreateAutoProvisioningGroupId": "apg-sn54avj8htgvtyh8****",
"RequestId": "745CEC9F-0DD7-4451-9FE7-8B752F39****"
}
Error codes
HTTP status code | Error code | Error message | Description |
---|---|---|---|
400 | InvalidFleetExcessCapacityTerminationPolicy.ValueNotSupported | The specified parameter "ExcessCapacityTerminationPolicy" is not supported. | The error message returned because the specified ExcessCapacityTerminationPolicy parameter is invalid. |
500 | InternalError | The request processing has failed due to some unknown error. | The error message returned because an internal error has occurred. Try again later. If the problem persists, submit a ticket. |
For a list of error codes, visit the API Error Center.