AttachDisk_云服务器 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.

接口说明

调用该接口时,您需要注意:

  • 实例和磁盘必须在同一个可用区。

  • 磁盘的状态必须为待挂载Available)。

  • 挂载数据盘时:

    • 目标 ECS 实例必须处于运行中Running)或者已停止Stopped)状态。
    • 如果是您单独购买的磁盘,计费方式必须是按量付费。
    • 从 ECS 实例上卸载的系统盘作为数据盘挂载时,不限制计费方式。
    • 弹性临时盘一旦卸载,只能重新挂载至其原始实例。
  • 挂载系统盘时:

    • 目标 ECS 实例必须是卸载该系统盘时的源实例。
    • 目标 ECS 实例必须处于已停止Stopped)状态。
    • 您必须设置实例登录凭证。
    • 弹性临时盘不支持挂载为系统盘。
    • 更多关于挂载系统盘的信息,请参见卸载或挂载系统盘
  • 查询 ECS 实例信息时,如果返回数据中包含{"OperationLocks": {"LockReason" : "security"}},则禁止一切操作。

  • 开启多重挂载特性的云盘,只能挂载到支持 NVMe 协议的实例上。 更多信息,请参见ESSD 云盘支持 NVMe以及使用多重挂载功能

流控信息

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

授权信息

当前云产品暂无权限信息透出。

请求参数

字段名称字段详情
InstanceIdstring

待挂载 ECS 实例的 ID。

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

待挂载的磁盘 ID。磁盘(DiskId)和实例(InstanceId)必须在同一个可用区。展开详情

示例值:d-bp1j4l5axzdy6ftk****参考取值来源:
    CreateDisk
    DescribeDisks
Devicestring

磁盘设备名称。展开详情

示例值:testDeviceName
DeleteWithInstanceboolean

释放实例时,该磁盘是否随实例一起释放。取值范围:展开详情

示例值:false
Bootableboolean

是否作为系统盘挂载。取值范围:展开详情

示例值:false
Passwordstring

挂载系统盘时,设置实例的用户名密码,仅对 administrator 和 root 用户名生效,其他用户名不生效。长度为 8 至 30 个字符,必须同时包含大小写英文字母、数字和特殊符号中的三类字符。特殊符号可以是:展开详情

示例值:EcsV587!
KeyPairNamestring

挂载系统盘时,为 Linux 系统 ECS 实例绑定的 SSH 密钥对的名称。展开详情

示例值:KeyPairTestName参考取值来源:
    CreateKeyPair
    DetachKeyPair
    ImportKeyPair
    AttachKeyPair
    DescribeKeyPairs
Forceboolean

是否是强制挂载请求。取值范围:展开详情

示例值:false

返回参数

字段名称字段详情
RequestIdstring

请求 ID。

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

返回示例

错误返回示例

错误码

全局错误码
HTTP 状态码错误码错误信息操作
400
InvalidDevice.Malformed
The specified device is not valid.诊断
400
IncorrectInstanceStatus
The current status of the resource does not support this operation.诊断
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 attach disk.诊断
400
DiskCategory.OperationNotSupported
The operation is not supported to the specified disk due to its disk category.诊断
400
InvalidDisk.DiskNotBootable
The specified disk is not a bootable disk, can not be attached as system disk.诊断
400
InvalidInstance.NotOriginInstance
The specified disk can not attached to other instance as system disk.诊断
400
InvalidParameterForce.DiskCategoryNotSupported
The specified disk category does not support force attach operation.诊断
400
InvalidParameterForce.PrepaidDiskNotSupported
The prepaid disk does not support force attach operation.诊断
400
InvalidParameterForce.MultiAttachDiskNotSupported
The multi attach disk does not support force attach operation.诊断
400
InvalidParameterForce.RegionNotSupported
The specified region does not support force attach operation.诊断
400
OperationConflict.DisksAttachingParallellyExceed
The number of disks attaching parallelly exceeds the limit.诊断
403
InstanceDiskLimitExceeded
The amount of the disk on instance in question reach its limits.诊断
403
InvalidDevice.InUse
The specified device has been occupied.诊断
403
DiskNotPortable
The specified disk is not a portable disk.诊断
403
InstanceLockedForSecurity
The instance is locked due to security.诊断
403
ResourcesNotInSameZone
The specified instance and disk are not in the same zone.诊断
403
InstanceExpiredOrInArrears
The specified operation is denied as your prepay instance is expired (prepay mode) or in arrears (afterpay mode).诊断
403
DiskInArrears
The specified operation is denied as your disk owing fee.诊断
403
DiskError
IncorrectDiskStatus.诊断
403
DiskId.ValueNotSupported
The specified parameter diskid is not supported.诊断
403
DiskId.StatusNotSupported
The specified disk status is not supported.诊断
403
IncorrectInstanceStatus.NotSupportESSD
The operation is not supported in this status, please reboot the instance.诊断
403
IncorrectDiskStatus
The operation is not supported in this status.诊断
403
UserNotInTheWhiteList
The user is not in disk white list.诊断
403
InvalidParameter.KMSKeyId.CMKNotEnabled
The CMK needs to be enabled.诊断
403
InvalidParameter.KMSKeyId.CMKUnauthorized
The CMK needs to be added ECS tag.诊断
403
InvalidParameter.KMSKeyId.KMSUnauthorized
ECS service have no right to access your KMS.诊断
403
DependencyViolation.WindowsInstance
The instance image is windows, cannot use ssh key pair to login.诊断
403
InvalidInstanceType.NotSupportDiskCategory
The instanceType of the specified instance does not support this disk category.诊断
403
InvalidInstanceType.NotSupportPL0
The instanceType of the specified instance does not support PL0 of cloud_essd.诊断
403
InvalidInstanceType.NvmeRequired
The instanceType of the specified instance requires nvme protocol.诊断
403
InvalidInstanceType.NvmeUnsupported
The instanceType of the specified instance does not support nvme protocol.诊断
403
InvalidInstanceType.NotSupportMultiAttachDisk
The instanceType of the specified instance does not support multi attach disk.诊断
403
DiskAttachedNumberExceeded
The attaching times of the specified disk exceeded.诊断
403
InvalidOperation.CanNotAttachMultiAttachDiskAsSystemDisk
Multi attach disk can not be attached as system disk.诊断
403
DeleteWithInstance.Conflict
Multi attach disk cannot be set to DeleteWithInstance attribute.诊断
403
InvalidParameter.DeleteWithInstance
The DeleteWithInstance for the elastic ephemeral disk must be set to true.诊断
403
InvalidOperation.OtherInstanceUnsupported
The elastic ephemeral disk can only be attached to the instance it was last mounted on, please check the disk's system tag to get the last associated instance.诊断
403
InvalidInstance.ZoneConflict
The force attach operation is not supported when both the current and target instances are in the same zone.诊断
403
InvalidParameter.AllEmpty
The current operation requires either a password or a keyPairName to must be provided. Please ensure that at least one of them is not empty.诊断
403
InvalidOperation.DiskQueueNumberNotEnough
The number of disk queues on the instance is not enough.诊断
404
InvalidInstanceId.NotFound
The specified InstanceId does not exist.诊断
404
InvalidDiskId.NotFound
The specified disk does not exist.诊断
404
InvalidDisk.InUse
The specified disk has been occupied.诊断
404
DiskAttachedNumberExceeded
The attaching times of the specified disk exceeded.诊断
404
InvalidKMSKeyId.NotFound
The KMS key used by the disk does not exist.诊断
500
InternalError
The request processing has failed due to some unknown error, exception or failure.诊断

变更历史

变更时间变更内容概要操作
2025-01-14
变更错误码500
2025-01-06
变更错误码403
2024-12-30
变更错误码400
变更错误码403
2024-11-27
变更错误码400
2024-07-08
变更错误码404
  • 1
  • 2
  • 10 条/页