Skip to content

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.

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.
FlagDefaultDescription
-n<string>pk-metalNamespace 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.

  1. The command asks the API server for your user name.
  2. It reads the operation. It refuses an operation that has a result.
  3. It sets the annotation metal.platform-kit.org/abort to <user name>: <reason>. The reason is required: the admission policy guard-lift accepts no other value.
  4. 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.
  5. The operator removes what the operation left behind.
  6. The phase of the operation becomes Aborted. The last step says what the operator removed.

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.

If you delete an operation, it also stops. But the operator then removes nothing from the machine.

pk-metal abort
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
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.
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.
CodeMeaning
0Success.
1Error; the message is on stderr, as "pk-metal: <message>".

A second abort of the same operation changes nothing and gives code 0.