VMware {code} Community
efranz
Contributor
Contributor

Not getting real-time memory performance data with _service.QueryPerf in vShpere

Hello,

does anyone have the same problem ?

I have a vshpere vCenter server with one ESX 4.0.0 (164009) and one ESX 3.0.2 ( 52542) in it.

I wrote a VB.NET application to query real-time statistics from ESX hosts via vCenter. The funny thing is that I get all CPU, memory, nic, and vmhba real-time stats from the 3.0.2 host by using the _service.QeryPerf method. When I try to query the ESX4 host, even _service.QueryAvailablePerfMetric does not return any memory counters.

Since it is not a problem with vCenter (it returns the memory data for the 3.0.2 host) I wonder whatever could be the problem here. According to the SDK docs nothing has changed here so far.

This is what I do:

1. Query available metrics with: _service.QueryAvailablePerfMetric returns 262 items

2. Query counters with: _service.QueryPerfCounter returns 262 items, too

3. Define a spec with passing all 262 IDs in PerfQSpec(0).metricId = PMIDSelected

PerfQSpec = New PerfQuerySpec() {New PerfQuerySpec()}

PerfQSpec(0).entity = entity

PerfQSpec(0).startTime = StartTime

PerfQSpec(0).startTimeSpecified = UseTimeSpans

PerfQSpec(0).endTime = EndTime

PerfQSpec(0).endTimeSpecified = UseTimeSpans

PerfQSpec(0).maxSample = 1

PerfQSpec(0).maxSampleSpecified = True

PerfQSpec(0).metricId = PMIDSelected

PerfQSpec(0).intervalId = RefreshRate

4. Then, finally, the service.QueryPerf(pmMor, PerfQSpec) returns NULL

That was a nice weekend ...

Any help very appreciated

Thanks

Erik

Reply
0 Kudos
4 Replies
BarkerDavidL
Contributor
Contributor

Yes, I am getting the same error.

I have ESX 3.5 and ESX 4.0. I am querying for CPU usage average over the last 20 seconds. In ESX 3.5, I get the value back. With ESX 4.0, the SOAP response returns two values separated by a comma (if format is CSV, as is mine. If 'normal', then you get an array. Either way, your code is probably set up to expect a string containing an integer.) So my client fails. Since I only have access to the values of the SOAP request parameters, I don't have a work-around for ESX 4.0.

See my topic here: http://communities.vmware.com/message/1469581#1469581

Reply
0 Kudos
admin
Immortal
Immortal

Hi,

I wanted to check if you are able to pull out the performance data for the ESX 4.0 host if you connect directly to host instead of vCenter. Also, kindly confirm if you are able to view the same from VI Client also, and you are facing issues only while you are querying for the data by invoking the API.

Reply
0 Kudos
BarkerDavidL
Contributor
Contributor

Actually, I am using the Managed Object Browser (MOB) and browsing the HostAgent directly, so I am not using vSphere. Now that you point this out to me, I can see that the original question dealt with vSphere. I don't think we are using vSphere here yet, but I am sure I will need to use that in the near future.

My goal is to extract data from VMWare servers to track and report their configuration and performance. Currently, I am able to use SNMP for ESX 3.5, but some of the data we need is not available via SNMPin ESX 4.0. So I tried to use the web services to get single data elements back, but I am getting two data elements separated by a comma '415,213' instead of '213' even when setting maxSample to 1.

I am able to see the statistics via the VI Client while viewing the performance charts. The data matches up with the data returned by the web service. My problem is that I cannot control the tool I am using to access the SOAP service. My tool expects a single integer when I request maxSample=1, but since I get two, my tool does not work.

Should I be getting two integers when I request maxSample=1?

Reply
0 Kudos
dmitrif
Enthusiast
Enthusiast

Erik, you don't need to specify start/end time if you asking for interval that it the real-time refresh interval of 20.

D.
Reply
0 Kudos