Deleting a disk image
Warning
Deleting a disk image is an operation that cannot be canceled or reversed. You cannot restore a deleted image.
Deleting an image does not delete the VMs and disks created from this image. They need to 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 of the appropriate image, click
and select Delete. - In the window that opens, click Delete.
If you do not have the Yandex Cloud command line interface yet, install and initialize it.
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 a description of the CLI's delete image commands:
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 the identifier (
ID
) or name (NAME
) of the desired image. -
Delete the image:
yc compute image delete \ --name first-image
If you don't have Terraform, install it and configure the Yandex Cloud provider.
Images created using Terraform can be deleted:
-
In the command line, go to the directory with the Terraform configuration file.
-
Delete the resources using this command:
terraform destroy
Alert
Terraform deletes all the resources that you created in the current configuration, such as clusters, networks, subnets, and instances.
-
Type
yes
and press Enter.
Use the delete REST API method for the Image resource or the ImageService/Delete gRPC API call.