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.

Reclamation Automation

Discussion in 'Scripting' started by eFinity, Dec 17, 2009.

  1. eFinity

    eFinity New Member

    Joined:
    Oct 6, 2009
    Messages:
    7
    Likes Received:
    0
    Occupation:
    Senior DataCenter Specialist
    Location:
    istanbul
    Hi,

    I wrote a script to automate the reclamation process on TSM running on AIX. Script queries the STGs that have volumes with PCTUtil below 10%.


    Here is the script:
    :rolleyes::rolleyes:
    #!/bin/ksh
    dsmadmc -id=USERID -pa=PWD -dataonly=yes "select distinct e1.STGPOOL_NAME from volumes e1, libvolumes e2 where e1.volume_name=e2.volume_name and e1.status='FULL' and e1.PCT_UTILIZED < 10 order by e1.STGPOOL_NAME desc" > /home/SCRIPTS/rcl.txt

    for i in $(cat /home/SCRIPTS/rcl.txt | awk '{ print $1}')

    do

    echo "THIS WILL BE THE COMMAND: reclaim stg $i th=90"

    dsmadmc -id=USERID -pa=PWD "reclaim stg $i th=90"

    done

    :rolleyes::rolleyes:

    I also defined a client schedule for tsm server node for the script to run every 8 hours.

    The problem with the script is if there is no STG returned from the sql command or there is a job for the returned STG going on, script generates error.

    I hope it also works for you and also hope someone can help me with the error messages.
     
  2.  
  3. BBB

    BBB Moderator

    Joined:
    Feb 13, 2007
    Messages:
    2,076
    Likes Received:
    19
    Location:
    Brisbane, Australia
    Why are you only reclaiming full volumes? And you should use the %reclaim value rather than %used.

    And why not just set the reclamation thresholds to what you want all the time if thats what you want. Otherwise have a schedule update the stgpool thresholds at the time you want to run reclamation.

    So not really sure what this script does that couldn't be done in a much simpler way.
     
  4. eFinity

    eFinity New Member

    Joined:
    Oct 6, 2009
    Messages:
    7
    Likes Received:
    0
    Occupation:
    Senior DataCenter Specialist
    Location:
    istanbul
    It's my choise. I have copy pool process and not enough drives. :) And since I only look for full volumes, PCT_Util = 100 - PCT_Reclaim.
     
  5. Samuel

    Samuel New Member

    Joined:
    Jul 9, 2008
    Messages:
    286
    Likes Received:
    1
    Me, i have define a script :
    PARRALLEL
    reclaim stg stgpool_name thres=%
    reclaim stg stgpool_name2 thres=%
    ...

    and a script to stop reclaim
    upd stg stgpool_name thres=100
    upd stg stgpool_name2 thres=100
    ...
     

Share This Page