6.6.7. Deleting the machine of the unhealthy etcd member
Finish removing the failed control plane node by deleting the machine of the unhealthy etcd member.
Procedure
Ensure that the Bare Metal Operator is available by running the following command:
$ oc get clusteroperator baremetalExample output
NAME VERSION AVAILABLE PROGRESSING DEGRADED SINCE MESSAGE baremetal 5.0.0 True False False 3d15hSave the
BareMetalHostobject of the affected node to a file for later use by running the following command:$ oc get -n openshift-machine-api bmh <node_name> -o yaml > bmh_affected.yamlReplace
<node_name>with the name of the affected node, which usually matches the associatedBareMetalHostname.View the YAML file of the saved
BareMetalHostobject by running the following command, and ensure the content is correct:$ cat bmh_affected.yamlRemove the affected
BareMetalHostobject by running the following command:$ oc delete -n openshift-machine-api bmh <node_name>Replace
<node_name>with the name of the affected node.List all machines by running the following command and identify the machine associated with the affected node:
$ oc get machines -n openshift-machine-api -o wideExample output
NAME PHASE TYPE REGION ZONE AGE NODE PROVIDERID STATE examplecluster-control-plane-0 Running 3h11m openshift-control-plane-0 baremetalhost:///openshift-machine-api/openshift-control-plane-0/da1ebe11-3ff2-41c5-b099-0aa41222964e externally provisioned examplecluster-control-plane-1 Running 3h11m openshift-control-plane-1 baremetalhost:///openshift-machine-api/openshift-control-plane-1/d9f9acbc-329c-475e-8d81-03b20280a3e1 externally provisioned examplecluster-control-plane-2 Running 3h11m openshift-control-plane-2 baremetalhost:///openshift-machine-api/openshift-control-plane-2/3354bdac-61d8-410f-be5b-6a395b056135 externally provisioned examplecluster-compute-0 Running 165m openshift-compute-0 baremetalhost:///openshift-machine-api/openshift-compute-0/3d685b81-7410-4bb3-80ec-13a31858241f provisioned examplecluster-compute-1 Running 165m openshift-compute-1 baremetalhost:///openshift-machine-api/openshift-compute-1/0fdae6eb-2066-4241-91dc-e7ea72ab13b9 provisionedDelete the machine of the unhealthy member by running the following command:
$ oc delete machine -n openshift-machine-api <machine_name>Replace
<machine_name>with the machine name associated with the affected node.Example command
$ oc delete machine -n openshift-machine-api examplecluster-control-plane-2참고After you remove the
BareMetalHostandMachineobjects, the machine controller automatically deletes theNodeobject.If deletion of the machine is delayed for any reason or the command is obstructed and delayed, force deletion by removing the machine object finalizer field.
주의Do not interrupt machine deletion by pressing
Ctrl+c. You must allow the command to proceed to completion. Open a new terminal window to edit and delete the finalizer fields.On a new terminal window, edit the machine configuration by running the following command:
$ oc edit machine -n openshift-machine-api examplecluster-control-plane-2Delete the following fields in the
Machinecustom resource, and then save the updated file:finalizers: - machine.machine.openshift.ioExample output
machine.machine.openshift.io/examplecluster-control-plane-2 edited