This is a cache of https://docs.openshift.com/container-platform/4.4/cnv/cnv_virtual_machines/cnv-deleting-vmis.html. It is a snapshot of the page at 2024-11-26T02:01:11.731+0000.
Deleting virtual machine instances - Virtual machines | Container-native virtualization | OpenShift Container Platform 4.4
×

When you delete a virtual machine, the associated VMI is automatically deleted. To manually delete a virtual machine instance (VMI), use the oc command-line interface (cli).

Use this procedure to check for and delete any outstanding VMIs before you uninstall container-native virtualization.

Listing all virtual machine instances

You can list the virtual machine instances in your cluster by using the oc command-line interface (cli).

Procedure
  • List all virtual machine instances by running the following command:

    $ oc get vmis

Deleting a virtual machine instance

You can delete a virtual machine instance by using the oc command-line interface (cli).

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

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

    $ oc delete vmi <vmi_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.