9.10.2. Deleting a virtual machine by using the CLI
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:
$ oc delete vm <vm_name>注記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.