# Clear the screen cls # Script to Load NetApp modules import-module dataontap # Login into system. $CLUSTER_NAME = "Your Cluster Name here" Connect-NcController $CLUSTER_NAME if (!$global:CurrentNcController){ write-output "invalid credentials" Break } # Getting the list of all volumes that are not root and not Offline and not vol0 $vols = Get-NcVol | Where-Object {$_.state -eq "online" -and ` ($_.Name -notlike "*_root*" -and $_.Name -notlike "*vol0*") } $vols.Count if ( $vols -ne $null ) { $VolumesStats = foreach ($vol in $vols) { $savedPercent = [math]::Round((($vol.VolumeSisAttributes.DeduplicationSpaceSaved + $vol.VolumeSisAttributes.CompressionSpaceSaved)/$Vol.VolumeSpaceAttributes.SizeUsed)*100,2) if ($savedPercent -eq 0) { $ratio = 0 } else { $ratio = [string]([Math]::Round(1+($savedPercent/100),2))+":1" } # Printing the output [PSCustomObject]@{ "vserver" = $vol.Vserver # vserver "Node" = $vol.VolumeIdAttributes.Node # node "volume" = $Vol.Name # volume "aggr-list" = [string]$vol.VolumeIdAttributes.AggrList # aggr-list "size" = ConvertTo-FormattedNumber -Type DataSize -NumberFormatString "0.00" -Value $Vol.VolumeSpaceAttributes.Size # size "available" = ConvertTo-FormattedNumber -Type DataSize -NumberFormatString "0.00" -Value $Vol.VolumeSpaceAttributes.SizeAvailable # available "filesystem-size" = ConvertTo-FormattedNumber -Type DataSize -NumberFormatString "0.00" -Value $vol.VolumeSpaceAttributes.FilesystemSize # filesystem-size "total" = ConvertTo-FormattedNumber -Type DataSize -NumberFormatString "0.00" -Value $vol.VolumeSpaceAttributes.SizeTotal # total "used" = ConvertTo-FormattedNumber -Type DataSize -NumberFormatString "0.00" -Value $Vol.VolumeSpaceAttributes.SizeUsed # used "percent-used %" = $vol.VolumeSpaceAttributes.PercentageSizeUsed # percent-used "space-nearly-full-threshold-percent %" = $vol.VolumeSpaceAttributes.SpaceNearlyFullThresholdPercent # space-nearly-full-threshold-percent "space-full-threshold-percent %" = $vol.VolumeSpaceAttributes.SpaceFullThresholdPercent # space-full-threshold-percent "max-autosize" = ConvertTo-FormattedNumber -Type DataSize -NumberFormatString "0.00" -Value $vol.VolumeAutosizeAttributes.MaximumSize # max-autosize "min-autosize" = ConvertTo-FormattedNumber -Type DataSize -NumberFormatString "0.00" -Value $vol.VolumeAutosizeAttributes.MinimumSize # min-autosize "autosize-grow-threshold-percent %" = $vol.VolumeAutosizeAttributes.GrowThresholdPercent # autosize-grow-threshold-percent "autosize-shrink-threshold-percent %" = $vol.VolumeAutosizeAttributes.ShrinkThresholdPercent # autosize-shrink-threshold-percent "autosize-mode" = $vol.VolumeAutosizeAttributes.Mode # autosize-mode "percent-snapshot-space %" = $vol.VolumeSpaceAttributes.PercentageSnapshotReserve # percent-snapshot-space "snapshot-space-used" = $vol.VolumeSpaceAttributes.PercentageSnapshotReserveUsed # snapshot-space-used "snapshot-policy" = $vol.VolumeSnapshotAttributes.SnapshotPolicy # snapshot-policy "filesys-size-fixed" = $vol.VolumeSpaceAttributes.IsFilesysSizeFixed # filesys-size-fixed "dedupe-space-saved" = ConvertTo-FormattedNumber -Type DataSize -NumberFormatString "0.00" -Value $vol.VolumeSisAttributes.DeduplicationSpaceSaved # dedupe-space-saved "dedupe-space-saved %" = $vol.VolumeSisAttributes.PercentageDeduplicationSpaceSaved # percent-dedupe-space-saved "compression-space-saved" = ConvertTo-FormattedNumber -Type DataSize -NumberFormatString "0.00" -Value $vol.VolumeSisAttributes.CompressionSpaceSaved # compression-space-saved "Compression-space-saved %" = $vol.VolumeSisAttributes.PercentageCompressionSpaceSaved # percent-compression-space-saved "total-space-saved" = ConvertTo-FormattedNumber -Type DataSize -NumberFormatString "0.00" -Value $vol.VolumeSisAttributes.TotalSpaceSaved # total-space-saved "total-space-saved %" = $vol.VolumeSisAttributes.PercentageTotalSpaceSaved # total-dedupe-space-saved "ratio" = "$ratio" # ratio "size-used-by-snapshots" = ConvertTo-FormattedNumber -Type DataSize -NumberFormatString "0.00" -Value $Vol.VolumeSpaceAttributes.SizeUsedBySnapshots # size-used-by-snapshots "snapshot-count" = $Vol.VolumeSnapshotAttributes.SnapshotCount # snapshot-count "physical-used" = ConvertTo-FormattedNumber -Type DataSize -NumberFormatString "0.00" -Value $vol.VolumeSpaceAttributes.PhysicalUsed # physical-used "physical-used-percent %" = $vol.VolumeSpaceAttributes.PhysicalUsedPercent # physical-used-percent "over-provisioned" = ConvertTo-FormattedNumber -Type DataSize -NumberFormatString "0.00" -Value $Vol.VolumeSpaceAttributes.OverProvisioned # over-provisioned "snapshot-reserve-available" = ConvertTo-FormattedNumber -Type DataSize -NumberFormatString "0.00" -Value $Vol.VolumeSpaceAttributes.SnapshotReserveAvailable # snapshot-reserve-available } } } # Writing the output to a File $VolumesStats | export-csv "$($env:USERPROFILE)\desktop\$(Get-Date -Format "ddMMMyyyy")_volumeDetailedStats.csv" -Force -notypeInformation