Using the NetApp PowerShell Toolkit (NPTK) can sometimes be a daunting task. Fortunately, it is pretty intuitive on how to configure most aspects of your storage system. Let’s start by looking at some of the cluster level configuration items that can be managed using the NTPK.

Getting Help

The NetApp Communities: The communities are a great place to get help quickly for any question you might have. I recommend that you use the Microsoft Cloud and Virtualization Discussions board, however the SDK and API board will infrequently have questions as well.You can also send me a message using the NetApp Communities. My username is asulliva, and I’m happy to respond to questions directly through the Communities messaging system.

From the NPTK itself: One of the less known features of the Toolkit is that it has help built in. Yes, you can use the standard Get-Help cmdlet, but there’s a hidden treasure: Show-NcHelp.This cmdlet will generate an HTML version of the cmdlet help and open your default browser to display it.

From here you can dig through the cmdlets and view all of the information you want to know about them quickly and easily.

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.

1

2

# 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!

I’ve had the pleasure of spending the last several days talking to the development team here at NetApp about the DataONTAP PowerShell Toolkit. As a result we’ve all learned alot, one of the more interesting features they brought to my attention was the credential management solution included with the toolkit. I found this very compelling, you see embedding credentials within a script is as old as scripting itself. There was a time not too long ago when it was considered taboo. However with PowerShell came access to the .net Security.Cryptography encryption/decryption methods. Scripters have unknowingly been accessing said methods indirectly whenever they would use the credential management funcions that Hal amd BSonPosh wrote long ago.

Which brings me to the DataONTAP toolkit. The Development team has steped it up a notch and included a full credential management solution with the latest version of the toolkit. The way it works is first you need to save logon information by using the Add-NaCredential cmdlet to save the credentials for a given NetApp controller onto the local machine. Then the next time you run the Connect-NaController cmdlet the credentials you previously saved will be used. So how do we use this new feature, and why do you care?

Within the PowerShell community there has been a lingering debate over modules and providers. Initially everyone seemed compelled to do both. Personally, I’ve never been very impressed by third party providers. Mainly because they always felt like a gimmick. They forced the file system analog, and the results where not very good. They were buggy, slow, and didn’ t support the standard provider hooks. This lead to many vendors never bothering, and focused instead on cmdlets. I myself had come to the conclusion that providers where something for the PowerShell team, and third party ISV should just leave them alone. Fortunately the provider in version 1.3 of the DataONTAP PowerShell toolkit has broken the mold and renewed my faith in providers!