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.
- Select 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 specified in the CLI profile is used by default. You can specify a different folder through the --folder-name
or --folder-id
parameter.
-
See the description of the CLI commands for deleting a snapshot:
yc compute snapshot delete --help
-
Get a list of snapshots in the default folder:
yc compute snapshot list
Result:
+----------------------+-----------------+----------------------+--------+----------------------------+ | 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
ID
orNAME
of the snapshot in question. -
Delete the snapshot:
yc compute snapshot delete \ --name first-snapshot
If you don't have Terraform, 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 directory with the Terraform configuration file.
-
Delete the resources using this command:
terraform destroy
Alert
Terraform will delete all the resources you created in the current configuration, such as clusters, networks, subnets, and VMs.
-
Type
yes
and press Enter.
Use the delete REST API method for the Snapshot resource or the SnapshotService/Delete gRPC API call.