OpenShift Virtualization¶
Red Hat OpenShift Virtualization Documentation
Workload Availability Required for Node-Loss Failover Testing
If you plan to test node-loss recovery (VM or container failover), you must install and configure Workload Availability prior to installing the OpenShift Virtualization Operator. Node Health Check and Self Node Remediation detect unhealthy nodes and force-restart workloads on healthy nodes — that path is a cold restart / failover, not a live migration. The Descheduler separately live-migrates VMs under load when they have evictionStrategy: LiveMigrate.
Prerequisites¶
- Storage configured with a default virtualization storage class
- Set annotation
storageclass.kubevirt.io/is-default-virt-classtotrueon the storage class - RWX access mode required for live migration
- NMState Operator installed
- Optional: underlay / CUDN networks for VM IP persistence. Needed for failover IP-sameness tests; not required to install Virtualization.
- Optional: a dedicated live-migration network on a separate VLAN to isolate migration traffic from workload traffic. Create the VLAN with the Live Migration Network VLAN NNCP example, then configure the
HyperConvergedCR to use it (see OpenShift Virtualization docs — live migration network).
Planning VM Migrations from VMware?
If you plan to migrate VMs from VMware vSphere using the Migration Toolkit for Virtualization, you must obtain the VDDK image from Broadcom ahead of time. Broadcom has restricted access (TAP partners). See Obtaining the VDDK. If VDDK is unavailable and VMs are on a supported SAN shared with OpenShift, see storage copy offload.
Install the Operator via WebUI¶
- Go to Ecosystem -> Software Catalog -> filter for "OpenShift Virtualization" -> click the tile
- Click Install
- Leave all the defaults and click Install
- Wait for the Operator to install
- Go to Ecosystem -> Installed Operators -> click "OpenShift Virtualization"
- Click on the "HyperConverged" tab and then click "Create HyperConverged"
- Leave all the defaults and click Create
- Wait for the deployment to complete — the Virtualization menu item will appear in the left navigation
Install the Operator via YAML (click to expand)
apiVersion: v1
kind: Namespace
metadata:
name: openshift-cnv
labels:
openshift.io/cluster-monitoring: "true"
---
apiVersion: operators.coreos.com/v1
kind: OperatorGroup
metadata:
name: kubevirt-hyperconverged-group
namespace: openshift-cnv
spec:
targetNamespaces:
- openshift-cnv
---
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
name: hco-operatorhub
namespace: openshift-cnv
spec:
source: redhat-operators
sourceNamespace: openshift-marketplace
name: kubevirt-hyperconverged
channel: stable
installPlanApproval: Automatic
Wait for the operator, then create the HyperConverged instance:
Verify¶
oc get csv -n openshift-cnv
oc get hyperconvergeds.v1beta1.hco.kubevirt.io -n openshift-cnv
oc get pods -n openshift-cnv
Example cloud-init for Static IP¶
networkData: |
version: 2
ethernets:
eth0: # eth0 is the default masquerade pod network, Use eth1 only when a second NIC (bridge/CUDN) is attached
dhcp4: no
addresses:
- 10.37.0.50/24
routes:
- to: default
via: 10.37.0.1
nameservers:
addresses:
- 10.3.0.3
- 9.9.9.9
dhcp6: no
accept-ra: false
userData: |
#cloud-config
user: cloud-user
password: Pass123!
chpasswd:
expire: false
Descheduler for Live Migration¶
If running the Kube Descheduler Operator alongside OpenShift Virtualization, see the Workload Availability — Kube Descheduler section for profile selection and configuration. The recommended profile for mixed clusters with VMs is KubeVirtRelieveAndMigrate.