TSM and tape libraries.
![]() |
|
TSM - Library Tape Management
Moving Tapes offsite
Freeing up library slots
Reclaiming offsite tapes
Regenerating a library definition
Reclaiming tapes that are assigned to another TSM server
Reporting on tape usage
Checkin and Checkout
Moving Tapes offsite
There are two parts to volume movement, updating TSM so its knows what is happening with the volumes; and physically managing the automated library inventory by using checkin/checkout commands.
If you are planning to take tapes offsite to a vault, then the important step is to update the access mode of those volumes to 'OFFSITE'. This tells TSM that it can still so some data processing like Reclamation and Move Data commands, but it will NEVER request a mount of the actual volume (it uses the primary copy instead). Note that only copy pool volumes can be set to 'OFFSITE' - this is because TSM always expects to have its primary pool volumes available (i.e.:mountable). The checkout operation for the offsite copypool volumes is a necessary extra step to get the tapes out of the library inventory.
Freeing up library slots
If your library becomes full, you may need to free up some slots. The trick is to eject older tapes from the library that you are not likely to use for a while, and keep the active tapes in the library. The 'MOVE MEDIA' command gives us the ability to have a combination automatic/manual library. We can 'move' tapes outside of the library to a nearby 'location', but the tapes are still considered as mountable. The distinction is whether they have the media state of 'MOUNABLEINLIB' or 'MOUNTABLENOTINLIB', and this tells TSM whether to ask the robot for to mount the volume or to issue a manual mount request. When processing an manual mount request, you must use the 'Checkin Libvol' command to update the library inventory and tell TSM that the tape is back in the robot (since that is ultimately how the tape gets mounted).
TSM will automatically toggle the volume's access mode from ReadOnly to ReadWrite and back again as it is moved in and out of the library. This is to allow any read operations to proceed (e.g.: restore) and cause a manual mount request, but write operations will not attempt to access the volume.
Reclaiming offsite tapes
You don't have to bring your offsite tapes in to do reclamation.
Set your copypool reclamation to a reasonable level, say 60%. TSM knows what files are still valid on offsite volumes that are to be reclaimed. It finds the copies of those files in the primary storage pool (which is still in the library); it moves a scratch tape to the copy pool and copies the files from the primary tape pool to the new copypool tape. The new copy tape is then marked to go offsite, and the old one marked for return.
Re-generating a library definition
Sometimes, especially with TSM servers hosted on Windows, it is necessary to delete and redefine a tape libary. After you remove the tape paths, you have to delete the library itself to remove the TSM server library inventory. You do this with the 'delete library library_name' command. Once you re-define the library and paths, you need to re-generate the library inventory by running the following commands, which must be run in the sequence shown.
Checkin the scratch volumes
checkin libvol library_name search=yes checklabel=barcode status=scratch
Checkin the private volumes
checkin libvol library_name search=yes checklabel=barcode status=private
Reclaiming tapes that are assigned to another TSM server
Imagine the scenario, you are using one TSM as a Library Manager, called TSM1, with maybe 3 other instances sharing the library. You decommission one of those instances, say its called TSM3, reclaim the physical server, then discover that TSM3 still has a lot of tapes allocated in the Library manager. The data is defunct, it's all been moved to other TSM servers and you want to reclaim those tapes as scratch. You can't change the tape to scratch status from TSM1 as it does not own the tapes. If you check them out and back in again, they are still owned by TSM3. You can't change the owner, so what do you do?
The problem is that TSM1 contains records about these tapes in it's volhist file. You need to delete the volhist record on TSM1 for each tape with this command. Put your own volume names in and be absolutely sure to get the names right or you will delete the wrong tapes!
DEL VOLHIST TODATE=TODAY TYPE=REMOTE VOLUME=volume-name FORCE=YES UPD LIBR library-name volume-name STAT=SCR
Reporting on Tape usage
The following query will produce a report of the space usage of all storage pool volumes, summarised by storage pool and status.
SELECT STGPOOL_NAME AS STGPOOL, COUNT(VOLUME_name) AS COUNT, STATUS, CAST(MEAN(EST_CAPACITY_MB/1024) AS DECIMAL(5,2)) AS GB_PER_VOL FROM VOLUMES GROUP BY STGPOOL_NAME,STATUS
Example output is shown below
STGPOOL COUNT STATUS GB_PER_VOL ------------- ----------- --------- ---------- ARCHCOPYPOOL 417 FULL 1.10 ARCHIVEPOOL 2 ONLINE 2.78 ARCHTAPEPOOL 2 FILLING 27.58 ARCHTAPEPOOL 2 FULL 49.60 BACKUPPOOL 7 ONLINE 38.26 CARTPOOL 1 EMPTY 0.00 CARTPOOL 221 FILLING 22.01 CARTPOOL 1021 FULL 33.99
Checking and Checkout
TSM needs to know where it's tapes are if they are stored in tape libraries and to keep it informed you use CHECKIN and CHECKOUT commands
A tape library has a small compartment usually called an IO station with a door. You place your new cartridges into the IO station then run a checkin command. The syntax of the command varies slightly depending on what type of library you have. The command for a SCSI library is
Checkin libv Library_name search=bulk checklabel=yes status=scr
This will read in all the tapes in the IO station, read the labels and define them to TSM as scratch. To check in a single named tape that contains required data, maybe something you are importing from a different system, try
Checkin libv Library_name Volume_name checklabel=yes
Both CHECKIN and CHECKOUT commands will issue a console message asking you to confirm you are ready. Reply to the message with 'REPLY nn' where nn is the message number.
However be aware that the robot will select the first tape from the IO station, it will not scan the IO station for your tape. I've had the Library Manager tell me the IO station was empty apart from a specific tape that I wanted, yet TSM kept selecting an incorrect tape on checkin. Eventually I tried a bulk checkin and then discovered there was four foreign tapes in the IO station.
If you have lots of tapes to input to TSM you can power your library down, open the main door, then just put the tapes directly into empty libary slots. You then power the library up and run an audit, then a bulk checkin to TSM like this
CHECKIN LIBV library_name SEARCH=YES CHECKL=B
If you have some unallocated tapes in your library, maybe because they were checked out with the REMOVE=NO parameter, and you want them checked in as scratch, use the following command - it compares the TSM database with the library database and will just check in tapes that TSM did not know about and set them to scratch status.
CHECKIN LIBVOL library_name STATUS=scratch SEARCH=YES CHECKL=B
Most of us have several TSM servers that share a physical library. This is done by partitioning the library into several logical libraries. Say you have two servers, TSM1 and TSM2 each with virtual libraries VLIB1 and VLIB2 In this case it is quite easy to transfer data between TSM servers. You run an Export, note the tape used (xyz123) then check it out VLIB1 like this
CHECKOUT LIBV VLIB1 xyx123 REMOVE=YES
This will place the tape into the IO station. You then log into the Library Manager (the control software for the tape library) and re-assign the tape from VLIB1 to VLIB2. Finally you check it back in with
CHECKIN LIBV VLIB2 tapeno xyz123 STAT=PRI CHECKL=YES
If you find the tape is rejected with an invalid label, try a bulk checkin.
If a volume has been removed from the library, but TSM has not been informed you can clear it from TSM with the command below. Checklabel=no and remove=no means that TSM will do no validation, it just removes it from the database.
Checkout libvolume Library_name Volume_name checklabel=no remove=no
