VMware {code} Community
Brian_Westphal
Contributor
Contributor

Why does QueryPerf() sometimes return null?

I have an application that uses the VI SDK. It connects directly to ESX server without going through Virtual Center. It samples performance counters at regular intervals.

Most of the time, it collects data fine. However, once in a while when calling QueryPerf() it gets a null return value. There is no exception thrown so there is no error message to indicate what happened. This usually happens for a single sample interval and rather sporadically. Next interval the same metric works fine.

I cannot find any documentation or online posting that describes when or why QueryPerf() would return null. My only guess is that the ESX server chooses to disregard the request when it is under heavy load.

Does anybody have any experience with this and know why it would be happening?

0 Kudos
10 Replies
admin
Immortal
Immortal

We never had such an observation. It would be great if you can share a sample script used for recreation. Or share some details for recreation, such as what were the entities you were trying to poll data, what was the interval, which version of ESX you are using, etc. Also check the data under Performance Tab in the VI Client as soon as you hit the issue next time. Does data in VI Client is missing for that interval? Please verify and update us with the results.

0 Kudos
Brian_Westphal
Contributor
Contributor

Here is a list of metrics from the most recent log we received from our customer:

Disk Write Requests instance: vmhba1:0:0

Disk Write Requests instance: vmhba1:0:10

Disk Write Requests instance: vmhba1:0:8

Disk Write Requests instance: vmhba1:0:17

Disk Read Rate instance: vmhba3:0:7

Disk Write Requests instance: vmhba1:0:12

Disk Write Requests instance: vmhba1:0:27

They have our software setup to sample a set of metrics every five minutes.

I need to see if the customer can watch the infrastructure client at the same time they are seeing problems with our product.

0 Kudos
Brian_Westphal
Contributor
Contributor

The version of ESX server that our customer is using is <![endif]><![if gte mso 9]>3.0.1.117504.

When looking at the VI client around the same time as our code gets the null return value our customer does not see any issues.

What can happen on the server that would cause this null return value?

0 Kudos
Brian_Westphal
Contributor
Contributor

I would edit my previous reply to remove the stupid M$ cut and paste from Outlook garbage, but the forum gives me an error every time I click the Edit link.

Anyway, ESX version is 3.0.1.117504

No problem indicated when they check VI Client around the same time as we get the null return value.

0 Kudos
heyitspablo
VMware Employee
VMware Employee

Brian - our team is looking at issue right now,, they will be in touch with you soon,,, thanks for your patience.

Keep up with latest info on vSphere PowerCLI http://blogs.vmware.com/vipowershell - Follow me on Twitter @heyitspablo
0 Kudos
Brian_Westphal
Contributor
Contributor

Anything more on this issue?

0 Kudos
DannyUtro
Contributor
Contributor

I have same problem. Any idea to resolve problem?

0 Kudos
admin
Immortal
Immortal

Can you please elaborate more on your issue?

What performance metrics are you trying to retrieve and what is ESX and VC version? Also, do you observe any error or do you see some data missing?

It would be great if you can share your sample code for the reference.

Thanks.

0 Kudos
DannyUtro
Contributor
Contributor

Hello, Angela.

I use a virtual center 2.5. Try to get metrics for all: for hosts (CPU, net etc.), for vritual machine (CPU, net etc.).

Hard to cut code from my project to show you, sorry. I try to create small project, to capture these nulls, and i'll post here later.

0 Kudos
Athadu
Contributor
Contributor

I ran into a similar issue and found out why in my case - link to that posting

There is a VMware KB article that refers to - check it out.

Regards

-Athadu

0 Kudos