5.8. Virtual machine recovery from node failures
To ensure that virtual machines (VMs) recover automatically when a node fails, configure node health checks, automated remediation, and capacity planning. These recommendations come from chaos testing results and help minimize VM downtime during node failure conditions.
5.8.1. How node health monitoring protects virtual machines 링크 복사링크가 클립보드에 복사되었습니다!
By default, virtual machines (VMs) are not automatically recovered to other available nodes when a node fails. To minimize VM downtime and ensure workload resilience, configure node health monitoring and automated remediation.
Without the Node Health Check Operator and a remediation Operator such as Self Node Remediation (SNR) or Fence Agents Remediation (FAR), VMs experience downtime until the node recovers. Apply the following configurations to ensure your workloads are resilient under node failure conditions:
-
Configure VMs with
runStrategy: Alwaysto allow recovery to other available nodes. - Deploy and configure the Node Health Check Operator to monitor node status changes and trigger automated remediation.
- Configure a remediation operator, such as SNR or FAR, to recover workloads from failed nodes.
- Plan node capacity to ensure that enough resources are available to host VMs that migrate from failed nodes.
5.8.1.1. Configuring a VM run strategy by using the CLI 링크 복사링크가 클립보드에 복사되었습니다!
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 OpenShift CLI (
oc).
Procedure
Edit the
VirtualMachineresource by running the following command:$ oc edit vm <vm_name> -n <namespace>Example run strategy:
apiVersion: kubevirt.io/v1 kind: VirtualMachine spec: runStrategy: Always # ...