The NetApp PowerShell Toolkit (NPTK) is a great way to get started administering your NetApp resources, both 7-mode and clustered Data ONTAP (cDOT), in a more efficient and scalable manner.
Getting the Toolkit
The download (version 3.2 at the time of this writing) is available from the NetApp Communities in the Microsoft Cloud and Virtualization board.
From the download page are two links to some great resources: the Getting Started presentation, and Making the Most of the NetApp PowerShell Toolkit. Both of these are excellent reads if you want some starting hints.
Getting Help
A Few Basics To Get Started
Now that you have the toolkit and have installed it, it’s time to use it. Let’s look at a couple of basic tasks.
Note: I will be using the cDOT cmdlets, however nearly all of the commands have an equivalent available for 7-mode.
Connecting to a controller
Connecting to your cluster is extremely easy. You can specify the cluster management IP address, or any of the node management IPs as well. If you do not provide credentials as a part of the command invocation, it will prompt for them.
|
# connect to the cluster management LIF Connect-NcController $controllerNameOrIp -Credential (Get-Credential) |
Getting Information
Now that we’re connected to the cluster, let’s take a look at some of the information that can be gathered:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
|
# show cluster information Get-NcCluster # show node information Get-NcNode # show the number of disks assigned to each controller Get-NcDisk | %{ $_.DiskOwnershipInfo.HomeNodeName } | Group-Object # show a summary of disk status Get-NcDisk | %{ $_.DiskRaidInfo.ContainerType } | Group-Object # show failed disks Get-NcDisk | ?{ $_.DiskRaidInfo.ContainerType -eq "broken" } # show root aggregates Get-NcAggr | ?{ $_.AggrRaidAttributes.HasLocalRoot -eq $true } # show volumes which are not SVM root volumes Get-NcVol | ?{ $_.VolumeStateAttributes.IsVserverRoot -eq $false } |
Onward to Automation
There are a number of “PowerShell Toolkit 101” posts that introduce some of the possibilities. Be sure to read through these other posts:
This doesn’t even begin to scratch the surface of the NetApp PowerShell Toolkit. Anything that can be done from the command line can be done using the toolkit. If you’re interested in seeing specific examples, need help, or just have questions, please let me know in the comments!