I'm weeding my collocgroups, and I decided my management script is
getting smooth enough that I'd consider exposing it for you-all to
take and beat upon if you desire. Throw tomatoes, kibitz, fix my
bustedness, whatever. :)
http://nersp.osg.ufl.edu/~asr/media/cg/
In there are:
the script itself, calc-collcation-groups
My local version of the "connect PERL to the TSM server" code,
tsm_query.pm
An example of verbose output showing something of the "train of
thought" of the code.
There are several things you'd have to change, to get it to function
in your environment:
0) comment out tsm_config.pm, and either comment out or use my
tsm_query.pm
1) list of servers. I get mine from a global config I maintain;
utterly unportable. You can plug in your own config, or just
literally list some servers at the spot where I say
if ($#{$server} > -1 ) {@servers = @{$server} ;} else {@servers = keys
%$config;}
... Something like
@servers = ("name1", "name2", "etc");
will do the trick.
2) Names of primary stgpools. 'Q nodedata' does not accept a
particularly flexible set of arguments. I stuck a pattern in there
which expands to (semantically) "my primary tape stgpool".
Collocgroup analysis is, of course, per-stgpool. You'll want to
analyze separately per-stgpool.
Change that pattern on the line where I say:
# ICK! Constant storagepool convention, ICK!
Here's the basic procedure.
I define a target size of the volumes in a devclass, a percentage
of the nominal capacity of the volume
I define collocgroups by policy domain. Groups are named
[DOMAINNAME]-[digits]. So, ERP has groups ERP-1 ERP-2, etc. etc.
Walk through all the nodes.
Nodes with primary occupation in excess of target size are not
candidates for collocgroup membership. If they're in a group now,
generate the statement to remove them. Otherwise, skip.
For nodes with primary occupation less than target size, walk
through the domain's existing collocgroups, and look for one with
enough room to add it, and still remain less than target size.
Generate the statment to add.
After looking at all the nodes, note which domains need more
collocgroups, and how many are necessary to accomodate the
overflow.
Look at all "tiny" tapes (tapes with occupation less than a set
percentage of the target size). If they're in a collocgroup that
has other tapes with enough space to fit, then generate the move
data statement to clear the tapes.
- Allen S. Rout
|