mirror of
https://github.com/openshift/openshift-docs.git
synced 2026-02-05 12:46:18 +01:00
Merge pull request #99578 from lahinson/osdocs-16009-hcp-evictionstrategy
[OSDOCS-16009]: Adding evictionStrategy docs
This commit is contained in:
@@ -60,6 +60,8 @@ include::modules/hcp-virt-attach-nvidia-gpus.adoc[leveloffset=+1]
|
||||
|
||||
include::modules/hcp-virt-attach-nvidia-gpus-np-api.adoc[leveloffset=+1]
|
||||
|
||||
include::modules/hcp-virt-evict-vms.adoc[leveloffset=+1]
|
||||
|
||||
include::modules/hcp-topology-spread-constraint.adoc[leveloffset=+1]
|
||||
|
||||
[role="_additional-resources"]
|
||||
|
||||
53
modules/hcp-virt-evict-vms.adoc
Normal file
53
modules/hcp-virt-evict-vms.adoc
Normal file
@@ -0,0 +1,53 @@
|
||||
// Module included in the following assemblies:
|
||||
//
|
||||
// * hosted_control_planes/hcp-manage/hcp-manage-virt.adoc
|
||||
|
||||
:_mod-docs-content-type: PROCEDURE
|
||||
[id="hcp-virt-evict-vms_{context}"]
|
||||
= Evicting KubeVirt virtual machines
|
||||
|
||||
In cases where KubeVirt virtual machines (VMs) cannot be live migrated, such as when you use GPU passthrough, the VMs must be evicted at the same time as the `NodePool` resource of the hosted cluster. Otherwise, the compute nodes might be shut down without being drained from the workload. This might also happen when you are upgrading the {VirtProductName} Operator. To achieve a synchronized restart, you can set the `evictionStrategy` parameter on the `hyperconverged` resource to ensure that only VMs that are drained from workloads are rebooted.
|
||||
|
||||
.Procedure
|
||||
|
||||
. To learn more about the `hyperconverged` resource and the allowed values for the `evictionStrategy` parameter, enter the following command:
|
||||
+
|
||||
[source,terminal]
|
||||
----
|
||||
$ oc explain hyperconverged.spec.evictionStrategy
|
||||
----
|
||||
|
||||
. Patch the `hyperconverged` resource by entering the following command:
|
||||
+
|
||||
[source,terminal]
|
||||
----
|
||||
$ oc -n openshift-cnv patch hyperconverged kubevirt-hyperconverged \
|
||||
--type=merge \
|
||||
-p '{"spec": {"evictionStrategy": "External"}}'
|
||||
----
|
||||
|
||||
. Patch the workload update strategy and the workload update methods by entering the following command:
|
||||
+
|
||||
[source,terminal]
|
||||
----
|
||||
$ oc -n openshift-cnv patch hyperconverged kubevirt-hyperconverged \
|
||||
--type=merge \
|
||||
-p '{"spec": {"workloadUpdateStrategy": {"workloadUpdateMethods": ["LiveMigrate","Evict"]}}}'
|
||||
----
|
||||
+
|
||||
By applying this patch, you specify that VMs should be live-migrated if possible, and that only the VMs that cannot be live-migrated should be evicted.
|
||||
|
||||
.Verification
|
||||
|
||||
* Check whether the patch command was applied properly by entering the following command:
|
||||
+
|
||||
[source,terminal]
|
||||
----
|
||||
$ oc -n openshift-cnv get hyperconverged kubevirt-hyperconverged -ojsonpath='{.spec.evictionStrategy}'
|
||||
----
|
||||
+
|
||||
.Example output
|
||||
[source,terminal]
|
||||
----
|
||||
External
|
||||
----
|
||||
Reference in New Issue
Block a user