public Collection<HostSpec> activate(ApplicationId application, ClusterSpec cluster, Capacity capacity) {
        List<HostSpec> preparedNodes = prepare(application, cluster, capacity);

        // Add ip addresses and activate parent host if necessary
        for (HostSpec prepared : preparedNodes) {
            try (var lock = nodeRepository.nodes().lockAndGetRequired(prepared.hostname())) {
                Node node = lock.node();
                if (node.ipConfig().primary().isEmpty()) {
                    node = node.with(IP.Config.of(List.of("::" + 0 + ":0"), List.of()));
                    nodeRepository.nodes().write(node, lock);
                }
                if (node.parentHostname().isEmpty()) continue;
                Node parent = nodeRepository.nodes().node(node.parentHostname().get()).get();
                if (parent.state() == Node.State.active) continue;
                NestedTransaction t = new NestedTransaction();
                if (parent.ipConfig().primary().isEmpty())
                    parent = parent.with(IP.Config.of(List.of("::" + 0 + ":0"), List.of("::" + 0 + ":2")));
                nodeRepository.nodes().activate(List.of(parent), new ApplicationTransaction(new ApplicationMutex(application, () -> { }), t));
                t.commit();
            }
        }

        return activate(application, preparedNodes);
    }
A test utility for provisioning tests.

@author bratseth
node-repository/src/test/java/com/yahoo/vespa/hosted/provision/provisioning/ProvisioningTester.java