Skip to content

Commit 6366064

Browse files
authored
Merge pull request #99578 from lahinson/osdocs-16009-hcp-evictionstrategy
[OSDOCS-16009]: Adding evictionStrategy docs
2 parents ffd6958 + 371f1c4 commit 6366064

File tree

2 files changed

+55
-0
lines changed

2 files changed

+55
-0
lines changed

hosted_control_planes/hcp-manage/hcp-manage-virt.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ include::modules/hcp-virt-attach-nvidia-gpus.adoc[leveloffset=+1]
6060

6161
include::modules/hcp-virt-attach-nvidia-gpus-np-api.adoc[leveloffset=+1]
6262

63+
include::modules/hcp-virt-evict-vms.adoc[leveloffset=+1]
64+
6365
include::modules/hcp-topology-spread-constraint.adoc[leveloffset=+1]
6466

6567
[role="_additional-resources"]

modules/hcp-virt-evict-vms.adoc

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * hosted_control_planes/hcp-manage/hcp-manage-virt.adoc
4+
5+
:_mod-docs-content-type: PROCEDURE
6+
[id="hcp-virt-evict-vms_{context}"]
7+
= Evicting KubeVirt virtual machines
8+
9+
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.
10+
11+
.Procedure
12+
13+
. To learn more about the `hyperconverged` resource and the allowed values for the `evictionStrategy` parameter, enter the following command:
14+
+
15+
[source,terminal]
16+
----
17+
$ oc explain hyperconverged.spec.evictionStrategy
18+
----
19+
20+
. Patch the `hyperconverged` resource by entering the following command:
21+
+
22+
[source,terminal]
23+
----
24+
$ oc -n openshift-cnv patch hyperconverged kubevirt-hyperconverged \
25+
--type=merge \
26+
-p '{"spec": {"evictionStrategy": "External"}}'
27+
----
28+
29+
. Patch the workload update strategy and the workload update methods by entering the following command:
30+
+
31+
[source,terminal]
32+
----
33+
$ oc -n openshift-cnv patch hyperconverged kubevirt-hyperconverged \
34+
--type=merge \
35+
-p '{"spec": {"workloadUpdateStrategy": {"workloadUpdateMethods": ["LiveMigrate","Evict"]}}}'
36+
----
37+
+
38+
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.
39+
40+
.Verification
41+
42+
* Check whether the patch command was applied properly by entering the following command:
43+
+
44+
[source,terminal]
45+
----
46+
$ oc -n openshift-cnv get hyperconverged kubevirt-hyperconverged -ojsonpath='{.spec.evictionStrategy}'
47+
----
48+
+
49+
.Example output
50+
[source,terminal]
51+
----
52+
External
53+
----

0 commit comments

Comments
 (0)