public void forEachVMInvoke(Class<?> targetClass, String methodName, Object[] args) {
    Host host = Host.getHost(0);
    int vmCount = host.getVMCount();
    for (int i = 0; i < vmCount; i++) {
      LogWriterUtils.getLogWriter().info("Invoking " + methodName + "on VM#" + i);
      host.getVM(i).invoke(targetClass, methodName, args);
    }
  }
Assumes there is only one host, and invokes the given method in every VM that host knows about.
geode-core/src/distributedTest/java/org/apache/geode/internal/cache/DistributedCacheTestCase.java