Automating Netbackup Installation without user intervention in 7.X :
As we all know netbackup client installation can be performed using
1) Install_client_files
2 ) Or mounting the cdrom and performing installation using ./install .
The problem with above two methods is either we have to add client to policy or installation expects response constantly from user . I have a requirement to perform netbackup installation without user intervention .My requirement is to installation netbackup client software on 500 servers as part of baseline even before these are added any domain . I have achieved this by editing "install" script code providing by netbackup .
This helped in installing netbackup as part of base line along with OS .
Summary of tasks to do to automate netbackup installation
S.no |
Entity to automate |
Action to be taken |
Script to Modify |
1 |
Is it Local installation |
Hardcode installation as local installation .
Are you installing to root environment?
|
.install |
2 |
Enter name of netbackup server |
Hardcode netbackup installation is client installation and give master server name inside the script |
client.inst |
3 |
Would you like to use XXX name as your client |
Hardcode client name inside the script as "hostname" (install) |
client.inst |
4 |
For 7.1.0.4 Which package would you like to install |
Hardcode client package to select in NB_update.install |
NB_upate.install |
5 |
Would like to install any other package |
Break the loop with the given code below to come out from 7.1.0.4 installation script |
NB_upate.install |
1)Hardcoding Local Installation
Line number 1267 , 361
Line 361
Original source code New code
LOCAL_INSTALL=1 LOCAL_INSTALL=1
if confirm y " YES=1
NetBackup installs to the running root environment, by defaul if [ $YES ]
Are you installing to the running root environment?"
then then
return return
else else
${ECHO} " ${ECHO} "
You have chosen to install to an alternate root environment. You have chosen to install to an alternate root environme
The alternate root environment must be mounted for access The alternate root environment must be mounted for access
and it must contain etc, var, usr, and tmp subdirectories. and it must contain etc, var, usr, and tmp subdirectories
For example, if you specify the alternate root path to be For example, if you specify the alternate root path to be
/alt, then /alt/etc, /alt/var, /alt/usr and /alt/tmp /alt, then /alt/etc, /alt/var, /alt/usr and /alt/tmp
must exist. NetBackup will be installed relative to /alt must exist. NetBackup will be installed relative to /alt
rather than the default root path '/'. " rather than the default root path '/'. "
REPLY="" REPLY=""
while [ "$REPLY" = "" ]; while [ "$REPLY" = "" ];
Line 1267
Hardcoding response for "Do you wish to continue ? "
Original source code New code
print_copyright print_copyright
${ECHO} " ${ECHO} "
Installing ${name_1} Installing ${name_1}
" "
if confirm y "Do you wish to continue?" YES=1
if [ $YES ]
then then
install_product ${product_1} install_product ${product_1}
wrap_up $? wrap_up $?
else else
wrap_up 0 wrap_up 0
2 ) Hardcode Netbackup installation as client installation and give netbackup master name within the script
Line number : 552 , 754
Script : client.inst
if confirm y "Do you want to install the NetB | YES=1
if [ $YES ]
#if confirm y "Do you want to install the NetBackup clien
then then
\: \:
else else
ask_me=n ask_me=n
fi fi
fi fi
if [ "${ask_me}" = "y" ] ; then if [ "${ask_me}" = "y" ] ; then
if [ $REQFILES = "." ] ; then if [ $REQFILES = "." ] ; then
Get_Client_List OneAnswer Get_Client_List OneAnswer
else else
ClientFILES=$REQFILES ClientFILES=$REQFILES
fi fi
if [ " $ClientFILES" = " " ] ; then if [ " $ClientFILES" = " " ] ; then
exit exit
Hardcoding master server name
Orginal source code New code
master_ans=0 master_ans=0
while [ ${master_ans} -ne 1 ] while [ ${master_ans} -ne 1 ]
do do
Prompt " Prompt "
Enter the name of the NetBackup server : " Enter the name of the NetBackup server : "
read Server | #read Server
${ECHO} ${Server} >> | Server='XXXXXX'
This will be taken as master server name in bp.conf
3 ) Hardcoding cilent name inside the script
Line number : 777
Script ; client.inst
Goto client.inst file and edit it as follows : It would be inside /NBClients/catalog/anb . Install script internally calls this
total 38
-r-xr-x--- 1 nbu backup 19410 Feb 3 2011 client.inst
Original source code New code
else else
if confirm y " YES='1'
Would you like to use \"${host}\" as the configured if [ $YES ]
name of the NetBackup client?" # if confirm y "
#Would you like to use \"${host}\" as the configured
#name of the NetBackup client?"
then then
Client=${host} Client=${host}
else else
Prompt " Prompt "
Enter the name of this NetBackup client : " Enter the name of this NetBackup client : "
read Client read Client
${ECHO} ${Client} >> ${ECHO} ${Client} >>
fi fi
fi fi
else else
Configurations :
After installing netbackup check for exclude list .It is good to check exclude list and put the necessary default exclude list .
cp /netappshare/default_exclude_list /usr/openv/TI/bin
You can put the buffers also in the script .
Installing netbackup 7.1.0.4
4) Hardcoding client package to select in NB_update.install
Line : 163
Script : NB.update_install
return 0 return 0
fi fi
valid=0 valid=0
until [ ${valid} -ne 0 ] until [ ${valid} -ne 0 ]
do do
#read ans and if it is empty, initialize it w #read ans and if it is empty, initialize it w
read ans | ans='y'
> #read ans
: ${ans:=${1}} : ${ans:=${1}}
#write to the tracefile #write to the tracefile
${ECHO} ${ans} >> ${Trace_File} ${ECHO} ${ans} >> ${Trace_File}
case "${ans}" in case "${ans}" in
Y*|y*) Y*|y*)
valid=1 valid=1
return 0 ;; return 0 ;;
5 ) Break the loop to select another package after the installation using the following code
Script : NBU-update.install
Line : 429
Original code New code
VALUE="${PACK_NAME}" VALUE="${PACK_NAME}"
else else
VALUE="q" VALUE="q"
fi fi
${ECHO} "${VALUE}" ${ECHO} "${VALUE}"
else else
read VALUE #read VALUE
verify_upgrade=`cat /usr/openv/pack/pack.summary |grep -i
if [ $verify_upgrade -gt 0 ]
then
echo "INFO: Server has 7.1. 0.4 installed "
exit
fi
VALUE='NB_CLT_7.1.0.4'
fi fi
VALUE=${VALUE:=bad} VALUE=${VALUE:=bad}
Now your netbackup client installation is sucessful ..!
Manoj K Matala
Incase of any queries please post your comments ,