ONTAP Discussions

How to list All volumes snapshots usage in a Aggregate

heightsnj
6,269 Views

I need to list how much space has been taken by volumes Snapshots in an Aggregate. Is there any way to do that either via CLI, or GUIs?

 

Thanks,

6 REPLIES 6

asulliva
6,200 Views

Not sure about GUI or CLI, but you can use the PowerShell Toolkit to get this done pretty quick...

 

$result = @()

foreach ($aggregate in Get-NcAggr) {
    $data = "" | Select Aggregate,VolSnapSpaceGB
    $data.Aggregate = $aggregate.Name
    $data.VolSnapSpaceGB = 0

    foreach ($volume in (Get-NcVol -Aggregate $aggregate)) {
# get the cumulative total for the oldest snapshot $snapSpace = (Get-NcSnapshot -Volume $volume | Sort-Object -Property Created | Select-Object -First 1).CumulativeTotal $data.VolSnapSpaceGB += [Math]::Round($snapSpace / 1gb, 2) } $result += $data } $result

Andrew

If this post resolved your issue, please help others by selecting ACCEPT AS SOLUTION or adding a KUDO.

heightsnj
6,165 Views

Thanks!

 

Unfortunately, I don't have POWERSHELL tool kit in-paced yet. 

Is there a way to do this via CLI or Unified Manager?

heightsnj
6,131 Views
Hi Asullivs,

I have a lot of snapshots for each volume, and wanted to sum them up together. Is you script include or snapshots for each volume or just add one of them up?

Can you please also provide the list of total amount of snapshots for each volume in aggregates basis?

Thanks a lot

rh
6,120 Views

Hi

 

How about the "aggr show_space" CLI command?

 

Does that give the info you need?

 

Good Luck!

 

Richard.

heightsnj
6,111 Views

aggr show-space only shows snapshots on aggr level which is not what I want.

 

I want to have a summary report on the amount of the space taken by snapshots for each volume in aggr basis.

asulliva
6,109 Views

The total snapshot space used by a volume is reported in the volume object, we just need to display it in a friendly format...

 

Get-NcVol | Select-Object Aggregate,Name,
    @{
        'Name' = "SizeUsedBySnapshots"; 
        'Expression' = { 
            $_.VolumeSpaceAttributes.SizeUsedBySnapshots | ConvertTo-FormattedNumber -Type DataSize 
        }
    } | Sort-Object -Property Aggregate,Name

Hope that helps.

 

Andrew

If this post resolved your issue, please help others by selecting ACCEPT AS SOLUTION or adding a KUDO.
Public