Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.
Chapter 6. Updating
6.1. Updating OpenShift Virtualization Link kopierenLink in die Zwischenablage kopiert!
Learn how to keep OpenShift Virtualization updated and compatible with OpenShift Container Platform.
6.1.1. About updating OpenShift Virtualization Link kopierenLink in die Zwischenablage kopiert!
When you install OpenShift Virtualization, you select an update channel and an approval strategy. The update channel determines the version that OpenShift Virtualization is updated to. The approval strategy setting determines whether updates occur automatically or require manual approval. Both settings can impact supportability.
6.1.1.1. Recommended settings Link kopierenLink in die Zwischenablage kopiert!
To maintain a supportable environment, use the following settings:
- Update channel: stable
- Approval strategy: Automatic
The stable release channel and the Automatic approval strategy are recommended for most OpenShift Virtualization installations. Use other settings only if you understand the risks.
With these settings, the update process automatically starts when a new version of the Operator is available in the stable channel. This ensures that your OpenShift Virtualization and OpenShift Container Platform versions remain compatible, and that your version of OpenShift Virtualization is suitable for production environments.
Each minor version of OpenShift Virtualization is supported only if you run the corresponding OpenShift Container Platform version. For example, you must run OpenShift Virtualization 4.14 on OpenShift Container Platform 4.14.
6.1.1.2. What to expect Link kopierenLink in die Zwischenablage kopiert!
- The amount of time an update takes to complete depends on your network connection. Most automatic updates complete within fifteen minutes.
- Updating OpenShift Virtualization does not interrupt network connections.
- Data volumes and their associated persistent volume claims are preserved during an update.
If you have virtual machines running that use hostpath provisioner storage, they cannot be live migrated and might block an OpenShift Container Platform cluster update.
As a workaround, you can reconfigure the virtual machines so that they can be powered off automatically during a cluster update. Remove the
evictionStrategy: LiveMigrate
runStrategy
Always
6.1.1.3. How updates work Link kopierenLink in die Zwischenablage kopiert!
- Operator Lifecycle Manager (OLM) manages the lifecycle of the OpenShift Virtualization Operator. The Marketplace Operator, which is deployed during OpenShift Container Platform installation, makes external Operators available to your cluster.
- OLM provides z-stream and minor version updates for OpenShift Virtualization. Minor version updates become available when you update OpenShift Container Platform to the next minor version. You cannot update OpenShift Virtualization to the next minor version without first updating OpenShift Container Platform.
6.1.1.4. Changing update settings Link kopierenLink in die Zwischenablage kopiert!
You can change the update channel and approval strategy for your OpenShift Virtualization Operator subscription by using the web console.
Prerequisites
- You have installed the OpenShift Virtualization Operator.
- You have administrator permissions.
Procedure
-
Click Operators
Installed Operators. - Select OpenShift Virtualization from the list.
- Click the Subscription tab.
- In the Subscription details section, click the setting that you want to change. For example, to change the approval strategy from Manual to Automatic, click Manual.
- In the window that opens, select the new update channel or approval strategy.
- Click Save.
6.1.1.5. Manual approval strategy Link kopierenLink in die Zwischenablage kopiert!
If you use the Manual approval strategy, you must manually approve every pending update. If OpenShift Container Platform and OpenShift Virtualization updates are out of sync, your cluster becomes unsupported. To avoid risking the supportability and functionality of your cluster, use the Automatic approval strategy.
If you must use the Manual approval strategy, maintain a supportable cluster by approving pending Operator updates as soon as they become available.
6.1.1.6. Manually approving a pending Operator update Link kopierenLink in die Zwischenablage kopiert!
If an installed Operator has the approval strategy in its subscription set to Manual, when new updates are released in its current update channel, the update must be manually approved before installation can begin.
Prerequisites
- An Operator previously installed using Operator Lifecycle Manager (OLM).
Procedure
-
In the Administrator perspective of the OpenShift Container Platform web console, navigate to Operators
Installed Operators. - Operators that have a pending update display a status with Upgrade available. Click the name of the Operator you want to update.
- Click the Subscription tab. Any updates requiring approval are displayed next to Upgrade status. For example, it might display 1 requires approval.
- Click 1 requires approval, then click Preview Install Plan.
- Review the resources that are listed as available for update. When satisfied, click Approve.
-
Navigate back to the Operators
Installed Operators page to monitor the progress of the update. When complete, the status changes to Succeeded and Up to date.
6.1.2. RHEL 9 compatibility Link kopierenLink in die Zwischenablage kopiert!
OpenShift Virtualization 4.14 is based on Red Hat Enterprise Linux (RHEL) 9. You can update to OpenShift Virtualization 4.14 from a version that was based on RHEL 8 by following the standard OpenShift Virtualization update procedure. No additional steps are required.
As in previous versions, you can perform the update without disrupting running workloads. OpenShift Virtualization 4.14 supports live migration from RHEL 8 nodes to RHEL 9 nodes.
6.1.2.1. RHEL 9 machine type Link kopierenLink in die Zwischenablage kopiert!
All VM templates that are included with OpenShift Virtualization now use the RHEL 9 machine type by default:
machineType: pc-q35-rhel9.<y>.0
<y>
pc-q35-rhel9.2.0
Updating OpenShift Virtualization does not change the
machineType
Before you change a VM’s
machineType
6.1.3. Monitoring update status Link kopierenLink in die Zwischenablage kopiert!
To monitor the status of a OpenShift Virtualization Operator update, watch the cluster service version (CSV)
PHASE
The
PHASE
Prerequisites
-
Log in to the cluster as a user with the role.
cluster-admin -
Install the OpenShift CLI ().
oc
Procedure
Run the following command:
$ oc get csv -n openshift-cnvReview the output, checking the
field. For example:PHASEExample output
VERSION REPLACES PHASE 4.9.0 kubevirt-hyperconverged-operator.v4.8.2 Installing 4.9.0 kubevirt-hyperconverged-operator.v4.9.0 ReplacingOptional: Monitor the aggregated status of all OpenShift Virtualization component conditions by running the following command:
$ oc get hyperconverged kubevirt-hyperconverged -n openshift-cnv \ -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
6.1.4. VM workload updates Link kopierenLink in die Zwischenablage kopiert!
When you update OpenShift Virtualization, virtual machine workloads, including
libvirt
virt-launcher
qemu
Each virtual machine has a
virt-launcher
virt-launcher
libvirt
You can configure how workloads are updated by editing the
spec.workloadUpdateStrategy
HyperConverged
LiveMigrate
Evict
Because the
Evict
LiveMigrate
When
LiveMigrate
- VMIs that support live migration are migrated during the update process. The VM guest moves into a new pod with the updated components enabled.
VMIs that do not support live migration are not disrupted or updated.
-
If a VMI has the eviction strategy but does not support live migration, it is not updated.
LiveMigrate
-
If a VMI has the
If you enable both
LiveMigrate
Evict
-
VMIs that support live migration use the update strategy.
LiveMigrate -
VMIs that do not support live migration use the update strategy. If a VMI is controlled by a
Evictobject that hasVirtualMachineset, a new VMI is created in a new pod with updated components.runStrategy: Always
Migration attempts and timeouts
When updating workloads, live migration fails if a pod is in the
Pending
- 5 minutes
-
If the pod is pending because it is
Unschedulable. - 15 minutes
- If the pod is stuck in the pending state for any reason.
When a VMI fails to migrate, the
virt-controller
virt-launcher
Each attempt corresponds to a migration object. Only the five most recent attempts are held in a buffer. This prevents migration objects from accumulating on the system while retaining information for debugging.
6.1.4.1. Configuring workload update methods Link kopierenLink in die Zwischenablage kopiert!
You can configure workload update methods by editing the
HyperConverged
Prerequisites
To use live migration as an update method, you must first enable live migration in the cluster.
NoteIf a
CR containsVirtualMachineInstanceand the virtual machine instance (VMI) does not support live migration, the VMI will not update.evictionStrategy: LiveMigrate-
You have installed the OpenShift CLI ().
oc
Procedure
To open the
CR in your default editor, run the following command:HyperConverged$ oc edit hyperconverged kubevirt-hyperconverged -n openshift-cnvEdit the
stanza of theworkloadUpdateStrategyCR. For example:HyperConvergedapiVersion: hco.kubevirt.io/v1beta1 kind: HyperConverged metadata: name: kubevirt-hyperconverged spec: workloadUpdateStrategy: workloadUpdateMethods: - LiveMigrate - Evict batchEvictionSize: 10 batchEvictionInterval: "1m0s" # ...- defines the methods that can be used to perform automated workload updates. The available values are
spec.workloadUpdateStrategy.workloadUpdateMethodsandLiveMigrate. If you enable both options as shown in this example, updates useEvictfor VMIs that support live migration andLiveMigratefor any VMIs that do not support live migration. To disable automatic workload updates, you can either remove theEvictstanza or setworkloadUpdateStrategyto leave the array empty.workloadUpdateMethods: []-
is the least disruptive update method. VMIs that support live migration are updated by migrating the virtual machine (VM) guest into a new pod with the updated components enabled. If
LiveMigrateis the only workload update method listed, VMIs that do not support live migration are not disrupted or updated.LiveMigrate -
is a disruptive method that shuts down VMI pods during upgrade.
Evictis the only update method available if live migration is not enabled in the cluster. If a VMI is controlled by aEvictobject that hasVirtualMachineconfigured, a new VMI is created in a new pod with updated components.runStrategy: Always
-
-
defines the number of VMIs that can be forced to be updated at a time by using the
spec.workloadUpdateStrategy.batchEvictionSizemethod. This does not apply to theEvictmethod.LiveMigrate - defines the interval to wait before evicting the next batch of workloads. This does not apply to the
spec.workloadUpdateStrategy.batchEvictionIntervalmethod.LiveMigrateNoteYou can configure live migration limits and timeouts by editing the
stanza of thespec.liveMigrationConfigCR.HyperConverged
- To apply your changes, save and exit the editor.
6.1.4.2. Viewing outdated VM workloads Link kopierenLink in die Zwischenablage kopiert!
You can view a list of outdated virtual machine (VM) workloads by using the CLI.
If there are outdated virtualization pods in your cluster, the
OutdatedVirtualMachineInstanceWorkloads
Procedure
To view a list of outdated virtual machine instances (VMIs), run the following command:
$ oc get vmi -l kubevirt.io/outdatedLauncherImage --all-namespaces
6.1.5. Control Plane Only updates Link kopierenLink in die Zwischenablage kopiert!
Every even-numbered minor version of OpenShift Container Platform is an Extended Update Support (EUS) version. However, Kubernetes design mandates serial minor version updates, so you cannot directly update from one EUS version to the next. An EUS-to-EUS update starts with updating OpenShift Virtualization to the latest z-stream of the next odd-numbered minor version. Next, update OpenShift Container Platform to the target EUS version. When the OpenShift Container Platform update succeeds, the corresponding update for OpenShift Virtualization becomes available. You can now update OpenShift Virtualization to the target EUS version.
You can directly update OpenShift Virtualization to the latest z-stream release of your current minor version without applying each intermediate z-stream update.
For more information about EUS versions, see the Red Hat OpenShift Container Platform Life Cycle Policy.
6.1.5.1. Prerequisites Link kopierenLink in die Zwischenablage kopiert!
Before beginning a Control Plane Only update, you must:
- Pause worker nodes' machine config pools before you start a Control Plane Only update so that the workers are not rebooted twice.
- Disable automatic workload updates before you begin the update process. This is to prevent OpenShift Virtualization from migrating or evicting your virtual machines (VMs) until you update to your target EUS version.
By default, OpenShift Virtualization automatically updates workloads, such as the
virt-launcher
spec.workloadUpdateStrategy
HyperConverged
6.1.5.2. Preventing workload updates during a Control Plane Only update Link kopierenLink in die Zwischenablage kopiert!
When you update from one Extended Update Support (EUS) version to the next, you must manually disable automatic workload updates to prevent OpenShift Virtualization from migrating or evicting workloads during the update process.
Prerequisites
- You are running an EUS version of OpenShift Container Platform and want to update to the next EUS version. You have not yet updated to the odd-numbered version in between.
- You read "Preparing to perform a Control Plane Only update" and learned the caveats and requirements that pertain to your OpenShift Container Platform cluster.
- You paused the worker nodes' machine config pools as directed by the OpenShift Container Platform documentation.
- It is recommended that you use the default Automatic approval strategy. If you use the Manual approval strategy, you must approve all pending updates in the web console. For more details, refer to the "Manually approving a pending Operator update" section.
Procedure
Run the following command and record the
configuration:workloadUpdateMethods$ oc get kv kubevirt-kubevirt-hyperconverged \ -n openshift-cnv -o jsonpath='{.spec.workloadUpdateStrategy.workloadUpdateMethods}'Turn off all workload update methods by running the following command:
$ oc patch hyperconverged kubevirt-hyperconverged -n openshift-cnv \ --type json -p '[{"op":"replace","path":"/spec/workloadUpdateStrategy/workloadUpdateMethods", "value":[]}]'Example output
hyperconverged.hco.kubevirt.io/kubevirt-hyperconverged patchedEnsure that the
Operator isHyperConvergedbefore you continue. Enter the following command and monitor the output:Upgradeable$ oc get hyperconverged kubevirt-hyperconverged -n openshift-cnv -o json | jq ".status.conditions"Example 6.1. Example output
[ { "lastTransitionTime": "2022-12-09T16:29:11Z", "message": "Reconcile completed successfully", "observedGeneration": 3, "reason": "ReconcileCompleted", "status": "True", "type": "ReconcileComplete" }, { "lastTransitionTime": "2022-12-09T20:30:10Z", "message": "Reconcile completed successfully", "observedGeneration": 3, "reason": "ReconcileCompleted", "status": "True", "type": "Available" }, { "lastTransitionTime": "2022-12-09T20:30:10Z", "message": "Reconcile completed successfully", "observedGeneration": 3, "reason": "ReconcileCompleted", "status": "False", "type": "Progressing" }, { "lastTransitionTime": "2022-12-09T16:39:11Z", "message": "Reconcile completed successfully", "observedGeneration": 3, "reason": "ReconcileCompleted", "status": "False", "type": "Degraded" }, { "lastTransitionTime": "2022-12-09T20:30:10Z", "message": "Reconcile completed successfully", "observedGeneration": 3, "reason": "ReconcileCompleted", "status": "True", "type": "Upgradeable" } ]The OpenShift Virtualization Operator has the
status.UpgradeableManually update your cluster from the source EUS version to the next minor version of OpenShift Container Platform:
$ oc adm upgradeVerification
Check the current version by running the following command:
$ oc get clusterversionNoteUpdating OpenShift Container Platform to the next version is a prerequisite for updating OpenShift Virtualization. For more details, refer to the "Updating clusters" section of the OpenShift Container Platform documentation.
Update OpenShift Virtualization.
- With the default Automatic approval strategy, OpenShift Virtualization automatically updates to the corresponding version after you update OpenShift Container Platform.
- If you use the Manual approval strategy, approve the pending updates by using the web console.
Monitor the OpenShift Virtualization update by running the following command:
$ oc get csv -n openshift-cnvConfirm that OpenShift Virtualization successfully updated to the latest z-stream release of the non-EUS version by running the following command:
$ oc get hyperconverged kubevirt-hyperconverged -n openshift-cnv -o json | jq ".status.versions"Example output
[ { "name": "operator", "version": "4.14.17" } ]Wait until the
Operator has theHyperConvergedstatus before you perform the next update. Enter the following command and monitor the output:Upgradeable$ oc get hyperconverged kubevirt-hyperconverged -n openshift-cnv -o json | jq ".status.conditions"- Update OpenShift Container Platform to the target EUS version.
Confirm that the update succeeded by checking the cluster version:
$ oc get clusterversionUpdate OpenShift Virtualization to the target EUS version.
- With the default Automatic approval strategy, OpenShift Virtualization automatically updates to the corresponding version after you update OpenShift Container Platform.
- If you use the Manual approval strategy, approve the pending updates by using the web console.
Monitor the OpenShift Virtualization update by running the following command:
$ oc get csv -n openshift-cnvThe update completes when the
field matches the target EUS version and theVERSIONfield readsPHASE.SucceededRestore the
configuration that you recorded from step 1 with the following command:workloadUpdateMethods$ oc patch hyperconverged kubevirt-hyperconverged -n openshift-cnv --type json -p \ "[{\"op\":\"add\",\"path\":\"/spec/workloadUpdateStrategy/workloadUpdateMethods\", \"value\":{WorkloadUpdateMethodConfig}}]"Example output
hyperconverged.hco.kubevirt.io/kubevirt-hyperconverged patchedVerification
Check the status of VM migration by running the following command:
$ oc get vmim -A
Next steps
- You can now unpause the worker nodes' machine config pools.