private ClusterResources currentResources(Application application,
                                              ClusterSpec clusterSpec,
                                              Cluster cluster,
                                              Capacity requested,
                                              CapacityPolicies capacityPolicies) {
        NodeList nodes = nodeRepository.nodes().list(Node.State.active).owner(application.id())
                                       .cluster(clusterSpec.id())
                                       .not().retired()
                                       .not().removable();
        boolean firstDeployment = nodes.isEmpty();
        var current =
                firstDeployment // start at min, preserve current resources otherwise
                ? new AllocatableResources(initialResourcesFrom(requested, clusterSpec, application.id(), capacityPolicies), clusterSpec,
                                           nodeRepository, requested.cloudAccount().orElse(CloudAccount.empty))
                : new AllocatableResources(nodes, nodeRepository);
        var model = new ClusterModel(nodeRepository, application, clusterSpec, cluster, nodes, current, nodeRepository.metricsDb(), nodeRepository.clock());
        return within(Limits.of(requested), model, firstDeployment);
    }
Returns the current resources of this cluster, or requested min if none
node-repository/src/main/java/com/yahoo/vespa/hosted/provision/provisioning/NodeRepositoryProvisioner.java