Highlighted
Contributor
Contributor

getting datastore usage history

Jump to solution

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%

0 Kudos
1 Solution

Accepted Solutions
Highlighted
User Moderator
User Moderator

Have a look at my post called Datastore usage statistics


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

View solution in original post

0 Kudos
5 Replies
Highlighted
Contributor
Contributor

no takers?

0 Kudos
Highlighted

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 . . .
0 Kudos
Highlighted
Contributor
Contributor

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

0 Kudos
Highlighted
User Moderator
User Moderator

Have a look at my post called Datastore usage statistics


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

View solution in original post

0 Kudos
Highlighted
Contributor
Contributor

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

Thanks heaps LucD!

0 Kudos