Managing File Storage for VPC snapshots
New
You can manage existing snapshots in the console, from the CLI, with the API or Terraform. You can update the user tags of the snapshots, and delete snapshots that you no longer need to free up space for new snapshots.
Although you can't create a snapshot on a replica share, the snapshots of the origin share are copied from the source to the replica at the next scheduled sync. These replica snapshots are created by the file service. They do not inherit the tags or the name from the original snapshots. However, they have the same fingerprint value as the source snapshot. They can't be manually deleted from the replica share, but are removed from the replica share at the next replication sync if the source snapshot is deleted on the source share.
Updating user tags of a snapshot in the UI
Use the following steps to update the user tags of a snapshot in the console.
- Go to the list of snapshots. In the IBM Cloud console, click the Navigation menu icon > Infrastructure > Storage > File storage shares.
- The file shares are listed for a specific region. If you want to see resources in another region, click the arrow to expand the list and select a different region. By default, the newest shares are displayed at the beginning of the list.
- Select the file share that you want to view, and click the Snapshots tab.
- Click the name of a snapshot to open the Snapshot details panel.
- Click the Edit icon next to the User tags.
- You can remove any existing tags and add new tags. Click Save.
Updating a snapshot with Terraform
To use Terraform, download the Terraform CLI and configure the IBM Cloud Provider plug-in. For more information, see Getting started with Terraform.
VPC infrastructure services use a specific regional endpoint, which targets to us-south
by default. If your VPC is created in another region, make sure to target the appropriate region in the provider block in the provider.tf
file.
See the following example of targeting a region other than the default us-south
.
provider "ibm" {
region = "eu-de"
}
To update a snapshot, use the ibm_is_share_snapshot
resource. You can change the tags of the snapshot by adding them with the tags
argument.
resource "ibm_is_share_snapshot" "example" {
tags = "dev:test"
source_share = ibm_is_share.example.id
}
For more information about the arguments and attributes, see ibm_is_snapshot.
Deleting snapshots in the console
You can delete any snapshot of a share. To be able to delete a snapshot, it must meet to the following prerequisites:
- Be in a
stable
orpending
state. - Not be actively restoring a share.
An easy way to determine whether you can delete a snapshot is to look in the console for the list of snapshots and check its status.
Deleting a single snapshot in the UI
You can delete a snapshot from the list of snapshots by using the following steps.
- Go to the list of all File Storage for VPC shares. In the IBM Cloud console, go to the menu > Infrastructure > Storage > File storage shares.
- Select a share from the list and click the share name to go to the share details page.
- Click the Snapshots tab to see a list of snapshots taken of this share.
- Locate the snapshot that you want to delete.
- Click the Actions icon .
- Select Delete.
- Confirm the deletion.
Deleting snapshots from the CLI
You can delete any snapshot for a share or all snapshots for a share. To be able to delete a snapshot, it must meet to the following prerequisites:
- Be in a
stable
orpending
state. - Not be actively restoring a share.
Use the following steps to delete a single snapshot by using the CLI.
-
List the snapshots that are available for a share to confirm the ID of the snapshot that you want to delete.
ibmcloud is share-snapshots SHARE [--output JSON] [-q, --quiet]
ibmcloud is share-snapshots my-file-share
-
Run the
ibmcloud is share-snapshot-delete
command and specify the ID of the snapshot. To delete multiple snapshots, you must specify all of their IDs in the same command.ibmcloud is share-snapshot-delete SHARE (SNAPSHOT1 SNAPSHOT2 ...) [-f, --force] [--output JSON] [-q, --quiet]
-
Confirm the deletion of the snapshot. The response message indicates that the snapshot is deleted.
$ ibmcloud is share-snapshot-delete my-file-share r134-6ce54f3b-8971-4b5d-95a7-7dfa897ddfb3 This will delete share snapshot r134-6ce54f3b-8971-4b5d-95a7-7dfa897ddfb3 for share ID my-file-share and cannot be undone. Continue [y/N] ?> y Deleting share snapshot r134-6ce54f3b-8971-4b5d-95a7-7dfa897ddfb3 for share ID my-file-share under account Test Account as user test.user@ibm.com... OK Share snapshot r134-6ce54f3b-8971-4b5d-95a7-7dfa897ddfb3 is deleted.
For more information about available command options, ibmcloud is snaphot-delete
.
Deleting snapshots with the API
You can delete any snapshot for a share or all snapshots for a share. To be able to delete a snapshot, it must meet to the following prerequisites:
- Be in a
stable
orpending
state. - Not be actively restoring a share.
Call the DELETE /shares/{share-id}/snapshots/{snapshot-id}
method to delete a specific snapshot by ID.
curl -X DELETE \
"$vpc_api_endpoint/v1/shares/r006-0fe9e5d8-0a4d-4818-96ec-e99708644a58/snapshots/r006-e13ee54f-baa4-40d3-b35c-b9ec163972b4?version=2024-12-10&generation=2" \
-H "Authorization: Bearer ${API_TOKEN}"
Deleting snapshots with Terraform
You can delete any snapshot for a share or all snapshots for a share. To be able to delete a snapshot, it must meet to the following prerequisites:
- Be in a
stable
orpending
state. - Not be actively restoring a share.
Use the terraform destroy
command to conveniently destroy a remote object such as a single snapshot. The following example deletes my-snapshot
.
terraform destroy --target ibm_is_snapshot.my-snapshot
For more information, see terraform destroy.
Activity tracking and auditing
When you initiate an activity on a snapshot, specific Activity tracking events are generated. These activities include creating, listing, modifying, and deleting snapshots. For more information, see Snapshot events.
Snapshot lifecycle states
Table 2 describes the snapshot states in the snapshot lifecycle.
Snapshot status | Explanation |
---|---|
Stable | The snapshot is created and is available for restoring a share. |
Waiting | Snapshot information is being retrieved. |
Pending | The snapshot is being replicated to a remote share. While the replication is in process, the percentage completed is displayed. |
Failed | The snapshot failed to be created, the share can't be restored from a snapshot. |
Suspended | Snapshot is temporarily unavailable. |
Updating | You changed the name of the snapshot and it is being updated. |
Deleting | The snapshot is being deleted. |
Deleted | The snapshot was deleted and is not available to restore shares. |
Managing security and compliance
Because snapshots are created from File Storage for VPC shares, they share the encryption key. When a share is created from a Snapshot, your SCC-registered preference of allowing only Customer-Managed encryption is applicable. For more information, see Getting started with Security and Compliance Center.
Next steps
You can Restore a share from a snapshot.