1
0
mirror of https://github.com/openshift/openshift-docs.git synced 2026-02-06 15:46:57 +01:00
Files
openshift-docs/modules/virt-configuring-vm-live-migration-cli.adoc

47 lines
1.1 KiB
Plaintext

// Module included in the following assemblies:
//
// * virt/live_migration/virt-configuring-vmi-eviction-strategy.adoc
[id="virt-configuring-vm-live-migration-cli_{context}"]
= Configuring custom virtual machines with the `LiveMigration` eviction strategy
You only need to configure the `LiveMigration` eviction strategy on custom
virtual machines. Common templates have this eviction strategy
configured by default.
.Procedure
. Add the `evictionStrategy: LiveMigrate` option to the `spec` section in the
virtual machine configuration file. This example uses `oc edit` to update
the relevant snippet of the `VirtualMachine` configuration file:
+
[source,terminal]
----
$ oc edit vm <custom-vm> -n <my-namespace>
----
+
[source,yaml]
----
apiVersion: kubevirt.io/v1alpha3
kind: VirtualMachine
metadata:
name: custom-vm
spec:
terminationGracePeriodSeconds: 30
evictionStrategy: LiveMigrate
domain:
resources:
requests:
...
----
. Restart the virtual machine for the update to take effect:
+
[source,terminal]
----
$ virtctl restart <custom-vm> -n <my-namespace>
----