Showing posts with label netapp. Show all posts
Showing posts with label netapp. Show all posts

Thursday, April 7, 2011

Short Guide for Netapp commands

This post contains the list of commands that will be most used and will come handy when managing or monitoring or troubleshooting a Netapp filer.


•sysconfig -a : shows hardware configuration with more verbose information

•sysconfig -d : shows information of the disk attached to the filer

•version : shows the netapp Ontap OS version.

•uptime : shows the filer uptime

•dns info : this shows the dns resolvers, the no of hits and misses and other info

•nis info : this shows the nis domain name, yp servers etc.

•rdfile : Like "cat" in Linux, used to read contents of text files/

•wrfile : Creates/Overwrites a file. Similar to "cat > filename" in Linux

•aggr status : Shows the aggregate status

•aggr status -r : Shows the raid configuration, reconstruction information of the disks in filer
•aggr show_space : Shows the disk usage of the aggreate, WAFL reserve, overheads etc.

•vol status : Shows the volume information

•vol status -s : Displays the spare disks on the filer

•vol status -f : Displays the failed disks on the filer

•vol status -r : Shows the raid configuration, reconstruction information of the disks

•df -h : Displays volume disk usage

•df -i : Shows the inode counts of all the volumes

•df -Ah : Shows "df" information of the aggregate

•license : Displays/add/removes license on a netapp filer

•maxfiles : Displays and adds more inodes to a volume

•aggr create : Creates aggregate

•vol create : Creates volume in an aggregate

•vol offline : Offlines a volume

•vol online : Onlines a volume

•vol destroy : Destroys and removes an volume

•vol size [+|-] : Resize a volume in netapp filer

•vol options : Displays/Changes volume options in a netapp filer

•qtree create : Creates qtree

•qtree status : Displays the status of qtrees

•quota on : Enables quota on a netapp filer

•quota off : Disables quota

•quota resize : Resizes quota

•quota report : Reports the quota and usage

•snap list : Displays all snapshots on a volume

•snap create : Create snapshot

•snap sched : Schedule snapshot creation

•snap reserve : Display/set snapshot reserve space in volume

•/etc/exports : File that manages the NFS exports

•rdfile /etc/exports : Read the NFS exports file

•wrfile /etc/exports : Write to NFS exports file

•exportfs -a : Exports all the filesystems listed in /etc/exports

•cifs setup : Setup cifs

•cifs shares : Create/displays cifs shares

•cifs access : Changes access of cifs shares

•lun create : Creates iscsi or fcp luns on a netapp filer

•lun map : Maps lun to an igroup

•lun show : Show all the luns on a filer

•igroup create : Creates netapp igroup

•lun stats : Show lun I/O statistics

•disk show : Shows all the disk on the filer

•disk zero spares : Zeros the spare disks

•disk_fw_update : Upgrades the disk firmware on all disks

•options : Display/Set options on netapp filer

•options nfs : Display/Set NFS options

•options timed : Display/Set NTP options on netapp.

•options autosupport : Display/Set autosupport options
•options cifs : Display/Set cifs options
•options tcp : Display/Set TCP options
•options net : Display/Set network options
•ndmpcopy : Initiates ndmpcopy

•ndmpd status : Displays status of ndmpd

•ndmpd killall : Terminates all the ndmpd processes.

•ifconfig : Displays/Sets IP address on a network/vif interface

•vif create : Creates a VIF (bonding/trunking/teaming)

•vif status : Displays status of a vif

•netstat : Displays network statistics

•sysstat -us 1 : begins a 1 second sample of the filer's current utilization (crtl - c to end)
•nfsstat : Shows nfs statistics

•nfsstat -l : Displays nfs stats per client

•nfs_hist : Displays nfs historgram

•statit : beings/ends a performance workload sampling [-b starts / -e ends]
•stats : Displays stats for every counter on netapp. Read stats man page for more info

•ifstat : Displays Network interface stats

•qtree stats : displays I/O stats of qtree

•environment : display environment status on shelves and chassis of the filer
•storage show : Shows storage component details

•snapmirror intialize : Initialize a snapmirror relation

•snapmirror update : Manually Update snapmirror relation

•snapmirror resync : Resyns a broken snapmirror

•snapmirror quiesce : Quiesces a snapmirror bond

•snapmirror break : Breakes a snapmirror relation

•snapmirror abort : Abort a running snapmirror

•snapmirror status : Shows snapmirror status

•lock status -h : Displays locks held by filer

•sm_mon : Manage the locks

•storage download shelf : Installs the shelf firmware

•software get : Download the Netapp OS software

•software install : Installs OS

•download : Updates the installed OS

•cf status : Displays cluster status

•cf takeover : Takes over the cluster partner

•cf giveback : Gives back control to the cluster partner

•reboot : Reboots a filer

Setup ISCSI on Linux from Netapp

A quick guide to setup IP SAN using Linux-Netapp-iscsi.

On Linux server :
1. Install iSCSI initiator (iscsi-initiator-utils rpm) on your linux machine. This will create the necessary binaries and will create /etc/iscsi.conf and /etc/initiatorname.iscsi
2. Add iscsi-iname to /etc/initiatorname.iscsi .

[root@unixfoo ~]# iscsi-iname
iqn.1987-05.com.cisco:01.44c65d9587d9
[root@unixfoo ~]#

Add the output to /etc/initiatorname.iscsi
3. Add the below lines to /etc/iscsi.conf

Continuous=no
HeaderDigest=never
DataDigest=never
ImmediateData=yes
DiscoveryAddress=192.185.12.12

DiscoveryAddress should be the IP address of the storage.
On Netapp filer :
1. Make sure you have iscsi license enabled.
2. Create volume for holding the iscsi luns.

filer1> vol create iscsivol aggr01 100g
3. Create lun on the volume

filer1> lun create -s 50g -t linux /vol/iscsivol/lun1
4. Create an igroup and add the Linux iscsi-iname to it.

filer1> igroup create -i -t linux iscsigrp
filer1> igroup add iscsigrp iqn.1987-05.com.cisco:01.44c65d9587d9
filer1> igroup show
iscsigrp (iSCSI) (ostype: linux):
iqn.1987-05.com.cisco:01.44c65d9587d9 (logged in on: iswta)
filer1>
5. Map the lun to the iscsi-group.

filer1> lun map /vol/iscsivol/lun1 iscsigrp 0
6. Enable only one interface for iscsi use and disable others

filer1> iswt interface disable e7
filer1> iswt interface show
Interface e0 disabled
Interface e4 enabled
Interface e5 disabled
Interface e7 disabled
filer1>
7. Done on the Netapp side.

On Linux again :
1. Start iscsi initiator

[root@unixfoo ~]# /etc/init.d/iscsi start
Checking iscsi config: [ OK ]
Loading iscsi driver: [ OK ]
Starting iscsid: [ OK ]
[root@unixfoo ~]#
2. Set iscsi initiator to start automatically after reboot.

[root@unixfoo ~]# chkconfig iscsi on
3. Check whether the iscsi lun shows up on the linux machine.

[root@unixfoo ~]# iscsi-ls
*******************************************************************************
SFNet iSCSI Driver Version ...4:0.1.11-3(02-May-2006)
*******************************************************************************
TARGET NAME : iqn.1992-08.com.netapp:sn.50380528
TARGET ALIAS :
HOST ID : 2
BUS ID : 0
TARGET ID : 0
TARGET ADDRESS : 192.185.12.12:3260,2
SESSION STATUS : ESTABLISHED AT Sat Dec 29 21:55:37 PST 2007
SESSION ID : ISID 00023d000001 TSIH 501

DEVICE DETAILS:
---------------
LUN ID : 0
Vendor: NETAPP Model: LUN Rev: 0.2
Type: Direct-Access ANSI SCSI revision: 04
page83 type3: 60a980004f6444662653053584516d34
page80: 4f6444516d344305358066265a
Device: /dev/sdb

*******************************************************************************
[root@unixfoo ~]#
4. Now you have a new device in your linux box (/dev/sdb) - that is your iscsi device. You can create filesystem on it and use it.
5. Done!