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

接口说明

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

  • 磁盘的状态必须为使用中In_use),云盘挂载的 ECS 实例的状态必须为已停止Stopped)。
  • 实例首次启动前,不能重新初始化挂载在其上的磁盘。
  • 已存在本地快照的云盘,不能重新初始化。
  • 开启多重挂载特性的云盘,不能重新初始化。
  • 对于系统盘,初始化到镜像的最初状态。若创建云盘的源镜像被删除,则无法初始化。
  • 对于直接创建的数据盘,初始化到空盘状态;对于通过快照创建的数据盘,初始化到快照状态。若源快照已被删除,则无法初始化并返回错误。

流控信息

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

授权信息

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

具体说明如下:展开详情

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

请求参数

字段名称字段详情
DiskIdstring

待初始化的磁盘 ID。

示例值:d-bp67acfmxazb4ph****参考取值来源:
    CreateDisk
    DescribeDisks
Passwordstring

重新初始化系统盘时,是否重置 ECS 实例的用户名密码。长度为 8 至 30 个字符,必须同时包含大小写英文字母、数字和特殊符号中的三类字符。特殊符号可以是:展开详情

示例值:EcsV587!
KeyPairNamestring

密钥对名称。展开详情

示例值:testKeyPairName参考取值来源:
    CreateKeyPair
    DetachKeyPair
    AttachKeyPair
    ImportKeyPair
    DescribeKeyPairs
AutoStartInstanceboolean

重新初始化磁盘后,是否自动启动实例。取值范围:展开详情

示例值:true
SecurityEnhancementStrategystring

当指定的云盘为系统盘时,重新初始化云盘后是否免费使用云安全中心服务。取值范围: 展开详情

示例值:Active

返回参数

字段名称字段详情
RequestIdstring

请求 ID。

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

返回示例

错误返回示例

错误码

全局错误码
HTTP 状态码错误码错误信息操作
400
LoginAsNonRoot.ImageNotSupport
The specified image does not support login as non-root.诊断
400
DiskHasSnapshotsWithInstantAccessEnabled.OperationNotSupported
The operation is not supported to the specified disk that have snapshots with InstantAccess enabled.诊断
400
InvalidPassword.Malformed
The specified parameter "Password" is not valid.诊断
400
InvalidKeyPairName.NotFound
The specified KeyPairName does not exist.诊断
400
DependencyViolation.IoOptimize
The specified parameter InstanceId is not valid.诊断
400
DiskCategory.OperationNotSupported
The operation is not supported to the specified disk due to its disk category.诊断
400
InvalidRegionId.MalFormed
The specified RegionId is not valid.诊断
403
LoginAsNonRoot.RegionNotSupport
The specified region does not support login as non-root.诊断
403
IncorrectDiskStatus
The current disk status does not support this operation.诊断
403
IncorrectInstanceStatus
The current status of the resource does not support this operation.诊断
403
InstanceLockedForSecurity
The instance is locked due to security.诊断
403
InvalidSnapshot.TooOld
The disk is created from a snapshotId made before 2013-07-15, it cannot be re-initiated the specified disk any more since the detached first time.诊断
403
OperationDenied
The snapshot which is used to create the specified disk has been deleted.诊断
403
InstanceExpiredOrInArrears
The specified operation is denied as your prepay instance is expired (prepay mode) or in arrears (afterpay mode).诊断
403
DiskCreatingSnapshot
The operation is denied due to a snapshot of the specified disk is not completed yet.诊断
403
SharedImageDeleted
The specified image by others shared is deleted.诊断
403
DependencyViolation.WindowsInstance
The instance creating is windows, cannot use ssh key pair to login.诊断
403
UserNotInTheWhiteList
The user is not in volume white list.诊断
403
InvalidParameter.KMSKeyId.CMKNotEnabled
The CMK needs to be enabled.诊断
403
InvalidParameter.KMSKeyId.KMSUnauthorized
ECS service have no right to access your KMS.诊断
403
HibernationConfigured.InstanceOperationForbidden
The operation is not permitted due to limit of the hibernation configured instance.诊断
403
InvalidOperation.MultiAttachDisk
Multi attach disk does not support this operation.诊断
403
InvalidParameter.KMSKeyId.CMKUnauthorized
The CMK needs to be added ECS tag.诊断
403
InvalidSourceSnapshot
The source snapshot of the disk has been deleted and cannot support the current operation.诊断
404
InvalidDiskId.NotFound
The specified disk does not exist.诊断
404
InvalidImageId.NotFound
The specified ImageId does not exist.诊断
404
InvalidDiskId.OperationNotSupported
The operation is not supported due to image not exist.诊断
500
InternalError
The request processing has failed due to some unknown error, exception or failure.诊断

变更历史

变更时间变更内容概要操作
2025-02-27
变更错误码403
2023-08-25
变更错误码400
变更错误码403
2021-06-18
变更错误码400
变更错误码403
2021-06-03
变更错误码403

相关示例