mirror of
				https://github.com/xcat2/xcat-core.git
				synced 2025-10-31 11:22:27 +00:00 
			
		
		
		
	Fix nodeset command for shell and shutdown options and fix nodeset usage and man page
This commit is contained in:
		| @@ -19,11 +19,11 @@ Name | ||||
| **************** | ||||
|  | ||||
|  | ||||
| \ **nodeset**\  [\ *noderange*\ ] [\ **boot**\  | \ **stat**\  | \ **iscsiboot**\  | \ **offline**\  | \ **runcmd=bmcsetup**\  | \ **osimage**\ = \ *imagename*\  | \ **shell**\  | \ **shutdown**\ ] | ||||
| \ **nodeset**\  \ *noderange*\  [\ **boot**\  | \ **stat**\  | \ **iscsiboot**\  | \ **offline**\  | \ **runcmd=bmcsetup**\  | \ **osimage**\ [=\ *imagename*\ ] | \ **shell**\  | \ **shutdown**\ ] | ||||
|  | ||||
| \ **nodeset**\  \ *noderange*\  \ **osimage=**\  \ *imagename*\  [\ **-**\ **-noupdateinitrd**\ ] [\ **-**\ **-ignorekernelchk**\ ] | ||||
| \ **nodeset**\  \ *noderange*\  \ **osimage**\ [=\ *imagename*\ ] [\ **-**\ **-noupdateinitrd**\ ] [\ **-**\ **-ignorekernelchk**\ ] | ||||
|  | ||||
| \ **nodeset**\  \ *noderange*\  \ **runimage=**\  \ *task*\  | ||||
| \ **nodeset**\  \ *noderange*\  \ **runimage=**\ \ *task*\  | ||||
|  | ||||
| \ **nodeset**\  [\ **-h | -**\ **-help | -v | -**\ **-version**\ ] | ||||
|  | ||||
| @@ -74,7 +74,7 @@ A user can supply their own scripts to be run on the mn or on the service node ( | ||||
|   | ||||
|  | ||||
|  | ||||
| \ **osimage | osimage=<imagename**\ > | ||||
| \ **osimage | osimage=**\ \ *imagename*\  | ||||
|   | ||||
|  Prepare server for installing a node using the specified os image. The os image is defined in the \ *osimage*\  table and \ *linuximage*\  table. If the <imagename> is omitted, the os image name will be obtained from \ *nodetype.provmethod*\  for the node. | ||||
|   | ||||
|   | ||||
| @@ -459,7 +459,7 @@ Options: | ||||
| "Usage: | ||||
|    Common: | ||||
|       nodeset [-h|--help|-v|--version] | ||||
|       nodeset <noderange> [shell|boot|runcmd=bmcsetup|iscsiboot|osimage[=<imagename>]|offline]", | ||||
|       nodeset <noderange> [shell|boot|runcmd=bmcsetup|iscsiboot|osimage[=<imagename>]|offline|shutdown|stat]", | ||||
|   "rmflexnode" => | ||||
| "Usage: | ||||
|     rmflexnode [-h|--help|-v|--version] | ||||
|   | ||||
| @@ -4,11 +4,11 @@ B<nodeset> - set the boot state for a noderange | ||||
|  | ||||
| =head1 B<Synopsis> | ||||
|  | ||||
| B<nodeset> [I<noderange>] [B<boot> | B<stat> | B<iscsiboot> | B<offline> | B<runcmd=bmcsetup> | B<osimage>= I<imagename> | B<shell> | B<shutdown>] | ||||
| B<nodeset> I<noderange> [B<boot> | B<stat> | B<iscsiboot> | B<offline> | B<runcmd=bmcsetup> | B<osimage>[=I<imagename>] | B<shell> | B<shutdown>] | ||||
|  | ||||
| B<nodeset> I<noderange> B<osimage=> I<imagename> [B<--noupdateinitrd>] [B<--ignorekernelchk>] | ||||
| B<nodeset> I<noderange> B<osimage>[=I<imagename>] [B<--noupdateinitrd>] [B<--ignorekernelchk>] | ||||
|  | ||||
| B<nodeset> I<noderange> B<runimage=> I<task> | ||||
| B<nodeset> I<noderange> B<runimage=>I<task> | ||||
|  | ||||
| B<nodeset> [B<-h>|B<--help>|B<-v>|B<--version>] | ||||
|  | ||||
| @@ -49,7 +49,7 @@ Instruct network boot loader to be skipped, generally meaning boot to hard disk | ||||
|  | ||||
| Cleanup the current pxe/tftp boot configuration files for the nodes requested | ||||
|  | ||||
| =item B<osimage>|B<osimage=<imagename>> | ||||
| =item B<osimage>|B<osimage=>I<imagename> | ||||
|  | ||||
| Prepare server for installing a node using the specified os image. The os image is defined in the I<osimage> table and I<linuximage> table. If the <imagename> is omitted, the os image name will be obtained from I<nodetype.provmethod> for the node.   | ||||
|  | ||||
|   | ||||
| @@ -23,7 +23,7 @@ my $globaltftpdir = xCAT::TableUtils->getTftpDir(); | ||||
|  | ||||
|  | ||||
| my %usage = ( | ||||
|     "nodeset" => "Usage: nodeset <noderange> [shell|boot|runcmd=bmcsetup|iscsiboot|osimage[=<imagename>]|offline]", | ||||
|     "nodeset" => "Usage: nodeset <noderange> [shell|boot|runcmd=bmcsetup|iscsiboot|osimage[=<imagename>]|offline|shutdown|stat]", | ||||
| ); | ||||
| sub handled_commands { | ||||
|     # process noderes:netboot like "grub2-<transfer protocol>" | ||||
| @@ -620,6 +620,31 @@ sub process_request { | ||||
|                { | ||||
|                  $validarch = $osimgent->{'osarch'}; | ||||
|                } | ||||
|             else | ||||
|                { | ||||
|                  # Can not determine arch from osimage definition. This is most likely | ||||
|                  # the case when nodeset is "shell" or "shutdown". Look at node definition, to | ||||
|                  # figure out arch to use. | ||||
|                   | ||||
|                  # get nodename from osimagenodehash hash | ||||
|                  my $node_name = $osimagenodehash{$osimage}[0]; | ||||
|                 | ||||
|                  # lookup node arch setting | ||||
|                  my $node_entry = $typetab->getNodeAttribs($node_name,['arch']); | ||||
|                  if ($node_entry and $node_entry->{'arch'}) | ||||
|                      { | ||||
|                        # Extracted arch from node definition | ||||
|                        $validarch = $node_entry->{'arch'}; | ||||
|                      } | ||||
|                  else | ||||
|                      { | ||||
|                        # At this point we can not determine architecture either | ||||
|                        # from osimage or node definition. | ||||
|                        my $rsp; | ||||
|                        push @{$rsp->{data}}, "Not able to determine architecture of node $node_name. Verify arch attribute setting.\n"; | ||||
|                        xCAT::MsgUtils->message("E", $rsp, $callback); | ||||
|                      }  | ||||
|                 } | ||||
|             if ($validarch =~ /ppc64/i) | ||||
|                { | ||||
|                    $validarch="ppc" | ||||
|   | ||||
		Reference in New Issue
	
	Block a user