This is a cache of https://docs.openshift.com/container-platform/4.12/virt/virtual_machines/virt-delete-vms.html. It is a snapshot of the page at 2024-11-27T13:26:14.193+0000.
Deleting virtual machines - Virtual machines | Virtualization | OpenShift Container Platform 4.12
×

You can delete a virtual machine from the web console or by using the oc command line interface.

Deleting a virtual machine using the web console

Deleting a virtual machine permanently removes it from the cluster.

When you delete a virtual machine, the data volume it uses is automatically deleted.

Procedure
  1. In the OpenShift Container Platform console, click VirtualizationVirtualMachines from the side menu.

  2. click the Options menu kebab of the virtual machine that you want to delete and select Delete.

    • Alternatively, click the virtual machine name to open the VirtualMachine details page and click ActionsDelete.

  3. In the confirmation pop-up window, click Delete to permanently delete the virtual machine.

Deleting a virtual machine by using the cli

You can delete a virtual machine by using the oc command line interface (cli). The oc client enables you to perform actions on multiple virtual machines.

When you delete a virtual machine, the data volume it uses is automatically deleted.

Prerequisites
  • Identify the name of the virtual machine that you want to delete.

Procedure
  • Delete the virtual machine by running the following command:

    $ oc delete vm <vm_name>

    This command only deletes objects that exist in the current project. Specify the -n <project_name> option if the object you want to delete is in a different project or namespace.