Home / Reference / CLI Cheat Sheet

ONTAP CLI Cheat Sheet

The commands admins type daily, grouped by job. Targets ONTAP 9.x. Use man <command> on the system for full flags; set -privilege advanced unlocks the rest.

Common ONTAP CLI commands

Cluster & node

CommandWhat it does
cluster showCluster name, version, nodes, UUID
node showList nodes and their state
node show -fields model,serial-number,ownerHardware identity
cluster peer create -peer-cluster X -peer-intercluster-lifs a,bPeer two clusters (prerequisite for SnapMirror)
cluster peer showPeering status
system node image show / cluster image showInstalled ONTAP images/versions
system license showLicensed features

SVM (vserver)

CommandWhat it does
vserver showAll SVMs, type (admin/data), state
vserver create -vserver vs1 -rootvolume rootvol1 -rootaggregate aggr1 -allowed-protocols nfsCreate a data SVM
vserver modify -vserver vs1 -allowed-protocols nfs,smbAdd protocols to an SVM
vserver delete -vserver vs1Delete an SVM (must be empty first)

Aggregates & disks

CommandWhat it does
storage aggregate showAggregates: size, used, raid type, disks
storage aggregate show -fields percent-usedUtilization (capacity monitoring)
storage aggregate create -aggregate aggr1 -diskcount 11 -raidtype raid_dpCreate aggregate (data disks + spares auto)
storage aggregate add-disks -aggregate aggr1 -diskcount 4Grow an aggregate online
storage aggregate online/offline/destroyLifecycle control (destroy = data loss)
storage disk showDisk inventory/state
storage shelf showShelf/disk-shelf state

Volumes

CommandWhat it does
volume create -vserver vs1 -volume vol1 -aggregate aggr1 -size 1tCreate FlexVol (add -type flexgroup + -aggregate-list for FlexGroup)
volume show -fields volume,aggregate,size,used,percent-usedVolume inventory + utilization
volume modify -vserver vs1 -volume vol1 -size 1.5tGrow (or shrink) a volume online
volume move start -vserver vs1 -volume vol1 -destination-aggregate aggr2Nondisruptive volume move
volume clone create -vserver vs1 -clone clone1 -parent-volume vol1Instant space-efficient clone
volume offline/online/destroyLifecycle control
volume show -fields junction-pathNamespace mount point

Snapshots

CommandWhat it does
snapshot create -vserver vs1 -volume vol1 -snapshot pre_patchManual snapshot
snapshot show -vserver vs1 -volume vol1List snapshots + sizes
snapshot delete -vserver vs1 -volume vol1 -snapshot oldDelete (frees space)
snapshot restore -vserver vs1 -volume vol1 -snapshot pre_patchRoll volume back (destructive to newer data)
snapshot policy showSchedules + retention
volume modify -vserver vs1 -volume vol1 -snapshot-reserve 10Change snapshot reserve
snapshot autodelete show -vserver vs1 -volume vol1Autodelete config (space safety net)

Networking

CommandWhat it does
network interface showLIFs, roles, addresses, failover state
network interface create -vserver vs1 -lif data1 -role data -data-protocol nfs -home-node node1 -home-port e0c -address 10.0.0.5 -netmask 255.255.255.0Create data LIF
network interface modify -vserver vs1 -lif data1 -home-node node2Change home/failover target
network route show -vserver vs1SVM routing
network port show -fields link,duplex,speedPhysical port health
ifgrp create -node node1 -ifgrp a0a -mode multimode_lacpCreate port channel (then add ports)
vlan create -node node1 -vlan-name e0c-100Create VLAN on a port
network ping-lif -vserver vs1 -lif data1Test LIF reachability from the cluster

NFS

CommandWhat it does
vserver nfs show -vserver vs1NFS state + versions enabled
vserver nfs enable -vserver vs1Enable NFS on the SVM
vserver export-policy rule show -vserver vs1 -policy defaultExport rules
vserver export-policy rule create -vserver vs1 -policy default -v4client 10.1.0.0/16 -protocol nfs -rorule sys -rwrule sysAllow a subnet to mount
vserver export-policy check-access -vserver vs1 -client-ip X -volume vol1 -authentication-method sysTest what a client can do (golden troubleshooting command)

SMB/CIFS

CommandWhat it does
vserver cifs create -vserver vs1 -cifs-server FS1 -domain ad.example.comJoin SVM to AD
vserver cifs show -vserver vs1CIFS server status
vserver cifs share create -vserver vs1 -share-name data -path /dataCreate a share
vserver cifs share show -vserver vs1List shares
vserver cifs share access-control show -vserver vs1 -share dataShare-level ACLs

S3

CommandWhat it does
vserver object-store-server create -vserver vs1 -object-store-server-name s3svm -root-user root -root-password P@ssCreate S3 object store server
vserver object-store-server showStatus/config
vserver object-store-server bucket create -vserver vs1 -bucket backupsCreate a bucket
vserver object-store-server bucket showList buckets

SAN (FC / iSCSI / NVMe)

CommandWhat it does
vserver fcp create -vserver vs1 / vserver iscsi create -vserver vs1Enable SAN protocol on SVM
lun create -vserver vs1 -volume lunvol -lun /vol/lunvol/lun0 -size 2t -ostype linuxCreate a LUN
lun showLUN inventory
igroup create -vserver vs1 -igroup host1 -protocol iscsi -initiator iqn.1994-05.com.example:host1Create initiator group
lun map -vserver vs1 -path /vol/lunvol/lun0 -igroup host1 -lun-id 0Map LUN to host
iscsi initiator show / fcp initiator showConnected initiators
vserver iscsi connection show -vserver vs1Active iSCSI sessions

Data protection (SnapMirror / SnapVault)

CommandWhat it does
vserver peer create -vserver vs1 -peer-vserver vsB -peer-cluster clusterBPeer SVMs (after cluster peering)
snapmirror create -source-path vs1:vol1 -destination-path vsB:volB -type XDP -policy DPDefault -schedule hourlyAsync replication relationship
snapmirror initialize -destination-path vsB:volBFirst full transfer
snapmirror show -fields state,status,lag-time,last-transfer-endHealth + lag (monitoring staple)
snapmirror update -destination-path vsB:volBManual incremental transfer
snapmirror break -destination-path vsB:volBMake destination writable (DR failover)
snapmirror resync -destination-path vs1:vol1Re-establish after break (watch direction!)
snapmirror restore -source-path vsB:volB -destination-path vs1:vol1Restore destination data to source
snapmirror policy showReplication/vault policies

Storage efficiency

CommandWhat it does
volume efficiency on -volume vol1Enable dedupe/compression
volume efficiency show -volume vol1Savings + scan status
volume efficiency modify -volume vol1 -schedule sun@2:00Reschedule scans
volume show -fields logical-used,logical-space-usedLogical vs physical (savings view)
volume modify -vserver vs1 -volume vol1 -space-guarantee noneThin-provision a volume

QoS

CommandWhat it does
qos policy-group create -policy-group pg1 -vserver vs1 -max-throughput 10000IOPS,500MBpsFixed limits
qos adaptive-policy-group create -name apg1 -vserver vs1 -expected-iops-per-tb 500 -peak-iops-per-tb 1000Size-scaled limits (AQoS)
volume modify -vserver vs1 -volume vol1 -qos-policy-group pg1Assign to volume
qos statistics volume show -interval 5Per-volume latency/throughput

Security & access

CommandWhat it does
security login create -vserver vs1 -user-or-group-name ops -application ssh -authmethod passwordCreate a user
security login showUsers + auth methods
security role show -vserver vs1RBAC roles
security key-manager onboard showOnboard key manager status (encryption)
volume show -fields encryptionWhich volumes are encrypted (NVE/NAE)

HA & MetroCluster

CommandWhat it does
storage failover showHA pair state
storage failover takeover -ofnode node2Planned takeover (maintenance)
storage failover giveback -ofnode node2Return storage to home node
metrocluster showMetroCluster configuration
metrocluster check runValidate readiness (pre-maintenance)
metrocluster switchover / metrocluster switchbackSite failover / return

Operations & monitoring

CommandWhat it does
event log show -severity ERROR -time ">now-24h"Recent errors
system health alert showHardware alerts
job showRunning/completed jobs
system node run -node node1 -command sysstat -M 1 10Live node perf (CPU/ops/disk util)
statistics start -sample-id s1 -object system:nodestatistics show -sample-id s1statistics stop -sample-id s1Collect perf counters
autosupport show / autosupport invoke -node node1 -type testAutoSupport status / send test
man <command>Built-in man pages — always available, always current
Pro tip set -showallfields true shows every field in * show output — great for scripting; set -units GB changes display units. And ? after any command shows available options.

← Reference index