Deleting a VM


    Deleting a VM is an operation that cannot be canceled or reversed. You cannot restore a deleted VM.

    When you select a disk to attach to a VM, you can specify whether that disk should be deleted when deleting the VM. You can choose this option when creating a VM, updating it, or attaching a new disk to it.

    If previously created disks are attached to the VM, they will be detached when the VM is deleted. The disk data will be preserved and you will be able to attach these disks to another VM in the future.

    1. Select the folder the VM belongs to.

    2. Select Compute Cloud.

    3. Select the VM → click image → select Delete.

      To do this with multiple VMs, select the VMs you need to delete from the list → click Delete at the bottom of the screen.

    4. Confirm deletion.

    If you don't have the Yandex.Cloud command line interface yet, install 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.

    1. View a description of the CLI's delete VM command:

      $ yc compute instance delete --help
    2. Get a list of VMs in the default folder:

      $ yc compute instance list
      |          ID          |       NAME      |    ZONE ID    | STATUS  |     DESCRIPTION      |
      | fhm0b28lgfp4tkoa3jl6 | first-instance  | ru-central1-a | RUNNING | my first vm via CLI  |
      | fhm9gk85nj7gcoji2f8s | second-instance | ru-central1-a | RUNNING | my second vm via CLI |
    3. Select the ID or NAME of the VM you need (for example, first-instance).

    4. Delete the VM:

      $ yc compute instance delete first-instance