Quantcast
Channel: NetApp – The Practical Administrator
Viewing all articles
Browse latest Browse all 16

NetApp PowerShell Toolkit 101: Cluster Configuration

$
0
0

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.

    cluster_config_1

    The bug is a result of a type conversion error. The workaround is to simply provide a value for the MinimumPrivateDataLength parameter:

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

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

Add-NcLicense -License ABCDEFGHIJKLMNOP

You can quickly compare the licenses in your cluster using this one-liner:

Get-NcLicense | Group-Object -Property Owner | Sort-Object -Property Name

cluster_config_2

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:

Get-NcLicense | Select-Object Owner, Description | Group-Object -Property Description

cluster_config_3

Cluster Management LIF(s)
Each cluster must have at least one LIF which is used for managing the cluster itself.

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

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
        }
    }
}

cluster_config_4

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.

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

// 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.

# 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

The post NetApp PowerShell Toolkit 101: Cluster Configuration appeared first on The Practical Administrator.


Viewing all articles
Browse latest Browse all 16

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>