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.
Before you start
Section titled “Before you start”- You have the ClusterRole
pk-metal-approver. It lets you patch HostOperations. - If you proposed the operation, your site allows self-approval (
selfApproval, see Set up approval permissions). If it does not, another person must approve.
Approve
Section titled “Approve”-
List the operations that wait for a person.
Terminal window pk-metal approve -
Approve one. The command shows each step in plain words. Type
y.Terminal window pk-metal approve pk-metal/provision-simhw2288v5000397-0f3c9a1eThe operation goes to
Running, or it waits for its MaintenanceWindow. -
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.
Hold a claim
Section titled “Hold a claim”A hold stops new proposals for one HostClaim. Nothing on the machine changes.
-
Hold the claim. Give the reason.
Terminal window pk-metal hold --reason "waiting for new disk" default/w-1pk-metal status shows
(on hold)for the claim. -
When you are ready, remove the hold.
Terminal window pk-metal unhold default/w-1
Retry a failed operation
Section titled “Retry a failed operation”-
Read why the operation failed.
Terminal window kubectl -n pk-metal describe hostoperation provision-simhw2288v5000397-0f3c9a1e -
Correct the cause.
-
Retry the operation.
Terminal window pk-metal retry pk-metal/provision-simhw2288v5000397-0f3c9a1eThe operator proposes the same plan again. The new operation waits for approval.
Abort a running operation
Section titled “Abort a running operation”-
Abort the operation. Give the reason.
Terminal window pk-metal abort --reason "wrong machine" pk-metal/reboot-w-1-x7k2p -
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.
Verify
Section titled “Verify”pk-metal statusshows the new phase.- The
APPROVEDcolumn shows your user name.
If it fails
Section titled “If it fails”| What you see | Go to |
|---|---|
| The approved operation does not start | Operation held |
| The operation fails | Operation failed |