var cluster = vm.runtime.host.parent;
if (cluster.vimType == "ClusterComputeResource") {
System.log("cluster name -> " + cluster.name);
System.log("cpu cores -> " + cluster.summary.numCpuCores);
System.log("effective cpu (MHz) -> " + cluster.summary.effectiveCpu);
System.log("effective mem (MB) -> " + cluster.summary.effectiveMemory);
System.log("total cpu (MHz) -> " + cluster.summary.totalCpu);
System.log("total mem (Bytes) -> " + cluster.summary.totalMemory);
// usage details for a DRS cluster can be accessed via cluster.usageSummary;
} else {
System.log("Not a cluster, perhaps a standalone host? -> " + cluster.vimType);
}