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.
Cluster & node
| Command | What it does |
|---|---|
cluster show | Cluster name, version, nodes, UUID |
node show | List nodes and their state |
node show -fields model,serial-number,owner | Hardware identity |
cluster peer create -peer-cluster X -peer-intercluster-lifs a,b | Peer two clusters (prerequisite for SnapMirror) |
cluster peer show | Peering status |
system node image show / cluster image show | Installed ONTAP images/versions |
system license show | Licensed features |
SVM (vserver)
| Command | What it does |
|---|---|
vserver show | All SVMs, type (admin/data), state |
vserver create -vserver vs1 -rootvolume rootvol1 -rootaggregate aggr1 -allowed-protocols nfs | Create a data SVM |
vserver modify -vserver vs1 -allowed-protocols nfs,smb | Add protocols to an SVM |
vserver delete -vserver vs1 | Delete an SVM (must be empty first) |
Aggregates & disks
| Command | What it does |
|---|---|
storage aggregate show | Aggregates: size, used, raid type, disks |
storage aggregate show -fields percent-used | Utilization (capacity monitoring) |
storage aggregate create -aggregate aggr1 -diskcount 11 -raidtype raid_dp | Create aggregate (data disks + spares auto) |
storage aggregate add-disks -aggregate aggr1 -diskcount 4 | Grow an aggregate online |
storage aggregate online/offline/destroy | Lifecycle control (destroy = data loss) |
storage disk show | Disk inventory/state |
storage shelf show | Shelf/disk-shelf state |
Volumes
| Command | What it does |
|---|---|
volume create -vserver vs1 -volume vol1 -aggregate aggr1 -size 1t | Create FlexVol (add -type flexgroup + -aggregate-list for FlexGroup) |
volume show -fields volume,aggregate,size,used,percent-used | Volume inventory + utilization |
volume modify -vserver vs1 -volume vol1 -size 1.5t | Grow (or shrink) a volume online |
volume move start -vserver vs1 -volume vol1 -destination-aggregate aggr2 | Nondisruptive volume move |
volume clone create -vserver vs1 -clone clone1 -parent-volume vol1 | Instant space-efficient clone |
volume offline/online/destroy | Lifecycle control |
volume show -fields junction-path | Namespace mount point |
Snapshots
| Command | What it does |
|---|---|
snapshot create -vserver vs1 -volume vol1 -snapshot pre_patch | Manual snapshot |
snapshot show -vserver vs1 -volume vol1 | List snapshots + sizes |
snapshot delete -vserver vs1 -volume vol1 -snapshot old | Delete (frees space) |
snapshot restore -vserver vs1 -volume vol1 -snapshot pre_patch | Roll volume back (destructive to newer data) |
snapshot policy show | Schedules + retention |
volume modify -vserver vs1 -volume vol1 -snapshot-reserve 10 | Change snapshot reserve |
snapshot autodelete show -vserver vs1 -volume vol1 | Autodelete config (space safety net) |
Networking
| Command | What it does |
|---|---|
network interface show | LIFs, 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.0 | Create data LIF |
network interface modify -vserver vs1 -lif data1 -home-node node2 | Change home/failover target |
network route show -vserver vs1 | SVM routing |
network port show -fields link,duplex,speed | Physical port health |
ifgrp create -node node1 -ifgrp a0a -mode multimode_lacp | Create port channel (then add ports) |
vlan create -node node1 -vlan-name e0c-100 | Create VLAN on a port |
network ping-lif -vserver vs1 -lif data1 | Test LIF reachability from the cluster |
NFS
| Command | What it does |
|---|---|
vserver nfs show -vserver vs1 | NFS state + versions enabled |
vserver nfs enable -vserver vs1 | Enable NFS on the SVM |
vserver export-policy rule show -vserver vs1 -policy default | Export rules |
vserver export-policy rule create -vserver vs1 -policy default -v4client 10.1.0.0/16 -protocol nfs -rorule sys -rwrule sys | Allow a subnet to mount |
vserver export-policy check-access -vserver vs1 -client-ip X -volume vol1 -authentication-method sys | Test what a client can do (golden troubleshooting command) |
SMB/CIFS
| Command | What it does |
|---|---|
vserver cifs create -vserver vs1 -cifs-server FS1 -domain ad.example.com | Join SVM to AD |
vserver cifs show -vserver vs1 | CIFS server status |
vserver cifs share create -vserver vs1 -share-name data -path /data | Create a share |
vserver cifs share show -vserver vs1 | List shares |
vserver cifs share access-control show -vserver vs1 -share data | Share-level ACLs |
S3
| Command | What it does |
|---|---|
vserver object-store-server create -vserver vs1 -object-store-server-name s3svm -root-user root -root-password P@ss | Create S3 object store server |
vserver object-store-server show | Status/config |
vserver object-store-server bucket create -vserver vs1 -bucket backups | Create a bucket |
vserver object-store-server bucket show | List buckets |
SAN (FC / iSCSI / NVMe)
| Command | What it does |
|---|---|
vserver fcp create -vserver vs1 / vserver iscsi create -vserver vs1 | Enable SAN protocol on SVM |
lun create -vserver vs1 -volume lunvol -lun /vol/lunvol/lun0 -size 2t -ostype linux | Create a LUN |
lun show | LUN inventory |
igroup create -vserver vs1 -igroup host1 -protocol iscsi -initiator iqn.1994-05.com.example:host1 | Create initiator group |
lun map -vserver vs1 -path /vol/lunvol/lun0 -igroup host1 -lun-id 0 | Map LUN to host |
iscsi initiator show / fcp initiator show | Connected initiators |
vserver iscsi connection show -vserver vs1 | Active iSCSI sessions |
Data protection (SnapMirror / SnapVault)
| Command | What it does |
|---|---|
vserver peer create -vserver vs1 -peer-vserver vsB -peer-cluster clusterB | Peer SVMs (after cluster peering) |
snapmirror create -source-path vs1:vol1 -destination-path vsB:volB -type XDP -policy DPDefault -schedule hourly | Async replication relationship |
snapmirror initialize -destination-path vsB:volB | First full transfer |
snapmirror show -fields state,status,lag-time,last-transfer-end | Health + lag (monitoring staple) |
snapmirror update -destination-path vsB:volB | Manual incremental transfer |
snapmirror break -destination-path vsB:volB | Make destination writable (DR failover) |
snapmirror resync -destination-path vs1:vol1 | Re-establish after break (watch direction!) |
snapmirror restore -source-path vsB:volB -destination-path vs1:vol1 | Restore destination data to source |
snapmirror policy show | Replication/vault policies |
Storage efficiency
| Command | What it does |
|---|---|
volume efficiency on -volume vol1 | Enable dedupe/compression |
volume efficiency show -volume vol1 | Savings + scan status |
volume efficiency modify -volume vol1 -schedule sun@2:00 | Reschedule scans |
volume show -fields logical-used,logical-space-used | Logical vs physical (savings view) |
volume modify -vserver vs1 -volume vol1 -space-guarantee none | Thin-provision a volume |
QoS
| Command | What it does |
|---|---|
qos policy-group create -policy-group pg1 -vserver vs1 -max-throughput 10000IOPS,500MBps | Fixed limits |
qos adaptive-policy-group create -name apg1 -vserver vs1 -expected-iops-per-tb 500 -peak-iops-per-tb 1000 | Size-scaled limits (AQoS) |
volume modify -vserver vs1 -volume vol1 -qos-policy-group pg1 | Assign to volume |
qos statistics volume show -interval 5 | Per-volume latency/throughput |
Security & access
| Command | What it does |
|---|---|
security login create -vserver vs1 -user-or-group-name ops -application ssh -authmethod password | Create a user |
security login show | Users + auth methods |
security role show -vserver vs1 | RBAC roles |
security key-manager onboard show | Onboard key manager status (encryption) |
volume show -fields encryption | Which volumes are encrypted (NVE/NAE) |
HA & MetroCluster
| Command | What it does |
|---|---|
storage failover show | HA pair state |
storage failover takeover -ofnode node2 | Planned takeover (maintenance) |
storage failover giveback -ofnode node2 | Return storage to home node |
metrocluster show | MetroCluster configuration |
metrocluster check run | Validate readiness (pre-maintenance) |
metrocluster switchover / metrocluster switchback | Site failover / return |
Operations & monitoring
| Command | What it does |
|---|---|
event log show -severity ERROR -time ">now-24h" | Recent errors |
system health alert show | Hardware alerts |
job show | Running/completed jobs |
system node run -node node1 -command sysstat -M 1 10 | Live node perf (CPU/ops/disk util) |
statistics start -sample-id s1 -object system:node … statistics show -sample-id s1 … statistics stop -sample-id s1 | Collect perf counters |
autosupport show / autosupport invoke -node node1 -type test | AutoSupport 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.