Renaming Block Storage for VPC snapshots
You can rename existing snapshots to make them simpler to identify.
For information about snapshot naming conventions, see Naming snapshots.
Renaming a snapshot in the console
Use the following steps to rename a snapshot in the console.
- Go to the list of snapshots. In the IBM Cloud console, go to the menu
> Infrastructure
> Storage > Snapshots.
- Click the name of a snapshot from the list.
- Click the Edit icon
.
- Provide a new name for the snapshot, save, and confirm your changes.
Renaming a snapshot from the CLI
Prerequisites for issuing commands from the CLI
Before you can use the CLI, you must install the IBM Cloud CLI and the VPC CLI plug-in. For more information, see the CLI prerequisites.
Log in to IBM Cloud®.
ibmcloud login --sso -a cloud.ibm.com
This command returns a URL and prompts for a passcode. Go to that URL in your browser and log in. If successful, you get a one-time passcode. Copy this passcode and paste it as a response on the prompt. After successful authentication, you are prompted to choose your account. If you have access to multiple accounts, select the account that you want to log in as. Respond to any remaining prompts to finish logging in.
Renaming the snapshot
To rename a snapshot, issue the ibmcloud is snapshot-update command and provide the snapshot ID and new name.
ibmcloud is snapshot-update SNAPSHOT_ID --name SNAPSHOT_NAME
See the following example.
ibmcloud is snapshot-update r138-e6664842-b370-496a-9ae7-da3fb647707c --name snappy-snap-snap
Updating snapshot r138-e6664842-b370-496a-9ae7-da3fb647707c under account Test Account as user test.user@ibm.com...
ID r138-e6664842-b370-496a-9ae7-da3fb647707c
Name snappy-snap-snap
CRN crn:v1:bluemix:public:is:eu-de:a/a1234567::snapshot:r138-e6664842-b370-496a-9ae7-da3fb647707c
Status stable
Clones Zone Available Created
eu-de-3 true 2023-02-17T20:28:53+00:00
eu-de-1 true 2023-02-17T18:53:57+00:00
Source volume ID Name
r010-df8ffd90-f2e5-470b-83d7-76e64995a1aa vicky-block-test1
Bootable false
Encryption provider_managed
Encryption key -
Minimum capacity(GB) 20
Size(GB) 1
Resource group ID Name
a0eb5d9062af485fa5bb2c6999c74eac test-snap
Created 2023-02-17T18:53:57+00:00
Captured at 2023-02-17T18:53:57+00:00
Tags -
For more information about available command options, see ibmcloud is snapshot-update.
Renaming a snapshot with the API
You can rename a snapshot by using the API.
Make a PATCH /snapshots call and specify the snapshot ID and new name of the snapshot.
curl -X PATCH \
"$vpc_api_endpoint/v1/snapshots/7528eb61-bc01-4763-a67a-a414a103f96d?version=2022-01-12&generation=2" \
-H "Authorization: Bearer ${API_TOKEN}" \
-d '{
"name": "my-snapshot-renamed"
}'
You can use the same call to rename a cross-regional copy. The cross-regional copy is independent from the source snapshot and source volume, and can be managed like any other snapshot.
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_snapshot resource. You can change the name of the snapshot, the fast restore zones, and tags. However, changing the resource_group and source_volume values forces Terraform
to delete the snapshot and create a different snapshot.
resource "ibm_is_snapshot" "example" {
name = "my-snapshot"
source_volume = ibm_is_volume.example.id
}
For more information about the arguments and attributes, see ibm_is_snapshot.