Rolls back a disk to a previous state by using a disk snapshot.
Operation description
Before you call this operation, read Roll back a disk by using snapshots.
When you call this operation, take note of the following items:
The disk must be in the In Use (
In_use) or Available (Available) state.The instance to which the disk is attached must be in the Stopped (
Stopped) state. You can call StopInstances to stop an instance.The specified SnapshotId parameter must be a historical snapshot created from the disk specified by DiskId.
When you call DescribeInstances to query ECS instance information, if the response contains
{"OperationLocks": {"LockReason" : "security"}}, all operations on the instance are prohibited.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
ecs:ResetDisk |
update |
*Disk
*Snapshot
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| DiskId |
string |
Yes |
The ID of the disk to be rolled back. |
d-bp199lyny9b3**** |
| SnapshotId |
string |
Yes |
The ID of the snapshot to use for rolling back the disk. |
s-bp199lyny9b3**** |
| DryRun |
boolean |
No |
Specifies whether to perform a dry run. Valid values:
Default value: false. |
false |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| RequestId |
string |
The request ID. |
F3CD6886-D8D0-4FEE-B93E-1B732396**** |
Examples
Success response
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. | |
| 400 | DryRunOperation | Request validation has been passed with DryRun flag set. | Your request is determined as valid when the DryRun parameter is set. |
| 400 | InternalError | The requested services is not available now. Please try again later. | An internal error has occurred. 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. | 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. | |
| 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. | The operation is not supported while the snapshot service is not activated. |
| 403 | Operation.Conflict | The operation may conflict with others. Please retry later. | |
| 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 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. | The specified disk has incomplete snapshots. |
| 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. | 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. | |
| 404 | InvalidInstanceId.NotFound | The specified InstanceId does not exist. | The specified instanceId is invalid. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.