Hello,
when looking at the "Summary" tab of a Cluster in vSphere Web Client there is a graph showing
for
I would like to know how to access these values behind the graph from vRealize Orchestrator and how they are calculated!? Reason is, that I want
to use the values for CPU and Memory for the selection of the least used cluster when deploying a new VM.
Currently I'm playing around with figures which I extracted from
VcComputeResourceSummary()
VcClusterComputeResourceSummary()
VcResourcePoolRuntimeInfo()
and extract stuff like
and also
etc.
So far, I wasn't able to get any values which are close enough to the values which are shown in the vSphere Web Client.
Any input is highly appreciated. I already searched the community, but I wasn't able to find something.
Regards,
Lars
Hi Lars,
You can access these values via the property resourceUsage of the cluster scripting object. Here is some sample code (the input parameter is the variable cluster of type VC:ClusterComputeResource![]()
var usage = cluster.resourceUsage;
System.log("CPU Used MHz: " + usage.cpuUsedMHz);
System.log("CPU Capacity MHz: " + usage.cpuCapacityMHz);
System.log("Memory Used MB: " + usage.memUsedMB);
System.log("Memory Capacity MB: " + usage.memCapacityMB);
System.log("Storage Used MB: " + usage.storageUsedMB);
System.log("Storage Capacity MB: " + usage.storageCapacityMB);
Hi Lars,
You can access these values via the property resourceUsage of the cluster scripting object. Here is some sample code (the input parameter is the variable cluster of type VC:ClusterComputeResource![]()
var usage = cluster.resourceUsage;
System.log("CPU Used MHz: " + usage.cpuUsedMHz);
System.log("CPU Capacity MHz: " + usage.cpuCapacityMHz);
System.log("Memory Used MB: " + usage.memUsedMB);
System.log("Memory Capacity MB: " + usage.memCapacityMB);
System.log("Storage Used MB: " + usage.storageUsedMB);
System.log("Storage Capacity MB: " + usage.storageCapacityMB);
Hello Ilian,
thank you very much for your quick response. That was the way I tried it long time ago, but for some reason I discarded it. The values I retrieve now look way better.
Regards,
Lars
