// Module included in the following assemblies:
//
// * virt/nodes/virt-eviction-strategies.adoc

:_mod-docs-content-type: PROCEDURE
[id="virt-delete-failed-node-vm-failover_{context}"]
= Delete a failed node to trigger virtual machine failover

[role="_abstract"]
If a node fails and machine health checks are not deployed on your cluster, virtual machines (VMs) with `runStrategy: Always` configured are not automatically relocated to healthy nodes. To trigger VM failover, you must manually delete the `Node` object.

.Prerequisites

* A node where a virtual machine was running has the `NotReady` condition.
* The virtual machine that was running on the failed node has `runStrategy` set to `Always`.
* You have installed the {oc-first}.

.Procedure

. Mark the node as unschedulable:
+
[source,terminal]
----
$ oc adm cordon <node_name>
----

. Drain all pods on the node:
+
[source,terminal]
----
$ oc adm drain <node_name> --force=true
----
+
This step might fail if the node is offline or unresponsive. Even if the node does not respond, the node might still be running a workload that writes to shared storage. To avoid data corruption, power down the physical hardware before you proceed.

. Delete the node from the cluster:
+
[source,terminal]
----
$ oc delete node <node_name>
----
+
Although the node object is now deleted from the cluster, it can still rejoin the cluster after reboot or if the kubelet service is restarted. To permanently delete the node and all its data, you must decommission the node.

. If you powered down the physical hardware, turn it back on so that the node can rejoin the cluster.

.Verification

* After all resources are terminated on the unhealthy node, a new virtual machine instance (VMI) is automatically created on a healthy node for each relocated VM. To confirm that the VMI was created, view all VMIs by using the {oc-first}.
