In the first article in our series, we took a tour of how to navigate and use the CLI with Data ONTAP 7-Mode. Today we’re going to dive into the CLI for clustered Data ONTAP where it gets a lot more fun!
Commands, Navigation, and Privilege Levels
Logging in (via SSH or console – telnet is disabled by default and strongly discouraged) you are provided a simple administrative-level prompt:
cdot_mba1::>
The prompt contains the name of the cluster (“cdot_mba1”) followed by a “::>” which indicates that you are in the cluster shell, at the root of the command tree (more on that in a moment) and at the normal administrative privilege level.
From here, you can see the available command structure by simply typing “?”:
cdot_mba1::> ? up Go up one directory cluster> Manage clusters dashboard> Display dashboards event> Manage system events exit Quit the CLI session history Show the history of commands for this CLI session job> Manage jobs and job schedules lun> Manage LUNs man Display the on-line manual pages network> Manage physical and virtual network connections qos> QoS settings redo Execute a previous command rows Show/Set the rows for this CLI session run Run interactive or non-interactive commands in the node shell security> The security directory set Display/Set CLI session settings sis Manage volume efficiency snapmirror> Manage SnapMirror statistics> Display operational statistics storage> Manage physical storage, including disks, aggregates, and failover system> The system directory top Go to the top-level directory volume> Manage virtual storage, including volumes, snapshots, and mirrors vserver> Manage Vservers
You can already see that this is quite a bit different from 7-mode. The commands are organized into a tree which you can navigate similarly to a directory structure. The ">" at the end indicates this is a directory, or context, into which you can further explore. At each level, you can use "?" to display the commands or sub-contexts available.
cdot_mba1::> storage
cdot_mba1::storage> ?
aggregate> Manage storage aggregates
array> The array directory
disk> Manage physical disks
errors> The errors directory
failover> Manage storage failover
library> The library directory
load> The load directory
path> The path directory
raid-options> The raid-options directory
cdot_mba1::storage>
You can also simply tab to display a more concise view of your options. And yes, that means that tab completion is included in the shell!
cdot_mba1::storage>
aggregate array disk errors failover
library load path raid-options
cdot_mba1::storage> aggregate
add-disks create delete modify
offline online raidtype relocation
rename restrict scrub show
show-scrub-status show-space
cdot_mba1::storage> aggregate show -aggregate aggr0
We'll circle back to tab completion later, but did you notice how the prompt has now changed? The current command sub-directory is now displayed within the prompt following the "::". This provides you with visual breadcrumbs for what context you're operating in and where in the command tree you are currently.
cdot_mba1::storage> aggregate
cdot_mba1::storage aggregate> ?
add-disks Add disks to an aggregate
create Create an aggregate
delete Delete an aggregate
modify Modify aggregate attributes
offline Offline an aggregate
online Online an aggregate
raidtype> The raidtype directory
relocation> Manage aggregate relocation
rename Rename an aggregate
restrict Restrict an aggregate
scrub Aggregate parity scrubbing
show Display a list of aggregates
show-scrub-status Display aggregate scrubbing status
show-space Display details of space utilization within an aggregate.
cdot_mba1::storage aggregate> raidtype
cdot_mba1::storage aggregate raidtype>
Ok, going down through the directory is easy, but what about going back up? There's actually several different options. You can simply say that you want to go up a level:
cdot_mba1::storage aggregate raidtype> up
cdot_mba1::storage aggregate>
You can say that you want to go all the way back to the top no matter how far down you are:
cdot_mba1::storage aggregate> top
cdot_mba1::>
Or you can do a standard "change directory" or cd
:
cdot_mba1::storage> cd ..
cdot_mba1::>
You can also jump around within the tree either using cd
or simply entering the context to which you want to change.
cdot_mba1::> volume
cdot_mba1::volume> cd aggregate
cdot_mba1::storage aggregate> volume
cdot_mba1::volume>
Just like 7-mode Data ONTAP, there are two additional privilege levels available: advanced and diag. You can change to these levels using the set -privilege
command.
cdot_mba1::> 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 cdot_mba1::*> set -privilege diagnostic Warning: These diagnostic commands are for use by NetApp personnel only. Do you want to continue? {y|n}: y cdot_mba1::*>
The asterisk after the "::" indicates that you are in either advanced or diag privilege mode, and there is unfortunately no visual distinction between the two modes.
More commands are available within the higher privilege levels than in the normal admin level, though because of the organization of the command tree they do not stand out as much as they do in 7-mode.
Advanced:
up Go up one directory
cluster> Manage clusters
dashboard> Display dashboards
event> Manage system events
exit Quit the CLI session
history Show the history of commands for this CLI session
job> Manage jobs and job schedules
lun> Manage LUNs
man Display the on-line manual pages
network> Manage physical and virtual network connections
qos> QoS settings
redo Execute a previous command
rows Show/Set the rows for this CLI session
run Run interactive or non-interactive commands in the node shell
security> The security directory
set Display/Set CLI session settings
sis Manage volume efficiency
snapmirror> Manage SnapMirror
statistics> Display operational statistics
storage> Manage physical storage, including disks, aggregates, and failover
system> The system directory
top Go to the top-level directory
volume> Manage virtual storage, including volumes, snapshots, and mirrors
vserver> Manage Vservers
Diag:
up Go up one directory
cluster> Manage clusters
dashboard> Display dashboards
diag> *The diag directory
event> Manage system events
exit Quit the CLI session
history Show the history of commands for this CLI session
job> Manage jobs and job schedules
logger> *Management logger
lun> Manage LUNs
man Display the on-line manual pages
network> Manage physical and virtual network connections
qos> QoS settings
redo Execute a previous command
repository> *Manage a content repository
rows Show/Set the rows for this CLI session
run Run interactive or non-interactive commands in the node shell
security> The security directory
set Display/Set CLI session settings
sis Manage volume efficiency
snapmirror> Manage SnapMirror
spm> *Service Process Manager
statistics> Display operational statistics
storage> Manage physical storage, including disks, aggregates, and failover
system> The system directory
top Go to the top-level directory
volume> Manage virtual storage, including volumes, snapshots, and mirrors
vserver> Manage Vservers
Changing between privilege levels is always done the same way, even when going back down from a higher level to the admin level:
cdot_mba1::*> set -privilege admin
cdot_mba1::>
Command Syntax and Help
You can see the syntax for a command by passing it the "-?" flag, but only at the appropriate level.
cdot_mba1::> storage -? Error: "-" is not a recognized command cdot_mba1::> storage aggregate -? Error: "-" is not a recognized command cdot_mba1::> storage aggregate show -? [ -checksum | -disk | -instance | -raid-info | -fields , ... ] [[-aggregate] ] Aggregate [ -chksumstyle ] Checksum Style [ -diskcount ] Number Of Disks [ -nodes , ... ] Nodes [ -disklist|-d , ... ] Disks [ -free-space-realloc {on|off|no_redirect} ] Free Space Reallocation [ -ha-policy {sfo|cfo} ] HA Policy [ -percent-snapshot-space ] Space Reserved for Snapshot Copies [ -hybrid-enabled {true|false} ] Hybrid Enabled [ -availsize {[KB|MB|GB|TB|PB]} ] Available Size [ -chksumenabled {true|false} ] Checksum Enabled [ -chksumstatus ] Checksum Status [ -has-mroot {true|false} ] Has Mroot Volume [ -has-partner-mroot {true|false} ] Has Partner Node Mroot Volume [ -home-id ] Home ID [ -home-name ] Home Name [ -hybrid-cache-size-total {[KB|MB|GB|TB|PB]} ] Total Hybrid Cache Size [ -hybrid {true|false} ] Hybrid [ -inconsistent {true|false} ] Inconsistent [ -is-home {true|false} ] Is Aggregate Home [ -maxraidsize|-s ] Max RAID Size [ -cache-raid-group-size ] Flash Pool SSD Tier Maximum RAID Group Size [ -owner-id ] Owner ID [ -owner-name ] Owner Name [ -percent-used ] Used Percentage [ -plexes , ... ] Plexes [ -raidgroups , ... ] RAID Groups [ -raidstatus ] RAID Status [ -raidtype|-t {raid_dp|raid4} ] RAID Type [ -root {true|false} ] Is Root [ -sis-metadata-space-used {[KB|MB|GB|TB|PB]} ] Space Used by Metadata for Volume Efficiency [ -size {[KB|MB|GB|TB|PB]} ] Size [ -state ] State [ -usedsize {[KB|MB|GB|TB|PB]} ] Used Size [ -volcount ] Number Of Volumes [ -volume-style ] Volume Style cdot_mba1::> storage aggregate show -
In this example, it's not until you get to the third word of the command that you are able to use the "-?" to display the parameters. This is because the first two words were actually directories or contexts (you may recall that both displayed the trailing ">" when we were navigating above) rather than actionable commands. It's that action that is key: you can't issue a command without specifying what it is you want done. Nouns alone won't cut it - you need to use a verb. So a command in the cluster shell will generally always end in a verb (show, create, delete, modify, etc.) and it is then that you can specify the appropriate parameters.
Where it gets even better are the manual (man) pages for clustered Data ONTAP. Similar to 7-mode, administrative-level commands have man page available explaining the operation of the command in detail:
cdot_mba1::> man system system Data ONTAP 8.2 system NAME system -- The system directory DESCRIPTION The system commands enable you to monitor and control cluster nodes. SUBDIRECTORIES health> - System Health Management and Diagnosis commands license> - Manage licenses node> - The system node directory script> - Capture CLI session to a file for later upload. Analogous to the unix 'script' command services> - Manage system services smtape> - Manage SMTape operations snmp> - The snmp directory timeout> - Manage the timeout value for CLI sessions Data ONTAP 8.2 -o- Data ONTAP 8.2
A key difference here is that you won't have to look at a single man page covering the entire command - or command directory/context - which may run on for many pages of output (some of the man pages might be more accurately described as man books). Instead, you can specify exactly at which level of the command you are looking for more information.
cdot_mba1::> man system health system health Data ONTAP 8.2 system health NAME system health -- System Health Management and Diagnosis commands DESCRIPTION System Health Management and Diagnosis commands SUBDIRECTORIES alert> - The alert directory autosupport> - The autosupport directory chassis> - Chassis health monitor directory cluster-switch> - The cluster-switch directory config> - The config directory controller> - Controller health monitor directory node-connectivity> - Node storage connectivity health monitor directory policy> - The policy directory status> - The status directory subsystem> - The subsystem directory system-connectivity> - System storage connectivity health monitor directory Data ONTAP 8.2 -o- Data ONTAP 8.2 cdot_mba1::> man system health status show system health status show Data ONTAP 8.2 system health status show NAME system health status show -- Display system health monitoring status AVAILABILITY This command is available to cluster administrators at the admin privilege level. DESCRIPTION The system health status show command displays the health monitor status. The possible states are: o ok o ok-with-suppressed o degraded o unreachable PARAMETERS None EXAMPLES This example displays information about health monitoring status: +---------------------------------------------------------------------------------+ | | | | | cluster1::> system health status show | | Status | | --------------- | | degraded | | | +---------------------------------------------------------------------------------+ Data ONTAP 8.2 -o- Data ONTAP 8.2
Command Completion
As noted previously, tab completion is built into the cluster shell so rather than having to fully type out storage aggregate
you can type st
[TAB]ag
[TAB] instead to have the shell auto-complete the commands for you.
You can also abbreviate the commands rather than tab completing them:
cdot_mba1::> st ag sh
Error: Ambiguous command. Possible matches include:
storage aggregate show
storage aggregate show-scrub-status
storage aggregate show-space
cdot_mba1::> st ag show
(storage aggregate show)
Aggregate Size Available Used% State #Vols Nodes RAID Status
--------- -------- --------- ----- ------- ------ ---------------- ------------
aggr0 900MB 43.54MB 95% online 1 cdot_mba1-01 raid_dp,
normal
cdot_mba1::>
As you can see, abbreviation will only work if the abbreviation is unique, but even when it isn't, the shell will show you the possible options in order to make it easier for you to complete the desired command. The uniqueness of the abbreviation is key and is similar to one of the navigation tricks above: you don't necessarily need to provide the entire path of the command as long as the abbreviated command is unique:
cdot_mba1::> ag show (aggr) Aggregate Size Available Used% State #Vols Nodes RAID Status --------- -------- --------- ----- ------- ------ ---------------- ------------ aggr0 900MB 43.54MB 95% online 1 cdot_mba1-01 raid_dp, normal cdot_mba1::>
You can also easily find where sub-commands or actions are available throughout the command tree simply by typing the word and hitting [Enter]:
cdot_mba1::> status Error: Ambiguous command. Possible matches include: system services manager status system health status vserver nfs status vserver services ndmp status system services ndmp status system license status volume clone split status event status volume file clone status system smtape status system services ndmp node-scope-mode status system node coredump status system node coredump segment status cdot_mba1::> health Error: Ambiguous command. Possible matches include: system health vserver dashboard health dashboard health cluster peer health
This can be a great way to explore the various nooks & crannies of the CLI - there's a lot there to look at!
Navigation and Editing
Command-line editing and navigation utilizes the standard keystrokes and combination previously discussed in CLI Efficiency: Common Basics
You can navigate through your previously-entered commands using the up and down arrows, or Ctrl+n and Ctrl+p, or you can now use the history
command to simply display the contents of that history.
cdot_mba1::> history 1 stor aggr show 2 man syste 3 man systm health status 4 history 5 vol show
You can enter multiple commands on the same command line by separating each command with a semi-colon. The commands will then be executed in order of entry.
cdot_mba1::> stor aggr show; vol show (storage aggregate show) Aggregate Size Available Used% State #Vols Nodes RAID Status --------- -------- --------- ----- ------- ------ ---------------- ------------ aggr0 900MB 43.54MB 95% online 1 cdot_mba1-01 raid_dp, normal (volume show) Vserver Volume Aggregate State Type Size Available Used% --------- ------------ ------------ ---------- ---- ---------- ---------- ----- cdot_mba1-01 vol0 aggr0 online RW 851.5MB 303.2MB 64% cdot_mba1::>
After all of the above, we've still only begun to scratch the surface of the features available in the clustered Data ONTAP CLI: there's a lot more yet to come!
6 thoughts on “Tours of the Black Prompt: Clustered NetApp Data ONTAP – Part 1”