All Products
Search
Document Center

Elastic Compute Service:CreateSnapshotGroup

Last Updated:Nov 14, 2024

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

You can specify InstanceId to create a snapshot-consistent group for disks on a specific ECS instance. You can also specify DiskId.N to create a snapshot-consistent group for multiple disks on multiple ECS instances within the same zone.

Note You cannot specify both DiskId.N and ExcludeDiskId.N in the same request. If you specify InstanceId, you can use DiskId.N to specify only disks on the specified ECS instance and cannot use DiskId.N to specify disks across ECS instances.

Take note of the following items:

  • The disks for which you want to create a snapshot must be in the In Use (In_use) or Unattached (Available) state.

    • If a disk is in the In Use (In_use) state, make sure that the ECS instance to which the disk is attached is in the Running (Running) or Stopped (Stopped) state.
    • If a disk is in the Unattached (Available) state, make sure that the disk has been attached to ECS instances. Snapshots cannot be created for disks that have never been attached to an ECS instance.
  • Snapshot-consistent groups can be used to create snapshots only for Enterprise SSDs (ESSDs), ESSD AutoPL disks, and ESSD Entry disks.

  • A snapshot-consistent group can contain snapshots of up to 16 disks, including system disks and data disks, and cannot exceed 32 TiB in size.

  • Snapshots that you created are stored indefinitely until you delete the snapshots. We recommend that you delete unnecessary snapshots on a regular basis to prevent excess snapshot storage fees.

  • Snapshot-consistent groups cannot be created for disks for which multi-attach feature is enabled. If disks for which the multi-attach feature is enabled are attached to an ECS instance, you must specify the ExcludeDiskId.N parameter to exclude the disks.

For more information about the snapshot-consistent group feature, see Create a snapshot-consistent group.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

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.
OperationAccess levelResource typeCondition keyAssociated operation
ecs:CreateSnapshotGroupcreate
*Instance
acs:ecs:{#regionId}:{#accountId}:instance/{#instanceId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
RegionIdstringYes

The region ID of the instance. You can call the DescribeRegions operation to query the most recent list of regions.

cn-hangzhou
InstanceIdstringNo

The instance ID.

i-j6ca469urv8ei629****
InstantAccessbooleanNo

Specifies whether to enable the instant access feature. Valid values:

  • true
  • false

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
InstantAccessRetentionDaysintegerNo

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 InstantAccess is set to true. The instant access feature is automatically disabled when the specified duration ends.

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
NamestringNo

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 http:// or https://.

testName
DescriptionstringNo

The description of the snapshot-consistent group. The description must be 2 to 256 characters in length and cannot start with http:// or https://.

This is description.
ClientTokenstringNo

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
StorageLocationArnstringNo
Note This parameter is unavailable for public use.
null
ExcludeDiskIdarrayNo

The ID of cloud disk N for which you do not want to create snapshots. If this parameter is specified, the created snapshot-consistent group does not contain snapshots of the cloud disk. Valid values of N: 1 to 16.

This parameter is empty by default, which indicates that snapshots are created for all the disks of the instance.

Note You cannot specify ExcludeDiskId.N and DiskId.N in the same request.
stringNo

The ID of cloud disk N for which you do not want to create snapshots. If this parameter is specified, the created snapshot-consistent group does not contain snapshots of the cloud disk. Valid values of N: 1 to 16.

This parameter is empty by default, which indicates that snapshots are created for all the disks of the instance.

Note You cannot specify ExcludeDiskId.N and DiskId.N in the same request.
d-j6cf7l0ewidb78lq****
DiskIdarrayNo

The ID of cloud disk N for which you want to create snapshots. You can specify multiple cloud disk IDs across instances within the same zone. Valid values of N: 1 to 16. A single 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 items:

  • You cannot specify both DiskId.N and ExcludeDiskId.N in the same request.
  • If InstanceId is set, you can use DiskId.N to specify only cloud disks attached to the instance specified by InstanceId, and you cannot use DiskId.N to specify cloud disks attached to multiple instances.
stringNo

The ID of cloud disk N for which you want to create snapshots. You can specify multiple cloud disk IDs across 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 items:

  • You cannot specify both DiskId.N and ExcludeDiskId.N in the same request.
  • If InstanceId is set, you can use DiskId.N to specify only cloud disks attached to the instance specified by InstanceId, and you cannot use DiskId.N to specify cloud disks attached to multiple instances.
d-bp1bcpqxahucdrcn****
Tagarray<object>No

The list of tags.

objectNo
KeystringNo

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 acs: or aliyun. It cannot contain http:// or https://.

TestKey
ValuestringNo

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 acs:. It cannot contain http:// or https://.

TestValue
ResourceGroupIdstringNo

The ID of the resource group to which the snapshot-consistent group belongs.

rg-bp67acfmxazb4p****

Response parameters

ParameterTypeDescriptionExample
object
SnapshotGroupIdstring

The ID of the snapshot-consistent group.

ssg-j6ciyh3k52qp7ovm****
RequestIdstring

The request ID.

01ABBD93-1ABB-4D92-B496-1A3D20EC0697

Examples

Sample success responses

JSONformat

{
  "SnapshotGroupId": "ssg-j6ciyh3k52qp7ovm****",
  "RequestId": "01ABBD93-1ABB-4D92-B496-1A3D20EC0697"
}

Error codes

HTTP status codeError codeError messageDescription
400InvalidDiskIds.NotInSameZoneThe specified disks are not in the same availability zone.-
400MissingParamter.InstanceIdThe specified InstanceId should not be null.-
400InvalidParam.ExcludeDiskIdsAndDiskIds.ConflictThe use of parameter 'ExcludeDiskIds' and 'DiskIds' at the same time is not supported.-
400InvalidSnapshotName.MalformedThe specified SnapshotName is wrongly formed.The format of the specified snapshot name is invalid.
400IncorrectInstanceStatusThe current status of the resource does not support this operation.The resource is in a state that does not support the current operation.
400Duplicate.TagKeyThe Tag.N.Key contain duplicate key.The specified tag key already exists. Tag keys must be unique.
400InvalidTagKey.MalformedThe specified Tag.n.Key is not valid.The specified Tag.N.Key parameter is invalid.
400InvalidTagValue.MalformedThe specified Tag.n.Value is not valid.The specified tag value is invalid.
400InvalidRetentionDays.MalformedThe specified RetentionDays is not valid.The specified RetentionDays parameter is invalid.
400DiskCategory.OperationNotSupportedThe special disk is encrypted, not support this operate.-
400InvalidParameter.NameThe specified Name is invalid.The specified Name parameter is invalid.
400InvalidParameter.DescriptionThe specified Description is invalid.-
400DiskCategory.OperationNotSupportedThe operation is not supported to the specified disk due to its disk category.The specified disk category does not support this operation.
403IncorrectDiskStatus.CreatingSnapshotA previous snapshot creation is in process.A previous snapshot creation task is in process. Please try again later.
403InstanceLockedForSecurityThe disk attached instance is locked due to security.The instance to which the disk is attached is locked for security reasons.
403IncorrectDiskStatus.NeverAttachedThe specified disk has never been attached to any instance.The removable disk has never been attached to instances and its content remains unchanged.
403QuotaExceed.SnapshotThe snapshot quota exceeds.The maximum number of snapshots has been reached. Delete snapshots that are no longer needed and try again.
403IncorrectDiskStatus.NeverUsedThe specified disk has never been used after creating.The disk has never been used and its data remains unchanged.
403CreateSnapshot.FailedThe process of creating snapshot is failed.Failed to create the snapshot.
403DiskInArrearsThe specified operation is denied as your disk has expired.The disk has expired due to an overdue payment.
403DiskId.ValueNotSupportedThe specified parameter diskid is not supported.The specified EBS device category does not support the operation.
403IncorrectDiskStatusThe 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.
403InvalidAccountStatus.NotEnoughBalanceYour account does not have enough balance.Your account balance is insufficient. Add funds to your account and try again.
403InvalidAccountStatus.SnapshotServiceUnavailableSnapshot service has not been opened yet.The operation is not supported while the snapshot service is not activated.
403IncorrectVolumeStatusThe current volume status does not support this operation.-
403IdempotentParameterMismatchThe specified clientToken is used.The specified client token is already in use.
403IncorrectDiskStatus.InvalidThe specified device status invalid, restart instance and try again.-
403IncorrectDiskType.NotSupportThe specified device type is not supported.The specified disk type does not support the operation.
403IncorrectDiskStatus.TransferringThe 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.
403InvalidParameter.KMSKeyId.CMKNotEnabledThe 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.
403InvalidParameter.KMSKeyId.KMSUnauthorizedECS service have no right to access your KMS.ECS is not authorized to access your KMS resources.
403IdempotentProcessingThe previous idempotent request(s) is still processing.A previous idempotent request is being processed. Try again later.
403QuotaExceed.Tags%sThe number of specified tags exceeds the upper limit. %s is a variable. An error message is dynamically returned based on call conditions.
403InvalidSnapshotCategory.MalformedThe specified Category is not valid.The specified Category parameter is invalid.
403InvalidOperation.UnauthorizedThe specified operation is unauthorized.-
403InvalidRegion.NotSupportSnapshotInstantAccessRegionThe snapshot InstantAccess is not supported for this region.-
403InvalidCategoryAndInstantAccess.MalformedThe snapshot Category and InstantAccess can't be used together.-
403IncorrectDiskStatus.TooManyCreatingSnapshotsThe specified disk has too many unfinished snapshots.-
403InvalidRegion.NotSupportThe specified region does not support creating snapshot group.-
403UserNotInTheWhiteListThe user is not in the white list of creating snapshot group.-
403InvalidInstance.NoDiskThere is no disk mounted on the instance.-
403NumberExceed.TooManyDisksThe number of all disks in the request exceeds.The number of disks in the request exceeds the upper limit.
403CapacityExceed.TooManyDisksThe capacity of all disks in the request exceeds.-
403InvalidDisk.ShareVolume%s-
403InvalidOperation.MultiAttachDiskMulti attach disk does not support this operation.Disks for which the multi-attach feature is enabled do not support the operation.
403IncorrectDiskStatus.InvalidThe specified disk status invalid, restart instance and try again.The state of the specified disk is invalid. Restart the instance and try again.
403InvalidParameter.KMSKeyId.CMKUnauthorizedThe CMK needs to be added ECS tag.-
403InvalidDisk.DiskCategoryInconsistentIf 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.
403QuotaExceed.ConcurrentSnapshotQuotaThe 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.
404InvalidDiskId.NotFoundThe specified DiskId does not exist.The specified disk does not exist. Check whether the disk ID is correct.
404InvalidDescription.MalformedThe specified description is wrongly formed.The resource description is invalid. The description must be 2 to 256 characters in length and cannot start with http:// or https://.
404InvalidInstanceId.NotFoundThe specified InstanceId does not exist.The specified instance does not exist.
404InvalidVolumeId.NotFoundThe specified volume does not exist.The specified Shared Block Storage device does not exist.
404InvalidRegionId.NotFoundThe specified RegionId does not exist.The specified region ID does not exist.
404InvalidKMSKeyId.NotFoundThe KMS key used by the disk does not exist.The KMS key used by the disk does not exist.
500InternalErrorThe request processing has failed due to some unknown error.An internal error has occurred. Try again later.
500InternalErrorThe 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 timeSummary of changesOperation
2024-11-04The Error code has changedView Change Details
2024-10-22The Error code has changedView Change Details
2024-05-08The Error code has changedView Change Details
2023-08-25The Error code has changedView Change Details
2023-08-24The Error code has changedView Change Details