Rolls back a disk to the state at a specific point in time based on a snapshot of the disk.
Operation description
When you call this operation, take note of the following items:
- The disk must be in the In Use (In_Use) or Unattached (Available) state.
- The Elastic Compute Service (ECS) instance to which the disk is attached must be in the Stopped (Stopped) state. You can call the StopInstances operation to stop an instance.
- The snapshot specified by the SnapshotId parameter must be created from the disk specified by the DiskId parameter.
- When you call the DescribeInstances operation to query instance information and the response contains
{"OperationLocks": {"LockReason" : "security"}}
, then this indicates that the instance is locked for security reasons and no operations can be performed on the instance.
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action
policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- The required resource types are displayed in bold characters.
- If the permissions cannot be granted at the resource level,
All Resources
is used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
ecs:ResetDisk | update | *Disk acs:ecs:{#regionId}:{#accountId}:disk/{#diskId} *Snapshot acs:ecs:{#regionId}:{#accountId}:snapshot/{#snapshotId} |
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
DiskId | string | Yes | The ID of the disk that you want to roll back. | d-bp199lyny9b3**** |
SnapshotId | string | Yes | The ID of the snapshot that you want to use to roll back the disk. | s-bp199lyny9b3**** |
DryRun | boolean | No | Specifies whether to check the validity of the request without actually making the request. Valid values:
Default value: false | false |
Response parameters
Examples
Sample success responses
JSON
format
{
"RequestId": "F3CD6886-D8D0-4FEE-B93E-1B732396****"
}
Error codes
HTTP status code | Error code | Error message | Description |
---|---|---|---|
400 | DiskCategory.OperationNotSupported | The operation is not supported to the specified disk due to its disk category. | The specified disk category does not support this operation. |
400 | InvalidRegionId.MalFormed | The specified RegionId is not valid. | The specified region does not exist. |
400 | DryRunOperation | Request validation has been passed with DryRun flag set. | Your request is determined as valid when the DryRun parameter is set. |
403 | IncorrectDiskStatus | The current disk status does not support this operation. | The disk is in a state that does not support the current operation. Make sure that the disk is available and that your account has no overdue payments. |
403 | IncorrectInstanceStatus | The current status of the resource does not support this operation. | The resource is in a state that does not support the current operation. |
403 | InstanceLockedForSecurity | The instance is locked due to security. | The operation is not supported while the instance is locked for security reasons. |
403 | InvalidParameter.Mismatch | The specified snapshot is not created from the specified disk. | An encrypted snapshot cannot be used to roll back an unencrypted disk. |
403 | InvalidParameter.Mismatch | Non-encrypted disk can not be reset by encrypted snapshot. | - |
403 | InvalidSnapshot.TooOld | The snapshotId is created before 2013-07-15, it cannot be restored since the first time the disk detached. | Snapshots created before July 15, 2013 do not support this operation. |
403 | InstanceExpiredOrInArrears | The specified operation is denied as your prepay instance is expired (prepay mode) or in arrears (afterpay mode). | The subscription instance has expired. You must renew the instance before you can proceed. |
403 | OperationDenied | The specified snapshot dees not support ResetDisk. | The specified snapshot cannot be used to reset the disk. |
403 | InvalidSnapshotId.NotReady | The specified snapshot has not completed yet. | The specified snapshot is being created. |
403 | InvalidAccountStatus.NotEnoughBalance | Your account does not have enough balance. | Your account balance is insufficient. Add funds to your account and try again. |
403 | InvalidAccountStatus.SnapshotServiceUnavailable | Snapshot service has not been opened yet. | The operation is not supported while the snapshot service is not activated. |
403 | Operation.Conflict | The operation may conflicts with others. | The operation conflicts with other operations. |
403 | UserNotInTheWhiteList | The user is not in disk white list. | You are not authorized to manage the disk. Try again when you are authorized. |
403 | InvalidParameter.KMSKeyId.CMKUnauthorized | The CMK needs to be added ECS tag. | - |
403 | InvalidParameter.KMSKeyId.CMKNotEnabled | The CMK needs to be enabled. | The customer master key (CMK) is not enabled when KMSKeyId is specified for an encrypted disk. You can call the DescribeKey operation of KMS to query information about the specified CMK. |
403 | InvalidParameter.KMSKeyId.KMSUnauthorized | ECS service have no right to access your KMS. | ECS is not authorized to access your KMS resources. |
403 | IncorrectDiskStatus.HasUnfinishedSnapshot | The current disk has unfinished snapshot. | - |
404 | InvalidParameter.KMSKeyId.NotFound | The specified KMSKeyId does not exist. | The specified KMSKeyId parameter does not exist. |
404 | InvalidDiskId.NotFound | The specified disk does not exist. | The specified disk does not exist. Check whether the disk ID is correct. |
404 | Disk.NotFound | The specified disk does not exist. | The specified disk does not exist. Check whether the disk ID is correct. |
404 | InvalidSnapshotId.NotFound | The specified SnapshotId does not exist. | The specified snapshot ID does not exist. |
404 | InvalidInstanceId.NotFound | The specified InstanceId does not exist. | The specified instance does not exist. |
500 | InternalError | The request processing has failed due to some unknown error. | An internal error has occurred. Try again later. |
500 | InternalError | The request processing has failed due to some unknown error, exception or failure. | An internal error has occurred. Try again later. |
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|---|---|
2023-08-25 | The Error code has changed | View Change Details |