ResizeDisk

Last Updated: Jan 26, 2018

Description

Extends the size of a cloud disk. 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).

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

    • The instance must be in the Running or 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 size extension, 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 Extend the size of a disk to a specified value. The unit of measurement is GB. 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 GB cannot be extended to a size more than 2,000 GB.
ClientToken String No Used to guarantee 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 indempotence.

Response parameters

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

Examples

Request example

  1. https://ecs.aliyuncs.com/?Action=ResizeDisk
  2. &DiskId=xxx
  3. &NewSize=1024
  4. &<Common Request Parameters>

Response example

XML format

  1. <ResizeDiskResponse>
  2. <RequestId>F3CD6886-D8D0-4FEE-B93E-1B73239673DE</RequestId>
  3. </ResizeDiskResponse>

JSON format

  1. {
  2. "RequestId": "F3CD6886-D8D0-4FEE-B93E-1B73239673DE"
  3. }

Error codes

Error code Error message HTTP status code Meaning
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 or 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 or 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.
Thank you! We've received your feedback.