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.
In this post we will cover:
- AutoSupport
- Licenses
- Cluster Management LIF(s)
- Inter-Cluster LIF(s)
- SNMP
- DNS
AutoSupport
Configuring AutoSupport is one of the most important things you can do for your system. AutoSupport enables the system to contact NetApp in the event of an error and allows NetApp to perform proactive and preemptive support for your systems.
- Note: If you receive an error like the below, this is a known bug with version 3.1 of the toolkit.
The bug is a result of a type conversion error. The workaround is to simply provide a value for the
MinimumPrivateDataLength
parameter:12345# May fail due to bug in NPTK v3.1 and below:Get-NcNode $nodeName | Set-NcAutoSupportConfig -To "you@work.com"# succeeds, with workaround. 2 is the default value.Get-NcNode $nodeName | Set-NcAutoSupportConfig -To "you@work.com" -MinimumPrivateDataLength 2
Some common tasks for AutoSupport include:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
# get the current autosupport configuration Get-NcNode $nodeName | Get-NcAutoSupportConfig # set the most common parameters $splat= @{ 'Transport' = "https"; 'IsPrivateDataRemoved' = $true; 'IsLocalCollectionEnabled' = $true; 'IsEnabled' = $true; 'IsSupportEnabled' = $true; } Get-NcNode $nodeName | Set-NcAutoSupportConfig @splat # if you use a proxy for web access, setting the configuration is quite easy Get-NcNode $nodeName | Set-NcAutoSupportConfig -ProxyUrl "$username:$password@$proxyhost:$port" |
Licenses
Adding licenses to your cDOT system is trivial:
1 |
Add-NcLicense -License ABCDEFGHIJKLMNOP |
You can quickly compare the licenses in your cluster using this one-liner:
1 |
Get-NcLicense | Group-Object -Property Owner | Sort-Object -Property Name |
This gives an easy to check comparison if you have the same license count applied to each host. Alternatively, you could use this one-liner to view the licenses and which host they have been applied to:
1 |
Get-NcLicense | Select-Object Owner, Description | Group-Object -Property Description |
Cluster Management LIF(s)
Each cluster must have at least one LIF which is used for managing the cluster itself.
1 2 3 4 5 6 7 8 9 |
# view the cluster management LIF(s) Get-NcNetInterface | ?{ $_.Role -eq "cluster_mgmt" } # managing the cluster management LIF is just like any other interface # change the IP address Get-NcNetInterface cluster_mgmt | Set-NcNetInterface -Address $newIP -Netmask $Netmask # change the home node and port Set-NcNetInterface -vserver $clusterName -Name cluster_mgmt -Node $newNode -Port $newPort |
Moving the cluster management LIF ahead of maintenance operations on the hosting node is a good idea to avoid any potential issues with connectivity. This function will move the cluster management LIF to another host in the failover group:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
function Move-LifInFog { [cmdletbinding(SupportsShouldProcess=$true)] Param( [Parameter( Mandatory=$true, ValueFromPipeline=$true )] [DataONTAP.C.Types.Net.NetInterfaceInfo] $LIF ) process { # determine the new destination port $newPort = Get-NcNetFailoverGroup | ?{ $_.FailoverGroup -eq $LIF.FailoverGroup ` -and $_.Node -ne $LIF.CurrentNode } | Get-Random $message = "Moving LIF to $($newPort.Node):$($newPort.Port)" if ($PSCmdlet.ShouldProcess($LIF, $message)) { $LIF | Move-NcNetInterface -DestinationNode $newPort.Node -DestinationPort $newPort.Port } } } |
Inter-Cluster LIF(s)
Inter-cluster LIFs are used for SnapMirror and SnapVault realtionships. They are a standard network interface with a specific role and firewall policy assigned.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
# view ICLs for the cluster Get-NcNetInterface -Role intercluster # view ICLs for a specific node Get-NcNode $nodeName | Get-NcNetInterface -Role intercluster # create a new ICL New-NcNetInterface -Name "$($nodeName)_ICL" -Node $nodeName -Role intercluster -Port $portName -DataProtocols none -Address $ip -Netmask $netmask # change the home port of an ICL (remember ICLs have to stay local to the node) Get-NcNetInterface -Name "$($nodeName)_ICL" | Set-NcNetInterface -Node $nodeName -port $newPortName # to actually move the ICL to a new port, you need to use the Move-NcNetInterface cmdlet Move-NcNetInterface -Name "$($nodeName)_ICL" -DestinationNode $nodeName -DestinationPort $newPort # alternatively, if you changed the home port, just send it home Invoke-NcNetInterfaceRevert -Name "$($nodeName)_ICL" |
SNMP
Using just a couple of commands, we can configure and enable SNMP for the cluster.
1 2 3 4 5 |
// Create the community Add-NcSnmpCommunity -Community notPublic // Start the SNMP service Enable-NcSnmp |
DNS
DNS is managed much like any other service on the Cluster.
1 2 3 4 5 6 7 8 9 |
# show the DNS config for a SVM Get-NcNetDns -Vserver $svmName # modify the DNS configuration for a SVM Get-NcNetDns -Vserver $svmName | Set-NcNetDns -NameServers 1.1.1.1,2.2.2.2,3.3.3.3 # an example from the documentation...copying the DNS configuration of one # SVM to another in one simple step Get-NcNetDns -Vserver $oldSVM | Set-NcNetDns -VserverContext $newSVM |
Question – I’m interested in automating the actual cluster setup process…in 7-mode there is an Initialize-NaController cmdlet but doesn’t appear to be a similar cmdlet for Cluster mode. Any suggestions on how to handle this? It would be specifically for 8.3.x.
Hi John,
This is possible, but not using cmdlets in the NetApp PowerShell toolkit that I’m aware of. Before a cluster has been created, the nodes have extremely limited functionality which does not support the functions of the PowerShell Toolkit.
You will need to use PowerShell’s ability to import .NET bindings and load the Manage ONTAP dll from the NetApp Manageability SDK. From there, using the .NET ZAPI bindings, you’ll want to connect to the nodes (you’ll need to let them DHCP, then pass that DHCP address to your script) using no password. Once connected there are several steps needed to instantiate the cluster:
cluster-create
zapi)Once that is done you will be able to connect to the cluster using the PowerShell toolkit and continue configuring.
Please reach out to me using the NetApp Community private message system (my username is asulliva) or my NetApp address (my community username at netapp.com). I’ll share what I can about the process.
Thank you for reading!
Andrew
Hi There, Is there an option to cluster unjoin one of the nodes via PowerShell?
Hello Morris,
Yes, you can use the
Remove-NcCluster
cmdlet to unjoin a node.Hope that helps!
Andrew
Hi,
Is there a way I can add more than one e-mail adreses in the to list while configuring ASUP using powershell? While I try this, I am getting error
Set-NcAutoSupportConfig : Invalid value specified for “to” element within “autosupport-config-modify”: “user1@domain.com,user2@domain.com”.