調用ResizeDisk接口,并可以指定DiskId、Type等參數,擴容一塊磁盤,支持擴容系統盤和數據盤。
接口說明
-
支持擴容的磁盤類型包括普通云盤(
cloud
)、高效云盤(cloud_efficiency
)、SSD 云盤(cloud_ssd
)、ESSD 云盤(cloud_essd
)、ESSD Entry 云盤(cloud_essd_entry) 、ESSD AutoPL 云盤(cloud_auto)、彈性臨時盤-標準版(elastic_ephemeral_disk_standard)和彈性臨時盤-高級版(elastic_ephemeral_disk_premium)。 -
當磁盤正在創建快照時,不允許擴容。
-
磁盤掛載的實例的狀態必須為運行中(
Running
)或者已停止(Stopped
)。 -
該接口不能擴容分區和文件系統,您需要在擴容云盤容量后自行分配分區和文件系統,具體操作,請參見擴容分區和文件系統。
-
開啟多重掛載特性的云盤支持在線擴容和離線擴容。離線擴容前,您需要確保所掛載的全部實例均為已停止(
Stopped
)狀態。
調試
您可以在OpenAPI Explorer中直接運行該接口,免去您計算簽名的困擾。運行成功后,OpenAPI Explorer可以自動生成SDK代碼示例。
授權信息
請求參數
名稱 | 類型 | 必填 | 描述 | 示例值 |
---|---|---|---|---|
DiskId | string | 是 | 磁盤 ID。您可以調用 DescribeDisks 查詢磁盤 ID。 | d-bp67acfmxazb4p**** |
Type | string | 否 | 擴容磁盤的方式。取值范圍:
| offline |
NewSize | integer | 是 | 希望擴容到的磁盤容量大小。單位為 GiB。取值范圍如下:
說明
指定的新磁盤容量必須比原磁盤容量大。
| 1900 |
ClientToken | string | 否 | 保證請求冪等性。從您的客戶端生成一個參數值,確保不同請求間該參數值唯一。ClientToken 只支持 ASCII 字符,且不能超過 64 個字符。更多信息,請參見如何保證冪等性。 | 123e4567-e89b-12d3-a456-426655440000 |
返回參數
示例
正常返回示例
JSON
格式
{
"OrderId": "20413515388****",
"RequestId": "F3CD6886-D8D0-4FEE-B93E-1B732396****"
}
錯誤碼
HTTP status code | 錯誤碼 | 錯誤信息 | 描述 |
---|---|---|---|
400 | InvalidDataDiskSize.ValueNotSupported | The specified DataDisk.n.Size beyond the permitted range, or the capacity of snapshot exceeds the size limit of the specified disk category. | 指定的 DataDisk.n.Size 超出允許范圍,或者快照的容量超過指定磁盤類別的大小限制。 |
400 | InvalidDataDiskCategory.ValueNotSupported | %s | 指定的數據磁盤類型無效。%s為變量,將根據調用API的實際情況動態返回錯誤信息。 |
400 | InvalidParameter.Conflict | %s | 您輸入的參數無效,請檢查參數之間是否沖突。%s為變量,將根據調用API的實際情況動態返回錯誤信息。 |
400 | InvalidDataDiskSize.ValueNotSupported | %s | 指定的數據盤容量無效。%s為變量,將根據調用API的實際情況動態返回錯誤信息。 |
400 | InvalidSystemDiskSize.ValueNotSupported | %s | 當前操作不支持設置的系統盤大小。 |
400 | IncompleteParamter | Some fields can not be null in this request. | 請求中缺失參數。 |
400 | InvalidRegionId.MalFormed | The specified RegionId is not valid. | 指定的地域不存在,請檢查該參數是否正確。 |
400 | InvalidParam.Type | The specified type is not supported. | 指定的參數Type無效。 |
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 | InvalidSystemDiskSize.ImageNotSupportResize | The specified image does not support resize. | 指定的鏡像不支持擴容。 |
400 | InvalidDisk.DetachedSystemDisk | The specified disk is a detached system disk, does not support this operation. | - |
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. | 指定磁盤類型的已用容量超出可用區配額限制,您可以前往配額中心查詢和申請提升磁盤容量配額。 |
400 | NoPermission.Price | The operation requires price permission. Please either apply for permission from your main account, or set the parameter AutoPay as true. | - |
400 | NoPermission.Refund | The operation requires refund permission. Please apply for permission from your main account. | - |
400 | InvalidOperation.InstanceRenewWithDowngradeInPlan | The operation is denied due to the specified instance has renew with downgrade record in plan. | 存在未生效的續費降配訂單。訂單生效前不允許此操作。 |
403 | OperationDenied | The type of the disk does not support the operation. | 此磁盤種類不支持指定的操作。 |
403 | OperationDenied | The status of the disk or the instance that the disk is attaching with does not support the 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 as your disk owing fee. | 指定的磁盤已欠費。 |
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. | 指定的新磁盤大小必須大于原始磁盤大小。 |
403 | Operation.Conflict | The operation may conflicts with others. | 該操作與其他操作沖突。 |
403 | InstanceLockedForSecurity | The instance is locked due to security. | 您的資源被安全鎖定,拒絕操作。 |
403 | IncorrectDiskStatus | The current disk status does not support this operation. | 當前的磁盤不支持此操作,請您確認磁盤處于正常使用狀態,是否欠費。 |
403 | UserNotInTheWhiteList | The user is not in disk white list. | 您不在磁盤白名單中,請加入白名單后重試。 |
403 | InvalidDiskCategory.NotSupported | The specified disk category is not supported. | 指定的云盤類型不支持當前操作。 |
403 | InvalidRegion.NotSupport | The specified region does not support resize online. | 該地域不支持在線擴容。 |
403 | InvalidDiskCategory.NotSupported | The specified disk category does not support resize online. | 指定的磁盤類型不支持在線擴容。 |
403 | IncorrectInstanceStatus | The current status of the resource does not support resize online. | 當前資源的狀態不支持此操作。 |
403 | InvalidInstanceStatus.NotRunning | The status of instance to which the disk attachs must be running when resizing online. | 在線調整磁盤大小時,磁盤連接到的實例的狀態必須正在運行。 |
403 | IncorrectDiskStatus | The current status of the resource does not support resize online. | - |
403 | InvalidOperation.InstanceTypeNotSupportOnlineResize | The instance type of the specified instance does not support resize online. | - |
403 | InvalidParameter.KMSKeyId.CMKUnauthorized | The CMK needs to be added ECS tag. | CMK 未授權 |
403 | InvalidParameter.KMSKeyId.CMKNotEnabled | The CMK needs to be enabled. | 加密云盤設置了 KMSKeyId 后,CMK必須處于啟用狀態。您可以調用密鑰管理服務的 DescribeKey 接口查詢指定CMK的相關信息。 |
403 | InvalidParameter.KMSKeyId.KMSUnauthorized | ECS service have no right to access your KMS. | ECS 服務無權訪問您的 KMS。 |
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. | 我們檢測到您的默認信用卡或借記卡存在安全風險。請通過電子郵件中的鏈接進行驗證。 |
403 | QuotaExceeded.PostpaidDataDiskCapacity | The quota of postpaid data disk capacity exceeds. | 按量付費數據盤使用容量超出配額。 |
403 | InvalidOperation.MultiAttachDiskNotSupportResizeOnline | Multi attach disk does not support resize online. | 開啟多重掛載特性的云盤不支持在線擴容。 |
404 | InvalidDiskId.NotFound | The specified disk does not exist. | 指定的磁盤不存在。請您檢查磁盤 ID 是否正確。 |
404 | InvalidInstanceId.NotFound | The specified InstanceId does not exist. | 指定的實例ID未找到。 |
500 | InternalError | The request processing has failed due to some unknown error. | 內部錯誤,請重試。 |
500 | InternalError | The request processing has failed due to some unknown error, exception or failure. | 內部錯誤,請重試。 |
訪問錯誤中心查看更多錯誤碼。
變更歷史
變更時間 | 變更內容概要 | 操作 |
---|---|---|
2024-08-23 | OpenAPI 錯誤碼發生變更 | 查看變更詳情 |
2023-10-18 | OpenAPI 錯誤碼發生變更 | 查看變更詳情 |
2023-10-09 | OpenAPI 錯誤碼發生變更 | 查看變更詳情 |
2023-05-16 | OpenAPI 錯誤碼發生變更 | 查看變更詳情 |