Microsoft Virtualization Discussions
Microsoft Virtualization Discussions
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.
There is no need of a powershell script, single cmdlet would give you that info.
Get-NaAggr
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....!
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.
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.
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
can we add %overcommited in this ?
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