VMware {code} Community
TomKol
Contributor
Contributor

QueryPerf: A specified parameter was not correct. metricId

Hi all,

I am trying to get metrics data for many objects at once. When I try to get data using QueryPerf for interval 300 seconds and also set metrics I want to get I get "A specified parameter was not correct. metricId" error when some metric do not exists for some object.

Weird is that if I use real time interval (20s), then QueryPerf return without error even if some metrics do not exist.

I know that I can get all available metrics, but that can be slow, because I want to query for hundreds of objects and I know which metric IDs I want. Is it really necessary to provide only available metrics to QueryPerf call or is there some workaround for historical intervals like 300s, etc?

Thanks,

Tomas

0 Kudos
6 Replies
dmitrif
Enthusiast
Enthusiast

Tomas,

Recommended practice is to call QueryPerfProviderSummary and then QueryAvailablePerfMetric for each entity before QueryPerf: it will give you correct interval and metrics IDs you can fetch from that entity.

Do you do it (QueryPerfProviderSummary and QueryAvailablePerfMetric)?



Dmitri Fedorov

BridgeWays, a division of Xandros

www.bridgeways.ca

D.
0 Kudos
TomKol
Contributor
Contributor

No I do not call QueryAvailablePerfMetric. I think that it is great overhead to call it for all entities (1000VMs). I do not udestand why there is not bulk version of available metrics.

For example I want to get just cpuUsage for all VMs and I need to call QueryAvailablePerfMetric for each one. QueryPerf is not sensitive to non existing MOR, but is sensitive to MetricId when doing history query.

Thanks,

Tomas

0 Kudos
dmitrif
Enthusiast
Enthusiast

No I do not call QueryAvailablePerfMetric

Then you will be getting the errors you asked about.

I think that it is great overhead to call it for all entities (1000VMs)

Software I develop easily handles over 2000 VMs and do make this call for every entity that is a performance data provider.

It makes it a little busy for the first time this metadata collected (then I cache and reuse it) , but nothing unmanageable.

is sensitive to MetricId when doing history query

of course it is Smiley Happy



Dmitri Fedorov

BridgeWays, a division of Xandros

www.bridgeways.ca

D.
0 Kudos
TomKol
Contributor
Contributor

I was thinking about cache, but metrics can change in time. That is why I want to ignore it. Maybe it is not possible. Good thing is that it is not sensitive at least on current metrics with interval 20s.

Thanks,

Tomas

0 Kudos
dmitrif
Enthusiast
Enthusiast

Metrics can change in time?

Meaning some of them could get added to or removed from an entity?

I've always thought that a set of available metrics for a given entity is relatively persistent, could you please give me an example of a situation when it is not?



Dmitri Fedorov

BridgeWays, a division of Xandros

www.bridgeways.ca

D.
0 Kudos
TomKol
Contributor
Contributor

Yes I mean add/remove of metrics. Simple example is when you scan these metrics on VM that is powered off. Then there is no metrics for example for disk activity etc. When you turn it on, it starts to collect these, so you see it in history.

Maybe I am wrong, but I think that I saw this.

Tomas

0 Kudos