Deleting a disk image
Warning
Deleting a disk image is permanent and cannot be undone, so you cannot recover a deleted image.
Deleting an image does not affect the VMs or disks created from that image. They must be deleted separately.
To delete an image:
- In the management console, select the folder the image belongs to.
- Select Compute Cloud.
- In the left-hand panel, select
Images. - In the line with the image, click
and select Delete. - In the window that opens, click Delete.
If you do not have the Yandex Cloud CLI yet, install and initialize it.
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 images:
yc compute image delete --help
-
Get a list of images in the default folder:
yc compute image list
Result:
+----------------------+-------------+--------+-------------+--------+ | ID | NAME | FAMILY | PRODUCT IDS | STATUS | +----------------------+-------------+--------+-------------+--------+ | fd8n3spmksqm******** | first-image | | | READY | +----------------------+-------------+--------+-------------+--------+
-
Select
ID
orNAME
of the image in question. -
Delete the image:
yc compute image delete \ --name first-image
If you don't have Terraform, install it and configure the Yandex Cloud provider.
To delete an image 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 Image resource or the ImageService/Delete gRPC API call.