====== Using Shared Storage Pools on VIOS ======
https://github.com/nigelargriffiths/Shared-Storage-Pool-Tools
https://www.ibm.com/support/pages/shared-storage-pool-ssp-best-practice
So here is a quick one line script "ncluster"
ncluster ()
{
/usr/ios/cli/ioscli cluster -status -verbose -fmt : -field "Node State" "Node Repos State" "Pool State" "Node Roles" "Node Upgrade Status" "Node Name" | \
awk -F: 'BEGIN { printf "No State Repos Pool Role ---Upgrade-Status--- Node-Name\n" ; } { printf "%2d %5s %5s %4s %4s %20s %s\n", NR, $1, $2, $3, $4, $5, $6; }'
}
And "nlu" to list shared pools
nlu ()
{
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
}
And below the sample output
$ ncluster
No State Repos Pool Role ---Upgrade-Status--- Node-Name
1 OK OK OK 2.2.4.10 UP_LEVEL indigovios1.aixncc.uk.ibm.com
2 OK OK OK 2.2.4.10 UP_LEVEL rubyvios1.aixncc.uk.ibm.com
3 OK OK OK 2.2.4.10 UP_LEVEL emeraldvios1.aixncc.uk.ibm.com
4 OK OK OK 2.2.4.10 UP_LEVEL emeraldvios2.aixncc.uk.ibm.com
5 OK OK OK 2.2.4.10 UP_LEVEL rubyvios2.aixncc.uk.ibm.com
6 OK OK OK 2.2.3.52 ON_LEVEL purplevio1.aixncc.uk.ibm.com
7 OK OK OK 2.2.4.10 UP_LEVEL purplevio2.aixncc.uk.ibm.com
8 OK OK OK 2.2.4.10 UP_LEVEL limevios1.aixncc.uk.ibm.com
9 OK OK OK 2.2.4.10 UP_LEVEL limevios2.aixncc.uk.ibm.com
10 OK OK OK 2.2.4.10 UP_LEVEL greenvios1.aixncc.uk.ibm.com
11 OK OK OK DBN 2.2.4.10 UP_LEVEL greenvios2.aixncc.uk.ibm.com
DBN is the "database node" I think means it is the node that updates the repository.
Not the script does not colour the output RED - but that would be cool!!
Here is another example after the SSP5 has noticed all the VIOS are at the higher level
No State Repos Pool Role ---Upgrade-Status--- Node-Name
1 OK OK OK 2.2.4.10 ON_LEVEL bronzevios1.aixncc.uk.ibm.com
2 OK OK OK 2.2.4.10 ON_LEVEL silvervios1.aixncc.uk.ibm.com
3 OK OK OK 2.2.4.10 ON_LEVEL goldvios1.aixncc.uk.ibm.com
4 OK OK OK 2.2.4.10 ON_LEVEL orangevios1.aixncc.uk.ibm.com
5 OK OK OK DBN 2.2.4.10 ON_LEVEL redvios1.aixncc.uk.ibm.com
The default format that zooms off the screen is below
$ cluster -status -verbose
Cluster Name: globular
Cluster Id: 9230352855ff11e3ba5b0e0a51517820
Cluster State: OK
Repository Mode: EVENT
Number of Nodes: 11
Nodes OK: 11
Nodes DOWN: 0
Pool Name: Pacific
Pool Id: 0000000009893E510000000052939733
Pool Mirror State: SYNCED
Node Name: indigovios1.aixncc.uk.ibm.com
Node Id: bf999ca460fb11e492d200006cae8b6a
Node MTM: 8231-E1C020659FDR
Node Partition Num: 1
Node State: OK
Node Repos State: OK
Node Upgrade Status: 2.2.4.10 ON_LEVEL
Node Roles:
Pool Name: Pacific
Pool Id: 0000000009893E510000000052939733
Pool State: OK
Node Name: rubyvios1.aixncc.uk.ibm.com
Node Id: 796dc49ef4ad11e4b72000006cae8b6a
Node MTM: 8408-E8E0221D494V
Node Partition Num: 1
Node State: OK
Node Repos State: OK
Node Upgrade Status: 2.2.4.10 ON_LEVEL
Node Roles:
Pool Name: Pacific
Pool Id: 0000000009893E510000000052939733
Pool State: OK
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:
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).
===== Alerting =====
$ alert -set -clustername demo1 -spname demosp -type threshold -value 75
$ Pool freespace is 47 percent.
$ alert -list -clustername demo1 -spname demosp -type threshold
PoolName: demosp
PoolID: 00000000097938230000000050E9B08C
ThresholdPercent: 75
$ alert -unset -clustername demo1 -spname demosp -type threshold
===== Pb with SSP =====
Remove cluster:
# odmget -q name=vioscluster0 CuAt
# rmdev -dl vioscluster0 -R
Then you can remove hanging vhost maps
Then reboot
===== Where is store the config of SSP =====
In the folder
/var/vio/SSP/
===== Convert a LU thick to thin in a SSP =====
Use nslim ...
https://www.ibm.com/support/pages/shared-storage-pools-hands-fun-virtual-disks-lu-example
$ ./nslim -?
Usage: ./nslim (v4) is a filter style program using stdin & stdout
It will thinly write a file (only copy non-zero blocks)
It uses 1MB blocks
If a block is zero-filled then it is skipped using lseek()
If a block has data then it will write() the block unchanged
Example:
./nslim SSP-LU-name
Flags:
-v for verbose output for every block you get a W=write or .=lseek on stderr
-V for verbose output on each GB you get count of written or skipped blocks
./nslim -v SSP-LU-name
this gives you visual feedback on progress
-t like verbose but does NOT actually write anything to stdout
this lets you passively see the mix of used and unused blocks
./nslim -t