Installing the OpenShift Virtualization Operator
Virtual Private Cloud 4.17 and later Bare metal worker nodes only RHCOS only
After setting up storage for your cluster, install the OpenShift Virtualization Operator to enable virtual machine management capabilities.
Before you begin
Before you install the OpenShift Virtualization Operator, complete the following steps:
-
Create a Red Hat OpenShift on IBM Cloud cluster with the following requirements:
- Bare metal worker nodes: Required for virtualization workloads
- RHCOS operating system: Required (not RHEL)
- OVN-Kubernetes CNI: Required for advanced networking features
- OpenShift 4.20 or later: Required for full virtualization support
- Outbound traffic protection: Must be disabled (can be set during cluster creation or disabled afterward)
You can disable outbound traffic protection during cluster creation in the UI or CLI, or disable it after cluster creation using the command in step 3.
-
Set up storage for OpenShift Virtualization. Your cluster must have exactly one properly configured storage solution (either ODF or VPC File Storage).
-
If you didn't disable outbound traffic protection during cluster creation, disable it now.
ibmcloud oc vpc outbound-traffic-protection disable -c <cluster-name>This step is only needed if outbound traffic protection was not disabled during cluster creation.
-
Enable the default catalog sources.
ibmcloud ks cluster config --admin -c <cluster-name> oc patch operatorhub cluster --type json -p '[{"op": "add", "path": "/spec/disableAllDefaultSources", "value": false}]' -
Verify the catalog sources are available.
oc get catalogsource -n openshift-marketplace -
Confirm the OpenShift Virtualization package is available.
oc get packagemanifests -n openshift-marketplace | grep kubevirt
Installing the OpenShift Virtualization Operator from the console
-
Log in to the IBM Cloud console and navigate to your cluster.
-
Click OpenShift web console to open the OpenShift console.
-
In the OpenShift console, navigate to Ecosystem > OperatorHub (or Operators > OperatorHub in earlier versions).
-
Search for OpenShift Virtualization.
-
Click the OpenShift Virtualization tile and then click Install.
-
On the Install Operator page, configure the following settings:
- Update channel: Select the appropriate channel for your OpenShift version
- Installation mode: All namespaces on the cluster (default)
- Installed Namespace: openshift-cnv (default)
- Update approval: Automatic (recommended)
-
Click Install to begin the installation.
-
Wait for the operator installation to complete. The status changes to Succeeded when ready.
Installing the OpenShift Virtualization Operator from the CLI
- Create a namespace for the OpenShift Virtualization Operator.
oc create namespace openshift-cnv - Create an OperatorGroup.
cat <<EOF | oc apply -f - apiVersion: operators.coreos.com/v1 kind: OperatorGroup metadata: name: kubevirt-hyperconverged-group namespace: openshift-cnv spec: targetNamespaces: - openshift-cnv EOF - Create a Subscription to install the operator.
cat <<EOF | oc apply -f - apiVersion: operators.coreos.com/v1alpha1 kind: Subscription metadata: name: hco-operatorhub namespace: openshift-cnv spec: source: redhat-operators sourceNamespace: openshift-marketplace name: kubevirt-hyperconverged startingCSV: kubevirt-hyperconverged-operator.v4.20.8 channel: "stable" EOF - Verify the operator installation.
Wait until theoc get csv -n openshift-cnvPHASEcolumn showsSucceeded.
Creating the HyperConverged custom resource
After the operator is installed, create a HyperConverged custom resource to deploy the OpenShift Virtualization components.
Understanding node placement
Red Hat OpenShift on IBM Cloud clusters do not have nodes labeled as master. You must configure node placement policies to specify where virtualization components and VM workloads run.
Recommended configuration
- Infrastructure components: Deploy on VSI worker nodes for cost optimization
- VM workloads: Deploy on bare metal worker nodes for best performance
Creating the HyperConverged CR from the console
-
In the OpenShift console, navigate to Ecosystem > Installed Operators (or Operators > Installed Operators in earlier versions).
-
Click OpenShift Virtualization.
-
Click the HyperConverged tab.
-
Click Create HyperConverged.
-
Configure node placement for infrastructure components:
- Click Infra tab
- Add node selectors or tolerations to target VSI nodes
-
Configure node placement for VM workloads:
- Click Workloads tab
- Add node selectors or tolerations to target bare metal nodes
-
Click Create.
Creating the HyperConverged CR from the CLI
Create a HyperConverged custom resource with the default configuration.
cat <<EOF | oc apply -f -
apiVersion: hco.kubevirt.io/v1beta1
kind: HyperConverged
metadata:
name: kubevirt-hyperconverged
namespace: openshift-cnv
spec:
EOF
Verifying the installation
-
Check the HyperConverged resource status.
oc get hyperconverged -n openshift-cnvWait until the
PHASEcolumn showsDeployed. -
Verify that virtualization pods are running.
oc get pods -n openshift-cnv -
Check for the Virtualization menu in the OpenShift console.
- Log in to the OpenShift console
- Look for Virtualization in the main navigation menu
-
Verify storage profiles are created.
oc get storageprofile -
If using VPC File Storage, configure storage profiles as described in Setting up storage for OpenShift Virtualization.
Troubleshooting installation issues
HyperConverged resource fails to deploy
If the HyperConverged resource fails to deploy with node placement errors:
- Check your node labels.
oc get nodes --show-labels - Update the HyperConverged CR with correct node selectors.
oc edit hyperconverged kubevirt-hyperconverged -n openshift-cnv - Review the HyperConverged operator logs.
oc logs -n openshift-cnv -l name=hyperconverged-cluster-operator
Operator installation fails
If the operator installation fails:
- Verify catalog sources are enabled.
oc get catalogsource -n openshift-marketplace - Check operator subscription status.
oc get subscription -n openshift-cnv - Review operator logs.
oc logs -n openshift-cnv -l app=kubevirt-hyperconverged-operator
Next steps
After installing OpenShift Virtualization:
- Create and manage virtual machines
- Configure virtual network interfaces (4.20 and later)
- Set up VM templates and images
For complete installation instructions, see Installing OpenShift Virtualization in the Red Hat documentation.