With Shared Storage Pools phase 5 coming soon, we have the lu -list command that output the Logical Unit (virtual disks) in Tier then Alphabetical order - hurray!
But it still has challenges and one command output can't please every one! Trouble is everyone has there own ideas of “perfect layout”
It is a "no win" problem for the developers. Here are three of my pet hates

Fortunately, the SSP designers are very clever. The lu options allow you a raw format. As an example:
$ lu -list -field LU_SIZE LU_NAME -fmt : 32768:testa 40960:testb 38912:vm97boot 8256:vm97data 8192:testc 8192:v23456789012345678901234567890 38912:vm96boot 8256:vm96data
OK, not pretty but nothing awk can’t sort out.
As we no longer need a sort the LUs by name we can reduce the ksh script to just one line (4 for readability):
echo "SizeMB UsedMB Used% Type Tier Name" /usr/ios/cli/ioscli lu -list -fmt : \ -field LU_SIZE LU_USED_SPACE LU_USED_PERCENT LU_PROVISION_TYPE TIER_NAME LU_NAME \ | awk -F: '{ printf "%6d %6d %4d%% %5s %7s %s\n",$1,$2,$3,$4,$5,$6}'
This works on BOTH VIOS 2.2.3 (random order) and the future VIOS 2.2.4 (Tier then LU name order) and you get:
VIOS 2.2.3.x
SizeMB UsedMB Used% Type Tier Name 1048576 971779 92% THIN SYSTEM purple3files 65536 65536 100% THICK SYSTEM orange5a 32768 19956 60% THIN SYSTEM vm34 32768 32768 100% THIN SYSTEM vm61b 32768 3392 10% THIN SYSTEM AIX735_b 32768 27016 82% THIN SYSTEM vm16boot 65536 26563 40% THIN SYSTEM ruby32data1 65536 0 0% THIN SYSTEM emerald3 25600 0 0% THIN SYSTEM volume-orange5_data1
VIOS 2.2.4
SizeMB UsedMB Used% Type Tier Name 32768 0 0% THIN test testa 40960 0 0% THIN test testb 38912 2562 6% THIN test vm97boot 8256 23 0% THIN test vm97data 39936 39936 100% THICK prod testc 8192 0 0% THIN prod v23456789012345678901234567890 40960 2562 6% THIN prod vm96boot 8256 26 0% THIN prod vm96data
Note: I have two Tiers here and they are ordered first.
A good start for two lines of ksh script but not good enough for me.
I actually need to sort the output differently for different views of the data like:
- All LUs in alphabetical order so I can simply find the one I want in one go.
- Which LU has the larger size?
- Which LU is actually taking the most storage?
- Order on tiers then name when I want too.
etc. So here is my NEW and Improved nlu ksh script where we can order the output with options and it works on VIOS 2.2.3 and VIOS 2.2.4 with Tiers (when or if they arrive :-).
$ nlu -? /home/padmin/nlu Nigel's lu command with improved layout and column ordering /home/padmin/nlu [-sizemb | -usedmb | -used | -type | -tier | -name (default)] $
Example default output by LU Name - my favourite default
$ nlu SizeMB UsedMB Used% Type Tier Name 32768 0 0% THIN test testa 40960 0 0% THIN test testb 39936 39936 100% THICK prod testc 8192 0 0% THIN prod v23456789012345678901234567890 40960 2562 6% THIN prod vm96boot 8256 26 0% THIN prod vm96data 38912 2562 6% THIN test vm97boot 8256 23 0% THIN test vm97data $
Example output reordered by column
$ nlu -sizemb SizeMB UsedMB Used% Type Tier Name 8192 0 0% THIN prod v23456789012345678901234567890 8256 23 0% THIN test vm97data 8256 26 0% THIN prod vm96data 32768 0 0% THIN test testa 38912 2562 6% THIN test vm97boot 39936 39936 100% THICK prod testc 40960 0 0% THIN test testb 40960 2562 6% THIN prod vm96boot $ nlu -usedmb SizeMB UsedMB Used% Type Tier Name 8192 0 0% THIN prod v23456789012345678901234567890 32768 0 0% THIN test testa 40960 0 0% THIN test testb 8256 23 0% THIN test vm97data 8256 26 0% THIN prod vm96data 38912 2562 6% THIN test vm97boot 40960 2562 6% THIN prod vm96boot 39936 39936 100% THICK prod testc $ nlu -tier SizeMB UsedMB Used% Type Tier Name 39936 39936 100% THICK prod testc 8192 0 0% THIN prod v23456789012345678901234567890 40960 2562 6% THIN prod vm96boot 8256 26 0% THIN prod vm96data 32768 0 0% THIN test testa 40960 0 0% THIN test testb 38912 2562 6% THIN test vm97boot 8256 23 0% THIN test vm97data
Here is the actual ksh script for nlu that is Nigel's New lu command
Runnable as padmin, root or any padmin like user (restricted shell with oem_setup_env command).
if [[ $(whoami) != "root" ]] then command=$(whence $0) # echo DEBUG I am padmin so restart $command again as the root user echo "$command" $1 | oem_setup_env else # echo DEBUG now I am root # lowercase the parameter with tr to avoid input case errors case `echo $1 | tr "[A-Z]" "[a-z]" ` in 1 | -sizemb) COLUMN="-nk 1" ;; 2 | -usedmb) COLUMN="-nk 2" ;; 3 | -used | -used%) COLUMN="-nk 3" ;; 4 | -type) COLUMN="-k 4" ;; 5 | -tier) COLUMN="-k 5" ;; 6 | -name) COLUMN="-k 6" ;; ? | -?) echo $0 "Nigel's lu command with improved layout and column ordering" echo $0 "[-sizemb | -usedmb | -used | -type | -tier | -name (default)]" exit 0 ;; *) COLUMN="-k 6" ;; esac echo " SizeMB UsedMB Used% Type Tier Name" /usr/ios/cli/ioscli \ lu -list -field LU_SIZE LU_USED_SPACE LU_USED_PERCENT \ LU_PROVISION_TYPE TIER_NAME LU_NAME -fmt : \ | awk -F: '{ printf "%7d %7d %4d%% %5s %5s %s\n", $1,$2,$3,$4,$5,$6}' \ | sort $COLUMN fi exit 0
The End