Deleting snapshot consistency groups

Delete a snapshot consistency group while choosing whether to keep or delete its member snapshots.

When you delete a consistency group, you can choose to delete or keep the individual member snapshots. If you update the consistency group to keep the individual snapshots before you delete the group, an activity tracking event is created. However, a backup job is not created because the backup snapshots remain intact.

Deleting a consistency group in the console

  1. Go to the list of snapshot consistency groups. In the IBM Cloud console, click the Navigation menu menu icon > 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.

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.

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: Bearer $iam_token"

Deleting a consistency group with Terraform

The preferred way to delete a snapshot consistency group that is managed by Terraform is to remove its ibm_is_snapshot_consistency_group resource block from your configuration and run terraform apply. Terraform detects the missing resource and destroys it, keeping your configuration and state in sync.

  1. Open your Terraform configuration file and delete the ibm_is_snapshot_consistency_group resource block for the consistency group.

  2. Run terraform apply to apply the change.

    terraform apply
    

    Terraform displays a plan that shows the resource is marked for destruction. Confirm the plan to proceed.

If you want to destroy a specific consistency group without editing your configuration, you can use terraform destroy --target instead. The following example targets a single resource by its Terraform address:

terraform destroy --target ibm_is_snapshot_consistency_group.example

Using this method preserves the resource block in your configuration, which creates a drift between your configuration and your infrastructure state. Remove the resource block from your configuration after you confirm that the consistency group is deleted.

For more information, see terraform apply and terraform destroy.

Activity Tracking events

All multi-volume snapshot operations generate events in IBM Cloud Activity Tracker Event Routing regardless if the consistency group was created manually or by the Backup service. For more information, see Consistency group events.

Next steps