VMware Cloud Community
LuckyT
Contributor
Contributor
Jump to solution

HostSystem CPU and Memory returns 0

Hi All,

I wrote below script to get Current CPU & Memory Usage on HostSystem in VCO 5.5, but below code always returns 0. Can someone help to resolve ? Is there any other way to get the Current Usage/Utilization ?

var myClusterOverallCpuUsage=0;

var  myClusterOverallMemoryUsage=0;

var myVcHostSystem = VcPlugin.allHostSystems

myClusterOverallCpuUsage = myVcHostSystem[0].summary.quickStats.overallCpuUsage;

myClusterOverallMemoryUsage = myVcHostSystem[0].summary.quickStats.overallMemoryUsage;

System.log( "name:" +myVcHostSystem[0].name);

System.log( "CPU usage"+myClusterOverallCpuUsage);

Thanks

0 Kudos
1 Solution

Accepted Solutions
iiliev
VMware Employee
VMware Employee
Jump to solution

OK, one more thing to try is to disable the usage of vCenter inventory service.

Put the following line in your vCO's vmo.properties file:

com.vmware.o11n.vim.useInventoryService=false

and then restart the vCO server (vco-server service)

View solution in original post

0 Kudos
5 Replies
RaviMV
Enthusiast
Enthusiast
Jump to solution

Let me run this script in my test lab and get back to U.

0 Kudos
iiliev
VMware Employee
VMware Employee
Jump to solution

Verify that CPU and memory usage for this host are visible in vCenter itself. If they are not available there, you may need to restart host management agents. Check the following KB for information how to do so:

http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=100349...

0 Kudos
LuckyT
Contributor
Contributor
Jump to solution

Hi,

The values in vCenter is visible & also i tested calling VIX API using Java and it returns the exact value from vCenter. But when i call from VCO it is returning 0.

Thanks

0 Kudos
iiliev
VMware Employee
VMware Employee
Jump to solution

OK, one more thing to try is to disable the usage of vCenter inventory service.

Put the following line in your vCO's vmo.properties file:

com.vmware.o11n.vim.useInventoryService=false

and then restart the vCO server (vco-server service)

0 Kudos
LuckyT
Contributor
Contributor
Jump to solution

Thanks Ilian, this did work for me..

0 Kudos