DetachDisk_云服务器 ECS_API文档

插件下载了解更多
VS Code 插件
安装插件之前,确保已安装 VS Code安装插件之前,确保已安装 VS Code
Alibaba Cloud Developer Toolkit is a collection of extensions that can help access Alibaba Cloud services in Visual Studio Code.
JetBrains 插件
安装插件之前,确保已安装 JetBrains IDE安装插件之前,确保已安装 JetBrains IDE
The Alibaba Cloud Developer Toolkit for JetBrains makes it easier to access Alibaba Cloud services.

接口说明

调用该接口时,请注意:

  • 该接口为异步操作,调用成功后等待一分钟左右才能完成卸载。

  • 所挂载的实例被安全控制后,OperationLocks中不能标记为"LockReason" : "security"的锁定状态。

  • 弹性临时盘一旦卸载,只能重新挂载至其原始实例。

流控信息

请求速率为500/60(s)。更多流控信息,请前往配额中心查看

授权信息

如下是此API对应的授权信息,用于RAM权限策略语句的Action元素中,为RAM用户或RAM角色授予调用此API的权限。请通过 RAM 访问控制设置,使用方法可参考访问控制帮助文档

具体说明如下:展开详情

操作访问级别资源类型条件关键字关联操作
ecs:DetachDisk
Update
Disk
acs:ecs:{#regionId}:{#accountId}:disk/{#diskId}
Instance
acs:ecs:{#regionId}:{#accountId}:instance/{#instanceId}

请求参数

字段名称字段详情
InstanceIdstring

待卸载的磁盘所绑定的 ECS 实例 ID。

示例值:i-bp67acfmxazb4p****参考取值来源:
    RunInstances
    StopInstances
    CreateInstance
    StartInstances
    RebootInstances
    DescribeInstances
    ModifyManagedInstance
    RenewReservedInstances
    AttachInstanceRamRole
    DetachInstanceRamRole
    DeregisterManagedInstance
    PurchaseReservedInstancesOffering
DiskIdstring

待卸载的磁盘 ID。展开详情

示例值:d-bp67acfmxazb4p****参考取值来源:
    CreateDisk
    DescribeDisks
DeleteWithInstanceboolean

卸载系统盘或数据盘时,设置自动释放属性。表示释放 ECS 实例时,是否同时释放该系统盘或数据盘。展开详情

示例值:false

返回参数

字段名称字段详情
RequestIdstring

请求 ID。

示例值:473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E

返回示例

错误码

全局错误码
HTTP 状态码错误码错误信息操作
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.诊断
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.诊断
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.诊断
403
InvalidOperation.DiskDetachingFromThisEcs
The specified disk is detaching from this ecs.诊断
404
InvalidInstanceId.NotFound
The specified InstanceId does not exist.诊断
404
InvalidDiskId.NotFound
The specified disk does not exist.诊断
404
InvalidDisk.AlreadyDetached
The specified disk has been detached.诊断
404
InvalidDiskId.OperationNotSupported
The operation is not supported due to base image not exist.诊断
500
InternalError
The request processing has failed due to some unknown error.诊断

变更历史

变更时间变更内容概要操作
2024-09-20
变更错误码403
2024-07-24
变更错误码403
2024-05-09
删除返回参数
2024-04-15
变更错误码400
2023-11-24
变更错误码403
2021-06-03
变更错误码403

相关示例

从ECS实例中卸载磁盘->删除磁盘
2021-01-14
磁盘相关
2022-03-21