I’ve got a great new script for you today!

We all love VMware for consolidating our servers. And we all know that virtualization requires lot’s of SAN space. But how do you keep track of the amount of space left on all your datastores? It’s pretty easy to create a report using the Powershell VI Toolkit. But who is going to read all those reports and compare them to yesterday’s values? You will most likely end up with a mailbox full of reports and still be surprized when yet another datastore fills up.

PeetersOnline to the rescue! How about storing the report every day and comparing today’s values to yesterday’s values? Then you can email yourself only the differences. The overview shows the datastores that changed since yesterday, the change rate and the current value. This way, you can easily assess if the datastore is about to fill up.

Because it is quite a large script (in Powershell terms) and it contains long lines that are not easily readable on my site, I have attached the script for you to download. It contains lot’s of comments, so you should be able to follow exactly what it does and how it works. If not, post a comment.

Enjoy!
Hugo

Track-Datastores (Rename to .ps1)

»crosslinked«

Tagged with:
 

11 Responses to Track Datastore Free Space

  1. Brad says:

    Good little tool, but it would also be great to export a CSV doc for reporting purposes.

    just my $.02

    Thanks

  2. Compare ESX configurations with Powershell « H9Newser’s Blog says:

    […] Track Datastore Free Space […]

  3. Top 10 PowerShell Script amit a Vmware adminisztrátorok használnak « Virtualize.hu says:

    […] Adattárad szabad helyeinek változásait követheed figyelemmel. Hugo Peeters http://www.peetersonline.nl/index.php/vmware/track-datastore-free-space/ […]

  4. A. Mikkelsen says:

    Hi
    Cool script.
    I have done some simular. This is a webpage that shows graphs.
    http://www.amikkelsen.com/?p=118

    Please give your comments

  5. Olaf says:

    Hello Guys,

    very nice script!

    How can i add commands for sending me an alert if datastore capacity is for an example below 10% of complete storage?

    Thanks in advance.

    cheers

  6. VMware, lo Mejor para Virtualizar? | El Blog de AdSense, SEO & Internet says:

    […] Link | Add Custom Fields to VI Client with Powershell Link | VMware Health Check Script Link | Track Datastore Free Space Link | List disk RDMS Link | Find Snapshots and Send email to User Link | Setting Video Hardware […]

  7. arenas says:

    hello Hugo :)

    many tnx for your help (how do manipule variable)

    pls, i have an under gestion.
    can i creat an exe file from the PS script file ?
    (transportable)

    tnx
    arenas

  8. Zizou says:

    # Export the output to an xml file; the new Current file
    $myColCurrent | Export-csv -Path “$Folder\$currentFile”

    # Disconnect from Virtual Center
    Disconnect-VIServer -Confirm:$False

    # Finally, let’s compare the Current information to that in the Previous file

    # Check if a Previous file exists
    If (Test-Path “$Folder\$previousFile”)
    {
    # Import the Previous file
    $myColPrevious = Import-Csv “$Folder\$previousFile”

Leave a Reply