ResetDisk - 使用快照回滚云盘

更新时间:
复制 MD 格式

使用云盘快照,将云盘回滚到之前某一特定的历史状态。

接口说明

调用该接口前,请您仔细阅读使用快照回滚云盘。

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

  • 云盘的状态必须为使用中(In_use)或空闲(Available)的状态。

  • 云盘挂载的实例的状态必须为已停止(Stopped)。您可以调用 StopInstances 停止实例。

  • 指定的参数SnapshotId必须是由DiskId创建的历史快照。

  • 通过 DescribeInstances 查询 ECS 实例信息时,如果返回数据中包含{"OperationLocks": {"LockReason" : "security"}},则禁止一切操作。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

调试

授权信息

下表是API对应的授权信息,可以在RAM权限策略语句的Action元素中使用,用来给RAM用户或RAM角色授予调用此API的权限。具体说明如下:

  • 操作:是指具体的权限点。

  • 访问级别:是指每个操作的访问级别,取值为写入(Write)、读取(Read)或列出(List)。

  • 资源类型:是指操作中支持授权的资源类型。具体说明如下:

    • 对于必选的资源类型,用前面加 * 表示。

    • 对于不支持资源级授权的操作,用全部资源表示。

  • 条件关键字:是指云产品自身定义的条件关键字。

  • 关联操作:是指成功执行操作所需要的其他权限。操作者必须同时具备关联操作的权限,操作才能成功。

操作

访问级别

资源类型

条件关键字

关联操作

ecs:ResetDisk

update

*Disk

acs:ecs:{#regionId}:{#accountId}:disk/{#diskId}

*Snapshot

acs:ecs:{#regionId}:{#accountId}:snapshot/{#snapshotId}

无 无

请求参数

名称

类型

必填

描述

示例值

DiskId

string

是

待回滚的云盘 ID。

d-bp199lyny9b3****

SnapshotId

string

是

需要回滚的云盘某一阶段的历史快照 ID。

s-bp199lyny9b3****

DryRun

boolean

否

是否预检本次请求。取值范围:

  • true:发送检查请求,不会直接回滚云盘。检查项包括是否填写了必选参数、请求格式和资源状态限制。如果检查不通过,则返回对应错误信息。如果检查通过,则返回错误码DryRunOperation。

  • false:发送正常请求,通过检查后直接发起云盘回滚操作。

默认值:false。

false

返回参数

名称

类型

描述

示例值

object

RequestId

string

请求 ID。

F3CD6886-D8D0-4FEE-B93E-1B732396****

示例

正常返回示例

JSON格式

{
  "RequestId": "F3CD6886-D8D0-4FEE-B93E-1B732396****"
}

错误码

HTTP status code

错误码

错误信息

描述

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.
400 DryRunOperation Request validation has been passed with DryRun flag set. 通过“DryRun”校验,您的请求已通过验证。
400 InternalError The requested services is not available now. Please try again later. 内部发生错误,请重试。
500 InternalError The request processing has failed due to some unknown error.
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 InvalidParameter.Mismatch The specified snapshot is not created from the specified disk.
403 InvalidSnapshot.TooOld The snapshot was created before 2013-07-15 and cannot be restored since the disk was first detached.
403 InstanceExpiredOrInArrears The specified operation is denied as your prepay instance is expired (prepay mode) or in arrears (afterpay mode).
403 OperationDenied The specified snapshot dees not support ResetDisk.
403 InvalidSnapshotId.NotReady The specified snapshot has not completed yet.
403 InvalidAccountStatus.NotEnoughBalance Your account does not have enough balance.
403 InvalidAccountStatus.SnapshotServiceUnavailable Snapshot service has not been opened yet. 快照服务未开通,操作无法执行。
403 Operation.Conflict The operation may conflict with others. Please retry later.
403 UserNotInTheWhiteList The user is not in disk white list. 您不在磁盘白名单中,请加入白名单后重试。
403 InvalidParameter.KMSKeyId.CMKUnauthorized The CMK has not authorized the ECS service to perform the KMS TagResource and UntagResource operations. Please verify the authorization and try again.
403 InvalidParameter.KMSKeyId.CMKNotEnabled The CMK needs to be enabled.
403 InvalidParameter.KMSKeyId.KMSUnauthorized ECS service does not have permission to access your KMS key. Please verify that the specified KMS key has authorized the ECS service.
403 IncorrectDiskStatus.HasUnfinishedSnapshot The current disk has unfinished snapshot. 当前磁盘有未完成快照。
403 InvalidOperation.DiskResetInProgress The operation cannot be performed because the disk has an ongoing reset task. Please try again later.
404 InvalidParameter.KMSKeyId.NotFound The specified KMSKeyId does not exist. Please verify that the key ID is correct and that the key resides in the current region.
404 InvalidDiskId.NotFound The specified disk does not exist. 指定的磁盘不存在。请您检查磁盘 ID 是否正确。
404 Disk.NotFound The specified disk does not exist. 指定的磁盘不存在,请您检查磁盘是否正确。
404 InvalidSnapshotId.NotFound The specified SnapshotId does not exist.
404 InvalidInstanceId.NotFound The specified InstanceId does not exist. 指定的实例ID无效。

访问错误中心查看更多错误码。

变更历史

更多信息,参考变更详情。