HP-UX vPars and Integrity VM V6.3 Administrator Guide

# -q Quite mode - no display of hpvmmodify command that will run
#
# -t targetmax Max target value to use for -a disk:avio_stor:[b,d,targetmax]...
# Valid values:
# 0 - special case: script will use full 0-127 range
# 15...127 - script will use specified max
# 1... 14 - not valid for this script, since 0-14 is
# the normal default range for target values
# if -t is not specified.
#
# -T Time the hpvmmodify add command with 'timex'
#
# EXAMPLES:
#
# Add all the disks in file "disklistfile" using defaults
# # ./thisscript -a -P guest -f disklistfile
#
# Add all the disks in file "disklistfile" 20 disks at a time
# # ./thisscript -a -P guest -f disklistfile -n 20
#
# Add the first 50 disks in the disklistfile, 20 disks at a time
# NOTE: this will result in 3 calls to hpvmmodify, to
# add 20 disks, another 20, and then the final 10.
# # ./thisscript -a -P guest -f disklistfile -N 50 -n 20
#
# NOTE: all of the above examples do not specify b,d,t values in the
# hpvmmodify resource string, so the default algorithm is used,
# to add 15 targets, from 0...14, and then increment to the next
# virtual adaptor (skipping 0,3).
#
# The following examples will cause the script to calculate and use
# explicit values for b,d,t in the hpvmmodify resource string.
#
# NOTE: Rules for specifying -t in this script:
# 0 Special case, means use 0...127
# 1...14 Invalid in this script, as this is part of the default
# range of 0...14
# 15...127 Use specified value as upper limit to target value before
# going to next virtual adaptor.
#
# Add all disks in the file using the full range of target values 0...127:
# # ./thisscript -a -P guest -f disklistfile -t 0
#
# Add all disks in the file using a maximum target value of 30
# # ./thisscript -a -P guest -f disklistfile -t 0
#
#
# ASSUMPTIONS AND LIMITATIONS
#
# - assume that the guest exists and may be modified
# - assume there are no storage devices assigned to the guest
# - assume the disks in the disklistfile are good
# - assume OK to add all disks as avio_stor
# - assume OK to add specified disks to the specified guest
# - limitation: 945 storage devices using default [b,d,t] values
# - limitation: 1024 max avio_stor storage devices
# - limitation: 127 max value for user specified target limit
# ------------------------------------------------------------------------------
#
# Script global variables
#
THISSCRIPT=$0
DFLTDISKLIMIT=945
MAXDISKCNT=1024
XNDEFAULT=10
BDT="" # default [b,d,t] setting
typeset -i BUS
typeset -i DEV
typeset -i TGT
typeset -i TGTMAX
typeset -i USERTGT
BUS=0
DEV=0
TGT=0
BUSMAX=7
DEVMAX=7
DEVSKIP=3
TGTMAX=127
USERTGT=0
WRKTGT=$TGTMAX
#
# function autobdt() - auto generates explicit b,d,t triples
#
function autobdt {
# echo "autobdt() function not yet implemented"
# use current BUS,DEV,TGT values
BDT="$BUS,$DEV,$TGT"
282 Sample script for adding multiple devices