private NodeCandidate candidateFrom(Node node) {
        Optional<Node> optionalParent = allNodes.parentOf(node);
        if (optionalParent.isPresent()) {
            Node parent = optionalParent.get();
            return NodeCandidate.createChild(node,
                                             capacity.availableCapacityOf(parent),
                                             parent,
                                             spareHosts.contains(parent),
                                             false,
                                             parent.exclusiveToApplicationId().isEmpty()
                                             && requested.canResize(node.resources(),
                                                                    capacity.unusedCapacityOf(parent),
                                                                    clusterSpec.type(),
                                                                    topologyChange,
                                                                    currentClusterSize));
        } else {
            return NodeCandidate.createStandalone(node, false);
        }
    }
Create a candidate from given pre-existing node
node-repository/src/main/java/com/yahoo/vespa/hosted/provision/provisioning/NodePrioritizer.java