getVMThinProvisionedSavings.pl

Version 3

    While looking around the forums, I noticed this thread: Script to determine disk space saved by thin provisioning which had an interesting request from the OP. This script will extract the total amount of provisioned space across all datastore(s) and consumed space for a VM and display in either the raw format in total bytes OR it's properly formatted disk consumption (B,KB,MB,GB,TB). This data is primarily useful when using thin provisioning

    Requirements:
    ESX(i) 4.0 or vCenter 4.0
    vSphere SDK for Perl or vMA 4.0

    Sample Execution:

    Raw output (in bytes by default):

    [vi-admin@scofield ~]./getVMThinProvisionedSavings.pl --server reflex.primp-industries.com --username primp

    VM Name                                  Provisioned          Used                % Saved
    -------------------------------------------------------------------------------------------
    Auroa                                    4833604510           4288344990          11.3 %
    -------------------------------------------------------------------------------------------
    Bitsy                                    2686155138           1851488642          31.1 %
    -------------------------------------------------------------------------------------------
    Certiorari                               9395724427           8590418059          8.6 %
    -------------------------------------------------------------------------------------------
    Clifford                                 10766700317          10766700317         0 %
    -------------------------------------------------------------------------------------------
    ESX-Kickstart                            13423364683          7031259723          47.6 %
    -------------------------------------------------------------------------------------------
    ESX40-1                                  46171339531          4402363147          90.5 %
    -------------------------------------------------------------------------------------------
    ESX40-2                                  30065354586          4306036570          85.7 %
    -------------------------------------------------------------------------------------------
    ESXi40-1                                 30065197293          4318462189          85.6 %

    .........

     

    Formated output:

    [vi-admin@scofield ~]$ ./getVMThinProvisionedSavings.pl --server reflex.primp-industries.com --username primp --format 1

    VM Name                                  Provisioned          Used                % Saved
    -------------------------------------------------------------------------------------------
    Auroa                                    4.50 GB              3.99 GB             11.3 %
    -------------------------------------------------------------------------------------------
    Bitsy                                    2.50 GB              1.72 GB             31.1 %
    -------------------------------------------------------------------------------------------
    Certiorari                               8.75 GB              8.00 GB             8.6 %
    -------------------------------------------------------------------------------------------
    Clifford                                 10.03 GB             10.03 GB            0 %
    -------------------------------------------------------------------------------------------
    ESX-Kickstart                            12.50 GB             6.55 GB             47.6 %
    -------------------------------------------------------------------------------------------
    ESX40-1                                  43.00 GB             4.10 GB             90.5 %
    -------------------------------------------------------------------------------------------
    ESX40-2                                  28.00 GB             4.01 GB             85.7 %
    -------------------------------------------------------------------------------------------
    ESXi40-1                                 28.00 GB             4.02 GB             85.6 %
    .....