public boolean canAllocateTenantNodeTo(Node host, boolean dynamicProvisioning) {
        if ( ! host.type().canRun(NodeType.tenant)) return false;
        if (host.status().wantToRetire()) return false;
        if (host.allocation().map(alloc -> alloc.membership().retired()).orElse(false)) return false;

        if (dynamicProvisioning)
            return EnumSet.of(State.provisioned, State.ready, State.reserved, State.active).contains(host.state());
        else
            return host.state() == State.active;
    }
Performs an operation requiring locking on all given nodes.

@param action the action to perform
@return the set of nodes on which the action was performed, as they became as a result of the operation
node-repository/src/main/java/com/yahoo/vespa/hosted/provision/node/Nodes.java