Docs
api
UHost(UHost)
ResizeAttachedDisk

Modify the size of the mounted disk - ResizeAttachedDisk

Overview

Modify the size of the mounted disk, including the system disk and data disk.

ℹ️ 1. Expansion during the power-on state may require a shutdown and restart to take effect, which can be predicted by DryRun. 2. After modifying the disk space size, please follow the instructions to enter the operating system for operation after startup.

Definition

Public Parameters

Parameter NameTypeDescription InformationRequired
ActionstringCorresponding API command name, the current API is ResizeAttachedDisk.Yes
PublicKeystringThe user's public key can be obtained from Console (opens in a new tab)Yes
SignaturestringUser signature generated based on public key and API command, see Signature AlgorithmYes

Request Parameters

Parameter NameTypeDescription InformationRequired
RegionstringRegion. See List of Regions and Availability ZonesYes
ZonestringAvailability Zone. See Availability Zone ListYes
ProjectIdstringProject ID. If not filled in, the default project is used, sub-accounts must be filled in. Please refer to the GetProjectList interface.No
UHostIdstringUHost Instance ID. See DescribeUHostInstance.Yes
DiskSpaceintDisk size, unit GB, step size is 10. The value range needs to be larger than the current disk size, for the maximum value please refer to Disk Type.Yes
DiskIdstringDisk ID. See DescribeUHostInstance return value in DiskSet.Yes
DryRunbooleanUsed to test whether the disk supports online expansion. DryRun=true, no actual operation will be performed, only the expected result of the operation will be returned. DryRun = false, the expansion operation will be executed normally.No

Response Field

Field NameTypeDescription InformationRequired
RetCodeintReturn status code. If it is 0, it means successful return. If it is not 0, it means failure.Yes
ActionstringOperation command name.Yes
MessagestringReturns an error message, providing detailed description when RetCode is non-zero.No
DiskIdstringID of successfully resized diskNo
NeedRestartbooleanThe status after expansion. NeedRestart = true, you must shut down and start the instance to use the expanded disk space. NeedRestart = false, no restart operation is needed after the disk is expanded.No

Example

Request Example

https://api.ucloud-global.com/?Action=ResizeAttachedDisk
&Region=cn-sh2
&Zone=cn-sh2-02
&UHostId=uhost-qfbc2i
&DiskId=bs-w5oyip
&DiskSpace=40
&DryRun=false

Response Example

{
  "Action": "ResizeAttachedDiskResponse",
  "DiskId": "bs-w5oyip",
  "NeedRestart": "yvzCZZig",
  "RetCode": 0
}