擴容一塊磁碟,支援擴容系統硬碟和資料盤。
介面說明
擴容前,請務必查詢雲端硬碟採用的分區格式。如果是 MBR 格式,不支援擴容到 2TiB 以上,否則會造成資料丟失。對於 MBR 分區擴容,建議您重新建立並掛載一塊資料盤,採用 GPT 分區格式後,再將已有資料拷貝至新的資料盤上。更多詳情,請參見擴容雲端硬碟容量。
-
支援擴容的磁碟類型包括普通雲端硬碟(
cloud)、高效雲端硬碟(cloud_efficiency)、SSD 雲端硬碟(cloud_ssd)、ESSD 雲端硬碟(cloud_essd)、ESSD AutoPL 雲端硬碟(cloud_auto)、彈性臨時盤-標準版(elastic_ephemeral_disk_standard)和彈性臨時盤-進階版(elastic_ephemeral_disk_premium)、 ESSD 同城冗餘雲端硬碟(cloud_regional_disk_auto)。 -
正在建立快照的雲端硬碟不支援擴容。請您等待快照建立完成後,再開始執行擴容操作。
-
該介面不能擴容分區和檔案系統,您需要在擴容雲端硬碟容量後自行分配分區和檔案系統,具體操作,請參見擴容分區與檔案系統(Linux)和擴容分區與檔案系統(windows)。
-
開啟多重掛載特性的雲端硬碟支援線上擴容和離線擴容,請確保磁碟掛載的執行個體滿足以下條件:
線上擴容時,執行個體狀態為運行中(
Running)。離線擴容時,執行個體狀態為運行中(
Running)或已停止(Stopped)。
-
請確保雲端硬碟滿足以下條件:
調試
您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。
調試
授權資訊
|
操作 |
存取層級 |
資源類型 |
條件關鍵字 |
關聯操作 |
|
ecs:ResizeDisk |
update |
*Disk
|
無 | 無 |
請求參數
|
名稱 |
類型 |
必填 |
描述 |
樣本值 |
| DiskId |
string |
是 |
磁碟 ID。您可以調用 DescribeDisks 查詢磁碟 ID。 |
d-bp67acfmxazb4p**** |
| Type |
string |
否 |
擴容磁碟的方式。取值範圍:
|
offline |
| NewSize |
integer |
是 |
希望擴容到的磁碟容量大小。單位為 GiB。取值範圍:
說明
指定的新磁碟容量必須比原磁碟容量大,否則調用介面將報錯。 |
1900 |
| ClientToken |
string |
否 |
保證請求等冪性。從您的用戶端產生一個參數值,確保不同請求間該參數值唯一。ClientToken 只支援 ASCII 字元,且不能超過 64 個字元。更多資訊,請參見如何保證等冪性。 |
123e4567-e89b-12d3-a456-426655440000 |
返回參數
|
名稱 |
類型 |
描述 |
樣本值 |
|
object |
|||
| OrderId |
string |
產生的訂單 ID。 說明
僅在擴容訂用帳戶雲端硬碟時會返回訂單 ID。 |
20413515388**** |
| RequestId |
string |
請求 ID。 |
F3CD6886-D8D0-4FEE-B93E-1B732396**** |
樣本
正常返回樣本
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 | InvalidParameter.Conflict | %s | 您輸入的參數無效,請檢查參數之間是否衝突。%s為變數,將根據調用API的實際情況動態返回錯誤資訊。 |
| 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 | 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. | 該操作需要價格許可權。請向您的主賬戶申請許可權,或將參數AutoPay設定為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. | 存在未生效的續約降配訂單。訂單生效前不允許此操作。 |
| 400 | InvalidSystemDiskSize.ValueNotSupported | The specified system disk size is invalid. | 無效的系統硬碟大小。 |
| 400 | OperationDenied.UnfinishedOrder | The current instance has unfinished refundOrder, this operation is denied. | 執行個體存在未完成的退款訂單,請耐心等待,稍後重試。 |
| 400 | AccountForbidden.CreateOrder | Order cannot be created due to abnormal account. | 當前帳號不允許建立訂單。 |
| 500 | InternalError | The request processing has failed due to some unknown error. | |
| 403 | 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. | |
| 403 | OperationDenied | The type of the disk 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 | InvalidInstanceStatus.NotRunning | The status of instance to which the disk attachs must be running when resizing 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. | |
| 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. | 開啟多重掛載特性的雲端硬碟不支援線上擴容。 |
| 403 | InvalidDataDiskCategory.ValueNotSupported | The specified Category of Data Disk is not valid. | 指定的資料盤磁碟類型不支援 |
| 403 | InvalidDiskSize.NotSupportMultiAttachDisk | The specified disk size exceeds the maximum limit 65536 for enabling multi-attach. | 大於 64 TB 的磁碟不支援開啟多重掛載 |
| 404 | InvalidDiskId.NotFound | The specified disk does not exist. | 指定的磁碟不存在。請您檢查磁碟 ID 是否正確。 |
| 404 | InvalidInstanceId.NotFound | The specified InstanceId does not exist. | 指定的執行個體ID無效。 |
訪問錯誤中心查看更多錯誤碼。
變更歷史
更多資訊,參考變更詳情。