I have come across a few servers that have memory issues when backing up large drives / filesystems and using MEMORYEFFICIENTBACKUP was not resolving the backup failures. The error code I would see was
ANS1030E The operating system refused a TSM request for memory allocation.
The problem was one drive that has millions of small files all under one directory. It's one of those poorly devised custom programs, and I've seen it a hundred times. I could journal the drive, but we seemed to get better results with an alternative method. A coworker reminded me of the INCLUDE.FS option using DISKCACHE and specifying the cache location.
INCLUDE.FS G: MEMORYEFFICIENTBACKUP=DISKCACHEMETHOD DISKCACHELOCATION=L:\TSM_cache
With the include.fs TSM will only use the memoryefficientbackup diskcache method for that particular drive, allowing the rest of the backup to perform normally. So if you have a drive or filesystem with millions of files this is an alternative to journaling.
Tuesday, June 21, 2011
Tuesday, June 14, 2011
Drive Matching
While working with a VTL I realized how much I hated matching drive definitions on a LAN-Free client or remote library client and decided to do something about it. So after searching the web and finding a helpful script to pull rmt and serial numbers from the tape drives discovered on the LAN-Free or Lib-Client I worked it into an AIX shell script that will match the drives rmt with the correct drive definition on the library manager. The key to this working is to have the library manager listed in the lib-clients dsm.sys and to define the following TSM script on the library manager.
-=-=-=-=-=-=-TSM Server Script-=-=-=-=-=-=-=-
def script drive_match desc="This script is used by a shell script to match drives to rmts to help create DEFINE PATH statements"
upd script drive_match "select 'define path $1 ' || drive_name || ' srct=server destt=drive libr=' || library_name || ' device=/dev/$2 -"
upd script drive_match " online=yes' from drives where DRIVE_SERIAL='$3' "
-=-=-=-=-=-=-UNIX Shell Script-=-=-=-=-=-=-=-
#!/bin/ksh
ID=`cat /home/tsmadmin/VARS/ADSMID`
PA=`cat /home/tsmadmin/VARS/ADSMPA`
touch ./drv_match.mac
cat /dev/null > ./drv_match.mac
clear
echo "This script will build the DEFINE PATH statements for a server"
echo ""
echo "Enter the Library Manager Name: \c"
read SERV
echo ""
echo "What is the TSM server name these paths are going to be generated for: \c"
read TSMSRV
echo ""
lsdev |grep fscsi | while read FSCS rest
do
TAPES=$(lsdev -p $FSCS | grep rmt | grep -v ALT |cut -f1 -d" ")
for TAPE in $TAPES
do
SERIAL=$(lscfg -vl $TAPE | grep Serial | awk -F"." '{printf "%d", $NF}')
FCS=$(echo $FSCS | sed 's/fscsi/fcs/')
dsmadmc -id=$ID -pa=$PA -dataonly=yes -commadelimited -servern=$SERV run drive_match $TSMSRV $TAPE $SERIAL | grep -v ANR >> ./drv_match.mac
done
done
cat ./drv_match.mac
-=-=-=-=-End Script-=-=-=-=-=-
You'll notice I save the output as a macro so it can be reviewed before executed. If you'd like to run the macro automatically then just add a dsmadmc line at the end.
The following is some sample output:
define path tsm8 VTL3_00332 srct=server destt=drive libr=VTL3 device=/dev/rmt88 online=yes
define path tsm8 VTL3_00336 srct=server destt=drive libr=VTL3 device=/dev/rmt89 online=yes
define path tsm8 VTL3_00340 srct=server destt=drive libr=VTL3 device=/dev/rmt90 online=yes
define path tsm8 VTL4_00444 srct=server destt=drive libr=VTL4 device=/dev/rmt91 online=yes
-=-=-=-=-=-=-TSM Server Script-=-=-=-=-=-=-=-
def script drive_match desc="This script is used by a shell script to match drives to rmts to help create DEFINE PATH statements"
upd script drive_match "select 'define path $1 ' || drive_name || ' srct=server destt=drive libr=' || library_name || ' device=/dev/$2 -"
upd script drive_match " online=yes' from drives where DRIVE_SERIAL='$3' "
-=-=-=-=-=-=-UNIX Shell Script-=-=-=-=-=-=-=-
#!/bin/ksh
ID=`cat /home/tsmadmin/VARS/ADSMID`
PA=`cat /home/tsmadmin/VARS/ADSMPA`
touch ./drv_match.mac
cat /dev/null > ./drv_match.mac
clear
echo "This script will build the DEFINE PATH statements for a server"
echo ""
echo "Enter the Library Manager Name: \c"
read SERV
echo ""
echo "What is the TSM server name these paths are going to be generated for: \c"
read TSMSRV
echo ""
lsdev |grep fscsi | while read FSCS rest
do
TAPES=$(lsdev -p $FSCS | grep rmt | grep -v ALT |cut -f1 -d" ")
for TAPE in $TAPES
do
SERIAL=$(lscfg -vl $TAPE | grep Serial | awk -F"." '{printf "%d", $NF}')
FCS=$(echo $FSCS | sed 's/fscsi/fcs/')
dsmadmc -id=$ID -pa=$PA -dataonly=yes -commadelimited -servern=$SERV run drive_match $TSMSRV $TAPE $SERIAL | grep -v ANR >> ./drv_match.mac
done
done
cat ./drv_match.mac
-=-=-=-=-End Script-=-=-=-=-=-
You'll notice I save the output as a macro so it can be reviewed before executed. If you'd like to run the macro automatically then just add a dsmadmc line at the end.
The following is some sample output:
define path tsm8 VTL3_00332 srct=server destt=drive libr=VTL3 device=/dev/rmt88 online=yes
define path tsm8 VTL3_00336 srct=server destt=drive libr=VTL3 device=/dev/rmt89 online=yes
define path tsm8 VTL3_00340 srct=server destt=drive libr=VTL3 device=/dev/rmt90 online=yes
define path tsm8 VTL4_00444 srct=server destt=drive libr=VTL4 device=/dev/rmt91 online=yes
Friday, June 10, 2011
TSM Server V6 AIX Install/Upgrade Gotchas
So after setting up numerous TSM 6.1 and 6.2 servers here are a few of the things that have been little gotchas. They were never upgrade stoppers but they did cause some headaches as we determined what was causing the errors.
- Check the ATAPE version (recommend 11.x)
- Check your xlC C++ runtime level (recommend 9.0.0.8 or greater)
- With AIX you must have IOCP set to available or else you'll have to update the OS setting and reboot the server.
- Make sure the user id that the TSM 6.x instance is running under has ulimit set to unlimited. Real pain when you go to create disk volumes and you forgot to set the ulimit. It was my absentminded moment!
- Don't forget that the tsmdbmgr.log file ownership needs to be the new ID not root.
- Also when using RAW disk volumes for TSM diskpools chown the device file (example: /dev/rtsmdata01) to the new user id or TSM will say it's unavailable.
- With a recent upgrade we could not get the TSM DB backup to execute without an error. It turned out the TSM client's dsmtca file ownership had been accidentally changed to the TSM server's user ID and it MUST BE OWNED BY ROOT for the backup of the TSM DB to execute successfully.
Tuesday, May 31, 2011
Where, how and why are tapes still used for backup?
Not strictly a TSM only topic, but this fascinating thread has been raging on over at LinkedIn for the last few days and I thought it would be worth sharing here. The provocative question asked was:
"Is tape still used for backup? Why is tape still being used these days when disk and cloud are available?"
Link: http://linkd.in/lo6VnM
Cue an avalanche of fascinating pro- and anti-tape pitches and opinions. Wading through the comments may take a while (I pitched-in with a couple of comments too) but it's a useful read as, frankly, these are the questions that clients/customers/decision-makers - and indeed ourselves - should be asking to ensure that we continue to use the right technology for the right purpose.
Of course, TSM itself is well-positioned for in many ways given its long-running support of disk, both in random access and more recently in sequential file (virtual tapes!).
David Mc
London, UK
Thursday, May 26, 2011
Get Device Info From AIX
I needed to gather the serial numbers by device (rmt) in AIX for our VTL, and the grep command in AIX is not as functional as my Linux box at home, so the -A and -B options are not available. Those two flags allow you to grab X lines before and after the grep'ed expression which is really handy when running lscfg -vp. Here's a grep command to gather just the rmt(s) with their serial and WWN. If you need to change the number of lines just change the a (after) and b (before) value, and s is what is "grep'ed".
lscfg -vp | awk 'c-->0;$0~s{if(b)for(c=b+1;c>1;c--)print r[(NR-c+1)%b];print;c=a}b{r[NR%b]=$0}' b=1 a=5 s="rmt"
lscfg -vp | awk 'c-->0;$0~s{if(b)for(c=b+1;c>1;c--)print r[(NR-c+1)%b];print;c=a}b{r[NR%b]=$0}' b=1 a=5 s="rmt"
Wednesday, May 18, 2011
Getting TSM Script Info
So you want to query a script and see what it executes but don't like the standard Q SCRIPT results? Don't forget about the FORMAT= options available. Most people know FORMAT=DETAIL but with the Q SCRIPT command there are two additional formats. FORMAT=LINE and FORMAT=RAW. I like RAW but LINE is decent if you want to see the script by sequence.
UPDATE: As reader Erwann reminded me (I had long forgotten), there is also a F=MACRO option which will display the script in a form that can be run as a macro to define the script to another TSM server. If you issue Help Q SCRIPT it does not list the MACRO option, but it is valid and does work. So you could dump all your scripts to macro format and send it to an outfile. Then you could define them to an alternate TSM server (Q SCRIPT * OUTFILE=SCRIPTS.MAC F=Macro).
tsm: TSMLIBM>q script LIBR_INFO f=macro
DEFINE SCRIPT LIBR_INFO DESC="Library path information"
UPDATE SCRIPT LIBR_INFO "q libr $1"
UPDATE SCRIPT LIBR_INFO "q libr $1 f=d"
UPDATE SCRIPT LIBR_INFO "q path $1 srct=serv destt=libr f=d"
UPDATE SCRIPT LIBR_INFO "q path * srct=serv destt=dr libr=$1 f=d"
UPDATE SCRIPT LIBR_INFO "select library_name,library_type,library_serial from libraries where library_name ='$1'"
UPDATE SCRIPT LIBR_INFO "select source_name,destination_name,library_name,device serial from paths where library_name='$1'"
UPDATE SCRIPT LIBR_INFO "select drive_name,drive_serial,element,library_name from drives where library_name='$1'"
Here are the examples:
tsm: TSMLIBM>q script LIBR_INFO f=line
Name Line Command
Number
---------- ------ ------------------------------------------------------------
LIBR_INFO 5 q libr $1
10 q libr $1 f=d
15 q path $1 srct=serv destt=libr f=d
20 q path * srct=serv destt=dr libr=$1 f=d
25 select library_name,library_type,library_serial from
libraries where library_name ='$1'
30 select source_name,destination_name,library_name,device
serial from paths where library_name='$1'
35 select drive_name,drive_serial,element,library_name from
drives where library_name='$1'
tsm: TSMLIBM>q script LIBR_INFO f=raw
q libr $1
q libr $1 f=d
q path $1 srct=serv destt=libr f=d
q path * srct=serv destt=dr libr=$1 f=d
select library_name,library_type,library_serial from libraries where library_name ='$1'
select source_name,destination_name,library_name,device serial from paths where library_name='$1'
select drive_name,drive_serial,element,library_name from drives where library_name='$1'
UPDATE: As reader Erwann reminded me (I had long forgotten), there is also a F=MACRO option which will display the script in a form that can be run as a macro to define the script to another TSM server. If you issue Help Q SCRIPT it does not list the MACRO option, but it is valid and does work. So you could dump all your scripts to macro format and send it to an outfile. Then you could define them to an alternate TSM server (Q SCRIPT * OUTFILE=SCRIPTS.MAC F=Macro).
tsm: TSMLIBM>q script LIBR_INFO f=macro
DEFINE SCRIPT LIBR_INFO DESC="Library path information"
UPDATE SCRIPT LIBR_INFO "q libr $1"
UPDATE SCRIPT LIBR_INFO "q libr $1 f=d"
UPDATE SCRIPT LIBR_INFO "q path $1 srct=serv destt=libr f=d"
UPDATE SCRIPT LIBR_INFO "q path * srct=serv destt=dr libr=$1 f=d"
UPDATE SCRIPT LIBR_INFO "select library_name,library_type,library_serial from libraries where library_name ='$1'"
UPDATE SCRIPT LIBR_INFO "select source_name,destination_name,library_name,device serial from paths where library_name='$1'"
UPDATE SCRIPT LIBR_INFO "select drive_name,drive_serial,element,library_name from drives where library_name='$1'"
Here are the examples:
tsm: TSMLIBM>q script LIBR_INFO f=line
Name Line Command
Number
---------- ------ ------------------------------------------------------------
LIBR_INFO 5 q libr $1
10 q libr $1 f=d
15 q path $1 srct=serv destt=libr f=d
20 q path * srct=serv destt=dr libr=$1 f=d
25 select library_name,library_type,library_serial from
libraries where library_name ='$1'
30 select source_name,destination_name,library_name,device
serial from paths where library_name='$1'
35 select drive_name,drive_serial,element,library_name from
drives where library_name='$1'
tsm: TSMLIBM>q script LIBR_INFO f=raw
q libr $1
q libr $1 f=d
q path $1 srct=serv destt=libr f=d
q path * srct=serv destt=dr libr=$1 f=d
select library_name,library_type,library_serial from libraries where library_name ='$1'
select source_name,destination_name,library_name,device serial from paths where library_name='$1'
select drive_name,drive_serial,element,library_name from drives where library_name='$1'
Getting TSM Script Info
So you want to query a script and see what it executes but don't like the standard Q SCRIPT results? Don't forget about the FORMAT= options available. Most people know FORMAT=DETAIL but with the Q SCRIPT command there are two additional formats. FORMAT=LINE and FORMAT=RAW. I like RAW but LINE is decent if you want to see the script by sequence.
UPDATE: As reader Erwann reminded me (I had long forgotten), there is also a F=MACRO option which will display the script in a form that can be run as a macro to define the script to another TSM server. If you issue Help Q SCRIPT it does not list the MACRO option, but it is valid and does work. So you could dump all your scripts to macro format and send it to an outfile. Then you could define them to an alternate TSM server (Q SCRIPT * OUTFILE=SCRIPTS.MAC F=Macro).
tsm: TSMLIBM>q script LIBR_INFO f=macro
DEFINE SCRIPT LIBR_INFO DESC="Library path information"
UPDATE SCRIPT LIBR_INFO "q libr $1"
UPDATE SCRIPT LIBR_INFO "q libr $1 f=d"
UPDATE SCRIPT LIBR_INFO "q path $1 srct=serv destt=libr f=d"
UPDATE SCRIPT LIBR_INFO "q path * srct=serv destt=dr libr=$1 f=d"
UPDATE SCRIPT LIBR_INFO "select library_name,library_type,library_serial from libraries where library_name ='$1'"
UPDATE SCRIPT LIBR_INFO "select source_name,destination_name,library_name,device serial from paths where library_name='$1'"
UPDATE SCRIPT LIBR_INFO "select drive_name,drive_serial,element,library_name from drives where library_name='$1'"
Here are the examples:
tsm: TSMLIBM>q script LIBR_INFO f=line
Name Line Command
Number
---------- ------ ------------------------------------------------------------
LIBR_INFO 5 q libr $1
10 q libr $1 f=d
15 q path $1 srct=serv destt=libr f=d
20 q path * srct=serv destt=dr libr=$1 f=d
25 select library_name,library_type,library_serial from
libraries where library_name ='$1'
30 select source_name,destination_name,library_name,device
serial from paths where library_name='$1'
35 select drive_name,drive_serial,element,library_name from
drives where library_name='$1'
tsm: TSMLIBM>q script LIBR_INFO f=raw
q libr $1
q libr $1 f=d
q path $1 srct=serv destt=libr f=d
q path * srct=serv destt=dr libr=$1 f=d
select library_name,library_type,library_serial from libraries where library_name ='$1'
select source_name,destination_name,library_name,device serial from paths where library_name='$1'
select drive_name,drive_serial,element,library_name from drives where library_name='$1'
UPDATE: As reader Erwann reminded me (I had long forgotten), there is also a F=MACRO option which will display the script in a form that can be run as a macro to define the script to another TSM server. If you issue Help Q SCRIPT it does not list the MACRO option, but it is valid and does work. So you could dump all your scripts to macro format and send it to an outfile. Then you could define them to an alternate TSM server (Q SCRIPT * OUTFILE=SCRIPTS.MAC F=Macro).
tsm: TSMLIBM>q script LIBR_INFO f=macro
DEFINE SCRIPT LIBR_INFO DESC="Library path information"
UPDATE SCRIPT LIBR_INFO "q libr $1"
UPDATE SCRIPT LIBR_INFO "q libr $1 f=d"
UPDATE SCRIPT LIBR_INFO "q path $1 srct=serv destt=libr f=d"
UPDATE SCRIPT LIBR_INFO "q path * srct=serv destt=dr libr=$1 f=d"
UPDATE SCRIPT LIBR_INFO "select library_name,library_type,library_serial from libraries where library_name ='$1'"
UPDATE SCRIPT LIBR_INFO "select source_name,destination_name,library_name,device serial from paths where library_name='$1'"
UPDATE SCRIPT LIBR_INFO "select drive_name,drive_serial,element,library_name from drives where library_name='$1'"
Here are the examples:
tsm: TSMLIBM>q script LIBR_INFO f=line
Name Line Command
Number
---------- ------ ------------------------------------------------------------
LIBR_INFO 5 q libr $1
10 q libr $1 f=d
15 q path $1 srct=serv destt=libr f=d
20 q path * srct=serv destt=dr libr=$1 f=d
25 select library_name,library_type,library_serial from
libraries where library_name ='$1'
30 select source_name,destination_name,library_name,device
serial from paths where library_name='$1'
35 select drive_name,drive_serial,element,library_name from
drives where library_name='$1'
tsm: TSMLIBM>q script LIBR_INFO f=raw
q libr $1
q libr $1 f=d
q path $1 srct=serv destt=libr f=d
q path * srct=serv destt=dr libr=$1 f=d
select library_name,library_type,library_serial from libraries where library_name ='$1'
select source_name,destination_name,library_name,device serial from paths where library_name='$1'
select drive_name,drive_serial,element,library_name from drives where library_name='$1'
Subscribe to:
Posts (Atom)