IBM Cloud Docs
Managing snapshot consistency groups

Managing snapshot consistency groups

A snapshot consistency group contains snapshots of multiple volumes that are attached to the same virtual server instance. The snapshots are loosely coupled. So, you can manage the snapshots within a consistency group in the same way that you manage any other snapshot. You can rename or delete individual snapshots from the consistency group if you want to. Or you can keep individual snapshots after you decide to delete the consistency group.

If you update the backup consistency group to keep the individual snapshots after the consistency group is deleted, a backup job is not created when the consistency group is deleted. The system creates an event in the Activity Tracker when the consistency group is deleted.

Updating a consistency group in the UI

  1. Go to the list of snapshot consistency groups. In the IBM Cloud console, click the Navigation Menu menu icon > VPC Infrastructure VPC icon > Storage > Block Storage Snapshots.
  2. On the Consistency groups tab, click the name of a group on the list to display the consistency group details.
  3. You can change the following attributes:
    • To change the name on the group, click the pencil icon and enter the new name.
    • Switch the toggle to enable or disable the deletion of the snapshots when the consistency group is deleted.

Deleting a consistency group in the UI

  1. Go to the list of snapshot consistency groups. In the IBM Cloud console, click the Navigation Menu menu icon > VPC Infrastructure VPC icon > Storage > Block Storage Snapshots.
  2. On the Consistency groups tab, click the name of a group on the list.
  3. Click the Actions > Delete.
  4. Type Delete.
  5. Click Delete.

Updating a consistency group from the CLI

You can update a consistency group from the CLI by running the following command. You can use the CLI to update the name of the resource and switch the delete_snapshots_on_delete property to keep the snapshots after the snapshot consistency group is deleted.

ibmcloud is snapshot-consistency-group-update CONSISTENCY_GROUP_ID

The following example changes the consistency group name. It identifies the consistency group by name. You can also use the ID of the consistency group with this command.

ibmcloud is snapshot-consistency-group-update multiple-snapshots-consistency-group-1 --name my-consistency-group               

Updating snapshot consistency group multiple-snapshots-consistency-group-1 under account Test Account as user test.user@ibm.com...
                               
ID                          r174-ed7c034e-9bd1-4474-83d0-f5b050f1490a   
Name                        my-consistency-group   
CRN                         crn:v1:bluemix:public:is:us-south:a/a1234567::snapshot-consistency-group:r174-ed7c034e-9bd1-4474-83d0-f5b050f1490a   
Href                        https://us-south.iaas.cloud.ibm.com/v1/snapshot_consistency_groups/r174-ed7c034e-9bd1-4474-83d0-f5b050f1490a   
Status                      stable   
Backup policy plan          -   
Delete snapshot on delete   true   
Source Snapshot             -   
Resource group              ID                                 Name      
                            11caaa983d9c4beb82690daab08717e9   Default      
                               
Created                     2023-08-25T10:55:37+05:30   
Service Tags                -   

For more information about available command options, see ibmcloud is snapshot-consistency-group-update.

Deleting a consistency group from the CLI

You can delete a consistency group from the CLI by running the following command.

ibmcloud is snapshot-consistency-group-delete CONSISTENCY_GROUP_ID

The following example deletes two consistency groups that are identified by their names.

$ ibmcloud is snapshot-consistency-group-delete snapshot-consistency-group-1 snapshot-consistency-group-2

This will delete snapshot consistency group snapshot-consistency-group-1, snapshot-consistency-group-2 and cannot be undone. Continue [y/N] ?> y

Deleting snapshot consistency group snapshot-consistency-group-1, snapshot-consistency-group-2 under account Test account as user test.user@ibm.com...
OK

Deletion request for snapshot consistency groups snapshot-consistency-group-1, snapshot-consistency-group-2 has been accepted.

For more information about available command options, see ibmcloud is snapshot-consistency-group-delete.

Updating a consistency group with the API

You can programmatically update a consistency group by calling the /snapshot_consistency_groups/{id} method in the VPC API as shown in the following sample request. You can use the API to update the name of the resource and switch the delete_snapshots_on_delete property to keep the snapshots after the snapshot consistency group is deleted.

curl -X PATCH\
"$vpc_api_endpoint/v1/snapshot_consistency_groups/$consistency_group_id?version=2023-12-05&generation=2" 
-H "Authorization: $iam_token"
-d "{\
   "delete_snapshot_on_delete_snapshot_consistency_group":false,\
   "name":"my-snapshot-consistency-group"}"

Deleting a consistency group with the API

You can programmatically delete a consistency group by calling the /snapshot_consistency_groups/{id} method in the VPC API as shown in the following sample request.

curl -X DELETE\
"$vpc_api_endpoint/v1/snapshot_consistency_groups/$consistency_group_id?version=2023-12-05&generation=2" 
-H "Authorization: $iam_token"

Updating a consistency group with Terraform

To update a snapshot consistency group, use the ibm_is_snapshot_consistency_group resource. You can update the name of the resource, change the delete_snapshots_on_delete property, which can be either true or false. You can also update the tags that are attached to the snapshots.

resource "ibm_is_snapshot_consistency_group" "example" {
  delete_snapshots_on_delete = true
  name = "example-snapshot-consistency-group"
  snapshots {
    [ 
      name = "snapshot-1"
      source_volume = {id = "ibm_is_instance.example.volume_attachments[0].volume_id_1"}
      user_tags = ["my-tag"]
    ].
    [ 
      name = "snapshot-2"
      source_volume = {id = "ibm_is_instance.example.volume_attachments[0].volume_id_2"}
      user_tags = ["my-tag"]
    ]
  }
}

Changing the resource_group and source_volume values of the member snapshots forces Terraform to destroy the snapshots and create different snapshots.

For more information about the arguments and attributes, see ibm_is_snapshot_consistency_group.

Deleting a consistency group with Terraform

Use the terraform destroy command to conveniently destroy a remote object such as a snapshot consistency group. The following example deletes my-snapshot-consistency-group.

terraform destroy --target ibm_is_snapshot_consistency_group.my-snapshot-consistency-group

For more information, see terraform destroy.

Activity Tracker events

All multi-volume snapshot operations generate events in IBM Cloud Activity Tracker regardless if the consistency group was created manually or by the Backup service. The following table lists the actions that relate to snapshot consistency group resources.

Table 1. IAM roles for snapshots
Resource Action Description
snapshot-consistency-group is.snapshot-consistency-group.snapshot-consistency-group.create The snapshot consistency group was created.
snapshot-consistency-group is.snapshot-consistency-group.snapshot-consistency-group.update The snapshot consistency group was updated.
snapshot-consistency-group is.snapshot-consistency-group.snapshot-consistency-group.delete The snapshot consistency group was deleted.
snapshot-consistency-group is.snapshot-consistency-group.snapshot-consistency-group.read One or more snapshot consistency groups were retrieved.