本接口用于修改一台包年包月ECS实例的实例规格,支持您升级或者降低实例规格,修改后的实例规格在实例整个生命周期内生效。
接口说明
请确保在使用该接口前,已充分了解 ECS 产品的收费方式、价格以及降配退款规则。
本接口属于异步操作,等待约 5~10 秒后配置变更完成。升级或者降低包年包月 ECS 实例规格前,您可以通过 DescribeResourcesModification 查询当前实例支持变配的实例规格。
注意事项
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
调试
授权信息
|
操作 |
访问级别 |
资源类型 |
条件关键字 |
关联操作 |
|
ecs:ModifyPrepayInstanceSpec |
update |
*Instance
|
无 | 无 |
请求参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
| InstanceId |
string |
是 |
实例 ID。 |
i-bp67acfmxazb4ph**** |
| RegionId |
string |
是 |
实例所属的地域 ID。您可以调用 DescribeRegions 查看最新的阿里云地域列表。 |
cn-hangzhou |
| InstanceType |
string |
是 |
需要变配的目标实例规格。取值请参见实例规格族或者调用 DescribeInstanceTypes 。 |
ecs.g5.xlarge |
| OperatorType |
string |
否 |
操作类型。取值范围: 说明
该参数可无需上传,系统可自动判断升配还是降配;如要上传,请按照下面的逻辑规则操作。
说明
升级或降低实例规格的注意事项请参见上文接口说明章节。 |
upgrade |
| ClientToken |
string |
否 |
保证请求幂等性。从您的客户端生成一个参数值,确保不同请求间该参数值唯一。ClientToken 只支持 ASCII 字符,且不能超过 64 个字符。更多信息,请参见如何保证幂等性。 |
123e4567-e89b-12d3-a456-426655440000 |
| AutoPay |
boolean |
否 |
升级实例规格时,是否自动支付。取值范围:
默认值:true。 说明
|
true |
| MigrateAcrossZone |
boolean |
否 |
是否支持跨集群升级实例规格。取值范围:
默认值:false。 当参数 经典网络类型实例:
专有网络 VPC 类型实例:对于已停售的实例规格,非 I/O 优化实例变配到 I/O 优化实例时,云服务器磁盘设备名和软件授权码会发生变化。Linux 实例的普通云盘(cloud)会被识别为 xvda 或者 xvdb 等,高效云盘(cloud_efficiency)和 SSD 云盘(cloud_ssd)会被识别为 vda 或者 vdb 等。 |
false |
| SystemDisk.Category |
string |
否 |
更换系统盘类型。取值范围:
说明
该参数仅支持从已停售的实例规格升级到正常售卖的实例规格族,并将非 I/O 优化实例规格升级为 I/O 优化实例规格时有效。 |
cloud_efficiency |
| RebootTime |
string |
否 |
实例的重启时间。按照ISO 8601标准表示,使用 UTC+0 时间。格式为:yyyy-MM-ddTHH:mmZ。 |
2018-01-01T12:05Z |
| EndTime |
string |
否 |
临时变更的终止时间。按照ISO 8601标准表示,使用 UTC+0 时间。格式为:yyyy-MM-ddTHH:mmZ。 |
2018-01-01T12:05Z |
| RebootWhenFinished |
boolean |
否 |
实例变配结束后是否立即重启。取值范围:
默认值为 false。 说明
若实例处于已停止状态,即使您设置了 |
false |
| ModifyMode |
string |
否 |
说明
该参数暂未开放使用。 |
null |
| Disk |
array<object> |
否 |
说明
该参数暂未开放使用。 |
|
|
object |
否 |
说明
该参数暂未开放使用。 |
||
| DiskId |
string |
否 |
说明
该参数暂未开放使用。 |
null |
| Category |
string |
否 |
说明
该参数暂未开放使用。 |
null |
| PerformanceLevel |
string |
否 |
说明
该参数暂未开放使用。 |
null |
返回参数
|
名称 |
类型 |
描述 |
示例值 |
|
object |
|||
| OrderId |
string |
生成的订单 ID。 |
1234567890 |
| RequestId |
string |
请求 ID。 |
473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E |
示例
正常返回示例
JSON格式
{
"OrderId": "1234567890",
"RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E"
}
异常返回示例
JSON格式
{
"RequestId": "E69EF3CC-94CD-42E7-8926-F133B86387C0",
"HostId": "ecs.aliyuncs.com",
"Code": "InvalidBillingMethod.ValueNotSupported",
"Message": "The operation is not permitted due to an invalid billing method of the instance."
}
错误码
|
HTTP status code |
错误码 |
错误信息 |
描述 |
|---|---|---|---|
| 400 | InvalidInstanceType.ValueUnauthorized | The specified InstanceType is not authorized. | |
| 400 | InvalidInstanceType.ValueNotSupported | The specified InstanceType does not exist or beyond the permitted range. | 您指定的实例规格不存在,或者您没有权限操作此规格的实例。 |
| 400 | InvalidBillingMethod.ValueNotSupported | The operation is not permitted due to an invalid billing method of the instance. | 由于实例的计费方式无效,该操作不允许。 |
| 400 | InvalidInstance.PurchaseNotFound | The specified instance has no purchase history. | 该实例的订购记录不存在。 |
| 400 | InvalidInstance.UnpaidOrder | The specified instance has unpaid order. | 指定实例还有未支付的订单。 |
| 400 | InvalidInstanceType.NotSupported | The specified InstanceType is not Supported. | |
| 400 | OrderCreationFailed | Order creation failed, please check your params and try it again later. | 订单创建失败,请修改参数后重试。 |
| 400 | Throttling | You have made too many requests within a short time; your request is denied due to request throttling. | 请求被流控,请稍后重试。 |
| 400 | Account.Arrearage | Your account has an outstanding payment. | 您的账号存在未支付的款项。 |
| 400 | InvalidInstanceId.NotFound | The specified InstanceId does not exist. | |
| 400 | InvalidRebootTime.MalFormed | The specified rebootTime is not valid. | 指定的 RebootTime 不合法。 |
| 400 | InvalidRebootTime.ValueNotSupported | The specified RebootTime is not valid. | 指定的重启时间不合法。 |
| 400 | IdempotenceParamNotMatch | Request uses a client token in a previous request but is not identical to that request. | 与相同 ClientToken 的请求参数不符合。 |
| 400 | InvalidInstanceChargeType.ValueNotSupported | %s | 暂不支持此付款类型,请核对相关信息后重试。 |
| 400 | InvalidStatus.NotStopped | Instance status must be stopped. | 实例只有在已停止的状态下,才能进行此操作。 |
| 400 | InvalidAction | %s | 操作无效。 |
| 400 | InstanceDowngrade.QuotaExceed | Quota of instance downgrade is exceed. | 您的实例降配已超额度,无法进行此操作。 |
| 400 | InvalidParameter | %s | 无效的参数。 |
| 400 | OperationDenied | The current user does not support this operation. | 您使用的账号暂不支持此操作。 |
| 400 | LastOrderProcessing | The previous order is still processing, please try again later. | 订单正在处理中,稍后重试。 |
| 400 | InvalidOperation.VpcHasEnabledAdvancedNetworkFeature | The specified vpc has enabled advanced network feature. | 该VPC开启了高阶特性,不能创建低规格的ECS。 |
| 400 | InvalidAction.WithActiveElasticUpgrade | The instance has active Elastic Upgrade. | |
| 400 | InstanceTypeNotSupported.TooManyDisksAttached | %s | |
| 400 | QuotaExceed.DiskCapacity | The used capacity of disk type has exceeded the quota in the zone, %s. | 指定磁盘类型的已用容量超出可用区配额限制,您可以前往配额中心查询和申请提升磁盘容量配额。 |
| 400 | MissingParameter.DiskCategory | The specified parameter Disk.Category can not be null when Disk.DiskId is specified. | |
| 400 | InvalidParameter.DiskCategory | The specified parameter Disk.Category is not valid. | |
| 400 | InvalidPerformanceLevel.Malformed | The specified parameter Disk.n.PerformanceLevel is not valid. | |
| 400 | InvalidSystemDiskCategory.NotMatchInstanceType | The system disk category does not match the instance type. | 系统盘类别与实例规格不匹配 |
| 400 | QuotaExceed.RufundVcpu | The maximum number of refunded vcpu is exceeded: %s . | 退款规则中vCPU配额超过了最大数量限制,具体限制请参见错误信息中%s占位符的实际信息。 |
| 400 | NoPermission.Price | The operation requires price permission. Please either apply for permission from your main account, or set the parameter AutoPay as true. | 该操作需要价格权限。请向您的主账户申请权限,或将参数AutoPay设置为true进行自动支付。 |
| 400 | NoPermission.Refund | The operation requires refund permission. Please apply for permission from your main account. | 该账号无权限操作退款,主账号需要授权退款相关权限。 |
| 400 | InvalidInstanceStatus | The current status of the instance does not support this operation. | |
| 400 | InvalidOperation.InstanceRenewWithDowngradeInPlan | The operation is denied due to the specified instance has renew with downgrade record in plan. | 存在未生效的续费降配订单。订单生效前不允许此操作。 |
| 400 | InvalidOperation.OnlineModificationUnsupported | Online modification of instance type is not supported for the specified instance due to its CPU topology. | 当前CPU拓扑类型不支持热变配 |
| 401 | InvalidInstanceType.ValueUnauthorized | The specified InstanceType is not authorized. | 指定的实例规格未授权使用。 |
| 500 | InternalError | The request processing has failed due to some unknown error, exception or failure. | 内部错误,请重试。 |
| 500 | ImageOrderFailed | Create marketplace image order failed. | 创建云市场订单失败,请提交工单处理。 |
| 403 | OperationDenied.NoStock | The specified instance is out of usage. | 指定的实例库存不足。 |
| 403 | InvalidInstanceType.ValueNotSupported | The specified InstanceType does not exist or beyond the permitted range. | |
| 403 | InvalidUser.PassRoleForbidden | The RAM user does not have privilege to pass a role. | RAM子账号不具备授予ECS RAM角色的权限。 |
| 403 | ImageNotSupportInstanceType | The specified image does not support the specified InstanceType. | 指定的镜像不支持指定的实例规格。 |
| 403 | InstanceType.Offline | %s | 实例规格因停售、供货不足等原因,不支持该操作。 |
| 403 | IncorrectInstanceStatus | The current status of the resource does not support this operation. | |
| 403 | Throttling | You have made too many requests within a short time; your request is denied due to request throttling. | |
| 403 | InvalidParameter.InstanceId | %s | 指定的参数 InstanceId 无效。 |
| 403 | OperationDenied | %s | |
| 403 | InvalidInstanceStatus | The current status of the instance does not support this operation. | 当前实例的状态不支持此操作。 |
| 403 | InvalidOperation.StarterPackage | StarterPackage not support modification. | |
| 403 | InvalidInstance.PreInstanceExpired | Instance business status is not Expired. | |
| 403 | InvalidInstance.EipNotSupport | The special instance with eip not support operate, please unassociate eip first. | 已绑定 EIP 的实例不支持该操作,请优先解绑EIP。 |
| 403 | OperationDenied.ImageNotValid | The specified image is not authorized. | |
| 403 | OperationDenied.LocalDiskUnsupported | The configuration change is not allowed when the specified instance has local disks mounted. | 实例挂载本地盘后不支持规格变配。 |
| 403 | InvalidOperation.EniCountExceeded | %s | |
| 403 | InvalidOperation.Ipv4CountExceeded | %s | IPv4 数量达到上限,导致该操作无效。 |
| 403 | InvalidOperation.Ipv6CountExceeded | %s | IPv6 数量达到上限,导致该操作无效。 |
| 403 | InvalidOperation.Ipv6NotSupport | %s | IPv6不支持当前操作。 |
| 403 | InvalidOperation.Ipv4NotSupport | %s | |
| 403 | InvalidInstance.NotFoundSystemDisk | The specified instance has no system disk. | |
| 403 | InvalidInstanceType.NotSupportDiskCategory | The instanceType of the specified instance does not support this disk category. | 指定的实例规格(InstanceType)不支持当前实例的云盘类别。请尝试更换其它实例规格。关于实例规格支持的云盘类型,请参见实例规格族文档。 |
| 403 | QuotaExceed.ElasticQuota | No additional quota is available for the specified ECS instance type. | 您在当前地域选择的实例规格所要创建的台数超出系统限额,您可以选择其他地域、实例规格或减少台数重新购买,也可以前往ECS管理控制台或配额中心申请提高限额。 |
| 403 | InvalidResourceType.NotSupported | %s | 指定资源组合不存在,请更换其他可用区或规格 |
| 403 | InvalidOperation.MaxEniQueueNumberExceeded | %s | 弹性网卡队列数超过上限,具体信息请参见错误信息%s占位符的实际返回结果。 |
| 403 | InvalidOperation.ExceedInstanceTypeQueueNumber | %s | 弹性网卡队列总数超过上限,具体信息请参见错误信息%s占位符的实际返回结果。 |
| 403 | InvalidParameter.InvalidEniQueueNumber | %s | 弹性网卡队列数有误,具体信息请参见错误信息%s占位符的实际返回结果。 |
| 403 | HibernationConfigured.InstanceOperationForbidden | The operation is not permitted due to limit of the hibernation configured instance. | 不符合开启休眠选项的实例的相关限制,操作不被允许。 |
| 403 | InvalidOperation.MaxModifyOnlineNumberExceeded | The specified instance has reached the maximum number of modify online attempts and needs to be rebooted. | |
| 403 | InvalidOperation.RebootingRequired | The specified instance needs to be rebooted. | |
| 403 | InvalidOperation.OSTypeNotSupported | The specified OS type is not supported. | |
| 403 | OperationDenied.UnpaidOrder | The specified instance has unpaid order. | 指定的实例ID已存在未支付订单,您可以登录ECS管理控制台支付。 |
| 403 | InvalidDisk.DetachedSystemDisk | The specified resource is/has a detached system disk %s , not support current operation. | 指定的磁盘是一块被卸载的系统盘,不支持当前操作。 |
| 403 | InvalidDataDiskCategory.ValueNotSupported | The specified Category of Data Disk is not valid. | 指定的数据盘磁盘类型不支持 |
| 403 | InvalidDiskCategory.NotSupported | The upgrade operation of instance does not support this category of disk. | 实例的升级操作不支持此类磁盘。 |
| 404 | InvalidRegionId.NotFound | The specified RegionId does not exist. | 指定的地域 ID 不存在。 |
| 404 | BillingMethodNotFound | The account has not chosen any billing method. | 该阿里云账号没有选择任何计费方法。 |
| 404 | InvalidInstanceId.NotFound | The specified InstanceId does not exist. | 指定的实例ID无效。 |
| 503 | LimitedOperation.ServiceUnavailable | The service is currently unavailable. Please try again later. | 当前服务不可用。请稍后重试。 |
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。