VMware Cloud Community
bobert
Contributor
Contributor
Jump to solution

getting datastore usage history

When you go to the performance tab of a datastore you can see the graph of allocated and used space over a time range.

How do you access these stats via powercli?

get-stattype -entity * doesn't seem to return any stat types for datastores

the point of this is i'm trying to script a report that shows the datastore usage percentage over the last 7 days

e.g,  80%, 81%, 82%, 82%, 82%, 83%, 83%

Reply
0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

Have a look at my post called Datastore usage statistics


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

View solution in original post

Reply
0 Kudos
5 Replies
bobert
Contributor
Contributor
Jump to solution

no takers?

Reply
0 Kudos
bulletprooffool
Champion
Champion
Jump to solution

PowercLi - a simple 'Get-Datastore' - will return all Datastores, the Capacity and the amount of free space.

Simply schedule this daily and pipe the outout to a file somewhere and you will have all the info you need.

Sample output

Name                               FreeSpaceMB      CapacityMB
----                               -----------      ----------
DATASTORE119                             50642          477696
DATASTORE112T2                           91838         1023488
7578_local                               85814          137984
DATASTORE105                             61535          477696

Good luck

One day I will virtualise myself . . .
Reply
0 Kudos
bobert
Contributor
Contributor
Jump to solution

yes, interesting workaround.

I could dump datastore objects using export-clixml to a file and read it in the next day.

It will be an interesting scripting challenge. But I guess there is no other option since that data is not available via get-view or get-stat

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

Have a look at my post called Datastore usage statistics


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

Reply
0 Kudos
bobert
Contributor
Contributor
Jump to solution

:smileygrin: now that's what I call answered! I need a triple points button when awarding that the correct answer lol

Thanks heaps LucD!

Reply
0 Kudos