ResizeDisk
Resizes a system disk or a data disk.
Operation description
扩容前,请务必查询云盘采用的分区格式。如果是 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)。
-
请确保云盘满足以下条件:
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
ecs:ResizeDisk |
update |
*Disk
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| DiskId |
string |
Yes |
The ID of the disk. You can call the DescribeDisks operation to query available disk IDs. |
d-bp67acfmxazb4p**** |
| Type |
string |
No |
The method that you want to use to resize the disk. Valid values:
|
offline |
| NewSize |
integer |
Yes |
The new disk capacity. Unit: GiB. Valid values:
Note
The new disk capacity must be larger than the original disk capacity. Otherwise, an error is reported. |
1900 |
| ClientToken |
string |
No |
The new disk capacity. Unit: GiB. Valid values:
Note
The new disk capacity must be larger than the original disk capacity. Otherwise, an error is reported. |
123e4567-e89b-12d3-a456-426655440000 |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| OrderId |
string |
The ID of the request. |
20413515388**** |
| RequestId |
string |
The ID of the request. |
F3CD6886-D8D0-4FEE-B93E-1B732396**** |
Examples
Success response
JSON format
{
"OrderId": "20413515388****",
"RequestId": "F3CD6886-D8D0-4FEE-B93E-1B732396****"
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | InvalidDataDiskSize.ValueNotSupported | The specified DataDisk.n.Size beyond the permitted range, or the capacity of snapshot exceeds the size limit of the specified disk category. | The specified DataDisk.N.Size parameter is invalid or the snapshot size exceeds the maximum capacity allowed for the specified disk category. |
| 400 | InvalidParameter.Conflict | %s | The specified parameter is invalid. Check whether parameter conflicts exist. %s is a variable. An error message is dynamically returned based on call conditions. |
| 400 | IncompleteParamter | Some fields can not be null in this request. | Some required parameters are not specified. |
| 400 | InvalidRegionId.MalFormed | The specified RegionId is not valid. | |
| 400 | InvalidParam.Type | The specified type is not supported. | The specified Type parameter is invalid. |
| 400 | LastOrderProcessing | The previous order is still processing, please try again later. | The order is being processed. 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 specified disk is a detached system disk, does not support this operation. | |
| 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 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. |
| 400 | NoPermission.Price | The operation requires price permission. Please either apply for permission from your main account, or set the parameter AutoPay as true. | This operation requires price permission. Please apply for permission to your master account, or set the parameter AutoPay to true for automatic payment. |
| 400 | NoPermission.Refund | The operation requires refund permission. Please apply for permission from your main account. | This account does not have permission to operate refund, and the main account needs to authorize refund-related permissions. |
| 400 | InvalidOperation.InstanceRenewWithDowngradeInPlan | The operation is denied due to the specified instance has renew with downgrade record in plan. | There are renewal downgrade orders that have not yet taken effect. This operation is not allowed before the order takes effect. |
| 400 | InvalidSystemDiskSize.ValueNotSupported | The specified system disk size is invalid. | The specified system disk size is invalid. |
| 400 | OperationDenied.UnfinishedOrder | The current instance has unfinished refundOrder, this operation is denied. | |
| 400 | AccountForbidden.CreateOrder | Order cannot be created due to abnormal account. | |
| 500 | InternalError | The request processing has failed due to some unknown error. | |
| 403 | InvalidDataDiskSize.ValueNotSupported | The specified DataDisk.n.Size beyond the permitted range, or the capacity of snapshot exceeds the size limit of the specified disk category. | |
| 403 | OperationDenied | The type of the disk does not support the operation. | The disk category does not support the specified operation. |
| 403 | InvalidDiskSize.TooSmall | Specified new disk size is less than the original disk size. | |
| 403 | InvalidDiskSize.TooLarge | Specified new disk size is beyond the permitted range. | |
| 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 as your disk owing fee. | |
| 403 | IncorrectInstanceStatus | The current status of the resource does not support this operation. | |
| 403 | DiskCreatingSnapshot | The operation is denied due to a snapshot of the specified disk is not completed yet. | |
| 403 | InvalidDiskSize | Specified new disk size is less than or equal the original disk size. | The new disk size must be greater than the original disk size. |
| 403 | Operation.Conflict | The operation may conflicts with others. | |
| 403 | InstanceLockedForSecurity | The instance is locked due to security. | The operation is not supported while the instance is locked for security reasons. |
| 403 | IncorrectDiskStatus | The current disk status does not support this operation. | |
| 403 | UserNotInTheWhiteList | The user is not in disk white list. | You are not authorized to manage the disk. Try again when you are authorized. |
| 403 | InvalidDiskCategory.NotSupported | The specified disk category is not supported. | The specified disk category does not support this operation. |
| 403 | InvalidRegion.NotSupport | The specified region does not support resize online. | Online resizing is not supported in the region. |
| 403 | InvalidInstanceStatus.NotRunning | The status of instance to which the disk attachs must be running when resizing online. | The instance to which the disk is attached is not in the Running state when you resize the disk online. |
| 403 | InvalidOperation.InstanceTypeNotSupportOnlineResize | The instance type of the specified instance does not support resize online. | |
| 403 | InvalidParameter.KMSKeyId.CMKUnauthorized | The CMK needs to be added ECS tag. | |
| 403 | InvalidParameter.KMSKeyId.CMKNotEnabled | The CMK needs to be enabled. | |
| 403 | InvalidParameter.KMSKeyId.KMSUnauthorized | ECS service have no right to access your KMS. | ECS is not authorized to access your KMS resources. |
| 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 resource does not support resize online. | |
| 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 of postpaid data disk capacity exceeds. | The used capacity of the pay-as-you-go disk reaches the quota limit. |
| 403 | InvalidOperation.MultiAttachDiskNotSupportResizeOnline | Multi attach disk does not support resize online. | Disks for which the multi-attach feature is enabled cannot be resized online. |
| 403 | InvalidDataDiskCategory.ValueNotSupported | The specified Category of Data Disk is not valid. | The specified data disk type is not supported. |
| 403 | InvalidDiskSize.NotSupportMultiAttachDisk | The specified disk size exceeds the maximum limit 65536 for enabling multi-attach. | The specified disk size exceeds the maximum limit 65536 for enabling multi-attach. |
| 404 | InvalidDiskId.NotFound | The specified disk does not exist. | The specified disk does not exist. Check whether the disk ID is correct. |
| 404 | InvalidInstanceId.NotFound | The specified InstanceId does not exist. | The specified instanceId is invalid. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.