ONTAP Discussions

SnapShot Space Usage

1VINAYKUMAR
3,382 Views

Hi Guys,

 

I need to find out the space usage of snapshots on all volumes in 7 mode and cluster mode. Please suggeset if there is any way if we can monitor the space usage of snapshots on all volumes and generate reports weekly basis.

 

regards

VK

2 REPLIES 2

JGPSHNTAP
3,361 Views

This can be easily done in powershell

asulliva
3,350 Views

To view total snapshot space used for each volume, you can use a short PowerShell script:

 

Get-NcVol | ?{ 
    $_.VolumeStateAttributes.IsNodeRoot -eq $false 
} | %{ 
    $_ | Get-NcSnapshot | Sort-Object -Property Created | Select-Object -First 1 
}

To sum the size of all snapshots, just add the CumulativeTotal property together:

 

$total = 0

Get-NcVol | ?{ 
    $_.VolumeStateAttributes.IsNodeRoot -eq $false 
} | %{ 
    $oldest_snap = $_ | Get-NcSnapshot | Sort-Object -Property Created | Select-Object -First 1 
    $total += $oldest_snap.CumulativeTotal

    $oldest_snap
}

Write-Output "Total size of all snapshots = $([Math]::Round($total / 1GB, 2)) GB"

Andrew

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