All Products
Search
Document Center

:ModifyInstanceSpec

更新时间:Oct 07, 2023

Changes the instance type and public bandwidth of a pay-as-you-go Elastic Compute Service (ECS) instance.

Usage notes

For information about how to use ECS SDK for Python to change resource configurations, see Query available resources for configuration changes.

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 (Running) or Stopped (Stopped) state.
  • Before you change the instance type of a pay-as-you-go instance, call the DescribeResourcesModification operation to query compatible instance types.
  • You can change the instance type of an instance only when the instance is in the Stopped (Stopped state.
  • The instance type and the public bandwidth of an instance cannot be changed together.
  • As of November 27, 2020, the total bandwidth available for all instances (new and modified) is subject to the throttling policies of your account. To increase the bandwidth limit, submit a ticket. The following throttling policies apply:
    • In a single region, the sum of actual peak bandwidths of all ECS instances that use the pay-by-traffic billing method for network usage cannot exceed 5 Gbit/s.
    • In a single region, the sum of actual peak bandwidths of all ECS instances that use the pay-by-bandwidth billing method for network usage cannot exceed 50 Gbit/s.

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 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 Overview of instance families. Alternatively, you can 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 billing method is used for network usage, the maximum inbound and outbound bandwidth values are used as the upper limits for bandwidth instead of guaranteed performance. In scenarios where demand outstrips resource supplies, these maximum bandwidth values may not be reached. If you want guaranteed bandwidth for your instance, we recommend that you use the pay-by-bandwidth billing method.
InternetMaxBandwidthIn Integer No 10

The maximum inbound public bandwidth. Unit: Mbit/s. Valid values:

  • When the purchased outbound public bandwidth is less than or equal to 10 Mbit/s, the valid values of this parameter are 1 to 10 and the default value is 10.
  • When the purchased outbound public bandwidth is greater than 10 Mbit/s, the valid values of this parameter are 1 to the InternetMaxBandwidthOut value and the default value is the InternetMaxBandwidthOut value.
Note When the pay-by-traffic billing method is used for network usage, the maximum inbound and outbound bandwidths are used as upper limits of bandwidths instead of guaranteed performance. In scenarios where demand outstrips resource supplies, these maximum bandwidth values may not be reached. If you want guaranteed bandwidth for your instance, we recommend that you use the pay-by-bandwidth billing method.
Temporary.StartTime String No null
Note This parameter is in invitational preview and is not publicly available.
Temporary.EndTime String No null
Note This parameter is in invitational preview and is not publicly available.
Temporary.InternetMaxBandwidthOut Integer No null
Note This parameter is in invitational preview and is not publicly available.
Async Boolean No false

Specifies whether to submit an asynchronous request. Valid values:

  • true
  • false

Default value: false.

AllowMigrateAcrossZone Boolean No false

Specifies whether cross-cluster instance type upgrades are supported.

  • true
  • false

Default value: false.

When AllowMigrateAcrossZone is set to true and you upgrade the instance based on the returned information, take note of the following items:

Instance that resides in the classic network:

  • For retired instance types, the private IP address, disk device names, and software authorization codes of a non-I/O optimized instance change when you upgrade the instance to an I/O optimized instance. For Linux instances, basic disks (cloud) are identified as xvd* such as xvda and xvdb, and ultra disks (cloud_efficiency) and standard SSDs (cloud_ssd) are identified as vd* such as vda and vdb.
  • For instance families that are available for purchase, when the instance type of an instance is changed, the private IP address of the instance is also changed. For more information, see Overview of instance families.

Instance that resides in a virtual private cloud (VPC): 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, basic disks (cloud) are identified as xvd* such as xvda and xvdb, and ultra disks (cloud_efficiency) and standard SSDs (cloud_ssd) are identified as vd* such as vda and vdb.

SystemDisk.Category String No cloud_ssd

The new category of the system disk. Valid values:

  • cloud_efficiency: ultra disk.
  • cloud_ssd: standard SSD.
Note This parameter is valid only when you upgrade an instance from a retired instance type to an available instance type or when you upgrade a non-I/O optimized instance to an I/O optimized instance. For more information, see Retired instance types and Overview of instance families.
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 ensure 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.

ModifyMode String No null
Note This parameter is not publicly available.
Disk.N.DiskId String No null
Note This parameter is not publicly available.
Disk.N.Category String No null
Note This parameter is not publicly available.
Disk.N.PerformanceLevel String No null
Note This parameter is not publicly available.

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 responses

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

HTTP statue code

Error code

Error message

Description

400 InvalidInternetChargeType.ValueNotSupported The specified InternetChargeType is not valid. Invalid billing method for network usage.
400 InvalidInstanceType.ValueUnauthorized The specified InstanceType does not exist or beyond the permitted range. The instance type is not found, or you are not authorized to manage instances of the instance type.
400 InvalidInstanceType.ValueUnauthorized The specified InstanceType is not authorized. You are not authorized to use the instance type.
400 InvalidInstanceType.ValueNotSupported The specified InstanceType does not exist or beyond the permitted range. The instance type is not found, or you are not authorized to manage instances of the instance type.
400 InvalidParameter.Mismatch Too many parameters in one request. The maximum number of parameters in the request is exceeded.
400 BandwidthUpgradeDenied.EipBoundInstance The specified VPC instance has bound EIP, temporary bandwidth upgrade is denied. The instance is associated with an elastic IP address (EIP), and the network bandwidth of the instance cannot be temporarily upgraded.
400 InvalidTemporary.StartTime The specifed Temporary.StartTime is not valid. The specified start time of the temporary upgrade period is invalid.
400 InvalidTemporary.EndTime The specifed Temporary.EndTime is not valid. Invalid Temporary.EndTime value.
400 Downgrade.NotSupported Downgrade operation is not supported. Configuration downgrades are not supported.
400 DependencyViolation.InstanceType The current InstanceType cannot be changed to the specified InstanceType. You cannot change the instance to the specified instance type.
400 Account.Arrearage Your account has an outstanding payment. You have unpaid orders in your account.
400 InvalidParameter.Bandwidth The specified parameter Bandwidth is not valid. Invalid bandwidth.
400 InvalidParameter.Conflict The specified image does not support the specified instance type. The specified image cannot be used for the specified instance type.
400 InvalidParameter.AllowMigrateAcrossZone The specified parameter CanMigrateAcrossZone is not valid. Invalid AllowMigrateAcrossZone value.
400 InvalidParam.SystemDiskCategory The specified param SystemDisk.Category is not valid. Invalid SystemDisk.Category value.
400 Throttling Request was denied due to request throttling, please try again after 5 minutes. Your request is being throttled. Try again in 5 minutes.
400 InvalidInstanceStatus.NotStopped The specified Instance status is not stopped. The specified instance is not in the Stopped state.
400 InvalidAction Specified action is not valid. The operation is invalid.
400 IdempotenceParamNotMatch There is a idempotence signature mismatch between this and last request. This request and the previous request contain the same client token but different other parameters.
400 InvalidClientToken.ValueNotSupported The ClientToken provided is invalid. Invalid ClientToken value.
400 Price.PricePlanResultNotFound The internetMaxBandwidthIn or internetMaxBandwidthOut provided is invalid. Invalid InternetMaxBandwidthIn or InternetMaxBandwidthOut value.
400 InvalidAction.NotSupport The ecs on dedicatedHost not support modify instanceType. 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. This operation cannot be performed on the Alibaba Cloud Marketplace image in the current state.
400 InvalidOperation.VpcHasEnabledAdvancedNetworkFeature The specified vpc has enabled advanced network feature. Advanced features are enabled for the VPC. You cannot create ECS instances that have low specifications in the VPC.
400 Invalid.PrivatePoolOptions.MatchCriteria Target mode does not support this operation. This operation cannot be performed when PrivatePoolOptions.MatchCriteria is set to Target.
400 InvalidDiskCategory.NotSupported The upgrade operation of instance does not support this category of disk. The configuration upgrade operation of instances does not support the disk category.
400 QuotaExceed.DiskCapacity The used capacity of disk type has exceeded the quota in the zone, %s. The capacity of disks that belong to the specified disk category exceeds the quota limit for the zone. You can go to the Quota Center to view and increase the quota.
400 InvalidParam.Async The specified parameter async is not valid. Invalid Async value.
403 CategoryViolation The specified instance does not support this operation because of its disk category. 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. This operation cannot be performed on the resource in the current state.
403 InstanceLockedForSecurity The specified operation is denied as your instance is locked for security reasons. The instance is locked for security reasons.
403 InvalidAccountStatus.NotEnoughBalance Your account does not have enough balance. The 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. This operation cannot be performed on the instance that uses the current billing method.
403 OperationDenied The specified instance is out of usage. The inventory of the specified instance type is insufficient.
403 LastTokenProcessing The last token request is processing. A 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 instance has been reserved for an instance type change. Changes made to the instance cannot take effect during the current contract period.
403 InvalidInstanceType.ValueNotSupported The specified zone does not offer the specified instancetype. The instance type is unavailable in the specified region.
403 ImageNotSupportInstanceType The specified image do not support the InstanceType instance. The specified image does not support the instance type.
403 InvalidParameter.NotMatch %s Invalid parameter. Check whether parameter conflicts exist.
403 InvalidInstance.EipNotSupport The specified instance with eip is not supported, please unassociate eip first. This operation cannot be performed on the instance that is associated with an EIP. Disassociate the EIP first.
403 OperationDenied.NoStock The resource is out of usage. The instance is not in the Running state. Start the instance or check whether the operation is valid.
403 OperationDenied.UnpaidOrder The specified instance has unpaid order. You have unpaid orders for the instance. You can log on to the ECS console to pay for the orders.
403 OperationDenied %s The operation is denied.
403 InvalidOperation.Ipv4CountExceeded %s The maximum number of IPv4 addresses is exceeded.
403 InvalidOperation.Ipv6CountExceeded %s The maximum number of IPv6 addresses is exceeded.
403 InvalidOperation.Ipv6NotSupport %s IPv6 addresses do not support this operation.
403 InvalidOperation.InstanceWithEipNotSupport The special instance with eip not support operate, please unassociate eip first. This operation cannot be performed on the instance that is associated with an EIP. Disassociate the EIP 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. 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 instance has no system disk attached. Make sure that the instance has a system disk attached. You can call the DescribeInstances operation to query the details of the instance.
403 InvalidInstanceType.NotSupportDiskCategory The instanceType of the specified instance does not support this disk category. The specified instance type does not support the disk categories 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 maximum number of instances of the specified instance type in the region is exceeded. Try another region or instance type, or reduce the number of instances that you want to create. You can also go to the ECS console or the 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 maximum number of instances of the specified instance type in the region is exceeded. Try another region or instance type, or reduce the number of instances that you want to create. You can also go to the ECS console or the 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 maximum number of vCPUs for all instance types is exceeded. 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 maximum number of instances of the specified instance type in the region, or the maximum number of vCPUs for all instance types is exceeded. You can go to the ECS console or Quota Center to request a quota increase.
403 InvalidOperation.InstanceTypeNotSupportEniTrunking %s The operation is not supported. For more information, see the return value of the %s placeholder in the error message.
403 InvalidOperation.MaxEniQueueNumberExceeded %s The maximum number of queues on the ENI is exceeded. For more information, see the returned value of the %s placeholder in the error message.
403 InvalidOperation.ExceedInstanceTypeQueueNumber %s The maximum number of queues for all ENIs on an instance is exceeded. For more information, see the returned value of the %s placeholder in the error message
403 InvalidParameter.InvalidEniQueueNumber %s Invalid number of queues for an ENI. For more information, see the return value of the %s placeholder in the error message.
403 HibernationConfigured.InstanceOperationForbidden The operation is not permitted due to limit of the hibernation configured instance. The operation cannot be performed due to the limitations of instances for which the instance hibernation feature is enabled.
404 InvalidInstanceId.NotFound The specified InstanceId does not exist. The instance ID is not found.
404 MissingTemporary.StartTime Temporary.StartTime is not specified. The start time of the temporary upgrade period is not specified.
404 MissingTemporary.EndTime Temporary.EndTime is not specified. The end time of the temporary upgrade period is not specified.
404 InvalidInstanceChargeType.NotFound The InstanceChargeType does not exist in our records. The instance billing method is not found.
500 InternalError The request processing has failed due to some unknown error, exception or failure. An internal error occurred. Try again later.
500 InternalError The request processing has failed due to some unknown error. An internal error occurred. Try again later.

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