1. Forum Rules (PLEASE CLICK HERE TO READ BEFORE POSTING) Click the link to access ADSM.ORG Acceptable Use Policy and forum rules which should be observed when using this website. Violators may be banned from this website. This message will disappear after you have made at least 12 posts. Thank you for your cooperation.

TSM Script to Free up tapes which are almost empty

Discussion in 'TSM Operation' started by cozcol, Feb 11, 2010.

  1. cozcol

    cozcol New Member

    Joined:
    Sep 11, 2008
    Messages:
    107
    Likes Received:
    0
    Occupation:
    Unix, Linux, AIX, Solaris, Tru64, TSM, Veritas, Ne
    Location:
    Auckland, New Zealand
    Hi Guys and girls,

    I am trying to get this script working which will free up almost empty tapes.

    Free up tapes which are almost empty

    for volume in $(dsmadmc -id=xxxx -pass=xxxx -outfile "select 'MARKER', volume_name from volumes where pct_utilized <10 " | grep '^MARKER' | cut -b 12-) ; do dsmadmc -id=xxxx -pass=xxxx -outfile 'move data ${volume}' ; done


    BUT ( The BIG BUT)

    Not quite working as desired yet!!!

    Script is logging in and the grep and cut are working ok.

    BUT the TSM server has some confusion over the variable for volumes.

    Any ideas chaps?

    ANS8000I Server command: 'move data ${volume}'
    ANR2401E MOVE DATA: Volume ${volume} is not defined in a storage pool.
    ANS8001I Return code 11.
     
  2.  
  3. TonyB

    TonyB Senior Member

    Joined:
    Dec 10, 2009
    Messages:
    384
    Likes Received:
    9
    Location:
    Sydney, Australia
    Reclamation not doing it for you?

    You've got a single quote around the 'move data ${volume}' chunk...use double rather than single quotes and shell expansion will occur...

    T
     
  4. Phil_02GT

    Phil_02GT New Member

    Joined:
    Jun 26, 2008
    Messages:
    118
    Likes Received:
    2
    Occupation:
    TSM admin
    Location:
    Montreal, Canada
    As TonyB said, is there any reasons not to use reclamation ?

    If you have volumes where pct_utilized <10 but there are no other volumes in filling status in this storage pool/collocation group you're just going to move the data around without any benefit.
     
  5. Trident

    Trident Senior Member

    Joined:
    Apr 2, 2007
    Messages:
    286
    Likes Received:
    26
    Occupation:
    IT operations
    Location:
    Oslo, Norway
    Hi,

    I have modified the script slightly to suit my needs. I had 100s of virtual volumes that had 100% util, but was only a few Mb in size. Each of these volumes eat up a 40Gb chunk on my tapes.

    Replace StanzaName with your own
    Replace XXXXXX with your password
    Replace DestStgPool with your own STG
    Replace SrcStgPool with your own STG


    Code:
    #!/bin/bash
    for volume in $(dsmadmc -se=StanzaName  -id=admin -pa=XXXXXXXXX  -tab  -dataonly=yes  "select 'MARKER',volume_name from volumes where stgpool_name='SrcStgPool' and EST_CAPACITY_MB<10" |grep '^MARKER' | cut -b 8-); do
    dsmadmc -se=StanzaName -id=admin -pa=XXXXXXX move data ${volume} stg=DestStgPool wait=yes
    done
    
    
     
  6. mateinone

    mateinone Moderator

    Joined:
    Nov 21, 2005
    Messages:
    537
    Likes Received:
    2
    Occupation:
    TSM Specialist
    Location:
    Victoria, Australia
    Not completely sure what you are trying to achieve or why you have the MARKER option etc etc.. but basically the following should do what you are looking to do.. but remember there may be other reasons why your data is storing like that. So if they are all 10% or less written to, but 90%+ free. Have you checked the collocation settings etc to make sure you are not going to do all of this processing for no gain?


    #!/usr/bin/ksh
    tsm="dsmadmc -id=xxxx -pass=xxxx -dataonly=yes -comma"
    volumes=`$tsm "select volume_name from volumes where pct_utilized <10"`
    for volume in $volumes
    do
    $tsm "move data $volume"
    done
     
  7. cozcol

    cozcol New Member

    Joined:
    Sep 11, 2008
    Messages:
    107
    Likes Received:
    0
    Occupation:
    Unix, Linux, AIX, Solaris, Tru64, TSM, Veritas, Ne
    Location:
    Auckland, New Zealand
    No Reclamation just isn't doing it's whole job for me.

    I have soo many volumes which are <10% utilised and 0% utilised on many, but these are never getting recalled back from offsite tape storage.

    Good point on the Collocation, may have to check through this.

    But TSM is reporting tapes which need to go offsite but is not requesting tapes back.
     
  8. javajockey

    javajockey Senior Member

    Joined:
    Dec 26, 2007
    Messages:
    265
    Likes Received:
    6
    Occupation:
    Server Operations
    Location:
    Yorktown
    You many have your offsite reclamation set too high. Try running reclaim with the threshold of 95 for example
    Code:
    reclaim stg copypool th=95 du=100
    That will target those those "highly reclaimable" tapes
     
  9. mateinone

    mateinone Moderator

    Joined:
    Nov 21, 2005
    Messages:
    537
    Likes Received:
    2
    Occupation:
    TSM Specialist
    Location:
    Victoria, Australia
    btw.... if doing a move data... you need to be using "reconst=yes"
     
  10. cjhood

    cjhood Moderator

    Joined:
    Dec 11, 2007
    Messages:
    322
    Likes Received:
    10
    Occupation:
    Storage Administrator - TSM/SAN
    Location:
    Brisbane, Australia
    If you're moving from and to a sequential access device, reconstr=yes is the default I believe.
     
  11. Trident

    Trident Senior Member

    Joined:
    Apr 2, 2007
    Messages:
    286
    Likes Received:
    26
    Occupation:
    IT operations
    Location:
    Oslo, Norway
    Hi,

    I have modified the script again.

    This time it will take the volumes with the least amount of data on it, and move it to another stgpool. This script works well for me, and saves me for a lot of half used tapes.



    Replace StanzaName with your own
    Replace XXXXXX with your password
    Replace DestStgPool with your own STG
    Replace SrcStgPool with your own STG


    Code:
    #!/bin/bash
    dsmadmc -se=StanzaName -id=admin -pa=XXXXXX  -tab  -dataonly=yes  "select count(volume_name) from volumes where stgpool_name='SrcStgPool' and EST_CAPACITY_MB*PCT_UTILIZED/100<4000 and STATUS='FULL'"
    for volume in $(dsmadmc -se=StanzaName -id=admin -pa=XXXXXX  -tab  -dataonly=yes  "select 'MARKER',volume_name from volumes where stgpool_name='SrcStgPool' and EST_CAPACITY_MB*PCT_UTILIZED/100<4000 and STATUS='FULL'" |grep '^MARKER' | cut -b 8-); do
    echo ${volume}
    dsmadmc -se=StanzaName -id=admin -pa=XXXXXX move data ${volume} stg=DestStgPool wait=yes
    done
    
     
  12. taraka77

    taraka77 New Member

    Joined:
    Jun 9, 2009
    Messages:
    6
    Likes Received:
    0
    Location:
    Hyderabad, India
    Reuse Delay

    Offsite volume won't come back even though utilization is 0%, until 'reuse delay' is met. So, Check 'reuse delay' configuration on the storage pool



     

Share This Page