From fc269d0f123df056acc56c8091386955e6a9bbc6 Mon Sep 17 00:00:00 2001 From: ertaozh Date: Thu, 6 Apr 2017 03:45:41 -0400 Subject: [PATCH 001/129] 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 002/129] 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 003/129] 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 004/129] 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 005/129] 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 006/129] 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 007/129] 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 008/129] 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 009/129] 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) From 3b114aa3538e199eb4f0c3ee2f37a5357fc266cf Mon Sep 17 00:00:00 2001 From: "litingt@cn.ibm.com" Date: Thu, 20 Apr 2017 02:59:20 -0400 Subject: [PATCH 010/129] This case is to verify bug 2521 to test when there is mgtifname is defined as remote networks, makedhcp could work correctly and create entrys in dhcp lease file --- xCAT-test/autotest/testcase/makedhcp/cases0 | 28 +++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/xCAT-test/autotest/testcase/makedhcp/cases0 b/xCAT-test/autotest/testcase/makedhcp/cases0 index 64f87a839..40b772526 100644 --- a/xCAT-test/autotest/testcase/makedhcp/cases0 +++ b/xCAT-test/autotest/testcase/makedhcp/cases0 @@ -176,3 +176,31 @@ check:output!~$$CN cmd:makedhcp -a end +start:makedhcp_remote_network_bug2521 +descriptiion:This case is to verify bug 2521 to test when there is mgtifname='!remote!', makedhcp could work correctly and create entrys in dhcp lease file. +cmd:mkdef -t network -o testnetwork net=100.100.100.0 mask=255.255.255.0 mgtifname='!remote!eth0' gateway=100.100.100.1 +check:rc==0 +cmd:lsdef -t network +check:rc==0 +check:output=~testnetwork +check:rc==0 +cmd:mkdef -t node -o testnode ip=100.100.100.2 groups=all mac=42:3d:0a:05:27:0b +check:rc==0 +cmd: cp -f /etc/hosts /etc/hosts.bak +cmd:echo "100.100.100.2 testnode" >> /etc/hosts +check:rc==0 +cmd:makedhcp testnode +check:rc==0 +cmd:makdhcp -q testnode +check:rc==0 +check:output=~testnode: ip-address = 100.100.100.2 +cmd:makdhcp -d testnode +check:rc==0 +cmd:makedhcp -n +check:rc==0 +cmd:noderm testnode +check:rc==0 +cmd:chtab -d netname=testnetwork networks +check:rc==0 +cmd:cp -f /etc/hosts.bak /etc/hosts +end From b7868cccef7bce1ccac0bac460ed2367fb9ad4b0 Mon Sep 17 00:00:00 2001 From: "litingt@cn.ibm.com" Date: Fri, 21 Apr 2017 04:47:32 -0400 Subject: [PATCH 011/129] update according to comments --- xCAT-test/autotest/testcase/makedhcp/cases0 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xCAT-test/autotest/testcase/makedhcp/cases0 b/xCAT-test/autotest/testcase/makedhcp/cases0 index 40b772526..b56db6f91 100644 --- a/xCAT-test/autotest/testcase/makedhcp/cases0 +++ b/xCAT-test/autotest/testcase/makedhcp/cases0 @@ -176,8 +176,8 @@ check:output!~$$CN cmd:makedhcp -a end -start:makedhcp_remote_network_bug2521 -descriptiion:This case is to verify bug 2521 to test when there is mgtifname='!remote!', makedhcp could work correctly and create entrys in dhcp lease file. +start:makedhcp_remote_network +descriptiion:This case is to test when there is mgtifname='!remote!', makedhcp could work correctly and create entrys in dhcp lease file. cmd:mkdef -t network -o testnetwork net=100.100.100.0 mask=255.255.255.0 mgtifname='!remote!eth0' gateway=100.100.100.1 check:rc==0 cmd:lsdef -t network From 1aa7a97236da4b1bc8539b0df15fea63718503aa Mon Sep 17 00:00:00 2001 From: junxiawang Date: Fri, 5 May 2017 04:47:06 -0400 Subject: [PATCH 012/129] Add test case for openbmc rspconfig command #2912 --- xCAT-test/autotest/testcase/rspconfig/cases0 | 53 ++++++++ .../autotest/testcase/rspconfig/rspconfig.sh | 117 ++++++++++++++++++ 2 files changed, 170 insertions(+) create mode 100755 xCAT-test/autotest/testcase/rspconfig/rspconfig.sh diff --git a/xCAT-test/autotest/testcase/rspconfig/cases0 b/xCAT-test/autotest/testcase/rspconfig/cases0 index d44e21732..516f2a4bf 100644 --- a/xCAT-test/autotest/testcase/rspconfig/cases0 +++ b/xCAT-test/autotest/testcase/rspconfig/cases0 @@ -40,3 +40,56 @@ cmd:rspconfig __GETNODEATTR($$CN,hcp)__ sshcfg check:rc==0 check:output=~__GETNODEATTR($$CN,hcp)__: \w+ end + +start:rspconfig_ip +description:rspconfig change openbmc ip +Attribute: $$CN-The operation object of rspconfig command +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/rspconfig/rspconfig.sh -i $$CN +check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/rspconfig/rspconfig.sh -c $$CN ip +check:rc==0 +end + +start:rspconfig_ip_invalid +description:rspconfig could not change openbmc ip using invalid ip +Attribute: $$CN-The operation object of rspconfig command +cmd:rspconfig $$CN ip=ddd +check:rc!=0 +end + +start:rspconfig_ip_null +description:rspconfig could not set ip to null +Attribute: $$CN-The operation object of rspconfig command +cmd:rspconfig $$CN ip= +check:rc!=0 +end + +start:rspconfig_netmask +description:rspconfig change openbmc netmask +Attribute: $$CN-The operation object of rspconfig command +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/rspconfig/rspconfig.sh -n $$CN netmask +check:rc==0 +end + +start:rspconfig_netmask_invalid +despcription:rspconfig could not change openbmc netmask using invalid netmask +Attribute: $$CN-The operation object of rspconfig command +cmd:rspconfig $$CN netmask=ddd +check:rc!=0 +end + +start:rspconfig_gateway +description:rspconfig change openbmc gateway +Attribute: $$CN-The operation object of rspconfig command +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/rspconfig/rspconfig.sh -g $$CN gateway +check:rc==0 +end + +start:rspconfig_gateway_invalid +despcription:rspconfig could not change openbmc gatway using invalid gateway +Attribute: $$CN-The operation object of rspconfig command +cmd:rspconfig $$CN gateway=ddd +check:rc!=0 +end + + diff --git a/xCAT-test/autotest/testcase/rspconfig/rspconfig.sh b/xCAT-test/autotest/testcase/rspconfig/rspconfig.sh new file mode 100755 index 000000000..7b3a8b33f --- /dev/null +++ b/xCAT-test/autotest/testcase/rspconfig/rspconfig.sh @@ -0,0 +1,117 @@ +#!/bin/bash +function test_ip() +{ + IP=$1 + VALID_CHECK=$(echo $IP|awk -F. '$1<=255&&$2<=255&&$3<=255&&$4<=255{print "yes"}') + if echo $IP|grep -E "^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$">/dev/null; then + if [ ${VALID_CHECK:-no} == "yes" ]; then + echo $1; + else + return 1; + fi + else + return 1; + fi + +} +function change_ip() +{ + test_ip $1; + if [[ $? -eq 1 ]]; then + echo ipvalue is invalid + exit 1; + fi + echo $1 > /tmp/BMCIP + ip1=`echo $1|awk -F. '{print $1}'` + ip2=`echo $1|awk -F. '{print $2}'` + ip3=`echo $1|awk -F. '{print $3}'` + ip4=`echo $1|awk -F. '{print $4}'` + echo ip is $ip1.$ip2.$ip3.$ip4 + ip=$ip4; + while [[ $ip != "10" ]]; do + ping $ip1.$ip2.$ip3.$ip -c 2 > /dev/null; + if [[ $? != 0 ]]; then + coutip="$ip1.$ip2.$ip3.$ip" + BMCNEWIP=$coutip; + echo $1,$2,$3 + rspconfig $2 ip=$BMCNEWIP + if [[ $? -eq 0 ]];then + echo right command; + else + exit 1; + fi + chdef $2 bmc=$BMCNEWIP + check_result $2 ip + fi + ip=`expr "$ip" "+" "1"` + done +} +function check_result { + + a=0; while true; + do [ $a -eq 3 ] && exit 1; + echo $a + sleep 20 + output=$(rspconfig $1 $2 ); + if [[ $? -eq 0 ]] ;then + echo $output;exit 0; + else + a=$[$a+1]; + sleep 1; + fi + done +} +function clear_env { + if [[ -f /tmp/BMCIP ]];then + echo need to clear env; + originip=$(cat /tmp/BMCIP); + echo originip is $originip; + rspconfig $2 ip=$originip + echo $2,$3 + rm -rf /tmp/BMCIP + chdef $2 bmc=$originip + check_result $2 $3 + fi +} +function change_gateway { + test_ip $1; + rspconfig $2 gateway=$1; + check_result $2 $3 +} +function change_netmask { + test_ip $1; + rspconfig $2 netmask=$1; + echo $2 ,$3 + check_result $2 $3 + +} +BMCIP="" +BMCNETWORK="" +BMCGATEWAY="" +BMCIP=`rspconfig frame45cn07 ip |awk -F":" '{print $3}'` +BMCGATEWAYE=`rspconfig frame45cn07 gateway |awk -F":" '{print $3}'` +BMCNETMASK=`rspconfig frame45cn07 netmask |awk -F":" '{print $3}'` +while [ "$#" -gt "0" ] +do +case $1 in + "-i"|"--ip" ) + change_ip $BMCIP $2 +;; + "-g"|"--gateway" ) + change_gateway $BMCGATEWAYE $2 $3 +;; + "-n"|"--netmask" ) + change_netmask $BMCNETMASK $2 $3 +;; + "-c"|"--clear" ) + clear_env $1 $2 +;; + *) + echo + echo "Please Insert $0: -i|-g|-n|-c" + echo + exit 1; +;; +esac +done + From 983c6a92298ba52cbfd8fa7b3944218b1635d9b3 Mon Sep 17 00:00:00 2001 From: junxiawang Date: Fri, 5 May 2017 06:22:25 -0400 Subject: [PATCH 013/129] Add test case for openbmc rspconfig command #2912 --- xCAT-test/autotest/testcase/rspconfig/rspconfig.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/xCAT-test/autotest/testcase/rspconfig/rspconfig.sh b/xCAT-test/autotest/testcase/rspconfig/rspconfig.sh index 7b3a8b33f..b80d0dadf 100755 --- a/xCAT-test/autotest/testcase/rspconfig/rspconfig.sh +++ b/xCAT-test/autotest/testcase/rspconfig/rspconfig.sh @@ -88,9 +88,9 @@ function change_netmask { BMCIP="" BMCNETWORK="" BMCGATEWAY="" -BMCIP=`rspconfig frame45cn07 ip |awk -F":" '{print $3}'` -BMCGATEWAYE=`rspconfig frame45cn07 gateway |awk -F":" '{print $3}'` -BMCNETMASK=`rspconfig frame45cn07 netmask |awk -F":" '{print $3}'` +BMCIP=`rspconfig $2 ip |awk -F":" '{print $3}'` +BMCGATEWAYE=`rspconfig $2 gateway |awk -F":" '{print $3}'` +BMCNETMASK=`rspconfig $2 netmask |awk -F":" '{print $3}'` while [ "$#" -gt "0" ] do case $1 in From 2f284f566e4dfda128defadaa2fad6b018a531fa Mon Sep 17 00:00:00 2001 From: junxiawang Date: Fri, 5 May 2017 06:35:24 -0400 Subject: [PATCH 014/129] Add test case for openbmc rspconfig command #2912 --- xCAT-test/autotest/testcase/rspconfig/rspconfig.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xCAT-test/autotest/testcase/rspconfig/rspconfig.sh b/xCAT-test/autotest/testcase/rspconfig/rspconfig.sh index b80d0dadf..cc9714d5e 100755 --- a/xCAT-test/autotest/testcase/rspconfig/rspconfig.sh +++ b/xCAT-test/autotest/testcase/rspconfig/rspconfig.sh @@ -28,7 +28,7 @@ function change_ip() ip4=`echo $1|awk -F. '{print $4}'` echo ip is $ip1.$ip2.$ip3.$ip4 ip=$ip4; - while [[ $ip != "10" ]]; do + while [[ $ip != "254" ]]; do ping $ip1.$ip2.$ip3.$ip -c 2 > /dev/null; if [[ $? != 0 ]]; then coutip="$ip1.$ip2.$ip3.$ip" @@ -49,7 +49,7 @@ function change_ip() function check_result { a=0; while true; - do [ $a -eq 3 ] && exit 1; + do [ $a -eq 10 ] && exit 1; echo $a sleep 20 output=$(rspconfig $1 $2 ); From a17edd7080107375e41f7e36258302569e5928b0 Mon Sep 17 00:00:00 2001 From: Casandra Qiu Date: Fri, 5 May 2017 09:53:28 -0400 Subject: [PATCH 015/129] Support vlan configration for Mellanox Ethernet switch --- xCAT-server/share/xcat/scripts/configMellanox | 100 +++++++++++++++++- 1 file changed, 96 insertions(+), 4 deletions(-) diff --git a/xCAT-server/share/xcat/scripts/configMellanox b/xCAT-server/share/xcat/scripts/configMellanox index 2e6f1db34..6ae339bf2 100755 --- a/xCAT-server/share/xcat/scripts/configMellanox +++ b/xCAT-server/share/xcat/scripts/configMellanox @@ -46,6 +46,9 @@ if ( 'user=s' => \$::USER, 'password=s' => \$::PASSWORD, 'auth=s' => \$::AUTH, + 'vlan=s' => \$::VLAN, + 'port=s' => \$::PORT, + 'mode=s' => \$::MODE, 'all' => \$::ALL, ) ) @@ -93,6 +96,16 @@ my $user; my $cmd; my $rc; my $master; +my $vlan; +my $port; +my $mode; + +#set community string for switch +my $community = "public"; +my @snmpcs = xCAT::TableUtils->get_site_attribute("snmpc"); +my $tmp = $snmpcs[0]; +if (defined($tmp)) { $community = $tmp } + if (($::IP) || ($::ALL)) { config_ip(); @@ -111,6 +124,9 @@ if (($::CONFIG) || ($::ALL)) { run_rspconfig(); } +if ($::VLAN) { + config_vlan(); +} sub config_ip { my @config_switches; @@ -125,7 +141,6 @@ sub config_ip { @nets = $nettab->getAllAttribs('net','mask'); } foreach my $switch (@nodes) { - print "change $switch to static ip address\n"; my $dip= $nodehash->{$switch}->[0]->{otherinterfaces}; if (!$dip) { print "Add otherinterfaces attribute for discover ip: chdef $switch otherinterfaces=x.x.x.x\n"; @@ -150,6 +165,7 @@ sub config_ip { #get hostname my $dswitch = xCAT::NetworkUtils->gethostname($dip); + # if hostnames are same, created different one for discovery name if ($dswitch eq $switch) { $dswitch=""; @@ -161,6 +177,7 @@ sub config_ip { $ip_str =~ s/\./\-/g; $dswitch = "switch-$ip_str"; } + $cmd = "chdef -t node -o $dswitch groups=switch ip=$dip switchtype=Mellanox username=admin nodetype=switch"; $rc= xCAT::Utils->runcmd($cmd, 0); $cmd = "makehosts $dswitch"; @@ -193,6 +210,8 @@ sub config_ip { my $csw = join(",",@config_switches); $cmd = "chdef $csw status=ip_configed otherinterfaces="; $rc= xCAT::Utils->runcmd($cmd, 0); + $cmd = "makehosts $csw"; + $rc= xCAT::Utils->runcmd($cmd, 0); } if (@discover_switches) { @@ -212,7 +231,6 @@ sub config_hostname { foreach my $switch (@nodes) { my $user= $switchhash->{$switch}->[0]->{sshusername}; if (!$user) { - print "switch ssh username is not defined, add default one\n"; $cmd = "chdef $switch username=admin"; $rc= xCAT::Utils->runcmd($cmd, 0); $user="admin"; @@ -244,7 +262,6 @@ sub config_snmp { foreach my $switch (@nodes) { my $user = $switchhash->{$switch}->[0]->{sshusername}; if (!$user) { - print "switch ssh username is not defined, add default one\n"; $cmd = "chdef $switch username=admin"; $rc= xCAT::Utils->runcmd($cmd, 0); $user="admin"; @@ -288,7 +305,6 @@ sub run_rspconfig { my $switchtab = xCAT::Table->new('switches'); my $switchhash = $switchtab->getNodesAttribs(\@nodes,['sshusername']); $master = `hostname -i`; - print "master=$master\n"; foreach my $switch (@nodes) { my $user= $switchhash->{$switch}->[0]->{sshusername}; #call rspconfig command to setup switch @@ -317,6 +333,71 @@ sub run_rspconfig { } +sub config_vlan { + # checking for port number, switches is checked earlier + if ($::PORT) { + $port = $::PORT; + } else { + xCAT::MsgUtils->message("E","Error - When setting vlan, a port must be provided."); + &usage; + exit(1); + } + + #will default to trunk mode + if ($::MODE) { + $mode = $::MODE; + if (!($mode =~ m/(access|trunk|hybrid|access-dcb|dot1q-tunnel)/) ) + { + xCAT::MsgUtils->message("E","Error - Please provided supported mode"); + &usage; + exit(1); + } + } else { + $mode = "access"; + } + + $vlan = $::VLAN; + + foreach my $switch (@nodes) { + my $devicetype; + + # check if it is ethernet switch or ib switch + my $ccmd = "snmpwalk -Os -v1 -c $community $switch 1.3.6.1.2.1.1.1"; + my $result = xCAT::Utils->runcmd($ccmd, 0); + + # only supports MSX1410 and MSX1400 for Mellanox Ethernet switch now + if ( $result =~ /MSX14/ ) { + $devicetype = "EthSwitch::Mellanox"; + }else { + xCAT::MsgUtils->message("E","Config IB switch vlan is not support yet"); + $devicetype = "IBSwitch::Mellanox"; + next; + } + + my $cmd_prefix = "xdsh $switch --devicetype $devicetype"; + my $cmd; + + # Build up the commands for easier readability + $cmd = $cmd . "enable\;"; + $cmd = $cmd . "configure terminal\;"; + $cmd = $cmd . "vlan $vlan\;"; + $cmd = $cmd . "exit\;"; + $cmd = $cmd . "interface ethernet 1/$port\;"; + $cmd = $cmd . "switchport mode $mode\;"; + if ($mode =~ /access/) { + $cmd = $cmd . "switchport access vlan $vlan\;"; + } else { + $cmd = $cmd . "switchport $mode allowed-vlan $vlan\;"; + } + $cmd = $cmd . "exit\;exit\;exit\;"; + + my $final_cmd = $cmd_prefix . " \"" . $cmd . "\""; + + `$final_cmd` + } +} + + #--------------------------------------------------------- =head3 usage @@ -339,6 +420,17 @@ sub usage To run rspconfig command: configMellanox --switches switchnames --config + + To set Vlan for interface commmand (only for Mellanox Ethernet switch) : + configMellanox --switches switchnames --port port --vlan vlan --mode mode + + The following mode are supported for switchport: + * access Only untagged ingress Ethernet packets are allowed + * trunk Only tagged ingress Ethernet packets are allowed + * hybrid Both tagged and untagged ingress Ethernet packets are allowed + * access-dcb Only untagged ingress Ethernet packets are allowed. Egress packets will be priority tagged + * dot1q-tunnel Both tagged and untagged ingress Ethernet packets are allowed. Egress packets are tagged with a second VLAN (802.1Q) header + \n"; } From 494cf232f46d00b6621b6c5d2f24e2efd417b300 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Wed, 10 May 2017 10:19:58 -0400 Subject: [PATCH 016/129] Support newer PDU firmware Newer PDU firmware renumbered OIDs. Detect and adapt to new OIDs on the newer firmware. --- xCAT-server/lib/xcat/plugins/pdu.pm | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/pdu.pm b/xCAT-server/lib/xcat/plugins/pdu.pm index 9d54d92fc..895d56184 100644 --- a/xCAT-server/lib/xcat/plugins/pdu.pm +++ b/xCAT-server/lib/xcat/plugins/pdu.pm @@ -271,8 +271,6 @@ sub powerpduoutlet { my $value; my $statstr; - my $oid = ".1.3.6.1.4.1.2.6.223.8.2.2.1.11"; - my $type = "INTEGER"; my $tmpnodestr = join(",", @$noderange); my $nodetab = xCAT::Table->new('pduoutlet'); @@ -341,6 +339,9 @@ sub outletpower { my $oid = ".1.3.6.1.4.1.2.6.223.8.2.2.1.11"; my $type = "INTEGER"; + if ($session->newmib) { + $oid = ".1.3.6.1.4.1.2.6.223.8.2.2.1.13"; + } my $varbind = new SNMP::Varbind([ $oid, $outlet, $value, $type ]); return $session->set($varbind); @@ -392,6 +393,9 @@ sub outletstat { my $oid = ".1.3.6.1.4.1.2.6.223.8.2.2.1.11"; my $output; my $statstr; + if ($session->newmib) { + $oid = ".1.3.6.1.4.1.2.6.223.8.2.2.1.13"; + } $output = $session->get("$oid.$outlet"); if ($output eq 1) { @@ -431,6 +435,15 @@ sub connectTopdu { unless ($session) { return; } + $session->newmib = 0; + my $pduversion = $session->get(".1.3.6.1.4.1.2.6.223.7.3.0"); + if ($pduversion =~ /(\d+)\.(\d+)_(\d+)/) { + if ($1 >= 1 and $2 >= 3 and $3 >= 3) { + $session->newmib = 1; + } + } + + return $session; } From 27613cdc18f7e9eafd0f09cac74828845f586408 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Wed, 10 May 2017 10:25:07 -0400 Subject: [PATCH 017/129] Fix syntax of newmib It has to be referenced as a hash element. --- xCAT-server/lib/xcat/plugins/pdu.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/pdu.pm b/xCAT-server/lib/xcat/plugins/pdu.pm index 895d56184..17e66f50c 100644 --- a/xCAT-server/lib/xcat/plugins/pdu.pm +++ b/xCAT-server/lib/xcat/plugins/pdu.pm @@ -339,7 +339,7 @@ sub outletpower { my $oid = ".1.3.6.1.4.1.2.6.223.8.2.2.1.11"; my $type = "INTEGER"; - if ($session->newmib) { + if ($session->{newmib}) { $oid = ".1.3.6.1.4.1.2.6.223.8.2.2.1.13"; } @@ -393,7 +393,7 @@ sub outletstat { my $oid = ".1.3.6.1.4.1.2.6.223.8.2.2.1.11"; my $output; my $statstr; - if ($session->newmib) { + if ($session->{newmib}) { $oid = ".1.3.6.1.4.1.2.6.223.8.2.2.1.13"; } @@ -435,11 +435,11 @@ sub connectTopdu { unless ($session) { return; } - $session->newmib = 0; + $session->{newmib} = 0; my $pduversion = $session->get(".1.3.6.1.4.1.2.6.223.7.3.0"); if ($pduversion =~ /(\d+)\.(\d+)_(\d+)/) { if ($1 >= 1 and $2 >= 3 and $3 >= 3) { - $session->newmib = 1; + $session->{newmib} = 1; } } From e9b8a3bbbf96b068ec7add801c747487dc1e3169 Mon Sep 17 00:00:00 2001 From: Casandra Qiu Date: Wed, 10 May 2017 13:48:18 -0400 Subject: [PATCH 018/129] modification for configMellanox scripts --- xCAT-server/lib/perl/xCAT/MellanoxIB.pm | 11 ++ .../lib/xcat/plugins/switchdiscover.pm | 2 +- xCAT-server/share/xcat/scripts/configMellanox | 101 ++++++++++-------- 3 files changed, 68 insertions(+), 46 deletions(-) diff --git a/xCAT-server/lib/perl/xCAT/MellanoxIB.pm b/xCAT-server/lib/perl/xCAT/MellanoxIB.pm index dbfec4b69..c26f18c9f 100644 --- a/xCAT-server/lib/perl/xCAT/MellanoxIB.pm +++ b/xCAT-server/lib/perl/xCAT/MellanoxIB.pm @@ -568,11 +568,13 @@ sub setSSHcfg { my $enable_cmd = "enable\r"; my $config_cmd = "configure terminal\r"; my $exit_cmd = "exit\r"; + my $init_cmd = "no\r"; my $pwd_prompt = "Password: "; my $sw_prompt = "^.*\] > "; my $enable_prompt = "^.*\] \#"; my $config_prompt = "^.*\\\(config\\\) \#"; + my $init_prompt = "Do you want to use the wizard for initial configuration?"; my $debug = 0; @@ -664,6 +666,15 @@ sub setSSHcfg { $mysw->exp_continue(); } ], + [ + "-re", $init_prompt, + sub { + #print "$node: sending command: $init_cmd\n"; + $mysw->clear_accum(); + $mysw->send($init_cmd); + $mysw->exp_continue(); + } + ], [ "-re", $sw_prompt, sub { diff --git a/xCAT-server/lib/xcat/plugins/switchdiscover.pm b/xCAT-server/lib/xcat/plugins/switchdiscover.pm index ebc6cb61b..12b3dc03c 100644 --- a/xCAT-server/lib/xcat/plugins/switchdiscover.pm +++ b/xCAT-server/lib/xcat/plugins/switchdiscover.pm @@ -37,7 +37,7 @@ my %global_mac_identity = ( "a8:97:dc" => "BNT G8052 switch", "6c:ae:8b" => "BNT G8264-T switch", "fc:cf:62" => "BNT G8124 switch", - "7c:fe:90" => "Mellanox IB switch", + "7c:fe:90" => "Mellanox switch", "8c:ea:1b" => "Edgecore Networks Switch" ); diff --git a/xCAT-server/share/xcat/scripts/configMellanox b/xCAT-server/share/xcat/scripts/configMellanox index 6ae339bf2..397ac58e8 100755 --- a/xCAT-server/share/xcat/scripts/configMellanox +++ b/xCAT-server/share/xcat/scripts/configMellanox @@ -43,9 +43,6 @@ if ( 'ip' => \$::IP, 'name' => \$::NAME, 'snmp' => \$::SNMP, - 'user=s' => \$::USER, - 'password=s' => \$::PASSWORD, - 'auth=s' => \$::AUTH, 'vlan=s' => \$::VLAN, 'port=s' => \$::PORT, 'mode=s' => \$::MODE, @@ -115,8 +112,7 @@ if (($::NAME) || ($::ALL)) { config_hostname(); } -if (($::SNMP) || ($::ALL)) -{ +if (($::SNMP) || ($::ALL)) { config_snmp(); } @@ -165,7 +161,6 @@ sub config_ip { #get hostname my $dswitch = xCAT::NetworkUtils->gethostname($dip); - # if hostnames are same, created different one for discovery name if ($dswitch eq $switch) { $dswitch=""; @@ -177,17 +172,29 @@ sub config_ip { $ip_str =~ s/\./\-/g; $dswitch = "switch-$ip_str"; } - - $cmd = "chdef -t node -o $dswitch groups=switch ip=$dip switchtype=Mellanox username=admin nodetype=switch"; + $cmd = "chdef -t node -o $dswitch groups=switch ip=$dip switchtype=Mellanox username=admin password=admin mgt=switch nodetype=switch"; $rc= xCAT::Utils->runcmd($cmd, 0); $cmd = "makehosts $dswitch"; $rc= xCAT::Utils->runcmd($cmd, 0); + $cmd = "makedns $dswitch"; + $rc= xCAT::Utils->runcmd($cmd, 0); + + $cmd="rspconfig $dswitch sshcfg=enable"; + $rc= xCAT::Utils->runcmd($cmd, 0); + if ($::RUNCMD_RC != 0) { + xCAT::MsgUtils->message("E"," Failed to config ssh passwordless for $dip"); + print "Failed to config ssh passwordless for $dswitch, $dip\n"; + push (@discover_switches, $dswitch); + next; + } # verify if xdsh works $cmd = "xdsh $dswitch -l admin --devicetype IBSwitch::Mellanox 'enable;configure terminal;exit' "; $rc= xCAT::Utils->runcmd($cmd, 0); if ($::RUNCMD_RC != 0) { - xCAT::MsgUtils->message("E","Couldn't communicate with $dswitch, $dip"); + xCAT::MsgUtils->message("E","Couldn't communicate with $dip"); + print "$cmd failed, Couldn't communicate with $dswitch, $dip\n"; + push (@discover_switches, $dswitch); next; } #get netmask @@ -203,6 +210,7 @@ sub config_ip { push (@discover_switches, $dswitch); push (@config_switches, $switch); + print "changed $switch ip address to static ip $static_ip\n"; } if (@config_switches) { @@ -217,6 +225,8 @@ sub config_ip { if (@discover_switches) { my $dsw = join(",",@discover_switches); #remove discover switch from xCATdb and /etc/hosts + $cmd = "makedns -d $dsw"; + $rc= xCAT::Utils->runcmd($cmd, 0); $cmd = "makehosts -d $dsw"; $rc= xCAT::Utils->runcmd($cmd, 0); $cmd = "rmdef $dsw"; @@ -231,6 +241,7 @@ sub config_hostname { foreach my $switch (@nodes) { my $user= $switchhash->{$switch}->[0]->{sshusername}; if (!$user) { + print "switch ssh username is not defined, add default one\n"; $cmd = "chdef $switch username=admin"; $rc= xCAT::Utils->runcmd($cmd, 0); $user="admin"; @@ -241,7 +252,8 @@ sub config_hostname { xCAT::MsgUtils->message("E","Failed to setup hostname for $switch"); next; } - push (@config_switches, $switch); + push (@config_switches, $switch); + print "switch host name changed to $switch\n"; } if (@config_switches) { #update switch status @@ -258,45 +270,42 @@ sub config_snmp { my $snmp_auth; my $switchtab = xCAT::Table->new('switches'); - my $switchhash = $switchtab->getNodesAttribs(\@nodes,['sshusername','username','password','auth']); + my $switchhash = $switchtab->getNodesAttribs(\@nodes,['sshusername','username','password','auth','privacy']); foreach my $switch (@nodes) { my $user = $switchhash->{$switch}->[0]->{sshusername}; if (!$user) { + print "switch ssh username is not defined, add default one\n"; $cmd = "chdef $switch username=admin"; $rc= xCAT::Utils->runcmd($cmd, 0); $user="admin"; } - if ($::USER) { - $snmp_user = $::USER; - } elsif ($switchhash->{$switch}->[0]->{username}) { - $snmp_user = $switchhash->{$switch}->[0]->{username}; - } else { - $snmp_user = "xcatadmin\r"; + $snmp_user = $switchhash->{$switch}->[0]->{username}; + if (!$snmp_user) { + print "no snmp user is defined for this switch $switch, not going to set up snmpv3\n"; + next; } - if ($::PASSWORD) { - $snmp_passwd = $::PASSWORD; - } elsif ($switchhash->{$switch}->[0]->{password}) { - $snmp_passwd = $switchhash->{$switch}->[0]->{password}; + $snmp_passwd = $switchhash->{$switch}->[0]->{password}; + $snmp_auth = $switchhash->{$switch}->[0]->{auth}; + my $snmp_privacy = $switchhash->{$switch}->[0]->{privacy}; + + my $cmd_prefix = "xdsh $switch -l $user --devicetype IBSwitch::Mellanox"; + my $cmd; + # Build up the commands for easier readability + $cmd = $cmd . "enable\;"; + $cmd = $cmd . "configure terminal\;"; + $cmd = $cmd . "snmp-server user $snmp_user v3 enable\;"; + if ($snmp_privacy) { + $cmd = $cmd . "snmp-server user $snmp_user v3 auth $snmp_auth $snmp_passwd priv $snmp_privacy $snmp_passwd\;"; } else { - # Need a special character - $snmp_passwd = "passw0rd\r"; - } - if ($::AUTH) { - $snmp_auth = $::AUTH; - } elsif ($switchhash->{$switch}->[0]->{auth}) { - $snmp_auth = $switchhash->{$switch}->[0]->{auth}; - } else { - $snmp_auth = "sha\r"; + $cmd = $cmd . "snmp-server user $snmp_user v3 auth $snmp_auth $snmp_passwd\; no snmp-server user $snmp_user v3 require-privacy\;"; } - $cmd = "xdsh $switch -l $user --devicetype IBSwitch::Mellanox 'enable;configure terminal;snmp-server user $snmp_user v3 enable;snmp-server user $snmp_user v3 auth $snmp_auth $snmp_passwd;no snmp-server user $snmp_user v3 require-privacy;configuration write;exit' "; - $rc= xCAT::Utils->runcmd($cmd, 0); - if ($::RUNCMD_RC != 0) { - xCAT::MsgUtils->message("E","Failed to set snmpv3 for $switch"); - } else { - $cmd = "chdef $switch status=snmp_configed snmpversion=3 snmpauth=$snmp_auth snmpusername=$snmp_user snmppassword=$snmp_passwd"; - $rc= xCAT::Utils->runcmd($cmd, 0); - } + print "snmpv3 configured for switch $switch\n"; + + $cmd = $cmd . "configuration write\;exit\;"; + my $final_cmd = $cmd_prefix . " \"" . $cmd . "\""; + + `$final_cmd` } } @@ -342,7 +351,7 @@ sub config_vlan { &usage; exit(1); } - + #will default to trunk mode if ($::MODE) { $mode = $::MODE; @@ -373,10 +382,12 @@ sub config_vlan { $devicetype = "IBSwitch::Mellanox"; next; } - + my $cmd_prefix = "xdsh $switch --devicetype $devicetype"; my $cmd; + print "Tagging VLAN=$vlan for $switch port $port\n"; + # Build up the commands for easier readability $cmd = $cmd . "enable\;"; $cmd = $cmd . "configure terminal\;"; @@ -390,10 +401,10 @@ sub config_vlan { $cmd = $cmd . "switchport $mode allowed-vlan $vlan\;"; } $cmd = $cmd . "exit\;exit\;exit\;"; - my $final_cmd = $cmd_prefix . " \"" . $cmd . "\""; `$final_cmd` + } } @@ -413,7 +424,7 @@ sub usage configMellanox -h│--help configMellanox --switches switchnames --ip configMellanox --switches switchnames --name - configMellanox --switches switchnames --snmp [--user snmp_user] [--password snmp_password] [--auth snmp_auth] + configMellanox --switches switchnames --snmp To set the ip address, hostname, config snmp and run rspconfig command: configMellanox --switches switchnames --all @@ -422,14 +433,14 @@ sub usage configMellanox --switches switchnames --config To set Vlan for interface commmand (only for Mellanox Ethernet switch) : - configMellanox --switches switchnames --port port --vlan vlan --mode mode + configMellanox --switches switchnames --port port --vlan vlan --mode mode - The following mode are supported for switchport: + The following mode are supported for switchport: * access Only untagged ingress Ethernet packets are allowed * trunk Only tagged ingress Ethernet packets are allowed * hybrid Both tagged and untagged ingress Ethernet packets are allowed * access-dcb Only untagged ingress Ethernet packets are allowed. Egress packets will be priority tagged - * dot1q-tunnel Both tagged and untagged ingress Ethernet packets are allowed. Egress packets are tagged with a second VLAN (802.1Q) header + * dot1q-tunnel Both tagged and untagged ingress Ethernet packets are allowed. Egress packets are tagged with a second VLAN (802.1Q) header \n"; } From c02c9269df22975306d80de03c8673aa0c47edf7 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Wed, 10 May 2017 14:49:40 -0400 Subject: [PATCH 019/129] Initial pass for OpenBMC rvitals --- .../references/man1/rvitals.1.rst | 2 +- perl-xCAT/xCAT/Usage.pm | 2 +- xCAT-client/pods/man1/rvitals.1.pod | 2 +- xCAT-server/lib/xcat/plugins/openbmc.pm | 71 ++++++++++++++++++- 4 files changed, 73 insertions(+), 4 deletions(-) diff --git a/docs/source/guides/admin-guides/references/man1/rvitals.1.rst b/docs/source/guides/admin-guides/references/man1/rvitals.1.rst index 55d29d53b..e6929cdfc 100644 --- a/docs/source/guides/admin-guides/references/man1/rvitals.1.rst +++ b/docs/source/guides/admin-guides/references/man1/rvitals.1.rst @@ -60,7 +60,7 @@ OpenPOWER server specific: ========================== -\ **rvitals**\ \ *noderange*\ {\ **temp | voltage | wattage | fanspeed | power | leds | all**\ } +\ **rvitals**\ \ *noderange*\ [\ **temp | voltage | wattage | fanspeed | power | leds | all**\ ] diff --git a/perl-xCAT/xCAT/Usage.pm b/perl-xCAT/xCAT/Usage.pm index cfad04bac..01ed1cb1c 100755 --- a/perl-xCAT/xCAT/Usage.pm +++ b/perl-xCAT/xCAT/Usage.pm @@ -76,7 +76,7 @@ my %usage = ( BMC specific: rvitals noderange {temp|voltage|wattage|fanspeed|power|leds|all} OpenPOWER server specific: - rvitals noderange {temp|voltage|wattage|fanspeed|power|leds|all} + rvitals noderange [temp|voltage|wattage|fanspeed|power|leds|all] MIC specific: rvitals noderange {thermal|all}", "reventlog" => diff --git a/xCAT-client/pods/man1/rvitals.1.pod b/xCAT-client/pods/man1/rvitals.1.pod index 3bce77fa8..32ff2fb81 100644 --- a/xCAT-client/pods/man1/rvitals.1.pod +++ b/xCAT-client/pods/man1/rvitals.1.pod @@ -28,7 +28,7 @@ B I {B|B|B|B|B|B I {B|B|B|B|B|B|B} +B I [B|B|B|B|B|B|B] =head1 B diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index 2fb93bf51..8c46fd90c 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -168,6 +168,13 @@ my %status_info = ( RSPCONFIG_SET_RESPONSE => { process => \&rspconfig_response, }, + RVITALS_REQUEST => { + method => "GET", + init_url => "$openbmc_project_url/sensors/enumerate", + }, + RVITALS_RESPONSE => { + process => \&rvitals_response, + }, ); $::RESPONSE_OK = "200 OK"; @@ -361,7 +368,7 @@ sub parse_args { return ([ 1, "No option specified for $command" ]); } - if (scalar(@ARGV) > 1 and ($command =~ /rpower|rinv|rsetboot/)) { + if (scalar(@ARGV) > 1 and ($command =~ /rpower|rinv|rsetboot|rvitals/)) { return ([ 1, "Only one option is supported at the same time" ]); } @@ -429,6 +436,12 @@ sub parse_args { return ([ 1, "Unsupported command: $command $subcommand" ]); } } + } elsif ($command eq "rvitals") { + $check = unsupported($callback); if (ref($check) eq "ARRAY") { return $check; } + $subcommand = "all" if (!defined($ARGV[0])); + unless ($subcommand =~ /^temp$|^voltage$|^wattage$|^fanspeed$|^power$|^leds$|^all$/) { + return ([ 1, "Unsupported command: $command $subcommand" ]); + } } else { return ([ 1, "Command is not supported." ]); } @@ -562,6 +575,18 @@ sub parse_command_status { return 1; } + if ($command eq "rvitals") { + if (defined($ARGV[0])) { + $subcommand = $ARGV[0]; + } else { + $subcommand = "all"; + } + + $next_status{LOGIN_RESPONSE} = "RVITALS_REQUEST"; + $next_status{RVITALS_REQUEST} = "RVITALS_RESPONSE"; + $status_info{RVITALS_RESPONSE}{argv} = "$subcommand"; + } + print Dumper(\%next_status) . "\n"; return; } @@ -1090,4 +1115,48 @@ sub rspconfig_response { } } +#------------------------------------------------------- + +=head3 rvitals_response + + Deal with response of rvitals command + Input: + $node: nodename of current response + $response: Async return response + +=cut + +#------------------------------------------------------- +sub rvitals_response { + my $node = shift; + my $response = shift; + + my $response_info = decode_json $response->content; + + my $grep_string = $status_info{RVITALS_RESPONSE}{argv}; + my $src; + my $content_info; + my $sensor_value; + + xCAT::SvrUtils::sendmsg("Processing command rvitals $grep_string", $callback, $node); + + foreach my $key_url (keys %{$response_info->{data}}) { + my %content = %{ ${ $response_info->{data} }{$key_url} }; + #print Dumper(%{$response_info->{data}}) . "\n"; + #print Dumper(%content) . "\n"; + $sensor_value = $key_url . " " . $content{Value}; + xCAT::SvrUtils::sendmsg("$sensor_value", $callback, $node); + } + + if ($next_status{ $node_info{$node}{cur_status} }) { + $node_info{$node}{cur_status} = $next_status{ $node_info{$node}{cur_status} }; + gen_send_request($node); + } else { + $wait_node_num--; + } + + return; +} + + 1; From 37e96693cfc440eae2141e4229ff62690d3c5d04 Mon Sep 17 00:00:00 2001 From: junxiawang Date: Thu, 11 May 2017 07:22:33 -0400 Subject: [PATCH 020/129] Add test case for openbmc rspconfig command #2912 --- .../autotest/testcase/rspconfig/rspconfig.sh | 156 +++++++++++++----- 1 file changed, 118 insertions(+), 38 deletions(-) diff --git a/xCAT-test/autotest/testcase/rspconfig/rspconfig.sh b/xCAT-test/autotest/testcase/rspconfig/rspconfig.sh index cc9714d5e..fa53dfdbd 100755 --- a/xCAT-test/autotest/testcase/rspconfig/rspconfig.sh +++ b/xCAT-test/autotest/testcase/rspconfig/rspconfig.sh @@ -7,104 +7,184 @@ function test_ip() if [ ${VALID_CHECK:-no} == "yes" ]; then echo $1; else - return 1; + exit 1; fi else - return 1; + exit 1; fi + return 0; } +function net() +{ + a=$(echo "$1" | awk -F "." '{print $1" "$2" "$3" "$4}') + for num in $a; + do + while (($num!=0));do + echo -n $(($num%2)) >> /tmp/$$.num; + num=$(($num/2)); + done + done + rc=$(grep -o "1" /tmp/$$.num | wc -l) + rm /tmp/$$.num + ip="$2/$rc" + A=($(echo "$ip"|sed 's/[./;]/ /g')) + B=$(echo $((2**(32-${A[4]})-1))) + C=($(echo "obase=256;ibase=10; $B"|bc|awk '{if(NF==4)a=$0;if(NF==3)a="0"$0;if(NF==2)a="0 0"$0;if(NF==1)a="0 0 0"$0;print a}')) + D=$(echo ${A[*]} ${C[*]}) + rc2=echo echo $D|awk 'BEGIN{OFS="."}{print $1,$2,$3,$4"-"$1+$6,$2+$7,$3+$8,$4+$9}' |awk -F '-' '{print $2}' +} function change_ip() { test_ip $1; - if [[ $? -eq 1 ]]; then - echo ipvalue is invalid - exit 1; - fi + if [[ $? -eq 0 ]];then echo $1 > /tmp/BMCIP ip1=`echo $1|awk -F. '{print $1}'` ip2=`echo $1|awk -F. '{print $2}'` ip3=`echo $1|awk -F. '{print $3}'` ip4=`echo $1|awk -F. '{print $4}'` echo ip is $ip1.$ip2.$ip3.$ip4 - ip=$ip4; - while [[ $ip != "254" ]]; do - ping $ip1.$ip2.$ip3.$ip -c 2 > /dev/null; - if [[ $? != 0 ]]; then + rc=$(net $3 $1) + rc4=`echo $rc |awk -F. '{print $4}'` + rc4=`expr "$rc4"` + if [[ $rc4 > 255 ]];then + rc4=255 + fi + ip=$ip4; while true; + do [[ $ip == "$rc4" ]] && exit 1; + ping $ip1.$ip2.$ip3.$ip -c 2 > /dev/null; + if [[ $? != 0 ]]; then coutip="$ip1.$ip2.$ip3.$ip" BMCNEWIP=$coutip; echo $1,$2,$3 rspconfig $2 ip=$BMCNEWIP - if [[ $? -eq 0 ]];then + if [[ $? -eq 0 ]];then echo right command; - else + else exit 1; fi chdef $2 bmc=$BMCNEWIP - check_result $2 ip + check_result $2 ip $BMCNEWIP + if [[ $? -ne 0 ]] ;then + exit 1; + else + echo need to return ; + break 3; + fi fi ip=`expr "$ip" "+" "1"` done + return 0 + fi } -function check_result { - +function check_result() +{ a=0; while true; - do [ $a -eq 10 ] && exit 1; - echo $a - sleep 20 - output=$(rspconfig $1 $2 ); - if [[ $? -eq 0 ]] ;then - echo $output;exit 0; - else - a=$[$a+1]; - sleep 1; - fi + do [ $a -eq 20 ] && exit 1; + output=`rspconfig $1 $2 |awk -F: '{print $3}'`; + echo output is $output; + if [[ $(echo $output|tr '.' '+'|bc) -eq $(echo $3|tr '.' '+'|bc) ]];then + echo checkresult is $output; + break 3; + else + a=$[$a+1]; + sleep 1; + fi done + return 0 } -function clear_env { +function clear_env() +{ if [[ -f /tmp/BMCIP ]];then echo need to clear env; originip=$(cat /tmp/BMCIP); echo originip is $originip; rspconfig $2 ip=$originip + if [[ $? -eq 0 ]];then + echo right command; + else + exit 1; + fi echo $2,$3 rm -rf /tmp/BMCIP chdef $2 bmc=$originip - check_result $2 $3 + check_result $2 $3 $originip + if [[ $? -ne 0 ]] ;then + exit 1; + else + echo "need to return" ; + break 1; + fi + return 0 fi + return 1 } function change_gateway { test_ip $1; rspconfig $2 gateway=$1; - check_result $2 $3 + if [[ $? -eq 0 ]];then + echo set gateway ok; + else + exit 1; + fi + check_result $2 $3 $1 + return 0 } function change_netmask { test_ip $1; rspconfig $2 netmask=$1; + if [[ $? -eq 0 ]];then + echo set netmask ok; + else + exit 1; + fi echo $2 ,$3 - check_result $2 $3 - + check_result $2 $3 $1 + return 0 } BMCIP="" -BMCNETWORK="" -BMCGATEWAY="" -BMCIP=`rspconfig $2 ip |awk -F":" '{print $3}'` -BMCGATEWAYE=`rspconfig $2 gateway |awk -F":" '{print $3}'` -BMCNETMASK=`rspconfig $2 netmask |awk -F":" '{print $3}'` +BMCGTEWAT="" +BMCNETMASK="" while [ "$#" -gt "0" ] do case $1 in "-i"|"--ip" ) - change_ip $BMCIP $2 + rspconfig $2 ip + if [[ $? -eq 0 ]];then + echo get ip ok; + BMCIP=`rspconfig $2 ip |awk -F":" '{print $3}'` + BMCNETMASK=`rspconfig $2 netmask |awk -F":" '{print $3}'` + else + exit 1; + fi + change_ip $BMCIP $2 $BMCNETMASK ;; "-g"|"--gateway" ) + rspconfig $2 gateway + if [[ $? -eq 0 ]];then + echo get gateway ok; + BMCGATEWAYE=`rspconfig $2 gateway |awk -F":" '{print $3}'` + else + exit 1; + fi + change_gateway $BMCGATEWAYE $2 $3 ;; "-n"|"--netmask" ) - change_netmask $BMCNETMASK $2 $3 + rspconfig $2 netmask + if [[ $? -eq 0 ]];then + echo get netmask ok; + BMCNETMASK=`rspconfig $2 netmask |awk -F":" '{print $3}'` + else + exit 1; + fi + change_netmask $BMCNETMASK $2 $3 ;; "-c"|"--clear" ) - clear_env $1 $2 + clear_env $1 $2 $3 + if [[ $? -ne 0 ]] ;then + exit 1 + fi ;; *) echo From 320d79a0fd886f8024afc9c28888731160ef2fc5 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Thu, 11 May 2017 09:57:05 -0400 Subject: [PATCH 021/129] Suggested review changes --- xCAT-server/lib/xcat/plugins/openbmc.pm | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index 8c46fd90c..ccec961d7 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -1138,13 +1138,16 @@ sub rvitals_response { my $content_info; my $sensor_value; - xCAT::SvrUtils::sendmsg("Processing command rvitals $grep_string", $callback, $node); + print "$node DEBUG Processing command: rvitals $grep_string \n"; + print Dumper(%{$response_info->{data}}) . "\n"; foreach my $key_url (keys %{$response_info->{data}}) { my %content = %{ ${ $response_info->{data} }{$key_url} }; - #print Dumper(%{$response_info->{data}}) . "\n"; - #print Dumper(%content) . "\n"; - $sensor_value = $key_url . " " . $content{Value}; + print Dumper(%content) . "\n"; + # $key_url is "/xyz/openbmc_project/sensors/xxx/yyy + # For now display xxx/yyy as a label + my ($junk, $label) = split("/sensors/", $key_url); + $sensor_value = $label . " " . $content{Value}; xCAT::SvrUtils::sendmsg("$sensor_value", $callback, $node); } From a5dda1a07e9de1af70ff8d66a6808b6a395ad74b Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Thu, 11 May 2017 14:47:33 -0400 Subject: [PATCH 022/129] Better processing mkdef if object already exists --- xCAT-server/lib/xcat/plugins/DBobjectdefs.pm | 28 ++++++++++++++------ 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/DBobjectdefs.pm b/xCAT-server/lib/xcat/plugins/DBobjectdefs.pm index f263fdfe4..973f1d4c0 100755 --- a/xCAT-server/lib/xcat/plugins/DBobjectdefs.pm +++ b/xCAT-server/lib/xcat/plugins/DBobjectdefs.pm @@ -1750,11 +1750,8 @@ sub defmk # won't remove the old one unless the force option is used my $rsp; - $rsp->{data}->[0] = "\nA definition for \'$obj\' already exists."; - $rsp->{data}->[1] = "To remove the old definition and replace it with \na new definition use the force \'-f\' option."; - $rsp->{data}->[2] = "To change the existing definition use the \'chdef\' command."; - xCAT::MsgUtils->message("E", $rsp, $::callback); - $error = 1; + $rsp->{data}->[0] = "A definition for \'$obj\' already exists. No changes will be made. Run again with \'-f\' option to force replace."; + xCAT::MsgUtils->message("W", $rsp, $::callback); delete $::FINALATTRS{$obj}; next; @@ -2007,7 +2004,6 @@ sub defmk # give results my $rsp; - $rsp->{data}->[0] = "The database was updated for the following objects:"; xCAT::MsgUtils->message("I", $rsp, $::callback); my $n = 1; @@ -2016,14 +2012,30 @@ sub defmk $rsp->{data}->[$n] = "$o"; $n++; } - xCAT::MsgUtils->message("I", $rsp, $::callback); + if ($n > 1) { + # Some objects were created ($n was increased), report as success + $rsp->{data}->[0] = "The database was updated for the following objects:"; + xCAT::MsgUtils->message("I", $rsp, $::callback); + } + else { + # No objects were created, report as error + $rsp->{data}->[0] = "The database was not updated."; + xCAT::MsgUtils->message("E", $rsp, $::callback); + } } else { my $rsp; my $nodenum = scalar(keys %::FINALATTRS); $rsp->{data}->[0] = "$nodenum object definitions have been created or modified."; - xCAT::MsgUtils->message("I", $rsp, $::callback); + if ($nodenum > 0) { + # Some objects were created, report as success + xCAT::MsgUtils->message("I", $rsp, $::callback); + } + else { + # No objects were created, report as error + xCAT::MsgUtils->message("E", $rsp, $::callback); + } } return 0; } From 83f5ea9321abd5649c1fe386f18a430205d64c5b Mon Sep 17 00:00:00 2001 From: XuWei Date: Thu, 11 May 2017 23:12:15 -0400 Subject: [PATCH 023/129] Get username and password from passwd table for openbmc discover --- xCAT-server/lib/xcat/plugins/bmcdiscover.pm | 27 ++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/bmcdiscover.pm b/xCAT-server/lib/xcat/plugins/bmcdiscover.pm index 439203163..4f6bce095 100644 --- a/xCAT-server/lib/xcat/plugins/bmcdiscover.pm +++ b/xCAT-server/lib/xcat/plugins/bmcdiscover.pm @@ -41,6 +41,8 @@ if ($tempstring =~ /debian/ || $tempstring =~ /ubuntu/) { my $parent_fd; my $bmc_user; my $bmc_pass; +my $openbmc_user; +my $openbmc_pass; #------------------------------------------------------- @@ -211,10 +213,11 @@ sub bmcdiscovery_processargs { # Get the default bmc account from passwd table, # this is only done for the discovery process ############################################ - ($bmc_user, $bmc_pass) = bmcaccount_from_passwd(); + ($bmc_user, $bmc_pass, $openbmc_user, $openbmc_pass) = bmcaccount_from_passwd(); # overwrite the default user and password if one is provided if ($::opt_U) { $bmc_user = $::opt_U; + $openbmc_user = $::opt_U; } elsif ($::opt_P) { # If password is provided, but no user, set the user to blank # Support older FSP and Tuletta machines @@ -222,6 +225,7 @@ sub bmcdiscovery_processargs { } if ($::opt_P) { $bmc_pass = $::opt_P; + $openbmc_pass = $::opt_P; } ######################################### @@ -868,12 +872,16 @@ sub bmcdiscovery { sub bmcaccount_from_passwd { my $bmcusername = "ADMIN"; my $bmcpassword = "admin"; + my $openbmcusername = "root"; + my $openbmcpassword = "0penBmc"; my $passwdtab = xCAT::Table->new("passwd", -create => 0); if ($passwdtab) { my $bmcentry = $passwdtab->getAttribs({ 'key' => 'ipmi' }, 'username', 'password'); if (defined($bmcentry)) { $bmcusername = $bmcentry->{'username'}; $bmcpassword = $bmcentry->{'password'}; + + # if username or password is undef or empty in passwd table, bmcusername or bmcpassword is empty unless ($bmcusername) { $bmcusername = ''; } @@ -881,8 +889,21 @@ sub bmcaccount_from_passwd { $bmcpassword = ''; } } + + my $openbmcentry = $passwdtab->getAttribs({ 'key' => 'openbmc' }, 'username', 'password'); + if (defined($openbmcentry)) { + $openbmcusername = $openbmcentry->{'username'}; + $openbmcpassword = $openbmcentry->{'password'}; + # if username or password is undef or empty in passwd table, openbmcusername or openbmcpassword is empty + unless ($openbmcusername) { + $openbmcusername = ''; + } + unless ($openbmcpassword) { + $openbmcpassword = ''; + } + } } - return ($bmcusername, $bmcpassword); + return ($bmcusername, $bmcpassword, $openbmcusername, $openbmcpassword); } #---------------------------------------------------------------------------- @@ -1020,7 +1041,7 @@ sub bmcdiscovery_openbmc{ my $node_data = $ip; my $cjar_file = "/tmp/cjar_$ip"; - my $data = '{"data": [ "' . $bmc_user .'", "' . $bmc_pass . '" ] }'; + my $data = '{"data": [ "' . $openbmc_user .'", "' . $openbmc_pass . '" ] }'; my $output = `curl -c $cjar_file -k -X POST -H \"Content-Type: application/json\" -d '$data' https://$ip/login`; From 09361d8499409aa5656c7929db351d18cee0b5cc Mon Sep 17 00:00:00 2001 From: Yuan Bai Date: Fri, 12 May 2017 13:01:44 +0800 Subject: [PATCH 024/129] update udevadmin work around (#3038) --- xCAT-server/share/xcat/install/scripts/getinstdisk | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/xCAT-server/share/xcat/install/scripts/getinstdisk b/xCAT-server/share/xcat/install/scripts/getinstdisk index 743b991b1..311a7294d 100644 --- a/xCAT-server/share/xcat/install/scripts/getinstdisk +++ b/xCAT-server/share/xcat/install/scripts/getinstdisk @@ -145,13 +145,10 @@ if [ -z "$install_disk" ]; then # Work around the issue Pegas running on Power9 installation hang in anaconda # with "TypeError: argument of type 'NoneType' is not iterable", # after running of "udevadm info --attribute-walk --name=/dev/sda" in %pre section of kickstart - exec 42>&1 - anaconda_version=$(anaconda --version 2>&1 >&42) - exec 42>&- cpu_model=$(awk '/model/ { print $NF }' /proc/cpuinfo) p9_bool=$(grep POWER9 /proc/cpuinfo|head -n 1|awk '{print $3}') - if [ "$anaconda_version" == "anaconda 21.48.22.93-1" -a \ - "$cpu_model" == "0000000000000000" -a "$p9_bool" == "POWER9" ]; then + anaconda --version >/dev/null 2>&1 + if [ $? -eq 0 ] && [ "$cpu_model" = "0000000000000000" ] && [ "$p9_bool" = "POWER9" ]; then disk_driver="" else disk_driver=$(udevadm info --attribute-walk --name=$disk | grep DRIVERS| grep -v '""'| grep -v '"sd"'| From 4db46093ea25c4582e0298d29ba2fff82696e5da Mon Sep 17 00:00:00 2001 From: junxiawang Date: Fri, 12 May 2017 04:38:32 -0400 Subject: [PATCH 025/129] Add test case for openbmc rspconfig command #2912 --- .../autotest/testcase/rspconfig/rspconfig.sh | 351 +++++++++--------- 1 file changed, 183 insertions(+), 168 deletions(-) diff --git a/xCAT-test/autotest/testcase/rspconfig/rspconfig.sh b/xCAT-test/autotest/testcase/rspconfig/rspconfig.sh index fa53dfdbd..c56dbdca5 100755 --- a/xCAT-test/autotest/testcase/rspconfig/rspconfig.sh +++ b/xCAT-test/autotest/testcase/rspconfig/rspconfig.sh @@ -1,197 +1,212 @@ #!/bin/bash function test_ip() { - IP=$1 - VALID_CHECK=$(echo $IP|awk -F. '$1<=255&&$2<=255&&$3<=255&&$4<=255{print "yes"}') - if echo $IP|grep -E "^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$">/dev/null; then - if [ ${VALID_CHECK:-no} == "yes" ]; then - echo $1; + IP=$1 + VALID_CHECK=$(echo $IP|awk -F. '$1<=255&&$2<=255&&$3<=255&&$4<=255{print "yes"}') + if echo $IP|grep -E "^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$">/dev/null; then + if [ ${VALID_CHECK:-no} == "yes" ]; then + echo $1; + else + return 1; + fi else - exit 1; + return 1; fi - else - exit 1; - fi - return 0; + return 0; } function net() { - a=$(echo "$1" | awk -F "." '{print $1" "$2" "$3" "$4}') - for num in $a; - do - while (($num!=0));do - echo -n $(($num%2)) >> /tmp/$$.num; - num=$(($num/2)); - done - done - rc=$(grep -o "1" /tmp/$$.num | wc -l) - rm /tmp/$$.num - ip="$2/$rc" - A=($(echo "$ip"|sed 's/[./;]/ /g')) - B=$(echo $((2**(32-${A[4]})-1))) - C=($(echo "obase=256;ibase=10; $B"|bc|awk '{if(NF==4)a=$0;if(NF==3)a="0"$0;if(NF==2)a="0 0"$0;if(NF==1)a="0 0 0"$0;print a}')) - D=$(echo ${A[*]} ${C[*]}) - rc2=echo echo $D|awk 'BEGIN{OFS="."}{print $1,$2,$3,$4"-"$1+$6,$2+$7,$3+$8,$4+$9}' |awk -F '-' '{print $2}' + a=$(echo "$1" | awk -F "." '{print $1" "$2" "$3" "$4}') + for num in $a; + do + while (($num!=0));do + echo -n $(($num%2)) >> /tmp/$$.num; + num=$(($num/2)); + done + done + rc=$(grep -o "1" /tmp/$$.num | wc -l) + rm /tmp/$$.num + ip="$2/$rc" + A=($(echo "$ip"|sed 's/[./;]/ /g')) + B=$(echo $((2**(32-${A[4]})-1))) + C=($(echo "obase=256;ibase=10; $B"|bc|awk '{if(NF==4)a=$0;if(NF==3)a="0"$0;if(NF==2)a="0 0"$0;if(NF==1)a="0 0 0"$0;print a}')) + D=$(echo ${A[*]} ${C[*]}) + rc2=echo echo $D|awk 'BEGIN{OFS="."}{print $1,$2,$3,$4"-"$1+$6,$2+$7,$3+$8,$4+$9}' |awk -F '-' '{print $2}' } function change_ip() { - test_ip $1; - if [[ $? -eq 0 ]];then - echo $1 > /tmp/BMCIP - ip1=`echo $1|awk -F. '{print $1}'` - ip2=`echo $1|awk -F. '{print $2}'` - ip3=`echo $1|awk -F. '{print $3}'` - ip4=`echo $1|awk -F. '{print $4}'` - echo ip is $ip1.$ip2.$ip3.$ip4 - rc=$(net $3 $1) - rc4=`echo $rc |awk -F. '{print $4}'` - rc4=`expr "$rc4"` - if [[ $rc4 > 255 ]];then - rc4=255 - fi - ip=$ip4; while true; - do [[ $ip == "$rc4" ]] && exit 1; - ping $ip1.$ip2.$ip3.$ip -c 2 > /dev/null; - if [[ $? != 0 ]]; then - coutip="$ip1.$ip2.$ip3.$ip" - BMCNEWIP=$coutip; - echo $1,$2,$3 - rspconfig $2 ip=$BMCNEWIP - if [[ $? -eq 0 ]];then - echo right command; - else - exit 1; - fi - chdef $2 bmc=$BMCNEWIP - check_result $2 ip $BMCNEWIP - if [[ $? -ne 0 ]] ;then - exit 1; - else - echo need to return ; - break 3; - fi - fi - ip=`expr "$ip" "+" "1"` - done - return 0 - fi + test_ip $1; + if [[ $? -ne 0 ]];then return 1;fi + echo $1 > /tmp/BMCIP + ip1=`echo $1|awk -F. '{print $1}'` + ip2=`echo $1|awk -F. '{print $2}'` + ip3=`echo $1|awk -F. '{print $3}'` + ip4=`echo $1|awk -F. '{print $4}'` + echo ip is $ip1.$ip2.$ip3.$ip4 + rc=$(net $3 $1) + rc4=`echo $rc |awk -F. '{print $4}'` + rc4=`expr "$rc4"` + if [[ $rc4 > 255 ]];then rc4=255;fi + ip=$ip4 + while true; + do [[ $ip == "$rc4" ]] && return 1; + ping $ip1.$ip2.$ip3.$ip -c 2 >/dev/null ; + if [[ $? != 0 ]]; then + coutip="$ip1.$ip2.$ip3.$ip" + BMCNEWIP=$coutip; + echo $1,$2,$3 + rspconfig $2 ip=$BMCNEWIP + if [[ $? -eq 0 ]];then + echo right command; + else + return 1; + fi + chdef $2 bmc=$BMCNEWIP + check_result $2 ip $BMCNEWIP + if [[ $? -ne 0 ]] ;then + return 1; + else + return 0; + fi + fi + ip=`expr "$ip" "+" "1"` + done } function check_result() -{ - a=0; while true; - do [ $a -eq 20 ] && exit 1; - output=`rspconfig $1 $2 |awk -F: '{print $3}'`; - echo output is $output; - if [[ $(echo $output|tr '.' '+'|bc) -eq $(echo $3|tr '.' '+'|bc) ]];then - echo checkresult is $output; - break 3; - else - a=$[$a+1]; - sleep 1; - fi - done - return 0 +{ + a=0; while true; + do [ $a -eq 20 ] && return 1; + output=`rspconfig $1 $2 |awk -F: '{print $3}'`; + echo output is $output; + if [[ $(echo $output|tr '.' '+'|bc) -eq $(echo $3|tr '.' '+'|bc) ]];then + echo checkresult is $output; + return 0 ; + else + a=$[$a+1]; + sleep 1; + fi + done + return 1; } function clear_env() { - if [[ -f /tmp/BMCIP ]];then - echo need to clear env; - originip=$(cat /tmp/BMCIP); - echo originip is $originip; - rspconfig $2 ip=$originip - if [[ $? -eq 0 ]];then - echo right command; - else - exit 1; - fi - echo $2,$3 - rm -rf /tmp/BMCIP - chdef $2 bmc=$originip - check_result $2 $3 $originip - if [[ $? -ne 0 ]] ;then - exit 1; - else - echo "need to return" ; - break 1; - fi - return 0 - fi - return 1 + if [[ -f /tmp/BMCIP ]];then + originip=$(cat /tmp/BMCIP); + echo originip is $originip; + rspconfig $2 ip=$originip + if [[ $? -eq 0 ]];then + echo right command; + else + return 1; + fi + rm -rf /tmp/BMCIP + chdef $2 bmc=$originip + check_result $2 $3 $originip + if [[ $? -ne 0 ]] ;then + return 1; + else + return 0; + fi + fi + return 1; } function change_gateway { - test_ip $1; - rspconfig $2 gateway=$1; - if [[ $? -eq 0 ]];then - echo set gateway ok; - else - exit 1; - fi - check_result $2 $3 $1 - return 0 + test_ip $1; + if [[ $? -ne 0 ]];then return 1;fi + rspconfig $2 gateway=$1; + if [[ $? -eq 0 ]];then + echo set gateway ok; + else + return 1; + fi + check_result $2 $3 $1 + if [[ $? -ne 0 ]] ;then + return 1; + else + return 0; + fi + } function change_netmask { - test_ip $1; - rspconfig $2 netmask=$1; - if [[ $? -eq 0 ]];then - echo set netmask ok; - else - exit 1; - fi - echo $2 ,$3 - check_result $2 $3 $1 - return 0 + test_ip $1; + if [[ $? -ne 0 ]];then return 1;fi + rspconfig $2 netmask=$1; + if [[ $? -eq 0 ]];then + echo set netmask ok; + else + return 1; + fi + check_result $2 $3 $1 + if [[ $? -ne 0 ]] ;then + return 1; + else + return 0; + fi } BMCIP="" BMCGTEWAT="" BMCNETMASK="" while [ "$#" -gt "0" ] do -case $1 in - "-i"|"--ip" ) - rspconfig $2 ip - if [[ $? -eq 0 ]];then - echo get ip ok; - BMCIP=`rspconfig $2 ip |awk -F":" '{print $3}'` - BMCNETMASK=`rspconfig $2 netmask |awk -F":" '{print $3}'` - else - exit 1; - fi - change_ip $BMCIP $2 $BMCNETMASK -;; - "-g"|"--gateway" ) - rspconfig $2 gateway - if [[ $? -eq 0 ]];then - echo get gateway ok; - BMCGATEWAYE=`rspconfig $2 gateway |awk -F":" '{print $3}'` - else - exit 1; - fi - - change_gateway $BMCGATEWAYE $2 $3 -;; - "-n"|"--netmask" ) - rspconfig $2 netmask - if [[ $? -eq 0 ]];then - echo get netmask ok; - BMCNETMASK=`rspconfig $2 netmask |awk -F":" '{print $3}'` - else - exit 1; - fi - change_netmask $BMCNETMASK $2 $3 -;; - "-c"|"--clear" ) - clear_env $1 $2 $3 - if [[ $? -ne 0 ]] ;then - exit 1 - fi -;; - *) - echo - echo "Please Insert $0: -i|-g|-n|-c" - echo - exit 1; -;; -esac + case $1 in + "-i"|"--ip" ) + rspconfig $2 ip + if [[ $? -eq 0 ]];then + BMCIP=`rspconfig $2 ip |awk -F":" '{print $3}'` + BMCNETMASK=`rspconfig $2 netmask |awk -F":" '{print $3}'` + else + exit 1; + fi + change_ip $BMCIP $2 $BMCNETMASK + if [[ $? -eq 1 ]];then + exit 1 + else + exit 0 + fi + ;; + "-g"|"--gateway" ) + rspconfig $2 gateway + if [[ $? -eq 0 ]];then + BMCGATEWAYE=`rspconfig $2 gateway |awk -F":" '{print $3}'` + else + exit 1; + fi + change_gateway $BMCGATEWAYE $2 $3 + if [[ $? -eq 1 ]];then + exit 1 + else + exit 0 + fi + ;; + "-n"|"--netmask" ) + rspconfig $2 netmask + if [[ $? -eq 0 ]];then + BMCNETMASK=`rspconfig $2 netmask |awk -F":" '{print $3}'` + else + exit 1; + fi + change_netmask $BMCNETMASK $2 $3 + if [[ $? -eq 1 ]];then + exit 1 + else + exit 0 + fi + ;; + "-c"|"--clear" ) + clear_env $1 $2 $3 + if [[ $? -eq 1 ]];then + exit 1 + else + exit 0 + fi + ;; + *) + echo + echo "Please Insert $0: -i|-g|-n|-c" + echo + exit 1; + ;; + esac done From 91cc1fbb4ef09a0134040db9a75ee65768454bda Mon Sep 17 00:00:00 2001 From: junxiawang Date: Fri, 12 May 2017 06:06:56 -0400 Subject: [PATCH 026/129] Add test case for openbmc rspconfig command #2912 --- .../autotest/testcase/rspconfig/rspconfig.sh | 237 +++++++++--------- 1 file changed, 118 insertions(+), 119 deletions(-) diff --git a/xCAT-test/autotest/testcase/rspconfig/rspconfig.sh b/xCAT-test/autotest/testcase/rspconfig/rspconfig.sh index c56dbdca5..35cebceed 100755 --- a/xCAT-test/autotest/testcase/rspconfig/rspconfig.sh +++ b/xCAT-test/autotest/testcase/rspconfig/rspconfig.sh @@ -2,83 +2,82 @@ function test_ip() { IP=$1 - VALID_CHECK=$(echo $IP|awk -F. '$1<=255&&$2<=255&&$3<=255&&$4<=255{print "yes"}') + VALID_CHECK=$(echo $IP|awk -F. '$1<=255&&$2<=255&&$3<=255&&$4<=255{print "yes"}') if echo $IP|grep -E "^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$">/dev/null; then if [ ${VALID_CHECK:-no} == "yes" ]; then echo $1; - else - return 1; - fi - else - return 1; - fi + else + return 1; + fi + else + return 1; + fi return 0; - } function net() { a=$(echo "$1" | awk -F "." '{print $1" "$2" "$3" "$4}') for num in $a; - do - while (($num!=0));do - echo -n $(($num%2)) >> /tmp/$$.num; - num=$(($num/2)); - done - done - rc=$(grep -o "1" /tmp/$$.num | wc -l) - rm /tmp/$$.num + do + while (($num!=0));do + echo -n $(($num%2)) >> /tmp/$$.num; + num=$(($num/2)); + done + done + rc=$(grep -o "1" /tmp/$$.num | wc -l) + rm /tmp/$$.num ip="$2/$rc" - A=($(echo "$ip"|sed 's/[./;]/ /g')) - B=$(echo $((2**(32-${A[4]})-1))) - C=($(echo "obase=256;ibase=10; $B"|bc|awk '{if(NF==4)a=$0;if(NF==3)a="0"$0;if(NF==2)a="0 0"$0;if(NF==1)a="0 0 0"$0;print a}')) - D=$(echo ${A[*]} ${C[*]}) - rc2=echo echo $D|awk 'BEGIN{OFS="."}{print $1,$2,$3,$4"-"$1+$6,$2+$7,$3+$8,$4+$9}' |awk -F '-' '{print $2}' + A=($(echo "$ip"|sed 's/[./;]/ /g')) + B=$(echo $((2**(32-${A[4]})-1))) + C=($(echo "obase=256;ibase=10; $B"|bc|awk '{if(NF==4)a=$0;if(NF==3)a="0"$0;if(NF==2)a="0 0"$0;if(NF==1)a="0 0 0"$0;print a}')) + D=$(echo ${A[*]} ${C[*]}) + rc2=echo echo $D|awk 'BEGIN{OFS="."}{print $1,$2,$3,$4"-"$1+$6,$2+$7,$3+$8,$4+$9}' |awk -F '-' '{print $2}' } function change_ip() { test_ip $1; if [[ $? -ne 0 ]];then return 1;fi - echo $1 > /tmp/BMCIP - ip1=`echo $1|awk -F. '{print $1}'` - ip2=`echo $1|awk -F. '{print $2}'` - ip3=`echo $1|awk -F. '{print $3}'` - ip4=`echo $1|awk -F. '{print $4}'` - echo ip is $ip1.$ip2.$ip3.$ip4 - rc=$(net $3 $1) - rc4=`echo $rc |awk -F. '{print $4}'` - rc4=`expr "$rc4"` - if [[ $rc4 > 255 ]];then rc4=255;fi - ip=$ip4 - while true; - do [[ $ip == "$rc4" ]] && return 1; - ping $ip1.$ip2.$ip3.$ip -c 2 >/dev/null ; - if [[ $? != 0 ]]; then - coutip="$ip1.$ip2.$ip3.$ip" - BMCNEWIP=$coutip; - echo $1,$2,$3 - rspconfig $2 ip=$BMCNEWIP - if [[ $? -eq 0 ]];then - echo right command; - else - return 1; - fi - chdef $2 bmc=$BMCNEWIP - check_result $2 ip $BMCNEWIP - if [[ $? -ne 0 ]] ;then - return 1; - else - return 0; - fi - fi - ip=`expr "$ip" "+" "1"` - done + echo $1 > /tmp/BMCIP + ip1=`echo $1|awk -F. '{print $1}'` + ip2=`echo $1|awk -F. '{print $2}'` + ip3=`echo $1|awk -F. '{print $3}'` + ip4=`echo $1|awk -F. '{print $4}'` + echo ip is $ip1.$ip2.$ip3.$ip4 + rc=$(net $3 $1) + rc4=`echo $rc |awk -F. '{print $4}'` + rc4=`expr "$rc4"` + if [[ $rc4 > 255 ]];then rc4=255;fi + ip=$ip4 + while true; + do [[ $ip == "$rc4" ]] && return 1; + ping $ip1.$ip2.$ip3.$ip -c 2 >/dev/null ; + if [[ $? != 0 ]]; then + coutip="$ip1.$ip2.$ip3.$ip" + BMCNEWIP=$coutip; + echo $1,$2,$3 + rspconfig $2 ip=$BMCNEWIP + if [[ $? -eq 0 ]];then + echo right command; + else + return 1; + fi + chdef $2 bmc=$BMCNEWIP + check_result $2 ip $BMCNEWIP + if [[ $? -ne 0 ]] ;then + return 1; + else + return 0; + fi + fi + ip=`expr "$ip" "+" "1"` + done } function check_result() { - a=0; while true; - do [ $a -eq 20 ] && return 1; - output=`rspconfig $1 $2 |awk -F: '{print $3}'`; - echo output is $output; + a=0; while true; + do [ $a -eq 20 ] && return 1; + output=`rspconfig $1 $2 |awk -F: '{print $3}'`; + echo output is $output; if [[ $(echo $output|tr '.' '+'|bc) -eq $(echo $3|tr '.' '+'|bc) ]];then echo checkresult is $output; return 0 ; @@ -111,38 +110,39 @@ function clear_env() fi return 1; } -function change_gateway { +function change_gateway +{ test_ip $1; if [[ $? -ne 0 ]];then return 1;fi - rspconfig $2 gateway=$1; + rspconfig $2 gateway=$1; if [[ $? -eq 0 ]];then - echo set gateway ok; - else - return 1; - fi - check_result $2 $3 $1 - if [[ $? -ne 0 ]] ;then - return 1; - else - return 0; - fi - + echo set gateway ok; + else + return 1; + fi + check_result $2 $3 $1 + if [[ $? -ne 0 ]] ;then + return 1; + else + return 0; + fi } -function change_netmask { +function change_netmask +{ test_ip $1; if [[ $? -ne 0 ]];then return 1;fi rspconfig $2 netmask=$1; - if [[ $? -eq 0 ]];then - echo set netmask ok; - else - return 1; - fi + if [[ $? -eq 0 ]];then + echo set netmask ok; + else + return 1; + fi check_result $2 $3 $1 - if [[ $? -ne 0 ]] ;then - return 1; - else - return 0; - fi + if [[ $? -ne 0 ]] ;then + return 1; + else + return 0; + fi } BMCIP="" BMCGTEWAT="" @@ -150,13 +150,13 @@ BMCNETMASK="" while [ "$#" -gt "0" ] do case $1 in - "-i"|"--ip" ) - rspconfig $2 ip + "-i"|"--ip" ) + rspconfig $2 ip if [[ $? -eq 0 ]];then - BMCIP=`rspconfig $2 ip |awk -F":" '{print $3}'` - BMCNETMASK=`rspconfig $2 netmask |awk -F":" '{print $3}'` - else - exit 1; + BMCIP=`rspconfig $2 ip |awk -F":" '{print $3}'` + BMCNETMASK=`rspconfig $2 netmask |awk -F":" '{print $3}'` + else + exit 1; fi change_ip $BMCIP $2 $BMCNETMASK if [[ $? -eq 1 ]];then @@ -167,46 +167,45 @@ do ;; "-g"|"--gateway" ) rspconfig $2 gateway - if [[ $? -eq 0 ]];then + if [[ $? -eq 0 ]];then BMCGATEWAYE=`rspconfig $2 gateway |awk -F":" '{print $3}'` else exit 1; fi - change_gateway $BMCGATEWAYE $2 $3 - if [[ $? -eq 1 ]];then - exit 1 - else - exit 0 - fi + change_gateway $BMCGATEWAYE $2 $3 + if [[ $? -eq 1 ]];then + exit 1 + else + exit 0 + fi ;; - "-n"|"--netmask" ) - rspconfig $2 netmask + "-n"|"--netmask" ) + rspconfig $2 netmask if [[ $? -eq 0 ]];then BMCNETMASK=`rspconfig $2 netmask |awk -F":" '{print $3}'` else - exit 1; - fi - change_netmask $BMCNETMASK $2 $3 - if [[ $? -eq 1 ]];then - exit 1 - else - exit 0 - fi + exit 1; + fi + change_netmask $BMCNETMASK $2 $3 + if [[ $? -eq 1 ]];then + exit 1 + else + exit 0 + fi ;; - "-c"|"--clear" ) - clear_env $1 $2 $3 - if [[ $? -eq 1 ]];then - exit 1 - else - exit 0 - fi + "-c"|"--clear" ) + clear_env $1 $2 $3 + if [[ $? -eq 1 ]];then + exit 1 + else + exit 0 + fi ;; - *) - echo - echo "Please Insert $0: -i|-g|-n|-c" - echo - exit 1; + *) + echo + echo "Please Insert $0: -i|-g|-n|-c" + echo + exit 1; ;; esac done - From e270ce1bd49059d44b531ede1a18b7463554028e Mon Sep 17 00:00:00 2001 From: hu-weihua Date: Fri, 12 May 2017 02:47:06 -0400 Subject: [PATCH 027/129] Change bundle name of pegas+p9 from rhels7.104-ppc64el.bundle to rhels7.4-pegas_ppc64le.bundle --- .../{rhels7.104-ppc64el.bundle => rhels7.4-pegas_ppc64le.bundle} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename xCAT-test/autotest/bundle/{rhels7.104-ppc64el.bundle => rhels7.4-pegas_ppc64le.bundle} (100%) diff --git a/xCAT-test/autotest/bundle/rhels7.104-ppc64el.bundle b/xCAT-test/autotest/bundle/rhels7.4-pegas_ppc64le.bundle similarity index 100% rename from xCAT-test/autotest/bundle/rhels7.104-ppc64el.bundle rename to xCAT-test/autotest/bundle/rhels7.4-pegas_ppc64le.bundle From e157f1439fd68608318d2d2fbc77c89b3d519c94 Mon Sep 17 00:00:00 2001 From: junxiawang Date: Fri, 12 May 2017 15:12:52 +0800 Subject: [PATCH 028/129] Add test case for 1276: nicips.enP5p7s0f1 can not removed from node definition.for issue:1276 (#3041) --- xCAT-test/autotest/testcase/confignics/cases0 | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/xCAT-test/autotest/testcase/confignics/cases0 b/xCAT-test/autotest/testcase/confignics/cases0 index f348f77fb..b2b5b0af1 100644 --- a/xCAT-test/autotest/testcase/confignics/cases0 +++ b/xCAT-test/autotest/testcase/confignics/cases0 @@ -264,3 +264,20 @@ check:rc==0 cmd:if [ -e /opt/xcat/share/xcat/tools/autotest/testcase/confignics/networks.csv ]; then tabrestore /opt/xcat/share/xcat/tools/autotest/testcase/confignics/networks.csv; rm -f /opt/xcat/share/xcat/tools/autotest/testcase/confignics/networks.csv*; fi check:rc==0 end +start:chdef_nicips +description:nicip could be set to null +Attribute: $$CN-The operation object of chdef command +cmd:lsdef $$CN;if [ $? -eq 0 ]; then lsdef -l $$CN -z >/tmp/CN.standa ;fi +check:rc==0 +cmd:chdef $$CN nicips.$$SECONDNIC=100.1.0.100 +check:rc==0 +cmd:lsdef $$CN -i nicips +check:output=~nicips.$$SECONDNIC=100.1.0.100 +cmd:chdef $$CN nicips.$$SECONDNIC="" +check:rc==0 +cmd:lsdef $$CN -i nicips +check:output!~100.1.0.100 +cmd:if [ -e /tmp/CN.standa ]; then rmdef $$CN; cat /tmp/CN.standa | mkdef -z; rm -rf /tmp/CN.standa; fi +check:rc==0 +end + From 9a8d2ebec9f9ff0e7b6b05a01cf274829dced481 Mon Sep 17 00:00:00 2001 From: Yuan Bai Date: Fri, 12 May 2017 16:17:34 +0800 Subject: [PATCH 029/129] fix nictypes capital letter failure (#3043) --- xCAT/postscripts/confignetwork | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/xCAT/postscripts/confignetwork b/xCAT/postscripts/confignetwork index 2398340b2..702fd5b2d 100755 --- a/xCAT/postscripts/confignetwork +++ b/xCAT/postscripts/confignetwork @@ -326,6 +326,9 @@ function sort_nics_device_order { ################################################################################### function configure_nicdevice { nics_pair=$* + #nictypes support capital letters, for example, Ethernet and ethernet + #use $utolcmd to transform capital to lower case + utolcmd="sed -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/" #configure nic and its device pair one by one num=1 max=`echo "$nics_pair"|wc -l` @@ -344,10 +347,10 @@ function configure_nicdevice { base_temp_nic=$base_nic_dev fi - base_nic_type=`find_nic_type "$base_temp_nic"` + base_nic_type=`find_nic_type "$base_temp_nic" | $utolcmd` fi nic_dev=`echo "$nics_pair" |sed -n "${num}p"|awk '{print $1}'` - nic_dev_type=`find_nic_type "$nic_dev"` + nic_dev_type=`find_nic_type "$nic_dev" | $utolcmd` echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" nic_pair=`echo "$nics_pair" |sed -n "${num}p"` echo "configure nic and its device : $nic_pair" From 6fb4f5aa4ad67cad9febf241428b5a6b60e9ad7b Mon Sep 17 00:00:00 2001 From: GONG Jie Date: Fri, 12 May 2017 16:28:15 +0800 Subject: [PATCH 030/129] Add test cases for check exit code when abnormal commands were performed (#2755) * Add test case for xdsh when permission denied * Add test case for nodestat for malformed command * Add test case descriptions for nodestat_usage and xdsh_permission_denied --- xCAT-test/autotest/testcase/nodestat/cases1 | 5 +++++ xCAT-test/autotest/testcase/xdsh/cases1 | 11 +++++++++++ 2 files changed, 16 insertions(+) create mode 100644 xCAT-test/autotest/testcase/nodestat/cases1 create mode 100644 xCAT-test/autotest/testcase/xdsh/cases1 diff --git a/xCAT-test/autotest/testcase/nodestat/cases1 b/xCAT-test/autotest/testcase/nodestat/cases1 new file mode 100644 index 000000000..f9c7ce03a --- /dev/null +++ b/xCAT-test/autotest/testcase/nodestat/cases1 @@ -0,0 +1,5 @@ +start:nodestat_usage +description: Test the exit code when no command line argument is passed to nodestat +cmd:nodestat +check:rc!=0 +end diff --git a/xCAT-test/autotest/testcase/xdsh/cases1 b/xCAT-test/autotest/testcase/xdsh/cases1 new file mode 100644 index 000000000..37286b5d3 --- /dev/null +++ b/xCAT-test/autotest/testcase/xdsh/cases1 @@ -0,0 +1,11 @@ +start:xdsh_permission_denied +description: Test the exit code when command xdsh failed +cmd:xdsh $$CN date +check:rc==0 +cmd:mv /root/.ssh/id_rsa /root/.ssh/id_rsa.backup +check:rc==0 +cmd:xdsh $$CN date +check:rc!=0 +cmd:mv /root/.ssh/id_rsa.backup /root/.ssh/id_rsa +check:rc==0 +end From e07b607b44051957cfc503c5a4adac179c60ef48 Mon Sep 17 00:00:00 2001 From: ertaozh Date: Fri, 12 May 2017 06:33:37 -0400 Subject: [PATCH 031/129] Fix issue 2577: chdef -m should return correct warning message when some attributes is not permit to be changed. --- .../references/man5/postscripts.5.rst | 4 +- .../admin-guides/references/man7/node.7.rst | 4 +- perl-xCAT/xCAT/DBobjUtils.pm | 24 +++++++- perl-xCAT/xCAT/Schema.pm | 4 +- xCAT-server/lib/xcat/plugins/DBobjectdefs.pm | 57 ++++++++++++------- 5 files changed, 65 insertions(+), 28 deletions(-) diff --git a/docs/source/guides/admin-guides/references/man5/postscripts.5.rst b/docs/source/guides/admin-guides/references/man5/postscripts.5.rst index a87cd902c..7e0615d2d 100644 --- a/docs/source/guides/admin-guides/references/man5/postscripts.5.rst +++ b/docs/source/guides/admin-guides/references/man5/postscripts.5.rst @@ -44,13 +44,13 @@ postscripts Attributes: \ **postscripts**\ - Comma separated list of scripts that should be run on this node after diskful installation or diskless boot. Each script can take zero or more parameters. For example: "script1 p1 p2,script2,...". xCAT automatically adds the postscripts from the xcatdefaults.postscripts attribute of the table to run first on the nodes after install or diskless boot. For installation of RedHat, CentOS, Fedora, the scripts will be run before the reboot. For installation of SLES, the scripts will be run after the reboot but before the init.d process. For diskless deployment, the scripts will be run at the init.d time, and xCAT will automatically add the list of scripts from the postbootscripts attribute to run after postscripts list. For installation of AIX, the scripts will run after the reboot and acts the same as the postbootscripts attribute. For AIX, use the postbootscripts attribute. + Comma separated list of scripts that should be run on this node after diskful installation or diskless boot. Each script can take zero or more parameters. For example: "script1 p1 p2,script2,...". xCAT automatically adds the postscripts from the xcatdefaults.postscripts attribute of the table to run first on the nodes after install or diskless boot. For installation of RedHat, CentOS, Fedora, the scripts will be run before the reboot. For installation of SLES, the scripts will be run after the reboot but before the init.d process. For diskless deployment, the scripts will be run at the init.d time, and xCAT will automatically add the list of scripts from the postbootscripts attribute to run after postscripts list. For installation of AIX, the scripts will run after the reboot and acts the same as the postbootscripts attribute. For AIX, use the postbootscripts attribute. Please note that the postscripts specified for "xcatdefaults" will be assigned to node automatically, it can not be removed from "postscripts" attribute of a node with "chdef -m" command \ **postbootscripts**\ - Comma separated list of scripts that should be run on this node after diskful installation or diskless boot. Each script can take zero or more parameters. For example: "script1 p1 p2,script2,...". On AIX these scripts are run during the processing of /etc/inittab. On Linux they are run at the init.d time. xCAT automatically adds the scripts in the xcatdefaults.postbootscripts attribute to run first in the list. + Comma separated list of scripts that should be run on this node after diskful installation or diskless boot. Each script can take zero or more parameters. For example: "script1 p1 p2,script2,...". On AIX these scripts are run during the processing of /etc/inittab. On Linux they are run at the init.d time. xCAT automatically adds the scripts in the xcatdefaults.postbootscripts attribute to run first in the list. Please note that the postbootscripts specified for "xcatdefaults" will be assigned to node automatically, it can not be removed from "postbootscripts" attribute of a node with "chdef -m" command diff --git a/docs/source/guides/admin-guides/references/man7/node.7.rst b/docs/source/guides/admin-guides/references/man7/node.7.rst index 77646859a..cb1f1b529 100644 --- a/docs/source/guides/admin-guides/references/man7/node.7.rst +++ b/docs/source/guides/admin-guides/references/man7/node.7.rst @@ -807,13 +807,13 @@ node Attributes: \ **postbootscripts**\ (postscripts.postbootscripts) - Comma separated list of scripts that should be run on this node after diskful installation or diskless boot. Each script can take zero or more parameters. For example: "script1 p1 p2,script2,...". On AIX these scripts are run during the processing of /etc/inittab. On Linux they are run at the init.d time. xCAT automatically adds the scripts in the xcatdefaults.postbootscripts attribute to run first in the list. + Comma separated list of scripts that should be run on this node after diskful installation or diskless boot. Each script can take zero or more parameters. For example: "script1 p1 p2,script2,...". On AIX these scripts are run during the processing of /etc/inittab. On Linux they are run at the init.d time. xCAT automatically adds the scripts in the xcatdefaults.postbootscripts attribute to run first in the list. Please note that the postbootscripts specified for "xcatdefaults" will be assigned to node automatically, it can not be removed from "postbootscripts" attribute of a node with "chdef -m" command \ **postscripts**\ (postscripts.postscripts) - Comma separated list of scripts that should be run on this node after diskful installation or diskless boot. Each script can take zero or more parameters. For example: "script1 p1 p2,script2,...". xCAT automatically adds the postscripts from the xcatdefaults.postscripts attribute of the table to run first on the nodes after install or diskless boot. For installation of RedHat, CentOS, Fedora, the scripts will be run before the reboot. For installation of SLES, the scripts will be run after the reboot but before the init.d process. For diskless deployment, the scripts will be run at the init.d time, and xCAT will automatically add the list of scripts from the postbootscripts attribute to run after postscripts list. For installation of AIX, the scripts will run after the reboot and acts the same as the postbootscripts attribute. For AIX, use the postbootscripts attribute. + Comma separated list of scripts that should be run on this node after diskful installation or diskless boot. Each script can take zero or more parameters. For example: "script1 p1 p2,script2,...". xCAT automatically adds the postscripts from the xcatdefaults.postscripts attribute of the table to run first on the nodes after install or diskless boot. For installation of RedHat, CentOS, Fedora, the scripts will be run before the reboot. For installation of SLES, the scripts will be run after the reboot but before the init.d process. For diskless deployment, the scripts will be run at the init.d time, and xCAT will automatically add the list of scripts from the postbootscripts attribute to run after postscripts list. For installation of AIX, the scripts will run after the reboot and acts the same as the postbootscripts attribute. For AIX, use the postbootscripts attribute. Please note that the postscripts specified for "xcatdefaults" will be assigned to node automatically, it can not be removed from "postscripts" attribute of a node with "chdef -m" command diff --git a/perl-xCAT/xCAT/DBobjUtils.pm b/perl-xCAT/xCAT/DBobjUtils.pm index 0bc7e2286..3d463a475 100755 --- a/perl-xCAT/xCAT/DBobjUtils.pm +++ b/perl-xCAT/xCAT/DBobjUtils.pm @@ -675,6 +675,7 @@ sub setobjdefs # update the tables a row at a time foreach my $objname (keys %objhash) { + my $obj_need_update = 0; # get attr=val that are set in the DB ?? my $type = $objhash{$objname}{objtype}; @@ -1023,6 +1024,7 @@ sub setobjdefs $rsp->{data}->[0] = "access_tabentry \'$this_attr->{access_tabentry}\' is not valid."; xCAT::MsgUtils->message("E", $rsp, $::callback); + $objhash{$objname}{error} = 1; next; } $lookup_table = $tabentry{'lookup_table'}; @@ -1075,19 +1077,26 @@ sub setobjdefs split(/$delim/, $DBattrvals{$objname}{$attr_name}); my @minusList = split(/$delim/, $objhash{$objname}{$attr_name}); + my $operation_failed = 0; foreach my $em (@minusList) { if (!(grep { $_ eq $em } @currentList)) { if (($::opt_t eq 'group') && ($DBattrvals{$objname}{'grouptype'} ne 'dynamic')) { my $rsp; $rsp->{data}->[0] = "$objname is not a member of \'$em\'."; - xCAT::MsgUtils->message("W", $rsp, $::callback); + xCAT::MsgUtils->message("E", $rsp, $::callback); + $operation_failed = 1; } else { my $rsp; $rsp->{data}->[0] = "$em is not in the attribute of \'$attr_name\' for the \'$objname\' definition."; - xCAT::MsgUtils->message("W", $rsp, $::callback); + xCAT::MsgUtils->message("E", $rsp, $::callback); + $operation_failed = 1; } } } + if ($operation_failed) { + $objhash{$objname}{error} = 1; + next; + } # make a new list without the one specified my $first = 1; @@ -1106,6 +1115,12 @@ sub setobjdefs } $val = $newlist; } + else { + my $rsp; + $rsp->{data}->[0] = "No value got for attribute \'$attr_name\' for the \'$objname\' definition."; + xCAT::MsgUtils->message("E", $rsp, $::callback); + next; + } } else { @@ -1118,10 +1133,13 @@ sub setobjdefs # the key is 'tabattrs' $allupdates{$lookup_table}{$objname}{$attr_name}{'tabattrs'}{$::tabattr} = $val; $setattrs = 1; - + $obj_need_update = 1; push(@setattrlist, $attr_name); } # end - foreach attribute + if ($obj_need_update) { + $objhash{$objname}{updated} = 1; + } my $rsp; foreach my $att (keys %$invalidattr) { diff --git a/perl-xCAT/xCAT/Schema.pm b/perl-xCAT/xCAT/Schema.pm index bf4816595..3821acee6 100755 --- a/perl-xCAT/xCAT/Schema.pm +++ b/perl-xCAT/xCAT/Schema.pm @@ -893,8 +893,8 @@ passed as argument rather than by table value', table_desc => 'The scripts that should be run on each node after installation or diskless boot.', descriptions => { node => 'The node name or group name.', - postscripts => 'Comma separated list of scripts that should be run on this node after diskful installation or diskless boot. Each script can take zero or more parameters. For example: "script1 p1 p2,script2,...". xCAT automatically adds the postscripts from the xcatdefaults.postscripts attribute of the table to run first on the nodes after install or diskless boot. For installation of RedHat, CentOS, Fedora, the scripts will be run before the reboot. For installation of SLES, the scripts will be run after the reboot but before the init.d process. For diskless deployment, the scripts will be run at the init.d time, and xCAT will automatically add the list of scripts from the postbootscripts attribute to run after postscripts list. For installation of AIX, the scripts will run after the reboot and acts the same as the postbootscripts attribute. For AIX, use the postbootscripts attribute.', - postbootscripts => 'Comma separated list of scripts that should be run on this node after diskful installation or diskless boot. Each script can take zero or more parameters. For example: "script1 p1 p2,script2,...". On AIX these scripts are run during the processing of /etc/inittab. On Linux they are run at the init.d time. xCAT automatically adds the scripts in the xcatdefaults.postbootscripts attribute to run first in the list.', + postscripts => 'Comma separated list of scripts that should be run on this node after diskful installation or diskless boot. Each script can take zero or more parameters. For example: "script1 p1 p2,script2,...". xCAT automatically adds the postscripts from the xcatdefaults.postscripts attribute of the table to run first on the nodes after install or diskless boot. For installation of RedHat, CentOS, Fedora, the scripts will be run before the reboot. For installation of SLES, the scripts will be run after the reboot but before the init.d process. For diskless deployment, the scripts will be run at the init.d time, and xCAT will automatically add the list of scripts from the postbootscripts attribute to run after postscripts list. For installation of AIX, the scripts will run after the reboot and acts the same as the postbootscripts attribute. For AIX, use the postbootscripts attribute. Please note that the postscripts specified for "xcatdefaults" will be assigned to node automatically, it can not be removed from "postscripts" attribute of a node with "chdef -m" command', + postbootscripts => 'Comma separated list of scripts that should be run on this node after diskful installation or diskless boot. Each script can take zero or more parameters. For example: "script1 p1 p2,script2,...". On AIX these scripts are run during the processing of /etc/inittab. On Linux they are run at the init.d time. xCAT automatically adds the scripts in the xcatdefaults.postbootscripts attribute to run first in the list. Please note that the postbootscripts specified for "xcatdefaults" will be assigned to node automatically, it can not be removed from "postbootscripts" attribute of a node with "chdef -m" command', comments => 'Any user-written notes.', disable => "Set to 'yes' or '1' to comment out this row.", }, diff --git a/xCAT-server/lib/xcat/plugins/DBobjectdefs.pm b/xCAT-server/lib/xcat/plugins/DBobjectdefs.pm index 973f1d4c0..3a2d4d7bd 100755 --- a/xCAT-server/lib/xcat/plugins/DBobjectdefs.pm +++ b/xCAT-server/lib/xcat/plugins/DBobjectdefs.pm @@ -1999,6 +1999,18 @@ sub defmk } else { + my $nodenum = 0; + my $ret = 0; + my @nodes_updated = (); + foreach my $node (keys %::FINALATTRS) { + if ($::FINALATTRS{$node}{updated}) { + $nodenum++; + push @nodes_updated, $node; + } + if ($::FINALATTRS{$node}{error}) { + $ret = 1; + } + } if ($::verbose) { @@ -2007,7 +2019,7 @@ sub defmk xCAT::MsgUtils->message("I", $rsp, $::callback); my $n = 1; - foreach my $o (sort(keys %::FINALATTRS)) + foreach my $o (sort( @nodes_updated)) { $rsp->{data}->[$n] = "$o"; $n++; @@ -2023,21 +2035,17 @@ sub defmk xCAT::MsgUtils->message("E", $rsp, $::callback); } } - else - { - my $rsp; - my $nodenum = scalar(keys %::FINALATTRS); - $rsp->{data}->[0] = "$nodenum object definitions have been created or modified."; - if ($nodenum > 0) { - # Some objects were created, report as success - xCAT::MsgUtils->message("I", $rsp, $::callback); - } - else { - # No objects were created, report as error - xCAT::MsgUtils->message("E", $rsp, $::callback); - } + my $rsp; + $rsp->{data}->[0] = "$nodenum object definitions have been created or modified."; + if ($nodenum > 0) { + # Some objects were created, report as success + xCAT::MsgUtils->message("I", $rsp, $::callback); } - return 0; + else { + # No objects were created, report as error + xCAT::MsgUtils->message("E", $rsp, $::callback); + } + return $ret; } } @@ -2786,18 +2794,29 @@ sub defch } else { + my $nodenum = 0; + my $ret = 0; + my @nodes_updated = (); + foreach my $node (keys %::FINALATTRS) { + if ($::FINALATTRS{$node}{updated}) { + $nodenum++; + push @nodes_updated, $node; + } + if ($::FINALATTRS{$node}{error}) { + $ret = 1; + } + } if ($::verbose) { # give results my $rsp; - my $nodenum = scalar(keys %::FINALATTRS); if ($nodenum) { $rsp->{data}->[0] = "The database was updated for the following objects:"; xCAT::MsgUtils->message("I", $rsp, $::callback); my $n = 1; - foreach my $o (sort(keys %::FINALATTRS)) + foreach my $o (sort(@nodes_updated)) { $rsp->{data}->[$n] = "$o\n"; $n++; @@ -2810,7 +2829,7 @@ sub defch else { my $rsp; - my $nodenum = scalar(keys %::FINALATTRS); + if ($nodenum) { $rsp->{data}->[0] = "$nodenum object definitions have been created or modified."; } else { @@ -2842,7 +2861,7 @@ sub defch } } } - return 0; + return $ret; } } From d4383de06daef49f719fc9c7336a0daa309fcf42 Mon Sep 17 00:00:00 2001 From: Casandra Qiu Date: Fri, 12 May 2017 09:54:14 -0400 Subject: [PATCH 032/129] modified from reviews --- xCAT-server/lib/perl/xCAT/MellanoxIB.pm | 1 - xCAT-server/share/xcat/scripts/configMellanox | 30 +++++++++---------- 2 files changed, 14 insertions(+), 17 deletions(-) diff --git a/xCAT-server/lib/perl/xCAT/MellanoxIB.pm b/xCAT-server/lib/perl/xCAT/MellanoxIB.pm index c26f18c9f..3d9b395a6 100644 --- a/xCAT-server/lib/perl/xCAT/MellanoxIB.pm +++ b/xCAT-server/lib/perl/xCAT/MellanoxIB.pm @@ -669,7 +669,6 @@ sub setSSHcfg { [ "-re", $init_prompt, sub { - #print "$node: sending command: $init_cmd\n"; $mysw->clear_accum(); $mysw->send($init_cmd); $mysw->exp_continue(); diff --git a/xCAT-server/share/xcat/scripts/configMellanox b/xCAT-server/share/xcat/scripts/configMellanox index 397ac58e8..8538eb5b9 100755 --- a/xCAT-server/share/xcat/scripts/configMellanox +++ b/xCAT-server/share/xcat/scripts/configMellanox @@ -210,7 +210,7 @@ sub config_ip { push (@discover_switches, $dswitch); push (@config_switches, $switch); - print "changed $switch ip address to static ip $static_ip\n"; + print "$switch: Changing IP address to static IP $static_ip\n"; } if (@config_switches) { @@ -253,7 +253,7 @@ sub config_hostname { next; } push (@config_switches, $switch); - print "switch host name changed to $switch\n"; + print "$switch: Changing host name to $switch\n"; } if (@config_switches) { #update switch status @@ -274,14 +274,12 @@ sub config_snmp { foreach my $switch (@nodes) { my $user = $switchhash->{$switch}->[0]->{sshusername}; if (!$user) { - print "switch ssh username is not defined, add default one\n"; - $cmd = "chdef $switch username=admin"; - $rc= xCAT::Utils->runcmd($cmd, 0); + print "switch ssh username is not defined, use default one\n"; $user="admin"; } $snmp_user = $switchhash->{$switch}->[0]->{username}; if (!$snmp_user) { - print "no snmp user is defined for this switch $switch, not going to set up snmpv3\n"; + print "No snmp user defined for switch $switch. Will not configure snmpv3\n"; next; } $snmp_passwd = $switchhash->{$switch}->[0]->{password}; @@ -300,7 +298,7 @@ sub config_snmp { $cmd = $cmd . "snmp-server user $snmp_user v3 auth $snmp_auth $snmp_passwd\; no snmp-server user $snmp_user v3 require-privacy\;"; } - print "snmpv3 configured for switch $switch\n"; + print "$switch: snmpv3 configured\n"; $cmd = $cmd . "configuration write\;exit\;"; my $final_cmd = $cmd_prefix . " \"" . $cmd . "\""; @@ -347,7 +345,7 @@ sub config_vlan { if ($::PORT) { $port = $::PORT; } else { - xCAT::MsgUtils->message("E","Error - When setting vlan, a port must be provided."); + xCAT::MsgUtils->message("E","Error - When configuring VLAN, a port must be provided."); &usage; exit(1); } @@ -378,7 +376,7 @@ sub config_vlan { if ( $result =~ /MSX14/ ) { $devicetype = "EthSwitch::Mellanox"; }else { - xCAT::MsgUtils->message("E","Config IB switch vlan is not support yet"); + xCAT::MsgUtils->message("E","Config IB switch VLAN is not support yet"); $devicetype = "IBSwitch::Mellanox"; next; } @@ -432,15 +430,15 @@ sub usage To run rspconfig command: configMellanox --switches switchnames --config - To set Vlan for interface commmand (only for Mellanox Ethernet switch) : + To configure VLAN on a specified port (Mellanox Ethernet switch ONLY): configMellanox --switches switchnames --port port --vlan vlan --mode mode - The following mode are supported for switchport: - * access Only untagged ingress Ethernet packets are allowed - * trunk Only tagged ingress Ethernet packets are allowed - * hybrid Both tagged and untagged ingress Ethernet packets are allowed - * access-dcb Only untagged ingress Ethernet packets are allowed. Egress packets will be priority tagged - * dot1q-tunnel Both tagged and untagged ingress Ethernet packets are allowed. Egress packets are tagged with a second VLAN (802.1Q) header + The following mode are supported for switchport: + * access Only untagged ingress Ethernet packets are allowed + * trunk Only tagged ingress Ethernet packets are allowed + * hybrid Both tagged and untagged ingress Ethernet packets are allowed + * access-dcb Only untagged ingress Ethernet packets are allowed. Egress packets will be priority tagged + * dot1q-tunnel Both tagged and untagged ingress Ethernet packets are allowed. Egress packets are tagged with a second VLAN (802.1Q) header \n"; } From 27dcfbbd7a0e8a5285aa881a59c2cd6152e9a548 Mon Sep 17 00:00:00 2001 From: ertaozh Date: Fri, 12 May 2017 21:40:11 -0400 Subject: [PATCH 033/129] enhance descript of postscripts.postscripts and postscripts.postbootscripts --- .../guides/admin-guides/references/man5/postscripts.5.rst | 4 ++-- docs/source/guides/admin-guides/references/man7/group.7.rst | 4 ++-- docs/source/guides/admin-guides/references/man7/node.7.rst | 4 ++-- perl-xCAT/xCAT/Schema.pm | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/source/guides/admin-guides/references/man5/postscripts.5.rst b/docs/source/guides/admin-guides/references/man5/postscripts.5.rst index 7e0615d2d..6bac116b9 100644 --- a/docs/source/guides/admin-guides/references/man5/postscripts.5.rst +++ b/docs/source/guides/admin-guides/references/man5/postscripts.5.rst @@ -44,13 +44,13 @@ postscripts Attributes: \ **postscripts**\ - Comma separated list of scripts that should be run on this node after diskful installation or diskless boot. Each script can take zero or more parameters. For example: "script1 p1 p2,script2,...". xCAT automatically adds the postscripts from the xcatdefaults.postscripts attribute of the table to run first on the nodes after install or diskless boot. For installation of RedHat, CentOS, Fedora, the scripts will be run before the reboot. For installation of SLES, the scripts will be run after the reboot but before the init.d process. For diskless deployment, the scripts will be run at the init.d time, and xCAT will automatically add the list of scripts from the postbootscripts attribute to run after postscripts list. For installation of AIX, the scripts will run after the reboot and acts the same as the postbootscripts attribute. For AIX, use the postbootscripts attribute. Please note that the postscripts specified for "xcatdefaults" will be assigned to node automatically, it can not be removed from "postscripts" attribute of a node with "chdef -m" command + Comma separated list of scripts that should be run on this node after diskful installation or diskless boot. Each script can take zero or more parameters. For example: "script1 p1 p2,script2,...". xCAT automatically adds the postscripts from the xcatdefaults.postscripts attribute of the table to run first on the nodes after install or diskless boot. For installation of RedHat, CentOS, Fedora, the scripts will be run before the reboot. For installation of SLES, the scripts will be run after the reboot but before the init.d process. For diskless deployment, the scripts will be run at the init.d time, and xCAT will automatically add the list of scripts from the postbootscripts attribute to run after postscripts list. For installation of AIX, the scripts will run after the reboot and acts the same as the postbootscripts attribute. For AIX, use the postbootscripts attribute. Please note that the postscripts specified for "xcatdefaults" will be assigned to node automatically, they can not be removed from "postscripts" attribute of a node with "chdef -m" command \ **postbootscripts**\ - Comma separated list of scripts that should be run on this node after diskful installation or diskless boot. Each script can take zero or more parameters. For example: "script1 p1 p2,script2,...". On AIX these scripts are run during the processing of /etc/inittab. On Linux they are run at the init.d time. xCAT automatically adds the scripts in the xcatdefaults.postbootscripts attribute to run first in the list. Please note that the postbootscripts specified for "xcatdefaults" will be assigned to node automatically, it can not be removed from "postbootscripts" attribute of a node with "chdef -m" command + Comma separated list of scripts that should be run on this node after diskful installation or diskless boot. Each script can take zero or more parameters. For example: "script1 p1 p2,script2,...". On AIX these scripts are run during the processing of /etc/inittab. On Linux they are run at the init.d time. xCAT automatically adds the scripts in the xcatdefaults.postbootscripts attribute to run first in the list. Please note that the postbootscripts specified for "xcatdefaults" will be assigned to node automatically, they can not be removed from "postbootscripts" attribute of a node with "chdef -m" command diff --git a/docs/source/guides/admin-guides/references/man7/group.7.rst b/docs/source/guides/admin-guides/references/man7/group.7.rst index 8aea1128b..9a67dd224 100644 --- a/docs/source/guides/admin-guides/references/man7/group.7.rst +++ b/docs/source/guides/admin-guides/references/man7/group.7.rst @@ -801,13 +801,13 @@ group Attributes: \ **postbootscripts**\ (postscripts.postbootscripts) - Comma separated list of scripts that should be run on this node after diskful installation or diskless boot. Each script can take zero or more parameters. For example: "script1 p1 p2,script2,...". On AIX these scripts are run during the processing of /etc/inittab. On Linux they are run at the init.d time. xCAT automatically adds the scripts in the xcatdefaults.postbootscripts attribute to run first in the list. + Comma separated list of scripts that should be run on this node after diskful installation or diskless boot. Each script can take zero or more parameters. For example: "script1 p1 p2,script2,...". On AIX these scripts are run during the processing of /etc/inittab. On Linux they are run at the init.d time. xCAT automatically adds the scripts in the xcatdefaults.postbootscripts attribute to run first in the list. Please note that the postbootscripts specified for "xcatdefaults" will be assigned to node automatically, they can not be removed from "postbootscripts" attribute of a node with "chdef -m" command \ **postscripts**\ (postscripts.postscripts) - Comma separated list of scripts that should be run on this node after diskful installation or diskless boot. Each script can take zero or more parameters. For example: "script1 p1 p2,script2,...". xCAT automatically adds the postscripts from the xcatdefaults.postscripts attribute of the table to run first on the nodes after install or diskless boot. For installation of RedHat, CentOS, Fedora, the scripts will be run before the reboot. For installation of SLES, the scripts will be run after the reboot but before the init.d process. For diskless deployment, the scripts will be run at the init.d time, and xCAT will automatically add the list of scripts from the postbootscripts attribute to run after postscripts list. For installation of AIX, the scripts will run after the reboot and acts the same as the postbootscripts attribute. For AIX, use the postbootscripts attribute. + Comma separated list of scripts that should be run on this node after diskful installation or diskless boot. Each script can take zero or more parameters. For example: "script1 p1 p2,script2,...". xCAT automatically adds the postscripts from the xcatdefaults.postscripts attribute of the table to run first on the nodes after install or diskless boot. For installation of RedHat, CentOS, Fedora, the scripts will be run before the reboot. For installation of SLES, the scripts will be run after the reboot but before the init.d process. For diskless deployment, the scripts will be run at the init.d time, and xCAT will automatically add the list of scripts from the postbootscripts attribute to run after postscripts list. For installation of AIX, the scripts will run after the reboot and acts the same as the postbootscripts attribute. For AIX, use the postbootscripts attribute. Please note that the postscripts specified for "xcatdefaults" will be assigned to node automatically, they can not be removed from "postscripts" attribute of a node with "chdef -m" command diff --git a/docs/source/guides/admin-guides/references/man7/node.7.rst b/docs/source/guides/admin-guides/references/man7/node.7.rst index cb1f1b529..0ab71ac4d 100644 --- a/docs/source/guides/admin-guides/references/man7/node.7.rst +++ b/docs/source/guides/admin-guides/references/man7/node.7.rst @@ -807,13 +807,13 @@ node Attributes: \ **postbootscripts**\ (postscripts.postbootscripts) - Comma separated list of scripts that should be run on this node after diskful installation or diskless boot. Each script can take zero or more parameters. For example: "script1 p1 p2,script2,...". On AIX these scripts are run during the processing of /etc/inittab. On Linux they are run at the init.d time. xCAT automatically adds the scripts in the xcatdefaults.postbootscripts attribute to run first in the list. Please note that the postbootscripts specified for "xcatdefaults" will be assigned to node automatically, it can not be removed from "postbootscripts" attribute of a node with "chdef -m" command + Comma separated list of scripts that should be run on this node after diskful installation or diskless boot. Each script can take zero or more parameters. For example: "script1 p1 p2,script2,...". On AIX these scripts are run during the processing of /etc/inittab. On Linux they are run at the init.d time. xCAT automatically adds the scripts in the xcatdefaults.postbootscripts attribute to run first in the list. Please note that the postbootscripts specified for "xcatdefaults" will be assigned to node automatically, they can not be removed from "postbootscripts" attribute of a node with "chdef -m" command \ **postscripts**\ (postscripts.postscripts) - Comma separated list of scripts that should be run on this node after diskful installation or diskless boot. Each script can take zero or more parameters. For example: "script1 p1 p2,script2,...". xCAT automatically adds the postscripts from the xcatdefaults.postscripts attribute of the table to run first on the nodes after install or diskless boot. For installation of RedHat, CentOS, Fedora, the scripts will be run before the reboot. For installation of SLES, the scripts will be run after the reboot but before the init.d process. For diskless deployment, the scripts will be run at the init.d time, and xCAT will automatically add the list of scripts from the postbootscripts attribute to run after postscripts list. For installation of AIX, the scripts will run after the reboot and acts the same as the postbootscripts attribute. For AIX, use the postbootscripts attribute. Please note that the postscripts specified for "xcatdefaults" will be assigned to node automatically, it can not be removed from "postscripts" attribute of a node with "chdef -m" command + Comma separated list of scripts that should be run on this node after diskful installation or diskless boot. Each script can take zero or more parameters. For example: "script1 p1 p2,script2,...". xCAT automatically adds the postscripts from the xcatdefaults.postscripts attribute of the table to run first on the nodes after install or diskless boot. For installation of RedHat, CentOS, Fedora, the scripts will be run before the reboot. For installation of SLES, the scripts will be run after the reboot but before the init.d process. For diskless deployment, the scripts will be run at the init.d time, and xCAT will automatically add the list of scripts from the postbootscripts attribute to run after postscripts list. For installation of AIX, the scripts will run after the reboot and acts the same as the postbootscripts attribute. For AIX, use the postbootscripts attribute. Please note that the postscripts specified for "xcatdefaults" will be assigned to node automatically, they can not be removed from "postscripts" attribute of a node with "chdef -m" command diff --git a/perl-xCAT/xCAT/Schema.pm b/perl-xCAT/xCAT/Schema.pm index 3821acee6..50241e8e5 100755 --- a/perl-xCAT/xCAT/Schema.pm +++ b/perl-xCAT/xCAT/Schema.pm @@ -893,8 +893,8 @@ passed as argument rather than by table value', table_desc => 'The scripts that should be run on each node after installation or diskless boot.', descriptions => { node => 'The node name or group name.', - postscripts => 'Comma separated list of scripts that should be run on this node after diskful installation or diskless boot. Each script can take zero or more parameters. For example: "script1 p1 p2,script2,...". xCAT automatically adds the postscripts from the xcatdefaults.postscripts attribute of the table to run first on the nodes after install or diskless boot. For installation of RedHat, CentOS, Fedora, the scripts will be run before the reboot. For installation of SLES, the scripts will be run after the reboot but before the init.d process. For diskless deployment, the scripts will be run at the init.d time, and xCAT will automatically add the list of scripts from the postbootscripts attribute to run after postscripts list. For installation of AIX, the scripts will run after the reboot and acts the same as the postbootscripts attribute. For AIX, use the postbootscripts attribute. Please note that the postscripts specified for "xcatdefaults" will be assigned to node automatically, it can not be removed from "postscripts" attribute of a node with "chdef -m" command', - postbootscripts => 'Comma separated list of scripts that should be run on this node after diskful installation or diskless boot. Each script can take zero or more parameters. For example: "script1 p1 p2,script2,...". On AIX these scripts are run during the processing of /etc/inittab. On Linux they are run at the init.d time. xCAT automatically adds the scripts in the xcatdefaults.postbootscripts attribute to run first in the list. Please note that the postbootscripts specified for "xcatdefaults" will be assigned to node automatically, it can not be removed from "postbootscripts" attribute of a node with "chdef -m" command', + postscripts => 'Comma separated list of scripts that should be run on this node after diskful installation or diskless boot. Each script can take zero or more parameters. For example: "script1 p1 p2,script2,...". xCAT automatically adds the postscripts from the xcatdefaults.postscripts attribute of the table to run first on the nodes after install or diskless boot. For installation of RedHat, CentOS, Fedora, the scripts will be run before the reboot. For installation of SLES, the scripts will be run after the reboot but before the init.d process. For diskless deployment, the scripts will be run at the init.d time, and xCAT will automatically add the list of scripts from the postbootscripts attribute to run after postscripts list. For installation of AIX, the scripts will run after the reboot and acts the same as the postbootscripts attribute. For AIX, use the postbootscripts attribute. Please note that the postscripts specified for "xcatdefaults" will be assigned to node automatically, they can not be removed from "postscripts" attribute of a node with "chdef -m" command', + postbootscripts => 'Comma separated list of scripts that should be run on this node after diskful installation or diskless boot. Each script can take zero or more parameters. For example: "script1 p1 p2,script2,...". On AIX these scripts are run during the processing of /etc/inittab. On Linux they are run at the init.d time. xCAT automatically adds the scripts in the xcatdefaults.postbootscripts attribute to run first in the list. Please note that the postbootscripts specified for "xcatdefaults" will be assigned to node automatically, they can not be removed from "postbootscripts" attribute of a node with "chdef -m" command', comments => 'Any user-written notes.', disable => "Set to 'yes' or '1' to comment out this row.", }, From b5448dc6f87098f3f1071bd66960064254763c7e Mon Sep 17 00:00:00 2001 From: chenglch Date: Mon, 15 May 2017 09:57:12 +0800 Subject: [PATCH 034/129] Fix regular expression issue while listing group object Group object should not be translate with the object name even if the attribute contains regular expression. Fix-issue: #3047 --- perl-xCAT/xCAT/DBobjUtils.pm | 10 ++++++---- xCAT-server/lib/xcat/plugins/DBobjectdefs.pm | 8 +++++--- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/perl-xCAT/xCAT/DBobjUtils.pm b/perl-xCAT/xCAT/DBobjUtils.pm index 0bc7e2286..fe4864e54 100755 --- a/perl-xCAT/xCAT/DBobjUtils.pm +++ b/perl-xCAT/xCAT/DBobjUtils.pm @@ -2503,6 +2503,7 @@ sub judge_node nicsattr value, like niccsips=eth0!1.1.1.1|2.1.1.1,eth1!3.1.1.1|4.1.1.1 node name, like frame10node10 nicnames: only return the value for specific nics, like "eth0,eth1" + is_group: bool value indicates whether the type of object is group Returns: expanded format, like: nicsips.eth0=1.1.1.1|2.1.1.1 @@ -2524,8 +2525,7 @@ sub expandnicsattr() if (($nicstr) && ($nicstr =~ /xCAT::/)) { $nicstr = shift; } - my $node = shift; - my $nicnames = shift; + my ($node, $nicnames, $is_group) = @_; my $ret; $nicstr =~ /^(.*?)=(.*?)$/; @@ -2574,8 +2574,10 @@ sub expandnicsattr() } } } - - $nicv[1]= xCAT::Table::transRegexAttrs($node, $nicv[1]); + # print group attributes in original format + if (!$is_group) { + $nicv[1]= xCAT::Table::transRegexAttrs($node, $nicv[1]); + } # ignore the line that does not have nicname or value if ($nicv[0] && $nicv[1]) { $ret .= " $nicattr.$nicv[0]=$nicv[1]\n"; diff --git a/xCAT-server/lib/xcat/plugins/DBobjectdefs.pm b/xCAT-server/lib/xcat/plugins/DBobjectdefs.pm index 973f1d4c0..8faed0d4f 100755 --- a/xCAT-server/lib/xcat/plugins/DBobjectdefs.pm +++ b/xCAT-server/lib/xcat/plugins/DBobjectdefs.pm @@ -3862,13 +3862,14 @@ sub defls $nicnames = join(',', @{ $::NicsAttrHash{$showattr} }); } my $nicsstr; + my $is_group = $defhash{$obj}{'objtype'} eq 'group'; if ($nicnames) { - $nicsstr = xCAT::DBobjUtils->expandnicsattr($nicval, $obj, $nicnames); + $nicsstr = xCAT::DBobjUtils->expandnicsattr($nicval, $obj, $nicnames, $is_group); } else { - $nicsstr = xCAT::DBobjUtils->expandnicsattr($nicval, $obj); + $nicsstr = xCAT::DBobjUtils->expandnicsattr($nicval, $obj, undef, $is_group); } # Compress mode, format the output @@ -3921,7 +3922,8 @@ sub defls if ($showattr =~ /^nic/) { my $nicval = "$showattr=$attrval"; - my $nicsstr = xCAT::DBobjUtils->expandnicsattr($nicval, $obj); + my $is_group = $defhash{$obj}{'objtype'} eq 'group'; + my $nicsstr = xCAT::DBobjUtils->expandnicsattr($nicval, $obj, undef, $is_group); if ($nicsstr) { push(@{ $rsp_info->{data} }, "$nicsstr"); From 460d33c8709311cae8a13802316447302090d882 Mon Sep 17 00:00:00 2001 From: junxiawang Date: Mon, 15 May 2017 02:20:24 -0400 Subject: [PATCH 035/129] Add test case for openbmc rspconfig command #2912 --- xCAT-test/autotest/testcase/rspconfig/cases0 | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/xCAT-test/autotest/testcase/rspconfig/cases0 b/xCAT-test/autotest/testcase/rspconfig/cases0 index 516f2a4bf..a62796ae1 100644 --- a/xCAT-test/autotest/testcase/rspconfig/cases0 +++ b/xCAT-test/autotest/testcase/rspconfig/cases0 @@ -92,4 +92,13 @@ cmd:rspconfig $$CN gateway=ddd check:rc!=0 end +start:rspconfig_node_invalid +despcription:rspconfig could not do any action using invalid node +cmd:test=$(lsdef testnode);if [[ $? -eq 0 ]]; then lsdef -l testnode -z >/tmp/testnode.stanza ;rmdef testnode;fi +check:rc==0 +cmd:rspconfig testnode ip +check:rc!=0 +cmd:if [[ -e /tmp/testnode.stanza ]]; then cat /tmp/testnode.stanza | chdef -z;rm -rf /tmp/testnode.stanza;fi +check:rc==0 +end From cc198bef122e7b39ba0cffe0a4862e2e4edb0a21 Mon Sep 17 00:00:00 2001 From: Matt Ezell Date: Mon, 15 May 2017 15:26:58 -0400 Subject: [PATCH 036/129] Enable switches to run findme for autodiscovery (#2662) --- xCAT-server/lib/xcat/plugins/switch.pm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/switch.pm b/xCAT-server/lib/xcat/plugins/switch.pm index ba3d1281f..61dbce696 100644 --- a/xCAT-server/lib/xcat/plugins/switch.pm +++ b/xCAT-server/lib/xcat/plugins/switch.pm @@ -293,15 +293,19 @@ sub process_request { #discovery working. Food for thought. return; } + my $discoverswitch = 0; + if (defined $req->{nodetype} and $req->{nodetype}->[0] eq 'switch') { + $discoverswitch = 1; + } my $firstpass = 1; if ($mac) { - $node = $macmap->find_mac($mac, $req->{cacheonly}->[0]); + $node = $macmap->find_mac($mac, $req->{cacheonly}->[0], $discoverswitch); $firstpass = 0; } if (not $node) { # and $req->{checkallmacs}->[0]) { foreach (@{ $req->{mac} }) { /.*\|.*\|([\dABCDEFabcdef:]+)(\||$)/; - $node = $macmap->find_mac($1, $firstpass); + $node = $macmap->find_mac($1, $firstpass, $discoverswitch); $firstpass = 0; if ($node) { last; } } From e2b25f57a3445ba197c97d68fc0a0fbca4dac373 Mon Sep 17 00:00:00 2001 From: XuWei Date: Tue, 16 May 2017 04:42:06 -0400 Subject: [PATCH 037/129] Modify output for rpower state when return Quiesced --- xCAT-server/lib/xcat/plugins/openbmc.pm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index 17657824d..4f0663d41 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -830,6 +830,8 @@ sub rpower_response { if ($node_info{$node}{cur_status} eq "RPOWER_STATUS_RESPONSE" and !$next_status{ $node_info{$node}{cur_status} }) { if ($response_info->{'data'}->{CurrentHostState} =~ /Off$/) { xCAT::SvrUtils::sendmsg("off", $callback, $node); + } elsif ($response_info->{'data'}->{CurrentHostState} =~ /Quiesced$/) { + xCAT::SvrUtils::sendmsg("quiesced", $callback, $node); } else { xCAT::SvrUtils::sendmsg("on", $callback, $node); } From 2e017e2c105c6f0a71eab8832137d31bf827b4a8 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Tue, 16 May 2017 15:56:49 -0400 Subject: [PATCH 038/129] OpenBMC rinv sorted output --- xCAT-server/lib/xcat/plugins/openbmc.pm | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index 4f0663d41..6014eb72b 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -876,6 +876,7 @@ sub rinv_response { my $grep_string = $status_info{RINV_RESPONSE}{argv}; my $src; my $content_info; + my @sorted_output; foreach my $key_url (keys %{$response_info->{data}}) { my %content = %{ ${ $response_info->{data} }{$key_url} }; @@ -893,19 +894,23 @@ sub rinv_response { } if (($grep_string eq "vpd" or $grep_string eq "mprom")) { - # wait for interface + xCAT::SvrUtils::sendmsg("No information can be obtained for $grep_string", $callback, $node); + last; } if (($grep_string eq "vpd" or $grep_string eq "deviceid")) { - # wait for interface + xCAT::SvrUtils::sendmsg("No information can be obtained for $grep_string", $callback, $node); + last; } if ($grep_string eq "uuid") { - # wait for interface + xCAT::SvrUtils::sendmsg("No information can be obtained for $grep_string", $callback, $node); + last; } if ($grep_string eq "guid") { - # wait for interface + xCAT::SvrUtils::sendmsg("No information can be obtained for $grep_string", $callback, $node); + last; } if ($grep_string eq "mac" and $key_url =~ /\/ethernet/) { @@ -923,10 +928,16 @@ sub rinv_response { foreach my $key (keys %content) { $content_info = uc ($src) . " " . $key . " : " . $content{$key}; - xCAT::SvrUtils::sendmsg("$content_info", $callback, $node); + push (@sorted_output, $node . ": ". $content_info); #Save output in array } } } + # If sorted array has any contents, sort it and print it + if (scalar @sorted_output > 0) { + @sorted_output = sort @sorted_output; #Sort all output + my $result = join "\n", @sorted_output; #Join into a single string for easier display + xCAT::SvrUtils::sendmsg("$result", $callback); + } if ($next_status{ $node_info{$node}{cur_status} }) { $node_info{$node}{cur_status} = $next_status{ $node_info{$node}{cur_status} }; From d30d0156e7ef5d65cfb2db653cc55221a361ed62 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Tue, 16 May 2017 16:07:44 -0400 Subject: [PATCH 039/129] rinv man page fix --- docs/source/guides/admin-guides/references/man1/rinv.1.rst | 4 ++-- xCAT-client/pods/man1/rinv.1.pod | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/source/guides/admin-guides/references/man1/rinv.1.rst b/docs/source/guides/admin-guides/references/man1/rinv.1.rst index 9d44f4377..df454d284 100644 --- a/docs/source/guides/admin-guides/references/man1/rinv.1.rst +++ b/docs/source/guides/admin-guides/references/man1/rinv.1.rst @@ -32,14 +32,14 @@ OpenPOWER (using ipmi) server specific: ======================================= -\ **rinv**\ \ *noderange*\ {\ **model | serial | deviceid | uuid | guid | vpd | mprom | firm | all**\ } +\ **rinv**\ \ *noderange*\ [\ **model | serial | deviceid | uuid | guid | vpd | mprom | firm | all**\ ] OpenPOWER (using openbmc) server specific: ========================================== -\ **rinv**\ \ *noderange*\ {\ **model | serial | deviceid | uuid | guid | vpd | mprom | firm | cpu | dimm | all**\ } +\ **rinv**\ \ *noderange*\ [\ **model | serial | deviceid | uuid | guid | vpd | mprom | firm | cpu | dimm | all**\ ] PPC (with HMC) specific: diff --git a/xCAT-client/pods/man1/rinv.1.pod b/xCAT-client/pods/man1/rinv.1.pod index e0799d15b..3a5c92f29 100644 --- a/xCAT-client/pods/man1/rinv.1.pod +++ b/xCAT-client/pods/man1/rinv.1.pod @@ -12,11 +12,11 @@ B I {B|B|B|B|B|B|B I {B|B|B|B|B|B|B|B|B} +B I [B|B|B|B|B|B|B|B|B] =head2 OpenPOWER (using openbmc) server specific: -B I {B|B|B|B|B|B|B|B|B|B|B} +B I [B|B|B|B|B|B|B|B|B|B|B] =head2 PPC (with HMC) specific: From 4dd1407d059abc2212de82afcc770a37fecc5cb9 Mon Sep 17 00:00:00 2001 From: junxiawang Date: Wed, 17 May 2017 07:09:50 -0400 Subject: [PATCH 040/129] Migration test just need to run under flat environment or will two dns server:SN and MN for CN --- .../autotest/testcase/migration/redhat_migration | 12 ++++++------ xCAT-test/autotest/testcase/migration/sles_migration | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/xCAT-test/autotest/testcase/migration/redhat_migration b/xCAT-test/autotest/testcase/migration/redhat_migration index 27a489882..0cd7f859c 100644 --- a/xCAT-test/autotest/testcase/migration/redhat_migration +++ b/xCAT-test/autotest/testcase/migration/redhat_migration @@ -2,9 +2,9 @@ start:redhat_migration1 os:Linux description:update xCAT from $$MIGRATION1_VERSION to latest version, these two global parameter defined in config file -#cmd:if ping -c 1 $$SN > /dev/null;then rpower $$SN off > /dev/null;fi -#cmd:chdef -t node -o $$CN servicenode= monserver=$$MN nfsserver=$$MN tftpserver=$$MN xcatmaster=$$MN -#check:rc==0 +cmd:if ping -c 1 $$SN > /dev/null;then rpower $$SN off > /dev/null;fi +cmd:chdef -t node -o $$CN servicenode= monserver=$$MN nfsserver=$$MN tftpserver=$$MN xcatmaster=$$MN +check:rc==0 cmd:rscan __GETNODEATTR($$CN,hcp)__ -w check:rc==0 cmd:makedns -n @@ -103,9 +103,9 @@ os:Linux description:update xCAT from $$MIGRATION2_VERSION to latest version, these two global parameter defined in config file stop:yes -#cmd:if ping -c 1 $$SN > /dev/null;then rpower $$SN off > /dev/null;fi -#cmd:chdef -t node -o $$CN servicenode= monserver=$$MN nfsserver=$$MN tftpserver=$$MN xcatmaster=$$MN -#check:rc==0 +cmd:if ping -c 1 $$SN > /dev/null;then rpower $$SN off > /dev/null;fi +cmd:chdef -t node -o $$CN servicenode= monserver=$$MN nfsserver=$$MN tftpserver=$$MN xcatmaster=$$MN +check:rc==0 cmd:rscan __GETNODEATTR($$CN,hcp)__ -w check:rc==0 cmd:makedns -n diff --git a/xCAT-test/autotest/testcase/migration/sles_migration b/xCAT-test/autotest/testcase/migration/sles_migration index e287ec852..a03bfc0d3 100644 --- a/xCAT-test/autotest/testcase/migration/sles_migration +++ b/xCAT-test/autotest/testcase/migration/sles_migration @@ -2,9 +2,9 @@ start:sles_migration1 os:Linux description:update xCAT from $$MIGRATION1_VERSION to latest version, these two global parameter defined in config file -#cmd:if ping -c 1 $$SN > /dev/null;then rpower $$SN off > /dev/null;fi -#cmd:chdef -t node -o $$CN servicenode= monserver=$$MN nfsserver=$$MN tftpserver=$$MN xcatmaster=$$MN -#check:rc==0 +cmd:if ping -c 1 $$SN > /dev/null;then rpower $$SN off > /dev/null;fi +cmd:chdef -t node -o $$CN servicenode= monserver=$$MN nfsserver=$$MN tftpserver=$$MN xcatmaster=$$MN +check:rc==0 cmd:rscan __GETNODEATTR($$CN,hcp)__ -w check:rc==0 cmd:makedns -n @@ -105,9 +105,9 @@ start:sles_migration2 os:Linux description:update xCAT from $$MIGRATION22VERSION to latest version, these two global parameter defined in config file -#cmd:if ping -c 1 $$SN > /dev/null;then rpower $$SN off > /dev/null;fi -#cmd:chdef -t node -o $$CN servicenode= monserver=$$MN nfsserver=$$MN tftpserver=$$MN xcatmaster=$$MN -#check:rc==0 +cmd:if ping -c 1 $$SN > /dev/null;then rpower $$SN off > /dev/null;fi +cmd:chdef -t node -o $$CN servicenode= monserver=$$MN nfsserver=$$MN tftpserver=$$MN xcatmaster=$$MN +check:rc==0 cmd:rscan __GETNODEATTR($$CN,hcp)__ -w check:rc==0 cmd:makedns -n From d4dd40c292ad8f3ea71e09b6580614c89d1f9fde Mon Sep 17 00:00:00 2001 From: junxiawang Date: Wed, 17 May 2017 08:19:23 -0400 Subject: [PATCH 041/129] add stop lable for Dev to debug --- xCAT-test/autotest/testcase/installation/SN_setup_case | 2 +- .../testcase/installation/reg_linux_diskfull_installation_flat | 2 +- .../installation/reg_linux_diskfull_installation_hierarchy | 2 +- .../testcase/installation/reg_linux_diskless_installation_flat | 2 +- .../installation/reg_linux_diskless_installation_hierarchy | 2 +- .../testcase/installation/reg_linux_statelite_installation_flat | 2 +- .../reg_linux_statelite_installation_hierarchy_by_nfs | 2 +- .../reg_linux_statelite_installation_hierarchy_by_ramdisk | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/xCAT-test/autotest/testcase/installation/SN_setup_case b/xCAT-test/autotest/testcase/installation/SN_setup_case index 271427394..ee92b76c2 100644 --- a/xCAT-test/autotest/testcase/installation/SN_setup_case +++ b/xCAT-test/autotest/testcase/installation/SN_setup_case @@ -1,4 +1,4 @@ -start:SN_setup_case +start:SN_setup_case:stop:yes os:Linux cmd:fdisk -l cmd:df -T diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_flat b/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_flat index b5ef8f841..62c61bf97 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_flat +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_flat @@ -1,4 +1,4 @@ -start:reg_linux_diskfull_installation_flat +start:reg_linux_diskfull_installation_flat:stop:yes os:Linux cmd:fdisk -l cmd:df -T diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_hierarchy b/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_hierarchy index a3a04ba54..28d2392cd 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_hierarchy +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_hierarchy @@ -1,4 +1,4 @@ -start:reg_linux_diskfull_installation_hierarchy +start:reg_linux_diskfull_installation_hierarchy:stop:yes os:Linux cmd:xdsh $$SN fdisk -l cmd:xdsh $$SN df -T diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat index a6e90df47..12fdda8dd 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat @@ -1,4 +1,4 @@ -start:reg_linux_diskless_installation_flat +start:reg_linux_diskless_installation_flat:stop:yes os:Linux cmd:fdisk -l cmd:df -T diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy index 5e16e29af..e689d60f8 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy @@ -1,4 +1,4 @@ -start:reg_linux_diskless_installation_hierarchy +start:reg_linux_diskless_installation_hierarchy:stop:yes os:Linux cmd:xdsh $$SN fdisk -l cmd:xdsh $$SN df -T diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_flat b/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_flat index 829460d05..f4937fdc9 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_flat +++ b/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_flat @@ -1,4 +1,4 @@ -start:reg_linux_statelite_installation_flat +start:reg_linux_statelite_installation_flat:stop:yes os:Linux cmd:fdisk -l cmd:df -T diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_nfs b/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_nfs index 7c8e83622..7a6f561c7 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_nfs +++ b/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_nfs @@ -1,4 +1,4 @@ -start:reg_linux_statelite_installation_hierarchy_by_nfs +start:reg_linux_statelite_installation_hierarchy_by_nfs:stop:yes os:Linux cmd:xdsh $$SN fdisk -l cmd:xdsh $$SN df -T diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_ramdisk b/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_ramdisk index c2140c00d..3bc4f5e95 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_ramdisk +++ b/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_ramdisk @@ -1,4 +1,4 @@ -start:reg_linux_statelite_installation_hierarchy_by_ramdisk +start:reg_linux_statelite_installation_hierarchy_by_ramdisk:stop:yes os:Linux cmd:xdsh $$SN fdisk -l cmd:xdsh $$SN df -T From 3b78dff3a0142e9176b04eeb0b2d9d88404ee03c Mon Sep 17 00:00:00 2001 From: junxiawang Date: Wed, 17 May 2017 08:26:37 -0400 Subject: [PATCH 042/129] add stop lable for Dev to debug --- xCAT-test/autotest/testcase/installation/SN_setup_case | 3 ++- .../testcase/installation/reg_linux_diskfull_installation_flat | 3 ++- .../installation/reg_linux_diskfull_installation_hierarchy | 3 ++- .../testcase/installation/reg_linux_diskless_installation_flat | 3 ++- .../installation/reg_linux_diskless_installation_hierarchy | 3 ++- .../installation/reg_linux_statelite_installation_flat | 3 ++- .../reg_linux_statelite_installation_hierarchy_by_nfs | 3 ++- .../reg_linux_statelite_installation_hierarchy_by_ramdisk | 3 ++- 8 files changed, 16 insertions(+), 8 deletions(-) diff --git a/xCAT-test/autotest/testcase/installation/SN_setup_case b/xCAT-test/autotest/testcase/installation/SN_setup_case index ee92b76c2..330bdeaa2 100644 --- a/xCAT-test/autotest/testcase/installation/SN_setup_case +++ b/xCAT-test/autotest/testcase/installation/SN_setup_case @@ -1,5 +1,6 @@ -start:SN_setup_case:stop:yes +start:SN_setup_case os:Linux +stop:yes cmd:fdisk -l cmd:df -T cmd:XCAT_DATABASE=$$XCAT_DATABASE /opt/xcat/share/xcat/tools/autotest/testcase/installation/pre_deploy_sn __GETNODEATTR($$SN,os)__ __GETNODEATTR($$SN,arch)__ diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_flat b/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_flat index 62c61bf97..cbe7a6991 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_flat +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_flat @@ -1,5 +1,6 @@ -start:reg_linux_diskfull_installation_flat:stop:yes +start:reg_linux_diskfull_installation_flat os:Linux +stop:yes cmd:fdisk -l cmd:df -T cmd:if ping -c 1 $$SN > /dev/null;then rpower $$SN off > /dev/null;fi diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_hierarchy b/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_hierarchy index 28d2392cd..eca702914 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_hierarchy +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_hierarchy @@ -1,5 +1,6 @@ -start:reg_linux_diskfull_installation_hierarchy:stop:yes +start:reg_linux_diskfull_installation_hierarchy os:Linux +stop:yes cmd:xdsh $$SN fdisk -l cmd:xdsh $$SN df -T cmd:xdsh $$SN "echo "test"> /test.hierarchy" diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat index 12fdda8dd..1541fae4b 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat @@ -1,5 +1,6 @@ -start:reg_linux_diskless_installation_flat:stop:yes +start:reg_linux_diskless_installation_flat os:Linux +stop:yes cmd:fdisk -l cmd:df -T cmd:chdef -t node -o $$CN servicenode= monserver=$$MN nfsserver=$$MN tftpserver=$$MN xcatmaster=$$MN diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy index e689d60f8..8ca853faa 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy @@ -1,5 +1,6 @@ -start:reg_linux_diskless_installation_hierarchy:stop:yes +start:reg_linux_diskless_installation_hierarchy os:Linux +stop:yes cmd:xdsh $$SN fdisk -l cmd:xdsh $$SN df -T cmd:xdsh $$SN "echo "test"> /test.hierarchy" diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_flat b/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_flat index f4937fdc9..fa994e2c6 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_flat +++ b/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_flat @@ -1,5 +1,6 @@ -start:reg_linux_statelite_installation_flat:stop:yes +start:reg_linux_statelite_installation_flat os:Linux +stop:yes cmd:fdisk -l cmd:df -T diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_nfs b/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_nfs index 7a6f561c7..cfb83253f 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_nfs +++ b/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_nfs @@ -1,5 +1,6 @@ -start:reg_linux_statelite_installation_hierarchy_by_nfs:stop:yes +start:reg_linux_statelite_installation_hierarchy_by_nfs os:Linux +stop:yes cmd:xdsh $$SN fdisk -l cmd:xdsh $$SN df -T cmd:xdsh $$SN "echo "test"> /test.hierarchy" diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_ramdisk b/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_ramdisk index 3bc4f5e95..a15e412f1 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_ramdisk +++ b/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_ramdisk @@ -1,5 +1,6 @@ -start:reg_linux_statelite_installation_hierarchy_by_ramdisk:stop:yes +start:reg_linux_statelite_installation_hierarchy_by_ramdisk os:Linux +stop:yes cmd:xdsh $$SN fdisk -l cmd:xdsh $$SN df -T cmd:xdsh $$SN "echo "test"> /test.hierarchy" From e664018cc493b5453874aa6d7e637460f560cc99 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Wed, 17 May 2017 11:25:38 -0400 Subject: [PATCH 043/129] Changes after review comments --- xCAT-server/lib/xcat/plugins/openbmc.pm | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index 6014eb72b..3ea0c7419 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -893,23 +893,23 @@ sub rinv_response { next if ($grep_string eq "serial"); } - if (($grep_string eq "vpd" or $grep_string eq "mprom")) { - xCAT::SvrUtils::sendmsg("No information can be obtained for $grep_string", $callback, $node); - last; + if (($grep_string eq "vpd" or $grep_string eq "mprom") and $key_url =~ /\/motherboard$/) { + xCAT::SvrUtils::sendmsg("No mprom information is available", $callback, $node); + next if ($grep_string eq "mprom"); } - if (($grep_string eq "vpd" or $grep_string eq "deviceid")) { - xCAT::SvrUtils::sendmsg("No information can be obtained for $grep_string", $callback, $node); - last; + if (($grep_string eq "vpd" or $grep_string eq "deviceid") and $key_url =~ /\/motherboard$/) { + xCAT::SvrUtils::sendmsg("No deviceid information is available", $callback, $node); + next if ($grep_string eq "deviceid"); } if ($grep_string eq "uuid") { - xCAT::SvrUtils::sendmsg("No information can be obtained for $grep_string", $callback, $node); + xCAT::SvrUtils::sendmsg("No uuid information is available", $callback, $node); last; } if ($grep_string eq "guid") { - xCAT::SvrUtils::sendmsg("No information can be obtained for $grep_string", $callback, $node); + xCAT::SvrUtils::sendmsg("No guid information is available", $callback, $node); last; } From 70cc3ac1c9616583f92ff643fe6ac1fae0532154 Mon Sep 17 00:00:00 2001 From: GONG Jie Date: Thu, 18 May 2017 02:18:04 +0800 Subject: [PATCH 044/129] Create a mailmap file to coalesce together commits by the same person. --- .mailmap | 69 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 .mailmap diff --git a/.mailmap b/.mailmap new file mode 100644 index 000000000..cc6d51051 --- /dev/null +++ b/.mailmap @@ -0,0 +1,69 @@ +BAI Yuan +Bruce Potter +CAO Li +CAO Meng Meng +CAO Meng Meng +CAO Meng Meng +Casandra Qiu +Casandra Qiu +CHENG Long +CHU De Gao +CHU De Gao +CHU De Gao +GAO Feng +GAO Ling +GAO Ling +GONG Jie +GONG Jie +GONG Jie +HU Wei Hua +Jarrod Johnson +Jarrod Johnson +Jarrod Johnson +Jarrod Johnson +JIN Jie Hua +JIN Jie Hua +LI Guang Cheng +LI Guang Cheng +LI Guang Cheng +LI Ting Ting +Linda O. Mellor +Linda O. Mellor +Lissa Valletta +Lissa Valletta +Mark Gurevich +Mark Gurevich +Norm Nott +Norm Nott +Patrick Lundgren +Patrick Lundgren +Patrick Lundgren +SUN Jing +SUN Jing +Victor Hu +Victor Hu +Victor Hu +WANG Hua Zhong +WANG Hua Zhong +WANG Jun Xia +WANG Xiao Peng +WANG Xiao Peng +WANG Xiao Peng +WANG Xiao Peng +WANG Xiao Peng +WU Xian +XU Bin +XU Bin +XU Qing +XU Qing +XU Wei +YANG Peng +YANG Song +YANG Song +YANG Song +YANG Song +YIN Le +YIN Le +ZHAO Er Tao +ZHAO Er Tao +ZHAO Er Tao From 7057ab5208b5b01da502a84095c0d43e1103e154 Mon Sep 17 00:00:00 2001 From: XuWei Date: Thu, 18 May 2017 01:41:33 -0400 Subject: [PATCH 045/129] Modify process of rinv firm/all depending on new url --- xCAT-server/lib/xcat/plugins/openbmc.pm | 49 +++++++++++++++++++++---- 1 file changed, 41 insertions(+), 8 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index 3ea0c7419..519a4a13c 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -106,6 +106,14 @@ my %status_info = ( process => \&rinv_response, }, + RINV_FIRM_REQUEST => { + method => "GET", + init_url => "$openbmc_project_url/software/enumerate", + }, + RINV_FIRM_RESPONSE => { + process => \&rinv_response, + }, + RPOWER_ON_REQUEST => { method => "PUT", init_url => "$openbmc_project_url/state/host0/attr/RequestedHostTransition", @@ -322,7 +330,7 @@ sub process_request { push @donargs, [ $node,$bmcip,$node_info{$node}{username}, $node_info{$node}{password}]; } else { $login_url = "$http_protocol://$bmcip/login"; - $content = '{"data": [ "' . $node_info{$node}{username} .'", "' . $node_info{$node}{password} . '" ] }'; + $content = '{ "data": [ "' . $node_info{$node}{username} .'", "' . $node_info{$node}{password} . '" ] }'; $handle_id = xCAT::OPENBMC->new($async, $login_url, $content); $handle_id_node{$handle_id} = $node; $node_info{$node}{cur_status} = $next_status{ $node_info{$node}{cur_status} }; @@ -496,9 +504,20 @@ sub parse_command_status { $subcommand = "all"; } - $next_status{LOGIN_RESPONSE} = "RINV_REQUEST"; - $next_status{RINV_REQUEST} = "RINV_RESPONSE"; - $status_info{RINV_RESPONSE}{argv} = "$subcommand"; + if ($subcommand eq "firm") { + $next_status{LOGIN_RESPONSE} = "RINV_FIRM_REQUEST"; + $next_status{RINV_FIRM_REQUEST} = "RINV_FIRM_RESPONSE"; + } elsif ($subcommand eq "all") { + $next_status{LOGIN_RESPONSE} = "RINV_REQUEST"; + $next_status{RINV_REQUEST} = "RINV_RESPONSE"; + $status_info{RINV_RESPONSE}{argv} = "$subcommand"; + $next_status{RINV_RESPONSE} = "RINV_FIRM_REQUEST"; + $next_status{RINV_FIRM_REQUEST} = "RINV_FIRM_RESPONSE"; + } else { + $next_status{LOGIN_RESPONSE} = "RINV_REQUEST"; + $next_status{RINV_REQUEST} = "RINV_RESPONSE"; + $status_info{RINV_RESPONSE}{argv} = "$subcommand"; + } } if ($command eq "rsetboot") { @@ -552,7 +571,7 @@ sub parse_command_status { if ($command eq "rspconfig") { my @options = (); foreach $subcommand (@ARGV) { - if ($subcommand =~ /^ip$|^netmask$|^gateway$/) { + if ($subcommand =~ /^ip$|^netmask$|^gateway$|^vlan$/) { $next_status{LOGIN_RESPONSE} = "RSPCONFIG_GET_REQUEST"; $next_status{RSPCONFIG_GET_REQUEST} = "RSPCONFIG_GET_RESPONSE"; push @options, $subcommand; @@ -873,7 +892,13 @@ sub rinv_response { my $response_info = decode_json $response->content; - my $grep_string = $status_info{RINV_RESPONSE}{argv}; + my $grep_string; + if ($node_info{$node}{cur_status} eq "RINV_FIRM_RESPONSE") { + $grep_string = "firm"; + } else { + $grep_string = $status_info{RINV_RESPONSE}{argv}; + } + my $src; my $content_info; my @sorted_output; @@ -881,6 +906,14 @@ sub rinv_response { foreach my $key_url (keys %{$response_info->{data}}) { my %content = %{ ${ $response_info->{data} }{$key_url} }; + if ($grep_string eq "firm") { + if (defined($content{Version}) and $content{Version}) { + my $firm_ver = "System Firmware Product Version: " . "$content{Version}"; + xCAT::SvrUtils::sendmsg("$firm_ver", $callback, $node); + next; + } + } + if (($grep_string eq "vpd" or $grep_string eq "model") and $key_url =~ /\/motherboard$/) { my $partnumber = "BOARD Part Number: " . "$content{PartNumber}"; xCAT::SvrUtils::sendmsg("$partnumber", $callback, $node); @@ -919,7 +952,7 @@ sub rinv_response { next; } - if ($grep_string eq "all" or $key_url =~ /\/$grep_string/ or ($grep_string eq "firm" and defined($content{Name}) and $content{Name} eq "OpenPOWER Firmware")) { + if ($grep_string eq "all" or $key_url =~ /\/$grep_string/) { if ($key_url =~ /\/(cpu\d*)\/(\w+)/) { $src = "$1 $2"; } else { @@ -1030,7 +1063,7 @@ sub reventlog_response { my $response_info = decode_json $response->content; - if ($node_info{$node}{cur_status} eq "REVENTLOG_CLEAR_REQUEST") { + if ($node_info{$node}{cur_status} eq "REVENTLOG_CLEAR_RESPONSE") { if ($response_info->{'message'} eq $::RESPONSE_OK) { xCAT::SvrUtils::sendmsg("clear", $callback, $node); } From 80e5e965420edaa5480dd3a2c7f629248dba3a8d Mon Sep 17 00:00:00 2001 From: Yuan Bai Date: Thu, 18 May 2017 14:00:50 +0800 Subject: [PATCH 046/129] fix mtu support (#3083) --- xCAT-server/lib/xcat/plugins/networks.pm | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/xCAT-server/lib/xcat/plugins/networks.pm b/xCAT-server/lib/xcat/plugins/networks.pm index 894d0518a..49f318854 100644 --- a/xCAT-server/lib/xcat/plugins/networks.pm +++ b/xCAT-server/lib/xcat/plugins/networks.pm @@ -372,8 +372,10 @@ sub donets # For Linux systems my @ip6table = split /\n/, `/sbin/ip -6 route`; my @rtable = split /\n/, `/bin/netstat -rn`; + my @mtable = split /\n/, `/bin/netstat -i`; splice @rtable, 0, 2; + splice @mtable, 0, 2; my %netgw = (); foreach my $rtent (@rtable) @@ -517,6 +519,15 @@ sub donets } } + # get mtu value + my $mtu; + my @rowm; + foreach (grep /\s*$mgtifname\b/, @mtable) + { + @rowm = split(/\s+/, $_); + $mtu = $rowm[1]; + } + if ($::DISPLAY) { push @{ $rsp->{data} }, "\n#From $host."; push @{ $rsp->{data} }, "$netname:"; @@ -528,9 +539,13 @@ sub donets push @{ $rsp->{data} }, " gateway=$gw"; } push @{ $rsp->{data} }, " mgtifname=$mgtifname"; + if ($mtu) + { + push @{ $rsp->{data} }, " mtu=$mtu"; + } } else { if (!$foundmatch) { - $nettab->setAttribs({ 'net' => $net, 'mask' => $mask }, { 'netname' => $netname, 'mgtifname' => $mgtifname, 'gateway' => $gw }); + $nettab->setAttribs({ 'net' => $net, 'mask' => $mask }, { 'netname' => $netname, 'mgtifname' => $mgtifname, 'gateway' => $gw, 'mtu' => $mtu }); } } From 317845a04cc28795688c716b549f8253f80ac67f Mon Sep 17 00:00:00 2001 From: yangsong Date: Thu, 18 May 2017 01:23:29 -0500 Subject: [PATCH 047/129] merge 2.13.perfopt branch to master branch (#3044) * Add trace point for perf tool in xcatd (#903) This patch aims to enable nytprof library to analyze the performance of xcat code in statement level. - Add perf trace point in xcatd - Add sleep time for db prcess to solve the race condition when - perf instraction is used. More reference To enable prof: perl -dt:NYTProf /opt/xcat/sbin/xcatd -f Some perf test sample: https://github.com/chenglch/xcatperf * refine the performance of makedhcp (#2901), it including: - refine the code logic in getSNList to get better performance - refine the getipaddr, cache the dns lookup result - refine noderangecontainsMn - refine ishostinsubnet --- perl-xCAT/xCAT/MsgUtils.pm | 61 ++++++++ perl-xCAT/xCAT/NetworkUtils.pm | 217 ++++++++++++++++++++--------- perl-xCAT/xCAT/ServiceNodeUtils.pm | 33 ++++- perl-xCAT/xCAT/Utils.pm | 15 ++ xCAT-server/sbin/xcatd | 32 ++++- 5 files changed, 287 insertions(+), 71 deletions(-) diff --git a/perl-xCAT/xCAT/MsgUtils.pm b/perl-xCAT/xCAT/MsgUtils.pm index b2e6484be..577d97ec4 100644 --- a/perl-xCAT/xCAT/MsgUtils.pm +++ b/perl-xCAT/xCAT/MsgUtils.pm @@ -16,6 +16,7 @@ use xCAT::Utils; #use locale; use Socket; use File::Path; +use constant PERF_LOG => "/var/log/xcat/perf.log"; $::NOK = -1; $::OK = 0; @@ -823,5 +824,65 @@ sub trace() { } } +#------------------------------------------------------------------ + +=head3 _perf_log + Libary function to write the perf log. Do not use it directly. +=cut + +#----------------------------------------------------------------- +sub _perf_log +{ + my $type = shift; + my $msg = shift; + my $fh; + my $ret = open($fh, '>>', PERF_LOG); + if (!$ret) { + xCAT::MsgUtils->message("S", "Open perf log file error: $!"); + } + my $line = localtime()."\t$type\t$msg\n"; + print $fh $line; + close $fh; +} + +#------------------------------------------------------------------ + +=head3 perf_log_info + Trace information for perf + Argument: + $msg (trace message) +=cut + +#----------------------------------------------------------------- +sub perf_log_info +{ + shift; + my $msg = shift; + _perf_log('info', $msg); +} + +#------------------------------------------------------------------ + +=head3 perf_log_process + Trace process information for perf + Arguments: + $process_type (immediate, plugin, etc) + $req (xcat reqeust) + $msg (additional message, optional) +=cut + +#----------------------------------------------------------------- +sub perf_log_process +{ + shift; + my ($process_type, $req, $msg, $pid) = @_; + if (defined($req)) { + my $command = $req->{command}->[0]; + _perf_log($process_type, "$$\t$command\t$msg"); + } else { + _perf_log($process_type, "$pid\t$msg"); + } +} + 1; diff --git a/perl-xCAT/xCAT/NetworkUtils.pm b/perl-xCAT/xCAT/NetworkUtils.pm index a66576cf4..0c62fb7a0 100755 --- a/perl-xCAT/xCAT/NetworkUtils.pm +++ b/perl-xCAT/xCAT/NetworkUtils.pm @@ -19,8 +19,7 @@ use File::Path; use Math::BigInt; use Socket; use xCAT::GlobalDef; - -#use Data::Dumper; +use Sys::Hostname; use strict; use warnings "all"; my $socket6support = eval { require Socket6 }; @@ -229,6 +228,9 @@ sub gethostname() hostname Optional: GetNumber=>1 (return the address as a BigInt instead of readable string) + GetAllAddresses=>1 (return the ) + OnlyV6=>1 () + OnlyV4=> () Returns: ip address Globals: cache: %::hostiphash @@ -270,69 +272,117 @@ sub getipaddr # #pass in an ip and only want an ip?? # return $iporhost; #} + my $isip=0; + if ($iporhost and ($iporhost =~ /\d+\.\d+\.\d+\.\d+/) || ($iporhost =~ /:/)){ + $isip=1; + } + + +#print "============================\n"; +#print Dumper(\%::hostiphash); +#print "\n"; +#print Dumper(\%extraarguments); +#print "\n"; +#print "iporhost=$iporhost"; +#print "\n"; +#print "============================\n"; #cache, do not lookup DNS each time - if ($::hostiphash and defined($::hostiphash{$iporhost}) && $::hostiphash{$iporhost}) + if ( + ((not $extraarguments{OnlyV6}) and (not $extraarguments{GetAllAddresses})) and defined($::hostiphash{$iporhost}) and $::hostiphash{$iporhost}) { - return $::hostiphash{$iporhost}; + + if($extraarguments{GetNumber} ) { + if($::hostiphash{$iporhost}{Number}){ + #print "YYYYYYYYYY GetNumber Cache Hit!!!YYYYYYYYY\n"; + return $::hostiphash{$iporhost}{Number}; + } + } elsif($::hostiphash{$iporhost}{hostip}) { + #print "YYYYYYYYYY dns Cache Hit!!!YYYYYYYYY\n"; + return $::hostiphash{$iporhost}{hostip}; + } + } + + if ($socket6support) # the getaddrinfo and getnameinfo supports both IPv4 and IPv6 + { + my @returns; + my $reqfamily = AF_UNSPEC; + if ($extraarguments{OnlyV6}) { + $reqfamily = AF_INET6; + } elsif ($extraarguments{OnlyV4}) { + $reqfamily = AF_INET; + } + my @addrinfo; + if($isip) { + @addrinfo=Socket6::getaddrinfo($iporhost, 0, $reqfamily, SOCK_STREAM, 6,Socket6::AI_NUMERICHOST()); + }else{ + @addrinfo=Socket6::getaddrinfo($iporhost, 0, $reqfamily, SOCK_STREAM, 6); + } + my ($family, $socket, $protocol, $ip, $name) = splice(@addrinfo, 0, 5); + unless($reqfamily == AF_INET6){ + if($isip){ + if($name){ + $::hostiphash{$iporhost}{hostip}=$name; + } + }elsif($ip){ + $::hostiphash{$iporhost}{hostip}=$ip; + } + } + while ($ip) + { + if ($extraarguments{GetNumber}) { #return a BigInt for compare, e.g. for comparing ip addresses for determining if they are in a common network or range + my $ip = (Socket6::getnameinfo($ip, Socket6::NI_NUMERICHOST()))[0]; + my $bignumber = Math::BigInt->new(0); + foreach (unpack("N*", Socket6::inet_pton($family, $ip))) { #if ipv4, loop will iterate once, for v6, will go 4 times + $bignumber->blsft(32); + $bignumber->badd($_); + } + push(@returns, $bignumber); + $::hostiphash{$iporhost}{Number}=$returns[0]; + } else { + push @returns, (Socket6::getnameinfo($ip, Socket6::NI_NUMERICHOST()))[0]; + $::hostiphash{$iporhost}{hostip}=$returns[0]; + } + if (scalar @addrinfo and $extraarguments{GetAllAddresses}) { + ($family, $socket, $protocol, $ip, $name) = splice(@addrinfo, 0, 5); + } else { + $ip = 0; + } + } + unless ($extraarguments{GetAllAddresses}) { + return $returns[0]; + } + return @returns; } else { - if ($socket6support) # the getaddrinfo and getnameinfo supports both IPv4 and IPv6 - { - my @returns; - my $reqfamily = AF_UNSPEC; - if ($extraarguments{OnlyV6}) { - $reqfamily = AF_INET6; - } elsif ($extraarguments{OnlyV4}) { - $reqfamily = AF_INET; - } - my @addrinfo = Socket6::getaddrinfo($iporhost, 0, $reqfamily, SOCK_STREAM, 6); - my ($family, $socket, $protocol, $ip, $name) = splice(@addrinfo, 0, 5); - while ($ip) - { - if ($extraarguments{GetNumber}) { #return a BigInt for compare, e.g. for comparing ip addresses for determining if they are in a common network or range - my $ip = (Socket6::getnameinfo($ip, Socket6::NI_NUMERICHOST()))[0]; - my $bignumber = Math::BigInt->new(0); - foreach (unpack("N*", Socket6::inet_pton($family, $ip))) { #if ipv4, loop will iterate once, for v6, will go 4 times - $bignumber->blsft(32); - $bignumber->badd($_); - } - push(@returns, $bignumber); - } else { - push @returns, (Socket6::getnameinfo($ip, Socket6::NI_NUMERICHOST()))[0]; - } - if (scalar @addrinfo and $extraarguments{GetAllAddresses}) { - ($family, $socket, $protocol, $ip, $name) = splice(@addrinfo, 0, 5); - } else { - $ip = 0; - } - } - unless ($extraarguments{GetAllAddresses}) { - return $returns[0]; - } - return @returns; - } - else - { - #return inet_ntoa(inet_aton($iporhost)) - #TODO, what if no scoket6 support, but passing in a IPv6 hostname? - if ($iporhost =~ /:/) { #ipv6 - return undef; + #return inet_ntoa(inet_aton($iporhost)) + #TODO, what if no scoket6 support, but passing in a IPv6 hostname? + if ($iporhost =~ /:/) { #ipv6 + return undef; - #die "Attempt to process IPv6 address, but system does not have requisite IPv6 perl support"; - } - my $packed_ip; - $iporhost and $packed_ip = inet_aton($iporhost); - if (!$packed_ip) - { - return undef; - } - if ($extraarguments{GetNumber}) { #only 32 bits, no for loop needed. - return Math::BigInt->new(unpack("N*", $packed_ip)); - } - return inet_ntoa($packed_ip); + #die "Attempt to process IPv6 address, but system does not have requisite IPv6 perl support"; } + my $packed_ip; + $iporhost and $packed_ip = inet_aton($iporhost); + if (!$packed_ip) + { + return undef; + } + + my $myip=inet_ntoa($packed_ip); + + unless($isip) { + $::hostiphash{$iporhost}{hostip}=$myip; + } + + if ($extraarguments{GetNumber}) { #only 32 bits, no for loop needed. + my $number=Math::BigInt->new(unpack("N*", $packed_ip)); + $::hostiphash{$iporhost}{Number}=$number; + return $number; + } + + return $myip; } } @@ -417,7 +467,7 @@ sub linklocaladdr { =cut #------------------------------------------------------------------------------- -sub ishostinsubnet { +sub ishostinsubnet{ my ($class, $ip, $mask, $subnet) = @_; #safe guard @@ -425,6 +475,40 @@ sub ishostinsubnet { { return 0; } + + my $maskType=0; + + #CIDR notation supported + if ($subnet && ($subnet =~ /\//)) { + ($subnet, $mask) = split /\//, $subnet, 2; + $subnet =~ s/\/.*$//; + $maskType=1; + }elsif ($mask) { + if ($mask =~ /\//) { + $mask =~ s/^\///; + $maskType=1; + } elsif($mask =~ /^0x/i ) { + $maskType=2; + } + } + + my $ret=xCAT::NetworkUtils::isInSameSubnet( $ip, $subnet, $mask, $maskType); + if(defined $ret and $ret==1){ + return 1; + }else{ + return 0; + } +} + +sub ishostinsubnet_orig { + my ($class, $ip, $mask, $subnet) = @_; + + #safe guard + if (!defined($ip) || !defined($mask) || !defined($subnet)) + { + return 0; + } + my $numbits = 32; if ($ip =~ /:/) { #ipv6 $numbits = 128; @@ -1314,7 +1398,7 @@ sub formatNetmask Returns: 1: they are in same subnet - 2: not in same subnet + undef: not in same subnet Globals: none @@ -1853,16 +1937,13 @@ sub get_subnet_aix sub determinehostname { my $hostname; - my $hostnamecmd = "/bin/hostname"; - my @thostname = xCAT::Utils->runcmd($hostnamecmd, 0); - if ($::RUNCMD_RC != 0) - { # could not get hostname - xCAT::MsgUtils->message("S", - "Error $::RUNCMD_RC from $hostnamecmd command\n"); - exit $::RUNCMD_RC; + eval { + $hostname = hostname; + }; + if($@){ + xCAT::MsgUtils->message("S","Fail to get hostname: $@\n"); + exit -1; } - $hostname = $thostname[0]; - #get all potentially valid abbreviations, and pick the one that is ok #by 'noderange' my @hostnamecandidates; diff --git a/perl-xCAT/xCAT/ServiceNodeUtils.pm b/perl-xCAT/xCAT/ServiceNodeUtils.pm index 5daf5c237..c27601874 100755 --- a/perl-xCAT/xCAT/ServiceNodeUtils.pm +++ b/perl-xCAT/xCAT/ServiceNodeUtils.pm @@ -14,7 +14,6 @@ if ($^O =~ /^aix/i) { } use lib "$::XCATROOT/lib/perl"; use strict; - #----------------------------------------------------------------------------- =head3 readSNInfo @@ -353,6 +352,37 @@ sub getSNandNodes #----------------------------------------------------------------------------- sub getSNList +{ + require xCAT::Table; + require xCAT::NodeRange; + my ($class, $service, $options) = @_; + my @servicenodes; + my $servicenodetab = xCAT::Table->new('servicenode'); + my $nodetab = xCAT::Table->new('nodelist'); + unless ($servicenodetab) # no servicenode table + { + xCAT::MsgUtils->message('I', "Unable to open servicenode table.\n"); + $servicenodetab->close; + return @servicenodes; + } + + + if($service){ + @servicenodes = $servicenodetab->getAllAttribsWhere(["$service==1"],'node'); + }else{ + @servicenodes = $servicenodetab->getAllAttribs(('node')); + } + + @servicenodes=xCAT::NodeRange::noderange(join(',',map {$_->{node}} @servicenodes)); + if($options eq "ALL"){ + return @servicenodes; + } + + @servicenodes = $nodetab->getAllAttribsWhere("node in ("."\'".join("\',\'", @servicenodes)."\'".") and groups not like '%__mgmtnode%'",'node'); + return map {$_->{node}} @servicenodes; +} + +sub getSNList_orig { require xCAT::Table; my ($class, $service, $options) = @_; @@ -367,6 +397,7 @@ sub getSNList } my @nodes = $servicenodetab->getAllNodeAttribs([$service]); $servicenodetab->close; + foreach my $node (@nodes) { if (!defined($service) || ($service eq "")) # want all the service nodes diff --git a/perl-xCAT/xCAT/Utils.pm b/perl-xCAT/xCAT/Utils.pm index a39ea8bb2..06b08ae68 100644 --- a/perl-xCAT/xCAT/Utils.pm +++ b/perl-xCAT/xCAT/Utils.pm @@ -3306,10 +3306,25 @@ sub isSELINUX =cut #------------------------------------------------------------------------------- + + sub noderangecontainsMn { my ($class, @noderange) = @_; + # check if any node in the noderange is the Management Node return the + # name + my @mnames; # management node names in the database, members of __mgmtnode + my $tab = xCAT::Table->new('nodelist'); + + my @nodelist = $tab->getAllAttribsWhere("node in ("."\'".join("\',\'", @noderange)."\'".") and groups like '%__mgmtnode%'",'node'); + return map {$_->{node}} @nodelist; # if no MN in the noderange, return nothing +} + +sub noderangecontainsMn_orig +{ + my ($class, @noderange) = @_; + # check if any node in the noderange is the Management Node return the # name my @mnames; # management node names in the database, members of __mgmtnode diff --git a/xCAT-server/sbin/xcatd b/xCAT-server/sbin/xcatd index 2bc097027..8132fad96 100755 --- a/xCAT-server/sbin/xcatd +++ b/xCAT-server/sbin/xcatd @@ -221,6 +221,20 @@ my $cmdlog_alllog = "====================================================\n"; my $cmdlog_starttime=undef; # ----used for command log end--------- +my $enable_perf = $sitetab->getAttribs({'key'=>'enableperf'},'value'); +if($enable_perf) { + # Enabled by user, check whether nytperf library is enabled + if (!defined(&DB::disable_profile)) { + xCAT::MsgUtils->message("S", "Perf is enabled in sitetable, but can not load the library."); + $enable_perf = 0; + } else { + if ($enable_perf) { + xCAT::MsgUtils->perf_log_info("start profiling"); + DB::enable_profile(); + } + } +} + $sitetab->close; @@ -926,7 +940,9 @@ unless ($foreground) { } $dbmaster = xCAT::Table::init_dbworker; - +if ($enable_perf) { + xCAT::MsgUtils->perf_log_process( "db", undef, "dbprocess", $dbmaster ); +} # Make sure DB process is ready. wait_db_process(); my $CHILDPID = 0; # Global for reapers @@ -1026,7 +1042,9 @@ $SIG{TERM} = $SIG{INT} = sub { if ($cmdlog_svrpid) { kill 'INT', $cmdlog_svrpid; } - + if ($enable_perf) { +# DB::finish_profile(); + } # ----used for command log end--------- }; @@ -1525,6 +1543,10 @@ until ($quit) { if ($sslfudgefactor) { $sslfudgefactor -= 1; } $sslclients++; # THROTTLE $cnnection->close(); + if ($enable_perf) { + xCAT::MsgUtils->perf_log_info("stop profiling"); +# DB::disable_profile(); + } } if (open($mainpidfile, "<", "/var/run/xcat/mainservice.pid")) { my $pid = <$mainpidfile>; @@ -1949,6 +1971,9 @@ sub plugin_command { } } $$progname = $oldprogname; + if ($enable_perf) { + xCAT::MsgUtils->perf_log_process('plugin', $req, "modname:$modname"); + } $parent_fd = $org_parent_fd; if ($sock) { close($parent_fd); @@ -2689,6 +2714,9 @@ sub service_connection { $req = get_request($sock, $globalencode, $line); unless ($req) { last; } + if ($enable_perf) { + xCAT::MsgUtils->perf_log_process('immediate', $req); + } # ----used for command log start---------- $cmdlog_starttime = time(); my ($sec, $min, $hour, $mday, $mon, $year) = localtime($cmdlog_starttime); From dd91546a8497bd7ca351defd763591ef34d70ae6 Mon Sep 17 00:00:00 2001 From: ertaozh Date: Thu, 18 May 2017 02:52:28 -0400 Subject: [PATCH 048/129] Modify release information for 2.13.4 --- docs/source/overview/xcat2_release.rst | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/docs/source/overview/xcat2_release.rst b/docs/source/overview/xcat2_release.rst index 18b27871b..21a39166b 100644 --- a/docs/source/overview/xcat2_release.rst +++ b/docs/source/overview/xcat2_release.rst @@ -14,11 +14,19 @@ 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.3 |- RHEL 6.9 | |- OpenBMC support(experimental): | +|| 2017/4/14 | | | | +|| | | | rpower rcons | +| `2.13.3 Release Notes `_ | | | | | | | | | +---------------------------------+---------------+-------------+----------------------------------+ From 6c8002cddde6d0a4fc5136498a25f65d4cf3b17e Mon Sep 17 00:00:00 2001 From: Weihua Hu Date: Thu, 18 May 2017 15:05:48 +0800 Subject: [PATCH 049/129] [DO NOT MERGE] Refine xcattest script (#3048) * Simplify xcattest usage * Modify usage depending on Mark's comments --- xCAT-test/xcattest | 2444 +++++++++++++++++++++++++------------------- 1 file changed, 1400 insertions(+), 1044 deletions(-) diff --git a/xCAT-test/xcattest b/xCAT-test/xcattest index 30e940801..6c7f0b5d8 100755 --- a/xCAT-test/xcattest +++ b/xCAT-test/xcattest @@ -14,292 +14,650 @@ BEGIN $::XCATROOT = $ENV{'XCATROOT'} ? $ENV{'XCATROOT'} : -d '/opt/xcat' ? '/opt/xcat' : '/usr'; } use lib "$::XCATROOT/lib/perl"; -my $rootdir = "$::XCATROOT/share/xcat/tools/autotest"; -my $needhelp = 0; -my $configinfo = undef; -my $configfile = undef; -my $casedir = "$rootdir/testcase"; -my $bundledir = "$rootdir/bundle"; -my $resultdir = "$rootdir/result"; -my $bundlelist = undef; -my $caselist = undef; -my $cmdlist = undef; -my $showbundlesorcommands = undef; -my $needshow = 0; -my $restore = 0; -my $ret = 0; -my $string1 = undef; -my $showbundlefiles = 0; -my $showcommandslist = 0; -my $stop_to_keep_env = 0; -#----------------------------------- -=head1 - System label usage: - In order to make install xCAT to be the first case for automation daily regression, "System" label is used in this xcattest command. - xcattest -f /opt/xcat/share/xcat/tools/autotest/default.conf:System -t install_xCAT_on_rhels_sles - xcattest -f /opt/xcat/share/xcat/tools/autotest/default.conf:System -t install_xCAT_on_ubuntu - System label means only the [System] aspect will be loaded and no other inital action will be done. -=cut +#--------------global attributes---------------- +my $prpgram_path = dirname(File::Spec->rel2abs(__FILE__)); +my $program_name = basename($0); +my $rootdir = "$prpgram_path/../share/xcat/tools/autotest"; +my $casedir = "$rootdir/testcase/"; +my $bundledir = "$rootdir/bundle/"; +my $resultdir = "$rootdir/result/"; +my $rst = 0; +my $setup_env_by_config_file = 1; +my $stop_to_keep_env = 0; -#----------------------------------- -my $initallabel = undef; -my $loadsysteminfo = "System"; +#Array to save all cases planed to handle +#these cases can be passed by option -b/-t/-c +#if without value passed by option -b/-t/-c, for "show information" function, +#the search scope is the all cases shipped by xcat_test package +my @cases_to_be_run = (); -#Create result directory -mkdir $resultdir unless -d $resultdir; - -# create a log for xcattest -my $timestamp = `date +"%Y%m%d%H%M%S"`; -open(LOG, ">$resultdir/xcattest.log.$timestamp") - or die "Can't open logfile for writing: $!"; - -if ( - !GetOptions("h|?" => \$needhelp, - "f=s" => \$configinfo, - "b=s" => \$bundlelist, - "t=s" => \$caselist, - "c=s" => \$cmdlist, - "s=s" => \$showbundlesorcommands, - "l" => \$needshow, - "restore" => \$restore) - ) -{ - &usage; - exit 1; -} - -if ($needhelp) -{ - &usage; - exit 0; -} - - -if (&checkoptions) -{ - &usage; - exit 1; -} - -#show bundle files under $bundledir with .bundle as file suffix -my %bundlefilesinfo = (); -if ($showbundlefiles) -{ - &listbundlefiles; - exit 0; -} - -#show commands, which is the folder name $casedir, with case* files and test cases -if ($showcommandslist) -{ - &listcommands; - exit 0; -} - -#load case to $cases -# key type -#$cases[x](x>0): hash -# name string -# os:AIX/Linux string -# arch:ppc64/x386 string -# hcp:hmc/mm/bmc/fsp string -# cmd: array -# check: array - -my @cases = (); -if ($needshow) { - &loadcase; - exit 0; -} - - -# create a log for run test cases -&log_this("xCAT automated test started at " . scalar(localtime())); -open(LOG_ERR, ">$resultdir/failedcases.$timestamp") - or die "Can't open error logfile for writing: $!"; - -#read config file -log_this("******************************"); -log_this("Reading Configure"); -log_this("******************************"); +#A hash to save the contect of config file +#The structure of %config #config{object}{type}{name}{attr} #config{table}{name}{entry}{key} #config{script_prev}->[] #config{script_post}->[] #config{var}{varname} my %config = (); -$ret = &getConfig; -if ($ret != 0) { - goto EXIT; + +#Array of hash, to save the information of case +my @cases = (); +my %case_name_index_map; + +#when loading cases, NORUN means just load case without attribute replacement. +#this is used for "show information" function +my $NORUN = 0; +my $RUN = 1; + +#----------global logs attributes--------------- +my $running_log_fd = undef +my $running_log_name = undef; +my $failed_log_name = undef; +my $performance_log_name = undef; + +#--------------command line attrbutes-------------- +my $needhelp = 0; +my $configfile = undef; +my $bundlelist = undef; +my $caselist = undef; +my $cmdlist = undef; +my $list = undef; +my $restore = 0; +my $quiet = 0; + +#-------------usage-------------------- +$::USAGE = "Usage: +To get help: + $program_name -h + +To list the information about all cases shipped by xcat test package + $program_name -l {caselist|caseinfo|casenum} +To list the information about all bunldes shipped by xcat test package + $program_name -l bundleinfo +To list the information about cases in specific bundles + $program_name -l {caselist|caseinfo|casenum} -b +To list the information about cases related to specific commands + $program_name -l {caselist|caseinfo|casenum} -c +To list the information about specific cases + $program_name -l {caselist|caseinfo|casenum} -t + +To run test cases in specific bundles + $program_name [-f {configure_file|configure_file:System}] -b [-r] [-q] +To run specific test cases + $program_name [-f {configure_file|configure_file:System}] -t [-r] [-q] +To run all cases related to specific commands + $program_name [-f {configure_file|configure_file:System}] -c [-r] [-q] + +Options: + -h : Get $program_name usage information. + -l : list specific information. The valid options are caselist,caseinfo,casenum,bundleinfo + -f : specify the configuration file. If 'System' tag is used, only [System] section in the configuration file will be used. If 'System' is not used all other sections of the configuration file will be used, like [Table], [Object], etc. + -c : Comma separated list of command names to test. + -t : Comma separated list of test case names to test. + -b : Comma separated list of bundle names to test. If a bundle name is specified without an absolute path, bundles under $bundledir will be searched + -r : Back up the original environment settings before running test, and restore them after running test. + -q : Just record all the output of $program_name into log file under $resultdir, not print to STDOUT. Print to STDOUT by default. +"; + +#============================================================================================== +# main process +#============================================================================================== +$rst = pro_init(); +if ($rst) { + print "Program $program_name initialization failed to exit.\n"; + to_exit(1); } -#if not only load System aspects from config file, then init test enviroment -if (!defined($initallabel)){ - log_this("******************************"); - log_this("Initialize xCAT test evironment"); - log_this("******************************"); - $ret = &init; - if ($ret != 0) { - goto EXIT; +if ( + !GetOptions("h" => \$needhelp, + "f=s" => \$configfile, + "b=s" => \$bundlelist, + "t=s" => \$caselist, + "c=s" => \$cmdlist, + "l=s" => \$list, + "q" => \$quiet, + "r" => \$restore) + ) +{ + log_this($running_log_fd, "$::USAGE"); + to_exit(1); +} + +if ($needhelp) { + log_this($running_log_fd, "$::USAGE"); + to_exit(0); +} + +my $error; +$rst = check_option_validity(\$error); +if ($rst) { + log_this($running_log_fd, "$error", "$::USAGE"); + to_exit(1); +} + +$rst = calculate_cases_to_be_run(\@cases_to_be_run, \$error); +if ($rst) { + log_this($running_log_fd, "$error"); + to_exit(1); +} + +#print "----case to be run-----------------\n"; +#print Dumper \@cases_to_be_run; + +if ($list) { + if ($list eq "caselist") { + if (@cases_to_be_run) { + + #list the cases indicated by option -b,-c,-t + foreach (@cases_to_be_run) { + log_this($running_log_fd, "$_"); + } + } else { + + #list the cases shipped by xcat test package + $rst = load_case(\@cases_to_be_run, \@cases, \%case_name_index_map, \$error, $NORUN); + if ($rst) { + log_this($running_log_fd, "$error"); + } + foreach my $case (@cases) { + log_this($running_log_fd, "$case->{name}"); + } + } + } elsif ($list eq "caseinfo") { + $rst = show_case_info(\@cases_to_be_run, \$error); + if ($rst) { + log_this($running_log_fd, "$error"); + to_exit(1); + } + } elsif ($list eq "casenum") { + if (@cases_to_be_run) { + + #list the case number indicated by option -b,-c,-t + my $casenum = @cases_to_be_run; + log_this($running_log_fd, "$casenum"); + } else { + + #list the case number shipped by xcat test package + $rst = load_case(\@cases_to_be_run, \@cases, \%case_name_index_map, \$error, $NORUN); + if ($rst) { + log_this($running_log_fd, "$error"); + } + my $casenum = @cases; + log_this($running_log_fd, "$casenum"); + } + } elsif ($list eq "bundleinfo") { + + #list the bundle information shipped by xcat test package + $rst = show_bundle_info(\$error); + if ($rst) { + log_this($running_log_fd, "$error"); + to_exit(1); + } + } + to_exit(0); +} + +unless (@cases_to_be_run) { + log_this($running_log_fd, "Please indicate the cases to run by option -b,-c,-t"); + to_exit(1); +} + +if (defined($configfile) && ($configfile =~ /(.*):(System)/)) { + $configfile = $1; + $setup_env_by_config_file = 0; +} + +log_this($running_log_fd, "xCAT automated test started at " . scalar(localtime())); +if (defined($configfile)) { + log_this($running_log_fd, "******************************"); + log_this($running_log_fd, "loading Configure file"); + log_this($running_log_fd, "******************************"); + $rst = load_config_file($configfile, \%config, \$error); + if ($rst) { + log_this($running_log_fd, "$error"); + to_exit(1); + } +} else { + $setup_env_by_config_file = 0; +} + +if ($restore) { + log_this($running_log_fd, "******************************"); + log_this($running_log_fd, "Backup current xCAT database"); + log_this($running_log_fd, "******************************"); + $rst = bakup_current_env(\$error); + if ($rst) { + log_this($running_log_fd, "$error"); + to_exit(1); } } -my @filespath = (); -#loading and check cases -log_this("******************************"); -log_this("loading test cases"); -log_this("******************************"); -$ret = &loadcase; -if ($ret != 0) { - goto EXIT; +if ($setup_env_by_config_file) { + log_this($running_log_fd, "******************************"); + log_this($running_log_fd, "Initialize xCAT test environment by definition in configure file"); + log_this($running_log_fd, "******************************"); + $rst = setup_env_by_configure_file(\%config, \$error); + if ($rst) { + log_this($running_log_fd, "$error"); + to_exit(1); + } } -#run case -log_this("******************************"); -log_this("Start to run test cases"); -log_this("******************************"); -&reordercases if (defined($bundlelist) || defined($caselist)); -&runcase; +log_this($running_log_fd, "******************************"); +log_this($running_log_fd, "loading test cases"); +log_this($running_log_fd, "******************************"); +$rst = load_case(\@cases_to_be_run, \@cases, \%case_name_index_map, \$error, $RUN); +if ($rst) { + log_this($running_log_fd, "$error"); + to_exit(1); +} + +#print "======Dumper loaded cases=======\n"; +#print Dumper \@cases; +#print "=====Dumper case_name_index_map=======================\n"; +#print Dumper \%case_name_index_map; + +log_this($running_log_fd, "******************************"); +log_this($running_log_fd, "Start to run test cases"); +log_this($running_log_fd, "******************************"); +$rst = run_case(\@cases_to_be_run, \@cases, \%case_name_index_map, \$error); +if ($rst) { + log_this($running_log_fd, "$error"); + to_exit(1); +} -EXIT: -log_this("******************************"); -log_this("un-initialize xCAT test evironment"); -log_this("******************************"); if ($restore) { - &uninit; + log_this($running_log_fd, "******************************"); + log_this($running_log_fd, "restore xCAT test evironment"); + log_this($running_log_fd, "******************************"); + $rst = restore_current_env(\$error); + if ($rst) { + log_this($running_log_fd, "$error"); + to_exit(1); + } } -&log_this("\nxCAT automated test finished at " . scalar(localtime())); -&log_this("Please check results in the $resultdir, \nand see $resultdir/failedcases.$timestamp file for failed cases.\nsee $resultdir/performance.report.$timestamp file for time consumption"); -close(LOG); -close(LOG_ERR); -my $reportfile = "$resultdir/performance.report.$timestamp"; -my $tmpreport = "$resultdir/xcattest.log.$timestamp"; -&getreport($tmpreport, $reportfile); +log_this($running_log_fd, "xCAT automated test finished at" . scalar(localtime())); +log_this($running_log_fd, "Please check results in the $resultdir, \nand see $failed_log_name file for failed cases."); + +#To generate performance report +$rst = generate_performance_report($running_log_name, $performance_log_name, \$error); +if ($rst) { + log_this($running_log_fd, "$error"); + to_exit(1); +} +log_this($running_log_fd, "see $performance_log_name file for time consumption"); if ($stop_to_keep_env) { - exit 1; + to_exit(1); } else { - exit 0; + to_exit(0); } -# end main -# -# logger -# +#============================================================================================== +# sub function implementation +#============================================================================================== -sub log_this -{ - print LOG join("\n", @_), "\n"; +#-------------------------------------------------------- +# Fuction name: log_this +# Description: print message to log file and STDOUT. +# Set '-q' option in command line, just print message to log file +# Atrributes: $logdf: the file description of openning log file +# Retrun code: 0 Success 1 Failed +#-------------------------------------------------------- +sub log_this { + my $logdf = shift; my $msg = join("\n", @_); - if ($msg =~ /\[Pass\]/) { - print color("green"), "$msg\n", color("reset"); - } elsif ($msg =~ /\[Failed\]/) { - print color("red"), "$msg\n", color("reset"); - } else { - print "$msg\n"; - } -} -sub log_error -{ - print LOG_ERR join("\n", @_), "\n"; -} - -sub include_file -{ - my $file = shift; - my $idir = shift; - my @text = (); - unless ($file =~ /^\//) { - $file = $idir . "/" . $file; - } - open(INCLUDE, $file) || return "#INCLUDEBAD:cannot open $file#"; - while () { - chomp($_); - s/\s+$//; #remove trailing spaces - next if /^\s*$/; #-- skip empty lines - push(@text, $_); - } - close(INCLUDE); - return join(",", @text); -} - -sub sort_caserange -{ - my @caserange = @_; - my $bundletext = join(',', @caserange); - #handle the #INLCUDE# tag recursively - my $idir = "$rootdir/bundle"; - my $doneincludes = 0; - while (not $doneincludes) { - $doneincludes = 1; - if ($bundletext =~ /#INCLUDE:[^#^\n]+#/) { - $doneincludes = 0; - $bundletext =~ s/#INCLUDE:([^#^\n]+)#/include_file($1,$idir)/eg; + #print message to STDOUT + if (!$quiet) { + if ($msg =~ /\[Pass\]/) { + print color("green"), "$msg\n", color("reset"); + } elsif ($msg =~ /\[Failed\]/) { + print color("red"), "$msg\n", color("reset"); + } else { + print "$msg\n"; } } - @caserange=split(",",$bundletext); - my @diff; - foreach my $case (@caserange) { - unless (grep { $_ eq $case } @diff) { - push @diff, $case; - } - } - my %index; - my @same = grep($index{$_}++, @caserange); - my @error =grep /INCLUDEBAD/, @caserange; - return (\@diff, \@same, \@error); + + #record message to log file + print $logdf "$msg\n"; + + return 0; } -sub getConfig -{ - my $type = undef; #Script_Prev,Script_Post,Table,Object,System,Custom - my $sub_type = undef; # The string after $type_ - # Script--> - # Script_Prev - # Script_Post - # Table---> - # Table_xxxxx - # Object--> - # Object_xxxx - # System----> - # Custom----> +#-------------------------------------------------------- +# Fuction name: pro_init +# Description: Do program initialization +# Atrributes: +# Retrun code: 0 Success 1 Failed +#-------------------------------------------------------- +sub pro_init { + mkpath("$resultdir") unless (-d "$resultdir"); - my $name = undef; - my $attr = undef; - my $value = undef; - my $c = 0; - my $cmd = undef; - my $mgt_name = undef; - - if (!open(FILE, "$configfile")) { - log_this("Error: can't open xCAT config file: $configfile"); - return 1; - } - - #Only load System information - if (defined($initallabel) && ($initallabel eq $loadsysteminfo)) { - while (my $line = ) { - $line = &trim($line); - next if (length($line) == 0); + my $timestamp = `date +"%Y%m%d%H%M%S"`; + chomp($timestamp); + $running_log_name = "$resultdir/xcattest.log.$timestamp"; + if (!open($running_log_fd, ">$running_log_name")) { + print "Failed to generate running log file for $program_name: $!\n"; + return 1; + } - #Only read System variable - if ($line =~ /\[System\]/) { - $type = "Varible"; - } - if (defined($type) && ($type eq "Varible")) { - if ($line =~ /(\w+)\s*=\s*([\w\.\-\+\/:]+)/) { - $config{var}{$1} = $2; + $failed_log_name = "$resultdir/failedcases.$timestamp"; + $performance_log_name = "$resultdir/performance.report.$timestamp"; + return 0; +} + +#-------------------------------------------------------- +# Fuction name: calculate_cases_to_be_run +# Description: calculate the case scope to be handle depending on option -b,-c,-t +# Atrributes: +# $cases_to_be_run_ref (output attribe) +# The reference of array to save the cases to be handled +# $error_ref (output attribe) +# The reference of scalar to save the error message generated during running current function +# Retrun code: 0 Success 1 Failed +#------------------------------------------------------- +sub calculate_cases_to_be_run { + my $cases_to_be_run_ref = shift; + my $error_ref = shift; + + my $fd = undef; + my @cases = (); + + $$error_ref = ""; + if ($bundlelist) { + my @bundles = split(",", $bundlelist); + foreach my $bundle (@bundles) { + + #if $bundle doesn't include path information, find $bundle under $bundledir by default + my $bundlepath = dirname($bundle); + if ($bundlepath eq ".") { + $bundle = "$bundledir/$bundle"; + } + if (!-e "$bundle") { + $$error_ref = "There isn't file $bundle\n"; + last; + } + if (!open($fd, "$bundle")) { + $$error_ref = "Can't open file $bundle:$!\n"; + last; + } + while (my $line = <$fd>) { + chomp($line); + $line =~ s/#.+//g if ($line =~ "#" && $line !~ "^#INCLUDE"); + $line =~ s/^\s+|\s+$//g; + next if ((length($line) == 0) || ($line =~ /^description\s*:\s*(.*)/)); + push(@cases, $line); + } + close($fd); + } + + return 1 if (length($$error_ref) != 0); + + #to handle "#INCLUDE:XXXXXXX#" line + my $casetxt = join(',', @cases); + for (; ;) { + if ($casetxt =~ /#INCLUDE:[^#^\n]+#/) { + $casetxt =~ s/#INCLUDE:([^#^\n]+)#/expend_include_file($1)/eg; + } else { + last; + } + } + @cases = split(",", $casetxt); + + my @error = grep /INCLUDEBAD/, @cases; + if (@error) { + $$error_ref = join("\n", @error); + return 1; + } + @{$cases_to_be_run_ref} = @cases; + } elsif ($caselist) { + @cases_to_be_run = split(",", $caselist); + } elsif ($cmdlist) { + my @cmds = split /,/, $cmdlist; + my @files = (); + my @cmdfiles = (); + get_files_recursive("$casedir", \@files); + for (my $countfile = 0 ; $countfile < @files ; $countfile++) { + for (my $countcmd = 0 ; $countcmd < @cmds ; $countcmd++) { + if ($files[$countfile] =~ m/\/$cmds[$countcmd]\/case/) { + push(@cmdfiles, glob("$files[$countfile]")); } - } - } - }else{ - #Load all config files information - while (my $line = ) { - $line = &trim($line); + } + } + + my $fd = undef; + foreach my $file (@cmdfiles) { + if (!open($fd, "<$file")) { + $$error_ref = "can't open $file:$!"; + return 1; + } + while (my $line = <$fd>) { + $line =~ s/^\s+|#[^!].+|\s+$//g; + + #skip blank and comment lines + next if (length($line) == 0 || ($line =~ /^\s*#/)); + if ($line =~ /^start\s*:\s*(.*)/) { + push @{$cases_to_be_run_ref}, $1; + } + } + close($fd); + } + } + return 0; +} + + +#-------------------------------------------------------- +# Fuction name: expend_include_file +# Description: To support '#INCLUDE" label in bundle file, to expend the include file +# Atrributes: $bundle (input attribute): the name of bundle +# Retrun code: 0 Success 1 Failed +#-------------------------------------------------------- +sub expend_include_file { + my $bundle = shift; + + my $fd = undef; + my $bundlepath = dirname($bundle); + my @cases = (); + + if ($bundlepath eq ".") { + $bundle = "$bundledir/$bundle"; + } + if (!-e "$bundle") { + return "#INCLUDEBAD:cannot find $bundle#"; + } + if (!open($fd, "<$bundle")) { + return "#INCLUDEBAD:cannot open $bundle $!#"; + } + while (my $line = <$fd>) { + chomp($line); + $line =~ s/#.+//g if ($line =~ "#" && $line !~ "^#INCLUDE"); + $line =~ s/^\s+|\s+$//g; + next if ((length($line) == 0) || ($line =~ /^description\s*:\s*(.*)/)); + push(@cases, $line); + } + close($fd); + return join(",", @cases); +} + +#-------------------------------------------------------- +# Fuction name: to_exit +# Description: customize exit function, include clean up environment +# Atrributes: +# Retrun code: +#-------------------------------------------------------- +sub to_exit { + my $exit_code = shift; + close($running_log_fd) if (defined $running_log_fd); + &runcmd("rm -rf /tmp/xCATdbbackup") if (-d "/tmp/xCATdbbackup"); + exit $exit_code; +} + + +#-------------------------------------------------------- +# Fuction name: check_option_validity +# Description: check the validity of command line +# Atrributes: +# $error_ref (output attribe) +# The reference of scalar to save the error message generated during running current function +# Retrun code: 0 Success 1 Failed +#-------------------------------------------------------- +sub check_option_validity { + my $error_ref = shift; + + if ($list) { + my @vaild_list_method = (); + if ($bundlelist || $caselist || $cmdlist) { + @vaild_list_method = ("caselist", "caseinfo", "casenum"); + } else { + @vaild_list_method = ("caselist", "caseinfo", "casenum", "bundleinfo"); + } + if (!(grep { /^$list$/ } @vaild_list_method)) { + $$error_ref = "Unsupport list method for option l"; + return 1; + } + } + + return 0; +} + + +#-------------------------------------------------------- +# Fuction name: show_case_info +# Description: to show case name and description +# Atrributes: +# $cases_to_be_run_ref (input attribe) +# The reference of array to save the cases to be handled +# $error_ref (output attribe) +# The reference of scalar to save the error message generated during running current function +# Retrun code: 0 Success 1 Failed +#-------------------------------------------------------- +sub show_case_info { + my $cases_to_be_run_ref = shift; + my $error_ref = shift; + + my @cases = (); + my %case_name_index_map; + my $rst = load_case($cases_to_be_run_ref, \@cases, \%case_name_index_map, $error_ref, $NORUN); + if ($rst) { + return 1; + } + + #print Dumper \@cases; + my %caseinfo; + my $case_num = @{$cases_to_be_run_ref}; + if ($case_num) { + foreach my $case (@{$cases_to_be_run_ref}) { + my $casedes = "without description"; + $casedes = $cases[ $case_name_index_map{$case} ]->{description} if ($cases[ $case_name_index_map{$case} ]->{description}); + $caseinfo{$case} = $casedes; + } + } else { + foreach my $case (@cases) { + my $casedes = "without description"; + $casedes = $case->{description} if ($case->{description}); + $caseinfo{ $case->{name} } = $casedes; + } + } + print_table(\%caseinfo); + return 0; +} + + +#-------------------------------------------------------- +# Fuction name: show_bundle_info +# Description: show bundle name and description +# Atrributes: +# $error_ref (output attribe) +# The reference of scalar to save the error message generated during running current function +# Retrun code: 0 Success 1 Failed +#-------------------------------------------------------- +sub show_bundle_info { + my $error_ref = shift; + + my %bundleinfo; + my $dd = undef; + my @bundlefiles = (); + if (!opendir(DIR, $bundledir)) { + $$error_ref = "Can't open directory $bundledir: $!"; + return 1; + } + my @files = readdir(DIR); + foreach my $file (@files) { + next if (-d $file); + next if ($file =~ /^\./); + push(@bundlefiles, $file); + } + closedir(DIR); + + foreach my $bundlefile (@bundlefiles) { + $bundleinfo{$bundlefile} = "without description"; + } + my $fd = undef; + foreach my $bundlefile (@bundlefiles) { + if (!open($fd, "< $bundledir$bundlefile")) { + $$error_ref = "Can't open bundle file $bundledir$bundlefile $!"; + return 1; + } + while (my $line = <$fd>) { + $line =~ s/^\s+|#.+|\s+$//g; + if ($line =~ /^description\s*:\s*(.*)/) { + $bundleinfo{$bundlefile} = $1; + last; + } + } + close($fd); + } + + print_table(\%bundleinfo); + return 0; +} + +#-------------------------------------------------------- +# Fuction name: load_config_file +# Description: load config file indicated by option -f +# Atrributes: +# $configfile (input attribute) +# The config file name +# $config_ref (output attribute) +# The reference of a hash to save the contect of config file +# The hash %config is a global attribute. +# The structure of %config: +# config{object}{type}{name}{attr} +# config{table}{name}{entry}{key} +# config{script_prev}->[] +# config{script_post}->[] +# config{var}{varname} +# $error_ref (output attribe) +# The reference of scalar to save the error message generated during running current function +# Retrun code: 0 Success 1 Failed +#-------------------------------------------------------- +sub load_config_file { + my $configfile = shift; + my $config_ref = shift; + my $error_ref = shift; + + my $type = undef; + my $sub_type = undef; + my $name = undef; + my $attr = undef; + my $value = undef; + my $c = 0; + my $cmd = undef; + my $mgt_name = undef; + my $fd = undef; + + if (!open($fd, "$configfile")) { + $$error_ref = "Error: can't open xCAT config file $configfile: $!"; + return 1; + } + + while (my $line = <$fd>) { + $line =~ s/^\s+|#.+|\s+$//g; next if (length($line) == 0); #Table name can not contain "_" @@ -315,11 +673,11 @@ sub getConfig if ($line =~ /(\w+)\s*=\s*([\w\.\-]+)/) { $attr = $1; $value = $2; - if ($name && ($config{table}{$sub_type}{$name}{__KEY__} ne $attr)) { - $config{table}{$sub_type}{$name}{$attr} = $value; + if ($name && ($$config_ref{table}{$sub_type}{$name}{__KEY__} ne $attr)) { + $$config_ref{table}{$sub_type}{$name}{$attr} = $value; } else { $name = $value; - $config{table}{$sub_type}{$name}{__KEY__} = $attr; + $$config_ref{table}{$sub_type}{$name}{__KEY__} = $attr; } } } elsif ($type eq "Object") { @@ -330,644 +688,498 @@ sub getConfig if ($attr eq "Name") { $name = $value; } elsif (!defined($name)) { - print "Please give name for Object\n"; - close FILE; + $$error = "Please give name for Object section"; + close($fd); return 1; } else { - $config{object}{$sub_type}{$name}{$attr} = $value; + $$config_ref{object}{$sub_type}{$name}{$attr} = $value; } } } elsif ($type eq "Script") { ##SCRIPT_BLOCK## if ($sub_type eq "Prev") { - $config{script_prev}->[$c] = $line; + $$config_ref{script_prev}->[$c] = $line; $c = $c + 1; } elsif ($sub_type eq "Post") { - $config{script_post}->[$c] = $line; + $$config_ref{script_post}->[$c] = $line; $c = $c + 1; } } elsif ($type eq "Varible") { ##NODE_BLOCK## if ($line =~ /(\w+)\s*=\s*([\w\.\-\+\/:]+)/) { - $config{var}{$1} = $2; + $$config_ref{var}{$1} = $2; } } } -} - if (exists $config{object}) { - foreach my $type (keys %{ $config{object} }) { - foreach my $name (keys %{ $config{object}{$type} }) { - log_this("OBJECT:$name,TYPE:$type"); - foreach my $attr (keys %{ $config{object}{$type}{$name} }) { - log_this(" $attr = $config{object}{$type}{$name}{$attr};"); + if (exists $$config_ref{object}) { + foreach my $type (keys %{ $$config_ref{object} }) { + foreach my $name (keys %{ $$config_ref{object}{$type} }) { + log_this($running_log_fd, "OBJECT:$name,TYPE:$type"); + foreach my $attr (keys %{ $$config_ref{object}{$type}{$name} }) { + log_this($running_log_fd, " $attr = $$config_ref{object}{$type}{$name}{$attr};"); } } } } - if (exists $config{table}) { - foreach my $type (keys %{ $config{table} }) { - log_this("TABLE:$type"); - foreach my $name (keys %{ $config{table}{$type} }) { - log_this(" $config{table}{$type}{$name}{__KEY__} = $name"); - foreach my $attr (keys %{ $config{table}{$type}{$name} }) { + if (exists $$config_ref{table}) { + foreach my $type (keys %{ $$config_ref{table} }) { + log_this($running_log_fd, "TABLE:$type"); + foreach my $name (keys %{ $$config_ref{table}{$type} }) { + log_this($running_log_fd, " $$config_ref{table}{$type}{$name}{__KEY__} = $name"); + foreach my $attr (keys %{ $$config_ref{table}{$type}{$name} }) { if ($attr ne '__KEY__') { - log_this(" $attr = $config{table}{$type}{$name}{$attr}"); + log_this($running_log_fd, " $attr = $$config_ref{table}{$type}{$name}{$attr}"); } } - log_this("\n"); } } } - if (exists $config{script_prev}) { - log_this("Script_Prev:"); - foreach $cmd (@{ $config{script_prev} }) { - log_this(" $cmd"); + if (exists $$config_ref{script_prev}) { + log_this($running_log_fd, "Script_Prev:"); + foreach $cmd (@{ $$config_ref{script_prev} }) { + log_this($running_log_fd, " $cmd"); } } - if (exists $config{script_post}) { - log_this("Script_Post:"); - foreach $cmd (@{ $config{script_post} }) { - log_this(" $cmd"); + if (exists $$config_ref{script_post}) { + log_this($running_log_fd, "Script_Post:"); + foreach $cmd (@{ $$config_ref{script_post} }) { + log_this($running_log_fd, " $cmd"); } } - if (exists $config{var}) { - log_this("Varible:"); - foreach my $varname (keys %{ $config{var} }) { - log_this(" $varname = $config{var}{$varname}"); + if (exists $$config_ref{var}) { + log_this($running_log_fd, "Varible:"); + foreach my $varname (keys %{ $$config_ref{var} }) { + log_this($running_log_fd, " $varname = $$config_ref{var}{$varname}"); } } - close FILE; + close($fd); return 0; } -sub init -{ - if ($restore) { - log_this("******************************"); - log_this("Backup current xCAT database"); - log_this("******************************"); - &runcmd("mkdir -p /tmp/xCATdbbackup"); - &runcmd("dumpxCATdb -p /tmp/xCATdbbackup"); - if ($::RUNCMD_RC != 0) { - &log_this("Fail to backup xCAT database"); - &runcmd("rm -rf /tmp/xCATdbbackup"); - $restore = 0; +#-------------------------------------------------------- +# Fuction name: load_case +# Description: load test case +# Atrributes: +# $cases_to_be_run_ref (input attribe) +# The reference of array to save the cases to be handled +# $case_ref (input attribe) +# The reference of a array of hash to save the contect of case +# The array @cases is a global attribute. +# The struture of @cases are: +# $cases[index]->{name} +# $cases[index]->{os} +# $cases[index]->{arch} +# $cases[index]->{hcp} +# $cases[index]->{type} +# $cases[index]->{stop} +# $cases[index]->{description} +# $cases[index]->{attribute} +# $cases[index]->{cmd}->[index][index] +# $cases[index]->{check}->[index][index] +# $cases[index]->{cmdcheck}->[index][index] +# $case_name_index_map_ref (input attribute) +# The reference of a hash to save the mapping of test name ane its index in @cases +# Due to there maybe is more than one implementation for one case +# $error_ref (output attribe) +# The reference of scalar to save the error message generated during running current function +# $run_case_flag (input attribute) +# The flag of whether run these case nex. +# 0 means no, just load case basic information, used by "searching informaiotn funtion of xcattest" +# 1 means yes, load case basic information and parse the attribure at the sametime. used by "run case funtion of xcattest" +# Retrun code: 0 Success 1 Failed +#-------------------------------------------------------- +sub load_case { + my $cases_to_be_run_ref = shift; + my $case_ref = shift; + my $case_name_index_map_ref = shift; + my $error_ref = shift; + my $run_case_flag = shift; + + #if @{$cases_to_be_run_ref} is empty, that means not indicate test case scope by command line option -b,-t,-c + #load all cases shipped by xcat test package + my $load_all_case_flag = 0; + my $case_num = @{$cases_to_be_run_ref}; + $load_all_case_flag = 1 if ($case_num == 0); + + my @files = (); + get_files_recursive("$casedir", \@files); + + my $line; + my $i = 0; + my $j = -1; + my $z = 0; + my $m = 0; + my $newcmdstart = 0; + my $skip = 0; + my $fd = undef; + + my %invalidcases; + foreach my $file (@files) { + if (!open($fd, "<$file")) { + $$error_ref = "Can't open $file: $!"; return 1; } - } - my $cmd = undef; - foreach $cmd (@{ $config{script_prev} }) { - log_this("$cmd"); - &runcmd($cmd); - if ($::RUNCMD_RC != 0) { - &log_this("Fail to run $cmd"); - return 1; - } - } - if (exists $config{object}) { - foreach my $type (keys %{ $config{object} }) { - foreach my $name (keys %{ $config{object}{$type} }) { - $cmd = "chdef -t $type -o $name"; - foreach my $attr (keys %{ $config{object}{$type}{$name} }) { - $cmd = $cmd . " $attr=$config{object}{$type}{$name}{$attr}"; - } - log_this($cmd); - runcmd($cmd); - if ($::RUNCMD_RC != 0) { - log_this("Fail to run $cmd"); - return 1; - } - } - } - } - if (exists $config{table}) { - foreach my $type (keys %{ $config{table} }) { - foreach my $name (keys %{ $config{table}{$type} }) { - $cmd = "chtab $config{table}{$type}{$name}{__KEY__}=$name"; - foreach my $attr (keys %{ $config{table}{$type}{$name} }) { - if ($attr ne '__KEY__') { - $cmd = $cmd . " $type.$attr=$config{table}{$type}{$name}{$attr}"; + while ($line = <$fd>) { + $line =~ s/^\s+|#[^!].+|\s+$//g; + + #skip blank and comment lines + next if (length($line) == 0 || ($line =~ /^\s*#/)); + + if ($line =~ /^start\s*:\s*(.*)/) { + my $name = $1; + if ($load_all_case_flag) { + if (is_valid_case_name($name)) { + $skip = 0; + $j = -1; + $case_ref->[$i] = {}; + $case_ref->[$i]->{name} = $name; + $case_ref->[$i]->{filename} = $file; + $$case_name_index_map_ref{"$name"} = $i; + $newcmdstart = 0; + } else { + $skip = 1; + push @{ $invalidcases{"invalidcasename"} }, $name; + } + } else { + if (!(grep { /^$name$/ } @{$cases_to_be_run_ref})) { + $skip = 1; + next; + } else { + if (is_valid_case_name($name)) { + $skip = 0; + $j = -1; + $case_ref->[$i] = {}; + $case_ref->[$i]->{name} = $name; + $case_ref->[$i]->{filename} = $file; + $$case_name_index_map_ref{"$name"} = $i; + $newcmdstart = 0; + } else { + $skip = 1; + push @{ $invalidcases{"invalidcasename"} }, $name; + } } } - log_this($cmd); - &runcmd($cmd); - if ($::RUNCMD_RC != 0) { - &log_this("Fail to run $cmd"); - return 1; + } elsif ($line =~ /^os\s*:\s*(\w[\w\,]+)/) { + next if $skip; + $case_ref->[$i]->{os} = $1; + + if ($run_case_flag) { + + #To judge whether need to skip the current case + my @validoslist = split(",", $case_ref->[$i]->{os}); + my @newvalidoslist = (); + foreach my $validos (@validoslist) { + if ($validos =~ /linux/i) { + push(@newvalidoslist, ("rhel", "sles", "ubnutu")); + } else { + push(@newvalidoslist, $validos); + } + } + + my $currentos = get_current_os(); + my $valid = 0; + foreach my $os (@newvalidoslist) { + if ($currentos =~ /$os/i) { + $valid = 1; + last; + } + } + unless ($valid) { + $skip = 1; + push @{ $invalidcases{"noruncases"} }, $case_ref->[$i]->{name}; + } + } + $newcmdstart = 0; + } elsif ($line =~ /^arch\s*:\s*(\w[\w\,]+)/) { + next if $skip; + $case_ref->[$i]->{arch} = $1; + $newcmdstart = 0; + } elsif ($line =~ /^hcp\s*:\s*(\w[\w\,]+)/) { + next if $skip; + $case_ref->[$i]->{hcp} = $1; + $newcmdstart = 0; + } elsif ($line =~ /^type\s*:\s*(\w[\w\,-]+)/) { + next if $skip; + $case_ref->[$i]->{type} = $1; + $newcmdstart = 0; + } elsif ($line =~ /^stop\s*:\s*(\w[\w\,]+)/) { + next if $skip; + $case_ref->[$i]->{stop} = $1; + $newcmdstart = 0; + } elsif ($line =~ /^description\s*:\s*(.+)/) { + next if $skip; + $case_ref->[$i]->{description} = $1; + $newcmdstart = 0; + } elsif ($line =~ /^attribute\s*:\s*(\w[\w\,]+)/) { + next if $skip; + $case_ref->[$i]->{attribute} = $1; + $newcmdstart = 0; + } elsif ($line =~ /^cmd\s*:\s*([\#\/\$\w].+)/) { + next if $skip; + $newcmdstart = 0; + $j = $j + 1; + $z = 0; + $m = 0; + if ($run_case_flag) { + $case_ref->[$i]->{cmd}->[$j][$m] = getvar($1, \%config); + if ($case_ref->[$i]->{cmd}->[$j][$m] =~ /miss attribute/) { + my $errlog = "$case_ref->[$i]->{name} $case_ref->[$i]->{cmd}->[$j][$m]"; + if (!(grep /$errlog/, @{ $invalidcases{"missattr"} })) { + push @{ $invalidcases{"missattr"} }, $errlog; + } + } + } else { + $case_ref->[$i]->{cmd}->[$j][$m] = $1; + } + $newcmdstart = 1; + } elsif ($line =~ /^check\s*:\s*(\w.+)/) { + next if $skip; + if ($run_case_flag) { + $case_ref->[$i]->{check}->[$j][$z] = getvar($1, \%config); + if ($case_ref->[$i]->{check}->[$j][$z] =~ /miss attribute/) { + my $errlog = "$case_ref->[$i]->{name} $case_ref->[$i]->{check}->[$j][$z]"; + if (!(grep /$errlog/, @{ $invalidcases{"missattr"} })) { + push @{ $invalidcases{"missattr"} }, $errlog; + } + } + } else { + $case_ref->[$i]->{check}->[$j][$z] = $1; + } + $z = $z + 1; + $newcmdstart = 0; + } elsif ($line =~ /^cmdcheck\s*:\s*(\w.+)/) { + next if $skip; + if ($run_case_flag) { + $case_ref->[$i]->{cmdcheck}->[$j][$z] = getvar($1, \%config); + if ($case_ref->[$i]->{cmdcheck}->[$j][$z] =~ /miss attribute/) { + my $errlog = "$case_ref->[$i]->{name} $case_ref->[$i]->{cmdcheck}->[$j][$z]"; + if (!(grep /$errlog/, @{ $invalidcases{"missattr"} })) { + push @{ $invalidcases{"missattr"} }, $errlog; + } + } + } else { + $case_ref->[$i]->{cmdcheck}->[$j][$z] = $1; + } + $z = $z + 1; + $newcmdstart = 0; + } elsif ($line =~ /^end/) { + next if $skip; + $i = $i + 1; + $newcmdstart = 0; + } elsif ($newcmdstart) { + ++$m; + $case_ref->[$i]->{cmd}->[$j][$m] = $line; + } + } + close($fd); + } + + my @wrong_cases = (); + my $caseerror = 0; + if ($invalidcases{"invalidcasename"}) { + + #log_this($running_log_fd, "Case name invalid:", @{ $invalidcases{"invalidcasename"} }); + $$error_ref = "Case name invalid: " . join(",", @{ $invalidcases{"invalidcasename"} }); + push @wrong_cases, @{ $invalidcases{"invalidcasename"} }; + $caseerror = 1; + } + + if ($run_case_flag) { + if ($invalidcases{"missattr"}) { + + #log_this($running_log_fd, "Miss attribute:", @{$invalidcases{"missattr"}}); + $$error_ref = "Miss attribute: " . join(",", @{ $invalidcases{"missattr"} }); + foreach my $line (@{ $invalidcases{"missattr"} }) { + my $name = split(" ", $line); + if (!(grep /$name/, @wrong_cases)) { + push @wrong_cases, $name; } } + $caseerror = 1; } - } - if (!exists $config{var}{OS}) { - my @output = runcmd("uname"); - $config{var}{OS} = $output[0]; - log_this("Detecting: OS = $config{var}{OS}"); - } else { - $config{var}{OS} = lc($config{var}{OS}); - } + if ($invalidcases{"noruncases"}) { + log_this($running_log_fd, "Not to run:", @{ $invalidcases{"noruncases"} }); + push @wrong_cases, @{ $invalidcases{"noruncases"} }; + } - if (!exists $config{var}{ARCH}) { - if (!exists $config{var}{CN}) { - $config{var}{ARCH} = "Unknown"; - log_this("Error: No compute node defined, can't get ARCH of compute node"); - } else { - $config{var}{ARCH} = getnodeattr($config{var}{CN}, "arch"); - if ($config{var}{ARCH} =~ /ppc/) { - $config{var}{ARCH} = 'ppc'; - } elsif ($config{var}{ARCH} =~ /86/) { - $config{var}{ARCH} = 'x86'; + unless ($caseerror) { + my @new_cases_to_be_run = (); + foreach my $c (@{$cases_to_be_run_ref}) { + if (!(grep { /^$c$/ } @wrong_cases)) { + push @new_cases_to_be_run, $c; + } } - log_this("Detecting: ARCH = $config{var}{ARCH}"); + log_this($running_log_fd, "To run:", @new_cases_to_be_run); + @{$cases_to_be_run_ref} = @new_cases_to_be_run; } } - if (!exists $config{var}{HCP}) { - if (!exists $config{var}{CN}) { - $config{var}{HCP} = "Unknown"; - log_this("Error: No compute node defined, can't get HCP TYPE of compute node"); - } else { - $config{var}{HCP} = getnodeattr($config{var}{CN}, "mgt"); - log_this("Detecting: HCP = $config{var}{HCP}"); - } + return $caseerror; +} +#-------------------------------------------------------- +# Fuction name: bakup_current_env +# Description: back up the xcat db +# Atrributes: +# $error_ref (output attribe) +# The reference of scalar to save the error message generated during running current function +# Retrun code: 0 Success 1 Failed +#-------------------------------------------------------- +sub bakup_current_env { + my $error_ref = shift; + &runcmd("mkdir -p /tmp/xCATdbbackup"); + &runcmd("dumpxCATdb -p /tmp/xCATdbbackup"); + if ($::RUNCMD_RC != 0) { + $$error_ref = "Fail to backup xCAT database"; + &runcmd("rm -rf /tmp/xCATdbbackup"); + return 1; } return 0; } -sub uninit -{ - my $cmd = undef; - - # if(exists $config{object}){ - # foreach my $type (keys %{$config{object}}){ - # foreach my $name (keys %{$config{object}{$type}}){ - # $cmd = "rmdef -t $type -o $name"; - # log_this($cmd); - # runcmd($cmd); - # if($::RUNCMD_RC != 0){ - # log_this("Fail to run $cmd"); - # return 1; - # } - # } - # } - # } - # if(exists $config{table}){ - # foreach my $type (keys %{$config{table}}){ - # foreach my $name (keys %{$config{table}{$type}}){ - # $cmd = "chtab -d $config{table}{$type}{$name}{__KEY__}=$name $type"; - # log_this($cmd); - # runcmd($cmd); - # if($::RUNCMD_RC != 0){ - # log_this("Fail to run $cmd"); - # return 1; - # } - # } - # } - # } - foreach $cmd (@{ $config{script_post} }) { - log_this($cmd); - runcmd($cmd); - if ($::RUNCMD_RC != 0) { - log_this("Error: Fail to run $cmd"); - return 1; - } - } - +#-------------------------------------------------------- +# Fuction name: restore_current_env +# Description: restore the xcat db +# Atrributes: +# $error_ref (output attribe) +# The reference of scalar to save the error message generated during running current function +# Retrun code: 0 Success 1 Failed +#-------------------------------------------------------- +sub restore_current_env { + my $error_ref = shift; &runcmd("restorexCATdb -p /tmp/xCATdbbackup"); &runcmd("rm -rf /tmp/xCATdbbackup"); return 0; } -sub Get_Files_Recursive -{ - my $dir = $_[0]; - foreach $dir (@_) - { - opendir(my $d, $dir); - for (; ;) - { - my $direntry = readdir($d); - last unless defined $direntry; - next if $direntry =~ m/^\.\w*/; - next if $direntry eq '..'; - if (-d $dir . "/" . $direntry) - { - Get_Files_Recursive($dir . "/" . $direntry); - } - else - { my $dirpath = $dir . '/' . $direntry . "\n"; - #print $dirpath; +#-------------------------------------------------------- +# Fuction name: run_case +# Description: +# Atrributes: +# $cases_to_be_run_ref (input attribe) +# The reference of array to save the cases to be handled +# $case_ref (input attribe) +# The reference of a array of hash to save the contect of case +# The array @cases is a global attribute. +# Please refer load_case function's comment to get the struture of @cases +# $case_name_index_map_ref (input attribute) +# The reference of a hash to save the mapping of test name ane its index in @cases +# Due to there maybe is more than one implementation for one case +# $error_ref (output attribe) +# The reference of scalar to save the error message generated during running current function +# Retrun code: 0 Success 1 Failed +#-------------------------------------------------------- +sub run_case { + my $cases_to_be_run_ref = shift; + my $cases_ref = shift; + my $case_name_index_map_ref = shift; + my $error_ref = shift; - #print $dir."\n"; - push(@filespath, glob("$dirpath")); - - } - } - closedir($d); - } -} - -sub loadcase -{ - my @files = (); - - #if($cmdlist){ - # my @cmds = split /,/,$cmdlist; - # for my $cmd (@cmds){ - # push (@files, glob("$casedir/$cmd/*")); - # } - #} else { - # @files = glob("$casedir/*/*"); - #} - Get_Files_Recursive("$casedir"); - for (my $countfile = 0 ; $countfile < @filespath ; $countfile++) - { - #TODO:if commands are not right, no action or message now - if ($cmdlist) { - my @cmds = split /,/, $cmdlist; - for (my $countcmd = 0 ; $countcmd < @cmds ; $countcmd++) { - if ($filespath[$countfile] =~ m/\/$cmds[$countcmd]\/case/) { - push(@files, glob("$filespath[$countfile]")); - } - } - } else { - push(@files, glob("$filespath[$countfile]")); - } - } - - - my $file; - my $line; - my $i = 0; - my $j = -1; - my $z = 0; - my $skip = 0; - - my @caserange = (); - my @rightcase = (); - my @notrightcase = (); - my @wrongnamecase= (); - my @samecase = (); - my @errorcase = (); - if ($bundlelist) { - my @bundles = split /,/, $bundlelist; - foreach my $bundle (@bundles) { - if (!open(FILE, "<$bundledir/$bundle")) { - log_this("can't open $bundledir/$bundle"); - return 1; - } - while ($line = ) { - chomp($line); - next if (length($line) == 0); - push(@caserange, $line); - } - close(FILE); - my @refs=sort_caserange(@caserange); - @caserange=@{$refs[0]}; - @samecase=@{$refs[1]}; - @errorcase=@{$refs[2]}; - } - } - - #TODO:if cases are not existed, no action or message. - if ($caselist) { - @caserange = split /,/, $caselist; - } - - foreach $file (@files) { - if (!open(FILE, "<$file")) { - log_this("can't open $file"); - return 1; - } - while ($line = ) { - $line = &trim($line); - next if (length($line) == 0); - - #skip comment lines - next if ($line =~ /^\s*#/); - - #TODO: description and attribute line is treated as a comment line for now - next if ($line =~ /^description\s*:/); - next if ($line =~ /^attribute\s*:/); - - if ($line =~ /^start\s*:\s*(.*)/) { - my $name =$1; - if ($name =~ /[^a-zA-Z0-9_-]/) { - $skip = 1; - push(@wrongnamecase, $name); - next; - }else { - $skip = 0; - if ($caserange[0] && !(grep { /^$name$/ } @caserange)) { - $skip = 1; - next; - } - $j = -1; - $cases[$i] = {}; - $cases[$i]->{name} = $name; - $cases[$i]->{filename} = $file; - if (!$needshow) { - $cases[$i]->{cmd} = []; - $cases[$i]->{check} = []; - $cases[$i]->{cmdcheck} = []; - push(@rightcase, $name); - } else { - $skip = 1; - $i = $i + 1; - } - } - } elsif ($line =~ /^os\s*:\s*(\w[\w\,]+)/) { - next if $skip; - $string1 = $1; - if ($string1 =~ /^rhels\s*/ && -f "/etc/redhat-release") { - $cases[$i]->{os} = "rhels"; - } elsif ($string1 =~ /^sles\s*/ && -f "/etc/SuSE-release") { - $cases[$i]->{os} = "sles"; - } elsif ($string1 =~ /^ubuntu\s*/ && -f "/etc/lsb-release") { - $cases[$i]->{os} = "ubuntu"; - } - else { - $cases[$i]->{os} = $string1; - - } - - chomp($cases[$i]->{os}); - chomp($config{var}{OS}); - if ($cases[$i]->{os} !~ /$config{var}{OS}/) { - if ((($config{var}{OS} =~ /^Linux\s*/i) && ($cases[$i]->{os} =~ /^aix\s*/i)) || (($config{var}{OS} =~ /^aix\s*/i) && ($cases[$i]->{os} !~ /^aix\s*/i)) || (($config{var}{OS} =~ /^rhels\s*/i) && ($cases[$i]->{os} !~ /^Linux\s*/i)) || (($config{var}{OS} =~ /^sles\s*/i) && ($cases[$i]->{os} !~ /^Linux\s*/i)) || (($config{var}{OS} =~ /^ubuntu\s*/i) && ($cases[$i]->{os} !~ /^Linux\s*/i))) { - push(@notrightcase, $cases[$i]->{name}); - pop(@rightcase); - $skip = 1; - } - } - - } elsif ($line =~ /^arch\s*:\s*(\w[\w\,]+)/) { - next if $skip; - $cases[$i]->{arch} = $1; - if ($cases[$i]->{arch} !~ /$config{var}{ARCH}/) { - push(@notrightcase, $cases[$i]->{name}); - pop(@rightcase); - $skip = 1; - } - } elsif ($line =~ /^hcp\s*:\s*(\w[\w\,]+)/) { - next if $skip; - $cases[$i]->{hcp} = $1; - if ($cases[$i]->{hcp} !~ /$config{var}{HCP}/) { - push(@notrightcase, $cases[$i]->{name}); - pop(@rightcase); - $skip = 1; - } - } elsif ($line =~ /^type\s*:\s*(\w[\w\,-]+)/) { - next if $skip; - $cases[$i]->{type} = $1; - if ($cases[$i]->{type} !~ /$config{var}{TYPE}/) { - push(@notrightcase, $cases[$i]->{name}); - pop(@rightcase); - $skip = 1; - } - } elsif ($line =~ /^stop\s*:\s*(\w[\w\,]+)/) { - next if $skip; - $cases[$i]->{stop} = $1; - } elsif ($line =~ /^cmd\s*:\s*([\/\$\w].+)/) { - next if $skip; - $j = $j + 1; - $z = 0; - $cases[$i]->{cmd}->[$j] = &getvar($1); - if ($cases[$i]->{cmd}->[$j] eq '') { - close(FILE); - return 1; - } - } elsif ($line =~ /^check\s*:\s*(\w.+)/) { - next if $skip; - $cases[$i]->{check}->[$j][$z] = &getvar($1); - if ($cases[$i]->{check}->[$j][$z] eq '') { - close(FILE); - return 1; - } - $z = $z + 1; - } elsif ($line =~ /^cmdcheck\s*:\s*(\w.+)/) { - next if $skip; - $cases[$i]->{cmdcheck}->[$j][$z] = &getvar($1); - if ($cases[$i]->{cmdcheck}->[$j][$z] eq '') { - close(FILE); - return 1; - } - $z = $z + 1; - } elsif ($line =~ /^end/) { - next if $skip; - $i = $i + 1; - } - } - - close(FILE); - } - - if ($needshow) { - if (@cases) { - foreach my $case (@cases) { - log_this("$case->{name}"); - } - }else { - log_this("Error: Please check the case name or command name"); - } - log_this("Case name not supported:", @wrongnamecase) if (@wrongnamecase); - return 0; - } - - if (@rightcase) { - log_this("To run:", @rightcase); - }else { - log_this("Error: No case to run, please check the case name or command name"); - } - log_this("Not to run:", @notrightcase) if (@notrightcase); - log_this("Duplicated case:", @samecase) if (@samecase); - log_this("INCLUDEBAD case:", @errorcase) if (@errorcase); - log_this("Case name not supported:", @wrongnamecase) if (@wrongnamecase); - return 0; -} -sub getnodeattr -{ - my ($node, $attr) = @_; - my @output = runcmd("lsdef -t node -o $node -i $attr"); - my $t; - if ($::RUNCMD_RC) { - - # return "Unknown"; - foreach $t (1 .. 40) { - log_this("Error: could not get node attr $attr "); - @output = runcmd("lsdef -t node -o $node -i $attr"); - last if ($::RUNCMD_RC == 0); - } - - } - if ($::RUNCMD_RC == 0) { - foreach my $output1 (@output) { - if ($output1 =~ /$attr=(\w.+)/) { - log_this("$attr is $1"); - return $1; - } - } - } - return "Unknown"; -} - -sub gettablevalue -{ - my ($keyname, $key, $colname, $table) = @_; - my @output = runcmd("gettab $keyname=$key $table\.$colname"); - return $output[0]; -} - -#to remove space and comment -sub trim -{ - my $str = shift @_; - if ($str) { - - # $str =~ s/\#/__wellnumber__/g; - $str =~ s/^\s+|#.+|\s+$//g; - - # $str =~ s/__wellnumber__/#/g; - } - return $str; -} - -sub getvar -{ - my $str = shift @_; - while ($str =~ /\$\$(\w+)/) { - my $varname = $1; - if (exists($config{var}{$varname})) { - $str =~ s/\$\$$varname/$config{var}{$varname}/g; - } else { - log_this("Error: can't get varible $varname"); - return ''; - } - } - return $str; -} - -sub getfunc -{ - my $str = shift @_; - my $func = undef; - my @para = (); - my $parameter = undef; - my $value = undef; - while ($str =~ /__(\w+)\(([\s\,\w\$]*)\)__/) { - $func = $1; - $parameter = $2; - log_this("parameter is $parameter,fun is $func"); - @para = split /\s*,\s*/, trim($parameter); - if ($func eq "GETNODEATTR") { - $value = getnodeattr(@para); - log_this("value is $value"); - if ($value eq "Unknown") { - $value = ''; - } - } elsif ($func eq "INC") { - $value = $para[0] + 1; - } elsif ($func eq "GETTABLEVALUE") { - $value = gettablevalue(@para); - } - $str =~ s/__$func\($parameter\)__/$value/g; - } - return $str; -} - -sub runcase -{ - my @output = (); - my $rc = 0; - my $j = 0; - my $z = 0; - my $lvalue = undef; - my $rvalue = undef; - my $op = undef; - my $failed = 0; my $total = 0; my $failnum = 0; - foreach my $case (@cases) { - my @record = (); - $failed = 0; - $j = 0; - $total = $total + 1; - my $now1 = timelocal(localtime()); - my $time1 = scalar(localtime()); - log_this("------START:$$case{name}::Time:$time1------"); - push @record, "------START:$$case{name}::Time:$time1------"; - push @record, "FILENAME:$$case{filename}"; - foreach my $cmd (@{ $$case{cmd} }) { - $cmd = getfunc($cmd); + my $failed_log_fd = undef; + if (!open($failed_log_fd, ">$failed_log_name")) { + $error_ref = "Failed to generate failed log file for $program_name: $!"; + return 1; + } - #by - my $runstart = timelocal(localtime()); + foreach my $case (@{$cases_to_be_run_ref}) { + my @caselog = (); + + my $failflag = 0; + my $j = 0; + ++$total; + + my $case_start_time = timelocal(localtime()); + my $case_start_time_str = scalar(localtime()); + + log_this($running_log_fd, "------START:$cases_ref->[$case_name_index_map_ref->{$case}]->{name}::Time:$case_start_time_str------\n"); + push @caselog, "------START:$cases_ref->[$case_name_index_map_ref->{$case}]->{name}::Time:$case_start_time_str------\n"; + push @caselog, "FILENAME:$cases_ref->[$case_name_index_map_ref->{$case}]->{filename}\n"; + + foreach my $cmd (@{ $cases_ref->[ $case_name_index_map_ref->{$case} ]->{cmd} }) { + + my $runstart = timelocal(localtime()); my $runstartstr = scalar(localtime()); - log_this("\nRUN:$cmd [$runstartstr]"); - push(@record, "\nRUN:$cmd [$runstartstr]"); - @output = &runcmd($cmd); - $rc = $::RUNCMD_RC; + my $cmdlen = @{$cmd}; + my @output = (); + my $rc = 0; + if ($cmdlen == 1) { + + #to run singal line command + + $cmd = getfunc($cmd->[0]); + @output = &runcmd($cmd); + $rc = $::RUNCMD_RC; + log_this($running_log_fd, "RUN:$cmd [$runstartstr]"); + push(@caselog, "RUN:$cmd [$runstartstr]"); + } else { + + #to run multiple lines command + + @output = runscript($cmd); + $rc = $::RUNCMD_RC; + log_this($running_log_fd, "RUN: [$runstartstr]", @{$cmd}); + push(@caselog, ("RUN: [$runstartstr]", @{$cmd})); + } - #by my $runstop = timelocal(localtime()); my $diffduration = $runstop - $runstart; - log_this("\n[$cmd] Running Time:$diffduration sec"); - push(@record, ("\n[$cmd] Running Time:$diffduration sec")); + log_this($running_log_fd, ("ElapsedTime:$diffduration sec", "RETURN rc = $rc", "OUTPUT:", @output)); + push(@caselog, ("ElapsedTime:$diffduration sec", "RETURN rc = $rc", "OUTPUT:", @output)); - log_this("RETURN: rc = $rc", "OUTPUT:", @output); - push(@record, ("RETURN rc = $rc", "OUTPUT:", @output)); + foreach my $check (@{ $cases_ref->[ $case_name_index_map_ref->{$case} ]->{check}->[$j] }) { + last if ($failflag); - - foreach my $check (@{ $$case{check}->[$j] }) { - if ($failed) { - last; - } if ($check =~ /rc\s*([=!]+)\s*(\d+)/) { - $lvalue = $rc; - $op = $1; - $rvalue = $2; + my $lvalue = $rc; + my $op = $1; + my $rvalue = $2; if ((($op eq '!=') && ($lvalue == $rvalue)) || (($op eq '==') && ($lvalue != $rvalue))) { - $failed = 1; + $failflag = 1; } - if ($failed) { - log_this("CHECK:rc $op $rvalue\t[Failed]"); - push(@record, "CHECK:rc $op $rvalue\t[Failed]"); + if ($failflag) { + log_this($running_log_fd, "CHECK:rc $op $rvalue\t[Failed]"); + push(@caselog, "CHECK:rc $op $rvalue\t[Failed]"); last; } else { - log_this("CHECK:rc $op $rvalue\t[Pass]"); - push(@record, "CHECK:rc $op $rvalue\t[Pass]"); + log_this($running_log_fd, "CHECK:rc $op $rvalue\t[Pass]"); + push(@caselog, "CHECK:rc $op $rvalue\t[Pass]"); } } elsif ($check =~ /output\s*([=!~]+)\s*(\S.*)/ && $check !~ /output\s*([=!~])\1/) { - $lvalue = join("\n", @output); - $op = $1; - $rvalue = $2; + my $lvalue = join("\n", @output); + my $op = $1; + my $rvalue = $2; + $rvalue = getfunc($rvalue); if ((($op eq '=~') && ($lvalue !~ /$rvalue/)) || (($op eq '!~') && ($lvalue =~ /$rvalue/)) || (($op eq '==') && ($lvalue ne $rvalue)) || (($op eq '!=') && ($lvalue eq $rvalue))) { - $failed = 1; + $failflag = 1; } - if ($failed) { - log_this("CHECK:output $op $rvalue\t[Failed]"); - push(@record, "CHECK:output $op $rvalue\t[Failed]"); + if ($failflag) { + log_this($running_log_fd, "CHECK:output $op $rvalue\t[Failed]"); + push(@caselog, "CHECK:output $op $rvalue\t[Failed]"); last; } else { - log_this("CHECK:output $op $rvalue\t[Pass]"); - push(@record, "CHECK:output $op $rvalue\t[Pass]"); + log_this($running_log_fd, "CHECK:output $op $rvalue\t[Pass]"); + push(@caselog, "CHECK:output $op $rvalue\t[Pass]"); } } elsif ($check =~ /output\s*~~\s*(\S.*)/) { - $op = "~~"; - $failed = 1; - $rvalue = $1; + my $op = "~~"; + + #my $failflag = 1; + my $rvalue = $1; + $rvalue = getfunc($rvalue); my $num; if ($rvalue =~ /(\d+)/) { @@ -982,7 +1194,7 @@ sub runcase my $min = $num * 0.9; $line =~ /.*:.*: (\d+) /; if ($1 < $max && $1 > $min) { - $failed = 0; + $failflag = 0; last; } } else { @@ -990,54 +1202,166 @@ sub runcase } } } - if ($failed) { - log_this("CHECK:output $op $rvalue $num\t[Failed]"); - push(@record, "CHECK:output $op $rvalue\t[Failed]"); + if ($failflag) { + log_this($running_log_fd, "CHECK:output $op $rvalue\t[Failed]"); + push(@caselog, "CHECK:output $op $rvalue\t[Failed]"); last; } else { - log_this("CHECK:output $op $rvalue $num\t[Pass]"); - push(@record, "CHECK:output $op $rvalue\t[Pass]"); - } - } - } - foreach my $cmdcheck (@{ $$case{cmdcheck}->[$j] }) { + log_this($running_log_fd, "CHECK:output $op $rvalue\t[Pass]"); + push(@caselog, "CHECK:output $op $rvalue\t[Pass]"); + } } } + foreach my $cmdcheck (@{ $cases_ref->[ $case_name_index_map_ref->{$case} ]->{cmdcheck}->[$j] }) { if ($cmdcheck) { &runcmd($cmdcheck); $rc = $::RUNCMD_RC; if ($rc == 1) { - log_this("CMDCHECK:output $cmdcheck\t[Failed]"); - push(@record, "CHECK:output $cmdcheck\t[Failed]"); + log_this($running_log_fd, "CHECK:output $cmdcheck\t[Failed]"); + push(@caselog, "CHECK:output $cmdcheck\t[Failed]"); } elsif ($rc == 0) { - log_this("CMDCHECK:output $cmdcheck\t[Pass]"); - push(@record, "CHECK:output $cmdcheck\t[Pass]"); + log_this($running_log_fd, "CHECK:output $cmdcheck\t[Pass]"); + push(@caselog, "CHECK:output $cmdcheck\t[Pass]"); } } } $j = $j + 1; + log_this($running_log_fd, " "); + push(@caselog, " "); } - my $now2 = timelocal(localtime()); - my $time2 = scalar(localtime()); - my $diff = $now2 - $now1; - if ($failed) { - log_this("------END::$$case{name}::Failed::Time:$time2 ::Duration::$diff sec------"); - push(@record, "------END::$$case{name}::Failed::Time:$time2 ::Duration::$diff sec------"); + my $case_end_time = timelocal(localtime()); + my $case_end_time_str = scalar(localtime()); + my $diff = $case_end_time - $case_start_time; + + if ($failflag) { + log_this($running_log_fd, "------END::$cases_ref->[$case_name_index_map_ref->{$case}]->{name}::Failed::Time:$case_end_time_str ::Duration::$diff sec------"); + push(@caselog, "------END::$cases_ref->[$case_name_index_map_ref->{$case}]->{name}::Failed::Time:$case_end_time_str ::Duration::$diff sec------"); } else { - log_this("------END::$$case{name}::Passed::Time:$time2 ::Duration::$diff sec------"); - push(@record, "------END::$$case{name}::Passed::Time:$time2 ::Duration::$diff sec------"); + log_this($running_log_fd, "------END::$cases_ref->[$case_name_index_map_ref->{$case}]->{name}::Passed::Time:$case_end_time_str ::Duration::$diff sec------"); + push(@caselog, "------END::$cases_ref->[$case_name_index_map_ref->{$case}]->{name}::Passed::Time:$case_end_time_str ::Duration::$diff sec------"); } - if ($failed) { - $failnum = $failnum + 1; - log_error(@record); - if (defined($$case{stop}) && ($$case{stop} =~ /^yes$/)) { + + if ($failflag) { + ++$failnum; + print $failed_log_fd (join("\n", @caselog), "\n"); + if (defined($cases_ref->[ $case_name_index_map_ref->{$case} ]->{stop}) && ($cases_ref->[ $case_name_index_map_ref->{$case} ]->{stop} =~ /^yes$/)) { $stop_to_keep_env = 1; last; } } } - log_this("\n\n"); - log_this("------Total: $total , Failed: $failnum------"); + + log_this($running_log_fd, "------Total: $total , Failed: $failnum------\n"); + close($failed_log_fd); + return 0; } +#-------------------------------------------------------- +# Fuction name: setup_env_by_configure_file +# Description: set up environment by the settings in config file +# Atrributes: +# $config_ref (input attribute) +# The reference of global hash %config. +# The structure of %config please refer to the comment of function load_config_file +# $error_ref (output attribe) +# The reference of scalar to save the error message generated during running current function +# Retrun code: 0 Success 1 Failed +#-------------------------------------------------------- +sub setup_env_by_configure_file { + my $config_ref = shift; + my $error_ref = shift; + + my $cmd = undef; + foreach $cmd (@{ $$config_ref{script_prev} }) { + log_this($running_log_fd, "$cmd"); + &runcmd($cmd); + if ($::RUNCMD_RC != 0) { + $$error_ref = "Fail to run $cmd"; + return 1; + } + } + + if (exists $$config_ref{object}) { + foreach my $type (keys %{ $$config_ref{object} }) { + foreach my $name (keys %{ $$config_ref{object}{$type} }) { + $cmd = "chdef -t $type -o $name"; + foreach my $attr (keys %{ $$config_ref{object}{$type}{$name} }) { + $cmd = $cmd . " $attr=$$config_ref{object}{$type}{$name}{$attr}"; + } + log_this($running_log_fd, "$cmd"); + runcmd($cmd); + if ($::RUNCMD_RC != 0) { + $$error_ref = "Fail to run $cmd"; + return 1; + } + } + } + } + + if (exists $$config_ref{table}) { + foreach my $type (keys %{ $$config_ref{table} }) { + foreach my $name (keys %{ $$config_ref{table}{$type} }) { + $cmd = "chtab $$config_ref{table}{$type}{$name}{__KEY__}=$name"; + foreach my $attr (keys %{ $$config_ref{table}{$type}{$name} }) { + if ($attr ne '__KEY__') { + $cmd = $cmd . " $type.$attr=$$config_ref{table}{$type}{$name}{$attr}"; + } + } + log_this($running_log_fd, "$cmd"); + &runcmd($cmd); + if ($::RUNCMD_RC != 0) { + $$error_ref = "Fail to run $cmd"; + return 1; + } + } + } + } + + if (!exists $$config_ref{var}{OS}) { + my @output = runcmd("uname"); + $$config_ref{var}{OS} = $output[0]; + log_this($running_log_fd, "Detecting: OS = $$config_ref{var}{OS}"); + } else { + $$config_ref{var}{OS} = lc($$config_ref{var}{OS}); + } + + if (!exists $$config_ref{var}{ARCH}) { + if (!exists $$config_ref{var}{CN}) { + $$config_ref{var}{ARCH} = "Unknown"; + log_this($running_log_fd, "Warning: No compute node defined, can't get ARCH of compute node"); + } else { + $$config_ref{var}{ARCH} = getnodeattr($$config_ref{var}{CN}, "arch"); + if ($$config_ref{var}{ARCH} =~ /le|el/) { + $$config_ref{var}{ARCH} = 'ppc64le'; + } elsif ($$config_ref{var}{ARCH} =~ /ppc/) { + $$config_ref{var}{ARCH} = 'ppc'; + } elsif ($$config_ref{var}{ARCH} =~ /86/) { + $$config_ref{var}{ARCH} = 'x86'; + } + log_this($running_log_fd, "Detecting: ARCH = $$config_ref{var}{ARCH}"); + } + } + + if (!exists $$config_ref{var}{HCP}) { + if (!exists $$config_ref{var}{CN}) { + $$config_ref{var}{HCP} = "Unknown"; + log_this($running_log_fd, "Warning: No compute node defined, can't get HCP TYPE of compute node"); + } else { + $$config_ref{var}{HCP} = getnodeattr($$config_ref{var}{CN}, "mgt"); + log_this($running_log_fd, "Detecting: HCP = $$config_ref{var}{HCP}"); + } + + } + + return 0; +} + +#-------------------------------------------------------- +# Fuction name: runcmd +# Description: run a command after 'cmd' label in one case +# Atrributes: +# Retrun code: +# $::RUNCMD_RC : the return code of command +# @$outref : the output of command +#-------------------------------------------------------- sub runcmd { my ($cmd) = @_; @@ -1056,91 +1380,269 @@ sub runcmd } -sub usage -{ - log_this("Usage:Run xcat test cases:"); - log_this(" xcattest [-?|-h]"); - log_this(" xcattest [-f configure file] [-b case bundle files]"); - log_this(" xcattest [-f configure file] [-t cases list]"); - log_this(" xcattest [-f configure file] [-c cmds list]"); - log_this("Show xcat test cases, bundle files, commands lists:"); - log_this(" xcattest [-b case bundle files] [-l]"); - log_this(" xcattest [-t cases list] [-l]"); - log_this(" xcattest [-c cmds list] [-l]"); - log_this("Show all bundle files, all commands:"); - log_this(" xcattest [-s command|bundle]"); - log_this(""); - return; + +#-------------------------------------------------------- +# Fuction name: runscript +# Description: run a script after 'cmd' label in one case +# Atrributes: +# $script_ref (input attribute) +# the reference of array where save every line of script +# Retrun code: +# $::RUNCMD_RC : the return code of command +# @$outref : the output of command +#-------------------------------------------------------- +sub runscript { + my $script_ref = shift; + my $time = time(); + my $tmpdir = "/tmp/xCATautotest$time/"; + my $tmpfile = "$tmpdir/script"; + my $rf; + mkpath("$tmpdir"); + open($rf, ">$tmpfile"); + foreach my $line (@$script_ref) { + $line = getfunc($line); + print $rf "$line\n"; + } + close($rf); + chmod 0755, "$tmpfile"; + my @output = runcmd("$tmpfile"); + + unlink("$tmpfile"); + rmdir("$tmpdir"); + return @output; } -sub listbundlefiles -{ - my @bundlefiles = (); - - #get all .bundle files from /opt/xcat/share/xcat/tools/autotest/bundle/ - opendir(DIR, $bundledir); - my @files = readdir(DIR); - foreach my $file (@files){ - next if (-d $file); - if ($file =~ /\.bundle$/){ - push(@bundlefiles, $file); - } - } - closedir(DIR); - - #read all .bundle files, get descriptions for each file. - my $skip =0; - my $line; - foreach my $bundlefile (@bundlefiles) { - if (!open(FILE, "<$bundledir/$bundlefile")) { - log_this("Error: Can't open bundle file: $bundlefile"); - log_this("Use 'xcattest -s bundle' to list out available bundles"); - return 1; - } - $skip = 0; - while ($line = ) { - $line = &trim($line); - next if (length($line) == 0); - - #description line is treated as a comment line for now - if ($line =~ /^description\s*:\s*(.*)/){ - if (length($1) != 0) { - $bundlefilesinfo{$bundlefile} = $1; - $skip=1; - last; - } +#-------------------------------------------------------- +# Fuction name: getnodeattr +# Description: get the value of node attribute form current environment +# Atrributes: +# Retrun code: +#-------------------------------------------------------- +sub getnodeattr { + my $node = shift; + my $attr = shift; + my $maxtry = 40; + foreach my $try (0 .. $maxtry) { + my @output = runcmd("lsdef -t node -o $node -i $attr"); + if ($::RUNCMD_RC == 0) { + foreach my $line (@output) { + if ($line =~ /$attr=(\w.+)/) { + return $1; + } } - } - close(FILE); - if (!$skip){ - $bundlefilesinfo{$bundlefile} = "No description, add with \"description: details\" in bundle file"; - } - } - &listformatbundleinfo(%bundlefilesinfo); - + } + } + return "Unknown"; +} + +#-------------------------------------------------------- +# Fuction name: get_files_recursive +# Description: Search all file in one directory recursively +# Atrributes: +# $dir (input attribute) +# The target scan directory +# $files_path_ref (output attribute) +# the reference of array where save all vaild files under $dir +# Retrun code: +#-------------------------------------------------------- +sub get_files_recursive +{ + my $dir = shift; + my $files_path_ref = shift; + + my $fd = undef; + opendir($fd, $dir); + for (; ;) + { + my $direntry = readdir($fd); + last unless (defined($direntry)); + next if ($direntry =~ m/^\.\w*/); + next if ($direntry eq '..'); + my $target = "$dir/$direntry"; + if (-d $target) { + get_files_recursive($target, $files_path_ref); + } else { + push(@{$files_path_ref}, glob("$target\n")); + } + } + closedir($fd); +} + + +#-------------------------------------------------------- +# Fuction name: is_valid_case_name +# Description: to check if a case name is valid +# Atrributes: $casename (input atrribute): the target case name +# Retrun code: 0 Success 1 Failed +#-------------------------------------------------------- +sub is_valid_case_name { + my $casename = shift; + if ($casename =~ /[^a-zA-Z0-9_-]/) { + return 0; + } else { + return 1; + } +} + +#------------------------------------------------------- +# Fuction name: get_current_os +# Description: +# Atrributes: +# Retrun code: +#-------------------------------------------------------- +sub get_current_os { + if (-f "/etc/redhat-release") { + return "rhels"; + } elsif (-f "/etc/SuSE-release") { + return "sles"; + } elsif (-f "/etc/lsb-release") { + return "ubuntu"; + } else { + return "aix"; + } +} + + +#-------------------------------------------------------- +# Fuction name: generate_performance_report +# Description: +# Atrributes: +# Retrun code: +#-------------------------------------------------------- +sub generate_performance_report { + my $runninglog = shift; + my $performancelog = shift; + my $error_ref = shift; + + my $performance_log_fd = undef; + + if (!open($performance_log_fd, ">$performancelog")) { + $$error_ref = "Failed to create performance log $performancelog: $!"; + return 1; + } + + print $performance_log_fd "Testcase Duration\n"; + print $performance_log_fd "------------------------------------------------------------------------------\n"; + + my @output = runcmd("cat $runninglog"); + my $cmdlineflag = 0; + my $line; + foreach my $line (@output) { + if ($line =~ /^------START:/) { + $line =~ s/------//g; + print $performance_log_fd "$line\n"; + } elsif ($line =~ /^RUN:/) { + $cmdlineflag = 1; + print $performance_log_fd "$line;\n"; + } elsif ($line =~ /^ElapsedTime:/) { + $cmdlineflag = 0; + print $performance_log_fd "$line\n"; + } elsif ($cmdlineflag) { + print $performance_log_fd "$line\n"; + } elsif ($line =~ /^------END:/) { + $line =~ s/------//g; + print $performance_log_fd "$line\n\n"; + } + } + close($performance_log_fd); return 0; } -sub listformatbundleinfo +#-------------------------------------------------------- +# Fuction name: getvar +# Description: replace specific attribute in case definition by the value set in config file +# Atrributes: +# Retrun code: +#-------------------------------------------------------- +sub getvar { - my $maxlen = 0; - foreach my $filename (keys %bundlefilesinfo) { - $maxlen = length($filename) if (length($filename) > $maxlen); + my $str = shift; + my $config_ref = shift; + + while ($str =~ /\$\$(\w+)/) { + my $varname = $1; + if (exists($$config_ref{var}{$varname})) { + $str =~ s/\$\$$varname/$$config_ref{var}{$varname}/g; + } else { + return "miss attribute $varname"; + } } - $maxlen += 4; + return $str; +} + +#-------------------------------------------------------- +# Fuction name: getfunc +# Description: replace specific funciton in case definition +# Atrributes: +# Retrun code: +#-------------------------------------------------------- +sub getfunc +{ + my $str = shift; + + while ($str =~ /__(\w+)\(([\s\,\w\$]*)\)__/) { + my $func = $1; + my $parameter = $2; + my $value = undef; + my @para = (); + + #log_this("parameter is $parameter,fun is $func"); + chomp($parameter); + @para = split /\s*,\s*/, $parameter; + if ($func eq "GETNODEATTR") { + $value = getnodeattr($para[0], $para[1]); + if ($value eq "Unknown") { + $value = ''; + } + } elsif ($func eq "INC") { + $value = $para[0] + 1; + } elsif ($func eq "GETTABLEVALUE") { + $value = gettablevalue(@para); + } + $str =~ s/__$func\($parameter\)__/$value/g; + } + return $str; +} + +#-------------------------------------------------------- +# Fuction name: gettablevalue +# Description: get specific table value from current environment +# Atrributes: +# Retrun code: +#-------------------------------------------------------- +sub gettablevalue +{ + my ($keyname, $key, $colname, $table) = @_; + my @output = runcmd("gettab $keyname=$key $table\.$colname"); + return $output[0]; +} + +#-------------------------------------------------------- +# Fuction name: print_table +# Description: print a hash table in good format +# Atrributes: +# Retrun code: +#-------------------------------------------------------- +sub print_table { + my $msg_ref = shift; my $desiredwidth = 120; my $screenwidth = (`tput cols` + 0); my $finallen = ($screenwidth > $desiredwidth ? $desiredwidth : $screenwidth); - print "bundle files and descriptions:\n"; - - foreach my $filename (sort { $a cmp $b } keys %bundlefilesinfo ) { - my @desc = split(" ", $bundlefilesinfo{$filename}); + my $maxkeylen = 0; + foreach my $key (keys %{$msg_ref}) { + my $keylen = length($key); + $maxkeylen = $keylen if ($keylen > $maxkeylen); + } + $maxkeylen += 4; + + foreach my $key (sort { $a cmp $b } keys %{$msg_ref}) { + my @desc = split(" ", $msg_ref->{$key}); my $str = ""; my @formatdesc = (); foreach my $word (@desc) { - if (length($str) + length($word) > $finallen - $maxlen) { + if (length($str) + length($word) > $finallen - $maxkeylen) { $str =~ s/([^\s]+)\s$/$1/g; push @formatdesc, $str; $str = ""; @@ -1150,162 +1652,16 @@ sub listformatbundleinfo $str =~ s/([^\s]+)\s$/$1/g; push @formatdesc, $str; - print "$filename"; + print color("green"), "$key", color("reset"); - my $space = " " x ($maxlen - length($filename)); + my $space = " " x ($maxkeylen - length($key)); print "$space$formatdesc[0]\n"; delete $formatdesc[0]; - $space = " " x $maxlen; + $space = " " x $maxkeylen; foreach my $line (@formatdesc) { print "$space$line\n" if (length($line)); } } -} - -sub listcommands -{ - my @files = (); - - Get_Files_Recursive("$casedir"); - for (my $countfile = 0 ; $countfile < @ filespath ; $countfile++) - { - if ($filespath[$countfile] =~ /testcase\/(.*)\/case/) { - log_this("$1"); - } - } -} - -sub getreport -{ - open(INDOC, ">$_[1]") || die("open STDOUT failed"); - print INDOC "Testcase Duration\n"; - print INDOC "------------------------------------------------------------------------------\n"; - close(INDOC); - open(STDOUT, ">>$_[1]") || die("open STDOUT failed"); - open FD, "<$_[0]" or die "$?"; - while () { - if (/Time/) { - s/------//g; - $_ .= "\n" if /END/; - print STDOUT $_; - } - } - - close(FD); - close(STDOUT); -} - - -sub reordercases -{ - my @caserange = (); - my $line; - if ($bundlelist) { - my @bundles = split /,/, $bundlelist; - foreach my $bundle (@bundles) { - if (!open(FILE, "<$bundledir/$bundle")){ - log_this("Error: Can't open bundle file: $bundle"); - return 1; - } - while ($line = ) { - chomp($line); - next if ((length($line) == 0) || ($line =~ /^description\s*:\s*(.*)/)); - push(@caserange, $line); - } - close(FILE); - my @refs=sort_caserange(@caserange); - @caserange=@{$refs[0]}; - } - } - if ($caselist) { - @caserange = split /,/, $caselist; - } - - my @tmpcases = (); - foreach my $case (@caserange) { - my $i = 0; - my $hit = 0; - foreach my $runcase (@cases) { - if ($runcase->{name} eq $case) { - $hit = 1; - last; - } - $i++; - next; - } - push(@tmpcases, $cases[$i]) if ($hit); - } - @cases = @tmpcases; -} - -sub checkoptions -{ - #-b,-c,-t,-s should be defined at least one - if (!defined($bundlelist) && !defined($caselist) && !defined($cmdlist) && !defined($showbundlesorcommands)) { - log_this("Error: please define options correctly, see below usage information:"); - return 1; - }elsif ((defined($bundlelist) || defined($caselist) || defined($cmdlist)) && (! $needshow) && !defined($configinfo)) { - #config file must be defined if the using -c,-b,-t to run test cases - log_this("Error: To run test cases, please define the config file with -f option"); - log_this(" To show test cases, please use the -l option"); - return 1; - }elsif (defined($showbundlesorcommands) && (defined($bundlelist) || defined($caselist) || defined($cmdlist))) { - #-s can't be used together with -c,-b,-t - log_this("Error: -b,-c or -t can't be used together with -s"); - return 1; - }elsif (defined($showbundlesorcommands) && $needshow) { - log_this("Error: -s, -l can't be used together"); - return 1; - } - - #check the -s option, the value should be bundle or command - if (defined($showbundlesorcommands)) { - if (($showbundlesorcommands ne "bundle") && ($showbundlesorcommands ne "command")) { - log_this("Error: please use \"bundle\" or \"command\" as the \-s value"); - return 1; - }elsif ($showbundlesorcommands eq "bundle") { - $showbundlefiles = 1; - }else { - } - $showcommandslist= 1; - } - - #get and check config file and System label - #this System label means only the [System] variable will be loaded - if (defined($configinfo)) { - if ($configinfo =~ /(.*):(.*)/) { - $configfile = $1; - $initallabel = $2; - if ($initallabel ne $loadsysteminfo) { - log_this("Error: $initallabel is not supported!"); - return 1; - } - }else { - $configfile = $configinfo; - } - if (!(-e $configfile)) { - log_this("Error: Can't open config file: $configfile"); - return 1; - } - } - - #check bundle files - if (defined($bundlelist)) { - my @bundles = split /,/, $bundlelist; - foreach my $bundle (@bundles){ - if ("$bundledir/$bundle" !~ /\.bundle$/) { - log_this("Error: please input the .bundle file"); - log_this("Use 'xcattest -s bundle' to list all bundle files"); - return 1; - } - if (!(-e "$bundledir/$bundle")) { - log_this("Error: Can't open bundle file: $bundle"); - log_this("Use 'xcattest -s bundle' to list all bundle files"); - return 1; - } - } - } - return 0; } From 28b68fd82344186e4b604a15af3db31e68d46c0a Mon Sep 17 00:00:00 2001 From: Weihua Hu Date: Thu, 18 May 2017 16:23:53 +0800 Subject: [PATCH 050/129] Remove redundant space, it will result in case failed to be loaded (#3095) --- xCAT-test/autotest/bundle/rhels7.4-pegas_ppc64le.bundle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-test/autotest/bundle/rhels7.4-pegas_ppc64le.bundle b/xCAT-test/autotest/bundle/rhels7.4-pegas_ppc64le.bundle index c430a505f..74a0d4803 100644 --- a/xCAT-test/autotest/bundle/rhels7.4-pegas_ppc64le.bundle +++ b/xCAT-test/autotest/bundle/rhels7.4-pegas_ppc64le.bundle @@ -38,7 +38,7 @@ rspconfig_ip_invalid rspconfig_netmask rspconfig_netmask_invalid rspconfig_gateway -rspconfig_gateway_invalid +rspconfig_gateway_invalid rspconfig_node_invalid rspconfig_ip_null reg_linux_diskfull_installation_flat From 213e7e05de91dbb40570e888f0fe795c6b299079 Mon Sep 17 00:00:00 2001 From: Bin Xu Date: Thu, 18 May 2017 17:16:58 +0800 Subject: [PATCH 051/129] create framework for executing and saving performance testcase data (#2500) - refine the xcatperftest tool to make it be easily integrated into xcattest - add testcase/performance/.. to trigger the performance testcase - fix manpage missing issue for xcatperftest --- xCAT-test/autotest/perfcmds.lst | 2 +- xCAT-test/autotest/testcase/performance/case0 | 18 +++ xCAT-test/bin/xcatperftest | 111 ++++++++++++++++-- xCAT-test/debian/rules | 2 + xCAT-test/xCAT-test.spec | 2 + 5 files changed, 122 insertions(+), 13 deletions(-) create mode 100644 xCAT-test/autotest/testcase/performance/case0 diff --git a/xCAT-test/autotest/perfcmds.lst b/xCAT-test/autotest/perfcmds.lst index e1cf7eb3c..d41d203c5 100644 --- a/xCAT-test/autotest/perfcmds.lst +++ b/xCAT-test/autotest/perfcmds.lst @@ -6,7 +6,7 @@ makedhcp #NODES# makeknownhosts #NODES# nodech #NODES# groups,=group1 nodels #NODES# noderes -nodeset #NODES# osimage=rhels7.3-GA-ppc64le-install-compute +nodeset #NODES# osimage=#OSIMAGE# chdef -t node -o #NODES# postscripts="fake" profile="install" netboot="grub2" rmdef -t node #PERFGRP# mkdef -z < #STANZ# diff --git a/xCAT-test/autotest/testcase/performance/case0 b/xCAT-test/autotest/testcase/performance/case0 new file mode 100644 index 000000000..6ed131c19 --- /dev/null +++ b/xCAT-test/autotest/testcase/performance/case0 @@ -0,0 +1,18 @@ +start:perftest_5000 +description:Default performance testing on 5000 fake nodes +os:Linux +cmd:which yum &>/dev/null && yum install -y bridge-utils || apt install -y bridge-utils +cmd:copycds $$ISO +check:rc==0 +cmd:xcatperftest 5000 /opt/xcat/share/xcat/tools/autotest/perfcmds.lst +check:rc==0 +end + +start:perftest_5000_without_conf +description:Default performance testing on 5000 fake nodes without extra configuraiton on MN +os:Linux +cmd:which yum &>/dev/null && yum install -y bridge-utils || apt install -y bridge-utils +check:rc==0 +cmd:xcatperftest 5000 /opt/xcat/share/xcat/tools/autotest/perfcmds.lst +check:rc==0 +end diff --git a/xCAT-test/bin/xcatperftest b/xCAT-test/bin/xcatperftest index e68e6b8f4..8795fb3a8 100755 --- a/xCAT-test/bin/xcatperftest +++ b/xCAT-test/bin/xcatperftest @@ -26,6 +26,17 @@ isNumber() expr $1 + 0 &>/dev/null } +# Used for prerequiste checking +preChecking() +{ + local val="" + for cmd in brctl ifconfig; do + which $cmd > /dev/null 2>&1 + [ $? -ne 0 ] && val="$cmd,$val" + done + echo $val | sed s/,$// +} + # Give a simple usage if [ -z "$1" ] || [ "$1" = "-h" ] || [ "$1" = "--help" ]; then echo "[PERF_DRYRUN=y] [PERF_NOCREATE=y] $0 [command-list-file]" @@ -45,6 +56,12 @@ if [ -z $XCATROOT ]; then fi fi +pass=$(preChecking) +if [ ! -z "$pass" ]; then + echo "Error: Missing required tools: $pass" + [ -z $PERF_DRYRUN ] && exit -1 +fi + # Mandatory, to specify the number of total fake nodes which will be created for testing FAKE_NODE_TOTAL=$1 @@ -73,6 +90,18 @@ if [ -z $FAKE_NETWORK_BMC ]; then FAKE_NETWORK_BMC='192.169' fi +# Optional, The network mask for the fake network object. +# By default, it is '255.255.0.0' but it could be changed when you set environment variable `FAKE_NETWORK_MASK` +if [ -z $FAKE_NETWORK_MASK ]; then + FAKE_NETWORK_MASK='255.255.0.0' +fi + +# Optional, The bridge device name for the temporary interface which is required on MN as nodeset/makedhcp will check if the MN and CN in same subnet. +# By default, it is 'perfvirbr0' but it could be changed when you set environment variable `FAKE_NETWORK_INTF` +if [ -z $FAKE_NETWORK_INTF ]; then + FAKE_NETWORK_INTF='perfvirbr0' +fi + # Optional, The node template name used for generating fake nodes. # By default, it is '-template' but it could be changed when you set environment variable `FAKE_NODE_GROUP` if [ -z $PERF_NODETEMPL ]; then @@ -81,11 +110,14 @@ fi # IP address assinged to node will be in [1-250] NODE_PER_ROW=250 +MYSUFFIX=`date +"%Y%m%d%H%M%S"` -PERFORMANCE_DIR=/tmp/xcat-performance -PERFORMANCE_NODE_TMPL=$PERFORMANCE_DIR/node.tmpl -PERFORMANCE_REPORT=$PERFORMANCE_DIR/report-$FAKE_NODE_TOTAL.$$ -PERFORMANCE_STANZ=$PERFORMANCE_DIR/stanz-$FAKE_NODE_TOTAL.$$ +if [ -z $PERFORMANCE_DIR ]; then + PERFORMANCE_DIR=$XCATROOT/share/xcat/tools/autotest/result +fi +PERFORMANCE_NODE_TMPL=$PERFORMANCE_DIR/perf-node.tmpl +PERFORMANCE_REPORT=$PERFORMANCE_DIR/perfreport-$FAKE_NODE_TOTAL.log.$MYSUFFIX +PERFORMANCE_STANZ=$PERFORMANCE_DIR/perfstanz-$FAKE_NODE_TOTAL.$MYSUFFIX # If the command list file is not specified, the tool will only create the stanz file for fake nodes. # If it is specified but not exists, the tool will exit with error. @@ -135,6 +167,45 @@ fakeNode() # bmc=$FAKE_NETWORK_BMC.$2.$3 bmcpassword=fake bmcusername=fake groups=all,performance > /dev/null 2>&1 } +# Create a fake xCAT network definition +fakeNetwork() +{ + lsdef -t network -o net-$FAKE_NODE_PREFIX > /dev/null 2>&1 + if [ 0 != $? ]; then + mkdef -t network net-$FAKE_NODE_PREFIX net=$FAKE_NETWORK_PRO.0.0 mask=$FAKE_NETWORK_MASK > /dev/null + else + chdef -t network -o net-$FAKE_NODE_PREFIX net=$FAKE_NETWORK_PRO.0.0 mask=$FAKE_NETWORK_MASK > /dev/null + fi +} + +# Create a fake xCAT network definition +fakeInterface() +{ + result=`ifconfig $1 2>/dev/null` + if [ -z "$2" ]; then + [ -z "$result" ] && brctl addbr $1 + ifconfig $1 $FAKE_NETWORK_PRO.251.254 netmask $FAKE_NETWORK_MASK || echo "$1 is not configured successfully" + elif [ ! -z "$result" ]; then + ifconfig $1 down + brctl delbr $1 || echo "$1 is not removed successfully, you may need to clean up manually." + fi +} + +getOSimage() +{ + # The OS image name used in nodeset to replace the MACRO Variable `#OSIMAGE#`. + # By default, it could be detectd automatically according to the arch + if [ -z $PERF_OSIMAGE ]; then + + # covert it to an array + osimage_array=($(lsdef -t osimage 2>/dev/null| grep `arch`|awk '/compute/ {print $1}')) + index=`expr $RANDOM % ${#osimage_array[@]} 2>/dev/null` + echo ${osimage_array[$index]} + else + echo $PERF_OSIMAGE + fi +} + # Create batch fake nodes stanz file for testing bootstrap() { @@ -164,6 +235,7 @@ runTest() { cmd=$1 + [ -z $osimage ] || cmd="${cmd/\#OSIMAGE\#/$osimage}" if [[ $cmd =~ '#STANZ#' ]]; then #mkdef -z execCmd "${cmd/\#STANZ\#/$PERFORMANCE_STANZ}" "$FAKE_NODE_TOTAL" @@ -179,7 +251,7 @@ runTest() do isNumber $num || continue if [[ $num -le $FAKE_NODE_TOTAL ]]; then - cmd=$1 + #cmd=$1 execCmd "${cmd/\#NODES\#/$FAKE_NODE_PREFIX[1-$num]}" "$num" fi done @@ -195,10 +267,11 @@ runTest() # Output performance result for each command. printResult() { - cmd=`echo "$1" | awk '{print $1}'` + #TODO, more clear short desc for this command + desc=`echo "$1" | awk '{print $1}'` result=$([[ $4 = 0 ]] && echo "SUCESS" || echo "FAIL") # TOTAL, CMD, NODERANGE, TIME, SUCESS, FULL COMMAND - echo "$FAKE_NODE_TOTAL", "$cmd", "$2", "$3", $result, \"$1\" >> $PERFORMANCE_REPORT + echo "$FAKE_NODE_TOTAL; $desc; $2; $3; $result; \"$1\"" | tee -a $PERFORMANCE_REPORT } # Executing each command and print the result to report file @@ -222,19 +295,21 @@ execCmd() ################################################# # Main Loop of the performance baseline testing # ################################################# -lsxcatd -a +version=`lsxcatd -a 2>/dev/null | grep Version` if [ 0 != $? ]; then - echo "ERROR: xCAT daemon is not running" - #exit 99 + echo "ERROR: xCAT daemon is not running. Start 'xcatd' and rerun this tool." + exit 99 fi -mkdir -p /tmp/xcat-performance +mkdir -p $PERFORMANCE_DIR lsdef -t node --template $PERF_NODETEMPL > $PERFORMANCE_NODE_TMPL 2>/dev/null if [ 0 != $? ]; then - echo "ERROR: Cannot find the default template for `arch`, make sure it exists and rerun the script." + echo "ERROR: Cannot find the default template for `arch`, make sure it exists and rerun this tool." exit 99 fi +#Get available OS image, it will be used for nodeset if possible +osimage=$(getOSimage) rack=$(expr $FAKE_NODE_TOTAL / $NODE_PER_ROW) @@ -257,13 +332,24 @@ if [ -z $RUN_CMD_LIST ]; then fi echo "Continue the performance testing for commands in $RUN_CMD_LIST " +if [ -z "$osimage" ]; then + echo "WARN: Cannot determine the OS image, the commands which defined with #OSIMAGE# will be failed." +fi + +echo $version | tee $PERFORMANCE_REPORT echo "==================================================" # Initial Populate the fake nodes into DB if [ -z $PERF_NOCREATE ]; then + #create fake network for makedns, makedhcp etc... + fakeNetwork execCmd "mkdef -z -f < $PERFORMANCE_STANZ" "$FAKE_NODE_TOTAL" fi +# fake interface is required for topology with service nodes as it will determine if then Mn/Sn are +# in the same subnet with CNs +fakeInterface $FAKE_NETWORK_INTF + series=`grep '^#SERIES#' $RUN_CMD_LIST | awk '{print $2}'` if [ ! -z $series ]; then series=${series//,/ } @@ -287,6 +373,7 @@ IFS_BAK= rm -f $PERFORMANCE_NODE_TMPL rm -f $PERFORMANCE_STANZ +fakeInterface $FAKE_NETWORK_INTF del if [ -z $PERF_DRYRUN ]; then echo diff --git a/xCAT-test/debian/rules b/xCAT-test/debian/rules index ad419b385..d7863c5c1 100755 --- a/xCAT-test/debian/rules +++ b/xCAT-test/debian/rules @@ -15,6 +15,8 @@ build: mkdir -p share/doc/man1 pod2man pods/man1/xcattest.1.pod > share/man/man1/xcattest.1 pod2html pods/man1/xcattest.1.pod > share/doc/man1/xcattest.1.html + pod2man pods/man1/xcatperftest.1.pod > share/man/man1/xcatperftest.1 + pod2html pods/man1/xcatperftest.1.pod > share/doc/man1/xcatperftest.1.html pwd clean: diff --git a/xCAT-test/xCAT-test.spec b/xCAT-test/xCAT-test.spec index 0625e5de9..e5f3d0fb5 100644 --- a/xCAT-test/xCAT-test.spec +++ b/xCAT-test/xCAT-test.spec @@ -28,7 +28,9 @@ Provides automated test tool and buckets to help test xCAT commands automaticall mkdir -p share/man/man1 mkdir -p share/doc/man1 pod2man pods/man1/xcattest.1.pod > share/man/man1/xcattest.1 +pod2man pods/man1/xcatperftest.1.pod > share/man/man1/xcatperftest.1 pod2html pods/man1/xcattest.1.pod > share/doc/man1/xcattest.1.html +pod2html pods/man1/xcatperftest.1.pod > share/doc/man1/xcatperftest.1.html %install # The install phase puts all of the files in the paths they should be in when the rpm is From d7c78132ee115468bb5a040b2672c4ea134d6cb6 Mon Sep 17 00:00:00 2001 From: Casandra Qiu Date: Thu, 18 May 2017 09:54:27 -0400 Subject: [PATCH 052/129] Supports range of ports for tagging vlan command --- xCAT-server/share/xcat/scripts/configMellanox | 54 ++++++++++++------- 1 file changed, 34 insertions(+), 20 deletions(-) diff --git a/xCAT-server/share/xcat/scripts/configMellanox b/xCAT-server/share/xcat/scripts/configMellanox index 8538eb5b9..ab2e798cc 100755 --- a/xCAT-server/share/xcat/scripts/configMellanox +++ b/xCAT-server/share/xcat/scripts/configMellanox @@ -341,9 +341,22 @@ sub run_rspconfig { } sub config_vlan { + my @ports; + my $port_input; # checking for port number, switches is checked earlier if ($::PORT) { - $port = $::PORT; + $port_input = $::PORT; + foreach my $num_str (split /,/, $port_input) { + if ($num_str =~ /-/) { + my ($min, $max) = split (/-/,$num_str); + while ($min < $max) { + push (@ports,$min); + $min++; + } + } else { + push (@ports,$num_str); + } + } } else { xCAT::MsgUtils->message("E","Error - When configuring VLAN, a port must be provided."); &usage; @@ -381,28 +394,29 @@ sub config_vlan { next; } + print "Tagging VLAN=$vlan for $switch port $port_input\n"; + + #create vlan + my $vlan_cmd = `xdsh $switch --devicetype $devicetype "enable;configure terminal;vlan $vlan;exit;exit" `; + my $cmd_prefix = "xdsh $switch --devicetype $devicetype"; - my $cmd; + foreach my $port (@ports) { + my $cmd; + # Build up the commands for easier readability + $cmd = $cmd . "enable\;"; + $cmd = $cmd . "configure terminal\;"; + $cmd = $cmd . "interface ethernet 1/$port\;"; + $cmd = $cmd . "switchport mode $mode\;"; + if ($mode =~ /access/) { + $cmd = $cmd . "switchport access vlan $vlan\;"; + } else { + $cmd = $cmd . "switchport $mode allowed-vlan $vlan\;"; + } + $cmd = $cmd . "exit\;exit\;exit\;"; + my $final_cmd = $cmd_prefix . " \"" . $cmd . "\""; - print "Tagging VLAN=$vlan for $switch port $port\n"; - - # Build up the commands for easier readability - $cmd = $cmd . "enable\;"; - $cmd = $cmd . "configure terminal\;"; - $cmd = $cmd . "vlan $vlan\;"; - $cmd = $cmd . "exit\;"; - $cmd = $cmd . "interface ethernet 1/$port\;"; - $cmd = $cmd . "switchport mode $mode\;"; - if ($mode =~ /access/) { - $cmd = $cmd . "switchport access vlan $vlan\;"; - } else { - $cmd = $cmd . "switchport $mode allowed-vlan $vlan\;"; + `$final_cmd` } - $cmd = $cmd . "exit\;exit\;exit\;"; - my $final_cmd = $cmd_prefix . " \"" . $cmd . "\""; - - `$final_cmd` - } } From 56fe5f42393dc6f76e87763a4bb0d17c8341d4e1 Mon Sep 17 00:00:00 2001 From: Casandra Qiu Date: Thu, 18 May 2017 11:27:59 -0400 Subject: [PATCH 053/129] change to < to <= --- xCAT-server/share/xcat/scripts/configMellanox | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-server/share/xcat/scripts/configMellanox b/xCAT-server/share/xcat/scripts/configMellanox index ab2e798cc..8095d3bc6 100755 --- a/xCAT-server/share/xcat/scripts/configMellanox +++ b/xCAT-server/share/xcat/scripts/configMellanox @@ -349,7 +349,7 @@ sub config_vlan { foreach my $num_str (split /,/, $port_input) { if ($num_str =~ /-/) { my ($min, $max) = split (/-/,$num_str); - while ($min < $max) { + while ($min <= $max) { push (@ports,$min); $min++; } From 7d109e915218ae7a5137b7410cdbfbf4b786b097 Mon Sep 17 00:00:00 2001 From: zet809 Date: Fri, 19 May 2017 11:29:07 +0800 Subject: [PATCH 054/129] Link 2.13.4 document --- README.rst | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 2cb961dfd..d8457bd7c 100644 --- a/README.rst +++ b/README.rst @@ -8,7 +8,7 @@ Documentation xCAT documentation is available at: http://xcat-docs.readthedocs.io/en/latest/ -|docs_latest| |docs_2133| |docs_2132| |docs_2131| |docs_2130| |docs_212| |docs_211| +|docs_latest| |docs_2134||docs_2133| |docs_2132| |docs_2131| |docs_2130| |docs_212| Open Source License ------------------- @@ -22,6 +22,11 @@ Developers Developers and prospective contributors are encouraged to read the `Developers Guide `_ In particular the `GitHub `_ related subsection. +.. |docs_2134| image:: https://readthedocs.org/projects/xcat-docs/badge/?version=2.13.4 + :alt: 2.13.4 documentation status + :scale: 100% + :target: http://xcat-docs.readthedocs.io/en/2.13.4/ + .. |docs_2133| image:: https://readthedocs.org/projects/xcat-docs/badge/?version=2.13.3 :alt: 2.13.3 documentation status :scale: 100% From 408d3a4fca85931fc2f413b4e5a522aecc7489b4 Mon Sep 17 00:00:00 2001 From: zet809 Date: Fri, 19 May 2017 11:29:35 +0800 Subject: [PATCH 055/129] Update README.rst --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index d8457bd7c..1d9a9e0ca 100644 --- a/README.rst +++ b/README.rst @@ -8,7 +8,7 @@ Documentation xCAT documentation is available at: http://xcat-docs.readthedocs.io/en/latest/ -|docs_latest| |docs_2134||docs_2133| |docs_2132| |docs_2131| |docs_2130| |docs_212| +|docs_latest| |docs_2134| |docs_2133| |docs_2132| |docs_2131| |docs_2130| |docs_212| Open Source License ------------------- From f2a09bc62b166ae37f39dea590ffc6a555d80f65 Mon Sep 17 00:00:00 2001 From: zet809 Date: Fri, 19 May 2017 11:32:24 +0800 Subject: [PATCH 056/129] Bump to 2.13.5 after 2.13.4 release --- Version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Version b/Version index 965a689ec..8bbab5627 100644 --- a/Version +++ b/Version @@ -1 +1 @@ -2.13.4 +2.13.5 From b57f085b8182c209e45851fe6c4d47f9d97479f4 Mon Sep 17 00:00:00 2001 From: hu-weihua Date: Fri, 19 May 2017 04:12:13 -0400 Subject: [PATCH 057/129] Run all cases specified by command line, do not skip invalid case --- xCAT-test/xcattest | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-test/xcattest b/xCAT-test/xcattest index 6c7f0b5d8..3ffd7cfd4 100755 --- a/xCAT-test/xcattest +++ b/xCAT-test/xcattest @@ -1016,7 +1016,7 @@ sub load_case { } } log_this($running_log_fd, "To run:", @new_cases_to_be_run); - @{$cases_to_be_run_ref} = @new_cases_to_be_run; + #@{$cases_to_be_run_ref} = @new_cases_to_be_run; } } return $caseerror; From 4fd1aeae80f1429f2dd6fa4d37fb5e68fd893e79 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Fri, 19 May 2017 13:05:18 -0400 Subject: [PATCH 058/129] Handle openbmc transition states --- xCAT-server/lib/xcat/plugins/openbmc.pm | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index 519a4a13c..f3adf401b 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -848,11 +848,23 @@ sub rpower_response { if ($node_info{$node}{cur_status} eq "RPOWER_STATUS_RESPONSE" and !$next_status{ $node_info{$node}{cur_status} }) { if ($response_info->{'data'}->{CurrentHostState} =~ /Off$/) { - xCAT::SvrUtils::sendmsg("off", $callback, $node); + # State is off, but check if it is transitioning + if ($response_info->{'data'}->{RequestedHostTransition} =~ /On$/) { + xCAT::SvrUtils::sendmsg("powering-on", $callback, $node); + } + else { + xCAT::SvrUtils::sendmsg("off", $callback, $node); + } } elsif ($response_info->{'data'}->{CurrentHostState} =~ /Quiesced$/) { xCAT::SvrUtils::sendmsg("quiesced", $callback, $node); } else { - xCAT::SvrUtils::sendmsg("on", $callback, $node); + # State is on, but check if it is transitioning + if ($response_info->{'data'}->{RequestedHostTransition} =~ /Off$/) { + xCAT::SvrUtils::sendmsg("powering-off", $callback, $node); + } + else { + xCAT::SvrUtils::sendmsg("on", $callback, $node); + } } } From f2df60815620144099194bd63717d2998251cc66 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Fri, 19 May 2017 14:30:14 -0400 Subject: [PATCH 059/129] Sync up .rst files --- docs/source/guides/admin-guides/references/man5/networks.5.rst | 2 +- docs/source/guides/admin-guides/references/man7/network.7.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/source/guides/admin-guides/references/man5/networks.5.rst b/docs/source/guides/admin-guides/references/man5/networks.5.rst index b9ab58208..c71afb5f2 100644 --- a/docs/source/guides/admin-guides/references/man5/networks.5.rst +++ b/docs/source/guides/admin-guides/references/man5/networks.5.rst @@ -138,7 +138,7 @@ networks Attributes: \ **mtu**\ - The default MTU for the network + The default MTU for the network, If multiple networks are applied to the same nic on the SN and/or CN, the MTU shall be the same for those networks. diff --git a/docs/source/guides/admin-guides/references/man7/network.7.rst b/docs/source/guides/admin-guides/references/man7/network.7.rst index 644e12908..593a52fb0 100644 --- a/docs/source/guides/admin-guides/references/man7/network.7.rst +++ b/docs/source/guides/admin-guides/references/man7/network.7.rst @@ -89,7 +89,7 @@ network Attributes: \ **mtu**\ (networks.mtu) - The default MTU for the network + The default MTU for the network, If multiple networks are applied to the same nic on the SN and/or CN, the MTU shall be the same for those networks. From 327f570f7c946747cf1c5113a04e074b1a2bc20f Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Fri, 19 May 2017 16:20:21 -0400 Subject: [PATCH 060/129] Changes due to review --- xCAT-server/lib/xcat/plugins/openbmc.pm | 30 +++++++++++++++++-------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index f3adf401b..b5a31fe49 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -29,6 +29,14 @@ use xCAT::SvrUtils; use xCAT::GlobalDef; use xCAT_monitoring::monitorctrl; +# String constants for rpower states +$::POWER_STATE_OFF="off"; +$::POWER_STATE_ON="on"; +$::POWER_STATE_POWERING_OFF="powering-off"; +$::POWER_STATE_POWERING_ON="powering-on"; +$::POWER_STATE_QUIESCED="quiesced"; +$::POWER_STATE_RESET="reset"; + sub unsupported { my $callback = shift; if (defined($::OPENBMC_DEVEL) && ($::OPENBMC_DEVEL eq "YES")) { @@ -825,21 +833,21 @@ sub rpower_response { if ($node_info{$node}{cur_status} eq "RPOWER_ON_RESPONSE") { if ($response_info->{'message'} eq $::RESPONSE_OK) { - xCAT::SvrUtils::sendmsg("on", $callback, $node); + xCAT::SvrUtils::sendmsg("$::POWER_STATE_ON", $callback, $node); $new_status{$::STATUS_POWERING_ON} = [$node]; } } if ($node_info{$node}{cur_status} eq "RPOWER_OFF_RESPONSE") { if ($response_info->{'message'} eq $::RESPONSE_OK) { - xCAT::SvrUtils::sendmsg("off", $callback, $node); + xCAT::SvrUtils::sendmsg("$::POWER_STATE_OFF", $callback, $node); $new_status{$::STATUS_POWERING_OFF} = [$node]; } } if ($node_info{$node}{cur_status} eq "RPOWER_RESET_RESPONSE") { if ($response_info->{'message'} eq $::RESPONSE_OK) { - xCAT::SvrUtils::sendmsg("reset", $callback, $node); + xCAT::SvrUtils::sendmsg("$::POWER_STATE_RESET", $callback, $node); $new_status{$::STATUS_POWERING_ON} = [$node]; } } @@ -850,22 +858,26 @@ sub rpower_response { if ($response_info->{'data'}->{CurrentHostState} =~ /Off$/) { # State is off, but check if it is transitioning if ($response_info->{'data'}->{RequestedHostTransition} =~ /On$/) { - xCAT::SvrUtils::sendmsg("powering-on", $callback, $node); + xCAT::SvrUtils::sendmsg("$::POWER_STATE_POWERING_ON", $callback, $node); } else { - xCAT::SvrUtils::sendmsg("off", $callback, $node); + xCAT::SvrUtils::sendmsg("$::POWER_STATE_OFF", $callback, $node); } } elsif ($response_info->{'data'}->{CurrentHostState} =~ /Quiesced$/) { - xCAT::SvrUtils::sendmsg("quiesced", $callback, $node); - } else { + xCAT::SvrUtils::sendmsg("$::POWER_STATE_QUIESCED", $callback, $node); + } elsif ($response_info->{'data'}->{CurrentHostState} =~ /Running$/) { # State is on, but check if it is transitioning if ($response_info->{'data'}->{RequestedHostTransition} =~ /Off$/) { - xCAT::SvrUtils::sendmsg("powering-off", $callback, $node); + xCAT::SvrUtils::sendmsg("$::POWER_STATE_POWERING_OFF", $callback, $node); } else { - xCAT::SvrUtils::sendmsg("on", $callback, $node); + xCAT::SvrUtils::sendmsg("$::POWER_STATE_ON", $callback, $node); } } + else { + my $unexpected_state = $response_info->{'data'}->{CurrentHostState}; + xCAT::SvrUtils::sendmsg("Unexpected state - $unexpected_state", $callback, $node); + } } if ($next_status{ $node_info{$node}{cur_status} }) { From a290657965dc6e01c05bf374357c507cbebcc1e5 Mon Sep 17 00:00:00 2001 From: hu-weihua Date: Mon, 22 May 2017 04:06:14 -0400 Subject: [PATCH 061/129] Fix bug: failed to handle multiple cases with the same case name --- xCAT-test/xcattest | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/xCAT-test/xcattest b/xCAT-test/xcattest index 3ffd7cfd4..600cb5d93 100755 --- a/xCAT-test/xcattest +++ b/xCAT-test/xcattest @@ -819,6 +819,7 @@ sub load_case { my $fd = undef; my %invalidcases; + my %case_name_index_map_bak; foreach my $file (@files) { if (!open($fd, "<$file")) { $$error_ref = "Can't open $file: $!"; @@ -839,6 +840,9 @@ sub load_case { $case_ref->[$i] = {}; $case_ref->[$i]->{name} = $name; $case_ref->[$i]->{filename} = $file; + if(exists($$case_name_index_map_ref{"$name"})){ + $case_name_index_map_bak{"$name"}=$$case_name_index_map_ref{"$name"}; + } $$case_name_index_map_ref{"$name"} = $i; $newcmdstart = 0; } else { @@ -856,6 +860,9 @@ sub load_case { $case_ref->[$i] = {}; $case_ref->[$i]->{name} = $name; $case_ref->[$i]->{filename} = $file; + if(exists($$case_name_index_map_ref{"$name"})){ + $case_name_index_map_bak{"$name"}=$$case_name_index_map_ref{"$name"}; + } $$case_name_index_map_ref{"$name"} = $i; $newcmdstart = 0; } else { @@ -890,7 +897,12 @@ sub load_case { } } unless ($valid) { - $skip = 1; + #$skip = 1; + if(exists($case_name_index_map_bak{$case_ref->[$i]->{name}})){ + $$case_name_index_map_ref{$case_ref->[$i]->{name}}=$case_name_index_map_bak{$case_ref->[$i]->{name}}; + }else{ + delete $$case_name_index_map_ref{$case_ref->[$i]->{name}}; + } push @{ $invalidcases{"noruncases"} }, $case_ref->[$i]->{name}; } } @@ -1099,8 +1111,8 @@ sub run_case { my $case_start_time = timelocal(localtime()); my $case_start_time_str = scalar(localtime()); - log_this($running_log_fd, "------START:$cases_ref->[$case_name_index_map_ref->{$case}]->{name}::Time:$case_start_time_str------\n"); - push @caselog, "------START:$cases_ref->[$case_name_index_map_ref->{$case}]->{name}::Time:$case_start_time_str------\n"; + log_this($running_log_fd, "------START::$cases_ref->[$case_name_index_map_ref->{$case}]->{name}::Time:$case_start_time_str------\n"); + push @caselog, "------START::$cases_ref->[$case_name_index_map_ref->{$case}]->{name}::Time:$case_start_time_str------\n"; push @caselog, "FILENAME:$cases_ref->[$case_name_index_map_ref->{$case}]->{filename}\n"; foreach my $cmd (@{ $cases_ref->[ $case_name_index_map_ref->{$case} ]->{cmd} }) { From ea2d22887ba8b421571b7e720aa9a5d60a070d84 Mon Sep 17 00:00:00 2001 From: Casandra Qiu Date: Mon, 22 May 2017 15:27:11 -0400 Subject: [PATCH 062/129] Modify pdu error message and check pdu version for different OID --- xCAT-server/lib/xcat/plugins/pdu.pm | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/pdu.pm b/xCAT-server/lib/xcat/plugins/pdu.pm index 17e66f50c..e92a7dc0d 100644 --- a/xCAT-server/lib/xcat/plugins/pdu.pm +++ b/xCAT-server/lib/xcat/plugins/pdu.pm @@ -287,11 +287,11 @@ sub powerpduoutlet { my ($pdu, $outlet) = split /:/, $pdu_outlet; my $session = connectTopdu($pdu,$callback); if (!$session) { - $callback->({ errorcode => [1],error => "Couldn't connect to $pdu"}); + $callback->({ errorcode => [1],error => "$node: Couldn't connect to $pdu"}); next; } if ($outlet > $pdunodes->{$pdu}->{outlet} ) { - $callback->({ errorcode => [1],error => "outlet number $outlet is invalid for $pdu"}); + $callback->({ error => "$node: $pdu outlet number $outlet is invalid"}); next; } my $cmd; @@ -314,7 +314,7 @@ sub powerpduoutlet { } if ($session->{ErrorStr}) { - $callback->({ errorcode => [1],error => "$session->{ErrorStr} for $pdu outlet $outlet"}); + $callback->({ errorcode => [1],error => "$node: $pdu outlet $outlet has error = $session->{ErrorStr}"}); } else { $output = "$pdu outlet $outlet is $statstr"; xCAT::SvrUtils::sendmsg($output, $callback, $node, %allerrornodes); @@ -341,7 +341,8 @@ sub outletpower { my $type = "INTEGER"; if ($session->{newmib}) { $oid = ".1.3.6.1.4.1.2.6.223.8.2.2.1.13"; - } + } + my $varbind = new SNMP::Varbind([ $oid, $outlet, $value, $type ]); return $session->set($varbind); @@ -425,6 +426,7 @@ sub connectTopdu { my $community = "public"; my $session; my $msg = "connectTopdu"; + my $versionoid = ".1.3.6.1.4.1.2.6.223.7.3.0"; $session = new SNMP::Session( DestHost => $pdu, @@ -435,14 +437,17 @@ sub connectTopdu { unless ($session) { return; } - $session->{newmib} = 0; - my $pduversion = $session->get(".1.3.6.1.4.1.2.6.223.7.3.0"); - if ($pduversion =~ /(\d+)\.(\d+)_(\d+)/) { - if ($1 >= 1 and $2 >= 3 and $3 >= 3) { - $session->{newmib} = 1; - } + + my $varbind = new SNMP::Varbind([ $versionoid, '' ]); + my $pduversion = $session->get($varbind); + if ($session->{ErrorStr}) { + return; } + $session->{newmib} = 0; + if ($pduversion =~ /sLEN/) { + $session->{newmib} = 1; + } return $session; @@ -450,6 +455,4 @@ sub connectTopdu { - - 1; From 7f22c23bf03d3cf3276f5b7f7e9aabeb3b1062a3 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Mon, 22 May 2017 15:47:58 -0400 Subject: [PATCH 063/129] Open rpower and rinv commands --- xCAT-server/lib/xcat/plugins/openbmc.pm | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index 519a4a13c..b3cec10b4 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -32,10 +32,9 @@ use xCAT_monitoring::monitorctrl; sub unsupported { my $callback = shift; if (defined($::OPENBMC_DEVEL) && ($::OPENBMC_DEVEL eq "YES")) { - xCAT::SvrUtils::sendmsg("Warning: Currently running development code, use at your own risk. Unset XCAT_OPENBMC_DEVEL to disable.", $callback); return; } else { - return ([ 1, "This openbmc related function is unsupported and disabled. To bypass, run the following: \n\texport XCAT_OPENBMC_DEVEL=YES" ]); + return ([ 1, "This openbmc related function is not yet supported. Please contact xCAT development team." ]); } } @@ -382,24 +381,16 @@ sub parse_args { my $subcommand = $ARGV[0]; if ($command eq "rpower") { - # - # disable function until fully tested - # - $check = unsupported($callback); if (ref($check) eq "ARRAY") { return $check; } unless ($subcommand =~ /^on$|^off$|^reset$|^boot$|^status$|^stat$|^state$/) { return ([ 1, "Unsupported command: $command $subcommand" ]); } } elsif ($command eq "rinv") { - # - # disable function until fully tested - # - $check = unsupported($callback); if (ref($check) eq "ARRAY") { return $check; } $subcommand = "all" if (!defined($ARGV[0])); unless ($subcommand =~ /^cpu$|^dimm$|^model$|^serial$|^firm$|^mac$|^vpd$|^mprom$|^deviceid$|^guid$|^uuid$|^all$/) { return ([ 1, "Unsupported command: $command $subcommand" ]); } } elsif ($command eq "getopenbmccons") { - #command for openbmc rcons + # command for openbmc rcons } elsif ($command eq "rsetboot") { # # disable function until fully tested @@ -754,7 +745,7 @@ sub deal_with_response { if ($response->status_line ne $::RESPONSE_OK) { my $error; if ($response->status_line eq $::RESPONSE_SERVICE_UNAVAILABLE) { - $error = "Service Unavailable"; + $error = $::RESPONSE_SERVICE_UNAVAILABLE; } else { my $response_info = decode_json $response->content; if ($response->status_line eq $::RESPONSE_SERVER_ERROR) { From 7e2458d7de7fed435b8ec70f6f3264b473bc4f47 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Mon, 22 May 2017 16:39:16 -0400 Subject: [PATCH 064/129] Spelling fixes for docs/sources/advanced rst files --- .../compute_node/changing_hostname_ip.rst | 2 +- .../domain_name_resolution.rst | 2 +- .../advanced/gpu/nvidia/osimage/index.rst | 2 +- .../hamn/high_available_management_node.rst | 4 +- ...mgmt_node_with_drbd_pacemaker_corosync.rst | 20 +-- .../setup_ha_mgmt_node_with_shared_data.rst | 10 +- .../appendix/appendix_b_diagnostics.rst | 2 +- .../databases/postgres_configure.rst | 2 +- .../hierarchy/define_service_node.rst | 2 +- .../advanced/kit/custom/build/createkit.rst | 2 +- .../advanced/kit/custom/introduction.rst | 4 +- .../advanced/kit/custom/using/addkitcomp.rst | 4 +- docs/source/advanced/kit/hpc/quickstart.rst | 4 +- .../building_stateless_images.rst | 2 +- .../networks/infiniband/firmware_updates.rst | 2 +- .../infiniband/mlnxofed_ib_install_v2.rst | 2 +- .../mlnxofed_ib_install_v2_diskful.rst | 4 +- .../mlnxofed_ib_install_v2_diskless.rst | 4 +- .../mlnxofed_ib_install_v2_preparation.rst | 2 +- .../mlnxofed_ib_verified_scenario_matrix.rst | 2 +- .../infiniband/switch_configuration.rst | 2 +- .../onie_switches/os_cumulus/install.rst | 4 +- .../switch_based_switch_discovery.rst | 2 +- docs/source/advanced/networks/vlan/vlan.rst | 4 +- docs/source/advanced/probe/osdeploy.rst | 2 +- docs/source/advanced/raid/hardware_raid.rst | 2 +- .../restapi_resource/restapi_reference.rst | 144 +++++++++--------- docs/source/advanced/sysclone/sysclone.rst | 2 +- docs/source/advanced/zones/overview.rst | 2 +- 29 files changed, 121 insertions(+), 121 deletions(-) diff --git a/docs/source/advanced/cluster_maintenance/compute_node/changing_hostname_ip.rst b/docs/source/advanced/cluster_maintenance/compute_node/changing_hostname_ip.rst index 544f577cd..10b7a69c1 100644 --- a/docs/source/advanced/cluster_maintenance/compute_node/changing_hostname_ip.rst +++ b/docs/source/advanced/cluster_maintenance/compute_node/changing_hostname_ip.rst @@ -25,7 +25,7 @@ Remove Old Provision Environment Change Definition ----------------- -#. Change netwoks table definitions :: +#. Change networks table definitions :: lsdef -t network -l diff --git a/docs/source/advanced/domain_name_resolution/domain_name_resolution.rst b/docs/source/advanced/domain_name_resolution/domain_name_resolution.rst index 984bf79fe..7311f53ae 100644 --- a/docs/source/advanced/domain_name_resolution/domain_name_resolution.rst +++ b/docs/source/advanced/domain_name_resolution/domain_name_resolution.rst @@ -480,6 +480,6 @@ Sample table contents: :: Limited support for user application networks --------------------------------------------- -In some cases you may have additional user application networks in your site that are not specifically used for cluster management.If desired you can create xCAT network definitions for these networks.This not only provides a convenient way to keep track of the network details but the information can also be used to help set up name resolution for these networks on the cluster nodes.When you add a network definition that includes a **"domain"** value then that domain is automatically included the xCAT name resolution set up. This will enable the nodes to be able to resolve hostnames from the other domains. +In some cases you may have additional user application networks in your site that are not specifically used for cluster management. If desired you can create xCAT network definitions for these networks. This not only provides a convenient way to keep track of the network details but the information can also be used to help set up name resolution for these networks on the cluster nodes. When you add a network definition that includes a **"domain"** value then that domain is automatically included the xCAT name resolution set up. This will enable the nodes to be able to resolve hostnames from the other domains. For example, when you run ``makedhcp -n`` it will list all domains defined in the xCAT **"site"** definition and xCAT **"network"** definitions in the **"option domain-search"** entry of the shared-network stanza in the dhcp configuration file. This will cause dhcp to put these domains in the compute nodes' **/etc/resolv.conf** file every time it gets a dhcp lease. diff --git a/docs/source/advanced/gpu/nvidia/osimage/index.rst b/docs/source/advanced/gpu/nvidia/osimage/index.rst index 04d4af107..70a2aff30 100644 --- a/docs/source/advanced/gpu/nvidia/osimage/index.rst +++ b/docs/source/advanced/gpu/nvidia/osimage/index.rst @@ -1,7 +1,7 @@ Create osimage definitions ========================== -Generate ``osimage`` definitions to provison the compute nodes with the NVIDIA CUDA toolkit installed. +Generate ``osimage`` definitions to provision the compute nodes with the NVIDIA CUDA toolkit installed. .. toctree:: :maxdepth: 2 diff --git a/docs/source/advanced/hamn/high_available_management_node.rst b/docs/source/advanced/hamn/high_available_management_node.rst index da94390ae..ebd78cf57 100644 --- a/docs/source/advanced/hamn/high_available_management_node.rst +++ b/docs/source/advanced/hamn/high_available_management_node.rst @@ -13,7 +13,7 @@ The data synchronization is important for any high availability configuration. W * The configuration files for the services that are required by xCAT, like named, DHCP, apache, nfs, ssh, etc. * The operating systems images repository and users customization data repository, the ``/install`` directory contains these repositories in most cases. -There are a lot of ways for data synchronization, but considering the specific xCAT HAMN requirements, only several of the data synchronziation options are practical for xCAT HAMN. +There are a lot of ways for data synchronization, but considering the specific xCAT HAMN requirements, only several of the data synchronization options are practical for xCAT HAMN. **1\. Move physical disks between the two management nodes**: if we could physically move the hard disks from the failed management node to the backup management node, and bring up the backup management node, then both the operating system and xCAT data will be identical between the new management node and the failed management node. RAID1 or disk mirroring could be used to avoid the disk be a single point of failure. @@ -40,7 +40,7 @@ The configuration for the high availability applications is usually complex, it **3\. Maintenance effort** -The automatic failover brings in several high availability applications, after the initial configuration is done, additional maintenance effort will be needed. For example, taking care of the high availability applications during cluster update, the updates for the high availability applications themselves, trouble shooting any problems with the high availability applications. A simple question may be able to help you to decide: could you get technical support if some of the high availability applications run into problems? All software has bugs. +The automatic failover brings in several high availability applications, after the initial configuration is done, additional maintenance effort will be needed. For example, taking care of the high availability applications during cluster update, the updates for the high availability applications themselves, troubleshooting any problems with the high availability applications. A simple question may be able to help you to decide: could you get technical support if some of the high availability applications run into problems? All software has bugs. Configuration Options ===================== diff --git a/docs/source/advanced/hamn/setup_ha_mgmt_node_with_drbd_pacemaker_corosync.rst b/docs/source/advanced/hamn/setup_ha_mgmt_node_with_drbd_pacemaker_corosync.rst index 766580dad..91f9c6cd9 100644 --- a/docs/source/advanced/hamn/setup_ha_mgmt_node_with_drbd_pacemaker_corosync.rst +++ b/docs/source/advanced/hamn/setup_ha_mgmt_node_with_drbd_pacemaker_corosync.rst @@ -31,7 +31,7 @@ Configuration Requirements #. Since the management node needs to provide IP services through broadcast such as DHCP to the compute nodes, the primary management node and standby management node should be in the same subnet to ensure the network services will work correctly after failover. -#. Network connections between the two management nodes: there are several networks defined in the general cluster configuration strucutre, like cluster network, management network and service network; the two management nodes should be in all of these networks(if exist at all). Besides that, it is recommended, though not strictly required, to use a direct, back-to-back, Gigabit Ethernet or higher bandwidth connection for the DRBD, Pacemaker and Corosync communication between the two management nodes. If the connection is run over switches, use of redundant components and the bonding driver (in active-backup mode) is recommended. +#. Network connections between the two management nodes: there are several networks defined in the general cluster configuration structure, like cluster network, management network and service network; the two management nodes should be in all of these networks(if exist at all). Besides that, it is recommended, though not strictly required, to use a direct, back-to-back, Gigabit Ethernet or higher bandwidth connection for the DRBD, Pacemaker and Corosync communication between the two management nodes. If the connection is run over switches, use of redundant components and the bonding driver (in active-backup mode) is recommended. ``Note``: A crossover Ethernet cable is required to setup the direct, back-to-back, Ethernet connection between the two management nodes, but with most of the current hardware, a normal Ethernet cable can also work, the Ethernet adapters will internally handle the crossover bit. Hard disk for DRBD: DRBD device can be setup on a partition of the disk that the operating system runs on, but it is recommended to use a separate standalone disk or RAID/Multipath disk for DRBD configuration. @@ -63,7 +63,7 @@ You have several options to get the RPM packages for ``DRBD``, ``drbdlinks``, `` #. Compile from source code: if none of the options work for some specific applications, you will have to compile RPMs from the source code. You can compile these packages on one of the management node or on a separate build machine with the same arch and operating system with the management nodes. Here are the instructions for compiling the RPM packages from source code: -Before compiling the RPM packages, you need to install some compling tools like gcc, make, glibc, rpm-build. :: +Before compiling the RPM packages, you need to install some compiling tools like gcc, make, glibc, rpm-build. :: yum groupinstall "Development tools" yum install libxslt libxslt-devel @@ -402,13 +402,13 @@ Configure DRBD [>....................] sync'ed: 0.5% (101932/102400)M finish: 2:29:06 speed: 11,644 (11,444) K/sec - If a direct, back-to-back Gigabyte Ethernet connection is setup between the two management nodes and you are unhappy with the syncronization speed, it is possible to speed up the initial synchronization through some tunable parameters in DRBD. This setting is not permanent, and will not be retained after boot. For details, see http://www.drbd.org/users-guide-emb/s-configure-sync-rate.html. :: + If a direct, back-to-back Gigabyte Ethernet connection is setup between the two management nodes and you are unhappy with the synchronization speed, it is possible to speed up the initial synchronization through some tunable parameters in DRBD. This setting is not permanent, and will not be retained after boot. For details, see http://www.drbd.org/users-guide-emb/s-configure-sync-rate.html. :: drbdadm disk-options --resync-rate=110M xCAT #. Create file system on DRBD device and mount the file system - Even while the DRBD sync is taking place, you can go ahead and create a filesystem on the DRBD device, but it is recommended to wait for the inital full synchronization is finished before creating the file system. + Even while the DRBD sync is taking place, you can go ahead and create a filesystem on the DRBD device, but it is recommended to wait for the initial full synchronization is finished before creating the file system. After the initial full synchronization is finished, you can take the DRBD device as a normal disk partition to create file system and mount it to some directory. The DRDB device name is set in the ``/etc/drbd.d/xcat.res`` created in the previous step. In this doc, the DRBD device name is ``/dev/drbd1``. :: @@ -964,7 +964,7 @@ At this point, the HA MN Setup is complete, and customer workloads and system ad Failover ======== -There are two kinds of failover, planned failover and unplanned failover. The planned failover can be useful for updating the management nodes or any scheduled maintainance activities; the unplanned failover covers the unexpected hardware or software failures. +There are two kinds of failover, planned failover and unplanned failover. The planned failover can be useful for updating the management nodes or any scheduled maintenance activities; the unplanned failover covers the unexpected hardware or software failures. In a planned failover, you can do necessary cleanup work on the previous primary management node before failover to the previous standby management node. In a unplanned failover, the previous management node probably is not functioning at all, you can simply shutdown the system. @@ -1009,7 +1009,7 @@ To avoid this, run the following command to set the autostart for the corosync s Backup working Pacemaker configuration (Optional) ================================================= -It is a good practice to backup the working ``pacemaker`` configuration, the backup could be in both plain text format or XML format, the plain text is more easily editable and can be modified and used chunk by chunk, the xml can be used to do a full replacement restore. It will be very useful to make such a backup everytime before you make a change. +It is a good practice to backup the working ``pacemaker`` configuration, the backup could be in both plain text format or XML format, the plain text is more easily editable and can be modified and used chunk by chunk, the xml can be used to do a full replacement restore. It will be very useful to make such a backup every time before you make a change. To backup in the plain text format, run the following command: :: @@ -1182,7 +1182,7 @@ Trouble shooting and debug tips Disable HA MN ============= -For whatever reason, the user might want to disable HA MN, here is the procedur of disabling HA MN: +For whatever reason, the user might want to disable HA MN, here is the procedure of disabling HA MN: * Shut down standby management node @@ -1245,7 +1245,7 @@ Finally we commit the changes that are in xcat_cfg into the live system: :: pcs cluster push cib xcat_cfg -We then need to make sure that the ``/xCATdrbd/etc/drbdlinks.xCAT.conf`` file has the systemimager portion uncommented, and re-do the initialisation of drbdlinks as they have been done earlier in the documentation +We then need to make sure that the ``/xCATdrbd/etc/drbdlinks.xCAT.conf`` file has the systemimager portion uncommented, and re-do the initialization of drbdlinks as they have been done earlier in the documentation Appendix A ========== @@ -1428,7 +1428,7 @@ Finally we commit the changes that are in xcat_cfg into the live system: :: pcs cluster cib-push xcat_cfg -Once the changes have been commited, we can view the config, by running the command below: :: +Once the changes have been committed, we can view the config, by running the command below: :: pcs config @@ -1640,7 +1640,7 @@ Finally we commit the changes that are in xcat_cfg into the live system: :: pcs cluster cib-push xcat_cfg -Once the changes have been commited, we can view the config, by running the command below: :: +Once the changes have been committed, we can view the config, by running the command below: :: pcs config diff --git a/docs/source/advanced/hamn/setup_ha_mgmt_node_with_shared_data.rst b/docs/source/advanced/hamn/setup_ha_mgmt_node_with_shared_data.rst index 6a3e1b98a..3eff968e6 100644 --- a/docs/source/advanced/hamn/setup_ha_mgmt_node_with_shared_data.rst +++ b/docs/source/advanced/hamn/setup_ha_mgmt_node_with_shared_data.rst @@ -18,9 +18,9 @@ The nfs service on the primary management node or the primary management node it What is Shared Data ==================== -The term ``Shared Data`` means that the two management nodes use a single copy of xCAT data, no matter which management node is the primary MN, the cluster management capability is running on top of the single data copy. The acess to the data could be done through various ways like shared storage, NAS, NFS, samba etc. Based on the protocol being used, the data might be accessable only on one management node at a time or be accessable on both management nodes in parellel. If the data could only be accessed from one management node, the failover process need to take care of the data access transition; if the data could be accessed on both management nodes, the failover does not need to consider the data access transition, it usually means the failover process could be faster. +The term ``Shared Data`` means that the two management nodes use a single copy of xCAT data, no matter which management node is the primary MN, the cluster management capability is running on top of the single data copy. The access to the data could be done through various ways like shared storage, NAS, NFS, samba etc. Based on the protocol being used, the data might be accessible only on one management node at a time or be accessible on both management nodes in parallel. If the data could only be accessed from one management node, the failover process need to take care of the data access transition; if the data could be accessed on both management nodes, the failover does not need to consider the data access transition, it usually means the failover process could be faster. -``Warning``: Running database through network file system has a lot of potential problems and is not practical, however, most of the database system provides database replication feature that can be used to synronize the database between the two management nodes +``Warning``: Running database through network file system has a lot of potential problems and is not practical, however, most of the database system provides database replication feature that can be used to synchronize the database between the two management nodes Configuration Requirements ========================== @@ -248,7 +248,7 @@ Besides the files mentioned above, there may be some additional customization fi ``Note``: If the IBM HPC software stack is configured in your environment, execute additional steps required to copy additional data or configuration files for HAMN setup. -The dhcpsd.cnf should be syncronized between the primary management node and standby management node only when the DHCP configuration on the two management nodes are exactly the same. +The dhcpsd.cnf should be synchronized between the primary management node and standby management node only when the DHCP configuration on the two management nodes are exactly the same. Cluster Maintenance Considerations ================================== @@ -268,7 +268,7 @@ At this point, the HA MN Setup is complete, and customer workloads and system ad Failover ======== -There are two kinds of failover, planned failover and unplanned failover. The planned failover can be useful for updating the management nodes or any scheduled maintainance activities; the unplanned failover covers the unexpected hardware or software failures. +There are two kinds of failover, planned failover and unplanned failover. The planned failover can be useful for updating the management nodes or any scheduled maintenance activities; the unplanned failover covers the unexpected hardware or software failures. In a planned failover, you can do necessary cleanup work on the previous primary management node before failover to the previous standby management node. In a unplanned failover, the previous management node probably is not functioning at all, you can simply shutdown the system. @@ -367,7 +367,7 @@ On the new primary management node: **DNS**: run ``makedns``. Verify dns services working for node resolution. Make sure the line ``nameserver=`` is in ``/etc/resolv.conf``. - **DHCP**: if the dhcpd.leases is not syncronized between the primary management node and standby management node, run ``makedhcp -a`` to setup the DHCP leases. Verify dhcp is operational. + **DHCP**: if the dhcpd.leases is not synchronized between the primary management node and standby management node, run ``makedhcp -a`` to setup the DHCP leases. Verify dhcp is operational. **conserver**: run makeconservercf. This will recreate the ``/etc/conserver.cf`` config files for all the nodes. diff --git a/docs/source/advanced/hierarchy/appendix/appendix_b_diagnostics.rst b/docs/source/advanced/hierarchy/appendix/appendix_b_diagnostics.rst index d30fc59db..768395548 100644 --- a/docs/source/advanced/hierarchy/appendix/appendix_b_diagnostics.rst +++ b/docs/source/advanced/hierarchy/appendix/appendix_b_diagnostics.rst @@ -15,4 +15,4 @@ Appendix B: Diagnostics * **Errors running hierarchical commands such as xdsh** -- xCAT has a number of commands that run hierarchically. That is, the commands are sent from xcatd on the management node to the correct service node xcatd, which in turn processes the command and sends the results back to xcatd on the management node. If a hierarchical command such as xcatd fails with something like "Error: Permission denied for request", check ``/var/log/messages`` on the management node for errors. One error might be "Request matched no policy rule". This may mean you will need to add policy table entries for your xCAT management node and service node. -* **/install is not mounted on service node from managemen mode** -- If service node does not have ``/install`` directory mounted from management node, run ``lsdef -t site clustersite -i installloc`` and verify ``installloc="/install"`` +* **/install is not mounted on service node from management mode** -- If service node does not have ``/install`` directory mounted from management node, run ``lsdef -t site clustersite -i installloc`` and verify ``installloc="/install"`` diff --git a/docs/source/advanced/hierarchy/databases/postgres_configure.rst b/docs/source/advanced/hierarchy/databases/postgres_configure.rst index 52db88e00..039b6c001 100644 --- a/docs/source/advanced/hierarchy/databases/postgres_configure.rst +++ b/docs/source/advanced/hierarchy/databases/postgres_configure.rst @@ -33,4 +33,4 @@ Restart PostgreSQL after editing the file: :: For more information about changing the ``pg_hab.conf`` file and ``postgresql.conf`` files, see the following documentation: -`Setup the PostgreSQL Configuraion Files `_ +`Setup the PostgreSQL Configuration Files `_ diff --git a/docs/source/advanced/hierarchy/define_service_node.rst b/docs/source/advanced/hierarchy/define_service_node.rst index dba32462c..6c5b5b3ef 100644 --- a/docs/source/advanced/hierarchy/define_service_node.rst +++ b/docs/source/advanced/hierarchy/define_service_node.rst @@ -179,7 +179,7 @@ compute node is rebooted or the compute node is explicitly moved to another SN using the `snmove `_ command. To use Service Node pools, you need to architect your network such that all of -the compute nodes and service nodes in a partcular pool are on the same flat +the compute nodes and service nodes in a particular pool are on the same flat network. If you don't want the management node to respond to manage some of the compute nodes, it shouldn't be on that same flat network. The site, dhcpinterfaces attribute should be set such that the SNs' DHCP daemon diff --git a/docs/source/advanced/kit/custom/build/createkit.rst b/docs/source/advanced/kit/custom/build/createkit.rst index 4061fbef4..fbb0e6118 100644 --- a/docs/source/advanced/kit/custom/build/createkit.rst +++ b/docs/source/advanced/kit/custom/build/createkit.rst @@ -112,7 +112,7 @@ minor version can be support following format: :: **kitpackage** --- This stanza defines Kit Package (ie. RPM). There can be zero or more kitpackage stanzas. For multiple package supports, need to #. Define one kitpackage section per supported OS. or - #. Define one kitpacakge stanza which contains multiple kitrepoid lines. For the RPM packages, users need to responsible for createing an RPM spec file that can run on multiple OSes. + #. Define one kitpacakge stanza which contains multiple kitrepoid lines. For the RPM packages, users need to responsible for creating an RPM spec file that can run on multiple OSes. :: diff --git a/docs/source/advanced/kit/custom/introduction.rst b/docs/source/advanced/kit/custom/introduction.rst index 4c847687e..febb1dbde 100644 --- a/docs/source/advanced/kit/custom/introduction.rst +++ b/docs/source/advanced/kit/custom/introduction.rst @@ -49,7 +49,7 @@ Kit Framework With time, the implementation of the xCAT Software Kit support may change. -In order to process a kit successfully, the kit must be conpatiable with the level of xCAT code that was used to build the kit. The xCAT kit commands and software kits contain the framework version and compatiable supported versions. +In order to process a kit successfully, the kit must be compatible with the level of xCAT code that was used to build the kit. The xCAT kit commands and software kits contain the framework version and compatible supported versions. To view the framework version, use the ``-v | --version`` option on :doc:`addkit ` :: @@ -59,7 +59,7 @@ To view the framework version, use the ``-v | --version`` option on :doc:`addkit compatible_frameworks = 0,1,2 -If the commands in the xCAT installation is not compatiable with the Software Kit obtained, update xCAT to a more recent release. +If the commands in the xCAT installation is not compatible with the Software Kit obtained, update xCAT to a more recent release. .. [#] PCM is IBM Platform Cluster Manager diff --git a/docs/source/advanced/kit/custom/using/addkitcomp.rst b/docs/source/advanced/kit/custom/using/addkitcomp.rst index f716770b8..0c396cf4b 100644 --- a/docs/source/advanced/kit/custom/using/addkitcomp.rst +++ b/docs/source/advanced/kit/custom/using/addkitcomp.rst @@ -14,7 +14,7 @@ To check if a kitcomponent is valid for an existing OS image definition run the chkkitcomp -i -If the kit component is compatible then add the kitcomponent to the OS image defintion using the addkitcomp command. :: +If the kit component is compatible then add the kitcomponent to the OS image definition using the addkitcomp command. :: addkitcomp -a -i @@ -34,7 +34,7 @@ The contents of the kit component may be listed by using the lskitcomponent comm Adding Multiple Versions of the Same Kit Component to an OS Image Definition ````````````````````````````````````````````````````````````````````````````` -xCAT allows to have multiple versions/releases of a product software kit available in the cluster. Typically, different OS image definitions corresponding to the different versions/releases of a product software stack. However, in some instances, may need mulitple versions/releases of the same product available within a single OS image. This is only feasible if the software product supports the install of multiple versions or releases of its product within an OS image. +xCAT allows to have multiple versions/releases of a product software kit available in the cluster. Typically, different OS image definitions corresponding to the different versions/releases of a product software stack. However, in some instances, may need multiple versions/releases of the same product available within a single OS image. This is only feasible if the software product supports the install of multiple versions or releases of its product within an OS image. Currently, it is not possible to install multiple versions of a product into an OS image using xCAT commands. xCAT uses yum on RedHat and zypper on SLES to install product rpms. These package managers do not provide an interface to install different versions of the same package, and will always force an upgrade of the package. We are investigating different ways to accomplish this function for future xCAT releases. diff --git a/docs/source/advanced/kit/hpc/quickstart.rst b/docs/source/advanced/kit/hpc/quickstart.rst index d76814907..74b8d83e4 100644 --- a/docs/source/advanced/kit/hpc/quickstart.rst +++ b/docs/source/advanced/kit/hpc/quickstart.rst @@ -77,7 +77,7 @@ The following software kits will be used to install the IBM HPC software stack o The ESSL software kit has an *external dependency* to the ``libxlf`` which is provided in the XLF software kit. Since it's already added in the above step, there is no action needed here. - If CUDA toolkit is being used, ESSL has a runtime dependency on the CUDA rpms. The adminstrator needs to create the repository for the CUDA 7.5 toolkit or a runtime error will occur when provisioning the node. See the :doc:`/advanced/gpu/nvidia/repo/index` section for more details about setting up the CUDA repository on the xCAT management node. :: + If CUDA toolkit is being used, ESSL has a runtime dependency on the CUDA rpms. The administrator needs to create the repository for the CUDA 7.5 toolkit or a runtime error will occur when provisioning the node. See the :doc:`/advanced/gpu/nvidia/repo/index` section for more details about setting up the CUDA repository on the xCAT management node. :: # # Assuming that the cuda repo has been configured at: @@ -101,7 +101,7 @@ The following software kits will be used to install the IBM HPC software stack o addkitcomp -a -i rhels7.2-ppc64le-install-compute \ essl-computenode-3264rtecuda-5.4.0-0-rhels-7.2-ppc64le - If the system doesn't have GPU and the CUDA toolkit is not needed, the adminstrator should not add the following kit components that requires the CUDA packages: ``essl-loginnode-5.4.0-0-rhels-7.2-ppc64le``, ``essl-computenode-3264rte-5.4.0-0-rhels-7.2-ppc64le`` and ``essl-computenode-3264rtecuda-5.4.0-0-rhels-7.2-ppc64le``. Check the ESSL installation guide: http://www.ibm.com/support/knowledgecenter/SSFHY8_5.4.0/com.ibm.cluster.essl.v5r4.essl300.doc/am5il_xcatinstall.htm + If the system doesn't have GPU and the CUDA toolkit is not needed, the administrator should not add the following kit components that requires the CUDA packages: ``essl-loginnode-5.4.0-0-rhels-7.2-ppc64le``, ``essl-computenode-3264rte-5.4.0-0-rhels-7.2-ppc64le`` and ``essl-computenode-3264rtecuda-5.4.0-0-rhels-7.2-ppc64le``. Check the ESSL installation guide: http://www.ibm.com/support/knowledgecenter/SSFHY8_5.4.0/com.ibm.cluster.essl.v5r4.essl300.doc/am5il_xcatinstall.htm #. Add the **Parallel ESSL** kitcomponents to osimage. diff --git a/docs/source/advanced/mixed_cluster/building_stateless_images.rst b/docs/source/advanced/mixed_cluster/building_stateless_images.rst index 7d1145095..4c9f9a344 100644 --- a/docs/source/advanced/mixed_cluster/building_stateless_images.rst +++ b/docs/source/advanced/mixed_cluster/building_stateless_images.rst @@ -1,7 +1,7 @@ Building Stateless/Diskless Images ================================== -A **stateless**, or **diskless**, provisioned nodes is one where the operating system image is deployed and loaded into memory. The Operating System (OS) does not store its files directly onto persistent storage (i.e hard disk drive, shared drive, usb, etc) and so subsequent rebooting of the machine results in loss of any state changes that happened while the machine was running. +A **stateless**, or **diskless**, provisioned nodes is one where the operating system image is deployed and loaded into memory. The Operating System (OS) does not store its files directly onto persistent storage (i.e. hard disk drive, shared drive, usb, etc) and so subsequent rebooting of the machine results in loss of any state changes that happened while the machine was running. To deploy stateless compute nodes, you must first create a stateless image. The "netboot" osimages created from ``copycds`` in the **osimage** table are sample osimage definitions that can be used for deploying stateless nodes. diff --git a/docs/source/advanced/networks/infiniband/firmware_updates.rst b/docs/source/advanced/networks/infiniband/firmware_updates.rst index a963c3356..e3d5f6c59 100644 --- a/docs/source/advanced/networks/infiniband/firmware_updates.rst +++ b/docs/source/advanced/networks/infiniband/firmware_updates.rst @@ -21,7 +21,7 @@ Burn new firmware on each ibaX: :: mstflint -d 0002:01:00.0 -i b -Note: if this is a PureFlex MezzanineP adapater then you must select the correct image for each ibaX device. Note the difference in the firmware image at end of filename: _0.bin (iba0/iba2) & _1.bin (iba1/iba3) +Note: if this is a PureFlex MezzanineP adapter then you must select the correct image for each ibaX device. Note the difference in the firmware image at end of filename: _0.bin (iba0/iba2) & _1.bin (iba1/iba3) Verify download successful: :: diff --git a/docs/source/advanced/networks/infiniband/mlnxofed_ib_install_v2.rst b/docs/source/advanced/networks/infiniband/mlnxofed_ib_install_v2.rst index 5658f2d1b..8a3a5a75c 100644 --- a/docs/source/advanced/networks/infiniband/mlnxofed_ib_install_v2.rst +++ b/docs/source/advanced/networks/infiniband/mlnxofed_ib_install_v2.rst @@ -1,7 +1,7 @@ Mellanox OFED Installation Script ================================= -Mellanox provides a tested and packaged version of the OpenFabrics Enterprise Distribution (OFED) driver, named Mellanox OFED (MLNX_OFED). To assist with the installation of the MLNX_OFED driver, xCAT provids a sample postscript: ``mlnxofed_ib_install.v2``. +Mellanox provides a tested and packaged version of the OpenFabrics Enterprise Distribution (OFED) driver, named Mellanox OFED (MLNX_OFED). To assist with the installation of the MLNX_OFED driver, xCAT provides a sample postscript: ``mlnxofed_ib_install.v2``. .. toctree:: :maxdepth: 2 diff --git a/docs/source/advanced/networks/infiniband/mlnxofed_ib_install_v2_diskful.rst b/docs/source/advanced/networks/infiniband/mlnxofed_ib_install_v2_diskful.rst index 610dd6384..96f263e4a 100644 --- a/docs/source/advanced/networks/infiniband/mlnxofed_ib_install_v2_diskful.rst +++ b/docs/source/advanced/networks/infiniband/mlnxofed_ib_install_v2_diskful.rst @@ -18,7 +18,7 @@ Diskful Installation chdef -t node -o \ -p postscripts="mlnxofed_ib_install -p /install//" - **[kernel mismatch issue]** The Mellanox OFED ISO is built againt a series of specific kernel version. If the version of the linux kernel does not match any of the Mellanox offered pre-built kernel modules, you can pass the ``--add-kernel-support`` argument to the Mellanox installation script to build the kernel modules based on the version you are using. :: + **[kernel mismatch issue]** The Mellanox OFED ISO is built against a series of specific kernel version. If the version of the linux kernel does not match any of the Mellanox offered pre-built kernel modules, you can pass the ``--add-kernel-support`` argument to the Mellanox installation script to build the kernel modules based on the version you are using. :: chdef -t node -o \ -p postscripts="mlnxofed_ib_install -p /install// \ @@ -42,4 +42,4 @@ Diskful Installation * Verify that the Mellanox IB drivers are located at: ``/lib/modules//extra/`` - * Use the ``ibv_devinfo`` comamnd to obtain information about the InfiniBand adapter. + * Use the ``ibv_devinfo`` command to obtain information about the InfiniBand adapter. diff --git a/docs/source/advanced/networks/infiniband/mlnxofed_ib_install_v2_diskless.rst b/docs/source/advanced/networks/infiniband/mlnxofed_ib_install_v2_diskless.rst index 36af543e7..3af2cb177 100644 --- a/docs/source/advanced/networks/infiniband/mlnxofed_ib_install_v2_diskless.rst +++ b/docs/source/advanced/networks/infiniband/mlnxofed_ib_install_v2_diskless.rst @@ -28,7 +28,7 @@ Diskless Installation *Note: The $1 is a argument that is passed to the the postinstall script at runtime.* - **[kernel mismatch issue]** The Mellanox OFED ISO is built againt a series of specific kernel version. If the version of the linux kernel does not match any of the Mellanox offered pre-built kernel modules, you can pass the ``--add-kernel-support`` argument to the Mellanox installation script to build the kernel modules based on the version you are using. :: + **[kernel mismatch issue]** The Mellanox OFED ISO is built against a series of specific kernel version. If the version of the linux kernel does not match any of the Mellanox offered pre-built kernel modules, you can pass the ``--add-kernel-support`` argument to the Mellanox installation script to build the kernel modules based on the version you are using. :: /install/postscripts/mlnxofed_ib_install \ -p /install// -m --add-kernel-support -end- \ @@ -62,4 +62,4 @@ Diskless Installation * Verify that the Mellanox IB drivers are located at: ``/lib/modules//extra/`` - * Use the ``ibv_devinfo`` comamnd to obtain information about the InfiniBand adapter. + * Use the ``ibv_devinfo`` command to obtain information about the InfiniBand adapter. diff --git a/docs/source/advanced/networks/infiniband/mlnxofed_ib_install_v2_preparation.rst b/docs/source/advanced/networks/infiniband/mlnxofed_ib_install_v2_preparation.rst index 929bdf674..48e40f8a2 100644 --- a/docs/source/advanced/networks/infiniband/mlnxofed_ib_install_v2_preparation.rst +++ b/docs/source/advanced/networks/infiniband/mlnxofed_ib_install_v2_preparation.rst @@ -22,7 +22,7 @@ The ``mlnxofed_ib_install.v2`` is a sample script intended to assist with the in # ensure the script has execute permission chmod +x /install/postscripts/mlnxofed_ib_install -#. Familarize the options available for the xCAT ``mlnxofed_ib_install`` script. +#. Familiarize the options available for the xCAT ``mlnxofed_ib_install`` script. +---------+------------------+----------------------------------------------------------+ | Option | Required | Description | diff --git a/docs/source/advanced/networks/infiniband/mlnxofed_ib_verified_scenario_matrix.rst b/docs/source/advanced/networks/infiniband/mlnxofed_ib_verified_scenario_matrix.rst index fd9bfded6..9849d2091 100644 --- a/docs/source/advanced/networks/infiniband/mlnxofed_ib_verified_scenario_matrix.rst +++ b/docs/source/advanced/networks/infiniband/mlnxofed_ib_verified_scenario_matrix.rst @@ -1,7 +1,7 @@ MLNX_OFED Support Matrix ======================== -The following ISO images and attributs have been verified by the xCAT Team. +The following ISO images and attributes have been verified by the xCAT Team. **RedHat Enterprise Linux** diff --git a/docs/source/advanced/networks/infiniband/switch_configuration.rst b/docs/source/advanced/networks/infiniband/switch_configuration.rst index 58e50e0ad..ab6bdf5ae 100644 --- a/docs/source/advanced/networks/infiniband/switch_configuration.rst +++ b/docs/source/advanced/networks/infiniband/switch_configuration.rst @@ -66,7 +66,7 @@ Then run the following: :: Setup syslog on the Switch -------------------------- -Use the following command to consolidate the syslog to the Management Node or Service Nodes, where ip is the addess of the MN or SN as known by the switch. :: +Use the following command to consolidate the syslog to the Management Node or Service Nodes, where ip is the address of the MN or SN as known by the switch. :: rspconfig mswitch logdest= diff --git a/docs/source/advanced/networks/onie_switches/os_cumulus/install.rst b/docs/source/advanced/networks/onie_switches/os_cumulus/install.rst index 8fa31ee71..e0d132dfb 100644 --- a/docs/source/advanced/networks/onie_switches/os_cumulus/install.rst +++ b/docs/source/advanced/networks/onie_switches/os_cumulus/install.rst @@ -12,7 +12,7 @@ xCAT provides support for detecting and installing the Cumulus Linux OS into ONI The mac address of the switch management port is required for xCAT to configure the DHCP information and send over the OS to install on the switch. - **[small clusters]** If you know the mac address of the management port on the switch, create the pre-defined switch defintion providing the mac address. :: + **[small clusters]** If you know the mac address of the management port on the switch, create the pre-defined switch definition providing the mac address. :: mkdef frame01sw1 --template onieswitch arch=armv71 \ ip=192.168.1.1 mac="aa:bb:cc:dd:ee:ff" @@ -32,7 +32,7 @@ xCAT provides support for detecting and installing the Cumulus Linux OS into ONI ip=192.168.4.1 switch=coresw1 switchport=4 ... - #. Leverage ``switchdiscover`` over the DHCP range to automatically detect the MAC address and write them into the predefined swtiches above. :: + #. Leverage ``switchdiscover`` over the DHCP range to automatically detect the MAC address and write them into the predefined switches above. :: switchdiscover --range diff --git a/docs/source/advanced/networks/switchdiscover/switch_based_switch_discovery.rst b/docs/source/advanced/networks/switchdiscover/switch_based_switch_discovery.rst index d2b9df8b7..356132d7f 100644 --- a/docs/source/advanced/networks/switchdiscover/switch_based_switch_discovery.rst +++ b/docs/source/advanced/networks/switchdiscover/switch_based_switch_discovery.rst @@ -155,7 +155,7 @@ These two config files are located in the **/opt/xcat/share/xcat/scripts** direc Switch Status ~~~~~~~~~~~~~ -During the switch-based switch discovery process, there are four states displayed. User may only see **switch_configed** status on node definition if discovery process succefully finished. +During the switch-based switch discovery process, there are four states displayed. User may only see **switch_configed** status on node definition if discovery process successfully finished. **Matched** --- Discovered switch is matched to predefine switch, **otherinterfaces** attribute is updated to dhcp IP address, and mac address, **switch type** and **usercomment** also updated with vendor information for the predefined switch. diff --git a/docs/source/advanced/networks/vlan/vlan.rst b/docs/source/advanced/networks/vlan/vlan.rst index 0e3e3840c..813f2fc60 100644 --- a/docs/source/advanced/networks/vlan/vlan.rst +++ b/docs/source/advanced/networks/vlan/vlan.rst @@ -206,7 +206,7 @@ There is no need to specify -i flag for removing nodes from a vlan. Remove a VLAN ------------- -The **rmvlan** command removes the given vlan ID from the cluster. It removes the vlan id from all the swithces involved, deconfigures the nodes so that vlan adaptor (tag) will be remved, cleans up /etc/hosts, DNS and database tables for the given vlan. +The **rmvlan** command removes the given vlan ID from the cluster. It removes the vlan id from all the switches involved, deconfigures the nodes so that vlan adaptor (tag) will be removed, cleans up /etc/hosts, DNS and database tables for the given vlan. For example: :: @@ -215,7 +215,7 @@ For example: :: VLAN Security ------------- -To make the vlan more secure, the root guard and the bpdu guard are enabled for each ports within the vlan by **mkvlan** and **chvlan** commands. This way it guards the topology changes on the switch by the hackers who hack the STP. However, when the vlan is removed by the **rmvlan** and the **chvlan (-d)** commands, the root guard and the bpdu guard are not disabled because the code cannot tell if the guards were enabled by the admin or not. If you want to remove the gurads after the vlan is removed, you need to use the switch command line interface to do so. Refer to the documents for the switch command line interfaces for details. +To make the vlan more secure, the root guard and the bpdu guard are enabled for each ports within the vlan by **mkvlan** and **chvlan** commands. This way it guards the topology changes on the switch by the hackers who hack the STP. However, when the vlan is removed by the **rmvlan** and the **chvlan (-d)** commands, the root guard and the bpdu guard are not disabled because the code cannot tell if the guards were enabled by the admin or not. If you want to remove the guards after the vlan is removed, you need to use the switch command line interface to do so. Refer to the documents for the switch command line interfaces for details. Limitation ---------- diff --git a/docs/source/advanced/probe/osdeploy.rst b/docs/source/advanced/probe/osdeploy.rst index 546d33198..c9a36f2f1 100644 --- a/docs/source/advanced/probe/osdeploy.rst +++ b/docs/source/advanced/probe/osdeploy.rst @@ -76,7 +76,7 @@ When all the nodes complete provisioning, the probe will exit and display output All nodes provisioned successfully [ OK ] -If there is something wrong when provisioning, this probe will exit when timeout is reachedd or ``Ctrl+C`` is pressed by user. The maximum time can be set by using ``-t`` as below(default 30 minutes) :: +If there is something wrong when provisioning, this probe will exit when timeout is reached or ``Ctrl+C`` is pressed by user. The maximum time can be set by using ``-t`` as below(default 30 minutes) :: xcatprobe osdeploy -n cn1 -t 30 diff --git a/docs/source/advanced/raid/hardware_raid.rst b/docs/source/advanced/raid/hardware_raid.rst index d6e0f3c8e..915f2b241 100644 --- a/docs/source/advanced/raid/hardware_raid.rst +++ b/docs/source/advanced/raid/hardware_raid.rst @@ -18,7 +18,7 @@ Following sections show how to use ``diskdiscover`` and ``configraid``, we assum Discovering disk devices ------------------------ -Command ``diskdiscover`` scans disk devices, it can get the overview of disks and RAID arrays information from compute node; The outputs contain useful information for ``configraid`` to configure RAID arrays, user can get ``pci_id``, ``pci_slot_name``, ``disk names``, ``RAID arrays`` and other informations from the outputs. It should be ran in xcat genesis system. It can be executed without input parameter or with pci_id, pci_id includes PCI vendor and device ID. For example, power8 SAS adapter pci_id is ``1014:034a``, ``1014`` is vendor info, ``034a`` is PCI-E IPR SAS Adapter, more info about pci_id refer to ``http://pci-ids.ucw.cz/read/PC/1014/``. +Command ``diskdiscover`` scans disk devices, it can get the overview of disks and RAID arrays information from compute node; The outputs contain useful information for ``configraid`` to configure RAID arrays, user can get ``pci_id``, ``pci_slot_name``, ``disk names``, ``RAID arrays`` and other information from the outputs. It should be ran in xcat genesis system. It can be executed without input parameter or with pci_id, pci_id includes PCI vendor and device ID. For example, power8 SAS adapter pci_id is ``1014:034a``, ``1014`` is vendor info, ``034a`` is PCI-E IPR SAS Adapter, more info about pci_id refer to ``http://pci-ids.ucw.cz/read/PC/1014/``. Here are steps to use ``diskdiscover``: diff --git a/docs/source/advanced/restapi/restapi_resource/restapi_reference.rst b/docs/source/advanced/restapi/restapi_resource/restapi_reference.rst index 1953a18ba..e00105af5 100644 --- a/docs/source/advanced/restapi/restapi_resource/restapi_reference.rst +++ b/docs/source/advanced/restapi/restapi_resource/restapi_reference.rst @@ -15,7 +15,7 @@ POST - Create a token. **Example:** -Aquire a token for user 'root'. :: +Acquire a token for user 'root'. :: #curl -X POST -k 'https://127.0.0.1/xcatws/tokens?userName=root&userPW=cluster&pretty=1' -H Content-Type:application/json --data '{"userName":"root","userPW":"cluster"}' @@ -62,8 +62,8 @@ Get all the node names from xCAT database. :: [URI:/nodes/{noderange}] - The node resource -------------------------------------------- -GET - Get all the attibutes for the node {noderange}. -````````````````````````````````````````````````````` +GET - Get all the attributes for the node {noderange}. +`````````````````````````````````````````````````````` The keyword ALLRESOURCES can be used as {noderange} which means to get node attributes for all the nodes. @@ -75,7 +75,7 @@ Refer to the man page: :doc:`lsdef ` @@ -101,7 +101,7 @@ Refer to the man page: :doc:`chdef ` @@ -597,7 +597,7 @@ Get all the vitails attributes for the node1. :: [URI:/nodes/{noderange}/vitals/{temp|voltage|wattage|fanspeed|power|leds...}] - The specific vital attributes for the node {noderange} -------------------------------------------------------------------------------------------------------------------------------------- -GET - Get the specific vitals attibutes. +GET - Get the specific vitals attributes. ```````````````````````````````````````` Refer to the man page: :doc:`rvitals ` @@ -628,7 +628,7 @@ Get the 'fanspeed' vitals attribute. :: [URI:/nodes/{noderange}/inventory] - The inventory attributes for the node {noderange} -------------------------------------------------------------------------------------- -GET - Get all the inventory attibutes. +GET - Get all the inventory attributes. `````````````````````````````````````` Refer to the man page: :doc:`rinv ` @@ -659,7 +659,7 @@ Get all the inventory attributes for node1. :: [URI:/nodes/{noderange}/inventory/{pci|model...}] - The specific inventory attributes for the node {noderange} -------------------------------------------------------------------------------------------------------------- -GET - Get the specific inventory attibutes. +GET - Get the specific inventory attributes. ``````````````````````````````````````````` Refer to the man page: :doc:`rinv ` @@ -714,7 +714,7 @@ Refer to the man page: :doc:`reventlog ` **Returns:** -* No output when execution is successfull. Otherwise output the error information in the Standard Error Format: {error:[msg1,msg2...],errocode:errornum}. +* No output when execution is successful. Otherwise output the error information in the Standard Error Format: {error:[msg1,msg2...],errocode:errornum}. **Example:** @@ -947,7 +947,7 @@ Refer to the man page: :doc:`chvm ` **Returns:** -* No output when execution is successfull. Otherwise output the error information in the Standard Error Format: {error:[msg1,msg2...],errocode:errornum}. +* No output when execution is successful. Otherwise output the error information in the Standard Error Format: {error:[msg1,msg2...],errocode:errornum}. **Example1:** @@ -982,7 +982,7 @@ Refer to the man page: :doc:`mkvm ` **Returns:** -* No output when execution is successfull. Otherwise output the error information in the Standard Error Format: {error:[msg1,msg2...],errocode:errornum}. +* No output when execution is successful. Otherwise output the error information in the Standard Error Format: {error:[msg1,msg2...],errocode:errornum}. **Example:** @@ -1003,7 +1003,7 @@ Refer to the man page: :doc:`rmvm ` **Returns:** -* No output when execution is successfull. Otherwise output the error information in the Standard Error Format: {error:[msg1,msg2...],errocode:errornum}. +* No output when execution is successful. Otherwise output the error information in the Standard Error Format: {error:[msg1,msg2...],errocode:errornum}. **Example:** @@ -1112,7 +1112,7 @@ Refer to the man page: :doc:`copycds ` @@ -1173,7 +1173,7 @@ Refer to the man page: :doc:`chdef ` **Returns:** -* No output when execution is successfull. Otherwise output the error information in the Standard Error Format: {error:[msg1,msg2...],errocode:errornum}. +* No output when execution is successful. Otherwise output the error information in the Standard Error Format: {error:[msg1,msg2...],errocode:errornum}. **Example1:** @@ -1284,7 +1284,7 @@ Refer to the man page: :doc:`rmimage ` @@ -1385,7 +1385,7 @@ Refer to the man page: :doc:`chdef ` @@ -1648,7 +1648,7 @@ Refer to the man page: :doc:`lsdef ` @@ -1668,7 +1668,7 @@ Refer to the man page: :doc:`chdef Date: Mon, 22 May 2017 22:04:31 -0400 Subject: [PATCH 065/129] Move stop label from redhat_migration test case --- xCAT-test/autotest/testcase/migration/redhat_migration | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/xCAT-test/autotest/testcase/migration/redhat_migration b/xCAT-test/autotest/testcase/migration/redhat_migration index 0cd7f859c..245a087e8 100644 --- a/xCAT-test/autotest/testcase/migration/redhat_migration +++ b/xCAT-test/autotest/testcase/migration/redhat_migration @@ -101,8 +101,7 @@ end start:redhat_migration2 os:Linux description:update xCAT from $$MIGRATION2_VERSION to latest version, these two global parameter defined in config file -stop:yes - +#stop:yes cmd:if ping -c 1 $$SN > /dev/null;then rpower $$SN off > /dev/null;fi cmd:chdef -t node -o $$CN servicenode= monserver=$$MN nfsserver=$$MN tftpserver=$$MN xcatmaster=$$MN check:rc==0 From aeb2f4e5fabed5bdcb33ff8277877036865566c7 Mon Sep 17 00:00:00 2001 From: hu-weihua Date: Mon, 22 May 2017 22:27:16 -0400 Subject: [PATCH 066/129] Modify a typo for xcattest --- xCAT-test/xcattest | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-test/xcattest b/xCAT-test/xcattest index 600cb5d93..97b17825c 100755 --- a/xCAT-test/xcattest +++ b/xCAT-test/xcattest @@ -882,7 +882,7 @@ sub load_case { my @newvalidoslist = (); foreach my $validos (@validoslist) { if ($validos =~ /linux/i) { - push(@newvalidoslist, ("rhel", "sles", "ubnutu")); + push(@newvalidoslist, ("rhel", "sles", "ubuntu")); } else { push(@newvalidoslist, $validos); } From e2f2d67ba882d3fc505832fe3fb80f1599ffabf5 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Mon, 22 May 2017 22:41:14 -0400 Subject: [PATCH 067/129] Check the failed nodes array before printing out the (#3110) error messages --- xCAT-server/lib/xcat/plugins/rinstall.pm | 32 +++++++++++++++--------- 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/rinstall.pm b/xCAT-server/lib/xcat/plugins/rinstall.pm index 6b5d70f7b..7857aaa21 100644 --- a/xCAT-server/lib/xcat/plugins/rinstall.pm +++ b/xCAT-server/lib/xcat/plugins/rinstall.pm @@ -364,9 +364,11 @@ sub rinstall { } } my $rsp = {}; - $rsp->{error}->[0] = "failed to run 'nodeset' against the following nodes: @failurenodes"; - $rsp->{errorcode}->[0] = 1; - xCAT::MsgUtils->message("E", $rsp, $callback); + if (0+@failurenodes > 0) { + $rsp->{error}->[0] = "Failed to run 'nodeset' against the following nodes: @failurenodes"; + $rsp->{errorcode}->[0] = 1; + xCAT::MsgUtils->message("E", $rsp, $callback); + } @nodes = @successnodes; } @@ -430,9 +432,11 @@ sub rinstall { } } my $rsp = {}; - $rsp->{error}->[0] = "failed to run 'rnetboot' against the following nodes: @failurenodes"; - $rsp->{errorcode}->[0] = 1; - xCAT::MsgUtils->message("E", $rsp, $callback); + if (0+@failurenodes > 0) { + $rsp->{error}->[0] = "Failed to run 'rnetboot' against the following nodes: @failurenodes"; + $rsp->{errorcode}->[0] = 1; + xCAT::MsgUtils->message("E", $rsp, $callback); + } } } else { @@ -493,9 +497,11 @@ sub rinstall { } } my $rsp = {}; - $rsp->{error}->[0] = "failed to run 'rsetboot' against the following nodes: @failurenodes"; - $rsp->{errorcode}->[0] = 1; - xCAT::MsgUtils->message("E", $rsp, $callback); + if (0+@failurenodes > 0) { + $rsp->{error}->[0] = "Failed to run 'rsetboot' against the following nodes: @failurenodes"; + $rsp->{errorcode}->[0] = 1; + xCAT::MsgUtils->message("E", $rsp, $callback); + } @nodes = @successnodes; } } @@ -549,9 +555,11 @@ sub rinstall { } } my $rsp = {}; - $rsp->{error}->[0] = "failed to run 'rpower' against the following nodes: @failurenodes"; - $rsp->{errorcode}->[0] = 1; - xCAT::MsgUtils->message("E", $rsp, $callback); + if (0+@failurenodes > 0) { + $rsp->{error}->[0] = "Failed to run 'rpower' against the following nodes: @failurenodes"; + $rsp->{errorcode}->[0] = 1; + xCAT::MsgUtils->message("E", $rsp, $callback); + } } } } From bd60341cb68cff6464855cf66b5595cf30e00185 Mon Sep 17 00:00:00 2001 From: cxhong Date: Mon, 22 May 2017 22:45:18 -0400 Subject: [PATCH 068/129] Support ZTP process for Cumulus Switch (#3085) * Support ZTP process for Cumulus Switch * change name of onieztp to cumulusztp and add server ip --- xCAT-server/lib/xcat/plugins/dhcp.pm | 5 ++++ xCAT/postscripts/cumulusztp | 34 ++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100755 xCAT/postscripts/cumulusztp diff --git a/xCAT-server/lib/xcat/plugins/dhcp.pm b/xCAT-server/lib/xcat/plugins/dhcp.pm index e2ff8556a..301796b0a 100644 --- a/xCAT-server/lib/xcat/plugins/dhcp.pm +++ b/xCAT-server/lib/xcat/plugins/dhcp.pm @@ -2271,6 +2271,7 @@ sub addnet6 push @netent, " option domain-search $domainstring;\n"; } } + my $nameservers = $netcfgs{$net}->{nameservers}; if ($nameservers and $nameservers =~ /:/) { @@ -2574,6 +2575,7 @@ sub addnet push @netent, " option interface-mtu $mtu;\n"; } + # add domain-search if not sles10 or rh5 my $osv = xCAT::Utils->osver(); unless (($osv =~ /^sle[sc]10/) || ($osv =~ /^rh.*5$/)) { @@ -2591,6 +2593,8 @@ sub addnet push @netent, " option domain-search $domainstring;\n"; } } + #for cumulus ZTP process + push @netent, " option cumulus-provision-url \"http://$tftp/install/postscripts/cumulusztp\";\n"; my $ddnserver = $nameservers; $ddnserver =~ s/,.*//; @@ -2928,6 +2932,7 @@ sub newconfig } push @dhcpconf, "option gpxe.no-pxedhcp 1;\n"; push @dhcpconf, "option www-server code 114 = string;\n"; + push @dhcpconf, "option cumulus-provision-url code 239 = text;\n"; push @dhcpconf, "\n"; push @dhcpconf, "omapi-port 7911;\n"; #Enable omapi... push @dhcpconf, "key xcat_key {\n"; diff --git a/xCAT/postscripts/cumulusztp b/xCAT/postscripts/cumulusztp new file mode 100755 index 000000000..311cdfdf1 --- /dev/null +++ b/xCAT/postscripts/cumulusztp @@ -0,0 +1,34 @@ +#!/bin/bash +function error() { + echo -e "\e[0;33mERROR: The Zero Touch Provisioning script failed while running the command $BASH_COMMAND at line $BASH_LINENO.\e[0m" >&2 + exit 1 +} + +# Log all output from this script +exec >/var/log/autoprovision 2>&1 + +trap error ERR + +#Add Debian Repositories +echo "deb http://http.us.debian.org/debian jessie main" >> /etc/apt/sources.list +echo "deb http://security.debian.org/ jessie/updates main" >> /etc/apt/sources.list + +#get ip address for server node +server_ip=`grep cumulus-provision-url /var/lib/dhcp/dhclient.eth0.leases | tail -1 | awk -F/ '{print $3}'` + +#push root ssh keys, config passwordless +echo "CumulusLinux!" | sudo -S mkdir -p /root/.ssh +echo "CumulusLinux!" | sudo -S /usr/bin/wget -O /root/.ssh/authorized_keys http://$server_ip/install/postscripts/_ssh/authorized_keys + +#enable and config snmpd +echo "CumulusLinux!" | sudo -S /usr/bin/wget -O /home/cumulus/enablesnmp http://$server_ip/install/postscripts/enablesnmp +sudo chmod +x /home/cumulus/enablesnmp +sudo /home/cumulus/enablesnmp + +#config base interface +echo "CumulusLinux!" | sudo -S /usr/bin/wget -O /home/cumulus/configinterface http://$server_ip/install/postscripts/configinterface +sudo chmod +x /home/cumulus/configinterface +sudo /home/cumulus/configinterface + +# CUMULUS-AUTOPROVISIONING +exit 0 From 4515d197d903405678cf26e8d4d7e1b12c13b810 Mon Sep 17 00:00:00 2001 From: XuWei Date: Tue, 23 May 2017 02:34:15 -0400 Subject: [PATCH 069/129] Use LWP to send https request in bmcdiscover instead of curl command --- xCAT-server/lib/xcat/plugins/bmcdiscover.pm | 25 +++++++++++++-------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/bmcdiscover.pm b/xCAT-server/lib/xcat/plugins/bmcdiscover.pm index 4f6bce095..d0e58e533 100644 --- a/xCAT-server/lib/xcat/plugins/bmcdiscover.pm +++ b/xCAT-server/lib/xcat/plugins/bmcdiscover.pm @@ -29,6 +29,9 @@ use Data::Dumper; use File::Basename; use File::Path; use Cwd; +use LWP; +use HTTP::Cookies; +use HTTP::Response; use JSON; my $nmap_path; @@ -1040,14 +1043,20 @@ sub bmcdiscovery_openbmc{ my $node = sprintf("node-%08x", unpack("N*", inet_aton($ip))); my $node_data = $ip; - my $cjar_file = "/tmp/cjar_$ip"; + my $brower = LWP::UserAgent->new( ssl_opts => { verify_hostname => 0 }, ); + my $cookie_jar = HTTP::Cookies->new(); + my $header = HTTP::Headers->new('Content-Type' => 'application/json'); + my $url = "https://$ip/login"; my $data = '{"data": [ "' . $openbmc_user .'", "' . $openbmc_pass . '" ] }'; - - my $output = `curl -c $cjar_file -k -X POST -H \"Content-Type: application/json\" -d '$data' https://$ip/login`; + $brower->cookie_jar($cookie_jar); + my $request = HTTP::Request->new( 'POST', $url, $header, $data ); + my $response = $brower->request($request); - if ($output =~ /\"status\": \"ok\"/) { - my $req_output = `curl -b $cjar_file -k https://$ip/xyz/openbmc_project/inventory/system/chassis/motherboard`; - my $response = decode_json $req_output; + if ($response->is_success) { + my $req_url = "https://$ip/xyz/openbmc_project/inventory/system/chassis/motherboard"; + my $get_req = HTTP::Request->new('GET', $req_url, $header); + my $req_output = $brower->request($get_req); + my $response = decode_json $req_output->content; my $mtm; my $serial; @@ -1080,10 +1089,8 @@ sub bmcdiscovery_openbmc{ $node =~ s/(.*)/\L$1/g; $node =~ s/[\s:\._]/-/g; } - - unlink $cjar_file; } else { - if ($output =~ /\"description\": \"Invalid username or password\"/) { + if ($response->content =~ /\"description\": \"Invalid username or password\"/) { xCAT::MsgUtils->message("W", { data => ["Invalid username or password for $ip"] }, $::CALLBACK); } return; From 75cb09d112575c9cb5f56bcb49541d72665052c6 Mon Sep 17 00:00:00 2001 From: XuWei Date: Tue, 23 May 2017 03:41:30 -0400 Subject: [PATCH 070/129] modified depending on comments --- xCAT-server/lib/xcat/plugins/bmcdiscover.pm | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/bmcdiscover.pm b/xCAT-server/lib/xcat/plugins/bmcdiscover.pm index d0e58e533..28e0d951d 100644 --- a/xCAT-server/lib/xcat/plugins/bmcdiscover.pm +++ b/xCAT-server/lib/xcat/plugins/bmcdiscover.pm @@ -1049,13 +1049,14 @@ sub bmcdiscovery_openbmc{ my $url = "https://$ip/login"; my $data = '{"data": [ "' . $openbmc_user .'", "' . $openbmc_pass . '" ] }'; $brower->cookie_jar($cookie_jar); - my $request = HTTP::Request->new( 'POST', $url, $header, $data ); - my $response = $brower->request($request); + my $login_request = HTTP::Request->new( 'POST', $url, $header, $data ); + my $login_response = $brower->request($login_request); - if ($response->is_success) { + if ($login_response->is_success) { my $req_url = "https://$ip/xyz/openbmc_project/inventory/system/chassis/motherboard"; - my $get_req = HTTP::Request->new('GET', $req_url, $header); - my $req_output = $brower->request($get_req); + my $req = HTTP::Request->new('GET', $req_url, $header); + my $req_output = $brower->request($req); + return if ($req_output->is_error); my $response = decode_json $req_output->content; my $mtm; my $serial; @@ -1090,7 +1091,7 @@ sub bmcdiscovery_openbmc{ $node =~ s/[\s:\._]/-/g; } } else { - if ($response->content =~ /\"description\": \"Invalid username or password\"/) { + if ($login_response->status_line =~ /401 Unauthorized/) { xCAT::MsgUtils->message("W", { data => ["Invalid username or password for $ip"] }, $::CALLBACK); } return; From 258cc7f13b11495dc9ef3fbfe1cf385d63de6764 Mon Sep 17 00:00:00 2001 From: junxiawang Date: Tue, 23 May 2017 07:52:13 -0400 Subject: [PATCH 071/129] modify migration test for environment's servicenode need to clear --- .../testcase/migration/redhat_migration | 18 ++++++++++++++++-- .../testcase/migration/sles_migration | 19 ++++++++++++++++--- 2 files changed, 32 insertions(+), 5 deletions(-) diff --git a/xCAT-test/autotest/testcase/migration/redhat_migration b/xCAT-test/autotest/testcase/migration/redhat_migration index 245a087e8..c2d43ff7b 100644 --- a/xCAT-test/autotest/testcase/migration/redhat_migration +++ b/xCAT-test/autotest/testcase/migration/redhat_migration @@ -2,7 +2,10 @@ start:redhat_migration1 os:Linux description:update xCAT from $$MIGRATION1_VERSION to latest version, these two global parameter defined in config file -cmd:if ping -c 1 $$SN > /dev/null;then rpower $$SN off > /dev/null;fi +cmd:if ping -c 1 $$SN > /dev/null;then rpower $$SN off > /dev/null;echo "poweroffsn">/tmp/poweroffsn;fi +check:rc==0 +cmd:if [[ "__GETNODEATTR($$SN,groups)__" =~ "service" ]];then chdef $$SN -m groups=service;echo "servicelabel" >/tmp/servicelabel;fi +check:rc==0 cmd:chdef -t node -o $$CN servicenode= monserver=$$MN nfsserver=$$MN tftpserver=$$MN xcatmaster=$$MN check:rc==0 cmd:rscan __GETNODEATTR($$CN,hcp)__ -w @@ -96,13 +99,20 @@ cmd:xdsh $$CN "noderm node0001" check:rc==0 cmd:latest_version_info=`lsxcatd -v`;xdsh $$CN "lsxcatd -v" | grep "$latest_version_info" check:rc==0 +cmd:if [[ -f /tmp/servicelabel ]];then chdef $$SN -p groups=service;rm -rf /tmp/servicelabel;fi +check:rc==0 +cmd:if [[ -f /tmp/poweroffsn ]];then rpower $$SN on > /dev/null;rm -rf /tmp/poweroffsn;fi +check:rc==0 end start:redhat_migration2 os:Linux description:update xCAT from $$MIGRATION2_VERSION to latest version, these two global parameter defined in config file #stop:yes -cmd:if ping -c 1 $$SN > /dev/null;then rpower $$SN off > /dev/null;fi +cmd:if ping -c 1 $$SN > /dev/null;then rpower $$SN off > /dev/null;echo "poweroffsn">/tmp/poweroffsn;fi +check:rc==0 +cmd:if [[ "__GETNODEATTR($$SN,groups)__" =~ "service" ]];then chdef $$SN -m groups=service;echo "servicelabel" >/tmp/servicelabel;fi +check:rc==0 cmd:chdef -t node -o $$CN servicenode= monserver=$$MN nfsserver=$$MN tftpserver=$$MN xcatmaster=$$MN check:rc==0 cmd:rscan __GETNODEATTR($$CN,hcp)__ -w @@ -196,5 +206,9 @@ cmd:xdsh $$CN "noderm node0001" check:rc==0 cmd:latest_version_info=`lsxcatd -v`;xdsh $$CN "lsxcatd -v" | grep "$latest_version_info" check:rc==0 +cmd:if [[ -f /tmp/servicelabel ]];then chdef $$SN -p groups=service;rm -rf /tmp/servicelabel;fi +check:rc==0 +cmd:if [[ -f /tmp/poweroffsn ]];then rpower $$SN on > /dev/null;rm -rf /tmp/poweroffsn;fi +check:rc==0 end diff --git a/xCAT-test/autotest/testcase/migration/sles_migration b/xCAT-test/autotest/testcase/migration/sles_migration index a03bfc0d3..f20f56edb 100644 --- a/xCAT-test/autotest/testcase/migration/sles_migration +++ b/xCAT-test/autotest/testcase/migration/sles_migration @@ -1,8 +1,10 @@ start:sles_migration1 os:Linux description:update xCAT from $$MIGRATION1_VERSION to latest version, these two global parameter defined in config file - -cmd:if ping -c 1 $$SN > /dev/null;then rpower $$SN off > /dev/null;fi +cmd:if ping -c 1 $$SN > /dev/null;then rpower $$SN off > /dev/null;echo "poweroffsn">/tmp/poweroffsn;fi +check:rc==0 +cmd:if [[ "__GETNODEATTR($$SN,groups)__" =~ "service" ]];then chdef $$SN -m groups=service;echo "servicelabel" >/tmp/servicelabel;fi +check:rc==0 cmd:chdef -t node -o $$CN servicenode= monserver=$$MN nfsserver=$$MN tftpserver=$$MN xcatmaster=$$MN check:rc==0 cmd:rscan __GETNODEATTR($$CN,hcp)__ -w @@ -99,13 +101,20 @@ cmd:xdsh $$CN "noderm node0001" check:rc==0 cmd:latest_version_info=`lsxcatd -v`;xdsh $$CN "lsxcatd -v" | grep "$latest_version_info" check:rc==0 +cmd:if [[ -f /tmp/servicelabel ]];then chdef $$SN -p groups=service;rm -rf /tmp/servicelabel;fi +check:rc==0 +cmd:if [[ -f /tmp/poweroffsn ]];then rpower $$SN on > /dev/null;rm -rf /tmp/poweroffsn;fi +check:rc==0 end start:sles_migration2 os:Linux description:update xCAT from $$MIGRATION22VERSION to latest version, these two global parameter defined in config file -cmd:if ping -c 1 $$SN > /dev/null;then rpower $$SN off > /dev/null;fi +cmd:if ping -c 1 $$SN > /dev/null;then rpower $$SN off > /dev/null;echo "poweroffsn">/tmp/poweroffsn;fi +check:rc==0 +cmd:if [[ "__GETNODEATTR($$SN,groups)__" =~ "service" ]];then chdef $$SN -m groups=service;echo "servicelabel" >/tmp/servicelabel;fi +check:rc==0 cmd:chdef -t node -o $$CN servicenode= monserver=$$MN nfsserver=$$MN tftpserver=$$MN xcatmaster=$$MN check:rc==0 cmd:rscan __GETNODEATTR($$CN,hcp)__ -w @@ -202,5 +211,9 @@ cmd:xdsh $$CN "noderm node0001" check:rc==0 cmd:latest_version_info=`lsxcatd -v`;xdsh $$CN "lsxcatd -v" | grep "$latest_version_info" check:rc==0 +cmd:if [[ -f /tmp/servicelabel ]];then chdef $$SN -p groups=service;rm -rf /tmp/servicelabel;fi +check:rc==0 +cmd:if [[ -f /tmp/poweroffsn ]];then rpower $$SN on > /dev/null;rm -rf /tmp/poweroffsn;fi +check:rc==0 end From 21c955467a6d818277b88c743fcfd3d59325c690 Mon Sep 17 00:00:00 2001 From: hu-weihua Date: Wed, 24 May 2017 03:47:52 -0400 Subject: [PATCH 072/129] Fix automation bug: xcattest failed to load case depending on arch label --- xCAT-test/xcattest | 49 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/xCAT-test/xcattest b/xCAT-test/xcattest index 97b17825c..7566e65d1 100755 --- a/xCAT-test/xcattest +++ b/xCAT-test/xcattest @@ -910,10 +910,59 @@ sub load_case { } elsif ($line =~ /^arch\s*:\s*(\w[\w\,]+)/) { next if $skip; $case_ref->[$i]->{arch} = $1; + + if ($run_case_flag) { + #To judge whether need to skip the current case + my $case_arch = $case_ref->[$i]->{arch}; + if($case_arch =~ /ppc/i && $case_arch !~ /le|el/i){ + $case_arch="ppc"; + }elsif($case_arch =~ /ppc/i && $case_arch =~ /le|el/i){ + $case_arch="ppc64le"; + }elsif($case_arch =~ /x86/i){ + $case_arch="x86"; + } + + my $env_arch = $config{var}{ARCH}; + if($env_arch =~ /ppc/i && $env_arch !~ /le|el/i){ + $env_arch="ppc"; + }elsif($env_arch =~ /ppc/i && $env_arch =~ /le|el/i){ + $env_arch="ppc64le"; + }elsif($env_arch =~ /x86/i){ + $env_arch="x86"; + } + + my $valid = 0; + if ($case_arch eq $env_arch) { + $valid = 1; + } + unless ($valid) { + if(exists($case_name_index_map_bak{$case_ref->[$i]->{name}})){ + $$case_name_index_map_ref{$case_ref->[$i]->{name}}=$case_name_index_map_bak{$case_ref->[$i]->{name}}; + }else{ + delete $$case_name_index_map_ref{$case_ref->[$i]->{name}}; + } + push @{ $invalidcases{"noruncases"} }, $case_ref->[$i]->{name}; + } + } $newcmdstart = 0; } elsif ($line =~ /^hcp\s*:\s*(\w[\w\,]+)/) { next if $skip; $case_ref->[$i]->{hcp} = $1; + if ($run_case_flag) { + #To judge whether need to skip the current case + my $valid = 0; + if ($case_ref->[$i]->{hcp} =~ /$config{var}{HCP}/i) { + $valid = 1; + } + unless ($valid) { + if(exists($case_name_index_map_bak{$case_ref->[$i]->{name}})){ + $$case_name_index_map_ref{$case_ref->[$i]->{name}}=$case_name_index_map_bak{$case_ref->[$i]->{name}}; + }else{ + delete $$case_name_index_map_ref{$case_ref->[$i]->{name}}; + } + push @{ $invalidcases{"noruncases"} }, $case_ref->[$i]->{name}; + } + } $newcmdstart = 0; } elsif ($line =~ /^type\s*:\s*(\w[\w\,-]+)/) { next if $skip; From 79f4ae63fa000c5919f1a78eb148385928233975 Mon Sep 17 00:00:00 2001 From: XuWei Date: Wed, 24 May 2017 02:35:33 -0400 Subject: [PATCH 073/129] Close ssl verify for bmcdiscover on Ubuntu --- xCAT-server/lib/xcat/plugins/bmcdiscover.pm | 9 ++++++++- xCAT-server/lib/xcat/plugins/openbmc.pm | 9 ++++----- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/bmcdiscover.pm b/xCAT-server/lib/xcat/plugins/bmcdiscover.pm index 28e0d951d..36f086c74 100644 --- a/xCAT-server/lib/xcat/plugins/bmcdiscover.pm +++ b/xCAT-server/lib/xcat/plugins/bmcdiscover.pm @@ -982,6 +982,10 @@ sub bmcdiscovery_ipmi { } } + if ($mtm eq '' or $serial eq '') { + xCAT::MsgUtils->message("W", { data => ["BMC Type/Model and/or Serial is unavailable for $ip"] }, $::CALLBACK); + return; + } $node_data .= ",$mtm"; $node_data .= ",$serial"; @@ -1043,7 +1047,7 @@ sub bmcdiscovery_openbmc{ my $node = sprintf("node-%08x", unpack("N*", inet_aton($ip))); my $node_data = $ip; - my $brower = LWP::UserAgent->new( ssl_opts => { verify_hostname => 0 }, ); + my $brower = LWP::UserAgent->new( ssl_opts => { SSL_verify_mode => 0x00, verify_hostname => 0 }, ); my $cookie_jar = HTTP::Cookies->new(); my $header = HTTP::Headers->new('Content-Type' => 'application/json'); my $url = "https://$ip/login"; @@ -1065,6 +1069,7 @@ sub bmcdiscovery_openbmc{ $mtm = $response->{data}->{Model}; $serial = $response->{data}->{SerialNumber}; } else { + xCAT::MsgUtils->message("W", { data => ["BMC Type/Model and/or Serial is unavailable for $ip"] }, $::CALLBACK); return; } @@ -1093,6 +1098,8 @@ sub bmcdiscovery_openbmc{ } else { if ($login_response->status_line =~ /401 Unauthorized/) { xCAT::MsgUtils->message("W", { data => ["Invalid username or password for $ip"] }, $::CALLBACK); + } else { + xCAT::MsgUtils->message("W", { data => ["$login_response->status_line for $ip"] }, $::CALLBACK); } return; } diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index 7eb476757..9143f0b9d 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -360,7 +360,7 @@ sub process_request { } } - $callback->({ errorcode => $check }) if ($check); + $callback->({ errorcode => [$check] }) if ($check); return; } @@ -864,10 +864,9 @@ sub rpower_response { else { xCAT::SvrUtils::sendmsg("$::POWER_STATE_ON", $callback, $node); } - } - else { - my $unexpected_state = $response_info->{'data'}->{CurrentHostState}; - xCAT::SvrUtils::sendmsg("Unexpected state - $unexpected_state", $callback, $node); + } else { + my $unexpected_state = $response_info->{'data'}->{CurrentHostState}; + xCAT::SvrUtils::sendmsg("Unexpected state - $unexpected_state", $callback, $node); } } From 1b1a5cc428bd0c8b5150efc3b29fe2373c81cf5c Mon Sep 17 00:00:00 2001 From: junxiawang Date: Wed, 24 May 2017 07:33:02 -0400 Subject: [PATCH 074/129] modify and add testcase for rvitals for issue:3062 --- xCAT-test/autotest/testcase/rvitals/cases0 | 71 +++++++++++++++++++--- 1 file changed, 64 insertions(+), 7 deletions(-) diff --git a/xCAT-test/autotest/testcase/rvitals/cases0 b/xCAT-test/autotest/testcase/rvitals/cases0 index 055317a88..a9ccc3a69 100644 --- a/xCAT-test/autotest/testcase/rvitals/cases0 +++ b/xCAT-test/autotest/testcase/rvitals/cases0 @@ -1,40 +1,97 @@ +start:rvitals_h +cmd:rvitals -h +check:rc==0 +check:output=~Usage: +check:output=~rvitals +end + +start:rvitals_v +cmd:rvitals -v +check:rc==0 +check:output=~Version +end + start:rvitals_temp cmd:rvitals $$CN temp check:rc==0 -check:output=~System Temperature +check:output=~System Temperature|Ambient Temp|temperature end + +start:rvitals_disktemp +arch:ppc64le +hcp:ipmi +cmd:rvitals $$CN disktemp +check:rc==0 +check:output=~Ambient Temp +end + +start:rvitals_cputemp +arch:ppc64le +hcp:ipmi +cmd:rvitals $$CN cputemp +check:rc==0 +check:output=~Ambient Temp +end + start:rvitals_voltage hcp:hmc,ivm,fsp,ipmi cmd:rvitals $$CN voltage check:rc==0 -check:output=~Frame Voltages +check:output=~Frame Voltages|CPU VDD Volt|SysBrd end + start:rvitals_power cmd:rvitals $$CN power check:rc==0 -check:output=~Current Power Status:\s*(on|off) +check:output=~Current Power Status:\s*(on|off)|Power Status:\s*(on|off) end + start:rvitals_state cmd:rvitals $$CN state check:rc==0 check:output=~System State: end + start:rvitals_lcds hcp:hmc,ivm,fsp,ipmi cmd:rvitals $$CN lcds check:rc==0 check:output=~Current LCD end + start:rvitals_all cmd:rvitals $$CN all check:rc==0 -check:output=~System Temperature -check:output=~Frame Voltages -check:output=~Current Power Status:\s*(on|off) -check:output=~System State: +check:output=~System Temperature|Ambient Temp +check:output=~Frame Voltages|CPU VDD Volt|SysBrd +check:output=~Current Power Status:\s*(on|off)|Power Status:\s*(on|off) +check:output=~ System State:|System Event:|NMI State +end + +start:rvitals_leds +cmd:rvitals $$CN leds +check:rc==0 +check:output=~LED +end + +start:rvitals_fanspeed +cmd:rvitals $$CN fanspeed +check:rc==0 +check:output=~Fan|Fan\s*\d:\s*\w+\s*RPM +end +start:rvitals_wattage +cmd:rvitals $$CN wattage +check:rc==0 +check:output=~12V Sense|AC Avg Power +check:output=~Mem Cache Power|MEM Avg Power end start:rvitals_noderange_err cmd:rvitals testnode check:rc!=0 check:output=~Error end +start:rvitals_errorcommand +cmd: rvitals $$CN errorcommand +check:rc!=0 +check:output=~Unrecognized rvitals arguments +end From d22b6c57a78b8ff184ca199dee8cfc89a3c98958 Mon Sep 17 00:00:00 2001 From: junxiawang Date: Wed, 24 May 2017 07:39:19 -0400 Subject: [PATCH 075/129] delete cases1 and cases0 could cover cases1 --- xCAT-test/autotest/testcase/rvitals/cases1 | 61 ---------------------- 1 file changed, 61 deletions(-) delete mode 100644 xCAT-test/autotest/testcase/rvitals/cases1 diff --git a/xCAT-test/autotest/testcase/rvitals/cases1 b/xCAT-test/autotest/testcase/rvitals/cases1 deleted file mode 100644 index 8a43aedb6..000000000 --- a/xCAT-test/autotest/testcase/rvitals/cases1 +++ /dev/null @@ -1,61 +0,0 @@ -start:rvitals_temp -arch:ppc64le -hcp:ipmi -cmd:rvitals $$CN temp -check:rc==0 -check:output=~Ambient Temp -end - -start:rvitals_disktemp -arch:ppc64le -hcp:ipmi -cmd:rvitals $$CN disktemp -check:rc==0 -check:output=~Ambient Temp -end - -start:rvitals_cputemp -arch:ppc64le -hcp:ipmi -cmd:rvitals $$CN cputemp -check:rc==0 -check:output=~Ambient Temp -end - -start:rvitals_fanspeed -arch:ppc64le -hcp:ipmi -cmd:rvitals $$CN fanspeed -check:rc==0 -check:output=~Fan\s*\d:\s*\w+\s*RPM -end - -start:rvitals_voltage -arch:ppc64le -hcp:ipmi -cmd:rvitals $$CN voltage -check:rc==0 -check:output=~CPU VDD Volt -end - -start:rvitals_all -arch:ppc64le -hcp:ipmi -cmd:rvitals $$CN all -check:rc==0 -check:output=~Power Status -check:output=~Power Overload -check:output=~Power Interlock -check:output=~Power Fault -check:output=~Power Control Fault -check:output=~Power Restore Policy -check:output=~Ambient Temp -end - -start:rvitals_noderange_err -arch:ppc64le -hcp:ipmi -cmd:rvitals testnode -check:rc!=0 -check:output=~Error -end From 0588d4e060c11bb75d5a55c0e6db030088da6a6b Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Wed, 24 May 2017 15:31:31 -0400 Subject: [PATCH 076/129] Add the units to the output that is being returned from the rvitals command to make the output more similar to existing OpenPower BMC based servers --- xCAT-server/lib/xcat/plugins/openbmc.pm | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index 7eb476757..0a513e2d9 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -71,6 +71,18 @@ sub handled_commands { }; } +my $prefix = "xyz.openbmc_project"; + +my %sensor_units = ( + "$prefix.Sensor.Value.Unit.DegreesC" => "C", + "$prefix.Sensor.Value.Unit.RPMS" => "RPMS", + "$prefix.Sensor.Value.Unit.Volts" => "Volts", + "$prefix.Sensor.Value.Unit.Meters" => "Meters", + "$prefix.Sensor.Value.Unit.Amperes" => "Amps", + "$prefix.Sensor.Value.Unit.Watts" => "Watts", + "$prefix.Sensor.Value.Unit.Joules" => "Joules" +); + my $http_protocol="https"; my $openbmc_url = "/org/openbmc"; my $openbmc_project_url = "/xyz/openbmc_project"; @@ -1199,7 +1211,7 @@ sub rvitals_response { my $content_info; my $sensor_value; - print "$node DEBUG Processing command: rvitals $grep_string \n"; + print "$node: DEBUG Processing command: rvitals $grep_string \n"; print Dumper(%{$response_info->{data}}) . "\n"; foreach my $key_url (keys %{$response_info->{data}}) { @@ -1208,7 +1220,7 @@ sub rvitals_response { # $key_url is "/xyz/openbmc_project/sensors/xxx/yyy # For now display xxx/yyy as a label my ($junk, $label) = split("/sensors/", $key_url); - $sensor_value = $label . " " . $content{Value}; + $sensor_value = $label . ": " . $content{Value} . " " . $sensor_units{ $content{Unit} }; xCAT::SvrUtils::sendmsg("$sensor_value", $callback, $node); } From 6e14f1ee08a1322af9d957624032f938d614e936 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Wed, 24 May 2017 15:46:23 -0400 Subject: [PATCH 077/129] Incorporated the Scale into the calculation of the value returned from openbmc-rest, so the values make more sense to humans --- xCAT-server/lib/xcat/plugins/openbmc.pm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index 0a513e2d9..d67cf7ca1 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -1220,7 +1220,14 @@ sub rvitals_response { # $key_url is "/xyz/openbmc_project/sensors/xxx/yyy # For now display xxx/yyy as a label my ($junk, $label) = split("/sensors/", $key_url); - $sensor_value = $label . ": " . $content{Value} . " " . $sensor_units{ $content{Unit} }; + # + # Calculate the value based on the scale + # + my $calc_value = $content{Value}; + if ( $content{Scale} != 0 ) { + $calc_value = ($content{Value} * (10 ** $content{Scale})); + } + $sensor_value = $label . ": " . $calc_value . " " . $sensor_units{ $content{Unit} }; xCAT::SvrUtils::sendmsg("$sensor_value", $callback, $node); } From 74769080c8158b7e11f27fd96b1d624ffb3e9738 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Wed, 24 May 2017 22:49:14 -0400 Subject: [PATCH 078/129] Based on the OpenBMC Sensor API, complete the development code for the supported options based on the possible values that are currently allowed to be returned. As more data is added, the code should be able to handle the printing of the data automatically --- .../references/man1/rvitals.1.rst | 17 ++++++++- perl-xCAT/xCAT/Usage.pm | 4 +- xCAT-client/pods/man1/rvitals.1.pod | 12 +++++- xCAT-server/lib/xcat/plugins/openbmc.pm | 37 ++++++++++++++++--- 4 files changed, 59 insertions(+), 11 deletions(-) diff --git a/docs/source/guides/admin-guides/references/man1/rvitals.1.rst b/docs/source/guides/admin-guides/references/man1/rvitals.1.rst index e6929cdfc..ca8af6688 100644 --- a/docs/source/guides/admin-guides/references/man1/rvitals.1.rst +++ b/docs/source/guides/admin-guides/references/man1/rvitals.1.rst @@ -56,20 +56,27 @@ BMC specific: \ **rvitals**\ \ *noderange*\ {\ **temp | voltage | wattage | fanspeed | power | leds | all**\ } -OpenPOWER server specific: +OpenPOWER (IPMI) specific: ========================== \ **rvitals**\ \ *noderange*\ [\ **temp | voltage | wattage | fanspeed | power | leds | all**\ ] +OpenPOWER (OpenBMC) specific: +============================= + + +\ **rvitals**\ \ *noderange*\ [\ **temp | voltage | wattage | fanspeed | power | length | all**\ ] + + ******************* \ **Description**\ ******************* -\ **rvitals**\ retrieves hardware vital information from the on-board Service +\ **rvitals**\ Retrieves hardware vital information from the on-board Service Processor for a single or range of nodes and groups. @@ -133,6 +140,12 @@ Processor for a single or range of nodes and groups. +\ **length**\ + + Retrieves length related attributes. + + + \ **power**\ Retrieves power status. diff --git a/perl-xCAT/xCAT/Usage.pm b/perl-xCAT/xCAT/Usage.pm index 30ba4b701..200f59037 100755 --- a/perl-xCAT/xCAT/Usage.pm +++ b/perl-xCAT/xCAT/Usage.pm @@ -81,8 +81,10 @@ my %usage = ( rvitals noderange {temp|wattage|fanspeed|leds|summary|all} BMC specific: rvitals noderange {temp|voltage|wattage|fanspeed|power|leds|all} - OpenPOWER server specific: + OpenPOWER (IPMI) specific: rvitals noderange [temp|voltage|wattage|fanspeed|power|leds|all] + OpenPOWER (OpenBMC) specific: + rvitals noderange [temp|voltage|wattage|fanspeed|power|length|all] MIC specific: rvitals noderange {thermal|all}", "reventlog" => diff --git a/xCAT-client/pods/man1/rvitals.1.pod b/xCAT-client/pods/man1/rvitals.1.pod index 32ff2fb81..52bacd35e 100644 --- a/xCAT-client/pods/man1/rvitals.1.pod +++ b/xCAT-client/pods/man1/rvitals.1.pod @@ -26,13 +26,17 @@ B I {B|B|B|B|B|B I {B|B|B|B|B|B|B} -=head2 OpenPOWER server specific: +=head2 OpenPOWER (IPMI) specific: B I [B|B|B|B|B|B|B] +=head2 OpenPOWER (OpenBMC) specific: + +B I [B|B|B|B|B|B|B] + =head1 B -B retrieves hardware vital information from the on-board Service +B Retrieves hardware vital information from the on-board Service Processor for a single or range of nodes and groups. =head1 B @@ -75,6 +79,10 @@ Retrieves rack environmentals. Retrieves LEDs status. +=item B + +Retrieves length related attributes. + =item B Retrieves power status. diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index d67cf7ca1..6e8273947 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -458,7 +458,7 @@ sub parse_args { } elsif ($command eq "rvitals") { $check = unsupported($callback); if (ref($check) eq "ARRAY") { return $check; } $subcommand = "all" if (!defined($ARGV[0])); - unless ($subcommand =~ /^temp$|^voltage$|^wattage$|^fanspeed$|^power$|^leds$|^all$/) { + unless ($subcommand =~ /^temp$|^voltage$|^wattage$|^fanspeed$|^power$|^length$|^all$/) { return ([ 1, "Unsupported command: $command $subcommand" ]); } } else { @@ -1216,17 +1216,42 @@ sub rvitals_response { foreach my $key_url (keys %{$response_info->{data}}) { my %content = %{ ${ $response_info->{data} }{$key_url} }; - print Dumper(%content) . "\n"; - # $key_url is "/xyz/openbmc_project/sensors/xxx/yyy - # For now display xxx/yyy as a label - my ($junk, $label) = split("/sensors/", $key_url); + # - # Calculate the value based on the scale + # Skip over attributes that are not asked to be printed + # + if ($grep_string =~ "temp") { + unless ( $content{Unit} =~ "DegreesC") { next; } + } + if ($grep_string =~ "voltage") { + unless ( $content{Unit} =~ "Volts") { next; } + } + if ($grep_string =~ "wattage") { + unless ( $content{Unit} =~ "Watts") { next; } + } + if ($grep_string =~ "fanspeed") { + unless ( $content{Unit} =~ "RPMS") { next; } + } + if ($grep_string =~ "power") { + unless ( $content{Unit} =~ "Amperes" || $content{Unit} =~ "Joules" || $content{Unit} =~ "Watts" ) { next; } + } + if ($grep_string =~ "length") { + unless ( $content{Unit} =~ "Meters" ) { next; } + } + # + # $key_url is in the format: "/xyz/openbmc_project/sensors/xxx/yyy + # For now display xxx/yyy as a label + # + my ($junk, $label) = split("/sensors/", $key_url); + + # + # Calculate the adjusted value based on the scale attribute # my $calc_value = $content{Value}; if ( $content{Scale} != 0 ) { $calc_value = ($content{Value} * (10 ** $content{Scale})); } + $sensor_value = $label . ": " . $calc_value . " " . $sensor_units{ $content{Unit} }; xCAT::SvrUtils::sendmsg("$sensor_value", $callback, $node); } From 2102c7d086f8390e2076de2d9731bc5ca4946fca Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Wed, 24 May 2017 23:02:24 -0400 Subject: [PATCH 079/129] Expose the rvitals command as part of openbmc support --- xCAT-server/lib/xcat/plugins/openbmc.pm | 1 - 1 file changed, 1 deletion(-) diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index d67cf7ca1..9848dc5eb 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -456,7 +456,6 @@ sub parse_args { } } } elsif ($command eq "rvitals") { - $check = unsupported($callback); if (ref($check) eq "ARRAY") { return $check; } $subcommand = "all" if (!defined($ARGV[0])); unless ($subcommand =~ /^temp$|^voltage$|^wattage$|^fanspeed$|^power$|^leds$|^all$/) { return ([ 1, "Unsupported command: $command $subcommand" ]); From 7ff64b220f123506cf0628469950c2b2c4c0eddb Mon Sep 17 00:00:00 2001 From: cxhong Date: Thu, 25 May 2017 01:14:16 -0400 Subject: [PATCH 080/129] Wrong mac address showing for switchdiscover command (#3131) --- xCAT-server/lib/perl/xCAT/SvrUtils.pm | 2 +- xCAT-server/lib/xcat/plugins/switchdiscover.pm | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/xCAT-server/lib/perl/xCAT/SvrUtils.pm b/xCAT-server/lib/perl/xCAT/SvrUtils.pm index 3e306e7fb..41350d242 100755 --- a/xCAT-server/lib/perl/xCAT/SvrUtils.pm +++ b/xCAT-server/lib/perl/xCAT/SvrUtils.pm @@ -1266,7 +1266,7 @@ sub get_mac_by_arp () } else { ($ip, $mac) = (undef, undef); } - if (@$IP[1] !~ $ip) { + if (@$IP[1] ne $ip) { ($ip, $mac) = (undef, undef); } else { last; diff --git a/xCAT-server/lib/xcat/plugins/switchdiscover.pm b/xCAT-server/lib/xcat/plugins/switchdiscover.pm index ebc6cb61b..ca192c222 100644 --- a/xCAT-server/lib/xcat/plugins/switchdiscover.pm +++ b/xCAT-server/lib/xcat/plugins/switchdiscover.pm @@ -38,6 +38,7 @@ my %global_mac_identity = ( "6c:ae:8b" => "BNT G8264-T switch", "fc:cf:62" => "BNT G8124 switch", "7c:fe:90" => "Mellanox IB switch", + "cc:37:ab" => "Edgecore Networks Switch", "8c:ea:1b" => "Edgecore Networks Switch" ); @@ -54,6 +55,8 @@ my %global_switch_type = ( mellanox => "Mellanox", MLNX => "Mellanox", MELLAN => "Mellanox", + Cumulus => "onie", + cumulus => "onie", Edgecore => "onie" ); From 886571042bb091cec1602430f6506ca4a25dc081 Mon Sep 17 00:00:00 2001 From: junxiawang Date: Thu, 25 May 2017 06:12:46 -0400 Subject: [PATCH 081/129] modify and add testcase for rvitals for issue:3062 --- xCAT-test/autotest/testcase/rvitals/cases0 | 28 ++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/xCAT-test/autotest/testcase/rvitals/cases0 b/xCAT-test/autotest/testcase/rvitals/cases0 index a9ccc3a69..348c0caa3 100644 --- a/xCAT-test/autotest/testcase/rvitals/cases0 +++ b/xCAT-test/autotest/testcase/rvitals/cases0 @@ -1,4 +1,6 @@ start:rvitals_h +description:get rvitals's usage +Attribute: $$CN-The operation object of rvitals command cmd:rvitals -h check:rc==0 check:output=~Usage: @@ -6,18 +8,24 @@ check:output=~rvitals end start:rvitals_v +description:get rvitals's version +Attribute: $$CN-The operation object of rvitals command cmd:rvitals -v check:rc==0 check:output=~Version end start:rvitals_temp +description:Retrieves temperatures +Attribute: $$CN-The operation object of rvitals command cmd:rvitals $$CN temp check:rc==0 check:output=~System Temperature|Ambient Temp|temperature end start:rvitals_disktemp +description:Retrieves disk temperatures +Attribute: $$CN-The operation object of rvitals command arch:ppc64le hcp:ipmi cmd:rvitals $$CN disktemp @@ -26,6 +34,8 @@ check:output=~Ambient Temp end start:rvitals_cputemp +description:Retrieves cpu temperatures +Attribute: $$CN-The operation object of rvitals command arch:ppc64le hcp:ipmi cmd:rvitals $$CN cputemp @@ -34,6 +44,8 @@ check:output=~Ambient Temp end start:rvitals_voltage +description:Retrieves power supply and VRM voltage readings +Attribute: $$CN-The operation object of rvitals command hcp:hmc,ivm,fsp,ipmi cmd:rvitals $$CN voltage check:rc==0 @@ -41,18 +53,24 @@ check:output=~Frame Voltages|CPU VDD Volt|SysBrd end start:rvitals_power +description:Retrieves power status +Attribute: $$CN-The operation object of rvitals command cmd:rvitals $$CN power check:rc==0 check:output=~Current Power Status:\s*(on|off)|Power Status:\s*(on|off) end start:rvitals_state +description:Retrieves the system state. +Attribute: $$CN-The operation object of rvitals command cmd:rvitals $$CN state check:rc==0 check:output=~System State: end start:rvitals_lcds +description:Retrieves LCDs status +Attribute: $$CN-The operation object of rvitals command hcp:hmc,ivm,fsp,ipmi cmd:rvitals $$CN lcds check:rc==0 @@ -60,6 +78,8 @@ check:output=~Current LCD end start:rvitals_all +description:Retrieves all status +Attribute: $$CN-The operation object of rvitals command cmd:rvitals $$CN all check:rc==0 check:output=~System Temperature|Ambient Temp @@ -69,28 +89,36 @@ check:output=~ System State:|System Event:|NMI State end start:rvitals_leds +description:Retrieves leds status +Attribute: $$CN-The operation object of rvitals command cmd:rvitals $$CN leds check:rc==0 check:output=~LED end start:rvitals_fanspeed +description:Retrieves fan speeds. +Attribute: $$CN-The operation object of rvitals command cmd:rvitals $$CN fanspeed check:rc==0 check:output=~Fan|Fan\s*\d:\s*\w+\s*RPM end start:rvitals_wattage +description:Retrieves wattage readings. +Attribute: $$CN-The operation object of rvitals command cmd:rvitals $$CN wattage check:rc==0 check:output=~12V Sense|AC Avg Power check:output=~Mem Cache Power|MEM Avg Power end start:rvitals_noderange_err +description:using not defined node cmd:rvitals testnode check:rc!=0 check:output=~Error end start:rvitals_errorcommand +description:using wrong command cmd: rvitals $$CN errorcommand check:rc!=0 check:output=~Unrecognized rvitals arguments From 89bc7608f1b0ff38e15440b2b95bfa3f76bcab4e Mon Sep 17 00:00:00 2001 From: immarvin Date: Thu, 25 May 2017 05:30:30 -0400 Subject: [PATCH 082/129] fix issue RHEL update caused boot failure due to selinux #2996 --- xCAT-server/lib/xcat/plugins/anaconda.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-server/lib/xcat/plugins/anaconda.pm b/xCAT-server/lib/xcat/plugins/anaconda.pm index 0222362ba..5b61b8326 100644 --- a/xCAT-server/lib/xcat/plugins/anaconda.pm +++ b/xCAT-server/lib/xcat/plugins/anaconda.pm @@ -859,7 +859,7 @@ sub mknetboot } # turn off the selinux - if ($osver =~ m/fedora12/ || $osver =~ m/fedora13/) { + if ($osver =~ m/(fedora12|fedora13|rhels7)/) { $kcmdline .= " selinux=0 "; } From ecd05c6de44ea5e30b079322db13a3ce8e4e5820 Mon Sep 17 00:00:00 2001 From: Bin Xu Date: Fri, 26 May 2017 17:51:28 +0800 Subject: [PATCH 083/129] Using statefule image only now. --- xCAT-test/bin/xcatperftest | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-test/bin/xcatperftest b/xCAT-test/bin/xcatperftest index 8795fb3a8..1ec36c963 100755 --- a/xCAT-test/bin/xcatperftest +++ b/xCAT-test/bin/xcatperftest @@ -198,7 +198,7 @@ getOSimage() if [ -z $PERF_OSIMAGE ]; then # covert it to an array - osimage_array=($(lsdef -t osimage 2>/dev/null| grep `arch`|awk '/compute/ {print $1}')) + osimage_array=($(lsdef -t osimage 2>/dev/null| grep `arch`|grep 'install'|awk '/compute/ {print $1}')) index=`expr $RANDOM % ${#osimage_array[@]} 2>/dev/null` echo ${osimage_array[$index]} else From 5413376a58f3c5e964b463306008792f5971f895 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Fri, 26 May 2017 11:09:16 -0400 Subject: [PATCH 084/129] Sort the output of rvitals to arrange the types of sensor data together. Removing the node out of the label in order to allow the sort to happen on just the keywords For debug, just print the json instead of splitting to multiple lines --- xCAT-server/lib/xcat/plugins/openbmc.pm | 26 ++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index 6e8273947..c827e4528 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -1209,10 +1209,10 @@ sub rvitals_response { my $grep_string = $status_info{RVITALS_RESPONSE}{argv}; my $src; my $content_info; - my $sensor_value; + my @sorted_output; print "$node: DEBUG Processing command: rvitals $grep_string \n"; - print Dumper(%{$response_info->{data}}) . "\n"; + print Dumper(%{$response_info->{data}}); foreach my $key_url (keys %{$response_info->{data}}) { my %content = %{ ${ $response_info->{data} }{$key_url} }; @@ -1238,11 +1238,12 @@ sub rvitals_response { if ($grep_string =~ "length") { unless ( $content{Unit} =~ "Meters" ) { next; } } - # - # $key_url is in the format: "/xyz/openbmc_project/sensors/xxx/yyy - # For now display xxx/yyy as a label - # - my ($junk, $label) = split("/sensors/", $key_url); + + my $label = (split(/\//, $key_url))[ -1 ]; + + # replace underscore with space, uppercase the first letter + $label =~ s/_/ /g; + $label =~ s/\b(\w)/\U$1/g; # # Calculate the adjusted value based on the scale attribute @@ -1252,8 +1253,15 @@ sub rvitals_response { $calc_value = ($content{Value} * (10 ** $content{Scale})); } - $sensor_value = $label . ": " . $calc_value . " " . $sensor_units{ $content{Unit} }; - xCAT::SvrUtils::sendmsg("$sensor_value", $callback, $node); + $content_info = $label . ": " . $calc_value . " " . $sensor_units{ $content{Unit} }; + push (@sorted_output, $content_info); #Save output in array + } + # If sorted array has any contents, sort it and print it + if (scalar @sorted_output > 0) { + # Sort the output, alpha, then numeric + my @sorted_output = grep {s/(^|\D)0+(\d)/$1$2/g,1} sort + grep {s/(\d+)/sprintf"%06.6d",$1/ge,1} @sorted_output; + xCAT::SvrUtils::sendmsg("$_", $callback, $node) foreach (@sorted_output); } if ($next_status{ $node_info{$node}{cur_status} }) { From fda07616e5f8e2d081c558043084f2f5d2a33680 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Tue, 30 May 2017 13:26:36 -0400 Subject: [PATCH 085/129] Spelling fixes for docs/sources/developers and overview --- docs/source/developers/github/change_code.rst | 2 +- docs/source/developers/github/forks.rst | 2 +- docs/source/developers/github/pull_request.rst | 2 +- docs/source/developers/guides/code/builds.rst | 2 +- docs/source/developers/guides/docs/doc_guidelines.rst | 6 +++--- docs/source/overview/differentiators.rst | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/source/developers/github/change_code.rst b/docs/source/developers/github/change_code.rst index a9f2b9f20..4eb5b79cd 100644 --- a/docs/source/developers/github/change_code.rst +++ b/docs/source/developers/github/change_code.rst @@ -24,7 +24,7 @@ It may take days before your pull request is properly reviewed and you want to k Creating additional branches will allow you to work on different tasks/enhancements at the same time. You can easily manage your working changes between branches with ``git stash.``. -Commiting code and pushing to remote branch +Committing code and pushing to remote branch ------------------------------------------- Once your code is ready.... diff --git a/docs/source/developers/github/forks.rst b/docs/source/developers/github/forks.rst index fccb84e75..2807e4009 100644 --- a/docs/source/developers/github/forks.rst +++ b/docs/source/developers/github/forks.rst @@ -41,7 +41,7 @@ Configure an ``upstream`` repository $ git remote add upstream git@github.com:xcat2/xcat-core.git - View the configured reposotories: :: + View the configured repositories: :: $ git remote -v origin git@github.com:/xcat-core.git (fetch) diff --git a/docs/source/developers/github/pull_request.rst b/docs/source/developers/github/pull_request.rst index b5273cb26..80593db5e 100644 --- a/docs/source/developers/github/pull_request.rst +++ b/docs/source/developers/github/pull_request.rst @@ -65,7 +65,7 @@ During the reviewing of your pull request, another pull request may be merged wh $ git push origin -f -If all the conflicts are resolved, the pull request should automaically turn green again and is able to be merged automatically. +If all the conflicts are resolved, the pull request should automatically turn green again and is able to be merged automatically. Reviewing Pull Requests as a Maintainer --------------------------------------- diff --git a/docs/source/developers/guides/code/builds.rst b/docs/source/developers/guides/code/builds.rst index 7afb55b1b..28aba3d02 100644 --- a/docs/source/developers/guides/code/builds.rst +++ b/docs/source/developers/guides/code/builds.rst @@ -37,7 +37,7 @@ The following steps will help configure ``pod2rst`` and be able to generate the make make install - * **[as non-root]** Extrat and build the Perl module using PREFIX to specify a directory that you have write permission :: + * **[as non-root]** Extract and build the Perl module using PREFIX to specify a directory that you have write permission :: mkdir ~/perllib perl Makefile.PL PREFIX=~/perllib diff --git a/docs/source/developers/guides/docs/doc_guidelines.rst b/docs/source/developers/guides/docs/doc_guidelines.rst index 0a245fe01..4e13e7b1c 100644 --- a/docs/source/developers/guides/docs/doc_guidelines.rst +++ b/docs/source/developers/guides/docs/doc_guidelines.rst @@ -65,7 +65,7 @@ Enumerated List Include another file -------------------- -To add contents of a document file inside another file, use ``.. include::``. This is usefull when a common information needs to be displayed in multiple files, whithout the use of a hyperlink. +To add contents of a document file inside another file, use ``.. include::``. This is useful when a common information needs to be displayed in multiple files, without the use of a hyperlink. :: .. include:: config_common.rst @@ -76,14 +76,14 @@ To add contents of a document file inside another file, use ``.. include::``. Th Index file ---------- -Index.rst files contain the ``.. toctree::`` tag. Files listed under that tag will have links to them displayed in the left side navigation area. If a documentation file does not wish to be accessbile from the navigation area, do not list it under the ``.. toctree::``. +Index.rst files contain the ``.. toctree::`` tag. Files listed under that tag will have links to them displayed in the left side navigation area. If a documentation file does not wish to be accessible from the navigation area, do not list it under the ``.. toctree::``. ``Note:`` If a file is not listed under the ``.. toctree::`` it might generate a warning during the documentation build ``WARNING: document isn't included in any toctree``. To eliminate such warning, add the file to the ``exclude_patterns`` list in the ``docs/source/conf.py`` file. However, do not add a file to the ``exclude_patterns`` list if it contains a customized link target, such as ``.. _my_link_taget:``. This link target will not be visible to other files and a ``WARNING: undefined label:`` will be displayed during the documentation build. Hyperlinks -> Internal Links -> External Links ---------------------------------------------- -Add links to refer other web page is a very common way in writting document, it's very helpful to reduce the doc duplication and make docs easy to understand. Following are several ways to add a link in the xCAT documentation. +Add links to refer other web page is a very common way in writing document, it's very helpful to reduce the doc duplication and make docs easy to understand. Following are several ways to add a link in the xCAT documentation. * **Add an Internal Link to ``Customized Link Target``** diff --git a/docs/source/overview/differentiators.rst b/docs/source/overview/differentiators.rst index f84bf0a8a..eb015c76b 100644 --- a/docs/source/overview/differentiators.rst +++ b/docs/source/overview/differentiators.rst @@ -18,7 +18,7 @@ Differentiators IBM Power, IBM Power LE, x86_64 -* Support Multiple Virtulization Infrastructures +* Support Multiple Virtualization Infrastructures IBM PowerKVM, KVM, IBM zVM, ESXI, XEN From b8894ed38b7113da759e8bb9494ed4dab2c5e46e Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Tue, 30 May 2017 14:28:15 -0400 Subject: [PATCH 086/129] Following changes based on review comments * Modified to display altitude instead of length * Print an output message if there is no values returned from the BMC --- .../guides/admin-guides/references/man1/rvitals.1.rst | 6 +++--- perl-xCAT/xCAT/FSPvitals.pm | 1 - perl-xCAT/xCAT/Usage.pm | 2 +- xCAT-client/pods/man1/rvitals.1.pod | 6 +++--- xCAT-server/lib/xcat/plugins/openbmc.pm | 8 ++++++-- 5 files changed, 13 insertions(+), 10 deletions(-) diff --git a/docs/source/guides/admin-guides/references/man1/rvitals.1.rst b/docs/source/guides/admin-guides/references/man1/rvitals.1.rst index ca8af6688..c6a84c704 100644 --- a/docs/source/guides/admin-guides/references/man1/rvitals.1.rst +++ b/docs/source/guides/admin-guides/references/man1/rvitals.1.rst @@ -67,7 +67,7 @@ OpenPOWER (OpenBMC) specific: ============================= -\ **rvitals**\ \ *noderange*\ [\ **temp | voltage | wattage | fanspeed | power | length | all**\ ] +\ **rvitals**\ \ *noderange*\ [\ **temp | voltage | wattage | fanspeed | power | altitude | all**\ ] @@ -140,9 +140,9 @@ Processor for a single or range of nodes and groups. -\ **length**\ +\ **altitude**\ - Retrieves length related attributes. + Retrieves altitude related attributes. diff --git a/perl-xCAT/xCAT/FSPvitals.pm b/perl-xCAT/xCAT/FSPvitals.pm index 3f31bf31c..11915abd7 100644 --- a/perl-xCAT/xCAT/FSPvitals.pm +++ b/perl-xCAT/xCAT/FSPvitals.pm @@ -375,7 +375,6 @@ sub rackenv { push @result, [ $name, $td, $Rc ]; if (!exists($request->{verbose})) { - #if( $td =~ /^Rack altitude in meters/ ) { if ($td =~ /^BPA-B total output in watts/) { last; } diff --git a/perl-xCAT/xCAT/Usage.pm b/perl-xCAT/xCAT/Usage.pm index 200f59037..742f7a9a1 100755 --- a/perl-xCAT/xCAT/Usage.pm +++ b/perl-xCAT/xCAT/Usage.pm @@ -84,7 +84,7 @@ my %usage = ( OpenPOWER (IPMI) specific: rvitals noderange [temp|voltage|wattage|fanspeed|power|leds|all] OpenPOWER (OpenBMC) specific: - rvitals noderange [temp|voltage|wattage|fanspeed|power|length|all] + rvitals noderange [temp|voltage|wattage|fanspeed|power|altitude|all] MIC specific: rvitals noderange {thermal|all}", "reventlog" => diff --git a/xCAT-client/pods/man1/rvitals.1.pod b/xCAT-client/pods/man1/rvitals.1.pod index 52bacd35e..bb7fec138 100644 --- a/xCAT-client/pods/man1/rvitals.1.pod +++ b/xCAT-client/pods/man1/rvitals.1.pod @@ -32,7 +32,7 @@ B I [B|B|B|B|B|B I [B|B|B|B|B|B|B] +B I [B|B|B|B|B|B|B] =head1 B @@ -79,9 +79,9 @@ Retrieves rack environmentals. Retrieves LEDs status. -=item B +=item B -Retrieves length related attributes. +Retrieves altitude related attributes. =item B diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index c827e4528..e896e9046 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -37,6 +37,8 @@ $::POWER_STATE_POWERING_ON="powering-on"; $::POWER_STATE_QUIESCED="quiesced"; $::POWER_STATE_RESET="reset"; +$::NO_ATTRIBUTES_RETURNED="No attributes returned from the BMC."; + sub unsupported { my $callback = shift; if (defined($::OPENBMC_DEVEL) && ($::OPENBMC_DEVEL eq "YES")) { @@ -458,7 +460,7 @@ sub parse_args { } elsif ($command eq "rvitals") { $check = unsupported($callback); if (ref($check) eq "ARRAY") { return $check; } $subcommand = "all" if (!defined($ARGV[0])); - unless ($subcommand =~ /^temp$|^voltage$|^wattage$|^fanspeed$|^power$|^length$|^all$/) { + unless ($subcommand =~ /^temp$|^voltage$|^wattage$|^fanspeed$|^power$|^altitude$|^all$/) { return ([ 1, "Unsupported command: $command $subcommand" ]); } } else { @@ -1235,7 +1237,7 @@ sub rvitals_response { if ($grep_string =~ "power") { unless ( $content{Unit} =~ "Amperes" || $content{Unit} =~ "Joules" || $content{Unit} =~ "Watts" ) { next; } } - if ($grep_string =~ "length") { + if ($grep_string =~ "altitude") { unless ( $content{Unit} =~ "Meters" ) { next; } } @@ -1262,6 +1264,8 @@ sub rvitals_response { my @sorted_output = grep {s/(^|\D)0+(\d)/$1$2/g,1} sort grep {s/(\d+)/sprintf"%06.6d",$1/ge,1} @sorted_output; xCAT::SvrUtils::sendmsg("$_", $callback, $node) foreach (@sorted_output); + } else { + xCAT::SvrUtils::sendmsg("$::NO_ATTRIBUTES_RETURNED", $callback, $node); } if ($next_status{ $node_info{$node}{cur_status} }) { From 78bc81874855021d7852ad2a7a94fcbbf3ae29c5 Mon Sep 17 00:00:00 2001 From: hu-weihua Date: Wed, 31 May 2017 01:26:43 -0400 Subject: [PATCH 087/129] Modify 2 bugs for xcattest --- xCAT-test/xcattest | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/xCAT-test/xcattest b/xCAT-test/xcattest index 7566e65d1..c3afbe490 100755 --- a/xCAT-test/xcattest +++ b/xCAT-test/xcattest @@ -1175,11 +1175,11 @@ sub run_case { #to run singal line command - $cmd = getfunc($cmd->[0]); - @output = &runcmd($cmd); + $cmd->[0] = getfunc($cmd->[0]); + @output = &runcmd($cmd->[0]); $rc = $::RUNCMD_RC; - log_this($running_log_fd, "RUN:$cmd [$runstartstr]"); - push(@caselog, "RUN:$cmd [$runstartstr]"); + log_this($running_log_fd, "RUN:$cmd->[0] [$runstartstr]"); + push(@caselog, "RUN:$cmd->[0] [$runstartstr]"); } else { #to run multiple lines command @@ -1275,7 +1275,8 @@ sub run_case { if ($cmdcheck) { &runcmd($cmdcheck); $rc = $::RUNCMD_RC; - if ($rc == 1) { + if ($rc != 0 ) { + $failflag = 1; log_this($running_log_fd, "CHECK:output $cmdcheck\t[Failed]"); push(@caselog, "CHECK:output $cmdcheck\t[Failed]"); } elsif ($rc == 0) { From 5056bea7db0a9d2a6378e3630f9a6bbd91c66e6f Mon Sep 17 00:00:00 2001 From: hu-weihua Date: Wed, 31 May 2017 05:13:06 -0400 Subject: [PATCH 088/129] modify typo --- xCAT-test/xcattest | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-test/xcattest b/xCAT-test/xcattest index c3afbe490..2bcbd7956 100755 --- a/xCAT-test/xcattest +++ b/xCAT-test/xcattest @@ -1173,7 +1173,7 @@ sub run_case { my $rc = 0; if ($cmdlen == 1) { - #to run singal line command + #to run single line command $cmd->[0] = getfunc($cmd->[0]); @output = &runcmd($cmd->[0]); From 5c4dd3184421a795b2ff8ff5e6893c45db503b4c Mon Sep 17 00:00:00 2001 From: yangsong Date: Wed, 31 May 2017 04:36:09 -0500 Subject: [PATCH 089/129] fix issue [fvt]2.13.4 nodeset osimage have no right output if command wrong #2971 (#3147) * fix issue#2971: one CLI arguments validation issue is not correct for nodeset/rinstall/winstall --- perl-xCAT/xCAT/Usage.pm | 38 +++++++++++++++++++++++ xCAT-server/lib/xcat/plugins/destiny.pm | 7 +++++ xCAT-server/lib/xcat/plugins/grub2.pm | 9 ++++-- xCAT-server/lib/xcat/plugins/petitboot.pm | 15 +++++---- xCAT-server/lib/xcat/plugins/rinstall.pm | 11 +++++++ xCAT-server/lib/xcat/plugins/xnba.pm | 14 ++++++--- xCAT-server/lib/xcat/plugins/yaboot.pm | 18 ++++++----- 7 files changed, 91 insertions(+), 21 deletions(-) diff --git a/perl-xCAT/xCAT/Usage.pm b/perl-xCAT/xCAT/Usage.pm index 742f7a9a1..2093ca5f0 100755 --- a/perl-xCAT/xCAT/Usage.pm +++ b/perl-xCAT/xCAT/Usage.pm @@ -622,3 +622,41 @@ sub parseCommand { return ""; } +#------------------------------------------------------------------------------ + +=head3 validateArgs + This function validates the arguments of the specified command + Arguments: + command + arguments(array @) + Returns: + $ref: a reference to array of [$retcode(integer),$info(string)] + $ref->[0]=0 : validation passed + $ret->[0]!=0: validation failed, the error info is returned in $ref->[1] + +=cut + +#------------------------------------------------------------------------------- + +sub validateArgs { + my $command=shift; + if ($command =~ /xCAT::Usage/) { $command = shift; } + + my $count=0; + my @extrargs=@_; + if($command =~ m/^(nodeset|rinstall|winstall)$/ ){ + #suppose that argument like "-p foo" have been processed and + #filtered by GetOpt subroutine + #fortunately the commands in this branch does not have such options + foreach(@extrargs){ + if($_ !~ m/^-[-]?\S+/){ + $count+=1; + } + } + if ($count!=1) { + return [1,"Invalid argument: '".join(" ",@extrargs)."'"]; + } + } + + return [0]; +} diff --git a/xCAT-server/lib/xcat/plugins/destiny.pm b/xCAT-server/lib/xcat/plugins/destiny.pm index 03d0b7843..41d63fc7b 100755 --- a/xCAT-server/lib/xcat/plugins/destiny.pm +++ b/xCAT-server/lib/xcat/plugins/destiny.pm @@ -187,8 +187,15 @@ sub setdestiny { chomp($state); my $target; my $action; + my $rawstate=$state; if ($state =~ /=/) { ($state, $target) = split '=', $state, 2; + + if(!$target){ + $callback->({ error => "invalid argument: \"$rawstate\"", errorcode => [1] }); + return; + } + if ($target =~ /:/) { ($target, $action) = split ':', $target, 2; } diff --git a/xCAT-server/lib/xcat/plugins/grub2.pm b/xCAT-server/lib/xcat/plugins/grub2.pm index e465db55b..5b2bb8ef3 100644 --- a/xCAT-server/lib/xcat/plugins/grub2.pm +++ b/xCAT-server/lib/xcat/plugins/grub2.pm @@ -12,7 +12,7 @@ use File::Path; use Socket; use Getopt::Long; use xCAT::Table; - +use xCAT::Usage; my $request; my %breaknetbootnodes; our %normalnodes; @@ -426,10 +426,13 @@ sub preprocess_request { return; } - if (@ARGV == 0) { + my $ret=xCAT::Usage->validateArgs($command,@ARGV); + if ($ret->[0]!=0) { if ($usage{$command}) { my %rsp; - $rsp{data}->[0] = $usage{$command}; + $rsp{error}->[0] = $ret->[1]; + $rsp{data}->[1] = $usage{$command}; + $rsp{errorcode}->[0] = $ret->[0]; $callback1->(\%rsp); } return; diff --git a/xCAT-server/lib/xcat/plugins/petitboot.pm b/xCAT-server/lib/xcat/plugins/petitboot.pm index faa292721..04430340b 100644 --- a/xCAT-server/lib/xcat/plugins/petitboot.pm +++ b/xCAT-server/lib/xcat/plugins/petitboot.pm @@ -6,7 +6,7 @@ use Getopt::Long; use xCAT::Table; use Sys::Syslog; use xCAT::Scope; - +use xCAT::Usage; my $globaltftpdir = xCAT::TableUtils->getTftpDir(); my %usage = ( @@ -322,11 +322,14 @@ sub preprocess_request { return; } - if (@ARGV == 0) { - if ($usage{$command}) { - my %rsp; - $rsp{data}->[0] = $usage{$command}; - $callback1->(\%rsp); + my $ret=xCAT::Usage->validateArgs($command,@ARGV); + if ($ret->[0]!=0) { + if ($usage{$command}) { + my %rsp; + $rsp{error}->[0] = $ret->[1]; + $rsp{data}->[1] = $usage{$command}; + $rsp{errorcode}->[0] = $ret->[0]; + $callback1->(\%rsp); } return; } diff --git a/xCAT-server/lib/xcat/plugins/rinstall.pm b/xCAT-server/lib/xcat/plugins/rinstall.pm index 7857aaa21..4fba96ed0 100644 --- a/xCAT-server/lib/xcat/plugins/rinstall.pm +++ b/xCAT-server/lib/xcat/plugins/rinstall.pm @@ -18,6 +18,7 @@ require xCAT::Utils; require xCAT::MsgUtils; use xCAT::NodeRange; use xCAT::Table; +use xCAT::Usage; use Data::Dumper; use Getopt::Long; @@ -96,6 +97,16 @@ sub rinstall { } if (($command =~ /rinstall/) or ($command =~ /winstall/)) { + my $ret=xCAT::Usage->validateArgs($command,@ARGV); + if ($ret->[0]!=0) { + my $rsp={}; + $rsp->{error}->[0] = $ret->[1]; + $rsp->{errorcode}->[0] = $ret->[0]; + xCAT::MsgUtils->message("E", $rsp, $callback); + &usage($command,$callback); + return; + } + my $state = $ARGV[0]; my $reststates; ($state, $reststates) = split(/,/, $state, 2); diff --git a/xCAT-server/lib/xcat/plugins/xnba.pm b/xCAT-server/lib/xcat/plugins/xnba.pm index eba36892d..e13c8dc79 100644 --- a/xCAT-server/lib/xcat/plugins/xnba.pm +++ b/xCAT-server/lib/xcat/plugins/xnba.pm @@ -11,6 +11,7 @@ use Getopt::Long; use xCAT::Utils; use xCAT::TableUtils; use xCAT::ServiceNodeUtils; +use xCAT::Usage; my $dhcpconf = "/etc/dhcpd.conf"; @@ -367,11 +368,14 @@ sub preprocess_request { return; } - if (@ARGV == 0) { - if ($usage{$command}) { - my %rsp; - $rsp{data}->[0] = $usage{$command}; - $callback1->(\%rsp); + my $ret=xCAT::Usage->validateArgs($command,@ARGV); + if ($ret->[0]!=0) { + if ($usage{$command}) { + my %rsp; + $rsp{error}->[0] = $ret->[1]; + $rsp{data}->[1] = $usage{$command}; + $rsp{errorcode}->[0] = $ret->[0]; + $callback1->(\%rsp); } return; } diff --git a/xCAT-server/lib/xcat/plugins/yaboot.pm b/xCAT-server/lib/xcat/plugins/yaboot.pm index 8e8ac37c9..1b3c3ab7e 100644 --- a/xCAT-server/lib/xcat/plugins/yaboot.pm +++ b/xCAT-server/lib/xcat/plugins/yaboot.pm @@ -12,6 +12,7 @@ use File::Path; use Socket; use Getopt::Long; use xCAT::Table; +use xCAT::Usage; my %breaknetbootnodes; our %normalnodes; @@ -422,15 +423,18 @@ sub preprocess_request { return; } - if (@ARGV == 0) { - if ($usage{$command}) { - my %rsp; - $rsp{data}->[0] = $usage{$command}; - $callback1->(\%rsp); + + my $ret=xCAT::Usage->validateArgs($command,@ARGV); + if ($ret->[0]!=0) { + if ($usage{$command}) { + my %rsp; + $rsp{error}->[0] = $ret->[1]; + $rsp{data}->[1] = $usage{$command}; + $rsp{errorcode}->[0] = $ret->[0]; + $callback1->(\%rsp); } return; - } - + } #Assume shared tftp directory for boring people, but for cool people, help sync up tftpdirectory contents when #if they specify no sharedtftp in site table From 1b9ccde323a82eb384af9a676264123c09bf40df Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Wed, 31 May 2017 15:09:14 -0400 Subject: [PATCH 090/129] Spelling fixes for admin guides --- .../guides/admin-guides/basic_concepts/xcat_object/node.rst | 4 ++-- .../common/deployment/acc_initrd_rootimg_gen.rst | 6 +++--- .../deployment/additionalpkg/nonubuntu_os_other_pkg.rst | 2 +- .../common/deployment/additionalpkg/nonubuntu_os_pkg.rst | 2 +- .../common/deployment/cfg_second_adapter.rst | 4 ++-- .../manage_clusters/common/deployment/deploy_os.rst | 2 +- .../manage_clusters/common/deployment/enable_kdump.rst | 2 +- .../manage_clusters/common/deployment/generate_img.rst | 6 +++--- .../common/deployment/prepostscripts/postinstall_script.rst | 2 +- .../manage_clusters/common/deployment/raid_cfg.rst | 6 +++--- .../common/deployment/syncfile/syncfile_overview.rst | 4 ++-- .../common/deployment/syncfile/syncfile_synclist_file.rst | 2 +- .../common/deployment/trim_diskless_rootimg.rst | 4 ++-- .../admin-guides/manage_clusters/common/kvm/manage_vm.rst | 4 ++-- .../admin-guides/manage_clusters/common/updatenode.rst | 2 +- .../manage_clusters/ppc64le/discovery/mtms/index.rst | 4 ++-- .../manage_clusters/ppc64le/statelite/config_statelite.rst | 4 ++-- .../manage_clusters/ppc64le/virtual_machines/FAQ.rst | 2 +- .../ppc64le/virtual_machines/hypervisorKVM.rst | 4 ++-- .../manage_clusters/ppc64le/virtual_machines/kvmMN.rst | 2 +- 20 files changed, 34 insertions(+), 34 deletions(-) diff --git a/docs/source/guides/admin-guides/basic_concepts/xcat_object/node.rst b/docs/source/guides/admin-guides/basic_concepts/xcat_object/node.rst index b8928ff7e..c94c576a2 100644 --- a/docs/source/guides/admin-guides/basic_concepts/xcat_object/node.rst +++ b/docs/source/guides/admin-guides/basic_concepts/xcat_object/node.rst @@ -6,7 +6,7 @@ Description The definition of physical units in the cluster, such as lpar, virtual machine, frame, cec, hmc, switch. -Key Attrubutes +Key Attributes -------------- * os: @@ -16,7 +16,7 @@ Key Attrubutes The hardware architecture of this node. Valid values: x86_64, ppc64, x86, ia64. * groups: - Usually, there are a set of nodes with some attributes in common, xCAT admin can define a node group containing these nodes, so that the management task can be issued against the group instead of individual nodes. A node can be a memeber of different groups, so the value of this attributes is a comma-delimited list of groups. At least one group is required to create a node. The new created group names should not be prefixed with "__" as this token has been preserverd as the internal group name. + Usually, there are a set of nodes with some attributes in common, xCAT admin can define a node group containing these nodes, so that the management task can be issued against the group instead of individual nodes. A node can be a member of different groups, so the value of this attributes is a comma-delimited list of groups. At least one group is required to create a node. The new created group names should not be prefixed with "__" as this token has been preserved as the internal group name. * mgt: The method to do general hardware management of the node. This attribute can be determined by the machine type of the node. Valid values: ipmi, blade, hmc, ivm, fsp, bpa, kvm, esx, rhevm. diff --git a/docs/source/guides/admin-guides/manage_clusters/common/deployment/acc_initrd_rootimg_gen.rst b/docs/source/guides/admin-guides/manage_clusters/common/deployment/acc_initrd_rootimg_gen.rst index 273c6c13c..9cc18ec36 100644 --- a/docs/source/guides/admin-guides/manage_clusters/common/deployment/acc_initrd_rootimg_gen.rst +++ b/docs/source/guides/admin-guides/manage_clusters/common/deployment/acc_initrd_rootimg_gen.rst @@ -1,14 +1,14 @@ Accelerating the diskless initrd and rootimg generating ======================================================== -Generating diskless initrd with ``genimage`` and compressed rootimg with ``packimage`` and ``liteimg`` is a time-comsuming process, it can be accelerated by enabling paralell compression tool ``pigz`` on the management node with multiple processors and cores. See :ref:`Appendix ` for an example on ``packimage`` performance optimized with ``pigz`` enabled. +Generating diskless initrd with ``genimage`` and compressed rootimg with ``packimage`` and ``liteimg`` is a time-consuming process, it can be accelerated by enabling parallel compression tool ``pigz`` on the management node with multiple processors and cores. See :ref:`Appendix ` for an example on ``packimage`` performance optimized with ``pigz`` enabled. Enabling the ``pigz`` for diskless initrd and rootimg generating ---------------------------------------------------------------- -The paralell compression tool ``pigz`` can be enabled by installing ``pigz`` package on the management server or diskless rootimg. Depending on the method of generating the initrd and compressed rootimg, the steps differ in different Linux distributions. +The parallel compression tool ``pigz`` can be enabled by installing ``pigz`` package on the management server or diskless rootimg. Depending on the method of generating the initrd and compressed rootimg, the steps differ in different Linux distributions. * **[RHEL]** @@ -24,7 +24,7 @@ The paralell compression tool ``pigz`` can be enabled by installing ``pigz`` pac ``pigz`` should be installed in the diskless rootimg. Download ``pigz`` package from https://dl.fedoraproject.org/pub/epel/ , then customize the diskless osimage to install ``pigz`` as the additional packages, see :doc:`Install Additional Other Packages` for more details. - 2) Enabeling the ``pigz`` in ``packimage`` + 2) Enabling the ``pigz`` in ``packimage`` ``pigz`` should be installed on the management server. Download ``pigz`` package from https://dl.fedoraproject.org/pub/epel/ , then install the ``pigz`` with ``yum`` or ``rpm``. diff --git a/docs/source/guides/admin-guides/manage_clusters/common/deployment/additionalpkg/nonubuntu_os_other_pkg.rst b/docs/source/guides/admin-guides/manage_clusters/common/deployment/additionalpkg/nonubuntu_os_other_pkg.rst index e6cc403e6..99d57a980 100644 --- a/docs/source/guides/admin-guides/manage_clusters/common/deployment/additionalpkg/nonubuntu_os_other_pkg.rst +++ b/docs/source/guides/admin-guides/manage_clusters/common/deployment/additionalpkg/nonubuntu_os_other_pkg.rst @@ -70,7 +70,7 @@ These are described in more details in the following sections. RPM Names ''''''''' -A simple otherpkgs.pkglist file just contains the the name of the rpm file without the version numbers. +A simple otherpkgs.pkglist file just contains the name of the rpm file without the version numbers. For example, if you put the following three rpms under **/install/post/otherpkgs///** directory, :: diff --git a/docs/source/guides/admin-guides/manage_clusters/common/deployment/additionalpkg/nonubuntu_os_pkg.rst b/docs/source/guides/admin-guides/manage_clusters/common/deployment/additionalpkg/nonubuntu_os_pkg.rst index 77651f270..dcf8c350b 100644 --- a/docs/source/guides/admin-guides/manage_clusters/common/deployment/additionalpkg/nonubuntu_os_pkg.rst +++ b/docs/source/guides/admin-guides/manage_clusters/common/deployment/additionalpkg/nonubuntu_os_pkg.rst @@ -51,7 +51,7 @@ These are described in more details in the following sections. RPM Names '''''''''' -A simple .pkglist file just contains the the name of the rpm file without the version numbers. +A simple .pkglist file just contains the name of the rpm file without the version numbers. For example :: diff --git a/docs/source/guides/admin-guides/manage_clusters/common/deployment/cfg_second_adapter.rst b/docs/source/guides/admin-guides/manage_clusters/common/deployment/cfg_second_adapter.rst index 492361fc5..ca1da9738 100644 --- a/docs/source/guides/admin-guides/manage_clusters/common/deployment/cfg_second_adapter.rst +++ b/docs/source/guides/admin-guides/manage_clusters/common/deployment/cfg_second_adapter.rst @@ -1,7 +1,7 @@ Configure Additional Network Interfaces - confignics ==================================================== -The **nics** table and the **confignics** postscript can be used to automatically configure additional network interfaces (mutltiple ethernets adapters, InfiniBand, etc) on the nodes as they are being deployed. +The **nics** table and the **confignics** postscript can be used to automatically configure additional network interfaces (multiple ethernets adapters, InfiniBand, etc) on the nodes as they are being deployed. The way the confignics postscript decides what IP address to give the secondary adapter is by checking the nics table, in which the nic configuration information is stored. @@ -78,7 +78,7 @@ By default, confignics does not configure the install nic. if need, using flag " chdef cn1 -p prostscripts="confignics -s" -Option "-s" writes the install nic's information into configuration file for persistance. All install nic's data defined in nics table will be written also. +Option "-s" writes the install nic's information into configuration file for persistence. All install nic's data defined in nics table will be written also. Add network object into the networks table diff --git a/docs/source/guides/admin-guides/manage_clusters/common/deployment/deploy_os.rst b/docs/source/guides/admin-guides/manage_clusters/common/deployment/deploy_os.rst index bd7567600..4a358b41e 100644 --- a/docs/source/guides/admin-guides/manage_clusters/common/deployment/deploy_os.rst +++ b/docs/source/guides/admin-guides/manage_clusters/common/deployment/deploy_os.rst @@ -11,7 +11,7 @@ There are more attributes of nodeset used for some specific purpose or specific * **runcmd**: This instructs the node to boot to the xCAT nbfs environment and proceed to configure BMC for basic remote access. This causes the IP, netmask, gateway, username, and password to be programmed according to the configuration table. * **shell**: This instructs the node to boot to the xCAT genesis environment, and present a shell prompt on console. The node will also be able to be sshed into and have utilities such as wget, tftp, scp, nfs, and cifs. It will have storage drivers available for many common systems. -Choose such additional attribute of nodeset according to your requirement, if want to get more informantion about nodeset, refer to nodeset's man page. +Choose such additional attribute of nodeset according to your requirement, if want to get more information about nodeset, refer to nodeset's man page. Start the OS Deployment ======================= diff --git a/docs/source/guides/admin-guides/manage_clusters/common/deployment/enable_kdump.rst b/docs/source/guides/admin-guides/manage_clusters/common/deployment/enable_kdump.rst index 85973cc1c..a6c0765d2 100644 --- a/docs/source/guides/admin-guides/manage_clusters/common/deployment/enable_kdump.rst +++ b/docs/source/guides/admin-guides/manage_clusters/common/deployment/enable_kdump.rst @@ -38,7 +38,7 @@ In above example, pkglist file is /opt/xcat/share/xcat/netboot/rh/compute.rhels7 Setup pkglist ------------- -Before setting up kdump,the approprite rpms should be added to the pkglist file.Here is the rpm packages list which needs to be added to pkglist file for kdump for different OS. +Before setting up kdump, the appropriate rpms should be added to the pkglist file.Here is the rpm packages list which needs to be added to pkglist file for kdump for different OS. * **[RHEL]** :: diff --git a/docs/source/guides/admin-guides/manage_clusters/common/deployment/generate_img.rst b/docs/source/guides/admin-guides/manage_clusters/common/deployment/generate_img.rst index a5dcf5382..e5886603d 100644 --- a/docs/source/guides/admin-guides/manage_clusters/common/deployment/generate_img.rst +++ b/docs/source/guides/admin-guides/manage_clusters/common/deployment/generate_img.rst @@ -1,7 +1,7 @@ Generate Diskless Image ======================= -The ``copycds`` command copies the contents of the Linux media to ``/install//`` so that it will be available for installing nodes or creating diskless images. After executing ``copycds``, there are serveral ``osimage`` definitions created by default. Run ``tabdump osimage`` to view these images: :: +The ``copycds`` command copies the contents of the Linux media to ``/install//`` so that it will be available for installing nodes or creating diskless images. After executing ``copycds``, there are several ``osimage`` definitions created by default. Run ``tabdump osimage`` to view these images: :: tabdump osimage @@ -18,7 +18,7 @@ The ``netboot-compute`` is the default **diskless** osimage created rhels7.1 ppc Before packing the diskless image, you have the opportunity to change any files in the image by changing to the ``rootimgdir`` and making modifications. (e.g. ``/install/netboot/rhels7.1/ppc64le/compute/rootimg``). -However it's recommended that all changes to the image are made via post install scripts so that it's easily repeatable.Although, instead, we recommend that you make all changes to the image via your postinstall script, so that it is repeatable. Refer to :doc:`/guides/admin-guides/manage_clusters/ppc64le/diskless/customize_image/pre_post_script` for more details. +However it's recommended that all changes to the image are made via post install scripts so that it's easily repeatable. Although, instead, we recommend that you make all changes to the image via your postinstall script, so that it is repeatable. Refer to :doc:`/guides/admin-guides/manage_clusters/ppc64le/diskless/customize_image/pre_post_script` for more details. Pack Diskless Image @@ -102,7 +102,7 @@ Skip this section if you want to use the image as is. 1, The use can modify the image to fit his/her own need. The following can be modified. -* Modify .pkglist file to add or remove packges that are from the os distro +* Modify .pkglist file to add or remove packages that are from the os distro * Modify .otherpkgs.pkglist to add or remove packages from other sources. Refer to ``Using_Updatenode`` for details diff --git a/docs/source/guides/admin-guides/manage_clusters/common/deployment/prepostscripts/postinstall_script.rst b/docs/source/guides/admin-guides/manage_clusters/common/deployment/prepostscripts/postinstall_script.rst index f212c8691..d3066b65c 100644 --- a/docs/source/guides/admin-guides/manage_clusters/common/deployment/prepostscripts/postinstall_script.rst +++ b/docs/source/guides/admin-guides/manage_clusters/common/deployment/prepostscripts/postinstall_script.rst @@ -40,7 +40,7 @@ The ``postinstall`` scripts are executed in step b). Do ``postinstall`` scripts execute in chroot mode under ``rootimgdir`` directory? ````````````````````````````````````````````````````````````````````````````````` -No. Unlike postscripts and postbootscripts, the ``postinstall`` scripts are run in non-chroot environment, directly on the management node. In the postinstall scripts, all the paths of the directories and files are based on ``/`` of the managememnt node. To reference inside the ``rootimgdir``, use the ``$IMG_ROOTIMGDIR`` environment variable, exported by ``genimage``. +No. Unlike postscripts and postbootscripts, the ``postinstall`` scripts are run in non-chroot environment, directly on the management node. In the postinstall scripts, all the paths of the directories and files are based on ``/`` of the management node. To reference inside the ``rootimgdir``, use the ``$IMG_ROOTIMGDIR`` environment variable, exported by ``genimage``. What are some of the environment variables available to my customized ``postinstall`` scripts? `````````````````````````````````````````````````````````````````````````````````````````````` diff --git a/docs/source/guides/admin-guides/manage_clusters/common/deployment/raid_cfg.rst b/docs/source/guides/admin-guides/manage_clusters/common/deployment/raid_cfg.rst index 0acea9a4e..752f38412 100644 --- a/docs/source/guides/admin-guides/manage_clusters/common/deployment/raid_cfg.rst +++ b/docs/source/guides/admin-guides/manage_clusters/common/deployment/raid_cfg.rst @@ -185,7 +185,7 @@ Here is the RAID1 partitioning section in service.raid1.sles11.tmpl: :: The samples above created one 24MB PReP partition on each disk, one 2GB mirrored swap partition and one mirrored ``/`` partition uses all the disk space. If you want to use different partitioning scheme in your cluster, modify this RAID1 section in the autoyast template file accordingly. -Since the PReP partition can not be mirrored between the two disks, some additional postinstall commands should be run to make the second disk bootable, here the the commands needed to make the second disk bootable: :: +Since the PReP partition can not be mirrored between the two disks, some additional postinstall commands should be run to make the second disk bootable, here the commands needed to make the second disk bootable: :: # Set the second disk to be bootable for RAID1 setup parted -s /dev/sdb mkfs 1 fat16 @@ -230,7 +230,7 @@ The command mdadm can query the detailed configuration for the RAID partitions: Disk Replacement Procedure -------------------------- -If any one disk fails in the RAID1 arrary, do not panic. Follow the procedure listed below to replace the failed disk and you will be fine. +If any one disk fails in the RAID1 array, do not panic. Follow the procedure listed below to replace the failed disk and you will be fine. Faulty disks should appear marked with an (F) if you look at ``/proc/mdstat``: :: @@ -250,7 +250,7 @@ Faulty disks should appear marked with an (F) if you look at ``/proc/mdstat``: : We can see that the first disk is broken because all the RAID partitions on this disk are marked as (F). -Remove the failed disk from RAID arrary +Remove the failed disk from RAID array --------------------------------------- ``mdadm`` is the command that can be used to query and manage the RAID arrays on Linux. To remove the failed disk from RAID array, use the command: :: diff --git a/docs/source/guides/admin-guides/manage_clusters/common/deployment/syncfile/syncfile_overview.rst b/docs/source/guides/admin-guides/manage_clusters/common/deployment/syncfile/syncfile_overview.rst index 4862d4ed8..d0d18af6f 100644 --- a/docs/source/guides/admin-guides/manage_clusters/common/deployment/syncfile/syncfile_overview.rst +++ b/docs/source/guides/admin-guides/manage_clusters/common/deployment/syncfile/syncfile_overview.rst @@ -3,7 +3,7 @@ Overview Synchronizing (sync) files to the nodes is a feature of xCAT used to distribute specific files from the management node to the new-deploying or deployed nodes. -This function is supported for diskful or RAMdisk-based diskless nodes.Generally, the specific files are usually the system configuration files for the nodes in the **/etc/directory**, like **/etc/hosts**, **/etc/resolve.conf**; it also could be the application programs configuration files for the nodes. The advantages of this function are: it can parallel sync files to the nodes or nodegroup for the installed nodes; it can automatically sync files to the newly-installing node after the installation. Additionally, this feature also supports the flexible format to define the synced files in a configuration file, called **'synclist'**. +This function is supported for diskful or RAMdisk-based diskless nodes. Generally, the specific files are usually the system configuration files for the nodes in the **/etc/directory**, like **/etc/hosts**, **/etc/resolve.conf**; it also could be the application programs configuration files for the nodes. The advantages of this function are: it can parallel sync files to the nodes or nodegroup for the installed nodes; it can automatically sync files to the newly-installing node after the installation. Additionally, this feature also supports the flexible format to define the synced files in a configuration file, called **'synclist'**. The synclist file can be a common one for a group of nodes using the same profile or osimage, or can be the special one for a particular node. Since the location of the synclist file will be used to find the synclist file, the common synclist should be put in a given location for Linux nodes or specified by the osimage. @@ -17,7 +17,7 @@ For a new-installing nodes, the Syncing File action will be triggered when perfo The postscript **'syncfiles'** is located in the **/install/postscripts/**. When running, it sends a message to the xcatd on the management node or service node, then the xcatd figures out the corresponding synclist file for the node and calls the ``xdcp`` command to sync files in the synclist to the node. -**If installing nodes in a hierarchical configuration, you must sync the Service Nodes first to make sure they are updated. The compute nodes will be sync'd from their service nodes.You can use the** ``updatenode -f`` **command to sync all the service nodes for range of compute nodes provided.** +**If installing nodes in a hierarchical configuration, you must sync the Service Nodes first to make sure they are updated. The compute nodes will be sync'd from their service nodes. You can use the** ``updatenode -f`` **command to sync all the service nodes for range of compute nodes provided.** For an installed nodes, the Syncing File action happens when performing the ``updatenode -F`` or ``xdcp -F synclist`` command to update a nodes. If performing the ``updatenode -F``, it figures out the location of the synclist files for all the nodes and classify the nodes which using same synclist file and then calls the ``xdcp -F synclist`` to sync files to the nodes. diff --git a/docs/source/guides/admin-guides/manage_clusters/common/deployment/syncfile/syncfile_synclist_file.rst b/docs/source/guides/admin-guides/manage_clusters/common/deployment/syncfile/syncfile_synclist_file.rst index 6ce471eb3..9af8e913f 100644 --- a/docs/source/guides/admin-guides/manage_clusters/common/deployment/syncfile/syncfile_synclist_file.rst +++ b/docs/source/guides/admin-guides/manage_clusters/common/deployment/syncfile/syncfile_synclist_file.rst @@ -97,7 +97,7 @@ Note: From xCAT 2.9.2 on AIX and from xCAT 2.12 on Linux, xCAT support a new for file -> (noderange for permitted nodes) file -The noderange would have several format. Following examples show that /etc/hosts file is synced to the nodes which is specifed before the file name :: +The noderange would have several format. Following examples show that /etc/hosts file is synced to the nodes which is specified before the file name :: /etc/hosts -> (node1,node2) /etc/hosts # The /etc/hosts file is synced to node1 and node2 /etc/hosts -> (node1-node4) /etc/hosts # The /etc/hosts file is synced to node1,node2,node3 and node4 diff --git a/docs/source/guides/admin-guides/manage_clusters/common/deployment/trim_diskless_rootimg.rst b/docs/source/guides/admin-guides/manage_clusters/common/deployment/trim_diskless_rootimg.rst index 198ac04e8..e417ca402 100644 --- a/docs/source/guides/admin-guides/manage_clusters/common/deployment/trim_diskless_rootimg.rst +++ b/docs/source/guides/admin-guides/manage_clusters/common/deployment/trim_diskless_rootimg.rst @@ -51,7 +51,7 @@ The content above presents some syntax supported in exlist file: +./usr/share/locale/C* - It is useful to include files following an exclude entry to qiuckly remove a larger set of files using a wildcard and then adding back the few necessary files using the + sign. In the above example, all the files and sub-directories matching the pattern ``/usr/share/locale/C*`` will be included in the ``rootimg.gz`` file. + It is useful to include files following an exclude entry to quickly remove a larger set of files using a wildcard and then adding back the few necessary files using the + sign. In the above example, all the files and sub-directories matching the pattern ``/usr/share/locale/C*`` will be included in the ``rootimg.gz`` file. Customize the ``exlist`` file and the osimage definition @@ -77,4 +77,4 @@ If you want to customize the osimage ``sles12.1-ppc64le-netboot-compute`` with y .. [1] The ``exlist`` file entry should not end with a slash ``/``, For example, this entry will never match anything: ``./usr/lib/perl[0-9]/[0-9.]*/ppc64le-linux-thread-multi/Encode/``. -.. [2] Pattern match test applies to the whole file name,starting from one of the start points specified in the ``exlist`` file entry. The regex syntax should comply with the regex syntax of system command ``find -path``, refer to its doc for details. +.. [2] Pattern match test applies to the whole file name, starting from one of the start points specified in the ``exlist`` file entry. The regex syntax should comply with the regex syntax of system command ``find -path``, refer to its doc for details. diff --git a/docs/source/guides/admin-guides/manage_clusters/common/kvm/manage_vm.rst b/docs/source/guides/admin-guides/manage_clusters/common/kvm/manage_vm.rst index cc7a1fc49..f383e065d 100644 --- a/docs/source/guides/admin-guides/manage_clusters/common/kvm/manage_vm.rst +++ b/docs/source/guides/admin-guides/manage_clusters/common/kvm/manage_vm.rst @@ -2,7 +2,7 @@ Manage Virtual Machine (VM) ============================ -Now the MowerKVM hypervisor "kvmhost1" is ready, this section introduces the VM management in xCAT, including examples on how to create,remove and clone VMs. +Now the MowerKVM hypervisor "kvmhost1" is ready, this section introduces the VM management in xCAT, including examples on how to create, remove and clone VMs. Create Virtual Machine ---------------------- @@ -117,7 +117,7 @@ Now a VM "vm1" is created, it can be provisioned like any other nodes in xCAT. T rpower vm1 on -If "vm1" is powered on successfully, the VM status can be obtained by running the following command on management node :: +If "vm1" is powered on successfully, the VM status can be obtained by running the following command on management node :: rpower vm1 status diff --git a/docs/source/guides/admin-guides/manage_clusters/common/updatenode.rst b/docs/source/guides/admin-guides/manage_clusters/common/updatenode.rst index 67444a2cd..5a505a57b 100644 --- a/docs/source/guides/admin-guides/manage_clusters/common/updatenode.rst +++ b/docs/source/guides/admin-guides/manage_clusters/common/updatenode.rst @@ -134,6 +134,6 @@ where is a comma separated postscript like ospkgs,otherpkgs etc. * wget is used in xcatdsklspost/xcataixpost to get all the postscripts from the to the node. You can check /tmp/wget.log file on the node to see if wget was successful or not. You need to make sure the /xcatpost directory has enough space to hold the postscripts. * A file called /xcatpost/mypostscript (Linux) is created on the node which contains the environmental variables and scripts to be run. Make sure this file exists and it contains correct info. You can also run this file on the node manually to debug. * For ospkgs/otherpkgs, if /install is not mounted on the , it will download all the rpms from the to the node using wget. Make sure /tmp and /xcatpost have enough space to hold the rpms and check /tmp/wget.log for errors. - * For ospkgs/otherpkgs, If zypper or yum is installed on the node, it will be used the command to install the rpms. Make sure to run createrepo on the source direcory on the every time a rpm is added or removed. Otherwise, the rpm command will be used, in this case, make sure all the necessary depended rpms are copied in the same source directory. + * For ospkgs/otherpkgs, If zypper or yum is installed on the node, it will be used the command to install the rpms. Make sure to run createrepo on the source directory on the every time a rpm is added or removed. Otherwise, the rpm command will be used, in this case, make sure all the necessary depended rpms are copied in the same source directory. * You can append -x on the first line of ospkgs/otherpkgs to get more debug info. diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms/index.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms/index.rst index fde5e5254..c4c998c9e 100644 --- a/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms/index.rst +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms/index.rst @@ -3,12 +3,12 @@ MTMS-based Discovery MTMS stands for **M**\ achine **T**\ ype/\ **M**\ odel and **S**\ erial. This is one way to uniquely identify each physical server. -MTMS-based hardware discovery assumes the administator has the model type and serial number information for the physical servers and a plan for mapping the servers to intended hostname/IP addresses. +MTMS-based hardware discovery assumes the administrator has the model type and serial number information for the physical servers and a plan for mapping the servers to intended hostname/IP addresses. **Overview** #. Automatically search and collect MTMS information from the servers - #. Write **discovered-bmc-nodes** to xCAT (recommened to set different BMC IP address) + #. Write **discovered-bmc-nodes** to xCAT (recommended to set different BMC IP address) #. Create **predefined-compute-nodes** to xCAT providing additional properties #. Power on the nodes which triggers xCAT hardware discovery engine diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/statelite/config_statelite.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/statelite/config_statelite.rst index ce44725f0..0e66ab76d 100644 --- a/docs/source/guides/admin-guides/manage_clusters/ppc64le/statelite/config_statelite.rst +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/statelite/config_statelite.rst @@ -20,7 +20,7 @@ The litefile table specifies the directories and files on the statelite nodes th #. The third column in the litefile table specifies options for the directory or file: #. tmpfs - It provides a file or directory for the node to use when booting, its permission will be the same as the original version on the server. In most cases, it is read-write; however, on the next statelite boot, the original version of the file or directory on the server will be used, it means it is non-persistent. This option can be performed on files and directories. - #. rw - Same as Above.Its name "rw" does NOT mean it always be read-write, even in most cases it is read-write. Do not confuse it with the "rw" permission in the file system. + #. rw - Same as above. Its name "rw" does NOT mean it always be read-write, even in most cases it is read-write. Do not confuse it with the "rw" permission in the file system. #. persistent - It provides a mounted file or directory that is copied to the xCAT persistent location and then over-mounted on the local file or directory. Anything written to that file or directory is preserved. It means, if the file/directory does not exist at first, it will be copied to the persistent location. Next time the file/directory in the persistent location will be used. The file/directory will be persistent across reboots. Its permission will be the same as the original one in the statelite location. It requires the statelite table to be filled out with a spot for persistent statelite. This option can be performed on files and directories. #. con - The contents of the pathname are concatenated to the contents of the existing file. For this directive the searching in the litetree hierarchy does not stop when the first match is found. All files found in the hierarchy will be concatenated to the file when found. The permission of the file will be "-rw-r--r--", which means it is read-write for the root user, but readonly for the others. It is non-persistent, when the node reboots, all changes to the file will be lost. It can only be performed on files. Do not use it for one directory. #. ro - The file/directory will be overmounted read-only on the local file/directory. It will be located in the directory hierarchy specified in the litetree table. Changes made to this file or directory on the server will be immediately seen in this file/directory on the node. This option requires that the file/directory to be mounted must be available in one of the entries in the litetree table. This option can be performed on files and directories. @@ -133,5 +133,5 @@ noderes ``noderes.nfsserver`` attribute can be set for the NFSroot server. If this is not set, then the default is the Management Node. -``noderes.nfsdir`` can be set. If this is not set, the the default is ``/install`` +``noderes.nfsdir`` can be set. If this is not set, the default is ``/install`` diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/virtual_machines/FAQ.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/virtual_machines/FAQ.rst index 7a00d46e6..214c79607 100644 --- a/docs/source/guides/admin-guides/manage_clusters/ppc64le/virtual_machines/FAQ.rst +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/virtual_machines/FAQ.rst @@ -88,7 +88,7 @@ Fail to ping the installed VM ADDRCONF(NETDEV_UP): eth0 link is not ready. - **Solutoin**: + **Solution**: Usually caused by the incorrect VM NIC model. Try the following steps to specify "virtio": :: rmvm vm1 diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/virtual_machines/hypervisorKVM.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/virtual_machines/hypervisorKVM.rst index e4f0b0b14..63a2df528 100644 --- a/docs/source/guides/admin-guides/manage_clusters/ppc64le/virtual_machines/hypervisorKVM.rst +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/virtual_machines/hypervisorKVM.rst @@ -16,7 +16,7 @@ Provision Hypervisor #. Customize the hypervisor node definition to create network bridge - xCAT ships a postscript **xHRM** to create a network bridge on kvm host during installation/netbooting. Specify the **xHRM** with appropriate parameters in **postscripts** attibute. For example: + xCAT ships a postscript **xHRM** to create a network bridge on kvm host during installation/netbooting. Specify the **xHRM** with appropriate parameters in **postscripts** attribute. For example: * To create a bridge named 'br0' against the installation network device specified by **installnic**: :: @@ -68,7 +68,7 @@ If the hypervisor is provisioned successfully according to the steps described a br0 8000.000000000000 no eth0 -If the network bridge is not created or configured successfully, run "xHRM" with **updatenode** on managememt node to create it manually::: +If the network bridge is not created or configured successfully, run "xHRM" with **updatenode** on management node to create it manually::: updatenode kvmhost1 -P "xHRM bridgeprereq eth0:br0" diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/virtual_machines/kvmMN.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/virtual_machines/kvmMN.rst index 8b735a1f4..eb33072f8 100644 --- a/docs/source/guides/admin-guides/manage_clusters/ppc64le/virtual_machines/kvmMN.rst +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/virtual_machines/kvmMN.rst @@ -15,7 +15,7 @@ Please make sure the following packages have been installed on the management no Set Up the kvm storage directory on the management node(optional) ----------------------------------------------------------------- -It is a recommended configuration to create a shared file system for virtual machines hosting. The shared file system, usually on a SAN, NAS or GPFS, is shared among KVM hypevisors, which simplifies VM migration from one hypervisor to another with xCAT. +It is a recommended configuration to create a shared file system for virtual machines hosting. The shared file system, usually on a SAN, NAS or GPFS, is shared among KVM hypervisors, which simplifies VM migration from one hypervisor to another with xCAT. The easiest shared file system is ``/install`` directory on the management node, it can be shared among hypervisors via NFS. Please refer to the following steps : From b1d75f8704414f5c064420ee9940eaaef61e020c Mon Sep 17 00:00:00 2001 From: XuWei Date: Wed, 31 May 2017 21:48:42 -0400 Subject: [PATCH 091/129] Add testcase to setup/clear openbmc simulator --- .../autotest/testcase/simulator/change_ip.sh | 19 +++++++++++++++++++ .../testcase/simulator/clear_simulator | 4 ++++ .../testcase/simulator/setup_simulator | 8 ++++++++ 3 files changed, 31 insertions(+) create mode 100644 xCAT-test/autotest/testcase/simulator/change_ip.sh create mode 100644 xCAT-test/autotest/testcase/simulator/clear_simulator create mode 100644 xCAT-test/autotest/testcase/simulator/setup_simulator diff --git a/xCAT-test/autotest/testcase/simulator/change_ip.sh b/xCAT-test/autotest/testcase/simulator/change_ip.sh new file mode 100644 index 000000000..15ed0ad7c --- /dev/null +++ b/xCAT-test/autotest/testcase/simulator/change_ip.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +flag=$1 +mnhn=$2 +cnhn=$3 + +if [ $flag = "-s" ]; then + cnip=`lsdef $cnhn -i bmc -c | awk -F '=' '{print $2}'` + echo $cnip > "/tmp/simulator" + mnip=`ping $mnhn -c 1 | grep "64 bytes from" |awk -F'(' '{print $2}'|awk -F')' '{print $1}'` + chdef $cnhn bmc=$mnip +elif [ $flag = "-c" ]; then + cnip=`cat /tmp/simulator` + chdef $cnhn bmc=$cnip + process=`ps aux | grep "simulator" | grep "python" | awk -F ' ' '{print $2}'` + kill $process + rm -rf "openbmc_simulator" +fi +exit $? diff --git a/xCAT-test/autotest/testcase/simulator/clear_simulator b/xCAT-test/autotest/testcase/simulator/clear_simulator new file mode 100644 index 000000000..24a95a41b --- /dev/null +++ b/xCAT-test/autotest/testcase/simulator/clear_simulator @@ -0,0 +1,4 @@ +start:clear_openbmc_simulator +cmd:sh /opt/xcat/share/xcat/tools/autotest/testcase/setup_simulator/change_ip.sh -c $$MN $$CN +check:rc==0 +end diff --git a/xCAT-test/autotest/testcase/simulator/setup_simulator b/xCAT-test/autotest/testcase/simulator/setup_simulator new file mode 100644 index 000000000..34f66896b --- /dev/null +++ b/xCAT-test/autotest/testcase/simulator/setup_simulator @@ -0,0 +1,8 @@ +start:setup_openbmc_simulator +cmd:git clone git@github.com:xuweibj/openbmc_simulator.git +check:rc==0 +cmd:/root/openbmc_simulator/simulator & +check:rc==0 +cmd:sh /opt/xcat/share/xcat/tools/autotest/testcase/setup_simulator/change_ip.sh -s $$MN $$CN +check:rc==0 +end From 57b10b57bd859b18cf3d0adc16005b31eaf7c15c Mon Sep 17 00:00:00 2001 From: GONG Jie Date: Thu, 1 Jun 2017 14:27:45 +0800 Subject: [PATCH 092/129] Add basic integration check to all the migration tests --- xCAT-test/autotest/testcase/migration/redhat_migration | 4 ++++ xCAT-test/autotest/testcase/migration/sles_migration | 4 ++++ xCAT-test/autotest/testcase/migration/ubuntu_migration1_p8le | 2 ++ xCAT-test/autotest/testcase/migration/ubuntu_migration1_vm | 2 ++ xCAT-test/autotest/testcase/migration/ubuntu_migration2_p8le | 2 ++ xCAT-test/autotest/testcase/migration/ubuntu_migration2_vm | 2 ++ 6 files changed, 16 insertions(+) diff --git a/xCAT-test/autotest/testcase/migration/redhat_migration b/xCAT-test/autotest/testcase/migration/redhat_migration index c2d43ff7b..57e67a268 100644 --- a/xCAT-test/autotest/testcase/migration/redhat_migration +++ b/xCAT-test/autotest/testcase/migration/redhat_migration @@ -97,6 +97,8 @@ cmd:xdsh $$CN "lsdef" check:output=~node0001 cmd:xdsh $$CN "noderm node0001" check:rc==0 +cmd:xdsh $$CN "/opt/xcat/share/xcat/tools/go-xcat smoke-test" +check:rc==0 cmd:latest_version_info=`lsxcatd -v`;xdsh $$CN "lsxcatd -v" | grep "$latest_version_info" check:rc==0 cmd:if [[ -f /tmp/servicelabel ]];then chdef $$SN -p groups=service;rm -rf /tmp/servicelabel;fi @@ -204,6 +206,8 @@ cmd:xdsh $$CN "lsdef" check:output=~node0001 cmd:xdsh $$CN "noderm node0001" check:rc==0 +cmd:xdsh $$CN "/opt/xcat/share/xcat/tools/go-xcat smoke-test" +check:rc==0 cmd:latest_version_info=`lsxcatd -v`;xdsh $$CN "lsxcatd -v" | grep "$latest_version_info" check:rc==0 cmd:if [[ -f /tmp/servicelabel ]];then chdef $$SN -p groups=service;rm -rf /tmp/servicelabel;fi diff --git a/xCAT-test/autotest/testcase/migration/sles_migration b/xCAT-test/autotest/testcase/migration/sles_migration index f20f56edb..36e6002fa 100644 --- a/xCAT-test/autotest/testcase/migration/sles_migration +++ b/xCAT-test/autotest/testcase/migration/sles_migration @@ -99,6 +99,8 @@ cmd:xdsh $$CN "lsdef" check:output=~node0001 cmd:xdsh $$CN "noderm node0001" check:rc==0 +cmd:xdsh $$CN "/opt/xcat/share/xcat/tools/go-xcat smoke-test" +check:rc==0 cmd:latest_version_info=`lsxcatd -v`;xdsh $$CN "lsxcatd -v" | grep "$latest_version_info" check:rc==0 cmd:if [[ -f /tmp/servicelabel ]];then chdef $$SN -p groups=service;rm -rf /tmp/servicelabel;fi @@ -209,6 +211,8 @@ cmd:xdsh $$CN "lsdef" check:output=~node0001 cmd:xdsh $$CN "noderm node0001" check:rc==0 +cmd:xdsh $$CN "/opt/xcat/share/xcat/tools/go-xcat smoke-test" +check:rc==0 cmd:latest_version_info=`lsxcatd -v`;xdsh $$CN "lsxcatd -v" | grep "$latest_version_info" check:rc==0 cmd:if [[ -f /tmp/servicelabel ]];then chdef $$SN -p groups=service;rm -rf /tmp/servicelabel;fi diff --git a/xCAT-test/autotest/testcase/migration/ubuntu_migration1_p8le b/xCAT-test/autotest/testcase/migration/ubuntu_migration1_p8le index cf77bd24f..e9f12e354 100644 --- a/xCAT-test/autotest/testcase/migration/ubuntu_migration1_p8le +++ b/xCAT-test/autotest/testcase/migration/ubuntu_migration1_p8le @@ -118,6 +118,8 @@ cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;rmdef node0001" check:rc==0 cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsdef" check:output!~node0001 +cmd:xdsh $$CN "/opt/xcat/share/xcat/tools/go-xcat smoke-test" +check:rc==0 cmd:xdsh $$CN "diff /oldxcat/old_version /newxcat/new_version" check:rc!=0 diff --git a/xCAT-test/autotest/testcase/migration/ubuntu_migration1_vm b/xCAT-test/autotest/testcase/migration/ubuntu_migration1_vm index 636553292..1c72822a7 100644 --- a/xCAT-test/autotest/testcase/migration/ubuntu_migration1_vm +++ b/xCAT-test/autotest/testcase/migration/ubuntu_migration1_vm @@ -117,6 +117,8 @@ cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;rmdef node0001" check:rc==0 cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsdef" check:output!~node0001 +cmd:xdsh $$CN "/opt/xcat/share/xcat/tools/go-xcat smoke-test" +check:rc==0 cmd:xdsh $$CN "diff /oldxcat/old_version /newxcat/new_version" check:rc!=0 end diff --git a/xCAT-test/autotest/testcase/migration/ubuntu_migration2_p8le b/xCAT-test/autotest/testcase/migration/ubuntu_migration2_p8le index 1d3216e8c..a1509715b 100644 --- a/xCAT-test/autotest/testcase/migration/ubuntu_migration2_p8le +++ b/xCAT-test/autotest/testcase/migration/ubuntu_migration2_p8le @@ -118,6 +118,8 @@ cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;rmdef node0001" check:rc==0 cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsdef" check:output!~node0001 +cmd:xdsh $$CN "/opt/xcat/share/xcat/tools/go-xcat smoke-test" +check:rc==0 cmd:xdsh $$CN "diff /oldxcat/old_version /newxcat/new_version" check:rc!=0 diff --git a/xCAT-test/autotest/testcase/migration/ubuntu_migration2_vm b/xCAT-test/autotest/testcase/migration/ubuntu_migration2_vm index 34c7123cb..d4af68b22 100644 --- a/xCAT-test/autotest/testcase/migration/ubuntu_migration2_vm +++ b/xCAT-test/autotest/testcase/migration/ubuntu_migration2_vm @@ -117,6 +117,8 @@ cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;rmdef node0001" check:rc==0 cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsdef" check:output!~node0001 +cmd:xdsh $$CN "/opt/xcat/share/xcat/tools/go-xcat smoke-test" +check:rc==0 cmd:xdsh $$CN "diff /oldxcat/old_version /newxcat/new_version" check:rc!=0 end From ffd2bdee8ee019830e6cd68dd0ee2fd20728c912 Mon Sep 17 00:00:00 2001 From: hu-weihua Date: Thu, 1 Jun 2017 03:19:29 -0400 Subject: [PATCH 093/129] Remove stop label from all provision cases --- xCAT-test/autotest/testcase/installation/SN_setup_case | 2 +- .../testcase/installation/reg_linux_diskfull_installation_flat | 2 +- .../installation/reg_linux_diskfull_installation_hierarchy | 2 +- .../testcase/installation/reg_linux_diskless_installation_flat | 2 +- .../installation/reg_linux_diskless_installation_hierarchy | 2 +- .../testcase/installation/reg_linux_statelite_installation_flat | 2 +- .../reg_linux_statelite_installation_hierarchy_by_nfs | 2 +- .../reg_linux_statelite_installation_hierarchy_by_ramdisk | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/xCAT-test/autotest/testcase/installation/SN_setup_case b/xCAT-test/autotest/testcase/installation/SN_setup_case index 330bdeaa2..4d0c6baa0 100644 --- a/xCAT-test/autotest/testcase/installation/SN_setup_case +++ b/xCAT-test/autotest/testcase/installation/SN_setup_case @@ -1,6 +1,6 @@ start:SN_setup_case os:Linux -stop:yes +#stop:yes cmd:fdisk -l cmd:df -T cmd:XCAT_DATABASE=$$XCAT_DATABASE /opt/xcat/share/xcat/tools/autotest/testcase/installation/pre_deploy_sn __GETNODEATTR($$SN,os)__ __GETNODEATTR($$SN,arch)__ diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_flat b/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_flat index cbe7a6991..be95f5d86 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_flat +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_flat @@ -1,6 +1,6 @@ start:reg_linux_diskfull_installation_flat os:Linux -stop:yes +#stop:yes cmd:fdisk -l cmd:df -T cmd:if ping -c 1 $$SN > /dev/null;then rpower $$SN off > /dev/null;fi diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_hierarchy b/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_hierarchy index eca702914..a21b71002 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_hierarchy +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_hierarchy @@ -1,6 +1,6 @@ start:reg_linux_diskfull_installation_hierarchy os:Linux -stop:yes +#stop:yes cmd:xdsh $$SN fdisk -l cmd:xdsh $$SN df -T cmd:xdsh $$SN "echo "test"> /test.hierarchy" diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat index 1541fae4b..f2019566a 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat @@ -1,6 +1,6 @@ start:reg_linux_diskless_installation_flat os:Linux -stop:yes +#stop:yes cmd:fdisk -l cmd:df -T cmd:chdef -t node -o $$CN servicenode= monserver=$$MN nfsserver=$$MN tftpserver=$$MN xcatmaster=$$MN diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy index 8ca853faa..920c1d563 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy @@ -1,6 +1,6 @@ start:reg_linux_diskless_installation_hierarchy os:Linux -stop:yes +#stop:yes cmd:xdsh $$SN fdisk -l cmd:xdsh $$SN df -T cmd:xdsh $$SN "echo "test"> /test.hierarchy" diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_flat b/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_flat index fa994e2c6..4b3b6849b 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_flat +++ b/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_flat @@ -1,6 +1,6 @@ start:reg_linux_statelite_installation_flat os:Linux -stop:yes +#stop:yes cmd:fdisk -l cmd:df -T diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_nfs b/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_nfs index cfb83253f..076a14c2d 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_nfs +++ b/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_nfs @@ -1,6 +1,6 @@ start:reg_linux_statelite_installation_hierarchy_by_nfs os:Linux -stop:yes +#stop:yes cmd:xdsh $$SN fdisk -l cmd:xdsh $$SN df -T cmd:xdsh $$SN "echo "test"> /test.hierarchy" diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_ramdisk b/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_ramdisk index a15e412f1..e9851d362 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_ramdisk +++ b/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_ramdisk @@ -1,6 +1,6 @@ start:reg_linux_statelite_installation_hierarchy_by_ramdisk os:Linux -stop:yes +#stop:yes cmd:xdsh $$SN fdisk -l cmd:xdsh $$SN df -T cmd:xdsh $$SN "echo "test"> /test.hierarchy" From c557dea948b2cb9092a0bcd25bfb710702183c3c Mon Sep 17 00:00:00 2001 From: XuWei Date: Thu, 1 Jun 2017 04:40:13 -0400 Subject: [PATCH 094/129] modified depending on comments --- .../autotest/testcase/simulator/change_ip.sh | 0 .../testcase/simulator/clear_simulator | 3 ++- .../testcase/simulator/install_git.sh | 24 +++++++++++++++++++ .../testcase/simulator/setup_simulator | 5 ++-- 4 files changed, 29 insertions(+), 3 deletions(-) mode change 100644 => 100755 xCAT-test/autotest/testcase/simulator/change_ip.sh create mode 100755 xCAT-test/autotest/testcase/simulator/install_git.sh diff --git a/xCAT-test/autotest/testcase/simulator/change_ip.sh b/xCAT-test/autotest/testcase/simulator/change_ip.sh old mode 100644 new mode 100755 diff --git a/xCAT-test/autotest/testcase/simulator/clear_simulator b/xCAT-test/autotest/testcase/simulator/clear_simulator index 24a95a41b..85b2557bd 100644 --- a/xCAT-test/autotest/testcase/simulator/clear_simulator +++ b/xCAT-test/autotest/testcase/simulator/clear_simulator @@ -1,4 +1,5 @@ start:clear_openbmc_simulator -cmd:sh /opt/xcat/share/xcat/tools/autotest/testcase/setup_simulator/change_ip.sh -c $$MN $$CN +description:clear evironment +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/setup_simulator/change_ip.sh -c $$MN $$CN check:rc==0 end diff --git a/xCAT-test/autotest/testcase/simulator/install_git.sh b/xCAT-test/autotest/testcase/simulator/install_git.sh new file mode 100755 index 000000000..d00e2475c --- /dev/null +++ b/xCAT-test/autotest/testcase/simulator/install_git.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +os=`cat /etc/*release*` + +if [[ "$os" =~ "Red Hat" ]] || [[ "$os" =~ "suse" ]]; then + yum install git + if [ $? != 0 ]; then + echo "Install git Failed." >> $log_file + exit 1 + fi +elif [[ "$os" =~ "ubuntu" ]]; then + apt-get install git + if [ $? != 0 ]; then + echo "Install git Failed." >> $log_file + exit 1 + fi +fi + +cd + +git clone git@github.com:xuweibj/openbmc_simulator.git + +exit $? + diff --git a/xCAT-test/autotest/testcase/simulator/setup_simulator b/xCAT-test/autotest/testcase/simulator/setup_simulator index 34f66896b..29fae143e 100644 --- a/xCAT-test/autotest/testcase/simulator/setup_simulator +++ b/xCAT-test/autotest/testcase/simulator/setup_simulator @@ -1,8 +1,9 @@ start:setup_openbmc_simulator -cmd:git clone git@github.com:xuweibj/openbmc_simulator.git +description:install dependent packaages, setup and start openbmc simulator +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/simulator/install_git.sh check:rc==0 cmd:/root/openbmc_simulator/simulator & check:rc==0 -cmd:sh /opt/xcat/share/xcat/tools/autotest/testcase/setup_simulator/change_ip.sh -s $$MN $$CN +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/simulator/change_ip.sh -s $$MN $$CN check:rc==0 end From fe6b771addc5a5e5ceed871bf090d57650872111 Mon Sep 17 00:00:00 2001 From: Bin Xu Date: Thu, 1 Jun 2017 17:22:22 +0800 Subject: [PATCH 095/129] Fix #3087: nodeset improvement - using multi-process to parallelize (#3118) * Fix #3087: nodeset improvement - using multi-process to parallelize - before deliver the request to xcatd, we can split the request to multiple sub-requests which contains different noderange - in that, xcatd could hanle those sub-requests in parallel, just like some issue multiple commands. * refine according to the review comments: - not using POSIX::ceil - Callback is reserved for filter method * refine codes according review comments * make the comments right and more readable. --- perl-xCAT/xCAT/Scope.pm | 165 ++++++++++++++++++++++ xCAT-server/lib/xcat/plugins/destiny.pm | 18 ++- xCAT-server/lib/xcat/plugins/grub2.pm | 12 +- xCAT-server/lib/xcat/plugins/petitboot.pm | 12 +- xCAT-server/lib/xcat/plugins/xnba.pm | 19 +-- 5 files changed, 206 insertions(+), 20 deletions(-) diff --git a/perl-xCAT/xCAT/Scope.pm b/perl-xCAT/xCAT/Scope.pm index 654e6950a..a7aaf2588 100644 --- a/perl-xCAT/xCAT/Scope.pm +++ b/perl-xCAT/xCAT/Scope.pm @@ -1,8 +1,173 @@ package xCAT::Scope; + use xCAT::Utils; use xCAT::Table; use xCAT::ServiceNodeUtils qw(getSNList); + +#----------------------------------------------------------------------------- + +=head3 split_node_array + + Split a node array into multiple subsets in case to handle them in parallel. + + Arguments: + Reference of source array + Maximum subset number + Default element capacity in each subset + Returns: An array of all subsets + Error: + none + Example: + my $subsets = split_node_array(\@nodes, 5, 250); +=cut + +#----------------------------------------------------------------------------- +sub split_node_array { + my $source = shift; + if ($source =~ /xCAT::Scope/) { + $source = shift; + } + my $max_sub = shift; + my $capacity = shift; + + if ($max_sub < 2) {return [$source];} + + my @dest = (); + my $total = $#{$source} + 1; + my $n_sub = int ($total / $capacity); + unless ($n_sub * $capacity == $total) { $n_sub++;} #POSIX::ceil + + if ( $n_sub <= 1 ) { + # Only 1 subset is enough + $dest[0] = $source; + + } elsif ( $n_sub > $max_sub ) { + # Exceed, then to recaculate the capacity of each subset as we only allow max_sub + $capacity = int ($total / $max_sub); + if ( $total % $max_sub > 0 ) { + $capacity += 1; + } + my $start = $end = 0; + for (1..$max_sub) { + $end = $start + $capacity - 1; + if ( $end > $total - 1 ) { + $end = $total - 1 + } + + my @temp = @$source[$start..$end]; + $dest[$_-1]=\@temp; + $start = $end + 1; + } + + } else { + # Only n_sub subsets are required, split the noderange into each subset + my $start = $end = 0; + for (1..$n_sub) { + $end = $start + $capacity - 1; + if ( $end > $total - 1 ) { + $end = $total - 1 + } + #print "subset #$_: $start to $end"; + my @temp = @$source[$start..$end]; + $dest[$_-1]=\@temp; + $start = $end + 1; + } + } + + return \@dest; +} + +#----------------------------------------------------------------------------- + +=head3 get_parallel_scope + + Convert a request object to an array of multiple requests according to the + splitted node range. + + Arguments: + Reference of request + Maximum subset number: Optional, default is 5 + Default element capacity in each subset: Optional, default is 250 + Returns: An array of requests + Error: + none + Example: + my $reqs = xCAT::Scope->get_parallel_scope($request); +=cut + +#----------------------------------------------------------------------------- +sub get_parallel_scope { + my $req = shift; + if ($req =~ /xCAT::Scope/) { + $req = shift; + } + my ($max_sub, $capacity) = @_; + #TODO, make the value configurable + unless ($max_sub) { $max_sub = 5; } + unless ($capacity) { $capacity = 250; } + + my $subsets = split_node_array(\@{$req->{node}}, $max_sub, $capacity); + # Just return the origin one if node range is not big enough. + if ($#{$subsets} < 1) { return [$req]; } + + my @requests = (); + foreach (@$subsets) { + my $reqcopy = {%$req}; + $reqcopy->{node} = $_; + push @requests, $reqcopy; + } + return \@requests; +} + +#----------------------------------------------------------------------------- + +=head3 get_broadcast_scope_with_parallel + + Convert a request object to an array of multiple requests according to the + splitted node range. + + Arguments: + Reference of request + Callback: TODO, Optional, the Callback will be used to filter the nodes + Returns: An array of requests + Error: + none + Example: + my $reqs = xCAT::Scope->get_broadcast_scope($request); +=cut + +#----------------------------------------------------------------------------- +sub get_broadcast_scope_with_parallel { + my $req = shift; + if ($req =~ /xCAT::Scope/) { + $req = shift; + } + #Exit if the packet has been preprocessed in its history + if ($req->{_xcatpreprocessed}->[0] == 1) { return [$req]; } + + #Handle the one for current management/service node + my $reqs = get_parallel_scope($req); + my @requests = @$reqs; + + #Broadcast the request to other management/service nodes + foreach (xCAT::ServiceNodeUtils->getSNList()) { + if (xCAT::NetworkUtils->thishostisnot($_)) { + my $xcatdest = $_; + my $reqcopy = {%$req}; + $reqcopy->{'_xcatdest'} = $_; + $reqcopy->{_xcatpreprocessed}->[0] = 1; + #Apply callback to filter the node range in future. + $reqs = get_parallel_scope($reqcopy); + foreach (@$reqs) { + push @requests, {%$_}; + } + } + } + return \@requests; +} + + sub get_broadcast_scope { my $req = shift; if ($req =~ /xCAT::Scope/) { diff --git a/xCAT-server/lib/xcat/plugins/destiny.pm b/xCAT-server/lib/xcat/plugins/destiny.pm index 41d63fc7b..ba55424f8 100755 --- a/xCAT-server/lib/xcat/plugins/destiny.pm +++ b/xCAT-server/lib/xcat/plugins/destiny.pm @@ -76,15 +76,24 @@ sub process_request { sub relay_response { my $resp = shift; + my $failure = 0; $callback->($resp); if ($resp and ($resp->{errorcode} and $resp->{errorcode}->[0]) or ($resp->{error} and $resp->{error}->[0])) { - $errored = 1; + $failure = 1; } - foreach (@{ $resp->{node} }) { - if ($_->{error} or $_->{errorcode}) { - $errored = 1; + # quick return when detect failure. + unless ( $failure ) { + foreach (@{ $resp->{node} }) { + if ($_->{error} or $_->{errorcode}) { + $failure = 1; + last; + } } } + if ( $failure ) { + $errored = $failure; + } + } sub setdestiny { @@ -408,6 +417,7 @@ sub setdestiny { bootparams => \$bphash}, \&relay_response); if ($errored) { # The error messeage for mkinstall/mknetboot/mkstatelite had been output within relay_response function above, don't need to output more + xCAT::MsgUtils->trace($verbose_on_off, "d", "destiny->process_request: Failed in processing mk$tempstate. Processing will not continue."); return; } diff --git a/xCAT-server/lib/xcat/plugins/grub2.pm b/xCAT-server/lib/xcat/plugins/grub2.pm index 5b2bb8ef3..14fa9702a 100644 --- a/xCAT-server/lib/xcat/plugins/grub2.pm +++ b/xCAT-server/lib/xcat/plugins/grub2.pm @@ -468,10 +468,10 @@ sub preprocess_request { return [$req]; } if (@CN > 0) { # if compute nodes broadcast to all servicenodes - return xCAT::Scope->get_broadcast_scope($req, @_); + return xCAT::Scope->get_broadcast_scope_with_parallel($req); } } - return [$req]; + return xCAT::Scope->get_parallel_scope($req); } sub process_request { @@ -592,9 +592,10 @@ sub process_request { my $inittime = 0; if (exists($request->{inittime})) { $inittime = $request->{inittime}->[0]; } if (!$inittime) { $inittime = 0; } - $errored = 0; + my %bphash; unless ($args[0] eq 'stat') { # or $args[0] eq 'enact') { + $errored = 0; xCAT::MsgUtils->trace($verbose_on_off, "d", "grub2: issue setdestiny request"); $sub_req->({ command => ['setdestiny'], node => \@nodes, @@ -602,8 +603,11 @@ sub process_request { arg => \@args, bootparams => \%bphash }, \&pass_along); + if ($errored) { + xCAT::MsgUtils->trace($verbose_on_off, "d", "petitboot: Failed in processing setdestiny. Processing will not continue."); + return; + } } - if ($errored) { return; } my $chaintab = xCAT::Table->new('chain', -create => 1); my $chainhash = $chaintab->getNodesAttribs(\@nodes, ['currstate']); diff --git a/xCAT-server/lib/xcat/plugins/petitboot.pm b/xCAT-server/lib/xcat/plugins/petitboot.pm index 04430340b..04f7bcdf7 100644 --- a/xCAT-server/lib/xcat/plugins/petitboot.pm +++ b/xCAT-server/lib/xcat/plugins/petitboot.pm @@ -360,10 +360,10 @@ sub preprocess_request { return [$req]; } if (@CN > 0) { # if compute nodes broadcast to all servicenodes - return xCAT::Scope->get_broadcast_scope($req, @_); + return xCAT::Scope->get_broadcast_scope_with_parallel($req); } } - return [$req]; + return xCAT::Scope->get_parallel_scope($req); } @@ -487,9 +487,10 @@ sub process_request { my $inittime = 0; if (exists($request->{inittime})) { $inittime = $request->{inittime}->[0]; } if (!$inittime) { $inittime = 0; } - $errored = 0; + my %bphash; unless ($args[0] eq 'stat') { # or $args[0] eq 'enact') { + $errored = 0; xCAT::MsgUtils->trace($verbose_on_off, "d", "petitboot: issue setdestiny request"); $sub_req->({ command => ['setdestiny'], node => \@nodes, @@ -497,8 +498,11 @@ sub process_request { arg => \@args, bootparams => \%bphash}, \&pass_along); + if ($errored) { + xCAT::MsgUtils->trace($verbose_on_off, "d", "petitboot: Failed in processing setdestiny. Processing will not continue."); + return; + } } - if ($errored) { return; } # Fix the bug 4611: PowerNV stateful CN provision will hang at reboot stage# if ($args[0] eq 'next') { diff --git a/xCAT-server/lib/xcat/plugins/xnba.pm b/xCAT-server/lib/xcat/plugins/xnba.pm index e13c8dc79..dd8fe9d1c 100644 --- a/xCAT-server/lib/xcat/plugins/xnba.pm +++ b/xCAT-server/lib/xcat/plugins/xnba.pm @@ -117,7 +117,7 @@ sub setstate { #Implement the kcmdline append here for #most generic, least code duplication -###hack start + ###hack start # This is my comment. There are many others like it, but this one is mine. # My comment is my best friend. It is my life. I must master it as I must master my life. # Without me, my comment is useless. Without my comment, I am useless. @@ -167,7 +167,7 @@ sub setstate { #$kern->{kcmdline} .= " ".$kern->{addkcmdline}; $kern->{kcmdline} .= " " . $kcmdlinehack; -###hack end + ###hack end } } @@ -243,7 +243,7 @@ sub setstate { if ($kern->{kernel} =~ /esxi[56]/) { #Make uefi boot provisions my $ucfg; open($ucfg, '>', $tftpdir . "/xcat/xnba/nodes/" . $node . ".uefi"); - if ($kern->{kcmdline} =~ / xcat\/netboot/) { + if ($kern->{kcmdline} =~ /xcat\/netboot/) { $kern->{kcmdline} =~ s/xcat\/netboot/\/tftpboot\/xcat\/netboot/; } print $ucfg "#!gpxe\n"; @@ -408,10 +408,10 @@ sub preprocess_request { return [$req]; } if (@CN > 0) { # if compute nodes broadcast to all servicenodes - return xCAT::Scope->get_broadcast_scope($req, @_); + return xCAT::Scope->get_broadcast_scope_with_parallel($req); } } - return [$req]; + return xCAT::Scope->get_parallel_scope($req); } sub process_request { @@ -545,9 +545,10 @@ sub process_request { my $inittime = 0; if (exists($::XNBA_request->{inittime})) { $inittime = $::XNBA_request->{inittime}->[0]; } if (!$inittime) { $inittime = 0; } - $errored = 0; + my %bphash; unless ($args[0] eq 'stat') { # or $args[0] eq 'enact') { + $errored = 0; xCAT::MsgUtils->trace($verbose_on_off, "d", "xnba: issue setdestiny request"); $sub_req->({ command => ['setdestiny'], node => \@nodes, @@ -555,10 +556,12 @@ sub process_request { arg => \@args , bootparams => \%bphash}, \&pass_along); + if ($errored) { + xCAT::MsgUtils->trace($verbose_on_off, "d", "xnba: Failed in processing setdestiny. Processing will not continue."); + return; + } } - if ($errored) { return; } - #Time to actually configure the nodes, first extract database data with the scalable calls my $chaintab = xCAT::Table->new('chain'); my $noderestab = xCAT::Table->new('noderes'); #in order to detect per-node tftp directories From 6c8034cfa90d461adab5fa990622ad8820218270 Mon Sep 17 00:00:00 2001 From: immarvin Date: Thu, 1 Jun 2017 21:49:32 +0800 Subject: [PATCH 096/129] fix typo in if-clause --- xCAT-server/share/xcat/install/scripts/post.rhels7 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xCAT-server/share/xcat/install/scripts/post.rhels7 b/xCAT-server/share/xcat/install/scripts/post.rhels7 index 3b36dfefe..f5c9de34e 100644 --- a/xCAT-server/share/xcat/install/scripts/post.rhels7 +++ b/xCAT-server/share/xcat/install/scripts/post.rhels7 @@ -9,11 +9,11 @@ for i in $(find /etc/sysconfig/network-scripts/ifcfg-*|egrep -v ifcfg-lo ) do nicname=$(echo $i|awk -F 'ifcfg-' '{print $2}') - if ethtool $nicname|grep -E -i "Link detected.*yes" >/dev/null 2>&1 + if ethtool $nicname|grep -E -i "Link detected.*yes" >/dev/null 2>&1; then if [ "$XCATDEBUGMODE" = "1" ] || [ "$XCATDEBUGMODE" = "2" ]; then msgutil_r "$MASTER_IP" "info" "set NIC $nicname to be activated on system boot" "/var/log/xcat/xcat.log" fi - then sed -i 's/ONBOOT=no/ONBOOT=yes/' $i + sed -i 's/ONBOOT=no/ONBOOT=yes/' $i fi #remove the entry 'HWADDR' from ifcfg-ethx, this is used to skip the From 0dae47b9a5189355b2b46132d664dbc5af85b69d Mon Sep 17 00:00:00 2001 From: Yuan Bai Date: Fri, 2 Jun 2017 11:25:35 +0800 Subject: [PATCH 097/129] fix issue 3142 delete useless dracut.* files under rootimg/tmp in liteimg (#3154) * fix issue 3142 useless dracut.* files under rootimg/tmp cause liteimg cost much time * polished * polished --- xCAT-server/lib/xcat/plugins/statelite.pm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/xCAT-server/lib/xcat/plugins/statelite.pm b/xCAT-server/lib/xcat/plugins/statelite.pm index daed8b6e6..e6f2e5e2d 100644 --- a/xCAT-server/lib/xcat/plugins/statelite.pm +++ b/xCAT-server/lib/xcat/plugins/statelite.pm @@ -355,6 +355,11 @@ sub process_request { xCAT::Utils->runcmd("mkdir $rootimg_dir/.statebackup", 0, 1); } + #delete useless rootimg/tmp/dracut.* files + #fix copy many dracut.* files cost too much time in liteimg + $verbose && $callback->({ info => ["removing \"$rootimg_dir/tmp/dracut.*\""] }); + unlink glob "$rootimg_dir/tmp/dracut.*"; + # recovery the files in litefile.save if necessary foreach my $line (keys %hashSaved) { my @oldentry = split(/\s+/, $line); From d7d3324abf9acd9bcec5ad792d76cc71c8a50f15 Mon Sep 17 00:00:00 2001 From: XuWei Date: Fri, 2 Jun 2017 01:57:58 -0400 Subject: [PATCH 098/129] modified depending on comments --- .../testcase/simulator/install_git.sh | 24 ------------------- .../testcase/simulator/setup_simulator | 17 ++++++++++++- 2 files changed, 16 insertions(+), 25 deletions(-) delete mode 100755 xCAT-test/autotest/testcase/simulator/install_git.sh diff --git a/xCAT-test/autotest/testcase/simulator/install_git.sh b/xCAT-test/autotest/testcase/simulator/install_git.sh deleted file mode 100755 index d00e2475c..000000000 --- a/xCAT-test/autotest/testcase/simulator/install_git.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash - -os=`cat /etc/*release*` - -if [[ "$os" =~ "Red Hat" ]] || [[ "$os" =~ "suse" ]]; then - yum install git - if [ $? != 0 ]; then - echo "Install git Failed." >> $log_file - exit 1 - fi -elif [[ "$os" =~ "ubuntu" ]]; then - apt-get install git - if [ $? != 0 ]; then - echo "Install git Failed." >> $log_file - exit 1 - fi -fi - -cd - -git clone git@github.com:xuweibj/openbmc_simulator.git - -exit $? - diff --git a/xCAT-test/autotest/testcase/simulator/setup_simulator b/xCAT-test/autotest/testcase/simulator/setup_simulator index 29fae143e..f2549cca3 100644 --- a/xCAT-test/autotest/testcase/simulator/setup_simulator +++ b/xCAT-test/autotest/testcase/simulator/setup_simulator @@ -1,6 +1,21 @@ start:setup_openbmc_simulator description:install dependent packaages, setup and start openbmc simulator -cmd:/opt/xcat/share/xcat/tools/autotest/testcase/simulator/install_git.sh +cmd:#!/bin/bash +os=`cat /etc/*release*` +if [[ "$os" =~ "Red Hat" ]] || [[ "$os" =~ "suse" ]]; then + yum install git + if [ $? != 0 ]; then + exit 1 + fi +elif [[ "$os" =~ "ubuntu" ]]; then + apt-get install git + if [ $? != 0 ]; then + exit 1 + fi +fi +exit 0 +check:rc==0 +cmd:cd /root/ && git clone git@github.com:xuweibj/openbmc_simulator.git check:rc==0 cmd:/root/openbmc_simulator/simulator & check:rc==0 From e4d06a4a8bc058fe5734784b5efad13d45a25d7d Mon Sep 17 00:00:00 2001 From: "litingt@cn.ibm.com" Date: Fri, 2 Jun 2017 03:33:16 -0400 Subject: [PATCH 099/129] update according to comments --- xCAT-test/autotest/testcase/makedhcp/cases0 | 1 + 1 file changed, 1 insertion(+) diff --git a/xCAT-test/autotest/testcase/makedhcp/cases0 b/xCAT-test/autotest/testcase/makedhcp/cases0 index b56db6f91..417f3f5a8 100644 --- a/xCAT-test/autotest/testcase/makedhcp/cases0 +++ b/xCAT-test/autotest/testcase/makedhcp/cases0 @@ -189,6 +189,7 @@ check:rc==0 cmd: cp -f /etc/hosts /etc/hosts.bak cmd:echo "100.100.100.2 testnode" >> /etc/hosts check:rc==0 +cmd:makdhcp -d testnode cmd:makedhcp testnode check:rc==0 cmd:makdhcp -q testnode From 2f62326f04b21d1ea8987be2549e67655b76a574 Mon Sep 17 00:00:00 2001 From: GONG Jie Date: Fri, 2 Jun 2017 16:45:40 +0800 Subject: [PATCH 100/129] Do operating system deployment in migration test cases --- .../testcase/migration/redhat_migration | 42 +++++++++++-------- .../testcase/migration/sles_migration | 38 ++++++++++------- .../testcase/migration/ubuntu_migration1_p8le | 19 +++++---- .../testcase/migration/ubuntu_migration1_vm | 19 +++++---- .../testcase/migration/ubuntu_migration2_p8le | 19 +++++---- .../testcase/migration/ubuntu_migration2_vm | 19 +++++---- 6 files changed, 97 insertions(+), 59 deletions(-) diff --git a/xCAT-test/autotest/testcase/migration/redhat_migration b/xCAT-test/autotest/testcase/migration/redhat_migration index 57e67a268..6ce3b9432 100644 --- a/xCAT-test/autotest/testcase/migration/redhat_migration +++ b/xCAT-test/autotest/testcase/migration/redhat_migration @@ -71,11 +71,13 @@ check:output=~$$MIGRATION1_VERSION cmd:xdsh $$CN "service xcatd status" check:rc==0 check:output=~running -cmd:xdsh $$CN "chdef -t node -o node0001 nodetype=osi groups=linux" +cmd:lsdef $$SN -z | ssh $$CN "mkdef -z" +cmd:ssh $$CN "chdef $$SN servicenode= monserver= nfsserver= tftpserver= xcatmaster=" +cmd:makedhcp -d $$SN +cmd:scp $$ISO $$CN:/tmp/foobar.iso +cmd:ssh $$CN "copycds /tmp/foobar.iso" +cmd:ssh $$CN "makedhcp -n" check:rc==0 -cmd:xdsh $$CN "lsdef" -check:output=~node0001 -cmd:check==0 cmd:xdsh $$CN "cd /; scp -r $$MN:/core-rpms-snap.tar.bz2 /" check:rc==0 cmd:xdsh $$CN "cd /; scp -r $$MN:/xcat-dep*.tar.bz2 /" @@ -93,14 +95,15 @@ check:rc==0 cmd:xdsh $$CN "service xcatd status" check:rc==0 check:output=~running -cmd:xdsh $$CN "lsdef" -check:output=~node0001 -cmd:xdsh $$CN "noderm node0001" -check:rc==0 -cmd:xdsh $$CN "/opt/xcat/share/xcat/tools/go-xcat smoke-test" -check:rc==0 cmd:latest_version_info=`lsxcatd -v`;xdsh $$CN "lsxcatd -v" | grep "$latest_version_info" check:rc==0 +cmd:ssh $$CN "rinstall $$SN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute" +check:rc==0 +cmd:sleep 300 +cmd:ssh $$CN "a=0; while ! `lsdef -l $$SN | grep status | grep booted >/dev/null`; do ((++a > 90)) && exit 99; sleep 20; done" +check:rc==0 +cmd:ssh $$CN "xdsh $$SN date" +check:rc==0 cmd:if [[ -f /tmp/servicelabel ]];then chdef $$SN -p groups=service;rm -rf /tmp/servicelabel;fi check:rc==0 cmd:if [[ -f /tmp/poweroffsn ]];then rpower $$SN on > /dev/null;rm -rf /tmp/poweroffsn;fi @@ -180,10 +183,12 @@ check:output=~$$MIGRATION2_VERSION cmd:xdsh $$CN "service xcatd status" check:rc==0 check:output=~running -cmd:xdsh $$CN "chdef -t node -o node0001 nodetype=osi groups=linux" -check:rc==0 -cmd:xdsh $$CN "lsdef" -check:output=~node0001 +cmd:lsdef $$SN -z | ssh $$CN "mkdef -z" +cmd:ssh $$CN "chdef $$SN servicenode= monserver= nfsserver= tftpserver= xcatmaster=" +cmd:makedhcp -d $$SN +cmd:scp $$ISO $$CN:/tmp/foobar.iso +cmd:ssh $$CN "copycds /tmp/foobar.iso" +cmd:ssh $$CN "makedhcp -n" cmd:check==0 cmd:xdsh $$CN "cd /; scp -r $$MN:/core-rpms-snap.tar.bz2 /" check:rc==0 @@ -202,9 +207,12 @@ check:rc==0 cmd:xdsh $$CN "service xcatd status" check:rc==0 check:output=~running -cmd:xdsh $$CN "lsdef" -check:output=~node0001 -cmd:xdsh $$CN "noderm node0001" +cmd:ssh $$CN "rinstall $$SN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute" +check:rc==0 +cmd:sleep 300 +cmd:ssh $$CN "a=0; while ! `lsdef -l $$SN | grep status | grep booted >/dev/null`; do ((++a > 90)) && exit 99; sleep 20; done" +check:rc==0 +cmd:ssh $$CN "xdsh $$SN date" check:rc==0 cmd:xdsh $$CN "/opt/xcat/share/xcat/tools/go-xcat smoke-test" check:rc==0 diff --git a/xCAT-test/autotest/testcase/migration/sles_migration b/xCAT-test/autotest/testcase/migration/sles_migration index 36e6002fa..d822385e0 100644 --- a/xCAT-test/autotest/testcase/migration/sles_migration +++ b/xCAT-test/autotest/testcase/migration/sles_migration @@ -74,10 +74,12 @@ check:output=~$$MIGRATION1_VERSION cmd:xdsh $$CN "service xcatd status" check:rc==0 check:output=~running -cmd:xdsh $$CN "chdef -t node -o node0001 nodetype=osi groups=linux" -check:rc==0 -cmd:xdsh $$CN "lsdef" -check:output=~node0001 +cmd:lsdef $$SN -z | ssh $$CN "mkdef -z" +cmd:ssh $$CN "chdef $$SN servicenode= monserver= nfsserver= tftpserver= xcatmaster=" +cmd:makedhcp -d $$SN +cmd:scp $$ISO $$CN:/tmp/foobar.iso +cmd:ssh $$CN "copycds /tmp/foobar.iso" +cmd:ssh $$CN "makedhcp -n" cmd:xdsh $$CN "cd /; scp -r $$MN:/core-rpms-snap.tar.bz2 /" check:rc==0 cmd:xdsh $$CN "cd /; scp -r $$MN:/xcat-dep*.tar.bz2 /" @@ -95,9 +97,12 @@ check:rc==0 cmd:xdsh $$CN "service xcatd status" check:rc==0 check:output=~running -cmd:xdsh $$CN "lsdef" -check:output=~node0001 -cmd:xdsh $$CN "noderm node0001" +cmd:ssh $$CN "rinstall $$SN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute" +check:rc==0 +cmd:sleep 300 +cmd:ssh $$CN "a=0; while ! `lsdef -l $$SN | grep status | grep booted >/dev/null`; do ((++a > 90)) && exit 99; sleep 20; done" +check:rc==0 +cmd:ssh $$CN "xdsh $$SN date" check:rc==0 cmd:xdsh $$CN "/opt/xcat/share/xcat/tools/go-xcat smoke-test" check:rc==0 @@ -186,10 +191,12 @@ check:output=~$$MIGRATION2_VERSION cmd:xdsh $$CN "service xcatd status" check:rc==0 check:output=~running -cmd:xdsh $$CN "chdef -t node -o node0001 nodetype=osi groups=linux" -check:rc==0 -cmd:xdsh $$CN "lsdef" -check:output=~node0001 +cmd:lsdef $$SN -z | ssh $$CN "mkdef -z" +cmd:ssh $$CN "chdef $$SN servicenode= monserver= nfsserver= tftpserver= xcatmaster=" +cmd:makedhcp -d $$SN +cmd:scp $$ISO $$CN:/tmp/foobar.iso +cmd:ssh $$CN "copycds /tmp/foobar.iso" +cmd:ssh $$CN "makedhcp -n" cmd:xdsh $$CN "cd /; scp -r $$MN:/core-rpms-snap.tar.bz2 /" check:rc==0 cmd:xdsh $$CN "cd /; scp -r $$MN:/xcat-dep*.tar.bz2 /" @@ -207,9 +214,12 @@ check:rc==0 cmd:xdsh $$CN "service xcatd status" check:rc==0 check:output=~running -cmd:xdsh $$CN "lsdef" -check:output=~node0001 -cmd:xdsh $$CN "noderm node0001" +cmd:ssh $$CN "rinstall $$SN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute" +check:rc==0 +cmd:sleep 300 +cmd:ssh $$CN "a=0; while ! `lsdef -l $$SN | grep status | grep booted >/dev/null`; do ((++a > 90)) && exit 99; sleep 20; done" +check:rc==0 +cmd:ssh $$CN "xdsh $$SN date" check:rc==0 cmd:xdsh $$CN "/opt/xcat/share/xcat/tools/go-xcat smoke-test" check:rc==0 diff --git a/xCAT-test/autotest/testcase/migration/ubuntu_migration1_p8le b/xCAT-test/autotest/testcase/migration/ubuntu_migration1_p8le index e9f12e354..2a6c8af8f 100644 --- a/xCAT-test/autotest/testcase/migration/ubuntu_migration1_p8le +++ b/xCAT-test/autotest/testcase/migration/ubuntu_migration1_p8le @@ -80,10 +80,12 @@ check:rc==0 cmd:xdsh $$CN "service xcatd status" check:rc==0 check:output=~running -cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;chdef -t node -o node0001 nodetype=osi groups=linux" -check:rc==0 -cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsdef" -check:output=~node0001 +cmd:lsdef $$SN -z | ssh $$CN "/opt/xcat/bin/mkdef -z" +cmd:ssh $$CN "/opt/xcat/bin/chdef $$SN servicenode= monserver= nfsserver= tftpserver= xcatmaster=" +cmd:makedhcp -d $$SN +cmd:scp $$ISO $$CN:/tmp/foobar.iso +cmd:ssh $$CN "/opt/xcat/sbin/copycds /tmp/foobar.iso" +cmd:ssh $$CN "/opt/xcat/sbin/makedhcp -n" cmd:xdsh $$CN "rm -rf /newxcat" cmd:xdsh $$CN "mkdir -p /newxcat" check:rc==0 @@ -114,10 +116,13 @@ check:rc==0 cmd:xdsh $$CN "service xcatd status" check:rc==0 check:output=~running -cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;rmdef node0001" +cmd:ssh $$CN "/opt/xcat/bin/rinstall $$SN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute" +check:rc==0 +cmd:sleep 300 +cmd:ssh $$CN "a=0; while ! `/opt/xcat/bin/lsdef -l $$SN | grep status | grep booted >/dev/null`; do ((++a > 90)) && exit 99; sleep 20; done" +check:rc==0 +cmd:ssh $$CN "/opt/xcat/bin/xdsh $$SN date" check:rc==0 -cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsdef" -check:output!~node0001 cmd:xdsh $$CN "/opt/xcat/share/xcat/tools/go-xcat smoke-test" check:rc==0 cmd:xdsh $$CN "diff /oldxcat/old_version /newxcat/new_version" diff --git a/xCAT-test/autotest/testcase/migration/ubuntu_migration1_vm b/xCAT-test/autotest/testcase/migration/ubuntu_migration1_vm index 1c72822a7..8c519b898 100644 --- a/xCAT-test/autotest/testcase/migration/ubuntu_migration1_vm +++ b/xCAT-test/autotest/testcase/migration/ubuntu_migration1_vm @@ -79,10 +79,12 @@ check:rc==0 cmd:xdsh $$CN "service xcatd status" check:rc==0 check:output=~running -cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;chdef -t node -o node0001 nodetype=osi groups=linux" -check:rc==0 -cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsdef" -check:output=~node0001 +cmd:lsdef $$SN -z | ssh $$CN "/opt/xcat/bin/mkdef -z" +cmd:ssh $$CN "/opt/xcat/bin/chdef $$SN servicenode= monserver= nfsserver= tftpserver= xcatmaster=" +cmd:makedhcp -d $$SN +cmd:scp $$ISO $$CN:/tmp/foobar.iso +cmd:ssh $$CN "/opt/xcat/sbin/copycds /tmp/foobar.iso" +cmd:ssh $$CN "/opt/xcat/sbin/makedhcp -n" cmd:xdsh $$CN "rm -rf /newxcat" cmd:xdsh $$CN "mkdir -p /newxcat" check:rc==0 @@ -113,10 +115,13 @@ check:rc==0 cmd:xdsh $$CN "service xcatd status" check:rc==0 check:output=~running -cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;rmdef node0001" +cmd:ssh $$CN "/opt/xcat/bin/rinstall $$SN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute" +check:rc==0 +cmd:sleep 300 +cmd:ssh $$CN "a=0; while ! `/opt/xcat/bin/lsdef -l $$SN | grep status | grep booted >/dev/null`; do ((++a > 90)) && exit 99; sleep 20; done" +check:rc==0 +cmd:ssh $$CN "/opt/xcat/bin/xdsh $$SN date" check:rc==0 -cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsdef" -check:output!~node0001 cmd:xdsh $$CN "/opt/xcat/share/xcat/tools/go-xcat smoke-test" check:rc==0 cmd:xdsh $$CN "diff /oldxcat/old_version /newxcat/new_version" diff --git a/xCAT-test/autotest/testcase/migration/ubuntu_migration2_p8le b/xCAT-test/autotest/testcase/migration/ubuntu_migration2_p8le index a1509715b..ca3fe6569 100644 --- a/xCAT-test/autotest/testcase/migration/ubuntu_migration2_p8le +++ b/xCAT-test/autotest/testcase/migration/ubuntu_migration2_p8le @@ -80,10 +80,12 @@ check:rc==0 cmd:xdsh $$CN "service xcatd status" check:rc==0 check:output=~running -cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;chdef -t node -o node0001 nodetype=osi groups=linux" -check:rc==0 -cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsdef" -check:output=~node0001 +cmd:lsdef $$SN -z | ssh $$CN "/opt/xcat/bin/mkdef -z" +cmd:ssh $$CN "/opt/xcat/bin/chdef $$SN servicenode= monserver= nfsserver= tftpserver= xcatmaster=" +cmd:makedhcp -d $$SN +cmd:scp $$ISO $$CN:/tmp/foobar.iso +cmd:ssh $$CN "/opt/xcat/sbin/copycds /tmp/foobar.iso" +cmd:ssh $$CN "/opt/xcat/sbin/makedhcp -n" cmd:xdsh $$CN "rm -rf /newxcat" cmd:xdsh $$CN "mkdir -p /newxcat" check:rc==0 @@ -114,10 +116,13 @@ check:rc==0 cmd:xdsh $$CN "service xcatd status" check:rc==0 check:output=~running -cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;rmdef node0001" +cmd:ssh $$CN "/opt/xcat/bin/rinstall $$SN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute" +check:rc==0 +cmd:sleep 300 +cmd:ssh $$CN "a=0; while ! `/opt/xcat/bin/lsdef -l $$SN | grep status | grep booted >/dev/null`; do ((++a > 90)) && exit 99; sleep 20; done" +check:rc==0 +cmd:ssh $$CN "/opt/xcat/bin/xdsh $$SN date" check:rc==0 -cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsdef" -check:output!~node0001 cmd:xdsh $$CN "/opt/xcat/share/xcat/tools/go-xcat smoke-test" check:rc==0 cmd:xdsh $$CN "diff /oldxcat/old_version /newxcat/new_version" diff --git a/xCAT-test/autotest/testcase/migration/ubuntu_migration2_vm b/xCAT-test/autotest/testcase/migration/ubuntu_migration2_vm index d4af68b22..adfe3244a 100644 --- a/xCAT-test/autotest/testcase/migration/ubuntu_migration2_vm +++ b/xCAT-test/autotest/testcase/migration/ubuntu_migration2_vm @@ -79,10 +79,12 @@ check:rc==0 cmd:xdsh $$CN "service xcatd status" check:rc==0 check:output=~running -cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;chdef -t node -o node0001 nodetype=osi groups=linux" -check:rc==0 -cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsdef" -check:output=~node0001 +cmd:lsdef $$SN -z | ssh $$CN "/opt/xcat/bin/mkdef -z" +cmd:ssh $$CN "/opt/xcat/bin/chdef $$SN servicenode= monserver= nfsserver= tftpserver= xcatmaster=" +cmd:makedhcp -d $$SN +cmd:scp $$ISO $$CN:/tmp/foobar.iso +cmd:ssh $$CN "/opt/xcat/sbin/copycds /tmp/foobar.iso" +cmd:ssh $$CN "/opt/xcat/sbin/makedhcp -n" cmd:xdsh $$CN "rm -rf /newxcat" cmd:xdsh $$CN "mkdir -p /newxcat" check:rc==0 @@ -113,10 +115,13 @@ check:rc==0 cmd:xdsh $$CN "service xcatd status" check:rc==0 check:output=~running -cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;rmdef node0001" +cmd:ssh $$CN "/opt/xcat/bin/rinstall $$SN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute" +check:rc==0 +cmd:sleep 300 +cmd:ssh $$CN "a=0; while ! `/opt/xcat/bin/lsdef -l $$SN | grep status | grep booted >/dev/null`; do ((++a > 90)) && exit 99; sleep 20; done" +check:rc==0 +cmd:ssh $$CN "/opt/xcat/bin/xdsh $$SN date" check:rc==0 -cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsdef" -check:output!~node0001 cmd:xdsh $$CN "/opt/xcat/share/xcat/tools/go-xcat smoke-test" check:rc==0 cmd:xdsh $$CN "diff /oldxcat/old_version /newxcat/new_version" From f7a39006dc7876f7fc65466adc5a834086d4b928 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Fri, 2 Jun 2017 12:42:16 -0400 Subject: [PATCH 101/129] Support rflash command -c option for OpenBMC --- xCAT-server/lib/xcat/plugins/openbmc.pm | 86 ++++++++++++++++++++++++- 1 file changed, 85 insertions(+), 1 deletion(-) diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index 84d9226a6..7560ac0d5 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -393,7 +393,7 @@ sub parse_args { my $noderange = shift; my $check = undef; - if (!defined($extrargs) and $command =~ /rpower|rsetboot|rspconfig/) { + if (!defined($extrargs) and $command =~ /rpower|rsetboot|rspconfig|rflash/) { return ([ 1, "No option specified for $command" ]); } @@ -462,6 +462,27 @@ sub parse_args { unless ($subcommand =~ /^temp$|^voltage$|^wattage$|^fanspeed$|^power$|^altitude$|^all$/) { return ([ 1, "Unsupported command: $command $subcommand" ]); } + } elsif ($command eq "rflash") { + my $filename_passed = 0; + foreach my $opt (@$extrargs) { + # Only files ending on .tar are allowed + if ($opt =~ /.*\.tar$/i) { + $filename_passed = 1; + next; + } + if ($filename_passed) { + # Filename was passed, check flags allowed with file + if ($opt !~ /^-c$|^--check$|^-d$|^--delete$|^-u$|^--upload$/) { + return ([ 1, "Unsupported file command option: $opt" ]); + } + } + else { + # Filename was not passed, check flags allowed without file + if ($opt !~ /^-c$|^--check$|^-l$|^--list/) { + return ([ 1, "Unsupported no file command command option: $opt" ]); + } + } + } } else { return ([ 1, "Command is not supported." ]); } @@ -618,6 +639,69 @@ sub parse_command_status { $status_info{RVITALS_RESPONSE}{argv} = "$subcommand"; } + if ($command eq "rflash") { + my $check_version = 0; + my $list = 0; + my $delete = 0; + my $upload = 0; + unless (GetOptions( + 'c|check' => \$check_version, + 'l|list' => \$list, + 'd|delete' => \$delete, + 'u|upload' => \$upload, + )) { + xCAT::SvrUtils::sendmsg("Error parsing arguments.", $callback); + return 1; + } + + my $update_file = $ARGV[0]; + my $filename = undef; + my $file_id = undef; + my $grep_cmd = "/usr/bin/grep -a"; + my $version_tag = '"version=IBM"'; + my $purpose_tag = '"purpose="'; + if (defined $update_file) { + # Filename or file id was specified + if ($update_file =~ /.*\.tar$/) { + # Filename ending on .tar was specified + $filename = $update_file; + if ($check_version) { + # Display firmware version of the specified .tar file + my $firmware_version_in_file = `$grep_cmd $version_tag $filename`; + my $purpose_version_in_file = `$grep_cmd $purpose_tag $filename`; + chomp($firmware_version_in_file); + chomp($purpose_version_in_file); + my ($purpose_string,$purpose_value) = split("=", $purpose_version_in_file); + my ($version_string,$version_value) = split("=", $firmware_version_in_file); + if ($purpose_value =~ /host/) { + $purpose_value = "Host"; + } + xCAT::SvrUtils::sendmsg("TAR $purpose_value Firmware Product Version\: $version_value", $callback); + } + } + else { + #TODO Process file id passed in + } + } + if ($check_version) { + #Display firmware version on BMC + $next_status{LOGIN_RESPONSE} = "RINV_FIRM_REQUEST"; + $next_status{RINV_FIRM_REQUEST} = "RINV_FIRM_RESPONSE"; + } + if ($list) { + xCAT::SvrUtils::sendmsg("List option is not yet supported.", $callback); + return 1; + } + if ($delete) { + xCAT::SvrUtils::sendmsg("Delete option is not yet supported.", $callback); + return 1; + } + if ($upload) { + xCAT::SvrUtils::sendmsg("Upload option is not yet supported.", $callback); + return 1; + } + } + print Dumper(\%next_status) . "\n"; return; } From bf382dcd10320442ad0a3bfe65fe0963ddf8923e Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Fri, 2 Jun 2017 15:02:02 -0400 Subject: [PATCH 102/129] Sync up the spelling to use: OpenPOWER and OpenBMC --- .../compute_node/replace/openpower.rst | 4 ++-- .../manage_clusters/ppc64le/index.rst | 10 +++++----- .../ppc64le/management/basic/rcons.rst | 4 ++-- .../admin-guides/references/man1/rpower.1.rst | 4 ++-- .../admin-guides/references/man5/openbmc.5.rst | 2 +- .../admin-guides/references/man5/xcatdb.5.rst | 2 +- docs/source/overview/xcat2_release.rst | 4 ++-- perl-xCAT/xCAT/ProfiledNodeUtils.pm | 2 +- perl-xCAT/xCAT/Schema.pm | 2 +- perl-xCAT/xCAT/Usage.pm | 4 ++-- xCAT-client/pods/man1/rpower.1.pod | 4 ++-- xCAT-genesis-scripts/bin/bmcsetup | 18 +++++++++--------- xCAT-server/lib/xcat/plugins/ipmi.pm | 2 +- 13 files changed, 31 insertions(+), 31 deletions(-) diff --git a/docs/source/advanced/cluster_maintenance/compute_node/replace/openpower.rst b/docs/source/advanced/cluster_maintenance/compute_node/replace/openpower.rst index 6e17f9947..018de0672 100644 --- a/docs/source/advanced/cluster_maintenance/compute_node/replace/openpower.rst +++ b/docs/source/advanced/cluster_maintenance/compute_node/replace/openpower.rst @@ -1,10 +1,10 @@ -OpenPower Nodes +OpenPOWER Nodes =============== When compute nodes are physically replaced in the frame, leverage xCAT to re-discover the compute nodes. The following guide can be used for: - * IBM OpenPower S822LC for HPC + * IBM OpenPOWER S822LC for HPC #. Identify the machine(s) to be replaced: ``frame10cn02``. diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/index.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/index.rst index 5923a32a5..9399c0405 100644 --- a/docs/source/guides/admin-guides/manage_clusters/ppc64le/index.rst +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/index.rst @@ -1,11 +1,11 @@ -IBM Power LE / OpenPOWER +IBM POWER LE / OpenPOWER ========================= -Most of the content is general information for xCAT, the focus and examples are for management of IBM OpenPower servers. +Most of the content is general information for xCAT, the focus and examples are for management of IBM OpenPOWER servers. -IBM OpenPower Servers - * based on Power8 Processor Technology is IPMI managed - * based on Power9 Processor Technology is OpenBmc managed [**Alpha**] +IBM OpenPOWER Servers + * based on POWER8 Processor Technology is IPMI managed + * based on POWER9 Processor Technology is OpenBMC managed [**Alpha**] .. toctree:: diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/management/basic/rcons.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/management/basic/rcons.rst index 531266228..6fcd77a1d 100644 --- a/docs/source/guides/admin-guides/manage_clusters/ppc64le/management/basic/rcons.rst +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/management/basic/rcons.rst @@ -7,11 +7,11 @@ Most enterprise servers do not have video adapters installed with the machine an Configure the correct console management by modifying the node definition: - * For OpenPower, **IPMI** managed server: :: + * For OpenPOWER, **IPMI** managed server: :: chdef -t node -o cons=ipmi - * For OpenPower, **OpenBMC** managed servers: :: + * For OpenPOWER, **OpenBMC** managed servers: :: chdef -t node -o cons=openbmc diff --git a/docs/source/guides/admin-guides/references/man1/rpower.1.rst b/docs/source/guides/admin-guides/references/man1/rpower.1.rst index 74dcc3cac..eb9037303 100644 --- a/docs/source/guides/admin-guides/references/man1/rpower.1.rst +++ b/docs/source/guides/admin-guides/references/man1/rpower.1.rst @@ -32,7 +32,7 @@ BMC (using IPMI): \ **rpower**\ \ *noderange*\ [\ **pduon | pduoff | pdustat | pdureset**\ ] -OpenPower BMC (using IPMI): +OpenPOWER BMC (using IPMI): =========================== @@ -41,7 +41,7 @@ OpenPower BMC (using IPMI): \ **rpower**\ \ *noderange*\ [\ **pduon | pduoff | pdustat | pdureset**\ ] -OpenPower OpenBMC: +OpenPOWER OpenBMC: ================== diff --git a/docs/source/guides/admin-guides/references/man5/openbmc.5.rst b/docs/source/guides/admin-guides/references/man5/openbmc.5.rst index 14cbd3c80..11bbee003 100644 --- a/docs/source/guides/admin-guides/references/man5/openbmc.5.rst +++ b/docs/source/guides/admin-guides/references/man5/openbmc.5.rst @@ -27,7 +27,7 @@ DESCRIPTION *********** -Setting for nodes that are controlled by an on-board OpenBmc. +Setting for nodes that are controlled by an on-board OpenBMC. ******************* diff --git a/docs/source/guides/admin-guides/references/man5/xcatdb.5.rst b/docs/source/guides/admin-guides/references/man5/xcatdb.5.rst index 4100de4bb..e2cb86603 100644 --- a/docs/source/guides/admin-guides/references/man5/xcatdb.5.rst +++ b/docs/source/guides/admin-guides/references/man5/xcatdb.5.rst @@ -567,7 +567,7 @@ notification(5)|notification.5 openbmc(5)|openbmc.5 - Setting for nodes that are controlled by an on-board OpenBmc. + Setting for nodes that are controlled by an on-board OpenBMC. diff --git a/docs/source/overview/xcat2_release.rst b/docs/source/overview/xcat2_release.rst index 21a39166b..2062b7c30 100644 --- a/docs/source/overview/xcat2_release.rst +++ b/docs/source/overview/xcat2_release.rst @@ -71,7 +71,7 @@ xCAT 2.12.x | | | | | +---------------------------------+---------------+-------------+----------------------------------+ || xCAT 2.12.3 | | |- GitHub Issues resolved | -|| 2016/09/30 | | |- rinv options for OpenPower | +|| 2016/09/30 | | |- rinv options for OpenPOWER | || | | |- switch based switch discovery | | `2.12.3 Release Notes `_ | | |- Add xCAT Troubleshooting Log | | | | |- xCAT Log Classification | | | | |- RAID Configuration | diff --git a/perl-xCAT/xCAT/ProfiledNodeUtils.pm b/perl-xCAT/xCAT/ProfiledNodeUtils.pm index dc351df6a..65cb35804 100644 --- a/perl-xCAT/xCAT/ProfiledNodeUtils.pm +++ b/perl-xCAT/xCAT/ProfiledNodeUtils.pm @@ -1365,7 +1365,7 @@ sub gen_chain_for_profiles { #run bmcsetups. #PowerNV nodes can't use 'runcmd=bmcsetup' to set BMC. - #But OpenPower need to support bmcsetup + #But OpenPOWER need to support bmcsetup my $nodehmtab = xCAT::Table->new('nodehm'); my $comments = ""; my $nodehmtab_entry = $nodehmtab->getNodeAttribs($hwprofile, ['comments']); diff --git a/perl-xCAT/xCAT/Schema.pm b/perl-xCAT/xCAT/Schema.pm index 50241e8e5..a19207611 100755 --- a/perl-xCAT/xCAT/Schema.pm +++ b/perl-xCAT/xCAT/Schema.pm @@ -446,7 +446,7 @@ passed as argument rather than by table value', openbmc => { cols => [qw(node bmc consport taggedvlan username password comments disable)], keys => [qw(node)], - table_desc => 'Setting for nodes that are controlled by an on-board OpenBmc.', + table_desc => 'Setting for nodes that are controlled by an on-board OpenBMC.', descriptions => { node => 'The node name or group name.', bmc => 'The hostname of the BMC adapter.', diff --git a/perl-xCAT/xCAT/Usage.pm b/perl-xCAT/xCAT/Usage.pm index 2093ca5f0..f7db5790b 100755 --- a/perl-xCAT/xCAT/Usage.pm +++ b/perl-xCAT/xCAT/Usage.pm @@ -29,10 +29,10 @@ my %usage = ( BMC (using IPMI): rpower noderange [on|off|softoff|reset|boot|stat|state|status|wake|suspend [-w timeout] [-o] [-r]] rpower noderange [pduon|pduoff|pdustat] - OpenPower BMC: + OpenPOWER BMC: rpower noderange [on|off|reset|boot|stat|state|status] rpower noderange [pduon|pduoff|pdustat] - OpenPower OpenBMC: + OpenPOWER OpenBMC: rpower noderange [on|off|reset|boot|stat|state|status] KVM Virtualization specific: rpower [boot] [ -c ] diff --git a/xCAT-client/pods/man1/rpower.1.pod b/xCAT-client/pods/man1/rpower.1.pod index 61e7be87c..fd676c268 100644 --- a/xCAT-client/pods/man1/rpower.1.pod +++ b/xCAT-client/pods/man1/rpower.1.pod @@ -14,13 +14,13 @@ B I [B|B|B|B|B|B|B I [B|B|B|B] -=head2 OpenPower BMC (using IPMI): +=head2 OpenPOWER BMC (using IPMI): B I [B|B|B|B|B|B|B] B I [B|B|B|B] -=head2 OpenPower OpenBMC: +=head2 OpenPOWER OpenBMC: B I [B|B|B|B|B|B|B] diff --git a/xCAT-genesis-scripts/bin/bmcsetup b/xCAT-genesis-scripts/bin/bmcsetup index b8208abe8..cb2aba4a5 100755 --- a/xCAT-genesis-scripts/bin/bmcsetup +++ b/xCAT-genesis-scripts/bin/bmcsetup @@ -37,7 +37,7 @@ function cold_reset_bmc() { fi if [ "$XPROD" = "309" -o "$XPROD" = "43707" ] ; then if [ "$XPROD" = "43707" ]; then - # OpenPower SPECIFIC, the OpenPower machines with AMI BMC should NOT need a + # OpenPOWER SPECIFIC, the OpenPOWER machines with AMI BMC should NOT need a # reset after applying ipmitool commands. However, it seems there is a problem with # the BMC where after 15 seconds, it stops responding. To work around, sleep 30 # seconds before issuing the reset of the BMC. @@ -49,7 +49,7 @@ function cold_reset_bmc() { fi if [ "$XPROD" = "43707" ]; then - # OpenPower SPECIFIC, check the BMC with the following raw command to + # OpenPOWER SPECIFIC, check the BMC with the following raw command to # make sure that the bmc is really in a "ready" state before continuing SLEEP_INTERVAL=3 MAX_ITERATION=100 @@ -65,7 +65,7 @@ function cold_reset_bmc() { TOTAL_SEC=$((${SLEEP_INTERVAL} * ${MAX_ITERATION})) logger -s -t $log_label -p local4.error "ERROR, After waiting ${TOTAL_SEC} seconds, the BMC is not in a ready state." else - # for Non OpenPower servers, just sleep for some set time. + # for Non OpenPOWER servers, just sleep for some set time. sleep 15 TRIES=0 @@ -82,7 +82,7 @@ function cold_reset_bmc() { # # Function snooze() # -# The purpose of this is to work around the issue with OpenPower BMCs after +# The purpose of this is to work around the issue with OpenPOWER BMCs after # making a change to network configuration, sleep 30 to be sure the changes apply. # function snooze() { @@ -95,8 +95,8 @@ function snooze() { return fi if [ "$XPROD" = "43707" ]; then - # For OpenPower Machines - logger -s -t $log_label -p local4.debug "OpenPower, snooze for 30 seconds..." + # For OpenPOWER Machines + logger -s -t $log_label -p local4.debug "OpenPOWER, snooze for 30 seconds..." sleep 30 else logger -s -t $log_label -p local4.debug "snooze for 1 second..." @@ -167,7 +167,7 @@ logger -s -t $log_label -p local4.info "IPMIVER=$IPMIVER, IPMIMFG=$IPMIMFG, XPRO # # IPMIMFG=2 = IBM -# IPMIMFG=0 = OpenPower +# IPMIMFG=0 = OpenPOWER # IPMIMFG=42817 and XPROD=16975 = OpenBMC # if [ "$IPMIMFG" == 2 ]; then #IBM @@ -416,7 +416,7 @@ if [ ! -z "$ISOPENBMC" ]; then rm -f /tmp/ipmicfg.xml exit $bmc_config_rc fi -# After network commands are issued, pause to allow the BMC to apply (OpenPower) +# After network commands are issued, pause to allow the BMC to apply (OpenPOWER) snooze let idev=NUMBMCS-1 @@ -646,7 +646,7 @@ while [ $idev -gt 0 ]; do logger -s -t $log_label -p local4.info "Lighting Identify Light" if [ "$XPROD" = "43707" -a "$IPMIMFG" = '0' ]; then - # OpenPower BMC specific, turn on the LED beacon light. + # OpenPOWER BMC specific, turn on the LED beacon light. # - default interval, # ipmitool chassis identify # Chassis identify interval: default (15 seconds) # - 275 is too large, # ipmitool chassis identify 275 diff --git a/xCAT-server/lib/xcat/plugins/ipmi.pm b/xCAT-server/lib/xcat/plugins/ipmi.pm index 5d3c15e87..59f70d20a 100644 --- a/xCAT-server/lib/xcat/plugins/ipmi.pm +++ b/xCAT-server/lib/xcat/plugins/ipmi.pm @@ -2535,7 +2535,7 @@ sub power { my $code; if (($sessdata->{subcommand} !~ /^on$|^off$|^reset$|^boot$|^stat$|^state$|^status$/) and isopenpower($sessdata)) { - xCAT::SvrUtils::sendmsg([ 1, "unsupported command rpower $sessdata->{subcommand} for OpenPower" ], $callback, $sessdata->{node}, %allerrornodes); + xCAT::SvrUtils::sendmsg([ 1, "unsupported command rpower $sessdata->{subcommand} for OpenPOWER" ], $callback, $sessdata->{node}, %allerrornodes); return; } From 1f4cb4e64eb8112305d4248b714286e7828f8d65 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Fri, 2 Jun 2017 15:18:46 -0400 Subject: [PATCH 103/129] Development code only warning --- xCAT-server/lib/xcat/plugins/openbmc.pm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index 7560ac0d5..6777b96aa 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -463,6 +463,10 @@ sub parse_args { return ([ 1, "Unsupported command: $command $subcommand" ]); } } elsif ($command eq "rflash") { + # + # disable function until fully tested + # + $check = unsupported($callback); if (ref($check) eq "ARRAY") { return $check; } my $filename_passed = 0; foreach my $opt (@$extrargs) { # Only files ending on .tar are allowed From b8fdb3c890b45bca869c71aef523e03987524f83 Mon Sep 17 00:00:00 2001 From: Samveen Gulati Date: Sat, 3 Jun 2017 03:24:16 +0000 Subject: [PATCH 104/129] #2939: Add `-d` option alias for `makeknownhosts -r` --- xCAT-client/pods/man8/makeknownhosts.8.pod | 10 ++++-- xCAT-server/lib/xcat/plugins/00kitnodebase.pm | 2 +- .../lib/xcat/plugins/makeknownhosts.pm | 33 +++++++------------ .../autotest/testcase/makeknownhosts/cases0 | 12 +++++++ 4 files changed, 32 insertions(+), 25 deletions(-) diff --git a/xCAT-client/pods/man8/makeknownhosts.8.pod b/xCAT-client/pods/man8/makeknownhosts.8.pod index 612c04b7e..99047d1cb 100644 --- a/xCAT-client/pods/man8/makeknownhosts.8.pod +++ b/xCAT-client/pods/man8/makeknownhosts.8.pod @@ -4,7 +4,7 @@ B - Make a known_hosts file under $ROOTHOME/.ssh for input noder =head1 SYNOPSIS -B I [B<-r>|B<--remove>] [B<-V>|B<--verbose>] +B I [B<-r>|B<--remove>|B<-d>|B<--delete>] [B<-V>|B<--verbose>] B [B<-h>|B<--help>] @@ -29,10 +29,14 @@ The file should be distributed using B to all the nodes, if you want node A set of comma delimited node names and/or group names. See the I man page for details on supported formats. -=item B<-r|--remove> +=item B<-d|--delete> Only removes the entries for the nodes from the known_hosts file. +=item B<-r|--remove> + +Synonymous to B<-d|--delete>. + =item B<-V|--verbose> Verbose mode. @@ -56,7 +60,7 @@ To build the known_hosts entry for the nodes in the lpars and service groups =item 3. To remove the known_hosts entry for node02 - makeknownhosts node02 -r + makeknownhosts node02 -d =back diff --git a/xCAT-server/lib/xcat/plugins/00kitnodebase.pm b/xCAT-server/lib/xcat/plugins/00kitnodebase.pm index 4eb76eacb..256ce90a3 100644 --- a/xCAT-server/lib/xcat/plugins/00kitnodebase.pm +++ b/xCAT-server/lib/xcat/plugins/00kitnodebase.pm @@ -130,7 +130,7 @@ sub process_request { if ($runconservercmd) { push @commandslist, [ 'makeconservercf', '-d' ]; } - push @commandslist, [ 'makeknownhosts', '-r' ]; + push @commandslist, [ 'makeknownhosts', '-d' ]; if ($macflag) { push @commandslist, [ 'makedhcp', '-d' ]; } diff --git a/xCAT-server/lib/xcat/plugins/makeknownhosts.pm b/xCAT-server/lib/xcat/plugins/makeknownhosts.pm index ef15946a3..8779b257a 100644 --- a/xCAT-server/lib/xcat/plugins/makeknownhosts.pm +++ b/xCAT-server/lib/xcat/plugins/makeknownhosts.pm @@ -65,13 +65,14 @@ sub process_request if ($request && $request->{arg}) { @ARGV = @{ $request->{arg} }; } else { @ARGV = (); } - my $usage = "Usage: makeknownhosts [-r] [-V]\n makeknownhosts -h"; + my $usage = "Usage: makeknownhosts [-r|-d] [-V]\n makeknownhosts -h"; # print "argv=@ARGV\n"; if (!GetOptions( 'h|help' => \$::opt_h, 'V|verbose' => \$::opt_V, 'r|remove' => \$::opt_r + 'd|delete' => \$::opt_d )) { my $rsp = {}; @@ -81,23 +82,22 @@ sub process_request } # display the usage if -h - if ($::opt_h) - { + if ($::opt_h) { my $rsp = {}; $rsp->{data}->[0] = $usage; xCAT::MsgUtils->message("I", $rsp, $callback, 1); return 0; } - if ($nodes eq "") - { # no noderange + if ($nodes eq "") { + # no noderange my $rsp = {}; $rsp->{data}->[0] = "The Noderange is missing."; xCAT::MsgUtils->message("E", $rsp, $callback, 1); return 1; } my $hostkey = "/etc/xcat/hostkeys/ssh_host_rsa_key.pub"; - if (!(-e $hostkey)) - { # the key is missing, cannot create known_hosts + if (!(-e $hostkey)) { + # the key is missing, cannot create known_hosts my $rsp = {}; $rsp->{data}->[0] = "The keyfile:$hostkey is missing. Cannot create the known_hosts file."; @@ -107,35 +107,28 @@ sub process_request # Backup the existing known_hosts file to known_hosts.backup $rc = backup_known_hosts_file($callback); - if ($rc != 0) - { + if ($rc != 0) { my $rsp = {}; $rsp->{data}->[0] = "Error backing up known_hosts file."; xCAT::MsgUtils->message("E", $rsp, $callback, 1); return 1; - } # Remove the nodes from knownhosts file $rc = remove_nodes_from_knownhosts($callback, $nodes); - if ($rc != 0) - { + if ($rc != 0) { my $rsp = {}; $rsp->{data}->[0] = "Error backing up known_hosts file."; xCAT::MsgUtils->message("E", $rsp, $callback, 1); return 1; - } # if -r flag is not specified, adding the nodes back to known_hosts file - if (!$::opt_r) - { + if (!($::opt_r or $::opt_d)) { my @nodelist = @$nodes; - foreach my $node (@nodelist) - { + foreach my $node (@nodelist) { $rc = add_known_host($node, $callback); - if ($rc != 0) - { + if ($rc != 0) { my $rsp = {}; $rsp->{data}->[0] = "Error building known_hosts file."; xCAT::MsgUtils->message("E", $rsp, $callback, 1); @@ -153,8 +146,6 @@ sub process_request Backs up the old known_hosts file in roots .ssh directory, if it exists. - - =cut #------------------------------------------------------- diff --git a/xCAT-test/autotest/testcase/makeknownhosts/cases0 b/xCAT-test/autotest/testcase/makeknownhosts/cases0 index 3e7e2e512..afe1e371d 100644 --- a/xCAT-test/autotest/testcase/makeknownhosts/cases0 +++ b/xCAT-test/autotest/testcase/makeknownhosts/cases0 @@ -28,6 +28,18 @@ check:rc!=0 check:output!~$$CN end +start:makeknownhosts_node_d +description:delete known node entry from $ROOTHOME/.ssh +cmd:makeknownhosts $$CN +cmd:cat ~/.ssh/known_hosts|grep $$CN +check:output=~$$CN +cmd:makeknownhosts $$CN -d +check:rc==0 +cmd:cat ~/.ssh/known_hosts|grep $$CN +check:rc!=0 +check:output!~$$CN +end + start:makeknownhosts_node_v description:verbose cmd:makeknownhosts $$CN -V From 1cac6a2db3c560c1562886e8eab2a2cc6f1ecc2e Mon Sep 17 00:00:00 2001 From: hu-weihua Date: Mon, 5 Jun 2017 00:26:44 -0400 Subject: [PATCH 105/129] Add rvitals test cases to pegas+p9 bundle --- .../autotest/bundle/rhels7.4-pegas_ppc64le.bundle | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/xCAT-test/autotest/bundle/rhels7.4-pegas_ppc64le.bundle b/xCAT-test/autotest/bundle/rhels7.4-pegas_ppc64le.bundle index 74a0d4803..c80880576 100644 --- a/xCAT-test/autotest/bundle/rhels7.4-pegas_ppc64le.bundle +++ b/xCAT-test/autotest/bundle/rhels7.4-pegas_ppc64le.bundle @@ -41,5 +41,15 @@ rspconfig_gateway rspconfig_gateway_invalid rspconfig_node_invalid rspconfig_ip_null +rvitals_h +rvitals_v +rvitals_errorcommand +rvitals_noderange_err +rvitals_temp +rvitals_voltage +rvitals_wattage +rvitals_fanspeed +rvitals_power +rvitals_all reg_linux_diskfull_installation_flat reg_linux_diskless_installation_flat From d6266b9aaf605c43fb0b7651bf12696c6f164b3e Mon Sep 17 00:00:00 2001 From: Yuan Bai Date: Mon, 5 Jun 2017 13:14:02 +0800 Subject: [PATCH 106/129] fix issue 2797 and enhance confignetwork (#3169) * to return non-zero when error * fix a potential issue when nicdevice is wrong for bond definition. --- xCAT/postscripts/confignetwork | 167 ++++++++++++++++++--------------- xCAT/postscripts/nicutils.sh | 4 +- 2 files changed, 94 insertions(+), 77 deletions(-) diff --git a/xCAT/postscripts/confignetwork b/xCAT/postscripts/confignetwork index 702fd5b2d..80ef76c1a 100755 --- a/xCAT/postscripts/confignetwork +++ b/xCAT/postscripts/confignetwork @@ -215,93 +215,94 @@ function find_nic_and_device_list { # ############################################################################### function sort_nics_device_order { + all_nics_list=$* eth_slot="" bond_slot="" vlan_slot="" num=1 - alone_nics=`echo "$all_nics_list"|awk '{if(01) print $0}'` - + #find stand alone nic num1=1 max1=`echo "$alone_nics"|wc -l` ((max1+=1)) while [ $num1 -lt $max1 ]; do - alonenic=`echo "$alone_nics"|sed -n "${num1}p"` + alonenic=`echo "$alone_nics"|sed -n "${num1}p"|sed "s/ //g"` echo "$nics_list"| grep "$alonenic" >/dev/null if [ $? -ne 0 ]; then echo $alonenic fi ((num1+=1)) done - # - num=1 - max=`echo "$nics_list"|wc -l` - ((max+=1)) - while [ $num -lt $max ]; - do - #for each nic and nicdevice : nic_dev base_nic_dev - #find nic type as nic_dev_type - #find nicdevice type as base_nic_type - base_nic_dev=`echo "$nics_list" |sed -n "${num}p"|awk '{print $2}'` - if echo "$base_nic_dev"|grep "@" >/dev/null; then - for i in `echo "$base_nic_dev" |sed 's/@/ /g'` - do - temp_base_nic_type=`find_nic_type "$i"` - if [ x"$temp_base_nic_type_one" = x ]; then - temp_base_nic_type_one=$temp_base_nic_type - elif [ x"$temp_base_nic_type" != x"$temp_base_nic_type_one" ]; then - log_error "different nic device types in $base_nic_dev." - break 2 - fi - done - else - temp_base_nic_dev=$base_nic_dev - temp_base_nic_type=`find_nic_type "$temp_base_nic_dev"` - fi + if [ -n "$nics_list" ]; then + num=1 + max=`echo "$nics_list"|wc -l` + ((max+=1)) + while [ $num -lt $max ]; + do + #for each nic and nicdevice : nic_dev base_nic_dev + #find nic type as nic_dev_type + #find nicdevice type as base_nic_type + base_nic_dev=`echo "$nics_list" |sed -n "${num}p"|awk '{print $2}'` + if echo "$base_nic_dev"|grep "@" >/dev/null; then + for i in `echo "$base_nic_dev" |sed 's/@/ /g'` + do + temp_base_nic_type=`find_nic_type "$i" | $utolcmd` + if [ x"$temp_base_nic_type_one" = x ]; then + temp_base_nic_type_one=$temp_base_nic_type + elif [ x"$temp_base_nic_type" != x"$temp_base_nic_type_one" ]; then + log_error "different nic device types in $base_nic_dev." + break 2 + fi + done + else + temp_base_nic_dev=$base_nic_dev + temp_base_nic_type=`find_nic_type "$temp_base_nic_dev" | $utolcmd` + fi - base_nic_type=$temp_base_nic_type - nic_dev=`echo "$nics_list" |sed -n "${num}p"|awk '{print $1}'` - nic_dev_type=`find_nic_type "$nic_dev"` + base_nic_type=$temp_base_nic_type + nic_dev=`echo "$nics_list" |sed -n "${num}p"|awk '{print $1}'` + nic_dev_type=`find_nic_type "$nic_dev" | $utolcmd` - #valid nic_dev and base_nic_dev pair as bond-ethernet or vlan-ethernet or bridge-ethernet - if [ x"$base_nic_type" = "xethernet" ]&& \ - [ x"$nic_dev_type" = "xbond" -o x"$nic_dev_type" = "xvlan" -o x"$nic_dev_type" = "xbridge" -o x"$nic_dev_type" = "xbridge_ovs" ]; then + #valid nic_dev and base_nic_dev pair as bond-ethernet or vlan-ethernet or bridge-ethernet + if [ x"$base_nic_type" = "xethernet" ]&& \ + [ x"$nic_dev_type" = "xbond" -o x"$nic_dev_type" = "xvlan" -o x"$nic_dev_type" = "xbridge" -o x"$nic_dev_type" = "xbridge_ovs" ]; then - if [ x"$eth_slot" = x ]; then - eth_slot=$num + if [ x"$eth_slot" = x ]; then + eth_slot=$num + else + eth_slot=$eth_slot" "$num + fi + + #valid nic_dev and base_nic_dev pair as vlan-bond or bridge-bond + elif [ x"$base_nic_type" = "xbond" ]&& \ + [ x"$nic_dev_type" = "xvlan" -o x"$nic_dev_type" = "xbridge" -o x"$nic_dev_type" = "xbridge_ovs" ]; then + + if [ x"$bond_slot" = x ]; then + bond_slot=$num + else + bond_slot=$bond_slot" "$num + fi + + #valid nic_dev and base_nic_dev pair as bridge-vlan + elif [ x"$base_nic_type" = "xvlan" ]&& \ + [ x"$nic_dev_type" = "xbridge" -o x"$nic_dev_type" = "xbridge_ovs" ]; then + + if [ x"$vlan_slot" = x ]; then + vlan_slot=$num + else + vlan_slot=$vlan_slot" "$num + fi else - eth_slot=$eth_slot" "$num + echo "Error: $nic_dev $base_nic_dev pair is invalid nic and nicdevice pair." fi - - #valid nic_dev and base_nic_dev pair as vlan-bond or bridge-bond - elif [ x"$base_nic_type" = "xbond" ]&& \ - [ x"$nic_dev_type" = "xvlan" -o x"$nic_dev_type" = "xbridge" -o x"$nic_dev_type" = "xbridge_ovs" ]; then - - if [ x"$bond_slot" = x ]; then - bond_slot=$num - else - bond_slot=$bond_slot" "$num - fi - - #valid nic_dev and base_nic_dev pair as bridge-vlan - elif [ x"$base_nic_type" = "xvlan" ]&& \ - [ x"$nic_dev_type" = "xbridge" -o x"$nic_dev_type" = "xbridge_ovs" ]; then - - if [ x"$vlan_slot" = x ]; then - vlan_slot=$num - else - vlan_slot=$vlan_slot" "$num - fi - else - log_error "Error: $nic_dev $base_nic_dev pair is invalid nic and nicdevice pair." - fi - ((num+=1)) - done + ((num+=1)) + done + fi new_order=$eth_slot" "$bond_slot" "$vlan_slot new_order_list="" if [ -n "$new_order" ]; then @@ -312,7 +313,6 @@ function sort_nics_device_order { echo "$nics_list" |sed -n "${i}p" done` fi - echo "$new_order_list" } @@ -326,15 +326,13 @@ function sort_nics_device_order { ################################################################################### function configure_nicdevice { nics_pair=$* - #nictypes support capital letters, for example, Ethernet and ethernet - #use $utolcmd to transform capital to lower case - utolcmd="sed -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/" #configure nic and its device pair one by one num=1 max=`echo "$nics_pair"|wc -l` base_temp_nic="" base_nic_for_bond="" line_num="" + noip=1 ((max+=1)) while [ $num -lt $max ]; do @@ -354,22 +352,25 @@ function configure_nicdevice { echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" nic_pair=`echo "$nics_pair" |sed -n "${num}p"` echo "configure nic and its device : $nic_pair" - #configure standalone ethernet nic if [ x"$nic_dev_type" = "xethernet" ]; then - + ipaddr=`find_nic_ips $nic_dev|awk -F"|" '{print $1}'` if [ -n "$ipaddr" ]; then create_ethernet_interface ifname=$nic_dev _ipaddr=$ipaddr else - log_error "There is no ip for $nic_dev." + log_warn "There is no ip for $nic_dev." + ((noip+=1)) fi - + #All Ethernet nics have no nicips + if [ $noip -eq $max ]; then + log_error "There is no any ip configured for any nic. Check nicips in nics table first." + errorcode=1 + fi #configure bridge #linux bridge type is bridge #openvswitch bridge type is bridge_ovs elif [ x"$nic_dev_type" = "xbridge_ovs" -o x"$nic_dev_type" = "xbridge" ]; then - create_bridge_interface ifname=$nic_dev _brtype=$nic_dev_type _port=$base_nic_dev _pretype=$base_nic_type #configure vlan @@ -388,10 +389,12 @@ function configure_nicdevice { create_bond_interface ifname=$nic_dev slave_ports=$base_nic_for_bond else log_error "Error : please check nictypes for $nic_pair." + errorcode=1 fi ((num+=1)) done + return $errorcode } ############################################################################ @@ -420,6 +423,11 @@ function enable_network_service { # ############################################################################ +errorcode=0 + +#nictypes should support capital letters, for example, Ethernet and ethernet +utolcmd="sed -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/" + #replace | with "@", for example, eth1|eth2 ----> eth1@eth2 nicdevice=`echo "$NICDEVICES" | sed 's/|/@/g'` @@ -449,10 +457,19 @@ enable_network_service #sort nics device pair based on nicdevice type sorted_nicdevice_list=`sort_nics_device_order "$new_nicdevice"` + +#If there is invalid nics pair, errorcode is 1 +invalid_nicdevice_pair=`echo "$sorted_nicdevice_list" | grep "Error"` +if [ $? -eq 0 ]; then +log_error $invalid_nicdevice_pair +errorcode=1 +fi + +#delete invalid nics device pair based on Error +valid_sorted_nicdevice_list=`echo "$sorted_nicdevice_list" | sed '/Error/d'` log_info "All valid nics and device list:" -echo "$sorted_nicdevice_list" |log_lines info - - +echo "$valid_sorted_nicdevice_list" |log_lines info #config nics and ifcfg files -configure_nicdevice "$sorted_nicdevice_list" +configure_nicdevice "$valid_sorted_nicdevice_list" +exit $errorcode diff --git a/xCAT/postscripts/nicutils.sh b/xCAT/postscripts/nicutils.sh index d9abe01eb..73c4711f9 100755 --- a/xCAT/postscripts/nicutils.sh +++ b/xCAT/postscripts/nicutils.sh @@ -635,11 +635,11 @@ function add_br() { BRIDGE=$2 if [[ $BRIDGE == "bridge_ovs" ]]; then - type brctl >/dev/null 2>/dev/null || echo "There is no ovs-vsctl" >&2 && exit 1 + type brctl >/dev/null 2>/dev/null || (echo "There is no ovs-vsctl" >&2 && exit 1) log_info "ovs-vsctl add-br $BNAME" ovs-vsctl add-br $BNAME elif [[ $BRIDGE == "bridge" ]]; then - type brctl >/dev/null 2>/dev/null || echo "There is no brctl" >&2 && exit 1 + type brctl >/dev/null 2>/dev/null || (echo "There is no brctl" >&2 && exit 1) log_info "brctl addbr $BNAME" brctl addbr $BNAME log_info "brctl stp $BNAME on" From 3bfa5af98a600dcf9e21e29998d7f1c74f0f59a2 Mon Sep 17 00:00:00 2001 From: Yuan Bai Date: Mon, 5 Jun 2017 13:44:08 +0800 Subject: [PATCH 107/129] add -r alias -d for makeknownhosts (#3186) --- .../admin-guides/references/man8/makeknownhosts.8.rst | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/source/guides/admin-guides/references/man8/makeknownhosts.8.rst b/docs/source/guides/admin-guides/references/man8/makeknownhosts.8.rst index 8dad0e800..495704d9c 100644 --- a/docs/source/guides/admin-guides/references/man8/makeknownhosts.8.rst +++ b/docs/source/guides/admin-guides/references/man8/makeknownhosts.8.rst @@ -19,7 +19,7 @@ SYNOPSIS ******** -\ **makeknownhosts**\ \ *noderange*\ [\ **-r | -**\ **-remove**\ ] [\ **-V | -**\ **-verbose**\ ] +\ **makeknownhosts**\ \ *noderange*\ [\ **-r | -d | -**\ **-remove**\ ] [\ **-V | -**\ **-verbose**\ ] \ **makeknownhosts**\ [\ **-h | -**\ **-help**\ ] @@ -53,7 +53,7 @@ OPTIONS -\ **-r|-**\ **-remove**\ +\ **-r| -d| -**\ **-remove**\ Only removes the entries for the nodes from the known_hosts file. @@ -98,6 +98,10 @@ EXAMPLES .. code-block:: perl makeknownhosts node02 -r + + or + + makeknownhosts node02 -d From 8196fd491455552f489843cdc0dcdb4c15c14510 Mon Sep 17 00:00:00 2001 From: GONG Jie Date: Mon, 5 Jun 2017 13:52:31 +0800 Subject: [PATCH 108/129] Add more verifications --- xCAT-test/autotest/testcase/migration/redhat_migration | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/xCAT-test/autotest/testcase/migration/redhat_migration b/xCAT-test/autotest/testcase/migration/redhat_migration index 6ce3b9432..f3817dd47 100644 --- a/xCAT-test/autotest/testcase/migration/redhat_migration +++ b/xCAT-test/autotest/testcase/migration/redhat_migration @@ -72,10 +72,11 @@ cmd:xdsh $$CN "service xcatd status" check:rc==0 check:output=~running cmd:lsdef $$SN -z | ssh $$CN "mkdef -z" +cmd:ssh $$CN "rscan __GETNODEATTR($$SN,hcp)__ -w" cmd:ssh $$CN "chdef $$SN servicenode= monserver= nfsserver= tftpserver= xcatmaster=" cmd:makedhcp -d $$SN cmd:scp $$ISO $$CN:/tmp/foobar.iso -cmd:ssh $$CN "copycds /tmp/foobar.iso" +cmd:ssh $$CN "copycds -n __GETNODEATTR($$CN,os)__ /tmp/foobar.iso" cmd:ssh $$CN "makedhcp -n" check:rc==0 cmd:xdsh $$CN "cd /; scp -r $$MN:/core-rpms-snap.tar.bz2 /" @@ -97,6 +98,8 @@ check:rc==0 check:output=~running cmd:latest_version_info=`lsxcatd -v`;xdsh $$CN "lsxcatd -v" | grep "$latest_version_info" check:rc==0 +cmd:ssh $$CN "lsdef -t osimage osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute" +check:rc==0 cmd:ssh $$CN "rinstall $$SN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute" check:rc==0 cmd:sleep 300 @@ -184,10 +187,11 @@ cmd:xdsh $$CN "service xcatd status" check:rc==0 check:output=~running cmd:lsdef $$SN -z | ssh $$CN "mkdef -z" +cmd:ssh $$CN "rscan __GETNODEATTR($$SN,hcp)__ -w" cmd:ssh $$CN "chdef $$SN servicenode= monserver= nfsserver= tftpserver= xcatmaster=" cmd:makedhcp -d $$SN cmd:scp $$ISO $$CN:/tmp/foobar.iso -cmd:ssh $$CN "copycds /tmp/foobar.iso" +cmd:ssh $$CN "copycds -n __GETNODEATTR($$CN,os)__ /tmp/foobar.iso" cmd:ssh $$CN "makedhcp -n" cmd:check==0 cmd:xdsh $$CN "cd /; scp -r $$MN:/core-rpms-snap.tar.bz2 /" @@ -207,6 +211,8 @@ check:rc==0 cmd:xdsh $$CN "service xcatd status" check:rc==0 check:output=~running +cmd:ssh $$CN "lsdef -t osimage osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute" +check:rc==0 cmd:ssh $$CN "rinstall $$SN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute" check:rc==0 cmd:sleep 300 From bf5fa8d11854ccff78d310943cd8aeda5dd1b179 Mon Sep 17 00:00:00 2001 From: junxiawang Date: Mon, 5 Jun 2017 06:45:29 -0400 Subject: [PATCH 109/129] modify rvitals_voltage test,for openbmc testcases do not need to add hcp attributes --- xCAT-test/autotest/testcase/rvitals/cases0 | 1 - 1 file changed, 1 deletion(-) diff --git a/xCAT-test/autotest/testcase/rvitals/cases0 b/xCAT-test/autotest/testcase/rvitals/cases0 index 348c0caa3..9e759843d 100644 --- a/xCAT-test/autotest/testcase/rvitals/cases0 +++ b/xCAT-test/autotest/testcase/rvitals/cases0 @@ -46,7 +46,6 @@ end start:rvitals_voltage description:Retrieves power supply and VRM voltage readings Attribute: $$CN-The operation object of rvitals command -hcp:hmc,ivm,fsp,ipmi cmd:rvitals $$CN voltage check:rc==0 check:output=~Frame Voltages|CPU VDD Volt|SysBrd From d861f68995d73f27dce5354c660798a07f6973e2 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Mon, 5 Jun 2017 10:56:59 -0400 Subject: [PATCH 110/129] Sync usage, man and code for ipmi rvitals --- .../ppc64le/management/basic/rcons.rst | 2 +- .../admin-guides/references/man1/rvitals.1.rst | 8 +++++++- perl-xCAT/xCAT/Usage.pm | 2 +- xCAT-client/pods/man1/rvitals.1.pod | 6 +++++- xCAT-server/lib/xcat/plugins/ipmi.pm | 16 ++++++++-------- 5 files changed, 22 insertions(+), 12 deletions(-) diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/management/basic/rcons.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/management/basic/rcons.rst index 6fcd77a1d..396880103 100644 --- a/docs/source/guides/admin-guides/manage_clusters/ppc64le/management/basic/rcons.rst +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/management/basic/rcons.rst @@ -46,7 +46,7 @@ The xCAT ``rcons`` command relies on conserver (http://www.conserver.com/). The OpenBMC Specific -``````````````` +```````````````` #. For OpenBMC managed servers, the root user must be able to ssh passwordless to the BMC for the ``rcons`` function to work. diff --git a/docs/source/guides/admin-guides/references/man1/rvitals.1.rst b/docs/source/guides/admin-guides/references/man1/rvitals.1.rst index c6a84c704..7fa7e62d6 100644 --- a/docs/source/guides/admin-guides/references/man1/rvitals.1.rst +++ b/docs/source/guides/admin-guides/references/man1/rvitals.1.rst @@ -60,7 +60,7 @@ OpenPOWER (IPMI) specific: ========================== -\ **rvitals**\ \ *noderange*\ [\ **temp | voltage | wattage | fanspeed | power | leds | all**\ ] +\ **rvitals**\ \ *noderange*\ [\ **temp | voltage | wattage | fanspeed | power | leds | chassis | all**\ ] OpenPOWER (OpenBMC) specific: @@ -140,6 +140,12 @@ Processor for a single or range of nodes and groups. +\ **chassis**\ + + Retrieves chassis status. + + + \ **altitude**\ Retrieves altitude related attributes. diff --git a/perl-xCAT/xCAT/Usage.pm b/perl-xCAT/xCAT/Usage.pm index f7db5790b..b93c5d788 100755 --- a/perl-xCAT/xCAT/Usage.pm +++ b/perl-xCAT/xCAT/Usage.pm @@ -82,7 +82,7 @@ my %usage = ( BMC specific: rvitals noderange {temp|voltage|wattage|fanspeed|power|leds|all} OpenPOWER (IPMI) specific: - rvitals noderange [temp|voltage|wattage|fanspeed|power|leds|all] + rvitals noderange [temp|voltage|wattage|fanspeed|power|leds|chassis|all] OpenPOWER (OpenBMC) specific: rvitals noderange [temp|voltage|wattage|fanspeed|power|altitude|all] MIC specific: diff --git a/xCAT-client/pods/man1/rvitals.1.pod b/xCAT-client/pods/man1/rvitals.1.pod index bb7fec138..fb246eb40 100644 --- a/xCAT-client/pods/man1/rvitals.1.pod +++ b/xCAT-client/pods/man1/rvitals.1.pod @@ -28,7 +28,7 @@ B I {B|B|B|B|B|B I [B|B|B|B|B|B|B] +B I [B|B|B|B|B|B|B|B] =head2 OpenPOWER (OpenBMC) specific: @@ -79,6 +79,10 @@ Retrieves rack environmentals. Retrieves LEDs status. +=item B + +Retrieves chassis status. + =item B Retrieves altitude related attributes. diff --git a/xCAT-server/lib/xcat/plugins/ipmi.pm b/xCAT-server/lib/xcat/plugins/ipmi.pm index 59f70d20a..a096071a7 100644 --- a/xCAT-server/lib/xcat/plugins/ipmi.pm +++ b/xCAT-server/lib/xcat/plugins/ipmi.pm @@ -6506,30 +6506,30 @@ sub vitals { $sensor_filters{leds} = 1; $doall = 1; } - if (grep /temp/, @textfilters) { + if (grep /^temp$/, @textfilters) { $sensor_filters{0x01} = 1; } - if (grep /volt/, @textfilters) { + if (grep /^voltage$/, @textfilters) { $sensor_filters{0x02} = 1; } - if (grep /watt/, @textfilters) { + if (grep /^wattage$/, @textfilters) { $sensor_filters{watt} = 1; } - if (grep /fan/, @textfilters) { + if (grep /^fanspeed$/, @textfilters) { $sensor_filters{0x04} = 1; } - if (grep /power/, @textfilters) { #power does not really include energy, but most people use 'power' to mean both + if (grep /^power$/, @textfilters) { #power does not really include energy, but most people use 'power' to mean both $sensor_filters{0x03} = 1; $sensor_filters{powerstate} = 1; $sensor_filters{energy} = 1; } - if (grep /energy/, @textfilters) { + if (grep /^energy$/, @textfilters) { $sensor_filters{energy} = 1; } - if (grep /led/, @textfilters) { + if (grep /^leds$/, @textfilters) { $sensor_filters{leds} = 1; } - if (grep /chassis/, @textfilters) { + if (grep /^chassis$/, @textfilters) { $sensor_filters{chassis} = 1; } unless (keys %sensor_filters) { From 551e9a0f483483a3f66348317887843d8de9bf0f Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Mon, 5 Jun 2017 11:36:27 -0400 Subject: [PATCH 111/129] Spelling fixes for install guides --- docs/source/guides/install-guides/common_sections.rst | 4 ++-- .../guides/install-guides/maintenance/uninstall_xcat.rst | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/source/guides/install-guides/common_sections.rst b/docs/source/guides/install-guides/common_sections.rst index e9f7cc87e..203b6cea9 100644 --- a/docs/source/guides/install-guides/common_sections.rst +++ b/docs/source/guides/install-guides/common_sections.rst @@ -37,11 +37,11 @@ xCAT consists of two software packages: ``xcat-core`` and ``xcat-dep`` * **Latest Release (Stable) Builds** - *This is the latest GA (Generally Availability) build that has been tested throughly* + *This is the latest GA (Generally Availability) build that has been tested thoroughly* * **Latest Snapshot Builds** - *This is the latest snapshot of the GA version build that may contain bug fixes but has not yet been tested throughly* + *This is the latest snapshot of the GA version build that may contain bug fixes but has not yet been tested thoroughly* * **Development Builds** diff --git a/docs/source/guides/install-guides/maintenance/uninstall_xcat.rst b/docs/source/guides/install-guides/maintenance/uninstall_xcat.rst index bfc60691f..6e343f834 100644 --- a/docs/source/guides/install-guides/maintenance/uninstall_xcat.rst +++ b/docs/source/guides/install-guides/maintenance/uninstall_xcat.rst @@ -58,7 +58,7 @@ Remove xCAT Files dpkg -l | awk '/xcat/ { print $2 }' - If you want to remove more cleanly, the list bleow maybe helpful. Listed are the packages of xcat installation tarball. Some RPMs may not to be installed in a specific environment. + If you want to remove more cleanly, the list below maybe helpful. Listed are the packages of xcat installation tarball. Some RPMs may not to be installed in a specific environment. * XCAT Core Packages list (xcat-core): From 1d2bac4a2a05ce1286ac591bcb0baf8b84b1c4ed Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Mon, 5 Jun 2017 13:44:15 -0400 Subject: [PATCH 112/129] Fix typo associated with pull request #3180 --- xCAT-server/lib/xcat/plugins/makeknownhosts.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-server/lib/xcat/plugins/makeknownhosts.pm b/xCAT-server/lib/xcat/plugins/makeknownhosts.pm index 8779b257a..f5efe5390 100644 --- a/xCAT-server/lib/xcat/plugins/makeknownhosts.pm +++ b/xCAT-server/lib/xcat/plugins/makeknownhosts.pm @@ -71,7 +71,7 @@ sub process_request if (!GetOptions( 'h|help' => \$::opt_h, 'V|verbose' => \$::opt_V, - 'r|remove' => \$::opt_r + 'r|remove' => \$::opt_r, 'd|delete' => \$::opt_d )) { From a2f2eaf0e76cea2ba457682631c855df2c46ccb4 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Mon, 5 Jun 2017 20:05:00 -0400 Subject: [PATCH 113/129] Change bmcdiscover to look at system information instead of motherboard information for the MTM/Serial Number. Use variables for building up then endpoint for OpenBMC --- xCAT-server/lib/xcat/plugins/bmcdiscover.pm | 28 +++++++++++++++------ 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/bmcdiscover.pm b/xCAT-server/lib/xcat/plugins/bmcdiscover.pm index 36f086c74..0811f73fe 100644 --- a/xCAT-server/lib/xcat/plugins/bmcdiscover.pm +++ b/xCAT-server/lib/xcat/plugins/bmcdiscover.pm @@ -1046,30 +1046,42 @@ sub bmcdiscovery_openbmc{ my $request_command = shift; my $node = sprintf("node-%08x", unpack("N*", inet_aton($ip))); + my $http_protocol="https"; + my $openbmc_project_url = "xyz/openbmc_project"; + my $login_endpoint = "login"; + my $system_endpoint = "inventory/system"; + my $node_data = $ip; my $brower = LWP::UserAgent->new( ssl_opts => { SSL_verify_mode => 0x00, verify_hostname => 0 }, ); my $cookie_jar = HTTP::Cookies->new(); my $header = HTTP::Headers->new('Content-Type' => 'application/json'); - my $url = "https://$ip/login"; my $data = '{"data": [ "' . $openbmc_user .'", "' . $openbmc_pass . '" ] }'; $brower->cookie_jar($cookie_jar); + + my $url = "$http_protocol://$ip/$login_endpoint"; my $login_request = HTTP::Request->new( 'POST', $url, $header, $data ); my $login_response = $brower->request($login_request); if ($login_response->is_success) { - my $req_url = "https://$ip/xyz/openbmc_project/inventory/system/chassis/motherboard"; - my $req = HTTP::Request->new('GET', $req_url, $header); + $url = "$http_protocol://$ip/$openbmc_project_url/$system_endpoint"; + my $req = HTTP::Request->new('GET', $url, $header); my $req_output = $brower->request($req); return if ($req_output->is_error); my $response = decode_json $req_output->content; my $mtm; my $serial; - if (defined($response->{data}) and defined($response->{data}->{Model}) and defined($response->{data}->{SerialNumber})) { - $mtm = $response->{data}->{Model}; - $serial = $response->{data}->{SerialNumber}; - } else { - xCAT::MsgUtils->message("W", { data => ["BMC Type/Model and/or Serial is unavailable for $ip"] }, $::CALLBACK); + if (defined($response->{data})) { + if (defined($response->{data}->{Model}) and defined($response->{data}->{SerialNumber})) { + $mtm = $response->{data}->{Model}; + $serial = $response->{data}->{SerialNumber}; + } else { + xCAT::MsgUtils->message("W", { data => ["Could not obtain Model Type and/or Serial Number for BMC at $ip"] }, $::CALLBACK); + return; + } + + } else { + xCAT::MsgUtils->message("E", { data => ["Unable to connect to REST server at $ip"] }, $::CALLBACK); return; } From 7c54b60b8add8394dad71dde463d3455b78541e0 Mon Sep 17 00:00:00 2001 From: XuWei Date: Mon, 5 Jun 2017 21:25:03 -0400 Subject: [PATCH 114/129] add -y when run yum install git --- xCAT-test/autotest/testcase/simulator/setup_simulator | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xCAT-test/autotest/testcase/simulator/setup_simulator b/xCAT-test/autotest/testcase/simulator/setup_simulator index f2549cca3..6a4bb71f6 100644 --- a/xCAT-test/autotest/testcase/simulator/setup_simulator +++ b/xCAT-test/autotest/testcase/simulator/setup_simulator @@ -3,12 +3,12 @@ description:install dependent packaages, setup and start openbmc simulator cmd:#!/bin/bash os=`cat /etc/*release*` if [[ "$os" =~ "Red Hat" ]] || [[ "$os" =~ "suse" ]]; then - yum install git + yum install git -y if [ $? != 0 ]; then exit 1 fi elif [[ "$os" =~ "ubuntu" ]]; then - apt-get install git + apt-get install git -y if [ $? != 0 ]; then exit 1 fi From b0fece290757f562179c32bbbfc465fff9561b86 Mon Sep 17 00:00:00 2001 From: XuWei Date: Mon, 5 Jun 2017 21:40:08 -0400 Subject: [PATCH 115/129] modify format of error msg for 2200 port to hash according to other msg --- xCAT-server/lib/xcat/plugins/bmcdiscover.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/xCAT-server/lib/xcat/plugins/bmcdiscover.pm b/xCAT-server/lib/xcat/plugins/bmcdiscover.pm index 36f086c74..3a99ded8a 100644 --- a/xCAT-server/lib/xcat/plugins/bmcdiscover.pm +++ b/xCAT-server/lib/xcat/plugins/bmcdiscover.pm @@ -594,7 +594,9 @@ sub scan_process { bmcdiscovery_ipmi(${$live_ip}[$i], $opz, $opw, $request_command); } } else { - xCAT::MsgUtils->message("E", "Can not get status of 2200 port.", $::CALLBACK); + my $rsp = {}; + push @{ $rsp->{data} }, "Can not get status of 2200 port for ip ${$live_ip}[$i].\n"; + xCAT::MsgUtils->message("E", $rsp, $::CALLBACK); exit 1; } From 5215b690f99b744fb10b8fd2d71bd7cf83b0f6ac Mon Sep 17 00:00:00 2001 From: hu-weihua Date: Tue, 6 Jun 2017 02:47:52 -0400 Subject: [PATCH 116/129] Modify one bug:Use of implicit split to @_ is deprecated at xcattest line 1059 --- xCAT-test/xcattest | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/xCAT-test/xcattest b/xCAT-test/xcattest index 2bcbd7956..00133e425 100755 --- a/xCAT-test/xcattest +++ b/xCAT-test/xcattest @@ -1056,9 +1056,9 @@ sub load_case { #log_this($running_log_fd, "Miss attribute:", @{$invalidcases{"missattr"}}); $$error_ref = "Miss attribute: " . join(",", @{ $invalidcases{"missattr"} }); foreach my $line (@{ $invalidcases{"missattr"} }) { - my $name = split(" ", $line); - if (!(grep /$name/, @wrong_cases)) { - push @wrong_cases, $name; + my @name = split(" ", $line); + if (!(grep /$name[0]/, @wrong_cases)) { + push @wrong_cases, $name[0]; } } $caseerror = 1; From ae09fdfe6de51bf08fdf5f3ceb1b9a991c076165 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Tue, 6 Jun 2017 13:04:41 -0400 Subject: [PATCH 117/129] Spelling for man1 and some formatting fixes --- .../restapi_resource/restapi_reference.rst | 32 +++++++++---------- docs/source/developers/github/change_code.rst | 2 +- .../ppc64le/management/basic/rcons.rst | 2 +- .../references/man1/bmcdiscover.1.rst | 4 +-- .../admin-guides/references/man1/cfgve.1.rst | 2 +- .../admin-guides/references/man1/chvm.1.rst | 6 ++-- .../references/man1/csm2xcat.1.rst | 2 +- .../references/man1/db2sqlsetup.1.rst | 2 +- .../references/man1/dumpxCATdb.1.rst | 4 +-- .../references/man1/genimage.1.rst | 2 +- .../references/man1/geninitrd.1.rst | 6 ++-- .../references/man1/getadapter.1.rst | 4 +-- .../references/man1/getmacs.1.rst | 12 +++---- .../references/man1/groupfiles4dsh.1.rst | 2 +- .../references/man1/imgexport.1.rst | 2 +- .../references/man1/imgimport.1.rst | 2 +- .../references/man1/liteimg.1.rst | 2 +- .../references/man1/lsflexnode.1.rst | 2 +- .../references/man1/lskitcomp.1.rst | 2 +- .../admin-guides/references/man1/lsslp.1.rst | 14 ++++---- .../admin-guides/references/man1/lstree.1.rst | 2 +- .../admin-guides/references/man1/lsvm.1.rst | 2 +- .../admin-guides/references/man1/mkdef.1.rst | 4 +-- .../references/man1/mkdocker.1.rst | 4 +-- .../references/man1/mkdsklsnode.1.rst | 6 ++-- .../references/man1/mknimimage.1.rst | 12 +++---- .../admin-guides/references/man1/mkvm.1.rst | 6 ++-- .../admin-guides/references/man1/monadd.1.rst | 4 +-- .../admin-guides/references/man1/moncfg.1.rst | 4 +-- .../references/man1/mondecfg.1.rst | 2 +- .../admin-guides/references/man1/monls.1.rst | 8 ++--- .../references/man1/monshow.1.rst | 2 +- .../references/man1/monstart.1.rst | 2 +- .../references/man1/nimnodecust.1.rst | 4 +-- .../references/man1/nimnodeset.1.rst | 13 ++++---- .../references/man1/nodeaddunmged.1.rst | 2 +- .../references/man1/nodechmac.1.rst | 2 +- .../references/man1/nodechprofile.1.rst | 2 +- .../references/man1/nodediscoverls.1.rst | 2 +- .../references/man1/nodediscoverstart.1.rst | 6 ++-- .../references/man1/nodediscoverstatus.1.rst | 2 +- .../references/man1/nodediscoverstop.1.rst | 2 +- .../references/man1/nodeimport.1.rst | 14 ++++---- .../admin-guides/references/man1/nodels.1.rst | 2 +- .../references/man1/nodepurge.1.rst | 2 +- .../references/man1/noderefresh.1.rst | 2 +- .../references/man1/nodestat.1.rst | 4 +-- .../references/man1/piflash.1.rst | 23 +++++++++++++ .../admin-guides/references/man1/rflash.1.rst | 16 +++++----- .../admin-guides/references/man1/rinv.1.rst | 6 ++-- .../references/man1/rmdocker.1.rst | 2 +- .../references/man1/rmdsklsnode.1.rst | 12 +++---- .../references/man1/rmhwconn.1.rst | 2 +- .../references/man1/rmigrate.1.rst | 2 +- .../references/man1/rmkitcomp.1.rst | 2 +- .../admin-guides/references/man1/rmvm.1.rst | 2 +- .../references/man1/rnetboot.1.rst | 4 +-- .../admin-guides/references/man1/rpower.1.rst | 6 ++-- .../references/man1/rspconfig.1.rst | 2 +- .../admin-guides/references/man1/sinv.1.rst | 8 ++--- .../admin-guides/references/man1/snmove.1.rst | 6 ++-- .../references/man1/swapnodes.1.rst | 6 ++-- .../references/man1/switchdiscover.1.rst | 10 +++--- .../references/man1/updatenode.1.rst | 10 +++--- .../references/man1/xcat2nim.1.rst | 2 +- docs/source/overview/quick_start.rst | 2 +- xCAT-client/pods/man1/bmcdiscover.1.pod | 4 +-- xCAT-client/pods/man1/cfgve.1.pod | 2 +- xCAT-client/pods/man1/chvm.1.pod | 6 ++-- xCAT-client/pods/man1/csm2xcat.1.pod | 2 +- xCAT-client/pods/man1/db2sqlsetup.1.pod | 2 +- xCAT-client/pods/man1/dumpxCATdb.1.pod | 4 +-- xCAT-client/pods/man1/genimage.1.pod | 2 +- xCAT-client/pods/man1/geninitrd.1.pod | 6 ++-- xCAT-client/pods/man1/getadapter.1.pod | 4 +-- xCAT-client/pods/man1/getmacs.1.pod | 12 +++---- xCAT-client/pods/man1/groupfiles4dsh.1.pod | 2 +- xCAT-client/pods/man1/imgexport.1.pod | 2 +- xCAT-client/pods/man1/imgimport.1.pod | 2 +- xCAT-client/pods/man1/liteimg.1.pod | 2 +- xCAT-client/pods/man1/lsflexnode.1.pod | 2 +- xCAT-client/pods/man1/lskitcomp.1.pod | 2 +- xCAT-client/pods/man1/lsslp.1.pod | 14 ++++---- xCAT-client/pods/man1/lstree.1.pod | 2 +- xCAT-client/pods/man1/lsvm.1.pod | 2 +- xCAT-client/pods/man1/mkdef.1.pod | 4 +-- xCAT-client/pods/man1/mkdocker.1.pod | 4 +-- xCAT-client/pods/man1/mkdsklsnode.1.pod | 6 ++-- xCAT-client/pods/man1/mknimimage.1.pod | 12 +++---- xCAT-client/pods/man1/mkvm.1.pod | 6 ++-- xCAT-client/pods/man1/monadd.1.pod | 4 +-- xCAT-client/pods/man1/moncfg.1.pod | 4 +-- xCAT-client/pods/man1/mondecfg.1.pod | 2 +- xCAT-client/pods/man1/monls.1.pod | 8 ++--- xCAT-client/pods/man1/monshow.1.pod | 2 +- xCAT-client/pods/man1/monstart.1.pod | 2 +- xCAT-client/pods/man1/nimnodecust.1.pod | 4 +-- xCAT-client/pods/man1/nimnodeset.1.pod | 13 ++++---- xCAT-client/pods/man1/nodeaddunmged.1.pod | 2 +- xCAT-client/pods/man1/nodechmac.1.pod | 2 +- xCAT-client/pods/man1/nodechprofile.1.pod | 2 +- xCAT-client/pods/man1/nodediscoverls.1.pod | 2 +- xCAT-client/pods/man1/nodediscoverstart.1.pod | 6 ++-- .../pods/man1/nodediscoverstatus.1.pod | 2 +- xCAT-client/pods/man1/nodediscoverstop.1.pod | 2 +- xCAT-client/pods/man1/nodeimport.1.pod | 14 ++++---- xCAT-client/pods/man1/nodels.1.pod | 2 +- xCAT-client/pods/man1/nodepurge.1.pod | 2 +- xCAT-client/pods/man1/noderefresh.1.pod | 2 +- xCAT-client/pods/man1/nodestat.1.pod | 4 +-- xCAT-client/pods/man1/rflash.1.pod | 16 +++++----- xCAT-client/pods/man1/rinv.1.pod | 6 ++-- xCAT-client/pods/man1/rmdocker.1.pod | 2 +- xCAT-client/pods/man1/rmdsklsnode.1.pod | 12 +++---- xCAT-client/pods/man1/rmhwconn.1.pod | 2 +- xCAT-client/pods/man1/rmigrate.1.pod | 2 +- xCAT-client/pods/man1/rmkitcomp.1.pod | 2 +- xCAT-client/pods/man1/rmvm.1.pod | 2 +- xCAT-client/pods/man1/rnetboot.1.pod | 4 +-- xCAT-client/pods/man1/rpower.1.pod | 6 ++-- xCAT-client/pods/man1/rspconfig.1.pod | 2 +- xCAT-client/pods/man1/sinv.1.pod | 8 ++--- xCAT-client/pods/man1/snmove.1.pod | 6 ++-- xCAT-client/pods/man1/swapnodes.1.pod | 6 ++-- xCAT-client/pods/man1/switchdiscover.1.pod | 10 +++--- xCAT-client/pods/man1/updatenode.1.pod | 10 +++--- xCAT-client/pods/man1/xcat2nim.1.pod | 2 +- 127 files changed, 322 insertions(+), 309 deletions(-) create mode 100644 docs/source/guides/admin-guides/references/man1/piflash.1.rst diff --git a/docs/source/advanced/restapi/restapi_resource/restapi_reference.rst b/docs/source/advanced/restapi/restapi_resource/restapi_reference.rst index e00105af5..d2cf1f937 100644 --- a/docs/source/advanced/restapi/restapi_resource/restapi_reference.rst +++ b/docs/source/advanced/restapi/restapi_resource/restapi_reference.rst @@ -567,7 +567,7 @@ Set the next boot state for the node1. :: ------------------------------------------------------------------------------- GET - Get all the vitals attributes. -``````````````````````````````````` +```````````````````````````````````` Refer to the man page: :doc:`rvitals ` @@ -598,7 +598,7 @@ Get all the vitails attributes for the node1. :: -------------------------------------------------------------------------------------------------------------------------------------- GET - Get the specific vitals attributes. -```````````````````````````````````````` +````````````````````````````````````````` Refer to the man page: :doc:`rvitals ` @@ -629,7 +629,7 @@ Get the 'fanspeed' vitals attribute. :: -------------------------------------------------------------------------------------- GET - Get all the inventory attributes. -`````````````````````````````````````` +``````````````````````````````````````` Refer to the man page: :doc:`rinv ` @@ -660,7 +660,7 @@ Get all the inventory attributes for node1. :: -------------------------------------------------------------------------------------------------------------- GET - Get the specific inventory attributes. -``````````````````````````````````````````` +```````````````````````````````````````````` Refer to the man page: :doc:`rinv ` @@ -1130,7 +1130,7 @@ Create osimage resources based on an xCAT image or configuration file :: ------------------------------------------------ GET - Get all the attributes for the osimage {imgname}. -`````````````````````````````````````````````````````` +``````````````````````````````````````````````````````` The keyword ALLRESOURCES can be used as {imgname} which means to get image attributes for all the osimages. @@ -1163,7 +1163,7 @@ Get the attributes for the specified osimage. :: } PUT - Change the attributes for the osimage {imgname}. -````````````````````````````````````````````````````` +`````````````````````````````````````````````````````` Refer to the man page: :doc:`chdef ` @@ -1348,7 +1348,7 @@ Create the networks resources base on the network configuration on xCAT MN. :: ------------------------------------------------ GET - Get all the attributes for the network {netname}. -`````````````````````````````````````````````````````` +``````````````````````````````````````````````````````` The keyword ALLRESOURCES can be used as {netname} which means to get network attributes for all the networks. @@ -1375,7 +1375,7 @@ Get all the attributes for network 'network1'. :: } PUT - Change the attributes for the network {netname}. -````````````````````````````````````````````````````` +`````````````````````````````````````````````````````` Refer to the man page: :doc:`chdef ` @@ -1488,7 +1488,7 @@ Get all the policy objects. :: ----------------------------------------------------- GET - Get all the attributes for a policy {policy_priority}. -``````````````````````````````````````````````````````````` +```````````````````````````````````````````````````````````` It will display all the policy attributes for one policy resource. @@ -1513,7 +1513,7 @@ Get all the attribute for policy 1. :: } PUT - Change the attributes for the policy {policy_priority}. -```````````````````````````````````````````````````````````` +````````````````````````````````````````````````````````````` It will change one or more attributes for a policy. @@ -1638,7 +1638,7 @@ Get all the group names from xCAT database. :: ---------------------------------------------- GET - Get all the attributes for the group {groupname}. -`````````````````````````````````````````````````````` +``````````````````````````````````````````````````````` Refer to the man page: :doc:`lsdef ` @@ -1658,7 +1658,7 @@ Get all the attributes for group 'all'. :: } PUT - Change the attributes for the group {groupname}. -````````````````````````````````````````````````````` +`````````````````````````````````````````````````````` Refer to the man page: :doc:`chdef ` @@ -1955,7 +1955,7 @@ URI list which can be used to create, query, change table entries. For a large number of nodes, this API call can be faster than using the corresponding nodes resource. The disadvantage is that you need to know the table names the attributes are stored in. GET - Get attributes of tables for a noderange. -`````````````````````````````````````````````` +``````````````````````````````````````````````` **Returns:** @@ -2026,7 +2026,7 @@ Get all the columns from tables nodetype and noderes for node1 and node2. :: } PUT - Change the node table attributes for {noderange}. -`````````````````````````````````````````````````````` +``````````````````````````````````````````````````````` **Parameters:** @@ -2048,7 +2048,7 @@ Change the nodetype.arch and noderes.netboot attributes for nodes node1,node2. : For a large number of nodes, this API call can be faster than using the corresponding nodes resource. The disadvantage is that you need to know the table names the attributes are stored in. GET - Get table attributes for a noderange. -`````````````````````````````````````````` +``````````````````````````````````````````` **Returns:** @@ -2120,7 +2120,7 @@ Use this for tables that don't have node name as the key of the table, for examp {keys} should be the name=value pairs which are used to search table. e.g. {keys} should be [net=192.168.1.0,mask=255.255.255.0] for networks table query since the net and mask are the keys of networks table. GET - Get attributes for rows from non-node tables. -`````````````````````````````````````````````````` +``````````````````````````````````````````````````` **Returns:** diff --git a/docs/source/developers/github/change_code.rst b/docs/source/developers/github/change_code.rst index 4eb5b79cd..e62064a32 100644 --- a/docs/source/developers/github/change_code.rst +++ b/docs/source/developers/github/change_code.rst @@ -25,7 +25,7 @@ Creating additional branches will allow you to work on different tasks/enhanceme Committing code and pushing to remote branch -------------------------------------------- +-------------------------------------------- Once your code is ready.... diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/management/basic/rcons.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/management/basic/rcons.rst index 6fcd77a1d..396880103 100644 --- a/docs/source/guides/admin-guides/manage_clusters/ppc64le/management/basic/rcons.rst +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/management/basic/rcons.rst @@ -46,7 +46,7 @@ The xCAT ``rcons`` command relies on conserver (http://www.conserver.com/). The OpenBMC Specific -``````````````` +```````````````` #. For OpenBMC managed servers, the root user must be able to ssh passwordless to the BMC for the ``rcons`` function to work. diff --git a/docs/source/guides/admin-guides/references/man1/bmcdiscover.1.rst b/docs/source/guides/admin-guides/references/man1/bmcdiscover.1.rst index efe3bde5b..7173c39f5 100644 --- a/docs/source/guides/admin-guides/references/man1/bmcdiscover.1.rst +++ b/docs/source/guides/admin-guides/references/man1/bmcdiscover.1.rst @@ -35,7 +35,7 @@ DESCRIPTION *********** -The \ **bmcdiscover**\ command will discover Baseboard Management Controllers (BMCs) using a scan mathod. +The \ **bmcdiscover**\ command will discover Baseboard Management Controllers (BMCs) using a scan method. The command uses \ **nmap**\ to scan active nodes over a specified IP range. The IP range format should be a format that is acceptable by \ **nmap**\ . @@ -52,7 +52,7 @@ OPTIONS \ **-**\ **-range**\ - Specify one or more IP ranges acceptable to nmap. IP rance can be hostnames, IP addresses, networks, etc. A single IP address (10.1.2.3) or an IP range (10.1.2.0/24) can be specified. If the range is very large, the \ **bmcdiscover**\ command may take a long time to return. + Specify one or more IP ranges acceptable to nmap. IP range can be hostnames, IP addresses, networks, etc. A single IP address (10.1.2.3) or an IP range (10.1.2.0/24) can be specified. If the range is very large, the \ **bmcdiscover**\ command may take a long time to return. diff --git a/docs/source/guides/admin-guides/references/man1/cfgve.1.rst b/docs/source/guides/admin-guides/references/man1/cfgve.1.rst index 6de85a9fd..3c53d9b20 100644 --- a/docs/source/guides/admin-guides/references/man1/cfgve.1.rst +++ b/docs/source/guides/admin-guides/references/man1/cfgve.1.rst @@ -98,7 +98,7 @@ OPTIONS be owned by vdsm:kvm. \ **localfs**\ : "/data/images/rhev" is set by default. - \ **virtsd.host**\ - A host must be specified for a storage doamin as SPM + \ **virtsd.host**\ - A host must be specified for a storage domain as SPM (Storage Pool Manager) when initialize the storage domain. The role of SPM may be migrated to other host by rhev-m during the running of the datacenter (For example, when the current SPM encountered issue or going to maintenance diff --git a/docs/source/guides/admin-guides/references/man1/chvm.1.rst b/docs/source/guides/admin-guides/references/man1/chvm.1.rst index 01e9afc33..14b1f28ea 100644 --- a/docs/source/guides/admin-guides/references/man1/chvm.1.rst +++ b/docs/source/guides/admin-guides/references/man1/chvm.1.rst @@ -151,7 +151,7 @@ PPC (using Direct FSP Management) specific: For Power 755(use option \ *--p775*\ to specify): -chvm could be used to change the octant configuration values for generating LPARs. chvm is designed to set the Octant configure value to split the CPU and memory for partitions, and set Octant Memory interleaving value. The chvm will only set the pending attributes value. After chvm, the CEC needs to be rebooted manually for the pending values to be enabled. Before reboot the cec, the administrator can use chvm to change the partition plan. If the the partition needs I/O slots, the administrator should use chvm to assign the I/O slots. +chvm could be used to change the octant configuration values for generating LPARs. chvm is designed to set the Octant configure value to split the CPU and memory for partitions, and set Octant Memory interleaving value. The chvm will only set the pending attributes value. After chvm, the CEC needs to be rebooted manually for the pending values to be enabled. Before reboot the cec, the administrator can use chvm to change the partition plan. If the partition needs I/O slots, the administrator should use chvm to assign the I/O slots. chvm is also designed to assign the I/O slots to the new LPAR. Both the current IO owning lpar and the new IO owning lpar must be powered off before an IO assignment. Otherwise, if the I/O slot is belonged to an Lpar and the LPAR is power on, the command will return an error when trying to assign that slot to a different lpar. @@ -166,7 +166,7 @@ zVM specific: ============= -The chvm command modifes the virtual machine's configuration specified in noderange. +The chvm command modifies the virtual machine's configuration specified in noderange. @@ -336,7 +336,7 @@ VMware/KVM specific: \ **-**\ **-resize**\ \ *disk*\ =\ *size*\ - Change the size of the Hard disk. The disk in \ *qcow2*\ format can not be set to less than it's current size. The disk in \ *raw*\ format can be resized smaller, use caution. Multiple disks can be resized by using comma separated \ *disk*\ \ **=**\ \ *size*\ pairs. The disks are specified by SCSI id. Size defaults to GB. + Change the size of the Hard disk. The disk in \ *qcow2*\ format can not be set to less than its current size. The disk in \ *raw*\ format can be resized smaller, use caution. Multiple disks can be resized by using comma separated \ *disk*\ \ **=**\ \ *size*\ pairs. The disks are specified by SCSI id. Size defaults to GB. diff --git a/docs/source/guides/admin-guides/references/man1/csm2xcat.1.rst b/docs/source/guides/admin-guides/references/man1/csm2xcat.1.rst index f03df04a2..cd06071a9 100644 --- a/docs/source/guides/admin-guides/references/man1/csm2xcat.1.rst +++ b/docs/source/guides/admin-guides/references/man1/csm2xcat.1.rst @@ -29,7 +29,7 @@ DESCRIPTION *********** -The csm2xcat command must be run on the Management Server of the CSM system that you want to migrate to xCAT. The commmand will build two xCAT stanza files that can update the xCAT database with the chdef command. +The csm2xcat command must be run on the Management Server of the CSM system that you want to migrate to xCAT. The command will build two xCAT stanza files that can update the xCAT database with the chdef command. Copy the csm2xcat command to the CSM Management Server. Run the command, indicating where you want your stanza files saved with the \ **-**\ **-dir**\ parameter. Check the stanza files to see if the information is what you want put in the xCAT database. Copy the two stanza files: node.stanza, device.stanza back to your xCAT Management node, and run the chdef command to input into the xCAT database. diff --git a/docs/source/guides/admin-guides/references/man1/db2sqlsetup.1.rst b/docs/source/guides/admin-guides/references/man1/db2sqlsetup.1.rst index 96b2fad80..2ea1fed24 100644 --- a/docs/source/guides/admin-guides/references/man1/db2sqlsetup.1.rst +++ b/docs/source/guides/admin-guides/references/man1/db2sqlsetup.1.rst @@ -46,7 +46,7 @@ For full information on the setup of DB2, see Setting_Up_DB2_as_the_xCAT_DB. When running of db2sqlsetup on the MN: One password must be supplied for the setup, a password for the xcatdb unix id which will be used as the DB2 instance id and database name. The password will be prompted for interactively or can be input with the XCATDB2PW environment variable. -The script will create the xcat database instance (xcatdb) in the /var/lib/db2 directory unless overriden by setting the site.databaseloc attribute. This attribute should not be set to the directory that is defined in the installloc attribute and it is recommended that the databaseloc be a new filesystem dedicated to the DB2 database, especially in very large clusters. +The script will create the xcat database instance (xcatdb) in the /var/lib/db2 directory unless overridden by setting the site.databaseloc attribute. This attribute should not be set to the directory that is defined in the installloc attribute and it is recommended that the databaseloc be a new filesystem dedicated to the DB2 database, especially in very large clusters. When running db2sqlseutp on the SN: Not only will the password for the DB2 instance Id be prompted for and must match the one on the Management Node; but also the hostname or ip address of the Management Node as known by the Service Node must be supplied , unless the XCATDB2SERVER environment variable is set. diff --git a/docs/source/guides/admin-guides/references/man1/dumpxCATdb.1.rst b/docs/source/guides/admin-guides/references/man1/dumpxCATdb.1.rst index 8dcaedc47..af89c9fef 100644 --- a/docs/source/guides/admin-guides/references/man1/dumpxCATdb.1.rst +++ b/docs/source/guides/admin-guides/references/man1/dumpxCATdb.1.rst @@ -35,7 +35,7 @@ If not using the binary dump option (-b), then the dumpxCATdb command creates .c Supports using XCAT_SKIPTABLES env variable to provide a list of skip tables. The command will never backup TEAL or ISNM tables, except isnm_config. To dump TEAL tables use the documented process for TEAL. For ISNM use tabdump, after using tabprune to get to prune unnecessary records. -If using the binary dump option for the DB2 or postgreSQL database, then the routine will use the Database provide utilites for backup of the entire database. +If using the binary dump option for the DB2 or postgreSQL database, then the routine will use the Database provide utilities for backup of the entire database. ******* @@ -49,7 +49,7 @@ OPTIONS \ **-V**\ Verbose. -\ **-a**\ All,without this flag the eventlog and auditlog will be skipped. +\ **-a**\ All, without this flag the eventlog and auditlog will be skipped. \ **-b**\ This flag is only used for the DB2 or postgreSQL database. The routine will use the database backup utilities to create a binary backup of the entire database. Note to use this backup on DB2, you will have first had to modify the logging of the database and have taken an offline initial backup. Refer to the xCAT DB2 documentation for more instructions. diff --git a/docs/source/guides/admin-guides/references/man1/genimage.1.rst b/docs/source/guides/admin-guides/references/man1/genimage.1.rst index 6d0f8adfd..d28fd3880 100644 --- a/docs/source/guides/admin-guides/references/man1/genimage.1.rst +++ b/docs/source/guides/admin-guides/references/man1/genimage.1.rst @@ -46,7 +46,7 @@ for stateless: \ **packimage**\ for statelite: \ **liteimg**\ -Besides prompting for some paramter values, the \ **genimage**\ command takes default guesses for the parameters not specified or not defined in the \ *osimage*\ and \ *linuximage*\ tables. It also assumes default answers for questions from the yum/zypper command when installing rpms into the image. Use \ **-**\ **-interactive**\ flag if you want the yum/zypper command to prompt you for the answers. +Besides prompting for some parameter values, the \ **genimage**\ command takes default guesses for the parameters not specified or not defined in the \ *osimage*\ and \ *linuximage*\ tables. It also assumes default answers for questions from the yum/zypper command when installing rpms into the image. Use \ **-**\ **-interactive**\ flag if you want the yum/zypper command to prompt you for the answers. If \ **-**\ **-onlyinitrd**\ is specified, genimage only regenerates the initrd for a stateless image to be used for a diskless install. diff --git a/docs/source/guides/admin-guides/references/man1/geninitrd.1.rst b/docs/source/guides/admin-guides/references/man1/geninitrd.1.rst index ffac5dd95..881fff450 100644 --- a/docs/source/guides/admin-guides/references/man1/geninitrd.1.rst +++ b/docs/source/guides/admin-guides/references/man1/geninitrd.1.rst @@ -43,7 +43,7 @@ If the initrd has been rebuilt by geninitrd, when run nodeset, the \ *--noupdate should be used to skip the rebuilding of initrd to improve the performance. Three attributes of osimage object can be used to specify the Driver RPM location and Driver names -for injecting new drviers to initrd. +for injecting new drivers to initrd. \ **netdrivers**\ - comma separated driver names that need to be injected to the initrd. The postfix '.ko' can be ignored. The netdrivers attribute must be set to specify the new driver list. @@ -65,7 +65,7 @@ this command is used to generate the initrd from the rootimg which generated by So the 'genimage' must be run once before running the geninitrd command. Two attributes of osimage object can be used to specify the Driver RPM location and Driver names -for injecting new drviers to initrd. +for injecting new drivers to initrd. \ **netdrivers**\ - comma separated driver names that need to be injected to the initrd. The postfix '.ko' can be ignored. The netdrivers attribute must be set to specify the new driver list. @@ -79,7 +79,7 @@ Parameters ********** -\ *imagename*\ specifies the name of an os image definition to be used. The specification for the image is storted in the \ *osimage*\ table and \ *linuximage*\ table. +\ *imagename*\ specifies the name of an os image definition to be used. The specification for the image is stored in the \ *osimage*\ table and \ *linuximage*\ table. \ **-**\ **-ignorekernelchk**\ diff --git a/docs/source/guides/admin-guides/references/man1/getadapter.1.rst b/docs/source/guides/admin-guides/references/man1/getadapter.1.rst index 7bd216c97..982fcd4c3 100644 --- a/docs/source/guides/admin-guides/references/man1/getadapter.1.rst +++ b/docs/source/guides/admin-guides/references/man1/getadapter.1.rst @@ -35,8 +35,8 @@ Traditionally, network interfaces in Linux are enumerated as eth[0123...], but t \ **getadapter**\ For each node within the , follows below scheme: -If the target node is scaned for the first time, \ **getadapter**\ will trigger genesis to collect information then save the information at the \ **nicsadapter**\ column of nics table. -If the target node has ever been scaned, \ **getadapter**\ will use the information from nics table first. +If the target node is scanned for the first time, \ **getadapter**\ will trigger genesis to collect information then save the information at the \ **nicsadapter**\ column of nics table. +If the target node has ever been scanned, \ **getadapter**\ will use the information from nics table first. If user hopes to scan the adapter information for the node but these information already exist, \ **-f**\ option can be used to start rescan process. \ **getadapter**\ tries to collect more information for the target network device, but doesn't guarantee collect same much information for every network device. diff --git a/docs/source/guides/admin-guides/references/man1/getmacs.1.rst b/docs/source/guides/admin-guides/references/man1/getmacs.1.rst index 05bfd6ff0..a38bc1abf 100644 --- a/docs/source/guides/admin-guides/references/man1/getmacs.1.rst +++ b/docs/source/guides/admin-guides/references/man1/getmacs.1.rst @@ -51,12 +51,12 @@ DESCRIPTION The getmacs command collects MAC address from a single or range of nodes. -Note that on AIX systems, the returned MAC address is not colon-seperated (for example 8ee2245cf004), while on Linux systems the MAC address is colon-seperated (for example 8e:e2:24:5c:f0:04). +Note that on AIX systems, the returned MAC address is not colon-separated (for example 8ee2245cf004), while on Linux systems the MAC address is colon-separated (for example 8e:e2:24:5c:f0:04). If no ping test performed, getmacs writes the first adapter MAC to the xCAT database. If ping test performed, getmacs will write the first successfully pinged MAC to xCAT database. For PPC (using Direct FSP Management) specific: -Note: If network adapters are physically assigned to LPARs, getmacs cannot read the MAC addresses unless perform \ **Discovery**\ with option "\ **-D**\ ", since there is no HMC command to read them and getmacs has to login to open formware. And if the LPARs has never been activated before, getmacs need to be performed with the option "\ **-D**\ " to get theirs MAC addresses. +Note: If network adapters are physically assigned to LPARs, getmacs cannot read the MAC addresses unless perform \ **Discovery**\ with option "\ **-D**\ ", since there is no HMC command to read them and getmacs has to login to open firmware. And if the LPARs has never been activated before, getmacs need to be performed with the option "\ **-D**\ " to get theirs MAC addresses. For PPC (using HMC) specific: @@ -74,7 +74,7 @@ OPTIONS \ **-**\ **-arp**\ -Read MAC address with ARP protocal. +Read MAC address with ARP protocol. \ **-C**\ @@ -90,7 +90,7 @@ Perform discovery for mac address. By default, it will run ping test to test th \ **-f**\ -Force immediate shutdown of the partition.This flag must be used with -D flag. +Force immediate shutdown of the partition. This flag must be used with -D flag. \ **-F**\ @@ -118,7 +118,7 @@ Read MAC address when the lpar is in openfirmware state. This option mush be us \ **-S**\ -The IP address of the machine to ping. The default is to read from xCAT databse if no \ **-S**\ specified. +The IP address of the machine to ping. The default is to read from xCAT database if no \ **-S**\ specified. \ **-v**\ @@ -167,7 +167,7 @@ Output is similar to: ent U78A1.001.99203B5-P1-T6 00145eb55788 /lhea@23c00614/ethernet@23e00514 unsuccessful physical -2. To retrieve the MAC address with ARP protocal: +2. To retrieve the MAC address with ARP protocol: .. code-block:: perl diff --git a/docs/source/guides/admin-guides/references/man1/groupfiles4dsh.1.rst b/docs/source/guides/admin-guides/references/man1/groupfiles4dsh.1.rst index ea06cfd04..3a2675767 100644 --- a/docs/source/guides/admin-guides/references/man1/groupfiles4dsh.1.rst +++ b/docs/source/guides/admin-guides/references/man1/groupfiles4dsh.1.rst @@ -33,7 +33,7 @@ This tool will build a directory of files, one for each defined nodegroup in xCAT. The file will be named the nodegroup name and contain a list of nodes that belong to the nodegroup. The file can be used as input to the AIX dsh command. -The purpose of this tool is to allow backward compatiblity with scripts +The purpose of this tool is to allow backward compatibility with scripts that were created using the AIX or CSM dsh command Reference: man dsh. diff --git a/docs/source/guides/admin-guides/references/man1/imgexport.1.rst b/docs/source/guides/admin-guides/references/man1/imgexport.1.rst index 2e08a1b61..3626725f1 100644 --- a/docs/source/guides/admin-guides/references/man1/imgexport.1.rst +++ b/docs/source/guides/admin-guides/references/man1/imgexport.1.rst @@ -61,7 +61,7 @@ For statelite: where x is the name of the profile. -Any files specified by the \ **-e**\ flag will also be exported. If \ **-p**\ flag is specified, the names of the postscripts and the postbootscripts for the given node will be exported. The postscripts themsleves need to be manualy exported using \ **-e**\ flag. +Any files specified by the \ **-e**\ flag will also be exported. If \ **-p**\ flag is specified, the names of the postscripts and the postbootscripts for the given node will be exported. The postscripts themselves need to be manualy exported using \ **-e**\ flag. For statelite, the litefile table settings for the image will also be exported. The litetree and statelite tables are not exported. diff --git a/docs/source/guides/admin-guides/references/man1/imgimport.1.rst b/docs/source/guides/admin-guides/references/man1/imgimport.1.rst index e5e542f7c..6359d535d 100644 --- a/docs/source/guides/admin-guides/references/man1/imgimport.1.rst +++ b/docs/source/guides/admin-guides/references/man1/imgimport.1.rst @@ -69,7 +69,7 @@ If \ **-p**\ flag is specified, the \ *postscripts*\ table will be updated wit If \ **-f**\ flag is not specified, all the files will be copied to the same directories as the source. If it is specified, the old profile name x will be changed to the new and the files will be copied to the appropriate directores for the new profiles. For example, \ */opt/xcat/share/xcat/netboot/sles/x.pkglist*\ will be copied to \ */install/custom/netboot/sles/compute_new.pkglist*\ and \ */install/netboot/sles11/ppc64/x/kernel*\ will be copied to \ */install/netboot/sles11/ppc64/compute_new/kernel*\ . This flag is commonly used when you want to copy the image on the same xCAT mn so you can make modification on the new one. -After this command, you can run the \ **nodeset**\ command and then start deploying the nodes. You can also choose to modify the files and run the following commands before the node depolyment. +After this command, you can run the \ **nodeset**\ command and then start deploying the nodes. You can also choose to modify the files and run the following commands before the node deployment. For stateful: nodeset diff --git a/docs/source/guides/admin-guides/references/man1/liteimg.1.rst b/docs/source/guides/admin-guides/references/man1/liteimg.1.rst index ceaec142a..266f59b73 100644 --- a/docs/source/guides/admin-guides/references/man1/liteimg.1.rst +++ b/docs/source/guides/admin-guides/references/man1/liteimg.1.rst @@ -63,7 +63,7 @@ PARAMETERS ********** -\ *imagename*\ specifies the name of a os image definition to be used. The specification for the image is storted in the \ *osimage*\ table and \ *linuximage*\ table. +\ *imagename*\ specifies the name of a os image definition to be used. The specification for the image is stored in the \ *osimage*\ table and \ *linuximage*\ table. ******* diff --git a/docs/source/guides/admin-guides/references/man1/lsflexnode.1.rst b/docs/source/guides/admin-guides/references/man1/lsflexnode.1.rst index e3c553c2e..e72fc0ce0 100644 --- a/docs/source/guides/admin-guides/references/man1/lsflexnode.1.rst +++ b/docs/source/guides/admin-guides/references/man1/lsflexnode.1.rst @@ -38,7 +38,7 @@ There are several concepts to support the HX5 multiple blades combination: \ **Complex**\ : Multiple blades which combined by a scalability card is a complex. -\ **Parition**\ : A logic concept which containing part of the \ **Blade slot node**\ in a complex. Each partition can map to a system to install Operating System. Each partition could have 1HX5, 1HX5+1MD or 2HX5+2MD. (MD is the Memory Drawer) +\ **Partition**\ : A logic concept which containing part of the \ **Blade slot node**\ in a complex. Each partition can map to a system to install Operating System. Each partition could have 1HX5, 1HX5+1MD or 2HX5+2MD. (MD is the Memory Drawer) \ **Blade slot node**\ : The physical blade which installed in the slot of a chassis. It can be a HX5 or MD. diff --git a/docs/source/guides/admin-guides/references/man1/lskitcomp.1.rst b/docs/source/guides/admin-guides/references/man1/lskitcomp.1.rst index 81500f251..895a065e1 100644 --- a/docs/source/guides/admin-guides/references/man1/lskitcomp.1.rst +++ b/docs/source/guides/admin-guides/references/man1/lskitcomp.1.rst @@ -89,7 +89,7 @@ OPTIONS - Each tag contains info for a group of kit compoonents belonging to the same kit. The info inside is structured as follows: + Each tag contains info for a group of kit components belonging to the same kit. The info inside is structured as follows: .. code-block:: perl diff --git a/docs/source/guides/admin-guides/references/man1/lsslp.1.rst b/docs/source/guides/admin-guides/references/man1/lsslp.1.rst index 0d16d5f50..3c83cb355 100644 --- a/docs/source/guides/admin-guides/references/man1/lsslp.1.rst +++ b/docs/source/guides/admin-guides/references/man1/lsslp.1.rst @@ -41,13 +41,13 @@ OPTIONS ******* -\ **noderange**\ The nodes which the user want to discover. If the user specify the noderange, lsslp will just return the nodes in the node range. Which means it will help to add the new nodes to the xCAT database without modifying the existed definitions. But the nodes' name specified in noderange should be defined in database in advance. The specified nodes' type can be frame/cec/hmc/fsp/bpa. If the it is frame or cec, lsslp will list the bpa or fsp nodes within the nodes(bap for frame, fsp for cec). Do not use noderange with the flag -s. +\ **noderange**\ The nodes which the user wants to discover. If the user specifies the noderange, lsslp will just return the nodes in the node range. Which means it will help to add the new nodes to the xCAT database without modifying the existed definitions. But the nodes' name specified in noderange should be defined in database in advance. The specified nodes' type can be frame/cec/hmc/fsp/bpa. If the it is frame or cec, lsslp will list the bpa or fsp nodes within the nodes(bap for frame, fsp for cec). Do not use noderange with the flag -s. \ **-i**\ IP(s) the command will send out (defaults to all available adapters). \ **-h**\ Display usage message. -\ **-n**\ Only display and write the newly discovered hardwares. +\ **-n**\ Only display and write the newly discovered hardware. \ **-u**\ Do unicast to a specified IP range. Must be used with \ **-s**\ and \ **-**\ **-range**\ . The \ **-u**\ flag is not supported on AIX. @@ -55,15 +55,15 @@ OPTIONS \ **-r**\ Display Raw SLP response. -\ **-C**\ The number of the expected responses specified by the user. When using this flag, lsslp will not return until the it has found all the nodes or time out. The default max time is 3 secondes. The user can use -T flag the specify the time they want to use. A short time will limite the time costing, while a long time will help to find all the nodes. +\ **-C**\ The number of the expected responses specified by the user. When using this flag, lsslp will not return until the it has found all the nodes or time out. The default max time is 3 seconds. The user can use -T flag the specify the time they want to use. A short time will limit the time costing, while a long time will help to find all the nodes. -\ **-T**\ The number in seconds to limite the time costing of lsslp. +\ **-T**\ The number in seconds to limit the time of lsslp. \ **-s**\ Service type interested in discovering. \ **-t**\ Number or service-request attempts. -\ **-**\ **-vpdtable**\ Output the SLP response in vpdtable formatting. Easy for writting data to vpd table. +\ **-**\ **-vpdtable**\ Output the SLP response in vpdtable formatting. Easy for writing data to vpd table. \ **-v**\ Command Version. @@ -73,9 +73,9 @@ OPTIONS \ **-x**\ XML format. -\ **-z**\ Stanza formated output. +\ **-z**\ Stanza formatted output. -\ **-I**\ Give the warning message for the nodes in database which have no SLP responses. Note that this flag noly can be used after the database migration finished successfully. +\ **-I**\ Give the warning message for the nodes in database which have no SLP responses. Note that this flag can only be used after the database migration finished successfully. ************ diff --git a/docs/source/guides/admin-guides/references/man1/lstree.1.rst b/docs/source/guides/admin-guides/references/man1/lstree.1.rst index b4c58f176..e6a4eeddf 100644 --- a/docs/source/guides/admin-guides/references/man1/lstree.1.rst +++ b/docs/source/guides/admin-guides/references/man1/lstree.1.rst @@ -29,7 +29,7 @@ DESCRIPTION *********** -The \ **lstree**\ command can display the tree of service node hierarchy for the xCAT nodes which have service node defined or which are service nodes, display the tree of hardware hierarchy only for the physical objects, display the tree of VM hierarchy for the xCAT nodes which are virtual machines or which are the hosts of virtual machines. If a noderange is specified, only show the part of the hierarchy that involves those nodes. For ZVM, we only support to disply VM hierarchy. By default, lstree will show both the hardware hierarchy and the VM hierarchy for all the nodes. +The \ **lstree**\ command can display the tree of service node hierarchy for the xCAT nodes which have service node defined or which are service nodes, display the tree of hardware hierarchy only for the physical objects, display the tree of VM hierarchy for the xCAT nodes which are virtual machines or which are the hosts of virtual machines. If a noderange is specified, only show the part of the hierarchy that involves those nodes. For ZVM, we only support to display VM hierarchy. By default, lstree will show both the hardware hierarchy and the VM hierarchy for all the nodes. ******* diff --git a/docs/source/guides/admin-guides/references/man1/lsvm.1.rst b/docs/source/guides/admin-guides/references/man1/lsvm.1.rst index dc53a2c47..ad48cc0af 100644 --- a/docs/source/guides/admin-guides/references/man1/lsvm.1.rst +++ b/docs/source/guides/admin-guides/references/man1/lsvm.1.rst @@ -360,7 +360,7 @@ Output is similar to: Available BSR array: 256 -Note: The lines listed in "All Physical I/O info" section represent all the physical I/O resource information. The format is like "owner_lparid,slot_id,physical resource name,drc_index,slot_class_code(class discription)". The 'drc index' is short for Dynamic Resource Configuration Index, it uniquely indicates a physical I/O resource in a normal power machine. +Note: The lines listed in "All Physical I/O info" section represent all the physical I/O resource information. The format is like "owner_lparid,slot_id,physical resource name,drc_index,slot_class_code(class description)". The 'drc index' is short for Dynamic Resource Configuration Index, it uniquely indicates a physical I/O resource in a normal power machine. 9. For DFM-managed partition on normal power machine, list out the detailed information: diff --git a/docs/source/guides/admin-guides/references/man1/mkdef.1.rst b/docs/source/guides/admin-guides/references/man1/mkdef.1.rst index 41084a288..066084735 100644 --- a/docs/source/guides/admin-guides/references/man1/mkdef.1.rst +++ b/docs/source/guides/admin-guides/references/man1/mkdef.1.rst @@ -84,7 +84,7 @@ OPTIONS \ **-**\ **-template**\ \ *template-object-name*\ - Name of the xCAT shipped object definition template or an existing object, from which the new object definition will be created. The newly created object will inherit the attributes of the template definition unless the attribute is specified in the arguments of \ **mkdef**\ command. If there are a template and an existing object with the same name \ *template-object-name*\ , the tempalte object takes precedence over the existing object. For the details of xCAT shipped object definition templates, refer to the manpage of \ **-**\ **-template**\ option in lsdef(1)|lsdef.1. + Name of the xCAT shipped object definition template or an existing object, from which the new object definition will be created. The newly created object will inherit the attributes of the template definition unless the attribute is specified in the arguments of \ **mkdef**\ command. If there are a template and an existing object with the same name \ *template-object-name*\ , the template object takes precedence over the existing object. For the details of xCAT shipped object definition templates, refer to the manpage of \ **-**\ **-template**\ option in lsdef(1)|lsdef.1. @@ -96,7 +96,7 @@ OPTIONS \ **-w**\ \ *attr==val*\ \ **-w**\ \ *attr=~val*\ ... - Use one or multiple -w flags to specify the selection string that can be used to select objects. The operators ==, !=, =~ and !~ are available. For mkdef commmand, the -w flag only makes sense for creating dynamic node group. Use the help option to get a list of valid attributes for each object type. + Use one or multiple -w flags to specify the selection string that can be used to select objects. The operators ==, !=, =~ and !~ are available. For mkdef command, the -w flag only makes sense for creating dynamic node group. Use the help option to get a list of valid attributes for each object type. Operator descriptions: == Select nodes where the attribute value is exactly this value. diff --git a/docs/source/guides/admin-guides/references/man1/mkdocker.1.rst b/docs/source/guides/admin-guides/references/man1/mkdocker.1.rst index 87559be1c..f1e2d2e47 100644 --- a/docs/source/guides/admin-guides/references/man1/mkdocker.1.rst +++ b/docs/source/guides/admin-guides/references/man1/mkdocker.1.rst @@ -137,7 +137,7 @@ Output is similar to: host01c01: Pull image ubuntu start host01c01: Pull image ubuntu done host01c01: Remove default network connection - host01c01: Connecting customzied network 'mynet0' + host01c01: Connecting customized network 'mynet0' host01c01: success @@ -155,7 +155,7 @@ Output is similar to: .. code-block:: perl host01c01: Remove default network connection - host01c01: Connecting customzied network 'mynet0' + host01c01: Connecting customized network 'mynet0' host01c01: success diff --git a/docs/source/guides/admin-guides/references/man1/mkdsklsnode.1.rst b/docs/source/guides/admin-guides/references/man1/mkdsklsnode.1.rst index f1a4294e7..6968e6039 100644 --- a/docs/source/guides/admin-guides/references/man1/mkdsklsnode.1.rst +++ b/docs/source/guides/admin-guides/references/man1/mkdsklsnode.1.rst @@ -38,7 +38,7 @@ This command will also create a NIM resolv_conf resource to be used when install The "domain" and "nameservers" attributes can be set in either the xCAT "network" definition used by the nodes or in the xCAT cluster "site" definition. The setting in the "network" definition will take priority. The "search" field of the resolv.conf file will contain a list all the domains -listed in the xCAT network definitions and the xCAT site definiton. +listed in the xCAT network definitions and the xCAT site definition. The "nameservers" value can either be set to a specific IP address or the "" key word. The "" key word means that the value of the "xcatmaster" attribute of the node definition will be used in the /etc/resolv.conf file. (I.e. The name of the install server as known by the node.) @@ -57,11 +57,11 @@ You can use the "-n" option of the mkdsklsnode command to create and initialize \ **Note:**\ When using the "-n" option make sure that the new osimage you specify and all the NIM resources that are used are different than what are currently being used on the nodes. The NIM resources should not be shared between the old osimage and the new osimage. -You can use the force option to reinitialize a node if it already has resources allocated or it is in the wrong NIM state. This option will reset the NIM node and deallocate resources before reinititializing. Use this option with caution since reinitializing a node will stop the node if it is currently running. +You can use the force option to reinitialize a node if it already has resources allocated or it is in the wrong NIM state. This option will reset the NIM node and deallocate resources before reinitializing. Use this option with caution since reinitializing a node will stop the node if it is currently running. After the mkdsklsnode command completes you can use the \ **lsnim**\ command to check the NIM node definition to see if it is ready for booting the node. ("lsnim -l "). -You can supply your own scripts to be run on the management node or on the service node (if their is hierarchy) for a node during the \ **mkdsklsnode**\ command. Such scripts are called \ **prescripts**\ . They should be copied to /install/prescripts dirctory. A table called \ *prescripts*\ is used to specify the scripts and their associated actions. The scripts to be run at the beginning of the \ **mkdsklsnode**\ command are stored in the 'begin' column of \ *prescripts*\ table. The scripts to be run at the end of the \ **mkdsklsnode**\ command are stored in the 'end' column of \ *prescripts*\ table. Run 'tabdump prescripts -d' command for details. An example for the 'begin' or the 'end' column is: \ *diskless:myscript1,myscript2*\ . The following two environment variables will be passed to each script: NODES contains all the names of the nodes that need to run the script for and ACTION contains the current current nodeset action, in this case "diskless". If \ *#xCAT setting:MAX_INSTANCE=number*\ is specified in the script, the script will get invoked for each node in parallel, but no more than \ *number*\ of instances will be invoked at at a time. If it is not specified, the script will be invoked once for all the nodes. +You can supply your own scripts to be run on the management node or on the service node (if their is hierarchy) for a node during the \ **mkdsklsnode**\ command. Such scripts are called \ **prescripts**\ . They should be copied to /install/prescripts directory. A table called \ *prescripts*\ is used to specify the scripts and their associated actions. The scripts to be run at the beginning of the \ **mkdsklsnode**\ command are stored in the 'begin' column of \ *prescripts*\ table. The scripts to be run at the end of the \ **mkdsklsnode**\ command are stored in the 'end' column of \ *prescripts*\ table. Run 'tabdump prescripts -d' command for details. An example for the 'begin' or the 'end' column is: \ *diskless:myscript1,myscript2*\ . The following two environment variables will be passed to each script: NODES contains all the names of the nodes that need to run the script for and ACTION contains the current nodeset action, in this case "diskless". If \ *#xCAT setting:MAX_INSTANCE=number*\ is specified in the script, the script will get invoked for each node in parallel, but no more than \ *number*\ of instances will be invoked at a time. If it is not specified, the script will be invoked once for all the nodes. ******* diff --git a/docs/source/guides/admin-guides/references/man1/mknimimage.1.rst b/docs/source/guides/admin-guides/references/man1/mknimimage.1.rst index 15d496c90..1d2985946 100644 --- a/docs/source/guides/admin-guides/references/man1/mknimimage.1.rst +++ b/docs/source/guides/admin-guides/references/man1/mknimimage.1.rst @@ -43,7 +43,7 @@ When creating a mksysb image definition you must specify either the "-n" or the When creating a diskless osimage definition you also have the option of automatically updating the NIM SPOT resource. You can have additional software installed or you can have configuration files added or updated. To have software installed you must provide either the names of NIM installp_bundle resources or fileset names on the command line using the "attr=val" option. You may also supply the installp flags, RPM flags, emgr flags to use when installing the software. -To have configuration files updated you must provide the full path name of a "synclists" file which contains the the list of actual files to update. The xCAT osimage definition that is created will contain the installp_bundle, otherpkgs, and synclists files that are provided on the command line. +To have configuration files updated you must provide the full path name of a "synclists" file which contains the list of actual files to update. The xCAT osimage definition that is created will contain the installp_bundle, otherpkgs, and synclists files that are provided on the command line. \ **Updating an existing xCAT osimage**\ @@ -69,7 +69,7 @@ You can use the "-i" and "-p" options to copy an existing diskless osimage. To - any other resources (or attributes) included in the original osimage will be included in the new osimage definition. -- if the "-p" option is specified then the original NIM lpp_source resource will be copied to a new location and redfined to NIM. (The default would be to use the original lpp_source - to save file system space.) +- if the "-p" option is specified then the original NIM lpp_source resource will be copied to a new location and redefined to NIM. (The default would be to use the original lpp_source - to save file system space.) \ **Additional information**\ @@ -85,7 +85,7 @@ To list a NIM resource definition use the AIX \ **lsnim**\ command ("lsnim -l < To check the validity of a SPOT or lpp_source resource use the AIX \ **nim**\ command ("nim -o check "). -To remove specific NIM resource definitons use the AIX \ **nim**\ command. ("nim -o remove "). +To remove specific NIM resource definitions use the AIX \ **nim**\ command. ("nim -o remove "). ******* @@ -255,7 +255,7 @@ OPTIONS - Note that you may specify multiple "script", "otherpkgs", and "installp_bundle" resources by using a comma seperated list. (ex. "script=ascript,bscript"). RPM names may be included in the "otherpkgs" list by using a "R:" prefix(ex. "R:whatever.rpm"). epkg (AIX interim fix package) file names may be included in the "otherpkgs" using the 'E:' prefix. (ex. "otherpkgs=E:IZ38930TL0.120304.epkg.Z"). + Note that you may specify multiple "script", "otherpkgs", and "installp_bundle" resources by using a comma separated list. (ex. "script=ascript,bscript"). RPM names may be included in the "otherpkgs" list by using a "R:" prefix(ex. "R:whatever.rpm"). epkg (AIX interim fix package) file names may be included in the "otherpkgs" using the 'E:' prefix. (ex. "otherpkgs=E:IZ38930TL0.120304.epkg.Z"). @@ -267,7 +267,7 @@ OPTIONS \ **-c|-**\ **-completeosimage**\ - Complete the creation of the osimage definition passed in on the command line. This option will use any additonal values passed in on the command line and/or it will attempt to create required resources in order to complete the definition of the xCAT osimage. For example, if the osimage definition is missing a spot or shared_root resource the command will create those resources and add them to the osimage definition. + Complete the creation of the osimage definition passed in on the command line. This option will use any additional values passed in on the command line and/or it will attempt to create required resources in order to complete the definition of the xCAT osimage. For example, if the osimage definition is missing a spot or shared_root resource the command will create those resources and add them to the osimage definition. @@ -492,7 +492,7 @@ The xCAT osimage definition created by this command will include the "otherpkgs" mknimimage -u 61dskls installp_bundle=bndres1,bndres2 installp_flags="-agcQX" -Note that when "installp_bundle", "otherpkgs", or "synclists" values are specified with the "-u" option then the xCAT osimage definiton is not used or updated. +Note that when "installp_bundle", "otherpkgs", or "synclists" values are specified with the "-u" option then the xCAT osimage definition is not used or updated. 13) Update an existing image to support NFSv4. Also specify verbose messages. diff --git a/docs/source/guides/admin-guides/references/man1/mkvm.1.rst b/docs/source/guides/admin-guides/references/man1/mkvm.1.rst index 753ddd42e..effaaa109 100644 --- a/docs/source/guides/admin-guides/references/man1/mkvm.1.rst +++ b/docs/source/guides/admin-guides/references/man1/mkvm.1.rst @@ -148,7 +148,7 @@ OPTIONS \ **vmcpus=**\ \ *value*\ \ **vmmemory=**\ \ *value*\ \ **vmphyslots=**\ \ *value*\ \ **vmothersetting=**\ \ *value*\ \ **vmnics=**\ \ *value*\ \ **vmstorage=**\ \ *value*\ [\ **-**\ **-vios**\ ] - To specify the parameters which are used to create a partition. The \ *vmcpus*\ , \ *vmmemory*\ are necessay, and the value specified with this command have a more high priority. If the value of any of the three options is not specified, the corresponding value specified for the node object will be used. If any of the three attributes is neither specified with this command nor specified with the node object, error information will be returned. To reference to lsvm(1)|lsvm.1 for more information about 'drc_index' for \ *vmphyslots*\ . + To specify the parameters which are used to create a partition. The \ *vmcpus*\ , \ *vmmemory*\ are necessary, and the value specified with this command have a more high priority. If the value of any of the three options is not specified, the corresponding value specified for the node object will be used. If any of the three attributes is neither specified with this command nor specified with the node object, error information will be returned. To reference to lsvm(1)|lsvm.1 for more information about 'drc_index' for \ *vmphyslots*\ . The option \ *vios*\ is used to specify the partition that will be created is a VIOS partition. If specified, the value for \ *vmstorage*\ shall be number which indicate the number of vSCSI server adapter will be created, and if no value specified for \ *vmphyslots*\ , all the physical slot of the power machine will be asigned to VIOS partition. If not specified, it shall be in form of \ *vios_name:server_slotid*\ to specify the vios and the virtual slot id of the vSCSI server adapter that will be connected from the Logical partition. @@ -392,7 +392,7 @@ First, define a node object: mkdef -t node -o lpar1 mgt=fsp cons=fsp nodetype=ppc,osi id=1 hcp=cec parent=cec hwtype=lpar groups=lpar,all -Then, create the partion on the specified cec. +Then, create the partition on the specified cec. .. code-block:: perl @@ -515,7 +515,7 @@ The output is similar to: mkvm viosnode vmcpus=1/4/16 vmmemory=1G/4G/32G vmphyslots=0x21010201,0x21010200 vmnics=vlan1 vmstorage=5 --vios -The resouces for the node is similar to: +The resources for the node is similar to: .. code-block:: perl diff --git a/docs/source/guides/admin-guides/references/man1/monadd.1.rst b/docs/source/guides/admin-guides/references/man1/monadd.1.rst index df2c69af8..bb8f629e8 100644 --- a/docs/source/guides/admin-guides/references/man1/monadd.1.rst +++ b/docs/source/guides/admin-guides/references/man1/monadd.1.rst @@ -39,9 +39,9 @@ Parameters ********** -\ *name*\ is the name of the monitoring plug-in module. For example, if the the \ *name*\ is called \ *xxx*\ , then the actual file name that the xcatd looks for is \ */opt/xcat/lib/perl/xCAT_monitoring/xxx.pm*\ . Use \ *monls -a*\ command to list all the monitoring plug-in modules that can be used. +\ *name*\ is the name of the monitoring plug-in module. For example, if the \ *name*\ is called \ *xxx*\ , then the actual file name that the xcatd looks for is \ */opt/xcat/lib/perl/xCAT_monitoring/xxx.pm*\ . Use \ *monls -a*\ command to list all the monitoring plug-in modules that can be used. -\ *settings*\ is the monitoring plug-in specific settings. It is used to customize the behavior of the plug-in or configure the 3rd party software. Format: \ *-s key-value -s key=value ...*\ Note that the square brackets are needed here. Use \ *monls name -d*\ command to look for the possbile setting keys for a plug-in module. +\ *settings*\ is the monitoring plug-in specific settings. It is used to customize the behavior of the plug-in or configure the 3rd party software. Format: \ *-s key-value -s key=value ...*\ Note that the square brackets are needed here. Use \ *monls name -d*\ command to look for the possible setting keys for a plug-in module. ******* diff --git a/docs/source/guides/admin-guides/references/man1/moncfg.1.rst b/docs/source/guides/admin-guides/references/man1/moncfg.1.rst index febc5f32f..a7ac99ccd 100644 --- a/docs/source/guides/admin-guides/references/man1/moncfg.1.rst +++ b/docs/source/guides/admin-guides/references/man1/moncfg.1.rst @@ -31,7 +31,7 @@ DESCRIPTION *********** -This command is used to configure a 3rd party monitoring software to monitor the xCAT cluster. For example, it modifies the configration file for the monitoring software so that the nodes can be included in the monitoring domain. The operation is performed on the management node and the service nodes of the given nodes. The operation will also be performed on the nodes if the \ *-r*\ option is specified, though the configuration of the nodes is usually performed during the node deployment stage. +This command is used to configure a 3rd party monitoring software to monitor the xCAT cluster. For example, it modifies the configuration file for the monitoring software so that the nodes can be included in the monitoring domain. The operation is performed on the management node and the service nodes of the given nodes. The operation will also be performed on the nodes if the \ *-r*\ option is specified, though the configuration of the nodes is usually performed during the node deployment stage. ********** @@ -39,7 +39,7 @@ Parameters ********** -\ *name*\ is the name of the monitoring plug-in module. For example, if the the \ *name*\ is called \ *xxx*\ , then the actual file name that the xcatd looks for is \ */opt/xcat/lib/perl/xCAT_monitoring/xxx.pm*\ . Use \ *monls -a*\ command to list all the monitoring plug-in modules that can be used. +\ *name*\ is the name of the monitoring plug-in module. For example, if the \ *name*\ is called \ *xxx*\ , then the actual file name that the xcatd looks for is \ */opt/xcat/lib/perl/xCAT_monitoring/xxx.pm*\ . Use \ *monls -a*\ command to list all the monitoring plug-in modules that can be used. \ *noderange*\ specifies the nodes to be monitored. If omitted, all nodes will be monitored. diff --git a/docs/source/guides/admin-guides/references/man1/mondecfg.1.rst b/docs/source/guides/admin-guides/references/man1/mondecfg.1.rst index 1b6b8439b..eeb0dc747 100644 --- a/docs/source/guides/admin-guides/references/man1/mondecfg.1.rst +++ b/docs/source/guides/admin-guides/references/man1/mondecfg.1.rst @@ -31,7 +31,7 @@ DESCRIPTION *********** -This command is used to deconfigure a 3rd party monitoring software from monitoring the xCAT cluster. The operation is performed on the management node and the service nodes of the given nodes. The operation will also be performed on the nodes if the \ *-r*\ option is specified. The deconfigration operation will remove the nodes from the 3rd party software's monitoring domain. +This command is used to deconfigure a 3rd party monitoring software from monitoring the xCAT cluster. The operation is performed on the management node and the service nodes of the given nodes. The operation will also be performed on the nodes if the \ *-r*\ option is specified. The deconfiguration operation will remove the nodes from the 3rd party software's monitoring domain. ********** diff --git a/docs/source/guides/admin-guides/references/man1/monls.1.rst b/docs/source/guides/admin-guides/references/man1/monls.1.rst index 7f321d21b..f5241006d 100644 --- a/docs/source/guides/admin-guides/references/man1/monls.1.rst +++ b/docs/source/guides/admin-guides/references/man1/monls.1.rst @@ -33,7 +33,7 @@ DESCRIPTION *********** -This command is used to list the status, desctiption, the configuration scripts and the settings of one or all of the monitoring plug-in modules. +This command is used to list the status, description, the configuration scripts and the settings of one or all of the monitoring plug-in modules. ********** @@ -49,9 +49,9 @@ OPTIONS ******* -\ **-a | -**\ **-all**\ Searches the \ *XCATROOT/lib/perl/xCAT_monitoring*\ directory and reports all the monitoring plug-in modules. If nothing is specified, the list is read from the \ *monitoring*\ tabel. +\ **-a | -**\ **-all**\ Searches the \ *XCATROOT/lib/perl/xCAT_monitoring*\ directory and reports all the monitoring plug-in modules. If nothing is specified, the list is read from the \ *monitoring*\ table. -\ **-d | -**\ **-description**\ Display the description of the plug-in modules. The description ususally contains the possible settings. +\ **-d | -**\ **-description**\ Display the description of the plug-in modules. The description usually contains the possible settings. \ **-h | -**\ **-help**\ Display usage message. @@ -110,7 +110,7 @@ The output looks like this: nagiosmon not-monitored -3. To list the status and the desciption for \ *snmpmon*\ module, enter: +3. To list the status and the description for \ *snmpmon*\ module, enter: .. code-block:: perl diff --git a/docs/source/guides/admin-guides/references/man1/monshow.1.rst b/docs/source/guides/admin-guides/references/man1/monshow.1.rst index e711239b7..2c8ff130c 100644 --- a/docs/source/guides/admin-guides/references/man1/monshow.1.rst +++ b/docs/source/guides/admin-guides/references/man1/monshow.1.rst @@ -59,7 +59,7 @@ OPTIONS \ **-a**\ specifies a comma-separated list of attributes or metrics names. The default is all. -\ **-w**\ specify one or multiple selection string that can be used to select events. The operators ==, !=, =,!,>,<,>=,<= are available. Wildcards % and _ are supported in the pattern string. % allows you to match any string of any length(including zero length) and _ allows you to match on a single character. The valid attributes are eventtype, monitor, monnode, application, component, id, serverity, message, rawdata, comments. Valid severity are: Informational, Warning, Critical. +\ **-w**\ specify one or multiple selection string that can be used to select events. The operators ==, !=, =,!,>,<,>=,<= are available. Wildcards % and _ are supported in the pattern string. % allows you to match any string of any length(including zero length) and _ allows you to match on a single character. The valid attributes are eventtype, monitor, monnode, application, component, id, severity, message, rawdata, comments. Valid severity are: Informational, Warning, Critical. Operator descriptions: diff --git a/docs/source/guides/admin-guides/references/man1/monstart.1.rst b/docs/source/guides/admin-guides/references/man1/monstart.1.rst index 292c72265..1595b28b8 100644 --- a/docs/source/guides/admin-guides/references/man1/monstart.1.rst +++ b/docs/source/guides/admin-guides/references/man1/monstart.1.rst @@ -39,7 +39,7 @@ PARAMETERS ********** -\ *name*\ is the name of the monitoring plug-in module. For example, if the the \ *name*\ is called \ *xxx*\ , then the actual file name that the xcatd looks for is \ */opt/xcat/lib/perl/xCAT_monitoring/xxx.pm*\ . Use \ **monls -a**\ command to list all the monitoring plug-in modules that can be used. +\ *name*\ is the name of the monitoring plug-in module. For example, if the \ *name*\ is called \ *xxx*\ , then the actual file name that the xcatd looks for is \ */opt/xcat/lib/perl/xCAT_monitoring/xxx.pm*\ . Use \ **monls -a**\ command to list all the monitoring plug-in modules that can be used. \ *noderange*\ is the nodes to be monitored. If omitted, all nodes will be monitored. diff --git a/docs/source/guides/admin-guides/references/man1/nimnodecust.1.rst b/docs/source/guides/admin-guides/references/man1/nimnodecust.1.rst index 8a82dad79..1fd244764 100644 --- a/docs/source/guides/admin-guides/references/man1/nimnodecust.1.rst +++ b/docs/source/guides/admin-guides/references/man1/nimnodecust.1.rst @@ -57,9 +57,9 @@ To create a NIM installp_bundle definition you can use the "nim -o define" opera nim -o define -t installp_bundle -a server=master -a location=/install/nim/mypkgs.bnd mypackages -See the AIX documantation for more information on using installp_bundle files. +See the AIX documentation for more information on using installp_bundle files. -The xCAT nimnodecust command will automatically handle the distribution of the packages to AIX service nodes when using an xCAT hierachical environment. +The xCAT nimnodecust command will automatically handle the distribution of the packages to AIX service nodes when using an xCAT hierarchical environment. ******* diff --git a/docs/source/guides/admin-guides/references/man1/nimnodeset.1.rst b/docs/source/guides/admin-guides/references/man1/nimnodeset.1.rst index 8c03d0fd7..5f3511342 100644 --- a/docs/source/guides/admin-guides/references/man1/nimnodeset.1.rst +++ b/docs/source/guides/admin-guides/references/man1/nimnodeset.1.rst @@ -33,7 +33,7 @@ This xCAT command can be used to initialize AIX/NIM standalone machines. Once th If you are using xCAT service nodes the \ **nimnodeset**\ command will automatically determine the correct server(s) for the node and do the initialization on that server(s). -The osimage_name is the name of an xCAT osimage definition that contains the list of NIM resources to use when initializing the nodes. If the osimage_name is not provided on the command line the code checks the node definition for the value of the "provmethod" attribute (which is the name of an osimage definition). If the osimage_image is provided on the command line then the code will also set the "provmethod" attribute of the node definiions. +The osimage_name is the name of an xCAT osimage definition that contains the list of NIM resources to use when initializing the nodes. If the osimage_name is not provided on the command line the code checks the node definition for the value of the "provmethod" attribute (which is the name of an osimage definition). If the osimage_image is provided on the command line then the code will also set the "provmethod" attribute of the node definitions. This command will also create a NIM resolv_conf resource to be used when installing the node. If a resolv_conf resource is not already included in the xCAT osimage definition and if the "domain" and "nameservers" values are set then a new NIM resolv_conf resource will be created and allocated to the nodes. @@ -41,7 +41,7 @@ NIM resolv_conf resource will be created and allocated to the nodes. The "domain" and "nameservers" attributes can be set in either the xCAT "network" definition used by the nodes or in the xCAT cluster "site" definition. The setting in the "network" definition will take priority. The "search" field of the resolv.conf file will contain a list all the domains -listed in the xCAT network definitions and the xCAT site definiton. +listed in the xCAT network definitions and the xCAT site definition. The "nameservers" value can either be set to a specific IP address or the "" key word. The "" key word means that the value of the "xcatmaster" attribute of the node definition will be used in the /etc/resolv.conf file. (I.e. The name of the install server as known by the node.) @@ -58,13 +58,13 @@ will be created. You can specify additional attributes and values using the "attr=val" command line option. This information will be passed on to the underlying call to the NIM "nim -o bos_inst" command. See the NIM documentation for information on valid command line options for the nim command. The "attr" must correspond to a NIM attribute supported for the NIM "bos_inst" operation. Information provided by the "attr=val" option will take precedence over the information provided in the osimage definition. -The force option can be used to reinitialize a node if it already has resources allocated or it is in the wrong NIM state. This option will reset the NIM node and deallocate resources before reinititializing. +The force option can be used to reinitialize a node if it already has resources allocated or it is in the wrong NIM state. This option will reset the NIM node and deallocate resources before reinitializing. This command will also create a NIM script resource to enable the xCAT support for user-provided customization scripts. After the \ **nimnodeset**\ command completes you can use the \ **lsnim**\ command to check the NIM node definition to see if it is ready for booting the node. ("lsnim -l "). -You can supply your own scripts to be run on the management node or on the service node (if their is hierarchy) for a node during the \ **nimnodeset**\ command. Such scripts are called \ **prescripts**\ . They should be copied to /install/prescripts dirctory. A table called \ *prescripts*\ is used to specify the scripts and their associated actions. The scripts to be run at the beginning of the \ **nimnodeset**\ command are stored in the 'begin' column of \ *prescripts*\ table. The scripts to be run at the end of the \ **nimnodeset**\ command are stored in the 'end' column of \ *prescripts*\ table. Run 'tabdump prescripts -d' command for details. An example for the 'begin' or the 'end' column is: \ *standalone:myscript1,myscript2*\ . The following two environment variables will be passed to each script: NODES contains all the names of the nodes that need to run the script for and ACTION contains the current nodeset action, in this case "standalone". If \ *#xCAT setting:MAX_INSTANCE=number*\ is specified in the script, the script will get invoked for each node in parallel, but no more than \ *number*\ of instances will be invoked at at a time. If it is not specified, the script will be invoked once for all the nodes. +You can supply your own scripts to be run on the management node or on the service node (if their is hierarchy) for a node during the \ **nimnodeset**\ command. Such scripts are called \ **prescripts**\ . They should be copied to /install/prescripts directory. A table called \ *prescripts*\ is used to specify the scripts and their associated actions. The scripts to be run at the beginning of the \ **nimnodeset**\ command are stored in the 'begin' column of \ *prescripts*\ table. The scripts to be run at the end of the \ **nimnodeset**\ command are stored in the 'end' column of \ *prescripts*\ table. Run 'tabdump prescripts -d' command for details. An example for the 'begin' or the 'end' column is: \ *standalone:myscript1,myscript2*\ . The following two environment variables will be passed to each script: NODES contains all the names of the nodes that need to run the script for and ACTION contains the current nodeset action, in this case "standalone". If \ *#xCAT setting:MAX_INSTANCE=number*\ is specified in the script, the script will get invoked for each node in parallel, but no more than \ *number*\ of instances will be invoked at at a time. If it is not specified, the script will be invoked once for all the nodes. ******* @@ -76,7 +76,7 @@ OPTIONS \ *attr=val [attr=val ...]*\ Specifies one or more "attribute equals value" pairs, separated by spaces. Attr= - val pairs must be specified last on the command line. These are used to specify additional values that can be passed to the underlying NIM commands, ("nim -o bos_inst ..."). See the NIM documentation for valid "nim" command line options. Note that you may specify multiple "script" and "installp_bundle" values by using a comma seperated list. (ex. "script=ascript,bscript"). + val pairs must be specified last on the command line. These are used to specify additional values that can be passed to the underlying NIM commands, ("nim -o bos_inst ..."). See the NIM documentation for valid "nim" command line options. Note that you may specify multiple "script" and "installp_bundle" values by using a comma separated list. (ex. "script=ascript,bscript"). @@ -106,8 +106,7 @@ OPTIONS \ **-l|-**\ **-location**\ - The directory location to use when creating new NIM resolv_conf resources. The d - efault location is /install/nim. + The directory location to use when creating new NIM resolv_conf resources. The default location is /install/nim. diff --git a/docs/source/guides/admin-guides/references/man1/nodeaddunmged.1.rst b/docs/source/guides/admin-guides/references/man1/nodeaddunmged.1.rst index 2a7cd8d10..2ce52c742 100644 --- a/docs/source/guides/admin-guides/references/man1/nodeaddunmged.1.rst +++ b/docs/source/guides/admin-guides/references/man1/nodeaddunmged.1.rst @@ -61,7 +61,7 @@ RETURN VALUE 0 The command completed successfully. -1 An error has occured. +1 An error has occurred. ******** diff --git a/docs/source/guides/admin-guides/references/man1/nodechmac.1.rst b/docs/source/guides/admin-guides/references/man1/nodechmac.1.rst index d293bcaea..84a1dce0c 100644 --- a/docs/source/guides/admin-guides/references/man1/nodechmac.1.rst +++ b/docs/source/guides/admin-guides/references/man1/nodechmac.1.rst @@ -63,7 +63,7 @@ RETURN VALUE 0 The command completed successfully. -1 An error has occured. +1 An error has occurred. ******** diff --git a/docs/source/guides/admin-guides/references/man1/nodechprofile.1.rst b/docs/source/guides/admin-guides/references/man1/nodechprofile.1.rst index 1d02e020a..be6b5300e 100644 --- a/docs/source/guides/admin-guides/references/man1/nodechprofile.1.rst +++ b/docs/source/guides/admin-guides/references/man1/nodechprofile.1.rst @@ -79,7 +79,7 @@ RETURN VALUE 0 The command completed successfully. -1 An error has occured. +1 An error has occurred. ******** diff --git a/docs/source/guides/admin-guides/references/man1/nodediscoverls.1.rst b/docs/source/guides/admin-guides/references/man1/nodediscoverls.1.rst index b791d5180..8d1458b64 100644 --- a/docs/source/guides/admin-guides/references/man1/nodediscoverls.1.rst +++ b/docs/source/guides/admin-guides/references/man1/nodediscoverls.1.rst @@ -114,7 +114,7 @@ RETURN VALUE 0 The command completed successfully. -1 An error has occured. +1 An error has occurred. ******** diff --git a/docs/source/guides/admin-guides/references/man1/nodediscoverstart.1.rst b/docs/source/guides/admin-guides/references/man1/nodediscoverstart.1.rst index 35e01991d..2171f8da9 100644 --- a/docs/source/guides/admin-guides/references/man1/nodediscoverstart.1.rst +++ b/docs/source/guides/admin-guides/references/man1/nodediscoverstart.1.rst @@ -59,7 +59,7 @@ When the nodes are discovered, PCM updates the affected configuration files on t When you power on the nodes, they PXE boot and DHCP/TFTP/HTTP on the management node give each node the xCAT genesis boot image, which inventories the node hardware and sends data to the management node. There, either the sequential discovery process or the -profile discovery process assigns node attributes and defines the node in the the database. +profile discovery process assigns node attributes and defines the node in the database. ******* @@ -127,7 +127,7 @@ OPTIONS -\ **chasiss=**\ \ *chassis-name*\ +\ **chassis=**\ \ *chassis-name*\ Sets the chassis name that the Blade server or PureFlex blade is located in, for either the Sequential Discovery or Profile Discovery methods. This option is used for the Blade server and PureFlex system only. You cannot specify this option with the rack option. @@ -196,7 +196,7 @@ RETURN VALUE 0 The command completed successfully. -1 An error has occured. +1 An error has occurred. ******** diff --git a/docs/source/guides/admin-guides/references/man1/nodediscoverstatus.1.rst b/docs/source/guides/admin-guides/references/man1/nodediscoverstatus.1.rst index 279166e08..182800616 100644 --- a/docs/source/guides/admin-guides/references/man1/nodediscoverstatus.1.rst +++ b/docs/source/guides/admin-guides/references/man1/nodediscoverstatus.1.rst @@ -52,7 +52,7 @@ RETURN VALUE 0 The command completed successfully. -1 An error has occured. +1 An error has occurred. ******** diff --git a/docs/source/guides/admin-guides/references/man1/nodediscoverstop.1.rst b/docs/source/guides/admin-guides/references/man1/nodediscoverstop.1.rst index 92e5ce339..f95b1b43f 100644 --- a/docs/source/guides/admin-guides/references/man1/nodediscoverstop.1.rst +++ b/docs/source/guides/admin-guides/references/man1/nodediscoverstop.1.rst @@ -53,7 +53,7 @@ RETURN VALUE 0 The command completed successfully. -1 An error has occured. +1 An error has occurred. ******** diff --git a/docs/source/guides/admin-guides/references/man1/nodeimport.1.rst b/docs/source/guides/admin-guides/references/man1/nodeimport.1.rst index 27341b4e8..ccd2a8ab9 100644 --- a/docs/source/guides/admin-guides/references/man1/nodeimport.1.rst +++ b/docs/source/guides/admin-guides/references/man1/nodeimport.1.rst @@ -29,7 +29,7 @@ DESCRIPTION *********** -The \ **nodeimport**\ command creates nodes by importing a hostinfo file which is following stanza format. In this hostinfo file, we can define node's hostname, ip, mac, switch name, switch port and host location infomation like rack, chassis, start unit, server height...etc +The \ **nodeimport**\ command creates nodes by importing a hostinfo file which is following stanza format. In this hostinfo file, we can define node's hostname, ip, mac, switch name, switch port and host location information like rack, chassis, start unit, server height...etc After nodes imported, the configuration files related with these nodes will be updated automatically. For example: /etc/hosts, dns configuration, dhcp configuration. And the kits node plugins will also be triggered automatically to update kit related configuration/services. @@ -83,9 +83,9 @@ RETURN VALUE 0 The command completed successfully. -1 An error has occured while validating parameters. +1 An error has occurred while validating parameters. -2 An error has occured while parsing hostinfo file. +2 An error has occurred while parsing hostinfo file. ******** @@ -143,7 +143,7 @@ To import nodes using a profile, follow the following steps: # hostinfo end. - Another example of a node infomation file, a PureFlex X/P node defined: + Another example of a node information file, a PureFlex X/P node defined: # hostinfo begin # To define a PureFlex P/X node, chassis and slot id must be specified. # The chassis must be a PureFlex chassis. @@ -191,7 +191,7 @@ Description: The name of the node, where __hostname__ is automatically generated \ **mac= This is a mandatory item. -Description: Specify the MAC address for the NIC used by the provisionging node, where is the NICs MAC address. +Description: Specify the MAC address for the NIC used by the provisioning node, where is the NICs MAC address. \ **switches= This is a mandatory item, when define switch, switchport and node nic name relationship. @@ -221,9 +221,9 @@ Description: Lists the IP address for each network interface configuration (NIC) Description: node location info. Specify the rack name which this node will be placed into. If not specify this item, there will be no node location info set for this node. this item must be specified together with height + unit. -\ **chasiss= This is an optional item. +\ **chassis= This is an optional item. -Description: node location info, for blade(or PureFlex) only. Specify the chasiss name which this blade will be placed into. this item can not be specified together with rack. +Description: node location info, for blade(or PureFlex) only. Specify the chassis name which this blade will be placed into. this item can not be specified together with rack. \ **height= This is an optional item. diff --git a/docs/source/guides/admin-guides/references/man1/nodels.1.rst b/docs/source/guides/admin-guides/references/man1/nodels.1.rst index 692331e73..395c72848 100644 --- a/docs/source/guides/admin-guides/references/man1/nodels.1.rst +++ b/docs/source/guides/admin-guides/references/man1/nodels.1.rst @@ -109,7 +109,7 @@ OPTIONS \ **-b|-**\ **-blame**\ - For values inherited from groups, display which groups provided the inheritence + For values inherited from groups, display which groups provided the inheritance diff --git a/docs/source/guides/admin-guides/references/man1/nodepurge.1.rst b/docs/source/guides/admin-guides/references/man1/nodepurge.1.rst index c11871cdc..847eb6c7b 100644 --- a/docs/source/guides/admin-guides/references/man1/nodepurge.1.rst +++ b/docs/source/guides/admin-guides/references/man1/nodepurge.1.rst @@ -59,7 +59,7 @@ RETURN VALUE 0 The command completed successfully. -1 An error has occured. +1 An error has occurred. ******** diff --git a/docs/source/guides/admin-guides/references/man1/noderefresh.1.rst b/docs/source/guides/admin-guides/references/man1/noderefresh.1.rst index 5eabc41af..7f110d908 100644 --- a/docs/source/guides/admin-guides/references/man1/noderefresh.1.rst +++ b/docs/source/guides/admin-guides/references/man1/noderefresh.1.rst @@ -57,7 +57,7 @@ RETURN VALUE 0 The command completed successfully. -1 An error has occured. +1 An error has occurred. ******** diff --git a/docs/source/guides/admin-guides/references/man1/nodestat.1.rst b/docs/source/guides/admin-guides/references/man1/nodestat.1.rst index f51b0d015..8d3afd684 100644 --- a/docs/source/guides/admin-guides/references/man1/nodestat.1.rst +++ b/docs/source/guides/admin-guides/references/man1/nodestat.1.rst @@ -63,7 +63,7 @@ Keywords to use: port -- the application daemon port number, if not specified, use internal list, then /etc/services. group -- the name of a node group that needs to get the application status from. If not specified, assume all the nodes in the nodelist table. To specify more than one groups, use group=a,group=b format. cmd -- the command that will be run locally on mn or sn. - lcmd -- the command that will be run the the mn only. + lcmd -- the command that will be run the mn only. dcmd -- the command that will be run distributed on the nodes using xdsh .... @@ -94,7 +94,7 @@ For the command specified by 'dcmd', no input is needed, the output can be a str \ **-m | -**\ **-usemon**\ - Uses the settings from the \ **monsetting**\ talbe to determine a list of applications that need to get status for. + Uses the settings from the \ **monsetting**\ table to determine a list of applications that need to get status for. diff --git a/docs/source/guides/admin-guides/references/man1/piflash.1.rst b/docs/source/guides/admin-guides/references/man1/piflash.1.rst new file mode 100644 index 000000000..1959a893e --- /dev/null +++ b/docs/source/guides/admin-guides/references/man1/piflash.1.rst @@ -0,0 +1,23 @@ + +######### +piflash.1 +######### + +.. highlight:: perl + + +******** +SYNOPSIS +******** + + +\ **piflash**\ -**\ **-package + + +*********** +DESCRIPTION +*********** + + +\ **piflash**\ Remotely applies firmware updates to servers. + 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 47b35ae06..087047ab6 100644 --- a/docs/source/guides/admin-guides/references/man1/rflash.1.rst +++ b/docs/source/guides/admin-guides/references/man1/rflash.1.rst @@ -73,7 +73,7 @@ PPC (with HMC) specific: ======================== -The \ **rflash**\ command uses the \ **xdsh**\ command to connect to the HMC controlling the given managed system and perform the updates. Before running \ **rflash**\ , use \ **rspconfig**\ to check if the related HMC ssh is enabled. To enable a HMC ssh connection, use \ **rspconfig**\ comamnd. +The \ **rflash**\ command uses the \ **xdsh**\ command to connect to the HMC controlling the given managed system and perform the updates. Before running \ **rflash**\ , use \ **rspconfig**\ to check if the related HMC ssh is enabled. To enable a HMC ssh connection, use \ **rspconfig**\ command. \ **Warning!**\ This command may take considerable time to complete, depending on the number of systems being updated and the workload on the target HMC. In particular, power subsystem updates may take an hour or more if there are many attached managed systems. @@ -83,7 +83,7 @@ The flash chip of a POWER5 and POWER6 managed system or power subsystem stores f The \ **-**\ **-commit**\ flag is used to write the contents of the temporary side of the flash to the permanent side. This flag should be used after updating code and verifying correct system operation. The \ **-**\ **-recover**\ flag is used to write the permanent side of the flash chip back to the temporary side. This flag should be used to recover from a corrupt flash operation, so that the previously running code can be restored. -\ **NOTE:**\ When the \ **-**\ **-commit**\ or \ **-**\ **-recover**\ two flags is used, the noderange \ **cannot**\ be BPA. It only \ **can**\ be CEC or LPAR ,and will take effect for \ **both**\ managed systems and power subsystems. +\ **NOTE:**\ When the \ **-**\ **-commit**\ or \ **-**\ **-recover**\ two flags is used, the noderange \ **cannot**\ be BPA. It only \ **can**\ be CEC or LPAR, and will take effect for \ **both**\ managed systems and power subsystems. xCAT recommends that you shutdown your Operating System images and power off your managed systems before applying disruptive updates to managed systems or power subsystems. @@ -104,7 +104,7 @@ The \ **deferred**\ option will load the new firmware into the T (temp) side, b In Direct FSP/BPA Management, there is \ **-d**\ \ *data_directory*\ option. The default value is /tmp. When doing firmware update, \ **rflash**\ will put some related data from rpm packages in directory, so the execution of \ **rflash**\ will require available disk space in for the command to properly execute: -For one GFW rpm package and one power code rpm package , if the GFW rpm package size is gfw_rpmsize, and the Power code rpm package size is power_rpmsize, it requires that the available disk space should be more than: 1.5\*gfw_rpmsize + 1.5\*power_rpmsize +For one GFW rpm package and one power code rpm package, if the GFW rpm package size is gfw_rpmsize, and the Power code rpm package size is power_rpmsize, it requires that the available disk space should be more than: 1.5\*gfw_rpmsize + 1.5\*power_rpmsize For Power 775, the \ **rflash**\ command takes effect on the primary and secondary FSPs or BPAs almost in parallel. @@ -115,7 +115,7 @@ NeXtScale FPC specific: ======================= -The command will update firmware for NeXtScale FPC when given an FPC node and the http information needed to access the firmware. The http imformation required includes both the MN IP address as well as the directory containing the firmware. It is recommended that the firmware be downloaded and placed in the /install directory structure as the xCAT MN /install directory is configured with the correct permissions for http. Refer to the doc to get more details: XCAT_NeXtScale_Clusters +The command will update firmware for NeXtScale FPC when given an FPC node and the http information needed to access the firmware. The http information required includes both the MN IP address as well as the directory containing the firmware. It is recommended that the firmware be downloaded and placed in the /install directory structure as the xCAT MN /install directory is configured with the correct permissions for http. Refer to the doc to get more details: XCAT_NeXtScale_Clusters OpenPOWER specific: @@ -140,7 +140,7 @@ The command will update firmware for OpenPOWER BMC when given an OpenPOWER node \ **-c|-**\ **-check**\ - Chech the firmware version of BMC and HPM file. + Check the firmware version of BMC and HPM file. @@ -209,7 +209,7 @@ The command will update firmware for OpenPOWER BMC when given an OpenPOWER node -1. To update only the power subsystem attached to a single HMC-attached pSeries CEC(cec_name), and recycle the power subsystem and all attached managed systems when the update is complete, and the Microcode update package and associated XML file are in /tmp/fw, enter: +1. To update only the power subsystem attached to a single HMC-attached pSeries CEC(cec_name), and recycle the power subsystem and all attached managed systems when the update is complete, and the Microcode update package and associated XML file are in /tmp/fw, enter: .. code-block:: perl @@ -219,7 +219,7 @@ The command will update firmware for OpenPOWER BMC when given an OpenPOWER node -2. To update only the power subsystem attached to a single HMC-attached pSeries node, and recycle the power subsystem and all attached managed systems when the update is complete, and the Microcode update package and associated XML file are in /tmp/fw, enter: +2. To update only the power subsystem attached to a single HMC-attached pSeries node, and recycle the power subsystem and all attached managed systems when the update is complete, and the Microcode update package and associated XML file are in /tmp/fw, enter: .. code-block:: perl @@ -239,7 +239,7 @@ The command will update firmware for OpenPOWER BMC when given an OpenPOWER node -4. To update the firmware on a NeXtScale FPC specify the FPC node name and the HTTP location of the file including the xCAT MN IP address and the directory on the xCAT MN containing the firmware as follows: +4. To update the firmware on a NeXtScale FPC specify the FPC node name and the HTTP location of the file including the xCAT MN IP address and the directory on the xCAT MN containing the firmware as follows: .. code-block:: perl diff --git a/docs/source/guides/admin-guides/references/man1/rinv.1.rst b/docs/source/guides/admin-guides/references/man1/rinv.1.rst index df454d284..c554e702f 100644 --- a/docs/source/guides/admin-guides/references/man1/rinv.1.rst +++ b/docs/source/guides/admin-guides/references/man1/rinv.1.rst @@ -114,10 +114,10 @@ zVM specific: ******************* -\ **rinv**\ retrieves hardware configuration information from the on-board +\ **rinv**\ retrieves hardware configuration information from the on-board Service Processor for a single or range of nodes and groups. -Calling \ **rinv**\ for VMware will display the UUID/GUID, nuumber of CPUs, amount of memory, the MAC address and a list of Hard disks. The output for each Hard disk includes the label, size and backing file location. +Calling \ **rinv**\ for VMware will display the UUID/GUID, number of CPUs, amount of memory, the MAC address and a list of Hard disks. The output for each Hard disk includes the label, size and backing file location. *************** @@ -140,7 +140,7 @@ Calling \ **rinv**\ for VMware will display the UUID/GUID, nuumber of CPUs, amo \ **config**\ - Retrieves number of processors, speed, total memory, and DIMM + Retrieves number of processors, speed, total memory, and DIMM locations. diff --git a/docs/source/guides/admin-guides/references/man1/rmdocker.1.rst b/docs/source/guides/admin-guides/references/man1/rmdocker.1.rst index 33db44ce4..db021f2a9 100644 --- a/docs/source/guides/admin-guides/references/man1/rmdocker.1.rst +++ b/docs/source/guides/admin-guides/references/man1/rmdocker.1.rst @@ -48,7 +48,7 @@ EXAMPLES .. code-block:: perl rmdocker host01c01 - host01c01: Disconnect customzied network 'mynet0' done + host01c01: Disconnect customized network 'mynet0' done host01c01: success diff --git a/docs/source/guides/admin-guides/references/man1/rmdsklsnode.1.rst b/docs/source/guides/admin-guides/references/man1/rmdsklsnode.1.rst index 1ad0c3b3e..b9dd2625d 100644 --- a/docs/source/guides/admin-guides/references/man1/rmdsklsnode.1.rst +++ b/docs/source/guides/admin-guides/references/man1/rmdsklsnode.1.rst @@ -39,11 +39,11 @@ If the node you are trying to remove is currently running the \ **rmdsklsnode**\ \ **Removing alternate NIM client definitions**\ -If you used the "-n" option when you created the NIM client definitions with the \ **mkdsklsnode**\ command then the NIM client machine names would be a combination of the xCAT node name and the osimage name used to initialize the NIM machine. To remove these definitions you must provide the name of the osimage that was used using the "-i" option. +If you used the "-n" option when you created the NIM client definitions with the \ **mkdsklsnode**\ command then the NIM client machine names would be a combination of the xCAT node name and the osimage name used to initialize the NIM machine. To remove these definitions, you must provide the name of the osimage that was used using the "-i" option. -In most cases you would most likely want to remove the old client definitions without disturbing the nodes that you just booted with the new alternate client definition. The \ **rmdsklsnode -r**\ option can be used to remove the old alternate client defintions without stopping the running node. +In most cases you would most likely want to remove the old client definitions without disturbing the nodes that you just booted with the new alternate client definition. The \ **rmdsklsnode -r**\ option can be used to remove the old alternate client definitions without stopping the running node. -However, if you have NIM dump resources assign to your nodes be aware that when the old NIM alternate client definitions are removed it will leave the nodes unable to produce a system dump. This is a current limitation in the NIM support for alternate client definitions. For this reason it is recommended that you wait to do this cleanup until right before you do your next upgrade. +However, if you have NIM dump resources assign to your nodes be aware that when the old NIM alternate client definitions are removed it will leave the nodes unable to produce a system dump. This is a current limitation in the NIM support for alternate client definitions. For this reason, it is recommended that you wait to do this cleanup until right before you do your next upgrade. ******* @@ -60,8 +60,7 @@ OPTIONS \ **-b |-**\ **-backupSN**\ - When using backup service nodes only update the backup. The default is to updat - e both the primary and backup service nodes. + When using backup service nodes only update the backup. The default is to update both the primary and backup service nodes. @@ -85,8 +84,7 @@ OPTIONS \ **-p|-**\ **-primarySN**\ - When using backup service nodes only update the primary. The default is to upda - te both the primary and backup service nodes. + When using backup service nodes only update the primary. The default is to update both the primary and backup service nodes. diff --git a/docs/source/guides/admin-guides/references/man1/rmhwconn.1.rst b/docs/source/guides/admin-guides/references/man1/rmhwconn.1.rst index 1edd0ad07..225bb4627 100644 --- a/docs/source/guides/admin-guides/references/man1/rmhwconn.1.rst +++ b/docs/source/guides/admin-guides/references/man1/rmhwconn.1.rst @@ -52,7 +52,7 @@ DESCRIPTION For PPC (with HMC) specific: -This command is used to disconnect CEC and Frame nodes from HMC nodes, according to the connection information defined in ppc talbe in xCAT DB. +This command is used to disconnect CEC and Frame nodes from HMC nodes, according to the connection information defined in ppc table in xCAT DB. Note: If a CEC belongs to a frame with a BPA installed, this CEC cannot be disconnected individually. Instead, the whole frame should be disconnected. diff --git a/docs/source/guides/admin-guides/references/man1/rmigrate.1.rst b/docs/source/guides/admin-guides/references/man1/rmigrate.1.rst index d6b67dfcb..c76a6584e 100644 --- a/docs/source/guides/admin-guides/references/man1/rmigrate.1.rst +++ b/docs/source/guides/admin-guides/references/man1/rmigrate.1.rst @@ -88,7 +88,7 @@ zVM specific: \ **vm**\ table - -Table governing VM paramaters. See vm(5)|vm.5 for further details. +Table governing VM parameters. See vm(5)|vm.5 for further details. This is used to determine the current host to migrate from. diff --git a/docs/source/guides/admin-guides/references/man1/rmkitcomp.1.rst b/docs/source/guides/admin-guides/references/man1/rmkitcomp.1.rst index 675774440..183372691 100644 --- a/docs/source/guides/admin-guides/references/man1/rmkitcomp.1.rst +++ b/docs/source/guides/admin-guides/references/man1/rmkitcomp.1.rst @@ -29,7 +29,7 @@ DESCRIPTION *********** -The \ **rmkitcomp**\ command removes kit components from an xCAT osimage. All the kit component attribute values that are contained in the osimage will be removed, and the kit comoponent meta rpm and package rpm could be uninstalled by \ **-u|-**\ **-uninstall**\ option. +The \ **rmkitcomp**\ command removes kit components from an xCAT osimage. All the kit component attribute values that are contained in the osimage will be removed, and the kit component meta rpm and package rpm could be uninstalled by \ **-u|-**\ **-uninstall**\ option. Note: The xCAT support for Kits is only available for Linux operating systems. diff --git a/docs/source/guides/admin-guides/references/man1/rmvm.1.rst b/docs/source/guides/admin-guides/references/man1/rmvm.1.rst index f3fc52f98..39a083ec7 100644 --- a/docs/source/guides/admin-guides/references/man1/rmvm.1.rst +++ b/docs/source/guides/admin-guides/references/man1/rmvm.1.rst @@ -65,7 +65,7 @@ OPTIONS \ **-**\ **-service**\ Remove the service partitions of the specified CECs. -\ **-p**\ KVM: Purge the existence of the VM from persistant storage. This will erase all storage related to the VM in addition to removing it from the active virtualization configuration. PPC: Remove the specified partiton on normal power machine. +\ **-p**\ KVM: Purge the existence of the VM from persistent storage. This will erase all storage related to the VM in addition to removing it from the active virtualization configuration. PPC: Remove the specified partition on normal power machine. \ **-f**\ Force remove the VM, even if the VM appears to be online. This will bring down a live VM if requested. diff --git a/docs/source/guides/admin-guides/references/man1/rnetboot.1.rst b/docs/source/guides/admin-guides/references/man1/rnetboot.1.rst index 90cc2f5fe..866e10306 100644 --- a/docs/source/guides/admin-guides/references/man1/rnetboot.1.rst +++ b/docs/source/guides/admin-guides/references/man1/rnetboot.1.rst @@ -66,11 +66,11 @@ Note: if the "val" fields includes spaces or any other characters that will be p \ **-r**\ -specify the number of retries that the monitoring process will perform before declare the failure. The default value is 3. Setting the retrycount to 0 means only monitoring the os installation progress and will not re-initiate the installation if the node status has not been changed to the expected value after timeout. This flag must be used with -m flag. +specify the number of retries that the monitoring process will perform before declaring the failure. The default value is 3. Setting the retrycount to 0 means only monitoring the os installation progress and will not re-initiate the installation if the node status has not been changed to the expected value after timeout. This flag must be used with -m flag. \ **-t**\ -Specify the the timeout, in minutes, to wait for the expectedstatus specified by -m flag. This is a required flag if the -m flag is specified. +Specify the timeout, in minutes, to wait for the expectedstatus specified by -m flag. This is a required flag if the -m flag is specified. \ **-V|-**\ **-verbose**\ diff --git a/docs/source/guides/admin-guides/references/man1/rpower.1.rst b/docs/source/guides/admin-guides/references/man1/rpower.1.rst index eb9037303..414471bd5 100644 --- a/docs/source/guides/admin-guides/references/man1/rpower.1.rst +++ b/docs/source/guides/admin-guides/references/man1/rpower.1.rst @@ -181,7 +181,7 @@ OPTIONS \ **resetsp**\ - Reboot the service processor. If there are primary and secondary FSPs/BPAs of one cec/frame, it will reboot them almost at the sametime. + Reboot the service processor. If there are primary and secondary FSPs/BPAs of one cec/frame, it will reboot them almost at the same time. @@ -320,13 +320,13 @@ OPTIONS \ **-r**\ \ *retrycount*\ - specify the number of retries that the monitoring process will perform before declare the failure. The default value is 3. Setting the retrycount to 0 means only monitoring the os installation progress and will not re-initiate the installation if the node status has not been changed to the expected value after timeout. This flag must be used with -m flag. + specify the number of retries that the monitoring process will perform before declaring the failure. The default value is 3. Setting the retrycount to 0 means only monitoring the os installation progress and will not re-initiate the installation if the node status has not been changed to the expected value after timeout. This flag must be used with -m flag. \ **-t**\ \ *timeout*\ - Specify the the timeout, in minutes, to wait for the expectedstatus specified by -m flag. This is a required flag if the -m flag is specified. + Specify the timeout, in minutes, to wait for the expectedstatus specified by -m flag. This is a required flag if the -m flag is specified. Power off, then on. diff --git a/docs/source/guides/admin-guides/references/man1/rspconfig.1.rst b/docs/source/guides/admin-guides/references/man1/rspconfig.1.rst index 9660a425d..c2165234b 100644 --- a/docs/source/guides/admin-guides/references/man1/rspconfig.1.rst +++ b/docs/source/guides/admin-guides/references/man1/rspconfig.1.rst @@ -564,7 +564,7 @@ OPTIONS \ **USERID**\ ={\ *newpasswd*\ } \ **updateBMC**\ ={\ **y|n**\ } - Change the password of the userid \ **USERID**\ for CMM in Flex system cluster. The option \ *updateBMC*\ can be used to specify whether updating the password of BMCs that connected to the speified CMM. The value is 'y' by default which means whenever updating the password of CMM, the password of BMCs will be also updated. Note that there will be several seconds needed before this command complete. + Change the password of the userid \ **USERID**\ for CMM in Flex system cluster. The option \ *updateBMC*\ can be used to specify whether updating the password of BMCs that connected to the specified CMM. The value is 'y' by default which means whenever updating the password of CMM, the password of BMCs will be also updated. Note that there will be several seconds needed before this command complete. If value "\*" is specified for USERID and the object node is \ *Flex System X node*\ , the password used to access the BMC of the System X node through IPMI will be updated as the same password of the userid \ **USERID**\ of the CMM in the same cluster. diff --git a/docs/source/guides/admin-guides/references/man1/sinv.1.rst b/docs/source/guides/admin-guides/references/man1/sinv.1.rst index f1274c9d6..89bf04d4e 100644 --- a/docs/source/guides/admin-guides/references/man1/sinv.1.rst +++ b/docs/source/guides/admin-guides/references/man1/sinv.1.rst @@ -116,7 +116,7 @@ Command Protocol can be used. See man \ **xdsh**\ for more details. then a new template will be created from the node output. This will result in having all nodes that match a given template reported in their group at the end of the run in the output file. - If no template count is specified, 0 is the default, and all nodes will + If no template count is specified, 0 is the default, and all nodes will be compared against the first template. @@ -127,7 +127,7 @@ Command Protocol can be used. See man \ **xdsh**\ for more details. that is stored in template path. You can use this parameter instead of running the command yourself to build the template. - \ **Note:**\ If the template path file does not exists, and no seed node is + \ **Note:**\ If the template path file does not exist, and no seed node is supplied, the seed node automatically is one node in the noderange. @@ -152,7 +152,7 @@ Command Protocol can be used. See man \ **xdsh**\ for more details. there can exist more lines in the xdsh return from the nodes. For example, if running a "rpm -qa | grep xCAT" command, without exactmatch - set, if the node containes more xCAT rpms that listed in the template, + set, if the node contains more xCAT rpms that listed in the template, it would be considered a match, as long as all rpms listed in the template were on the node. With exactmatch set, the output must be identical to the template. @@ -165,7 +165,7 @@ Command Protocol can be used. See man \ **xdsh**\ for more details. of relevant device configuration file. The devicetype value must correspond to a valid device configuration file. xCAT ships some default configuration files - for Ethernet switches and and IB switches under + for Ethernet switches and IB switches under \ */opt/xcat/share/xcat/devicetype*\ directory. If you want to overwrite any of the configuration files, copy them to \ */var/opt/xcat/*\ directory and cutomize. diff --git a/docs/source/guides/admin-guides/references/man1/snmove.1.rst b/docs/source/guides/admin-guides/references/man1/snmove.1.rst index 80c0fd598..453e64c94 100644 --- a/docs/source/guides/admin-guides/references/man1/snmove.1.rst +++ b/docs/source/guides/admin-guides/references/man1/snmove.1.rst @@ -59,7 +59,7 @@ node is second. The \ **xcatmaster**\ attribute must be set to the hostname of the primary service node as it is known by the node. When the \ **snmove**\ command is run it modifies the xCAT database to -switch the the primary server to the backup server. +switch the primary server to the backup server. It will also check the other services that are being used for the node (tftpserver, monserver, nfsserver, conserver), and if they were set @@ -114,13 +114,13 @@ OPTIONS \ **-l|-**\ **-liteonly**\ - Use this option to ONLY synchronize any AIX statelite files from the primary server to the backup server for the nodes. It will not do the actual moving of thre nodes the the backup servers. + Use this option to ONLY synchronize any AIX statelite files from the primary server to the backup server for the nodes. It will not do the actual moving of the nodes to the backup servers. \ **-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. + Specifies a list of extra postscripts to be run on the nodes after the nodes are moved over to the new service 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. diff --git a/docs/source/guides/admin-guides/references/man1/swapnodes.1.rst b/docs/source/guides/admin-guides/references/man1/swapnodes.1.rst index 55c8b6f4e..158c5f4cf 100644 --- a/docs/source/guides/admin-guides/references/man1/swapnodes.1.rst +++ b/docs/source/guides/admin-guides/references/man1/swapnodes.1.rst @@ -44,7 +44,7 @@ The \ **swapnodes**\ command shouldn't make the decision of which 2 nodes are s After running \ **swapnodes**\ command, the order of the I/O devices may be changed after IO re-assignment, so the administrator needs to run \ **rbootseq**\ to set the boot string for the current_node. And then boot the node with the same image and same postscripts because they have the same attributes. -Without \ **-o**\ option, it's used to swap the location info in the db between 2 nodes. With \ **-o**\ option, it's used to move the \ *current_node*\ definition to \ *fip_node*\ (the 2nd octant), not move the \ *fip_node*\ definition to the 1st octant. If the two nodes are in a cec, it will assign the IO adapters that were assigned to the defective node to the available node. Originally, the \ *current_node*\ is a defective non-compute node, and \ *fip_node*\ is a avaible compute node. After the swapping, the \ *current_node*\ will be a available node. +Without \ **-o**\ option, it's used to swap the location info in the db between 2 nodes. With \ **-o**\ option, it's used to move the \ *current_node*\ definition to \ *fip_node*\ (the 2nd octant), not move the \ *fip_node*\ definition to the 1st octant. If the two nodes are in a cec, it will assign the IO adapters that were assigned to the defective node to the available node. Originally, the \ *current_node*\ is a defective non-compute node, and \ *fip_node*\ is a available compute node. After the swapping, the \ *current_node*\ will be a available node. ******* @@ -94,7 +94,7 @@ EXAMPLES -1. To swap the service node attributes and IO assignments between sn1 and compute2 which are in the same cec, all the attributes in the ppc table and nodepos talbe of the two node will be swapped, and the the I/O adapters from the defective node (the original sn1) will be assigned to the available node (the original compute2). After the swapping, the sn1 will use the compute2's hardware resource and the I/O adapters from the original sn1. +1. To swap the service node attributes and IO assignments between sn1 and compute2 which are in the same cec, all the attributes in the ppc table and nodepos table of the two node will be swapped, and the I/O adapters from the defective node (the original sn1) will be assigned to the available node (the original compute2). After the swapping, the sn1 will use the compute2's hardware resource and the I/O adapters from the original sn1. .. code-block:: perl @@ -104,7 +104,7 @@ EXAMPLES -2. To swap the service node attributes and IO assignments between sn1 and compute2 which are NOT in the same cec, all the attributes in the ppc table and nodepos talbe of the two node will be swapped. After the swapping, the sn1 will use the compute2's hardware resource. +2. To swap the service node attributes and IO assignments between sn1 and compute2 which are NOT in the same cec, all the attributes in the ppc table and nodepos table of the two node will be swapped. After the swapping, the sn1 will use the compute2's hardware resource. .. code-block:: perl diff --git a/docs/source/guides/admin-guides/references/man1/switchdiscover.1.rst b/docs/source/guides/admin-guides/references/man1/switchdiscover.1.rst index 1ba9aff9b..e84f3e74d 100644 --- a/docs/source/guides/admin-guides/references/man1/switchdiscover.1.rst +++ b/docs/source/guides/admin-guides/references/man1/switchdiscover.1.rst @@ -23,13 +23,13 @@ DESCRIPTION *********** -The switchdiscover command scans the subnets and discovers all the swithches on the subnets. The command takes a list of subnets as input. The default subnets are the ones that the xCAT management node is on. It uses nmap command as default to discover the switches. However, you can specify other discovery methods such as lldp or snmp with \ **-s**\ flag. You can write the discovered switches into xCAT database with \ **-w**\ flag. This command supports may output formats such as xml(\ **-x**\ ), raw(\ **-r**\ ) and stanza(\ **-z**\ ) in addition to the default format. +The switchdiscover command scans the subnets and discovers all the switches on the subnets. The command takes a list of subnets as input. The default subnets are the ones that the xCAT management node is on. It uses nmap command as default to discover the switches. However, you can specify other discovery methods such as lldp or snmp with \ **-s**\ flag. You can write the discovered switches into xCAT database with \ **-w**\ flag. This command supports may output formats such as xml(\ **-x**\ ), raw(\ **-r**\ ) and stanza(\ **-z**\ ) in addition to the default format. \ **-**\ **-setup**\ flag is for switch-based switch discovery. It will find all the discovered switches on the subnets, then match them with predefined switches in the xCATDB. Next, it will set discovered switches with static ip address and hostname based on the predefined switch. It will also enable snmpv3 configuration. The details of the process are defined in the http://xcat-docs.readthedocs.io/en/latest/advanced/networks/switchdiscover/switches_discovery.html. -To view all the switches defined in the xCAT databasee use \ **lsdef -w "nodetype=switch"**\ command. +To view all the switches defined in the xCAT database use \ **lsdef -w "nodetype=switch"**\ command. -For lldp method, make sure that lldpd package is installed and lldpd is running on the xCAT management node. lldpd comes from xcat-dep packge or you can get it from http://vincentbernat.github.io/lldpd/installation.html. +For lldp method, make sure that lldpd package is installed and lldpd is running on the xCAT management node. lldpd comes from xcat-dep package or you can get it from http://vincentbernat.github.io/lldpd/installation.html. For snmp method, make sure that snmpwalk command is installed and snmp is enabled for switches. To install snmpwalk, "yum install net-snmp-utils" for redhat and sles, "apt-get install snmp" for Ubuntu. @@ -102,13 +102,13 @@ OPTIONS \ **-x**\ - XML formated output. + XML formatted output. \ **-z**\ - Stanza formated output. + Stanza formatted output. diff --git a/docs/source/guides/admin-guides/references/man1/updatenode.1.rst b/docs/source/guides/admin-guides/references/man1/updatenode.1.rst index 55043ad8d..cd9a37448 100644 --- a/docs/source/guides/admin-guides/references/man1/updatenode.1.rst +++ b/docs/source/guides/admin-guides/references/man1/updatenode.1.rst @@ -325,7 +325,7 @@ PARAMETERS The scripts must be executable and copied to the /install/postscripts directory. Each script can take zero or more parameters. - If parameters are spcified, the whole list needs to be quoted by double quotes. + If parameters are specified, the whole list needs to be quoted by double quotes. For example: @@ -341,7 +341,7 @@ PARAMETERS Specifies one or more "attribute equals value" pairs, separated by spaces. Attr=val pairs must be specified last on the command line. The currently supported attributes are: "installp_bundle", "otherpkgs", "installp_flags", - "emgr_flags" and "rpm_flags". These attribute are only valid for AIX software + "emgr_flags" and "rpm_flags". These attributes are only valid for AIX software maintenance support. @@ -355,9 +355,7 @@ OPTIONS \ **-**\ **-fanout**\ =\ *fanout_value*\ - Specifies a fanout value for the maximum number of concur- - rently executing remote shell processes. Serial execution - can be specified by indicating a fanout value of \ **1**\ . If \ **-**\ **-fanout**\ is not specified, a default fanout value of \ **64**\ is used. + Specifies a fanout value for the maximum number of concurrently executing remote shell processes. Serial execution can be specified by indicating a fanout value of \ **1**\ . If \ **-**\ **-fanout**\ is not specified, a default fanout value of \ **64**\ is used. @@ -441,7 +439,7 @@ OPTIONS AIX and Linux and updating software (-S) for Linux only. The non-root userid must be previously defined as an xCAT user. The userid sudo setup will have to be done by the admin on the node. - This is not supported in a hiearchical cluster, that is the node is serviced by a service node. + This is not supported in a hierarchical cluster, that is the node is serviced by a service node. See the document Granting_Users_xCAT_privileges for required xcat/sudo setup. diff --git a/docs/source/guides/admin-guides/references/man1/xcat2nim.1.rst b/docs/source/guides/admin-guides/references/man1/xcat2nim.1.rst index e23510646..9069b27de 100644 --- a/docs/source/guides/admin-guides/references/man1/xcat2nim.1.rst +++ b/docs/source/guides/admin-guides/references/man1/xcat2nim.1.rst @@ -153,7 +153,7 @@ EXAMPLES xcat2nim -l -t node clstrn02 -7. To re-create a NIM machine definiton and display verbose output. +7. To re-create a NIM machine definition and display verbose output. .. code-block:: perl diff --git a/docs/source/overview/quick_start.rst b/docs/source/overview/quick_start.rst index 8bf22dfae..d26fc33b8 100644 --- a/docs/source/overview/quick_start.rst +++ b/docs/source/overview/quick_start.rst @@ -33,7 +33,7 @@ If xCAT looks suitable for your requirement, following steps are recommended pro Now you have the node definition. Verify the hardware control for defined nodes is working. e.g. ``rpower stat``. - Refer to the doc: :doc:`Hardware Management ` to learn how to perform the remote hardware control. + Refer to the doc: :doc:`Hardware Management <../guides/admin-guides/manage_clusters/ppc64le/management/index>` to learn how to perform the remote hardware control. #. Deploy OS on the target nodes diff --git a/xCAT-client/pods/man1/bmcdiscover.1.pod b/xCAT-client/pods/man1/bmcdiscover.1.pod index 3d4058f51..2e967fab5 100644 --- a/xCAT-client/pods/man1/bmcdiscover.1.pod +++ b/xCAT-client/pods/man1/bmcdiscover.1.pod @@ -17,7 +17,7 @@ B [B<-u> I] [B<-p> I] B<-i> I B<--ips =head1 DESCRIPTION -The B command will discover Baseboard Management Controllers (BMCs) using a scan mathod. +The B command will discover Baseboard Management Controllers (BMCs) using a scan method. The command uses B to scan active nodes over a specified IP range. The IP range format should be a format that is acceptable by B. @@ -31,7 +31,7 @@ Note: The scan method currently support is B. =item B<--range> -Specify one or more IP ranges acceptable to nmap. IP rance can be hostnames, IP addresses, networks, etc. A single IP address (10.1.2.3) or an IP range (10.1.2.0/24) can be specified. If the range is very large, the B command may take a long time to return. +Specify one or more IP ranges acceptable to nmap. IP range can be hostnames, IP addresses, networks, etc. A single IP address (10.1.2.3) or an IP range (10.1.2.0/24) can be specified. If the range is very large, the B command may take a long time to return. =item B<-s> diff --git a/xCAT-client/pods/man1/cfgve.1.pod b/xCAT-client/pods/man1/cfgve.1.pod index 93c8dbc60..e2df6268f 100644 --- a/xCAT-client/pods/man1/cfgve.1.pod +++ b/xCAT-client/pods/man1/cfgve.1.pod @@ -81,7 +81,7 @@ The NFS export directory must be configured for read write access and must be owned by vdsm:kvm. B: "/data/images/rhev" is set by default. -B - A host must be specified for a storage doamin as SPM +B - A host must be specified for a storage domain as SPM (Storage Pool Manager) when initialize the storage domain. The role of SPM may be migrated to other host by rhev-m during the running of the datacenter (For example, when the current SPM encountered issue or going to maintenance diff --git a/xCAT-client/pods/man1/chvm.1.pod b/xCAT-client/pods/man1/chvm.1.pod index 99ec573f7..f1ac27855 100644 --- a/xCAT-client/pods/man1/chvm.1.pod +++ b/xCAT-client/pods/man1/chvm.1.pod @@ -114,7 +114,7 @@ This command also supports to change specific partition attributes by specifying For Power 755(use option I<--p775> to specify): -chvm could be used to change the octant configuration values for generating LPARs. chvm is designed to set the Octant configure value to split the CPU and memory for partitions, and set Octant Memory interleaving value. The chvm will only set the pending attributes value. After chvm, the CEC needs to be rebooted manually for the pending values to be enabled. Before reboot the cec, the administrator can use chvm to change the partition plan. If the the partition needs I/O slots, the administrator should use chvm to assign the I/O slots. +chvm could be used to change the octant configuration values for generating LPARs. chvm is designed to set the Octant configure value to split the CPU and memory for partitions, and set Octant Memory interleaving value. The chvm will only set the pending attributes value. After chvm, the CEC needs to be rebooted manually for the pending values to be enabled. Before reboot the cec, the administrator can use chvm to change the partition plan. If the partition needs I/O slots, the administrator should use chvm to assign the I/O slots. chvm is also designed to assign the I/O slots to the new LPAR. Both the current IO owning lpar and the new IO owning lpar must be powered off before an IO assignment. Otherwise, if the I/O slot is belonged to an Lpar and the LPAR is power on, the command will return an error when trying to assign that slot to a different lpar. @@ -127,7 +127,7 @@ chvm could be used to modify the resources assigned to partitions. The admin sha =head2 zVM specific: -The chvm command modifes the virtual machine's configuration specified in noderange. +The chvm command modifies the virtual machine's configuration specified in noderange. =head1 OPTIONS @@ -248,7 +248,7 @@ Purge the Hard disk. Deregisters and deletes the files. Multiple can be done w =item B<--resize> I=I -Change the size of the Hard disk. The disk in I format can not be set to less than it's current size. The disk in I format can be resized smaller, use caution. Multiple disks can be resized by using comma separated IB<=>I pairs. The disks are specified by SCSI id. Size defaults to GB. +Change the size of the Hard disk. The disk in I format can not be set to less than its current size. The disk in I format can be resized smaller, use caution. Multiple disks can be resized by using comma separated IB<=>I pairs. The disks are specified by SCSI id. Size defaults to GB. =back diff --git a/xCAT-client/pods/man1/csm2xcat.1.pod b/xCAT-client/pods/man1/csm2xcat.1.pod index fc1f66411..dffc47c79 100644 --- a/xCAT-client/pods/man1/csm2xcat.1.pod +++ b/xCAT-client/pods/man1/csm2xcat.1.pod @@ -11,7 +11,7 @@ B [B<-h>] =head1 DESCRIPTION -The csm2xcat command must be run on the Management Server of the CSM system that you want to migrate to xCAT. The commmand will build two xCAT stanza files that can update the xCAT database with the chdef command. +The csm2xcat command must be run on the Management Server of the CSM system that you want to migrate to xCAT. The command will build two xCAT stanza files that can update the xCAT database with the chdef command. Copy the csm2xcat command to the CSM Management Server. Run the command, indicating where you want your stanza files saved with the B<--dir> parameter. Check the stanza files to see if the information is what you want put in the xCAT database. Copy the two stanza files: node.stanza, device.stanza back to your xCAT Management node, and run the chdef command to input into the xCAT database. diff --git a/xCAT-client/pods/man1/db2sqlsetup.1.pod b/xCAT-client/pods/man1/db2sqlsetup.1.pod index 4bf2768de..8d9e9f059 100644 --- a/xCAT-client/pods/man1/db2sqlsetup.1.pod +++ b/xCAT-client/pods/man1/db2sqlsetup.1.pod @@ -28,7 +28,7 @@ For full information on the setup of DB2, see Setting_Up_DB2_as_the_xCAT_DB. When running of db2sqlsetup on the MN: One password must be supplied for the setup, a password for the xcatdb unix id which will be used as the DB2 instance id and database name. The password will be prompted for interactively or can be input with the XCATDB2PW environment variable. -The script will create the xcat database instance (xcatdb) in the /var/lib/db2 directory unless overriden by setting the site.databaseloc attribute. This attribute should not be set to the directory that is defined in the installloc attribute and it is recommended that the databaseloc be a new filesystem dedicated to the DB2 database, especially in very large clusters. +The script will create the xcat database instance (xcatdb) in the /var/lib/db2 directory unless overridden by setting the site.databaseloc attribute. This attribute should not be set to the directory that is defined in the installloc attribute and it is recommended that the databaseloc be a new filesystem dedicated to the DB2 database, especially in very large clusters. When running db2sqlseutp on the SN: Not only will the password for the DB2 instance Id be prompted for and must match the one on the Management Node; but also the hostname or ip address of the Management Node as known by the Service Node must be supplied , unless the XCATDB2SERVER environment variable is set. diff --git a/xCAT-client/pods/man1/dumpxCATdb.1.pod b/xCAT-client/pods/man1/dumpxCATdb.1.pod index b9e155a08..fbdf7e392 100644 --- a/xCAT-client/pods/man1/dumpxCATdb.1.pod +++ b/xCAT-client/pods/man1/dumpxCATdb.1.pod @@ -17,7 +17,7 @@ If not using the binary dump option (-b), then the dumpxCATdb command creates .c Supports using XCAT_SKIPTABLES env variable to provide a list of skip tables. The command will never backup TEAL or ISNM tables, except isnm_config. To dump TEAL tables use the documented process for TEAL. For ISNM use tabdump, after using tabprune to get to prune unnecessary records. -If using the binary dump option for the DB2 or postgreSQL database, then the routine will use the Database provide utilites for backup of the entire database. +If using the binary dump option for the DB2 or postgreSQL database, then the routine will use the Database provide utilities for backup of the entire database. =head1 OPTIONS @@ -28,7 +28,7 @@ B<-v> Command Version. B<-V> Verbose. -B<-a> All,without this flag the eventlog and auditlog will be skipped. +B<-a> All, without this flag the eventlog and auditlog will be skipped. B<-b> This flag is only used for the DB2 or postgreSQL database. The routine will use the database backup utilities to create a binary backup of the entire database. Note to use this backup on DB2, you will have first had to modify the logging of the database and have taken an offline initial backup. Refer to the xCAT DB2 documentation for more instructions. diff --git a/xCAT-client/pods/man1/genimage.1.pod b/xCAT-client/pods/man1/genimage.1.pod index 7d2414604..bc4f09d8b 100644 --- a/xCAT-client/pods/man1/genimage.1.pod +++ b/xCAT-client/pods/man1/genimage.1.pod @@ -29,7 +29,7 @@ for stateless: B for statelite: B -Besides prompting for some paramter values, the B command takes default guesses for the parameters not specified or not defined in the I and I tables. It also assumes default answers for questions from the yum/zypper command when installing rpms into the image. Use B<--interactive> flag if you want the yum/zypper command to prompt you for the answers. +Besides prompting for some parameter values, the B command takes default guesses for the parameters not specified or not defined in the I and I tables. It also assumes default answers for questions from the yum/zypper command when installing rpms into the image. Use B<--interactive> flag if you want the yum/zypper command to prompt you for the answers. If B<--onlyinitrd> is specified, genimage only regenerates the initrd for a stateless image to be used for a diskless install. diff --git a/xCAT-client/pods/man1/geninitrd.1.pod b/xCAT-client/pods/man1/geninitrd.1.pod index fce267474..f2d4cfc7a 100644 --- a/xCAT-client/pods/man1/geninitrd.1.pod +++ b/xCAT-client/pods/man1/geninitrd.1.pod @@ -26,7 +26,7 @@ If the initrd has been rebuilt by geninitrd, when run nodeset, the I<--noupdatei should be used to skip the rebuilding of initrd to improve the performance. Three attributes of osimage object can be used to specify the Driver RPM location and Driver names -for injecting new drviers to initrd. +for injecting new drivers to initrd. B - comma separated driver names that need to be injected to the initrd. The postfix '.ko' can be ignored. The netdrivers attribute must be set to specify the new driver list. @@ -51,7 +51,7 @@ this command is used to generate the initrd from the rootimg which generated by So the 'genimage' must be run once before running the geninitrd command. Two attributes of osimage object can be used to specify the Driver RPM location and Driver names -for injecting new drviers to initrd. +for injecting new drivers to initrd. B - comma separated driver names that need to be injected to the initrd. The postfix '.ko' can be ignored. The netdrivers attribute must be set to specify the new driver list. @@ -64,7 +64,7 @@ B - comma separated driver rpm packages (full path should be sp =head1 Parameters -I specifies the name of an os image definition to be used. The specification for the image is storted in the I table and I table. +I specifies the name of an os image definition to be used. The specification for the image is stored in the I table and I table. =over 12 diff --git a/xCAT-client/pods/man1/getadapter.1.pod b/xCAT-client/pods/man1/getadapter.1.pod index 0c10af7a1..d9e43c6e9 100644 --- a/xCAT-client/pods/man1/getadapter.1.pod +++ b/xCAT-client/pods/man1/getadapter.1.pod @@ -16,8 +16,8 @@ B use genesis to collect network adapters information, so that mean B For each node within the , follows below scheme: -If the target node is scaned for the first time, B will trigger genesis to collect information then save the information at the B column of nics table. -If the target node has ever been scaned, B will use the information from nics table first. +If the target node is scanned for the first time, B will trigger genesis to collect information then save the information at the B column of nics table. +If the target node has ever been scanned, B will use the information from nics table first. If user hopes to scan the adapter information for the node but these information already exist, B<-f> option can be used to start rescan process. B tries to collect more information for the target network device, but doesn't guarantee collect same much information for every network device. diff --git a/xCAT-client/pods/man1/getmacs.1.pod b/xCAT-client/pods/man1/getmacs.1.pod index 68572339f..8bbbb8d17 100644 --- a/xCAT-client/pods/man1/getmacs.1.pod +++ b/xCAT-client/pods/man1/getmacs.1.pod @@ -23,12 +23,12 @@ B I [B<-V>| B<--verbose>] [B<-d>] [B<--arp>] [B<-i> I =head1 DESCRIPTION The getmacs command collects MAC address from a single or range of nodes. -Note that on AIX systems, the returned MAC address is not colon-seperated (for example 8ee2245cf004), while on Linux systems the MAC address is colon-seperated (for example 8e:e2:24:5c:f0:04). +Note that on AIX systems, the returned MAC address is not colon-separated (for example 8ee2245cf004), while on Linux systems the MAC address is colon-separated (for example 8e:e2:24:5c:f0:04). If no ping test performed, getmacs writes the first adapter MAC to the xCAT database. If ping test performed, getmacs will write the first successfully pinged MAC to xCAT database. For PPC (using Direct FSP Management) specific: -Note: If network adapters are physically assigned to LPARs, getmacs cannot read the MAC addresses unless perform B with option "B<-D>", since there is no HMC command to read them and getmacs has to login to open formware. And if the LPARs has never been activated before, getmacs need to be performed with the option "B<-D>" to get theirs MAC addresses. +Note: If network adapters are physically assigned to LPARs, getmacs cannot read the MAC addresses unless perform B with option "B<-D>", since there is no HMC command to read them and getmacs has to login to open firmware. And if the LPARs has never been activated before, getmacs need to be performed with the option "B<-D>" to get theirs MAC addresses. For PPC (using HMC) specific: @@ -42,7 +42,7 @@ Note: If "B<-d>" is specified, all the MAC of the blades will be displayed. If n B<--arp> -Read MAC address with ARP protocal. +Read MAC address with ARP protocol. B<-C> @@ -58,7 +58,7 @@ Perform discovery for mac address. By default, it will run ping test to test th B<-f> -Force immediate shutdown of the partition.This flag must be used with -D flag. +Force immediate shutdown of the partition. This flag must be used with -D flag. B<-F> @@ -86,7 +86,7 @@ Read MAC address when the lpar is in openfirmware state. This option mush be us B<-S> -The IP address of the machine to ping. The default is to read from xCAT databse if no B<-S> specified. +The IP address of the machine to ping. The default is to read from xCAT database if no B<-S> specified. B<-v> @@ -122,7 +122,7 @@ Output is similar to: ent U78A1.001.99203B5-P1-T6 00145eb55788 /lhea@23c00614/ethernet@23e00514 unsuccessful physical -2. To retrieve the MAC address with ARP protocal: +2. To retrieve the MAC address with ARP protocol: getmacs lpar4 --arp diff --git a/xCAT-client/pods/man1/groupfiles4dsh.1.pod b/xCAT-client/pods/man1/groupfiles4dsh.1.pod index 171b99978..7f2281eba 100644 --- a/xCAT-client/pods/man1/groupfiles4dsh.1.pod +++ b/xCAT-client/pods/man1/groupfiles4dsh.1.pod @@ -15,7 +15,7 @@ This tool will build a directory of files, one for each defined nodegroup in xCAT. The file will be named the nodegroup name and contain a list of nodes that belong to the nodegroup. The file can be used as input to the AIX dsh command. -The purpose of this tool is to allow backward compatiblity with scripts +The purpose of this tool is to allow backward compatibility with scripts that were created using the AIX or CSM dsh command Reference: man dsh. diff --git a/xCAT-client/pods/man1/imgexport.1.pod b/xCAT-client/pods/man1/imgexport.1.pod index a2376df26..0e535a57b 100644 --- a/xCAT-client/pods/man1/imgexport.1.pod +++ b/xCAT-client/pods/man1/imgexport.1.pod @@ -45,7 +45,7 @@ For statelite: where x is the name of the profile. -Any files specified by the B<-e> flag will also be exported. If B<-p> flag is specified, the names of the postscripts and the postbootscripts for the given node will be exported. The postscripts themsleves need to be manualy exported using B<-e> flag. +Any files specified by the B<-e> flag will also be exported. If B<-p> flag is specified, the names of the postscripts and the postbootscripts for the given node will be exported. The postscripts themselves need to be manualy exported using B<-e> flag. For statelite, the litefile table settings for the image will also be exported. The litetree and statelite tables are not exported. diff --git a/xCAT-client/pods/man1/imgimport.1.pod b/xCAT-client/pods/man1/imgimport.1.pod index f652f9d74..2757ee48a 100644 --- a/xCAT-client/pods/man1/imgimport.1.pod +++ b/xCAT-client/pods/man1/imgimport.1.pod @@ -50,7 +50,7 @@ If B<-p> flag is specified, the I table will be updated with the po If B<-f> flag is not specified, all the files will be copied to the same directories as the source. If it is specified, the old profile name x will be changed to the new and the files will be copied to the appropriate directores for the new profiles. For example, I will be copied to I and I will be copied to I. This flag is commonly used when you want to copy the image on the same xCAT mn so you can make modification on the new one. -After this command, you can run the B command and then start deploying the nodes. You can also choose to modify the files and run the following commands before the node depolyment. +After this command, you can run the B command and then start deploying the nodes. You can also choose to modify the files and run the following commands before the node deployment. For stateful: nodeset diff --git a/xCAT-client/pods/man1/liteimg.1.pod b/xCAT-client/pods/man1/liteimg.1.pod index 4a98c114a..9f8ed39ff 100644 --- a/xCAT-client/pods/man1/liteimg.1.pod +++ b/xCAT-client/pods/man1/liteimg.1.pod @@ -41,7 +41,7 @@ Note: If you make any changes to your litefile table after running liteimg then =head1 PARAMETERS -I specifies the name of a os image definition to be used. The specification for the image is storted in the I table and I table. +I specifies the name of a os image definition to be used. The specification for the image is stored in the I table and I table. =head1 OPTIONS diff --git a/xCAT-client/pods/man1/lsflexnode.1.pod b/xCAT-client/pods/man1/lsflexnode.1.pod index bcb1a2c93..4fa436316 100644 --- a/xCAT-client/pods/man1/lsflexnode.1.pod +++ b/xCAT-client/pods/man1/lsflexnode.1.pod @@ -22,7 +22,7 @@ There are several concepts to support the HX5 multiple blades combination: B: Multiple blades which combined by a scalability card is a complex. -B: A logic concept which containing part of the B in a complex. Each partition can map to a system to install Operating System. Each partition could have 1HX5, 1HX5+1MD or 2HX5+2MD. (MD is the Memory Drawer) +B: A logic concept which containing part of the B in a complex. Each partition can map to a system to install Operating System. Each partition could have 1HX5, 1HX5+1MD or 2HX5+2MD. (MD is the Memory Drawer) B: The physical blade which installed in the slot of a chassis. It can be a HX5 or MD. diff --git a/xCAT-client/pods/man1/lskitcomp.1.pod b/xCAT-client/pods/man1/lskitcomp.1.pod index 413e7f6be..dfd6e307c 100644 --- a/xCAT-client/pods/man1/lskitcomp.1.pod +++ b/xCAT-client/pods/man1/lskitcomp.1.pod @@ -57,7 +57,7 @@ Return the output with XML tags. The data is returned as: -Each tag contains info for a group of kit compoonents belonging to the same kit. The info inside is structured as follows: +Each tag contains info for a group of kit components belonging to the same kit. The info inside is structured as follows: The sub-tag contains the kit's name. The sub-tags store info about the kit's components. diff --git a/xCAT-client/pods/man1/lsslp.1.pod b/xCAT-client/pods/man1/lsslp.1.pod index 81d5cfdef..fe1e04cac 100755 --- a/xCAT-client/pods/man1/lsslp.1.pod +++ b/xCAT-client/pods/man1/lsslp.1.pod @@ -19,13 +19,13 @@ NOTE: SLP broadcast requests will propagate only within the subnet of the networ =head1 OPTIONS -B The nodes which the user want to discover. If the user specify the noderange, lsslp will just return the nodes in the node range. Which means it will help to add the new nodes to the xCAT database without modifying the existed definitions. But the nodes' name specified in noderange should be defined in database in advance. The specified nodes' type can be frame/cec/hmc/fsp/bpa. If the it is frame or cec, lsslp will list the bpa or fsp nodes within the nodes(bap for frame, fsp for cec). Do not use noderange with the flag -s. +B The nodes which the user wants to discover. If the user specifies the noderange, lsslp will just return the nodes in the node range. Which means it will help to add the new nodes to the xCAT database without modifying the existed definitions. But the nodes' name specified in noderange should be defined in database in advance. The specified nodes' type can be frame/cec/hmc/fsp/bpa. If the it is frame or cec, lsslp will list the bpa or fsp nodes within the nodes(bap for frame, fsp for cec). Do not use noderange with the flag -s. B<-i> IP(s) the command will send out (defaults to all available adapters). B<-h> Display usage message. -B<-n> Only display and write the newly discovered hardwares. +B<-n> Only display and write the newly discovered hardware. B<-u> Do unicast to a specified IP range. Must be used with B<-s> and B<--range>. The B<-u> flag is not supported on AIX. @@ -33,16 +33,16 @@ B<--range> Specify one or more IP ranges. Must be use in unicast mode. It ac B<-r> Display Raw SLP response. -B<-C> The number of the expected responses specified by the user. When using this flag, lsslp will not return until the it has found all the nodes or time out. The default max time is 3 secondes. The user can use -T flag the specify the time they want to use. A short time will limite the time costing, while a long time will help to find all the nodes. +B<-C> The number of the expected responses specified by the user. When using this flag, lsslp will not return until the it has found all the nodes or time out. The default max time is 3 seconds. The user can use -T flag the specify the time they want to use. A short time will limit the time costing, while a long time will help to find all the nodes. -B<-T> The number in seconds to limite the time costing of lsslp. +B<-T> The number in seconds to limit the time of lsslp. B<-s> Service type interested in discovering. B<-t> Number or service-request attempts. -B<--vpdtable> Output the SLP response in vpdtable formatting. Easy for writting data to vpd table. +B<--vpdtable> Output the SLP response in vpdtable formatting. Easy for writing data to vpd table. B<-v> Command Version. @@ -52,9 +52,9 @@ B<-w> Writes output to xCAT database. B<-x> XML format. -B<-z> Stanza formated output. +B<-z> Stanza formatted output. -B<-I> Give the warning message for the nodes in database which have no SLP responses. Note that this flag noly can be used after the database migration finished successfully. +B<-I> Give the warning message for the nodes in database which have no SLP responses. Note that this flag can only be used after the database migration finished successfully. =head1 RETURN VALUE diff --git a/xCAT-client/pods/man1/lstree.1.pod b/xCAT-client/pods/man1/lstree.1.pod index 182abe37b..618151539 100644 --- a/xCAT-client/pods/man1/lstree.1.pod +++ b/xCAT-client/pods/man1/lstree.1.pod @@ -10,7 +10,7 @@ B [B<-s> | B<--servicenode>] [B<-H> | B<--hardwaremgmt>] [B<-v> | B<--vi =head1 DESCRIPTION -The B command can display the tree of service node hierarchy for the xCAT nodes which have service node defined or which are service nodes, display the tree of hardware hierarchy only for the physical objects, display the tree of VM hierarchy for the xCAT nodes which are virtual machines or which are the hosts of virtual machines. If a noderange is specified, only show the part of the hierarchy that involves those nodes. For ZVM, we only support to disply VM hierarchy. By default, lstree will show both the hardware hierarchy and the VM hierarchy for all the nodes. +The B command can display the tree of service node hierarchy for the xCAT nodes which have service node defined or which are service nodes, display the tree of hardware hierarchy only for the physical objects, display the tree of VM hierarchy for the xCAT nodes which are virtual machines or which are the hosts of virtual machines. If a noderange is specified, only show the part of the hierarchy that involves those nodes. For ZVM, we only support to display VM hierarchy. By default, lstree will show both the hardware hierarchy and the VM hierarchy for all the nodes. =head1 OPTIONS diff --git a/xCAT-client/pods/man1/lsvm.1.pod b/xCAT-client/pods/man1/lsvm.1.pod index d588fbf42..ac802ed7a 100644 --- a/xCAT-client/pods/man1/lsvm.1.pod +++ b/xCAT-client/pods/man1/lsvm.1.pod @@ -248,7 +248,7 @@ Output is similar to: Bytes per BSR array: 4096 Available BSR array: 256 -Note: The lines listed in "All Physical I/O info" section represent all the physical I/O resource information. The format is like "owner_lparid,slot_id,physical resource name,drc_index,slot_class_code(class discription)". The 'drc index' is short for Dynamic Resource Configuration Index, it uniquely indicates a physical I/O resource in a normal power machine. +Note: The lines listed in "All Physical I/O info" section represent all the physical I/O resource information. The format is like "owner_lparid,slot_id,physical resource name,drc_index,slot_class_code(class description)". The 'drc index' is short for Dynamic Resource Configuration Index, it uniquely indicates a physical I/O resource in a normal power machine. 9. For DFM-managed partition on normal power machine, list out the detailed information: diff --git a/xCAT-client/pods/man1/mkdef.1.pod b/xCAT-client/pods/man1/mkdef.1.pod index 8f5cdb899..af59220b2 100644 --- a/xCAT-client/pods/man1/mkdef.1.pod +++ b/xCAT-client/pods/man1/mkdef.1.pod @@ -50,7 +50,7 @@ A set of comma delimited object types. Use the help option to get a list of val =item B<--template> I -Name of the xCAT shipped object definition template or an existing object, from which the new object definition will be created. The newly created object will inherit the attributes of the template definition unless the attribute is specified in the arguments of B command. If there are a template and an existing object with the same name I, the tempalte object takes precedence over the existing object. For the details of xCAT shipped object definition templates, refer to the manpage of B<--template> option in L. +Name of the xCAT shipped object definition template or an existing object, from which the new object definition will be created. The newly created object will inherit the attributes of the template definition unless the attribute is specified in the arguments of B command. If there are a template and an existing object with the same name I, the template object takes precedence over the existing object. For the details of xCAT shipped object definition templates, refer to the manpage of B<--template> option in L. =item B<-V|--verbose> @@ -58,7 +58,7 @@ Verbose mode. =item B<-w> I B<-w> I ... -Use one or multiple -w flags to specify the selection string that can be used to select objects. The operators ==, !=, =~ and !~ are available. For mkdef commmand, the -w flag only makes sense for creating dynamic node group. Use the help option to get a list of valid attributes for each object type. +Use one or multiple -w flags to specify the selection string that can be used to select objects. The operators ==, !=, =~ and !~ are available. For mkdef command, the -w flag only makes sense for creating dynamic node group. Use the help option to get a list of valid attributes for each object type. Operator descriptions: == Select nodes where the attribute value is exactly this value. diff --git a/xCAT-client/pods/man1/mkdocker.1.pod b/xCAT-client/pods/man1/mkdocker.1.pod index 1f9ee535c..dcb4eb0e4 100644 --- a/xCAT-client/pods/man1/mkdocker.1.pod +++ b/xCAT-client/pods/man1/mkdocker.1.pod @@ -82,7 +82,7 @@ Output is similar to: host01c01: Pull image ubuntu start host01c01: Pull image ubuntu done host01c01: Remove default network connection - host01c01: Connecting customzied network 'mynet0' + host01c01: Connecting customized network 'mynet0' host01c01: success 2. To create a docker instance which have dir "destdir" in docker instance bind from "srcdir" on dockerhost, and have "Tty" opened with which the docker instance can be attached after started to check the files under "destdir". @@ -92,7 +92,7 @@ Output is similar to: Output is similar to: host01c01: Remove default network connection - host01c01: Connecting customzied network 'mynet0' + host01c01: Connecting customized network 'mynet0' host01c01: success =head1 SEE ALSO diff --git a/xCAT-client/pods/man1/mkdsklsnode.1.pod b/xCAT-client/pods/man1/mkdsklsnode.1.pod index 5e0a95278..3b51f160f 100644 --- a/xCAT-client/pods/man1/mkdsklsnode.1.pod +++ b/xCAT-client/pods/man1/mkdsklsnode.1.pod @@ -19,7 +19,7 @@ This command will also create a NIM resolv_conf resource to be used when install The "domain" and "nameservers" attributes can be set in either the xCAT "network" definition used by the nodes or in the xCAT cluster "site" definition. The setting in the "network" definition will take priority. The "search" field of the resolv.conf file will contain a list all the domains -listed in the xCAT network definitions and the xCAT site definiton. +listed in the xCAT network definitions and the xCAT site definition. The "nameservers" value can either be set to a specific IP address or the "" key word. The "" key word means that the value of the "xcatmaster" attribute of the node definition will be used in the /etc/resolv.conf file. (I.e. The name of the install server as known by the node.) @@ -41,11 +41,11 @@ You can use the "-n" option of the mkdsklsnode command to create and initialize B When using the "-n" option make sure that the new osimage you specify and all the NIM resources that are used are different than what are currently being used on the nodes. The NIM resources should not be shared between the old osimage and the new osimage. -You can use the force option to reinitialize a node if it already has resources allocated or it is in the wrong NIM state. This option will reset the NIM node and deallocate resources before reinititializing. Use this option with caution since reinitializing a node will stop the node if it is currently running. +You can use the force option to reinitialize a node if it already has resources allocated or it is in the wrong NIM state. This option will reset the NIM node and deallocate resources before reinitializing. Use this option with caution since reinitializing a node will stop the node if it is currently running. After the mkdsklsnode command completes you can use the B command to check the NIM node definition to see if it is ready for booting the node. ("lsnim -l "). -You can supply your own scripts to be run on the management node or on the service node (if their is hierarchy) for a node during the B command. Such scripts are called B. They should be copied to /install/prescripts dirctory. A table called I is used to specify the scripts and their associated actions. The scripts to be run at the beginning of the B command are stored in the 'begin' column of I table. The scripts to be run at the end of the B command are stored in the 'end' column of I table. Run 'tabdump prescripts -d' command for details. An example for the 'begin' or the 'end' column is: I. The following two environment variables will be passed to each script: NODES contains all the names of the nodes that need to run the script for and ACTION contains the current current nodeset action, in this case "diskless". If I<#xCAT setting:MAX_INSTANCE=number> is specified in the script, the script will get invoked for each node in parallel, but no more than I of instances will be invoked at at a time. If it is not specified, the script will be invoked once for all the nodes. +You can supply your own scripts to be run on the management node or on the service node (if their is hierarchy) for a node during the B command. Such scripts are called B. They should be copied to /install/prescripts directory. A table called I is used to specify the scripts and their associated actions. The scripts to be run at the beginning of the B command are stored in the 'begin' column of I table. The scripts to be run at the end of the B command are stored in the 'end' column of I table. Run 'tabdump prescripts -d' command for details. An example for the 'begin' or the 'end' column is: I. The following two environment variables will be passed to each script: NODES contains all the names of the nodes that need to run the script for and ACTION contains the current nodeset action, in this case "diskless". If I<#xCAT setting:MAX_INSTANCE=number> is specified in the script, the script will get invoked for each node in parallel, but no more than I of instances will be invoked at a time. If it is not specified, the script will be invoked once for all the nodes. =head1 OPTIONS diff --git a/xCAT-client/pods/man1/mknimimage.1.pod b/xCAT-client/pods/man1/mknimimage.1.pod index 78dc2b00e..700ccdc43 100644 --- a/xCAT-client/pods/man1/mknimimage.1.pod +++ b/xCAT-client/pods/man1/mknimimage.1.pod @@ -24,7 +24,7 @@ B When creating a diskless osimage definition you also have the option of automatically updating the NIM SPOT resource. You can have additional software installed or you can have configuration files added or updated. To have software installed you must provide either the names of NIM installp_bundle resources or fileset names on the command line using the "attr=val" option. You may also supply the installp flags, RPM flags, emgr flags to use when installing the software. -To have configuration files updated you must provide the full path name of a "synclists" file which contains the the list of actual files to update. The xCAT osimage definition that is created will contain the installp_bundle, otherpkgs, and synclists files that are provided on the command line. +To have configuration files updated you must provide the full path name of a "synclists" file which contains the list of actual files to update. The xCAT osimage definition that is created will contain the installp_bundle, otherpkgs, and synclists files that are provided on the command line. B @@ -50,7 +50,7 @@ You can use the "-i" and "-p" options to copy an existing diskless osimage. To - any other resources (or attributes) included in the original osimage will be included in the new osimage definition. -- if the "-p" option is specified then the original NIM lpp_source resource will be copied to a new location and redfined to NIM. (The default would be to use the original lpp_source - to save file system space.) +- if the "-p" option is specified then the original NIM lpp_source resource will be copied to a new location and redefined to NIM. (The default would be to use the original lpp_source - to save file system space.) B @@ -67,7 +67,7 @@ To list a NIM resource definition use the AIX B command ("lsnim -l command ("nim -o check "). -To remove specific NIM resource definitons use the AIX B command. ("nim -o remove "). +To remove specific NIM resource definitions use the AIX B command. ("nim -o remove "). =head1 OPTIONS @@ -187,7 +187,7 @@ Value Specifies the security method required for NFS access. =back -Note that you may specify multiple "script", "otherpkgs", and "installp_bundle" resources by using a comma seperated list. (ex. "script=ascript,bscript"). RPM names may be included in the "otherpkgs" list by using a "R:" prefix(ex. "R:whatever.rpm"). epkg (AIX interim fix package) file names may be included in the "otherpkgs" using the 'E:' prefix. (ex. "otherpkgs=E:IZ38930TL0.120304.epkg.Z"). +Note that you may specify multiple "script", "otherpkgs", and "installp_bundle" resources by using a comma separated list. (ex. "script=ascript,bscript"). RPM names may be included in the "otherpkgs" list by using a "R:" prefix(ex. "R:whatever.rpm"). epkg (AIX interim fix package) file names may be included in the "otherpkgs" using the 'E:' prefix. (ex. "otherpkgs=E:IZ38930TL0.120304.epkg.Z"). =item B<-b> I @@ -195,7 +195,7 @@ Used to specify the path name of a mksysb file to use when defining a NIM mksysb =item B<-c|--completeosimage> -Complete the creation of the osimage definition passed in on the command line. This option will use any additonal values passed in on the command line and/or it will attempt to create required resources in order to complete the definition of the xCAT osimage. For example, if the osimage definition is missing a spot or shared_root resource the command will create those resources and add them to the osimage definition. +Complete the creation of the osimage definition passed in on the command line. This option will use any additional values passed in on the command line and/or it will attempt to create required resources in order to complete the definition of the xCAT osimage. For example, if the osimage definition is missing a spot or shared_root resource the command will create those resources and add them to the osimage definition. =item B<-f|--force> @@ -333,7 +333,7 @@ The xCAT osimage definition created by this command will include the "otherpkgs" mknimimage -u 61dskls installp_bundle=bndres1,bndres2 installp_flags="-agcQX" -Note that when "installp_bundle", "otherpkgs", or "synclists" values are specified with the "-u" option then the xCAT osimage definiton is not used or updated. +Note that when "installp_bundle", "otherpkgs", or "synclists" values are specified with the "-u" option then the xCAT osimage definition is not used or updated. 13) Update an existing image to support NFSv4. Also specify verbose messages. diff --git a/xCAT-client/pods/man1/mkvm.1.pod b/xCAT-client/pods/man1/mkvm.1.pod index 700521841..fd98f4525 100644 --- a/xCAT-client/pods/man1/mkvm.1.pod +++ b/xCAT-client/pods/man1/mkvm.1.pod @@ -88,7 +88,7 @@ Request to create a new full system partition for each CEC. =item B I B I B I B I B I B I [B<--vios>] -To specify the parameters which are used to create a partition. The I, I are necessay, and the value specified with this command have a more high priority. If the value of any of the three options is not specified, the corresponding value specified for the node object will be used. If any of the three attributes is neither specified with this command nor specified with the node object, error information will be returned. To reference to L for more information about 'drc_index' for I. +To specify the parameters which are used to create a partition. The I, I are necessary, and the value specified with this command have a more high priority. If the value of any of the three options is not specified, the corresponding value specified for the node object will be used. If any of the three attributes is neither specified with this command nor specified with the node object, error information will be returned. To reference to L for more information about 'drc_index' for I. The option I is used to specify the partition that will be created is a VIOS partition. If specified, the value for I shall be number which indicate the number of vSCSI server adapter will be created, and if no value specified for I, all the physical slot of the power machine will be asigned to VIOS partition. If not specified, it shall be in form of I to specify the vios and the virtual slot id of the vSCSI server adapter that will be connected from the Logical partition. @@ -241,7 +241,7 @@ First, define a node object: mkdef -t node -o lpar1 mgt=fsp cons=fsp nodetype=ppc,osi id=1 hcp=cec parent=cec hwtype=lpar groups=lpar,all -Then, create the partion on the specified cec. +Then, create the partition on the specified cec. mkvm lpar1 --full @@ -321,7 +321,7 @@ The output is similar to: mkvm viosnode vmcpus=1/4/16 vmmemory=1G/4G/32G vmphyslots=0x21010201,0x21010200 vmnics=vlan1 vmstorage=5 --vios -The resouces for the node is similar to: +The resources for the node is similar to: viosnode: Lpar Processor Info: Curr Processor Min: 1. diff --git a/xCAT-client/pods/man1/monadd.1.pod b/xCAT-client/pods/man1/monadd.1.pod index 1e587afdd..1ad4bd093 100644 --- a/xCAT-client/pods/man1/monadd.1.pod +++ b/xCAT-client/pods/man1/monadd.1.pod @@ -18,9 +18,9 @@ This command is used to register a monitoring plug-in module to monitor the xCAT =head1 Parameters -I is the name of the monitoring plug-in module. For example, if the the I is called I, then the actual file name that the xcatd looks for is I. Use I command to list all the monitoring plug-in modules that can be used. +I is the name of the monitoring plug-in module. For example, if the I is called I, then the actual file name that the xcatd looks for is I. Use I command to list all the monitoring plug-in modules that can be used. -I is the monitoring plug-in specific settings. It is used to customize the behavior of the plug-in or configure the 3rd party software. Format: I<-s key-value -s key=value ...> Note that the square brackets are needed here. Use I command to look for the possbile setting keys for a plug-in module. +I is the monitoring plug-in specific settings. It is used to customize the behavior of the plug-in or configure the 3rd party software. Format: I<-s key-value -s key=value ...> Note that the square brackets are needed here. Use I command to look for the possible setting keys for a plug-in module. =head1 OPTIONS diff --git a/xCAT-client/pods/man1/moncfg.1.pod b/xCAT-client/pods/man1/moncfg.1.pod index a1fc5a20c..47a3bba3a 100644 --- a/xCAT-client/pods/man1/moncfg.1.pod +++ b/xCAT-client/pods/man1/moncfg.1.pod @@ -15,12 +15,12 @@ B I I<[noderange]> B<[-r|--remote]> =head1 DESCRIPTION -This command is used to configure a 3rd party monitoring software to monitor the xCAT cluster. For example, it modifies the configration file for the monitoring software so that the nodes can be included in the monitoring domain. The operation is performed on the management node and the service nodes of the given nodes. The operation will also be performed on the nodes if the I<-r> option is specified, though the configuration of the nodes is usually performed during the node deployment stage. +This command is used to configure a 3rd party monitoring software to monitor the xCAT cluster. For example, it modifies the configuration file for the monitoring software so that the nodes can be included in the monitoring domain. The operation is performed on the management node and the service nodes of the given nodes. The operation will also be performed on the nodes if the I<-r> option is specified, though the configuration of the nodes is usually performed during the node deployment stage. =head1 Parameters -I is the name of the monitoring plug-in module. For example, if the the I is called I, then the actual file name that the xcatd looks for is I. Use I command to list all the monitoring plug-in modules that can be used. +I is the name of the monitoring plug-in module. For example, if the I is called I, then the actual file name that the xcatd looks for is I. Use I command to list all the monitoring plug-in modules that can be used. I specifies the nodes to be monitored. If omitted, all nodes will be monitored. diff --git a/xCAT-client/pods/man1/mondecfg.1.pod b/xCAT-client/pods/man1/mondecfg.1.pod index 1884ab1b1..6f7ccc753 100644 --- a/xCAT-client/pods/man1/mondecfg.1.pod +++ b/xCAT-client/pods/man1/mondecfg.1.pod @@ -15,7 +15,7 @@ B I I<[noderange]> B<[-r|--remote]> =head1 DESCRIPTION -This command is used to deconfigure a 3rd party monitoring software from monitoring the xCAT cluster. The operation is performed on the management node and the service nodes of the given nodes. The operation will also be performed on the nodes if the I<-r> option is specified. The deconfigration operation will remove the nodes from the 3rd party software's monitoring domain. +This command is used to deconfigure a 3rd party monitoring software from monitoring the xCAT cluster. The operation is performed on the management node and the service nodes of the given nodes. The operation will also be performed on the nodes if the I<-r> option is specified. The deconfiguration operation will remove the nodes from the 3rd party software's monitoring domain. =head1 PARAMETERS diff --git a/xCAT-client/pods/man1/monls.1.pod b/xCAT-client/pods/man1/monls.1.pod index 55cd86498..c9130a98e 100644 --- a/xCAT-client/pods/man1/monls.1.pod +++ b/xCAT-client/pods/man1/monls.1.pod @@ -15,7 +15,7 @@ B =head1 DESCRIPTION -This command is used to list the status, desctiption, the configuration scripts and the settings of one or all of the monitoring plug-in modules. +This command is used to list the status, description, the configuration scripts and the settings of one or all of the monitoring plug-in modules. =head1 Parameters @@ -26,9 +26,9 @@ I is the name of the monitoring plug-in module. =head1 OPTIONS -B<-a | --all> Searches the I directory and reports all the monitoring plug-in modules. If nothing is specified, the list is read from the I tabel. +B<-a | --all> Searches the I directory and reports all the monitoring plug-in modules. If nothing is specified, the list is read from the I table. -B<-d | --description> Display the description of the plug-in modules. The description ususally contains the possible settings. +B<-d | --description> Display the description of the plug-in modules. The description usually contains the possible settings. B<-h | --help> Display usage message. @@ -64,7 +64,7 @@ The output looks like this: nagiosmon not-monitored -3. To list the status and the desciption for I module, enter: +3. To list the status and the description for I module, enter: monls snmpmon -d diff --git a/xCAT-client/pods/man1/monshow.1.pod b/xCAT-client/pods/man1/monshow.1.pod index 22d4309f9..c3aa85385 100755 --- a/xCAT-client/pods/man1/monshow.1.pod +++ b/xCAT-client/pods/man1/monshow.1.pod @@ -36,7 +36,7 @@ B<-t> specifies a range of time for the data, The default is last 60 minutes. Fo B<-a> specifies a comma-separated list of attributes or metrics names. The default is all. -B<-w> specify one or multiple selection string that can be used to select events. The operators ==, !=, =,!,>,<,>=,<= are available. Wildcards % and _ are supported in the pattern string. % allows you to match any string of any length(including zero length) and _ allows you to match on a single character. The valid attributes are eventtype, monitor, monnode, application, component, id, serverity, message, rawdata, comments. Valid severity are: Informational, Warning, Critical. +B<-w> specify one or multiple selection string that can be used to select events. The operators ==, !=, =,!,>,<,>=,<= are available. Wildcards % and _ are supported in the pattern string. % allows you to match any string of any length(including zero length) and _ allows you to match on a single character. The valid attributes are eventtype, monitor, monnode, application, component, id, severity, message, rawdata, comments. Valid severity are: Informational, Warning, Critical. Operator descriptions: diff --git a/xCAT-client/pods/man1/monstart.1.pod b/xCAT-client/pods/man1/monstart.1.pod index 624fad4fa..092d6a399 100644 --- a/xCAT-client/pods/man1/monstart.1.pod +++ b/xCAT-client/pods/man1/monstart.1.pod @@ -18,7 +18,7 @@ This command is used to start a 3rd party software, (for example start the daemo =head1 PARAMETERS -I is the name of the monitoring plug-in module. For example, if the the I is called I, then the actual file name that the xcatd looks for is I. Use B command to list all the monitoring plug-in modules that can be used. +I is the name of the monitoring plug-in module. For example, if the I is called I, then the actual file name that the xcatd looks for is I. Use B command to list all the monitoring plug-in modules that can be used. I is the nodes to be monitored. If omitted, all nodes will be monitored. diff --git a/xCAT-client/pods/man1/nimnodecust.1.pod b/xCAT-client/pods/man1/nimnodecust.1.pod index ea5eaa711..93cba2a36 100644 --- a/xCAT-client/pods/man1/nimnodecust.1.pod +++ b/xCAT-client/pods/man1/nimnodecust.1.pod @@ -30,9 +30,9 @@ To create a NIM installp_bundle definition you can use the "nim -o define" opera nim -o define -t installp_bundle -a server=master -a location=/install/nim/mypkgs.bnd mypackages -See the AIX documantation for more information on using installp_bundle files. +See the AIX documentation for more information on using installp_bundle files. -The xCAT nimnodecust command will automatically handle the distribution of the packages to AIX service nodes when using an xCAT hierachical environment. +The xCAT nimnodecust command will automatically handle the distribution of the packages to AIX service nodes when using an xCAT hierarchical environment. =head1 OPTIONS diff --git a/xCAT-client/pods/man1/nimnodeset.1.pod b/xCAT-client/pods/man1/nimnodeset.1.pod index 2e9b9835f..04ecd9587 100644 --- a/xCAT-client/pods/man1/nimnodeset.1.pod +++ b/xCAT-client/pods/man1/nimnodeset.1.pod @@ -14,7 +14,7 @@ This xCAT command can be used to initialize AIX/NIM standalone machines. Once th If you are using xCAT service nodes the B command will automatically determine the correct server(s) for the node and do the initialization on that server(s). -The osimage_name is the name of an xCAT osimage definition that contains the list of NIM resources to use when initializing the nodes. If the osimage_name is not provided on the command line the code checks the node definition for the value of the "provmethod" attribute (which is the name of an osimage definition). If the osimage_image is provided on the command line then the code will also set the "provmethod" attribute of the node definiions. +The osimage_name is the name of an xCAT osimage definition that contains the list of NIM resources to use when initializing the nodes. If the osimage_name is not provided on the command line the code checks the node definition for the value of the "provmethod" attribute (which is the name of an osimage definition). If the osimage_image is provided on the command line then the code will also set the "provmethod" attribute of the node definitions. This command will also create a NIM resolv_conf resource to be used when installing the node. If a resolv_conf resource is not already included in the xCAT osimage definition and if the "domain" and "nameservers" values are set then a new NIM resolv_conf resource will be created and allocated to the nodes. @@ -22,7 +22,7 @@ NIM resolv_conf resource will be created and allocated to the nodes. The "domain" and "nameservers" attributes can be set in either the xCAT "network" definition used by the nodes or in the xCAT cluster "site" definition. The setting in the "network" definition will take priority. The "search" field of the resolv.conf file will contain a list all the domains -listed in the xCAT network definitions and the xCAT site definiton. +listed in the xCAT network definitions and the xCAT site definition. The "nameservers" value can either be set to a specific IP address or the "" key word. The "" key word means that the value of the "xcatmaster" attribute of the node definition will be used in the /etc/resolv.conf file. (I.e. The name of the install server as known by the node.) @@ -35,13 +35,13 @@ will be created. You can specify additional attributes and values using the "attr=val" command line option. This information will be passed on to the underlying call to the NIM "nim -o bos_inst" command. See the NIM documentation for information on valid command line options for the nim command. The "attr" must correspond to a NIM attribute supported for the NIM "bos_inst" operation. Information provided by the "attr=val" option will take precedence over the information provided in the osimage definition. -The force option can be used to reinitialize a node if it already has resources allocated or it is in the wrong NIM state. This option will reset the NIM node and deallocate resources before reinititializing. +The force option can be used to reinitialize a node if it already has resources allocated or it is in the wrong NIM state. This option will reset the NIM node and deallocate resources before reinitializing. This command will also create a NIM script resource to enable the xCAT support for user-provided customization scripts. After the B command completes you can use the B command to check the NIM node definition to see if it is ready for booting the node. ("lsnim -l "). -You can supply your own scripts to be run on the management node or on the service node (if their is hierarchy) for a node during the B command. Such scripts are called B. They should be copied to /install/prescripts dirctory. A table called I is used to specify the scripts and their associated actions. The scripts to be run at the beginning of the B command are stored in the 'begin' column of I table. The scripts to be run at the end of the B command are stored in the 'end' column of I table. Run 'tabdump prescripts -d' command for details. An example for the 'begin' or the 'end' column is: I. The following two environment variables will be passed to each script: NODES contains all the names of the nodes that need to run the script for and ACTION contains the current nodeset action, in this case "standalone". If I<#xCAT setting:MAX_INSTANCE=number> is specified in the script, the script will get invoked for each node in parallel, but no more than I of instances will be invoked at at a time. If it is not specified, the script will be invoked once for all the nodes. +You can supply your own scripts to be run on the management node or on the service node (if their is hierarchy) for a node during the B command. Such scripts are called B. They should be copied to /install/prescripts directory. A table called I is used to specify the scripts and their associated actions. The scripts to be run at the beginning of the B command are stored in the 'begin' column of I table. The scripts to be run at the end of the B command are stored in the 'end' column of I table. Run 'tabdump prescripts -d' command for details. An example for the 'begin' or the 'end' column is: I. The following two environment variables will be passed to each script: NODES contains all the names of the nodes that need to run the script for and ACTION contains the current nodeset action, in this case "standalone". If I<#xCAT setting:MAX_INSTANCE=number> is specified in the script, the script will get invoked for each node in parallel, but no more than I of instances will be invoked at at a time. If it is not specified, the script will be invoked once for all the nodes. =head1 OPTIONS @@ -50,7 +50,7 @@ You can supply your own scripts to be run on the management node or on the serv =item I Specifies one or more "attribute equals value" pairs, separated by spaces. Attr= -val pairs must be specified last on the command line. These are used to specify additional values that can be passed to the underlying NIM commands, ("nim -o bos_inst ..."). See the NIM documentation for valid "nim" command line options. Note that you may specify multiple "script" and "installp_bundle" values by using a comma seperated list. (ex. "script=ascript,bscript"). +val pairs must be specified last on the command line. These are used to specify additional values that can be passed to the underlying NIM commands, ("nim -o bos_inst ..."). See the NIM documentation for valid "nim" command line options. Note that you may specify multiple "script" and "installp_bundle" values by using a comma separated list. (ex. "script=ascript,bscript"). =item B<-b|--backupSN> @@ -70,8 +70,7 @@ The name of an existing xCAT osimage definition. =item B<-l|--location> -The directory location to use when creating new NIM resolv_conf resources. The d -efault location is /install/nim. +The directory location to use when creating new NIM resolv_conf resources. The default location is /install/nim. =item B<-p|--primarySN> diff --git a/xCAT-client/pods/man1/nodeaddunmged.1.pod b/xCAT-client/pods/man1/nodeaddunmged.1.pod index 60258c7a0..675daa669 100644 --- a/xCAT-client/pods/man1/nodeaddunmged.1.pod +++ b/xCAT-client/pods/man1/nodeaddunmged.1.pod @@ -34,7 +34,7 @@ Sets the IP address of the unmanaged node, where I is the IP address 0 The command completed successfully. -1 An error has occured. +1 An error has occurred. =head1 EXAMPLES diff --git a/xCAT-client/pods/man1/nodechmac.1.pod b/xCAT-client/pods/man1/nodechmac.1.pod index 593b20a51..0bf9830f8 100644 --- a/xCAT-client/pods/man1/nodechmac.1.pod +++ b/xCAT-client/pods/man1/nodechmac.1.pod @@ -36,7 +36,7 @@ Sets the new MAC address for the NIC used by the provisioning node, where is 0 The command completed successfully. -1 An error has occured. +1 An error has occurred. =head1 EXAMPLES diff --git a/xCAT-client/pods/man1/nodediscoverls.1.pod b/xCAT-client/pods/man1/nodediscoverls.1.pod index 5b6af9bf6..bde7b37e0 100644 --- a/xCAT-client/pods/man1/nodediscoverls.1.pod +++ b/xCAT-client/pods/man1/nodediscoverls.1.pod @@ -76,7 +76,7 @@ Command version. 0 The command completed successfully. -1 An error has occured. +1 An error has occurred. =head1 EXAMPLES diff --git a/xCAT-client/pods/man1/nodediscoverstart.1.pod b/xCAT-client/pods/man1/nodediscoverstart.1.pod index 165a68d5a..4e3b98d37 100755 --- a/xCAT-client/pods/man1/nodediscoverstart.1.pod +++ b/xCAT-client/pods/man1/nodediscoverstart.1.pod @@ -52,7 +52,7 @@ When the nodes are discovered, PCM updates the affected configuration files on t When you power on the nodes, they PXE boot and DHCP/TFTP/HTTP on the management node give each node the xCAT genesis boot image, which inventories the node hardware and sends data to the management node. There, either the sequential discovery process or the -profile discovery process assigns node attributes and defines the node in the the database. +profile discovery process assigns node attributes and defines the node in the database. =head1 OPTIONS @@ -99,7 +99,7 @@ Sets the node groups that the discovered nodes should be put in for either the S Sets the rack name where the node is located for either the Sequential Discovery or Profile Discovery methods. -=item BI +=item BI Sets the chassis name that the Blade server or PureFlex blade is located in, for either the Sequential Discovery or Profile Discovery methods. This option is used for the Blade server and PureFlex system only. You cannot specify this option with the rack option. @@ -146,7 +146,7 @@ Command Version. 0 The command completed successfully. -1 An error has occured. +1 An error has occurred. =head1 EXAMPLES diff --git a/xCAT-client/pods/man1/nodediscoverstatus.1.pod b/xCAT-client/pods/man1/nodediscoverstatus.1.pod index 2e261fdef..f65597e40 100644 --- a/xCAT-client/pods/man1/nodediscoverstatus.1.pod +++ b/xCAT-client/pods/man1/nodediscoverstatus.1.pod @@ -25,7 +25,7 @@ Command Version. 0 The command completed successfully. -1 An error has occured. +1 An error has occurred. =head1 EXAMPLES diff --git a/xCAT-client/pods/man1/nodediscoverstop.1.pod b/xCAT-client/pods/man1/nodediscoverstop.1.pod index 8cde9a0cb..b8ce5b563 100644 --- a/xCAT-client/pods/man1/nodediscoverstop.1.pod +++ b/xCAT-client/pods/man1/nodediscoverstop.1.pod @@ -26,7 +26,7 @@ Command Version. 0 The command completed successfully. -1 An error has occured. +1 An error has occurred. =head1 EXAMPLES diff --git a/xCAT-client/pods/man1/nodeimport.1.pod b/xCAT-client/pods/man1/nodeimport.1.pod index 30087957b..2c3b670f7 100644 --- a/xCAT-client/pods/man1/nodeimport.1.pod +++ b/xCAT-client/pods/man1/nodeimport.1.pod @@ -10,7 +10,7 @@ B B I B I command creates nodes by importing a hostinfo file which is following stanza format. In this hostinfo file, we can define node's hostname, ip, mac, switch name, switch port and host location infomation like rack, chassis, start unit, server height...etc +The B command creates nodes by importing a hostinfo file which is following stanza format. In this hostinfo file, we can define node's hostname, ip, mac, switch name, switch port and host location information like rack, chassis, start unit, server height...etc After nodes imported, the configuration files related with these nodes will be updated automatically. For example: /etc/hosts, dns configuration, dhcp configuration. And the kits node plugins will also be triggered automatically to update kit related configuration/services. @@ -56,9 +56,9 @@ Sets the node groups that the imported node belongs to, where is a 0 The command completed successfully. -1 An error has occured while validating parameters. +1 An error has occurred while validating parameters. -2 An error has occured while parsing hostinfo file. +2 An error has occurred while parsing hostinfo file. =head1 EXAMPLES @@ -106,7 +106,7 @@ To import nodes using a profile, follow the following steps: # hostinfo end. - Another example of a node infomation file, a PureFlex X/P node defined: + Another example of a node information file, a PureFlex X/P node defined: # hostinfo begin # To define a PureFlex P/X node, chassis and slot id must be specified. # The chassis must be a PureFlex chassis. @@ -153,7 +153,7 @@ Description: The name of the node, where __hostname__ is automatically generated B> This is a mandatory item. -Description: Specify the MAC address for the NIC used by the provisionging node, where is the NICs MAC address. +Description: Specify the MAC address for the NIC used by the provisioning node, where is the NICs MAC address. B> This is a mandatory item, when define switch, switchport and node nic name relationship. @@ -183,9 +183,9 @@ B> This is an optional item. Description: node location info. Specify the rack name which this node will be placed into. If not specify this item, there will be no node location info set for this node. this item must be specified together with height + unit. -B> This is an optional item. +B> This is an optional item. -Description: node location info, for blade(or PureFlex) only. Specify the chasiss name which this blade will be placed into. this item can not be specified together with rack. +Description: node location info, for blade(or PureFlex) only. Specify the chassis name which this blade will be placed into. this item can not be specified together with rack. B> This is an optional item. diff --git a/xCAT-client/pods/man1/nodels.1.pod b/xCAT-client/pods/man1/nodels.1.pod index b976091bf..e3e76cd58 100644 --- a/xCAT-client/pods/man1/nodels.1.pod +++ b/xCAT-client/pods/man1/nodels.1.pod @@ -75,7 +75,7 @@ Force display of table name and column name context for each result =item B<-b|--blame> -For values inherited from groups, display which groups provided the inheritence +For values inherited from groups, display which groups provided the inheritance =item B<-S> diff --git a/xCAT-client/pods/man1/nodepurge.1.pod b/xCAT-client/pods/man1/nodepurge.1.pod index 73b6a94ba..714f164f2 100644 --- a/xCAT-client/pods/man1/nodepurge.1.pod +++ b/xCAT-client/pods/man1/nodepurge.1.pod @@ -32,7 +32,7 @@ The nodes to be removed. 0 The command completed successfully. -1 An error has occured. +1 An error has occurred. =head1 EXAMPLES diff --git a/xCAT-client/pods/man1/noderefresh.1.pod b/xCAT-client/pods/man1/noderefresh.1.pod index b25693c71..cafd50986 100644 --- a/xCAT-client/pods/man1/noderefresh.1.pod +++ b/xCAT-client/pods/man1/noderefresh.1.pod @@ -30,7 +30,7 @@ The nodes to be updated. 0 The command completed successfully. -1 An error has occured. +1 An error has occurred. =head1 EXAMPLES diff --git a/xCAT-client/pods/man1/nodestat.1.pod b/xCAT-client/pods/man1/nodestat.1.pod index 42a0dc5f0..fd964a3c9 100644 --- a/xCAT-client/pods/man1/nodestat.1.pod +++ b/xCAT-client/pods/man1/nodestat.1.pod @@ -41,7 +41,7 @@ Keywords to use: port -- the application daemon port number, if not specified, use internal list, then /etc/services. group -- the name of a node group that needs to get the application status from. If not specified, assume all the nodes in the nodelist table. To specify more than one groups, use group=a,group=b format. cmd -- the command that will be run locally on mn or sn. - lcmd -- the command that will be run the the mn only. + lcmd -- the command that will be run the mn only. dcmd -- the command that will be run distributed on the nodes using xdsh .... For commands specified by 'cmd' and 'lcmd', the input of is a list of comma separated node names, the output must be in the following format: @@ -63,7 +63,7 @@ Uses fping instead of nmap even if nmap is available. If you seem to be having =item B<-m>|B<--usemon> -Uses the settings from the B talbe to determine a list of applications that need to get status for. +Uses the settings from the B table to determine a list of applications that need to get status for. =item B<-p>|B<--powerstat> diff --git a/xCAT-client/pods/man1/rflash.1.pod b/xCAT-client/pods/man1/rflash.1.pod index de1f11e60..091eec11a 100644 --- a/xCAT-client/pods/man1/rflash.1.pod +++ b/xCAT-client/pods/man1/rflash.1.pod @@ -40,7 +40,7 @@ The command will update firmware for NeXtScale FPC when given an FPC node and th =head2 PPC (with HMC) specific: -The B command uses the B command to connect to the HMC controlling the given managed system and perform the updates. Before running B, use B to check if the related HMC ssh is enabled. To enable a HMC ssh connection, use B comamnd. +The B command uses the B command to connect to the HMC controlling the given managed system and perform the updates. Before running B, use B to check if the related HMC ssh is enabled. To enable a HMC ssh connection, use B command. B This command may take considerable time to complete, depending on the number of systems being updated and the workload on the target HMC. In particular, power subsystem updates may take an hour or more if there are many attached managed systems. @@ -50,7 +50,7 @@ The flash chip of a POWER5 and POWER6 managed system or power subsystem stores f The B<--commit> flag is used to write the contents of the temporary side of the flash to the permanent side. This flag should be used after updating code and verifying correct system operation. The B<--recover> flag is used to write the permanent side of the flash chip back to the temporary side. This flag should be used to recover from a corrupt flash operation, so that the previously running code can be restored. -BWhen the B<--commit> or B<--recover> two flags is used, the noderange B be BPA. It only B be CEC or LPAR ,and will take effect for B managed systems and power subsystems. +BWhen the B<--commit> or B<--recover> two flags is used, the noderange B be BPA. It only B be CEC or LPAR, and will take effect for B managed systems and power subsystems. xCAT recommends that you shutdown your Operating System images and power off your managed systems before applying disruptive updates to managed systems or power subsystems. @@ -68,7 +68,7 @@ The B option will load the new firmware into the T (temp) side, but wi In Direct FSP/BPA Management, there is B<-d> I option. The default value is /tmp. When doing firmware update, B will put some related data from rpm packages in directory, so the execution of B will require available disk space in for the command to properly execute: -For one GFW rpm package and one power code rpm package , if the GFW rpm package size is gfw_rpmsize, and the Power code rpm package size is power_rpmsize, it requires that the available disk space should be more than: 1.5*gfw_rpmsize + 1.5*power_rpmsize +For one GFW rpm package and one power code rpm package, if the GFW rpm package size is gfw_rpmsize, and the Power code rpm package size is power_rpmsize, it requires that the available disk space should be more than: 1.5*gfw_rpmsize + 1.5*power_rpmsize For Power 775, the B command takes effect on the primary and secondary FSPs or BPAs almost in parallel. @@ -76,7 +76,7 @@ For more details about the Firmware Update using Direct FSP/BPA Management, refe =head2 NeXtScale FPC specific: -The command will update firmware for NeXtScale FPC when given an FPC node and the http information needed to access the firmware. The http imformation required includes both the MN IP address as well as the directory containing the firmware. It is recommended that the firmware be downloaded and placed in the /install directory structure as the xCAT MN /install directory is configured with the correct permissions for http. Refer to the doc to get more details: XCAT_NeXtScale_Clusters +The command will update firmware for NeXtScale FPC when given an FPC node and the http information needed to access the firmware. The http information required includes both the MN IP address as well as the directory containing the firmware. It is recommended that the firmware be downloaded and placed in the /install directory structure as the xCAT MN /install directory is configured with the correct permissions for http. Refer to the doc to get more details: XCAT_NeXtScale_Clusters =head2 OpenPOWER specific: @@ -92,7 +92,7 @@ Writes the command's usage statement to standard output. =item B<-c|--check> -Chech the firmware version of BMC and HPM file. +Check the firmware version of BMC and HPM file. =item B<-p> I @@ -139,12 +139,12 @@ Verbose output. =over 4 =item 1. -To update only the power subsystem attached to a single HMC-attached pSeries CEC(cec_name), and recycle the power subsystem and all attached managed systems when the update is complete, and the Microcode update package and associated XML file are in /tmp/fw, enter: +To update only the power subsystem attached to a single HMC-attached pSeries CEC(cec_name), and recycle the power subsystem and all attached managed systems when the update is complete, and the Microcode update package and associated XML file are in /tmp/fw, enter: rflash cec_name -p /tmp/fw --activate disruptive =item 2. -To update only the power subsystem attached to a single HMC-attached pSeries node, and recycle the power subsystem and all attached managed systems when the update is complete, and the Microcode update package and associated XML file are in /tmp/fw, enter: +To update only the power subsystem attached to a single HMC-attached pSeries node, and recycle the power subsystem and all attached managed systems when the update is complete, and the Microcode update package and associated XML file are in /tmp/fw, enter: rflash bpa_name -p /tmp/fw --activate disruptive @@ -154,7 +154,7 @@ To commit a firmware update to permanent flash for both managed system and the r rflash cec_name --commit =item 4. -To update the firmware on a NeXtScale FPC specify the FPC node name and the HTTP location of the file including the xCAT MN IP address and the directory on the xCAT MN containing the firmware as follows: +To update the firmware on a NeXtScale FPC specify the FPC node name and the HTTP location of the file including the xCAT MN IP address and the directory on the xCAT MN containing the firmware as follows: rflash fpc01 http://10.1.147.169/install/firmware/fhet17a/ibm_fw_fpc_fhet17a-2.02_anyos_noarch.rom diff --git a/xCAT-client/pods/man1/rinv.1.pod b/xCAT-client/pods/man1/rinv.1.pod index 3a5c92f29..30fab0f2c 100644 --- a/xCAT-client/pods/man1/rinv.1.pod +++ b/xCAT-client/pods/man1/rinv.1.pod @@ -69,10 +69,10 @@ B I [B<--zfcppoolnames>] =head1 B -B retrieves hardware configuration information from the on-board +B retrieves hardware configuration information from the on-board Service Processor for a single or range of nodes and groups. -Calling B for VMware will display the UUID/GUID, nuumber of CPUs, amount of memory, the MAC address and a list of Hard disks. The output for each Hard disk includes the label, size and backing file location. +Calling B for VMware will display the UUID/GUID, number of CPUs, amount of memory, the MAC address and a list of Hard disks. The output for each Hard disk includes the label, size and backing file location. =head1 B @@ -88,7 +88,7 @@ List all buses for each I/O slot. =item B -Retrieves number of processors, speed, total memory, and DIMM +Retrieves number of processors, speed, total memory, and DIMM locations. =item B diff --git a/xCAT-client/pods/man1/rmdocker.1.pod b/xCAT-client/pods/man1/rmdocker.1.pod index efe339027..d02992870 100644 --- a/xCAT-client/pods/man1/rmdocker.1.pod +++ b/xCAT-client/pods/man1/rmdocker.1.pod @@ -29,7 +29,7 @@ Force to removal of a running container or failed to disconnect customized netwo =head1 EXAMPLES rmdocker host01c01 - host01c01: Disconnect customzied network 'mynet0' done + host01c01: Disconnect customized network 'mynet0' done host01c01: success =head1 SEE ALSO diff --git a/xCAT-client/pods/man1/rmdsklsnode.1.pod b/xCAT-client/pods/man1/rmdsklsnode.1.pod index 9500d2290..f7ed75e27 100644 --- a/xCAT-client/pods/man1/rmdsklsnode.1.pod +++ b/xCAT-client/pods/man1/rmdsklsnode.1.pod @@ -20,11 +20,11 @@ If the node you are trying to remove is currently running the B com B -If you used the "-n" option when you created the NIM client definitions with the B command then the NIM client machine names would be a combination of the xCAT node name and the osimage name used to initialize the NIM machine. To remove these definitions you must provide the name of the osimage that was used using the "-i" option. +If you used the "-n" option when you created the NIM client definitions with the B command then the NIM client machine names would be a combination of the xCAT node name and the osimage name used to initialize the NIM machine. To remove these definitions, you must provide the name of the osimage that was used using the "-i" option. -In most cases you would most likely want to remove the old client definitions without disturbing the nodes that you just booted with the new alternate client definition. The B option can be used to remove the old alternate client defintions without stopping the running node. +In most cases you would most likely want to remove the old client definitions without disturbing the nodes that you just booted with the new alternate client definition. The B option can be used to remove the old alternate client definitions without stopping the running node. -However, if you have NIM dump resources assign to your nodes be aware that when the old NIM alternate client definitions are removed it will leave the nodes unable to produce a system dump. This is a current limitation in the NIM support for alternate client definitions. For this reason it is recommended that you wait to do this cleanup until right before you do your next upgrade. +However, if you have NIM dump resources assign to your nodes be aware that when the old NIM alternate client definitions are removed it will leave the nodes unable to produce a system dump. This is a current limitation in the NIM support for alternate client definitions. For this reason, it is recommended that you wait to do this cleanup until right before you do your next upgrade. =head1 OPTIONS @@ -36,8 +36,7 @@ Use the force option to stop and remove running nodes. This handles the situatio =item B<-b |--backupSN> -When using backup service nodes only update the backup. The default is to updat -e both the primary and backup service nodes. +When using backup service nodes only update the backup. The default is to update both the primary and backup service nodes. =item B<-h |--help> @@ -53,8 +52,7 @@ A set of comma delimited node names and/or group names. See the "noderange" man =item B<-p|--primarySN> -When using backup service nodes only update the primary. The default is to upda -te both the primary and backup service nodes. +When using backup service nodes only update the primary. The default is to update both the primary and backup service nodes. =item B<-r|--remdef> diff --git a/xCAT-client/pods/man1/rmhwconn.1.pod b/xCAT-client/pods/man1/rmhwconn.1.pod index 86ea9a15e..d0dd7cad9 100644 --- a/xCAT-client/pods/man1/rmhwconn.1.pod +++ b/xCAT-client/pods/man1/rmhwconn.1.pod @@ -24,7 +24,7 @@ B B<-s> For PPC (with HMC) specific: -This command is used to disconnect CEC and Frame nodes from HMC nodes, according to the connection information defined in ppc talbe in xCAT DB. +This command is used to disconnect CEC and Frame nodes from HMC nodes, according to the connection information defined in ppc table in xCAT DB. Note: If a CEC belongs to a frame with a BPA installed, this CEC cannot be disconnected individually. Instead, the whole frame should be disconnected. diff --git a/xCAT-client/pods/man1/rmigrate.1.pod b/xCAT-client/pods/man1/rmigrate.1.pod index fea02a867..2be54a94f 100644 --- a/xCAT-client/pods/man1/rmigrate.1.pod +++ b/xCAT-client/pods/man1/rmigrate.1.pod @@ -49,7 +49,7 @@ The maximum quiesce time a VM may be stopped during a relocation attempt. =head1 B B table - -Table governing VM paramaters. See L for further details. +Table governing VM parameters. See L for further details. This is used to determine the current host to migrate from. =head1 B diff --git a/xCAT-client/pods/man1/rmkitcomp.1.pod b/xCAT-client/pods/man1/rmkitcomp.1.pod index 591f0cfd7..5484300dc 100644 --- a/xCAT-client/pods/man1/rmkitcomp.1.pod +++ b/xCAT-client/pods/man1/rmkitcomp.1.pod @@ -10,7 +10,7 @@ B [B<-V>|B<--verbose>] [B<-u>|B<--uninstall>] [B<-f>|B<--force>] [B<- =head1 DESCRIPTION -The B command removes kit components from an xCAT osimage. All the kit component attribute values that are contained in the osimage will be removed, and the kit comoponent meta rpm and package rpm could be uninstalled by B<-u|--uninstall> option. +The B command removes kit components from an xCAT osimage. All the kit component attribute values that are contained in the osimage will be removed, and the kit component meta rpm and package rpm could be uninstalled by B<-u|--uninstall> option. Note: The xCAT support for Kits is only available for Linux operating systems. diff --git a/xCAT-client/pods/man1/rmvm.1.pod b/xCAT-client/pods/man1/rmvm.1.pod index 959a350d8..2dcf8cc67 100644 --- a/xCAT-client/pods/man1/rmvm.1.pod +++ b/xCAT-client/pods/man1/rmvm.1.pod @@ -37,7 +37,7 @@ B<-r> Retain the data object definitions of the nodes. B<--service> Remove the service partitions of the specified CECs. -B<-p> KVM: Purge the existence of the VM from persistant storage. This will erase all storage related to the VM in addition to removing it from the active virtualization configuration. PPC: Remove the specified partiton on normal power machine. +B<-p> KVM: Purge the existence of the VM from persistent storage. This will erase all storage related to the VM in addition to removing it from the active virtualization configuration. PPC: Remove the specified partition on normal power machine. B<-f> Force remove the VM, even if the VM appears to be online. This will bring down a live VM if requested. diff --git a/xCAT-client/pods/man1/rnetboot.1.pod b/xCAT-client/pods/man1/rnetboot.1.pod index 6b9fc9671..e968e9f2d 100644 --- a/xCAT-client/pods/man1/rnetboot.1.pod +++ b/xCAT-client/pods/man1/rnetboot.1.pod @@ -41,11 +41,11 @@ Note: if the "val" fields includes spaces or any other characters that will be p B<-r> -specify the number of retries that the monitoring process will perform before declare the failure. The default value is 3. Setting the retrycount to 0 means only monitoring the os installation progress and will not re-initiate the installation if the node status has not been changed to the expected value after timeout. This flag must be used with -m flag. +specify the number of retries that the monitoring process will perform before declaring the failure. The default value is 3. Setting the retrycount to 0 means only monitoring the os installation progress and will not re-initiate the installation if the node status has not been changed to the expected value after timeout. This flag must be used with -m flag. B<-t> -Specify the the timeout, in minutes, to wait for the expectedstatus specified by -m flag. This is a required flag if the -m flag is specified. +Specify the timeout, in minutes, to wait for the expectedstatus specified by -m flag. This is a required flag if the -m flag is specified. B<-V|--verbose> diff --git a/xCAT-client/pods/man1/rpower.1.pod b/xCAT-client/pods/man1/rpower.1.pod index fd676c268..0e38e78c8 100644 --- a/xCAT-client/pods/man1/rpower.1.pod +++ b/xCAT-client/pods/man1/rpower.1.pod @@ -104,7 +104,7 @@ Exit Rack standby will be the default state that a rack goes into when power is =item B -Reboot the service processor. If there are primary and secondary FSPs/BPAs of one cec/frame, it will reboot them almost at the sametime. +Reboot the service processor. If there are primary and secondary FSPs/BPAs of one cec/frame, it will reboot them almost at the same time. =item B @@ -207,11 +207,11 @@ Do not use dependency table (default is to use dependency table). Valid only wit =item B<-r> I -specify the number of retries that the monitoring process will perform before declare the failure. The default value is 3. Setting the retrycount to 0 means only monitoring the os installation progress and will not re-initiate the installation if the node status has not been changed to the expected value after timeout. This flag must be used with -m flag. +specify the number of retries that the monitoring process will perform before declaring the failure. The default value is 3. Setting the retrycount to 0 means only monitoring the os installation progress and will not re-initiate the installation if the node status has not been changed to the expected value after timeout. This flag must be used with -m flag. =item B<-t> I -Specify the the timeout, in minutes, to wait for the expectedstatus specified by -m flag. This is a required flag if the -m flag is specified. +Specify the timeout, in minutes, to wait for the expectedstatus specified by -m flag. This is a required flag if the -m flag is specified. Power off, then on. diff --git a/xCAT-client/pods/man1/rspconfig.1.pod b/xCAT-client/pods/man1/rspconfig.1.pod index 900224f65..aba5fcd5a 100644 --- a/xCAT-client/pods/man1/rspconfig.1.pod +++ b/xCAT-client/pods/man1/rspconfig.1.pod @@ -416,7 +416,7 @@ Set the blade or MPA textid. When using '*', the textid used is the node name sp =item B={I} B={B} -Change the password of the userid B for CMM in Flex system cluster. The option I can be used to specify whether updating the password of BMCs that connected to the speified CMM. The value is 'y' by default which means whenever updating the password of CMM, the password of BMCs will be also updated. Note that there will be several seconds needed before this command complete. +Change the password of the userid B for CMM in Flex system cluster. The option I can be used to specify whether updating the password of BMCs that connected to the specified CMM. The value is 'y' by default which means whenever updating the password of CMM, the password of BMCs will be also updated. Note that there will be several seconds needed before this command complete. If value "*" is specified for USERID and the object node is I, the password used to access the BMC of the System X node through IPMI will be updated as the same password of the userid B of the CMM in the same cluster. diff --git a/xCAT-client/pods/man1/sinv.1.pod b/xCAT-client/pods/man1/sinv.1.pod index 9c08ced7e..b81db7b57 100644 --- a/xCAT-client/pods/man1/sinv.1.pod +++ b/xCAT-client/pods/man1/sinv.1.pod @@ -95,7 +95,7 @@ If there is no match, and we are not over the template count, then a new template will be created from the node output. This will result in having all nodes that match a given template reported in their group at the end of the run in the output file. -If no template count is specified, 0 is the default, and all nodes will +If no template count is specified, 0 is the default, and all nodes will be compared against the first template. =item B<-s>|B<--seed> I @@ -104,7 +104,7 @@ This is the node that will be used to build the first template that is stored in template path. You can use this parameter instead of running the command yourself to build the template. -B If the template path file does not exists, and no seed node is +B If the template path file does not exist, and no seed node is supplied, the seed node automatically is one node in the noderange. @@ -126,7 +126,7 @@ template (except for xdshcoll header and comments). If not in exactmatch mode, there can exist more lines in the xdsh return from the nodes. For example, if running a "rpm -qa | grep xCAT" command, without exactmatch -set, if the node containes more xCAT rpms that listed in the template, +set, if the node contains more xCAT rpms that listed in the template, it would be considered a match, as long as all rpms listed in the template were on the node. With exactmatch set, the output must be identical to the template. @@ -137,7 +137,7 @@ Specify a user-defined device type that references the location of relevant device configuration file. The devicetype value must correspond to a valid device configuration file. xCAT ships some default configuration files -for Ethernet switches and and IB switches under +for Ethernet switches and IB switches under I directory. If you want to overwrite any of the configuration files, copy them to I directory and cutomize. diff --git a/xCAT-client/pods/man1/snmove.1.pod b/xCAT-client/pods/man1/snmove.1.pod index 477ba7ea6..d1e4fad4d 100644 --- a/xCAT-client/pods/man1/snmove.1.pod +++ b/xCAT-client/pods/man1/snmove.1.pod @@ -40,7 +40,7 @@ node is second. The B attribute must be set to the hostname of the primary service node as it is known by the node. When the B command is run it modifies the xCAT database to -switch the the primary server to the backup server. +switch the primary server to the backup server. It will also check the other services that are being used for the node (tftpserver, monserver, nfsserver, conserver), and if they were set @@ -84,11 +84,11 @@ No modifications will be made on the nodes. If not specified, several xCAT posts =item B<-l|--liteonly> -Use this option to ONLY synchronize any AIX statelite files from the primary server to the backup server for the nodes. It will not do the actual moving of thre nodes the the backup servers. +Use this option to ONLY synchronize any AIX statelite files from the primary server to the backup server for the nodes. It will not do the actual moving of the nodes to the backup servers. =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 B 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. +Specifies a list of extra postscripts to be run on the nodes after the nodes are moved over to the new service node. If B 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<-s|--source> diff --git a/xCAT-client/pods/man1/swapnodes.1.pod b/xCAT-client/pods/man1/swapnodes.1.pod index c1e17308f..63b3c59f2 100644 --- a/xCAT-client/pods/man1/swapnodes.1.pod +++ b/xCAT-client/pods/man1/swapnodes.1.pod @@ -25,7 +25,7 @@ The B command shouldn't make the decision of which 2 nodes are swappe After running B command, the order of the I/O devices may be changed after IO re-assignment, so the administrator needs to run B to set the boot string for the current_node. And then boot the node with the same image and same postscripts because they have the same attributes. -Without B<-o> option, it's used to swap the location info in the db between 2 nodes. With B<-o> option, it's used to move the I definition to I (the 2nd octant), not move the I definition to the 1st octant. If the two nodes are in a cec, it will assign the IO adapters that were assigned to the defective node to the available node. Originally, the I is a defective non-compute node, and I is a avaible compute node. After the swapping, the I will be a available node. +Without B<-o> option, it's used to swap the location info in the db between 2 nodes. With B<-o> option, it's used to move the I definition to I (the 2nd octant), not move the I definition to the 1st octant. If the two nodes are in a cec, it will assign the IO adapters that were assigned to the defective node to the available node. Originally, the I is a defective non-compute node, and I is a available compute node. After the swapping, the I will be a available node. =head1 OPTIONS @@ -61,12 +61,12 @@ one way. Only move the I definition to the I's hardware =over 3 =item 1. -To swap the service node attributes and IO assignments between sn1 and compute2 which are in the same cec, all the attributes in the ppc table and nodepos talbe of the two node will be swapped, and the the I/O adapters from the defective node (the original sn1) will be assigned to the available node (the original compute2). After the swapping, the sn1 will use the compute2's hardware resource and the I/O adapters from the original sn1. +To swap the service node attributes and IO assignments between sn1 and compute2 which are in the same cec, all the attributes in the ppc table and nodepos table of the two node will be swapped, and the I/O adapters from the defective node (the original sn1) will be assigned to the available node (the original compute2). After the swapping, the sn1 will use the compute2's hardware resource and the I/O adapters from the original sn1. swapnodes -c sn1 -f compute2 =item 2. -To swap the service node attributes and IO assignments between sn1 and compute2 which are NOT in the same cec, all the attributes in the ppc table and nodepos talbe of the two node will be swapped. After the swapping, the sn1 will use the compute2's hardware resource. +To swap the service node attributes and IO assignments between sn1 and compute2 which are NOT in the same cec, all the attributes in the ppc table and nodepos table of the two node will be swapped. After the swapping, the sn1 will use the compute2's hardware resource. swapnodes -c sn1 -f compute2 diff --git a/xCAT-client/pods/man1/switchdiscover.1.pod b/xCAT-client/pods/man1/switchdiscover.1.pod index 7bcdbc27b..ec16fcaad 100755 --- a/xCAT-client/pods/man1/switchdiscover.1.pod +++ b/xCAT-client/pods/man1/switchdiscover.1.pod @@ -16,13 +16,13 @@ B [I | B<--range> I] B<[-V] [-w][-r|-x|-z] =head1 DESCRIPTION -The switchdiscover command scans the subnets and discovers all the swithches on the subnets. The command takes a list of subnets as input. The default subnets are the ones that the xCAT management node is on. It uses nmap command as default to discover the switches. However, you can specify other discovery methods such as lldp or snmp with B<-s> flag. You can write the discovered switches into xCAT database with B<-w> flag. This command supports may output formats such as xml(B<-x>), raw(B<-r>) and stanza(B<-z>) in addition to the default format. +The switchdiscover command scans the subnets and discovers all the switches on the subnets. The command takes a list of subnets as input. The default subnets are the ones that the xCAT management node is on. It uses nmap command as default to discover the switches. However, you can specify other discovery methods such as lldp or snmp with B<-s> flag. You can write the discovered switches into xCAT database with B<-w> flag. This command supports may output formats such as xml(B<-x>), raw(B<-r>) and stanza(B<-z>) in addition to the default format. B<--setup> flag is for switch-based switch discovery. It will find all the discovered switches on the subnets, then match them with predefined switches in the xCATDB. Next, it will set discovered switches with static ip address and hostname based on the predefined switch. It will also enable snmpv3 configuration. The details of the process are defined in the http://xcat-docs.readthedocs.io/en/latest/advanced/networks/switchdiscover/switches_discovery.html. -To view all the switches defined in the xCAT databasee use B command. +To view all the switches defined in the xCAT database use B command. -For lldp method, make sure that lldpd package is installed and lldpd is running on the xCAT management node. lldpd comes from xcat-dep packge or you can get it from http://vincentbernat.github.io/lldpd/installation.html. +For lldp method, make sure that lldpd package is installed and lldpd is running on the xCAT management node. lldpd comes from xcat-dep package or you can get it from http://vincentbernat.github.io/lldpd/installation.html. For snmp method, make sure that snmpwalk command is installed and snmp is enabled for switches. To install snmpwalk, "yum install net-snmp-utils" for redhat and sles, "apt-get install snmp" for Ubuntu. @@ -77,11 +77,11 @@ Writes output to xCAT database. =item B<-x> -XML formated output. +XML formatted output. =item B<-z> -Stanza formated output. +Stanza formatted output. =item B<--setup> diff --git a/xCAT-client/pods/man1/updatenode.1.pod b/xCAT-client/pods/man1/updatenode.1.pod index 5f7f060f2..582a9da26 100644 --- a/xCAT-client/pods/man1/updatenode.1.pod +++ b/xCAT-client/pods/man1/updatenode.1.pod @@ -249,7 +249,7 @@ A comma-separated list of script names. The scripts must be executable and copied to the /install/postscripts directory. Each script can take zero or more parameters. -If parameters are spcified, the whole list needs to be quoted by double quotes. +If parameters are specified, the whole list needs to be quoted by double quotes. For example: "script1 p1 p2,script2" @@ -259,7 +259,7 @@ For example: Specifies one or more "attribute equals value" pairs, separated by spaces. Attr=val pairs must be specified last on the command line. The currently supported attributes are: "installp_bundle", "otherpkgs", "installp_flags", -"emgr_flags" and "rpm_flags". These attribute are only valid for AIX software +"emgr_flags" and "rpm_flags". These attributes are only valid for AIX software maintenance support. =back @@ -270,9 +270,7 @@ maintenance support. =item B<--fanout>=I -Specifies a fanout value for the maximum number of concur- -rently executing remote shell processes. Serial execution -can be specified by indicating a fanout value of B<1>. If B<--fanout> is not specified, a default fanout value of B<64> is used. +Specifies a fanout value for the maximum number of concurrently executing remote shell processes. Serial execution can be specified by indicating a fanout value of B<1>. If B<--fanout> is not specified, a default fanout value of B<64> is used. =item B<-A|--updateallsw> @@ -340,7 +338,7 @@ Specifies a non-root user name to use for remote command execution. This option AIX and Linux and updating software (-S) for Linux only. The non-root userid must be previously defined as an xCAT user. The userid sudo setup will have to be done by the admin on the node. -This is not supported in a hiearchical cluster, that is the node is serviced by a service node. +This is not supported in a hierarchical cluster, that is the node is serviced by a service node. See the document Granting_Users_xCAT_privileges for required xcat/sudo setup. diff --git a/xCAT-client/pods/man1/xcat2nim.1.pod b/xCAT-client/pods/man1/xcat2nim.1.pod index 97e7e9aee..318aad0df 100644 --- a/xCAT-client/pods/man1/xcat2nim.1.pod +++ b/xCAT-client/pods/man1/xcat2nim.1.pod @@ -98,7 +98,7 @@ B<-V|--verbose> Verbose mode. xcat2nim -l -t node clstrn02 -7. To re-create a NIM machine definiton and display verbose output. +7. To re-create a NIM machine definition and display verbose output. xcat2nim -V -t node -f clstrn05 From dbf52b4be79aa77e3d3757ef3bdac4f4b2db0ee1 Mon Sep 17 00:00:00 2001 From: Casandra Qiu Date: Tue, 6 Jun 2017 15:37:31 -0400 Subject: [PATCH 118/129] Add global mac address for mallanox switches --- xCAT-server/lib/xcat/plugins/switchdiscover.pm | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/xCAT-server/lib/xcat/plugins/switchdiscover.pm b/xCAT-server/lib/xcat/plugins/switchdiscover.pm index 12b3dc03c..168cf6ea8 100644 --- a/xCAT-server/lib/xcat/plugins/switchdiscover.pm +++ b/xCAT-server/lib/xcat/plugins/switchdiscover.pm @@ -38,6 +38,15 @@ my %global_mac_identity = ( "6c:ae:8b" => "BNT G8264-T switch", "fc:cf:62" => "BNT G8124 switch", "7c:fe:90" => "Mellanox switch", + "e4:1d:2d" => "Mellanox switch", + "24:8a:07" => "Mellanox switch", + "00:25:8b" => "Mellanox switch", + "00:02:c9" => "Mellanox switch", + "f4:52:14" => "Mellanox switch", + "ec:0d:9a" => "Mellanox switch", + "cc:37:ab" => "Edgecore Networks Switch", + "a8:2b:b5" => "Edgecore Networks Switch", + "70:72:cf" => "Edgecore Networks Switch", "8c:ea:1b" => "Edgecore Networks Switch" ); @@ -54,6 +63,8 @@ my %global_switch_type = ( mellanox => "Mellanox", MLNX => "Mellanox", MELLAN => "Mellanox", + Cumulus => "onie", + cumulus => "onie", Edgecore => "onie" ); From 0aff97e196a9affe9a56a883a7a674c0156d3517 Mon Sep 17 00:00:00 2001 From: XuWei Date: Wed, 7 Jun 2017 04:00:17 -0400 Subject: [PATCH 119/129] fix testcase clear_openbmc_simulator error --- xCAT-test/autotest/testcase/simulator/change_ip.sh | 4 +++- xCAT-test/autotest/testcase/simulator/clear_simulator | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/xCAT-test/autotest/testcase/simulator/change_ip.sh b/xCAT-test/autotest/testcase/simulator/change_ip.sh index 15ed0ad7c..59fb80b0a 100755 --- a/xCAT-test/autotest/testcase/simulator/change_ip.sh +++ b/xCAT-test/autotest/testcase/simulator/change_ip.sh @@ -13,7 +13,9 @@ elif [ $flag = "-c" ]; then cnip=`cat /tmp/simulator` chdef $cnhn bmc=$cnip process=`ps aux | grep "simulator" | grep "python" | awk -F ' ' '{print $2}'` - kill $process + if [ $process ]; then + kill $process + fi rm -rf "openbmc_simulator" fi exit $? diff --git a/xCAT-test/autotest/testcase/simulator/clear_simulator b/xCAT-test/autotest/testcase/simulator/clear_simulator index 85b2557bd..61e2207c9 100644 --- a/xCAT-test/autotest/testcase/simulator/clear_simulator +++ b/xCAT-test/autotest/testcase/simulator/clear_simulator @@ -1,5 +1,5 @@ start:clear_openbmc_simulator description:clear evironment -cmd:/opt/xcat/share/xcat/tools/autotest/testcase/setup_simulator/change_ip.sh -c $$MN $$CN +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/simulator/change_ip.sh -c $$MN $$CN check:rc==0 end From b5827d3797e75cad8d143458cb95abccc62e0981 Mon Sep 17 00:00:00 2001 From: GONG Jie Date: Wed, 7 Jun 2017 17:17:21 +0800 Subject: [PATCH 120/129] Revert "Add more verifications in migration test cases" (#3228) --- xCAT-test/autotest/testcase/migration/redhat_migration | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/xCAT-test/autotest/testcase/migration/redhat_migration b/xCAT-test/autotest/testcase/migration/redhat_migration index f3817dd47..6ce3b9432 100644 --- a/xCAT-test/autotest/testcase/migration/redhat_migration +++ b/xCAT-test/autotest/testcase/migration/redhat_migration @@ -72,11 +72,10 @@ cmd:xdsh $$CN "service xcatd status" check:rc==0 check:output=~running cmd:lsdef $$SN -z | ssh $$CN "mkdef -z" -cmd:ssh $$CN "rscan __GETNODEATTR($$SN,hcp)__ -w" cmd:ssh $$CN "chdef $$SN servicenode= monserver= nfsserver= tftpserver= xcatmaster=" cmd:makedhcp -d $$SN cmd:scp $$ISO $$CN:/tmp/foobar.iso -cmd:ssh $$CN "copycds -n __GETNODEATTR($$CN,os)__ /tmp/foobar.iso" +cmd:ssh $$CN "copycds /tmp/foobar.iso" cmd:ssh $$CN "makedhcp -n" check:rc==0 cmd:xdsh $$CN "cd /; scp -r $$MN:/core-rpms-snap.tar.bz2 /" @@ -98,8 +97,6 @@ check:rc==0 check:output=~running cmd:latest_version_info=`lsxcatd -v`;xdsh $$CN "lsxcatd -v" | grep "$latest_version_info" check:rc==0 -cmd:ssh $$CN "lsdef -t osimage osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute" -check:rc==0 cmd:ssh $$CN "rinstall $$SN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute" check:rc==0 cmd:sleep 300 @@ -187,11 +184,10 @@ cmd:xdsh $$CN "service xcatd status" check:rc==0 check:output=~running cmd:lsdef $$SN -z | ssh $$CN "mkdef -z" -cmd:ssh $$CN "rscan __GETNODEATTR($$SN,hcp)__ -w" cmd:ssh $$CN "chdef $$SN servicenode= monserver= nfsserver= tftpserver= xcatmaster=" cmd:makedhcp -d $$SN cmd:scp $$ISO $$CN:/tmp/foobar.iso -cmd:ssh $$CN "copycds -n __GETNODEATTR($$CN,os)__ /tmp/foobar.iso" +cmd:ssh $$CN "copycds /tmp/foobar.iso" cmd:ssh $$CN "makedhcp -n" cmd:check==0 cmd:xdsh $$CN "cd /; scp -r $$MN:/core-rpms-snap.tar.bz2 /" @@ -211,8 +207,6 @@ check:rc==0 cmd:xdsh $$CN "service xcatd status" check:rc==0 check:output=~running -cmd:ssh $$CN "lsdef -t osimage osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute" -check:rc==0 cmd:ssh $$CN "rinstall $$SN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute" check:rc==0 cmd:sleep 300 From 374991356f9774d7529893f4471dbfeec46adbbc Mon Sep 17 00:00:00 2001 From: GONG Jie Date: Wed, 7 Jun 2017 17:18:39 +0800 Subject: [PATCH 121/129] Revert "Do operating system deployment in migration test cases" (#3229) --- .../testcase/migration/redhat_migration | 42 +++++++------------ .../testcase/migration/sles_migration | 42 +++++++------------ .../testcase/migration/ubuntu_migration1_p8le | 21 ++++------ .../testcase/migration/ubuntu_migration1_vm | 21 ++++------ .../testcase/migration/ubuntu_migration2_p8le | 21 ++++------ .../testcase/migration/ubuntu_migration2_vm | 21 ++++------ 6 files changed, 57 insertions(+), 111 deletions(-) diff --git a/xCAT-test/autotest/testcase/migration/redhat_migration b/xCAT-test/autotest/testcase/migration/redhat_migration index 6ce3b9432..c2d43ff7b 100644 --- a/xCAT-test/autotest/testcase/migration/redhat_migration +++ b/xCAT-test/autotest/testcase/migration/redhat_migration @@ -71,13 +71,11 @@ check:output=~$$MIGRATION1_VERSION cmd:xdsh $$CN "service xcatd status" check:rc==0 check:output=~running -cmd:lsdef $$SN -z | ssh $$CN "mkdef -z" -cmd:ssh $$CN "chdef $$SN servicenode= monserver= nfsserver= tftpserver= xcatmaster=" -cmd:makedhcp -d $$SN -cmd:scp $$ISO $$CN:/tmp/foobar.iso -cmd:ssh $$CN "copycds /tmp/foobar.iso" -cmd:ssh $$CN "makedhcp -n" +cmd:xdsh $$CN "chdef -t node -o node0001 nodetype=osi groups=linux" check:rc==0 +cmd:xdsh $$CN "lsdef" +check:output=~node0001 +cmd:check==0 cmd:xdsh $$CN "cd /; scp -r $$MN:/core-rpms-snap.tar.bz2 /" check:rc==0 cmd:xdsh $$CN "cd /; scp -r $$MN:/xcat-dep*.tar.bz2 /" @@ -95,15 +93,12 @@ check:rc==0 cmd:xdsh $$CN "service xcatd status" check:rc==0 check:output=~running +cmd:xdsh $$CN "lsdef" +check:output=~node0001 +cmd:xdsh $$CN "noderm node0001" +check:rc==0 cmd:latest_version_info=`lsxcatd -v`;xdsh $$CN "lsxcatd -v" | grep "$latest_version_info" check:rc==0 -cmd:ssh $$CN "rinstall $$SN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute" -check:rc==0 -cmd:sleep 300 -cmd:ssh $$CN "a=0; while ! `lsdef -l $$SN | grep status | grep booted >/dev/null`; do ((++a > 90)) && exit 99; sleep 20; done" -check:rc==0 -cmd:ssh $$CN "xdsh $$SN date" -check:rc==0 cmd:if [[ -f /tmp/servicelabel ]];then chdef $$SN -p groups=service;rm -rf /tmp/servicelabel;fi check:rc==0 cmd:if [[ -f /tmp/poweroffsn ]];then rpower $$SN on > /dev/null;rm -rf /tmp/poweroffsn;fi @@ -183,12 +178,10 @@ check:output=~$$MIGRATION2_VERSION cmd:xdsh $$CN "service xcatd status" check:rc==0 check:output=~running -cmd:lsdef $$SN -z | ssh $$CN "mkdef -z" -cmd:ssh $$CN "chdef $$SN servicenode= monserver= nfsserver= tftpserver= xcatmaster=" -cmd:makedhcp -d $$SN -cmd:scp $$ISO $$CN:/tmp/foobar.iso -cmd:ssh $$CN "copycds /tmp/foobar.iso" -cmd:ssh $$CN "makedhcp -n" +cmd:xdsh $$CN "chdef -t node -o node0001 nodetype=osi groups=linux" +check:rc==0 +cmd:xdsh $$CN "lsdef" +check:output=~node0001 cmd:check==0 cmd:xdsh $$CN "cd /; scp -r $$MN:/core-rpms-snap.tar.bz2 /" check:rc==0 @@ -207,14 +200,9 @@ check:rc==0 cmd:xdsh $$CN "service xcatd status" check:rc==0 check:output=~running -cmd:ssh $$CN "rinstall $$SN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute" -check:rc==0 -cmd:sleep 300 -cmd:ssh $$CN "a=0; while ! `lsdef -l $$SN | grep status | grep booted >/dev/null`; do ((++a > 90)) && exit 99; sleep 20; done" -check:rc==0 -cmd:ssh $$CN "xdsh $$SN date" -check:rc==0 -cmd:xdsh $$CN "/opt/xcat/share/xcat/tools/go-xcat smoke-test" +cmd:xdsh $$CN "lsdef" +check:output=~node0001 +cmd:xdsh $$CN "noderm node0001" check:rc==0 cmd:latest_version_info=`lsxcatd -v`;xdsh $$CN "lsxcatd -v" | grep "$latest_version_info" check:rc==0 diff --git a/xCAT-test/autotest/testcase/migration/sles_migration b/xCAT-test/autotest/testcase/migration/sles_migration index d822385e0..f20f56edb 100644 --- a/xCAT-test/autotest/testcase/migration/sles_migration +++ b/xCAT-test/autotest/testcase/migration/sles_migration @@ -74,12 +74,10 @@ check:output=~$$MIGRATION1_VERSION cmd:xdsh $$CN "service xcatd status" check:rc==0 check:output=~running -cmd:lsdef $$SN -z | ssh $$CN "mkdef -z" -cmd:ssh $$CN "chdef $$SN servicenode= monserver= nfsserver= tftpserver= xcatmaster=" -cmd:makedhcp -d $$SN -cmd:scp $$ISO $$CN:/tmp/foobar.iso -cmd:ssh $$CN "copycds /tmp/foobar.iso" -cmd:ssh $$CN "makedhcp -n" +cmd:xdsh $$CN "chdef -t node -o node0001 nodetype=osi groups=linux" +check:rc==0 +cmd:xdsh $$CN "lsdef" +check:output=~node0001 cmd:xdsh $$CN "cd /; scp -r $$MN:/core-rpms-snap.tar.bz2 /" check:rc==0 cmd:xdsh $$CN "cd /; scp -r $$MN:/xcat-dep*.tar.bz2 /" @@ -97,14 +95,9 @@ check:rc==0 cmd:xdsh $$CN "service xcatd status" check:rc==0 check:output=~running -cmd:ssh $$CN "rinstall $$SN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute" -check:rc==0 -cmd:sleep 300 -cmd:ssh $$CN "a=0; while ! `lsdef -l $$SN | grep status | grep booted >/dev/null`; do ((++a > 90)) && exit 99; sleep 20; done" -check:rc==0 -cmd:ssh $$CN "xdsh $$SN date" -check:rc==0 -cmd:xdsh $$CN "/opt/xcat/share/xcat/tools/go-xcat smoke-test" +cmd:xdsh $$CN "lsdef" +check:output=~node0001 +cmd:xdsh $$CN "noderm node0001" check:rc==0 cmd:latest_version_info=`lsxcatd -v`;xdsh $$CN "lsxcatd -v" | grep "$latest_version_info" check:rc==0 @@ -191,12 +184,10 @@ check:output=~$$MIGRATION2_VERSION cmd:xdsh $$CN "service xcatd status" check:rc==0 check:output=~running -cmd:lsdef $$SN -z | ssh $$CN "mkdef -z" -cmd:ssh $$CN "chdef $$SN servicenode= monserver= nfsserver= tftpserver= xcatmaster=" -cmd:makedhcp -d $$SN -cmd:scp $$ISO $$CN:/tmp/foobar.iso -cmd:ssh $$CN "copycds /tmp/foobar.iso" -cmd:ssh $$CN "makedhcp -n" +cmd:xdsh $$CN "chdef -t node -o node0001 nodetype=osi groups=linux" +check:rc==0 +cmd:xdsh $$CN "lsdef" +check:output=~node0001 cmd:xdsh $$CN "cd /; scp -r $$MN:/core-rpms-snap.tar.bz2 /" check:rc==0 cmd:xdsh $$CN "cd /; scp -r $$MN:/xcat-dep*.tar.bz2 /" @@ -214,14 +205,9 @@ check:rc==0 cmd:xdsh $$CN "service xcatd status" check:rc==0 check:output=~running -cmd:ssh $$CN "rinstall $$SN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute" -check:rc==0 -cmd:sleep 300 -cmd:ssh $$CN "a=0; while ! `lsdef -l $$SN | grep status | grep booted >/dev/null`; do ((++a > 90)) && exit 99; sleep 20; done" -check:rc==0 -cmd:ssh $$CN "xdsh $$SN date" -check:rc==0 -cmd:xdsh $$CN "/opt/xcat/share/xcat/tools/go-xcat smoke-test" +cmd:xdsh $$CN "lsdef" +check:output=~node0001 +cmd:xdsh $$CN "noderm node0001" check:rc==0 cmd:latest_version_info=`lsxcatd -v`;xdsh $$CN "lsxcatd -v" | grep "$latest_version_info" check:rc==0 diff --git a/xCAT-test/autotest/testcase/migration/ubuntu_migration1_p8le b/xCAT-test/autotest/testcase/migration/ubuntu_migration1_p8le index 2a6c8af8f..cf77bd24f 100644 --- a/xCAT-test/autotest/testcase/migration/ubuntu_migration1_p8le +++ b/xCAT-test/autotest/testcase/migration/ubuntu_migration1_p8le @@ -80,12 +80,10 @@ check:rc==0 cmd:xdsh $$CN "service xcatd status" check:rc==0 check:output=~running -cmd:lsdef $$SN -z | ssh $$CN "/opt/xcat/bin/mkdef -z" -cmd:ssh $$CN "/opt/xcat/bin/chdef $$SN servicenode= monserver= nfsserver= tftpserver= xcatmaster=" -cmd:makedhcp -d $$SN -cmd:scp $$ISO $$CN:/tmp/foobar.iso -cmd:ssh $$CN "/opt/xcat/sbin/copycds /tmp/foobar.iso" -cmd:ssh $$CN "/opt/xcat/sbin/makedhcp -n" +cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;chdef -t node -o node0001 nodetype=osi groups=linux" +check:rc==0 +cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsdef" +check:output=~node0001 cmd:xdsh $$CN "rm -rf /newxcat" cmd:xdsh $$CN "mkdir -p /newxcat" check:rc==0 @@ -116,15 +114,10 @@ check:rc==0 cmd:xdsh $$CN "service xcatd status" check:rc==0 check:output=~running -cmd:ssh $$CN "/opt/xcat/bin/rinstall $$SN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute" -check:rc==0 -cmd:sleep 300 -cmd:ssh $$CN "a=0; while ! `/opt/xcat/bin/lsdef -l $$SN | grep status | grep booted >/dev/null`; do ((++a > 90)) && exit 99; sleep 20; done" -check:rc==0 -cmd:ssh $$CN "/opt/xcat/bin/xdsh $$SN date" -check:rc==0 -cmd:xdsh $$CN "/opt/xcat/share/xcat/tools/go-xcat smoke-test" +cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;rmdef node0001" check:rc==0 +cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsdef" +check:output!~node0001 cmd:xdsh $$CN "diff /oldxcat/old_version /newxcat/new_version" check:rc!=0 diff --git a/xCAT-test/autotest/testcase/migration/ubuntu_migration1_vm b/xCAT-test/autotest/testcase/migration/ubuntu_migration1_vm index 8c519b898..636553292 100644 --- a/xCAT-test/autotest/testcase/migration/ubuntu_migration1_vm +++ b/xCAT-test/autotest/testcase/migration/ubuntu_migration1_vm @@ -79,12 +79,10 @@ check:rc==0 cmd:xdsh $$CN "service xcatd status" check:rc==0 check:output=~running -cmd:lsdef $$SN -z | ssh $$CN "/opt/xcat/bin/mkdef -z" -cmd:ssh $$CN "/opt/xcat/bin/chdef $$SN servicenode= monserver= nfsserver= tftpserver= xcatmaster=" -cmd:makedhcp -d $$SN -cmd:scp $$ISO $$CN:/tmp/foobar.iso -cmd:ssh $$CN "/opt/xcat/sbin/copycds /tmp/foobar.iso" -cmd:ssh $$CN "/opt/xcat/sbin/makedhcp -n" +cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;chdef -t node -o node0001 nodetype=osi groups=linux" +check:rc==0 +cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsdef" +check:output=~node0001 cmd:xdsh $$CN "rm -rf /newxcat" cmd:xdsh $$CN "mkdir -p /newxcat" check:rc==0 @@ -115,15 +113,10 @@ check:rc==0 cmd:xdsh $$CN "service xcatd status" check:rc==0 check:output=~running -cmd:ssh $$CN "/opt/xcat/bin/rinstall $$SN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute" -check:rc==0 -cmd:sleep 300 -cmd:ssh $$CN "a=0; while ! `/opt/xcat/bin/lsdef -l $$SN | grep status | grep booted >/dev/null`; do ((++a > 90)) && exit 99; sleep 20; done" -check:rc==0 -cmd:ssh $$CN "/opt/xcat/bin/xdsh $$SN date" -check:rc==0 -cmd:xdsh $$CN "/opt/xcat/share/xcat/tools/go-xcat smoke-test" +cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;rmdef node0001" check:rc==0 +cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsdef" +check:output!~node0001 cmd:xdsh $$CN "diff /oldxcat/old_version /newxcat/new_version" check:rc!=0 end diff --git a/xCAT-test/autotest/testcase/migration/ubuntu_migration2_p8le b/xCAT-test/autotest/testcase/migration/ubuntu_migration2_p8le index ca3fe6569..1d3216e8c 100644 --- a/xCAT-test/autotest/testcase/migration/ubuntu_migration2_p8le +++ b/xCAT-test/autotest/testcase/migration/ubuntu_migration2_p8le @@ -80,12 +80,10 @@ check:rc==0 cmd:xdsh $$CN "service xcatd status" check:rc==0 check:output=~running -cmd:lsdef $$SN -z | ssh $$CN "/opt/xcat/bin/mkdef -z" -cmd:ssh $$CN "/opt/xcat/bin/chdef $$SN servicenode= monserver= nfsserver= tftpserver= xcatmaster=" -cmd:makedhcp -d $$SN -cmd:scp $$ISO $$CN:/tmp/foobar.iso -cmd:ssh $$CN "/opt/xcat/sbin/copycds /tmp/foobar.iso" -cmd:ssh $$CN "/opt/xcat/sbin/makedhcp -n" +cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;chdef -t node -o node0001 nodetype=osi groups=linux" +check:rc==0 +cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsdef" +check:output=~node0001 cmd:xdsh $$CN "rm -rf /newxcat" cmd:xdsh $$CN "mkdir -p /newxcat" check:rc==0 @@ -116,15 +114,10 @@ check:rc==0 cmd:xdsh $$CN "service xcatd status" check:rc==0 check:output=~running -cmd:ssh $$CN "/opt/xcat/bin/rinstall $$SN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute" -check:rc==0 -cmd:sleep 300 -cmd:ssh $$CN "a=0; while ! `/opt/xcat/bin/lsdef -l $$SN | grep status | grep booted >/dev/null`; do ((++a > 90)) && exit 99; sleep 20; done" -check:rc==0 -cmd:ssh $$CN "/opt/xcat/bin/xdsh $$SN date" -check:rc==0 -cmd:xdsh $$CN "/opt/xcat/share/xcat/tools/go-xcat smoke-test" +cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;rmdef node0001" check:rc==0 +cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsdef" +check:output!~node0001 cmd:xdsh $$CN "diff /oldxcat/old_version /newxcat/new_version" check:rc!=0 diff --git a/xCAT-test/autotest/testcase/migration/ubuntu_migration2_vm b/xCAT-test/autotest/testcase/migration/ubuntu_migration2_vm index adfe3244a..34c7123cb 100644 --- a/xCAT-test/autotest/testcase/migration/ubuntu_migration2_vm +++ b/xCAT-test/autotest/testcase/migration/ubuntu_migration2_vm @@ -79,12 +79,10 @@ check:rc==0 cmd:xdsh $$CN "service xcatd status" check:rc==0 check:output=~running -cmd:lsdef $$SN -z | ssh $$CN "/opt/xcat/bin/mkdef -z" -cmd:ssh $$CN "/opt/xcat/bin/chdef $$SN servicenode= monserver= nfsserver= tftpserver= xcatmaster=" -cmd:makedhcp -d $$SN -cmd:scp $$ISO $$CN:/tmp/foobar.iso -cmd:ssh $$CN "/opt/xcat/sbin/copycds /tmp/foobar.iso" -cmd:ssh $$CN "/opt/xcat/sbin/makedhcp -n" +cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;chdef -t node -o node0001 nodetype=osi groups=linux" +check:rc==0 +cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsdef" +check:output=~node0001 cmd:xdsh $$CN "rm -rf /newxcat" cmd:xdsh $$CN "mkdir -p /newxcat" check:rc==0 @@ -115,15 +113,10 @@ check:rc==0 cmd:xdsh $$CN "service xcatd status" check:rc==0 check:output=~running -cmd:ssh $$CN "/opt/xcat/bin/rinstall $$SN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute" -check:rc==0 -cmd:sleep 300 -cmd:ssh $$CN "a=0; while ! `/opt/xcat/bin/lsdef -l $$SN | grep status | grep booted >/dev/null`; do ((++a > 90)) && exit 99; sleep 20; done" -check:rc==0 -cmd:ssh $$CN "/opt/xcat/bin/xdsh $$SN date" -check:rc==0 -cmd:xdsh $$CN "/opt/xcat/share/xcat/tools/go-xcat smoke-test" +cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;rmdef node0001" check:rc==0 +cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsdef" +check:output!~node0001 cmd:xdsh $$CN "diff /oldxcat/old_version /newxcat/new_version" check:rc!=0 end From 061b230edba9ca575788b916339b7e4a27c68f74 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Wed, 7 Jun 2017 11:59:54 -0400 Subject: [PATCH 122/129] Change to PartNumber and SerialNumber for bmcdiscover --- xCAT-server/lib/xcat/plugins/bmcdiscover.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/bmcdiscover.pm b/xCAT-server/lib/xcat/plugins/bmcdiscover.pm index 0811f73fe..b0bb1514e 100644 --- a/xCAT-server/lib/xcat/plugins/bmcdiscover.pm +++ b/xCAT-server/lib/xcat/plugins/bmcdiscover.pm @@ -1072,8 +1072,8 @@ sub bmcdiscovery_openbmc{ my $serial; if (defined($response->{data})) { - if (defined($response->{data}->{Model}) and defined($response->{data}->{SerialNumber})) { - $mtm = $response->{data}->{Model}; + if (defined($response->{data}->{PartNumber}) and defined($response->{data}->{SerialNumber})) { + $mtm = $response->{data}->{PartNumber}; $serial = $response->{data}->{SerialNumber}; } else { xCAT::MsgUtils->message("W", { data => ["Could not obtain Model Type and/or Serial Number for BMC at $ip"] }, $::CALLBACK); From d90eafb453448901767f26a6477eb5676c2404d8 Mon Sep 17 00:00:00 2001 From: Casandra Qiu Date: Wed, 7 Jun 2017 14:30:30 -0400 Subject: [PATCH 123/129] modify from code review --- xCAT-server/share/xcat/scripts/configMellanox | 44 +++++++++---------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/xCAT-server/share/xcat/scripts/configMellanox b/xCAT-server/share/xcat/scripts/configMellanox index 8095d3bc6..43dc783b7 100755 --- a/xCAT-server/share/xcat/scripts/configMellanox +++ b/xCAT-server/share/xcat/scripts/configMellanox @@ -26,13 +26,13 @@ use xCAT::MsgUtils; Getopt::Long::Configure("bundling"); $Getopt::Long::ignorecase = 0; -#global variables +# global variables my @nodes; my @filternodes; #--------------------------------------------------------- -#Main +# Main # parse the options if ( @@ -97,7 +97,7 @@ my $vlan; my $port; my $mode; -#set community string for switch +# set community string for switch my $community = "public"; my @snmpcs = xCAT::TableUtils->get_site_attribute("snmpc"); my $tmp = $snmpcs[0]; @@ -143,7 +143,7 @@ sub config_ip { next; } - #Validate if this IP is reachable + # Validate if this IP is reachable my $p = Net::Ping->new(); if (!$p->ping($dip)) { print "$dip is not reachable\n"; @@ -158,7 +158,7 @@ sub config_ip { next; } - #get hostname + # get hostname my $dswitch = xCAT::NetworkUtils->gethostname($dip); # if hostnames are same, created different one for discovery name @@ -166,7 +166,7 @@ sub config_ip { $dswitch=""; } - #if not defined, need to create one for xdsh to use + # if not defined, need to create one for xdsh to use if (!$dswitch) { my $ip_str = $dip; $ip_str =~ s/\./\-/g; @@ -197,7 +197,7 @@ sub config_ip { push (@discover_switches, $dswitch); next; } - #get netmask + # get netmask my $mask; foreach my $net (@nets) { if (xCAT::NetworkUtils::isInSameSubnet( $net->{'net'}, $static_ip, $net->{'mask'}, 0)) { @@ -214,7 +214,7 @@ sub config_ip { } if (@config_switches) { - #update switch status + # update switch status my $csw = join(",",@config_switches); $cmd = "chdef $csw status=ip_configed otherinterfaces="; $rc= xCAT::Utils->runcmd($cmd, 0); @@ -224,7 +224,7 @@ sub config_ip { if (@discover_switches) { my $dsw = join(",",@discover_switches); - #remove discover switch from xCATdb and /etc/hosts + # remove discover switch from xCATdb and /etc/hosts $cmd = "makedns -d $dsw"; $rc= xCAT::Utils->runcmd($cmd, 0); $cmd = "makehosts -d $dsw"; @@ -256,14 +256,14 @@ sub config_hostname { print "$switch: Changing host name to $switch\n"; } if (@config_switches) { - #update switch status + # update switch status my $csw = join(",",@config_switches); $cmd = "chdef $csw status=hostname_configed" ; $rc= xCAT::Utils->runcmd($cmd, 0); } } -#setup secure SNMP v3 +# setup secure SNMP v3 sub config_snmp { my $snmp_user; my $snmp_passwd; @@ -314,25 +314,25 @@ sub run_rspconfig { $master = `hostname -i`; foreach my $switch (@nodes) { my $user= $switchhash->{$switch}->[0]->{sshusername}; - #call rspconfig command to setup switch - #enable ssh + # call rspconfig command to setup switch + # enable ssh $cmd=`rspconfig $switch sshcfg=enable`; - #enable snmp function on the switch + # enable snmp function on the switch $cmd=`rspconfig $switch snmpcfg=enable`; - #enable the snmp trap + # enable the snmp trap $cmd=`rspconfig $switch alert=enable`; - #Logging destination: + # Logging destination: $cmd=`rspconfig $switch logdest=$master`; - #config ntp + # config ntp $cmd = `xdsh $switch -l $user --devicetype IBSwitch::Mellanox "enable;configure terminal;ntp enable;ntpdate $master; ntp server $master;configuration write;show ntp" `; push (@config_switches, $switch); } if (@config_switches) { - #update switch status + # update switch status my $csw = join(",",@config_switches); $cmd = "chdef $csw status=switch_configed" ; $rc= xCAT::Utils->runcmd($cmd, 0); @@ -358,17 +358,17 @@ sub config_vlan { } } } else { - xCAT::MsgUtils->message("E","Error - When configuring VLAN, a port must be provided."); + xCAT::MsgUtils->message("E"," When configuring VLAN, a port must be provided."); &usage; exit(1); } - #will default to trunk mode + # will default to trunk mode if ($::MODE) { $mode = $::MODE; if (!($mode =~ m/(access|trunk|hybrid|access-dcb|dot1q-tunnel)/) ) { - xCAT::MsgUtils->message("E","Error - Please provided supported mode"); + xCAT::MsgUtils->message("E"," Please provided supported mode"); &usage; exit(1); } @@ -396,7 +396,7 @@ sub config_vlan { print "Tagging VLAN=$vlan for $switch port $port_input\n"; - #create vlan + # create vlan my $vlan_cmd = `xdsh $switch --devicetype $devicetype "enable;configure terminal;vlan $vlan;exit;exit" `; my $cmd_prefix = "xdsh $switch --devicetype $devicetype"; From e73d85c5eb4faeb88527b41108c5ab0d533f3439 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Wed, 7 Jun 2017 14:53:55 -0400 Subject: [PATCH 124/129] openbmc rflash command support for -l --list option --- xCAT-server/lib/xcat/plugins/openbmc.pm | 69 +++++++++++++++++++++++-- 1 file changed, 66 insertions(+), 3 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index d9f5519ac..7e1d8727f 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -204,6 +204,13 @@ my %status_info = ( RVITALS_RESPONSE => { process => \&rvitals_response, }, + RFLASH_LIST_REQUEST => { + method => "GET", + init_url => "$openbmc_project_url/software/enumerate", + }, + RFLASH_LIST_RESPONSE => { + process => \&rflash_response, + }, ); $::RESPONSE_OK = "200 OK"; @@ -483,7 +490,7 @@ sub parse_args { else { # Filename was not passed, check flags allowed without file if ($opt !~ /^-c$|^--check$|^-l$|^--list/) { - return ([ 1, "Unsupported no file command command option: $opt" ]); + return ([ 1, "Unsupported no file command option: $opt" ]); } } } @@ -693,8 +700,9 @@ sub parse_command_status { $next_status{RINV_FIRM_REQUEST} = "RINV_FIRM_RESPONSE"; } if ($list) { - xCAT::SvrUtils::sendmsg("List option is not yet supported.", $callback); - return 1; + #Display firmware update files uploaded to BMC + $next_status{LOGIN_RESPONSE} = "RFLASH_LIST_REQUEST"; + $next_status{RFLASH_LIST_REQUEST} = "RFLASH_LIST_RESPONSE"; } if ($delete) { xCAT::SvrUtils::sendmsg("Delete option is not yet supported.", $callback); @@ -1364,5 +1372,60 @@ sub rvitals_response { return; } +#------------------------------------------------------- +=head3 rflash_response + + Deal with response of rflash command + Input: + $node: nodename of current response + $response: Async return response + +=cut + +#------------------------------------------------------- +sub rflash_response { + my $node = shift; + my $response = shift; + + my $response_info = decode_json $response->content; + + print Dumper(%{$response_info->{data}}); + + my $update_id; + my $update_activation; + my $update_purpose; + my $update_version; + + if ($node_info{$node}{cur_status} eq "RFLASH_LIST_RESPONSE") { + # Display "list" option header and data + xCAT::SvrUtils::sendmsg("ID Purpose State Version", $callback, $node); + xCAT::SvrUtils::sendmsg("-" x 55, $callback, $node); + + foreach my $key_url (keys %{$response_info->{data}}) { + my %content = %{ ${ $response_info->{data} }{$key_url} }; + + $update_id = (split(/\//, $key_url))[ -1 ]; + if (defined($content{Version}) and $content{Version}) { + $update_version = $content{Version}; + } + if (defined($content{Activation}) and $content{Activation}) { + $update_activation = (split(/\./, $content{Activation}))[ -1 ]; + } + if (defined($content{Purpose}) and $content{Purpose}) { + $update_purpose = (split(/\./, $content{Purpose}))[ -1 ]; + } + xCAT::SvrUtils::sendmsg(sprintf("%-8s %-7s %-8s %s", $update_id, $update_purpose, $update_activation, $update_version), $callback, $node); + } + xCAT::SvrUtils::sendmsg("", $callback, $node); #Separate output in case more than 1 endpoint + } + + if ($next_status{ $node_info{$node}{cur_status} }) { + $node_info{$node}{cur_status} = $next_status{ $node_info{$node}{cur_status} }; + gen_send_request($node); + } else { + $wait_node_num--; + } + return; +} 1; From 9fd9e211d0e4a1112565602e65eded4192edf8d0 Mon Sep 17 00:00:00 2001 From: xuweibj Date: Thu, 8 Jun 2017 11:15:07 +0800 Subject: [PATCH 125/129] rm / from path of xcatpost folder when run rm command (#3238) --- xCAT/postscripts/xcatdsklspost | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/xCAT/postscripts/xcatdsklspost b/xCAT/postscripts/xcatdsklspost index 3e2c4ffb1..7aac7ab28 100755 --- a/xCAT/postscripts/xcatdsklspost +++ b/xCAT/postscripts/xcatdsklspost @@ -126,9 +126,8 @@ download_postscripts() retry=0 rc=1 # this is a fail return while [ 0 -eq 0 ]; do - - if [ -e "\/$xcatpost" ]; then - rm -rf "\/$xcatpost" + if [ -e "$xcatpost" ]; then + rm -rf "$xcatpost" fi export LANG=C; wget -l inf -nH -N -r --waitretry=10 --random-wait -e robots=off -T 60 -nH --cut-dirs=2 --reject "index.html*" --no-parent http://$server$INSTALLDIR/postscripts/ -P /$xcatpost 2> /tmp/wget.log From cccf4b783f531c3afcde32c8fe58ceba9e07d62f Mon Sep 17 00:00:00 2001 From: Yuan Bai Date: Thu, 8 Jun 2017 11:21:05 +0800 Subject: [PATCH 126/129] =?UTF-8?q?fix=203224=20nodeset=20create=20dracut.?= =?UTF-8?q?*=20file=20in=20sles=20statelite=20cost=20too=20much=E2=80=A6?= =?UTF-8?q?=20(#3227)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix 3224 nodeset create dracut.* file in sles statelite cost too much time * polished based on comments --- xCAT-server/lib/xcat/plugins/sles.pm | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/sles.pm b/xCAT-server/lib/xcat/plugins/sles.pm index 164e6d46c..f69689a1e 100644 --- a/xCAT-server/lib/xcat/plugins/sles.pm +++ b/xCAT-server/lib/xcat/plugins/sles.pm @@ -1707,12 +1707,10 @@ erver, if so, stop it first and try again" ], sub using_dracut { my $rootimgdir = shift; - my $chkcmd = "chroot $rootimgdir/rootimg dracut --list-modules"; - my $rc = system($chkcmd); - if ($rc) { - return 0; - } else { + if ( -f "$rootimgdir/rootimg/etc/dracut.conf" ) { return 1; + } else { + return 0; } } From d9d0cfd42ccdee03085f36fed194d850622804b9 Mon Sep 17 00:00:00 2001 From: chenglch Date: Thu, 8 Jun 2017 11:21:26 +0800 Subject: [PATCH 127/129] Avoid of circular reference in a loop of rinstall (#3121) This is a temporary fix for getadapter which will hang forever if error happens in `rinstall stage`. The root cause is the circular reference in `runxcmd`. As global variable `$::xcmd_outref` and `%::xcmd_outref_hash` are used to save the output message, if the plugin command are called with runxcmd and the plugin called also calls another plugin with `runxcmd`, the circular reference will happen. In this situation, if the output reponse is used in a iterator, like: ``` foreach my $line (@$res) { xCAT::MsgUtils->message("I", $rsp, $callback); ``` `$res` points to the global variable, and `MsgUtils->message` in the runxcmd calls also add the value in the global variable, as the iter object is changed, the loop will not be terminated. This patch can not solve the circular reference problem, it is just a workaround to avoid infinite loop. Some known issues: the error message will print twice as the `MsgUtils->message` called in runxcmd. But we can not simply remove it as the plugin may not be called with `runxcmd`. Error message example: ``` Error: frame10node10: mgt configuration can not be found. frame10node10: Unable to identify plugin for this command, check relevant tables: noderes.netboot frame10node10: Unable to identify plugin for this command, check relevant tables: noderes.netboot Failed to run 'nodeset' against the following nodes: frame10node10 Error: failed to run command: rinstall frame10node10 runcmd=getadapter ``` partial-fix: #3046 --- xCAT-server/lib/xcat/plugins/rinstall.pm | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/rinstall.pm b/xCAT-server/lib/xcat/plugins/rinstall.pm index 4fba96ed0..906746b33 100644 --- a/xCAT-server/lib/xcat/plugins/rinstall.pm +++ b/xCAT-server/lib/xcat/plugins/rinstall.pm @@ -351,7 +351,9 @@ sub rinstall { # We got an error with the nodeset my @successnodes; my @failurenodes; - foreach my $line (@$res) { + # copy into a temporary variable to avoid of circular reference + my @lines = @$res; + foreach my $line (@lines) { $rsp->{data}->[0] = $line; if (($line =~ /: install/) or ($line =~ /: netboot/)) { my $successnode; @@ -414,7 +416,6 @@ sub rinstall { }, $subreq, -1, 1); - $rc = $::RUNCMD_RC; my $rsp = {}; if ($VERBOSE) { @@ -427,7 +428,9 @@ sub rinstall { # We got an error with the rnetboot my @failurenodes; - foreach my $line (@$res) { + # copy into a temporary variable to avoid of circular reference + my @lines = @$res; + foreach my $line (@lines) { $rsp->{data}->[0] = $line; if ($line =~ /: Success/) { my $successnode; @@ -491,7 +494,9 @@ sub rinstall { # We got an error with the rsetboot my @successnodes; my @failurenodes; - foreach my $line (@$res) { + # copy into a temporary variable to avoid of circular reference + my @lines = @$res; + foreach my $line (@lines) { $rsp->{data}->[0] = $line; if ($line =~ /: Network/) { my $successnode; @@ -550,7 +555,9 @@ sub rinstall { unless ($rc == 0) { # We got an error with the rpower my @failurenodes; - foreach my $line (@$res) { + # copy into a temporary variable to avoid of circular reference + my @lines = @$res; + foreach my $line (@lines) { $rsp->{data}->[0] = $line; if (($line =~ /: on reset/) or ($line =~ /: off on/)) { my $successnode; From 7e4c748eaa092db9e4c0716463154c83af18f845 Mon Sep 17 00:00:00 2001 From: Casandra Qiu Date: Fri, 9 Jun 2017 11:02:36 -0400 Subject: [PATCH 128/129] Change osver to OSVER for onie switch support --- xCAT/postscripts/hardeths | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/xCAT/postscripts/hardeths b/xCAT/postscripts/hardeths index 0d51de150..9dd75dcde 100755 --- a/xCAT/postscripts/hardeths +++ b/xCAT/postscripts/hardeths @@ -47,11 +47,11 @@ network_ipv4calc () } if [ -f /etc/os-release ] && (cat /etc/os-release |grep -i '^NAME=[ "]*Cumulus Linux[ "]*$' >/dev/null 2>&1); then - osver="cumulus" + OSVER="cumulus" fi defgw=`ip route | grep default | awk '{print $3}'` -if ( pmatch $OSVER "ubuntu*" ) || (pmatch $osver "cumulus") +if ( pmatch $OSVER "ubuntu*" ) || (pmatch $OSVER "cumulus") then echo `hostname` >/etc/hostname mv /etc/network/interfaces /etc/network/interfaces.old # this file will be filled up next @@ -94,7 +94,7 @@ for nic in `ip link |grep "BROADCAST" |awk '{print $2}' | sed s/://`; do PREFIXMASK=`echo $IPADDRMASK | awk -F'/' '{print $2}'` # converts to x.x.x.x mask value maskfromprefix $PREFIXMASK - if ( pmatch $OSVER "ubuntu*" ) || (pmatch $osver "cumulus") + if ( pmatch $OSVER "ubuntu*" ) || (pmatch $OSVER "cumulus") then NETWORK=`network_ipv4calc $IPADDR $NETMASK` #BROADCAST=`ifconfig $nic | grep Bcast | awk '{print $3}' | awk -F: '{print $2}'` @@ -169,7 +169,7 @@ EOF fi done -if ( pmatch $OSVER "ubuntu*") || (pmatch $osver "cumulus") +if ( pmatch $OSVER "ubuntu*") || (pmatch $OSVER "cumulus") then cat >>/etc/network/interfaces < Date: Fri, 9 Jun 2017 13:51:22 -0400 Subject: [PATCH 129/129] Review updates --- xCAT-server/lib/xcat/plugins/openbmc.pm | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index 7e1d8727f..ff192fbbf 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -119,6 +119,14 @@ my %status_info = ( process => \&reventlog_response, }, + RFLASH_LIST_REQUEST => { + method => "GET", + init_url => "$openbmc_project_url/software/enumerate", + }, + RFLASH_LIST_RESPONSE => { + process => \&rflash_response, + }, + RINV_REQUEST => { method => "GET", init_url => "$openbmc_project_url/inventory/enumerate", @@ -204,13 +212,6 @@ my %status_info = ( RVITALS_RESPONSE => { process => \&rvitals_response, }, - RFLASH_LIST_REQUEST => { - method => "GET", - init_url => "$openbmc_project_url/software/enumerate", - }, - RFLASH_LIST_RESPONSE => { - process => \&rflash_response, - }, ); $::RESPONSE_OK = "200 OK"; @@ -484,13 +485,13 @@ sub parse_args { if ($filename_passed) { # Filename was passed, check flags allowed with file if ($opt !~ /^-c$|^--check$|^-d$|^--delete$|^-u$|^--upload$/) { - return ([ 1, "Unsupported file command option: $opt" ]); + return ([ 1, "Invalid option specified when a file is provided: $opt" ]); } } else { # Filename was not passed, check flags allowed without file if ($opt !~ /^-c$|^--check$|^-l$|^--list/) { - return ([ 1, "Unsupported no file command option: $opt" ]); + return ([ 1, "Invalid option specified: $opt" ]); } } } @@ -691,16 +692,16 @@ sub parse_command_status { } } else { - #TODO Process file id passed in + # TODO Process file id passed in } } if ($check_version) { - #Display firmware version on BMC + # Display firmware version on BMC $next_status{LOGIN_RESPONSE} = "RINV_FIRM_REQUEST"; $next_status{RINV_FIRM_REQUEST} = "RINV_FIRM_RESPONSE"; } if ($list) { - #Display firmware update files uploaded to BMC + # Display firmware update files uploaded to BMC $next_status{LOGIN_RESPONSE} = "RFLASH_LIST_REQUEST"; $next_status{RFLASH_LIST_REQUEST} = "RFLASH_LIST_RESPONSE"; }