Deleting a disk
You can only delete a disk that is not attached to any VM.
Warning
Deleting a disk is an operation that cannot be canceled or reversed. You cannot restore a deleted disk.
If you delete a disk, its snapshots are not deleted with it. Snapshots need to be deleted separately.
To delete a disk:
Management console
CLI
- In the management console, select the folder the disk belongs to.
- Click on the Compute Cloud tile.
- On the Virtual machines page, go to the Disks tab.
- In the row with the appropriate disk, click on the icon and select the Delete command.
- Confirm the deletion.
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 disk commands:
$ yc compute disk delete --help
-
Get a list of disks in the default folder:
yc compute disk list
Result:
+----------------------+--------------+-------------+---------------+--------+----------------------+-------------------------+ | ID | NAME | SIZE | ZONE | STATUS | INSTANCE IDS | DESCRIPTION | +----------------------+--------------+-------------+---------------+--------+----------------------+-------------------------+ | a7lqgbt0bb9s40tifuhc | first-disk | 20401094656 | ru-central1-a | READY | a7lcvu28njbhnkcteb5n | | | a7lv5j5hm1p1hppprga7 | second-disk | 21474836480 | ru-central1-a | READY | | | +----------------------+--------------+-------------+---------------+--------+----------------------+-------------------------+
-
Select the
ID
orNAME
of the necessary disk. -
Delete the disk:
$ yc compute disk delete \ --name first-disk