adminjg Absent Member.
Absent Member.
2314 views

Configuring IBM TSM (Tivoli Storage Manager) on OES11 SP1 NC

Hi,

Just wondering if anyone could shed some light on how to configure TSM on an NCS hosting NSS pool's ? I believe I have most of it worked out but would like some feed back.

My setup:
3 node cluster (Active/Active)
1:1 ratio of pool/volumes

- At the root of each volume I created a "tivoli" folder and placed the dsm.opt file with a reference to the associated stanza for that volume.
- each node has a dsm.sys file with one stanza for every Volume it could potentially host.
- Load scripts to start the dscmcad process and unload script to stop the dsmcad process are in place for each resource.

The load scripts basically just call a dsm.sh script that I wrote. The script accepts two parms. First parm to inidicate start or stop and second parm to indicate which volume to backup.
Example: dsm.sh start HOME1 --> would call /usr/bin/dsmcad -optfile=/media/nss/HOME1/tivoli/dsm.opt

Am I on the right track ? So far everything works except for whatever reason I can't seem to get the current pid to kill the process when the unload scripts is executed. Not sure if this is the proper way to unload the dsmcad process when a resource is moved ??

Any help is appreciated!
Labels (1)
0 Likes
5 Replies
Anonymous_User Absent Member.
Absent Member.

Re: Configuring IBM TSM (Tivoli Storage Manager) on OES11 SP1 NC

adminjg wrote:

> My setup:
> 3 node cluster (Active/Active)
> 1:1 ratio of pool/volumes
>
> - At the root of each volume I created a "tivoli" folder and placed the
> dsm.opt file with a reference to the associated stanza for that volume.
> - each node has a dsm.sys file with one stanza for every Volume it could
> potentially host.
> - Load scripts to start the dscmcad process and unload script to stop
> the dsmcad process are in place for each resource.
>
> The load scripts basically just call a dsm.sh script that I wrote. The
> script accepts two parms. First parm to inidicate start or stop and
> second parm to indicate which volume to backup.
> Example: dsm.sh start HOME1 --> would call /usr/bin/dsmcad
> -optfile=/media/nss/HOME1/tivoli/dsm.opt


Basically this is what I'm doing here as well. I will use the variables
DSM_DIR und DSMOPT for the base directory and options file.

> Am I on the right track ? So far everything works except for whatever
> reason I can't seem to get the current pid to kill the process when the
> unload scripts is executed. Not sure if this is the proper way to unload
> the dsmcad process when a resource is moved ??


Instead of just placing the options file on the NSS volume I do copy the
complete bin folder of the TSM client. The load script starts this copy
of dsmcad. Thus the unload script sees something like
/media/nss/VOL/backup/dsmcad
in the list of processes and stops this instance of dsmcad.
There are certainly more clever ways of doing this. But it works quite
well and reliable. Note that if you migrate the cluster resource within
the backup window of TSM the backup will restart on the new cluster node
- which is nice and handy.

Günther
0 Likes
adminjg Absent Member.
Absent Member.

Re: Configuring IBM TSM (Tivoli Storage Manager) on OES11 SP

Unfortunately our backup team has a specific process in place and won't allow me to duplicate the entire tsm directory on each node. They prefer to only have the dsm.opt file.

How is your unload script configured ? Currently what I'm attempting to do is call the same script except (dsmc.sh stop HOME1) within the dsmc.sh script I issue ps -ef | grep "HOME1/tivoli" | grep -v grep | awk '{print $2}' this will return the PID of the correct dsmcad process that is being unloaded (example: dsmcad -optfile=/media/nss/HOME1/tivoli) once I have the PID I simply kill the process --> kill ${pid}.

For whatever reason when I test this at the terminal I can retrieve the pid just fine, but as soon as I call the script within the unload script the PID is always returned empty ?

Is there a more elegant way of stopping the dsmcad process ??

Thanks!
0 Likes
Anonymous_User Absent Member.
Absent Member.

Re: Configuring IBM TSM (Tivoli Storage Manager) on OES11 SP1 NC

adminjg wrote:

> How is your unload script configured ? Currently what I'm attempting to
> do is call the same script except (dsmc.sh stop HOME1) within the
> dsmc.sh script I issue ps -ef | grep "HOME1/tivoli" | grep -v grep | awk
> '{print $2}' this will return the PID of the correct dsmcad process that
> is being unloaded (example: dsmcad -optfile=/media/nss/HOME1/tivoli)
> once I have the PID I simply kill the process --> kill ${pid}.


To me this looks just fine.

> For whatever reason when I test this at the terminal I can retrieve the
> pid just fine, but as soon as I call the script within the unload script
> the PID is always returned empty ?


The cluster scripts run in a different environment than a shell. Check
your path variable PATH etc. Redirect the output of your dsmc.sh script
to a file in order to see what is happening in more detail.

> Is there a more elegant way of stopping the dsmcad process ??


Probably yes, but this is the way I'm doing it also.

Günther

0 Likes
adminjg Absent Member.
Absent Member.

Re: Configuring IBM TSM (Tivoli Storage Manager) on OES11 SP


>The cluster scripts run in a different environment than a shell. Check
>your path variable PATH etc. Redirect the output of your dsmc.sh script
>to a file in order to see what is happening in more detail.


Thanks, for whatever reason my grep string was too specific when running within the unload script shell. I had to modify it to only include the volume name. ps -ef | grep "/media/nss/HOME1" | grep -v grep | awk '{print $2}' did the trick. I figured this out by logging ps -ef | grep "dsmcad" command when executing the unload script.

Here's the completed script in case anyone else stumbles on this thread.

#!/bin/bash
REL=0.1
##############################################################################
#
# dsmc.sh - dsmcad start process
# Copyright (C) 2014 Author
#
##############################################################################
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# Authors/Contributors:
# xxxxxxx
#
##############################################################################
# Date Created: Tue May 20 10:26:00 2014
# Last updated:
# Crontab command: Not recommended
# Supporting file: /media/nss/volumeName/tivoli/dsm.opt
# Additional notes: This script relies on two parameters the start or stop
# directive in parm1($1) and the location of the dsm.opt
# file in parm2($2). The dsm.opt file must be stored
# within a tivoli folder at the root of the volume of the
# resource to be backed up.
##############################################################################
DIALOG=${DIALOG=dialog}
TS=$(date +"%b %d %T")
HOST=$(hostname)
USER=$(whoami)
EMAIL=root
LOG="/var/log/tsm.log"
dsm=/usr/bin
tsmCmd=$1
optFile="/media/nss/$2/tivoli/dsm.opt"
volName="$2"

function initlog() {
if [ -e /var/log/tsm.log ]
then
echo "log file exists" > /dev/null
else
touch /var/log/tsm.log
echo "Logging started at ${TS}" > ${LOG}
echo "All actions are being performed by the user: ${USER}" >> ${LOG}
echo " " >> ${LOG}
fi
}

function logit() {
echo -e $TS $HOST: $* >> ${LOG}
}

#Main

initlog
logit "v$REL OES11sp1 Tivoli NCS Script"
logit "========================================="

case "${tsmCmd}" in
start)
logit "Initiating ${dsm}/dsmcad -optfile=${optFile}"
${dsm}/dsmcad -optfile=${optFile}
if [ $? -ne 0 ]; then
logit "Initiating ${dsm}/dsmcad -optfile=${optFile} failed"
else
logit "Initiating ${dsm}/dsmcad -optfile=${optFile} was successful"
fi
;;
stop)

logit "Get PID for ${dsm}/dsmcad -optfile=${optFile}"
pid=`ps -ef | grep "${volName}" | grep -v grep | awk '{print $2}'`

logit "Initiating kill for the following process ${pid}"
kill ${pid}

if [ $? -ne 0 ]; then
logit "Kill process for pid $pid failed"
else
logit "Kill process for pid $pid was successful"
fi
esac
0 Likes
Anonymous_User Absent Member.
Absent Member.

Re: Configuring IBM TSM (Tivoli Storage Manager) on OES11 SP1 NC

adminjg wrote:
>
>>
>>> The cluster scripts run in a different environment than a shell. Check
>>> your path variable PATH etc. Redirect the output of your dsmc.sh script
>>> to a file in order to see what is happening in more detail.

>
> Thanks, for whatever reason my grep string was too specific when running
> within the unload script shell. I had to modify it to only include the
> volume name. ps -ef | grep "/media/nss/HOME1" | grep -v grep | awk
> '{print $2}' did the trick. I figured this out by logging ps -ef | grep
> "dsmcad" command when executing the unload script.
>
> Here's the completed script in case anyone else stumbles on this thread.


Glad to hear that it is working now. And thank you very much for sharing
the shell script.

Günther

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.