2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-05-30 09:36:41 +00:00

Merge branch 'master' of github.com:xcat2/xcat-core into xcatconfig_add_new_cases

This commit is contained in:
caomengmeng 2016-11-07 03:20:44 -05:00
commit 8b9910ee02
63 changed files with 2122 additions and 1651 deletions

View File

@ -12,15 +12,19 @@ Set attributes in the ``networks`` table
#. To define additional networks, use one of the following options:
* Use ``mkdef`` to create/update an entry into ``networks`` table. (**Recommended**)
* [**Recommended**] Use ``mkdef`` to create/update an entry into ``networks`` table.
To create a network entry for 192.168.X.X/16 with a gateway of 192.168.1.254: ::
mkdef -t network -o net1 net=192.168.0.0 mask=255.255.0.0 gateway=192.168.1.254
* Use the ``tabedit`` command to modify the networks table directly in an editor: ``tabedit networks``
* Use the ``tabedit`` command to modify the networks table directly in an editor: ::
* Use the ``makenetworks`` command to automatically generate a entry in the ``networks`` table
tabedit networks
* Use the ``makenetworks`` command to automatically generate a entry in the ``networks`` table: ::
makenetworks
#. Verify the network statements
@ -31,16 +35,33 @@ Set attributes in the ``networks`` table
Initialize DHCP services
------------------------
#. Configure DHCP to listen on different network interfaces (**Optional**)
Configure DHCP to listen on different network interfaces [**Optional**]
xCAT allows specifying different network intercaces thateDHCP can listen on for different nodes or node groups. If this is not needed, go to the next step. To set dhcpinterfaces ::
The default behavior of xCAT is to configure DHCP to listen on all interfaces defined in the ``networks`` table.
chdef -t site dhcpinterfaces='xcatmn|eth1,eth2;service|bond0'
The ``dhcpinterfaces`` keyword in the ``site`` table allows administrators to limit the interfaces that DHCP will listen over. If the management node has 4 interfaces, (eth0, eth1, eth2, and eth3), and you want DHCP to listen only on "eth1" and "eth3", set ``dhcpinterfaces`` using: ::
For more information, see ``dhcpinterfaces`` keyword in the :doc:`site </guides/admin-guides/references/man5/site.5>` table.
chdef -t site dhcpinterfaces="eth1,eth3"
To set "eth1" and "eth3" on the management node and "bond0" on all nodes in the nodegroup="service", set ``dhcpinterfaces`` using: ::
chdef -t site dhcpinterfaces="xcatmn|eth1,eth3;service|bond0"
**noboot**
``````````
For the *IBM OpenPOWER S822LC for HPC ("Minsky")* nodes, the BMC and compute "eth0" share the left-side integrated ethernet port and compute "eth1" is the right-side integrated ethernet port. For these servers, it is recommended to use two physical cables allowing the BMC port to be dedicated and "eth1" used by the OS. When an open range is configured on the two networks, the xCAT Genesis kernel will be sent to the BMC interface and causes problems during hardware discovery. To support this scenario, on the xCAT management node, if "eth1" is connected to the BMC network and "eth3" is connected to the compute network, disable genesis boot for the BMC network by setting ``:noboot`` in ``dhcpinterfaces`` using: ::
chdef -t site dhcpinterfaces="eth1:noboot,eth3"
# run the mknb command to remove the genesis
# configuration file for the specified network
mknb ppc64
For more information, see ``dhcpinterfaces`` keyword in the :doc:`site </guides/admin-guides/references/man5/site.5>` table.
#. Create a new DHCP configuration file with the networks defined using the ``makedhcp`` command. ::
After making any DHCP changes, create a new DHCP configuration file with the networks defined using the ``makedhcp`` command. ::
makedhcp -n

View File

@ -0,0 +1,58 @@
At the time of this writing there is no ISO image availabe for RHEV. Individual RPM packages need to be downloaded.
* Download *Management-Agent-Power-7* and *Power_Tools-7* RPMs from RedHat to the xCAT management node. Steps below assume all RPMs were downloaded to ``/install/post/otherpkgs/rhels7.3/ppc64le/RHEV4/4.0-GA``
* Create a yum repository for the downloaded RPMs ::
createrepo /install/post/otherpkgs/rhels7.3/ppc64le/RHEV4/4.0-GA
* Create new osimage definition based on an existing RHEL7 osimage definition ::
mkdef -t osimage -o rhels7.3-ppc64le-RHEV4-install-compute \
--template rhels7.3-ppc64le-install-compute
* Modify ``otherpkgdir`` attribute to point to the package directory with downloaded RPMs ::
chdef -t osimage rhels7.3-ppc64le-RHEV4-install-compute \
otherpkgdir=/install/post/otherpkgs/rhels7.3/ppc64le/RHEV4/4.0-GA
* Create a new package list file ``/install/custom/rhels7.3/ppc64le/rhelv4.pkglist`` to include necessary packages provided from the OS. ::
#INCLUDE:/opt/xcat/share/xcat/install/rh/compute.rhels7.pkglist#
bridge-utils
* Modify ``pkglist`` attribute to point to the package list file from the step above ::
chdef -t osimage rhels7.3-snap3-ppc64le-RHEV4-install-compute \
pkglist=/install/custom/rhels7.3/ppc64le/rhelv4.pkglist
* Create a new package list file ``/install/custom/rhels7.3/ppc64le/rhev4.otherpkgs.pkglist`` to list required packages ::
libvirt
qemu-kvm-rhev
qemu-kvm-tools-rhev
virt-manager-common
virt-install
* Modify ``otherpkglist`` attribute to point to the package list file from the step above ::
chdef -t osimage rhels7.3-snap3-ppc64le-RHEV4-install-compute \
otherpkglist=/install/custom/rhels7.3/ppc64le/rhev4.otherpkgs.pkglist
* The RHEV osimage should look similar to: ::
Object name: rhels7.3-ppc64le-RHEV4-install-compute
imagetype=linux
osarch=ppc64le
osdistroname=rhels7.3-ppc64le
osname=Linux
osvers=rhels7.3
otherpkgdir=/install/post/otherpkgs/rhels7.3/ppc64le/RHEV4/4.0-GA
otherpkglist=/install/custom/rhels7.3/ppc64le/rhev4.otherpkgs.pkglist
pkgdir=/install/rhels7.3/ppc64le
pkglist=/install/custom/rhels7.3/ppc64le/rhelv4.pkglist
profile=compute
provmethod=install
template=/opt/xcat/share/xcat/install/rh/compute.rhels7.tmpl

View File

@ -0,0 +1,85 @@
Install and Configure Hypervisor
================================
Provision Hypervisor
--------------------
* **[PowerKVM]**
.. include:: pKVMHypervisor.rst
* **[RHEV]**
.. include:: RHEVHypervisor.rst
#. 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:
* To create a bridge named 'br0' against the installation network device specified by **installnic**: ::
chdef kvmhost1 -p postscripts="xHRM bridgeprereq br0"
* To create a bridge with default name 'default' against the installation network device specified by **installnic**: ::
chdef kvmhost1 -p postscripts="xHRM bridgeprereq"
* To create a bridge named 'br0' against the network device 'eth0': ::
chdef kvmhost1 -p postscripts="xHRM bridgeprereq eth0:br0"
**Note**: The network bridge name you use should not be the virtual bridges (vbrX) created by libvirt installation [1]_.
#. Customize the hypervisor node definition to mount the shared kvm storage directory on management node **(optional)**
If the shared kvm storage directory on the management node has been exported, it can be mounted on PowerKVM hypervisor for virtual machines hosting.
An easy way to do this is to create another postscript named "mountvms" which creates a directory **/install/vms** on hypervisor and then mounts **/install/vms** from the management node, the content of "mountvms" can be: ::
logger -t xcat "Install: setting vms mount in fstab"
mkdir -p /install/vms
echo "$MASTER:/install/vms /install/vms nfs \
rsize=8192,wsize=8192,timeo=14,intr,nfsvers=2 1 2" >> /etc/fstab
Then set the file permission and specify the script in **postscripts** attribute of hypervisor node definition: ::
chmod 755 /install/postscripts/mountvms
chdef kvmhost1 -p postscripts=mountvms
#. Provision the hypervisor node with the osimage ::
nodeset kvmhost1 osimage=<osimage_name>
rpower kvmhost1 boot
Create network bridge on hypervisor
------------------------------------
To launch VMs, a network bridge must be created on the KVM hypervisor.
If the hypervisor is provisioned successfully according to the steps described above, a network bridge will be created and attached to a physical interface. This can be checked by running ``brctl show`` on the hypervisor to show the network bridge information, please make sure a network bridge has been created and configured according to the parameters passed to postscript "xHRM" ::
# brctl show
bridge name bridge id STP enabled interfaces
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:::
updatenode kvmhost1 -P "xHRM bridgeprereq eth0:br0"
Start libvirtd service
----------------------
Verify **libvirtd** service is running: ::
systemctl status libvirtd
If service is not running, it can be started with: ::
systemctl start libvirtd
.. [1] Every standard libvirt installation provides NAT based connectivity to virtual machines out of the box using the "virtual bridge" interfaces (virbr0, virbr1, etc) Those will be created by default.

View File

@ -26,12 +26,12 @@ The xCAT based KVM solution offers users the ability to:
* install copy on write instances of virtual machines
* clone virtual machines
This section introduces the steps of management node preparation, KVM hypervisor setup and virtual machine management, and presents some typical problems and solutions on xCAT kvm support.
This section introduces the steps of management node preparation, hypervisor setup and virtual machine management, and presents some typical problems and solutions on xCAT kvm support.
.. toctree::
:maxdepth: 2
kvmMN.rst
powerKVM.rst
hypervisorKVM.rst
manage_vms.rst
FAQ.rst

View File

@ -0,0 +1,20 @@
Obtain a PowerKVM ISO and create PowerKVM osimages with it: ::
copycds ibm-powerkvm-3.1.0.0-39.0-ppc64le-gold-201511041419.iso
The following PowerKVM osimage will be created ::
# lsdef -t osimage -o pkvm3.1-ppc64le-install-compute
Object name: pkvm3.1-ppc64le-install-compute
imagetype=linux
osarch=ppc64le
osdistroname=pkvm3.1-ppc64le
osname=Linux
osvers=pkvm3.1
otherpkgdir=/install/post/otherpkgs/pkvm3.1/ppc64le
pkgdir=/install/pkvm3.1/ppc64le
profile=compute
provmethod=install
template=/opt/xcat/share/xcat/install/pkvm/compute.pkvm3.ppc64le.tmpl

View File

@ -1,92 +0,0 @@
Setup PowerKVM Hypervisor
=========================
Provision Hypervisor with PowerKVM
----------------------------------
Please follow the :ref:`Diskful Installation <diskful_installation>` to provision kvm hypervisor with PowerKVM, several customization steps should be taken into consideration.
To demonstrate the brief steps on hypervisor provision, take **ibm-powerkvm-3.1.0.0-39.0-ppc64le-gold-201511041419.iso** for example here:
#. Obtain a PowerKVM iso and create PowerKVM osimages with it: ::
copycds ibm-powerkvm-3.1.0.0-39.0-ppc64le-gold-201511041419.iso
The following PowerKVM osimage will be created on success ::
# lsdef -t osimage -o pkvm3.1-ppc64le-install-compute
Object name: pkvm3.1-ppc64le-install-compute
imagetype=linux
osarch=ppc64le
osdistroname=pkvm3.1-ppc64le
osname=Linux
osvers=pkvm3.1
otherpkgdir=/install/post/otherpkgs/pkvm3.1/ppc64le
pkgdir=/install/pkvm3.1/ppc64le
profile=compute
provmethod=install
template=/opt/xcat/share/xcat/install/pkvm/compute.pkvm3.ppc64le.tmpl
#. 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. Please specify the **xHRM** with appropriate parameters in **postscripts** attibute. Here is some examples on this:
To create a bridge with default name 'default' against the installation network device which was specified by **installnic** attribute ::
chdef kvmhost1 -p postscripts="xHRM bridgeprereq"
To create a bridge named 'br0' against the installation network device which was specified by **installnic** attribute(recommended) ::
chdef kvmhost1 -p postscripts="xHRM bridgeprereq br0"
To create a bridge named 'br0' against the network device 'eth0' ::
chdef kvmhost1 -p postscripts="xHRM bridgeprereq eth0:br0"
**Note**: The network bridge name you use should not be the virtual bridges created by libvirt installation [1]_.
#. Customize the hypervisor node definition to mount the shared kvm storage directory on management node **(optional)**
If the shared kvm storage directory on the management node has been exported, it can be mounted on PowerKVM hypervisor for virtual machines hosting.
An easy way to do this is to create another postscript named "mountvms" which creates a directory **/install/vms** on hypervisor and then mounts **/install/vms** from the management node, the content of "mountvms" can be: ::
logger -t xcat "Install: setting vms mount in fstab"
mkdir -p /install/vms
echo "$MASTER:/install/vms /install/vms nfs \
rsize=8192,wsize=8192,timeo=14,intr,nfsvers=2 1 2" >> /etc/fstab
Then set the file permission and specify the script in **postscripts** attribute of hypervisor node definition: ::
chmod 755 /install/postscripts/mountvms
chdef kvmhost1 -p postscripts=mountvms
#. Provision the hypervisor node with the PowerKVM osimage ::
nodeset kvmhost1 osimage=pkvm3.1-ppc64le-install-compute
rpower kvmhost1 boot
Create network bridge on hypervisor
------------------------------------
To launch VMs, a network bridge must be created on the PowerKVM hypervisors.
If the hypervisor is provisioned successfully according to the steps described above, a network bridge will be created and attached to a physical interface. This can be checked by running ``brctl show`` on the hypervisor to show the network bridge information, please make sure a network bridge has been created and configured according to the parameters passed to postscript "xHRM" ::
# brctl show
bridge name bridge id STP enabled interfaces
br0 8000.000000000000 no eth0
If the network bridge is not created or configured successfully, please run "xHRM" with **updatenode** on managememt node to create it manually:::
updatenode kvmhost1 -P "xHRM bridgeprereq eth0:br0"
.. [1] Every standard libvirt installation provides NAT based connectivity to virtual machines out of the box using the "virtual bridge" interfaces (virbr0, virbr1, etc) Those will be created by default.

View File

@ -33,7 +33,7 @@ DESCRIPTION
Packs the stateless image from the chroot file system into a file to be sent to the node for a diskless boot.
Note: For an osimage that is deployed on a cluster, running packimage will overwrite the existing rootimage file and be unavailable to the compute nodes while the command executes.
Note: For an osimage that is deployed on a cluster, running packimage will overwrite the existing rootimage file and be unavailable to the compute nodes while packimage is running.
**********

View File

@ -21,11 +21,21 @@ SYNOPSIS
\ **xcattest**\ [\ **-?|-h**\ ]
\ **xcattest**\ [\ **-f**\ \ *configure file*\ ] [\ **-b**\ \ *case bundle list*\ ] [\ **-l**\ ]
\ **xcattest**\ [\ **-f**\ \ *configure file*\ ] [\ **-b**\ \ *case bundle list*\ ]
\ **xcattest**\ [\ **-f**\ \ *configure file*\ ] [\ **-t**\ \ *case list*\ ]
\ **xcattest**\ [\ **-f**\ \ *configure file*\ ] [\ **-c**\ \ *cmd list*\ ] [\ **-l**\ ]
\ **xcattest**\ [\ **-f**\ \ *configure file*\ ] [\ **-c**\ \ *cmd list*\ ]
\ **xcattest**\ [\ **-b**\ \ *case bundle list*\ ] [\ **-l**\ ]
\ **xcattest**\ [\ **-t**\ \ *case list*\ ] [\ **-l**\ ]
\ **xcattest**\ [\ **-c**\ \ *cmd list*\ ] [\ **-l**\ ]
\ **xcattest**\ [\ **-s**\ \ *command*\ ]
\ **xcattest**\ [\ **-s**\ \ *bundle*\ ]
***********
@ -52,7 +62,7 @@ OPTIONS
\ **-f**\ \ *configure file*\
Specifies the configuration file, if not specified, the default configure file is /opt/xcat/share/xcat/tools/autotest/default.conf.
Specifies the configuration file with full-path. xCAT supports an example config file: /opt/xcat/share/xcat/tools/autotest/linux.conf.template
@ -79,7 +89,9 @@ OPTIONS
Display the test cases names specified by the flag -b, -t or -c.
\ **-s**\
Display the bundle files and command with value: bundle or command.
************
RETURN VALUE
@ -136,33 +148,33 @@ EXAMPLES
.. code-block:: perl
xcattest -c /tmp/config -c rpower
xcattest -f /tmp/config -c rpower
2.
To run customized bundle:
To run customized bundle with /tmp/config file:
.. code-block:: perl
xcattest -l > /tmp/custom.bundle
xcattest -l > /opt/xcat/share/xcat/tools/autotest/bundle/custom.bundle
Modify custom.bundle
xcattest -b custom.bundle
xcattest -f /tmp/config -b custom.bundle
3.
To run specified test cases.
To run specified test cases with /tmp/config:
.. code-block:: perl
xcattest -t lsdef_t_o_l_z
xcattest -f /tmp/config -t lsdef_t_o_l_z

View File

@ -82,22 +82,28 @@ site Attributes:
details on supported formats.
nodestatus: If set to 'n', the nodelist.status column will not be updated during
the node deployment, node discovery and power operations. The default is to update.
the node deployment, node discovery and power operations. The default
is to update.
skiptables: Comma separated list of tables to be skipped by dumpxCATdb
skipvalidatelog: If set to 1, then getcredentials and getpostscripts calls will not be logged in syslog.
skipvalidatelog: If set to 1, then getcredentials and getpostscripts calls will not
be logged in syslog.
-------------
DHCP ATTRIBUTES
-------------
dhcpinterfaces: The network interfaces DHCP should listen on. If it is the same
for all nodes, use a simple comma-separated list of NICs. To
specify different NICs for different nodes:
xcatmn|eth1,eth2;service|bond0.
In this example xcatmn is the name of the xCAT MN, and DHCP there
should listen on eth1 and eth2. On all of the nodes in group
'service' DHCP should listen on the bond0 nic.
dhcpinterfaces: The network interfaces DHCP should listen on. If it is the same for all
nodes, use a comma-separated list of the NICs. To specify different NICs
for different nodes, use the format: "xcatmn|eth1,eth2;service|bond0",
where xcatmn is the name of the management node, DHCP should listen on
the eth1 and eth2 interfaces. All the nodes in group 'service' should
listen on the 'bond0' interface.
To disable the genesis kernel from being sent to specific interfaces, a
':noboot' option can be appended to the interface name. For example,
if the management node has two interfaces, eth1 and eth2, disable
genesis from being sent to eth1 using: "eth1:noboot,eth2".
dhcpsetup: If set to 'n', it will skip the dhcp setup process in the nodeset cmd.
@ -120,18 +126,19 @@ site Attributes:
DNS ATTRIBUTES
------------
dnshandler: Name of plugin that handles DNS setup for makedns.
domain: The DNS domain name used for the cluster.
forwarders: The DNS servers at your site that can provide names outside of the
cluster. The makedns command will configure the DNS on the management
node to forward requests it does not know to these servers.
Note that the DNS servers on the service nodes will ignore this value
and always be configured to forward requests to the management node.
forwarders: The DNS servers at your site that can provide names outside of the cluster.
The makedns command will configure the DNS on the management node to foward
requests it does not know to these servers. Note that the DNS servers on the
service nodes will ignore this value and always be configured to forward
to the management node.
master: The hostname of the xCAT management node, as known by the nodes.
nameservers: A comma delimited list of DNS servers that each node in the cluster
should use. This value will end up in the nameserver settings of the
nameservers: A comma delimited list of DNS servers that each node in the cluster should
use. This value will end up in the nameserver settings of the
/etc/resolv.conf on each node. It is common (but not required) to set
this attribute value to the IP addr of the xCAT management node, if
you have set up the DNS on the management node by running makedns.
@ -148,16 +155,16 @@ site Attributes:
section. This is an interface for user to add configuration entries to
the zone sections in named.conf.
dnsinterfaces: The network interfaces DNS server should listen on. If it is the same
for all nodes, use a simple comma-separated list of NICs. To
specify different NICs for different nodes:
xcatmn|eth1,eth2;service|bond0.
In this example xcatmn is the name of the xCAT MN, and DNS there
should listen on eth1 and eth2. On all of the nodes in group
'service' DNS should listen on the bond0 nic.
NOTE: if using this attribute to block certain interfaces, make sure
the ip maps to your hostname of xCAT MN is not blocked since xCAT needs to
use this ip to communicate with the local NDS server on MN.
dnsinterfaces: The network interfaces DNS should listen on. If it is the same for all
nodes, use a simple comma-separated list of NICs. To specify different
NICs for different nodes, use the format: "xcatmn|eth1,eth2;service|bond0",
where xcatmn is the name of the management node, and DNS should listen on
the eth1 and eth2 interfaces. All the nods in group 'service' should
listen on the 'bond0' interface.
NOTE: If using this attribute to block certain interfaces, make sure
the IP maps to your hostname of xCAT MN is not blocked since xCAT needs
to use this IP to communicate with the local NDS server on MN.
-------------------------
HARDWARE CONTROL ATTRIBUTES
@ -200,12 +207,12 @@ site Attributes:
It takes effects on other PPC hardware control command
getmacs/rnetboot/rbootseq and so on. Default is 8.
syspowerinterval: For system p CECs, this is the number of seconds the rpower
command will wait between performing the action for each CEC.
For system x IPMI servers, this is the number of seconds the
rpower command will wait between powering on <syspowermaxnodes>
nodes at a time. This value is used to control the power on speed
in large clusters. Default is 0.
syspowerinterval: For SystemP CECs, this is the number of seconds the rpower command
will wait between performing the action for each CEC. For SystemX
IPMI servers, this is the number of seconds the rpower command will
wait between powering on <syspowermaxnodes> nodes at a time. This
value is used to control the power on speed in large clusters.
Default is 0.
syspowermaxnodes: The number of servers to power on at one time before waiting
'syspowerinterval' seconds to continue on to the next set of
@ -291,12 +298,13 @@ site Attributes:
If value is set to a hostname, the directory in tftpdir
will be mounted from that hostname on the SN
sharedinstall: Indicates if a shared file system will be used for installation
resources. Possible values are: 'no', 'sns', or 'all'. 'no'
means a shared file system is not being used. 'sns' means a
shared filesystem is being used across all service nodes.
'all' means that the management as well as the service nodes
are all using a common shared filesystem. The default is 'no'.
sharedinstall: Indicates if a shared file system will be used for installation
resources. Possible values are: 'no', 'sns', or 'all'. 'no'
means a shared file system is not being used. 'sns' means a
shared filesystem is being used across all service nodes.
'all' means that the management as well as the service nodes
are all using a common shared filesystem. The default is 'no'.
xcatconfdir: Where xCAT config data is (default /etc/xcat).
xcatdebugmode: the xCAT debug level. xCAT provides a batch of techniques
@ -315,23 +323,24 @@ site Attributes:
REMOTESHELL ATTRIBUTES
--------------------
nodesyncfiledir: The directory on the node, where xdcp will rsync the files
SNsyncfiledir: The directory on the Service Node, where xdcp will rsync the files
from the MN that will eventually be rsync'd to the compute nodes.
sshbetweennodes: Comma separated list of groups of compute nodes to enable passwordless root
ssh during install, or xdsh -K. Default is ALLGROUPS.
Set to NOGROUPS,if you do not wish to enabled any group of compute nodes.
Service Nodes are not affected by this attribute
they are always setup with
passwordless root access to nodes and other SN.
sshbetweennodes: Comma separated list of groups of compute nodes to enable passwordless
root ssh to the nodes during install or running 'xdsh -K'. The default
is ALLGROUPS. Set to NOGROUPS to disable.
Service Nodes are not affected by this attribute as they are always
configured with passwordless root access.
If using the zone table, this attribute in not used.
-----------------
SERVICES ATTRIBUTES
-----------------
consoleondemand: When set to 'yes', conserver connects and creates the console
output only when the user opens the console. Default is no on
Linux, yes on AIX.
output only when the user opens the console. Default is 'no' on
Linux, 'yes' on AIX.
httpport: The port number that the booting/installing nodes should contact the
http server on the MN/SN on. It is your responsibility to configure
@ -355,12 +364,12 @@ site Attributes:
will use the management node's own hardware clock to calculate
the system date and time
svloglocal: if set to 1, syslog on the service node will not get forwarded to the
mgmt node.
svloglocal: If set to 1, syslog on the service node will not get forwarded to the
management node.
timezone: (e.g. America/New_York)
tftpdir: tftp directory path. Default is /tftpboot
tftpdir: The tftp directory path. Default is /tftpboot
tftpflags: The flags that used to start tftpd. Default is '-v -l -s /tftpboot
-m /etc/tftpmapfile4xcat.conf' if tftplfags is not set
@ -369,29 +378,24 @@ site Attributes:
using nmap (if available) from the management node instead of the
service node. This will improve the performance in a flat network.
vsftp: Default is 'n'. If set to 'y', the xcatd on the mn will automatically
bring up vsftpd. (You must manually install vsftpd before this.
This setting does not apply to the service node. For sn
you need to set servicenode.ftpserver=1 if you want xcatd to
bring up vsftpd.
FQDNfirst: Fully Qualified Domain Name first. If set to 1/yes/enable, the /etc/hosts
entries generated by 'makehosts' will put the FQDN before the PQDN(Partially
Qualified Domain Name). Otherwise, the original behavior will be performed.
hierarchicalattrs: Table attributes(e.g. postscripts, postbootscripts) that will be
included hierarchically. Attribute values for all the node's groups
will be applied to the node in the groups' order except the repeat one.
.. code-block:: perl
vsftp: Default is 'n'. If set to 'y', xcatd on the management node will automatically
start vsftpd. (vsftpd must be installed by the admin). This setting does not
apply to service nodes. For service nodes, set servicenode.ftpserver=1.
FQDNfirst: Fully Qualified Domain Name first. If set to 1/yes/enable, the /etc/hosts
entries generated by 'makehosts' will put the FQDN before the PQDN(Partially
Qualified Domain Name). Otherwise, the original behavior will be performed.
hierarchicalattrs: Table attributes(e.g. postscripts, postbootscripts) that will be
included hierarchically. Attribute values for all the node's groups
will be applied to the node in the groups' order except the repeat one.
-----------------------
VIRTUALIZATION ATTRIBUTES
-----------------------
usexhrm: Have xCAT run its xHRM script when booting up KVM guests to set the
virtual network bridge up correctly.
usexhrm: Have xCAT execute the xHRM script when booting up KVM guests to configure
the virtual network bridge.
vcenterautojoin: When set to no, the VMWare plugin will not attempt to auto remove
and add hypervisors while trying to perform operations. If users
or tasks outside of xCAT perform the joining this assures xCAT

View File

@ -937,18 +937,18 @@ passed as argument rather than by table value',
# Do not put description text past column 88, so it displays well in a 100 char wide window.
# ----------------------------------------------------------------------------------|----------
key => "Attribute Name: Description\n\n" .
" ------------\n" .
"AIX ATTRIBUTES\n" .
" ------------\n" .
" nimprime : The name of NIM server, if not set default is the AIX MN.
If Linux MN, then must be set for support of mixed cluster (TBD).\n\n" .
key => "Attribute Name: Description\n\n" .
" ------------\n" .
"AIX ATTRIBUTES\n" .
" ------------\n" .
" nimprime : The name of NIM server, if not set default is the AIX MN.\n" .
" If Linux MN, then must be set for support of mixed cluster (TBD).\n\n" .
" useSSHonAIX: (yes/1 or no/0). Default is yes. The support for rsh/rcp is deprecated.\n" .
" useNFSv4onAIX: (yes/1 or no/0). If yes, NFSv4 will be used with NIM. If no,\n" .
" NFSv3 will be used with NIM. Default is no.\n\n" .
" -----------------\n" .
"DATABASE ATTRIBUTES\n" .
" -----------------\n" .
" NFSv3 will be used with NIM. Default is no.\n\n" .
" -----------------\n" .
"DATABASE ATTRIBUTES\n" .
" -----------------\n" .
" auditnosyslog: If set to 1, then commands will only be written to the auditlog table.\n" .
" This attribute set to 1 and auditskipcmds=ALL means no logging of commands.\n" .
" Default is to write to both the auditlog table and syslog.\n" .
@ -967,21 +967,26 @@ passed as argument rather than by table value',
" excludenodes: A set of comma separated nodes and/or groups that would automatically\n" .
" be subtracted from any noderange, it can be used for excluding some\n" .
" failed nodes for any xCAT commands. See the 'noderange' manpage for\n" .
" details on supported formats.\n\n" .
" details on supported formats.\n\n" .
" nodestatus: If set to 'n', the nodelist.status column will not be updated during\n" .
" the node deployment, node discovery and power operations. The default is to update.\n\n" .
" the node deployment, node discovery and power operations. The default\n" .
" is to update.\n\n" .
" skiptables: Comma separated list of tables to be skipped by dumpxCATdb\n\n" .
" skipvalidatelog: If set to 1, then getcredentials and getpostscripts calls will not be logged in syslog.\n\n" .
" -------------\n" .
"DHCP ATTRIBUTES\n" .
" -------------\n" .
" dhcpinterfaces: The network interfaces DHCP should listen on. If it is the same\n" .
" for all nodes, use a simple comma-separated list of NICs. To\n" .
" specify different NICs for different nodes:\n" .
" xcatmn|eth1,eth2;service|bond0.\n" .
" In this example xcatmn is the name of the xCAT MN, and DHCP there\n" .
" should listen on eth1 and eth2. On all of the nodes in group\n" .
" 'service' DHCP should listen on the bond0 nic.\n\n" .
" skipvalidatelog: If set to 1, then getcredentials and getpostscripts calls will not \n" .
" be logged in syslog.\n\n" .
" -------------\n" .
"DHCP ATTRIBUTES\n" .
" -------------\n" .
" dhcpinterfaces: The network interfaces DHCP should listen on. If it is the same for all\n" .
" nodes, use a comma-separated list of the NICs. To specify different NICs\n" .
" for different nodes, use the format: \"xcatmn|eth1,eth2;service|bond0\", \n" .
" where xcatmn is the name of the management node, DHCP should listen on \n" .
" the eth1 and eth2 interfaces. All the nodes in group 'service' should \n" .
" listen on the 'bond0' interface.\n\n" .
" To disable the genesis kernel from being sent to specific interfaces, a\n" .
" ':noboot' option can be appended to the interface name. For example,\n" .
" if the management node has two interfaces, eth1 and eth2, disable\n" .
" genesis from being sent to eth1 using: \"eth1:noboot,eth2\".\n\n" .
" dhcpsetup: If set to 'n', it will skip the dhcp setup process in the nodeset cmd.\n\n" .
" dhcplease: The lease time for the dhcp client. The default value is 43200.\n\n" .
" disjointdhcps: If set to '1', the .leases file on a service node only contains\n" .
@ -993,78 +998,77 @@ passed as argument rather than by table value',
" If set to 'static', the network configuration will be configured \n" .
" in static mode based on the node and network definition on MN.\n" .
" If set to 'dhcp', the network will be configured with dhcp protocol.\n" .
" The default is 'dhcp'.\n\n" .
" ------------\n" .
"DNS ATTRIBUTES\n" .
" ------------\n" .
" dnshandler: Name of plugin that handles DNS setup for makedns.\n" .
" domain: The DNS domain name used for the cluster.\n\n" .
" forwarders: The DNS servers at your site that can provide names outside of the\n" .
" cluster. The makedns command will configure the DNS on the management\n" .
" node to forward requests it does not know to these servers.\n" .
" Note that the DNS servers on the service nodes will ignore this value\n" .
" and always be configured to forward requests to the management node.\n\n" .
" The default is 'dhcp'.\n\n" .
" ------------\n" .
"DNS ATTRIBUTES\n" .
" ------------\n" .
" dnshandler: Name of plugin that handles DNS setup for makedns.\n\n" .
" domain: The DNS domain name used for the cluster.\n\n" .
" forwarders: The DNS servers at your site that can provide names outside of the cluster.\n" .
" The makedns command will configure the DNS on the management node to foward\n" .
" requests it does not know to these servers. Note that the DNS servers on the\n" .
" service nodes will ignore this value and always be configured to forward \n" .
" to the management node.\n\n" .
" master: The hostname of the xCAT management node, as known by the nodes.\n\n" .
" nameservers: A comma delimited list of DNS servers that each node in the cluster\n" .
" should use. This value will end up in the nameserver settings of the\n" .
" nameservers: A comma delimited list of DNS servers that each node in the cluster should\n" .
" use. This value will end up in the nameserver settings of the\n" .
" /etc/resolv.conf on each node. It is common (but not required) to set\n" .
" this attribute value to the IP addr of the xCAT management node, if\n" .
" you have set up the DNS on the management node by running makedns.\n" .
" In a hierarchical cluster, you can also set this attribute to\n" .
" \"<xcatmaster>\" to mean the DNS server for each node should be the\n" .
" node that is managing it (either its service node or the management\n" .
" node).\n\n" .
" node).\n\n" .
" externaldns: To specify that external dns is used. If externaldns is set to any value\n" .
" then, makedns command will not start the local nameserver on xCAT MN. \n" .
" Default is to start the local nameserver.\n\n" .
" Default is to start the local nameserver.\n\n" .
" dnsupdaters: The value are \',\' separated string which will be added to the zone config\n" .
" section. This is an interface for user to add configuration entries to\n" .
" the zone sections in named.conf.\n\n" .
" dnsinterfaces: The network interfaces DNS server should listen on. If it is the same\n" .
" for all nodes, use a simple comma-separated list of NICs. To\n" .
" specify different NICs for different nodes:\n" .
" xcatmn|eth1,eth2;service|bond0.\n" .
" In this example xcatmn is the name of the xCAT MN, and DNS there\n" .
" should listen on eth1 and eth2. On all of the nodes in group\n" .
" 'service' DNS should listen on the bond0 nic.\n" .
" NOTE: if using this attribute to block certain interfaces, make sure\n" .
" the ip maps to your hostname of xCAT MN is not blocked since xCAT needs to\n" .
" use this ip to communicate with the local NDS server on MN.\n\n" .
" -------------------------\n" .
"HARDWARE CONTROL ATTRIBUTES\n" .
" -------------------------\n" .
" the zone sections in named.conf.\n\n" .
" dnsinterfaces: The network interfaces DNS should listen on. If it is the same for all\n" .
" nodes, use a simple comma-separated list of NICs. To specify different \n" .
" NICs for different nodes, use the format: \"xcatmn|eth1,eth2;service|bond0\", \n" .
" where xcatmn is the name of the management node, and DNS should listen on\n" .
" the eth1 and eth2 interfaces. All the nods in group 'service' should \n" .
" listen on the 'bond0' interface.\n\n" .
" NOTE: If using this attribute to block certain interfaces, make sure\n" .
" the IP maps to your hostname of xCAT MN is not blocked since xCAT needs\n" .
" to use this IP to communicate with the local NDS server on MN.\n\n" .
" -------------------------\n" .
"HARDWARE CONTROL ATTRIBUTES\n" .
" -------------------------\n" .
" blademaxp: The maximum number of concurrent processes for blade hardware control.\n\n" .
" ea_primary_hmc: The hostname of the HMC that the Integrated Switch Network\n" .
" Management Event Analysis should send hardware serviceable\n" .
" events to for processing and potentially sending to IBM.\n\n" .
" ea_backup_hmc: The hostname of the HMC that the Integrated Switch Network\n" .
" Management Event Analysis should send hardware serviceable\n" .
" events to if the primary HMC is down.\n\n" .
" events to if the primary HMC is down.\n\n" .
" enableASMI: (yes/1 or no/0). If yes, ASMI method will be used after fsp-api. If no,\n" .
" when fsp-api is used, ASMI method will not be used. Default is no.\n\n" .
" fsptimeout: The timeout, in milliseconds, to use when communicating with FSPs.\n\n" .
" hwctrldispatch: Whether or not to send hw control operations to the service\n" .
" node of the target nodes. Default is 'y'.(At present, this attribute\n" .
" is only used for IBM Flex System)\n\n" .
" is only used for IBM Flex System)\n\n" .
" ipmidispatch: Whether or not to send ipmi hw control operations to the service\n" .
" node of the target compute nodes. Default is 'y'.\n\n" .
" ipmimaxp: The max # of processes for ipmi hw ctrl. The default is 64. Currently,\n" .
" this is only used for HP hw control.\n\n" .
" this is only used for HP hw control.\n\n" .
" ipmiretries: The # of retries to use when communicating with BMCs. Default is 3.\n\n" .
" ipmisdrcache: If set to 'no', then the xCAT IPMI support will not cache locally\n" .
" the target node's SDR cache to improve performance.\n\n" .
" ipmitimeout: The timeout to use when communicating with BMCs. Default is 2.\n" .
" This attribute is currently not used.\n\n" .
" This attribute is currently not used.\n\n" .
" maxssh: The max # of SSH connections at any one time to the hw ctrl point for PPC\n" .
" This parameter doesn't take effect on the rpower command.\n" .
" It takes effects on other PPC hardware control command\n" .
" getmacs/rnetboot/rbootseq and so on. Default is 8.\n\n" .
" syspowerinterval: For system p CECs, this is the number of seconds the rpower\n" .
" command will wait between performing the action for each CEC.\n" .
" For system x IPMI servers, this is the number of seconds the\n" .
" rpower command will wait between powering on <syspowermaxnodes>\n" .
" nodes at a time. This value is used to control the power on speed\n" .
" in large clusters. Default is 0.\n\n" .
" syspowerinterval: For SystemP CECs, this is the number of seconds the rpower command\n" .
" will wait between performing the action for each CEC. For SystemX\n" .
" IPMI servers, this is the number of seconds the rpower command will\n" .
" wait between powering on <syspowermaxnodes> nodes at a time. This\n" .
" value is used to control the power on speed in large clusters. \n" .
" Default is 0.\n\n" .
" syspowermaxnodes: The number of servers to power on at one time before waiting\n" .
" 'syspowerinterval' seconds to continue on to the next set of\n" .
" nodes. If the noderange given to rpower includes nodes served\n" .
@ -1081,18 +1085,18 @@ passed as argument rather than by table value',
" processes for PPC hardware control commands. Default is 64.\n\n" .
" ppcretry: The max # of PPC hw connection attempts to HMC before failing.\n" .
" It only takes effect on the hardware control commands through HMC. \n" .
" Default is 3.\n\n" .
" Default is 3.\n\n" .
" ppctimeout: The timeout, in milliseconds, to use when communicating with PPC hw\n" .
" through HMC. It only takes effect on the hardware control commands\n" .
" through HMC. Default is 0.\n\n" .
" through HMC. Default is 0.\n\n" .
" snmpc: The snmp community string that xcat should use when communicating with the\n" .
" switches.\n\n" .
" ---------------------------\n" .
"INSTALL/DEPLOYMENT ATTRIBUTES\n" .
" ---------------------------\n" .
" switches.\n\n" .
" ---------------------------\n" .
"INSTALL/DEPLOYMENT ATTRIBUTES\n" .
" ---------------------------\n" .
" cleanupxcatpost: (yes/1 or no/0). Set to 'yes' or '1' to clean up the /xcatpost\n" .
" directory on the stateless and statelite nodes after the\n" .
" postscripts are run. Default is no.\n\n" .
" postscripts are run. Default is no.\n\n" .
" db2installloc: The location which the service nodes should mount for\n" .
" the db2 code to install. Format is hostname:/path. If hostname is\n" .
" omitted, it defaults to the management node. Default is /mntdb2.\n\n" .
@ -1100,18 +1104,18 @@ passed as argument rather than by table value',
" defserialport: The default serial port - currently only used by mknb.\n\n" .
" defserialspeed: The default serial speed - currently only used by mknb.\n\n" .
" genmacprefix: When generating mac addresses automatically, use this manufacturing\n" .
" prefix (e.g. 00:11:aa)\n\n" .
" prefix (e.g. 00:11:aa)\n\n" .
" genpasswords: Automatically generate random passwords for BMCs when configuring\n" .
" them.\n\n" .
" them.\n\n" .
" installdir: The local directory name used to hold the node deployment packages.\n\n" .
" installloc: The location from which the service nodes should mount the \n" .
" deployment packages in the format hostname:/path. If hostname is\n" .
" omitted, it defaults to the management node. The path must\n" .
" match the path in the installdir attribute.\n\n" .
" match the path in the installdir attribute.\n\n" .
" iscsidir: The path to put the iscsi disks in on the mgmt node.\n\n" .
" mnroutenames: The name of the routes to be setup on the management node.\n" .
" It is a comma separated list of route names that are defined in the\n" .
" routes table.\n\n" .
" routes table.\n\n" .
" runbootscripts: If set to 'yes' the scripts listed in the postbootscripts\n" .
" attribute in the osimage and postscripts tables will be run during\n" .
" each reboot of stateful (diskful) nodes. This attribute has no\n" .
@ -1127,44 +1131,43 @@ passed as argument rather than by table value',
" sharedtftp: Set to 0 or no, xCAT should not assume the directory\n" .
" in tftpdir is mounted on all on Service Nodes. Default is 1/yes.\n" .
" If value is set to a hostname, the directory in tftpdir\n" .
" will be mounted from that hostname on the SN\n\n" .
" sharedinstall: Indicates if a shared file system will be used for installation\n" .
" resources. Possible values are: 'no', 'sns', or 'all'. 'no' \n" .
" means a shared file system is not being used. 'sns' means a\n" .
" shared filesystem is being used across all service nodes.\n" .
" 'all' means that the management as well as the service nodes\n" .
" are all using a common shared filesystem. The default is 'no'.\n" .
" will be mounted from that hostname on the SN\n\n" .
" sharedinstall: Indicates if a shared file system will be used for installation\n" .
" resources. Possible values are: 'no', 'sns', or 'all'. 'no' \n" .
" means a shared file system is not being used. 'sns' means a\n" .
" shared filesystem is being used across all service nodes.\n" .
" 'all' means that the management as well as the service nodes\n" .
" are all using a common shared filesystem. The default is 'no'.\n\n" .
" xcatconfdir: Where xCAT config data is (default /etc/xcat).\n\n" .
" xcatdebugmode: the xCAT debug level. xCAT provides a batch of techniques\n" .
" to help user debug problems while using xCAT, especially on OS provision,\n" .
" such as collecting logs of the whole installation process and accessing\n" .
" the installing system via ssh, etc. These techniques will be enabled\n" .
" according to different xCAT debug levels specified by 'xcatdebugmode',\n" .
" currently supported values:\n" .
" '0': disable debug mode\n" .
" '1': enable basic debug mode\n" .
" '2': enable expert debug mode\n" .
" currently supported values:\n" .
" '0': disable debug mode\n" .
" '1': enable basic debug mode\n" .
" '2': enable expert debug mode\n" .
" For the details on 'basic debug mode' and 'expert debug mode',\n" .
" refer to xCAT documentation.\n\n" .
" --------------------\n" .
"REMOTESHELL ATTRIBUTES\n" .
" --------------------\n" .
" nodesyncfiledir: The directory on the node, where xdcp will rsync the files\n" .
" refer to xCAT documentation.\n\n" .
" --------------------\n" .
"REMOTESHELL ATTRIBUTES\n" .
" --------------------\n" .
" nodesyncfiledir: The directory on the node, where xdcp will rsync the files\n\n" .
" SNsyncfiledir: The directory on the Service Node, where xdcp will rsync the files\n" .
" from the MN that will eventually be rsync'd to the compute nodes.\n\n" .
" sshbetweennodes: Comma separated list of groups of compute nodes to enable passwordless root \n" .
" ssh during install, or xdsh -K. Default is ALLGROUPS.\n" .
" Set to NOGROUPS,if you do not wish to enabled any group of compute nodes.\n" .
" Service Nodes are not affected by this attribute\n" .
" they are always setup with\n" .
" passwordless root access to nodes and other SN.\n" .
" sshbetweennodes: Comma separated list of groups of compute nodes to enable passwordless\n" .
" root ssh to the nodes during install or running 'xdsh -K'. The default\n" .
" is ALLGROUPS. Set to NOGROUPS to disable.\n\n" .
" Service Nodes are not affected by this attribute as they are always\n" .
" configured with passwordless root access.\n" .
" If using the zone table, this attribute in not used.\n\n" .
" -----------------\n" .
"SERVICES ATTRIBUTES\n" .
" -----------------\n" .
" -----------------\n" .
"SERVICES ATTRIBUTES\n" .
" -----------------\n" .
" consoleondemand: When set to 'yes', conserver connects and creates the console\n" .
" output only when the user opens the console. Default is no on\n" .
" Linux, yes on AIX.\n\n" .
" output only when the user opens the console. Default is 'no' on\n" .
" Linux, 'yes' on AIX.\n\n" .
" httpport: The port number that the booting/installing nodes should contact the\n" .
" http server on the MN/SN on. It is your responsibility to configure\n" .
" the http server to listen on that port - xCAT will not do that.\n\n" .
@ -1174,7 +1177,7 @@ passed as argument rather than by table value',
" For example, if the network response time is too slow, nmap may not\n" .
" give stable output. You can increase the timeout value by specifying \n" .
" '--min-rtt-timeout 1s'. xCAT will append the options defined here to \n" .
" the nmap command.\n\n" .
" the nmap command.\n\n" .
" ntpservers: A comma delimited list of NTP servers for the service node and\n" .
" the compute node to sync with. The keyword <xcatmaster> means that\n" .
" the node's NTP server is the node that is managing it\n" .
@ -1182,45 +1185,43 @@ passed as argument rather than by table value',
" extntpservers: A comma delimited list of external NTP servers for the xCAT\n" .
" management node to sync with. If it is empty, the NTP server\n" .
" will use the management node's own hardware clock to calculate\n" .
" the system date and time\n\n" .
" svloglocal: if set to 1, syslog on the service node will not get forwarded to the\n" .
" mgmt node.\n\n" .
" timezone: (e.g. America/New_York)\n\n" .
" tftpdir: tftp directory path. Default is /tftpboot\n\n" .
" the system date and time\n\n" .
" svloglocal: If set to 1, syslog on the service node will not get forwarded to the\n" .
" management node.\n\n" .
" timezone: (e.g. America/New_York)\n\n" .
" tftpdir: The tftp directory path. Default is /tftpboot\n\n" .
" tftpflags: The flags that used to start tftpd. Default is \'-v -l -s /tftpboot \n" .
" -m /etc/tftpmapfile4xcat.conf\' if tftplfags is not set\n\n" .
" useNmapfromMN: When set to yes, nodestat command should obtain the node status\n" .
" using nmap (if available) from the management node instead of the\n" .
" service node. This will improve the performance in a flat network.\n\n" .
" vsftp: Default is 'n'. If set to 'y', the xcatd on the mn will automatically\n" .
" bring up vsftpd. (You must manually install vsftpd before this.\n" .
" This setting does not apply to the service node. For sn\n" .
" you need to set servicenode.ftpserver=1 if you want xcatd to\n" .
" bring up vsftpd.\n\n" .
"FQDNfirst: Fully Qualified Domain Name first. If set to 1/yes/enable, the /etc/hosts \n" .
" entries generated by 'makehosts' will put the FQDN before the PQDN(Partially \n" .
" Qualified Domain Name). Otherwise, the original behavior will be performed.\n\n" .
"hierarchicalattrs: Table attributes(e.g. postscripts, postbootscripts) that will be\n" .
" included hierarchically. Attribute values for all the node's groups\n" .
" will be applied to the node in the groups' order except the repeat one.\n\n" .
" -----------------------\n" .
"VIRTUALIZATION ATTRIBUTES\n" .
" -----------------------\n" .
" usexhrm: Have xCAT run its xHRM script when booting up KVM guests to set the\n" .
" virtual network bridge up correctly.\n" .
" vsftp: Default is 'n'. If set to 'y', xcatd on the management node will automatically\n" .
" start vsftpd. (vsftpd must be installed by the admin). This setting does not\n" .
" apply to service nodes. For service nodes, set servicenode.ftpserver=1.\n\n" .
" FQDNfirst: Fully Qualified Domain Name first. If set to 1/yes/enable, the /etc/hosts \n" .
" entries generated by 'makehosts' will put the FQDN before the PQDN(Partially \n" .
" Qualified Domain Name). Otherwise, the original behavior will be performed.\n\n" .
" hierarchicalattrs: Table attributes(e.g. postscripts, postbootscripts) that will be\n" .
" included hierarchically. Attribute values for all the node's groups\n" .
" will be applied to the node in the groups' order except the repeat one.\n\n" .
" -----------------------\n" .
"VIRTUALIZATION ATTRIBUTES\n" .
" -----------------------\n" .
" usexhrm: Have xCAT execute the xHRM script when booting up KVM guests to configure\n" .
" the virtual network bridge.\n\n" .
" vcenterautojoin: When set to no, the VMWare plugin will not attempt to auto remove\n" .
" and add hypervisors while trying to perform operations. If users\n" .
" or tasks outside of xCAT perform the joining this assures xCAT\n" .
" will not interfere.\n\n" .
" will not interfere.\n\n" .
" vmwarereconfigonpower: When set to no, the VMWare plugin will make no effort to\n" .
" push vm.cpus/vm.memory updates from xCAT to VMWare.\n\n" .
" persistkvmguests: Keep the kvm definition on the kvm hypervisor when you power off\n" .
" the kvm guest node. This is useful for you to manually change the \n" .
" kvm xml definition file in virsh for debugging. Set anything means\n" .
" enable.\n\n" .
" --------------------\n" .
"XCAT DAEMON ATTRIBUTES\n" .
" --------------------\n" .
" enable.\n\n" .
" --------------------\n" .
"XCAT DAEMON ATTRIBUTES\n" .
" --------------------\n" .
" useflowcontrol: (yes/1 or no/0). If yes, the postscript processing on each node\n" .
" contacts xcatd on the MN/SN using a lightweight UDP packet to wait\n" .
" until xcatd is ready to handle the requests associated with\n" .
@ -1228,9 +1229,9 @@ passed as argument rather than by table value',
" locking out admin interactive use. This value works with the\n" .
" xcatmaxconnections and xcatmaxbatch attributes. Is not supported on AIX.\n" .
" If the value is no, nodes sleep for a random time before contacting\n" .
" xcatd, and retry. The default is no.\n" .
" See the following document for details:\n" .
" Hints_and_Tips_for_Large_Scale_Clusters\n\n" .
" xcatd, and retry. The default is no.\n" .
" See the following document for details:\n" .
" Hints_and_Tips_for_Large_Scale_Clusters\n\n" .
" xcatmaxconnections: Number of concurrent xCAT protocol requests before requests\n" .
" begin queueing. This applies to both client command requests\n" .
" and node requests, e.g. to get postscripts. Default is 64.\n\n" .
@ -1240,7 +1241,7 @@ passed as argument rather than by table value',
" xcatiport: The port used by xcatd to receive install status updates from nodes.\n\n" .
" xcatlport: The port used by xcatd command log writer process to collect command output.\n\n" .
" xcatsslversion: The ssl version by xcatd. Default is SSLv3.\n\n" .
" xcatsslciphers: The ssl cipher by xcatd. Default is 3DES.\n\n",
" xcatsslciphers: The ssl cipher by xcatd. Default is 3DES.\n\n",
value => 'The value of the attribute specified in the "key" column.',
comments => 'Any user-written notes.',
disable => "Set to 'yes' or '1' to comment out this row.",

View File

@ -1724,12 +1724,15 @@ sub setAttribs
my %newpairs;
# NOTE(chenglch): Just work around, set the default value to '' due to
# null value can not be allowed in composite primary keys in standard
# SQL rules.
my $descr = $xCAT::Schema::tabspec{ $self->{tabname} };
my @pkeys = @{$descr->{keys}};
for my $p (@pkeys) {
if(!defined($elems->{$p}) && !defined($pKeypairs->{$p})) {
$elems->{$p}= '';
# SQL rules. As auto increment key is uesd by 'eventlog' and 'auditlog'
# table, just skip these tables.
if ($self->{tabname} ne "eventlog" && $self->{tabname} ne "auditlog") {
my $descr = $xCAT::Schema::tabspec{ $self->{tabname} };
my @pkeys = @{$descr->{keys}};
for my $p (@pkeys) {
if(!defined($elems->{$p}) && !defined($pKeypairs->{$p})) {
$elems->{$p}= '';
}
}
}

View File

@ -32,6 +32,7 @@ else {
use IPC::Open3;
use IO::Select;
use xCAT::GlobalDef;
use Digest::MD5 qw(md5_hex);
eval {
require xCAT::RemoteShellExp;
};
@ -2394,19 +2395,21 @@ sub acquire_lock {
use Fcntl ":flock";
my $tlock;
$tlock->{path} = "/var/lock/xcat/" . $lock_name;
open($tlock->{fd}, ">", $tlock->{path}) or return undef;
sysopen($tlock->{fd}, $tlock->{path}, POSIX::O_CREAT | POSIX::O_WRONLY) or return undef;
unless ($tlock->{fd}) { return undef; }
if ($nonblock_mode) {
flock($tlock->{fd}, LOCK_EX | LOCK_NB) or return undef;
} else {
flock($tlock->{fd}, LOCK_EX) or return undef;
}
print { $tlock->{fd} } $$;
truncate $tlock->{fd},0;
syswrite $tlock->{fd} ,$$;
$tlock->{fd}->autoflush(1);
return $tlock;
}
#---------------------
=head3 release_lock
@ -4781,4 +4784,45 @@ sub get_nmapversion {
return $nmap_version;
}
#--------------------------------------------------------------------------------
=head3 acquire_lock_imageop
acquire lock for the image related operations on specific rootimg dir
the image related operation includes genimage,packimage,rmimage...
Arguments:
$rootimg_dir: the full path of osimage rootimage dir
lock mode: 0-block, 1-non-block
Returns:
a list with format (<error code>, <error messgae> or <lock handler>)
the <error code>: 0 on success, 1 on fail
the <error message>: available on fail
the <lock handler>: available on success
=cut
#--------------------------------------------------------------------------------
sub acquire_lock_imageop {
my $self=shift;
my $rootimg_dir=shift;
my $NON_BLOCK=shift;
$NON_BLOCK=1 unless(defined $NON_BLOCK);
my $mylockfile=Cwd::realpath($rootimg_dir);
my $mymd5=md5_hex($mylockfile);
$mylockfile=~s/\//./g;
$mylockfile=$mylockfile.".".$mymd5;
my $lock = xCAT::Utils->acquire_lock("$mylockfile", $NON_BLOCK);
unless ($lock){
my $pidfd;
open($pidfd,"<","/var/run/lock/xcat/$mylockfile");
my $pid=<$pidfd>;
close($pidfd);
return (1, "failed to acquire lock, seems there is another genimage/packimage/rmimage process $pid running on root image dir \"$rootimg_dir\"");
}
return (0,$lock);
}
1;

View File

@ -36,26 +36,6 @@ elif [ $reason = "BOUND" ]; then
for gw in $new_routers; do
ip route add default via $gw
done
# Up to this point we were logging to the local /var/log/xcat.genesis
# file. But now we know the xCAT MN, so replace logging to the local
# file with logging to the xCAT MN
if [ ! -z "$new_log_servers" ]; then
head -n -1 /etc/rsyslog.conf > /etc/rsyslog.conf.new
cp /etc/rsyslog.conf.new /etc/rsyslog.conf
fi
for ls in $new_log_servers; do
echo "*.* @$ls" >> /etc/rsyslog.conf
done
kill `cat /var/run/syslogd.pid`
sleep 3
RSYSLOGD_VERSION=`rsyslogd -v | grep "rsyslogd" | cut -d" " -f2 | cut -d"." -f1`
if [ $RSYSLOGD_VERSION -ge 8 ]; then
# Newer versions of rsyslogd do not support -c flag anymore
/sbin/rsyslogd
else
/sbin/rsyslogd -c4
fi
if [ ! -z "$new_tcode" -a -r "/usr/share/zoneinfo/posix/$new_tcode" ]; then
cp "/usr/share/zoneinfo/posix/$new_tcode" /etc/localtime

View File

@ -169,6 +169,10 @@ export XCATMASTER
logger -s -t $log_label -p local4.info "XCATMASTER is $XCATMASTER, XCATPORT is $XCATPORT"
head -n -1 /etc/rsyslog.conf > /etc/rsyslog.conf.new
cp /etc/rsyslog.conf.new /etc/rsyslog.conf
echo "*.* @$XCATMASTER" >> /etc/rsyslog.conf
if [[ -n $hostip && -n $netmask && -n $gateway && -n $bootnic ]]; then
# doing static ip
# the device was determined above from the bootif mac, and put in bootnic
@ -253,21 +257,6 @@ else
fi
fi
count_f=0
while [ $count_f -le 8 ]; do
rsyslogd_ps=`ps -ef | grep 'rsyslogd' | grep -v 'grep'`
if [ "$rsyslogd_ps" ]; then
break
else
((count_f++))
sleep 0.5
fi
done
if [ $count_f -gt 8 ]; then
echo "rsyslogd maybe off"
fi
openssl genrsa -out /etc/xcat/certkey.pem 4096 > /dev/null 2>&1 &
logger -s -t $log_label -p local4.info "Acquired IPv4 address on $bootnic"
@ -285,6 +274,21 @@ while [ "`ntpq -c 'rv 0 offset' | awk -F '=' '/offset=/ { print $2 }' | awk -F '
sleep 1
done
read -r RSYSLOG_PID </var/run/syslogd.pid 2>/dev/null
kill "$RSYSLOG_PID" 2>/dev/null
while kill -0 "$RSYSLOG_PID" 2>/dev/null
do
sleep 0.5
done
unset RSYSLOG_PID
RSYSLOGD_VERSION=`rsyslogd -v | awk '/rsyslogd/ { split($2, a, "."); print a[1]; }'`
if [ "$RSYSLOGD_VERSION" -ge 8 ]; then
/sbin/rsyslogd
else
/sbin/rsyslogd -c4
fi
HOST_ARCH=`uname -m`
if echo $HOST_ARCH | grep "ppc64"; then
modprobe ipmi_powernv
@ -331,6 +335,8 @@ while :; do
/bin/getcert $XCATMASTER:$XCATPORT
destiny=''
dest=''
XCAT_DISCOVERY_WAS_DONE=1
export XCAT_DISCOVERY_WAS_DONE
elif [ "$dest" = shell ]; then
logger -s -t $log_label -p local4.info "Dropping to debug shell(exit to run next destiny)..."
destiny=''
@ -391,16 +397,20 @@ while :; do
destiny=''
dest=''
elif [ "$dest" = standby ]; then
destiny=''
dest=''
delay=$((30+$RANDOM%270))
while [ $delay -gt 0 ]; do
if [ $((delay%10)) == 0 ]; then
logger -s -t $log_label -p local4.info "Received request to retry in a bit, will call xCAT back in $delay seconds"
if [ "$XCAT_DISCOVERY_WAS_DONE" == 1 ]; then
logger -s -t $log_label -p local4.info "Received request=$dest, will call xCAT back in $delay seconds. Discovery is complete, run nodeset on this node to provision an Operating System"
else
logger -s -t $log_label -p local4.info "Received request to retry in a bit, will call xCAT back in $delay seconds"
fi
fi
delay=$((delay-1))
sleep 1
done
destiny=''
dest=''
echo "Retrying ";
elif [ "$dest" = shutdown ]; then
logger -s -t $log_label -p local4.info "Poweroff..."

View File

@ -0,0 +1,268 @@
package hierarchy;
# IBM(c) 2016 EPL license http://www.eclipse.org/legal/epl-v10.html
BEGIN { $::XCATROOT = $ENV{'XCATROOT'} ? $ENV{'XCATROOT'} : -d '/opt/xcat' ? '/opt/xcat' : '/usr'; }
use lib "$::XCATROOT/probe/lib/perl";
use probe_utils;
use xCAT::ServiceNodeUtils;
use strict;
use Data::Dumper;
use IO::Select;
use File::Basename;
use POSIX ":sys_wait_h";
sub new {
my $self = {};
my $class = shift;
$self->{program_name} = basename("$0");
my %dispatchcmd;
$self->{dispatchcmd} = \%dispatchcmd;
my @subjobpids = ();
my @subjobfds = ();
my %subjobstates;
my %fdnodemap;
$self->{subjobpids} = \@subjobpids;
$self->{subjobfds} = \@subjobfds;
$self->{subjobstates} = \%subjobstates;
$self->{allsubjobdone} = 0;
$self->{fdnodemap} = \%fdnodemap;
$self->{select} = new IO::Select;
bless($self, ref($class) || $class);
return $self;
}
sub calculate_dispatch_cmd {
my $self = shift;
my $noderange = shift;
my $argv_ref = shift;
my $error_ref = shift;
@{$error_ref} = ();
my @snlist = xCAT::ServiceNodeUtils->getAllSN();
if ($noderange) {
my @nodes = probe_utils->parse_node_range($noderange);
#if there is error in noderange
if ($?) {
my $error = join(" ", @nodes);
if ($error =~ /Error: Invalid nodes and\/or groups in noderange: (.+)/) {
push @{$error_ref}, "There are invaild nodes ($1) in command line attribute node range";
} else {
push @{$error_ref}, "There is error in command line attribute node range, please using nodels to check";
}
return 1;
} else {
#calculate the mapping between SN and the nodes which belong to it.
chomp foreach (@nodes);
my $snnodemap = xCAT::ServiceNodeUtils->get_ServiceNode(\@nodes, "xcat", "MN");
my %newsnnodemap;
my $rst = 0;
foreach my $sn (keys %$snnodemap) {
if (grep(/^$sn$/, @snlist)) { # the node just belong to one SN
push(@{ $newsnnodemap{$sn} }, @{ $snnodemap->{$sn} });
} elsif ($sn =~ /(\w+),.+/) { # the node belong to more than one SN, count it into first SN
if (grep(/^$1$/, @snlist)) {
push(@{ $newsnnodemap{$1} }, @{ $snnodemap->{$sn} });
} else {
push @{$error_ref}, "The value $1 of 'servicenode' isn't a service node";
$rst = 1;
}
} else { # the nodes don't belong to any SN will be handled by MN
push(@{ $newsnnodemap{mn} }, @{ $snnodemap->{$sn} });
}
}
return 1 if ($rst);
#print Dumper \%newsnnodemap;
#generate new command for each SN, replace noderange
foreach my $sn (keys %newsnnodemap) {
my $nodes = join(",", @{ $newsnnodemap{$sn} });
for (my $i = 0 ; $i <= @$argv_ref ; $i++) {
if ($argv_ref->[$i] eq "-n") {
$argv_ref->[ $i + 1 ] = $nodes;
last;
}
}
my $args = join(" ", @$argv_ref);
$self->{dispatchcmd}->{$sn} = "$::XCATROOT/probe/subcmds/$self->{program_name} $args -H 2>&1";
}
}
} else {
#there isn't noderange input from STDIN, dispatch command to all SN if there are SN defined in MN
#if there isn't SN defined in MN, just dispatch command to MN itself
my $args = join(" ", @$argv_ref);
$self->{dispatchcmd}->{mn} = "$::XCATROOT/probe/subcmds/$self->{program_name} $args -H 2>&1";
if (@snlist) {
my $sns = join(",", @snlist);
$self->{dispatchcmd}->{$sns} = "$::XCATROOT/probe/subcmds/$self->{program_name} $args -H 2>&1";
}
}
return 0;
}
sub dispatch_cmd {
my $self = shift;
my $noderange = shift;
my $argv_ref = shift;
my $error_ref = shift;
@$error_ref = ();
my $rst = 0;
$rst = $self->calculate_dispatch_cmd($noderange, $argv_ref, $error_ref);
return $rst if ($rst);
foreach my $target_server (keys %{ $self->{dispatchcmd} }) {
my $subjobcmd = undef;
if ($target_server eq "mn") {
$subjobcmd = $self->{dispatchcmd}->{$target_server};
} else {
$subjobcmd = "xdsh $target_server -s \"$self->{dispatchcmd}->{$target_server}\" 2>&1";
}
#print "$subjobcmd\n";
my $subjobfd;
my $subjobpid;
if (!($subjobpid = open($subjobfd, "$subjobcmd |"))) {
push @{$error_ref}, "Fork process to dispatch cmd $subjobcmd to $target_server failed: $!";
$rst = 1;
last;
}
push(@{ $self->{subjobpids} }, $subjobpid);
push(@{ $self->{subjobfds} }, $subjobfd);
$self->{fdnodemap}->{$subjobfd} = $target_server;
}
if (@{ $self->{subjobpids} })
{
$self->{select}->add(\*$_) foreach (@{ $self->{subjobfds} });
$| = 1;
foreach (@{ $self->{subjobfds} }) {
$self->{subjobstates}->{$_} = 0;
}
}
return $rst;
}
sub read_reply {
my $self = shift;
my $reply_cache_ref = shift;
%$reply_cache_ref = ();
my @hdls;
while (!$self->{allsubjobdone} && !%$reply_cache_ref) {
if (@hdls = $self->{select}->can_read(0)) {
foreach my $hdl (@hdls) {
foreach my $fd (@{ $self->{subjobfds} }) {
if (!$self->{subjobstates}->{$_} && $hdl == \*$fd) {
if (eof($fd)) {
$self->{subjobstates}->{$fd} = 1;
} else {
my $line;
chomp($line = <$fd>);
#print ">>>$line\n";
$line = "mn:$line" if ($self->{fdnodemap}->{$fd} eq "mn");
push @{ $reply_cache_ref->{ $self->{fdnodemap}->{$fd} } }, $line;
}
}
}
}
}
sleep 0.1;
#check if all sub job have done
$self->{allsubjobdone} = 1;
$self->{allsubjobdone} &= $self->{subjobstates}->{$_} foreach (keys %{ $self->{subjobstates} });
}
if (%$reply_cache_ref) {
return 1;
} else {
return 0;
}
}
sub destory {
my $self = shift;
my $error_ref = shift;
my $rst = 0;
@$error_ref = ();
close($_) foreach (@{ $self->{subjobfds} });
my %runningpid;
$runningpid{$_} = 1 foreach (@{ $self->{subjobpids} });
my $existrunningpid = 0;
$existrunningpid = 1 if (%runningpid);
my $try = 0;
while ($existrunningpid) {
#send terminal signal to all running process at same time
#try INT 5 up to 5 times
if ($try < 5) {
foreach my $pid (keys %runningpid) {
kill 'INT', $pid if ($runningpid{$pid});
}
#try TERM 5 up to 5 times
} elsif ($try < 10) {
foreach my $pid (keys %runningpid) {
kill 'TERM', $pid if ($runningpid{$pid});
}
#try KILL 1 time
} else {
foreach my $pid (keys %runningpid) {
kill 'KILL', $pid if ($runningpid{$pid});
}
}
++$try;
sleep 1;
#To check how many process exit, set the flag of exited process to 0
foreach my $pid (keys %runningpid) {
$runningpid{$pid} = 0 if (waitpid($pid, WNOHANG));
}
#To check if there are processes still running, if there are, try kill again in next loop
$existrunningpid = 0;
$existrunningpid |= $runningpid{$_} foreach (keys %runningpid);
#just try 10 times, if still can't kill some process, give up
if ($try > 10) {
my $leftpid;
foreach my $pid (keys %runningpid) {
$leftpid .= "$pid " if ($runningpid{$pid});
}
push @{$error_ref}, "Can't stop process $leftpid, please handle manually.";
$rst = 1;
last;
}
}
return $rst;
}
1;

View File

@ -354,32 +354,6 @@ sub is_dns_ready {
#------------------------------------------
=head3
Description:
Convert host name to ip address
Arguments:
hostname: The hostname need to convert
Returns:
ip: The ip address
=cut
#------------------------------------------
sub get_ip_from_hostname {
my $hostname = shift;
$hostname = shift if (($hostname) && ($hostname =~ /probe_utils/));
my $ip = "";
my @output = `ping -c 1 $hostname 2>&1`;
if (!$?) {
if ($output[0] =~ /^PING.+\s+\((\d+\.\d+\.\d+\.\d+)\).+/) {
$ip = $1;
}
}
return $ip;
}
#------------------------------------------
=head3
Description:
Calculate network address from ip and netmask
@ -409,45 +383,6 @@ sub get_network {
#------------------------------------------
=head3
Description:
Convert ip to hostname
Arguments:
ip: The ip need to convert
Returns:
hostname: hostname or ""
=cut
#------------------------------------------
sub get_hostname_from_ip {
my $ip = shift;
$ip = shift if (($ip) && ($ip =~ /probe_utils/));
my $dns_server = shift;
my $hostname = "";
my $output = "";
`which nslookup > /dev/null 2>&1`;
if (!$?) {
$output = `nslookup $ip $dns_server 2>&1`;
if (!$?) {
chomp($output);
my $rc = $hostname = `echo "$output"|awk -F" " '/name =/ {print \$4}'|awk -F"." '{print \$1}'`;
chomp($hostname);
return $hostname if (!$rc);
}
}
if (($hostname eq "") && (-e "/etc/hosts")) {
$output = `cat /etc/hosts 2>&1 |grep $ip`;
if (!$?) {
my @splitoutput = split(" ", $output);
$hostname = $splitoutput[1];
}
}
return $hostname;
}
#------------------------------------------
=head3
Description:
Check if the free space of specific directory is more than expected value
@ -482,48 +417,6 @@ sub is_dir_has_enough_space{
return 2;
}
#------------------------------------------
=head3
Description:
Convert input time format to the number of non-leap seconds since whatever time the system considers to be the epoch
the format of input time are two kinds
one like "Aug 15 02:43:31", another likes "15/Aug/2016:01:10:24"
Arguments:
timestr: the time format need to be converted
yday: the year of current time.
Returns:
the number of non-leap seconds since whatever time the system considers to be the epoch
=cut
#------------------------------------------
sub convert_to_epoch_seconds {
my $timestr=shift;
$timestr = shift if (($timestr) && ($timestr =~ /probe_utils/));
my $yday=shift;
my $ref_seconds=shift;
my $mday;
my $dday;
my $h;
my $m;
my $s;
my $epoch_seconds=-1;
my %monthsmap = ("Jan"=>0,"Feb"=>1,"Mar"=>2,"Apr"=>3,"May"=>4,"Jun"=>5,"Jul"=>6,"Aug"=>7,"Sep"=>8,"Oct"=>9,"Nov"=>10,"Dec"=>11);
if($timestr =~/(\w+)\s+(\d+)\s+(\d+):(\d+):(\d+)/){
($mday,$dday,$h,$m,$s)=($1,$2,$3,$4,$5);
$epoch_seconds = timelocal($s,$m,$h,$dday,$monthsmap{$mday},$yday);
if($epoch_seconds>$ref_seconds){
$yday-=1;
$epoch_seconds = timelocal($s,$m,$h,$dday,$monthsmap{$mday},$yday);
}
}elsif($timestr =~ /(\d+)\/(\w+)\/(\d+):(\d+):(\d+):(\d+)/){
$epoch_seconds = timelocal($6,$5,$4,$1,$monthsmap{$2},($3-1900));
}
return $epoch_seconds;
}
#------------------------------------------
=head3

View File

@ -2,14 +2,15 @@
# IBM(c) 2016 EPL license http://www.eclipse.org/legal/epl-v10.html
#--------------------------------------------------------
#This is a template for developing a probe sub_command.
#This template mainly implement the sub_comamd dispatch in hierarchical structure
#Developer only need to focus on main probe job (by implement do_main_job function) and friendly output (by implement summary_all_jobs_output function) for user
#This is a template for developing a new probe sub_command. Especially in hierarchical environment.
#This template mainly implement the sub_comamd dispatch in hierarchical structure and basic framework of a new sub_comamd.
#Developer only need to focus on main probe job (by implement do_main_job function) and friendly output (by implement summary_all_jobs_output function) for user.
#This template can also be used in flat structure. but if developer think it's too heavy in flat, it's fine to develop sub command directly.
#But in hierarchical structure, we strongly recommand using this template.
#
#The main dispatch policy are:
#1. if there isn't noderange input from commmand line. if there are service nodes defined in current MN,
# we dispatch exact same command input from STDIN to all SNs and current MN. if there isn't service nodes defined,
#1. if there isn't noderange input from commmand line and there are service nodes defined in current MN,
# dispatch exact same command input from STDIN to all SNs and current MN. if there isn't service nodes defined,
# just hanld command input from STDIN in current MN
#2. If there is noderange input from command line by opion "-n", we will dispatch the command input from STDIN to SN which can hanle these ndoes
# For example, if we got command from STDIN like "probecommand -n test[1-15] -V" and test[1-5] 's SN is SN1, test[6-10]'s SN is SN2
@ -17,25 +18,24 @@
# For MN run: probecommand -n test[11-15] -V
# For SN1 run: probecommand -n test[1-5] -V
# For SN2 run: probecommand -n test[6-10] -V
#3. All the return message from SNs and MN will be saved in hash %summaryoutput, develper can use it while implement summary_all_jobs_output function
#3. All the return message from SNs and MN will be saved in hash %summaryoutput, develper can use it when implement summary_all_jobs_output function
#--------------------------------------------------------
BEGIN { $::XCATROOT = $ENV{'XCATROOT'} ? $ENV{'XCATROOT'} : -d '/opt/xcat' ? '/opt/xcat' : '/usr'; }
use lib "$::XCATROOT/probe/lib/perl";
use probe_utils;
use xCAT::ServiceNodeUtils;
use hierarchy;
use File::Basename;
use Getopt::Long qw(:config no_ignore_case);
use IO::Select;
use Data::Dumper;
use Getopt::Long qw(:config no_ignore_case);
my $program_name = basename("$0"); #current sub_command name
my $help = 0; #command line attribute '-h', get usage information
my $test = 0; #command line attribute '-T'
my $verbose = 0; #command line attribute '-V'
my $noderange; #command line attribute '-n'
my $help = 0; #command line attribute '-h', get usage information
my $test = 0; #command line attribute '-T'
my $hierarchy = 0;
my $verbose = 0; #command line attribute '-V'
my $noderange; #command line attribute '-n'
my $output = "stdout"; #used by probe_utils->send_msg("$output", "o", "xxxxxxxxxx"); print output to STDOUT
my $is_sn = 0; #flag current server is SN
my $rst = 0; #the exit code of current command
@ -47,22 +47,19 @@ my $terminal = 0; #means get INT signal from STDIN
# $summaryoutput{SN1} = @SN1_output_history
my %summaryoutput;
#a map of SNs and command which will be dispatched to current SN
# one example:
# $dispatchcmd{SN1} = "probecommand -n test[1-5] -V"
# $dispatchcmd{SN2} = "probecommand -n test[6-10] -V"
my %dispatchcmd;
my $is_sn;
$is_sn = 1 if (-e "/etc/xCATSN");
#save command line attributes from STDIN
my @tmpargv;
#--------------------------------
#-------------------------------------
# Usage
#-------------------------------------
# below are some options rules used by default
# -h : Get usage information of current sub command
# -V : Output more information for debug
# -T : To verify if $program_name can work, reserve option for probe framework, dosen't use by customer
# -n : In xCAT probe, -n is uesd to specify node range uniformly
#--------------------------------
#-------------------------------------
my $program_name = basename("$0"); #current sub_command name
$::USAGE = "Usage:
$program_name -h
$program_name [-V]
@ -77,24 +74,20 @@ Options:
";
#------------------------------------
# Please implement the main checking job of current command in do_main_job function
# If $outputtarget has input value, that means do_main_job is running on MN, so every message needed to print on STDOUT should be written into pipe $outputtarget.
# If $outputtarget has no value, that means do_main_job is running on SN, all message just need to print on STDOUT
# Recommand to use probe_utils->send_msg() to handle message you plan to print out
# Please implement the main job of current command in do_main_job function
# Recommand to use probe_utils->send_msg() to handle message you plan to print out to STDOUT
# A simple example has been written in funciton.
#------------------------------------
sub do_main_job {
my $outputtarget = shift;
$outputtarget = "stdout" if (!$outputtarget);
my $rst = 0;
probe_utils->send_msg($outputtarget, "o", "I reveive node range is $noderange");
probe_utils->send_msg("$output", "o", "Received node range: $noderange");
#<#DO YOUR OWN CHECKING JOB1#>
probe_utils->send_msg($outputtarget, "o", "first checking point");
#<#DO YOUR OWN JOB1#>
probe_utils->send_msg("$output", "o", "Do the first job");
#<#DO YOUR OWN CHECKING JOB2#>
probe_utils->send_msg($outputtarget, "f", "second checking point");
#<#DO YOUR OWN JOB2#>
probe_utils->send_msg("$output", "f", "Do the second job");
return $rst;
}
@ -112,94 +105,27 @@ sub summary_all_jobs_output {
#DO SUMMARY DEPENDING ON YOUR SUB_COMMAND NEED
probe_utils->send_msg("$output", "d", "======================do summary=====================");
#print "summaryoutput:\n";
#print Dumper \%summaryoutput;
foreach my $sn (keys %summaryoutput) {
probe_utils->send_msg("$output", "d", "[$sn]");
foreach my $log (@{ $summaryoutput{$sn} }) {
probe_utils->send_msg("$output", "d", "$log");
probe_utils->send_msg("$output", "d", "\t$log");
}
}
return $rst;
}
#-------------------------------------
# Each probe sub command is supposed to support hierarchical.
# This funtion is used to calclulate which SN should be dispatched which command
# main process
#-------------------------------------
sub calculate_dispatch_cmd {
my @snlist = xCAT::ServiceNodeUtils->getAllSN();
if ($noderange) {
my @nodes = `nodels $noderange 2>&1`;
#if there is error in noderange
if ($?) {
my $error = join(" ", @nodes);
if ($error =~ /Error: Invalid nodes and\/or groups in noderange: (.+)/) {
probe_utils->send_msg("$output", "f", "There are invaild nodes ($1) in command line attribute node range");
} else {
probe_utils->send_msg("$output", "f", "There is error in command line attribute node range, please using nodels to check");
}
return 1;
} else {
#calculate the mapping between SN and the nodes which belong to it.
chomp foreach (@nodes);
my $snnodemap = xCAT::ServiceNodeUtils->get_ServiceNode(\@nodes, "xcat", "MN");
#print Dumper $snnodemap;
my %newsnnodemap;
foreach my $sn (keys %$snnodemap) {
if (grep(/^$sn$/, @snlist)) { # the node just belong to one SN
push(@{ $newsnnodemap{$sn} }, @{ $snnodemap->{$sn} });
} elsif ($sn =~ /(\w+),.+/) { # the node belong to more than one SN, count it into first SN
if(grep(/^$1$/, @snlist)){
push(@{ $newsnnodemap{$1} }, @{ $snnodemap->{$sn} });
}else{
probe_utils->send_msg("$output", "f", "The value $1 of 'servicenode' isn't a service node");
}
} else { # the nodes don't belong to any SN will be handled by MN
push(@{ $newsnnodemap{mn} }, @{ $snnodemap->{$sn} });
}
}
#print Dumper \%newsnnodemap;
#generate new command for each SN, replace noderange
foreach my $sn (keys %newsnnodemap) {
my $nodes = join(",", @{ $newsnnodemap{$sn} });
if ($sn eq "mn") {
$noderange = $nodes;
} else {
for (my $i = 0 ; $i <= $#tmpargv ; $i++) {
if ($tmpargv[$i] eq "-n") {
$tmpargv[ $i + 1 ] = $nodes;
last;
}
}
my $args = join(" ", @tmpargv);
$dispatchcmd{$sn} = "$::XCATROOT/probe/subcmds/$program_name $args 2>&1";
}
}
}
} else {
#there isn't noderange input from STDIN, dispatch command to all SN if there are SN defined in MN
if (@snlist) {
my $args = join(" ", @tmpargv);
my $sns = join(",", @snlist);
$dispatchcmd{$sns} = "$::XCATROOT/probe/subcmds/$program_name $args 2>&1" if (!$?);
}
}
return 0;
}
#-------------------------------------
# main process start
#-------------------------------------
@tmpargv = @ARGV;
my @tmpargv = @ARGV;
if (
!GetOptions("--help|h" => \$help,
"T" => \$test,
"H" => \$hierarchy,
"n=s" => \$noderange,
"V" => \$verbose))
{
@ -227,177 +153,77 @@ $SIG{TERM} = $SIG{INT} = sub {
$terminal = 1;
};
#--------------------------------------------
# To confirm what current node is, MN or SN
#--------------------------------------------
$is_sn = 1 if (-e "/etc/xCATSN");
#if this node is SN, just run job, not to do dispatch
if ($is_sn) {
#if it is called by hierarchy template, just run job, not to do dispatch
if ($hierarchy || $is_sn) {
$rst = do_main_job();
exit $rst;
}
#--------------------------------------------
# calculate which command should be dispatched to which SN
#--------------------------------------------
$rst = calculate_dispatch_cmd();
my $hierarchy_instance = hierarchy->new();
#print Dumper \%dispatchcmd;
#print "nodes left to mn : $noderange\n";
#print "========================\n";
exit $rst if ($rst);
#--------------------------------------------
# dispatch job to MN and SN
#--------------------------------------------
my $mnjobpid = 0;
my @snsjobpids = ();
my @snsjobfds = ();
my $pipe_parent_read;
my $pipe_child_write;
pipe $pipe_parent_read, $pipe_child_write;
{
#handle job in MN
$mnjobpid = fork();
if (!defined($mnjobpid)) {
probe_utils->send_msg("$output", "f", "fork process to handle MN job failed: $!");
$rst = 1;
last;
} elsif ($mnjobpid == 0) {
$SIG{TERM} = $SIG{INT} = sub {
exit 1;
};
close $pipe_parent_read;
$rst = do_main_job($pipe_child_write);
exit $rst;
#-------starting to dispatch_cmd--------
my @error;
$rst = $hierarchy_instance->dispatch_cmd($noderange, \@tmpargv, \@error);
if ($rst) {
probe_utils->send_msg("$output", "f", "Calculate dispatch command failed");
foreach (@error) {
probe_utils->send_msg("$output", "", "$_");
}
$SIG{CHLD} = sub { waitpid($mnjobpid, WNOHANG) };
close $pipe_child_write;
#handle job dispatch to SN
foreach my $sn (keys %dispatchcmd) {
my $snjobcmd = "xdsh $sn -s \"$dispatchcmd{$sn}\" 2>&1";
#print "$sn = $snjobcmd\n";
my $snjobfd;
my $snjobpid;
if (!($snjobpid = open($snjobfd, "$snjobcmd |"))) {
probe_utils->send_msg("$output", "f", "fork process to dispatch cmd $snjobcmd to $sn failed: $!");
next;
}
push(@snsjobpids, $snjobpid);
push(@snsjobfds, $snjobfd);
if ($hierarchy_instance->destory(\@error)) {
probe_utils->send_msg("$output", "", "$_") foreach (@error);
}
exit $rst;
}
my $select = new IO::Select;
$select->add(\*$pipe_parent_read) if ($pipe_parent_read);
$select->add(\*$_) foreach (@snsjobfds);
$| = 1;
#----------start to read reply-------
my %reply_cache;
while ($hierarchy_instance->read_reply(\%reply_cache)) {
foreach my $servers (keys %reply_cache) { #Dispatch_cmd may use SN range to dispatch cms to SNs at one time
my @server_array = split(",", $servers);
foreach my $server (@server_array) {
foreach (@{ $reply_cache{$servers} }) {
my $msg = "";
my $logmsg = "";
my $line;
my %pipeisnonull;
$pipeisnonull{mn} = 1;
$pipeisnonull{$_} = 1 foreach (@snsjobfds);
my $onepipeisnonull = 1;
while ($onepipeisnonull) {
if (@hdls = $select->can_read(0)) {
foreach $hdl (@hdls) {
if ($pipeisnonull{mn} && $hdl == \*$pipe_parent_read) {
if (eof($pipe_parent_read)) {
$pipeisnonull{mn} = 0;
} else {
chomp($line = <$pipe_parent_read>);
print "$line\n";
push @{ $summaryoutput{mn} }, $line;
#For cases like below:
#c910f02c04p04: [ok] :All xCAT deamons are running
if ($reply_cache{$servers}->[$_] =~ /^(\w+)\s*:\s*(\[\w+\]\s*):\s*(.*)/) {
if ("$1" eq "$server") {
$logmsg = "$2: $3";
$msg = "$2:<$server>: $3";
}
#For cases like below:
#c910f02c04p05: IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
} elsif ($reply_cache{$servers}->[$_] =~ /^(\w+)\s*:\s*(.*)/) {
if ("$1" eq "$server") {
$logmsg = "$2";
$msg = "<$server>: $2";
}
#For cases like below:
#Unable to open socket connection to xcatd daemon on localhost:3001.
} else {
foreach my $fd (@snsjobfds) {
if ($pipeisnonull{$fd} && $hdl == \*$fd) {
if (eof($fd)) {
$pipeisnonull{$fd} = 0;
} else {
chomp($line = <$fd>);
if ($line =~ /(Error:)\s+(\w+)\s+(.+)/i) {
push @{ $summaryoutput{$2} }, $line;
#if need to print to STDIN in real time, can make below line available
#print "[failed] :$2: $line\n";
} elsif ($line =~ /^(\w+)\s*:\s(.*)/) {
push @{ $summaryoutput{$1} }, $2;
#if need to print to STDIN in real time, can make below lines available
#$line = "$2:$1: $3" if ($line =~ /^(\w+)\s*:\s*(\[\w+\]\s*):\s*(.*)/);
#print "$line\n";
}
}
}
if (length($reply_cache{$servers}->[$_])) {
$logmsg = $reply_cache{$servers}->[$_];
$msg = "[failed] :[$server]: $reply_cache{$servers}->[$_]";
}
}
probe_utils->send_msg("$output", "", "$msg") if (length($msg));
push @{ $summaryoutput{$server} }, $logmsg if (length($logmsg));
}
$onepipeisnonull = 0;
$onepipeisnonull |= $pipeisnonull{$_} foreach (keys %pipeisnonull);
}
last if ($terminal);
sleep 1;
}
}
close($pipe_child_write) if ($pipe_child_write);
close($pipe_parent_read) if ($pipe_parent_read);
close($_) foreach (@snsjobfds);
#start to clear up all sub processes
my %runningpid;
$runningpid{$mnjobpid} = 1 if ($mnjobpid);
$runningpid{$_} = 1 foreach (@snsjobpids);
my $existrunningpid = 0;
$existrunningpid = 1 if (%runningpid);
my $trytime = 0;
while ($existrunningpid) {
#send terminal signal to all running process at same time
#try INT 5 up to 5 times
if ($try < 5) {
foreach my $pid (keys %runningpid) {
kill 'INT', $pid if ($runningpid{$pid});
}
#try TERM 5 up to 5 times
} elsif ($try < 10) {
foreach my $pid (keys %runningpid) {
kill 'TERM', $pid if ($runningpid{$pid});
}
#try KILL 1 time
} else {
foreach my $pid (keys %runningpid) {
kill 'KILL', $pid if ($runningpid{$pid});
}
}
++$try;
sleep 1;
#To check how many process exit, set the flag of exited process to 0
foreach my $pid (keys %runningpid) {
$runningpid{$pid} = 0 if (waitpid($pid, WNOHANG));
}
#To check if there are processes still running, if there are, try kill again in next loop
$existrunningpid = 0;
$existrunningpid |= $runningpid{$_} foreach (keys %runningpid);
#just try 10 times, if still can't kill some process, give up
if ($try > 10) {
my $leftpid;
foreach my $pid (keys %runningpid) {
$leftpid .= "$pid " if ($runningpid{$pid});
}
print "Can't stop process $leftpid, please handle manually.\n";
if ($terminal) {
last;
}
}
#----------hierarchy_instance->destory-----------
if ($hierarchy_instance->destory(\@error)) {
probe_utils->send_msg("$output", "", "$_") foreach (@error);
}
#-------------------------------------
# summary all jobs output to display
#-------------------------------------
@ -408,3 +234,5 @@ exit $rst;

View File

@ -39,12 +39,15 @@ my $program_name = basename("$0");
$::USAGE = "Usage:
$program_name -h
$program_name -n <node_range> -m <discovery_type> [-t <max_waiting_time>] [-V] [--noprecheck]
$program_name -n <node_range> -m <discovery_type> -r <roll_back_duration> [-V] [--noprecheck]
Description:
Probe the discovery process, including pre-check for required configuration and realtime monitor of discovery process.
If all pre-check items pass, $program_name will go to monitor directly, otherwise $program_name will exit.
In order to do realtime monitor, $program_name probe must be run along with the node discovery procedure. Trigger this command before triggering node discovery procedure.
Currently, this command does not support hierarchy.
Probe the discovery process, including pre-check for required configuration, 'Realtime monitor' and 'Replay history' of discovery process.
If all pre-check items failed, $program_name will exit.
Realtime monitor: This is a default. This tool with monitor discovery state of the node. Trigger 'Realtime monitor' before rebooting target node to do discovery.
Replay history: Used after discovery is finished to probe the previously completed discovery.
[NOTE] Currently, hierarchial structure is not supported.
Options:
-h : Get usage information of $program_name.
@ -53,6 +56,9 @@ Options:
-n : The range of predefined nodes, must be used with option -m.
--noprecheck : skip pre-checking discovery to validate correct configuration.
-t : The maximum time to wait when doing monitor, unit is minutes. default is 60.
-r : Trigger 'Replay history' mode. Follow the duration of rolling back. Units are 'h' (hour) or 'm' (minute)
Supported format examples: 3h30m (3 hours and 30 minutes ago), 2h (2 hours ago), 40m (40 minutes ago) and 3 (3 hours ago).
If unit is not specified, hour will be used by default.
";
#----------------------------------------------
@ -78,7 +84,7 @@ if (
"m=s" => \$discovery_type,
"n=s" => \$noderange,
"t=s" => \$maxwaittime,
# "r=s" => \$rollforward_time_of_replay,
"r=s" => \$rollforward_time_of_replay,
"i=s" => \$nics)) #option i is a reservation option, dosen't show up in usage now
{
probe_utils->send_msg("stdout", "f", "Invalid parameter for $program_name");
@ -424,7 +430,7 @@ sub do_pre_check {
probe_utils->send_msg("stdout", "d", "$_") foreach (@errors);
}
} else {
$msg = "Attribute 'master' in 'site' table is configured well";
$msg = "Attribute 'master' in 'site' table is configured";
my $masteripinsite = `tabdump site | awk -F',' '/^"master",/ { gsub(/"/, "", \$2) ; print \$2 }'`;
chomp($masteripinsite);
if ($masteripinsite eq "") {
@ -694,7 +700,7 @@ sub check_genesis_file {
sub dhcp_dynamic_range_check {
my $nets = shift;
my $rst = 0;
my $msg = "DHCP dynamic range is configured well";
my $msg = "DHCP dynamic range is configured";
my $dhcpconfig;
if (-e "/etc/dhcp/dhcpd.conf") {
@ -756,12 +762,18 @@ sub dhcp_dynamic_range_check {
$tftpdir = "/tftpboot";
}
my @errors = ();
my %node_ip;
if ($noderange) {
%node_ip = get_node_ip();
foreach my $node (keys %node_ip) {
if ($node_ip{$node}{"error"}) {
push @errors, $node_ip{$node}{"error"};
$rst = 1;
}
}
}
my @errors = ();
foreach my $net (@$nets) {
if (!exists($subnet_hash{$net})) {
push @errors, "The net $net is not matched.";
@ -772,11 +784,12 @@ sub dhcp_dynamic_range_check {
if ($subnet_hash{$net} ne "unknown") {
if (%node_ip) {
foreach my $node (keys %node_ip) {
next if ($node_ip{$node}{"error"});
foreach my $dr (@{ $subnet_hash{$net} }) {
my @dr_ip = split(/-/, $dr);
if (compare_ip_value($dr_ip[0], $node_ip{$node}) and compare_ip_value($node_ip{$node}, $dr_ip[1])) {
push @errors, "$node ip $node_ip{$node} is conflicting with dynamic range.";
if (compare_ip_value($dr_ip[0], $node_ip{$node}{"ip"}) and compare_ip_value($node_ip{$node}{"ip"}, $dr_ip[1])) {
push @errors, "$node ip $node_ip{$node}{\"ip\"} is conflicting with dynamic range.";
$rst = 1;
next;
}
@ -817,33 +830,28 @@ sub dhcp_dynamic_range_check {
sub get_node_ip {
my $ip_net;
my @node_info = `lsdef $noderange -i ip -c 2>&1`;
my %nodeip;
my %nodecheckrst;
my %nodeipcheck = ();
foreach (@node_info) {
chomp($_);
$_ =~ s/^\s+|\s+$//g;
if ($_ =~ /^Error: Could not find an object named '(\w+)' .+/i) {
$nodecheckrst{$1}{"error"} = "Could not find node definition";
$rst = 1;
} elsif ($_ =~ /^(\w+): ip=(.*)/i) {
$nodeip{$1} = $2;
if ($_ =~ /^Error: Could not find an object named '(.+)' of type .+/i) {
$nodeipcheck{$1}{"error"} = "Could not find node definition";
} elsif ($_ =~ /^(.+): ip=(.*)/i) {
$nodeipcheck{$1}{"ip"} = $2;
}
}
foreach my $node (keys %nodeip) {
foreach my $node (keys %nodeipcheck) {
$ip_net = xCAT::NetworkUtils->getipaddr($node);
if ($nodeip{$node} and ($nodeip{$node} ne $ip_net)) {
probe_utils->send_msg("stdout", "d", "IP $nodeip{$node} definition for $node is not correct") if ($verbose);
if ($nodeipcheck{$node}{"ip"} and $ip_net and ($nodeipcheck{$node}{"ip"} ne $ip_net)) {
$nodeipcheck{$node}{"error"} = "IP $nodeipcheck{$node}{\"ip\"} definition for $node is not correct";
$nodeipcheck{$node}{"ip"} = $ip_net;
}
$nodeip{$node} = $ip_net;
$nodeipcheck{$node}{"error"} = "IP for $node is not on any network this server attached, please run 'makehosts' and 'makedns -n'." unless (xCAT::NetworkUtils->nodeonmynet($node));
}
foreach my $node (keys %nodecheckrst) {
probe_utils->send_msg("stdout", "d", "$node : $nodecheckrst{$node}{error}") if (exists($nodecheckrst{$node}{error}));
}
return %nodeip;
return %nodeipcheck;
}
sub compare_ip_value {
@ -1174,17 +1182,17 @@ sub handle_dhcp_msg {
my $nic = $2;
if ($3 =~ /no free leases/) {
probe_utils->send_msg("stdout", "d", "[$mac] Receive DHCPDISCOVER from $mac via $nic, no free leases") if ($monitor);
probe_utils->send_msg("stdout", "d", "[$mac] Received DHCPDISCOVER from $mac via $nic, no free leases") if ($monitor);
return 0;
}
my $record = "Receive DHCPDISCOVER from $mac via $nic";
my $record = "Received DHCPDISCOVER from $mac via $nic";
probe_utils->send_msg("stdout", "d", "[$mac] $record") if ($monitor);
push(@{ $node_state_ref->{$mac}{log} }, $log_ref->{msg}) if ($debug);
} elsif ($log_ref->{msg} =~ /DHCPOFFER\s+on\s+(.+)\s+to\s+(\w\w:\w\w:\w\w:\w\w:\w\w:\w\w).+via\s+(.+)/i) {
my $ip = $1;
my $mac = $2;
my $nic = $3;
my $record = "Send DHCPOFFER on $ip back to $mac via $nic";
my $record = "Sent DHCPOFFER on $ip back to $mac via $nic";
probe_utils->send_msg("stdout", "d", "[$mac] $record") if ($monitor);
push(@{ $node_state_ref->{$mac}{log} }, $log_ref->{msg}) if ($debug);
@ -1192,7 +1200,7 @@ sub handle_dhcp_msg {
my $ip = $1;
my $mac = $2;
my $nic = $3;
my $record = "Receive DHCPREQUEST from $mac for $ip via $nic";
my $record = "Received DHCPREQUEST from $mac for $ip via $nic";
probe_utils->send_msg("stdout", "d", "[$mac] $record") if ($monitor);
push(@{ $node_state_ref->{$mac}{log} }, $log_ref->{msg}) if ($debug);
@ -1200,7 +1208,7 @@ sub handle_dhcp_msg {
my $ip = $1;
my $mac = $2;
my $nic = $3;
my $record = "Send DHCPACK on $ip back to $mac via $nic";
my $record = "Sent DHCPACK on $ip back to $mac via $nic";
probe_utils->send_msg("stdout", "d", "[$mac] $record") if ($monitor);
push(@{ $node_state_ref->{$mac}{log} }, $log_ref->{msg}) if ($debug);
@ -1211,17 +1219,17 @@ sub handle_dhcp_msg {
my $mac = $1;
my $nic = $2;
if ($3 =~ /no dynamic leases/) {
probe_utils->send_msg("stdout", "d", "Receive DHCPDISCOVER from $mac via $nic, no free leases") if ($monitor);
probe_utils->send_msg("stdout", "d", "Received DHCPDISCOVER from $mac via $nic, no free leases") if ($monitor);
return 0;
}
my $record = "Receive BOOTREQUEST from $mac via $nic";
my $record = "Received BOOTREQUEST from $mac via $nic";
probe_utils->send_msg("stdout", "d", "[$mac] $record") if ($monitor);
push(@{ $node_state_ref->{$mac}{log} }, $log_ref->{msg}) if ($debug);
} elsif ($log_ref->{msg} =~ /BOOTREPLY\s+for\s+(.+)\s+to\s+.+(\w\w:\w\w:\w\w:\w\w:\w\w:\w\w).+via\s+(.+)/) {
my $ip = $1;
my $mac = $2;
my $nic = $3;
my $record = "Send BOOTREPLY on $ip back to $mac via $nic";
my $record = "Sent BOOTREPLY on $ip back to $mac via $nic";
probe_utils->send_msg("stdout", "d", "[$mac] $record") if ($monitor);
push(@{ $node_state_ref->{$mac}{log} }, $log_ref->{msg}) if ($debug);
@ -1520,7 +1528,7 @@ sub conclusion_report {
}
} elsif ($node_state_ref->{$identify}{type} eq "mac") {
foreach (@{ $node_state_ref->{$identify}{statehistory} }) {
$stop_stage = $_ if ($stop_stage < $_);
$stop_stage = $_ if ($stop_stage < $_);
}
if ($stop_stage != $::STATE_DISCOVER_COMPLETED) {
$failed_mac{$identify}{stop_point} = $stop_stage;
@ -1532,7 +1540,7 @@ sub conclusion_report {
my $success_node_num = @success_node;
my $failed_node_num = @failed_node;
my $failed_nodes = join(",", @failed_node);
probe_utils->send_msg("stdout", "", "Discover $success_node_num node(s) successfully, $failed_node_num node(s) failed.");
probe_utils->send_msg("stdout", "", "Discovered $success_node_num node(s) successfully, $failed_node_num node(s) failed.");
probe_utils->send_msg("stdout", "", "Unmatched node(s):");
probe_utils->send_msg("stdout", "", "$failed_nodes");

File diff suppressed because it is too large Load Diff

View File

@ -110,6 +110,7 @@ sub parse_args {
# Responds with usage statement
local *usage = sub {
my $usage_string = xCAT::Usage->getUsage($cmd);
send_msg($request, 0, " $usage_string");
return ([ $_[0], $usage_string ]);
};
@ -124,6 +125,7 @@ sub parse_args {
@ARGV = @$args;
$Getopt::Long::ignorecase = 0;
Getopt::Long::Configure("bundling");
Getopt::Long::Configure("no_pass_through");
# Process command-line flags
if (!GetOptions(\%opt,
@ -288,7 +290,7 @@ sub process_request {
}
if ($verbose) {
send_msg(\%request, 0, " ...changing the ntpp configuration file /etc/ntp.conf.\n ntp servers are: $ntp_servers");
send_msg(\%request, 0, " ...changing the ntp configuration file /etc/ntp.conf.\n ntp servers are: $ntp_servers");
}
# create ntp server config file

View File

@ -37,6 +37,8 @@ use File::Path;
use xCAT::Utils;
use xCAT::TableUtils;
use xCAT::SvrUtils;
use Digest::MD5 qw(md5_hex);
Getopt::Long::Configure("bundling");
Getopt::Long::Configure("pass_through");
@ -97,7 +99,8 @@ sub process_request {
my $provmethod;
my $help;
my $version;
my $lock;
GetOptions(
"profile|p=s" => \$profile,
"arch|a=s" => \$arch,
@ -199,6 +202,14 @@ sub process_request {
}
$rootimg_dir = "$destdir/rootimg";
my $retcode;
($retcode,$lock)=xCAT::Utils->acquire_lock_imageop($rootimg_dir);
if($retcode){
$callback->({ error => ["$lock"], errorcode => [1]});
return 1;
}
my $distname = $osver;
until (-r "$::XCATROOT/share/xcat/netboot/$distname/" or not $distname) {
chop($distname);

View File

@ -10,9 +10,11 @@ BEGIN
use lib "$::XCATROOT/lib/perl";
use Getopt::Long;
use File::Path;
use Cwd qw(realpath);
use xCAT::Utils;
use xCAT::TableUtils;
use xCAT::DBobjUtils;
use Digest::MD5 qw(md5_hex);
Getopt::Long::Configure("bundling");
Getopt::Long::Configure("pass_through");
@ -41,7 +43,8 @@ sub process_request {
my $xcatdef;
my $imagename;
my $imagedir;
my $lock;
if (!xCAT::Utils->isLinux()) {
$callback->({ error => ["The rmimage command is only supported on Linux."], errorcode => [1] });
return;
@ -175,8 +178,17 @@ sub process_request {
$callback->({ error => ["Image directory $imagedir does not exist"], errorcode => [1] });
return;
}
# Doing this extra check now because we now have a method and arch from either the node or the image name.
my $retcode;
($retcode,$lock)=xCAT::Utils->acquire_lock_imageop("$imagedir/rootimg");
if($retcode){
$callback->({ error => ["$lock"], errorcode => [1]});
return 1;
}
# Doing this extra check now because we now have a method and arch from either the node or the image namee
if (($method eq "sysclone") && ($arch ne "s390x")) {
# Only supporting removing sysclone images for s390x at this time.
@ -184,17 +196,28 @@ sub process_request {
return;
}
my @filestoremove = ("$imagedir/rootimg.gz", "$imagedir/kernel", "$imagedir/initrd-stateless.gz", "$imagedir/initrd-statelite.gz");
my @filestoremove = ("$imagedir/kernel", "$imagedir/initrd-stateless.gz", "$imagedir/initrd-statelite.gz");
my @rootimgtars=glob "$imagedir/rootimg.{tar,cpio}.{xz,gz}";
push @filestoremove,@rootimgtars;
#unmount all the mount points under rootimg directory
#to avoid removing the directory/files on management node by mistake
$realimagedir=realpath("$imagedir/rootimg");
my @mntptlist;
my $FILEHD=undef;
open($FILEHD,"<","/proc/mounts");
while(<$FILEHD>){
my @arr=split / /;
push @mntptlist,$arr[1] if(substr($arr[1],0,length($realimagedir)) eq $realimagedir);
}
close($FILEHD);
foreach my $mntpt (@mntptlist){
system("umount -l $mntpt >/dev/null 2>&1")
}
#some rpms like atftp mount the rootimg/proc to /proc, we need to make sure rootimg/proc is free of junk
`umount -l $imagedir/rootimg/proc 2>&1 1>/dev/null`;
# also umount the rootimg/sys
`umount -l $imagedir/rootimg/sys 2>&1 1>/dev/null`;
# umount the rootimg/dev
my $devmount = `cat /proc/mounts |grep "$imagedir/rootimg/dev"`;
if ($devmount) {
my $devmount = system("findmnt $imagedir/rootimg/dev/ >/dev/null 2>&1");
if (!$devmount) {
xCAT::Utils->runcmd("umount -l $imagedir/rootimg/dev");
if ($?) {
$callback->({ error => ["$imagedir/rootimg/dev mount on /dev, and can't umount. remove $imagename will lead to unpredictable result, please umount manualy before try again"], errorcode => [1] });

View File

@ -909,7 +909,7 @@ Usage:
} else {
$ent->{'node'} = 'undef' unless ($ent->{'node'});
$ent->{'method'} = 'undef' unless ($ent->{'method'});
push @discoverednodes, sprintf(" %-40s%-20s%-15s%-10s%-13s", $ent->{'uuid'}, $ent->{'node'}, $ent->{'method'}, $ent->{'mtm'}, substr($ent->{'serial'}, 0, 12));
push @discoverednodes, sprintf(" %-40s%-20s%-15s%-10s%-20s", $ent->{'uuid'}, $ent->{'node'}, $ent->{'method'}, $ent->{'mtm'}, substr($ent->{'serial'}, 0, 19));
}
}

View File

@ -1464,6 +1464,13 @@ sub initDB
xCAT::MsgUtils->message('E', "Could not add default value for site.xcatsslversion.");
}
}
# Set dhcpd.conf be updated when update xcat
my $cmds = "XCATBYPASS=Y $::XCATROOT/sbin/makedhcp -n 2>/dev/null";
xCAT::Utils->runcmd("$cmds", -1);
if ($::RUNCMD_RC != 0) {
xCAT::MsgUtils->message('E', "Could not create a new dhcp configuration file.");
}
}
# remove xcatserver,xcatclient

View File

@ -457,7 +457,7 @@ ProcessType () {
# before mount, need to check whether it exists or not
STRPATH="${TMPFS}${2}"
STRLEN=${#STRPATH}
CHAREND=`echo ${STRPATH} | /bin/cut -c${STRLEN}`
CHAREND=`echo ${STRPATH} | /usr/bin/cut -c${STRLEN}`
if [ "${CHAREND}" = "/" ]; then # it is one directory
if [ ! -d ${STRPATH} ]; then

View File

@ -19,6 +19,8 @@ use File::Temp qw/mkdtemp/;
use FindBin;
use lib "$FindBin::Bin/../imgutils";
use imgutils;
use xCAT::Utils;
use Digest::MD5 qw(md5_hex);
#use strict;
Getopt::Long::Configure("bundling");
@ -66,6 +68,8 @@ my $tempfile;
my $prompt;
my $ignorekernelchk;
my $noupdate;
my $lock;
sub xdie {
@ -112,17 +116,30 @@ sub mount_chroot {
sub umount_chroot {
my $rootimage_dir = shift;
if ($rootimage_dir eq "") {
$rootimage_dir=realpath($rootimage_dir);
if ($rootimage_dir eq "/") {
print "\n\n\n\nWARNING: /proc and /sys may still be mounted in the rootimgdir\n\n\n\n";
return 1;
}
#unmount all the mount points under rootimg directory
#to avoid removing the direcoty/files on managemment node by mistake
my @mntptlist;
my $FILEHD=undef;
open($FILEHD,"<","/proc/mounts");
while(<$FILEHD>){
my @arr=split / /;
push @mntptlist,$arr[1] if(substr($arr[1],0,length($rootimage_dir)) eq $rootimage_dir);
}
close($FILEHD);
foreach my $mntpt (@mntptlist){
system("umount -l $mntpt >/dev/null 2>&1")
}
if (majversion($osver) > 6) {
system("umount -l $rootimage_dir/proc");
system("umount -l $rootimage_dir/sys");
#system("umount -l $rootimage_dir/dev");
system("rm -rf $rootimage_dir/dev/*");
#only remove the /dev in rootimg directory if it is not a mount point
system("findmnt $rootimage_dir/dev/ >/dev/null 2>&1 || rm -rf $rootimage_dir/dev/*");
}
}
@ -194,6 +211,7 @@ $srcdir_otherpkgs = "$installroot/post/otherpkgs/$osver/$arch" unless ($srcdir_o
$destdir = "$installroot/netboot/$osver/$arch/$profile" unless ($destdir);
$updates{'rootimgdir'} = $destdir if ($tempfile);
$rootimg_dir = "$destdir/rootimg";
$kerneldir = "$installroot/kernels" unless ($kerneldir); # the default directory for 3rd-party kernel is "$installroot/kernels";
@ -348,6 +366,14 @@ unless ($onlyinitrd) {
exit 1;
}
my $retcode;
($retcode,$lock)=xCAT::Utils->acquire_lock_imageop($rootimg_dir);
if($retcode){
print "$lock";
exit 1;
}
mount_chroot($rootimg_dir);
my %pkg_hash = imgutils::get_package_names($pkglist);

View File

@ -1791,7 +1791,7 @@ EOMS
}
}
if ($mode eq "statelite") {
foreach ("sbin/ifconfig", "usr/bin/clear", "usr/bin/touch", "bin/hostname", "usr/bin/egrep", "bin/ln", "bin/ls", "usr/bin/dirname", "usr/bin/expr", "usr/bin/chroot", "usr/bin/grep", "bin/cpio", "bin/sleep", "bin/mount", "bin/umount", "sbin/dhcpcd", "bin/bash", "sbin/insmod", "bin/mkdir", "bin/mknod", "sbin/ip", "bin/cat", "usr/bin/awk", "usr/bin/wget", "bin/cp", "usr/bin/cpio", "usr/bin/zcat", "usr/bin/gzip", "lib/mkinitrd/bin/run-init", "usr/bin/uniq", "usr/bin/sed", "usr/bin/wc", "bin/sed", "sbin/udevd", "usr/bin/readlink", "usr/sbin/parted", "sbin/mke2fs", "sbin/mkswap", "sbin/swapon", "bin/chmod", "usr/bin/bc", "usr/bin/xz", "usr/bin/gzip", "bin/tar") {
foreach ("sbin/ifconfig", "usr/bin/clear", "usr/bin/touch", "usr/bin/cut", "usr/bin/rm", "bin/hostname", "usr/bin/egrep", "bin/ln", "bin/ls", "usr/bin/dirname", "usr/bin/expr", "usr/bin/chroot", "usr/bin/grep", "bin/cpio", "bin/sleep", "bin/mount", "bin/umount", "sbin/dhcpcd", "bin/bash", "sbin/insmod", "bin/mkdir", "bin/mknod", "sbin/ip", "bin/cat", "usr/bin/awk", "usr/bin/wget", "bin/cp", "usr/bin/cpio", "usr/bin/zcat", "usr/bin/gzip", "lib/mkinitrd/bin/run-init", "usr/bin/uniq", "usr/bin/sed", "usr/bin/wc", "bin/sed", "sbin/udevd", "usr/bin/readlink", "usr/sbin/parted", "sbin/mke2fs", "sbin/mkswap", "sbin/swapon", "bin/chmod", "usr/bin/bc", "usr/bin/xz", "usr/bin/gzip", "bin/tar") {
getlibs($_);
push @filestoadd, $_;
}

View File

@ -2,7 +2,7 @@
#
# go-xcat - Install xCAT automatically.
#
# Version 1.0.9
# Version 1.0.10
#
# Copyright (C) 2016 International Business Machines
# Eclipse Public License, Version 1.0 (EPL-1.0)
@ -1188,6 +1188,9 @@ function update_xcat()
[[ "${ver}" = "(not installed)" ]] &&
unset "install_list[${i}]"
done < <(check_package_version "${install_list[@]}")
[[ "${#install_list[@]}" -gt "0" ]]
warn_if_bad "$?" "xCAT is not installed."
exit_if_bad "$?" "In order to install xCAT, please rerun with \`${0##*/} install'."
install_packages "$@" "${install_list[@]}"
}

View File

@ -297,6 +297,7 @@ xcatd_restart
run_command_with_XCATBYPASS
disable_root_permission_in_policy_table
assign_certain_command_permission
xcatconfig_u_check_xcatsslversion_rhels_sles
reg_linux_diskless_installation_flat
packimage_m_cpio_c_gzip
packimage_m_cpio_c_xz

View File

@ -203,6 +203,7 @@ nodeset_shell
nodeset_cmdline
nodeset_runimg
nodeset_check_warninginfo
xcatconfig_u_check_xcatsslversion_rhels_sles
reg_linux_diskless_installation_flat
packimage_m_cpio_c_gzip
packimage_m_cpio_c_xz

View File

@ -297,6 +297,7 @@ xcatd_restart
run_command_with_XCATBYPASS
disable_root_permission_in_policy_table
assign_certain_command_permission
xcatconfig_u_check_xcatsslversion_rhels_sles
reg_linux_diskless_installation_flat
packimage_m_cpio_c_gzip
packimage_m_cpio_c_xz

View File

@ -206,6 +206,7 @@ nodeset_cmdline
nodeset_runimg
redhat_migration1
redhat_migration2
xcatconfig_u_check_xcatsslversion_rhels_sles
reg_linux_statelite_installation_flat
SN_setup_case
reg_linux_diskfull_installation_hierarchy

View File

@ -203,6 +203,7 @@ nodeset_check_warninginfo
nodeset_shell
nodeset_cmdline
nodeset_runimg
xcatconfig_u_check_xcatsslversion_rhels_sles
reg_linux_diskless_installation_flat
packimage_m_cpio_c_gzip
packimage_m_cpio_c_xz

View File

@ -297,6 +297,7 @@ xcatd_restart
run_command_with_XCATBYPASS
disable_root_permission_in_policy_table
assign_certain_command_permission
xcatconfig_u_check_xcatsslversion_rhels_sles
reg_linux_diskless_installation_flat
packimage_m_cpio_c_gzip
packimage_m_cpio_c_xz

View File

@ -204,6 +204,7 @@ switchdiscover_range_z_V
nodeset_shell
nodeset_cmdline
nodeset_runimg
xcatconfig_u_check_xcatsslversion_rhels_sles
reg_linux_statelite_installation_flat
SN_setup_case
reg_linux_diskfull_installation_hierarchy

View File

@ -209,6 +209,7 @@ nodeset_check_warninginfo
nodeset_shell
nodeset_cmdline
nodeset_runimg
xcatconfig_u_check_xcatsslversion_rhels_sles
reg_linux_diskless_installation_flat
reg_linux_statelite_installation_flat
SN_setup_case

View File

@ -261,6 +261,7 @@ makentp_V
makentp
makentp_a
nodeset_check_warninginfo
xcatconfig_u_check_xcatsslversion_rhels_sles
reg_linux_diskless_installation_flat
packimage_m_cpio_c_gzip
packimage_m_cpio_c_xz

View File

@ -213,6 +213,7 @@ xcatd_restart
run_command_with_XCATBYPASS
disable_root_permission_in_policy_table
assign_certain_command_permission
xcatconfig_u_check_xcatsslversion_rhels_sles
reg_linux_diskless_installation_flat
packimage_m_cpio_c_gzip
packimage_m_cpio_c_xz

View File

@ -216,6 +216,7 @@ xcatd_restart_systemd
run_command_with_XCATBYPASS_systemd
disable_root_permission_in_policy_table_systemd
assign_certain_command_permission_systemd
xcatconfig_u_check_xcatsslversion_rhels_sles
sles_migration1
sles_migration2
reg_linux_statelite_installation_flat

View File

@ -213,6 +213,7 @@ xcatd_restart_systemd
run_command_with_XCATBYPASS_systemd
disable_root_permission_in_policy_table_systemd
assign_certain_command_permission_systemd
xcatconfig_u_check_xcatsslversion_rhels_sles
sles_migration1
sles_migration2
reg_linux_diskless_installation_flat

View File

@ -252,3 +252,6 @@ xcatd_restart
run_command_with_XCATBYPASS
disable_root_permission_in_policy_table
assign_certain_command_permission
xcatconfig_u_check_xcatsslversion_ubuntu
ubuntule_migration1_p8le
ubuntule_migration2_p8le

View File

@ -269,3 +269,6 @@ rmdocker_command
rmdocker_f_command
lsdocker_h_command
lsdocker_l_command
xcatconfig_u_check_xcatsslversion_ubuntu
ubuntux_migration1_vm
ubuntux_migration2_vm

View File

@ -252,3 +252,7 @@ xcatd_restart_systemd
run_command_with_XCATBYPASS_systemd
disable_root_permission_in_policy_table_systemd
assign_certain_command_permission_systemd
xcatconfig_u_check_xcatsslversion_ubuntu
ubuntule_migration1_p8le
ubuntule_migration2_p8le

View File

@ -261,3 +261,6 @@ run_command_with_XCATBYPASS_systemd
disable_root_permission_in_policy_table_systemd
assign_certain_command_permission_systemd
nodeset_check_warninginfo
xcatconfig_u_check_xcatsslversion_ubuntu
ubuntux_migration1_vm
ubuntux_migration2_vm

View File

@ -222,3 +222,20 @@ cmd:chdef -t wrongtype -o testnode groups=all,aix
check:rc!=0
check:output=~not a valid
end
start:chdef_template
os:linux
description:try to change a template, a new node is created according to chdef.
cmd:result=`lsdef | grep switch-template`; if [[ $result =~ "switch-template" ]]; then echo $result; noderm switch-template; fi
cmd:chdef -t node -o switch-template groups=test
check:output=~1 object definitions have been created or modified
check:output=~New object definitions \'switch-template\' have been created
check:rc==0
cmd:lsdef switch-template
check:output=~Object name\: switch\-template
check:output=~groups\=test
check:rc==0
cmd:noderm switch-template
check:rc==0
end

View File

@ -4,6 +4,7 @@ description:check fresh install disk, usded for x86 multi disk only, and not che
cmd:xdsh $$CN "dd if=/dev/zero of=/dev/sdb bs=1048576 count=100"
cmd:xdsh $$CN "dd if=/dev/zero of=/dev/sdb bs=1048576 count=300 seek=60858"
cmd:if [[ "__GETNODEATTR($$CN,arch)__" != "ppc64" ]]; then tabdump -w node==$$CN kvm_nodedata |grep -i $$CN; fi
cmd:if [ "__GETNODEATTR($$CN,arch)__" != "ppc64" -a "__GETNODEATTR($$CN,mgt)__" != "ipmi" ];then if [[ "__GETNODEATTR($$CN,vmstorage)__" =~ "phy" ]]; then rmvm $$CN -f -p && mkvm $$CN; else rmvm $$CN -f -p && mkvm $$CN -s 20G; fi;fi
check:rc=0
cmd:makedns -n

View File

@ -3,6 +3,8 @@ os:Linux
cmd:copycds $$ISO
check:rc==0
cmd:if [[ "__GETNODEATTR($$CN,arch)__" != "ppc64" ]]; then tabdump -w node==$$CN kvm_nodedata; fi
check:rc==0
cmd:if [ "__GETNODEATTR($$CN,arch)__" != "ppc64" -a "__GETNODEATTR($$CN,mgt)__" != "ipmi" ];then if [[ "__GETNODEATTR($$CN,vmstorage)__" =~ "phy" ]]; then rmvm $$CN -f -p && mkvm $$CN; else rmvm $$CN -f -p && mkvm $$CN -s 20G; fi;fi
check:rc==0
cmd:makedns -n

View File

@ -9,7 +9,7 @@ cmd:chtab key=nameservers site.value="<xcatmaster>"
check:rc==0
#cmd:if [ "__GETNODEATTR($$SN,arch)__" != "ppc64" -a "__GETNODEATTR($$SN,mgt)__" != "ipmi" ];then if [[ "__GETNODEATTR($$SN,vmstorage)__" =~ "phy" ]]; then rmvm $$SN -f -p && mkvm $$SN; else rmvm $$SN -f -p && mkvm $$SN -s 20G; fi;fi
#Add for debug rmvm issue
cmd:if [[ "__GETNODEATTR($$CN,arch)__" != "ppc64" ]]; then tabdump -w node==$$SN kvm_nodedata |grep -i $$SN; fi
cmd:if [[ "__GETNODEATTR($$CN,arch)__" != "ppc64" ]]; then tabdump -w node==$$SN kvm_nodedata; fi
check:rc==0
cmd:if [ "__GETNODEATTR($$SN,arch)__" != "ppc64" -a "__GETNODEATTR($$SN,mgt)__" != "ipmi" ];then if [[ "__GETNODEATTR($$SN,vmstorage)__" =~ "phy" ]]; then rmvm $$SN -f -p && mkvm $$SN; else rmvm $$SN -f -p;mkvm $$SN;rmvm $$SN -f -p;mkvm $$SN -s 20G; fi;fi
check:rc==0

View File

@ -3,6 +3,8 @@ os:Linux
cmd:chtab key=nameservers site.value="<xcatmaster>"
check:rc==0
cmd:if [[ "__GETNODEATTR($$CN,arch)__" != "ppc64" ]]; then tabdump -w node==$$SN kvm_nodedata; fi
check:rc==0
cmd:if [[ "__GETNODEATTR($$SN,arch)__" =~ "x86_64" ]];then rmvm $$SN -f -p && mkvm $$SN -s 40G; fi
cmd:makedns -n

View File

@ -5,6 +5,8 @@ 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 [[ "__GETNODEATTR($$CN,arch)__" != "ppc64" ]]; then tabdump -w node==$$CN kvm_nodedata; fi
check:rc==0
cmd:if [ "__GETNODEATTR($$CN,arch)__" != "ppc64" -a "__GETNODEATTR($$CN,mgt)__" != "ipmi" ];then if [[ "__GETNODEATTR($$CN,vmstorage)__" =~ "phy" ]]; then rmvm $$CN -f -p && mkvm $$CN; else rmvm $$CN -f -p && mkvm $$CN -s 20G; fi;fi
check:rc=0
cmd:makedns -n

View File

@ -3,6 +3,8 @@ os:Linux
cmd:copycds $$ISO
check:rc==0
cmd:if [[ "__GETNODEATTR($$CN,arch)__" != "ppc64" ]]; then tabdump -w node==$$CN kvm_nodedata; fi
check:rc=0
cmd:if [ "__GETNODEATTR($$CN,arch)__" != "ppc64" -a "__GETNODEATTR($$CN,mgt)__" != "ipmi" ];then if [[ "__GETNODEATTR($$CN,vmstorage)__" =~ "phy" ]]; then rmvm $$CN -f -p && mkvm $$CN; else rmvm $$CN -f -p && mkvm $$CN -s 20G; fi;fi
check:rc=0
cmd:makedns -n

View File

@ -2,6 +2,8 @@ start:Full_installation_flat_docker
os:Linux
cmd:copycds $$ISO
check:rc==0
cmd:if [[ "__GETNODEATTR($$CN,arch)__" != "ppc64" ]]; then tabdump -w node==$$CN kvm_nodedata; fi
check:rc==0
cmd:if [ "__GETNODEATTR($$CN,arch)__" != "ppc64" -a "__GETNODEATTR($$CN,mgt)__" != "ipmi" ];then if [[ "__GETNODEATTR($$CN,vmstorage)__" =~ "phy" ]]; then rmvm $$CN -f -p && mkvm $$CN; else rmvm $$CN -f -p && mkvm $$CN -s 20G; fi;fi
check:rc=0
cmd:makedns -n

View File

@ -209,3 +209,42 @@ check:rc==0
cmd:lsdef testnode1
check:output=~Could not find
end
start:lsdef_template
os:linux
description:check xCAT supported template
cmd:lsdef --template
check:rc==0
check:output=~hmc\-template \(node\)
check:output=~ppc64le\-template \(node\)
check:output=~ppc64lekvmguest\-template \(node\)
check:output=~switch\-template \(node\)
check:output=~x86_64\-template \(node\)
check:output=~x86_64kvmguest\-template \(node\)
end
start:lsdef_template_switch_template
os:linux
description:check xCAT supported template for switch template
cmd:lsdef --template switch-template
check:rc==0
check:output=~Object name\: switch-template
check:output=~groups=switch
check:output=~nodetype=switch
check:output=~postbootscripts\=otherpkgs
check:output=~postscripts\=syslog\,remoteshell\,syncfiles
check:output=~usercomment\=the switch definition template
check:output=~postscripts\=syslog\,remoteshell\,syncfiles
check:output=~ip\=OPTIONAL\:the ip address of the switch
check:output=~mac\=OPTIONAL\:the MAC address of the switch
check:output=~switchtype\=OPTIONAL\:The type of switch
end
start:lsdef_template_with_invalid_name
os:linux
description:lsdef --template with invalid template name
cmd:result=`lsdef | grep test_with_invalid_name`; if [[ $result =~ "test_with_invalid_name" ]]; then noderm test_with_invalid_name; fi
cmd:lsdef --template "test_with_invalid_name"
check:rc==1
check:output=~Error: Could not find test_with_invalid_name in xCAT templates.
end

View File

@ -5,6 +5,8 @@ description:update xCAT from $$MIGRATION1_VERSION to $$LATEST_VERSION, these two
#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 [[ "__GETNODEATTR($$CN,arch)__" != "ppc64" ]]; then tabdump -w node==$$CN kvm_nodedata; fi
check:rc==0
cmd:if [ "__GETNODEATTR($$CN,arch)__" != "ppc64" -a "__GETNODEATTR($$CN,mgt)__" != "ipmi" ];then rmvm $$CN -f -p && mkvm $$CN -s 20G; fi
cmd:rscan __GETNODEATTR($$CN,hcp)__ -w
check:rc==0
@ -114,6 +116,8 @@ 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 [[ "__GETNODEATTR($$CN,arch)__" != "ppc64" ]]; then tabdump -w node==$$CN kvm_nodedata; fi
check:rc==0
cmd:if [ "__GETNODEATTR($$CN,arch)__" != "ppc64" -a "__GETNODEATTR($$CN,mgt)__" != "ipmi" ];then rmvm $$CN -f -p && mkvm $$CN -s 20G; fi
cmd:rscan __GETNODEATTR($$CN,hcp)__ -w
check:rc==0

View File

@ -5,6 +5,8 @@ description:update xCAT from $$MIGRATION1_VERSION to $$LATEST_VERSION, these two
#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 [[ "__GETNODEATTR($$CN,arch)__" != "ppc64" ]]; then tabdump -w node==$$CN kvm_nodedata; fi
check:rc==0
cmd:if [ "__GETNODEATTR($$CN,arch)__" != "ppc64" -a "__GETNODEATTR($$CN,mgt)__" != "ipmi" ];then rmvm $$CN -f -p && mkvm $$CN -s 20G; fi
cmd:rscan __GETNODEATTR($$CN,hcp)__ -w
check:rc==0
@ -116,6 +118,8 @@ description:update xCAT from $$MIGRATION22VERSION to $$LATEST_VERSION, these two
#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 [[ "__GETNODEATTR($$CN,arch)__" != "ppc64" ]]; then tabdump -w node==$$CN kvm_nodedata; fi
check:rc==0
cmd:if [ "__GETNODEATTR($$CN,arch)__" != "ppc64" -a "__GETNODEATTR($$CN,mgt)__" != "ipmi" ];then rmvm $$CN -f -p && mkvm $$CN -s 20G; fi
cmd:rscan __GETNODEATTR($$CN,hcp)__ -w
check:rc==0

View File

@ -159,4 +159,168 @@ check:output=~not a valid
end
start:mkdef_template_switch_template_without_attribute
os:linux
description:create a node with swtich template without any attributes
cmd:result=`lsdef | grep auto_test_node_1`; if [[ $result =~ "auto_test_node_1" ]]; then echo $result; noderm auto_test_node_1; fi
cmd:mkdef -t node -o auto_test_node_1 --template switch-template
check:rc==0
check:output=~1 object definitions have been created or modified.
cmd:lsdef auto_test_node_1
check:rc==0
check:output=~Object name\: auto_test_node_1
check:output=~groups=switch
check:output=~nodetype=switch
check:output=~postbootscripts\=otherpkgs
check:output=~postscripts\=syslog\,remoteshell\,syncfiles
check:output=~usercomment\=the switch definition template
check:output=~postscripts\=syslog\,remoteshell\,syncfiles
check:output!=ip\=OPTIONAL\:the ip address of the switch
check:output!=mac\=OPTIONAL\:the MAC address of the switch
check:output!=switchtype\=
cmd:noderm auto_test_node_1
check:rc==0
end
start:mkdef_template_cec_template_without_remainder
os:linux
description:create a node with cec template once
cmd:result=`lsdef | grep auto_test_cec_node_1`; if [[ $result =~ "auto_test_cec_node_1" ]]; then echo $result; noderm auto_test_cec_node_1; fi
cmd:mkdef -t node -o auto_test_cec_node_1 --template cec-template serial=test mtm=test hcp=test
checkrc==0
check:output=~1 object definitions have been created or modified
cmd:lsdef auto_test_cec_node_1
check:output=~Object name\: auto\_test\_cec\_node\_1
check:output=~groups\=cec\,all
check:output=~hwtype\=cec
check:output=~mgt\=hmc
check:output=~nodetype\=ppc
check:output=~postbootscripts\=otherpkgs
check:output=~postscripts\=syslog\,remoteshell\,syncfiles
check:output=~usercomment\=the cec definition template
check:output=~hcp\=test
check:output=~mtm\=test
check:output=~serial\=test
cmd:noderm auto_test_cec_node_1
check:rc==0
end
start:mkdef_template_invalid_template
os:linux
description:create a node with invalid template
cmd:result=`lsdef | grep auto_test_node`; if [[ $result =~ "auto_test_node" ]]; then echo $result; noderm auto_test_node; fi
cmd:result=`lsdef | grep auto_test_invalid_template`; if [[ $result =~ "auto_test_invalid_template" ]]; then echo $result; noderm auto_test_invalid_template; fi
cmd:lsdef --template auto_test_invalid_template
check:rc==1
check:output=~Error\: Could not find auto\_test\_invalid\_template in xCAT templates
cmd:mkdef -t node -o auto_test_node --template auto_test_invalid_template
checkrc==1
check:output=~Error\: Could not find the template object named \'auto\_test\_invalid\_template\' of type \'node\'
end
start:mkdef_node_with_a_node_template
os:linux
description:create a node with a node template, using cec template to create node at beginning
cmd:result=`lsdef | grep auto_test_cec_node_1`; if [[ $result =~ "auto_test_cec_node_1" ]]; then echo $result; noderm auto_test_cec_node_1; fi
cmd:result=`lsdef | grep auto_test_cec_node_2`; if [[ $result =~ "auto_test_cec_node_2" ]]; then echo $result; noderm auto_test_cec_node_2; fi
cmd:mkdef -t node -o auto_test_cec_node_1 --template cec-template serial=test mtm=test hcp=test groups=test_template
checkrc==0
check:output=~1 object definitions have been created or modified
check:output=~created
cmd:mkdef -t node -o auto_test_cec_node_2 --template auto_test_cec_node_1 serial=test2 mtm=test2 hcp=test2
checkrc==0
check:output=~1 object definitions have been created or modified
cmd:lsdef auto_test_cec_node_2
check:output=~Object name\: auto\_test\_cec\_node\_2
check:output=~groups\=test\_template
check:output!=groups\=cec\,all
check:output=~hwtype\=cec
check:output=~mgt\=hmc
check:output=~nodetype\=ppc
check:output=~postbootscripts\=otherpkgs
check:output=~postscripts\=syslog\,remoteshell\,syncfiles
check:output=~usercomment\=the cec definition template
check:output=~hcp\=test2
check:output=~mtm\=test2
check:output=~serial\=test2
cmd:noderm auto_test_cec_node_1
check:rc==0
cmd:noderm auto_test_cec_node_2
check:rc==0
end
start:mkdef_template_cec_template_step_by_step
os:linux
description:create a node with cec template step by step
cmd:result=`lsdef | grep auto_test_cec_node_1`; if [[ $result =~ "auto_test_cec_node_1" ]]; then echo $result; noderm auto_test_cec_node_1; fi
cmd:mkdef -t node -o auto_test_cec_node_1 --template cec-template
check:rc==1
check:output=~Error\: The attribute \"serial\" must be specified!
cmd:mkdef -t node -o auto_test_cec_node_1 --template cec-template serial=test
check:rc==1
check:output=~Error\: The attribute \"mtm\" must be specified!
cmd:mkdef -t node -o auto_test_cec_node_1 --template cec-template serial=test mtm=test
check:rc==1
check:output=~Error\: The attribute \"hcp\" must be specified!
cmd:mkdef -t node -o auto_test_cec_node_1 --template cec-template serial=test mtm=test hcp=test
checkrc==0
check:output=~1 object definitions have been created or modified
cmd:lsdef auto_test_cec_node_1
check:output=~Object name\: auto\_test\_cec\_node\_1
check:output=~groups\=cec\,all
check:output=~hwtype\=cec
check:output=~mgt\=hmc
check:output=~nodetype\=ppc
check:output=~postbootscripts\=otherpkgs
check:output=~postscripts\=syslog\,remoteshell\,syncfiles
check:output=~usercomment\=the cec definition template
check:output=~hcp\=test
check:output=~mtm\=test
check:output=~serial\=test
cmd:noderm auto_test_cec_node_1
check:rc==0
end
start:check_mkdef_node_with_template_priority
os:linux
description:create node named cec-template with cec template at beginning, the node is priority high than tempalate to create a new node
cmd:result=`lsdef | grep cec-template`; if [[ $result =~ "cec-template" ]]; then echo $result; noderm cec-template; fi
cmd:result=`lsdef | grep auto_test_cec_node`; if [[ $result =~ "auto_test_cec_node" ]]; then echo $result; noderm auto_test_cec_node; fi
cmd:mkdef -t node -o cec-template --template cec-template serial=test mtm=test hcp=test groups=test_template_priority
checkrc==0
check:output=~1 object definitions have been created or modified
cmd:mkdef -t node -o auto_test_cec_node --template cec-template serial=test2 mtm=test2 hcp=test2
checkrc==0
check:output=~1 object definitions have been created or modified
cmd:lsdef auto_test_cec_node
check:output=~Object name\: auto\_test\_cec\_node
check:output=~groups\=test\_template\_priority
check:output!=groups\=cec\,all
check:output=~hwtype\=cec
check:output=~mgt\=hmc
check:output=~nodetype\=ppc
check:output=~postbootscripts\=otherpkgs
check:output=~postscripts\=syslog\,remoteshell\,syncfiles
check:output=~usercomment\=the cec definition template
check:output=~hcp\=test2
check:output=~mtm\=test2
check:output=~serial\=test2
cmd:noderm cec-template
checkrc==0
cmd:noderm auto_test_cec_node
checkrc==0
end
start:mkdef_template_diskless_osimage_rootimgdir
os:linux
description:check rootimgdir warning message after make new osimage with mkdef --template
cmd:mkdef -t osimage -o test-osimage_with_template --template __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute
check:rc==0
output=~1 object definitions have been created or modified
cmd:xcatprobe osimagecheck
check:output=~Identical root image directory
check:output=~test-osimage
check:output=~__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute
cmd:rmdef -t osimage -o test-osimage_with_template
check:rc==0
end

View File

@ -128,3 +128,13 @@ cmd:rmdef -t wrongtype -o testnode
check:rc!=0
check:output=~not a valid
end
start:rmdef_template
os:linux
description:try to delete a template, then error messages appear
cmd:result=`lsdef | grep switch-template`; if [[ $result =~ "switch-template" ]]; then echo $result; noderm switch-template; fi
cmd:rmdef switch-template
checkrc==1
check:output=~Error\: Could not find an object named \'switch-template\' of type \'node\'
check:output=~No objects have been removed from the xCAT database.
end

View File

@ -454,3 +454,23 @@ check:output=~postscripts has completed
check:output=~Software Maintenance has completed
end
start:updatenode_P_syslog_V_xcatdebugmode_is_one
description:xcatdebugmode value is one, there should be execution outputs.
cmd:chtab key=xcatdebugmode site.value=1
check:rc==0
cmd:updatenode $$CN -P syslog -V
check:output=~$$CN: ++
cmd:chtab key=xcatdebugmode site.value=0
check:rc==0
end
start:updatenode_P_syslog_V_xcatdebugmode_is_two
description:xcatdebugmode value is two, there should be execution outputs.
cmd:chtab key=xcatdebugmode site.value=2
check:rc==0
cmd:updatenode $$CN -P syslog -V
check:output=~$$CN: ++
cmd:chtab key=xcatdebugmode site.value=0
check:rc==0
end

View File

@ -6,11 +6,21 @@ B<xcattest> - Run automated xCAT test cases.
B<xcattest> [B<-?|-h>]
B<xcattest> [B<-f> I<configure file>] [B<-b> I<case bundle list>] [B<-l>]
B<xcattest> [B<-f> I<configure file>] [B<-b> I<case bundle list>]
B<xcattest> [B<-f> I<configure file>] [B<-t> I<case list>]
B<xcattest> [B<-f> I<configure file>] [B<-c> I<cmd list>] [B<-l>]
B<xcattest> [B<-f> I<configure file>] [B<-c> I<cmd list>]
B<xcattest> [B<-b> I<case bundle list>] [B<-l>]
B<xcattest> [B<-t> I<case list>] [B<-l>]
B<xcattest> [B<-c> I<cmd list>] [B<-l>]
B<xcattest> [B<-s> B<command>]
B<xcattest> [B<-s> B<bundle>]
=head1 DESCRIPTION
@ -28,11 +38,11 @@ Display usage message.
=item B<-f> I<configure file>
Specifies the configuration file, if not specified, the default configure file is /opt/xcat/share/xcat/tools/autotest/default.conf.
Specifies the configuration file with full-path. xCAT supports an example config file: /opt/xcat/share/xcat/tools/autotest/linux.conf.template
=item B<-b> I<case bundle list>
Comma separated list of test cases bundle files, each test cases bundle can contain multiple lines and each line for one test case name.
Comma separated list of test cases bundle files, each test cases bundle can contain multiple lines and each line for one test case name. The bundle files should be listed in: /opt/xcat/share/xcat/tools/autotest/bundle.
=item B<-t> I<cases list>
@ -46,6 +56,10 @@ Comma separated list of commands which will be tested, i.e., all the test cases
Display the test cases names specified by the flag -b, -t or -c.
=item B<-s>
Display the bundle files and command with value: bundle or command.
=back
=head1 RETURN VALUE
@ -86,21 +100,21 @@ B<Note>: Each test case can have more than one I<cmd> sections and each I<cmd> s
To run all test cases related command rpower:
xcattest -c /tmp/config -c rpower
xcattest -f /tmp/config -c rpower
=item 2.
To run customized bundle:
To run customized bundle with /tmp/config file:
xcattest -l > /tmp/custom.bundle
xcattest -c lsdef -l > /opt/xcat/share/xcat/tools/autotest/bundle/custom.bundle
Modify custom.bundle
xcattest -b custom.bundle
xcattest -f /tmp/config -b custom.bundle
=item 3.
To run specified test cases.
To run specified test cases with /tmp/config file:
xcattest -t lsdef_t_o_l_z
xcattest -f /tmp/config -t lsdef_t_o_l_z
=item 4.

View File

@ -17,7 +17,7 @@ use lib "$::XCATROOT/lib/perl";
my $rootdir = "$::XCATROOT/share/xcat/tools/autotest";
my $needhelp = 0;
my $configinfo = undef;
my $configfile = "$rootdir/default.conf";
my $configfile = undef;
my $casedir = "$rootdir/testcase";
my $bundledir = "$rootdir/bundle";
my $resultdir = "$rootdir/result";
@ -768,7 +768,6 @@ sub loadcase
if ($needshow) {
if (@cases) {
log_this("Test cases:");
foreach my $case (@cases) {
log_this("$case->{name}");
}
@ -1063,9 +1062,10 @@ sub usage
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 [-f configure file] [-b case bundle files] [-l]");
log_this(" xcattest [-f configure file] [-t cases list] [-l]");
log_this(" xcattest [-f configure file] [-c cmds list] [-l]");
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;
@ -1111,7 +1111,7 @@ sub listbundlefiles
}
close(FILE);
if (!$skip){
$bundlefilesinfo{$bundlefile} = "No description, add \"description: details\" in this bundle file";
$bundlefilesinfo{$bundlefile} = "No description, add with \"description: details\" in bundle file";
}
}
&listformatbundleinfo(%bundlefilesinfo);
@ -1132,8 +1132,8 @@ sub listformatbundleinfo
my $finallen = ($screenwidth > $desiredwidth ? $desiredwidth : $screenwidth);
print "bundle files and descriptions:\n";
foreach my $filename (keys %bundlefilesinfo) {
foreach my $filename (sort { $a cmp $b } keys %bundlefilesinfo ) {
my @desc = split(" ", $bundlefilesinfo{$filename});
my $str = "";
my @formatdesc = ();
@ -1242,8 +1242,13 @@ sub checkoptions
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
#-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) {
@ -1251,7 +1256,7 @@ sub checkoptions
return 1;
}
#check the L option, it only should be bundle or command
#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");
@ -1262,10 +1267,11 @@ sub checkoptions
}
$showcommandslist= 1;
}
#get and check config file and System label
#this System label means only the [System] variable will be loaded
if ($configinfo) {
if ($configinfo =~ /(.*):(.*)/) {
if (defined($configinfo)) {
if ($configinfo =~ /(.*):(.*)/) {
$configfile = $1;
$initallabel = $2;
if ($initallabel ne $loadsysteminfo) {
@ -1275,11 +1281,10 @@ sub checkoptions
}else {
$configfile = $configinfo;
}
}
if (!(-e $configfile)) {
log_this("Error: Can't open config file: $configfile");
return 1;
if (!(-e $configfile)) {
log_this("Error: Can't open config file: $configfile");
return 1;
}
}
#check bundle files
@ -1288,12 +1293,12 @@ sub checkoptions
foreach my $bundle (@bundles){
if ("$bundledir/$bundle" !~ /\.bundle$/) {
log_this("Error: please input the .bundle file");
log_this("Use 'xcattest -s bundle' to list out available bundles");
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 -b bundle' to list out available bundles");
log_this("Use 'xcattest -s bundle' to list all bundle files");
return 1;
}
}

View File

@ -715,7 +715,7 @@ while [ $op_index -le $OTHERPKGS_INDEX ]; do
fi
if [ $hasyum -eq 1 ]; then
#use yum
result=`yum list $fn 2>&1`
result=`yum --showduplicates list $fn 2>&1`
if [ $? -eq 0 ]; then
rc=0
array_set_element repo_path $index $path

View File

@ -43,7 +43,7 @@ while true; do
if [ $RETRY -eq 90 ];then
#timeout, complain and exit
msgutil_r "$MASTER_IP" "err" `date`" xcatinstallpost: Network not configured, please check..." "/var/log/xcat/xcat.log"
msgutil_r "$MASTER_IP" "err" "`date`: xcatinstallpost: Network not configured, please check..." "/var/log/xcat/xcat.log"
exit 1
fi