This feature allows you to create a snapshot of a specified disk storage device. When creating a snapshot, consider the following:
- A snapshot can only be created when the ECS status is Stopped or Running. However, snapshots cannot be created for newly created instances that have not been activated.
- An error is returned when you create a snapshot immediately after creating an ECS system disk or once adding a data disk by using a snapshot. This is because the system disk or data disk is still loading data. Usually, a snapshot can be created 1 hour after a system disk is created. The size of the disk data determines the time required to create a data disk snapshot.
- After you add the disk, if the instance has never been started, the added disk cannot be used to create snapshots.
- If snapshot creation is incomplete (that is, the progress bar has not reached 100%), this snapshot cannot be used to create a user-defined image.
- If snapshot creation is incomplete (that is, the progress bar has not reached 100%), you may not create another snapshot of the same disk.
- The snapshot quota is determined by the total number of disks owned by the account. The maximum number of snapshots you can create is the number of disks multiplied by 64. For example, in the case of two disks, you can have 2 x 64 = 128 snapshots.
- If the status of the disk is In_use and the OperationLocks of the instance it is attached to indicates LockReason: security, a snapshot cannot be created.
- The instance where a disk is mounted must be started once before the disk can be used to create snapshots.
- If a created independent basic cloud disk has never been mounted, an error message is displayed when you create snapshots.
|DiskId||String||Yes||Indicates the ID of the specified disk.|
|SnapshotName||String||No|| The name of a snapshot instance can be 2 to 128 characters in length and: |
|Description||String||No|| The description of a snapshot can be 2 to 256 characters in length and cannot begin with |
|ClientToken||String||No||Used to make sure the idempotence of the request. The value is generated by a client. The token must be unique among all requests and can contain up to 64 ASCII characters. For more information, see the appendix How to Ensure Idempotence.|
|SnapshotId||String||The snapshot ID.|
|Error code||Error message||HTTP status code||Meaning|
|MissingParameter||The input parameter DiskId that is mandatory for processing this request is not supplied.||400||The required DiskId parameter is missing.|
|InvalidDiskId.NotFound||The specified DiskId does not exist.||404||The specified disk does not exist.|
|InvalidSnapshotName.Malformed||The specified SnapshotName is wrongly formed.||400||The SnapshotName format is invalid.|
|InvalidDescription.Malformed||The specified description is wrongly formed.||404||The Description format is invalid.|
|IncorrectInstanceStatus||The current status of the resource does not support this operation.||400||The status of the specified instance is incorrect.|
|IncorrectDiskStatus.CreatingSnapshot||A previous snapshot creation is in process.||403||A snapshot of the specified disk is being created.|
|InstanceLockedForSecurity||The disk attached instance is locked due to security.||403||The specified instance has a safety lock.|
|IncorrectDiskStatus.NeverAttached||The specified disk has never been attached to any instance.||403||The portable basic cloud disk has not been attached since creation, so the content has not changed.|
|QuotaExceed.Snapshot||The maximum number of snapshots is exceeded.||403||The snapshot quota has been reached.|
|IncorrectDiskStatus.NeverUsed||The specified disk has never been used after creating.||403||The disk has not been used since creation, so the content has not changed.|
|CreateSnapshot.Failed||The process of creating snapshot is failed.||403||Snapshot creation has failed.|
&<Public Request Parameters>