NetApp Command Reference
NetApp Command Reference
NetApp General Command Reference Guide
The NetApp has a rich set of commands that allow you to completely manage the filer from the command line. The NetApp Command Line Interface or CLI allows the administrator to manage every single component of this device. Admittedly some aspects of the filer are easier to manage via a web interface, but as a rule, the CLI is the way to go. Below is a generalized reference guide to many of the commands it multiple command arguments. The commands are broken down into there respective organizational areas of interest.
NetApp Software Commands
> software list – Lists software in the /etc/software directory
> software get http://10.10.23.1/8.0_e_image.zip 8.0_e_image.zip – Copy software from http to software directory
> software delete – Deletes software in the /etc/software directory
> software update 8.0_e_image.zip -r – Install software. The -r prevents it rebooting afterwards
Baseboard Management Controller BMC (Not to be confused with BMC Patrol)
> bmc status – shows the status of the BMC remote management interface
> bmc setup – BMC remote management interface setup
NetApp General Commands
> setup – Re-Run initial setup
> halt – Reboots controller into bootrom
> reboot – Reboots controller back to Data Ontap
> sysconfig -a – System configuration and information
> java netapp.cmds.jsh – limited freebsd cli
> storage show disk – show physical information about disks
> passwd – Change password for logged in user
> sasadmin shelf – shows a graphical layout of your shelves with occupied disk slots
> options trusted.hosts 10.10.23.1 or 10.10.23.1/nn – hosts that are permitted to telnet, http, https and ssh admin access. 10.10.23.1 = ip address, /nn are network bits
> options trusted.hosts * – Allows all hosts to the above command
> sysstat -s 5 – Displays operating statistics every 5 seconds i.e. CPU, NFS, CIFS, NET, DISK, etc
> reallocate measure /vol/volume-xyz – Measure the amount of fragmentation in a volume
> options autologout.console.enable on – Turns on autologout for the console
> options autologout.console.timeout 300 – 300 second autologout for the console
> options autologout.telnet.enable on – Turns on autologout for telnet
> options autologout.telnet.timeout 300 – 300 second autologout for the console
NetApp Diagnostics Commands
Press DEL at boot up during memory test followed by boot_diags and select all – Diagnostic tests for a new install
> priv set diags – Enter diagnostics CLI mode from the Ontap CLI
> priv set – Return to normal CLI mode from diagnostics mode
NetApp Service Port (SP)
> sp status – shows the status of the SP remote management interface
> sp setup – SP remote management setup
NetApp Alternate Control Path (ACP) Commands
> options acp.enabled on – Turns on ACP
> storage show acp -a – show ACP status
NetApp Aggregates Commands
> aggr create aggregate_name – Creates an Aggregate
> aggr destroy aggregate_name – removes an Aggregate
> aggr offline aggregate_name – takes an Aggregate offline
> aggr online aggregate_name – bring an Aggregate online
> aggr options aggregate_name root – makes an Aggregate root|Only use if your Root Aggregate is damanged
> aggr status – shows status of all aggregates
> aggr status aggregate_name – show status of a specific Aggregate
> aggr status -r aggr0 – shows the root volume on aggr0 and the disk layout
> aggr status -s aggr0 – shows spare disks on aggr0
> aggr status -v aggr0 – *Note* This must be done in the priv set diag mode. This shows much more detailed information of the aggregate status
> aggr show_space aggregate_name – shows specific aggregate space information
> aggr options aggregate_name nosnap=on – Disable snapshot autocreation
> aggr options aggregate_name raidsize=x – x being the number of drives in the RAID
> aggr scrub status -v – *Note* This must be done in the priv set diag mode. Shows scrub status of the aggregate
> aggr scrub resume – *Note* This must be done in the priv set diag mode. Resumes a susepended scrub
> aggr scrub suspend – *Note* This must be done in the priv set diag mode. Suspends a current scrub process
> aggr scrub start – *Note* This must be done in the priv set diag mode. Starts a new scrub process
> reallocate start -f -p /vol/volume-xyz – Run in priv set advanced, used after adding disks to an aggregate to evenly distribute blocks amongst raid groups
> snap reserve -A aggregate_name 0 – Set Aggregate snap reserve to 0% or any number you enter
> snap list -A aggregate_name – Lists snapshots on specified aggregate
> snap delete -A aggregate_name – Deletes a snapshot on a specified aggregate
> snap sched -A aggregate_name hours@time,time,time which creates a snapshot shedule in weeks days hours@time. ie 0 2 1@4 means no weekly snaps, 2 daily, 1 hourly @ 4am.
NetApp Volumes Related Commands
> vol create volume_name – Creates a volume
> vol autosize volume_name – Shows autosize settings for a given volume
> vol autosize volume_name on|off – Turns Volume autosize on or off
> vol options volume_name – Lists volume options
> vol size volume_name + size k|m|g|t – increase volume size by KB, MB, GB or TB
> vol status -f – lists broken or failed disks
> vol scrub status -v – Shows the scrubbing status of volumes
> vol options nosnapdir on|off – enables or disables snapshot visibility from the volume or LUN level
NetApp Qtree Commands
> qtree create /vol/volume_name/qtree_name – Create a qtree within a volume
> qtree security /vol/volume_name/qtree_name unix|ntfs|mixed – Change security settings of a qtree
> qtree stats qtree_name – Shows CIFS or NFS ops/sec for a given qtree
> qtree status – Displays all your Qtree’s
NetApp Snapshot Commands
> snap create volume_name snapshot_name – create a snapshot
> snap list volume_name – List snapshots for a volume
> snap delete volume_name snapshot_name – delete a snapshot on a volume
> snap delete -a volume_name – Deletes all snapshots for a volume
> snap autodelete volume_name show – Shows snapshot autodelete settings for a volume
> snap restore -s snapshot_name volume_name – Restores a snapshot on the specified volume name
> snap sched volume_name weeks days hours@time – Creates a snapshot schedule on a volume i.e. snap sched volume 4 5 1@07 Weekly Snapshots are created at midnight on each Sunday, Daily snapshots are created each day except Sunday at midnight
> snap delta volume_name – Shows delta changes between snapshots for a given volume
> snap reserve volume_name – Shows the snap reserve for a given volume
> snap reclaimable volume_name snapshot_name – Shows the amount of space reclaimable if you remove this snapshot from the volume
options cifs.show_snapshot on – Allows snapshot directory to be browse-able via CIFS
options nfs.hide_snapshot off – Allows snapshot directory to be visible via NFS
NetApp SnapMirror Commands
> options snapmirror.enable on – turns on SnapMirror. Replace on with off to toggle
> rdfile /etc/snapmirror.allow – To be performed on the Source Filer. You should see you destination filers in this file.
> wrfile /etc/snapmirror.allow – To be performed on the Source Filer. Overwrites the file with the specified destination filer name and ip address
> vol restrict volume_name – To be performed on the Destination. Makes the destination volume read only which must be done for volume based replication. Don’t use for Qtree based replication
> snapmirror initialize -S srcfiler:source_volume dstfiler:destination_volume – To be performed on the destination. This is for full volume mirror. For example snapmirror initialize -S filer1:vol1 filer2:vol2
> snapmirror initialize -S srcfiler:/vol/vol1/qtree dstfiler:/vol/vol1/qtree – To be performed on the destination. Performs the same as the command above but for Qtree’s only
> snapmirror initialize -S srcfiler/vol/vol1/- dstfiler:/vol/vol1/qtree – To be performed on the destination. Performs volume to qtree replication. Includes all luns, exports on the source volume
> snapmirror status – Shows the status of snapmirror and replicated volumes or qtree’s
> snapmirror status -l – Shows much more detail that the command above, i.e. snapshot name, bytes transferred, progress, etc
> snapmirror quiesce volume_name – To be performed on Destination. Pauses the SnapMirror Replication. If you are removing the snapmirror relationship this is the first step.
> snapmirror break volume_name – To be performed on Destination. Breaks or disengages the SnapMirror Replication. If you are removing the snapmirror relationship this is the second step followed by deleting the snapshot
> snapmirror resync volume_name – To be performed on Destination. When data is out of date, for example working off DR site and wanting to resync back to primary, only performed when SnapMirror relationship is broken
> snapmirror update -S srcfiler:volume_name dstfiler:volume_name – To be performed on Destination. Forces a new snapshot on the source and performs a replication, only if an initial replication baseline has been already done
> snapmirror release volume_name dstfiler:volume_name – To be performed on Destination. Removes a snapmirror destination
/etc/snapmirror.conf – edit or wrfile this file on the destination filer or vfiler to enter in a snapmirror schedule. i.e. srcfiler:vol1 dstfiler:vol1 – 15 * * * This will replicate every 15 minutes. Each * represents a value. Starting from right to left you have day of week, month, day of month, hour minute. Minute 0-59, hours 0-23, day-of-month 1-31, day-of-week 0 for Sunday – 6 Saturday Each value can only be a number.
/vol/vfiler_vol/etc/snapmirror.conf – read or write this file for snapmirror configurations on a vfiler. vfiler_vol being the first volume with the /etc in the vfiler
“priv set diag” followed by “snapmirror break -h ” followed by “priv set”. – If for some reason you snapmirror relationship has been orphaned, meaning it doesn’t exist in snapmirror status on the source but does exist on the destination, you can use these three commands to force the destination to become read/write. You can then do “snap list” and find the baseline snapshot for the destination. Followed by snap delete of the baseline snapshot. This will remove the snapmirror relationship if all else fails. Lastly don’t forget to remove the entry from snapmirror.conf
NetApp Cluster Commands
> cf enable – enable cluster
> cf disable – disable cluster
> cf takeover – take over resources from other controller
> cf giveback – give back controller resources after a take over
NetApp vFiler & Multistore Commands
> vfiler limit – To be performed on the host to see what the limit of vfilers is
> vfiler limit 16 – To be performed on the host to change the limit of vfilers to 16 or any number you specify. Check the documentation for Memory Requirements before doing this
> vfiler status – Displays the status of the vfiler i.e. running or stopped
> vfiler status -r – On the host system. Shows which volumes are running on each vfiler
> vfiler rename old_vfiler_name new_vfiler_name – Renames a vfiler
> vfiler run vfiler_name setup – Runs the vfiler setup wizard
> vfiler run vfiler_name cifs setup – Runs the cifs setup wizard for a vfiler
> ipspace create ipspacename – Creates an ipspace – needed when 2 or more vfilers use the same network subnets
> ipspace list – Lists the available ipspace’s
> ipspace assign ipspacename interface_name – Assigns the interface to an ipspace.
> ipspace destroy ipspace_name – Removes/Deletes an ipspace
> vfiler create vfiler_name -s ipspace_name -i 10.10.23.1 /vol/volume_name or qtree_name – Creates a vfiler name with ip address 10.10.23.1 and assigns the volume or qtree to the vfiler. The -s is optionalNOTE: Creating a qtree as the base vfiler does not allow you to enable snapmirror. You must create the base as a volume!
> vfiler add vfiler_name -i 10.10.23.1 /vol/volume_name – Adds an ip address and additional volume – can be qtree to an existing vfiler name
> vfiler remove vfiler_name -i 10.10.23.1 /vol/volume_name – Removes an IP address and volume from an existing vfiler
> vfiler destroy vfiler_name – Deletes/removes a vfiler
> vfiler rename vfiler_name_old vfiler_name_new – Renames a vfiler from old name to new name
> vfiler context vfiler_name – Changes CLI into the context of the vfiler name
> vfiler allow vfiler_name proto=cifs proto=nfs proto=iscsi – Allows the following protocols cifs, nfs and iscsi. Disallows rsh, ssh, ftp and http
> vfiler stop vfiler_name – Stops a vfiler instance
> vfiler start vfiler_name – Starts a vfiler instance
> vfiler run vfiler_name route add default 10.10.23.1 1 – Adds a default route to a vfiler. To be performed from vfiler0
route add 10.10.23.1/10.10.23.1.x 1 – Adds a route in a vfiler
NetApp Vlan & vfiler Commands
Check the ip space that the vfiler is using by typing ipspace list
Create a vlan interface on the host i.e. vif0-110 for vlan 110
Assign an interface to the ip space of the vfiler i.e. ipspace assign ipspace_name vif0-110
Add the ip address you wish to use on the vlan interface to the vfiler i.e. vfiler add vfiler_name -i 10.10.23.1
Once the vfiler has this ip address in it’s config we can add it onto the interface i.e. ifconfig vif0-110 10.10.23.1 netmask 255.255.255.0
NetApp Autosupport Commands
> options autosupport.support.enable on – Turns Autosupport on
> options autosupport.support.enable off – Turns Autosupport off
> autosupport.doit “description” – creates an autosupport alert with a user defined description
NetApp Hot Spares Commands
Any functioning disk which is not assigned or part of an aggregate but is assigned to a controller will function as a hot spare disk
disk show
> vol status -r – displays which disks are allocated as spare
Serious NetApp Configuration References & Tricks
Also see: LDAP Tech Tips Puppet Master Config Tips