public Node retire(Agent agent, Instant retiredAt) {
        Allocation allocation = requireAllocation("Cannot retire");
        if (allocation.membership().retired()) return this;
        return with(allocation.retire())
                .with(history.with(new History.Event(History.Event.Type.retired, agent, retiredAt)));
    }
Returns a copy of this node which is retired.
If the node was already retired it is returned as-is.
node-repository/src/main/java/com/yahoo/vespa/hosted/provision/Node.java