Effective December 3, NetApp adopts Microsoft’s Business-to-Customer (B2C) identity management to simplify and provide secure access to NetApp resources.
For accounts that did not pre-register (prior to Dec 3), access to your NetApp data may take up to 1 hour as your legacy NSS ID is synchronized to the new B2C identity.
To learn more, read the FAQ and watch the video.
Need assistance? Complete this form and select “Registration Issue” as the Feedback Category.

Microsoft Virtualization Discussions

Get total filer capacity and available capacity

CRAIGEGROSS

I am new to powershell and am trying to create a script that will give the total capacity of the filer and available capacity.

I have seen the getnavol and getaggr and use them to get that data but am stumped on how to get total capacity data.

Any assistance is appreciated 

1 ACCEPTED SOLUTION

vinith

Hi Craig, We can attain the same using powershell custom objects.

Have a look at the code below and run it in your environment to get the required information. We can use Get-NaDisk and extract the total,available and used storage on the controller

$info = New-Object -TypeName PSObject -Property  @{

 

'FilerName' = (Get-NaSystemInfo).systemname;

'Total Physical Disk Space Capacity (TB)'=([math]::round((((Get-NaDisk | % { $_.PhysicalSpace} | Measure-Object -Sum).sum)/1TB),2));

'Used Disk Space Capacity (TB)'=([math]::round((((Get-NaDisk | % { $_.UsedSpace} | Measure-Object -Sum).sum)/1TB),2));

'Available Disk Capacity (TB)'=(([math]::round((((Get-NaDisk | % { $_.PhysicalSpace} | Measure-Object -Sum).sum)/1TB),2)) - ([math]::round((((Get-NaDisk | % { $_.UsedSpace} | Measure-Object -Sum).sum)/1TB),2)));

}

$info

We use custom hash tables to append all values to one place rather than using Add-Content to create reusable objects, please have a look at the link http://blogs.msdn.com/b/powershell/archive/2009/12/05/new-object-psobject-property-hashtable.aspx

Please do let me know if this is what you need.

View solution in original post

1 REPLY 1

vinith

Hi Craig, We can attain the same using powershell custom objects.

Have a look at the code below and run it in your environment to get the required information. We can use Get-NaDisk and extract the total,available and used storage on the controller

$info = New-Object -TypeName PSObject -Property  @{

 

'FilerName' = (Get-NaSystemInfo).systemname;

'Total Physical Disk Space Capacity (TB)'=([math]::round((((Get-NaDisk | % { $_.PhysicalSpace} | Measure-Object -Sum).sum)/1TB),2));

'Used Disk Space Capacity (TB)'=([math]::round((((Get-NaDisk | % { $_.UsedSpace} | Measure-Object -Sum).sum)/1TB),2));

'Available Disk Capacity (TB)'=(([math]::round((((Get-NaDisk | % { $_.PhysicalSpace} | Measure-Object -Sum).sum)/1TB),2)) - ([math]::round((((Get-NaDisk | % { $_.UsedSpace} | Measure-Object -Sum).sum)/1TB),2)));

}

$info

We use custom hash tables to append all values to one place rather than using Add-Content to create reusable objects, please have a look at the link http://blogs.msdn.com/b/powershell/archive/2009/12/05/new-object-psobject-property-hashtable.aspx

Please do let me know if this is what you need.

View solution in original post

Announcements
NetApp on Discord Image

We're on Discord, are you?

Live Chat, Watch Parties, and More!

Explore Banner

Meet Explore, NetApp’s digital sales platform

Engage digitally throughout the sales process, from product discovery to configuration, and handle all your post-purchase needs.

NetApp Insights to Action
I2A Banner
Public