public Datacenter getRandomDatacenter() {
      if (hardwareLayout.getDatacenters().size() == 0) {
        return null;
      }
      return hardwareLayout.getDatacenters().get(new Random().nextInt(hardwareLayout.getDatacenters().size()));
    }
@return all existing nodes in hardware layout when this method is being invoked.
ambry-clustermap/src/test/java/com/github/ambry/clustermap/TestUtils.java