// Module included in the following assemblies:

// * machine_management/mgmt-power-remediation-baremetal

:_mod-docs-content-type: CONCEPT
[id="mgmt-power-remediation-baremetal-about_{context}"]
= About power-based remediation of bare metal

[role="_abstract"]
You can configure and deploy a machine health check to detect and repair unhealthy bare-metal nodes, which is critical to ensuring the overall health of the cluster. 

Physically remediating a cluster can be challenging and any delay in putting the machine into a safe or an operational state increases the time the cluster remains in a degraded state, and the risk that subsequent failures might bring the cluster offline. Power-based remediation helps counter such challenges.

Instead of reprovisioning the nodes, power-based remediation uses a power controller to power off an inoperable node. This type of remediation is also called power fencing.

{product-title} uses the `MachineHealthCheck` controller to detect faulty bare metal nodes. Power-based remediation is fast and reboots faulty nodes instead of removing them from the cluster.

Power-based remediation provides the following capabilities:

* Allows the recovery of control plane nodes
* Reduces the risk of data loss in hyperconverged environments
* Reduces the downtime associated with recovering physical machines

[id="mgmt-power-remediation-baremetal-about-health-checks_{context}"]
== About machine health checks on bare metal

Machine deletion on bare metal cluster triggers reprovisioning of a bare metal host.
Usually bare metal reprovisioning is a lengthy process, during which the cluster
is missing compute resources and applications might be interrupted.

There are two ways to change the default remediation process from machine deletion to host power-cycle:

. Annotate the `MachineHealthCheck` resource with the
`machine.openshift.io/remediation-strategy: external-baremetal` annotation.
. Create a `Metal3RemediationTemplate` resource, and refer to it in the `spec.remediationTemplate` of the `MachineHealthCheck`.

After using one of these methods, unhealthy machines are power-cycled by using Baseboard Management Controller (BMC) credentials.

About the annotation-based remediation process::
The annotation-based remediation process performs the following steps:
+
--
. The MachineHealthCheck (MHC) controller detects that a node is unhealthy.
. The MHC notifies the bare metal machine controller which requests to power-off the unhealthy node.
. After the power is off, the node is deleted, which allows the cluster to reschedule the affected workload on other nodes.
. The bare metal machine controller requests to power on the node.
. After the node is up, the node re-registers itself with the cluster, resulting in the creation of a new node.
. After the node is recreated, the bare metal machine controller restores the annotations and labels that existed on the unhealthy node before its deletion.
--
+
[NOTE]
====
If the power operations did not complete, the bare metal machine controller triggers the reprovisioning of the unhealthy node unless this is a control plane node or a node that was provisioned externally.
====

About the metal3-based remediation process::
The metal3-based remediation process performs the following steps:
+
--
. The MachineHealthCheck (MHC) controller detects that a node is unhealthy.
. The MHC creates a metal3 remediation custom resource for the metal3 remediation controller, which requests to power-off the unhealthy node.
. After the power is off, the node is deleted, which allows the cluster to reschedule the affected workload on other nodes.
. The metal3 remediation controller requests to power on the node.
. After the node is up, the node re-registers itself with the cluster, resulting in the creation of a new node.
. After the node is recreated, the metal3 remediation controller restores the annotations and labels that existed on the unhealthy node before its deletion.
--
+
[NOTE]
====
If the power operations did not complete, the metal3 remediation controller triggers the reprovisioning of the unhealthy node unless this is a control plane node or a node that was provisioned externally.
====
