Enable VM storage live migration in OpenShift Virtualization

Solution Unverified - Updated

Environment

  • OpenShift Container Platform >= 4.17
  • OpenShift Virtualization >= 4.17

Requirements

  • Migration Toolkit for Containers (MTC)
  • More than 1 node in the OpenShift cluster

Issue

VM Storage Live Migration is Tech Preview in OpenShift Virtualization 4.17 and 4.18 with Migration Toolkit for Containers 1.8.4. However, it is not enabled by default in the HyperConverged CR. There is no simple mechanism to enable it.

Resolution

For now, use oc annotateto enable the KubeVirt feature gates that are needed :

oc annotate --overwrite -n openshift-cnv hco kubevirt-hyperconverged   kubevirt.kubevirt.io/jsonpatch='[ {"op": "add", "path": "/spec/configuration/developerConfiguration/featureGates/-", "value": "VolumesUpdateStrategy"}, {"op": "add", "path": "/spec/configuration/developerConfiguration/featureGates/-", "value": "VolumeMigration"} ]'

NOTE : Using oc annotate to enable feature gates in KubeVirt is not supported by Red Hat

Root Cause

No feature gate available for the HyperConverged resource to enable the required feature gates in KubeVirt.

Components
Category

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.