enable -v -h for profiled nodes related commands, and also, create man pages
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@14196 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
parent
f19883d909
commit
66dab45eba
45
xCAT-client/pods/man1/nodeaddunmged.1.pod
Normal file
45
xCAT-client/pods/man1/nodeaddunmged.1.pod
Normal file
@ -0,0 +1,45 @@
|
||||
=head1 NAME
|
||||
|
||||
B<nodeaddunmged> - Create a un-managed node with hostname and ip address specified.
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
B<nodeaddunmged> [-h| --help │ -v │ --version]
|
||||
|
||||
B<nodeaddunmged> hostname=<hostname> ip=<ip>
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
The B<nodeaddunmged> command will add nodes into group __Unmanaged. And we just need to specify hostname and IP for this node.
|
||||
|
||||
=head1 OPTIONS
|
||||
|
||||
B<-h|--help>
|
||||
|
||||
Display usage message.
|
||||
|
||||
B<-v|--version>
|
||||
|
||||
Command Version.
|
||||
|
||||
B<hostname=<hostname>>
|
||||
|
||||
The hostname of the unmanaged node.
|
||||
|
||||
B<ip=<ip>>
|
||||
|
||||
The IP address of the unmanaged node.
|
||||
|
||||
=head1 RETURN VALUE
|
||||
|
||||
0 The command completed successfully.
|
||||
|
||||
1 An error has occured.
|
||||
|
||||
=head1 EXAMPLES
|
||||
|
||||
nodeaddunmged hostname=unmanaged01 ip=192.168.1.100
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
|
47
xCAT-client/pods/man1/nodechmac.1.pod
Normal file
47
xCAT-client/pods/man1/nodechmac.1.pod
Normal file
@ -0,0 +1,47 @@
|
||||
=head1 NAME
|
||||
|
||||
B<nodechmac> - Update a profiled node's provisioning NIC's MAC address.
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
B<nodechmac> [-h| --help │ -v │ --version]
|
||||
|
||||
B<nodechmac> <node> mac=<mac>
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
The B<nodechmac> command is for changing a node's provisioning NIC's MAC.
|
||||
|
||||
This command can be used for following use case: The hardware of a node has some problems and this node will be replaced with a new one. However, Admin wants to apply the old node's configurations to the new one. For example: keep the old hostname, network settings...etc.
|
||||
|
||||
=head1 OPTIONS
|
||||
|
||||
B<-h|--help>
|
||||
|
||||
Display usage message.
|
||||
|
||||
B<-v|--version>
|
||||
|
||||
Command Version.
|
||||
|
||||
B<node>
|
||||
|
||||
The node name.
|
||||
|
||||
B<mac=<mac>>
|
||||
|
||||
The provisioning NIC's MAC address of the new node.
|
||||
|
||||
=head1 RETURN VALUE
|
||||
|
||||
0 The command completed successfully.
|
||||
|
||||
1 An error has occured.
|
||||
|
||||
=head1 EXAMPLES
|
||||
|
||||
nodechmac compute-000 mac=2F:3C:88:98:7E:01
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
|
62
xCAT-client/pods/man1/nodechprofile.1.pod
Normal file
62
xCAT-client/pods/man1/nodechprofile.1.pod
Normal file
@ -0,0 +1,62 @@
|
||||
=head1 NAME
|
||||
|
||||
B<nodechprofile> - Update node profiles for profiled nodes.
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
B<nodechprofile> [-h| --help │ -v │ --version]
|
||||
|
||||
B<nodechprofile> <noderange> [imageprofile=<imageprofile>] [networkprofile=<networkprofile>] [hardwareprofile=<hardwareprofile>]
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
The B<nodechprofile> command update following profiles for nodes: imageprofile, networkprofile and hardwareprofile. After profiles for nodes changed, the node's status will be changed to "defined", which means we must reinstall them.
|
||||
|
||||
Changing imageprofile will change node's os or provisioning related settings.
|
||||
|
||||
Changing networkprofile will change node's network settings. And, B<nodechprofile> will be able to update node's IP address automatically.
|
||||
|
||||
Changing hardwareprofile will change node's hardware settings: BMC, FSP...etc.
|
||||
|
||||
=head1 OPTIONS
|
||||
|
||||
B<-h|--help>
|
||||
|
||||
Display usage message.
|
||||
|
||||
B<-v|--version>
|
||||
|
||||
Command Version.
|
||||
|
||||
B<noderange>
|
||||
|
||||
The nodes to be removed.
|
||||
|
||||
B<imageprofile=<imageprofile>>
|
||||
|
||||
The new image profile name. If there is a group named "__ImageProfile_imgprofile", then "imgprofile" is the image profile name. A image profile defines provisioning method, os info, kit info, provisioning params...etc for nodes.
|
||||
|
||||
B<networkprofile=<networkprofile>>
|
||||
|
||||
The network profile name. If there is a group named "__NetworkProfile_netprofile", then "netprofile" is the network profile name. A network profile defines networks, nics, routes...etc for nodes.
|
||||
|
||||
B<hardwareprofile=<hardwareprofile>>
|
||||
|
||||
The hardware profile name. If there is a group named "__HardwareProfile_hwprofile", then "hwprofile" is the hardware profile name. A harddware profile defines hardware management related info like: IPMI, HMC, CEC, CMM...etc for nodes.
|
||||
|
||||
=head1 RETURN VALUE
|
||||
|
||||
0 The command completed successfully.
|
||||
|
||||
1 An error has occured.
|
||||
|
||||
=head1 EXAMPLES
|
||||
|
||||
nodechprofile compute-000,compute-001 imageprofile=rhels6.3_packaged
|
||||
|
||||
nodechprofile compute-000 imageprofile=rhels6.3_packaged networkprofile=default_cn hardwareprofile=default_ipmi
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
L<nodepurge(1)|nodepurge.1>, L<noderefresh(1)|noderefresh.1>, L<nodeimport(1)|nodeimport.1>, L<noderange(3)|noderange.3>
|
||||
|
37
xCAT-client/pods/man1/nodediscoverls.1.pod
Normal file
37
xCAT-client/pods/man1/nodediscoverls.1.pod
Normal file
@ -0,0 +1,37 @@
|
||||
=head1 NAME
|
||||
|
||||
B<nodediscoverls> - List all discovered profiled nodes
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
B<nodediscoverls> [-h| --help │ -v │ --version]
|
||||
|
||||
B<nodediscoverls>
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
The B<nodediscoverls> List all discovered profiled nodes at current discover period.
|
||||
|
||||
=head1 OPTIONS
|
||||
|
||||
B<-h|--help>
|
||||
|
||||
Display usage message.
|
||||
|
||||
B<-v|--version>
|
||||
|
||||
Command Version.
|
||||
|
||||
=head1 RETURN VALUE
|
||||
|
||||
0 The command completed successfully.
|
||||
|
||||
1 An error has occured.
|
||||
|
||||
=head1 EXAMPLES
|
||||
|
||||
nodediscoverls
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
L<nodediscoverstart(1)|nodediscoverstart.1>, L<nodediscoverstatus(1)|nodediscoverstatus.1>, L<nodediscoverstop(1)|nodediscoverstop.1>
|
95
xCAT-client/pods/man1/nodediscoverstart.1.pod
Normal file
95
xCAT-client/pods/man1/nodediscoverstart.1.pod
Normal file
@ -0,0 +1,95 @@
|
||||
=head1 NAME
|
||||
|
||||
B<nodediscoverstart> - Start profiled nodes discovery.
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
B<nodediscoverstart> [-h| --help │ -v │ --version]
|
||||
|
||||
B<nodediscoverstart> networkprofile=<networkprofile> imageprofile=<imageprofile> hostnameformat=<hostnameformat> [hardwareprofile=<hardwareprofile>] [groups=<groups>] [rack=<rack>] [chassis=<chassis>] [height=<height>] [unit=<unit>] [rank=rank]
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
The B<nodediscoverstart> command starts profiled nodes discovery.
|
||||
|
||||
Once profiled nodes discovery started, admin can bootup nodes which want to be provisioned with PXE. These nodes will be able to discovered automatically. The nodes' settings like hostname and IP address will be assigned automatically according to specified profiles.
|
||||
|
||||
After nodes discovered, 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.
|
||||
|
||||
=head1 OPTIONS
|
||||
|
||||
B<-h|--help>
|
||||
|
||||
Display usage message.
|
||||
|
||||
B<-v|--version>
|
||||
|
||||
Command Version.
|
||||
|
||||
B<networkprofile=<networkprofile>>
|
||||
|
||||
The network profile name. If there is a group named "__NetworkProfile_netprofile", then "netprofile" is the network profile name. A network profile defines networks, nics, routes...etc for imported nodes.
|
||||
|
||||
B<imageprofile=<imageprofile>>
|
||||
|
||||
The image profile name. If there is a group named "__ImageProfile_imgprofile", then "imgprofile" is the image profile name. A image profile defines provisioning method, os info, kit info, provisioning params...etc for imported nodes.
|
||||
|
||||
B<hardwareprofile=<hardwareprofile>>
|
||||
|
||||
The hardware profile name. If there is a group named "__HardwareProfile_hwprofile", then "hwprofile" is the hardware profile name. A harddware profile defines hardware management related info like: IPMI, HMC, CEC, CMM...etc for imported nodes.
|
||||
|
||||
B<hostnameformat=<hostnameformat>>
|
||||
|
||||
The hostname format for generating hostnames for nodes if the hostname for a node is specified as "__hostname__" in hostinfo file.
|
||||
Following hostname format types are supported:
|
||||
|
||||
B<prefix#NNNappendix>
|
||||
|
||||
For example:
|
||||
If hostname format is compute-#NN, then node's hostname will be generated automatically like: compute-00, compute-01, ...compute-99
|
||||
If hostname format is blade#NNN-x64, then node's hostname will be generated automatically like: blade001-x64, blade002-x64, ..., blade999-x64
|
||||
|
||||
B<prefix#RRand#NNappendix>
|
||||
|
||||
For example:
|
||||
If hostname format is compute-#RR-#NN, then nodes which placed in a rack which rack number is 2 will be generated with hostnames like: compute-02-00, compute-02-01, ..., compute-02-99. And nodes which placed in another rack wich rack number is 5 will be generated with hostnames like: compute-05-00, compute-05-01, ..., compute-05-99.
|
||||
If hostname format is node-#NN-in-#RR, then hostnames for nodes in rack with rack number 1 will be: node-00-in-01, node-01-in-01, ..., node-99-in-01. And hostnames for nodes in rack with rack number 2 will be: node-00-in-02, node-01-in-02, ..., node-99-in-02.
|
||||
|
||||
B<groups=<groups>>
|
||||
|
||||
The groups which the imported nodes will belong to.
|
||||
|
||||
B<rack=<rack name>>
|
||||
|
||||
node location info. Specify the rack name which this node will be placed into.
|
||||
|
||||
B<chasiss=<chassis name>>
|
||||
|
||||
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.
|
||||
|
||||
B<height=<chassis name>>
|
||||
|
||||
node location info, for rack server only. Specify the server height number, in U. This item must be specified together with rack. If not specified, the default value is 1.
|
||||
|
||||
B<unit=<unit name>>
|
||||
|
||||
node location info, for rack server only. Specify the node's start unit number in rack, in U. This item must be specified together with rack. If not specified, the default value is 1.
|
||||
|
||||
B<rank=<rank>>
|
||||
|
||||
Defines the start number in hostname format. If hostname format specified like "compute#NNN" and rank is set to 5, then hostnames of discovered nodes will be named as: "compute005, compute006, ..."
|
||||
|
||||
=head1 RETURN VALUE
|
||||
|
||||
0 The command completed successfully.
|
||||
|
||||
1 An error has occured.
|
||||
|
||||
=head1 EXAMPLES
|
||||
|
||||
nodediscoverstart networkprofile=default_cn imageprofile=rhels6.3_packaged hostnameformat=compute#NNN
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
L<nodediscoverstop(1)|nodediscoverstop.1>, L<nodediscoverls(1)|nodediscoverls.1>, L<nodediscoverstatus(1)|nodediscoverstatus.1>
|
||||
|
37
xCAT-client/pods/man1/nodediscoverstatus.1.pod
Normal file
37
xCAT-client/pods/man1/nodediscoverstatus.1.pod
Normal file
@ -0,0 +1,37 @@
|
||||
=head1 NAME
|
||||
|
||||
B<nodediscoverstatus> - Detect whether Profiled nodes discovery is running or not.
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
B<nodediscoverstatus> [-h| --help │ -v │ --version]
|
||||
|
||||
B<nodediscoverstatus>
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
The B<nodediscoverstatus> Detect whether Profiled nodes discovery is running or not.
|
||||
|
||||
=head1 OPTIONS
|
||||
|
||||
B<-h|--help>
|
||||
|
||||
Display usage message.
|
||||
|
||||
B<-v|--version>
|
||||
|
||||
Command Version.
|
||||
|
||||
=head1 RETURN VALUE
|
||||
|
||||
0 The command completed successfully.
|
||||
|
||||
1 An error has occured.
|
||||
|
||||
=head1 EXAMPLES
|
||||
|
||||
nodediscoverstatus
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
L<nodediscoverstart(1)|nodediscoverstart.1>, L<nodediscoverls(1)|nodediscoverls.1>, L<nodediscoverstatus(1)|nodediscoverstop.1>
|
37
xCAT-client/pods/man1/nodediscoverstop.1.pod
Normal file
37
xCAT-client/pods/man1/nodediscoverstop.1.pod
Normal file
@ -0,0 +1,37 @@
|
||||
=head1 NAME
|
||||
|
||||
B<nodediscoverstop> - Stop profiled nodes auto discover.
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
B<nodediscoverstop> [-h| --help │ -v │ --version]
|
||||
|
||||
B<nodediscoverstop>
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
The B<nodediscoverstop> command stops profiled nodes discover and the new booted nodes will not be discovered as profiled nodes any more.
|
||||
|
||||
=head1 OPTIONS
|
||||
|
||||
B<-h|--help>
|
||||
|
||||
Display usage message.
|
||||
|
||||
B<-v|--version>
|
||||
|
||||
Command Version.
|
||||
|
||||
=head1 RETURN VALUE
|
||||
|
||||
0 The command completed successfully.
|
||||
|
||||
1 An error has occured.
|
||||
|
||||
=head1 EXAMPLES
|
||||
|
||||
nodediscoverstop
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
L<nodediscoverstart(1)|nodediscoverstart.1>, L<nodediscoverls(1)|nodediscoverls.1>, L<nodediscoverstatus(1)|nodediscoverstatus.1>
|
155
xCAT-client/pods/man1/nodeimport.1.pod
Normal file
155
xCAT-client/pods/man1/nodeimport.1.pod
Normal file
@ -0,0 +1,155 @@
|
||||
=head1 NAME
|
||||
|
||||
B<nodeimport> - Create profiled nodes by importing hostinfo file.
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
B<nodeimport> [-h| --help │ -v │ --version]
|
||||
|
||||
B<nodeimport> file=<hostinfo file> networkprofile=<networkprofile> imageprofile=<imageprofile> hostnameformat=<hostnameformat> [hardwareprofile=<hardwareprofile>] [groups=<groups>]
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
The B<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, and host location infomation 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.
|
||||
|
||||
=head1 OPTIONS
|
||||
|
||||
B<-h|--help>
|
||||
|
||||
Display usage message.
|
||||
|
||||
B<-v|--version>
|
||||
|
||||
Command Version.
|
||||
|
||||
B<file=<hostinfo file>>
|
||||
|
||||
The full path of the hostinfo file.
|
||||
|
||||
B<networkprofile=<networkprofile>>
|
||||
|
||||
The network profile name. If there is a group named "__NetworkProfile_netprofile", then "netprofile" is the network profile name. A network profile defines networks, nics, routes...etc for imported nodes.
|
||||
|
||||
B<imageprofile=<imageprofile>>
|
||||
|
||||
The image profile name. If there is a group named "__ImageProfile_imgprofile", then "imgprofile" is the image profile name. A image profile defines provisioning method, os info, kit info, provisioning params...etc for imported nodes.
|
||||
|
||||
B<hardwareprofile=<hardwareprofile>>
|
||||
|
||||
The hardware profile name. If there is a group named "__HardwareProfile_hwprofile", then "hwprofile" is the hardware profile name. A harddware profile defines hardware management related info like: IPMI, HMC, CEC, CMM...etc for imported nodes.
|
||||
|
||||
B<hostnameformat=<hostnameformat>>
|
||||
|
||||
The hostname format for generating hostnames for nodes if the hostname for a node is specified as "__hostname__" in hostinfo file.
|
||||
Following hostname format types are supported:
|
||||
|
||||
B<prefix#NNNappendix>
|
||||
|
||||
For example:
|
||||
If hostname format is compute-#NN, then node's hostname will be generated automatically like: compute-00, compute-01, ...compute-99
|
||||
If hostname format is blade#NNN-x64, then node's hostname will be generated automatically like: blade001-x64, blade002-x64, ..., blade999-x64
|
||||
|
||||
B<prefix#RRand#NNappendix>
|
||||
|
||||
For example:
|
||||
If hostname format is compute-#RR-#NN, then nodes which placed in a rack which rack number is 2 will be generated with hostnames like: compute-02-00, compute-02-01, ..., compute-02-99. And nodes which placed in another rack wich rack number is 5 will be generated with hostnames like: compute-05-00, compute-05-01, ..., compute-05-99.
|
||||
If hostname format is node-#NN-in-#RR, then hostnames for nodes in rack with rack number 1 will be: node-00-in-01, node-01-in-01, ..., node-99-in-01. And hostnames for nodes in rack with rack number 2 will be: node-00-in-02, node-01-in-02, ..., node-99-in-02.
|
||||
|
||||
B<groups=<groups>>
|
||||
|
||||
The groups which the imported nodes will belong to.
|
||||
|
||||
|
||||
=head1 RETURN VALUE
|
||||
|
||||
0 The command completed successfully.
|
||||
|
||||
1 An error has occured while validating parameters.
|
||||
|
||||
2 An error has occured while parsing hostinfo file.
|
||||
|
||||
|
||||
=head1 EXAMPLES
|
||||
|
||||
An example for importing profiled nodes.
|
||||
1. Run "tabdump nodegroups" to get all groups and find out which ones are avaiable profiles. Then run "lsdef -t group <groupname>" to get the detailed info for these profiles. like:
|
||||
# tabdump nodegroup
|
||||
#groupname,grouptype,members,membergroups,wherevals,comments,disable
|
||||
"compute","static",,,,,
|
||||
"__HardwareProfile_default_ipmi","static","static",,,,
|
||||
"__NetworkProfile_default_mn","static","static",,,,
|
||||
"__NetworkProfile_default_cn","static",,,,,
|
||||
"__ImageProfile_rhels6.2-x86_64-install-compute","static","static",,,,
|
||||
|
||||
# lsdef -t group __NetworkProfile_default_cn
|
||||
Object name: __NetworkProfile_default_cn
|
||||
grouptype=static
|
||||
installnic=eth0
|
||||
members=compute-000,compute-001
|
||||
netboot=xnba
|
||||
nichostnamesuffixes=eth0:-eth0
|
||||
nicnetworks=eth0:provision
|
||||
nictypes=eth0:Ethernet
|
||||
primarynic=eth0
|
||||
|
||||
2. Prepare a hostinfo file looks like:
|
||||
|
||||
# hostinfo begin
|
||||
|
||||
__hostname__:
|
||||
mac=b8:ac:6f:37:59:24
|
||||
ip=192.168.1.20
|
||||
chassis=chassis01
|
||||
|
||||
__hostname__:
|
||||
mac=b8:ac:6f:37:59:25
|
||||
ip=192.168.1.20
|
||||
rack=rack01
|
||||
height=1
|
||||
unit=2
|
||||
|
||||
# hostinfo end.
|
||||
|
||||
Here, we are going to import 2 nodes, and about each line of this file:
|
||||
__hostname__: - Mandatory item
|
||||
Description: The hostname for the node.
|
||||
If you want to specify the hostname for this node, just write like: "compute-001:"
|
||||
If you want the hostname auto generated from hostnameformat, just write like: "__hostname__:"
|
||||
|
||||
mac=<mac str> - Mandatory item
|
||||
Description: Specify the node's provisioning nic's MAC address
|
||||
|
||||
ip=<ip str> - Optional item
|
||||
Description: Specify the node's provisioing IP address.
|
||||
If not specify this item, node's provisioning IP will be generated automatically according to NetworkProfile.
|
||||
|
||||
rack=<rack name> - 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.
|
||||
|
||||
chasiss=<chassis name> - 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.
|
||||
|
||||
height=<chassis name> - Optional item
|
||||
Description: node location info, for rack server only. Specify the server height number, in U.
|
||||
this item must be specified together with rack and unit.
|
||||
|
||||
unit=<unit name> - Optional item
|
||||
Description: node location info, for rack server only. Specify the node's start unit number in rack, in U.
|
||||
this item must be specified together with rack and height.
|
||||
|
||||
3. Run nodeimport command:
|
||||
nodeimport file=/root/hostinfo.txt networkprofile=default_cn imageprofile=rhels6.3_packaged hostnameformat=compute-#NNN
|
||||
|
||||
4. After node import succeeds, we'll get 2 nodes created, And node's configurations like dhcp, dns, /etc/hosts will be updated automatically too.
|
||||
|
||||
5. Reboot the nodes, they will be provisioned automatically.
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
L<nodepurge(1)|nodepurge.1>, L<nodechprofile(1)|nodechprofile.1>, L<noderefresh(1)|noderefresh.1>
|
||||
|
44
xCAT-client/pods/man1/nodepurge.1.pod
Normal file
44
xCAT-client/pods/man1/nodepurge.1.pod
Normal file
@ -0,0 +1,44 @@
|
||||
=head1 NAME
|
||||
|
||||
B<nodepurge> - Remove nodes from database, also remove them from system configuration.
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
B<nodepurge> [-h| --help │ -v │ --version]
|
||||
|
||||
B<nodepurge> <noderange>
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
The B<nodepurge> command removes nodes records from database, and also remove relative configuration automatically.
|
||||
|
||||
After nodes removed, 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.
|
||||
|
||||
=head1 OPTIONS
|
||||
|
||||
B<-h|--help>
|
||||
|
||||
Display usage message.
|
||||
|
||||
B<-v|--version>
|
||||
|
||||
Command Version
|
||||
|
||||
B<noderange>
|
||||
|
||||
The nodes to be removed.
|
||||
|
||||
=head1 RETURN VALUE
|
||||
|
||||
0 The command completed successfully.
|
||||
|
||||
1 An error has occured.
|
||||
|
||||
=head1 EXAMPLES
|
||||
|
||||
nodepurge compute-000,compute-001
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
L<nodeimport(1)|nodeimport.1>, L<nodechprofile(1)|nodechprofile.1>, L<noderefresh(1)|noderefresh.1>, L<noderange(3)|noderange.3>
|
||||
|
42
xCAT-client/pods/man1/noderefresh.1.pod
Normal file
42
xCAT-client/pods/man1/noderefresh.1.pod
Normal file
@ -0,0 +1,42 @@
|
||||
=head1 NAME
|
||||
|
||||
B<noderefresh> - Re-Call kit plugins for profiled nodes
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
B<noderefresh> [-h| --help │ -v │ --version]
|
||||
|
||||
B<noderefresh> <noderange>
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
The B<noderefresh> command will just call kit plugins for profiled nodes, in-order to refresh node's related configurations/services.
|
||||
|
||||
=head1 OPTIONS
|
||||
|
||||
B<-h|--help>
|
||||
|
||||
Display usage message.
|
||||
|
||||
B<-v|--version>
|
||||
|
||||
Command Version.
|
||||
|
||||
B<noderange>
|
||||
|
||||
The nodes to be updated.
|
||||
|
||||
=head1 RETURN VALUE
|
||||
|
||||
0 The command completed successfully.
|
||||
|
||||
1 An error has occured.
|
||||
|
||||
=head1 EXAMPLES
|
||||
|
||||
noderefresh compute-000,compute-001
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
L<nodeimport(1)|nodeimport.1>, L<nodechprofile(1)|nodechprofile.1>, L<nodepurge(1)|nodepurge.1>, L<noderange(3)|noderange.3>
|
||||
|
@ -220,6 +220,16 @@ ln -sf ../bin/xcatclientnnr $RPM_BUILD_ROOT/%{prefix}/bin/addkitcomp
|
||||
ln -sf ../bin/xcatclientnnr $RPM_BUILD_ROOT/%{prefix}/bin/rmkitcomp
|
||||
ln -sf ../bin/xcatclientnnr $RPM_BUILD_ROOT/%{prefix}/bin/chkkitcomp
|
||||
ln -sf ../bin/xcatclientnnr $RPM_BUILD_ROOT/%{prefix}/bin/lskmodules
|
||||
ln -sf ../bin/xcatclientnnr $RPM_BUILD_ROOT/%{prefix}/bin/nodeimport
|
||||
ln -sf ../bin/xcatclientnnr $RPM_BUILD_ROOT/%{prefix}/bin/nodediscoverstart
|
||||
ln -sf ../bin/xcatclientnnr $RPM_BUILD_ROOT/%{prefix}/bin/nodediscoverstop
|
||||
ln -sf ../bin/xcatclientnnr $RPM_BUILD_ROOT/%{prefix}/bin/nodediscoverls
|
||||
ln -sf ../bin/xcatclientnnr $RPM_BUILD_ROOT/%{prefix}/bin/nodediscoverstatus
|
||||
ln -sf ../bin/xcatclientnnr $RPM_BUILD_ROOT/%{prefix}/bin/nodeaddunmged
|
||||
ln -sf ../bin/xcatclient $RPM_BUILD_ROOT/%{prefix}/bin/nodepurge
|
||||
ln -sf ../bin/xcatclient $RPM_BUILD_ROOT/%{prefix}/bin/nodechprofile
|
||||
ln -sf ../bin/xcatclient $RPM_BUILD_ROOT/%{prefix}/bin/noderefresh
|
||||
ln -sf ../bin/xcatclient $RPM_BUILD_ROOT/%{prefix}/bin/nodechmac
|
||||
|
||||
|
||||
%clean
|
||||
|
@ -12,6 +12,7 @@ package xCAT_plugin::profilednodes;
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
use Getopt::Long qw(:config no_ignore_case);
|
||||
require xCAT::Table;
|
||||
require xCAT::DBobjUtils;
|
||||
require xCAT::Utils;
|
||||
@ -150,7 +151,7 @@ sub process_request {
|
||||
#-----------------------------------------------------
|
||||
|
||||
sub parse_args{
|
||||
foreach my $arg (@$args){
|
||||
foreach my $arg (@ARGV){
|
||||
my @argarray = split(/=/,$arg);
|
||||
my $arglen = @argarray;
|
||||
if ($arglen > 2){
|
||||
@ -171,6 +172,69 @@ sub parse_args{
|
||||
return undef;
|
||||
}
|
||||
|
||||
sub validate_args{
|
||||
my $helpmsg = shift;
|
||||
my $enabledparamsref = shift;
|
||||
my $mandatoryparamsref = shift;
|
||||
|
||||
my $help;
|
||||
my $ver;
|
||||
|
||||
@ARGV = ();
|
||||
if($args) {
|
||||
@ARGV = @$args;
|
||||
}
|
||||
GetOptions(
|
||||
'h|help' => \$help,
|
||||
'V|verbose' => \$::VERBOSE,
|
||||
'v|version' => \$ver,
|
||||
);
|
||||
|
||||
if($help){
|
||||
setrsp_infostr($helpmsg);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if($ver){
|
||||
my $version = xCAT::Utils->Version();
|
||||
my $versionmsg = "$command : $version";
|
||||
setrsp_infostr($versionmsg);
|
||||
return 0;
|
||||
}
|
||||
|
||||
my $parseret = parse_args();
|
||||
if ($parseret){
|
||||
setrsp_errormsg($parseret);
|
||||
return 0;
|
||||
}
|
||||
|
||||
# Make sure the specified parameters are valid ones.
|
||||
my @enabledparams = ();
|
||||
if($enabledparamsref){
|
||||
@enabledparams = @$enabledparamsref;
|
||||
}
|
||||
foreach my $argname (keys %args_dict){
|
||||
if (! grep{ $_ eq $argname} @enabledparams){
|
||||
setrsp_errormsg("Illegal attribute $argname specified.");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
# Mandatory arguments.
|
||||
my @mandatoryparams = ();
|
||||
if ($mandatoryparamsref){
|
||||
@mandatoryparams = @$mandatoryparamsref;
|
||||
}
|
||||
foreach (@mandatoryparams){
|
||||
if(! exists($args_dict{$_})){
|
||||
setrsp_errormsg("Mandatory parameter $_ not specified.");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head3 nodeimport
|
||||
@ -198,25 +262,19 @@ sub nodeimport{
|
||||
|
||||
# Parse arges.
|
||||
xCAT::MsgUtils->message('S', "Import profiled nodes through hostinfo file.");
|
||||
my $retstr = parse_args();
|
||||
if ($retstr){
|
||||
setrsp_errormsg($retstr);
|
||||
return;
|
||||
}
|
||||
# Make sure the specified parameters are valid ones.
|
||||
|
||||
my $helpmsg = "nodeimport: create profiled nodes by importing hostinfo file.
|
||||
Usage:
|
||||
\tnodeimport file=<hostinfo file> networkprofile=<networkprofile> imageprofile=<imageprofile> hostnameformat=<hostnameformat> [hardwareprofile=<hardwareprofile>] [groups=<groups>]
|
||||
\tnodeimport [-h|--help]
|
||||
\tnodeimport {-v|--version}";
|
||||
|
||||
my @enabledparams = ('file', 'groups', 'networkprofile', 'hardwareprofile', 'imageprofile', 'hostnameformat');
|
||||
foreach my $argname (keys %args_dict){
|
||||
if (! grep{ $_ eq $argname} @enabledparams){
|
||||
setrsp_errormsg("Illegal attribute $argname specified.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
# Mandatory arguments.
|
||||
foreach (('file','networkprofile', 'imageprofile', 'hostnameformat')){
|
||||
if(! exists($args_dict{$_})){
|
||||
setrsp_errormsg("Mandatory parameter $_ not specified.");
|
||||
return;
|
||||
}
|
||||
my @mandatoryparams = ('file','networkprofile', 'imageprofile', 'hostnameformat');
|
||||
|
||||
my $ret = validate_args($helpmsg, \@enabledparams, \@mandatoryparams);
|
||||
if (! $ret){
|
||||
return;
|
||||
}
|
||||
|
||||
if(! (-e $args_dict{'file'})){
|
||||
@ -299,7 +357,7 @@ sub nodeimport{
|
||||
setrsp_progress("call mkdef to create nodes.");
|
||||
my $warnstr = "";
|
||||
my $retref = xCAT::Utils->runxcmd({command=>["mkdef"], stdin=>[$retstr_gen], arg=>['-z']}, $request_command, 0, 1);
|
||||
$retstr = get_cmd_return($retref);
|
||||
my $retstr = get_cmd_return($retref);
|
||||
xCAT::MsgUtils->message('S', "The return message of running mkdef: $retstr");
|
||||
# runxcmd failed.
|
||||
if ($::RUNCMD_RC != 0){
|
||||
@ -343,6 +401,18 @@ sub nodepurge{
|
||||
xCAT::MsgUtils->message('S', "Purging nodes.");
|
||||
# For remove nodes, we should call 'nodemgmt' in front of 'noderm'
|
||||
setrsp_progress("Call kit node plugins.");
|
||||
|
||||
my $helpmsg = "nodepurge: Remove nodes from database, also remove them from system configuration.
|
||||
Usage:
|
||||
\tnodepurge <noderange>
|
||||
\tnodepurge [-h|--help]
|
||||
\tnodepurge {-v|--version}";
|
||||
|
||||
my $ret = validate_args($helpmsg);
|
||||
if (! $ret){
|
||||
return;
|
||||
}
|
||||
|
||||
my $warnstr = "";
|
||||
my $retref = xCAT::Utils->runxcmd({command=>["kitnoderemove"], node=>$nodes}, $request_command, 0, 1);
|
||||
my $retstr = get_cmd_return($retref);
|
||||
@ -384,6 +454,17 @@ sub nodepurge{
|
||||
sub noderefresh
|
||||
{
|
||||
my $nodes = $request->{node};
|
||||
my $helpmsg = "noderefresh: Re-Call kit plugins for profiled nodes
|
||||
Usage:
|
||||
\tnoderefresh <noderange>
|
||||
\tnoderefresh [-h|--help]
|
||||
\tnoderefresh {-v|--version}";
|
||||
|
||||
my $ret = validate_args($helpmsg);
|
||||
if (! $ret){
|
||||
return;
|
||||
}
|
||||
|
||||
my $retref = xCAT::Utils->runxcmd({command=>["kitnoderefresh"], node=>$nodes}, $request_command, 0, 1);
|
||||
my $retstr = get_cmd_return($retref);
|
||||
xCAT::MsgUtils->message('S', "The return message of running kitnoderefresh: $retstr");
|
||||
@ -412,24 +493,21 @@ sub noderefresh
|
||||
#-------------------------------------------------------
|
||||
sub nodechprofile{
|
||||
my $nodes = $request->{node};
|
||||
my %updated_groups;
|
||||
|
||||
xCAT::MsgUtils->message('S', "Update nodes' profile settings.");
|
||||
# Parse arges.
|
||||
my $retstr = parse_args();
|
||||
if ($retstr){
|
||||
setrsp_errormsg($retstr);
|
||||
|
||||
my $helpmsg = "nodechprofile: Update node profiles for profiled nodes.
|
||||
Usage:
|
||||
\tnodechprofile <noderange> [networkprofile=<networkprofile>] [imageprofile=<imageprofile>] [hardwareprofile=<hardwareprofile>]
|
||||
\tnodechprofile [-h|--help]
|
||||
\tnodechprofile {-v|--version}";
|
||||
|
||||
my @enabledparams = ('networkprofile', 'hardwareprofile', 'imageprofile');
|
||||
my $ret = validate_args($helpmsg, \@enabledparams);
|
||||
if (! $ret){
|
||||
return;
|
||||
}
|
||||
# Make sure the specified parameters are valid ones.
|
||||
my @enabledparams = ('networkprofile', 'hardwareprofile', 'imageprofile');
|
||||
foreach my $argname (keys %args_dict){
|
||||
if (! grep{ $_ eq $argname} @enabledparams){
|
||||
setrsp_errormsg("Illegal attribute $argname specified.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
my %updated_groups;
|
||||
# Get current templates for all nodes.
|
||||
setrsp_progress("Read database to get groups for all nodes.");
|
||||
my %groupdict;
|
||||
@ -447,7 +525,7 @@ sub nodechprofile{
|
||||
if ($attrshash{'groups'}){
|
||||
@groups = split(/,/, $attrshash{'groups'});
|
||||
|
||||
my $groupsref;
|
||||
my $groupsref = [];
|
||||
# Replace the old template name with new specified ones in args_dict
|
||||
if(exists $args_dict{'networkprofile'}){
|
||||
$groupsref = replace_item_in_array(\@groups, "NetworkProfile", $args_dict{'networkprofile'});
|
||||
@ -471,7 +549,7 @@ sub nodechprofile{
|
||||
# call plugins
|
||||
setrsp_progress("Call nodemgmt plugins.");
|
||||
my $retref = xCAT::Utils->runxcmd({command=>["kitnodeupdate"], node=>$nodes}, $request_command, 0, 1);
|
||||
$retstr = get_cmd_return($retref);
|
||||
my $retstr = get_cmd_return($retref);
|
||||
xCAT::MsgUtils->message('S', "The return message of running kitnodeupdate: $retstr");
|
||||
if ($::RUNCMD_RC != 0){
|
||||
setrsp_progress("Warning: failed to call some kit commands. Details: $retstr");
|
||||
@ -503,27 +581,16 @@ sub nodechprofile{
|
||||
sub nodeaddunmged
|
||||
{
|
||||
xCAT::MsgUtils->message("Adding a unmanaged node.");
|
||||
# Parse arges.
|
||||
my $retstr = parse_args();
|
||||
if ($retstr){
|
||||
setrsp_errormsg($retstr);
|
||||
return;
|
||||
}
|
||||
my $helpmsg = "nodeaddunmged: Create a un-managed node with hostname and ip address specified.
|
||||
Usage:
|
||||
\tnodeaddunmged hostname<hostname> ip=<ip>
|
||||
\tnodeaddunmged [-h|--help]
|
||||
\tnodeaddunmged {-v|--version}";
|
||||
|
||||
# Make sure the specified parameters are valid ones.
|
||||
my @enabledparams = ('hostname', 'ip');
|
||||
foreach my $argname (keys %args_dict){
|
||||
if (! grep{ $_ eq $argname} @enabledparams){
|
||||
setrsp_errormsg("Illegal attribute $argname specified.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
# Mandatory arguments.
|
||||
foreach (('hostname','ip')){
|
||||
if(! exists($args_dict{$_})){
|
||||
setrsp_errormsg("Mandatory parameter $_ not specified.");
|
||||
return;
|
||||
}
|
||||
my $ret = validate_args($helpmsg, \@enabledparams, \@enabledparams);
|
||||
if (! $ret){
|
||||
return;
|
||||
}
|
||||
|
||||
# validate the IP address
|
||||
@ -561,7 +628,7 @@ sub nodeaddunmged
|
||||
|
||||
# run nodeadd to create node records.
|
||||
my $retref = xCAT::Utils->runxcmd({command=>["nodeadd"], arg=>[$args_dict{"hostname"}, "groups=__Unmanaged", "hosts.ip=$args_dict{'ip'}"]}, $request_command, 0, 1);
|
||||
$retstr = get_cmd_return($retref);
|
||||
my $retstr = get_cmd_return($retref);
|
||||
xCAT::MsgUtils->message('S', "The return message of running nodeadd: $retstr");
|
||||
if ($::RUNCMD_RC != 0){
|
||||
setrsp_errormsg("Failed to call nodeadd to create node. Details: $retstr");
|
||||
@ -591,30 +658,21 @@ sub nodeaddunmged
|
||||
sub nodechmac
|
||||
{
|
||||
xCAT::MsgUtils->message("Replacing node's mac address.");
|
||||
# Parse arges.
|
||||
my $nodelist = $request->{node};
|
||||
my $hostname = $nodelist->[0];
|
||||
my $retstr = parse_args();
|
||||
if ($retstr){
|
||||
setrsp_errormsg($retstr);
|
||||
my $helpmsg = "nodechmac: Update a profiled node's provisioning NIC's MAC address.
|
||||
Usage:
|
||||
\tnodechmac <node> mac=<mac>
|
||||
\tnodechmac [-h|--help]
|
||||
\tnodechmac {-v|--version}";
|
||||
|
||||
my @enabledparams = ('mac');
|
||||
my $ret = validate_args($helpmsg, \@enabledparams, \@enabledparams);
|
||||
if (! $ret){
|
||||
return;
|
||||
}
|
||||
|
||||
# Make sure the specified parameters are valid ones.
|
||||
my @enabledparams = ('mac');
|
||||
foreach my $argname (keys %args_dict){
|
||||
if (! grep{ $_ eq $argname} @enabledparams){
|
||||
setrsp_errormsg("Illegal attribute $argname specified.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
# Mandatory arguments.
|
||||
foreach (('mac')){
|
||||
if(! exists($args_dict{$_})){
|
||||
setrsp_errormsg("Mandatory parameter $_ not specified.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
my $nodelist = $request->{node};
|
||||
my $hostname = $nodelist->[0];
|
||||
|
||||
# Validate MAC address
|
||||
my $recordsref = xCAT::ProfiledNodeUtils->get_allnode_singleattrib_hash('mac', 'mac');
|
||||
%allmacs = %$recordsref;
|
||||
@ -642,7 +700,7 @@ sub nodechmac
|
||||
# Call Plugins.
|
||||
setrsp_progress("Calling kit plugins");
|
||||
my $retref = xCAT::Utils->runxcmd({command=>["kitnodeupdate"], node=>[$hostname]}, $request_command, 0, 1);
|
||||
$retstr = get_cmd_return($retref);
|
||||
my $retstr = get_cmd_return($retref);
|
||||
xCAT::MsgUtils->message('S', "The return message of running kitnodeupdate: $retstr");
|
||||
if ($::RUNCMD_RC != 0){
|
||||
setrsp_progress("Warning: failed to call kit commands. Details: $retstr");
|
||||
@ -676,27 +734,20 @@ sub nodechmac
|
||||
|
||||
#-------------------------------------------------------
|
||||
sub nodediscoverstart{
|
||||
# Parse arges.
|
||||
xCAT::MsgUtils->message("Profiled nodes discovery started.");
|
||||
my $retstr = parse_args();
|
||||
if ($retstr){
|
||||
setrsp_errormsg($retstr);
|
||||
return;
|
||||
}
|
||||
|
||||
my $helpmsg = "nodediscoverstart: Start profiled nodes discovery.
|
||||
Usage:
|
||||
\tnodediscoverstart networkprofile=<networkprofile> imageprofile=<imageprofile> hostnameformat=<hostnameformat> [hardwareprofile=<hardwareprofile>] [groups=<groups>] [rack=<rack>] [chassis=<chassis>] [height=<height>] [unit=<unit>] [rank=rank]
|
||||
\tnodediscoverstart [-h|--help]
|
||||
\tnodediscoverstart {-v|--version}
|
||||
";
|
||||
|
||||
my @enabledparams = ('networkprofile', 'hardwareprofile', 'imageprofile', 'hostnameformat', 'rank', 'rack', 'chassis', 'height', 'unit', 'groups');
|
||||
foreach my $argname (keys %args_dict){
|
||||
if (! grep{ $_ eq $argname} @enabledparams){
|
||||
setrsp_errormsg("Illegal attribute $argname specified.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
# mandatory arguments.
|
||||
foreach my $key ('networkprofile', 'imageprofile', 'hostnameformat'){
|
||||
if (! exists $args_dict{$key}){
|
||||
setrsp_errormsg("argument $key must be specified");
|
||||
return;
|
||||
}
|
||||
my @mandatoryparams = ('networkprofile', 'imageprofile', 'hostnameformat');
|
||||
my $ret = validate_args($helpmsg, \@enabledparams, \@mandatoryparams);
|
||||
if (! $ret){
|
||||
return;
|
||||
}
|
||||
|
||||
# validate hostnameformat:
|
||||
@ -811,6 +862,18 @@ sub nodediscoverstart{
|
||||
|
||||
#------------------------------------------------------
|
||||
sub nodediscoverstop{
|
||||
|
||||
my $helpmsg = "nodediscoverstop: Stop profiled nodes auto discover.
|
||||
Usage:
|
||||
\tnodediscoverstop
|
||||
\tnodediscoverstop [-h|--help]
|
||||
\tnodediscoverstop {-v|--version}";
|
||||
|
||||
my $ret = validate_args($helpmsg);
|
||||
if (! $ret){
|
||||
return;
|
||||
}
|
||||
|
||||
# Read DB to confirm the discover is started.
|
||||
xCAT::MsgUtils->message("Stopping profiled node's discover.");
|
||||
my $discover_running = xCAT::ProfiledNodeUtils->is_discover_started();
|
||||
@ -848,6 +911,18 @@ sub nodediscoverstop{
|
||||
|
||||
#-------------------------------------------------------
|
||||
sub nodediscoverstatus{
|
||||
|
||||
my $helpmsg = "nodediscoverstatus: Detect whether Profiled nodes discovery is running or not.
|
||||
Usage:
|
||||
\tnodediscoverstatus
|
||||
\tnodediscoverstatus [-h|--help]
|
||||
\tnodediscoverstatus {-v|--version}";
|
||||
|
||||
my $ret = validate_args($helpmsg);
|
||||
if (! $ret){
|
||||
return;
|
||||
}
|
||||
|
||||
my $discover_running = xCAT::ProfiledNodeUtils->is_discover_started();
|
||||
if($discover_running){
|
||||
setrsp_progress("Profiled nodes discover is running");
|
||||
@ -867,6 +942,17 @@ sub nodediscoverstatus{
|
||||
|
||||
#-------------------------------------------------------
|
||||
sub nodediscoverls{
|
||||
my $helpmsg = "nodediscoverls: List all discovered profiled nodes.
|
||||
Usage:
|
||||
\tnodediscoverls
|
||||
\tnodediscoverls [-h|--help]
|
||||
\tnodediscoverls {-v|--version}";
|
||||
|
||||
my $ret = validate_args($helpmsg);
|
||||
if (! $ret){
|
||||
return;
|
||||
}
|
||||
|
||||
# Read DB to confirm the discover is started.
|
||||
my $discover_running = xCAT::ProfiledNodeUtils->is_discover_started();
|
||||
if (! $discover_running){
|
||||
|
Loading…
Reference in New Issue
Block a user