All Products
Search
Document Center

Elastic Compute Service:ResizeDisk

Last Updated:Jul 28, 2026

Expands the capacity of a disk, including system disks and data disks.

Operation description

Note

Before expanding a disk, query the partition format of the disk. If the disk uses the MBR partition format, you cannot expand the disk to more than 2 TiB. Otherwise, data loss may occur. To expand an MBR-partitioned disk, create and attach a new data disk, use the GPT partition format, and then copy the existing data to the new data disk. For more information, see Expand disk capacity.

  • Supported disk types include basic disks (cloud), ultra disks (cloud_efficiency), standard SSDs (cloud_ssd), enterprise SSDs (cloud_essd), ESSD AutoPL disks (cloud_auto), elastic ephemeral disks - Standard (elastic_ephemeral_disk_standard), elastic ephemeral disks - Premium (elastic_ephemeral_disk_premium), and regional ESSDs (cloud_regional_disk_auto).

  • Disks for which snapshots are being created cannot be expanded. Wait until the snapshot creation is complete before expanding the disk.

  • This operation does not expand partitions or file systems. After expanding the disk capacity, you must manually allocate partitions and file systems. For more information, see Expand partitions and file systems (Linux) and Expand partitions and file systems (Windows).

  • Disks with the multi-attach feature enabled support both online and offline expansion. Make sure that the instances to which the disk is attached meet the following conditions:

    • For online scale-out, the instance status must be Running (Running).

    • For offline scale-out, the instance status must be Running (Running) or Stopped (Stopped).

  • Make sure that the disk meets the following conditions:

    • The disk is in the In Use (In Use) or Available (Available) state.

    • (Strongly recommended) A snapshot has been created for the disk to back up data. For more information, see Create a snapshot.

    • If the data disk is newly purchased, initialize the disk before expanding it. For more information, see Initialization overview.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

ecs:ResizeDisk

update

*Disk

acs:ecs:{#regionId}:{#accountId}:disk/{#diskId}

None None

Request parameters

Parameter

Type

Required

Description

Example

DiskId

string

Yes

The disk ID. You can call DescribeDisks to query disk IDs.

d-bp67acfmxazb4p****

Type

string

No

The method used to expand the disk. Valid values:

  • offline (default): offline expansion. After the expansion, you must restart the instance in the console by following the instructions in Restart an instance or by calling the RebootInstance operation for the changes to take effect.

  • online: online expansion. The expansion takes effect without restarting the instance. Supported disk types include ultra disks, standard SSDs, enterprise SSDs, and elastic ephemeral disks.

offline

NewSize

integer

Yes

The new disk capacity that you want to expand to. Unit: GiB. Valid values:

  • System disk:

    • Basic disk: 20 to 500.

    • Enterprise SSD:
      • PL0: 1 to 2048.

      • PL1: 20 to 2048.

      • PL2: 461 to 2048.

      • PL3: 1261 to 2048.

    • ESSD AutoPL disk: 1 to 2048.

    • Other disk types: 20 to 2048.

  • Data disk:

    • Ultra disk (cloud_efficiency): 20 to 32768.

    • Standard SSD (cloud_ssd): 20 to 32768.

    • Enterprise SSD (cloud_essd): The valid values depend on the value of PerformanceLevel. You can call DescribeDisks to query disk information and then check the valid values based on the PerformanceLevel parameter in the response.
      • PL0: 1 to 65536.

      • PL1: 20 to 65536.

      • PL2: 461 to 65536.

      • PL3: 1261 to 65536.

    • Basic disk (cloud): 5 to 2000.

    • ESSD AutoPL disk (cloud_auto): 1 to 65536.

    • Elastic ephemeral disk - Standard (elastic_ephemeral_disk_standard): 64 to 8,192.

    • Elastic ephemeral disk - Premium (elastic_ephemeral_disk_premium): 64 to 8,192.

Note

The specified new disk capacity must be greater than the original disk capacity. Otherwise, an error is returned.

1900

ClientToken

string

No

The client token that is used to ensure the idempotence of the request. You can use the client to generate the token, but make sure that the token is unique among different requests. The ClientToken value can contain only ASCII characters and cannot exceed 64 characters in length. For more information, see How to ensure idempotence.

123e4567-e89b-12d3-a456-426655440000

Response elements

Element

Type

Description

Example

object

OrderId

string

The order ID.

Note

An order ID is returned only when you expand a subscription disk.

20413515388****

RequestId

string

The request ID.

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 is beyond the permitted range; or the capacity of the snapshot exceeds the size limit of 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.
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. This operation is not supported.
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 to true.
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 an unfinished refund order. This operation is denied.
400 AccountForbidden.CreateOrder Order cannot be created due to abnormal account. The current account is not allowed to create orders.
500 InternalError The request processing has failed due to some unknown error.
403 InvalidDataDiskSize.ValueNotSupported The specified DataDisk.n.Size is beyond the permitted range; or the capacity of the 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 because the disk has overdue payments. Please settle the outstanding balance.
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 conflict with others. Please retry later.
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 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 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. A security risk has been detected on your default credit or debit card. Verify your identity by using the link in the 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.