Deleting a disk snapshot
Warning
Deleting a snapshot is an operation that you cannot cancel or reverse. You cannot restore a deleted snapshot. When you delete a snapshot, all the information in it is deleted. The data on the main disk will remain unchanged.
To delete a snapshot:
- In the management console, select the folder where the snapshot is located.
- Select Compute Cloud.
- In the left-hand panel, select
Snapshots. - In the line with the appropriate 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 using the --folder-name
or --folder-id
parameter.
-
See the description of the CLI's delete snapshot commands:
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 the ID (
ID
) or the name (NAME
) of the desired snapshot. -
Delete the snapshot:
yc compute snapshot delete \ --name first-snapshot
If you don't have Terraform, install it and configure the Yandex Cloud provider.
If you created a snapshot with Terraform, you can delete it:
-
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.