private NodeList clusterOf(Node node, NodeList allNodes) {
        ApplicationId application = node.allocation().get().owner();
        ClusterSpec.Id cluster = node.allocation().get().membership().cluster().id();
        // This considers some non-active states to prevent unnecessary moves. E.g. we don't want to start moving nodes
        // to a host which already contain a failed node in our cluster
        return allNodes.state(Node.State.reserved, Node.State.active, Node.State.failed, Node.State.parked)
                       .owner(application)
                       .cluster(cluster);
    }
Ensure that nodes within a cluster a spread across hosts on exclusive network switches.

@author mpolden
node-repository/src/main/java/com/yahoo/vespa/hosted/provision/maintenance/SwitchRebalancer.java