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 Name | Type | Description Information | Required |
---|---|---|---|
Action | string | Corresponding API command name, the current API is ResizeAttachedDisk . | Yes |
PublicKey | string | The user's public key can be obtained from Console (opens in a new tab) | Yes |
Signature | string | User signature generated based on public key and API command, see Signature Algorithm | Yes |
Request Parameters
Parameter Name | Type | Description Information | Required |
---|---|---|---|
Region | string | Region. See List of Regions and Availability Zones | Yes |
Zone | string | Availability Zone. See Availability Zone List | Yes |
ProjectId | string | Project ID. If not filled in, the default project is used, sub-accounts must be filled in. Please refer to the GetProjectList interface. | No |
UHostId | string | UHost Instance ID. See DescribeUHostInstance. | Yes |
DiskSpace | int | Disk 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 |
DiskId | string | Disk ID. See DescribeUHostInstance return value in DiskSet. | Yes |
DryRun | boolean | Used 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 Name | Type | Description Information | Required |
---|---|---|---|
RetCode | int | Return status code. If it is 0, it means successful return. If it is not 0, it means failure. | Yes |
Action | string | Operation command name. | Yes |
Message | string | Returns an error message, providing detailed description when RetCode is non-zero. | No |
DiskId | string | ID of successfully resized disk | No |
NeedRestart | boolean | The 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
}