Creates a snapshot-consistent group for the disks of an Elastic Compute Service (ECS) instance. A snapshot-consistent group contains snapshots of one or more disks.
Operation description
您可以设置InstanceId为实例内的指定云盘创建快照一致性组;也可以只使用DiskId.N为同可用区内多台 ECS 实例挂载的多块云盘创建快照一致性组。
DiskId.N不可与ExcludeDiskId.N同时设置。此外,如果设置了InstanceId,则DiskId.N只能设置指定实例内已挂载的云盘,不再支持设置多个跨实例的云盘 ID。
创建快照一致性组时,请注意:
-
待创建快照的云盘必须处于使用中(
In_use)或待挂载(Available)的状态。如果云盘处于使用中(
In_use)的状态,则 ECS 实例状态为运行中(Running)或者已停止(Stopped)。如果云盘处于待挂载(
Available)的状态,则需要保证云盘有过挂载到 ECS 实例的历史操作。从未挂载过 ECS 实例的云盘不支持创建快照。
-
目前快照一致性组只支持 ESSD 系列云盘(ESSD、ESSD AutoPL、ESSD Entry)。
-
单个快照一致性组最多包括 16 块云盘(包括系统盘和数据盘),且总容量不超过 32 TiB。
-
您自行创建的快照会一直保留,请定期删除不再需要的快照,避免快照容量持续扣费。
-
开启多重挂载特性的云盘不支持创建快照一致性组。如果实例挂载了开启多重挂载特性的云盘,您需要设置
ExcludeDiskId.N参数排除该云盘。
关于快照一致性组的功能、计费等信息,请参见快照一致性组。
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
ecs:CreateSnapshotGroup |
create |
Instance
Disk
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| RegionId |
string |
Yes |
The region ID of the instance. You can call the DescribeRegions operation to query the most recent list of regions. |
cn-hangzhou |
| InstanceId |
string |
No |
The instance ID. |
i-j6ca469urv8ei629**** |
| InstantAccess |
boolean |
No |
Specifies whether to enable the instant access feature. Valid values:
Default value: false. Note
This parameter is no longer used. By default, new standard snapshots of ESSDs are upgraded to instant access snapshots free of charge without the need for additional configurations. For more information, see Use the instant access feature. |
false |
| InstantAccessRetentionDays |
integer |
No |
The number of days for which the instant access feature is available. Unit: days. Valid values: 1 to 65535. This parameter takes effect only when This parameter is left empty by default, which indicates that the instant access feature is automatically disabled when the instant access snapshots are released. Note
This parameter is no longer used. By default, new standard snapshots of ESSDs are upgraded to instant access snapshots free of charge without the need for additional configurations. For more information, see Use the instant access feature. |
1 |
| Name |
string |
No |
The name of the snapshot-consistent group. The name must be 2 to 128 characters in length. The name can contain letters, digits, periods (.), underscores (_), hyphens (-), and colons (:). It must start with a letter and cannot start with |
testName |
| Description |
string |
No |
The description of the snapshot-consistent group. The description must be 2 to 256 characters in length and cannot start with |
This is description. |
| ClientToken |
string |
No |
The client token that is used to ensure the idempotence of the request. You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length. For more information, see How to ensure idempotence. |
123e4567-e89b-12d3-a456-426655440000 |
| StorageLocationArn |
string |
No |
Note
This parameter is unavailable for public use. |
null |
| ExcludeDiskId |
array |
No |
The IDs of the cloud disks for which you do not want to create snapshots. After you specify the IDs of cloud disks, the snapshot-consistent group that you create does not contain the snapshots of the specified cloud disks. Valid values of N: 1 to 16. This parameter is empty by default, which indicates that snapshots are created for all disks of the instance. Note
This parameter cannot be set at the same time as the |
d-j6cf7l0ewidb78lq**** |
|
string |
No |
The IDs of the cloud disks for which you do not want to create snapshots. After you specify the IDs of cloud disks, the snapshot-consistent group that you create does not contain the snapshots of the specified cloud disks. Valid values of N: 1 to 16. This parameter is empty by default, which indicates that snapshots are created for all disks of the instance. Note
This parameter cannot be set at the same time as the |
d-j6cf7l0ewidb78lq**** |
|
| DiskId |
array |
No |
The IDs of the cloud disks for which you want to create a snapshot-consistent group. You can specify the IDs of cloud disks that are attached to multiple instances within the same zone. Valid values of N: 1 to 16. A snapshot-consistent group can contain snapshots of up to 16 cloud disks whose total disk size does not exceed 32 TiB. Take note of the following:
|
|
|
string |
No |
The IDs of the cloud disks for which you want to create a snapshot-consistent group. You can specify the IDs of cloud disks that are attached to multiple instances within the same zone. Valid values of N: 1 to 16. A snapshot-consistent group can contain snapshots of up to 16 cloud disks whose total disk size does not exceed 32 TiB. Take note of the following:
|
d-bp1bcpqxahucdrcn**** |
|
| Tag |
array<object> |
No |
The list of tags. |
|
|
object |
No |
|||
| Key |
string |
No |
The key of tag N of the snapshot-consistent group. Valid values of N: 1 to 20. The tag key cannot be an empty string. The tag key can be up to 128 characters in length and cannot start with |
TestKey |
| Value |
string |
No |
The value of tag N of the snapshot-consistent group. Valid values of N: 1 to 20. The tag value can be an empty string. It can be up to 128 characters in length and cannot start with |
TestValue |
| ResourceGroupId |
string |
No |
The ID of the resource group to which the snapshot-consistent group belongs. |
rg-bp67acfmxazb4p**** |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| SnapshotGroupId |
string |
The ID of the snapshot-consistent group. |
ssg-j6ciyh3k52qp7ovm**** |
| RequestId |
string |
The request ID. |
01ABBD93-1ABB-4D92-B496-1A3D20EC0697 |
Examples
Success response
JSON format
{
"SnapshotGroupId": "ssg-j6ciyh3k52qp7ovm****",
"RequestId": "01ABBD93-1ABB-4D92-B496-1A3D20EC0697"
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | InvalidDiskIds.NotInSameZone | The specified disks are not in the same availability zone. | |
| 400 | MissingParamter.InstanceId | The specified InstanceId should not be null. | |
| 400 | InvalidParam.ExcludeDiskIdsAndDiskIds.Conflict | The use of parameter 'ExcludeDiskIds' and 'DiskIds' at the same time is not supported. | |
| 400 | InvalidSnapshotName.Malformed | The specified SnapshotName is wrongly formed. | The format of the specified snapshot name is invalid. |
| 400 | 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. |
| 400 | Duplicate.TagKey | The Tag.N.Key contain duplicate key. | The specified tag key already exists. Tag keys must be unique. |
| 400 | InvalidTagKey.Malformed | The specified Tag.n.Key is not valid. | The specified Tag.N.Key parameter is invalid. |
| 400 | InvalidTagValue.Malformed | The specified Tag.n.Value is not valid. | The specified tag value is invalid. |
| 400 | InvalidRetentionDays.Malformed | The specified RetentionDays is not valid. | The specified RetentionDays parameter is invalid. |
| 400 | DiskCategory.OperationNotSupported | The special disk is encrypted, not support this operate. | |
| 400 | InvalidParameter.Name | The specified Name is invalid. | The specified Name parameter is invalid. |
| 400 | InvalidParameter.Description | The specified Description is invalid. | |
| 500 | InternalError | The request processing has failed due to some unknown error. | |
| 403 | IncorrectDiskStatus.CreatingSnapshot | A previous snapshot creation is in process. | |
| 403 | InstanceLockedForSecurity | The disk attached instance is locked due to security. | |
| 403 | IncorrectDiskStatus.NeverAttached | The specified disk has never been attached to any instance. | |
| 403 | QuotaExceed.Snapshot | The snapshot quota exceeds. | |
| 403 | IncorrectDiskStatus.NeverUsed | The specified disk has never been used after creating. | |
| 403 | CreateSnapshot.Failed | The process of creating snapshot is failed. | |
| 403 | DiskInArrears | The specified operation is denied as your disk has expired. | |
| 403 | DiskId.ValueNotSupported | The specified parameter diskid is not supported. | The specified EBS device category does not support the operation. |
| 403 | IncorrectDiskStatus | The current disk status does not support this operation. | |
| 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 | IncorrectInstanceStatus | The current status of the resource does not support this operation. | |
| 403 | IncorrectVolumeStatus | The current volume status does not support this operation. | |
| 403 | IdempotentParameterMismatch | The specified clientToken is used. | The specified client token is already in use. |
| 403 | IncorrectDiskStatus.Invalid | The specified device status invalid, restart instance and try again. | |
| 403 | IncorrectDiskType.NotSupport | The specified device type is not supported. | The specified disk type does not support the operation. |
| 403 | IncorrectDiskStatus.Transferring | The specified device is transferring, you can retry after the process is finished. | The specified disk is being migrated. Wait until the migration is complete and try again. |
| 403 | InvalidParameter.KMSKeyId.CMKNotEnabled | The CMK needs to be enabled. | |
| 403 | InvalidParameter.KMSKeyId.KMSUnauthorized | ECS service have no right to access your KMS. | ECS is not authorized to access your KMS resources. |
| 403 | IdempotentProcessing | The previous idempotent request(s) is still processing. | A previous idempotent request is being processed. Try again later. |
| 403 | InvalidSnapshotCategory.Malformed | The specified Category is not valid. | The specified Category parameter is invalid. |
| 403 | InvalidOperation.Unauthorized | The specified operation is unauthorized. | |
| 403 | InvalidRegion.NotSupportSnapshotInstantAccessRegion | The snapshot InstantAccess is not supported for this region. | |
| 403 | InvalidCategoryAndInstantAccess.Malformed | The snapshot Category and InstantAccess can't be used together. | |
| 403 | IncorrectDiskStatus.TooManyCreatingSnapshots | The specified disk has too many unfinished snapshots. | |
| 403 | InvalidRegion.NotSupport | The specified region does not support creating snapshot group. | |
| 403 | UserNotInTheWhiteList | The user is not in the white list of creating snapshot group. | |
| 403 | InvalidInstance.NoDisk | There is no disk mounted on the instance. | No disk is mounted on the instance. |
| 403 | NumberExceed.TooManyDisks | The number of all disks in the request exceeds. | The number of disks in the request exceeds the upper limit. |
| 403 | CapacityExceed.TooManyDisks | The capacity of all disks in the request exceeds. | |
| 403 | InvalidOperation.MultiAttachDisk | Multi attach disk does not support this operation. | Disks for which the multi-attach feature is enabled do not support the operation. |
| 403 | InvalidParameter.KMSKeyId.CMKUnauthorized | The CMK needs to be added ECS tag. | |
| 403 | InvalidDisk.DiskCategoryInconsistent | If any specified disk is of a regional disk category, then all disks must also be of that regional disk category. | If any specified disk is of a regional disk category, then all disks must also be of that regional disk category. |
| 403 | QuotaExceed.ConcurrentSnapshotQuota | The number of snapshots being created for the disk %s has exceeded the concurrent quota (%s). Please wait for the previous snapshots to complete before trying again. | The number of snapshots being created for this disk has exceeded the concurrent quota. Please wait for the previous snapshots to complete before trying again. |
| 403 | InvalidDisk.ShareVolume | The specified diskId is invalid. The shared volume does not support creating a snapshot group. | The specified diskId is invalid. The shared volume does not support creating a snapshot group. |
| 403 | InvalidParameter.UnauthorizedStorageLocationArn | The operation has failed due to lack of permission for the specified "StorageLocationArn". Please use a resource with appropriate permission for the operation. | The current operation failed because the specified StorageLocationArn has insufficient permissions. Contact the administrator of the resource to obtain the operation permissions. |
| 403 | InvalidOperation.SnapshotStorageLocationUnsupported | Snapshots with storage location in CloudBox do not support the current operation. | The snapshot of the storage location in the CloudBox does not support the current operation. |
| 403 | InvalidStorageLocationArn.Malformed | The specified parameter StorageLocationArn is wrongly formed. | The format of the specified parameter StorageLocationArn is incorrect. |
| 404 | InvalidDiskId.NotFound | The specified DiskId does not exist. | The specified disk does not exist. Check whether the disk ID is correct. |
| 404 | InvalidDescription.Malformed | The specified description is wrongly formed. | |
| 404 | InvalidInstanceId.NotFound | The specified InstanceId does not exist. | The specified instanceId is invalid. |
| 404 | InvalidVolumeId.NotFound | The specified volume does not exist. | |
| 404 | InvalidRegionId.NotFound | The specified RegionId does not exist. | The specified region ID does not exist. |
| 404 | InvalidKMSKeyId.NotFound | The KMS key used by the disk does not exist. | The KMS key used by the disk does not exist. |
| 404 | InvalidResourceGroup.NotFound | The ResourceGroup provided does not exist in our records. | The specified resource group does not exist. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.