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.
Synopsis
Section titled “Synopsis”pk-metal replace [-n namespace] --host <host> [--ack-etcd-risk reason] <claim> | <node>| Flag | Default | Description |
|---|---|---|
--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> | default | Namespace of the claim. |
This command also accepts the global flags --kubeconfig and --context.
What it does
Section titled “What it does”- The command finds the claim, as pk-metal reinstall does.
- It reads the new Host. The Host must be Available, not claimed and wiped.
- It writes the asset of the new Host into
spec.assetRefof the claim. - With
--ack-etcd-risk, it also sets the annotationmetal.platform-kit.org/ack-etcd-riskto<your username>: <reason>. - The HostClaim controller releases the old machine first.
- Then it proposes the install of the node on the new machine.
What happens to the old machine
Section titled “What happens to the old 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.
Examples
Section titled “Examples”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 --host simhw2288v5000403 w-1
pk-metal: host simhw2288v5000403 cannot take the node: not wiped (pk-metal wipe simhw2288v5000403)
Objects
Section titled “Objects”| 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. |
Exit status
Section titled “Exit status”Related
Section titled “Related”- Replace a node
- Add a node adds a node before you remove one.
- pk-metal reinstall installs the node again on the same machine.
- Remove a node
- Identity