从一台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. | |
| 429 | Throttling | The request was denied due to request throttling. Please retry later. |
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。