Modifies the attributes of the private pool of an instance.

Description

A private pool is generated after an elasticity assurance or a capacity reservation is created. The private pool is associated with information about instances that are created by using the private pool. You can configure whether to use a private pool when you create an ECS instance, so that the instance can match the elasticity assurance or capacity reservation.

  • After you call this operation to modify the attributes of the private pool for an instance, you do not need to restart the instance.
  • When you call the following operations, the system rematches the instance with private pools. If the instance already matches a specified private pool, the call to the operation may fail because the private pool capacity is used up or because the private pool is invalid. If the call fails, call the ModifyInstanceAttachmentAttributes operation to change the match mode of the private pool to Open.
    • StartInstance
    • ReActivateInstances
    • ModifyInstanceChargeType
    • ModifyPrepayInstanceSpec
    • ReplaceSystemDisk

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes ModifyInstanceAttachmentAttributes

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

RegionId String Yes cn-hangzhou

The region ID of the private pool. You can call the DescribeRegions operation to query the most recent list of regions.

InstanceId String Yes i-bp67acfmxazb4****

The ID of the instance for which you want to modify the attributes of the private pool.

PrivatePoolOptions.MatchCriteria String Yes Open

The match mode of the private pool. Valid values:

  • Open: open private pool. The system matches the instance with open private pools.
  • Target: specified private pool. You must set the PrivatePoolOptions.Id parameter to specify the ID of a private pool.
  • None: no private pool. The instance starts without using private pools.
PrivatePoolOptions.Id String No eap-bp67acfmxazb4****

The ID of the private pool. Set the value to the ID of the elasticity assurance or capacity reservation that generates the private pool.

  • This parameter is required when PrivatePoolOptions.MatchCriteria is set to Target.
  • This parameter must be empty when PrivatePoolOptions.MatchCriteria is set to Open or None.

Response parameters

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

The ID of the request.

Examples

Sample requests

https://ecs.aliyuncs.com/?Action=ModifyInstanceAttachmentAttributes
&RegionId=cn-hangzhou
&InstanceId=i-bp67acfmxazb4****
&PrivatePoolOptions.MatchCriteria=Open
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<ModifyInstanceAttachmentAttributesResponse>
    <RequestId>473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E</RequestId>
</ModifyInstanceAttachmentAttributesResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "RequestId" : "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E"
}

Error codes

HttpCode Error code Error message Description
400 MissingParameter.RegionId The specified RegionId should not be null. The error message returned because the required RegionId parameter is not specified.
400 DedicatedHostNotSupported DedicatedHost is not supported for PrivatePool. The error message returned because private pools cannot be used to create instances on dedicated hosts.
400 SpotNotSupported Spot is not supported for PrivatePool. The error message returned because private pools cannot be used to create preemptible instances.
400 ClassicNetworkNotSupported Classic network is not supported for PrivatePool. The error message returned because private pools cannot be used to create instances of the classic network type.
400 Invalid.InstanceId Instance does not exist. The error message returned because the specified instance does not exist.
400 Invalid.PrivatePoolOptions.MatchCriteria Target mode does not support this operation. The error message returned because the operation is not supported while the PrivatePoolOptions.MatchCriteria parameter is set to Target.
400 MissingParameter.PrivatePoolOptions.Id The specified PrivatePoolOptions.Id should not be null. The error message returned because the PrivatePoolOptions.Id parameter is not specified.
400 Invalid.PrivatePoolOptions.Id The PrivatePool does not exist. The error message returned because the private pool does not exist.
400 Invalid.InstanceType The InstanceType does not match the PrivatePool. The error message returned because the specified instance type does not match the specified private pool.
400 Invalid.InstanceChargeType The InstanceChargeType does not match the PrivatePool. The error message returned because the specified billing method of the instance does not match the specified private pool.
400 Invalid.ZoneId The ZoneId does not match the PrivatePool. The error message returned because the specified zone does not match the specified private pool.
400 Invalid.PrivatePoolOptions.MatchCriteria The PrivatePoolOptions.MatchCriteria does not match the PrivatePool. The error message returned because the specified PrivatePoolOptions.MatchCriteria parameter does not match the private pool.
400 InvalidPlatform.ValueNotSupported The Platform does not match the PrivatePool. The error message returned because the specified Platform parameter does not match the private pool.
400 InvalidAliUid The PrivatePool does not belong to the user of the Instance. The error message returned because the specified private pool does not belong to the user who attempted to create the instance.
400 Invalid.InstanceId The Instance dose not attached to a PrivatePool. The error message returned because the instance does not match the private pool.
400 Invalid.TooManyPrivatePoolOptions.Ids Too many PrivatePoolOptions.Ids in this request. The error message returned because the number of specified elasticity assurance IDs exceeds the upper limit.
400 Invalid.TooManyZoneIds Too many ZoneIds in the request. The error message returned because the number of specified zone IDs exceeds the upper limit.
400 Invalid.TooManyInstanceTypes Too many InstanceTypes in the request. The error message returned because the number of specified instance types exceeds the upper limit.
400 Invalid.TooManyUnpaidPrivatePool Too many PrivatePools create but still unpaid. The error message returned because multiple private pools are created but not paid.
400 Invalid.InstanceCpuCoreCountOrInstanceAmount Both InstanceCpuCoreCount and InstanceAmount are provided. The error message returned because the InstanceCpuCoreCount and InstanceAmount parameters cannot be specified at the same time.
400 Invalid.PrivatePool.Purchase The PrivatePool has already paid. The error message returned because the private pool is already paid.
400 Invalid.AssuranceTimes.NotSupported The value of AssuranceTimes is not supported. The error message returned because the specified AssuranceTimes parameter is invalid.
400 RepeatStartPrivatePool PrivatePool has already been started. The error message returned because the private pool is already started.
500 InternalError The request processing has failed due to some unknown error, exception or failure. The error message returned because an internal error has occurred. Try again later.

For a list of error codes, see Service error codes.