HOWTO: Update a NIM server PDF Print E-mail
User Rating: / 5
PoorBest 
Written by Michael Felt   

#!/usr/bin/ksh
# Copyright 2012 Michael Felt, all rights reserved
# Create a nim lpp_source from an install DVD CD
setlevel()
{
OSLEVEL=`oslevel -s | cut -c 1-2,6-7,9-10`
DVDLEVEL=`installp -d /dev/cd0 -L | grep bos.rte.install | awk -F: ' { print $3 } ' | \
     awk -F. ' { print $1 $2 "0" $3 "0" $4 }' | sort | tail -1`
while [ "x$LEVEL" == "x" ]; do
        if [ $DVDLEVEL -ne $OSLEVEL ]; then
            echo DVDLEVEL is $DVDLEVEL, OSLEVEL is $OSLEVEL
                echo "should new lpp_source be set according to DVD or OS? : (O/D)"\\c
                read choice
                case "$choice" in
                O|o)
                        LEVEL=$OSLEVEL ;;
                D|d)
                        LEVEL=$DVDLEVEL ;;
                esac
        fi
done
}
getvg()
{
        lsvg -o
        VG=vgNim
        echo --- using volume group vgNim ---
        echo --- need to add selection script ---
}

clear
echo "AIXTOOLS and ROOTVG.NET script to assist with NIM installation based on host's oslevel"
echo ========== -- getting current software levels
setlevel
echo ========== -- choose existing volume group
getvg

echo ========== -- create logical volumes
mklv -t jfs2 -y lv${LEVEL} ${VG} 4G
[[ $? -ne 0 ]] && echo $0: cannot make logical volume, exiting && exit -1
mklv -t jfs2 -y lv${LEVEL}s ${VG} 2G
[[ $? -ne 0 ]] && echo $0: cannot make logical volume, exiting && exit -1

echo ========== -- create filesystems...
crfs -v jfs2 -d lv${LEVEL} -m /export/${LEVEL} -A yes -u nim
[[ $? -ne 0 ]] && echo $0: cannot filesystem /export/${LEVEL}, exiting && exit -1
mount /export/${LEVEL}

crfs -v jfs2 -d lv${LEVEL}s -m /export/${LEVEL}/spot_${LEVEL} -A yes -u nim
[[ $? -ne 0 ]] && echo $0: cannot filesystem /export/${LEVEL}spot_${LEVEL}, exiting && exit -1
mount /export/${LEVEL}/spot_${LEVEL}

lsvg -l ${VG}

echo ========== -- create NIM lpp_source and spot from DVD
nim -o define -t lpp_source -a server=master -a source=/dev/cd0 -a location=/export/${LEVEL}/lpp lpp_${LEVEL}
[[ $? -ne 0 ]] && echo $0: nim lpp_source create failed, exiting && nim -o remove lpp_${LEVEL} && exit -1
bffcreate -d /dev/cd0 -q -t /export/${LEVEL}/lpp -v -S -X openssh.base openssh.man.en_US openssh.msg.en_US

nim -o define -t spot -a server=master -a source=lpp_${LEVEL} -a location=/export/${LEVEL} spot_${LEVEL}
[[ $? -ne 0 ]] && echo $0: nim spot create failed && nim -o remove spot_${LEVEL} && exit -1
 



 
< Prev   Next >
Login