This documentation is for a release that is no longer maintained
See documentation for the latest supported version 3 or the latest supported version 4.3.6. Uninstalling OpenShift Virtualization using the CLI
You can uninstall OpenShift Virtualization by using the OpenShift Container Platform CLI.
3.6.1. Prerequisites 复制链接链接已复制到粘贴板!
- You must have OpenShift Virtualization 2.4 installed.
You must delete all virtual machines, virtual machine instances, and DataVolumes.
重要Attempting to uninstall OpenShift Virtualization without deleting these objects results in failure.
3.6.2. 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-adminpermissions.
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
Delete the HyperConverged Custom Resource:
oc delete HyperConverged kubevirt-hyperconverged -n openshift-cnv
$ oc delete HyperConverged kubevirt-hyperconverged -n openshift-cnvCopy to Clipboard Copied! Toggle word wrap Toggle overflow Delete the subscription of the OpenShift Virtualization operator in the Operator Lifecycle Manager (OLM):
oc delete subscription kubevirt-hyperconverged -n openshift-cnv
$ oc delete subscription kubevirt-hyperconverged -n openshift-cnvCopy to Clipboard Copied! Toggle word wrap Toggle overflow 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)
$ CSV_NAME=$(oc get csv -n openshift-cnv -o=custom-columns=:metadata.name)Copy to Clipboard Copied! Toggle word wrap Toggle overflow 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$ oc delete csv ${CSV_NAME} -n openshift-cnvCopy to Clipboard Copied! Toggle word wrap Toggle overflow 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
clusterserviceversion.operators.coreos.com "kubevirt-hyperconverged-operator.v2.4.9" deletedCopy to Clipboard Copied! Toggle word wrap Toggle overflow