Skip to content

Command · pk-metal

pk-metal replace

changes machinesneeds the cluster

pk-metal replace moves one node to a different machine. Use it when the hardware failed. The command points the HostClaim at the new machine. The operator then proposes the operations, and a person approves each one.

pk-metal replace [-n namespace] --host <host> [--ack-etcd-risk reason] <claim> | <node>
<claim> or <node>
The name of the HostClaim, or the name of the TalosNode that a claim names.
FlagDefaultDescription
--ack-etcd-risk<string>-Reason to accept an even or short etcd membership while a control plane moves; stored on the claim as "<your username>: <reason>".
--host<string>-The machine (Host) to move the node to; it must be Available.
-n<string>defaultNamespace of the claim.

This command also accepts the global flags --kubeconfig and --context.

  1. The command finds the claim, as pk-metal reinstall does.
  2. It reads the new Host. The Host must be Available, not claimed and wiped.
  3. It writes the asset of the new Host into spec.assetRef of the claim.
  4. With --ack-etcd-risk, it also sets the annotation metal.platform-kit.org/ack-etcd-risk to <your username>: <reason>.
  5. The HostClaim controller releases the old machine first.
  6. Then it proposes the install of the node on the new machine.
The machine answers
The node leaves the cluster, and the operator removes its etcd member. The operator resets the machine.
The machine does not answer
The operator turns the machine off and marks the Host for a wipe. Run pk-metal wipe before you use the machine again.

The node keeps its name. Thus its etcd member must go before the node joins again.

For hardware that still works, add the new node first and remove the old node after that. Then etcd always has enough members.

pk-metal replace
pk-metal replace --host simhw2288v5000402 w-1
claim default/w-1 now selects host simhw2288v5000402 (asset ci-00402); it ran on host simhw2288v5000400.
The operator first releases the old machine (its node leaves the cluster; a machine that does not answer is powered off and marked for a wipe),
then installs the node on the new one. Each step waits for: pk-metal approve

A Host that is not free gives the cause.

pk-metal replace
pk-metal replace --host simhw2288v5000403 w-1
pk-metal: host simhw2288v5000403 cannot take the node: not wiped (pk-metal wipe simhw2288v5000403)
Object Access Purpose
HostClaim get, list, patch Writes spec.assetRef, spec.systemRef and, with the flag, metal.platform-kit.org/ack-etcd-risk.
Host get Makes sure that the new machine is free. Reads its asset.
CodeMeaning
0Success.
1Error; the message is on stderr, as "pk-metal: <message>".