Skip to content

Day 2

Approve, hold, retry and abort

Control each HostOperation: run it, stop new proposals, run a failed one again, or stop a running one.

HostOperation phases: AwaitingApproval, Running, then Succeeded, Failed or Aborted. Retry deletes a failed operation so that the operator proposes it again.AwaitingApprovalRunningSucceededFailedAbortedapproveabortretry: the operator proposes again
The four commands and the phases that they act on.
  1. List the operations that wait for a person.

    Terminal window
    pk-metal approve
  2. Approve one. The command shows each step in plain words. Type y.

    Terminal window
    pk-metal approve pk-metal/provision-simhw2288v5000397-0f3c9a1e

    The operation goes to Running, or it waits for its MaintenanceWindow.

  3. To approve several operations, give several names. The command shows the plan of each one, and it asks about each one.

    Terminal window
    pk-metal approve pk-metal/provision-simhw2288v5000397-0f3c9a1e pk-metal/provision-simhw2288v5000398-5e6f7a8b

No command approves all operations that wait. Each approval is an answer to one plan. See pk-metal approve.

The command reads the operation again after your answer. If the plan changed, it approves nothing.

A hold stops new proposals for one HostClaim. Nothing on the machine changes.

  1. Hold the claim. Give the reason.

    Terminal window
    pk-metal hold --reason "waiting for new disk" default/w-1

    pk-metal status shows (on hold) for the claim.

  2. When you are ready, remove the hold.

    Terminal window
    pk-metal unhold default/w-1
  1. Read why the operation failed.

    Terminal window
    kubectl -n pk-metal describe hostoperation provision-simhw2288v5000397-0f3c9a1e
  2. Correct the cause.

  3. Retry the operation.

    Terminal window
    pk-metal retry pk-metal/provision-simhw2288v5000397-0f3c9a1e

    The operator proposes the same plan again. The new operation waits for approval.

  1. Abort the operation. Give the reason.

    Terminal window
    pk-metal abort --reason "wrong machine" pk-metal/reboot-w-1-x7k2p
  2. Monitor the operation until its phase is Aborted.

    Terminal window
    kubectl -n pk-metal get hostoperation reboot-w-1-x7k2p -w

The operation stops before its next step. Then the operator ejects the media, clears the boot override and removes its cordon. A reboot, an applied config or an upgrade stays as it is.

  • pk-metal status shows the new phase.
  • The APPROVED column shows your user name.
What you see Go to
The approved operation does not start Operation held
The operation fails Operation failed