×

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.