Microsoft Virtualization Discussions

Volumes and Snapshots usage report

himarco0
12,859 Views

Hi all, anybody know how to get snapshot usage information for a specific volume?

I mean, I would like to have information such as percent usage of the snap reserve and the amount of total space used by the snapshots.

Same information as "df" command from the console:

Filesystem               total       used      avail capacity  Mounted on
/vol/myvol/      408GB      382GB       25GB      94%  /vol/cifsirca01_itascost01/
/vol/myvol/.snapshot       72GB       25GB       46GB      36%  /vol/cifsirca01_itascost01/.snapshot

I didn't found any command.

Get-NaVol give me a lot of useful informations about the volume (including space usage) but nothing regarding the snapshots.

Get-NaSnapshotReserve give me space reserved but not usage
I tried also Get-NaSnapshotVolumeSpace but it's not what I need

I would like to have a script that report in a formatted text file (then I will import into excel) all the volumes with all usage information.

I think It's interesting to have periodically usage statistics...

Thanks you very much for your help!

Regards,

Marco

1 ACCEPTED SOLUTION

paleon
12,859 Views

I think the code below will get you what you seek.  The output is in bytes.  The standard output of "df" is kibibytes (1024 bytes or KiB).  This may account for differences you encounter between the two methods.

$vols = Get-NaVol | Sort-Object -Property Name

foreach ($vol in $vols) {
    $snapshots = Get-NaSnapshot $vol.name
    if ($snapshots -eq $null) {
        write-host "Volume $($vol.name) snapshot space used is 0 bytes"
    }
    else {
        $usedSpace = $snapshots[$snapshots.count-1].CumulativeTotal
        write-host "Volume $($vol.name) snapshot space used is $usedSpace bytes"
    }
}

View solution in original post

9 REPLIES 9

paleon
12,860 Views

I think the code below will get you what you seek.  The output is in bytes.  The standard output of "df" is kibibytes (1024 bytes or KiB).  This may account for differences you encounter between the two methods.

$vols = Get-NaVol | Sort-Object -Property Name

foreach ($vol in $vols) {
    $snapshots = Get-NaSnapshot $vol.name
    if ($snapshots -eq $null) {
        write-host "Volume $($vol.name) snapshot space used is 0 bytes"
    }
    else {
        $usedSpace = $snapshots[$snapshots.count-1].CumulativeTotal
        write-host "Volume $($vol.name) snapshot space used is $usedSpace bytes"
    }
}

himarco0
12,859 Views

Thank You Paleon!

     it's exactly what I was looking for.

When the script will be ready I can post it here if anyone is interested about.

Thanks again!

Marco

shubhada
12,859 Views

Hi,

If you will use System Manager,you will be able to get this information in text and also graphically.Attaching a screenshot if this is the information you are looking at.

-Shubhada

himarco0
12,859 Views

Hi Shubhada,

     you are right I can have helpful graphical information using System Manager too.

But I'm trying to use Powershell scripts to have a full volume status and usage report on an Excel spreadsheet.

I don't know if system manager can generate an Excel report.

Anyway could I ask you how did you configure http System Manager. I'm using it as "Windows MMC console".

Thank You!

Marco

shubhada
12,859 Views

Hi Marco,

You should be using SM1.0 or SM1.1 . They are MMC based applications.

You should be able to use SystemManager2.0 with https.It will be

available with Data ONTAP8.1.Hope this helps

Thanks,

Shubhada

himarco0
12,859 Views

Yes Shubhada,

    I'm using SM 1.1

Ok, I understood, I should wait for the Ontap 8.1 🙂

Thank You!

Regards,

Marco

russbbass
12,859 Views

I think the PowerShell scripting of this report will make it easier to schedule, rather that opening the SM each time.

Please post it when you complete it.

Regards,

Russ

himarco0
12,859 Views

Hi Russ,

     l'm still working on the script... As soon as I will have a good one I will post it here!

Thanks & Regards,

Marco

netapplem
12,859 Views

It has been two years since this has been updated.  I was wondering if this was ever completed.

I actually need a graphical representation of the system, but I cannot use System Manager.  I am a client and only have access to my vFiler, so I do not see the entire system or have the ability to use System Manager.  Management is looking for a pie\bar chart, and I cannot find a way to quickly do this (because, once they ask for it, they will want it frequently and quickly).

Any information would be helpful.

-Joe

Public