Chapter 4. Upgrading OpenShift Virtualization
You can manually upgrade to the next minor version of OpenShift Virtualization and monitor the status of an update by using the web console.
4.1. About upgrading OpenShift Virtualization
4.1.1. How OpenShift Virtualization upgrades work
- You can upgrade to the next minor version of OpenShift Virtualization by using the OpenShift Container Platform web console to change the channel of your Operator subscription.
- You can enable automatic z-stream updates during OpenShift Virtualization installation.
- Updates are delivered via the Marketplace Operator, which is deployed during OpenShift Container Platform installation. The Marketplace Operator makes external Operators available to your cluster.
- The amount of time an update takes to complete depends on your network connection. Most automatic updates complete within fifteen minutes.
4.1.2. How OpenShift Virtualization upgrades affect your cluster
Upgrading does not interrupt virtual machine workloads.
Virtual machine pods are not restarted or migrated during an upgrade. If you need to update the
virt-launcher
pod, you must restart or live migrate the virtual machine.NoteEach virtual machine has a
virt-launcher
pod that runs the virtual machine instance. Thevirt-launcher
pod runs an instance oflibvirt
, which is used to manage the virtual machine process.
- Upgrading does not interrupt network connections.
Data volumes and their associated persistent volume claims are preserved during upgrade.
ImportantIf you have virtual machines running that cannot be live migrated, they might block an OpenShift Container Platform cluster upgrade. This includes virtual machines that use hostpath provisioner storage or SR-IOV network interfaces.
As a workaround, you can reconfigure the virtual machines so that they can be powered off automatically during a cluster upgrade. Remove the
evictionStrategy: LiveMigrate
field and set therunStrategy
field toAlways
.
4.2. Upgrade pathways for minor releases
The upgrade pathway is different depending on the 2.4.z version of OpenShift Virtualization that you have installed.
You must upgrade your OpenShift Container Platform to 4.6 before upgrading the minor release of OpenShift Virtualization.
4.2.1. Upgrading from 2.4.3 to 2.5.8
You must first upgrade to 2.5.0 before you can upgrade the z-stream. You can then upgrade from 2.5.0 to 2.5.1 and then to 2.5.2 and so on.
If your Approval Strategy is Automatic, which is the default, OpenShift Virtualization upgrades the z-stream automatically after you have upgraded to 2.5.0.
4.2.2. Upgrading from 2.4.4 or 2.4.5 to 2.5.8
You can upgrade from 2.4.4 or 2.4.5 directly to 2.5.2. You can then upgrade from 2.5.2 to 2.5.3 and so on.
If your Approval Strategy is Automatic, which is the default, OpenShift Virtualization upgrades the z-stream automatically after you have upgraded to 2.5.2.
4.3. Upgrading OpenShift Virtualization to the next minor version
You can manually upgrade OpenShift Virtualization to the next minor version by using the OpenShift Container Platform web console to change the channel of your Operator subscription.
Prerequisites
-
Log in to the cluster as a user with the
cluster-admin
role.
Procedure
-
Access the OpenShift Container Platform web console and navigate to Operators
Installed Operators. - Click OpenShift Virtualization to open the Operator Details page.
- Click the Subscription tab to open the Subscription Overview page.
- In the Channel pane, click the pencil icon on the right side of the version number to open the Change Subscription Update Channel window.
- Select stable. This ensures that you install the version of OpenShift Virtualization that is compatible with your OpenShift Container Platform version.
- Click Save.
Check the status of the upgrade by navigating to Operators
Installed Operators. You can also check the status by running the following oc
command:$ oc get csv -n openshift-cnv
4.4. Monitoring upgrade status
The best way to monitor OpenShift Virtualization upgrade status is to watch the cluster service version (CSV) PHASE
. You can also monitor the CSV conditions in the web console or by running the command provided here.
The PHASE
and conditions values are approximations that are based on available information.
Prerequisites
-
Log in to the cluster as a user with the
cluster-admin
role. -
Install the OpenShift CLI (
oc
).
Procedure
Run the following command:
$ oc get csv
Review the output, checking the
PHASE
field. For example:Example output
VERSION REPLACES PHASE 2.5.0 kubevirt-hyperconverged-operator.v2.4.3 Installing 2.4.3 Replacing
Optional: Monitor the aggregated status of all OpenShift Virtualization component conditions by running the following command:
$ oc get hco -n openshift-cnv kubevirt-hyperconverged \ -o=jsonpath='{range .status.conditions[*]}{.type}{"\t"}{.status}{"\t"}{.message}{"\n"}{end}'
A successful upgrade results in the following output:
Example output
ReconcileComplete True Reconcile completed successfully Available True Reconcile completed successfully Progressing False Reconcile completed successfully Degraded False Reconcile completed successfully Upgradeable True Reconcile completed successfully