final int upgradeSlots(OsVersionTarget target, NodeList candidates) {
        if (!candidates.stream().allMatch(node -> node.type() == target.nodeType())) {
            throw new IllegalArgumentException("All node types must match type of OS version target " + target.nodeType());
        }
        int max = target.nodeType() == NodeType.host ? maxActiveUpgrades.value() : 1;
        int upgrading = candidates.changingOsVersionTo(target.version()).size();
        return Math.max(0, max - upgrading);
    }
Returns the number of upgrade slots available for given target
node-repository/src/main/java/com/yahoo/vespa/hosted/provision/os/OsUpgrader.java