This is a cache of https://docs.openshift.com/container-platform/4.5/virt/install/uninstalling-virt-cli.html. It is a snapshot of the page at 2024-11-23T00:54:05.238+0000.
Uninstalling OpenShift Virtualization using the <strong>cli</strong> - OpenShift Virtualization installation | OpenShift Virtualization | OpenShift Container Platform 4.5
×

You can uninstall OpenShift Virtualization by using the OpenShift Container Platform cli.

Prerequisites

Deleting OpenShift Virtualization

You can delete OpenShift Virtualization by using the cli.

Prerequisites
  • Install the OpenShift cli (oc).

  • Access to a OpenShift Virtualization cluster using an account with cluster-admin permissions.

When you delete the subscription of the OpenShift Virtualization operator in the OLM by using the cli, the ClusterServiceVersion (CSV) object is not deleted from the cluster. To completely uninstall OpenShift Virtualization, you must explicitly delete the CSV.

Procedure
  1. Delete the HyperConverged Custom Resource:

    $ oc delete HyperConverged kubevirt-hyperconverged -n openshift-cnv
  2. Delete the subscription of the OpenShift Virtualization operator in the Operator Lifecycle Manager (OLM):

    $ oc delete subscription kubevirt-hyperconverged -n openshift-cnv
  3. Set the ClusterServiceVersion (CSV) name for OpenShift Virtualization as an environment variable:

    $ CSV_NAME=$(oc get csv -n openshift-cnv -o=custom-columns=:metadata.name)
  4. Delete the CSV from the OpenShift Virtualization cluster by specifying the CSV name from the previous step:

    $ oc delete csv ${CSV_NAME} -n openshift-cnv

    OpenShift Virtualization is uninstalled when a confirmation message indicates that the CSV was deleted successfully:

    Example output
    clusterserviceversion.operators.coreos.com "kubevirt-hyperconverged-operator.v2.4.9" deleted