Deleting a disk snapshot
Warning
Deleting a snapshot is permanent and cannot be undone, so you cannot recover a deleted snapshot. When you delete a snapshot, all the information it stores is erased. The data on the primary disk will remain unchanged.
To delete a snapshot:
- In the management console, select the folder containing your snapshot.
- Go to Compute Cloud.
- In the left-hand panel, select
Snapshots. - In the line with the snapshot, click
and select Delete. - In the window that opens, click Delete.
The folder used by default is the one specified when creating the CLI profile. To change the default folder, use the yc config set folder-id <folder_ID> command. You can also set a different folder for any specific command using the --folder-name or --folder-id options.
-
See the description of the CLI commands for deleting snapshots:
yc compute snapshot delete --help -
Get a list of snapshots in the default folder:
yc compute snapshot listResult:
+----------------------+-----------------+----------------------+--------+----------------------------+ | ID | NAME | PRODUCT IDS | STATUS | DESCRIPTION | +----------------------+-----------------+----------------------+--------+----------------------------+ | fd8rlt1u2rf0l******* | first-snapshot | f2ecl5vhsftd******** | READY | my first snapshot via CLI | | fhmolt1u2rf0******** | second-snapshot | f2eclmol5lps******** | READY | my second snapshot via CLI | +----------------------+-----------------+----------------------+--------+----------------------------+ -
Select
IDorNAMEof the snapshot in question. -
Delete the snapshot:
yc compute snapshot delete \ --name first-snapshot
If you do not have Terraform yet, install it and configure the Yandex Cloud provider.
To delete a snapshot created with Terraform, follow these steps:
-
In the command line, go to the folder with the Terraform configuration file.
-
Delete the resources using this command:
terraform destroyAlert
Terraform will delete all the resources you created in the current configuration, such as clusters, networks, subnets, and VMs.
-
Type
yesand press Enter.
Use the delete REST API method for the Snapshot resource or the SnapshotService/Delete gRPC API call.