從一台ECS執行個體上卸載一塊隨用隨付的資料盤或者系統硬碟。
介面說明
調用該介面時,請注意:
-
該介面為非同步作業,調用成功後等待一分鐘左右才能完成卸載。
-
所掛載的執行個體被安全控制後,
OperationLocks中不能標記為"LockReason" : "security"的鎖定狀態。 -
彈性臨時盤一旦卸載,只能重新掛載至其原始執行個體。
調試
您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。
調試
授權資訊
|
操作 |
存取層級 |
資源類型 |
條件關鍵字 |
關聯操作 |
|
ecs:DetachDisk |
update |
*Disk
*Instance
|
無 | 無 |
請求參數
|
名稱 |
類型 |
必填 |
描述 |
樣本值 |
| InstanceId |
string |
是 |
待卸載的磁碟所綁定的 ECS 執行個體 ID。 |
i-bp67acfmxazb4p**** |
| DiskId |
string |
是 |
待卸載的磁碟 ID。
|
d-bp67acfmxazb4p**** |
| DeleteWithInstance |
boolean |
否 |
卸載系統硬碟或資料盤時,設定自動釋放屬性。表示釋放 ECS 執行個體時,是否同時釋放該系統硬碟或資料盤。
預設值:true 您需要注意:
|
false |
返回參數
|
名稱 |
類型 |
描述 |
樣本值 |
|
object |
|||
| RequestId |
string |
請求 ID。 |
473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E |
樣本
正常返回樣本
JSON格式
{
"RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E"
}
錯誤碼
|
HTTP status code |
錯誤碼 |
錯誤資訊 |
描述 |
|---|---|---|---|
| 400 | InvalidParameter | The input parameter is mandatory for processing this request is empty. | 參數不可為空。 |
| 400 | InvalidRegionId.MalFormed | The specified RegionId is not valid. | |
| 400 | InvalidOperation.InstanceTypeNotSupport | The instance type of the specified instance does not support hot detach disk. | 磁碟掛載的執行個體不支援磁碟熱插拔操作。 |
| 400 | DisksDetachingOnEcsExceeded | The number of disks detaching on the instance exceeds the limit. | 執行個體上正在卸載的磁碟個數超過限制 |
| 400 | InvalidInstanceId.Malformed | The specified parameter InstanceId is not valid. | 指定的參數InstanceId格式有誤。 |
| 500 | InternalError | The request processing has failed due to some unknown error. | |
| 403 | IncorrectDiskStatus | The current disk status does not support this operation. | |
| 403 | DiskNotPortable | The specified disk is not a portable disk. | |
| 403 | InstanceLockedForSecurity | The instance is locked due to security. | 您的資源被安全鎖定,拒絕操作。 |
| 403 | DependencyViolation | The specified disk has not been attached on the specified instance. | |
| 403 | DiskTypeViolation | The specified disk is a system disk and cannot support the operation. | 指定的雲端硬碟是系統硬碟,不能卸載。 |
| 403 | IncorrectInstanceStatus | The current status of the resource does not support this operation. | |
| 403 | UserNotInTheWhiteList | The user is not in disk white list. | 您不在磁碟白名單中,請加入白名單後重試。 |
| 403 | InvalidInstance.ImageCategory | The image category of the specified instance does not support detaching system disk. | 指定執行個體的鏡像狀態不支援卸載指定的系統硬碟。可能原因:建立執行個體時使用的鏡像被刪除。 |
| 403 | DeleteWithInstance.Conflict | Multi attach disk cannot be set to DeleteWithInstance attribute. | 開啟多重掛載特性的雲端硬碟不支援設定 DeleteWithInstance。 |
| 403 | InvalidOperation.DiskCategoryUnsupported | The DetachDisk operation is not supported for elastic ephemeral disk. | 彈性臨時盤不支援單獨卸載 |
| 403 | InvalidParameter.DeleteWithInstance | The DeleteWithInstance for the elastic ephemeral disk must be set to true. | 彈性臨時盤的 DeleteWithInstance 屬性必須設定為 true。 |
| 403 | InvalidOperation.DiskDetachingFromThisEcs | The specified disk is detaching from this ecs. | 磁碟正在從當前執行個體上卸載。 |
| 404 | InvalidInstanceId.NotFound | The specified InstanceId does not exist. | 指定的執行個體ID無效。 |
| 404 | InvalidDiskId.NotFound | The specified disk does not exist. | 指定的磁碟不存在。請您檢查磁碟 ID 是否正確。 |
| 404 | InvalidDisk.AlreadyDetached | The specified disk has been detached. | |
| 404 | InvalidDiskId.OperationNotSupported | The operation is not supported due to base image not exist. |
訪問錯誤中心查看更多錯誤碼。
變更歷史
更多資訊,參考變更詳情。