Command · pk-metal
pk-metal abort
changes machinesneeds the cluster
pk-metal abort asks the operator to stop one HostOperation.
The operator stops before the next step and then removes the media, the boot override and the cordon of the operation.
Synopsis
Section titled “Synopsis”pk-metal abort [-n namespace] [--reason text] <operation> | <namespace>/<operation><operation>- The name of the operation, as pk-metal status prints it:
pk-metal/<name>, or the name only with-n.
| Flag | Default | Description |
|---|---|---|
-n<string> | pk-metal | Namespace of the operation. |
--reason<string>required | - | Why, for the people who read the operation later. |
This command also accepts the global flags --kubeconfig and --context.
What it does
Section titled “What it does”- The command asks the API server for your user name.
- It reads the operation. It refuses an operation that has a result.
- It sets the annotation
metal.platform-kit.org/abortto<user name>: <reason>. The reason is required: the admission policyguard-liftaccepts no other value. - The HostOperation controller stops the operation:
- An operation that did not start ends immediately. The machine did not change.
- An operation that runs stops before its next step.
- The operator removes what the operation left behind.
- The phase of the operation becomes Aborted. The last step says what the operator removed.
What the operator finishes first
Section titled “What the operator finishes first”A step that already acted on the machine completes before the operation stops.
- The operator waits for a reboot that it already asked for.
- If a PowerCycle already turned the machine off, the operator turns it on again.
What the operator removes
Section titled “What the operator removes”- The virtual media that the operation mounted (EjectMedia).
- The boot override that the operation set.
- The cordon of the Kubernetes node, if the operation cordoned it. A node that a person cordoned before stays cordoned.
If you delete an operation, it also stops. But the operator then removes nothing from the machine.
Examples
Section titled “Examples”pk-metal abort --reason "wrong node" pk-metal/reboot-w-1-x7k2p
asked to abort pk-metal/reboot-w-1-x7k2p. It stops before its next step (a step that already acted on the machine is finished first), then ejects its media, clears its boot override and uncordons the node it cordoned.
Follow it: pk-metal status, or kubectl get hostoperation -n pk-metal reboot-w-1-x7k2p
Abort an operation that waits for approval. Nothing changes on the machine.
pk-metal abort reboot-cp-2-m4q8z
asked to abort pk-metal/reboot-cp-2-m4q8z. It has not started, so it ends now and nothing is done to host simhw2288v5000398.
Objects
Section titled “Objects”| Object | Access | Purpose |
|---|---|---|
SelfSubjectReview |
create | Gets your user name from the API server. |
| HostOperation | get, list, patch | Sets the annotation metal.platform-kit.org/abort. |
Exit status
Section titled “Exit status”A second abort of the same operation changes nothing and gives code 0.
Related
Section titled “Related”- pk-metal retry deletes the aborted operation, so that the operator proposes it again.
- pk-metal rollout has its own
abortfor a full rollout. - Approve, hold, retry and abort
- Operation failed