Microsoft Virtualization Discussions

Powershell Code to return Storage Data info

OldGreyBeard
2,491 Views

Hi All

 

Firstly I've never used any of the NetApp Powershell commandlets.

Developing a script here to do some estate reporting, (while we have multiple tools they all output in different formats and either show too much or not enough info !!)

 

So what am I trying to do..

Return 

  • Aggregate Name. Overall Capacity / used space / free space / Over committed %
  • Volume Name. Used space / free space dedupe and compression stats.
  • LUN Name. Used space / free space

Any one have some example code I can work with as I'm really unsure where to start.

 

Cheers in advance

P

1 REPLY 1

JohnChampion
2,395 Views

For aggregate info use "Get-NcAggr"

Example:

Connect-NcController {ipaddress}

Get-NcAggr

$aggr = Get-NcAggr -Name {aggregate name in list}

$aggr | format-list

 

...if you need more detailed info then drill into any of the 'DataONTAP.C.Types' objects you see listed...

$aggr.AggrSpaceAttributes

 

...to reference specific properties use $aggr.{propertyname} to retrieve the value

$aggr.AggregateName

$aggr.AggregateTotalSize

$aggr.AggregateUsed

$aggr.AggregateAvailable

$aggr.AggrSpaceAttributes.PhysicalUsedPercent

 

For Volume info use Get-NcVol and for LUNs use Get-NcLun, and do the same drill downs as in the Get-NcAggr example above to find the needed values...and use tab completion when drilling down into the objects - makes it a LOT easier than all that typing 😉

 

Public