allow extra scripts to be run with snmove command

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@9289 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
linggao 2011-04-12 20:27:22 +00:00
parent d8c5a3c51d
commit 990d9ada0b
3 changed files with 495 additions and 406 deletions

View File

@ -4,9 +4,9 @@ B<snmove> - Change xCAT compute nodes to use a different xCAT service node.
=head1 SYNOPSIS
B<snmove> I<noderange> [B<-d>|B<--dest> I<sn2>] [B<-D>|B<--destn> I<sn2n>] [B<-i>|B<--ignorenodes>]
B<snmove> I<noderange> [B<-d>|B<--dest> I<sn2>] [B<-D>|B<--destn> I<sn2n>] [B<-i>|B<--ignorenodes>] [B<-P>|B<--postscripts> I<script1,script2...>|I<all>]
B<snmove> B<-s>|B<--source> I<sn1> [B<-S>|B<--sourcen> I<sn1n>] [B<-d>|B<--dest> I<sn2>] [B<-D>|B<--destn> I<sn2n>] [B<-i>|B<--ignorenodes>]
B<snmove> B<-s>|B<--source> I<sn1> [B<-S>|B<--sourcen> I<sn1n>] [B<-d>|B<--dest> I<sn2>] [B<-D>|B<--destn> I<sn2n>] [B<-i>|B<--ignorenodes>] [B<-P>|B<--postscripts> I<script1,script2...>|I<all>]
B<snmove> [B<-h>|B<--help>|B<-v>|B<--version>]
@ -72,7 +72,7 @@ If it is an AIX diskful node then the B<niminit> command will be run so that it
=back
Note: You can also run other postscripts using the B<updatenode> command if needed.
Note: You can also run other postscripts useing -P option if needed.
When the B<snmove> command is executed the new service node must be running but
the original service node may be down.
@ -101,6 +101,10 @@ Specifies the hostname of the destination service node as known by (facing) the
No modifications will be made on the nodes. If not specified, several xCAT postscripts will be run on the nodes to complete the switch to the new service node.
=item B<-P|--postscripts>
Specifies a list of extra postscripts to be run on the nodes after the nodes are moved over to the new serive node. If 'all' is specified, all the postscripts defined in the postscripts table will be run for the nodes. The specified postscripts must be stored under /install/postscripts directory.
=item B<-h|--help>
Display usage message.
@ -145,6 +149,18 @@ Move all the nodes in xCAT group "sngroup1" to the SN named "xcatsn2".
B<snmove sngroup1 -d xcatsn2>
=item 6.
Move all the nodes in xCAT group "sngroup1" to the SN named "xcatsn2" and run extra postscripts.
B<snmove sngroup1 -d xcatsn2 -P test1>
=item 7.
Move all the nodes in xCAT group "sngroup1" to the SN named "xcatsn2" and do not run anything on the nodes.
B<snmove sngroup1 -d xcatsn2 -i>
=back
=head1 FILES

File diff suppressed because it is too large Load Diff

View File

@ -845,12 +845,12 @@ sub updatenode
my $cmd;
if ($::SETSERVER) {
$cmd =
"XCATBYPASS=Y $::XCATROOT/bin/xdsh $nodestring -s -e $installdir/postscripts/xcatdsklspost 2 -M $snkey ospkgs,otherpkgs 2>&1";
"XCATBYPASS=Y $::XCATROOT/bin/xdsh $nodestring -s -v -e $installdir/postscripts/xcatdsklspost 2 -M $snkey ospkgs,otherpkgs 2>&1";
} else {
$cmd =
"XCATBYPASS=Y $::XCATROOT/bin/xdsh $nodestring -s -e $installdir/postscripts/xcatdsklspost 2 -m $snkey ospkgs,otherpkgs 2>&1";
"XCATBYPASS=Y $::XCATROOT/bin/xdsh $nodestring -s -v -e $installdir/postscripts/xcatdsklspost 2 -m $snkey ospkgs,otherpkgs 2>&1";
}
if ($::VERBOSE)
@ -1018,11 +1018,11 @@ $AIXnodes_nd, $subreq ) != 0 ) {
$mode = "1";
}
if ($::SETSERVER) {
$args1 = ["-s", "-e", "$installdir/postscripts/xcatdsklspost $mode -M $snkey $postscripts"];
$args1 = ["-s", "-v", "-e", "$installdir/postscripts/xcatdsklspost $mode -M $snkey $postscripts"];
} else {
$args1 = ["-s", "-e", "$installdir/postscripts/xcatdsklspost $mode -m $snkey $postscripts"];
$args1 = ["-s", "-v", "-e", "$installdir/postscripts/xcatdsklspost $mode -m $snkey $postscripts"];
}
@ -1091,9 +1091,9 @@ $AIXnodes_nd, $subreq ) != 0 ) {
}
if ($::SETSERVER) {
$cmd = "XCATBYPASS=Y $::XCATROOT/bin/xdsh $nodestring -s -e $installdir/postscripts/xcataixpost -M $snkey -c $mode $postscripts 2>&1";
$cmd = "XCATBYPASS=Y $::XCATROOT/bin/xdsh $nodestring -s -v -e $installdir/postscripts/xcataixpost -M $snkey -c $mode $postscripts 2>&1";
} else {
$cmd = "XCATBYPASS=Y $::XCATROOT/bin/xdsh $nodestring -s -e $installdir/postscripts/xcataixpost -m $snkey -c $mode $postscripts 2>&1";
$cmd = "XCATBYPASS=Y $::XCATROOT/bin/xdsh $nodestring -s -v -e $installdir/postscripts/xcataixpost -m $snkey -c $mode $postscripts 2>&1";
}
if ($::VERBOSE)