Microsoft Virtualization Discussions

Aggregate report...

kallu_chakri
15,803 Views

Hi All, I will be greatful, if anyone could get my a powershell script for a report in the below format. (Aggregate Name) (Total Space (TB)) (Used Capacity (TB))(Allocated Capacity (TB)) (Space Available (TB)) Thanks, Kalyan Guturi.

7 REPLIES 7

vinith
15,803 Views

There is no need of a powershell script, single cmdlet would give you that info.

Get-NaAggr

kallu_chakri
15,803 Views

Vinith,

Thanks for the quick response. However, "Get-NaAggr" provides <total size> <used> and <Available> but doesn't provide allocated. Command "aggr show_space" provides all the mentioned information. How can we point this Get-NaAggr command to a specific filer.

Help here please....!

vinith
15,803 Views

Connect to the Controller first as below.

Connect-NaController <Controller IP Address> -Credential (Get-Credential)

Then try out Get-NaAggr

I guess you are a newbie to powershell toolkit, check out some of these documents.

https://communities.netapp.com/docs/DOC-6162

https://communities.netapp.com/docs/DOC-10684

JimKoenig
14,993 Views

You are correct by the way get-NaAgg doesn't contain the allocated amount... Did you ever find a Powershell command that would give the allocated amount?  I am having the same issue where I am not able to find the allocated amount even on the cDOT systems using get-NcAgg.  Thanks.

asulliva
14,985 Views

Something like this should produce the information you're looking for:

 

 Get-NcAggr | ForEach-Object {
    $x = "" | Select Name,Total_TB,Used_TB,Allocated_TB,Available_TB
    $x.Name = $_.Name
    $x.Total_TB = [Math]::Round($_.TotalSize / 1TB, 2)
    $x.Available_TB = [Math]::Round($_.Available / 1TB, 2)
    $x.Used_TB = [Math]::Round($_.AggrSpaceAttributes.SizeUsed / 1TB, 2)
    $x.Allocated_TB = 0

    Get-NcVol | ?{ $_.Aggregate -eq $x.Name } | %{ $x.Allocated_TB += $_.TotalSize }
    $x.Allocated_TB = [Math]::Round($x.Allocated_TB / 1TB, 2)

    $x
}

There is no single command or attribute which shows the allocated capacity against an aggregate.  Instead you simply find all the volumes on that aggregate and sum their provisioned space.

 

Hope that helps.

 

Andrew

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

Kirand1979
13,821 Views

can we add %overcommited in this ?

asulliva
13,725 Views

Hello @Kirand1979,

 

You can add in the commitment percent using this line:

 

$x.Committed_Percent = [Math]::Round(($x.Allocated_TB / $x.Total_TB) * 100)

 

Don't forget to add the "Committed_Percent" field to the object declaration too.

 

$x = "" | Select Name,Total_TB,Used_TB,Allocated_TB,Available_TB,Committed_Percent

 

Hope that helps.

 

Andrew

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