// Module included in the following assemblies:
//
// * virt/nodes/virt-eviction-strategies.adoc
// * virt/about_virt/virt-vm-recovery-from-node-failures.adoc

:_mod-docs-content-type: PROCEDURE
[id="virt-configuring-runstrategy-vm_{context}"]
= Configuring a VM run strategy by using the CLI

[role="_abstract"]
You can configure a run strategy for a virtual machine (VM) by using the command line. The run strategy controls whether a VM automatically restarts after disruptions such as node failures or maintenance events.

.Prerequisites

* You have installed the {oc-first}.

.Procedure

* Edit the `VirtualMachine` resource by running the following command:
+
[source,terminal]
----
$ oc edit vm <vm_name> -n <namespace>
----
+
Example run strategy:
+
[source,yaml]
----
apiVersion: kubevirt.io/v1
kind: VirtualMachine
spec:
  runStrategy: Always
# ...
----
