ADSM-L

Re: [ADSM-L] TSM & client machine renames

2011-06-02 16:05:05
Subject: Re: [ADSM-L] TSM & client machine renames
From: John Underdown <JohnUnderdown AT SYNOVUS DOT COM>
To: ADSM-L AT VM.MARIST DOT EDU
Date: Thu, 2 Jun 2011 16:02:11 -0400
i used dsmadmc has a backend for a CGI script. used perl modules DBD::TSM and 
DBI, but you can call dsmadmc directly. Access was controlled thru clear text 
file that was no way related to TSM access and deleted after we were done. 
Timing was key but well documented for users to follow. Hope this helps. 

#!/usr/bin/perl -w
use CGI qw(:standard);
use CGI::Carp qw(warningsToBrowser fatalsToBrowser);
use strict;
use DBI;

print header;
print start_html("Rename TSM Node");
print end_html;

my $nodename = uc(param('nodename'));
my $rename = uc(param('rename'));
my $userid = param('userid');
my $passwd = param('passwd');

open READ, "</rename/userid.txt";

my $autherr = 1;

while (<READ>) {
  $_ =~ /(\w+)\s(\w+)/;
  if($1 eq $userid && $2 eq $passwd){
      $autherr = 0;
   }
}

close READ;

my ($sec,$min,$hour,$day,$mon,$year,$wday,$yday,$isdst)=localtime;
$year+=1900;
$mon+=1;
my $str = "$mon/$day/$year $hour:$min:$sec $userid";

open OUT, ">/rename/logs/$mon$day$hour$min$sec-$userid.log";

if ($autherr){
   print "Wrong User ID and/or Password!<br>\n";
   print OUT "$str Wrong User ID and/or Password!\n";
   exit;
}

my ($dbh1,$dbh2,$sth1,$sth2,$fs1,$fs2);

print "Renaming $nodename to $rename\n";
print OUT "$str Renaming $nodename to $rename\n";

$dbh1=DBI->connect("DBI:TSM:tsm-1","tsmadmin","tsmpw",
                     {RaiseError => 0,
                     PrintError => 0}) or die $DBI::errstr;

$dbh2=DBI->connect("DBI:TSM:tsm-1","tsmadmin","tsmpw",
                     {RaiseError => 0,
                     PrintError => 0}) or die $DBI::errstr;

$sth1=$dbh1->prepare ("q node $nodename")
   or die $dbh1->errstr;

if (!$sth1->execute()){
   print "<br><br>Node $nodename Not Found!<br>";
   print OUT "$str Node $nodename Not Found!\n";
   exit;
}

$sth1=$dbh1->prepare ("rename node $nodename $rename")
   or die $dbh1->errstr;

if ($sth1->execute()){
   print "<br><br>Renamed node $nodename to $rename<br>\n";
   print OUT "$str Renamed node $nodename to $rename\n";
}else{
   print "<br><br>Failed to rename node $nodename to $rename<br>\n";
   print OUT "$str Failed to rename node $nodename to $rename\n";
   exit;
}

$sth1=$dbh1->prepare ("update node $rename synovus1")
   or die $dbh1->errstr;

if ($sth1->execute()){
   print "<br>Changed node $rename password to synovus1<br>\n";
   print OUT "$str Changed node $rename password to synovus1\n";
}else{
   print "<br>Failed to Changed node $rename password<br>\n";
   print OUT "$str Failed to Changed node $rename password\n";
}

$sth1=$dbh1->prepare ("select FILESPACE_NAME from filespaces where 
node_name='$rename'")
   or die $dbh1->errstr;

$nodename = lc($nodename);
$rename = lc($rename);

if ($sth1->execute()){
   while (($fs2) = $sth1->fetchrow_array) {
      $fs1 = $fs2;
      if ($fs2 =~ s/$nodename/$rename/){
         $sth2=$dbh2->prepare ("rename filespace $rename $fs1 $fs2 namet=uni")
           or die $dbh2->errstr;
         if ($sth2->execute()){
            print "<br>Renamed filespace  $rename $fs1 $fs2<br>\n";
            print OUT "$str Renamed filespace  $rename $fs1 $fs2\n";
         }else{
            print "<br>Failed to rename filespace  $rename $fs1 $fs2<br>\n";
            print OUT "$str Failed to renamed filespace  $rename $fs1 $fs2\n";
         }
      }
   }
}

$dbh1->disconnect;
$dbh2->disconnect;
close OUT;

From:   Paul Zarnowski <psz1 AT CORNELL DOT EDU>
To:     ADSM-L AT VM.MARIST DOT EDU
Date:   06/02/2011 10:59 AM
Subject:        [ADSM-L] TSM & client machine renames
Sent by:        "ADSM: Dist Stor Manager" <ADSM-L AT VM.MARIST DOT EDU>

Hello all,

We are contemplating a massive Active Domain reorganization which would
involve renaming hundreds of Windows machines that we backup into TSM.  We
forsee a few problems with this, and I am looking to see if any other TSM
sites have faced a similar problem and what they did to address it.

The problems:
1. Renaming a Windows system will result in TSM making a fresh backups for
the volumes on that system (because the system name is part of the
filespace name).  Renaming the filespace on the TSM server will address
this, but timing is a problem.  If you rename the filespace a day early or
a day late, you will still end up with extra backups.

2. TSM likes to replace DOMAIN C: statements with DOMAIN \\systemname\C$.
If the systemname changes, then the TSM backup will fail, because it won't
be able to find the old systemname (unless and until the DOMAIN statement
is updated).  Again, with so many machines, updating all those DSM.OPT
files will be problematic.

3. If we have a large number of unintended extra backups, TSM server
resources (database size and stgpool capacity) will be stretched.


Having a tool that would allow our customers to rename their TSM
filespaces on-demand would be a big help.  As we do not give out policy
domain privileges, we cannot use dsmadmc to do this.  I am looking for
other solutions that any of you might have developed, or even just thought
about.  If the TSM BA client allowed a user to rename their filespace,
that would be a great solution.  But it's not there.

Thanks for any help (or condolences).

..Paul


--
Paul Zarnowski                            Ph: 607-255-4757
Manager, Storage Services                 Fx: 607-255-8521
719 Rhodes Hall, Ithaca, NY 14853-3801    Em: psz1 AT cornell DOT edu


U.S. BANCORP made the following annotations
---------------------------------------------------------------------
Electronic Privacy Notice. This e-mail, and any attachments, contains 
information that is, or may be, covered by electronic communications privacy 
laws, and is also confidential and proprietary in nature. If you are not the 
intended recipient, please be advised that you are legally prohibited from 
retaining, using, copying, distributing, or otherwise disclosing this 
information in any manner. Instead, please reply to the sender that you have 
received this communication in error, and then immediately delete it. Thank you 
in advance for your cooperation.



---------------------------------------------------------------------


-----------------------------------------
NOTICE: This communication is intended only for the person or
entity to whom it is addressed and may contain confidential,
proprietary, and/or privileged material. Unless you are the
intended addressee, any review, reliance, dissemination,
distribution, copying or use whatsoever of this communication is
strictly prohibited. If you received this in error, please reply
immediately and delete the material from all computers. Email sent
through the Internet is not secure. Do not use email to send us
confidential information such as credit card numbers, PIN numbers,
passwords, Social Security Numbers, Account numbers, or other
important and confidential information.

<Prev in Thread] Current Thread [Next in Thread>