EasyManua.ls Logo

IBM Midrange System DS4000 Series

IBM Midrange System DS4000 Series
566 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
496 IBM Midrange System Storage Hardware Guide
Example 8-8 Script to create and map a logical drives for AIX
#!/usr/bin/ksh
#
# ----------------------------------------------------------------------------
#
# Script: Create LUN on DS5000
# Purpose: Create several LUNs on DS5000 and allocate to a specific hostgroup.
# If error message is detected, script will terminate
#
# ----------------------------------------------------------------------------
set -x
#
DATE=`date '+%y%m%d'`
FCMD=/usr/SMclient/SMcli
IP="9.11.218.183 9.11.218.182"
PWDD=xxxxxxx
Create_LUN()
{
LUNNO=$7
$FCMD $IP -p $PWDD -c "create logicaldrive array=$2 userlabel=\"$1\" capacity=$3 GB
owner=$6 segmentsize=$4;"
error_chk $? Create_$1 quit
# Note we are attaching to a 'hostgroup', this can be changed to 'host' below
$FCMD $IP -p $PWDD -c "set logicaldrive [$1] logicalunitnumber=$7 hostgroup=\"$5\";"
error_chk $? Allocate_$1 quit
}
error_chk()
{
TIME=`date '+%T'`
if [ $1 -eq 0 ]
then
echo "Process $2 completed Successfully at $TIME"
else
echo "Warning process $2 completed with code $1 at $TIME "
if [ "$3" = "quit" ]
then
echo " ######################## ERROR
####################################\n"
echo "Process $2 terminating at $TIME"
echo " ######################## ERROR
####################################\n"
exit 1
fi
fi
}
# Passed variables used below
# LUN name=$1
# ARRAY name $2
# LUN size $3
# Segment size $4
# Host to map to $5
# Preferred Controlle a or b $6
# Host LUN number when mapped $7
Create_LUN AIX_A Data_FC 20 64 AIX_ITSO a 10

Table of Contents

Related product manuals