cookbook:tsm
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
cookbook:tsm [2018/10/18 22:03] – [Syncronization] Scott Cunliffe | cookbook:tsm [2025/01/21 22:07] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Tivoli Storage Manager Sync Cookbook ====== | ====== Tivoli Storage Manager Sync Cookbook ====== | ||
- | Tivoli Storage Manager (or TSM) is IBM's enterprise backup solution, and provides both a command line interface program that can be used to query the information required for synchronization, and ODBC driver that allows you to directly query data from the TSM database. | + | Tivoli Storage Manager (or TSM) is IBM's enterprise backup solution, and provides both a [[technote: |
TSM is designed around several database tables that must be queried to get a complete list of tapes. | TSM is designed around several database tables that must be queried to get a complete list of tapes. | ||
Line 7: | Line 7: | ||
These tables are: | These tables are: | ||
* **The DRM Table**. This table lists all tapes are considered critical for recovery purposes. | * **The DRM Table**. This table lists all tapes are considered critical for recovery purposes. | ||
- | * **The Volume Table**. This table lists all tapes that contain active data for a given TSM system. Any Volume that become scratch and is no longer managed by the DRM subsystem will be dropped from this table. | + | * **The Volume Table**. This table lists all tapes that contain active data for a given TSM system. Any [[object: |
- | * **The Library Table**. This table is only available on servers that are considered library masters and lists all Volumes that are in an ATL environment. This table will also include scratch tapes that are currently in an ATL. | + | * **The Library Table**. This table is only available on servers that are considered library masters and lists all [[object: |
- | <note tip>The location field in the Volume and state field DRM tables do not represent the same value. The location field in the Volume table represents the perceived current location of a Volume, while the state field in the DRM table may represent the current location, but may also represent the destination location of a tape. | + | <note tip>The location field in the [[object: |
</ | </ | ||
- | <note tip>TSM will drop Volumes from both the Volume and DRM tables when they become scratch. Although these Volumes may now be in an ATL and visible by querying the Library Master Server, they may also be elsewhere, including a scratch rack and not appear in any TSM table. To identify any scratch tapes that may have evaded being recalled from off-site, it is good practice to set the SCRATCH field during each synchronization and to periodically run the [[cli: | + | <note tip>TSM will drop [[object: |
+ | ===== Data Extraction From TSM ===== | ||
+ | |||
+ | The first step in synchronizing your TSM Library with TapeTrack is to extract the [[object: | ||
+ | |||
+ | Using the Tivoli Storage Manager administrative tool dsmadmc, the [[object: | ||
+ | |||
+ | {{dsmadmc_extract.png}} | ||
===== The dsmadmc command ===== | ===== The dsmadmc command ===== | ||
Line 20: | Line 27: | ||
=== From the DRM table: === | === From the DRM table: === | ||
- | <sxh> | + | |
- | dsmadmc -dataonly=yes -id=userid -pa=password -tcpserveraddress=tsm01.gazillabyte.local -displaymode=table -outfile=TSM-DRM.csv -commadelimited " | + | From the DRM table, select the fields: |
- | </sxh> | + | * volume_name: |
+ | * state: Used to determine the location the [[object: | ||
+ | * stgpool_name: | ||
+ | |||
+ | <code> | ||
+ | dsmadmc -dataonly=yes -id=userid -pa=password -tcpserveraddress=tsm01.gazillabyte.local | ||
+ | | ||
+ | </code> | ||
=== From the Volume table: === | === From the Volume table: === | ||
- | <sxh> | ||
- | dsmadmc -dataonly=yes -id=userid -pa=password -tcpserveraddress=tsm01.gazillabyte.local -displaymode=table -outfile=TSM-Volumes.csv -commadelimited " | ||
- | </ | ||
- | ===== Syncronization | + | From the [[object: |
+ | * volume_name: | ||
+ | * location: Used to determine the location the [[object: | ||
+ | * stgpool_name: | ||
+ | < | ||
+ | dsmadmc -dataonly=yes -id=userid -pa=password -tcpserveraddress=tsm01.gazillabyte.local \ | ||
+ | -displaymode=table -outfile=TSM-VOL.csv -commadelimited " | ||
+ | </ | ||
+ | |||
+ | Output CSV files should be written to a directory where the TapeTrack Sync command can access them as input files for the Sync process. | ||
+ | |||
+ | ===== Synchronization | ||
<note important> | <note important> | ||
- | Synchronization with TapeTrack is performed by calling the [[cli: | + | Synchronization with TapeTrack is performed by calling the [[cli: |
- | | + | |
- | | + | |
- | | + | |
+ | |||
+ | {{tsm_sync.png}} | ||
+ | |||
+ | The [[cli: | ||
=== Example Command Line Arguments === | === Example Command Line Arguments === | ||
Line 42: | Line 68: | ||
Sync command line using DRM output | Sync command line using DRM output | ||
- | <sxh> | + | <code> |
TMSS10Sync -a -d TSM-DRM.ttidef -S user: | TMSS10Sync -a -d TSM-DRM.ttidef -S user: | ||
- | </sxh> | + | </code> |
Where: | Where: | ||
- | * '' | + | * '' |
- | * '' | + | * '' |
- | * '' | + | * '' |
* '' | * '' | ||
Sync command line using Volume output | Sync command line using Volume output | ||
- | <sxh> | + | <code> |
- | TMSS10Sync -a -d TSM-DRM.ttidef -S user: | + | TMSS10Sync -a -d TSM-VOL.ttidef -S user: |
- | </sxh> | + | </code> |
Where: | Where: | ||
- | * '' | + | * '' |
- | * '' | + | * '' |
- | * '' | + | * '' |
* '' | * '' | ||
=== Example batch file showing Sync process with dsmadmc extracted data and process output === | === Example batch file showing Sync process with dsmadmc extracted data and process output === | ||
- | <sxh> | + | <code> |
#!/bin/bash | #!/bin/bash | ||
Line 91: | Line 117: | ||
# Synchronize off the DRM table. | # Synchronize off the DRM table. | ||
# | # | ||
- | TMSS10Sync -a -d $ETC/ | + | TMSS10Sync -a -d $ETC/ |
echo "Step 3: Extracting Volume information from TSM Server: " $TSMIP | echo "Step 3: Extracting Volume information from TSM Server: " $TSMIP | ||
Line 113: | Line 139: | ||
echo TMSS10MoveScratch -S user: | echo TMSS10MoveScratch -S user: | ||
- | </sxh> | + | </code> |
- | === Example Synchronization Definition === | + | === Example Synchronization Definition |
<note tip>TSM is highly configurable, | <note tip>TSM is highly configurable, | ||
- | * **Mountable** The Volume is available for use. | + | * **Mountable**: The Volume is available for use. |
- | * **Courier** The Volume is waiting to be picked-up to be take off-site. | + | * **Courier**: The Volume is waiting to be picked-up to be taken offsite. |
- | * **Courier Retrieve** The Volume | + | * **Vault**: The Volume |
- | * **Vault** The Volume | + | * **Vault |
- | * **Vault Retrieve** The Volume | + | * **Courier |
- | The following definition | + | |
+ | |||
+ | The following definition | ||
</ | </ | ||
- | <sxh> | + | ===TSM-VOL TTIDEF File=== |
- | # | + | <code> |
- | # Set input file | + | # Volume TTIDEF |
- | # | + | |
- | SetFile("TSM-Volume.csv"); | + | # Set CSV delimiter |
- | # | + | SetCSVDelimiter(","); |
- | # Set the Customer and Media as literal values as they never change | + | |
# | # | ||
+ | # Set Customer and Media values as they remain constant | ||
SetLiteral(CUSTOMER, | SetLiteral(CUSTOMER, | ||
SetLiteral(MEDIA, | SetLiteral(MEDIA, | ||
- | # | + | |
- | # Set the delimiter to a CSV | + | # Extract |
- | # | + | |
- | SetCSVDelimiter("," | + | |
- | # | + | |
- | # Set the Volume ID | + | |
- | # | + | |
Extract(VOLUME, | Extract(VOLUME, | ||
- | # | ||
- | # Set the volume description from pool name | ||
# | # | ||
+ | # Extract Scratch value for comparison | ||
+ | Extract(SCRATCH, | ||
+ | |||
+ | # Extract Description | ||
Extract(DESCRIPTION, | Extract(DESCRIPTION, | ||
+ | RemoveSpaces(DESCRIPTION); | ||
+ | |||
+ | # If Scratch = Vault skip, anything else set SCRATCH to true | ||
+ | AddTranslation(SCRATCH, | ||
+ | AddTranslation(SCRATCH, | ||
+ | |||
+ | # Exclude any lines starting with . or / | ||
+ | AddString(EXCLUSION, | ||
+ | AddString(EXCLUSION, | ||
+ | |||
+ | </ | ||
+ | |||
+ | |||
+ | ===TSM-DRM TTIDEF File=== | ||
+ | |||
+ | < | ||
+ | # DRM TTIDEF | ||
+ | |||
+ | # Set CSV delimiter | ||
+ | SetCSVDelimiter("," | ||
# | # | ||
- | # Get the repository value | + | # Set Customer and Media values as they remain constant |
- | # | + | SetLiteral(CUSTOMER, |
+ | SetLiteral(MEDIA, | ||
+ | |||
+ | # Extract Volume-ID | ||
+ | Extract(VOLUME, | ||
+ | |||
+ | # Extract Repository value | ||
Extract(REPOSITORY, | Extract(REPOSITORY, | ||
- | # | + | RemoveSpaces(REPOSITORY); |
- | # Translate repository value based off initial | + | |
- | # If Repository = Vault, Courier or Courier Retrieve set Repository to OFFS | + | # Extract Scratch |
- | # If Repository = Anything else (Mountable, Vault Retrieve) set Repository to LIBR | + | Extract(SCRATCH, 2, 20, 0); |
- | # | + | RemoveSpaces(SCRATCH); |
- | AddTranslation(REPOSITORY, "Vault", "OFFS"); | + | |
- | AddTranslation(REPOSITORY, "Courier*", " | + | # Translate Scratch value |
+ | AddTranslation(SCRATCH, "VAULTRETRIEVE", "true"); | ||
+ | AddTranslation(SCRATCH, "*", " | ||
+ | |||
+ | # Translate Repository value | ||
+ | AddTranslation(REPOSITORY, | ||
AddTranslation(REPOSITORY, | AddTranslation(REPOSITORY, | ||
- | # | + | AddSkipOnRepositoryChange(" |
- | # Set all volumes to scratch | + | |
- | # | + | # Exclude any lines starting with . or / |
- | SetLiteral(SCRATCH, "false"); | + | AddString(EXCLUSION, 0, ".*" |
- | </sxh> | + | AddString(EXCLUSION, |
+ | </code> | ||
+ | |||
+ | <- : | ||
- | <- :cookbook: | + | {{tag> |
cookbook/tsm.1539900189.txt.gz · Last modified: 2025/01/21 22:07 (external edit)