EN 
06.06.2026 Norbert WELCOME IN MY WORLD

This website is originally written in the Czech language. Most content is machine (AI) translated into English. The translation may not be exact and may contain errors.

Tento článek si můžete zobrazit v originální české verzi. You can view this article in the original Czech version.
NetApp ONTAP CLI příkazy

NetApp ONTAP CLI commands

Edited 19.12.2023 22:00 | created | Petr Bouška - Samuraj |
Managing NetApp disk arrays running ONTAP can be done using the ONTAP System Manager web interface, but many more options are available using the ONTAP CLI command line. The commands allow us to configure and view everything in detail. In this article, we will look at commonly used commands and the implementation of some specific tasks.
displayed: 20 599x (3 660 CZ, 16 939 EN) | Comments [0]

Documentation

This article contains only a small part of the commands I needed (I will occasionally add more).

In the official documentation, we have access to the description of the commands (man pages) ONTAP 9 Documentation Center - CLI. Where we can click on Command man pages and further select the section for the corresponding ONTAP version. And the description of working with and using the CLI Using the ONTAP command-line interface, which continues with a description of managing individual areas.

CLI - Command-Line Interface

Administrator Privilege Levels

We normally work in administrator mode, but for some commands or parameters we need to switch to advanced (privileged) mode, or diagnostic mode.

AFF::> set -privilege advanced

Warning: These advanced commands are potentially dangerous; use them only when directed to do
         so by NetApp personnel.
Do you want to continue? {y|n}: y

AFF::*> set -privilege diagnostic

Warning: These diagnostic commands are for use by NetApp personnel only.
Do you want to continue? {y|n}: y

AFF::*> set -privilege admin

AFF::>

Shells

On the NetApp cluster, we can use three different Shells:

  • clustershell - the main and native Shell accessible after logging in, for cluster management and configuration
  • nodeshell - a special Shell for commands related to the node, commands are called using system node run
  • systemshell - a low-level shell for diagnostics and troubleshooting

Entering Commands

Commands are organized into a hierarchy using directories. We can execute a command by typing the full path of the command.

cluster::> storage disk show 

Or by navigating through the directory structure. Typing .. will move us up one level. Using top will take us to the top level of the hierarchy.

cluster::> storage
cluster::storage> disk
cluster::storage disk> show

We can abbreviate commands by typing the minimum number of letters that make the command unique. We can use the tab key to complete (expand) the command and display the parameters. And the question mark (?) to display the options with a description at that location.

In the command parameters, we can use query operators. The asterisk (*) wildcard, which matches all records. For example, all volumes with the string volume show -volume *VMware*. The not operator exclamation mark (!), a value that should not be compared. The or operator (|), range (..), less than (<), greater than (>), extended query ( { query } ).

For the show command, we can use the -instance parameter to display all details. Example volume show -instance. Another option is to use the -fields parameter and specify which items should be displayed (the default ones are always shown). The question mark will show us the options, example volume show -fields ?.

Network Management

Ports

Displaying information about physical ports. List of all ports.

AFF::> network port show

Node: AFF-01

                                                  Speed(Mbps) Health
Port      IPspace      Broadcast Domain Link MTU  Admin/Oper   Status
--------- ------------ ---------------- ---- ---- -----------  --------
a0a       Default      iSCSI-1          up   9000     -/-     healthy
a0b       Default      iSCSI-2          up   9000     -/-     healthy
e0M       Default      Default          up   1500  auto/1000  healthy
e0a       Default      CIFS             up   9000  auto/1000  healthy
e0b       Default      -                down 1500  auto/-      -
e0c       Cluster      Cluster          up   9000  auto/25000 healthy
e0d       Cluster      Cluster          up   9000  auto/25000 healthy
e2a       Default      -                up   9000  auto/10000 healthy
e2b       Default      -                up   9000  auto/10000 healthy
e2c       Default      -                up   9000  auto/10000 healthy
e2d       Default      -                up   9000  auto/10000 healthy

Detail of a specific port.

network port show -node AFF-01 -port e0M

Logical Interface (LIF), management IP addresses

One of the things that cannot be done in the web interface is changing the management IP addresses.

In the CLI, we can list the current LIFs and configured IP addresses. List all, filter in various ways, or get details (all parameters).

network interface show
network interface show -lif cluster_mgmt
network interface show -lif cluster_mgmt -instance

AFF::> network interface show -curr-port e0M

            Logical    Status     Network            Current       Current Is
Vserver     Interface  Admin/Oper Address/Mask       Node          Port    Home
----------- ---------- ---------- ------------------ ------------- ------- ----
AFF    
            AFF-A-mgmt1  up/up    10.0.0.198/24      node-a        e0M     true
            AFF-B-mgmt1  up/up    10.0.0.199/24      node-b        e0M     true
            cluster_mgmt up/up    10.0.0.200/24      node-a        e0M     true
3 entries were displayed.

We can modify the management address, but in the command we need to specify exactly which address we are setting.

network interface modify -vserver AFF -lif AFF-B-mgmt1 -home-node node-b -home-port e0M -address 10.0.0.199 -netmask 255.255.255.0
network interface modify -vserver AFF -lif cluster_mgmt -address 10.0.0.200 -netmask 255.255.255.0

Network Gateway

In order for routing to work in the network, we also need to define gateways for different subnets. The definition is done globally, we can have multiple and they are automatically assigned according to the interface address.

AFF::> network route create -vserver AFF -gateway 10.0.0.1
AFF::> network route show
AFF::> network route show -vserver AFF

Vserver             Destination     Gateway         Metric
------------------- --------------- --------------- ------
AFF
                    0.0.0.0/0       10.0.0.1        20
                    0.0.0.0/0       192.168.100.1   20
2 entries were displayed.

Viewing the Routing Table

Displays the active installed routes on one or more cluster nodes. Requires advanced (privileged) mode.

AFF::> network route active-entry show
AFF::> network route active-entry show -vserver Cluster -node AFF-01

Vserver: Cluster
Node: AFF-01
Subnet Group: 0.0.0.0/0
Destination             Gateway              Interface   Metric  Flags
----------------------  -------------------  ---------   ------  -----
127.0.0.1/32            link#3               lo0              1
127.0.10.1/32           link#3               lo0              1
127.0.20.1/32           link#3               lo0              1
169.254.0.0             link#4               e0c              7
169.254.0.0             link#5               e0d              7
169.254.131.53/32       link#4               lo0              1
169.254.229.90/32       link#5               lo0              1
7 entries were displayed.

DNS Servers

Another thing that needs to be set up are the DNS servers. Below is an example of displaying the current values and adding another address.

AFF::> vserver services dns show
                                                              Name
Vserver         State     Domains                             Servers
--------------- --------- ----------------------------------- ----------------
AFF             enabled   firma.local                         10.0.0.10
2 entries were displayed.

AFF::> vserver services dns delete -vserver AFF
AFF::> vserver services dns create -vserver AFF -domains firma.local -name-servers 10.0.0.10,10.0.0.20

Communication Testing - Ping

For testing network communication, the classic ping command can be useful, which we can execute from a specific controller or interface.

AFF::> network ping -node node-a -destination www.google.com
www.google.com is alive

AFF::> network ping -lif cluster_mgmt -vserver AFF -destination www.google.com
www.google.com is alive

Subnets

Displaying the defined subnets.

network subnet show

Creating a subnet.

network subnet create -ipspace Default -subnet-name Mgmt -broadcast-domain Mgmt -subnet 10.1.0.0/255.255.255.0 -gateway 10.1.0.1 -ip-ranges 10.1.0.10-10.1.0.100 

Displaying Port Statistics

In the nodeshell, we can display statistics for physical ports. More is described in NetApp ONTAP errors on network ports.

system node run -node AFF-02 -command ifstat e2c

IPspaces

Displaying the defined IPspaces.

AFF::> network ipspace show
IPspace             Vserver List                  Broadcast Domains
------------------- ----------------------------- ----------------------------
Cluster
                    Cluster                       Cluster
Default
                    AFF, svm-iscsi                CIFS, Default, iSCSI-1,
                                                  iSCSI-2
2 entries were displayed.

Broadcast Domains

Displaying the defined Broadcast Domains.

AFF::> network port broadcast-domain show
IPspace Broadcast                                         Update
Name    Domain Name    MTU  Port List                     Status Details
------- ----------- ------  ----------------------------- --------------
Cluster Cluster       9000
                            AFF-01:e0c                    complete
                            AFF-01:e0d                    complete
                            AFF-02:e0c                    complete
                            AFF-02:e0d                    complete
Default Default       1500
                            AFF-01:e0M                    complete
                            AFF-02:e0M                    complete
        iSCSI-1       9000
                            AFF-01:a0a                    complete
                            AFF-02:a0a                    complete
        iSCSI-2       9000
                            AFF-01:a0b                    complete
                            AFF-02:a0b                    complete
4 entries were displayed.

Failover groups

Display of defined Failover groups.

AFF::> network interface failover-groups show
                                  Failover
Vserver          Group            Targets
---------------- ---------------- --------------------------------------------
AFF
                 Default
                                  AFF-01:e0M, AFF-02:e0M
                 iSCSI-1
                                  AFF-01:a0a, AFF-02:a0a
                 iSCSI-2
                                  AFF-01:a0b, AFF-02:a0b
Cluster
                 Cluster
                                  AFF-01:e0c, AFF-01:e0d,
                                  AFF-02:e0c, AFF-02:e0d
4 entries were displayed.

System, Cluster and Interconnect

Display of cluster members

AFF::> cluster show
Node                  Health  Eligibility
--------------------- ------- ------------
AFF-01                true    true
AFF-02                true    true
2 entries were displayed.

High availability

AFF::> cluster ha show
High-Availability Configured: true

High Availability interconnect configuration

Requires advanced (privileged) mode. The type must be InfiniBand, Remote direct memory access over Converged Ethernet (RoCE).

AFF::*> system ha interconnect config show

                       Node: AFF-01
          Interconnect Type: RoCE
            Local System ID: 536875713
          Partner System ID: 536875678
       Connection Initiator: local
                  Interface: external

Port   IP Address
----   -----------------
e0c-17
       169.254.17.161
e0d-18
       169.254.18.222


                       Node: AFF-02
          Interconnect Type: RoCE
            Local System ID: 536875678
          Partner System ID: 536875713
       Connection Initiator: partner
                  Interface: external

Port   IP Address
----   -----------------
e0c-17
       169.254.17.192
e0d-18
       169.254.18.143

2 entries were displayed.

High Availability interconnect ports

AFF::*> system ha interconnect port show
                               Physical  Link
                Link           Layer     Layer      Physical   Physical  Active
Node            Monitor  Port  State     State       Link Up  Link Down  Link
--------------  -------  ----  --------  ---------  --------  ---------  ------
AFF-01          off
                            0  linkup    active            2          2  true
                            1  linkup    active            2          2  true
AFF-02          off
                            0  linkup    active            4          4  true
                            1  linkup    active            4          4  true
2 entries were displayed.

High Availability interconnect status

AFF::*> system ha interconnect status show

                       Node: AFF-01
              Link 0 Status: up
              Link 1 Status: up
           Is Link 0 Active: true
           Is Link 1 Active: true
         IC RDMA Connection: up

                       Node: AFF-02
              Link 0 Status: up
              Link 1 Status: up
           Is Link 0 Active: true
           Is Link 1 Active: true
         IC RDMA Connection: up
2 entries were displayed.

Storage failover

AFF::> storage failover show
                              Takeover          
Node           Partner        Possible State Description  
-------------- -------------- -------- -------------------
AFF-01         AFF-02         true     Connected to AFF-02
AFF-02         AFF-01         true     Connected to AFF-01
2 entries were displayed. 

During the restart of one node.

AFF::> storage failover show
                              Takeover          
Node           Partner        Possible State Description  
-------------- -------------- -------- ----------------------------------
AFF-01         AFF-02         -        Unknown
AFF-02         AFF-01         false    In takeover, Auto giveback will be
                                       initiated in 442 seconds
2 entries were displayed. 

Cluster replication ring

cluster ring show

Cluster kernel service status

AFF::> cluster kernel-service show
Master     Cluster    Quorum        Availability  Operational
Node       Node       Status        Status        Status
---------- ---------- ------------- ------------- -------------
AFF-02     AFF-01     in-quorum     true          operational
           AFF-02     in-quorum     true          operational
2 entries were displayed.

Disks and aggregates

Display of aggregate information

Brief list of aggregates

storage aggregate show

Details about a specific aggregate

storage aggregate show -aggregate aggr_data1

Display of disk information

List of disks including type, aggregates on disk, etc.

storage disk show

Detail of a specific volume.

storage disk show -disk 1.0.0

Information about disk partitions and controller ownership.

storage disk show -partition-ownership

Display of spare disks

The output shows that ADP v2 (Root-Data1-Data2) is used. Spare disks are displayed for each controller (Node). It is necessary to check that there is space for Root (Local Root Usable) and Data (Local Data Usable).

AFF::> storage aggregate show-spare-disks

Original Owner: node-a
 Pool0
  Root-Data1-Data2 Partitioned Spares
                                                              Local    Local
                                                               Data     Root Physical
 Disk             Type   Class          RPM Checksum         Usable   Usable     Size Status
 ---------------- ------ ----------- ------ -------------- -------- -------- -------- --------
 1.0.23           SSD    solid-state      - block            1.73TB  31.19GB   3.49TB zeroed

Original Owner: node-b
 Pool0
  Root-Data1-Data2 Partitioned Spares
                                                              Local    Local
                                                               Data     Root Physical
 Disk             Type   Class          RPM Checksum         Usable   Usable     Size Status
 ---------------- ------ ----------- ------ -------------- -------- -------- -------- --------
 1.0.8            SSD    solid-state      - block                0B  31.19GB   3.49TB zeroed
 1.0.23           SSD    solid-state      - block            1.73TB       0B   3.49TB zeroed
3 entries were displayed.

Creation of an aggregate

storage aggregate create -aggregate aggr_data2 -diskcount 23 -node node-b

Clearing spare disks

storage disk zerospares -owner node-b

Volumes and LUNs

Display of volume information

List of volumes including aggregate, status, size, etc.

volume show

Detail of a specific volume.

volume show -vserver svm-iscsi_ -volume svm_iscsi_root

Display of LUN information

List of LUNs including type, status, size, etc.

lun show

Detail of a specific LUN.

lun show -vserver svm-iscsi -path /vol/Servers_vol_01/Servers_lun_01

Bringing an offline LUN online

If a LUN runs out of space, it is taken offline to protect the data. It switches to the `space-error` state. If we solve the problem, we need to bring it back online.

lun modify -path /vol/Servers_vol_01/Servers_lun_01 -state online

Purging the recovery queue

If we delete a Volume, the space in the aggregate is not immediately freed up. For some time, the Volume can be restored. If we need the space right away, we can remove it completely. Free Aggregate space is not returning after deleting Volumes - NetApp Knowledge Base

First, we list the queue, then there is the option to delete everything or a specific Volume.

set -privilege diagnostic
volume recovery-queue show -vserver <vserver name>
volume recovery-queue purge-all -vserver <vserver_name>
volume recovery-queue purge -vserver <vserver_name> -volume <volume name>

Display of storage efficiency information

Described in more detail at the end of the article NetApp ONTAP Components, Principles and Features.

volume efficiency config
volume efficiency show
volume efficiency show -instance
volume show -vserver svm-iscsi -volume Server_vol_01
volume show-footprint
storage aggregate efficiency cross-volume-dedupe show 
storage aggregate show-efficiency -advanced
storage aggregate show-efficiency 
storage aggregate show-efficiency -details 
storage aggregate show-space

Storage VM (SVM) - vServer

Display of SVM information

List of SVMs.

AFF::> vserver show
                               Admin      Operational Root
Vserver     Type    Subtype    State      State       Volume     Aggregate
----------- ------- ---------- ---------- ----------- ---------- ----------
AFF         admin   -          -          -           -          -
AFF-01      node    -          -          -           -          -
AFF-02      node    -          -          -           -          -
svm-iscsi   data    default    running    running     svm_iscsi_ AFF_01_NVME
                                                      root       _SSD_1
4 entries were displayed. 

Detail of a specific SVM.

vserver show -vserver svm-iscsi

Changing the iSCSI Target Name (IQN) on the vServer

vserver iscccsi modify

Setting the privilege level in the CLI.

AFF::> set -privilege advanced

Warning: These advanced commands are potentially dangerous; use them only when directed to do
         so by NetApp personnel.
Do you want to continue? {y|n}: y

AFF::*> vserver iscsi stop -vserver svm-iscsi
AFF::*> vserver iscsi modify -vserver svm-iscsi -target-name iqn.1992-08.com.netapp:AFF
AFF::*> vserver iscsi start -vserver svm-iscsi

Events and alerts

More is described in NetApp ONTAP EMS events, notifications, monitoring of filling.

Displaying events (logs)

event log show
event log show -severity <=NOTICE
event log show -message-name monitor.volume.nearlyFull
event log show -time >10m

Sending notifications (events) by email

event config modify -mail-server SERVER -mail-from EMAIL@COMPANY.COM
event notification destination create -name ADMIN1 -email RECIPIENT1@COMPANY.COM
event notification create -filter-name important-events -destinations ADMIN1
Author:

Related articles:

NetApp ONTAP

Articles that relate to NetApp All Flash FAS (AFF) and Fabric-Attached Storage (FAS) disk arrays with the ONTAP operating system.

Computer Storage

Data storage is a vast and complex issue in the computer world. Here you will find articles dedicated to Storage Area Networks (SAN), iSCSI technologies, Fiber Channel, disk arrays (Storage System, Disk Srray) and data storage and storage in general.

If you want write something about this article use comments.

Comments

There are no comments yet.

Add comment

Insert tag: strong em link

Help:
  • maximum length of comment is 2000 characters
  • HTML tags are not allowed (they will be removed), you can use only the special tags listed above the input field
  • new line (ENTER) ends paragraph and start new one
  • when you respond to a comment, put the original comment number in squar brackets at the beginning of the paragraph (line)