Skip to content

Commit 3e6ac62

Browse files
Merge pull request #78982 from jherrman/CNV-39419
OSDOCS#39419: Fixing procedure for creating live migration policies
2 parents 61c631b + 7316215 commit 3e6ac62

File tree

1 file changed

+36
-4
lines changed

1 file changed

+36
-4
lines changed

modules/virt-configuring-a-live-migration-policy.adoc

Lines changed: 36 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
[id="virt-configuring-a-live-migration-policy_{context}"]
77
= Creating a live migration policy by using the command line
88

9-
You can create a live migration policy by using the command line. A live migration policy is applied to selected virtual machines (VMs) by using any combination of labels:
9+
You can create a live migration policy by using the command line. KubeVirt applies the live migration policy to selected virtual machines (VMs) by using any combination of labels:
1010

1111
* VM labels such as `size`, `os`, or `gpu`
1212
* Project labels such as `priority`, `bandwidth`, or `hpc-workload`
@@ -22,7 +22,40 @@ If multiple policies meet this criteria, the policies are sorted by alphabetical
2222

2323
.Procedure
2424

25-
. Create a `MigrationPolicy` object as in the following example:
25+
. Edit the VM object to which you want to apply a live migration policy, and add the corresponding VM labels.
26+
27+
.. Open the YAML configuration of the resource:
28+
+
29+
[source,terminal]
30+
----
31+
$ oc edit vm <vm_name>
32+
----
33+
34+
.. Adjust the required label values in the `.spec.template.metadata.labels` section of the configuration. For example, to mark the VM as a `production` VM for the purposes of migration policies, add the `kubevirt.io/environment: production` line:
35+
+
36+
[source,yaml, subs="+quotes"]
37+
----
38+
apiVersion: migrations.kubevirt.io/v1alpha1
39+
kind: VirtualMachine
40+
metadata:
41+
name: <vm_name>
42+
namespace: default
43+
labels:
44+
app: my-app
45+
environment: production
46+
spec:
47+
template:
48+
metadata:
49+
labels:
50+
kubevirt.io/domain: <vm_name>
51+
kubevirt.io/size: large
52+
kubevirt.io/environment: production
53+
# ...
54+
----
55+
56+
.. Save and exit the configuration.
57+
58+
. Configure a `MigrationPolicy` object with the corresponding labels. The following example configures a policy that applies to all VMs that are labeled as `production`:
2659
+
2760
[source,yaml]
2861
----
@@ -36,8 +69,7 @@ spec:
3669
hpc-workloads: "True"
3770
xyz-workloads-type: ""
3871
virtualMachineInstanceSelector: <2>
39-
workload-type: "db"
40-
operating-system: ""
72+
kubevirt.io/environment: "production"
4173
----
4274
<1> Specify project labels.
4375
<2> Specify VM labels.

0 commit comments

Comments
 (0)