扩容一块磁盘,支持扩容系统盘和数据盘。
接口说明
扩容前,请务必查询云盘采用的分区格式。如果是 MBR 格式,不支持扩容到 2TiB 以上,否则会造成数据丢失。对于 MBR 分区扩容,建议您重新创建并挂载一块数据盘,采用 GPT 分区格式后,再将已有数据拷贝至新的数据盘上。更多详情,请参见扩容云盘容量。
-
支持扩容的磁盘类型包括普通云盘(
cloud)、高效云盘(cloud_efficiency)、SSD 云盘(cloud_ssd)、ESSD 云盘(cloud_essd)、ESSD Entry 云盘(cloud_essd_entry)、ESSD AutoPL 云盘(cloud_auto)、弹性临时盘-标准版(elastic_ephemeral_disk_standard)和弹性临时盘-高级版(elastic_ephemeral_disk_premium)、 ESSD 同城冗余云盘(cloud_regional_disk_auto)。 -
正在创建快照的云盘不支持扩容。请您等待快照创建完成后,再开始执行扩容操作。
-
该接口不能扩容分区和文件系统,您需要在扩容云盘容量后自行分配分区和文件系统,具体操作,请参见扩容分区与文件系统(Linux)和扩容分区与文件系统(windows)。
-
开启多重挂载特性的云盘支持在线扩容和离线扩容,请确保磁盘挂载的实例满足以下条件:
在线扩容时,实例状态为运行中(
Running)。离线扩容时,实例状态为运行中(
Running)或已停止(Stopped)。
-
请确保云盘满足以下条件:
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
调试
授权信息
|
操作 |
访问级别 |
资源类型 |
条件关键字 |
关联操作 |
|
ecs:ResizeDisk |
update |
*Disk
|
无 | 无 |
请求参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
| DiskId |
string |
是 |
磁盘 ID。您可以调用 DescribeDisks 查询磁盘 ID。 |
d-bp67acfmxazb4p**** |
| Type |
string |
否 |
扩容磁盘的方式。取值范围:
|
offline |
| NewSize |
integer |
是 |
希望扩容到的磁盘容量大小。单位为 GiB。取值范围:
说明
指定的新磁盘容量必须比原磁盘容量大,否则调用接口将报错。 |
1900 |
| ClientToken |
string |
否 |
保证请求幂等性。从您的客户端生成一个参数值,确保不同请求间该参数值唯一。ClientToken 只支持 ASCII 字符,且不能超过 64 个字符。更多信息,请参见如何保证幂等性。 |
123e4567-e89b-12d3-a456-426655440000 |
返回参数
|
名称 |
类型 |
描述 |
示例值 |
|
object |
|||
| OrderId |
string |
生成的订单 ID。 说明
仅在扩容包年包月云盘时会返回订单 ID。 |
20413515388**** |
| RequestId |
string |
请求 ID。 |
F3CD6886-D8D0-4FEE-B93E-1B732396**** |
示例
正常返回示例
JSON格式
{
"OrderId": "20413515388****",
"RequestId": "F3CD6886-D8D0-4FEE-B93E-1B732396****"
}
错误码
|
HTTP status code |
错误码 |
错误信息 |
描述 |
|---|---|---|---|
| 400 | InvalidDataDiskSize.ValueNotSupported | The specified parameter NewSize is beyond the permitted range. Please ensure that NewSize is within the range supported by the disk category and try again. | |
| 400 | InvalidParameter.Conflict | %s | 您输入的参数无效,请检查参数之间是否冲突。%s为变量,将根据调用API的实际情况动态返回错误信息。 |
| 400 | IncompleteParamter | Some required parameters are missing in this request. Please check the required parameters and try again. | |
| 400 | InvalidRegionId.MalFormed | The specified RegionId is not valid. | |
| 400 | InvalidParam.Type | The specified type is not supported. | 指定的参数Type无效。 |
| 400 | LastOrderProcessing | The previous order is still processing. Please try again later. | 上一个订单仍正在处理中,请稍后再试。 |
| 400 | InvalidStatus.Upgrading | The instance which the disk attachs is upgrading; please try again later. | |
| 400 | InvalidSystemDiskSize.ImageNotSupportResize | The image of the instance does not support resize. | |
| 400 | InvalidDisk.DetachedSystemDisk | The current operation is not supported because the specified resource is/has a detached system disk. Please attach the disk or verify the resource state and try again. | |
| 400 | OperationDenied.NotEnoughCapacity | The capacity of the current dedicated block storage cluster is not enough to expand. | |
| 400 | IncorrectDiskStatus.ReplicationStatusNotFound | Disk replication status not found. | |
| 400 | IncorrectDiskStatus.InReplication | Disk already in replication. | |
| 400 | QuotaExceed.DiskCapacity | The disk capacity quota of the specified disk category has been exceeded in the current zone. Please reduce the requested disk capacity or select another zone and try again. You can also view the disk capacity quota and apply for an increase in Quota Center. | |
| 400 | NoPermission.Price | The operation requires price permission. Please either apply for permission from your main account or set the parameter AutoPay to true. | |
| 400 | NoPermission.Refund | The operation requires refund permission. Please apply for permission from your main account. | 该账号无权限操作退款,主账号需要授权退款相关权限。 |
| 400 | InvalidOperation.InstanceRenewWithDowngradeInPlan | The operation is denied due to the specified instance has renew with downgrade record in plan. | 存在未生效的续费降配订单。订单生效前不允许此操作。 |
| 400 | InvalidSystemDiskSize.ValueNotSupported | The specified system disk size is invalid. | 无效的系统硬盘大小。 |
| 400 | OperationDenied.UnfinishedOrder | The current instance has an unfinished refund order. This operation is denied. | |
| 400 | AccountForbidden.CreateOrder | Order cannot be created due to abnormal account. | 当前账号不允许创建订单。 |
| 400 | InvalidParameter.KMSKeyId.NotFound | The specified KMSKeyId does not exist. Please verify that the key ID is correct and that the key resides in the current region. | |
| 400 | InvalidOperation.DiskReadOnlyNotSupportResize | The specified disk is a read-only disk. The resize operation is not supported. | 只读模式云盘不支持扩容。 |
| 500 | InternalError | The request processing has failed due to an internal error and you may retry later or contact support with the request ID. | |
| 403 | InvalidDataDiskSize.ValueNotSupported | The specified parameter NewSize is beyond the permitted range. Please ensure that NewSize is within the range supported by the disk category and try again. | |
| 403 | OperationDenied | The specified disk category does not support the current operation. Please use a supported disk category and try again. | |
| 403 | InvalidDiskSize.TooSmall | The specified NewSize must be greater than the original size. Please specify a larger NewSize and try again. | |
| 403 | InvalidDiskSize.TooLarge | The specified NewSize is beyond the permitted range. Please check the supported size range and try again. | |
| 403 | InstanceExpiredOrInArrears | The specified operation is denied as your prepay instance is expired (prepay mode) or in arrears (afterpay mode). | |
| 403 | DiskError | Incorrect disk status. | |
| 403 | DiskInArrears | The specified operation is denied because the disk has overdue payments. Please settle the outstanding balance. | |
| 403 | IncorrectInstanceStatus | The current status of the instance does not support this operation. Please wait until the ongoing operation on the instance completes and try again. | |
| 403 | DiskCreatingSnapshot | The operation is denied due to a snapshot of the specified disk is not completed yet. | |
| 403 | InvalidDiskSize | The specified NewSize must be greater than the original size. Please specify a larger NewSize and try again. | |
| 403 | Operation.Conflict | The resource is currently busy with a conflicting operation. Please wait for it to complete and try again. | |
| 403 | InstanceLockedForSecurity | Operation failed because the instance attached to this disk is locked for security reasons. Please open a ticket to contact our security team if you have any questions. | |
| 403 | IncorrectDiskStatus | The current disk status does not support this operation. | |
| 403 | UserNotInTheWhiteList | The current account is not in the allowlist for this operation. Please submit a ticket to apply for access. | |
| 403 | InvalidDiskCategory.NotSupported | The specified disk category is not supported. Please ensure the disk category supports resizing and try again. | |
| 403 | InvalidRegion.NotSupport | The specified region does not support resize online. | 该地域不支持在线扩容。 |
| 403 | InvalidInstanceStatus.NotRunning | The instance to which the disk is attached must be in the Running state when resizing online. Please start the instance and try again. | |
| 403 | InvalidOperation.InstanceTypeNotSupportOnlineResize | The instance type of the specified instance does not support resize online. | |
| 403 | InvalidParameter.KMSKeyId.CMKUnauthorized | The CMK has not authorized the ECS service to perform the KMS TagResource and UntagResource operations. Please verify the authorization and try again. | |
| 403 | InvalidParameter.KMSKeyId.CMKNotEnabled | The CMK needs to be enabled. | |
| 403 | InvalidParameter.KMSKeyId.KMSUnauthorized | ECS service does not have permission to access your KMS key. Please verify that the specified KMS key has authorized the ECS service. | |
| 403 | InstanceSpecModification.NotEffective | The instance which the disk attachs has been reserved for making a spec modification and not taken effective in the current contract period. | |
| 403 | InvalidDiskSize.NotSupportResizeOnline | The current size of the specified disk does not support online resizing. Please use offline resizing or specify a supported size and try again. | |
| 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. | 我们检测到您的默认信用卡或借记卡存在安全风险。请通过电子邮件中的链接进行验证。 |
| 403 | QuotaExceeded.PostpaidDataDiskCapacity | The quota for pay-as-you-go data disk capacity has been exceeded. Please reduce the requested capacity or apply for a quota increase. | |
| 403 | InvalidOperation.MultiAttachDiskNotSupportResizeOnline | Multi attach disk does not support resize online. | 开启多重挂载特性的云盘不支持在线扩容。 |
| 403 | InvalidDataDiskCategory.ValueNotSupported | The disk category of the specified disk is not valid for resizing. Please ensure the disk category supports resizing and try again. | |
| 403 | InvalidDiskSize.NotSupportMultiAttachDisk | The specified disk size exceeds the maximum limit (65536) for enabling multi-attach. Please specify a smaller size and try again. | |
| 403 | InvalidOperation.LingJunDiskResizeUnsupported | The specified disk is attached to a LingJun instance that does not support disk resizing. Please stop the instance and resize it again. | |
| 404 | InvalidDiskId.NotFound | The specified disk does not exist. Please verify the DiskId and the current region and try again. | |
| 404 | InvalidInstanceId.NotFound | The instance to which the specified disk is attached does not exist. Please verify the DiskId and the current region and try again. |
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。