ONTAP Discussions

Data Ontap PSTK comlet for CDOT ( v8.3+) Aggregate Status Disk space info

JIATI0111
5,231 Views

Anyone knows if there is any cmdlet that can output the content that is similar to the ONTAP CDOT v8.3+ command  aggr show-status so that the individual disk and corresponding space info will be listed for aggregates with either storage pool or ADP enabled?

 

clustername::> aggr show-status

Owner Node: nodename
Aggregate: n01_aggr0_SAS (online, raid_dp) (block checksums)
Plex: /n01_aggr0_SAS/plex0 (online, normal, active, pool0)
RAID Group /n01_aggr0_SAS/plex0/rg0 (normal, block checksums)
Usable Physical
Position Disk Pool Type RPM Size Size Status
-------- --------------------------- ---- ----- ------ -------- -------- ----------
shared 1.1.5 0 SAS 10000 61.58GB 838.4GB (normal)
shared 1.1.7 0 SAS 10000 61.58GB 838.4GB (normal)
shared 1.1.9 0 SAS 10000 61.58GB 838.4GB (normal)
shared 1.1.11 0 SAS 10000 61.58GB 838.4GB (normal)
shared 1.1.13 0 SAS 10000 61.58GB 838.4GB (normal)
shared 1.1.15 0 SAS 10000 61.58GB 838.4GB (normal)
shared 1.1.17 0 SAS 10000 61.58GB 838.4GB (normal)
shared 1.1.19 0 SAS 10000 61.58GB 838.4GB (normal)
shared 1.1.21 0 SAS 10000 61.58GB 838.4GB (normal)

 

Aggregate: n01_aggr1_SAS (online, raid_dp, hybrid) (block checksums)

...

 

Thanks,

Timothy

1 ACCEPTED SOLUTION

JGPSHNTAP
5,147 Views

Timothy,

 

If you don't need the results returned as objects and just need a report you can use 

 

invoke-ncssh "aggr show-status"

 

If I have time today I might be able to come up with something.

 

Also, this is posted in the data ontap discussions, and there is a separate powershell forum under - http://community.netapp.com/t5/OnCommand-Storage-Management-Software-Discussions/bd-p/oncommand-storage-management-software-discussions

 

Back in the day we used to have our own subfolder, but that got combined

View solution in original post

8 REPLIES 8

JGPSHNTAP
5,214 Views

If you need the exact output like you want you can always use invoke-ncssh 

 

But I would start with by playing with get-ncaggr

 

man *aggr*

 

 

mbeattie
5,194 Views

Hi Timothy,

 

I would advise using a query to filter the disks to the assigned aggregate using the "Get-NcDisk" CmdLet. You can then display the properties of the disk object rather than screen scraping command line output. Here is an "example" for you. Modify to meet your requirements.

 

Source Code:

 

#'------------------------------------------------------------------------------
Param(
   [Parameter(Mandatory=$True, HelpMessage="The hostname or IP Address of the cluster")]
   [String]$ClusterName,
   [Parameter(Mandatory=$True, HelpMessage="The name of the aggregate")]
   [String]$AggregateName
)
#'------------------------------------------------------------------------------
#'Enumerate the index number of the client in the export policy rules.
#'------------------------------------------------------------------------------
$credentials = Get-Credential -Credential admin
Import-Module DataONTAP
Try{
   Connect-NcController -Name $ClusterName -HTTPS -Credential $credentials -ErrorAction Stop
}Catch{
   Write-Warning -Message $("Failed connecting to cluster ""$ClusterName"". Error " + $_.Exception.Message)
   Break;
}
#'------------------------------------------------------------------------------
#'Enumerate the disks within the aggregate.
#'------------------------------------------------------------------------------
$query = Get-NcDisk -Template
$query.Aggregate = $AggregateName
Try{
   $disks = Get-NcDisk -Query $query -ErrorAction Stop
}Catch{
   Write-Warning -Message $("Failed enumerating disks for aggregate ""$AggregateName"". Error " + $_.Exception.Message)
   Break;
}
Write-Host "DiskName,DiskType,RPM,Capacity,AggregateName"
ForEach($disk In $disks){
   Write-Host $($disk.Name + "," + $disk.DiskInventoryInfo.DiskType + "," + $disk.Rpm + "," + $disk.Capacity + "," + $disk.Aggregate)
}
#'------------------------------------------------------------------------------

 

Example Output:

 

PS C:\Scripts\PowerShell\Projects\GetDisks> .\GetDisks.ps1 -ClusterName cluster1 -AggregateName node1_aggr1

Name                 Address           Vserver              Version
----                 -------           -------              -------
cluster1             192.168.100.100                          NetApp Release 8.3.1: Mon Aug 31 08:49:20 UTC 2015
DiskName,DiskType,RPM,Capacity,AggregateName
NET-1.1,FCAL,15000,4289192960,node1_aggr1
NET-1.16,FCAL,15000,4289192960,node1_aggr1
NET-1.17,FCAL,15000,4289192960,node1_aggr1
NET-1.18,FCAL,15000,4289192960,node1_aggr1
NET-1.19,FCAL,15000,4289192960,node1_aggr1
NET-1.20,FCAL,15000,4289192960,node1_aggr1
NET-1.21,FCAL,15000,4289192960,node1_aggr1
NET-1.22,FCAL,15000,4289192960,node1_aggr1
NET-1.23,FCAL,15000,4289192960,node1_aggr1
NET-1.24,FCAL,15000,4289192960,node1_aggr1
NET-1.25,FCAL,15000,4289192960,node1_aggr1
NET-1.26,FCAL,15000,4289192960,node1_aggr1
NET-1.27,FCAL,15000,4289192960,node1_aggr1
NET-1.28,FCAL,15000,4289192960,node1_aggr1
NET-1.29,FCAL,15000,4289192960,node1_aggr1
NET-1.30,FCAL,15000,4289192960,node1_aggr1
NET-1.31,FCAL,15000,4289192960,node1_aggr1
NET-1.32,FCAL,15000,4289192960,node1_aggr1
NET-1.33,FCAL,15000,4289192960,node1_aggr1
NET-1.34,FCAL,15000,4289192960,node1_aggr1
NET-1.35,FCAL,15000,4289192960,node1_aggr1
NET-1.36,FCAL,15000,4289192960,node1_aggr1
NET-1.37,FCAL,15000,4289192960,node1_aggr1
NET-1.38,FCAL,15000,4289192960,node1_aggr1
NET-1.39,FCAL,15000,4289192960,node1_aggr1
NET-1.40,FCAL,15000,4289192960,node1_aggr1
NET-1.41,FCAL,15000,4289192960,node1_aggr1
NET-1.42,FCAL,15000,4289192960,node1_aggr1
NET-1.43,FCAL,15000,4289192960,node1_aggr1
NET-1.44,FCAL,15000,4289192960,node1_aggr1
NET-1.45,FCAL,15000,4289192960,node1_aggr1
NET-1.46,FCAL,15000,4289192960,node1_aggr1
NET-1.47,FCAL,15000,4289192960,node1_aggr1
NET-1.50,FCAL,15000,4289192960,node1_aggr1
NET-1.51,FCAL,15000,4289192960,node1_aggr1
NET-1.52,FCAL,15000,4289192960,node1_aggr1
NET-1.53,FCAL,15000,4289192960,node1_aggr1
NET-1.54,FCAL,15000,4289192960,node1_aggr1
NET-1.55,FCAL,15000,4289192960,node1_aggr1
NET-1.56,FCAL,15000,4289192960,node1_aggr1

Hope that helps

 

/Matt

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

JIATI0111
5,170 Views

Matt,

 

Thanks for for your reply. Yes, I did collect disk info using Get-NcDisk and get the mapping info to corresponding aggregates. But the point is that we have CDOT 8.3.2 systems with ADP enabled , plus having a SSD storage pool shared by two aggregates. When I get the output from get-ncdisk, those Shared disk has no value for aggregates since it belongs to multiple aggregates. I can get the aggregate list from AggregateList of DiskSharedInfo from get-ncaggr , Raid info, but it does not have the capacity info how much belongs to which aggregate. 

 

In short, I'd like to get the space usage info for each aggregate for a shared disk, either a SSD ( storage pool) or SAS disk ( in ADP enabled shelf for root_Data aggregates). In the example of the cli output, we can see each disk is allocated only a portion to the aggregate listed, and the quantity is what I want to know from PSTK for disks in such ADP/storage pool.

 

i check all related cmdlet such as disk, aggr, storage pool, it looks like none of them have the info. I would think there is a cmdlet mapping to the CLI aggr show-status, but it looks like not available yet unless I don't know. I am using a lower version of PSTK in production, but I downloaded v4.3 and did not find as well.

 

Thanks!

Timothy

JGPSHNTAP
5,148 Views

Timothy,

 

If you don't need the results returned as objects and just need a report you can use 

 

invoke-ncssh "aggr show-status"

 

If I have time today I might be able to come up with something.

 

Also, this is posted in the data ontap discussions, and there is a separate powershell forum under - http://community.netapp.com/t5/OnCommand-Storage-Management-Software-Discussions/bd-p/oncommand-storage-management-software-discussions

 

Back in the day we used to have our own subfolder, but that got combined

JIATI0111
5,123 Views

JGPSHNTAP,

 

Thanks a lot for your replies. Yes,  I will take your advice at this time using the old fashion way at this time to get what I need quicker and look forward seeing new cmdlets coming out to wrap them up in objects. 🙂

 

Thanks,

Timothy

asulliva
5,097 Views

All of the information you're looking for is returned with the Get-NcAggrStatus cmdlet, it's just not formatted the same way.  For example, if you want to see how much FlashPool space is being used from the disk paritions, you would need to do something like...

 

((Get-NcAggrStatus -Aggregate $aggrName).AggrPlexList.AggrRaidgroupList | ?{ $_.StoragePool -ne $null } ).AggrDiskList

Then look at the properties for PhysicalSize (the size of the disk) vs the UsableSize (the size of the partition).  

 

If you're just looking to get a report of the information, then using Invoke-NcSsh with the CLI will probably be best though.

 

Also, @JGPSHNTAP, there is a forum here on the Communities for the PowerShell toolkit.  It can be found at Forums -> Products and Solutions -> Virtualization and Cloud -> Microsoft Cloud and Virtualization Solutions.  Additionally, you can reach out in real time using the Slack channel for PowerShell, courtsey of The Pub.

Hope that helps.

 

Andrew

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

JGPSHNTAP
5,066 Views

Andrew,

 

I believe I said there was a forum and I pointed them to the link.  But back in the day, when beam was around, and i've been using PS toolkit since 1.0, we used to have our own forum and it wasn't coupled together with others.  It was called the powershell forum.  They closed this down and I asked them to reopen it, and they decided to leave it as it is today.

 

Also, thanks for the cmdlet above, I haven't had much time to play with the cDOT stuff as we are just transitioning.  95% of my stuff is written for 7-mode

JIATI0111
5,035 Views

Andrew,

 

Thanks a lot for taking time looking into this, and thanks again for @JGPSHNTAP. I had not gone deeper enough to get the info I need and now I got. 

 

Appreciated the help from you guys and sorry for posting with the wrong label, won't do that next time.

 

Timothy

Public