private List<Node> findCandidates(ApplicationId application, ClusterCapacity clusterCapacity, int clusterIndex, LockedNodeList allNodes) {
        NodeResources nodeResources = toNodeResources(clusterCapacity);

        // We'll allocate each ClusterCapacity as a unique cluster in a dummy application
        ClusterSpec cluster = asSpec(Optional.ofNullable(clusterCapacity.clusterType()), clusterIndex);
        NodeSpec nodeSpec = NodeSpec.from(clusterCapacity.count(), 1, nodeResources, false, true,
                                          nodeRepository().zone().cloud().account(), Duration.ZERO);
        var allocationContext = IP.Allocation.Context.from(nodeRepository().zone().cloud(),
                                                           nodeSpec.cloudAccount().isExclave(nodeRepository().zone()),
                                                           nodeRepository().nameResolver());
        NodePrioritizer prioritizer = new NodePrioritizer(allNodes, application, cluster, nodeSpec,
                                                          true, false, allocationContext, nodeRepository().nodes(),
                                                          nodeRepository().resourcesCalculator(), nodeRepository().spareCount(),
                                                          nodeRepository().exclusivity().allocation(cluster));
        List<NodeCandidate> nodeCandidates = prioritizer.collect()
                                                        .stream()
                                                        .filter(node -> node.violatesExclusivity(cluster,
                                                                                                 application,
                                                                                                 nodeRepository().exclusivity().clusterType(cluster),
                                                                                                 nodeRepository().exclusivity().allocation(cluster),
                                                                                                 nodeRepository().zone().cloud().allowHostSharing(),
                                                                                                 allNodes)
                                                                        != NodeCandidate.ExclusivityViolation.YES)
                                                        .toList();
        MutableInteger index = new MutableInteger(0);
        return nodeCandidates
                .stream()
                .limit(clusterCapacity.count())
                .map(candidate -> candidate.toNode()
                        .allocate(application,
                                  ClusterMembership.from(cluster, index.next()),
                                  nodeResources,
                                  nodeRepository().clock().instant()))
                .toList();
    }
Try to allocate the preprovision cluster capacity.

@param mutableNodes represents all nodes in the node repo.  As preprovision capacity is virtually allocated
                    they are added to {@code mutableNodes}
@return the part of a cluster capacity it was unable to allocate, if any
node-repository/src/main/java/com/yahoo/vespa/hosted/provision/maintenance/HostCapacityMaintainer.java