---
title: Delete a virtual machine
---

# Delete a virtual machine {#virt-delete-vms}

You can remove virtual machines (VMs) from your cluster to free up resources using either the web console or CLI. Deleting a VM removes the virtual machine definition and optionally its associated storage resources.

## Deleting a virtual machine using the web console {#virt-delete-vm-web_virt-delete-vms}

Deleting a virtual machine (VM) permanently removes it from the cluster.

If the VM is delete protected, the **Delete** action is disabled in the VM’s **Actions** menu.

**Prerequisites**

- You have disabled the VM’s delete protection setting.
- You have stopped the VM.

**Procedure**

1. From the OpenShift Container Platform web console, choose your view:

   - For a virtualization-focused view, select **Administrator** → **Virtualization** → **VirtualMachines**.
   - For a general view, navigate to **Virtualization** → **VirtualMachines**.
2. Click the **Options** menu ![](/openshift-docs-markdown/images/kebab.png "Options menu") beside a VM and select **Delete**.

   Alternatively, click the VM’s name to open the **VirtualMachine details** page and click **Actions** → **Delete**.

   You can also right-click the VM in the tree view and select **Delete** from the pop-up menu.
3. Optional: Select **With grace period** or clear **Delete disks**.
4. Click **Delete** to permanently delete the VM.

## Deleting a virtual machine by using the CLI {#virt-deleting-vms_virt-delete-vms}

You can delete a virtual machine (VM) by using the `oc` command-line interface (CLI). The `oc` client enables you to perform actions on multiple VMs.

**Prerequisites**

- You have disabled the VM’s delete protection setting.
- You have stopped the VM.
- You have installed the OpenShift CLI (`oc`).

**Procedure**

- Delete the VM by running the following command:

  ```terminal
  $ oc delete vm <vm_name>
  ```

  > [!NOTE]
  > This command only deletes a VM in the current project. Specify the `-n <project_name>` option if the VM you want to delete is in a different project or namespace.
