Installing the OpenShift Virtualization Operator on Red Hat OpenShift on IBM Cloud clusters
Virtual Private Cloud 4.17 and later Red Hat CoreOS only Baremetal worker nodes only
You can use the OpenShift Virtualization Operator to manage virtual machine workloads alongside your container workloads.
The OpenShift Virtualization Operator adds Kubernetes custom resources to enable virtualization. You can use these resources for the following tasks.
- Create and manage Linux and Windows virtual machines (VMs).
- Run pod and VM workloads alongside each other in your cluster.
- Clone or import VMs.
- Manage network interface controllers and storage disks attached to your VMs.
- Migrate virtual machines between nodes.
Secondary networks and User defined networks aren't supported. For more information, see Primary networks.
Prerequisites
Before you begin, make sure that you have the following.
- A Red Hat OpenShift on IBM Cloud cluster at version 4.17 or later
- VPC Baremetal workers
- RHCOS operating system
- Outbound traffic protection disabled
- OpenShift Data Foundation installed
To install ODF, see Deploying OpenShift Data Foundation on VPC clusters.
Setting up virtualization with File Storage for VPC
-
In the
kube-system/addon-vpc-block-csi-driver-configmap
configmap, set theIsStorageClassDefault
property tofalse
.oc edit cm -n kube-system addon-vpc-block-csi-driver-configmap
-
Install the File Storage for VPC add-on from IBM cloud console.
-
Verify the add-on is installed by listing the storage classes.
oc get storageclass
-
Choose a storage class, for example
ibmc-vpc-file-metro-1000-iops
and set it as the default by editing thekube-system/addon-vpc-file-csi-driver-configmap
and entering it as theSET_DEFAULT_STORAGE_CLASS
field.oc edit cm -n kube-system addon-vpc-file-csi-driver-configmap
-
Wait a few minutes for the changes to take effect.
-
Subscribe to the OpenShift Virtualization catalog by using the CLI.
-
Follow the steps to Deploy the OpenShift Virtualization Operator by using the CLI.
-
Wait until
StorageProfile
resources are created for each StorageClass. As CDI does not automatically recognize VPC File storage properties, you need to properly set it up. -
Edit the
StorageProfile
for the default storage class (ibmc-vpc-file-metro-1000-iops
) and add the following specs.spec: claimPropertySets: - accessModes: - ReadWriteMany volumeMode: Filesystem
-
Check if the resource status is updated with a
claimPropertySets
that represents the new specs.oc get storageprofile ibmc-vpc-file-metro-1000-iops -o yaml
-
In the OpenShift console, look for a new main menu item called Virtualization. You can now use the console to create template VMs from the console.
Next steps
Review the following Red Hat docs for creating and managing VMs in your cluster.