fix updatenode AIX diskful hierarchical software copies
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@14003 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
@ -12797,7 +12797,7 @@ sub make_SN_resource
|
||||
} # end if $::NFSv4
|
||||
|
||||
# make sure we have the NIM networks defs etc we need for these nodes
|
||||
if (&checkNIMnetworks($callback, \@nodelist, \%nethash, $Sname, $subreq) != 0)
|
||||
if (&checkNIMnetworks($callback, \@nodelist, \%nethash, $SNname, $subreq) != 0)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
@ -451,7 +451,6 @@ sub preprocess_updatenode
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
my $sn = xCAT::Utils->get_ServiceNode(\@nodes, "xcat", "MN");
|
||||
if ($::ERROR_RC)
|
||||
{
|
||||
@ -1418,7 +1417,7 @@ sub doAIXcopy
|
||||
{
|
||||
|
||||
my $sip = xCAT::NetworkUtils->getipaddr($snkey);
|
||||
chomp $ip;
|
||||
chomp $sip;
|
||||
if ($ip eq $sip)
|
||||
{
|
||||
next;
|
||||
@ -1668,24 +1667,26 @@ sub doAIXcopy
|
||||
next;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
# get the dir names to copy to
|
||||
my $rpm_srcdir;
|
||||
my $instp_srcdir;
|
||||
my $emgr_srcdir;
|
||||
my $srcdir;
|
||||
if ($::ALTSRC) {
|
||||
$rpm_srcdir = "$imagedef{$img}{alt_loc}";
|
||||
$instp_srcdir = "$imagedef{$img}{alt_loc}";
|
||||
$emgr_srcdir = "$imagedef{$img}{alt_loc}";
|
||||
$srcdir = "$imagedef{$img}{alt_loc}";
|
||||
} else {
|
||||
$rpm_srcdir = "$imagedef{$img}{lpp_loc}/RPMS/ppc";
|
||||
$instp_srcdir = "$imagedef{$img}{lpp_loc}/installp/ppc";
|
||||
$emgr_srcdir = "$imagedef{$img}{lpp_loc}/emgr/ppc";
|
||||
$srcdir = "$imagedef{$img}{lpp_loc}";
|
||||
}
|
||||
my $dir = dirname($srcdir);
|
||||
|
||||
if ($::VERBOSE)
|
||||
{
|
||||
my $rsp;
|
||||
push @{$rsp->{data}}, "Copying $srcdir to $dir on service node $snkey.\n";
|
||||
xCAT::MsgUtils->message("I", $rsp, $callback);
|
||||
}
|
||||
|
||||
# make sure the dir exists on the service node
|
||||
# also make sure it's writeable by all
|
||||
my $mkcmd = qq~/usr/bin/mkdir -p $rpm_srcdir; chmod 777 $rpm_srcdir; /usr/bin/mkdir -p $instp_srcdir; chmod 777 $instp_srcdir; /usr/bin/mkdir -p $emgr_srcdir; chmod 777 $emgr_srcdir~;
|
||||
my $mkcmd = qq~/usr/bin/mkdir -p $dir~;
|
||||
my $output = xCAT::InstUtils->xcmd($callback, $subreq, "xdsh", $snkey, $mkcmd, 0);
|
||||
if ($::RUNCMD_RC != 0) {
|
||||
my $rsp;
|
||||
@ -1697,72 +1698,34 @@ sub doAIXcopy
|
||||
next;
|
||||
}
|
||||
|
||||
# copy all the packages
|
||||
foreach my $pkg (@pkglist)
|
||||
{
|
||||
my $rcpargs;
|
||||
my $srcfile;
|
||||
if (($pkg =~ /^R:/) || ($pkg =~ /\.rpm/))
|
||||
{
|
||||
my ($junk, $pname);
|
||||
if ($pkg =~ /:/) {
|
||||
($junk, $pname) = split(/:/, $pkg);
|
||||
} else {
|
||||
$pname = $pkg;
|
||||
}
|
||||
# sync source files to SN
|
||||
my $cpcmd = qq~$::XCATROOT/bin/prsync -o "rlHpEAogDz" $srcdir $snkey:$dir 2>/dev/null~;
|
||||
$output=xCAT::InstUtils->xcmd($callback, $subreq, "xdsh", $nimprime, $cpcmd, 0);
|
||||
if ($::RUNCMD_RC != 0)
|
||||
{
|
||||
my $rsp;
|
||||
push @{$rsp->{data}}, "Could not copy $srcdir to $dir for service node $snkey.\n";
|
||||
push @{$rsp->{data}}, "Output from command: \n\n$output\n\n";
|
||||
xCAT::MsgUtils->message("E", $rsp, $callback);
|
||||
return (1);
|
||||
}
|
||||
|
||||
# use rpm location
|
||||
$rcpargs = ["$rpm_srcdir/$pname", "$rpm_srcdir"];
|
||||
|
||||
} elsif (($pkg =~ /^E:/) || ($pkg =~ /epkg\.Z/)) {
|
||||
|
||||
my ($junk, $pname);
|
||||
if ($pkg =~ /:/) {
|
||||
($junk, $pname) = split(/:/, $pkg);
|
||||
} else {
|
||||
$pname = $pkg;
|
||||
}
|
||||
$rcpargs = ["$emgr_srcdir/$pname", "$emgr_srcdir"];
|
||||
}
|
||||
else
|
||||
{
|
||||
my $pname;
|
||||
my $junk;
|
||||
if ($pkg =~ /:/)
|
||||
{
|
||||
($junk, $pname) = split(/:/, $pkg);
|
||||
}
|
||||
else
|
||||
{
|
||||
$pname = $pkg;
|
||||
}
|
||||
|
||||
# use installp loc
|
||||
my @allfiles = glob "$instp_srcdir/$pname*";
|
||||
my $sourcefiles = "";
|
||||
foreach my $file (@allfiles) {
|
||||
$sourcefiles .= "$file ";
|
||||
}
|
||||
$rcpargs = [$sourcefiles, "$instp_srcdir"];
|
||||
}
|
||||
|
||||
if ($::VERBOSE)
|
||||
{
|
||||
my $rsp;
|
||||
push @{$rsp->{data}}, "Copying files to $snkey.\n";
|
||||
xCAT::MsgUtils->message("I", $rsp, $callback);
|
||||
}
|
||||
|
||||
my $output = xCAT::Utils->runxcmd({command => ["xdcp"], node => [$snkey], arg => $rcpargs}, $subreq, -1, 0);
|
||||
|
||||
if ($::RUNCMD_RC != 0)
|
||||
{
|
||||
my $rsp;
|
||||
push @{$rsp->{data}}, "Could not copy $pkg to $snkey.\n";
|
||||
xCAT::MsgUtils->message("E", $rsp, $callback);
|
||||
}
|
||||
}
|
||||
}
|
||||
# run inutoc in remote installp dir
|
||||
my $installpsrcdir;
|
||||
if ($::ALTSRC) {
|
||||
$installpsrcdir = $srcdir;
|
||||
} else {
|
||||
$installpsrcdir = "$srcdir/installp/ppc";
|
||||
}
|
||||
my $icmd = qq~cd $installpsrcdir; /usr/sbin/inutoc .~;
|
||||
my $output = xCAT::InstUtils->xcmd($callback, $subreq, "xdsh", $snkey, $icmd, 0);
|
||||
if ($::RUNCMD_RC != 0)
|
||||
{
|
||||
my $rsp;
|
||||
push @{$rsp->{data}}, "Could not run inutoc for $installpsrcdir on $snkey\n";
|
||||
xCAT::MsgUtils->message("E", $rsp, $callback);
|
||||
}
|
||||
} # end for each osimage
|
||||
} # end - for each service node
|
||||
return (0, \%imagedef, \%nodeupdateinfo);
|
||||
}
|
||||
|
@ -322,7 +322,6 @@ if(0) { # only do networks on the management node (NIM primary) for now
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return (0, \@nodelist, \@servicenodes, $type);
|
||||
}
|
||||
|
||||
@ -693,6 +692,9 @@ sub x2n
|
||||
|
||||
$::msgstr = "$::Sname: ";
|
||||
|
||||
my $nimprime = xCAT::InstUtils->getnimprime();
|
||||
chomp $nimprime;
|
||||
|
||||
# process the command line
|
||||
$rc = &processArgs($callback);
|
||||
if ($rc != 0)
|
||||
@ -720,6 +722,7 @@ sub x2n
|
||||
my @networks;
|
||||
my @groups;
|
||||
foreach my $obj (keys %::objhash) {
|
||||
|
||||
if ($::objtype{$obj} eq 'node') {
|
||||
push(@nodes, $obj);
|
||||
} elsif ($::objtype{$obj} eq 'network') {
|
||||
@ -742,6 +745,17 @@ sub x2n
|
||||
if (scalar(@nodes)) {
|
||||
foreach my $objname (@nodes) {
|
||||
|
||||
# does this node belong to this server?
|
||||
my $nimmaster = $nimprime;
|
||||
if ($::objhash{$objname}{servicenode}) {
|
||||
my $sn2;
|
||||
($nimmaster, $sn2) = split(/,/, $::objhash{$objname}{servicenode});
|
||||
}
|
||||
|
||||
if (!xCAT::InstUtils->is_me($nimmaster)) {
|
||||
next;
|
||||
}
|
||||
|
||||
if ($::opt_l || $::opt_r) {
|
||||
|
||||
if (&rm_or_list_nim_object($objname, $::objtype{$objname}, $callback)) {
|
||||
@ -749,13 +763,13 @@ sub x2n
|
||||
$error++;
|
||||
}
|
||||
} else {
|
||||
|
||||
if (mkclientdef($objname, $callback)) {
|
||||
# could not create client definition
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
next;
|
||||
}
|
||||
} # end for each node
|
||||
}
|
||||
|
||||
# NIM network definitions
|
||||
|
Reference in New Issue
Block a user