This is a cache of https://docs.openshift.com/container-platform/4.2/cnv/cnv_users_guide/cnv-delete-vms.html. It is a snapshot of the page at 2024-11-23T02:41:22.515+0000.
Deleting virtual machines - Container-native virtualization <strong>user</strong>'s guide | Container-native virtualization | OpenShift Container Platform 4.2
×

Use one of these procedures to delete a virtual machine:

  • Using the web console

  • Using the CLI

Deleting a virtual machine using the web console

Deleting a virtual machine permanently removes it from the cluster.

Delete a virtual machine using the ⋮ button of the virtual machine in the WorkloadsVirtual Machines list, or using the Actions control of the Virtual Machine Details screen.

Procedure
  1. In the container-native virtualization console, click WorkloadsVirtual Machines from the side menu.

  2. Click the ⋮ button of the virtual machine to delete and select Delete Virtual Machine.

    • Alternatively, click the virtual machine name to open the Virtual Machine Details screen and click ActionsDelete Virtual Machine.

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

Deleting a virtual machine and its DataVolume using the CLI

When you delete a virtual machine, the DataVolume it uses is not automatically deleted.

Deleting the DataVolume is recommended in order to maintain a clean environment and avoid possible confusion.

Procedure

Run these commands to delete the virtual machine and the DataVolume.

You can delete objects only in the project you are currently working in, unless you specify the -n <project_name> option.
  1. Run the following command to delete the virtual machine:

    $ oc delete vm <fedora-vm>
  2. Run the following command to delete the DataVolume:

    $ oc delete dv <datavolume-name>