workingengg
Contributor
Contributor

performance chat issue vcenter 6.0 - get - powershell

After upgrading to vcenter 6.0

through gui vcenter i am able to fetch the cluster wise data. but when i use powershell below commned no valus are showing ..its returning blank

Get-Stat -Entity ($cluster)-start (get-date).AddDays(-1) -Finish (Get-Date)-MaxSamples 10000 -stat cpu.usage.average

PS C:\> Get-Stat -Entity ($cluster)-start (get-date).AddDays(-1) -Finish (Get-Date)-MaxSamples 10000 -stat cpu.usage.average | Measure-Object -Property value -Average -Maximum -Minimum

PS C:\>


is any counters has been updated in 6.0

0 Kudos
18 Replies
LucD
Leadership
Leadership

Is that only for this specific counter ? Or for all counters on that cluster ?

Does it return data for the ESXi nodes in the cluster ?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
workingengg
Contributor
Contributor

Yes for esx i am able to get the data ..

only for cluster level i am not able to fetch the data. all the counters

0 Kudos
LucD
Leadership
Leadership

The cluster performance data is aggregated data, in other words it has to pass through the aggregation process.

Or you do the aggregation yourself with "realtime" data.

Try getting the cluster data for a time period further back than 1 day.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
workingengg
Contributor
Contributor

i couldn't able to fetch values for a particular time period back days, hours and min also .. but i am able to fetch same from GUI Smiley Sad

0 Kudos
LucD
Leadership
Leadership

Cluster metrics are aggregate data, meaning that they are created on the vCenter in scheduled jobs on the vCenter DB.

Can you check if these aggregation jobs are working correctly ?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
workingengg
Contributor
Contributor

All aggregation jobs are working and last run outcome also succeeded.

Event Task Cleanup

Past Day stats rollup

Past Month stats rollup

Past Week stats rollup

Process Performance Data

Topn past day

Topn past month

Topn past week

Topn past year

0 Kudos
LucD
Leadership
Leadership

Could you attach a screenshot of the commands you are trying to run ?

Also display the content of the variables (like $cluster)


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
workingengg
Contributor
Contributor

this is the command i am using with out any variable


Get-Stat -Entity (Get-cluster myclustername)-start (get-date).AddDays(-1) -Finish (Get-Date)-MaxSamples 10000 -stat cpu.usage.average | Measure-Object -Property value -Average -Maximum -Minimum


getting blank

screen.jpg

0 Kudos
LucD
Leadership
Leadership

There doesn't seem to be a blank between -Finish (Get-Date) and -MaxSamples


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
workingengg
Contributor
Contributor

actually ..it has space between

-Finish (Get-Date) and -MaxSamples


previous one is my typo error

0 Kudos
LucD
Leadership
Leadership

Thought as much :smileygrin:

Now can you see data for the past day under the Performance tab for this cluster ?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
workingengg
Contributor
Contributor

Bad luck .... Still same problem Smiley Sad

0 Kudos
workingengg
Contributor
Contributor

From GUI, vcenter i am able to see the

past day /month and custom date , under the Performance tab for clusters


While using the powershell only getting blank Smiley Sad strange

0 Kudos
LucD
Leadership
Leadership

There are a couple more things you could check.

Does the Get-Cluster, as used on the Entity parameter, actually return one or more objects ?

In my Stats Toolbox, see Stats Toolbox – A vSphere Server Performance Counter tool, there is an option to check for the oldest available statistical data for a specific entity.

What does it say for that cluster ?

Can you run the Get-Stat without the MaxSamples parameter.

Does that make any difference ?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
workingengg
Contributor
Contributor

get-cluster CMD is working like normal, its fetching of all my cluster name and HA,HAfaillevel,drs,drsautolevel parameters.

checked Get-Stat without the MaxSamples parameter. no luck  same blank.

i am able to fetch the data for individual esxi host.with max samples and without max,

Get-Stat -Entity (Get-vmhost myhostname)-start (get-date).AddDays(-1) -Finish (Get-Date)-MaxSamples 10000 -stat cpu.usage.average | Measure-Object -Property value -Average -Maximum -Minimum

0 Kudos
LucD
Leadership
Leadership

Could it be that you are suffering from the config.vpxd.stats.maxQueryMetrics setting ?

See KB2107096, you only need to check the config.vpxd.stats.maxQueryMetrics in this case.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
workingengg
Contributor
Contributor

Is any other way can fetch this info from database

Need a small info.. .What is the table that having the cluster performance and memory info in vcenter database

0 Kudos
LucD
Leadership
Leadership

No, there is no official other way of retrieving the statistical data.

That being said, the data is of course stored in a DB, and if you're adventurous enough you can try to submit queries directly to the DB.

There are a number of table views (named VPXV._HIST_STAT_xxxx) that apparently contain the statistical data.

Other people have tried this method as well, and seem to be successful in retrieving data.

See for example Querying the VMware vCenter Database (VCDB) for Performance and Configuration Information

But again, this is NOT an official and supported way of retrieving statistical data.

The DB schema can change between versions!


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos