Microsoft Virtualization Discussions

Differences between aggr show_space and Get-NaAggrSpace

neilwilson
3,993 Views

Hi are there any plans to add more details to the Get-NaAggrSpace cmdlet so that it is more in line with the information given by using aggr show_space command from the DataOnTap Console?

Get-NaAggrSpace doesn't show space used by WAFL or Snapshot reserve in the aggregate.

I can get the aggregate snapshot reserve in powershell by using the Get-NaSnapshotReserve cmdlet

I cant see a cmdlet that gives me the WAFL reserve amount - from calculations on aggregate on 1 of our filers it looks like it is 10% of the aggregate.

Before I code a 10% size adjustment to into my script - Is the WAFL reserve always 10% of the aggregate size regardless of the version of Data OnTap?

Also is there any way to change the output format of Get-NaAggrSpace from bytes to kb,gb or tb?

Sorry if my questions are noobish - I only started using powershell this week and am new to scripting in general.

Thanks

Neil.

2 REPLIES 2

cknight
3,993 Views
Also is there any way to change the output format of Get-NaAggrSpace from bytes to kb,gb or tb?

This one is easy.  PowerShell has built-in constants for storage sizes, so try something like this:

PS C:\> (Get-NaSnapshotReserve -Aggregate aggr0).Size / 1gb

1.19512939453125

You can also look at the Toolkit's data formatters (DataONTAP.Format.ps1xml) to see how we use a Toolkit cmdlet to format sizes with units:

PS C:\> $s = (Get-NaSnapshotReserve -Aggregate aggr0).Size

PS C:\> ConvertTo-FormattedNumber $s DataSize

1 GB

Get-NaAggrSpace doesn't show space used by WAFL or Snapshot reserve in the aggregate.

I can get the aggregate snapshot reserve in powershell by using the Get-NaSnapshotReserve cmdlet

I cant see a cmdlet that gives me the WAFL reserve amount - from calculations on aggregate on 1 of our filers it looks like it is 10% of the aggregate.

Before I code a 10% size adjustment to into my script - Is the WAFL reserve always 10% of the aggregate size regardless of the version of Data OnTap?

WAFL reserve space seems to be around 10% but you can calculate it.  Aggregate space calcs are a little more involved and require data points from multiple APIs to get everything you seek.  From the API docs:

(Get-NaDisk).PhysicalSpace --> Use to get total aggregate size (multiply by number of data disks in aggregate (don't count parity disks))

(Get-NaAggrSpace).SizeNominal --> Total space contained in the aggregate minus the WAFL reserve

Given these definitions, you should be able to determine the WAFL reserve.  And given a few other things you should be able to calculate everything:

(Get-NaSnapshotReserve -Aggregate).Size --> Aggregate snap reserve

(Get-NaAggr).SizeTotal --> Aggregate total usable size in bytes, not including WAFL reserve and aggregate snapshot reserve

I would prefer everything be in one structure, but I would hesitate to do that in the Toolkit as it would entail multiple API calls for each aggregate and would slow the process even when those values aren't of interest.

beam
3,993 Views

When you do an aggr show_space you get "Total space", "WAFL reserve", "Snap reserve", and "Usable space" (among other things).  The (Get-NaAggrSpace).SizeNominal value is equal to the "Usable space" value plus the "Snap reserve" value.  To verify, you can try something like this:

PS> (Get-NaSnapshotReserve -Aggregate aggr0).Size + (Get-NaAggr aggr0).SizeTotal

3199338442752

PS> (Get-NaAggrSpace aggr0).SizeNominal

3199338442752

PS> Invoke-NaSsh aggr show_space

Aggregate 'aggr0'

    Total space    WAFL reserve    Snap reserve    Usable space       BSR NVLOG           A-SIS          Smtape

   3471504384KB     347150436KB     156217696KB    2968136252KB             0KB       1209288KB             0KB

PS C:\Users\Administrator> 156217696KB+2968136252KB

3199338442752

Hope that helps!

-Steven

Public