All Products
Search
Document Center

Elastic Compute Service:ModifyAutoProvisioningGroup

Last Updated:Apr 11, 2024

Modifies the configurations of an auto-provisioning group.

Operation description

Before you call this operation, take note of the following items:

  • If you modify the capacity or capacity-related settings of an auto-provisioning group, the group executes a scheduling task after the group is modified.
  • You cannot modify an auto-provisioning group when the group is being deleted.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

There is currently no authorization information disclosed in the API.

Request parameters

ParameterTypeRequiredDescriptionExample
RegionIdstringYes

The region ID of the auto-provisioning group. You can call the DescribeRegions operation to query the most recent region list.

cn-hangzhou
AutoProvisioningGroupIdstringNo

The auto-provisioning group ID.

apg-bp67acfmxazb4ph****
ExcessCapacityTerminationPolicystringNo

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

  • termination: releases the removed instances.
  • no-termination: removes the instances from the auto-provisioning group but does not release them.
no-termination
DefaultTargetCapacityTypestringNo

The type of supplemental instances. When the sum of the PayAsYouGoTargetCapacity and SpotTargetCapacity values is smaller than the TotalTargetCapacity value, the auto-provisioning group creates instances of the specified type to meet the target capacity. Valid values:

  • PayAsYouGo: pay-as-you-go instances
  • Spot: preemptible instances
Spot
TerminateInstancesWithExpirationbooleanNo

Specifies whether to release instances that are located in the auto-provisioning group after the group expires. Valid values:

  • true: releases instances that are located in the auto-provisioning group.
  • false: removes instances from the auto-provisioning group but does not release them.
false
MaxSpotPricefloatNo

The maximum price of preemptible instances in the auto-provisioning group.

Note When both the MaxSpotPrice and LaunchTemplateConfig.N.MaxPrice parameters are specified, the smaller one of the two parameter values is used. The LaunchTemplateConfig.N.MaxPrice parameter is specified when the auto-provisioning group is created, and cannot be modified.
0.5
TotalTargetCapacitystringNo

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 the PayAsYouGoTargetCapacity parameter as well as the target capacity of preemptible instances specified by the SpotTargetCapacity parameter.

70
PayAsYouGoTargetCapacitystringNo

The target capacity of pay-as-you-go instances in the auto-provisioning group. Valid values: Set this parameter to a value smaller than the TotalTargetCapacity value.

30
SpotTargetCapacitystringNo

The target capacity of preemptible instances in the auto-provisioning group. Valid values: Set this parameter to a value smaller than the TotalTargetCapacity value.

30
AutoProvisioningGroupNamestringNo

The name of the auto-provisioning group. The name 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 (-).

apg-test
LaunchTemplateConfigobject []No

The extended configurations of the launch template.

VSwitchIdstringNo

The ID of the vSwitch in extended configuration N. The zone of the instances created from the extended configuration is determined by the vSwitch.

vsw-sn5bsitu4lfzgc5o7****
MaxPricedoubleNo

The maximum price of preemptible instances in extended configuration N.

3
PriorityintegerNo

The priority of extended configuration N. A value of 0 indicates the highest priority. The value must be greater than 0.

1
InstanceTypestringNo

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 Instance families.

ecs.g5.large
WeightedCapacitydoubleNo

The weight of the instance type specified in the extended configuration. 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 instance type and the minimum computing power of a single instance in the cluster that can 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.

  • For an instance type with 8 vCPUs and 60 GiB of memory, you can set the weight to 1.
  • For an instance type with 16 vCPUs and 120 GiB of memory, you can set the weight to 2.
2

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The request ID.

B48A12CD-1295-4A38-A8F0-0E92C937****

Examples

Sample success responses

JSONformat

{
  "RequestId": "B48A12CD-1295-4A38-A8F0-0E92C937****"
}

Error codes

HTTP status codeError codeError messageDescription
400MissingParameterThe specified parameter "AutoProvisioningGroupId" should not be null.-
400MissingParameterThe specified parameter "AutoProvisioningGroupConfig" should not be null.-
400NoPermission%s-
400InvalidLaunchTemplateConfigs.SizeExceedThe size of LaunchTemplateConfigs exceeds limit.-
400QuotaExceed.LaunchTemplateConfigs%s-
400OperationDenied%sThe operation is denied.
403Forbidden.RAMUser not authorized to operate on the specified resource, or this API doesn't support RAM.-
403InvalidName.MalformedThe specified parameter "AutoProvisioningGroupName" is not valid.-
403AutoProvisioningGroup.UnauthorizedUnauthorized to operate current action.-
403AutoProvisioningGroup.IncorrectStatusCurrent status of AutoProvisioningGroup does not support curren action.-
403InvalidParameter.TargetCapacityThe 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.-
404InvalidAutoProvisioningGroupId.NotFoundThe specified AutoProvisioningGroupId does not exist.-
404InvalidParameter.MaxPriceThe specified parameter "MaxSpotPrice" is not valid.-

For a list of error codes, visit the Service error codes.