Data ONTAP® PowerShell Toolkit

Switch to Data ONTAP Cluster-mode documentation.

Overview

Intelligent storage capabilities are an integral part of application infrastructures, and one of the biggest challenges of managing intelligent storage is integrating it into existing processes, environments and management frameworks. This is the principal reason NetApp created the Data ONTAP PowerShell Toolkit.

The Data ONTAP PowerShell Toolkit is a collection of PowerShell cmdlets intended to simplify storage management in Windows environments. These cmdlets allow administrators to invoke Data ONTAP commands from a PowerShell script, which can then be easily invoked from existing management frameworks. The cmdlets may also be used individually as an alternative to using the Data ONTAP command-line interface.

Requirements

Getting Started

To load the Toolkit, begin a script with 'Import-Module DataONTAP'.

To learn about which cmdlets are available, try Show-NaHelp or Get-NaHelp after importing the module. Also, online help with examples is available for every cmdlet using PowerShell's built-in Get-Help cmdlet.

Usage Notes

Types

Some of the cmdlets write simple types to the PowerShell pipeline, such as System.String or System.Boolean. These should remain stable over subsequent Toolkit releases.

Most cmdlets yield objects of an internal type, such as NetApp.Ontapi.Filer.Volume.VolumeInfo. Some even yield different class types depending on the version of Data ONTAP returning the values. And these return types will evolve over time as new APIs are supported. However, the field names in these classes should remain stable over time. So if scripts are written to use the values in all returned objects without referring to the class names, forward compatibility issues with newer Toolkit releases should be minimized. For example:

Correct:

   PS C:\> $vol = Get-NaVol vol2

   PS C:\> $vol.Name

   vol2

Incorrect:

   PS C:\> [NetApp.Ontapi.Filer.Volume.VolumeInfo] $vol = Get-NaVol vol2

   PS C:\> $vol.Name

   vol2

Cluster-Mode

Cluster-Mode is the future of Data ONTAP. While there are many similarities between Data ONTAP (Cluster-Mode) and Data ONTAP (7-Mode), there are also several key differences that impact PowerShell users.

Most importantly, Cluster-Mode has no equivalent to "vfiler0", which corresponds to a physical controller running 7-Mode. Cluster-Mode has a single "admin" Vserver for managing physical resources in the cluster (disks, nodes, aggregates, network ports, etc.) and one or more data Vservers for serving data and managing most virtual components related to serving data (volumes, qtrees, LUN, protocols, snapshots, etc.).

It is critical to note that some APIs (and therefore some cmdlets) are only handled by the cluster admin Vserver, while others are only handled by the data Vservers. The Toolkit user is responsible for directing cmdlets to the proper Vserver. The Toolkit provides several methods of directing cmdlets, and it does so automatically in some cases.

For example, to connect to a cluster admin Vserver:

   PS C:\> Connect-NcController cluster1

While connected to a cluster admin Vserver, you can direct cmdlets to a data Vserver in several ways:

  1. Set the data Vserver while connecting to the cluster Vserver:

       PS C:\> Connect-NcController cluster1 -Vserver vserver1

  2. Set the data Vserver anytime after connecting to the cluster Vserver:

       PS C:\> Connect-NcController cluster1

       PS C:\> $global:CurrentNcController.Vserver = "vserver1"

  3. Specify the data Vserver destination as a cmdlet argument:

       PS C:\> Set-NcLunSize /vol/unitTestLuns/georgeTestFcp01 +10% -VserverContext vserver1

  4. Use getters from either cluster or data Vserver, and pipe their output into other cmdlets. The Toolkit includes enough context on objects written to the pipeline to determine where to direct subsequent cmdlets that operate on those objects:

       PS C:\> Connect-NcController cluster1

       PS C:\> Get-NcLun | Set-NcLunSize -NewSize +10%

You can also connect directly to a data Vserver management interface. While connected directly to a data Vserver, cmdlets may not be issued to the cluster admin Vserver or any other data Vserver.

   PS C:\> Connect-NcController vserver1

Many getter cmdlets work in either the cluster admin or data Vserver contexts. To determine where cmdlets may be directed, use Get-NcHelp and check the Family field:

   PS C:\> Get-NcHelp -Category volume

   Name Category Family Api

   ---- -------- ------ ---

   Dismount-NcVol volume {vserver} {volume-unmount}

   Get-NcVol volume {cluster, vserver} {volume-get-iter}

   Get-NcVolAutosize volume {vserver} {volume-autosize-get}

   Get-NcVolClone volume {cluster, vserver} {volume-clone-get-iter}

   Get-NcVolCloneSplit volume {vserver} {volume-clone-split-status}

Known Issues


 Data ONTAP® PowerShell Toolkit