1
0
mirror of https://github.com/openshift/openshift-docs.git synced 2026-02-05 12:46:18 +01:00
Files
openshift-docs/modules/virt-configuring-workload-update-methods.adoc
2023-10-30 10:13:25 -04:00

58 lines
2.8 KiB
Plaintext

// Module included in the following assemblies:
//
// * virt/updating/upgrading-virt.adoc
:_mod-docs-content-type: PROCEDURE
[id="virt-configuring-workload-update-methods_{context}"]
= Configuring workload update methods
You can configure workload update methods by editing the `HyperConverged` custom resource (CR).
.Prerequisites
* To use live migration as an update method, you must first enable live migration in the cluster.
+
[NOTE]
====
If a `VirtualMachineInstance` CR contains `evictionStrategy: LiveMigrate` and the virtual machine instance (VMI) does not support live migration, the VMI will not update.
====
.Procedure
. To open the `HyperConverged` CR in your default editor, run the following command:
+
[source,terminal,subs="attributes+"]
----
$ oc edit hyperconverged kubevirt-hyperconverged -n {CNVNamespace}
----
. Edit the `workloadUpdateStrategy` stanza of the `HyperConverged` CR. For example:
+
[source,yaml]
----
apiVersion: hco.kubevirt.io/v1beta1
kind: HyperConverged
metadata:
name: kubevirt-hyperconverged
spec:
workloadUpdateStrategy:
workloadUpdateMethods: <1>
- LiveMigrate <2>
- Evict <3>
batchEvictionSize: 10 <4>
batchEvictionInterval: "1m0s" <5>
# ...
----
<1> The methods that can be used to perform automated workload updates. The available values are `LiveMigrate` and `Evict`. If you enable both options as shown in this example, updates use `LiveMigrate` for VMIs that support live migration and `Evict` for any VMIs that do not support live migration. To disable automatic workload updates, you can either remove the `workloadUpdateStrategy` stanza or set `workloadUpdateMethods: []` to leave the array empty.
//NOTE: in 4.10, removing the stanza will not disable the feature.
<2> 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 `LiveMigrate` is the only workload update method listed, VMIs that do not support live migration are not disrupted or updated.
<3> A disruptive method that shuts down VMI pods during upgrade. `Evict` is the only update method available if live migration is not enabled in the cluster. If a VMI is controlled by a `VirtualMachine` object that has `runStrategy: Always` configured, a new VMI is created in a new pod with updated components.
<4> The number of VMIs that can be forced to be updated at a time by using the `Evict` method. This does not apply to the `LiveMigrate` method.
<5> The interval to wait before evicting the next batch of workloads. This does not apply to the `LiveMigrate` method.
+
[NOTE]
====
You can configure live migration limits and timeouts by editing the `spec.liveMigrationConfig` stanza of the `HyperConverged` CR.
====
. To apply your changes, save and exit the editor.