From fc269d0f123df056acc56c8091386955e6a9bbc6 Mon Sep 17 00:00:00 2001 From: ertaozh Date: Thu, 6 Apr 2017 03:45:41 -0400 Subject: [PATCH 1/9] Add release information for 2.13.3 --- docs/source/overview/xcat2_release.rst | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/source/overview/xcat2_release.rst b/docs/source/overview/xcat2_release.rst index a87d50a50..18b27871b 100644 --- a/docs/source/overview/xcat2_release.rst +++ b/docs/source/overview/xcat2_release.rst @@ -14,6 +14,14 @@ xCAT 2.13.x |xCAT |New OS |New |New Feature | |Version | |Hardware | | +=================================+===============+=============+==================================+ +|| xCAT 2.13.3 |- RHEL 6.9 | |- rpower for OpenBMC(experimental)| +|| 2017/4/7 | | |- Add -C for rmdef to run nodeset | +|| | | | nodeset offline | +| `2.13.3 Release Notes `_ | | | | +| | | | | ++---------------------------------+---------------+-------------+----------------------------------+ || xCAT 2.13.2 | | |- Refine ONIE switch support doc | || 2017/2/24 | | |- Add -p for xcatprobe osdeploy | || | | | to support performance calculate| From 84afb20c3e3e4a50fa10757aea2d04e41b661627 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Fri, 7 Apr 2017 14:07:59 -0400 Subject: [PATCH 2/9] add --buffersize option to rflash --- xCAT-server/lib/xcat/plugins/ipmi.pm | 30 ++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/ipmi.pm b/xCAT-server/lib/xcat/plugins/ipmi.pm index c14c31ac3..5f4849beb 100644 --- a/xCAT-server/lib/xcat/plugins/ipmi.pm +++ b/xCAT-server/lib/xcat/plugins/ipmi.pm @@ -1766,6 +1766,7 @@ sub do_firmware_update { my $ret; my $ipmitool_ver; my $verbose = 0; + my $verbose_opt; $ret = get_ipmitool_version(\$ipmitool_ver); exit $ret if $ret < 0; @@ -1848,6 +1849,21 @@ sub do_firmware_update { $buffer_size = "15000"; } + # check verbose and buffersize options + for my $opt (@{$sessdata->{'extraargs'}}) { + if ($opt =~ /-V{1,4}/) { + $verbose_opt = lc($opt); + $verbose = 1; + } + if ($opt =~ /buffersize=/) { + my ($attribute, $buffer_value) = split(/=/, $opt); + if ($buffer_value) { + # buffersize option was passed in, reset the default + $buffer_size = $buffer_value; + } + } + } + # check for 8335-GTB Firmware above 1610A release. If below, exit if ($output =~ /8335-GTB/) { $cmd = $pre_cmd . " fru print 47"; @@ -1899,14 +1915,8 @@ sub do_firmware_update { # step 4 upgrade firmware $cmd = $pre_cmd . " -z " . $buffer_size . " hpm upgrade $hpm_file force "; - # check verbose debug option - for my $opt (@{$sessdata->{'extraargs'}}) { - if ($opt =~ /-V{1,4}/) { - $cmd .= lc($opt); - $verbose = 1; - last; - } - } + $cmd .= $verbose_opt; + my $rflash_log_file = xCAT::Utils->full_path($sessdata->{node}.".log", RFLASH_LOG_DIR); $cmd .= " >".$rflash_log_file." 2>&1"; xCAT::SvrUtils::sendmsg([ 0, @@ -1933,7 +1943,7 @@ sub do_firmware_update { "Running ipmitool command $cmd failed: $output"); } $exit_with_success_func->($sessdata->{node}, $callback, - "Success to update firmware. FRU information will be populated in a few minutes."); + "Success updating firmware. FRU information will be populated in a few minutes."); } sub rflash { @@ -1946,7 +1956,7 @@ sub rflash { if ($opt =~ /^(-c|--check)$/i) { $sessdata->{subcommand} = "check"; # support verbose options for ipmitool command - } elsif ($opt !~ /.*\.hpm$/i && $opt !~ /^-V{1,4}$/) { + } elsif ($opt !~ /.*\.hpm$/i && $opt !~ /^-V{1,4}$/ && $opt !~ /^--buffersize=/) { $callback->({ error => "The option $opt is not supported", errorcode => 1 }); return; From 7f09d26ce6eff358339195f964ffff1129c806f5 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Mon, 10 Apr 2017 11:12:18 -0400 Subject: [PATCH 3/9] Improve progress messages --- xCAT-server/lib/xcat/plugins/ipmi.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/xCAT-server/lib/xcat/plugins/ipmi.pm b/xCAT-server/lib/xcat/plugins/ipmi.pm index 5f4849beb..ed0bc59ab 100644 --- a/xCAT-server/lib/xcat/plugins/ipmi.pm +++ b/xCAT-server/lib/xcat/plugins/ipmi.pm @@ -1885,6 +1885,7 @@ sub do_firmware_update { # step 1 power off $cmd = $pre_cmd . " chassis power off"; + xCAT::SvrUtils::sendmsg("Preparing to upgrade firmware, powering chassis off...", $callback, $sessdata->{node}, %allerrornodes); $output = xCAT::Utils->runcmd($cmd, -1); if ($::RUNCMD_RC != 0) { $exit_with_error_func->($sessdata->{node}, $callback, @@ -1936,6 +1937,7 @@ sub do_firmware_update { "Timeout to check the bmc status"); } + xCAT::SvrUtils::sendmsg("Firmware updated, powering chassis on to populate FRU information...", $callback, $sessdata->{node}, %allerrornodes); $cmd = $pre_cmd . " chassis power on"; $output = xCAT::Utils->runcmd($cmd, -1); if ($::RUNCMD_RC != 0) { @@ -1943,7 +1945,7 @@ sub do_firmware_update { "Running ipmitool command $cmd failed: $output"); } $exit_with_success_func->($sessdata->{node}, $callback, - "Success updating firmware. FRU information will be populated in a few minutes."); + "Success updating firmware."); } sub rflash { From a00bff3e80e1666af326102af399e198a4f8a4e4 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Wed, 12 Apr 2017 14:03:18 -0400 Subject: [PATCH 4/9] Add --retry option to rflash command --- xCAT-server/lib/xcat/plugins/ipmi.pm | 92 +++++++++++++++++++++++++--- 1 file changed, 83 insertions(+), 9 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/ipmi.pm b/xCAT-server/lib/xcat/plugins/ipmi.pm index ed0bc59ab..dbf87b666 100644 --- a/xCAT-server/lib/xcat/plugins/ipmi.pm +++ b/xCAT-server/lib/xcat/plugins/ipmi.pm @@ -1766,6 +1766,7 @@ sub do_firmware_update { my $ret; my $ipmitool_ver; my $verbose = 0; + my $retry = 2; my $verbose_opt; $ret = get_ipmitool_version(\$ipmitool_ver); exit $ret if $ret < 0; @@ -1834,8 +1835,6 @@ sub do_firmware_update { if ($bmc_password) { $pre_cmd = $pre_cmd . " -P $bmc_password"; } - xCAT::SvrUtils::sendmsg("rflash started, please wait.......", - $callback, $sessdata->{node}, %allerrornodes); # check for 8335-GTB Model Type to adjust buffer size my $buffer_size = "30000"; @@ -1849,7 +1848,7 @@ sub do_firmware_update { $buffer_size = "15000"; } - # check verbose and buffersize options + # check verbose, buffersize, and retry options for my $opt (@{$sessdata->{'extraargs'}}) { if ($opt =~ /-V{1,4}/) { $verbose_opt = lc($opt); @@ -1862,8 +1861,18 @@ sub do_firmware_update { $buffer_size = $buffer_value; } } + if ($opt =~ /retry=/) { + my ($attribute, $retry_value) = split(/=/, $opt); + if ($retry_value) { + # retry option was passed in, reset the default + $retry = $retry_value; + } + } } + xCAT::SvrUtils::sendmsg("rflash started, individual node upgrade failure will be retried upto $retry times. Please wait.......", + $callback, $sessdata->{node}, %allerrornodes); + # check for 8335-GTB Firmware above 1610A release. If below, exit if ($output =~ /8335-GTB/) { $cmd = $pre_cmd . " fru print 47"; @@ -1883,6 +1892,9 @@ sub do_firmware_update { } } +RETRY_UPGRADE: + my $failed_upgrade = 0; + # step 1 power off $cmd = $pre_cmd . " chassis power off"; xCAT::SvrUtils::sendmsg("Preparing to upgrade firmware, powering chassis off...", $callback, $sessdata->{node}, %allerrornodes); @@ -1925,9 +1937,21 @@ sub do_firmware_update { $callback, $sessdata->{node}); $output = xCAT::Utils->runcmd($cmd, -1); + # if upgrade command failed and we exausted number of retries + # report an error, exit to the caller and leave node in powered off state + # otherwise report an error, power on the node and try upgrade again if ($::RUNCMD_RC != 0) { - $exit_with_error_func->($sessdata->{node}, $callback, - "Running ipmitool command $cmd failed: $output"); + if ($retry == 0) { + # No more retries left, report and error and exit + $exit_with_error_func->($sessdata->{node}, $callback, + "Running ipmitool command $cmd failed: $output"); + } + else { + # Error upgrading, set a flag to attempt a retry + xCAT::SvrUtils::sendmsg("Running ipmitool command $cmd failed: $output", $callback, $sessdata->{node}, %allerrornodes); + $failed_upgrade = 1; + + } } # step 5 power on @@ -1937,15 +1961,65 @@ sub do_firmware_update { "Timeout to check the bmc status"); } - xCAT::SvrUtils::sendmsg("Firmware updated, powering chassis on to populate FRU information...", $callback, $sessdata->{node}, %allerrornodes); + if ($failed_upgrade) { + xCAT::SvrUtils::sendmsg("Firmware update failed, powering chassis on for a retry. This can take several minutes. $retry retries left ...", $callback, $sessdata->{node}, %allerrornodes); + } + else { + xCAT::SvrUtils::sendmsg("Firmware updated, powering chassis on to populate FRU information...", $callback, $sessdata->{node}, %allerrornodes); + } + $cmd = $pre_cmd . " chassis power on"; $output = xCAT::Utils->runcmd($cmd, -1); if ($::RUNCMD_RC != 0) { $exit_with_error_func->($sessdata->{node}, $callback, "Running ipmitool command $cmd failed: $output"); } - $exit_with_success_func->($sessdata->{node}, $callback, - "Success updating firmware."); + + my $node_ready_for_retry = 0; + if ($failed_upgrade) { + # Update has failed in step 4. Wait for node to reboot and try again + if ($verbose) { + xCAT::SvrUtils::sendmsg("Sleeping for a few min waiting for node to power on before attempting a retry", $callback, $sessdata->{node}, %allerrornodes); + } + sleep(300); # sleep for 5 min for node to reboot + # Start testing every 10 sec for node to be booted. Give up after 5 min. + foreach (1..30) { + # Test node is booted in to OS + $cmd = "nodestat $sessdata->{node} | grep sshd"; + $output = xCAT::Utils->runcmd($cmd, -1); + if ($::RUNCMD_RC == 0) { + # Node is ready to retry an upgrage + if ($verbose) { + xCAT::SvrUtils::sendmsg("Detected node booted. Will retry upgrade", $callback, $sessdata->{node}, %allerrornodes); + } + $node_ready_for_retry = 1; + last; + } + else { + # Still not booted, wait for 10 sec and try again + if ($verbose) { + xCAT::SvrUtils::sendmsg("Node still not ready, Test again in 10 sec.", $callback, $sessdata->{node}, %allerrornodes); + } + sleep(10); + } + } + if ($node_ready_for_retry) { + $retry--; # decrement number of retries left + # Yes, it is a goto statement here. Ugly, but removes the need to restructure + # the above block of code. + goto RETRY_UPGRADE; + } + else { + # After 10 min of waiting node has not rebooted. Give up retrying. + $exit_with_error_func->($sessdata->{node}, $callback, + "Giving up waiting for the node to reboot. No firther upgrade retries will be attempted."); + } + + } + else { + $exit_with_success_func->($sessdata->{node}, $callback, + "Success updating firmware."); + } } sub rflash { @@ -1958,7 +2032,7 @@ sub rflash { if ($opt =~ /^(-c|--check)$/i) { $sessdata->{subcommand} = "check"; # support verbose options for ipmitool command - } elsif ($opt !~ /.*\.hpm$/i && $opt !~ /^-V{1,4}$/ && $opt !~ /^--buffersize=/) { + } elsif ($opt !~ /.*\.hpm$/i && $opt !~ /^-V{1,4}$/ && $opt !~ /^--buffersize=/ && $opt !~ /^--retry=/) { $callback->({ error => "The option $opt is not supported", errorcode => 1 }); return; From bcd5247e3e13ed702d685b886b99cd62c9fa2117 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Wed, 12 Apr 2017 14:44:20 -0400 Subject: [PATCH 5/9] Add --retry flag to rflash man page --- .../guides/admin-guides/references/man1/rflash.1.rst | 8 +++++++- xCAT-client/pods/man1/rflash.1.pod | 6 +++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/docs/source/guides/admin-guides/references/man1/rflash.1.rst b/docs/source/guides/admin-guides/references/man1/rflash.1.rst index 0945ec619..47b35ae06 100644 --- a/docs/source/guides/admin-guides/references/man1/rflash.1.rst +++ b/docs/source/guides/admin-guides/references/man1/rflash.1.rst @@ -50,7 +50,7 @@ OpenPOWER BMC specific: ======================= -\ **rflash**\ \ *noderange*\ \ *hpm_file_path*\ [\ **-c | -**\ **-check**\ ] [\ **-V**\ ] +\ **rflash**\ \ *noderange*\ \ *hpm_file_path*\ [\ **-c | -**\ **-check**\ ] [\ **-**\ **-retry=**\ \ *count*\ ] [\ **-V**\ ] @@ -174,6 +174,12 @@ The command will update firmware for OpenPOWER BMC when given an OpenPOWER node +\ **-**\ **-retry=**\ \ *count*\ + + Specify number of times to retry the update if failure is detected. Default value is 2. Value of 0 can be used to indicate no retries. + + + \ **-v|-**\ **-version**\ Displays the command's version. diff --git a/xCAT-client/pods/man1/rflash.1.pod b/xCAT-client/pods/man1/rflash.1.pod index 2a02fc315..de1f11e60 100644 --- a/xCAT-client/pods/man1/rflash.1.pod +++ b/xCAT-client/pods/man1/rflash.1.pod @@ -24,7 +24,7 @@ B I I =head2 OpenPOWER BMC specific: -B I I [B<-c>|B<--check>] [B<-V>] +B I I [B<-c>|B<--check>] [B<--retry=>I] [B<-V>] =head1 B @@ -114,6 +114,10 @@ Used to commit the flash image in the temporary side of the chip to the permanen Used to recover the flash image in the permanent side of the chip to the temporary side for both managed systems and power subsystems. +=item B<--retry=>I + +Specify number of times to retry the update if failure is detected. Default value is 2. Value of 0 can be used to indicate no retries. + =item B<-v|--version> Displays the command's version. From d86217ed5848672b78cabee196a9a9b019a05c95 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Wed, 12 Apr 2017 15:16:47 -0400 Subject: [PATCH 6/9] Message fixes suggested in review comments --- xCAT-server/lib/xcat/plugins/ipmi.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/ipmi.pm b/xCAT-server/lib/xcat/plugins/ipmi.pm index dbf87b666..16fa35f48 100644 --- a/xCAT-server/lib/xcat/plugins/ipmi.pm +++ b/xCAT-server/lib/xcat/plugins/ipmi.pm @@ -1870,7 +1870,7 @@ sub do_firmware_update { } } - xCAT::SvrUtils::sendmsg("rflash started, individual node upgrade failure will be retried upto $retry times. Please wait.......", + xCAT::SvrUtils::sendmsg("rflash started, upgrade failure will be retried up to $retry times. Please wait...", $callback, $sessdata->{node}, %allerrornodes); # check for 8335-GTB Firmware above 1610A release. If below, exit @@ -2012,7 +2012,7 @@ RETRY_UPGRADE: else { # After 10 min of waiting node has not rebooted. Give up retrying. $exit_with_error_func->($sessdata->{node}, $callback, - "Giving up waiting for the node to reboot. No firther upgrade retries will be attempted."); + "Giving up waiting for the node to reboot. No further retries will be attempted."); } } From 7912641d98f7db1d1a48e2a0db2232f5859140ad Mon Sep 17 00:00:00 2001 From: hu-weihua Date: Wed, 12 Apr 2017 21:41:41 -0400 Subject: [PATCH 7/9] Add timestamp for every cmd log in xcatteat log --- xCAT-test/xcattest | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xCAT-test/xcattest b/xCAT-test/xcattest index 541fad827..adb91d428 100755 --- a/xCAT-test/xcattest +++ b/xCAT-test/xcattest @@ -907,7 +907,8 @@ sub runcase #by my $runstart = timelocal(localtime()); - log_this("\nRUN:$cmd"); + my $runstartstr = scalar(localtime()); + log_this("\nRUN:$cmd [$runstartstr]"); push(@record, "\nRUN:$cmd"); @output = &runcmd($cmd); $rc = $::RUNCMD_RC; From 3e89d33fc82c9d9d51efe6a3deac9025531b7f3a Mon Sep 17 00:00:00 2001 From: yangsong Date: Wed, 12 Apr 2017 22:31:54 -0500 Subject: [PATCH 8/9] fix issue #2856: [DEV] nodes provisioned with redhat osimages created by xCAT 2.12.3 or earlier missed yum repo to MN in xCAT 2.12.4 or later (#2857) * fix issue [DEV] nodes provisioned with redhat osimages created by xCAT 2.12.3 or earlier missed yum repo to MN in xCAT 2.12.4 or later #2856 * fix issue [DEV] nodes provisioned with redhat osimages created by xCAT 2.12.3 or earlier missed yum repo to MN in xCAT 2.12.4 or later #2856 --- perl-xCAT/xCAT/Yum.pm | 8 ++++++-- xCAT-server/lib/perl/xCAT/Template.pm | 5 +++-- xCAT-server/lib/xcat/plugins/anaconda.pm | 9 +++++++++ xCAT-server/share/xcat/install/scripts/post.xcat | 6 +++--- 4 files changed, 21 insertions(+), 7 deletions(-) diff --git a/perl-xCAT/xCAT/Yum.pm b/perl-xCAT/xCAT/Yum.pm index b8eeb8c02..71faef8c9 100644 --- a/perl-xCAT/xCAT/Yum.pm +++ b/perl-xCAT/xCAT/Yum.pm @@ -9,12 +9,16 @@ my $distname; my $arch; my $installpfx; +my $distrepopfx="/install/postscripts/repos"; + sub localize_yumrepo { my $self = shift; my $pkgdir = shift; $distname=shift; $arch=shift; - open($yumrepofile, ">", "$pkgdir/local-repository.tmpl"); + + mkpath("$distrepopfx/$pkgdir"); + open($yumrepofile, ">", "$distrepopfx/$pkgdir/local-repository.tmpl"); my %options = ( wanted => \&check_tofix, follow_fast => 1 @@ -27,7 +31,7 @@ sub localize_yumrepo { sub remove_yumrepo { my $self = shift; my $pkgdir = shift; - rmtree("$pkgdir/local-repository.tmpl"); + rmtree("$distrepopfx/$pkgdir/local-repository.tmpl"); } sub check_tofix { diff --git a/xCAT-server/lib/perl/xCAT/Template.pm b/xCAT-server/lib/perl/xCAT/Template.pm index 06dc55b2b..d1415fa3a 100644 --- a/xCAT-server/lib/perl/xCAT/Template.pm +++ b/xCAT-server/lib/perl/xCAT/Template.pm @@ -303,11 +303,12 @@ sub subvars { $source_in_pre .= "\necho 'repo --name=pkg$c --baseurl=http://'\$nextserver'/$pkgdir' >> /tmp/repos"; $source .= "repo --name=pkg$c --baseurl=http://#TABLE:noderes:\$NODE:nfsserver#/$pkgdir\n"; #for rhels5.9 } - if( -f "$pkgdir/local-repository.tmpl"){ + my $distrepofile="/install/postscripts/repos/$pkgdir/local-repository.tmpl"; + if( -f "$distrepofile"){ my $repofd; my $repo_in_post; local $/=undef; - open($repofd,"<","$pkgdir/local-repository.tmpl"); + open($repofd,"<","$distrepofile"); $repo_in_post = <$repofd>; close($repofd); $repo_in_post =~ s#baseurl=#baseurl=http://$master/#g; diff --git a/xCAT-server/lib/xcat/plugins/anaconda.pm b/xCAT-server/lib/xcat/plugins/anaconda.pm index 237a4e8b7..05bec81e5 100644 --- a/xCAT-server/lib/xcat/plugins/anaconda.pm +++ b/xCAT-server/lib/xcat/plugins/anaconda.pm @@ -1260,6 +1260,15 @@ sub mkinstall } } + unless(-f "/install/postscripts/repos/$pkgdir/local-repository.tmpl"){ + #fix issue #2856@github + #for the osimages created by <=xCAT 2.12.3 + #there is no local-repository.tmpl under pkgdir created on copycds + #generate local-repository.tmpl here if it does not exist + require xCAT::Yum; + xCAT::Yum->localize_yumrepo($pkgdir, $os, $arch); + } + my @missingparms; unless ($os) { if ($imagename) { push @missingparms, "osimage.osvers"; } diff --git a/xCAT-server/share/xcat/install/scripts/post.xcat b/xCAT-server/share/xcat/install/scripts/post.xcat index 48024de9c..ba66f082b 100755 --- a/xCAT-server/share/xcat/install/scripts/post.xcat +++ b/xCAT-server/share/xcat/install/scripts/post.xcat @@ -410,9 +410,9 @@ export ARCH=#TABLE:nodetype:THISNODE:arch# export CONSOLEPORT=#TABLEBLANKOKAY:nodehm:THISNODE:serialport# #for redhat: -##place-holder for the code to save the repo info on compute node,pointing to the "pkgdir" of the osimage -##so that the provisioned node -##WRITEREPO# +#place-holder for the code to save the repo info on compute node,pointing to the "pkgdir" of the osimage +#so that the provisioned node has the repo pointed to the distro path on MN +#WRITEREPO# if [ "$XCATDEBUGMODE" = "1" ] || [ "$XCATDEBUGMODE" = "2" ]; then msgutil_r "$MASTER_IP" "info" "running mypostscript" "/var/log/xcat/xcat.log" From b665e03cdc3c1f2229a7e73f2096aedd84b36536 Mon Sep 17 00:00:00 2001 From: immarvin Date: Thu, 13 Apr 2017 01:11:07 -0400 Subject: [PATCH 9/9] fix issue [DEV] nodes provisioned with redhat osimages created by xCAT 2.12.3 or earlier missed yum repo to MN in xCAT 2.12.4 or later #2856: process the multiple dirs in pkgdir --- perl-xCAT/xCAT/Yum.pm | 3 ++- xCAT-server/lib/xcat/plugins/anaconda.pm | 19 ++++++++++--------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/perl-xCAT/xCAT/Yum.pm b/perl-xCAT/xCAT/Yum.pm index 71faef8c9..368992a78 100644 --- a/perl-xCAT/xCAT/Yum.pm +++ b/perl-xCAT/xCAT/Yum.pm @@ -54,8 +54,9 @@ sub generate_repo my $dirlocation = shift; my @dircomps = File::Spec->splitdir($dirlocation); pop(@dircomps); + my $reponame = join("-",@dircomps); my $yumurl = File::Spec->catdir(@dircomps); - my $reponame = $dircomps[$#dircomps]; + print $yumrepofile "[local-$distname-$arch-$reponame]\n"; print $yumrepofile "name=xCAT configured yum repository for $yumurl\n"; print $yumrepofile "baseurl=$yumurl\n"; diff --git a/xCAT-server/lib/xcat/plugins/anaconda.pm b/xCAT-server/lib/xcat/plugins/anaconda.pm index 05bec81e5..0222362ba 100644 --- a/xCAT-server/lib/xcat/plugins/anaconda.pm +++ b/xCAT-server/lib/xcat/plugins/anaconda.pm @@ -16,6 +16,7 @@ use xCAT::TableUtils; use xCAT::NetworkUtils; use xCAT::MsgUtils; use xCAT::SvrUtils; +use xCAT::Yum; #use Data::Dumper; use Getopt::Long; @@ -1260,13 +1261,15 @@ sub mkinstall } } - unless(-f "/install/postscripts/repos/$pkgdir/local-repository.tmpl"){ - #fix issue #2856@github - #for the osimages created by <=xCAT 2.12.3 - #there is no local-repository.tmpl under pkgdir created on copycds - #generate local-repository.tmpl here if it does not exist - require xCAT::Yum; - xCAT::Yum->localize_yumrepo($pkgdir, $os, $arch); + my @pkgdirs=split(/,/,$pkgdir); + foreach my $mypkgdir (@pkgdirs){ + unless(-f "/install/postscripts/repos/$mypkgdir/local-repository.tmpl"){ + #fix issue #2856@github + #for the osimages created by <=xCAT 2.12.3 + #there is no local-repository.tmpl under pkgdir created on copycds + #generate local-repository.tmpl here if it does not exist + xCAT::Yum->localize_yumrepo($mypkgdir, $os, $arch); + } } my @missingparms; @@ -2471,8 +2474,6 @@ sub copycd } } - - require xCAT::Yum; xCAT::Yum->localize_yumrepo($path, $distname, $arch); if ($rc != 0)