Notes

2020.07.14: Enabling Out-of-Band IP with ATTO 7600N

set ethernetport mp1 enabled

2020.07.09: How To Collect NetApp OCI Scale Report

https://{ip}/private/rest/v1/advancedTroubleshooting/reports/scaleReport


2020.04.18: PowerShell One-Liner to Remove Spaces from the End of Lines of Captured Output


A simple but effective one liner. Run it in PowerShell. Copy and Paste in your text content with spaces at the end of the lines into PowerShell. Type EOF to end capturing data. And then simply copy the output to get your content with spaces at end of line removed.


$R = $TRUE;$O=@();While($R){$I = Read-Host; If($I -eq "EOF"){$R = $FALSE}else{$O += $I.Trimend(" ")}};$O


2019.04.09: How to check User Name Mapping


set advanced

vserver services access-check authentication show-creds -vserver {SVM} -win-name {USER}
vserver security file-directory show-effective-permissions -vserver {SVM} -win-user-name {USER} -path /

2018.09.09: Excel Formumlas for NetApp Docs 3.3 Cluster via ASUP Collections

Column A = Cluster

Column D = Node Serial Number

="(Find-NtapAsupSystemInfo -ClusterName "&A2&" -NodeSerialNumber "&D2&").Cluster_Identifier >> log.txt"


Column AB = Cluster Identifier (obtained from above)


="Get-NtapClusterAsupData -Cluster '"&A2&":"&AB2&"' | Format-NtapClusterData | Out-NtapDocument -WordFile 'C:\Output\"&A2&".Docx' -ExcelFile 'C:\Output\"&A2&".xlsx'"


2018.07.03: Advanced Drive Partitioning Boot Menu Options (from an ONTAP 9.3 system)

* Advanced Drive Partitioning Boot Menu Options *
*************************************************

(9a) Unpartition all disks and remove their ownership information

(9b) Clean configuration and initialize node with partitioned disks
(9c) Clean configuration and initialize node with whole disks
(9d) Reboot the node
(9e) Return to main boot menu

2017.09.18: ONTAP Special Boot Menu

(1) Normal Boot.
(2) Boot without /etc/rc.
(3) Change password.
(4) Clean configuration and initialize all disks.
(5) Maintenance mode boot.
(6) Update flash from backup config.
(7) Install new software first.
(8) Reboot node.

Selection (1-8)? 22/7


(22/7)     Print this secret List

(23/7)     Boot in nothing initialized mode.
(25/6)     Force boot with multiple filesystem disks missing.
(25/7)     Boot w/ disk labels forced to clean.
(28/7)     Display disk labels.
(28/8)     Examine disk labels in detail.
(29/7)     Bypass media errors.
(30/7)     OBSOLETE: REMOVED. (Was: edit disk labels.)
(6a)       Update flash from alternate backup config.
(4c)       Clean configuration and initialize all disks.
(4d)       Initialize all disks.
(44/4a)    Zero disks if needed and create new flexible root volume.
(44/7)     Assign all disks, Initialize all disks as SPARE, write DDR labels
(readonly) Readonly boot
(prev_cp)  Boot from previous CP
(quotaoff) Boot and turn quotas off

2017.07.10: How to trim spaces from lines in a file


$File = "FILENAME"; $New = @(); get-content $File | foreach{ $New += $_.Trim(" ") }; $New | Out-File $File


2017.04.29: NetAppDocs for 7-Mode via ASUP

Variables:
FILERA     = Name of Controller A
SERIALA    = Serial # of Controller A
FILERB     = Name of Controller B
SERIALB    = Serial # of Controller B
C:\Output\ = Output Folder
HAPAIR     = Output filename (for docx and xlsx)

Command:

Get-NtapFilerAsupData -System 'FILERA:SERIAL_NUMBER!FILERB:SERIAL_NUMBER' | Format-NtapFilerData | Out-NtapDocument -WordFile 'C:\Output\HAPAIR.docx' -ExcelFile 'C:\Output\HAPAIR.xlsx'

2017.02.11: PowerShell resolve hostname to IP
[System.Net.Dns]::GetHostAddresses("$HOSTNAME").IPAddressToString

2017.01.18: What do storage system and shelf temperature thresholds mean?

system node run -node {NODE-NAME} -command environment chassis list-sensors

2016.12.18: Reset wfa "admin" password

Prompt browse to> {INSTALL_PATH}\WFA\bin
wfa --admin-password
Note: Also useful> wfa -help

2016.12.07 


For disabling platform check for cDOT destination, add following line to /etc/conf/transition-tool.conf and then restart the windows service: cft.skip.clustermode.platform.check = true. Using this flag to disable platform check must not be used without engineering approval (PVR)!

2016.12.13: Offline mgmt in Cluster Ring Show
From: https://forums.netapp.com/thread/102278
Commands from systemshell% to:
1) Check whether mgwd is running:
spmctl --list | grep mgwd
2) Kill mgwd:
spmctl -h mgwd -s
3) Re-start mgwd:
spmctl -h mgwd -e

2016.09.25: Data collection from Cisco Switches
copy running-config startup-config
show tech-support | no-more
show ssh key
show ssh server
show callhome destination-profile

2016.09.25: Data collection from NetApp Switches (via enable)
write mem
show tech-support
show ip ssh
show logging email config

2016.09.25: Data collection from ONTAP 8.2.3 ::>
rows 0; system health status show; system health subsystem show; system health alert show -instance; cluster peer show -instance; vserver peer show; storage disk show -fields owner,dr-home,array,errors; cluster peer show -instance; cluster peer health show -instance; autosupport invoke -node * -type all -message BASIC_CONFIG

2016.09.25: Data collection from ONTAP 8.3+ ::>
rows 0; system health status show; system health subsystem show; system health alert show -instance; cluster peer show -instance; vserver peer show; storage disk show -fields owner,dr-home,array,errors; cluster peer show -instance; cluster peer health show -instance; autosupport invoke -node * -type all -message BASIC_CONFIG

NetAppdocs instructions:


Import-Module NetappDocs

Find-NtapAsupClusterId -ClusterName CLUSTERNAME -NodeSerialNumber SERIALNUMBER_of_a_NODE
Get-NtapClusterAsupData -Cluster 'CLUSTERNAME:CLUSTER_IDENTIFIER' | Format-NtapClusterData | Out-NtapDocument -WordFile 'C:\Output\CLUSTERNAME.Docx' -ExcelFile 'C:\Output\CLUSTERNAME.xlsx'

PS> One Liner to Parse the Output of> cdpd show-neighbors -v

$cdpd = get-content '.\cdpd output.txt'


$N = $LP = $RD = $RP = ""; "CDOT NODE,LOCAL PORT,REMOTE DEVICE,REMOTE PORT"; $cdpd | foreach{ If($_.StartsWith("Node")){ $N = $_.Substring(5).Trim(" ","`t") }; If($_.StartsWith("Local Port")){ $LP = $_.Substring(11).Trim(" ","`t") }; If($_.StartsWith("Remote Device")){ $RD = $_.Substring(14).Trim(" ","`t") }; If($_.StartsWith("Remote Port")){ $RP = $_.Substring(12).Trim(" ","`t") }; If($RD -and $LP -and $RP){ "$N,$LP,$RD,$RP"; $LP = ""; $RD = ""; $RP = "" } }


How to get all 32-bit Snapshots on a 7-Mode  (>= 8.1.4P4 ) System using PowerShell

Import-Module DataONTAP


$Cred = New-Object System.Management.Automation.PsCredential($(Read-Host "U"),$(Read-Host "P" -AsSecureString))


Add-NaCredential 10.0.0.50 -Credential $Cred


Connect-NaController 10.0.0.50


Get-NaVol | foreach { $_.Name ; $Snapshots = Get-NaSnapshot -TargetName $_ | Where{ $_.FsBlockFormat -eq "32_bit" }; $Snapshots | FT Name,Created,FsBlockFormat }


Getting all IGROUPS with Mapped LUNs on a Node


import-module D:\NA_DaveC\DataONTAP

$Controller = "CONTROLLER_NAME"
connect-nccontroller $Controller
$NodeName = "NODE_NAME"
(get-nclunmap | where{$_.Node -eq $NodeName}).initiatorgroup | select -uniq

One Liner to Get Contents

$N = @(); (Get-Content "contents.txt") | Foreach{ $N += $_.split(".")[0].Trim(" ") }; $N


How to Trace with Netsh


netsh trace start scenario=NetConnection capture=yes report=yes persistent=no maxsize=1024 correlation=yes traceFile=C:\Logs\NetTrace.etl


netsh trace stop


https://blogs.technet.microsoft.com/yongrhee/2012/12/01/network-tracing-packet-sniffing-built-in-to-windows-server-2008-r2-and-windows-server-2012/


FUNCTION Split on SemiColon

Function SPLITSEMICOLON{ Param([parameter(Mandatory=$true)][System.Array]$InArr); $Output = @(); $InArr | Foreach { $Output += $_.Split(";"); $Output += ""}; $Output | Set-Content "TEMP.TXT"; Notepad TEMP.TXT }


Boot Loader Boot Options


boot_ontap maint

boot_ontap prompt

Configuring Failover of Node Mgmt in 8.3.X (20151207)

broadcast-domain create -broadcast-domain VLAN123 -mtu 1500
vlan create -node CLU1N1 -vlan-name e1a-123
net int modify -vserver CLU1 -lif CLU1N1_mgmt1 -home-node CLU1N1 -home-port e1a
net int revert -vserver CLU1 -lif CLU1N1_mgmt1
broadcast-domain remove-ports -broadcast-domain Default -ports CLU1N1:e0m
broadcast-domain add-ports -broadcast-domain VLAN123 -ports CLU1N1:e0m,CLU1N1:e1a-123
net int modify -vserver CLU1 -lif CLU1N1_mgmt1 -home-node CLU1N1 -home-port e0m

Power on VM via ESXi CLI (20151207)
vim-cmd vmsvc/getallvms | grep {VM_NAME}
vim-cmd vmsvc/power.getstate {VMID}
vim-cmd vmsvc/power.on {VMID}

Nearstore effect on SnapMirror Priority (2015/11/28)

If Nearstore is enabled on the Controller, the SnapMirror priority will be the same as Client Workloads.
With Nearstore disabled SnapMirror is given a lower priority over Client workload.

Insight 2015 Content Link (2015/11/28)

https://www.brainshark.com/go/netapp-sell/insight-library.html

CMPG (2015/11/28)

cmdownload.exe -filer CONTROLLERNAME -weeks 2
cmpg -analysis -details -f CONTROLLERNAME/*.gz
cmpg -analysis -details -noDataAverage -f CONTROLLERNAME/*.gz

Determining Vol Affinity

In Nodeshell:
FAS> priv set diag
FAS*> vol_db lookup name
The output should be similar to the: f:X:0[0x................]
FAS*> vol_db get waffi_id f:X:0

One Liner PS Function to Convert List to CSV (2015/11/15)
FUNCTION ListToCSV { PARAM([Parameter(Mandatory=$True)][System.Array]$InArr); [String]$OutStr = ""; $InArr | Foreach{ $OutStr += $_.trim() + "," }; $OutStr.Substring(0,$OutStr.Length-1) | Out-File "TEMP.TXT"; Notepad TEMP.TXT }

Copy and paste into PowerShell. Then run -

PS> ListToCSV
- and copy and paste in the list. Output appears in Notepad as CSV.

How to collect a SECD trace (2015/11/09)

https://kb.netapp.com/support/index?page=content&id=1015122

User to SID Translation (2015/11/09)

$objUser = New-Object System.Security.Principal.NTAccount("DOMAIN\USERNAME")
$strSID = $objUser.Translate
$strSID.Value

SID to User Translation (2015/11/09)

$objSID = New-Object System.Security.Principal.SecurityIdentifier("S-1-5-21-1234567890-1234567890-1234567890-1234567")
$objUser = $objSID.Translate ( [System.Security.Principal.NTAccount])
$objUser.Value

20151025: How to get a Count of Unnecessary Default Style Name Maps (cDOT)


PS> (get-ncnamemapping -direction unix_win | where { ($_.replacement.Split("\")[0] -eq "DOMAIN") -and ($_.replacement.Split("\")[2] -eq $_.pattern) }).count


PS> (get-ncnamemapping -direction win_unix | where { ($_.pattern.Split("\")[0] -eq "DOMAIN") -and ($_.pattern.Split("\")[2] -eq $_.replacement) }).count

20151024: Pocket guide for NetApp commands (7-mode)


http://www.cloudibee.com/pocket-guide-for-netapp-commands-7-mode/


20151012: Capturing a Perfstat (for Clustered Data ONTAP)


perfstat8 cluster_management_IP_address -m c -t 4 -i 5 -z


20151012: How to capture traces on Data ONTAP 7-Mode systems


pktt start -all -d /etc/crash -b 2m -s 1000m

pktt stop all

20150804: Common Read Only and No Access Export Policies (8.2+)


vserver export-policy create -vserver SVMNAME -policyname expol_noaccess


vserver export-policy create -vserver SVMNAME -policyname expol_readonly
vserver export-policy rule create -vserver SVMNAME -policyname expol_readonly -ruleindex 1 -protocol any -clientmatch 0.0.0.0/0 -rorule any -rwrule never -anon 65534 -superuser none -allow-suid true -allow-dev true

20150701: Advanced Clustershell - Deleting 7-Mode Snapshots older than 2 Weeks


set -confirmations off

snapshot delete {-is-7-mode true -create-time <2w}
set -confirmations on

20150522: Commands for re-cabling Cluster Network and Increasing from 2 to 4 CIs per FAS8040


R/W Commands Required:


net port modify -node NODENAME -port e0b -role cluster -mtu 9000 -flowcontrol-admin none

net port modify -node NODENAME -port e0d -role cluster -mtu 9000 -flowcontrol-admin none
net int create -vserver NODENAME -lif clus3 -role cluster -home-node NODENAME -home-port e0b -auto true
net int create -vserver NODENAME -lif clus4 -role cluster -home-node NODENAME -home-port e0d -auto true

R/O (Show) Useful Commands on cDOT:


cluster show

set advanced; cluster ring show
set advanced; cluster ping-cluster -node ANYNODE
net port show -role cluster
net int show -role cluster

R/O (Show/User Level) Useful Commands on CN1610 (if replacing ISL cables SFP to Twinax and vice-verse):


show port-channel brief



20150306: How to Install Qual Devices File without CIFS


software get http://10.20.30.40/qual_devices_v3
software get http://10.20.30.40/qual_devices_v3.copy
priv set diag
mv /etc/software/qual_devices_v3 /etc/qual_devices_v3
mv /etc/software/qual_devices_v3.copy /etc/qual_devices_v3.copy
rdfile /etc/qual_devices_v3
priv set admin


20141219: Troubleshooting Cause of Failover via the SP

If not the required information in the AutoSupports, run these from the service processor:
SP> priv set advanced
SP*> system log
SP*> events all
SP*> sp status –d
SP*> system sensors
SP*> version

20141016: A Super Easy One-Line way to get your PSCredential


$Cred = New-Object System.Management.Automation.PsCredential($(Read-Host "U"),$(Read-Host "P" -AsSecureString))


20140421: 7-Mode Flash Cache Checks

# Check if the card is detected by the version of ONTAP, and - if so - whether it is enabled:

sysconfig -ca
sysconfig

# Check flex_scale is licensed:

license

# Typical options (if it is detected and enabled):

options flexscale.enable             on  
options flexscale.lopri_blocks       off 
options flexscale.normal_data_blocks on  
options flexscale.pcs_high_res       off 
options flexscale.pcs_size           0GB 

# To see it working:

stats show -p flexscale-access -i 1

20140322: Enabling SSH Access to a Clustered ONTAP system Before Completing Cluster Setup

In the below, first break the "Cluster Setup Wizard" by typing "exit" or using Ctrl+C, then run the following commands. The following commands have us create an IP Address for node-mgmt on the node-mgmt port e0M.

network interface create -lif mgmt1 -role node-mgmt -home-node localhost -home-port e0M -address 10.10.10.11 -netmask 255.255.0.0

security login password -username admin

security login create -username admin -application ssh -authmethod password -role admin

Optional step: For if you need to be able to route to the node-mgmt IP created above before completing the "Cluster Setup Wizard".

system node rename -newname NODE01


network routing-groups route create -vserver NODE01 -routing-group n10.10.10.10/16 -destination 0.0.0.0/0 -gateway 10.0.0.2 -metric 10

20140117: Checks for non-default SFO (storage failover) settings in Clustered ONTAP

sto fail show -enabled false
sto fail show -auto-giveback true
sto fail show -abort-operations true
sto fail show -check-partner false
sto fail show -onpanic false
sto fail show -onreboot false
sto fail show -auto-giveback-after-panic false


20130427: Disabling 7DOT Timeouts in Console, SSH, Telnet + PuTTY

options autologout.console.enable off
options autologout.telnet.enable off
options ssh.idle.timeout 0
+ Putty > Settings > Connection > SSH > Kex > Max minutes before rekey = 0

20130415: Disabling automatic aggregate Snapshot copy creation

aggr options aggr_name nosnap on
snap delete -A -a aggr_name
snap reserve -A aggr_name 0

20130415: Realtime Monitoring of Data ONTAP with sysstat

From the DOT CLI, run:
sysstat -x 1
Specifically we're interested in the CP ty field. Any b or B's is not good and suggest the storage is being hammered!
CP = Consistency Point
B = Back to back CPs (CP generated CP)
b = Deferred back to back CPs (CP generated CP)

20130415: ESXi 5.* Error: “System logs on host … are stored on non-persistent storage.”

vSphere Client -> Host -> Configuration tab -> Software Panel -> Advanced Settings
Syslog -> global: Syslog.global.logDir
Input a value in the form:
[datastoreName]/logdir
Example:
[FRKNFSVOL0]/frkesx01logs
Note 1: You do need the square brackets.
Note 2: The logs folder does not need to be created first

20130118: Understanding AD DS Functional & Domain Levels