Extends the size of a cloud disk.

Description

When you call this interface, consider the following:

  • You can only extend the size of a data disk instead of a system disk.

  • You can only extend the size of a basic cloud disk (Cloud), an ultra cloud disk (Cloud_efficiency), or an SSD cloud disk (Cloud_ssd).

  • You cannot extend the size of a disk when it is used to create a snapshot.

  • If a data disk has been attached to an ECS instance:

    • The instance must be in the Running (Running) or Stopped (Stopped) status.

    • The instance must be restarted  in the ECS console or by calling the API RebootInstance after the size extension.

  • This action only extends the capacity of a data disk, and the partitions and the file system are not modified. After the operation, you must manually allocate the storage space.

Request parameters

Name Type Required Description
Action String Yes The name of this interface. Value: ResizeDisk.
DiskId String Yes The ID of a disk.
NewSize Integer Yes Extends the size of a disk to a specified value.  The unit of measurement is GiB. Value range:
  • For a Basic cloud disk (Cloud): [5, 2000]
  • For an Ultra cloud disk (Cloud_efficiency): [5, 2000]
  • For an SSD cloud disk (Cloud_ssd): [5, 2000]
The value of NewSize must be greater than the former size of your disk. A disk that is smaller than 2,000 GiB cannot be extended to a size more than 2,000 GiB.
ClientToken String No Guarantees the idempotence of the request. The value is generated by a client. The client token must be unique among all requests and can only contain up to 64 ASCII characters. For more information, see How to ensure idempotence.

Response parameters

All parameters are common response parameters. For more information, see Common parameters.

Examples

Request example
https://ecs.aliyuncs.com/?Action=ResizeDisk
&DiskId=xxx
&NewSize=1024
&<Common Request Parameters>
Response example

XML format

<ResizeDiskResponse>
    <RequestId>F3CD6886-D8D0-4FEE-B93E-1B73239673DE</RequestId>
</ResizeDiskResponse>
JSON format
{
    "RequestId": "F3CD6886-D8D0-4FEE-B93E-1B73239673DE"
}

Error codes

Error codes specific to this interface are as follows. For more information, see API Error Center.

Error code Error message HTTP status code Description
DiskCreatingSnapshot The operation is denied due to a snapshot of the specified disk is not completed yet. 403 A snapshot is being created for the specified disk, please try again later.
DiskError IncorrectDiskStatus 403 Abnormal disk status.
DiskInArrears The specified operation is denied as your disk owing fee. 403 Overdue payment on the specified disk.
IncorrectInstanceStatus The current status of the resource does not support this operation. 403 The instance to which the data disk is attached must be in the Running (Running) or Stopped (Stopped) status.
InstanceExpiredOrInArrears The specified operation is denied as your prepay instance is expired (prepay mode) or in arrears (afterpay mode). 403 The instance to which the data disk is attached has been out of service.
InvalidDiskSize.TooLarge Specified new disk size is beyond the permitted range. 403 The maximum size of the specified disk is exceeded.
InvalidDiskSize.TooSmall Specified new disk size is less than the original disk size. 403 The value of NewSize must be greater than the former size of your disk.
OperationDenied The status of the disk or the instance that the disk is attaching with does not support the operation. 403 You can only extend the size of a data disk. Or the instance to which the data disk is attached must be in the Running (Running) or Stopped (Stopped) status.
OperationDenied The type of the disk does not support the operation. 403 You can only extend the size of a Basic cloud disk, an Ultra cloud disk or an SSD cloud disk.
InvalidDiskId.NotFound The specified disk does not exist. 404 The specified DiskId does not exist.
InvalidInstanceId.NotFound The specified InstanceId does not exist. 404 The specified InstanceId does not exist.