Changes the instance type and public bandwidth of a pay-as-you-go instance.
Description
For information about how to use SDK for Python to change resource configurations, see Query available resources for configuration changes.
When you call this operation, take note of the following items:
- Make sure that you have no overdue payments in your account.
- You can adjust the public bandwidth of an instance only when the instance is in the Running or Stopped state.
- Before you change the instance type of a pay-as-you-go instance, call the DescribeResourcesModification operation to check for compatible instance types.
- You can change the instance type of an instance only when the instance is in the Stopped state.
- Each operation lets you change only one configuration at a time: the instance type or the public bandwidth.
- As of November 27, 2020, the total bandwidth available for all instances (new and modified) is subject to the throttling poiicy of your account. To increase the maximum bandwidth value, submit a ticket. The following throttling policies apply:
- Within a single region, the sum of actual peak bandwidths of all ECS instances that use the pay-by-traffic metering method for network usage cannot exceed 5 Gbit/s.
- Within a single region, the sum of actual peak bandwidths of all ECS instances that use the pay-by-bandwidth metering method for network usage cannot exceed 50 Gbit/s.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | ModifyInstanceSpec | The operation that you want to perform. Set the value to ModifyInstanceSpec. |
InstanceId | String | Yes | i-bp67acfmxazb4p**** | The ID of the instance. |
InstanceType | String | No | ecs.g6.large | The new instance type. For more information, see Instance families or call the DescribeInstanceTypes operation to query the most recent instance type list. |
InternetMaxBandwidthOut | Integer | No | 10 | The maximum outbound public bandwidth. Unit: Mbit/s. Valid values: 0 to 100. Note When the pay-by-traffic metering method is used, the maximum inbound and outbound bandwidth values are used as the upper limits for bandwidth instead of guaranteed performance specifications. In scenarios where demand outstrips available resources, the instance may not achieve these limits. If you want guaranteed bandwidth for your instance, we recommend that you use the pay-by-bandwidth metering method. |
InternetMaxBandwidthIn | Integer | No | 10 | The maximum inbound public bandwidth. Unit: Mbit/s. Valid values:
Note When the pay-by-traffic metering method is used, the maximum inbound and outbound bandwidth values are used as the upper limits for bandwidth instead of guaranteed performance specifications. In scenarios where demand outstrips available resources, the instance may not achieve these limits. If you want guaranteed bandwidth for your instance, we recommend that you use the pay-by-bandwidth metering method. |
Temporary.StartTime | String | No | hide | Note This parameter is in invitational preview and is unavailable for public use. |
Temporary.EndTime | String | No | hide | Note This parameter is in invitational preview and is unavailable for public use. |
Temporary.InternetMaxBandwidthOut | Integer | No | 0 | Note This parameter is in invitational preview and is unavailable for public use. |
Async | Boolean | No | false | Specifies whether to submit an asynchronous request. Default value: false. |
AllowMigrateAcrossZone | Boolean | No | false | Specifies whether to support cross-cluster instance type upgrades. Default value: false. When Instances of the classic network type:
Instances that reside in virtual private clouds (VPCs): For retired instance types, when a non-I/O-optimized instance is upgraded to an I/O-optimized instance, the disk device names and software authorization codes of the instance change. For more information, see Retired instance types. For Linux instances, device names of basic disks ( |
SystemDisk.Category | String | No | cloud_ssd | The new category of the system disk. This parameter is valid only when you upgrade an instance from a retired instance type to an available instance type or upgrade a non-I/O optimized instance to an I/O optimized instance. For more information, see Retired instance types and Instance families. Valid values:
|
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 a client token. Make sure that a unique client token is used for each request. The ClientToken value can contain only ASCII characters and cannot exceed 64 characters in length. For more information, see How to ensure idempotence. |
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=ModifyInstanceSpec
&InstanceId=i-bp67acfmxazb4p****
&InstanceType=ecs.g6.large
&InternetMaxBandwidthOut=10
&ClientToken=0c593ea1-3bea-11e9-b96b-88e9fe637760
&<Common request parameters>
Sample success response
XML
format
HTTP/1.1 200 OK
Content-Type:application/xml
<ModifyInstanceSpecResponse>
<RequestId>04F0F334-1335-436C-A1D7-6C044FE73368</RequestId>
</ModifyInstanceSpecResponse>
JSON
format
HTTP/1.1 200 OK
Content-Type:application/json
{
"RequestId" : "04F0F334-1335-436C-A1D7-6C044FE73368"
}
Error codes
HttpCode | Error code | Error message | Description |
---|---|---|---|
400 | InvalidInternetChargeType.ValueNotSupported | The specified InternetChargeType is not valid. | The error message returned because the specified InternetChargeType parameter is invalid. |
400 | InvalidInstanceType.ValueUnauthorized | The specified InstanceType does not exist or beyond the permitted range. | The error message returned because the specified instance type does not exist or because you are not authorized to manage instances of the specified instance type. |
400 | InvalidInstanceType.ValueUnauthorized | The specified InstanceType is not authorized. | The error message returned because you are not authorized to use the specified instance type. |
400 | InvalidInstanceType.ValueNotSupported | The specified InstanceType does not exist or beyond the permitted range. | The error message returned because the specified instance type does not exist or because you are not authorized to manage instances of the specified instance type. |
400 | InvalidParameter.Mismatch | Too many parameters in one request. | The error message returned because the number of parameters contained in the request exceeds the upper limit. |
400 | BandwidthUpgradeDenied.EipBoundInstance | The specified VPC instance has bound EIP, temporary bandwidth upgrade is denied. | The error message returned because the instance is associated with an elastic IP address and the instance network bandwidth cannot be temporarily upgraded. |
400 | InvalidTemporary.StartTime | The specifed Temporary.StartTime is not valid. | The error message because the specified Temporary.StartTime parameter is invalid. |
400 | InvalidTemporary.EndTime | The specifed Temporary.EndTime is not valid. | The error message because the specified Temporary.EndTime parameter is invalid. |
400 | Downgrade.NotSupported | Downgrade operation is not supported. | The error message returned because the downgrade operation is not supported. |
400 | DependencyViolation.InstanceType | The current InstanceType cannot be changed to the specified InstanceType. | The error message returned because the current instance type cannot be changed to the specified instance type. |
400 | Account.Arrearage | Your account has an outstanding payment. | The error message returned because you have unpaid orders in your account. |
400 | InvalidParameter.Bandwidth | The specified parameter Bandwidth is not valid. | The error message returned because the specified bandwidth is invalid. |
400 | InvalidParameter.Conflict | The specified image does not support the specified instance type. | The error message returned because the specified image cannot be used for the specified instance type. |
400 | InvalidParameter.AllowMigrateAcrossZone | The specified parameter CanMigrateAcrossZone is not valid. | The specified AllowMigrateAcrossZone parameter is invalid. |
400 | InvalidParam.SystemDiskCategory | The specified param SystemDisk.Category is not valid. | The error message returned because the specified SystemDisk.Category parameter is invalid. |
400 | Throttling | Request was denied due to request throttling, please try again after 5 minutes. | The error message returned because your request is throttled. Try again 5 minutes later. |
400 | InvalidInstanceStatus.NotStopped | The specified Instance status is not stopped. | The error message returned because the specified instance is not in the Stopped state. |
400 | InvalidAction | Specified action is not valid. | The error message returned because the operation is invalid. |
400 | IdempotenceParamNotMatch | There is a idempotence signature mismatch between this and last request. | The error message returned because this request and the previous request contain the same client token but different other parameters. |
400 | InvalidClientToken.ValueNotSupported | The ClientToken provided is invalid. | The error message returned because the specified ClientToken parameter is invalid. |
400 | Price.PricePlanResultNotFound | The internetMaxBandwidthIn or internetMaxBandwidthOut provided is invalid. | The error message returned because the specified InternetMaxBandwidthIn or InternetMaxBandwidthOut parameter is invalid. |
400 | InvalidAction.NotSupport | The ecs on dedicatedHost not support modify instanceType. | The error message returned because you cannot change the instance types of instances hosted on dedicated hosts. |
400 | InvalidMarketImageStatus.NotSupported | The status of specified market image does not support this operation. | The error message returned because the operation is not supported while the specified Alibaba Cloud Marketplace image is in the current state. |
400 | InvalidOperation.VpcHasEnabledAdvancedNetworkFeature | The specified vpc has enabled advanced network feature. | The error message returned because advanced features are enabled for the specified VPC. You cannot create low-specification instances in the VPC. |
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 | InvalidDiskCategory.NotSupported | The upgrade operation of instance does not support this category of disk. | The error message returned because the upgrade operations of instances do not support the specified disk category. |
403 | CategoryViolation | The specified instance does not support this operation because of its disk category. | The error message returned because the configurations of instances that have local disks attached cannot be changed. |
403 | InvalidStatus.ValueNotSupported | The current status of the resource does not support this operation. | The error message returned because the operation is not supported while the resource is in the current state. |
403 | InstanceLockedForSecurity | The specified operation is denied as your instance is locked for security reasons. | The error message returned because the operation is not supported while the instance is locked for security reasons. |
403 | InvalidAccountStatus.NotEnoughBalance | Your account does not have enough balance. | The error message returned because your account balance is insufficient. Add funds to your account and try again. |
403 | ChargeTypeViolation | The operation is not permitted due to charge type of the instance. | The error message returned because the billing method of the instance does not support this operation. |
403 | OperationDenied | The specified instance is out of usage. | The error message returned because the resources of the specified instance type are insufficient. |
403 | LastTokenProcessing | The last token request is processing. | The error message returned because the last token request is being processed. Try again later. |
403 | InstanceSpecModification.NotEffective | The specified instance has been reserved for making a spec modification and not taken effective in the current contract period. | The error message returned because the instance is reserved due to an instance type change. Changes made to it cannot take effect during the current contract period. |
403 | InvalidInstanceType.ValueNotSupported | The specified zone does not offer the specified instancetype. | The error message returned because the specified instance type is unavailable in the specified region. |
403 | ImageNotSupportInstanceType | The specified image do not support the InstanceType instance. | The error message returned because the specified image does not support the instance type. |
403 | InvalidParameter.NotMatch | %s | The error message returned because a specified parameter is invalid. Check whether parameter conflicts exist. |
403 | InvalidInstance.EipNotSupport | The specified instance with eip is not supported, please unassociate eip first. | The operation is not supported while an EIP is associated with the instance. Disassociate the EIP first. |
403 | OperationDenied.NoStock | The resource is out of usage. | The error message returned because the instance is not in the Running state. Start the instance or check whether the specified operation is invalid. |
403 | OperationDenied.UnpaidOrder | The specified instance has unpaid order. | The error message returned because you have unpaid orders for the specified instance. You can log on to the ECS console to pay for the orders. |
403 | OperationDenied | %s | The error message returned because the operation is denied. |
403 | InvalidOperation.Ipv4CountExceeded | %s | The error message returned because the maximum number of IPv4 addresses has been reached. |
403 | InvalidOperation.Ipv6CountExceeded | %s | The error message returned because the maximum number of IPv6 addresses has been reached. |
403 | InvalidOperation.Ipv6NotSupport | %s | The error message returned because IPv6 addresses do not support this operation. |
403 | InvalidOperation.InstanceWithEipNotSupport | The special instance with eip not support operate, please unassociate eip first. | The error message returned because the operation is not supported while an EIP is associated with this instance. Disassociate the EIP address first. |
403 | SecurityRisk.3DVerification | We have detected a security risk with your default credit or debit card. Please proceed with verification via the link in your email. | The error message returned because risks are detected in your default credit card or debit card. Click the URL in the email for verification. |
403 | InvalidInstance.NotFoundSystemDisk | The specified instance has no system disk. | The error message returned because the specified instance has no system disk attached. Make sure that the specified instance has a system disk attached. You can call the DescribeInstances operation to query the details of the specified instance. |
403 | InvalidInstanceType.NotSupportDiskCategory | The instanceType of the specified instance does not support this disk category. | The error message returned because the instance type specified by the InstanceType parameter does not support the disk category of the instance. Try another instance type. For information about the disk categories supported by instance types, see the instance family documentation. |
403 | QuotaExceed.ElasticQuota | No additional quota is available for the specified ECS instance type. | The error message returned because the maximum number of instances of the specified instance type in the region has been reached. Try another region or instance type, or reduce the purchase quantity. You can go to the ECS console or Quota Center to request a quota increase. |
403 | QuotaExceed.ElasticQuota | The number of the specified ECS instances has exceeded the quota of the specified instance type. | The error message returned because the maximum number of instances of the specified instance type in the region has been reached. Try another region or instance type, or reduce the purchase quantity. You can go to the ECS console or Quota Center to request a quota increase. |
403 | QuotaExceed.ElasticQuota | The number of vCPUs assigned to the ECS instances has exceeded the quota in the zone. | The error message returned because the maximum number of vCPUs for all instance types has been reached in the zone. You can go to the ECS console or Quota Center to request a quota increase. |
403 | QuotaExceed.ElasticQuota | The number of the specified ECS instances has exceeded the quota of the specified instance type, or the number of vCPUs assigned to the ECS instances has exceeded the quota in the zone. | The error message returned because the maximum number of instances of the specified instance type in the region has been reached or because the maximum number of vCPUs for all instance types has been reached. You can go to the ECS console or Quota Center to request a quota increase. |
403 | InvalidOperation.InstanceTypeNotSupportEniTrunking | %s | The error message returned because the operation is not supported. For more information, see the returned value of the %s in the error message. |
403 | InvalidOperation.MaxEniQueueNumberExceeded | %s | The error message returned because the maximum number of queues per ENI has been reached. For more information, see the returned value of the %s in the error message. |
403 | InvalidOperation.ExceedInstanceTypeQueueNumber | %s | The error message returned because the maximum number of queues for all ENIs on an instance has been reached. For more information, see the returned value of the %s in the error message. |
403 | InvalidParameter.InvalidEniQueueNumber | %s | The error message returned because the specified NetworkInterfaceQueueNumber parameter is invalid. For more information, see the returned value of the %s in the error message. |
404 | InvalidInstanceId.NotFound | The specified InstanceId does not exist. | The error message returned because the specified InstanceId parameter is invalid. |
404 | MissingTemporary.StartTime | Temporary.StartTime is not specified. | The error message returned because the Temporary.StartTime parameter is not specified. |
404 | MissingTemporary.EndTime | Temporary.EndTime is not specified. | The error message returned because the Temporary.EndTime parameter is not specified. |
404 | InvalidInstanceChargeType.NotFound | The InstanceChargeType does not exist in our records. | The error message returned because the specified instance billing method does not exist. |
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. |
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. |
For a list of error codes, see Service error codes.