Results 1 to 11 of 11
  1. #1
    Member cozcol's Avatar
    Join Date
    Sep 2008
    Location
    Auckland, New Zealand
    Posts
    107
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question TSM Script to Free up tapes which are almost empty

    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. #2
    Senior Member
    Join Date
    Dec 2009
    Location
    Sydney, Australia
    Posts
    384
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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

  3. #3
    Member
    Join Date
    Jun 2008
    Location
    Montreal, Canada
    Posts
    115
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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.

  4. #4
    Senior Member Trident's Avatar
    Join Date
    Apr 2007
    Location
    Oslo, Norway
    Posts
    272
    Thanks
    2
    Thanked 19 Times in 19 Posts

    Default

    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
    -= Trident =-

  5. #5
    Moderator
    Join Date
    Nov 2005
    Location
    Victoria, Australia
    Posts
    537
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default

    Quote Originally Posted by cozcol View Post
    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.
    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

  6. #6
    Member cozcol's Avatar
    Join Date
    Sep 2008
    Location
    Auckland, New Zealand
    Posts
    107
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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.

  7. #7
    Senior Member javajockey's Avatar
    Join Date
    Dec 2007
    Location
    Yorktown
    Posts
    265
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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

  8. #8
    Moderator
    Join Date
    Nov 2005
    Location
    Victoria, Australia
    Posts
    537
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default

    btw.... if doing a move data... you need to be using "reconst=yes"

  9. #9
    Moderator
    Join Date
    Dec 2007
    Location
    Brisbane, Australia
    Posts
    322
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default

    If you're moving from and to a sequential access device, reconstr=yes is the default I believe.
    -Chris

  10. #10
    Senior Member Trident's Avatar
    Join Date
    Apr 2007
    Location
    Oslo, Norway
    Posts
    272
    Thanks
    2
    Thanked 19 Times in 19 Posts

    Default

    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
    -= Trident =-

  11. #11
    Newcomer
    Join Date
    Jun 2009
    Location
    Hyderabad, India
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default 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



    Quote Originally Posted by cozcol View Post
    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.

Similar Threads

  1. how to empty returning DR tapes
    By umur in forum Disaster Recovery Module
    Replies: 14
    Last Post: 06-19-2009, 12:14 PM
  2. Pending/Empty Script
    By GregE in forum Scripting
    Replies: 4
    Last Post: 07-03-2008, 11:01 AM
  3. Query for tapes that have gone empty
    By krissie in forum Scripting
    Replies: 1
    Last Post: 11-15-2006, 09:36 AM
  4. Any Command to Check Empty/Free Slot in the Tape Library ?
    By Janice in forum Tape / Media Library
    Replies: 4
    Last Post: 08-22-2006, 09:58 AM
  5. Replies: 1
    Last Post: 01-27-2004, 03:04 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •