// Module included in the following assemblies:
//
// * virt/managing-vms/virt-delete-vms.adoc

:_mod-docs-content-type: PROCEDURE
[id="virt-deleting-vms_{context}"]

= Deleting a virtual machine by using the CLI

[role="_abstract"]
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 {oc-first}.

.Procedure

* Delete the VM by running the following command:
+
[source,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.
====

