2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2026-05-15 02:44:17 +00:00

Merge pull request #2789 from xcat2/master

Merge master to 2.13 branch for 2.13.3 release.(1)
This commit is contained in:
zet809
2017-03-31 10:03:29 +08:00
committed by GitHub
154 changed files with 4467 additions and 768 deletions
+3
View File
@@ -2,3 +2,6 @@
docs/build
# Ignore the temporary file for creating the Release version
Release.save*
# ignore the old generated man pages and html pages
xCAT-client/share/man
xCAT-client/share/doc
+6 -1
View File
@@ -8,7 +8,7 @@ Documentation
xCAT documentation is available at: http://xcat-docs.readthedocs.io/en/latest/
|docs_latest| |docs_2131| |docs_2130| |docs_212| |docs_211|
|docs_latest| |docs_2132| |docs_2131| |docs_2130| |docs_212| |docs_211|
Open Source License
-------------------
@@ -22,6 +22,11 @@ Developers
Developers and prospective contributors are encouraged to read the `Developers Guide <http://xcat-docs.readthedocs.io/en/latest/developers/>`_
In particular the `GitHub <http://xcat-docs.readthedocs.io/en/latest/developers/github/>`_ related subsection.
.. |docs_2132| image:: https://readthedocs.org/projects/xcat-docs/badge/?version=2.13.2
:alt: 2.13.2 documentation status
:scale: 100%
:target: http://xcat-docs.readthedocs.io/en/2.13.2/
.. |docs_2131| image:: https://readthedocs.org/projects/xcat-docs/badge/?version=2.13.1
:alt: 2.13.1 documentation status
:scale: 100%
+1 -1
View File
@@ -1 +1 @@
2.13.2
2.13.3
@@ -5,3 +5,4 @@ Compute Node
:maxdepth: 2
changing_hostname_ip.rst
replace/index.rst
@@ -0,0 +1,7 @@
Replacing Nodes
===============
.. toctree::
:maxdepth: 2
openpower.rst
@@ -0,0 +1,38 @@
OpenPower Nodes
===============
When compute nodes are physically replaced in the frame, leverage xCAT to re-discover the compute nodes. The following guide can be used for:
* IBM OpenPower S822LC for HPC
#. Identify the machine(s) to be replaced: ``frame10cn02``.
#. [**Optional**] It's recommended to set the BMC IP address back to DHCP, if it was set to STATIC. ::
rspconfig frame10cn02 ip=dhcp
#. Set the outgoing machine to ``offline`` and remove attributes of the machine: ::
nodeset frame10cn02 offline
chdef frame10cn02 mac=""
#. If using **MTMS**-based discovery, fill in the Model-Type and Serial Number for the machine: ::
chdef frame10cn02 mtm=8335-GTB serial=<NEW SERIAL NUMBER>
#. If using **SWITCH**-based discovery, go on to the next step. The ``switch`` and ``switch-port`` should already be set in the compute node definition.
Node attributes will be replaced during the discovery process (mtm, serial, mac, etc.)
#. Search for the new BMC in the open range: ::
bmcdiscover --range <IP open range> -w -z
#. When the BMC is found, start the discovery with the following commands: ::
rsetboot /node-8335.* net
rpower /node-8335.* boot
@@ -28,6 +28,11 @@ The following table illustrates the cluster being used in this example:
| | r2n10 |
+----------------------+----------------------+
#. Modify ``site`` table attribute to include **service** group's postscripts in compute node definition: ::
chdef -t site hierarchicalattrs="postscripts"
#. Select the compute nodes that will become service nodes
The first node in each rack, ``r1n01`` and ``r2n01``, is selected to become the xCAT service nodes and manage the compute nodes in that rack
@@ -9,7 +9,7 @@ Any cluster using statelite compute nodes must use a stateful (diskful) Service
**Note:** All xCAT Service Nodes must be at the exact same xCAT version as the xCAT Management Node.
Configure ``otherpkgdir`` and ``otherpkglist`` for service node osimage
----------------------------------------------------------------------
-----------------------------------------------------------------------
* Create a subdirectory ``xcat`` under a path specified by ``otherpkgdir`` attribute of the service node os image, selected during the :doc:`../define_service_nodes` step.
@@ -16,11 +16,12 @@ There may be occasions where a re-install of the OS is required. Assuming the
* **[use xCAT]** ``xdsh`` can be used to invoke the reinstall of the OS: ::
# to clear out all the previous configuration, use the -k option (optional)
xdsh <switch> "/usr/cumulus/bin/onie-select -k
# to invoke the reinstall of the OS
xdsh <switch> "/usr/cumulus/bin/onie-select -i -f;reboot"
# to clear out all the previous configuration, use the -k option
xdsh <switch> "/usr/cumulus/bin/onie-select -k -f;reboot"
* **[manually]** Log into the Cumulus OS switch and run the following commands: ::
sudo onie-select -i
+23 -1
View File
@@ -63,6 +63,12 @@ The following commands are supported against a compute node:
cn01: f5pdu3 outlet 6 is on
cn01: f5pdu3 outlet 7 is on
* Power cycling the PDU outlets on a compute node: ::
# rpower cn01 pdureset
cn01: f5pdu3 outlet 6 is reset
cn01: f5pdu3 outlet 7 is reset
The following commands are supported against a PDU:
* Check the status of the full PDU: ::
@@ -98,7 +104,7 @@ The following commands are supported against a PDU:
f5pdu3: outlet 12 is off
* Power on the full PDU: ::
# rpower f5pdu3 on
f5pdu3: outlet 1 is on
f5pdu3: outlet 2 is on
@@ -112,6 +118,22 @@ The following commands are supported against a PDU:
f5pdu3: outlet 10 is on
f5pdu3: outlet 11 is on
f5pdu3: outlet 12 is on
* Power reset the full PDU: ::
# rpower f5pdu3 reset
f5pdu3: outlet 1 is reset
f5pdu3: outlet 2 is reset
f5pdu3: outlet 3 is reset
f5pdu3: outlet 4 is reset
f5pdu3: outlet 5 is reset
f5pdu3: outlet 6 is reset
f5pdu3: outlet 7 is reset
f5pdu3: outlet 8 is reset
f5pdu3: outlet 9 is reset
f5pdu3: outlet 10 is reset
f5pdu3: outlet 11 is reset
f5pdu3: outlet 12 is reset
**Note:** For BMC based compute nodes, turning the PDU outlet power on does not automatically power on the compute side. Users will need to issue ``rpower <node> on`` to power on the compute node after the BMC boots.
+63
View File
@@ -0,0 +1,63 @@
The SSL Certificates in xCAT
----------------------------
The xCAT daemon on the management node and service node listens on a SSL socket on port 3001, the communications on the SSL socket include:
1. the xCAT requests from xCAT Clients
2. the xCAT requests forwarded from other xCAT daemons, for example, the requests forwarded between xCAT daemons on management node and service nodes
3. some special xCAT requests from compute nodes, such as ``getcredentials``, ``getpostscript``, ``litefile``, etc.
xCAT creates 1 CA certificate and 2 credentials (private key and certificate pairs):
1. xCAT CA certificate(ca.pem):
* a self-signed certificate used as Certificate Authority in xcatd SSL communication;
* generated by ``/opt/xcat/share/xcat/scripts/setup-xcat-ca.sh`` script on xCAT installation;
* will be generated (or updated) on xCAT management node when:
* install or update xCAT when "/etc/xcat/ca" directory does not exist
* or run ``xcatconfig -f|--force``
* or run ``xcatconfig -c|--credentials``
* files on management node:
* ``/etc/xcat/ca/ca-cert.pem``
* ``/etc/xcat/cert/ca.pem`` ,copied by ``/opt/xcat/share/xcat/scripts/setup-server-cert.sh``
* ``/root/.xcat/ca.pem`` ,copied by ``/opt/xcat/share/xcat/scripts/setup-local-client.sh``
* file on service node: ``/root/.xcat/ca.pem``
* distribution path:
**/etc/xcat/cert/ca.pem (MN)** ===(run ``xcatconfig`` command)===> **/install/postscripts/_xcat/ca.pem (MN)** ===(node provision/updatenode)==> **/xcatpost/_xcat/ca.pem (SN and CN)** ==(run "servicenode" postscript)==> **/root/.xcat/ca.pem (SN)**
2. xCAT server credential(server-cred.pem):
* a concatenation of server private key and certificate(signed with xCAT CA certificate)
* generated by ``/opt/xcat/share/xcat/scripts/setup-server-cert.sh`` on xCAT installation;
* will be generated (or updated) on xCAT management node when:
* install or update xCAT when ``/etc/xcat/cert`` directory does not exist
* or run ``xcatconfig -f|--force``
* or run ``xcatconfig -c|--credentials``
* file on management node: ``/etc/xcat/cert/server-cred.pem``
* file on service node: ``/etc/xcat/cert/server-cred.pem``
* distribution path:
**/etc/xcat/cert/server-cred.pem (MN)** ==(run ``xcatserver`` script called by ``servicenode`` postscript)===> **/etc/xcat/cert/server-cred.pem(SN)**
3. xCAT client credential(client-cred.pem):
* a concatenation of client private key and certificate (signed with xCAT CA certificate)
* generated by ``/opt/xcat/share/xcat/scripts/setup-local-client.sh`` on xCAT installation
* will be generated (or updated) on xCAT management node when:
* install or update xCAT when ``/root/.xcat/client-key.pem`` does not exist;
* or run ``xcatconfig -f|--force``
* or run ``xcatconfig -c|--credentials``
* file on management node: ``/root/.xcat/client-cred.pem``
* file on service node: ``/root/.xcat/client-cred.pem``
* distribution path:
**/root/.xcat/client-cred.pem (MN)** ===(run ``xcatclient`` script called by ``servicenode`` postscript")===> **/root/.xcat/client-cred.pem(SN)**
The usage of the credentials in the xCAT SSL communication is:
.. image:: ./imgs/certs.png
:height: 500 px
:width: 600 px
:scale: 100 %
:alt: alternate text
:align: center
Binary file not shown.

After

Width:  |  Height:  |  Size: 218 KiB

+15 -27
View File
@@ -4,52 +4,40 @@ Transmission Channel
The xCAT daemon uses SSL to only allow authorized users to run xCAT commands. All xCAT commands are initiated as an xCAT **client**, even when run commands from the xCAT management node. This **client** opens an SSL socket to the xCAT daemon, sends the command and receives responses through this one socket. xCAT has configured the certificate for root, if you nee to authorize other users, refer to the section below.
Create SSL Certificate So That User Can Be Authenticated By xCAT
````````````````````````````````````````````````````````````````
Running the following command on the Management node as root: ::
/opt/xcat/share/xcat/scripts/setup-local-client.sh <username>
By running this command you'll see SSL certificates are creating, enter ``yes`` where prompted and take the defaults.
This will create the following files in the <username> 's ``$HOME/.xcat`` directory: ::
ca.pem
client-cert.pem
client-cred.pem
client-key.pem
client-req.pem
.. toctree::
:maxdepth: 2
certs.rst
Commands Access Control
-----------------------
Except SSL channel, xCAT only authorize root on the management node to run **xCAT** commands by default. But xCAT can be configured to allow both **non-root users** and **remote users** to run limited xCAT commands. For remote users, we mean the users who triggers the xCAT commands from other nodes and not have to login to the management node. xCAT uses the **policy** table to control who has authority to run specific xCAT commands. For a full explanation of the **policy** table, refer to :doc:`policy </guides/admin-guides/references/man5/policy.5>` man page.
.. _granting_xcat_privileges:
Granting Users xCAT Privileges
``````````````````````````````
To give a non-root user all xCAT commands privileges, run ``tabedit policy`` and add a line: ::
To give a non-root user all xCAT command privileges, run ``tabedit policy`` and add a line: ::
"6","<username>",,,,,,"allow",,
Where <username> is the name of the user that you are granting privileges to. In the above case, this user can now perform all xCAT commands, including changing the ``policy`` table to grant right to other users, so this should be used with caution.
Where <username> is the name of the user that you are granting privileges to. This user can now perform all xCAT commands, including changing the ``policy`` table to grant rights to other users, so this should be used with caution.
You may only want to grant users limited access. One example is that one user may only be allowed to run ``nodels``. This can be done as follows: ::
To grant a user ability to run ``nodels`` command: ::
"6","<username>",,"nodels",,,,"allow",,
If you want to grant all users the ability to run nodels, add this line: ::
To grant all users the ability to run ``nodels``: ::
"6.1","*",,"nodels",,,,"allow",,
You also can do this by running: ::
CLI can also be used: ::
chdef -t policy -o 6.1 name=* commands=nodels rule=allow
**Note** Make sure the directories that contain the xCAT commands are in the user's ``$PATH``. If not, add them to ``$PATH`` as appropriate way in your system. ::
**Note** Make sure the directories that contain the xCAT commands are in the user's ``$PATH``. If not, add them to ``$PATH`` as appropriate in your system. ::
echo $PATH | grep xcat
/opt/xcat/bin:/opt/xcat/sbin: .......
@@ -57,18 +45,18 @@ You also can do this by running: ::
Extra Setup for Remote Commands
```````````````````````````````
To give a user the ability to run remote commands (xdsh, xdcp, psh, pcp) in some node, except above steps, also need to run below steps: ::
To give a user the ability to run remote commands (``xdsh``, ``xdcp``, ``psh``, ``pcp``) in some node, in addition to above steps, also need to run below steps: ::
su - <username>
xdsh <noderange> -K
This will setup the user and root ssh keys for the user under the ``$HOME/.ssh`` directory of the user on the nodes. The root ssh keys are needed for the user to run the xCAT commands under the xcatd daemon, where the user will be running as root. **Note**: the uid for the user should match the uid on the management node and a password for the user must have been set on the nodes.
This will setup the user and root ssh keys for the user under the ``$HOME/.ssh`` directory of the user on the nodes. The root ssh keys are needed for the user to run the xCAT commands under the xcatd daemon, where the user will be running as root. **Note**: the uid and the password for the user on the management node, should match the uid and password on the managed nodes.
Set Up Login Node (Remote Client)
`````````````````````````````````
In some cases, you don't want your **non-root** user login to management node but still can run some xCAT commands. This time, you need setup a login node(i.e. remote client) for these users.
In some cases, you don't want your **non-root** user login to management node but still can run some xCAT commands. This time, you need setup a login node (i.e. remote client) for these users.
Below are the steps of how to set up a login node.
@@ -78,9 +66,9 @@ Below are the steps of how to set up a login node.
* :doc:`Configure xCAT Software Repository in RHEL</guides/install-guides/yum/configure_xcat>`
* `Configure the Base OS Repository in SUSE <http://xcat-docs.readthedocs.org/en/latest/guides/install-guides/zypper/prepare_mgmt_node.html#configure-the-base-os-repository>`_
* :ref:`Configure the Base OS Repository in SUSE <zypper_configure_the_base_os_repository>`
* `Configure the Base OS Repository in Ubuntu <http://xcat-docs.readthedocs.org/en/latest/guides/install-guides/apt/prepare_mgmt_node.html#configure-the-base-os-repository>`_
* :ref:`Configure the Base OS Repository in Ubuntu <apt_configure_the_base_os_repository>`
Then install ``xCAT-client``.
@@ -1,121 +1,10 @@
Advanced Networking Configuration
=================================
The ``confignetwork`` postscript can be used to configure the network interfaces on the compute nodes to support VLAN, BONDs, and BRIDGES. In order to use the ``confignetwork`` postscript, the following attributes must be configured for the node in the ``nics`` table:
* ``nicips``
* ``nictypes``
* ``nicnetworks``
* ``nicdevices`` - resolves the relationship among the physical network intereface devices
The following example set the xCAT properties for compute node ``cn1`` to achieve the following network configuration using the ``confignetwork`` postscript:
* Compute node ``cn1`` has two physical NICs: eth2 and eth3
* Bond eth2 and eth3 as ``bond0``
* From ``bond0``, create 2 VLANs: ``bond0.1`` and ``bond0.2``
* Make bridge ``br1`` using ``bond0.1`` with IP (10.0.0.1)
* Make bridge ``br2`` using ``bond0.2`` with IP (20.0.0.1)
Define attributes in the ``nics`` table
---------------------------------------
#. Using the ``mkdef`` or ``chdef`` commands
a. Compute node ``cn1`` has two physical NICs: ``eth2`` and ``eth3`` ::
chdef cn1 nictypes.eth2=ethernet nictypes.eth3=ethernet
b. Define ``bond0`` and bond ``eth2`` and ``eth3`` as ``bond0`` ::
chdef cn1 nictypes.bond0=bond \
nicdevices.bond0="eth2|eth3"
c. Fom ``bond0``, create 2 VLANs: ``bond0.1`` and ``bond0.2`` ::
chdef cn1 nictypes.bond0.1=vlan \
nictypes.bond0.2=vlan \
nicdevices.bond0.1=bond0 \
nicdevices.bond0.2=bond0
d. Create bridge ``br1`` using ``bond0.1`` with IP (10.0.0.1) ::
chdef cn1 nictypes.br1=bridge \
nicdevices.br1=bond0.1 \
nicips.br1=10.0.0.1 \
nicnetworks.br1="net10"
e. Create bridge ``br2`` using ``bond0.2`` with IP (20.0.0.1) ::
chdef cn1 nictypes.br2=bridge \
nicdevices.br2=bond0.2 \
nicips.br2=20.0.0.1 \
nicnetworks.br2="net20"
#. Using an xCAT stanza file
- Prepare a stanza file ``<filename>.stanza`` with content similiar to the following: ::
# <xCAT data object stanza file>
cn1:
objtype=node
arch=x86_64
groups=kvm,vm,all
nicdevices.br1=bond0.1
nicdevices.br2=bond0.2
nicdevices.bond0.1=bond0
nicdevices.bond0.2=bond0
nicdevices.bond0=eth2|eth3
nictypes.eth2=ethernet
nictypes.eth3=ethernet
nictypes.bond0=bond
nictypes.bond0.1=vlan
nictypes.bond0.2=vlan
nictypes.br1=bridge
nictypes.br2=bridge
nicips.br1=10.0.0.1
nicips.br2=20.0.0.1
nicnetworks.br1=net10
nicnetworks.br2=net20
- Using the ``mkdef -z`` option, define the stanza file to xCAT: ::
cat <filename>.stanza | mkdef -z
#. Using ``tabedit`` to edit the ``nics`` database table directly
The ``tabedit`` command opens the specified xCAT database table in a ``vi`` like editor and allows the user to edit any text and write the changes back to the database table.
After changing the content of the ``nics`` table, here is the result from ``tabdump nics`` ::
# tabdump nics
#node,nicips,nichostnamesuffixes,nichostnameprefixes,nictypes,niccustomscripts,nicnetworks,nicaliases,nicextraparams,nicdevices,comments,disable
"cn1","br1!10.0.0.1,br2!20.0.0.1",,,"br1!bridge,eth2!ethernet,eth3!ethernet,bond0.2!vlan,bond0!bond,br2!bridge,bond0.1!vlan",,"br1!net10,br2!net20",,,"br1!bond0.1,bond0!eth2|eth3,bond0.2!bond0,bond0.1!bond0,br2!bond0.2",,
Add network object into the networks table
------------------------------------------
The ``nicnetworks`` attribute only defines the nic that uses the IP address.
Other information about the network should be defined in the ``networks`` table.
Use the ``chdef`` command to add/modify the networks in the ``networks`` table ::
chdef -t network net10 net=10.0.0.0 mask=255.0.0.0 mgtifname=eth0
chdef -t network net20 net=20.0.0.0 mask=255.0.0.0 mgtifname=eth1
Add ``confignetwork`` into the node's postscripts list
------------------------------------------------------
Using below command to add ``confignetwork`` into the node's postscripts list ::
chdef cn1 -p postscripts=confignetwork
During OS deployment on compute node, ``confignetwork`` will be run in postscript.
If the compute node has OS, use ``updatenode`` command to run ``confignetwork`` ::
updatenode cn1 -P confignetwork
Advanced Networking Configuration - confignetwork
=================================================
**Note:** ``confignetwork`` postscript is only supported on RHEL releases.
.. toctree::
:maxdepth: 2
.. include:: ../../../common/deployment/cfg_network_vlan.rst
.. include:: ../../../common/deployment/cfg_network_bond.rst
@@ -0,0 +1,58 @@
Configure Two Bonded Adapters
-----------------------------
The following example set the xCAT properties for compute node ``cn1`` to create:
* Compute node ``cn1`` has two physical NICs: eth2 and eth3
* Bond eth2 and eth3 as ``bond0``
* Assign ip ``40.0.0.1`` to the bonded interface ``bond0``
Define attributes in the ``nics`` table
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#. Using the ``mkdef`` or ``chdef`` commands
a. Compute node ``cn1`` has two physical NICs: ``eth2`` and ``eth3`` ::
chdef cn1 nictypes.eth2=ethernet nictypes.eth3=ethernet
b. Define ``bond0`` and bond ``eth2`` and ``eth3`` as ``bond0`` ::
chdef cn1 nictypes.bond0=bond nicdevices.bond0="eth2|eth3"
chdef cn1 nicips.bond0=40.0.0.1
Add network object into the networks table
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Use the ``chdef`` command to add/modify the networks in the ``networks`` table ::
chdef -t network net40 net=40.0.0.0 mask=255.0.0.0
chdef cn1 nicnetworks.bond0=net40
Add ``confignetwork`` into the node's postscripts list
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Use command below to add ``confignetwork`` into the node's postscripts list ::
chdef cn1 -p postscripts=confignetwork
During OS deployment on compute node, ``confignetwork`` postscript will be executed.
If the compute node is already running, use ``updatenode`` command to run ``confignetwork`` postscript without rebooting the node::
updatenode cn1 -P confignetwork
Verify bonding mode
~~~~~~~~~~~~~~~~~~~
Login to compute node cn1 and check bonding options in ``/etc/sysconfig/network-scripts/ifcfg-bond0`` file ::
BONDING_OPTS="mode=802.3ad xmit_hash_policy=layer2+3"
* ``mode=802.3ad`` requires additional configuration on the switch.
* ``mode=2`` can be used for bonding without additional switch configuration.
If changes are made to ``/etc/sysconfig/network-scripts/ifcfg-bond0`` file, restart network service.
@@ -0,0 +1,109 @@
Configure BOND, VLAN and BRIDGES
--------------------------------
The ``confignetwork`` postscript can be used to configure the network interfaces on the compute nodes to support VLAN, BONDs, and BRIDGES. In order for the ``confignetwork`` postscript to run successfully, the following attributes must be configured for the node in the ``nics`` table:
* ``nicips``
* ``nictypes``
* ``nicnetworks``
* ``nicdevices`` - resolves the relationship among the physical network interface devices
The following example set the xCAT properties for compute node ``cn1`` to achieve the following network configuration using the ``confignetwork`` postscript:
* Compute node ``cn1`` has two physical NICs: ``eth2`` and ``eth3``
* Bond ``eth2`` and ``eth3`` as ``bond0``
* From ``bond0``, create 2 VLANs: ``bond0.1`` and ``bond0.2``
* Make bridge ``br1`` using ``bond0.1`` with IP (10.0.0.1)
* Make bridge ``br2`` using ``bond0.2`` with IP (20.0.0.1)
Define attributes in the ``nics`` table
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Chose one of two methods described below:
#. Using the ``mkdef`` or ``chdef`` commands
a. Compute node ``cn1`` has two physical NICs: ``eth2`` and ``eth3`` ::
chdef cn1 nictypes.eth2=ethernet nictypes.eth3=ethernet
b. Define ``bond0`` and bond ``eth2`` and ``eth3`` as ``bond0`` ::
chdef cn1 nictypes.bond0=bond \
nicdevices.bond0="eth2|eth3"
c. From ``bond0``, create 2 VLANs: ``bond0.1`` and ``bond0.2`` ::
chdef cn1 nictypes.bond0.1=vlan \
nictypes.bond0.2=vlan \
nicdevices.bond0.1=bond0 \
nicdevices.bond0.2=bond0
d. Create bridge ``br1`` using ``bond0.1`` with IP (10.0.0.1) ::
chdef cn1 nictypes.br1=bridge \
nicdevices.br1=bond0.1 \
nicips.br1=10.0.0.1 \
nicnetworks.br1="net10"
e. Create bridge ``br2`` using ``bond0.2`` with IP (20.0.0.1) ::
chdef cn1 nictypes.br2=bridge \
nicdevices.br2=bond0.2 \
nicips.br2=20.0.0.1 \
nicnetworks.br2="net20"
#. Using an xCAT stanza file
- Prepare a stanza file ``<filename>.stanza`` with content similiar to the following: ::
# <xCAT data object stanza file>
cn1:
objtype=node
arch=x86_64
groups=kvm,vm,all
nicdevices.br1=bond0.1
nicdevices.br2=bond0.2
nicdevices.bond0.1=bond0
nicdevices.bond0.2=bond0
nicdevices.bond0=eth2|eth3
nictypes.eth2=ethernet
nictypes.eth3=ethernet
nictypes.bond0=bond
nictypes.bond0.1=vlan
nictypes.bond0.2=vlan
nictypes.br1=bridge
nictypes.br2=bridge
nicips.br1=10.0.0.1
nicips.br2=20.0.0.1
nicnetworks.br1=net10
nicnetworks.br2=net20
- Using the ``mkdef -z`` option, define the stanza file to xCAT: ::
cat <filename>.stanza | mkdef -z
Define the additional networks to xCAT
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If this is a new network being created on the compute nodes, an entry needs to be created into the xCAT database.
The ``nicnetworks`` attribute only defines the nic that uses the IP address.
Other information about the network should be defined in the ``networks`` table.
Use the ``chdef`` command to add/modify the networks in the ``networks`` table ::
chdef -t network net10 net=10.0.0.0 mask=255.0.0.0
chdef -t network net20 net=20.0.0.0 mask=255.0.0.0
Add ``confignetwork`` into the node's postscripts list
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Use the following command to add ``confignetwork`` into postscript list to execute on reboot: ::
chdef cn1 -p postscripts=confignetwork
If the compute node is already running, use ``updatenode`` command to run ``confignetwork`` postscript without rebooting the node::
updatenode cn1 -P confignetwork
@@ -1,5 +1,5 @@
Configure Additional Network Interfaces
=======================================
Configure Additional Network Interfaces - confignics
====================================================
The **nics** table and the **confignics** postscript can be used to automatically configure additional network interfaces (mutltiple ethernets adapters, InfiniBand, etc) on the nodes as they are being deployed.
@@ -47,7 +47,7 @@ There are 3 ways to complete this operation.
The ``tabedit`` command opens the specified xCAT database table in a vi like editor and allows the user to edit any text and write the changes back to the database table.
*WARNING* Using the ``tabedit`` command is not the recommended method because it is tedious and error prone.
*WARNING:* Using the ``tabedit`` command is not the recommended method because it is tedious and error prone.
After changing the content of the ``nics`` table, here is the result from ``tabdump nics`` ::
@@ -70,7 +70,7 @@ After you have defined the configuration information in any of the ways above, r
Add confignics into the node's postscripts list
-----------------------------------------------
Using below command to add confignics into the node's postscripts list ::
Use command below to add confignics into the node's postscripts list ::
chdef cn1 -p postscripts=confignics
@@ -78,7 +78,7 @@ By default, confignics does not configure the install nic. if need, using flag "
chdef cn1 -p prostscripts="confignics -s"
Option "-s" write the install nic's information into configuration file for persistance. All install nic's data defined in nics table will be written also.
Option "-s" writes the install nic's information into configuration file for persistance. All install nic's data defined in nics table will be written also.
Add network object into the networks table
@@ -103,6 +103,7 @@ Option -r to remove the undefined NICS
If the compute node's nics were configured by ``confignics`` and the nics configuration changed in the nics table, user the ``confignics -r`` to remove the undefined nic.
For example, if on a compute node the ``eth0``, ``eth1``, and ``eth2`` nics were configured: ::
# ifconfig
eth0 Link encap:Ethernet HWaddr 00:14:5e:d9:6c:e6
...
@@ -114,7 +115,7 @@ For example, if on a compute node the ``eth0``, ``eth1``, and ``eth2`` nics were
Delete the eth2 definition in nics table using the ``chdef`` command.
Then run the following to remove the undefined ``eth2`` nic on the compute node: ::
# updatenode <noderange> -P "confignics -r"
updatenode <noderange> -P "confignics -r"
The result should have ``eth2`` disabled: ::
@@ -25,11 +25,11 @@ Examples for xdsh
xdsh node1 -K
- To run the ps -ef command on node targets node1 and node2, enter: ::
- To run the ``ps -ef`` command on node targets node1 and node2, enter: ::
xdsh node1,node2 "ps -ef"
- To run the ps command on node targets node1 and run the remote command with the -v and -t flag, enter: ::
- To run the ``ps`` command on node targets node1 and run the remote command with the ``-v`` and ``-t`` flag, enter: ::
xdsh node1,node2 -o"-v -t" ps =item *
@@ -37,15 +37,15 @@ Examples for xdsh
xdsh node1,node2 -f 1 -e myfile
- To run the ps command on node1 and ignore all the dsh environment variable except the DSH_NODE_OPTS, enter: ::
- To run the ``ps`` command on node1 and ignore all the dsh environment variable except the DSH_NODE_OPTS, enter: ::
xdsh node1 -X `DSH_NODE_OPTS' ps
- To run on Linux, the xdsh command "dpkg | grep vim" on the node ubuntu diskless image, enter: ::
- To run on Linux, the ``xdsh`` command ``dpkg -l| grep vim`` on the node ubuntu diskless image, enter: ::
xdsh -i /install/netboot/ubuntu14.04.2/ppc64el/compute/rootimg "dpkg -l|grep vim"
- To run xdsh with the non-root userid "user1" that has been setup as an xCAT userid and with sudo on node1 and node2 to run as root, do the following, see xCAT doc on Granting_Users_xCAT_privileges: ::
- To run ``xdsh`` with the non-root userid "user1" that has been setup as an xCAT userid and with sudo on node1 and node2 to run as root, do the following, see :ref:`Granting users xCAT privileges <granting_xcat_privileges>`: ::
xdsh node1,node2 --sudo -l user1 "cat /etc/passwd"
@@ -70,7 +70,7 @@ Examples for xdcp
xdcp all /etc/hosts /etc/hosts
- To rsync the /etc/hosts file to your compute nodes:
- To ``rsync`` the /etc/hosts file to your compute nodes:
Create a rsync file /tmp/myrsync, with this line: ::
@@ -84,7 +84,7 @@ Examples for xdcp
xdcp compute -F /tmp/myrsync
- To rsync the /etc/file1 and file2 to your compute nodes and rename to filex and filey:
- To ``rsync`` the /etc/file1 and file2 to your compute nodes and rename to filex and filey:
Create a rsync file /tmp/myrsync, with these line: ::
@@ -96,7 +96,7 @@ Examples for xdcp
xdcp compute -F /tmp/myrsync to update the Compute Nodes
- To rsync files in the Linux image at /install/netboot/ubuntu14.04.2/ppc64el/compute/rootimg on the MN:
- To ``rsync`` files in the Linux image at /install/netboot/ubuntu14.04.2/ppc64el/compute/rootimg on the MN:
Create a rsync file /tmp/myrsync, with this line: ::
@@ -76,6 +76,7 @@ This is the minimal list of files needed, you can add additional files to the li
"ALL","/etc/ntp.conf","tmpfs",,
"ALL","/etc/ntp.conf.org","tmpfs",,
"ALL","/etc/resolv.conf","tmpfs",,
"ALL","/etc/hostname","tmpfs",,
"ALL","/etc/ssh/","tmpfs",,
"ALL","/etc/sysconfig/","tmpfs",,
"ALL","/etc/syslog-ng/","tmpfs",,
@@ -89,6 +90,8 @@ This is the minimal list of files needed, you can add additional files to the li
"ALL","/opt/xcat/","tmpfs",,
"ALL","/xcatpost/","tmpfs",,
"ALL","/root/.ssh/","tmpfs",,
"ALL","/etc/systemd/system/","tmpfs",,
"ALL","/etc/adjtime","tmpfs",,
litetree table
--------------
@@ -33,12 +33,11 @@ Traditionally, network interfaces in Linux are enumerated as eth[0123...], but t
\ **getadapter**\ use genesis to collect network adapters information, so that mean it need to restart the target node.
\ **getadapter**\ follows below scheme:
\ **getadapter**\ For each node within the <noderange>, follows below scheme:
If the target node is scaned for the first time, \ **getadapter**\ will trigger genesis to collect information then save the information at local.
If the target node has ever been scaned, i.e. this node has network device information in local, \ **getadapter**\ use the local information first.
If user doesn't want to use local information, can use \ **-f**\ option to force to trigger new round scan process.
if part nodes of \ *noderange*\ don't have network device information in local and the rest have, \ **getadapter**\ only trigger real scan process for these nodes which don't have local information, the nodes have network device information in local, \ **getadapter**\ still use the local information first.
If the target node is scaned for the first time, \ **getadapter**\ will trigger genesis to collect information then save the information at the \ **nicsadapter**\ column of nics table.
If the target node has ever been scaned, \ **getadapter**\ will use the information from nics table first.
If user hopes to scan the adapter information for the node but these information already exist, \ **-f**\ option can be used to start rescan process.
\ **getadapter**\ tries to collect more information for the target network device, but doesn't guarantee collect same much information for every network device.
@@ -25,7 +25,7 @@ DESCRIPTION
\ **pping**\ is a utility used to ping a list of nodes in parallel.
\ **pping**\ will return an unsorted list of nodes with a ping or noping status.
\ **pping**\ front-ends nmap or fping if available.
\ **pping**\ front-ends \ **nmap**\ or \ **fping**\ if available.
This command does not support the xcatd client/server communication. It must be run on the management node.
@@ -48,7 +48,7 @@ OPTIONS
\ **-f | -**\ **-use_fping**\
Use fping instead of nmap
Use \ **fping**\ instead of \ **nmap**\
@@ -22,7 +22,7 @@ SYNOPSIS
\ **rmdef**\ [\ **-h | -**\ **-help**\ ] [\ **-t**\ \ *object-types*\ ]
\ **rmdef**\ [\ **-V | -**\ **-verbose**\ ] [\ **-a | -**\ **-all**\ ] [\ **-t**\ \ *object-types*\ ] [\ **-o**\ \ *object-names*\ ]
[\ **-f | -**\ **-force**\ ] [\ *noderange*\ ]
[\ **-f | -**\ **-force**\ ] [\ **-C | -**\ **-cleanup**\ ] [\ *noderange*\ ]
***********
@@ -41,17 +41,26 @@ OPTIONS
\ **-a|-**\ **-all**\
Clear the whole xCAT database. A backup of the xCAT definitions should be saved before using this option. Once all the data is removed the xCAT daemon will no longer work. Most xCAT commands will fail.
In order to use xCAT commands again, you have two options. You can restore your database from your backup by switching to bypass mode, and running the restorexCATdb command.
You switch to bypass mode by setting the XCATBYPASS environmant variable. (ex. "export XCATBYPASS=yes")
A second option is to run xcatconfig -d. This will restore the initial setup of the database as when xCAT was initially installed.
You can then restart xcatd and run xCAT commands.
Clear the whole xCAT database. A backup of the xCAT definitions should be saved before using this option as the xCAT daemons will no longer work once cleared.
To restore:
1. \ **export XCATBYPASS=1**\ and run the \ **restorexCATdb**\ command.
or
2. Run \ **xcatconfig -d**\ which initializes the database the same as when xCAT was installed.
\ **-f|-**\ **-force**\
Use this with the all option as an extra indicator that ALL definitions are to be removed.
Use this with the \ **-**\ **-all**\ option as an extra indicator that ALL definitions are to be removed.
@@ -79,6 +88,12 @@ OPTIONS
\ **-C|-**\ **-cleanup**\
Perform additional cleanup by running \ **nodeset offline**\ on the objects specified in the \ *noderange*\ .
\ **-V|-**\ **-verbose**\
Verbose mode.
@@ -29,7 +29,14 @@ BMC (using IPMI) specific:
\ **rpower**\ \ *noderange*\ [\ **on | off | softoff | reset | boot | stat | state | status | wake | suspend**\ [\ **-w**\ \ *timeout*\ ] [\ **-o**\ ] [\ **-r**\ ]]
\ **rpower**\ \ *noderange*\ [\ **pduon | pduoff | pdustat**\ ]
\ **rpower**\ \ *noderange*\ [\ **pduon | pduoff | pdustat | pdureset**\ ]
OpenBMC specific:
=================
\ **rpower**\ \ *noderange*\ [\ **off | on | reset | boot | stat | state | status**\ ]
PPC (with IVM or HMC) specific:
@@ -108,7 +115,7 @@ pdu specific:
=============
\ **rpower**\ \ *noderange*\ [\ **stat | off | on**\ ]
\ **rpower**\ \ *noderange*\ [\ **stat | off | on | reset**\ ]
@@ -264,7 +264,7 @@ running commands, are terminated (SIGTERM).
xdsh will chroot (xcatchroot for AIX) to this path and run the xdsh command against the
install image. No other xdsh flags, environment variables apply with
this input. A noderange is not accepted. Only runs on the local host,
normally the Management Node. The command you run must not prompt for input, the prompt will not be returned to you, and it will appear that xdsh hangs.
normally the Management Node. The command you run must not prompt for input, the prompt will not be returned to you, and it will appear that \ **xdsh**\ hangs.
@@ -381,8 +381,8 @@ running commands, are terminated (SIGTERM).
displays an error and terminates execution for the remote
targets that failed to respond. If \ *timeout*\ is not specified,
\ **xdsh**\ waits indefinitely to continue processing output from
all remote targets. The exception is the -K flag which defaults
to 10 seconds.
all remote targets. The exception is the \ **-K**\ flag which defaults
to 10 seconds.
@@ -512,23 +512,28 @@ running commands, are terminated (SIGTERM).
If \ **DSH_REMOTE_PASSWORD**\ is set to the password of the
userid (usually root) that will ssh to the node, then when
you use the -K flag, you will not be prompted for a password.
you use the \ **-K**\ flag, you will not be prompted for a password.
\ **DSH_SYNTAX**\
Specifies the shell syntax to use on remote targets; \ **ksh**\ or
\ **csh**\ . If not specified, the \ **ksh**\ syntax is assumed. This
\ **csh**\ . If not specified, the \ **ksh**\ syntax is assumed. This
variable is overridden by the \ **-S**\ flag.
\ **DSH_TIMEOUT**\
Specifies the time, in seconds, to wait for output from
each remote target. This variable is overridden by the \ **-t**\
flag.
Specifies the time, in seconds, to wait for output from
each remote target. This variable is overridden by the \ **-t**\ flag.
\ **DSH_VERIFY**\
Verifies each target before executing any remote commands on the target. If a target is not responding, execution of remote commands for the target is canceled. This variable is overridden by the \ **-v**\ flag.
@@ -538,10 +543,10 @@ running commands, are terminated (SIGTERM).
**********************************
To provide backward compatibility for scripts written using dsh in
To provide backward compatibility for scripts written using \ **dsh**\ in
AIX and CSM, a tool has been provided \ **groupfiles4dsh**\ ,
which will build node group files from the
xCAT database that can be used by dsh. See \ **man groupfiles4dsh**\ .
xCAT database that can be used by \ **dsh**\ . See \ **man groupfiles4dsh**\ .
****************
@@ -567,7 +572,7 @@ userdefined.
*******************
The dsh command exit code is 0 if the command executed without errors and all remote shell commands finished with exit codes of 0. If internal dsh errors occur or the remote shell commands do not complete successfully, the dsh command exit value is greater than 0. The exit value is increased by 1 for each successive instance of an unsuccessful remote command execution. If the remotely issued command is run in the background, the exit code of the remotely issued command is 0.
The \ **xdsh**\ command exit code is 0 if the command executed without errors and all remote shell commands finished with exit codes of 0. If internal dsh errors occur or the remote shell commands do not complete successfully, the dsh command exit value is greater than 0. The exit value is increased by 1 for each successive instance of an unsuccessful remote command execution. If the remotely issued command is run in the background, the exit code of the remotely issued command is 0.
****************
@@ -663,7 +668,7 @@ on the service node fedora9 diskless image, enter:
To define the QLogic IB switch as a node and to set up the SSH keys for IB switch
\ **qswitch**\ with device configuration file
\ **/var/opt/xcat/IBSwitch/Qlogic/config**\ and user name \ **username**\ , Enter
\ **/var/opt/xcat/IBSwitch/Qlogic/config**\ and user name \ **username**\ , enter
.. code-block:: perl
@@ -675,7 +680,7 @@ on the service node fedora9 diskless image, enter:
10. To define the Management Node in the database so you can use xdsh, Enter
10. To define the Management Node in the database so you can use \ **xdsh**\ , enter
.. code-block:: perl
@@ -686,7 +691,7 @@ on the service node fedora9 diskless image, enter:
11. To define the Mellanox switch as a node and run a command to show the ssh keys.
\ **mswitch**\ with and user name \ **username**\ , Enter
\ **mswitch**\ with and user name \ **username**\ , enter
.. code-block:: perl
@@ -724,7 +729,7 @@ on the service node fedora9 diskless image, enter:
13.
To run xdsh with the non-root userid "user1" that has been setup as an xCAT userid and with sudo on node1 and node2 to run as root, do the following, see xCAT doc on Granting_Users_xCAT_privileges:
To run \ **xdsh**\ with the non-root userid "user1" that has been setup as an xCAT userid and with sudo on node1 and node2 to run as root, do the following, see xCAT doc on Granting_Users_xCAT_privileges:
.. code-block:: perl
@@ -50,7 +50,7 @@ nodehm Attributes:
\ **mgt**\
The method to use to do general hardware management of the node. This attribute is used as the default if power or getmac is not set. Valid values: ipmi, blade, hmc, ivm, fsp, bpa, kvm, esx, rhevm. See the power attribute for more details.
The method to use to do general hardware management of the node. This attribute is used as the default if power or getmac is not set. Valid values: openbmc, ipmi, blade, hmc, ivm, fsp, bpa, kvm, esx, rhevm. See the power attribute for more details.
@@ -0,0 +1,82 @@
#########
openbmc.5
#########
.. highlight:: perl
****
NAME
****
\ **openbmc**\ - a table in the xCAT database.
********
SYNOPSIS
********
\ **openbmc Attributes:**\ \ *node*\ , \ *bmc*\ , \ *username*\ , \ *password*\ , \ *comments*\ , \ *disable*\
***********
DESCRIPTION
***********
Setting for nodes that are controlled by an on-board OpenBmc.
*******************
openbmc Attributes:
*******************
\ **node**\
The node name or group name.
\ **bmc**\
The hostname of the BMC adapter.
\ **username**\
The BMC userid.
\ **password**\
The BMC password.
\ **comments**\
Any user-written notes.
\ **disable**\
Set to 'yes' or '1' to comment out this row.
********
SEE ALSO
********
\ **nodels(1)**\ , \ **chtab(8)**\ , \ **tabdump(8)**\ , \ **tabedit(8)**\
@@ -50,13 +50,13 @@ passwd Attributes:
\ **password**\
The default password for this type of component
The default password for this type of component. On Linux, a crypted form could be provided. Hashes starting with $1$, $5$ and $6$ (md5, sha256 and sha512 respectively) are supported.
\ **cryptmethod**\
Indicates the method that was used to encrypt the password attribute. On AIX systems, if a value is provided for this attribute it indicates that the password attribute is encrypted. If the cryptmethod value is not set it indicates the password is a simple string value. On Linux systems, the cryptmethod can be set to md5, sha256 or sha512. If not set, sha256 will be used as default.
Indicates the method to use to encrypt the password attribute. On AIX systems, if a value is provided for this attribute it indicates that the password attribute is encrypted. If the cryptmethod value is not set it indicates the password is a simple string value. On Linux systems, the cryptmethod can be set to md5, sha256 or sha512. If not set, sha256 will be used as default to encrypt plain-text passwords.
@@ -19,7 +19,7 @@ SYNOPSIS
********
\ **pdu Attributes:**\ \ *pdu*\ , \ *machinetype*\ , \ *modelnum*\ , \ *serialnum*\ , \ *outletCount*\ , \ *comments*\ , \ *disable*\
\ **pdu Attributes:**\ \ *node*\ , \ *nodetype*\ , \ *outlet*\ , \ *machinetype*\ , \ *modelnum*\ , \ *serialnum*\ , \ *comments*\ , \ *disable*\
***********
@@ -36,12 +36,24 @@ pdu Attributes:
\ **pdu**\
\ **node**\
The hostname/address of the pdu to which the settings apply
\ **nodetype**\
The node type should be pdu
\ **outlet**\
The pdu outlet count
\ **machinetype**\
The pdu machine type
@@ -60,16 +72,16 @@ pdu Attributes:
\ **outletCount**\
\ **comments**\
Any user-written notes.
\ **disable**\
Set to 'yes' or '1' to comment out this row.
@@ -288,6 +288,10 @@ osimage(7)|osimage.7
pdu(7)|pdu.7
policy(7)|policy.7
@@ -561,6 +565,12 @@ notification(5)|notification.5
openbmc(5)|openbmc.5
Setting for nodes that are controlled by an on-board OpenBmc.
osdistro(5)|osdistro.5
Information about all the OS distros in the xCAT cluster
@@ -19,7 +19,7 @@ SYNOPSIS
********
\ **group Attributes:**\ \ *addkcmdline*\ , \ *arch*\ , \ *authdomain*\ , \ *bmc*\ , \ *bmcpassword*\ , \ *bmcport*\ , \ *bmcusername*\ , \ *bmcvlantag*\ , \ *cfgmgr*\ , \ *cfgmgtroles*\ , \ *cfgserver*\ , \ *chain*\ , \ *chassis*\ , \ *cmdmapping*\ , \ *cons*\ , \ *conserver*\ , \ *consoleondemand*\ , \ *cpucount*\ , \ *cputype*\ , \ *currchain*\ , \ *currstate*\ , \ *dhcpinterfaces*\ , \ *disksize*\ , \ *displayname*\ , \ *dockercpus*\ , \ *dockerflag*\ , \ *dockerhost*\ , \ *dockermemory*\ , \ *dockernics*\ , \ *domainadminpassword*\ , \ *domainadminuser*\ , \ *domaintype*\ , \ *getmac*\ , \ *groupname*\ , \ *grouptype*\ , \ *hcp*\ , \ *height*\ , \ *hostcluster*\ , \ *hostinterface*\ , \ *hostmanager*\ , \ *hostnames*\ , \ *hosttype*\ , \ *hwtype*\ , \ *id*\ , \ *initrd*\ , \ *installnic*\ , \ *interface*\ , \ *ip*\ , \ *iscsipassword*\ , \ *iscsiserver*\ , \ *iscsitarget*\ , \ *iscsiuserid*\ , \ *kcmdline*\ , \ *kernel*\ , \ *linkports*\ , \ *mac*\ , \ *machinetype*\ , \ *membergroups*\ , \ *members*\ , \ *memory*\ , \ *mgt*\ , \ *micbridge*\ , \ *michost*\ , \ *micid*\ , \ *miconboot*\ , \ *micpowermgt*\ , \ *micvlog*\ , \ *migrationdest*\ , \ *modelnum*\ , \ *monserver*\ , \ *mpa*\ , \ *mtm*\ , \ *nameservers*\ , \ *netboot*\ , \ *nfsdir*\ , \ *nfsserver*\ , \ *nicaliases*\ , \ *niccustomscripts*\ , \ *nicdevices*\ , \ *nicextraparams*\ , \ *nichostnameprefixes*\ , \ *nichostnamesuffixes*\ , \ *nicips*\ , \ *nicnetworks*\ , \ *nicsadapter*\ , \ *nictypes*\ , \ *nimserver*\ , \ *nodetype*\ , \ *ondiscover*\ , \ *os*\ , \ *osvolume*\ , \ *otherinterfaces*\ , \ *ou*\ , \ *outletcount*\ , \ *parent*\ , \ *passwd.HMC*\ , \ *passwd.admin*\ , \ *passwd.celogin*\ , \ *passwd.general*\ , \ *passwd.hscroot*\ , \ *password*\ , \ *pdu*\ , \ *postbootscripts*\ , \ *postscripts*\ , \ *power*\ , \ *pprofile*\ , \ *prescripts-begin*\ , \ *prescripts-end*\ , \ *primarynic*\ , \ *productkey*\ , \ *profile*\ , \ *protocol*\ , \ *provmethod*\ , \ *rack*\ , \ *room*\ , \ *routenames*\ , \ *serial*\ , \ *serialflow*\ , \ *serialnum*\ , \ *serialport*\ , \ *serialspeed*\ , \ *servicenode*\ , \ *setupconserver*\ , \ *setupdhcp*\ , \ *setupftp*\ , \ *setupipforward*\ , \ *setupldap*\ , \ *setupnameserver*\ , \ *setupnfs*\ , \ *setupnim*\ , \ *setupntp*\ , \ *setupproxydhcp*\ , \ *setuptftp*\ , \ *sfp*\ , \ *side*\ , \ *slot*\ , \ *slotid*\ , \ *slots*\ , \ *snmpauth*\ , \ *snmppassword*\ , \ *snmpprivacy*\ , \ *snmpusername*\ , \ *snmpversion*\ , \ *storagcontroller*\ , \ *storagetype*\ , \ *supernode*\ , \ *supportedarchs*\ , \ *supportproxydhcp*\ , \ *switch*\ , \ *switchinterface*\ , \ *switchport*\ , \ *switchtype*\ , \ *switchvlan*\ , \ *syslog*\ , \ *termport*\ , \ *termserver*\ , \ *tftpdir*\ , \ *tftpserver*\ , \ *unit*\ , \ *urlpath*\ , \ *usercomment*\ , \ *userid*\ , \ *username*\ , \ *vmbeacon*\ , \ *vmbootorder*\ , \ *vmcfgstore*\ , \ *vmcluster*\ , \ *vmcpus*\ , \ *vmhost*\ , \ *vmmanager*\ , \ *vmmaster*\ , \ *vmmemory*\ , \ *vmnicnicmodel*\ , \ *vmnics*\ , \ *vmothersetting*\ , \ *vmphyslots*\ , \ *vmstorage*\ , \ *vmstoragecache*\ , \ *vmstorageformat*\ , \ *vmstoragemodel*\ , \ *vmtextconsole*\ , \ *vmvirtflags*\ , \ *vmvncport*\ , \ *webport*\ , \ *wherevals*\ , \ *xcatmaster*\
\ **group Attributes:**\ \ *addkcmdline*\ , \ *arch*\ , \ *authdomain*\ , \ *bmc*\ , \ *bmcpassword*\ , \ *bmcport*\ , \ *bmcusername*\ , \ *bmcvlantag*\ , \ *cfgmgr*\ , \ *cfgmgtroles*\ , \ *cfgserver*\ , \ *chain*\ , \ *chassis*\ , \ *cmdmapping*\ , \ *cons*\ , \ *conserver*\ , \ *consoleondemand*\ , \ *cpucount*\ , \ *cputype*\ , \ *currchain*\ , \ *currstate*\ , \ *dhcpinterfaces*\ , \ *disksize*\ , \ *displayname*\ , \ *dockercpus*\ , \ *dockerflag*\ , \ *dockerhost*\ , \ *dockermemory*\ , \ *dockernics*\ , \ *domainadminpassword*\ , \ *domainadminuser*\ , \ *domaintype*\ , \ *getmac*\ , \ *groupname*\ , \ *grouptype*\ , \ *hcp*\ , \ *height*\ , \ *hostcluster*\ , \ *hostinterface*\ , \ *hostmanager*\ , \ *hostnames*\ , \ *hosttype*\ , \ *hwtype*\ , \ *id*\ , \ *initrd*\ , \ *installnic*\ , \ *interface*\ , \ *ip*\ , \ *iscsipassword*\ , \ *iscsiserver*\ , \ *iscsitarget*\ , \ *iscsiuserid*\ , \ *kcmdline*\ , \ *kernel*\ , \ *linkports*\ , \ *mac*\ , \ *machinetype*\ , \ *membergroups*\ , \ *members*\ , \ *memory*\ , \ *mgt*\ , \ *micbridge*\ , \ *michost*\ , \ *micid*\ , \ *miconboot*\ , \ *micpowermgt*\ , \ *micvlog*\ , \ *migrationdest*\ , \ *modelnum*\ , \ *monserver*\ , \ *mpa*\ , \ *mtm*\ , \ *nameservers*\ , \ *netboot*\ , \ *nfsdir*\ , \ *nfsserver*\ , \ *nicaliases*\ , \ *niccustomscripts*\ , \ *nicdevices*\ , \ *nicextraparams*\ , \ *nichostnameprefixes*\ , \ *nichostnamesuffixes*\ , \ *nicips*\ , \ *nicnetworks*\ , \ *nicsadapter*\ , \ *nictypes*\ , \ *nimserver*\ , \ *nodetype*\ , \ *ondiscover*\ , \ *os*\ , \ *osvolume*\ , \ *otherinterfaces*\ , \ *ou*\ , \ *outlet*\ , \ *parent*\ , \ *passwd.HMC*\ , \ *passwd.admin*\ , \ *passwd.celogin*\ , \ *passwd.general*\ , \ *passwd.hscroot*\ , \ *password*\ , \ *pdu*\ , \ *postbootscripts*\ , \ *postscripts*\ , \ *power*\ , \ *pprofile*\ , \ *prescripts-begin*\ , \ *prescripts-end*\ , \ *primarynic*\ , \ *productkey*\ , \ *profile*\ , \ *protocol*\ , \ *provmethod*\ , \ *rack*\ , \ *room*\ , \ *routenames*\ , \ *serial*\ , \ *serialflow*\ , \ *serialnum*\ , \ *serialport*\ , \ *serialspeed*\ , \ *servicenode*\ , \ *setupconserver*\ , \ *setupdhcp*\ , \ *setupftp*\ , \ *setupipforward*\ , \ *setupldap*\ , \ *setupnameserver*\ , \ *setupnfs*\ , \ *setupnim*\ , \ *setupntp*\ , \ *setupproxydhcp*\ , \ *setuptftp*\ , \ *sfp*\ , \ *side*\ , \ *slot*\ , \ *slotid*\ , \ *slots*\ , \ *snmpauth*\ , \ *snmppassword*\ , \ *snmpprivacy*\ , \ *snmpusername*\ , \ *snmpversion*\ , \ *storagcontroller*\ , \ *storagetype*\ , \ *supernode*\ , \ *supportedarchs*\ , \ *supportproxydhcp*\ , \ *switch*\ , \ *switchinterface*\ , \ *switchport*\ , \ *switchtype*\ , \ *switchvlan*\ , \ *syslog*\ , \ *termport*\ , \ *termserver*\ , \ *tftpdir*\ , \ *tftpserver*\ , \ *unit*\ , \ *urlpath*\ , \ *usercomment*\ , \ *userid*\ , \ *username*\ , \ *vmbeacon*\ , \ *vmbootorder*\ , \ *vmcfgstore*\ , \ *vmcluster*\ , \ *vmcpus*\ , \ *vmhost*\ , \ *vmmanager*\ , \ *vmmaster*\ , \ *vmmemory*\ , \ *vmnicnicmodel*\ , \ *vmnics*\ , \ *vmothersetting*\ , \ *vmphyslots*\ , \ *vmstorage*\ , \ *vmstoragecache*\ , \ *vmstorageformat*\ , \ *vmstoragemodel*\ , \ *vmtextconsole*\ , \ *vmvirtflags*\ , \ *vmvncport*\ , \ *webport*\ , \ *wherevals*\ , \ *xcatmaster*\
***********
@@ -57,16 +57,24 @@ group Attributes:
\ **bmc**\ (ipmi.bmc)
\ **bmc**\ (ipmi.bmc, openbmc.bmc)
The hostname of the BMC adapter.
or
The hostname of the BMC adapter.
\ **bmcpassword**\ (ipmi.password)
\ **bmcpassword**\ (ipmi.password, openbmc.password)
The BMC password. If not specified, the key=ipmi row in the passwd table is used as the default.
or
The BMC password.
\ **bmcport**\ (ipmi.bmcport)
@@ -115,10 +123,14 @@ group Attributes:
\ **bmcusername**\ (ipmi.username)
\ **bmcusername**\ (ipmi.username, openbmc.username)
The BMC userid. If not specified, the key=ipmi row in the passwd table is used as the default.
or
The BMC userid.
\ **bmcvlantag**\ (ipmi.taggedvlan)
@@ -461,7 +473,7 @@ group Attributes:
\ **mgt**\ (nodehm.mgt)
The method to use to do general hardware management of the node. This attribute is used as the default if power or getmac is not set. Valid values: ipmi, blade, hmc, ivm, fsp, bpa, kvm, esx, rhevm. See the power attribute for more details.
The method to use to do general hardware management of the node. This attribute is used as the default if power or getmac is not set. Valid values: openbmc, ipmi, blade, hmc, ivm, fsp, bpa, kvm, esx, rhevm. See the power attribute for more details.
@@ -663,10 +675,14 @@ group Attributes:
\ **nodetype**\ (nodetype.nodetype)
\ **nodetype**\ (nodetype.nodetype, pdu.nodetype)
A comma-delimited list of characteristics of this node. Valid values: ppc, blade, vm (virtual machine), osi (OS image), mm, mn, rsa, switch.
or
The node type should be pdu
\ **ondiscover**\ (chain.ondiscover)
@@ -707,7 +723,7 @@ group Attributes:
\ **outletcount**\ (pdu.outletcount)
\ **outlet**\ (pdu.outlet)
The pdu outlet count
@@ -19,7 +19,7 @@ SYNOPSIS
********
\ **node Attributes:**\ \ *addkcmdline*\ , \ *appstatus*\ , \ *appstatustime*\ , \ *arch*\ , \ *authdomain*\ , \ *bmc*\ , \ *bmcpassword*\ , \ *bmcport*\ , \ *bmcusername*\ , \ *bmcvlantag*\ , \ *cfgmgr*\ , \ *cfgmgtroles*\ , \ *cfgserver*\ , \ *chain*\ , \ *chassis*\ , \ *cmdmapping*\ , \ *cons*\ , \ *conserver*\ , \ *consoleondemand*\ , \ *cpucount*\ , \ *cputype*\ , \ *currchain*\ , \ *currstate*\ , \ *dhcpinterfaces*\ , \ *disksize*\ , \ *displayname*\ , \ *dockercpus*\ , \ *dockerflag*\ , \ *dockerhost*\ , \ *dockermemory*\ , \ *dockernics*\ , \ *domainadminpassword*\ , \ *domainadminuser*\ , \ *domaintype*\ , \ *getmac*\ , \ *groups*\ , \ *hcp*\ , \ *height*\ , \ *hidden*\ , \ *hostcluster*\ , \ *hostinterface*\ , \ *hostmanager*\ , \ *hostnames*\ , \ *hosttype*\ , \ *hwtype*\ , \ *id*\ , \ *initrd*\ , \ *installnic*\ , \ *interface*\ , \ *ip*\ , \ *iscsipassword*\ , \ *iscsiserver*\ , \ *iscsitarget*\ , \ *iscsiuserid*\ , \ *kcmdline*\ , \ *kernel*\ , \ *linkports*\ , \ *mac*\ , \ *machinetype*\ , \ *memory*\ , \ *mgt*\ , \ *micbridge*\ , \ *michost*\ , \ *micid*\ , \ *miconboot*\ , \ *micpowermgt*\ , \ *micvlog*\ , \ *migrationdest*\ , \ *modelnum*\ , \ *monserver*\ , \ *mpa*\ , \ *mtm*\ , \ *nameservers*\ , \ *netboot*\ , \ *nfsdir*\ , \ *nfsserver*\ , \ *nicaliases*\ , \ *niccustomscripts*\ , \ *nicdevices*\ , \ *nicextraparams*\ , \ *nichostnameprefixes*\ , \ *nichostnamesuffixes*\ , \ *nicips*\ , \ *nicnetworks*\ , \ *nicsadapter*\ , \ *nictypes*\ , \ *nimserver*\ , \ *node*\ , \ *nodetype*\ , \ *ondiscover*\ , \ *os*\ , \ *osvolume*\ , \ *otherinterfaces*\ , \ *ou*\ , \ *outletcount*\ , \ *parent*\ , \ *passwd.HMC*\ , \ *passwd.admin*\ , \ *passwd.celogin*\ , \ *passwd.general*\ , \ *passwd.hscroot*\ , \ *password*\ , \ *pdu*\ , \ *postbootscripts*\ , \ *postscripts*\ , \ *power*\ , \ *pprofile*\ , \ *prescripts-begin*\ , \ *prescripts-end*\ , \ *primarynic*\ , \ *primarysn*\ , \ *productkey*\ , \ *profile*\ , \ *protocol*\ , \ *provmethod*\ , \ *rack*\ , \ *room*\ , \ *routenames*\ , \ *serial*\ , \ *serialflow*\ , \ *serialnum*\ , \ *serialport*\ , \ *serialspeed*\ , \ *servicenode*\ , \ *setupconserver*\ , \ *setupdhcp*\ , \ *setupftp*\ , \ *setupipforward*\ , \ *setupldap*\ , \ *setupnameserver*\ , \ *setupnfs*\ , \ *setupnim*\ , \ *setupntp*\ , \ *setupproxydhcp*\ , \ *setuptftp*\ , \ *sfp*\ , \ *side*\ , \ *slot*\ , \ *slotid*\ , \ *slots*\ , \ *snmpauth*\ , \ *snmppassword*\ , \ *snmpprivacy*\ , \ *snmpusername*\ , \ *snmpversion*\ , \ *status*\ , \ *statustime*\ , \ *storagcontroller*\ , \ *storagetype*\ , \ *supernode*\ , \ *supportedarchs*\ , \ *supportproxydhcp*\ , \ *switch*\ , \ *switchinterface*\ , \ *switchport*\ , \ *switchtype*\ , \ *switchvlan*\ , \ *syslog*\ , \ *termport*\ , \ *termserver*\ , \ *tftpdir*\ , \ *tftpserver*\ , \ *unit*\ , \ *updatestatus*\ , \ *updatestatustime*\ , \ *urlpath*\ , \ *usercomment*\ , \ *userid*\ , \ *username*\ , \ *vmbeacon*\ , \ *vmbootorder*\ , \ *vmcfgstore*\ , \ *vmcluster*\ , \ *vmcpus*\ , \ *vmhost*\ , \ *vmmanager*\ , \ *vmmaster*\ , \ *vmmemory*\ , \ *vmnicnicmodel*\ , \ *vmnics*\ , \ *vmothersetting*\ , \ *vmphyslots*\ , \ *vmstorage*\ , \ *vmstoragecache*\ , \ *vmstorageformat*\ , \ *vmstoragemodel*\ , \ *vmtextconsole*\ , \ *vmvirtflags*\ , \ *vmvncport*\ , \ *webport*\ , \ *xcatmaster*\ , \ *zonename*\
\ **node Attributes:**\ \ *addkcmdline*\ , \ *appstatus*\ , \ *appstatustime*\ , \ *arch*\ , \ *authdomain*\ , \ *bmc*\ , \ *bmcpassword*\ , \ *bmcport*\ , \ *bmcusername*\ , \ *bmcvlantag*\ , \ *cfgmgr*\ , \ *cfgmgtroles*\ , \ *cfgserver*\ , \ *chain*\ , \ *chassis*\ , \ *cmdmapping*\ , \ *cons*\ , \ *conserver*\ , \ *consoleondemand*\ , \ *cpucount*\ , \ *cputype*\ , \ *currchain*\ , \ *currstate*\ , \ *dhcpinterfaces*\ , \ *disksize*\ , \ *displayname*\ , \ *dockercpus*\ , \ *dockerflag*\ , \ *dockerhost*\ , \ *dockermemory*\ , \ *dockernics*\ , \ *domainadminpassword*\ , \ *domainadminuser*\ , \ *domaintype*\ , \ *getmac*\ , \ *groups*\ , \ *hcp*\ , \ *height*\ , \ *hidden*\ , \ *hostcluster*\ , \ *hostinterface*\ , \ *hostmanager*\ , \ *hostnames*\ , \ *hosttype*\ , \ *hwtype*\ , \ *id*\ , \ *initrd*\ , \ *installnic*\ , \ *interface*\ , \ *ip*\ , \ *iscsipassword*\ , \ *iscsiserver*\ , \ *iscsitarget*\ , \ *iscsiuserid*\ , \ *kcmdline*\ , \ *kernel*\ , \ *linkports*\ , \ *mac*\ , \ *machinetype*\ , \ *memory*\ , \ *mgt*\ , \ *micbridge*\ , \ *michost*\ , \ *micid*\ , \ *miconboot*\ , \ *micpowermgt*\ , \ *micvlog*\ , \ *migrationdest*\ , \ *modelnum*\ , \ *monserver*\ , \ *mpa*\ , \ *mtm*\ , \ *nameservers*\ , \ *netboot*\ , \ *nfsdir*\ , \ *nfsserver*\ , \ *nicaliases*\ , \ *niccustomscripts*\ , \ *nicdevices*\ , \ *nicextraparams*\ , \ *nichostnameprefixes*\ , \ *nichostnamesuffixes*\ , \ *nicips*\ , \ *nicnetworks*\ , \ *nicsadapter*\ , \ *nictypes*\ , \ *nimserver*\ , \ *node*\ , \ *nodetype*\ , \ *ondiscover*\ , \ *os*\ , \ *osvolume*\ , \ *otherinterfaces*\ , \ *ou*\ , \ *outlet*\ , \ *parent*\ , \ *passwd.HMC*\ , \ *passwd.admin*\ , \ *passwd.celogin*\ , \ *passwd.general*\ , \ *passwd.hscroot*\ , \ *password*\ , \ *pdu*\ , \ *postbootscripts*\ , \ *postscripts*\ , \ *power*\ , \ *pprofile*\ , \ *prescripts-begin*\ , \ *prescripts-end*\ , \ *primarynic*\ , \ *primarysn*\ , \ *productkey*\ , \ *profile*\ , \ *protocol*\ , \ *provmethod*\ , \ *rack*\ , \ *room*\ , \ *routenames*\ , \ *serial*\ , \ *serialflow*\ , \ *serialnum*\ , \ *serialport*\ , \ *serialspeed*\ , \ *servicenode*\ , \ *setupconserver*\ , \ *setupdhcp*\ , \ *setupftp*\ , \ *setupipforward*\ , \ *setupldap*\ , \ *setupnameserver*\ , \ *setupnfs*\ , \ *setupnim*\ , \ *setupntp*\ , \ *setupproxydhcp*\ , \ *setuptftp*\ , \ *sfp*\ , \ *side*\ , \ *slot*\ , \ *slotid*\ , \ *slots*\ , \ *snmpauth*\ , \ *snmppassword*\ , \ *snmpprivacy*\ , \ *snmpusername*\ , \ *snmpversion*\ , \ *status*\ , \ *statustime*\ , \ *storagcontroller*\ , \ *storagetype*\ , \ *supernode*\ , \ *supportedarchs*\ , \ *supportproxydhcp*\ , \ *switch*\ , \ *switchinterface*\ , \ *switchport*\ , \ *switchtype*\ , \ *switchvlan*\ , \ *syslog*\ , \ *termport*\ , \ *termserver*\ , \ *tftpdir*\ , \ *tftpserver*\ , \ *unit*\ , \ *updatestatus*\ , \ *updatestatustime*\ , \ *urlpath*\ , \ *usercomment*\ , \ *userid*\ , \ *username*\ , \ *vmbeacon*\ , \ *vmbootorder*\ , \ *vmcfgstore*\ , \ *vmcluster*\ , \ *vmcpus*\ , \ *vmhost*\ , \ *vmmanager*\ , \ *vmmaster*\ , \ *vmmemory*\ , \ *vmnicnicmodel*\ , \ *vmnics*\ , \ *vmothersetting*\ , \ *vmphyslots*\ , \ *vmstorage*\ , \ *vmstoragecache*\ , \ *vmstorageformat*\ , \ *vmstoragemodel*\ , \ *vmtextconsole*\ , \ *vmvirtflags*\ , \ *vmvncport*\ , \ *webport*\ , \ *xcatmaster*\ , \ *zonename*\
***********
@@ -69,16 +69,24 @@ node Attributes:
\ **bmc**\ (ipmi.bmc)
\ **bmc**\ (ipmi.bmc, openbmc.bmc)
The hostname of the BMC adapter.
or
The hostname of the BMC adapter.
\ **bmcpassword**\ (ipmi.password)
\ **bmcpassword**\ (ipmi.password, openbmc.password)
The BMC password. If not specified, the key=ipmi row in the passwd table is used as the default.
or
The BMC password.
\ **bmcport**\ (ipmi.bmcport)
@@ -127,10 +135,14 @@ node Attributes:
\ **bmcusername**\ (ipmi.username)
\ **bmcusername**\ (ipmi.username, openbmc.username)
The BMC userid. If not specified, the key=ipmi row in the passwd table is used as the default.
or
The BMC userid.
\ **bmcvlantag**\ (ipmi.taggedvlan)
@@ -461,7 +473,7 @@ node Attributes:
\ **mgt**\ (nodehm.mgt)
The method to use to do general hardware management of the node. This attribute is used as the default if power or getmac is not set. Valid values: ipmi, blade, hmc, ivm, fsp, bpa, kvm, esx, rhevm. See the power attribute for more details.
The method to use to do general hardware management of the node. This attribute is used as the default if power or getmac is not set. Valid values: openbmc, ipmi, blade, hmc, ivm, fsp, bpa, kvm, esx, rhevm. See the power attribute for more details.
@@ -669,10 +681,14 @@ node Attributes:
\ **nodetype**\ (nodetype.nodetype)
\ **nodetype**\ (nodetype.nodetype, pdu.nodetype)
A comma-delimited list of characteristics of this node. Valid values: ppc, blade, vm (virtual machine), osi (OS image), mm, mn, rsa, switch.
or
The node type should be pdu
\ **ondiscover**\ (chain.ondiscover)
@@ -713,7 +729,7 @@ node Attributes:
\ **outletcount**\ (pdu.outletcount)
\ **outlet**\ (pdu.outlet)
The pdu outlet count
@@ -0,0 +1,85 @@
#####
pdu.7
#####
.. highlight:: perl
****
NAME
****
\ **pdu**\ - a logical object definition in the xCAT database.
********
SYNOPSIS
********
\ **pdu Attributes:**\ \ *machinetype*\ , \ *modelnum*\ , \ *node*\ , \ *nodetype*\ , \ *outlet*\ , \ *serialnum*\
***********
DESCRIPTION
***********
Logical objects of this type are stored in the xCAT database in one or more tables. Use the following commands
to manipulate the objects: \ **mkdef**\ , \ **chdef**\ , \ **lsdef**\ , and \ **rmdef**\ . These commands will take care of
knowing which tables the object attributes should be stored in. The attribute list below shows, in
parentheses, what tables each attribute is stored in.
***************
pdu Attributes:
***************
\ **machinetype**\ (pdu.machinetype)
The pdu machine type
\ **modelnum**\ (pdu.modelnum)
The pdu model number
\ **node**\ (pdu.node)
The hostname/address of the pdu to which the settings apply
\ **nodetype**\ (pdu.nodetype)
The node type should be pdu
\ **outlet**\ (pdu.outlet)
The pdu outlet count
\ **serialnum**\ (pdu.serialnum)
The pdu serial number
********
SEE ALSO
********
\ **mkdef(1)**\ , \ **chdef(1)**\ , \ **lsdef(1)**\ , \ **rmdef(1)**\
@@ -10,6 +10,8 @@ Install an OS on the Management Node
:start-after: BEGIN_install_os_mgmt_node
:end-before: END_install_os_mgmt_node
.. _apt_configure_the_base_os_repository:
Configure the Base OS Repository
--------------------------------
@@ -10,6 +10,8 @@ Install an OS on the Management Node
:start-after: BEGIN_install_os_mgmt_node
:end-before: END_install_os_mgmt_node
.. _zypper_configure_the_base_os_repository:
Configure the Base OS Repository
--------------------------------
@@ -0,0 +1,25 @@
2017-02-16 - OpenSSL Vulnerabilities
====================================
*Feb 16, 2017*, OpenSSL announced the following security advisories: https://www.openssl.org/news/secadv/20170216.txt
Advisory CVEs
-------------
* CVE-2017-3733 - **Encrypt-Then-Mac renegotiation crash** (Severity:High)
OpenSSL 1.1.0 users should upgrade to 1.1.0e
This issue does not affect OpenSSL version 1.0.2.
Please see the security bulletin above for patch, upgrade, or suggested work around information.
Action
------
xCAT uses OpenSSL for client-server communication but **does not** ship it.
It is highly recommended to keep your OpenSSL levels up-to-date with the indicated versions in the security bulletins to prevent any potential security threats. Obtain the updated software packages from your Operating system distribution channels.
+1
View File
@@ -4,4 +4,5 @@
.. toctree::
:maxdepth: 1
20170216_openssl.rst
20170126_openssl.rst
+18 -1
View File
@@ -50,7 +50,7 @@ our @dsh_valid_env = (
'DSH_REMOTE_PASSWORD', 'DSH_TO_USERID',
'DSH_FROM_USERID', 'DEVICETYPE',
'RSYNCSN', 'DSH_RSYNC_FILE',
'RSYNCSNONLY',
'RSYNCSNONLY', 'DSH_VERIFY',
);
select(STDERR);
$| = 1;
@@ -2492,6 +2492,12 @@ sub config_dsh
$dsh_trace
&& xCAT::MsgUtils->message("I", $rsp, $::CALLBACK);
$$options{'verify'} = $$options{'verify'} || $ENV{'DSH_VERIFY'} || undef;
my $rsp = {};
$rsp->{data}->[0] = "TRACE: Verify value is $$options{'verify'} ";
$dsh_trace
&& xCAT::MsgUtils->message("I", $rsp, $::CALLBACK);
# Check if $$options{'pre-command'} has been overwritten
# Mellanox uses pre-command = cli
if (!$$options{'pre-command'})
@@ -4434,6 +4440,17 @@ sub parse_and_run_dcp
return 0;
}
unless ($options{'user'})
{
# user was not specified with -l flag, check it user calling the command
# was saved in DSH_FROM_USERID environment variable
my $current_userid = $ENV{'DSH_FROM_USERID'};
if (defined($current_userid)) {
# Set userid from value in DSH_FROM_USERID environment variable
$options{'user'} = $current_userid;
}
}
if (defined($options{'rootimg'}))
{
if (xCAT::Utils->isAIX())
+51 -16
View File
@@ -443,6 +443,19 @@ passed as argument rather than by table value',
disable => "Set to 'yes' or '1' to comment out this row.",
},
},
openbmc => {
cols => [qw(node bmc username password comments disable)],
keys => [qw(node)],
table_desc => 'Setting for nodes that are controlled by an on-board OpenBmc.',
descriptions => {
node => 'The node name or group name.',
bmc => 'The hostname of the BMC adapter.',
username => 'The BMC userid.',
password => 'The BMC password.',
comments => 'Any user-written notes.',
disable => "Set to 'yes' or '1' to comment out this row.",
},
},
iscsi => {
cols => [qw(node server target lun iname file userid passwd kernel kcmdline initrd comments disable)],
keys => [qw(node)],
@@ -559,7 +572,7 @@ passed as argument rather than by table value',
ddnsdomain => 'A domain to be combined with nodename to construct FQDN for DDNS updates induced by DHCP. This is not passed down to the client as "domain"',
vlanid => 'The vlan ID if this network is within a vlan.',
domain => 'The DNS domain name (ex. cluster.com).',
mtu => 'The default MTU for the network',
mtu => 'The default MTU for the network, If multiple networks are applied to the same nic on the SN and/or CN, the MTU shall be the same for those networks.',
comments => 'Any user-written notes.',
disable => "Set to 'yes' or '1' to comment out this row.",
},
@@ -586,7 +599,7 @@ passed as argument rather than by table value',
descriptions => {
node => 'The node name or group name.',
power => 'The method to use to control the power of the node. If not set, the mgt attribute will be used. Valid values: ipmi, blade, hmc, ivm, fsp, kvm, esx, rhevm. If "ipmi", xCAT will search for this node in the ipmi table for more info. If "blade", xCAT will search for this node in the mp table. If "hmc", "ivm", or "fsp", xCAT will search for this node in the ppc table.',
mgt => 'The method to use to do general hardware management of the node. This attribute is used as the default if power or getmac is not set. Valid values: ipmi, blade, hmc, ivm, fsp, bpa, kvm, esx, rhevm. See the power attribute for more details.',
mgt => 'The method to use to do general hardware management of the node. This attribute is used as the default if power or getmac is not set. Valid values: openbmc, ipmi, blade, hmc, ivm, fsp, bpa, kvm, esx, rhevm. See the power attribute for more details.',
cons => 'The console method. If nodehm.serialport is set, this will default to the nodehm.mgt setting, otherwise it defaults to unused. Valid values: cyclades, mrv, or the values valid for the mgt attribute.',
termserver => 'The hostname of the terminal server.',
termport => 'The port number on the terminal server that this node is connected to.',
@@ -679,17 +692,19 @@ passed as argument rather than by table value',
},
},
pdu => {
cols => [qw(node nodetype machinetype modelnum serialnum outletCount comments disable)],
cols => [qw(node nodetype outlet machinetype modelnum serialnum comments disable)],
keys => [qw(node)],
nodecol => "node",
table_desc => 'Parameters to use when interrogating pdus',
descriptions => {
node => 'The hostname/address of the pdu to which the settings apply',
nodetype => 'The node type should be pdu ',
outlet => 'The pdu outlet count',
machinetype => 'The pdu machine type',
modelnum => 'The pdu model number',
serialnum => 'The pdu serial number',
outletcount => 'The pdu outlet count',
comments => 'Any user-written notes.',
disable => "Set to 'yes' or '1' to comment out this row.",
},
},
switches => {
@@ -845,8 +860,8 @@ passed as argument rather than by table value',
descriptions => {
key => 'The type of component this user/pw is for. Valid values: blade (management module), ipmi (BMC), system (nodes), omapi (DHCP), hmc, ivm, cec, frame, switch.',
username => 'The default userid for this type of component',
password => 'The default password for this type of component',
cryptmethod => 'Indicates the method that was used to encrypt the password attribute. On AIX systems, if a value is provided for this attribute it indicates that the password attribute is encrypted. If the cryptmethod value is not set it indicates the password is a simple string value. On Linux systems, the cryptmethod can be set to md5, sha256 or sha512. If not set, sha256 will be used as default.',
password => 'The default password for this type of component. On Linux, a crypted form could be provided. Hashes starting with $1$, $5$ and $6$ (md5, sha256 and sha512 respectively) are supported.',
cryptmethod => 'Indicates the method to use to encrypt the password attribute. On AIX systems, if a value is provided for this attribute it indicates that the password attribute is encrypted. If the cryptmethod value is not set it indicates the password is a simple string value. On Linux systems, the cryptmethod can be set to md5, sha256 or sha512. If not set, sha256 will be used as default to encrypt plain-text passwords.',
authdomain => 'The domain in which this entry has meaning, e.g. specifying different domain administrators per active directory domain',
comments => 'Any user-written notes.',
disable => "Set to 'yes' or '1' to comment out this row.",
@@ -2447,6 +2462,26 @@ my @nodeattrs = (
tabentry => 'mpa.urlpath',
access_tabentry => 'mpa.mpa=attr:node',
},
#########################
# openbmc table #
##########################
{ attr_name => 'bmc',
only_if => 'mgt=openbmc',
tabentry => 'openbmc.bmc',
access_tabentry => 'openbmc.node=attr:node',
},
{ attr_name => 'bmcusername',
only_if => 'mgt=openbmc',
tabentry => 'openbmc.username',
access_tabentry => 'openbmc.node=attr:node',
},
{ attr_name => 'bmcpassword',
only_if => 'mgt=openbmc',
tabentry => 'openbmc.password',
access_tabentry => 'openbmc.node=attr:node',
},
######################
# nodepos table #
######################
@@ -2859,6 +2894,11 @@ my @nodeattrs = (
tabentry => 'pdu.nodetype',
access_tabentry => 'pdu.node=attr:node',
},
{ attr_name => 'outlet',
only_if => 'nodetype=pdu',
tabentry => 'pdu.outlet',
access_tabentry => 'pdu.node=attr:node',
},
{ attr_name => 'machinetype',
only_if => 'nodetype=pdu',
tabentry => 'pdu.machinetype',
@@ -2874,11 +2914,6 @@ my @nodeattrs = (
tabentry => 'pdu.serialnum',
access_tabentry => 'pdu.node=attr:node',
},
{ attr_name => 'outletcount',
only_if => 'nodetype=pdu',
tabentry => 'pdu.outletcount',
access_tabentry => 'pdu.node=attr:node',
},
#########################
## switches table #
@@ -4100,6 +4135,11 @@ push(@{ $defspec{group}->{'attrs'} }, @nodeattrs);
tabentry => 'pdu.nodetype',
access_tabentry => 'pdu.node=attr:node',
},
{ attr_name => 'outlet',
only_if => 'nodetype=pdu',
tabentry => 'pdu.outlet',
access_tabentry => 'pdu.node=attr:node',
},
{ attr_name => 'machinetype',
only_if => 'nodetype=pdu',
tabentry => 'pdu.machinetype',
@@ -4115,11 +4155,6 @@ push(@{ $defspec{group}->{'attrs'} }, @nodeattrs);
tabentry => 'pdu.serialnum',
access_tabentry => 'pdu.node=attr:node',
},
{ attr_name => 'outletcount',
only_if => 'nodetype=pdu',
tabentry => 'pdu.outletcount',
access_tabentry => 'pdu.node=attr:node',
},
);
+4
View File
@@ -2358,6 +2358,10 @@ sub transRegexAttrs
undef $@; #extract_bracketed would have set $@ if it didn't return, undef $@
$retval = $node;
$retval =~ s/$parts[0]/$parts[1]/;
if ($retval =~ /^$/) {
return undef;
}
return $retval;
}
while ($curr)
{
+6 -2
View File
@@ -26,6 +26,8 @@ my %usage = (
"rpower" =>
"Usage: rpower <noderange> [--nodeps] [on|onstandby|off|suspend|reset|stat|state|boot] [-V|--verbose] [-m table.colum==expectedstatus][-m table.colum==expectedstatus...] [-r <retrycount>] [-t <timeout>]
rpower [-h|--help|-v|--version]
OpenBMC specific:
rpower noderange [on|off|reset|boot|stat|state|status]
KVM Virtualization specific:
rpower <noderange> [boot] [ -c <path to iso> ]
PPC (with IVM or HMC) specific:
@@ -44,6 +46,8 @@ my %usage = (
rpower <noderange> [on|onstandby|off|cycle|state|sms]
Blade(using AMM) specific:
rpower <noderange> [cycle|softoff] [-V|--verbose]
Lenovo high-density server specific:
rpower <noderange> [on|off|reset|boot|reseat]
zVM specific:
rpower noderange [on|off|reset|stat|softoff]
MIC specific:
@@ -51,8 +55,8 @@ my %usage = (
docker specific:
rpower noderange [start|stop|restart|pause|unpause|state]
pdu specific:
rpower noderange [off|on|stat]
rpower noderange [pduoff|pduon|pdustat]
rpower noderange [off|on|stat|status|reset]
rpower noderange [pduoff|pduon|pdustat|pdustatus|pdureset]
",
"rbeacon" =>
"Usage: rbeacon <noderange> [on|off|stat] [-V|--verbose]
+1 -1
View File
@@ -73,7 +73,7 @@ fi
if [ $USE_CONFLUENT == "1" ] && ([ -x "/opt/confluent/bin/confetty" ] || [ -x "/usr/bin/confetty" ] || [ -x "/usr/local/bin/confetty" ]); then
# use confluent, make sure conserver is not also running
CONSERVER_RC=`service conserver status >& /dev/null; echo $?`
CONSERVER_RC=`pidof conserver >> /dev/null; echo $?`
if [[ ${CONSERVER_RC} == 0 ]]; then
echo "Error: consoleservice is set to 'confluent' but conserver is running. Stop conserver, run makeconfluentcfg, and retry..."
exit 1
+1 -1
View File
@@ -17,7 +17,7 @@ unless ($ENV{DISPLAY}) {
my $mydir = dirname($0);
my $sb;
my $tilefact;
my $xrm = "-xrm xterm.mainMenu.*.font:fixed -xrm xterm.vtMenu.*.font:fixed -xrm xterm.fontMenu.*.font:fixed -xrm xterm -xrm xterm.vt100.font6:grvga.737";
my $xrm = "-xrm xterm.mainMenu.*.font:fixed -xrm xterm.vtMenu.*.font:fixed -xrm xterm.fontMenu.*.font:fixed -xrm xterm -xrm xterm.vt100.font6:grvga.737 -xrm xterm.vt100.color0:#000000 -xrm xterm.vt100.color1:#AA0000 -xrm xterm.vt100.color2:#00AA00 -xrm xterm.vt100.color3:#AA5500 -xrm xterm.vt100.color4:#0000AA -xrm xterm.vt100.color5:#AA00AA -xrm xterm.vt100.color6:#00AAAA -xrm xterm.vt100.color7:#AAAAAA -xrm xterm.vt100.color8:#555555 -xrm xterm.vt100.color9:#FF5555 -xrm xterm.vt100.color10:#55FF55 -xrm xterm.vt100.color11:#FFFF55 -xrm xterm.vt100.color12:#5555FF -xrm xterm.vt100.color13:#FF55FF -xrm xterm.vt100.color14:#55FFFF -xrm xterm.vt100.color15:#FFFFFF";
my $font = "5x7";
my $sizegeometry;
GetOptions(
+23
View File
@@ -190,6 +190,11 @@ if ($ENV{'DSH_ENVIRONMENT'})
push(@{ $cmdref->{env} }, "DSH_ENVIRONMENT=$ENV{'DSH_ENVIRONMENT'}");
}
if ($ENV{'DSH_VERIFY'})
{
push(@{ $cmdref->{env} }, "DSH_VERIFY=$ENV{'DSH_VERIFY'}");
}
xCAT::Client::submit_request($cmdref, \&xCAT::Client::handle_response);
exit $xCAT::Client::EXITCODE;
@@ -666,6 +671,24 @@ sub parse_args_xdcp
$::NODE_RCP = 1;
}
my $to_userid;
if ($options{'user'}) # if -l option
{
$to_userid = $options{'user'};
}
else
{
# find out who is the current user running xdcp
my $current_userid = getpwuid($>);
$ENV{DSH_FROM_USERID} = $current_userid;
$to_userid = $current_userid;
}
# Save userid running this command in ENV variable.
# It will be later extraced by DSHCLI.pm
$ENV{DSH_TO_USERID} = $to_userid;
if ($options{'bypass'})
{
$ENV{XCATBYPASS} = "yes"; # bypass xcatd
+4 -5
View File
@@ -14,12 +14,11 @@ Traditionally, network interfaces in Linux are enumerated as eth[0123...], but t
B<getadapter> use genesis to collect network adapters information, so that mean it need to restart the target node.
B<getadapter> follows below scheme:
B<getadapter> For each node within the <noderange>, follows below scheme:
If the target node is scaned for the first time, B<getadapter> will trigger genesis to collect information then save the information at local.
If the target node has ever been scaned, i.e. this node has network device information in local, B<getadapter> use the local information first.
If user doesn't want to use local information, can use B<-f> option to force to trigger new round scan process.
if part nodes of I<noderange> don't have network device information in local and the rest have, B<getadapter> only trigger real scan process for these nodes which don't have local information, the nodes have network device information in local, B<getadapter> still use the local information first.
If the target node is scaned for the first time, B<getadapter> will trigger genesis to collect information then save the information at the B<nicsadapter> column of nics table.
If the target node has ever been scaned, B<getadapter> will use the information from nics table first.
If user hopes to scan the adapter information for the node but these information already exist, B<-f> option can be used to start rescan process.
B<getadapter> tries to collect more information for the target network device, but doesn't guarantee collect same much information for every network device.
+2 -2
View File
@@ -16,7 +16,7 @@ B<pping> {B<-v>|B<--version>}
B<pping> is a utility used to ping a list of nodes in parallel.
B<pping> will return an unsorted list of nodes with a ping or noping status.
B<pping> front-ends nmap or fping if available.
B<pping> front-ends B<nmap> or B<fping> if available.
This command does not support the xcatd client/server communication. It must be run on the management node.
@@ -34,7 +34,7 @@ If more than one interface is specified, each interface will be combined with th
=item B<-f>|B<--use_fping>
Use fping instead of nmap
Use B<fping> instead of B<nmap>
=item B<-h>|B<--help>
+19 -7
View File
@@ -8,7 +8,7 @@ B<rmdef> - Use this command to remove xCAT data object definitions.
B<rmdef> [B<-h>|B<--help>] [B<-t> I<object-types>]
B<rmdef> [B<-V>|B<--verbose>] [B<-a>|B<--all>] [B<-t> I<object-types>] [B<-o> I<object-names>]
[B<-f>|B<--force>] [I<noderange>]
[B<-f>|B<--force>] [B<-C>|B<--cleanup>] [I<noderange>]
=head1 DESCRIPTION
@@ -22,15 +22,23 @@ This command is used to remove xCAT object definitions that are stored in the xC
=item B<-a|--all>
Clear the whole xCAT database. A backup of the xCAT definitions should be saved before using this option. Once all the data is removed the xCAT daemon will no longer work. Most xCAT commands will fail.
In order to use xCAT commands again, you have two options. You can restore your database from your backup by switching to bypass mode, and running the restorexCATdb command.
You switch to bypass mode by setting the XCATBYPASS environmant variable. (ex. "export XCATBYPASS=yes")
A second option is to run xcatconfig -d. This will restore the initial setup of the database as when xCAT was initially installed.
You can then restart xcatd and run xCAT commands.
Clear the whole xCAT database. A backup of the xCAT definitions should be saved before using this option as the xCAT daemons will no longer work once cleared.
To restore:
=over 5
=item 1. B<export XCATBYPASS=1> and run the B<restorexCATdb> command.
or
=item 2. Run B<xcatconfig -d> which initializes the database the same as when xCAT was installed.
=back
=item B<-f|--force>
Use this with the all option as an extra indicator that ALL definitions are to be removed.
Use this with the B<--all> option as an extra indicator that ALL definitions are to be removed.
=item B<-h|--help>
@@ -48,6 +56,10 @@ A set of comma delimited object names.
A set of comma delimited object types.
=item B<-C|--cleanup>
Perform additional cleanup by running B<nodeset offline> on the objects specified in the I<noderange>.
=item B<-V|--verbose>
Verbose mode.
+15 -3
View File
@@ -12,7 +12,11 @@ B<rpower> [B<-h>|B<--help>|B<-v>|B<--version>]
B<rpower> I<noderange> [B<on>|B<off>|B<softoff>|B<reset>|B<boot>|B<stat>|B<state>|B<status>|B<wake>|B<suspend> [B<-w> I<timeout>] [B<-o>] [B<-r>]]
B<rpower> I<noderange> [B<pduon>|B<pduoff>|B<pdustat>]
B<rpower> I<noderange> [B<pduon>|B<pduoff>|B<pdustat>|B<pdureset>]
=head2 OpenBMC specific:
B<rpower> I<noderange> [B<off>|B<on>|B<reset>|B<boot>|B<stat>|B<state>|B<status>]
=head2 PPC (with IVM or HMC) specific:
@@ -46,7 +50,11 @@ B<rpower> I<noderange> [B<on>|B<onstandby>|B<off>|B<stat>|B<state>|B<sms>]
=head2 Blade specific:
B<rpower> I<noderange> [B<cycle>|B<softoff>]
B<rpower> I<noderange> [B<cycle>|B<softoff>]
=head2 Lenovo High-Density Server specific:
B<rpower> I<noderange> [B<on>|B<off>|B<reset>|B<boot>|B<reseat>]
=head2 zVM specific:
@@ -58,7 +66,7 @@ B<rpower> I<noderange> [B<start>|B<stop>|B<restart>|B<pause>|B<unpause>|B<state>
=head2 pdu specific:
B<rpower> I<noderange> [B<stat>|B<off>|B<on>]
B<rpower> I<noderange> [B<stat>|B<off>|B<on>|B<reset>]
=head1 DESCRIPTION
@@ -169,6 +177,10 @@ This option is recommended over B<cycle>.
Power off, then on.
=item B<reseat>
For Lenovo high-density servers, simulates unplugging and replugging the node into the chassis.
=item B<of>
Boot the node to open firmware console mode.
+18 -15
View File
@@ -231,7 +231,7 @@ for valid names.
xdsh will chroot (xcatchroot for AIX) to this path and run the xdsh command against the
install image. No other xdsh flags, environment variables apply with
this input. A noderange is not accepted. Only runs on the local host,
normally the Management Node. The command you run must not prompt for input, the prompt will not be returned to you, and it will appear that xdsh hangs.
normally the Management Node. The command you run must not prompt for input, the prompt will not be returned to you, and it will appear that B<xdsh> hangs.
=item B<-K>|B<--ssh-setup>
@@ -324,8 +324,8 @@ available from any target in the specified I<timeout>, B<xdsh>
displays an error and terminates execution for the remote
targets that failed to respond. If I<timeout> is not specified,
B<xdsh> waits indefinitely to continue processing output from
all remote targets. The exception is the -K flag which defaults
to 10 seconds.
all remote targets. The exception is the B<-K> flag which defaults
to 10 seconds.
=item B<-T>|B<--trace>
@@ -430,29 +430,32 @@ remote I<user_ID> is used.
If B<DSH_REMOTE_PASSWORD> is set to the password of the
userid (usually root) that will ssh to the node, then when
you use the -K flag, you will not be prompted for a password.
you use the B<-K> flag, you will not be prompted for a password.
=item B<DSH_SYNTAX>
Specifies the shell syntax to use on remote targets; B<ksh> or
B<csh>. If not specified, the B<ksh> syntax is assumed. This
B<csh>. If not specified, the B<ksh> syntax is assumed. This
variable is overridden by the B<-S> flag.
=item B<DSH_TIMEOUT>
Specifies the time, in seconds, to wait for output from
each remote target. This variable is overridden by the B<-t>
flag.
Specifies the time, in seconds, to wait for output from
each remote target. This variable is overridden by the B<-t> flag.
=item B<DSH_VERIFY>
Verifies each target before executing any remote commands on the target. If a target is not responding, execution of remote commands for the target is canceled. This variable is overridden by the B<-v> flag.
=back
=head1 B<Compatibility with AIX dsh>
To provide backward compatibility for scripts written using dsh in
To provide backward compatibility for scripts written using B<dsh> in
AIX and CSM, a tool has been provided B<groupfiles4dsh>,
which will build node group files from the
xCAT database that can be used by dsh. See B<man groupfiles4dsh>.
xCAT database that can be used by B<dsh>. See B<man groupfiles4dsh>.
=head1 B<SECURITY>
@@ -471,7 +474,7 @@ userdefined.
=head1 B<EXIT STATUS>
The dsh command exit code is 0 if the command executed without errors and all remote shell commands finished with exit codes of 0. If internal dsh errors occur or the remote shell commands do not complete successfully, the dsh command exit value is greater than 0. The exit value is increased by 1 for each successive instance of an unsuccessful remote command execution. If the remotely issued command is run in the background, the exit code of the remotely issued command is 0.
The B<xdsh> command exit code is 0 if the command executed without errors and all remote shell commands finished with exit codes of 0. If internal dsh errors occur or the remote shell commands do not complete successfully, the dsh command exit value is greater than 0. The exit value is increased by 1 for each successive instance of an unsuccessful remote command execution. If the remotely issued command is run in the background, the exit code of the remotely issued command is 0.
=head1 B<EXAMPLES>
@@ -525,20 +528,20 @@ To cleanup the servicenode directory that stages the copy of files to the nodes,
To define the QLogic IB switch as a node and to set up the SSH keys for IB switch
B<qswitch> with device configuration file
B</var/opt/xcat/IBSwitch/Qlogic/config> and user name B<username>, Enter
B</var/opt/xcat/IBSwitch/Qlogic/config> and user name B<username>, enter
chdef -t node -o qswitch groups=all nodetype=switch
xdsh qswitch -K -l username --devicetype IBSwitch::Qlogic
=item 10.
To define the Management Node in the database so you can use xdsh, Enter
To define the Management Node in the database so you can use B<xdsh>, enter
xcatconfig -m
=item 11.
To define the Mellanox switch as a node and run a command to show the ssh keys.
B<mswitch> with and user name B<username>, Enter
B<mswitch> with and user name B<username>, enter
chdef -t node -o mswitch groups=all nodetype=switch
@@ -560,7 +563,7 @@ If it is for Telnet, add I<tn:> in front of the user name: I<tn:admin>.
=item 13.
To run xdsh with the non-root userid "user1" that has been setup as an xCAT userid and with sudo on node1 and node2 to run as root, do the following, see xCAT doc on Granting_Users_xCAT_privileges:
To run B<xdsh> with the non-root userid "user1" that has been setup as an xCAT userid and with sudo on node1 and node2 to run as root, do the following, see xCAT doc on Granting_Users_xCAT_privileges:
xdsh node1,node2 --sudo -l user1 "cat /etc/passwd"
+11
View File
@@ -72,6 +72,17 @@ if [ -r /sys/devices/virtual/dmi/id/product_name ]; then #x86
MTM=VMware
else
MTM=`cat /sys/devices/virtual/dmi/id/product_name|awk -F'[' '{print $2}'|awk -F']' '{print $1}'`
if [ -z "$MTM" ]; then
FRU=`ipmitool fru print 0`
if [ $? -eq 0 ]; then
MTM=`echo "$FRU" | awk -F': ' '/Product Manufacturer/ {m=$2} /Product Name/ {n=$2} END {print m":"n}'`
else
logger -s -t $log_label -p local4.warning "Couldn't find MTM information in FRU, falling back to DMI (MTMS-based discovery may fail)"
m=`cat /sys/devices/virtual/dmi/id/sys_vendor`
n=`cat /sys/devices/virtual/dmi/id/product_name`
MTM="$m:$n"
fi
fi
SERIAL=`cat /sys/devices/virtual/dmi/id/product_serial`
fi
CPUCOUNT=`cat /proc/cpuinfo |grep "model name"|wc -l`
+10 -3
View File
@@ -266,8 +266,11 @@ ip addr show dev $bootnic|grep -v 'scope link'|grep -v 'dynamic'|grep -v inet6|
logger -s -t $log_label -p local4.info "Starting ntpd..."
ntpd -g -x
logger -s -t $log_label -p local4.info "Waiting for ntpd to synchronize..."
ntp-wait -n 1999 -s 1 -v
# ntp-wait defaults to 6 seconds between retries, wait for 1 minute
NTP_TRIES=10
NTP_SLEEP=6
logger -s -t $log_label -p local4.info "Waiting for $NTP_TRIES x $NTP_SLEEP seconds for ntpd to synchronize..."
ntp-wait -n $NTP_TRIES -s $NTP_SLEEP -v
if [ $? -ne 0 ]
then
logger -s -t $log_label -p local4.info "... ntpd did not synchronize."
@@ -422,7 +425,11 @@ while :; do
logger -s -t $log_label -p local4.info "Poweroff..."
poweroff -f
else
logger -s -t $log_label -p local4.err "Unrecognized directive (dest=$dest)"
if [ "$dest" = error ]; then
logger -s -t $log_label -p local4.info "$destparameter"
else
logger -s -t $log_label -p local4.err "Unrecognized directive (dest=$dest)"
fi
destiny=''
dest=''
delay=$((30+$RANDOM%270))
+16 -9
View File
@@ -7,23 +7,30 @@ echo "<xcatrequest>
<callback_port>300</callback_port>
</xcatrequest>" > /tmp/destreq.xml
if [ -f /tmp/destiny.xml ]; then rm /tmp/destiny.xml; fi
while [ ! -f /tmp/destiny.xml ] || grep error /tmp/destiny.xml; do
if [ -f /tmp/destiny.xml ]; then
timer=60
while [ $timer -gt 0 ]; do
echo -en "Retrying in $timer seconds \r" >&2
sleep 1
timer=$(($timer-1));
done
fi
timer=0
while [ ! -f /tmp/destiny.xml ]; do
while [ $timer -gt 0 ]; do
echo -en "No destiny command received, retrying in $timer seconds \r" >&2
sleep 1
timer=$(($timer-1));
done
echo " " >&2;
if [ -f /etc/xcat/cert.pem -a -f /etc/xcat/certkey.pem ]; then #use client cert if available
cat /tmp/destreq.xml | openssl s_client -key /etc/xcat/certkey.pem -cert /etc/xcat/cert.pem -connect $XCATDEST -quiet 2> /dev/null > /tmp/destiny.xml
else
cat /tmp/destreq.xml | openssl s_client -connect $XCATDEST -quiet 2> /dev/null > /tmp/destiny.xml
fi
timer=60
done
rm /tmp/destreq.xml
DESTINY=`grep '<destiny>' /tmp/destiny.xml | awk -F'>' '{print $2}'|awk -F'<' '{print $1}'`
if [ -z "$DESTINY" ]; then
ERROR=`grep '<error>' /tmp/destiny.xml | awk -F'>' '{print $2}'|awk -F'<' '{print $1}'`
if [ ! -z "$ERROR" ]; then
DESTINY="error=$ERROR"
else
DESTINY="error=No destiny command received"
fi
fi
rm /tmp/destiny.xml
echo $DESTINY
+13
View File
@@ -115,6 +115,19 @@ unless ($noderange) {
exit 1;
}
my @nodes = split (",", $noderange);
my @error_nodes;
foreach my $node (@nodes) {
if ($node =~ /^-/) {
push @error_nodes, $node;
}
}
if (@error_nodes) {
my $error = join (",", @error_nodes);
probe_utils->send_msg("stdout", "f", "[$error]: Wrong node definition.");
exit 1;
}
if ($rollforward_time_of_replay) {
if (($rollforward_time_of_replay !~ /(\d+)h(\d+)m/i) && ($rollforward_time_of_replay !~ /^(\d+)h*$/i) && ($rollforward_time_of_replay !~ /^(\d+)m$/i)) {
probe_utils->send_msg("stdout", "f", "Unsupported time format for option '-r'");
+64
View File
@@ -15,6 +15,7 @@ use lib "$::XCATROOT/lib/perl";
use strict;
use warnings "all";
use Time::HiRes qw/time/;
use xCAT::SvrUtils;
use IO::Socket::INET qw/!AF_INET6 !PF_INET6/;
my $initialtimeout = 0.5;
@@ -79,6 +80,63 @@ sub hexdump {
print "\n";
}
my %command_info = (
6 => {
56 => "Get Channel Authentication Capabilities",
59 => "Set session privilege level",
60 => "Close Session",
58 => "activate session",
57 => "Get Session Challenge",
1 => "Get Device ID",
2 => "Cold Reset",
55 => "Get System GUID",
64 => "Set Channel Access",
76 => "Set User Payload Access",
10 => "Get Command Support",
},
4 => {
18 => "Set PEF Configuration Parameters",
19 => "Get PEF Configuration Parameters",
45 => "Get Sensor Reading",
},
0 => {
8 => "Set System Boot Options",
9 => "Get System Boot Options",
4 => "Chassis Identify(beacon)",
2 => "Chassis Control",
1 => "Get Chassis Status",
},
12 => {
1 => "Set LAN Configuration Parameters",
2 => "Get LAN Configuration Parameters",
33 => "Set SOL Configuration Parameters",
34 => "Get SOL Configuration Parameters",
},
10 => {
35 => "Get SDR",
34 => "Reserve SDR Repository",
71 => "Clear SEL",
67 => "Get SEL Entry",
66 => "Reserve SEL",
72 => "Get SEL Time",
64 => "Get SEL Info",
17 => "Read FRU Data",
16 => "Get FRU Inventory Area Info",
32 => "Get SDR Repository Info",
},
);
my %netfn_types = (
0 => "Chassis",
2 => "Bridge",
4 => "Sensor/Event",
6 => "App",
8 => "Firmware",
10 => "Storage",
12 => "Transport",
# do we need to define anymore then these?
);
my %payload_types = ( #help readability in certain areas of code by specifying payload by name rather than number
'ipmi' => 0,
'sol' => 1,
@@ -415,6 +473,12 @@ sub subcmd {
my %args = @_;
$self->{expectedcmd} = $args{command};
$self->{expectednetfn} = $args{netfn} + 1;
if ($self->{onlogon_args}->{xcatdebugmode}) {
my $command_string = $command_info{$args{netfn}}->{$args{command}};
my $data_values = join ", ", @{$args{data}};
my $msg = sprintf ("[ipmi_debug] $self->{onlogon_args}->{command}:$self->{onlogon_args}->{subcommand}(@{$self->{onlogon_args}->{extraargs}}), raw_cmd: netfn(0x%02x=>%s), cmd(0x%02x=>%s), data=[%s]", $args{netfn}, $netfn_types{$args{netfn}}, $args{command}, $command_string, $data_values);
xCAT::SvrUtils::sendmsg([0, $msg], $self->{onlogon_args}->{outfunc});
}
my $seqincrement = 7;
while ($tabooseq{ $self->{expectednetfn} }->{ $self->{expectedcmd} }->{ $self->{seqlun} } and $seqincrement) { #avoid using a seqlun formerly marked 'taboo', but don't advance by more than 7, just in case
$tabooseq{ $self->{expectednetfn} }->{ $self->{expectedcmd} }->{ $self->{seqlun} }--; #forgive a taboo lun over time...
+46
View File
@@ -0,0 +1,46 @@
#!/usr/bin/perl
## IBM(c) 2107 EPL license http://www.eclipse.org/legal/epl-v10.html
package xCAT::OPENBMC;
BEGIN
{
$::XCATROOT = $ENV{'XCATROOT'} ? $ENV{'XCATROOT'} : '/opt/xcat';
}
use lib "$::XCATROOT/lib/perl";
use strict;
use warnings "all";
use HTTP::Async;
use HTTP::Request;
use HTTP::Headers;
use HTTP::Cookies;
use Data::Dumper;
my $header = HTTP::Headers->new('Content-Type' => 'application/json');
sub new {
my $async = shift;
$async = shift if (($async) && ($async =~ /OPENBMC/));
my $url = shift;
my $content = shift;
my $method = 'POST';
my $id = send_request( $async, $method, $url, $content );
return $id;
}
sub send_request {
my $async = shift;
$async = shift if (($async) && ($async =~ /OPENBMC/));
my $method = shift;
my $url = shift;
my $content = shift;
my $request = HTTP::Request->new( $method, $url, $header, $content );
my $id = $async->add_with_opts($request, {});
return $id;
}
1;
+1 -1
View File
@@ -235,7 +235,7 @@ sub process_command {
if ($command eq 'rpower') { $subcommand = $request->{op}; }
#pdu commands will be handled in the pdu plugin
if(($subcommand eq 'pduoff') || ($subcommand eq 'pduon') || ($subcommand eq 'pdustat')){
if(($subcommand eq 'pduoff') || ($subcommand eq 'pduon') || ($subcommand eq 'pdustat') || ($subcommand eq 'pdureset')){
return 0;
}
+14 -9
View File
@@ -149,16 +149,21 @@ sub crypt_system_password {
"ERROR: Unable to get password from database table $table, key=$key");
return undef;
}
$cryptmethod = $data->{'cryptmethod'};
if (!$cryptmethod) {
# Use sha256 crypt method by default
$result = crypt($password, $CRYPT_METHOD{'sha256'} . xCAT::Utils::genpassword(8));
} elsif( defined($CRYPT_METHOD{$cryptmethod})) {
$result = crypt($password,
$CRYPT_METHOD{$cryptmethod} . xCAT::Utils::genpassword(8));
if (($password =~ /^\$1\$/) || ($password =~ /^\$5\$/) || ($password =~ /^\$6\$/)) {
# $password is already hashed
$result = $password;
} else {
xCAT::MsgUtils->message("S", "Unsupported crypt method $cryptmethod");
return undef;
$cryptmethod = $data->{'cryptmethod'};
if (!$cryptmethod) {
# Use sha256 crypt method by default
$result = crypt($password, $CRYPT_METHOD{'sha256'} . xCAT::Utils::genpassword(8));
} elsif( defined($CRYPT_METHOD{$cryptmethod})) {
$result = crypt($password,
$CRYPT_METHOD{$cryptmethod} . xCAT::Utils::genpassword(8));
} else {
xCAT::MsgUtils->message("S", "Unsupported crypt method $cryptmethod");
return undef;
}
}
return $result;
}
+7 -1
View File
@@ -1582,7 +1582,13 @@ sub dump_all_attribs_in_tabs
} else {
$values .= "$attrib=$val||";
if ($attrib =~ /^disable$/) {
$values .= "comments=$t";
# Updated on 2017-03-22 for issue 2634 Quotes in tables' comment field break mypostscript
# The original line is : $values .= "comments=$t";
# In order to fix issue 2634, change this line to : $values .= "comments=";
# To keep the free-style of comments and avoid the issues caused by special characters in
# the comments, the value of comments will not be appending to network related environment
# variables in mypostscript
$values .= "comments=";
}
}
}
+11 -4
View File
@@ -16,6 +16,7 @@ use xCAT::Utils;
use xCAT::TableUtils;
use xCAT::NetworkUtils;
use xCAT::PasswordUtils;
use xCAT::MsgUtils;
use XML::Simple;
BEGIN
@@ -852,7 +853,10 @@ sub windows_join_data {
}
unless ($adminuser and $adminpass) {
my $passtab = xCAT::Table->new('passwd', -create => 0);
unless ($passtab) { sendmsg([ 1, "Error authenticating to Active Directory" ], $node); return; }
unless ($passtab) {
xCAT::MsgUtils->message("SE", "[ERROR]$node: Error authenticating to Active Directory");
return;
}
my @adpents = $passtab->getAttribs({ key => 'activedirectory' }, [ 'username', 'password', 'authdomain' ]);
my $adpent;
foreach $adpent (@adpents) {
@@ -1411,7 +1415,10 @@ sub machinepassword {
$ENV{KRB5CCNAME} = "/tmp/xcat/krbcache.$realm.$$";
unless ($loggedrealms{$realm}) {
my $passtab = xCAT::Table->new('passwd', -create => 0);
unless ($passtab) { sendmsg([ 1, "Error authenticating to Active Directory" ], $node); return; }
unless ($passtab) {
xCAT::MsgUtils->message("SE", "[ERROR]$node: Error authenticating to Active Directory");
return;
}
my @adpents = $passtab->getAttribs({ key => 'activedirectory' }, [ 'username', 'password', 'authdomain' ]);
my $adpent;
my $username;
@@ -1452,7 +1459,7 @@ sub machinepassword {
}
}
unless ($server) {
sendmsg([ 1, "Unable to determine a directory server to communicate with, try site.directoryserver" ]);
xCAT::MsgUtils->message("SE", "[ERROR]Unable to determine a directory server to communicate with, try site.directoryserver");
return;
}
}
@@ -1589,7 +1596,7 @@ sub crydb
$kp{$k} = $v if defined($k);
}
return \%kp if %kp;
sendmsg([ 1, "Unable to parse password parameters $key" ]);
xCAT::MsgUtils->message("SE", "[ERROR]Unable to parse password parameters $key");
return undef;
};
$kp = $get_query_map->($key);
+1
View File
@@ -132,6 +132,7 @@ sub context_properties {
|| $ENV{'DSH_REPORTS_DIRECTORY'};
$properties{'DSH_SYNTAX'} = $ENV{'DSH_SYNTAX'};
$properties{'DSH_TIMEOUT'} = $ENV{'DSH_TIMEOUT'};
$properties{'DSH_VERIFY'} = $ENV{'DSH_VERIFY'};
$properties{'RSYNC_RSH'} = $ENV{'RSYNC_RSH'};
if ($ENV{'DSH_ON_HMC'}) {
+1 -1
View File
@@ -1279,7 +1279,7 @@ sub setup_HTTP
#-----------------------------------------------------------------------------
sub stop_TFTP
{
my $distro;
my $distro=xCAT::Utils->osver();
# Check whether the tftp-hpa has been installed, the ubuntu tftpd-hpa configure file is under /etc/default
unless (-x "/usr/sbin/in.tftpd" and (-e "/etc/xinetd.d/tftp" or -e "/etc/default/tftpd-hpa")) {
xCAT::MsgUtils->message("S", "ERROR: The tftpd was not installed, enable the tftp failed.");
+38 -17
View File
@@ -468,6 +468,7 @@ sub processArgs
undef $::opt_nics;
undef $::opt_setattr;
undef $::opt_template;
undef $::opt_cleanup;
# parse the options - include any option from all 4 cmds
Getopt::Long::Configure("no_pass_through");
@@ -497,6 +498,7 @@ sub processArgs
'nics' => \$::opt_nics,
'u' => \$::opt_setattr,
'template:s' => \$::opt_template,
'C|cleanup' => \$::opt_cleanup,
)
)
{
@@ -513,6 +515,13 @@ sub processArgs
return 2;
}
if (defined($::opt_cleanup) && ($::command ne "rmdef")) {
my $rsp;
$rsp->{data}->[0] = "Option \'-C\' can not be used with $::command.";
xCAT::MsgUtils->message("E", $rsp, $::callback);
return 2;
}
if (defined($::opt_setattr)) {
if (!$::opt_t && !$::filedata) {
$::opt_t = 'osimage';
@@ -4015,6 +4024,9 @@ sub defrm
# process the command line
my $rc = &processArgs;
# Issue info message if more than cleanup_msg_trigger nodes are being removed with --cleanup option
my $cleanup_msg_trigger = 100;
if ($rc != 0)
{
@@ -4258,24 +4270,33 @@ sub defrm
}
}
# Call nodeset offline on each node to cleanup its boot configuration files from /tftpboot directory
if ($doreq) {
# Go through each object and make sure it is a node type
my @allnodes;
foreach my $single_object (keys %objhash) {
if ($objhash{$single_object} eq "node") {
# build a list of nodes to offline
push @allnodes, $single_object;
if ($::opt_cleanup) {
# Call nodeset offline on each node to cleanup its boot configuration files from /tftpboot directory
if ($doreq) {
# Go through each object and make sure it is a node type
my @allnodes;
foreach my $single_object (keys %objhash) {
if ($objhash{$single_object} eq "node") {
# build a list of nodes to offline
push @allnodes, $single_object;
}
}
# If cleaning up (issuing nodeset offline) for more than cleanup_msg_trigger node,
# issue info message
if (@allnodes > $cleanup_msg_trigger) {
my $rsp;
$rsp->{data}->[0] = "Performing configuration cleanup. This might take a some time.";
xCAT::MsgUtils->message("I", $rsp, $::callback);
}
# Run nodeset offline and capture output.
# But the output can be ignored since we do not want to prevent user from doing rmdef if
# nodeset returns some error.
my @output = xCAT::Utils->runxcmd({
command => ['nodeset'],
node => [@allnodes],
arg => ['offline'],
}, $doreq, 0 ,1);
}
# Run nodeset offline and capture output.
# But the output can be ignored since we do not want to prevent user from doing rmdef if
# nodeset returns some error.
my @output = xCAT::Utils->runxcmd({
command => ['nodeset'],
node => [@allnodes],
arg => ['offline'],
}, $doreq, 0 ,1);
}
# remove the objects
@@ -4488,7 +4509,7 @@ sub defrm_usage
$rsp->{data}->[0] = "\nUsage: rmdef - Remove xCAT data object definitions.\n";
$rsp->{data}->[1] = " rmdef [-h | --help ] [-t object-types]\n";
$rsp->{data}->[2] = " rmdef [-V | --verbose] [-t object-types] [-a | --all] [-f | --force]";
$rsp->{data}->[3] = " [-o object-names] [-w attr=val,[attr=val...] [noderange]\n";
$rsp->{data}->[3] = " [-o object-names] [-C | --cleanup] [noderange]\n";
$rsp->{data}->[4] = "\nThe following data object types are supported by xCAT.\n";
my $n = 5;
+12 -3
View File
@@ -2218,7 +2218,8 @@ sub copycd
unless ($distname)
{
print "INFO - Could not find ID=$did in the discinfo database for OS=$desc ARCH=$darch NUM=$dno, attempt to auto-detect...\n";
print "INFO - Could not find ID=$did in the discinfo database for OS=$desc ARCH=$darch NUM=$dno\n";
print "INFO - Attempting to auto-detect...\n";
if ($desc =~ /IBM_PowerKVM/)
{
# check for PowerKVM support
@@ -2232,7 +2233,15 @@ sub copycd
# RHEL 7.3 description is: Red Hat Enterprise Linux 7.3
#
my @rhel_version = split / /, $desc;
$distname = "rhels" . $rhel_version[4];
#
# auto-detect pegas beta ISOs
#
if ( $rhel_version[4] =~ "Pegas") {
$distname = "rhels" . $rhel_version[5] . "-pegas";
}
else {
$distname = "rhels" . $rhel_version[4];
}
open($dinfo, $mntpath . "/.treeinfo");
while (<$dinfo>) {
chomp($_);
@@ -2297,7 +2306,7 @@ sub copycd
);
return;
}
print "INFO - detected distname=$distname, arch=$arch\n";
%{$request} = (); #clear request we've got it.
my $disccopiedin = 0;
+1 -1
View File
@@ -4401,7 +4401,7 @@ sub process_request {
else { $moreinfo = build_more_info($noderange, $callback); }
#pdu commands will be handled in the pdu plugin
if ($command eq "rpower" and grep(/^pduon|pduoff|pdustat$/, @exargs)) {
if ($command eq "rpower" and grep(/^pduon|pduoff|pdureset|pdustat$/, @exargs)) {
return;
}
@@ -896,6 +896,11 @@ sub bmcdiscovery_ipmi {
my $output = xCAT::Utils->runcmd("$icmd", -1);
if ($output =~ $bmcstr) {
if ($output =~ /RAKP 2 message indicates an error : (.+)\nError: (.+)/) {
xCAT::MsgUtils->message("E", { data => ["$2: $1 for $ip"] }, $::CALLBACK);
return 1;
}
# The output contains System Power indicated the username/password is correct, then try to get MTMS
if ($output =~ /System Power\s*:\s*\S*/) {
my $mtm = '';
@@ -921,6 +926,13 @@ sub bmcdiscovery_ipmi {
$serial = $2;
last;
}
if (($fru_output =~ /Product Manufacturer\s+:\s+(.*?)\s+P.*?roduct Name\s+:\s+(.*?)\s+P.*?roduct Serial\s+:\s+(\S+)/)) {
$mtm = $1.":".$2;
$serial = $3;
last;
}
}
}
@@ -939,6 +951,7 @@ sub bmcdiscovery_ipmi {
if ($mtm and $serial) {
$node = "node-$mtm-$serial";
$node =~ s/(.*)/\L$1/g;
$node =~ s/[\s:\._]/-/g;
}
} elsif ($output =~ /error : unauthorized name/) {
xCAT::MsgUtils->message("E", { data => ["BMC username is incorrect for $ip"] }, $::CALLBACK);
+6 -2
View File
@@ -226,6 +226,7 @@ sub makeconfluentcfg {
# Get db info for the nodes related to console
my $hmtab = xCAT::Table->new('nodehm');
my $nodepostab = xCAT::Table->new('nodepos');
my $mptab = xCAT::Table->new('mp');
my @cfgents1; # = $hmtab->getAllNodeAttribs(['cons','serialport','mgt','conserver','termserver','termport']);
my @cfgents2;
my @cfgents3;
@@ -234,7 +235,7 @@ sub makeconfluentcfg {
$explicitnodes = 1;
@cfgents1 = $hmtab->getNodesAttribs($nodes, [ 'node', 'cons', 'mgt', 'conserver', 'termserver', 'termport', 'consoleondemand' ]);
@cfgents2 = $nodepostab->getNodesAttribs($nodes, [ 'node', 'rack', 'u', 'chassis', 'slot', 'room' ]);
@cfgents3 = $nodepostab->getNodesAttribs($nodes, [ 'node', 'mpa', 'id' ]);
@cfgents3 = $mptab->getNodesAttribs($nodes, [ 'node', 'mpa', 'id' ]);
# Adjust the data structure to make the result consistent with the getAllNodeAttribs() call we make if a noderange was not specified
my @tmpcfgents1;
@@ -462,7 +463,7 @@ sub donodeent {
}
}
if (defined($cfgent->{consoleondemand})) {
if ($cfgent->{consoleondemand}) {
if ($cfgent->{consoleondemand} == 'yes') {
$parameters{'console.logging'} = 'none';
}
else {
@@ -471,6 +472,9 @@ sub donodeent {
} elsif ($::XCATSITEVALS{'consoleondemand'} and $::XCATSITEVALS{'consoleondemand'} !~ m/^n/) {
$parameters{'console.logging'} = 'none';
}
elsif ($::XCATSITEVALS{'consoleondemand'} and $::XCATSITEVALS{'consoleondemand'} == 'no') {
$parameters{'console.logging'} = 'full';
}
# ok, now for nodepos...
if (defined $cfgent->{u}) {
+5 -2
View File
@@ -145,8 +145,11 @@ sub process_request {
if ($path)
{
$path=Cwd::realpath($path);
unless(substr($path,0,length("/install")) eq "/install"){
if(-e $path) {
$path=Cwd::realpath($path);
}
unless((substr($path,0,length("/install/")) eq "/install/") or ($path eq "/install")){
$callback->({ warning => "copycds: the specified path \"$path\" is not a subdirectory under /install. Make sure this path is configured for httpd/apache, otherwise, the provisioning with this iso will fail!" });
}
push @{ $newreq->{arg} }, ("-p", $path);
+1 -1
View File
@@ -622,7 +622,7 @@ sub process_request {
} else {
# this host string might be a xcat group, try to test each node in the group
foreach my $host (noderange($hosts)) {
foreach my $host (xCAT::NodeRange->noderange($hosts)) {
unless (xCAT::NetworkUtils->thishostisnot($host)) {
$listenonifs = $dnsif;
last;
+12 -4
View File
@@ -114,6 +114,17 @@ sub setdestiny {
my $state = $ARGV[0];
my $reststates;
my $bptab = xCAT::Table->new('bootparams', -create => 1);
my %tempbh = %{ $bptab->getNodesAttribs(\@nodes, [qw(addkcmdline)]) };
while(my ($key, $value) = each(%tempbh)) {
if ($value && $value->[0]->{"addkcmdline"}) {
my $addkcmdline = $value->[0]->{"addkcmdline"};
# $key is node name
$bphash->{$key}->[0]->{"addkcmdline"} = $addkcmdline;
}
}
$bptab->close();
# to support the case that the state could be runimage=xxx,runimage=yyy,osimage=xxx
($state, $reststates) = split(/,/, $state, 2);
my %nstates;
@@ -389,10 +400,7 @@ sub setdestiny {
ignorekernelchk => $ignorekernelchk,
bootparams => \$bphash}, \&relay_response);
if ($errored) {
my @myself = xCAT::NetworkUtils->determinehostname();
my $myname = $myself[ (scalar @myself) - 1 ];
# The callback function point to xcatd::build_response, it use dclone to clone data, but it can only accept a reference. The error msg here is a simple string, and will cause dclone failed. Seems to be string array can be used by dclone.
$callback->({ errorcode => [1], error => ["Some nodes failed to set up $state resources on server $myname, aborting"] });
# The error messeage for mkinstall/mknetboot/mkstatelite had been output within relay_response function above, don't need to output more
return;
}
+4
View File
@@ -12,6 +12,10 @@ package xCAT_plugin::docker;
BEGIN
{
$::XCATROOT = $ENV{'XCATROOT'} ? $ENV{'XCATROOT'} : '/opt/xcat';
my $async_path = "/usr/local/share/perl5/";
unless (grep { $_ eq $async_path } @INC) {
push @INC, $async_path;
}
}
use lib "$::XCATROOT/lib/perl";
+5 -9
View File
@@ -407,7 +407,7 @@ sub process_request {
}
#pdu commands will be handled in the pdu plugin
if ($command eq "rpower" and grep(/^pduon|pduoff|pdustat$/, @exargs)) {
if ($command eq "rpower" and grep(/^pduon|pduoff|pdureset|pdustat$/, @exargs)) {
return;
}
#my $sitetab = xCAT::Table->new('site');
@@ -5131,14 +5131,10 @@ sub mkcommonboot {
$bptab->setNodeAttribs(
$node,
{
kernel => $kernel,
initrd => "",
kcmdline => $append
}
);
my $bootparams = ${$req->{bootparams}};
$bootparams->{$node}->[0]->{kernel} = $kernel;
$bootparams->{$node}->[0]->{kcmdline} = $append;
$bootparams->{$node}->[0]->{initrd} = "";
} # end of node loop
}
+6 -56
View File
@@ -304,66 +304,16 @@ sub deploy_genesis {
my ($node, $node_desc_ptr, $callback, $subreq) = @_;
my $outref = xCAT::Utils->runxcmd(
{
command => ['nodeset'],
command => ['rinstall'],
node => ["$node"],
arg => ['runcmd=getadapter'],
},
$subreq, 0, 1);
if ($::RUNCMD_RC != 0) {
$callback->({ error => "failed to run command: nodeset $node runcmd=getadapter", errorcode => 1 });
return 1;
}
# TODO: use rinstall to replace the following code when rinstall is ready.
if ($node_desc_ptr->{mgt} eq "ipmi") {
$outref = xCAT::Utils->runxcmd(
{
command => ["rsetboot"],
node => ["$node"],
arg => ['net'],
},
$subreq, 0, 1);
if ($::RUNCMD_RC != 0) {
$callback->({ error => "failed to run command: rsetboot $node net", errorcode => 1 });
return 1;
foreach my $out (@$outref) {
$callback->({data => "$out"})
}
$outref = xCAT::Utils->runxcmd(
{
command => ['rpower'],
node => ["$node"],
arg => ['reset'],
},
$subreq, 0, 1);
if ($::RUNCMD_RC != 0) {
$callback->({ error => "failed to run command: rpower $node reset", errorcode => 1 });
return 1;
}
} elsif ($node_desc_ptr->{mgt} eq "kvm") {
$outref = xCAT::Utils->runxcmd(
{
command => ['rpower'],
node => ["$node"],
arg => ['reset'],
},
$subreq, 0, 1);
if ($::RUNCMD_RC != 0) {
$callback->({ error => "failed to run command: rpower $node reset", errorcode => 1 });
return 1;
}
} elsif ($node_desc_ptr->{mgt} eq "hmc") {
$outref = xCAT::Utils->runxcmd(
{
command => ["rnetboot"],
node => ["$node"],
},
$subreq, 0, 1);
if ($::RUNCMD_RC != 0) {
$callback->({ error => "failed to run command: rnetboot $node", errorcode => 1 });
return 1;
}
} else {
$callback->({ error => "$node: The mgt configuration is not supported by getadapter.",
errorcode => 1 });
$callback->({ error => "failed to run command: rinstall $node runcmd=getadapter", errorcode => 1 });
return 1;
}
$callback->({ data => "$node: Booting into genesis, this could take several minutes..." });
@@ -495,8 +445,8 @@ sub update_adapter_result {
}
$callback->({ data => "$output" });
if (!$has_nic) {
$callback->({ data => "$node: Couldn't find interface name information detected by udevadm,"
. " the nics table will not be updated." });
$callback->({ data => "$node: nics talbe will not be updated as not any ".
"useful information could be found with udevadm command." });
return 0;
}
my $nics_table = xCAT::Table->new('nics');
+2 -2
View File
@@ -44,7 +44,7 @@ sub delnode
while ($idx <= $#hosts)
{
if (($ip and $hosts[$idx] =~ /^${ip}\s/)
or $hosts[$idx] =~ /^\d+\.\d+\.\d+\.\d+\s+${node}[\s\.r]/)
or $hosts[$idx] =~ /^\d+\.\d+\.\d+\.\d+\s+${node}[\s\.\r]/)
{
$hosts[$idx] = "";
}
@@ -74,7 +74,7 @@ sub addnode
{
if ($hosts[$idx] =~ /^${ip}\s/
or $hosts[$idx] =~ /^\d+\.\d+\.\d+\.\d+\s+${node}[\s\.r]/)
or $hosts[$idx] =~ /^\d+\.\d+\.\d+\.\d+\s+${node}[\s\.\r]/)
{
if ($foundone)
{
+1 -1
View File
@@ -647,7 +647,7 @@ sub process_request {
else { $moreinfo = build_more_info($noderange, $callback); }
#pdu commands will be handled in the pdu plugin
if ($command eq "rpower" and grep(/^pduon|pduoff|pdustat$/, @exargs)) {
if ($command eq "rpower" and grep(/^pduon|pduoff|pdureset|pdustat$/, @exargs)) {
return;
}
+1 -1
View File
@@ -362,7 +362,7 @@ sub process_request {
}
#pdu commands will be handled in the pdu plugin
if (($extrargs->[0] eq 'pdustat') || ($extrargs->[0] eq 'pduon') || ($extrargs->[0] eq 'pduoff')) {
if (($extrargs->[0] eq 'pdustat') || ($extrargs->[0] eq 'pdureset') || ($extrargs->[0] eq 'pduon') || ($extrargs->[0] eq 'pduoff')) {
return;
}
+87 -59
View File
@@ -43,6 +43,7 @@ my %allerrornodes = ();
my %newnodestatus = ();
my $global_sessdata;
my %child_pids;
my $xcatdebugmode = 0;
my $IPMIXCAT = "/opt/xcat/bin/ipmitool-xcat";
my $NON_BLOCK = 1;
@@ -1731,6 +1732,37 @@ sub do_firmware_update {
$ret = get_ipmitool_version(\$ipmitool_ver);
exit $ret if $ret < 0;
my $exit_with_error_func = sub {
my ($node, $callback, $message) = @_;
my $status = "failed to update firmware";
my $nodelist_table = xCAT::Table->new('nodelist');
if (!$nodelist_table) {
xCAT::MsgUtils->message("S", "Unable to open nodelist table, denying");
} else {
$nodelist_table->setNodeAttribs($node, { status => $status });
$nodelist_table->close();
}
xCAT::MsgUtils->message("S", $node.": ".$message);
$callback->({ error => "$node: $message", errorcode => 1 });
exit -1;
};
my $exit_with_success_func = sub {
my ($node, $callback, $message) = @_;
my $status = "success to update firmware";
my $nodelist_table = xCAT::Table->new('nodelist');
if (!$nodelist_table) {
xCAT::MsgUtils->message("S", "Unable to open nodelist table, denying");
} else {
$nodelist_table->setNodeAttribs($node, { status => $status });
$nodelist_table->close();
}
xCAT::MsgUtils->message("S", $node.": ".$message);
$callback->({ data => "$node: $message" });
exit 0;
};
# only 1.8.15 or above support hpm update for firestone machines.
if (calc_ipmitool_version($ipmitool_ver) < calc_ipmitool_version("1.8.15")) {
$callback->({ error => "IPMITool $ipmitool_ver do not support firmware update for " .
@@ -1741,9 +1773,8 @@ sub do_firmware_update {
if (($hpm_data_hash{deviceID} ne $sessdata->{device_id}) ||
($hpm_data_hash{productID} ne $sessdata->{prod_id}) ||
($hpm_data_hash{manufactureID} ne $sessdata->{mfg_id})) {
xCAT::SvrUtils::sendmsg([ 1, "The image file doesn't match this machine" ],
$callback, $sessdata->{node}, %allerrornodes);
exit -1;
$exit_with_error_func->($sessdata->{node}, $callback,
"The image file doesn't match this machine");
}
my $output;
@@ -1773,9 +1804,8 @@ sub do_firmware_update {
my $cmd = $pre_cmd . " fru print 3";
$output = xCAT::Utils->runcmd($cmd, -1);
if ($::RUNCMD_RC != 0) {
xCAT::SvrUtils::sendmsg([ 1, "Running ipmitool command $cmd failed: $output" ],
$callback, $sessdata->{node}, %allerrornodes);
exit -1;
$exit_with_error_func->($sessdata->{node}, $callback,
"Running ipmitool command $cmd failed: $output");
}
if ($output =~ /8335-GTB/) {
$buffer_size = "15000";
@@ -1786,18 +1816,16 @@ sub do_firmware_update {
$cmd = $pre_cmd . " fru print 47";
$output = xCAT::Utils->runcmd($cmd, -1);
if ($::RUNCMD_RC != 0) {
xCAT::SvrUtils::sendmsg([ 1, "Running ipmitool command $cmd failed: $output" ],
$callback, $sessdata->{node}, %allerrornodes);
exit -1;
$exit_with_error_func->($sessdata->{node}, $callback,
"Running ipmitool command $cmd failed: $output");
}
my $grs_version = $output =~ /OP8_v(\d*\.\d*_\d*\.\d*)/;
if ($grs_version =~ /\d\.(\d+)_(\d+\.\d+)/) {
my $prim_grs_version = $1;
my $sec_grs_version = $2;
if ($prim_grs_version <= 7 && $sec_grs_version < 2.55) {
xCAT::SvrUtils::sendmsg([ 1, "Error: Current firmware level OP8v_$grs_version requires one-time manual update to at least version OP8v_1.7_2.55" ],
$callback, $sessdata->{node}, %allerrornodes);
exit -1;
$exit_with_error_func->($sessdata->{node}, $callback,
"Error: Current firmware level OP8v_$grs_version requires one-time manual update to at least version OP8v_1.7_2.55");
}
}
}
@@ -1806,34 +1834,30 @@ sub do_firmware_update {
$cmd = $pre_cmd . " chassis power off";
$output = xCAT::Utils->runcmd($cmd, -1);
if ($::RUNCMD_RC != 0) {
xCAT::SvrUtils::sendmsg([ 1, "Running ipmitool command $cmd failed: $output" ],
$callback, $sessdata->{node}, %allerrornodes);
exit -1;
$exit_with_error_func->($sessdata->{node}, $callback,
"Running ipmitool command $cmd failed: $output");
}
# step 2 reset cold
$cmd = $pre_cmd . " mc reset cold";
$output = xCAT::Utils->runcmd($cmd, -1);
if ($::RUNCMD_RC != 0) {
xCAT::SvrUtils::sendmsg([ 1, "Running ipmitool command $cmd failed: $output" ],
$callback, $sessdata->{node}, %allerrornodes);
exit -1;
$exit_with_error_func->($sessdata->{node}, $callback,
"Running ipmitool command $cmd failed: $output");
}
# check reset status
unless (check_bmc_status_with_ipmitool($pre_cmd, 5, 24)) {
xCAT::SvrUtils::sendmsg([ 1, "Timeout to check the bmc status" ],
$callback, $sessdata->{node}, %allerrornodes);
exit -1;
unless (check_bmc_status_with_ipmitool($pre_cmd, 5, 60)) {
$exit_with_error_func->($sessdata->{node}, $callback,
"Timeout to check the bmc status");
}
# step 3 protect network
$cmd = $pre_cmd . " raw 0x32 0xba 0x18 0x00";
$output = xCAT::Utils->runcmd($cmd, -1);
if ($::RUNCMD_RC != 0) {
xCAT::SvrUtils::sendmsg([ 1, "Running ipmitool command $cmd failed: $output" ],
$callback, $sessdata->{node}, %allerrornodes);
exit -1;
$exit_with_error_func->($sessdata->{node}, $callback,
"Running ipmitool command $cmd failed: $output");
}
# step 4 upgrade firmware
@@ -1850,7 +1874,28 @@ sub do_firmware_update {
xCAT::SvrUtils::sendmsg([ 0,
"rflashing ... See the detail progress :\"tail -f $rflash_log_file\"" ],
$callback, $sessdata->{node});
exec($cmd);
$output = xCAT::Utils->runcmd($cmd, -1);
if ($::RUNCMD_RC != 0) {
$exit_with_error_func->($sessdata->{node}, $callback,
"Running ipmitool command $cmd failed: $output");
}
# step 5 power on
# check reset status
unless (check_bmc_status_with_ipmitool($pre_cmd, 5, 60)) {
$exit_with_error_func->($sessdata->{node}, $callback,
"Timeout to check the bmc status");
}
$cmd = $pre_cmd . " chassis power on";
$output = xCAT::Utils->runcmd($cmd, -1);
if ($::RUNCMD_RC != 0) {
$exit_with_error_func->($sessdata->{node}, $callback,
"Running ipmitool command $cmd failed: $output");
}
$exit_with_success_func->($sessdata->{node}, $callback,
"Success to update firmware. FRU information will be populated in a few minutes.");
}
sub rflash {
@@ -1996,29 +2041,8 @@ sub start_rflash_processes {
# Wait for all processes to end
while (keys %child_pids) {
my ($node_status, $rc, $cpid);
my $cpid;
if (($cpid = wait()) > 0) {
$rc = $?;
if (!grep(/^(-c|--check)$/i, @exargs)) {
$node_status->{node} = $child_pids{$cpid};
if ($rc == 0) {
$node_status->{status} = "success to update firmware";
} else {
$node_status->{status} = "failed to update firmware";
}
my $nodelist_table = xCAT::Table->new('nodelist');
if (!$nodelist_table) {
xCAT::MsgUtils->message("S", "Unable to open nodelist table, denying");
} else {
$nodelist_table->setNodeAttribs($node_status->{node},
{ status => $node_status->{status} });
$nodelist_table->close();
}
xCAT::MsgUtils->message("S",
$node_status->{node}.": ". $node_status->{status});
xCAT::SvrUtils::sendmsg([ $rc,
$node_status->{status} ], $callback, $node_status->{node});
}
delete $child_pids{$cpid};
}
}
@@ -2666,16 +2690,18 @@ sub add_textual_frus {
my $type = shift;
my $sessdata = shift;
unless ($type) { $type = 'hw'; }
if ($desc =~ /System Firmware/i and $category =~ /product/i) {
$type = 'firmware,bmc';
}
if ($desc =~ /NODE \d+/ and $category =~ /chassis/) {
if ( ($desc =~ /NODE \d+/ or $desc =~ /Backplane/) and $category =~ /chassis/) {
add_textual_fru($parsedfru, $desc . " " . $categorydesc . "Part Number", $category, "partnumber", 'model', $sessdata);
add_textual_fru($parsedfru, $desc . " " . $categorydesc . "Serial Number", $category, "serialnumber", 'serial', $sessdata);
} else {
add_textual_fru($parsedfru, $desc . " " . $categorydesc . "Part Number", $category, "partnumber", $type, $sessdata);
add_textual_fru($parsedfru, $desc . " " . $categorydesc . "Serial Number", $category, "serialnumber", $type, $sessdata);
}
add_textual_fru($parsedfru, $desc . " " . $categorydesc . "Manufacturer", $category, "manufacturer", $type, $sessdata);
add_textual_fru($parsedfru, $desc . " " . $categorydesc . "FRU Number", $category, "frunum", $type, $sessdata);
add_textual_fru($parsedfru, $desc . " " . $categorydesc . "Version", $category, "version", $type, $sessdata);
@@ -3035,6 +3061,7 @@ sub initfru_with_mprom {
sub process_currfruid {
my $rsp = shift;
my $sessdata = shift;
if ($rsp->{code} == 0xcb) {
$sessdata->{currfrudata} = "Not Present";
$sessdata->{currfrudone} = 1;
@@ -3285,7 +3312,7 @@ sub initfru_zero {
if ($_->{encoding} == 3) {
$fru->value($_->{value});
} else {
next;
next;
#print Dumper($_);
#print $_->{encoding};
@@ -3298,8 +3325,9 @@ sub initfru_zero {
if ($sessdata->{skipotherfru}) { #skip non-primary fru devices
if ($sessdata->{skipotherfru} and isopenpower($sessdata)) {
# For openpower servers, fru 3 is used to get MTM/Serial information, fru 47 is used to get firmware information
@{$sessdata->{frus_for_openpower}} = qw(3 47);
# For openpower Big Data servers, fru 2 has MTM/Serial and fru 43 has firmware information
# For openpower HPC servers, fru 3 has MTM/Serial and fru 47 has firmware information
@{$sessdata->{frus_for_openpower}} = qw(2 3 43 47);
my %fruids_hash = map {$_ => 1} @{$sessdata->{frus_for_openpower}};
foreach my $key (keys %{ $sessdata->{sdr_hash} }) {
my $sdr = $sessdata->{sdr_hash}->{$key};
@@ -3586,7 +3614,7 @@ sub add_fruhash {
$fru->rec_type("hw");
}
$fru->value($sessdata->{currfrudata});
if (exists($sessdata->{currfrusdr})) {
if ($sessdata->{currfrusdr}) {
$fru->desc($sessdata->{currfrusdr}->id_string);
}
$sessdata->{fru_hash}->{ $sessdata->{frudex} } = $fru;
@@ -3692,7 +3720,7 @@ sub readcurrfrudevice {
if ($data[0] != $sessdata->{currfruchunk}) {
# Fix FRU 43,48 and 49 for GRS server that they can not return as much data as shall return
if ($data[0] gt 0) {
if ($data[0] ge 0) {
$sessdata->{currfrudone} = 1;
} else {
my $text = "Received incorrect data from BMC for FRU ID: " . $sessdata->{currfruid};
@@ -4104,7 +4132,7 @@ sub parseboard {
my $macdata = $boardinf{extra}->[6]->{value};
my $macstring = "1";
my $macprefix;
while ($macstring !~ /00:00:00:00:00:00/ and not ref $global_sessdata->{currmacs}) {
while ($macdata and $macstring !~ /00:00:00:00:00:00/ and not ref $global_sessdata->{currmacs}) {
my @currmac = splice @$macdata, 0, 6;
unless ((scalar @currmac) == 6) {
last;
@@ -7682,7 +7710,7 @@ sub preprocess_request {
}
#pdu commands will be handled in the pdu plugin
if(($subcmd eq 'pduoff') || ($subcmd eq 'pduon') || ($subcmd eq 'pdustat')){
if(($subcmd eq 'pduoff') || ($subcmd eq 'pduon') || ($subcmd eq 'pdustat') || ($subcmd eq 'pdureset')){
return 0;
}
@@ -8162,6 +8190,7 @@ sub process_request {
if ($::XCATSITEVALS{ipmitimeout}) { $ipmitimeout = $::XCATSITEVALS{ipmitimeout} }
if ($::XCATSITEVALS{ipmiretries}) { $ipmitrys = $::XCATSITEVALS{ipmitretries} }
if ($::XCATSITEVALS{ipmisdrcache}) { $enable_cache = $::XCATSITEVALS{ipmisdrcache} }
if ($::XCATSITEVALS{xcatdebugmode}) { $xcatdebugmode = $::XCATSITEVALS{xcatdebugmode} }
#my @threads;
my @donargs = ();
@@ -8375,6 +8404,8 @@ sub donode {
command => $command,
extraargs => \@exargs,
subcommand => $exargs[0],
xcatdebugmode => $xcatdebugmode,
outfunc => $callback,
};
if ($sessiondata{$node}->{ipmisession}->{error}) {
xCAT::SvrUtils::sendmsg([ 1, $sessiondata{$node}->{ipmisession}->{error} ], $callback, $node, %allerrornodes);
@@ -8459,7 +8490,4 @@ sub genhwtree
}
1;
+14 -1
View File
@@ -1775,7 +1775,20 @@ sub rmvm {
foreach $disk (@purgedisks) {
my $disktype = $disk->parentNode()->getAttribute("device");
if ($disktype eq "cdrom") { next; }
my @driver = $disk->parentNode()->findnodes("driver");
unless ($driver[0]) { next; }
my $drivertype = $driver[0]->getAttribute("type");
if (($drivertype eq "raw") || ($disktype eq "block")) {
#For raw or block devices, do not remove, even if purge was specified. Log info message.
xCAT::MsgUtils->trace(0, "i", "Not purging raw or block storage device: $disk");
next;
}
my $file = $disk->getAttribute("file");
unless ($file) {
xCAT::MsgUtils->trace(0, "w", "Not able to find 'file' attribute value for: $disk");
next;
}
# try to check the existence first, if cannot find, do nothing.
# we do retry because we found sometimes the delete might fail
@@ -3662,7 +3675,7 @@ sub process_request {
}
#pdu commands will be handled in the pdu plugin
if ($command eq "rpower" and grep(/^pduon|pduoff|pdustat$/, @exargs)) {
if ($command eq "rpower" and grep(/^pduon|pduoff|pdureset|pdustat$/, @exargs)) {
return;
}
+7 -2
View File
@@ -152,7 +152,7 @@ sub preprocess_request
'h|help' => \$::HELP,
'v|version' => \$::VERSION))
{
&usage($cb);
&usage($cb,1);
return (1);
}
if ($::HELP) {
@@ -169,7 +169,7 @@ sub preprocess_request
my $nodes = $req->{node};
if (!$nodes)
{
&usage($cb);
&usage($cb,1);
return (1);
}
@@ -914,6 +914,7 @@ sub process_request {
}
if ($command eq "nodestat_internal") {
#if ( -x '/usr/bin/nmap' ) {
@@ -1210,10 +1211,14 @@ sub process_request {
sub usage
{
my $cb = shift;
my $retcode=shift;
my $rsp = {};
$rsp->{data}->[0] = "Usage:";
$rsp->{data}->[1] = " nodestat [noderange] [-m|--usemon] [-p|powerstat] [-u|--updatedb]";
$rsp->{data}->[2] = " nodestat [-h|--help|-v|--version]";
if($retcode){
$rsp->{errorcode}->[0]=$retcode;
}
xCAT::MsgUtils->message("I", $rsp, $cb);
}
+698
View File
@@ -0,0 +1,698 @@
#!/usr/bin/perl
## IBM(c) 2017 EPL license http://www.eclipse.org/legal/epl-v10.html
package xCAT_plugin::openbmc;
BEGIN
{
$::XCATROOT = $ENV{'XCATROOT'} ? $ENV{'XCATROOT'} : '/opt/xcat';
my $async_path = "/usr/local/share/perl5/";
unless (grep { $_ eq $async_path } @INC) {
push @INC, $async_path;
}
}
use lib "$::XCATROOT/lib/perl";
use strict;
use warnings "all";
use HTTP::Async;
use HTTP::Cookies;
use xCAT::OPENBMC;
use xCAT::Utils;
use xCAT::Table;
use xCAT::Usage;
use xCAT::SvrUtils;
use File::Basename;
use Data::Dumper;
use JSON;
$::OPENBMC_DEVEL = $ENV{'OPENBMC_DEVEL'};
sub unsupported {
my $callback = shift;
if (defined($::OPENBMC_DEVEL) && ($::OPENBMC_DEVEL eq "YES")) {
xCAT::SvrUtils::sendmsg("Warning: Currently running development code, use at your own risk. Unset OPENBMC_DEVEL and `restartxcatd` to disable.", $callback);
return;
} else {
return ([ 1, "This openbmc related function is unsupported and disabled. To bypass, run the following: \n\texport OPENBMC_DEVEL=YES\n\trestartxcatd" ]);
}
}
#-------------------------------------------------------
=head3 handled_commands
Return list of commands handled by this plugin
=cut
#-------------------------------------------------------
sub handled_commands {
return {
rpower => 'nodehm:mgt',
rinv => 'nodehm:mgt',
getopenbmccons => 'nodehm:cons',
rsetboot => 'nodehm:mgt',
rspconfig => 'nodehm:mgt',
rvitals => 'nodehm:mgt',
rflash => 'nodehm:mgt',
reventlog => 'nodehm:mgt',
rspreset => 'nodehm:mgt',
rbeacon => 'nodehm:mgt',
renergy => 'nodehm:mgt',
};
}
my $http_protocol="https";
my $openbmc_url = "/org/openbmc";
my $openbmc_project_url = "/xyz/openbmc_project";
#-------------------------------------------------------
# The hash table to store method and url for request,
# process function for response
#-------------------------------------------------------
my %status_info = (
LOGIN_REQUEST => {
method => "POST",
init_url => "/login",
},
LOGIN_RESPONSE => {
process => \&login_response,
},
RPOWER_ON_REQUEST => {
method => "PUT",
init_url => "$openbmc_project_url/state/host0/attr/RequestedHostTransition",
data => "xyz.openbmc_project.State.Host.Transition.On",
},
RPOWER_ON_RESPONSE => {
process => \&rpower_response,
},
RPOWER_OFF_REQUEST => {
method => "PUT",
init_url => "$openbmc_project_url/state/host0/attr/RequestedHostTransition",
data => "xyz.openbmc_project.State.Host.Transition.Off",
},
RPOWER_OFF_RESPONSE => {
process => \&rpower_response,
},
RPOWER_RESET_REQUEST => {
method => "PUT",
init_url => "$openbmc_project_url/state/host0/attr/RequestedHostTransition",
data => "xyz.openbmc_project.State.Host.Transition.Reboot",
},
RPOWER_RESET_RESPONSE => {
process => \&rpower_response,
},
RPOWER_STATUS_REQUEST => {
method => "GET",
init_url => "$openbmc_project_url/state/host0",
},
RPOWER_STATUS_RESPONSE => {
process => \&rpower_response,
},
RINV_REQUEST => {
method => "GET",
init_url => "$openbmc_url/inventory/enumerate",
},
RINV_RESPONSE => {
process => \&rinv_response,
},
);
#-----------------------------
=head3 %node_info
$node_info = (
$node => {
bmc => "x.x.x.x",
username => "username",
password => "password",
cur_status => "LOGIN_REQUEST",
cur_url => "",
method => "",
back_urls => (),
},
);
'cur_url', 'method', 'back_urls' used for path has a trailing-slash
=cut
#-----------------------------
my %node_info = ();
my %next_status = ();
my %handle_id_node = ();
my $wait_node_num;
my $async;
my $cookie_jar;
my $callback;
my %allerrornodes = ();
#-------------------------------------------------------
=head3 preprocess_request
preprocess the command
=cut
#-------------------------------------------------------
sub preprocess_request {
my $request = shift;
if (defined $request->{_xcatpreprocessed}->[0] and $request->{_xcatpreprocessed}->[0] == 1) {
return [$request];
}
$callback = shift;
my $command = $request->{command}->[0];
my $noderange = $request->{node};
my $extrargs = $request->{arg};
my @exargs = ($request->{arg});
my @requests;
if (ref($extrargs)) {
@exargs = @$extrargs;
}
my $usage_string = xCAT::Usage->parseCommand($command, @exargs);
if ($usage_string) {
$callback->({ data => [$usage_string] });
$request = {};
return;
}
my $parse_result = parse_args($command, $extrargs);
if (ref($parse_result) eq 'ARRAY') {
$callback->({ errorcode => $parse_result->[0], data => $parse_result->[1] });
$request = {};
return;
}
my $sn = xCAT::ServiceNodeUtils->get_ServiceNode($noderange, "xcat", "MN");
foreach my $snkey (keys %$sn) {
my $reqcopy = {%$request};
$reqcopy->{node} = $sn->{$snkey};
$reqcopy->{'_xcatdest'} = $snkey;
$reqcopy->{_xcatpreprocessed}->[0] = 1;
push @requests, $reqcopy;
}
return \@requests;
}
#-------------------------------------------------------
=head3 process_request
Process the command
=cut
#-------------------------------------------------------
sub process_request {
my $request = shift;
my $command = $request->{command}->[0];
my $noderange = $request->{node};
parse_node_info($noderange);
parse_command_status($command);
$cookie_jar = HTTP::Cookies->new({});
$async = HTTP::Async->new(
cookie_jar => $cookie_jar,
ssl_options => {
SSL_verify_mode => 0,
},
);
my $bmcip;
my $login_url;
my $handle_id;
my $content;
$wait_node_num = keys %node_info;
my @donargs = ();
foreach my $node (keys %node_info) {
$bmcip = $node_info{$node}{bmc};
$login_url = "$http_protocol://$bmcip/login";
$content = '{"data": [ "' . $node_info{$node}{username} .'", "' . $node_info{$node}{password} . '" ] }';
$handle_id = xCAT::OPENBMC->new($async, $login_url, $content);
$handle_id_node{$handle_id} = $node;
$node_info{$node}{cur_status} = $next_status{ $node_info{$node}{cur_status} };
print "$node: DEBUG POST $login_url -d $content\n";
push @donargs, [ $node,$bmcip,$node_info{$node}{username}, $node_info{$node}{password}];
}
#process rcons
if ($request->{command}->[0] eq "getopenbmccons") {
foreach (@donargs) {
getopenbmccons($_, $callback);
}
return;
}
while (1) {
last unless ($wait_node_num);
while (my ($response, $handle_id) = $async->wait_for_next_response) {
deal_with_response($handle_id, $response);
}
}
return;
}
#-------------------------------------------------------
=head3 parse_args
Parse the command line options and operands
=cut
#-------------------------------------------------------
sub parse_args {
my $command = shift;
my $extrargs = shift;
my $check = undef;
if (scalar(@ARGV) > 1) {
return ([ 1, "Only one option is supported at the same time" ]);
}
my $subcommand = $ARGV[0];
if ($command eq "rpower") {
#
# disable function until fully tested
#
$check = unsupported($callback); if (ref($check) eq "ARRAY") { return $check; }
if (!defined($extrargs)) {
return ([ 1, "No option specified for rpower" ]);
}
unless ($subcommand =~ /^on$|^off$|^reset$|^boot$|^status$|^stat$|^state$/) {
return ([ 1, "Unsupported command: $command $subcommand" ]);
}
} elsif ($command eq "rinv") {
#
# disable function until fully tested
#
$check = unsupported($callback); if (ref($check) eq "ARRAY") { return $check; }
unless ($subcommand =~ /^cpu$|^dimm$|^bios$|^all$/) {
return ([ 1, "Unsupported command: $command $subcommand" ]);
}
} else {
return ([ 1, "Command is not supported." ]);
}
return;
}
#-------------------------------------------------------
=head3 parse_command_status
Parse the command to init status machine
=cut
#-------------------------------------------------------
sub parse_command_status {
my $command = shift;
$next_status{LOGIN_REQUEST} = "LOGIN_RESPONSE";
if ($command eq "rpower") {
my $subcommand = $ARGV[0];
if ($subcommand eq "on") {
$next_status{LOGIN_RESPONSE} = "RPOWER_ON_REQUEST";
$next_status{RPOWER_ON_REQUEST} = "RPOWER_ON_RESPONSE";
} elsif ($subcommand eq "off") {
$next_status{LOGIN_RESPONSE} = "RPOWER_OFF_REQUEST";
$next_status{RPOWER_OFF_REQUEST} = "RPOWER_OFF_RESPONSE";
} elsif ($subcommand eq "reset") {
$next_status{LOGIN_RESPONSE} = "RPOWER_RESET_REQUEST";
$next_status{RPOWER_RESET_REQUEST} = "RPOWER_RESET_RESPONSE";
} elsif ($subcommand eq "status" or $subcommand eq "state" or $subcommand eq "stat") {
$next_status{LOGIN_RESPONSE} = "RPOWER_STATUS_REQUEST";
$next_status{RPOWER_STATUS_REQUEST} = "RPOWER_STATUS_RESPONSE";
} elsif ($subcommand eq "boot") {
$next_status{LOGIN_RESPONSE} = "RPOWER_STATUS_REQUEST";
$next_status{RPOWER_STATUS_REQUEST} = "RPOWER_STATUS_RESPONSE";
$next_status{RPOWER_STATUS_RESPONSE}{OFF} = "RPOWER_ON_REQUEST";
$next_status{RPOWER_ON_REQUEST} = "RPOWER_ON_RESPONSE";
$next_status{RPOWER_STATUS_RESPONSE}{ON} = "RPOWER_RESET_REQUEST";
$next_status{RPOWER_RESET_REQUEST} = "RPOWER_RESET_RESPONSE";
}
}
if ($command eq "rinv") {
my $subcommand = $ARGV[0];
if ($subcommand eq "cpu" or $subcommand eq "dimm" or $subcommand eq "bios" or $subcommand eq "all") {
$next_status{LOGIN_RESPONSE} = "RINV_REQUEST";
$next_status{RINV_REQUEST} = "RINV_RESPONSE";
$status_info{RINV_RESPONSE}{argv} = "$subcommand";
}
}
print Dumper(\%next_status) . "\n";
}
#-------------------------------------------------------
=head3 parse_node_info
Parse the node information: bmc, username, password
=cut
#-------------------------------------------------------
sub parse_node_info {
my $noderange = shift;
my $passwd_table = xCAT::Table->new('passwd');
my $passwd_hash = $passwd_table->getAttribs({ 'key' => 'openbmc' }, qw(username password));
my $openbmc_table = xCAT::Table->new('openbmc');
my $openbmc_hash = $openbmc_table->getNodesAttribs(\@$noderange, ['bmc', 'username', 'password']);
foreach my $node (@$noderange) {
if (defined($openbmc_hash->{$node}->[0])) {
if ($openbmc_hash->{$node}->[0]->{'bmc'}) {
$node_info{$node}{bmc} = $openbmc_hash->{$node}->[0]->{'bmc'};
} else {
xCAT::SvrUtils::sendmsg("Unable to get attribute bmc", $callback, $node);
next;
}
if ($openbmc_hash->{$node}->[0]->{'username'}) {
$node_info{$node}{username} = $openbmc_hash->{$node}->[0]->{'username'};
} elsif ($passwd_hash and $passwd_hash->{username}) {
$node_info{$node}{username} = $passwd_hash->{username};
} else {
xCAT::SvrUtils::sendmsg("Unable to get attribute username", $callback, $node);
delete $node_info{$node};
next;
}
if ($openbmc_hash->{$node}->[0]->{'password'}) {
$node_info{$node}{password} = $openbmc_hash->{$node}->[0]->{'password'};
} elsif ($passwd_hash and $passwd_hash->{password}) {
$node_info{$node}{password} = $passwd_hash->{password};
} else {
xCAT::SvrUtils::sendmsg("Unable to get attribute password", $callback, $node);
delete $node_info{$node};
next;
}
$node_info{$node}{cur_status} = "LOGIN_REQUEST";
} else {
xCAT::SvrUtils::sendmsg("Unable to get information from openbmc table", $callback, $node);
next;
}
}
print Dumper(\%node_info) ."\n";
return;
}
#-------------------------------------------------------
=head3 gen_send_request
Generate request's information
If the node has method itself, use it as request's method.
If not, use method %status_info defined.
If the node has cur_url, check whether also has sub_urls.
If has, request's url is join cur_url and one in sub_urls(use one at once to check which is needed).
If not, use method %status_info defined.
use xCAT::OPENBMC->send_request send request
store handle_id and mapping node
Input:
$node: nodename of current node
=cut
#-------------------------------------------------------
sub gen_send_request {
my $node = shift;
my $method;
my $request_url;
my $content;
if ($node_info{$node}{method}) {
$method = $node_info{$node}{method};
} else {
$method = $status_info{ $node_info{$node}{cur_status} }{method};
}
if ($status_info{ $node_info{$node}{cur_status} }{data}) {
$content = '{"data":"' . $status_info{ $node_info{$node}{cur_status} }{data} . '"}';
}
if ($node_info{$node}{cur_url}) {
$request_url = $node_info{$node}{cur_url};
} else {
$request_url = $status_info{ $node_info{$node}{cur_status} }{init_url};
}
$request_url = "$http_protocol://" . $node_info{$node}{bmc} . $request_url;
my $handle_id = xCAT::OPENBMC->send_request($async, $method, $request_url, $content);
$handle_id_node{$handle_id} = $node;
$node_info{$node}{cur_status} = $next_status{ $node_info{$node}{cur_status} };
my $debug_info;
if ($method eq "GET") {
$debug_info = "$node: DEBUG $method $request_url";
} else {
$debug_info = "$node: DEBUG $method $request_url -d $content";
}
print "$debug_info\n";
return;
}
#-------------------------------------------------------
=head3 deal_with_response
Check response's status_line and
Input:
$handle_id: Async return ID with response
$response: Async return response
=cut
#-------------------------------------------------------
sub deal_with_response {
my $handle_id = shift;
my $response = shift;
my $node = $handle_id_node{$handle_id};
delete $handle_id_node{$handle_id};
if ($response->status_line ne "200 OK") {
my $error;
if ($response->status_line eq "503 Service Unavailable") {
$error = "Service Unavailable";
} else {
my $response_info = decode_json $response->content;
if ($response->status_line eq "500 Internal Server Error") {
$error = $response_info->{'data'}->{'exception'};
} elsif ($response_info->{'data'}->{'description'} =~ /path or object not found: (.+)/) {
$error = "path or object not found $1";
} else {
$error = $response_info->{'data'}->{'description'};
}
}
xCAT::SvrUtils::sendmsg([1, $error], $callback, $node);
$wait_node_num--;
return;
}
print "$node: DEBUG " . lc ($node_info{$node}{cur_status}) . " " . $response->status_line . "\n";
$status_info{ $node_info{$node}{cur_status} }->{process}->($node, $response);
return;
}
#-------------------------------------------------------
=head3 login_response
Deal with response of login
Input:
$node: nodename of current response
$response: Async return response
=cut
#-------------------------------------------------------
sub login_response {
my $node = shift;
my $response = shift;
if ($next_status{ $node_info{$node}{cur_status} }) {
$node_info{$node}{cur_status} = $next_status{ $node_info{$node}{cur_status} };
gen_send_request($node);
}
return;
}
#-------------------------------------------------------
=head3 rpower_response
Deal with response of rpower command
Input:
$node: nodename of current response
$response: Async return response
=cut
#-------------------------------------------------------
sub rpower_response {
my $node = shift;
my $response = shift;
my $response_info = decode_json $response->content;
if ($node_info{$node}{cur_status} eq "RPOWER_ON_RESPONSE") {
if ($response_info->{'message'} eq "200 OK") {
xCAT::SvrUtils::sendmsg("on", $callback, $node);
}
}
if ($node_info{$node}{cur_status} eq "RPOWER_OFF_RESPONSE") {
if ($response_info->{'message'} eq "200 OK") {
xCAT::SvrUtils::sendmsg("off", $callback, $node);
}
}
if ($node_info{$node}{cur_status} eq "RPOWER_RESET_RESPONSE") {
if ($response_info->{'message'} eq "200 OK") {
xCAT::SvrUtils::sendmsg("reset", $callback, $node);
}
}
if ($node_info{$node}{cur_status} eq "RPOWER_STATUS_RESPONSE") {
xCAT::SvrUtils::sendmsg($response_info->{'data'}->{CurrentHostState}, $callback, $node);
}
if ($next_status{ $node_info{$node}{cur_status} }) {
if ($node_info{$node}{cur_status} eq "RPOWER_STATUS_RESPONSE") {
if ($response_info->{'data'}->{CurrentHostState} =~ /Off$/) {
$node_info{$node}{cur_status} = $next_status{ $node_info{$node}{cur_status} }{OFF};
} else {
$node_info{$node}{cur_status} = $next_status{ $node_info{$node}{cur_status} }{ON};
}
} else {
$node_info{$node}{cur_status} = $next_status{ $node_info{$node}{cur_status} };
}
gen_send_request($node);
} else {
$wait_node_num--;
}
return;
}
#-------------------------------------------------------
=head3 rinv_response
Deal with response of rinv command
Input:
$node: nodename of current response
$response: Async return response
=cut
#-------------------------------------------------------
sub rinv_response {
my $node = shift;
my $response = shift;
my $response_info = decode_json $response->content;
my $grep_string = $status_info{RINV_RESPONSE}{argv};
my $src;
my $content_info;
foreach my $key_url (keys %{$response_info->{data}}) {
if ($grep_string eq "all" or $key_url =~ /\/$grep_string/) {
if ($key_url =~ /\/(cpu\d*)\/(\w+)/) {
$src = "$1 $2";
} else {
$src = basename $key_url;
}
my %content = %{ ${ $response_info->{data} }{$key_url} };
foreach my $key (keys %content) {
$content_info = uc ($src) . " " . $key . " : " . $content{$key};
xCAT::SvrUtils::sendmsg("$content_info", $callback, $node);
}
}
}
if ($next_status{ $node_info{$node}{cur_status} }) {
$node_info{$node}{cur_status} = $next_status{ $node_info{$node}{cur_status} };
gen_send_request($node);
} else {
$wait_node_num--;
}
return;
}
#-------------------------------------------------------
=head3 getopenbmccons
Process getopenbmccons
=cut
#-------------------------------------------------------
sub getopenbmccons {
my $argr = shift;
#$argr is [$node,$bmcip,$nodeuser,$nodepass];
my $callback = shift;
my $rsp;
my $node=$argr->[0];
my $output = "openbmc, getopenbmccoms";
xCAT::SvrUtils::sendmsg($output, $callback, $argr->[0], %allerrornodes);
$rsp = { node => [ { name => [ $argr->[0] ] } ] };
$rsp->{node}->[0]->{bmcip}->[0] = $argr->[1];
$rsp->{node}->[0]->{username}->[0] = $argr->[2];
$rsp->{node}->[0]->{passwd}->[0] = $argr->[3];
$callback->($rsp);
return $rsp;
}
1;
+80 -21
View File
@@ -40,6 +40,10 @@ use SNMP;
my $VERBOSE = 0;
my %allerrornodes = ();
my $callback;
my $pdutab;
my @pduents;
my $pdunodes;
#-------------------------------------------------------
@@ -126,14 +130,22 @@ sub process_request
@exargs = @$extrargs;
}
#fill in the total outlet count for each pdu
$pdutab = xCAT::Table->new('pdu');
@pduents = $pdutab->getAllNodeAttribs(['node', 'outlet']);
fill_outletCount(\@pduents, $callback);
if( $command eq "rinv") {
#for higher performance, handle node in batch
return powerstat($noderange, $callback);
}elsif ($command eq "rpower") {
my $subcmd = $exargs[0];
if(($subcmd eq 'on') || ($subcmd eq 'off') || ($subcmd eq 'stat')){
if (($subcmd eq 'pduoff') || ($subcmd eq 'pduon') || ($subcmd eq 'pdustat')|| ($subcmd eq 'pdureset') ){
#if one day, pdu node have pdu attribute, handle in this section too
return powerpduoutlet($noderange, $subcmd, $callback);
} else {
#-------------------------------------------
#there are 2 cases will enter this black
#there are 2 cases will enter this block
#one is if node's mgt is pdu
#another is if node has pdu attribute but mgt isn't pdu
#if the node has pdu attribute but mgt isn't pdu,
@@ -147,16 +159,17 @@ sub process_request
push @allpdunodes, $node;
}
}
return powerpdu(\@allpdunodes, $subcmd, $callback);
}elsif(($subcmd eq 'pduoff') || ($subcmd eq 'pduon') || ($subcmd eq 'pdustat')){
#if one day, pdu node have pdu attribute, handle in this section too
return powerpduoutlet($noderange, $subcmd, $callback);
}else{
$callback->({ errorcode => [1],error => "The input command $subcmd is not support for pdu"});
if(@allpdunodes) {
if(($subcmd eq 'on') || ($subcmd eq 'off') || ($subcmd eq 'stat') || ($subcmd eq 'state') || ($subcmd eq 'reset') ){
return powerpdu(\@allpdunodes, $subcmd, $callback);
} else {
my $pdunode = join (",", @allpdunodes);
$callback->({ errorcode => [1],error => "The option $subcmd is not support for pdu node(s) $pdunode."});
}
}
}
}elsif($command eq "nodeset") {
$callback->({ errorcode => [1],error => "The input $command is not support for pdu"});
$callback->({ errorcode => [1],error => "The input $command is not support for pdu"});
}else{
#reserve for other new command in future
}
@@ -164,6 +177,31 @@ sub process_request
return;
}
sub fill_outletCount {
my $pduentries = shift;
my $callback = shift;
my $outletoid = ".1.3.6.1.4.1.2.6.223.8.2.1.0";
my $pdutab = xCAT::Table->new('pdu');
foreach my $pdu (@$pduentries) {
my $cur_pdu = $pdu->{node};
my $count = $pdu->{outlet};
#get total outlet number for the pdu
if (!$count) {
my $session = connectTopdu($cur_pdu,$callback);
#will not log this error to output
if (!$session) {
next;
}
$count = $session->get("$outletoid");
if ($count) {
$pdutab->setNodeAttribs($cur_pdu, {outlet => $count});
}
}
$pdunodes->{$cur_pdu}->{outlet}=$count;
}
}
#-------------------------------------------------------
=head3 powerpdu
@@ -177,30 +215,36 @@ sub powerpdu {
my $noderange = shift;
my $subcmd = shift;
my $callback = shift;
my $outletnum = ".1.3.6.1.4.1.2.6.223.8.2.1.0";
if ($subcmd eq "stat") {
if (($subcmd eq "stat") || ($subcmd eq "state")){
return powerstat($noderange, $callback);
}
foreach my $node (@$noderange) {
my $session = connectTopdu($node,$callback);
my $count = $session->get("$outletnum");
if (!$session) {
$callback->({ errorcode => [1],error => "Couldn't connect to $node"});
next;
}
my $count = $pdunodes->{$node}->{outlet};
my $value;
my $statstr;
if ($subcmd eq "off") {
$value = 0;
$statstr = "off";
} else {
} elsif ( $subcmd eq "on") {
$value = 1;
$statstr = "on";
} else {
$value = 2;
$statstr = "reset";
}
for (my $outlet =1; $outlet <= $count; $outlet++)
{
outletpower($session, $outlet, $value);
if ($session->{ErrorStr}) {
$callback->({ error => "$session->{ErrorStr}"});
$callback->({ errorcode => [1],error => "Failed to get outlet status for $node"});
} else {
my $output = " outlet $outlet is $statstr";
xCAT::SvrUtils::sendmsg($output, $callback, $node, %allerrornodes);
@@ -244,6 +288,14 @@ sub powerpduoutlet {
foreach my $pdu_outlet (@pdus) {
my ($pdu, $outlet) = split /:/, $pdu_outlet;
my $session = connectTopdu($pdu,$callback);
if (!$session) {
$callback->({ errorcode => [1],error => "Couldn't connect to $pdu"});
next;
}
if ($outlet > $pdunodes->{$pdu}->{outlet} ) {
$callback->({ errorcode => [1],error => "outlet number $outlet is invalid for $pdu"});
next;
}
my $cmd;
if ($subcmd eq "pdustat") {
$statstr=outletstat($session, $outlet);
@@ -255,12 +307,16 @@ sub powerpduoutlet {
$value = 1;
$statstr = "on";
outletpower($session, $outlet, $value);
} elsif ($subcmd eq "pdureset") {
$value = 2;
$statstr = "reset";
outletpower($session, $outlet, $value);
} else {
$callback->({ error => "$subcmd is not support"});
}
if ($session->{ErrorStr}) {
$callback->({ error => "$session->{ErrorStr}"});
$callback->({ errorcode => [1],error => "$session->{ErrorStr} for $pdu outlet $outlet"});
} else {
$output = "$pdu outlet $outlet is $statstr";
xCAT::SvrUtils::sendmsg($output, $callback, $node, %allerrornodes);
@@ -304,10 +360,13 @@ sub powerstat {
my $callback = shift;
my $output;
my $outletnum = ".1.3.6.1.4.1.2.6.223.8.2.1.0";
foreach my $pdu (@$noderange) {
my $session = connectTopdu($pdu,$callback);
my $count = $session->get("$outletnum");
if (!$session) {
$callback->({ errorcode => [1],error => "Couldn't connect to $pdu"});
next;
}
my $count = $pdunodes->{$pdu}->{outlet};
for (my $outlet =1; $outlet <= $count; $outlet++)
{
my $statstr = outletstat($session, $outlet);
@@ -337,8 +396,10 @@ sub outletstat {
$output = $session->get("$oid.$outlet");
if ($output eq 1) {
$statstr = "on";
} else {
} elsif ($output eq 0) {
$statstr = "off";
} else {
return;
}
return $statstr;
}
@@ -368,8 +429,6 @@ sub connectTopdu {
UseSprintValue => 1,
);
unless ($session) {
$msg = "Failed to connect to $pdu";
xCAT::SvrUtils::sendmsg($msg, $callback, $pdu, %allerrornodes);
return;
}
return $session;
@@ -5,6 +5,7 @@ use File::Path;
use Getopt::Long;
use xCAT::Table;
use Sys::Syslog;
use xCAT::Scope;
my $globaltftpdir = xCAT::TableUtils->getTftpDir();
+1 -1
View File
@@ -127,7 +127,7 @@ sub preprocess_request {
}
#pdu commands will be handled in the pdu plugin
if (($extraargs->[0] eq 'pdustat') || ($extraargs->[0] eq 'pduon') || ($extraargs->[0] eq 'pduoff')) {
if (($extraargs->[0] eq 'pdustat') || ($extraargs->[0] eq 'pdureset') || ($extraargs->[0] eq 'pduon') || ($extraargs->[0] eq 'pduoff')) {
return;
}
+2 -2
View File
@@ -218,9 +218,9 @@ sub rinstall {
}
my $nodetypearch = $nodetypeattribs->{'arch'};
if ($nodetypearch ne $osimagearch) {
unless ((($nodetypearch =~ /ppc64le/) or ($nodetypearch =~ /ppc64el/)) and (($osimagearch =~ /ppc64le/) or ($osimagearch =~ /ppc64el/))) {
unless(($nodetypearch =~ /^ppc64(le|el)?$/i) and ($osimagearch =~ /^ppc64(le|el)?$/i)){
my $rsp = {};
$rsp->{error}->[0] = "$node: The value of 'arch' attribute is not same as the 'osarch' attribute for osimage.";
$rsp->{error}->[0] = "$node: The value of 'arch' attribute of node does not match the 'osarch' attribute of osimage.";
$rsp->{errorcode}->[0] = 1;
xCAT::MsgUtils->message("E", $rsp, $callback);
next;
+32 -1
View File
@@ -181,6 +181,8 @@ sub process_request {
system("mkdir -p $rootimg_dir/xcatpost");
system("cp -r $installroot/postscripts/* $rootimg_dir/xcatpost/");
# update rw to ro for sles
updateFstab($rootimg_dir,$profile,$arch);
#get the root password for the node
my $pass = xCAT::PasswordUtils::crypt_system_password();
@@ -258,7 +260,6 @@ sub process_request {
return;
}
# now get the files for the node
my @synclist = xCAT::Utils->runcmd("ilitefile $imagename", 0, 1);
unless (@synclist) {
@@ -569,6 +570,8 @@ sub process_request {
system("rm -f $xcat_packimg_tmpfile");
}
chdir($oldpath);
}
sub liteMe {
@@ -968,5 +971,33 @@ sub liteItem {
}
}
=head3
updateFstab
=cut
sub updateFstab {
$rootimg_dir = shift;
$profile = shift;
$arch = shift;
my $rootfs_name = $profile . "_" . $arch;
my $tfstab;
open($tfstab, "<", "$rootimg_dir/etc/fstab");
my @fsdents = <$tfstab>;
close($tfstab);
open($tfstab, ">", "$rootimg_dir/etc/fstab");
foreach my $line (@fsdents) {
if ( $line =~ /^$rootfs_name/ ) {
$line =~ s/\brw\b/ro/;
}
print $tfstab $line;
}
close($tfstab);
}
1;
+18 -7
View File
@@ -23,6 +23,7 @@ use Socket;
use Expect;
#global variables for this module
my $community;
my %globalopt;
my @filternodes;
my @iprange;
@@ -949,6 +950,13 @@ sub snmp_scan {
send_msg($request, 0, "$result\n" );
}
my @lines = split /\n/, $result;
#set community string for switch
$community = "public";
my @snmpcs = xCAT::TableUtils->get_site_attribute("snmpc");
my $tmp = $snmpcs[0];
if (defined($tmp)) { $community = $tmp }
foreach my $line (@lines) {
my @array = split / /, $line;
@@ -1008,8 +1016,8 @@ sub get_snmpvendorinfo {
#Ubuntu only takes OID
#my $ccmd = "snmpwalk -Os -v1 -c public $ip sysDescr.0";
my $ccmd = "snmpwalk -Os -v1 -c public $ip 1.3.6.1.2.1.1.1";
#get sysDescr.0";
my $ccmd = "snmpwalk -Os -v1 -c $community $ip 1.3.6.1.2.1.1.1";
if (exists($globalopt{verbose})) {
send_msg($request, 0, "Process command: $ccmd\n");
}
@@ -1047,8 +1055,8 @@ sub get_snmpmac {
my $mac;
#Ubuntu only takes OID
#my $ccmd = "snmpwalk -Os -v1 -c public $ip ipNetToMediaPhysAddress | grep $ip";
my $ccmd = "snmpwalk -Os -v1 -c public $ip 1.3.6.1.2.1.4.22.1.2 | grep $ip";
#get ipNetToMediaPhysAddress;
my $ccmd = "snmpwalk -Os -v1 -c $community $ip 1.3.6.1.2.1.4.22.1.2 | grep $ip";
if (exists($globalopt{verbose})) {
send_msg($request, 0, "Process command: $ccmd\n");
@@ -1091,8 +1099,8 @@ sub get_snmphostname {
my $hostname;
#Ubuntu only takes OID
#my $ccmd = "snmpwalk -Os -v1 -c public $ip sysName";
my $ccmd = "snmpwalk -Os -v1 -c public $ip 1.3.6.1.2.1.1.5";
#get sysName info;
my $ccmd = "snmpwalk -Os -v1 -c $community $ip 1.3.6.1.2.1.1.5";
if (exists($globalopt{verbose})) {
send_msg($request, 0, "Process command: $ccmd\n");
}
@@ -1415,7 +1423,10 @@ sub matchPredefineSwitch {
send_msg($request, 0, "Switch discovered and matched: $dswitch to $node" );
xCAT::Utils->runxcmd({ command => ['chdef'], arg => ['-t','node','-o',$node,"otherinterfaces=$ip",'status=Matched',"mac=$mac","switchtype=$stype","usercomment=$vendor"] }, $sub_req, 0, 1);
# only write to xcatdb if -w or --setup option specified
if ( (exists($globalopt{w})) || (exists($globalopt{setup})) ) {
xCAT::Utils->runxcmd({ command => ['chdef'], arg => ['-t','node','-o',$node,"otherinterfaces=$ip",'status=Matched',"mac=$mac","switchtype=$stype","usercomment=$vendor"] }, $sub_req, 0, 1);
}
push (@{$configswitch->{$stype}}, $node);
}
+12 -34
View File
@@ -175,15 +175,10 @@ sub winshell {
} else {
mkwinlinks($node, $oshash->{$node}->[0]);
}
my $bptab = xCAT::Table->new('bootparams', -create => 1);
$bptab->setNodeAttribs(
$node,
{
kernel => "Boot/pxeboot.0",
initrd => "",
kcmdline => ""
}
);
my $bootparams = ${$request->{bootparams}};
$bootparams->{$node}->[0]->{kernel} = "Boot/pxeboot.0";
$bootparams->{$node}->[0]->{kcmdline} = "";
$bootparams->{$node}->[0]->{initrd} = "";
}
}
@@ -245,7 +240,7 @@ sub mkinstall
my $node;
my $ostab = xCAT::Table->new('nodetype');
my %doneimgs;
my $bptab = xCAT::Table->new('bootparams', -create => 1);
my $bootparams = ${$request->{bootparams}};
my $hmtab = xCAT::Table->new('nodehm');
my $vpdtab = xCAT::Table->new('vpd');
my $vpdhash = $vpdtab->getNodesAttribs(\@nodes, ['uuid']);
@@ -365,16 +360,11 @@ sub mkinstall
} else {
mkwinlinks($node, $ent);
}
$bootparams->{$node}->[0]->{kcmdline} = "";
$bootparams->{$node}->[0]->{initrd} = "";
if ($arch =~ /x86_64/)
{
$bptab->setNodeAttribs(
$node,
{
kernel => "Boot/pxeboot.0",
initrd => "",
kcmdline => ""
}
);
$bootparams->{$node}->[0]->{kernel} = "Boot/pxeboot.0";
} elsif ($arch =~ /x86/) {
unless (-r "$tftpdir/Boot/pxeboot32.0") {
my $origpxe;
@@ -402,14 +392,7 @@ sub mkinstall
print $bootmgr $_;
}
}
$bptab->setNodeAttribs(
$node,
{
kernel => "Boot/pxeboot32.0",
initrd => "",
kcmdline => ""
}
);
$bootparams->{$node}->[0]->{kernel} = "Boot/pxeboot32.0";
}
next;
}
@@ -500,14 +483,9 @@ sub mkinstall
} elsif (-r $installroot . "/$os/$arch/sources/install.wim") {
if ($arch =~ /x86/)
{
$bptab->setNodeAttribs(
$node,
{
kernel => "$winpepath" . "Boot/pxeboot.0",
initrd => "",
kcmdline => ""
}
);
$bootparams->{$node}->[0]->{kcmdline} = "";
$bootparams->{$node}->[0]->{initrd} = "";
$bootparams->{$node}->[0]->{kernel} = "Boot/pxeboot.0";
}
}
else
+1 -1
View File
@@ -706,7 +706,7 @@ sub process_request {
}
#pdu commands will be handled in the pdu plugin
if ($command eq "rpower" and grep(/^pduon|pduoff|pdustat$/, @exargs)) {
if ($command eq "rpower" and grep(/^pduon|pduoff|pdureset|pdustat$/, @exargs)) {
return;
}
+1 -1
View File
@@ -2319,7 +2319,7 @@ sub powerVM {
my $out;
##pdu commands will be handled in the pdu plugin
if ($args->[0] eq 'pduon' || $args->[0] eq 'pduoff' || $args->[0] eq 'pdustat') {
if ($args->[0] eq 'pduon' || $args->[0] eq 'pdureset' || $args->[0] eq 'pduoff' || $args->[0] eq 'pdustat') {
return;
}
+22 -2
View File
@@ -969,6 +969,10 @@ sub genSSHNodeHostKey
#
# generate new hostkeys
#
my ($rlogin,$rpass,$ruid,$rgid) = getpwnam("root");
my ($sname, $spasswd,$sgid,$smembers)=getgrnam("ssh_keys");
my @sshkeylist;
xCAT::MsgUtils->message('I', "Generating new node hostkeys...");
xCAT::MsgUtils->message('I', "Generating SSH2 RSA Key...");
my $cmd =
@@ -978,6 +982,10 @@ sub genSSHNodeHostKey
{
xCAT::MsgUtils->message('E', "Could not generate SSH2 RSA key.");
}
else{
push @sshkeylist,"/etc/xcat/hostkeys/ssh_host_rsa_key";
}
xCAT::MsgUtils->message('I', "Generating SSH2 DSA Key...");
$cmd =
@@ -987,6 +995,9 @@ sub genSSHNodeHostKey
{
xCAT::MsgUtils->message('E', "Could not generate SSH2 DSA key.");
}
else{
push @sshkeylist,"/etc/xcat/hostkeys/ssh_host_dsa_key";
}
# see if this system supports the ecdsa
xCAT::Utils->runcmd('rm -rf /tmp/ecdsa_key >/dev/null 2>&1 ; /usr/bin/ssh-keygen -t ecdsa -f /tmp/ecdsa_key -P "" &>/dev/null', 0);
@@ -999,8 +1010,17 @@ sub genSSHNodeHostKey
{
xCAT::MsgUtils->message('E', "Could not generate SSH2 ECDSA key.");
}
else{
push @sshkeylist,"/etc/xcat/hostkeys/ssh_host_ecdsa_key";
}
}
if(@sshkeylist){
if(defined $ruid && defined $sgid){
chown $ruid,$sgid,@sshkeylist;
}
chmod 0640,@sshkeylist;
}
# copy the public keys to install directory
$cmd =
@@ -1542,7 +1562,7 @@ sub genCredentials
my ($cmd, $outref, $rc);
$rc = getgrnam($user);
if (!$rc) {
$cmd = "groupadd $user";
$cmd = "groupadd --system $user";
$outref = xCAT::Utils->runcmd("$cmd", 0);
if ($::RUNCMD_RC != 0) {
xCAT::MsgUtils->message('E', "$cmd failed");
@@ -1551,7 +1571,7 @@ sub genCredentials
}
$rc = getpwnam($user);
if (!$rc) {
$cmd = "useradd -g $user -s /bin/bash -d /home/$user -m $user";
$cmd = "useradd --system -g $user -s /bin/bash -d /home/$user -m $user";
$outref = xCAT::Utils->runcmd("$cmd", 0);
if ($::RUNCMD_RC != 0) {
xCAT::MsgUtils->message('E', "$cmd failed");
+1
View File
@@ -2843,6 +2843,7 @@ sub service_connection {
}
} else {
my %resp = (error => "Permission denied for request");
$resp{errorcode}=1;
$resp{serverdone} = [undef];
if ($req->{transid}) {
$resp{transid} = $req->{transid}->[0];
+98
View File
@@ -0,0 +1,98 @@
#!/usr/bin/env perl
# IBM(c) 2017 EPL license http://www.eclipse.org/legal/epl-v10.html
use Fcntl qw(:DEFAULT :flock);
use Time::HiRes qw(sleep);
use File::Path;
BEGIN {
$::XCATROOT = $ENV{'XCATROOT'} ? $ENV{'XCATROOT'} : -d '/opt/xcat' ? '/opt/xcat' : '/usr';
}
my $sleepint = int(rand(10)); #Stagger start to avoid overwhelming conserver/xCATd
my ($lockfd, $bmcip);
my $username = 'root';
my $password = '0penBmc';
my $node = $ARGV[0];
use constant CONSOLE_LOCK_FILE => "/tmp/xcat/consolelock";
use constant CONSOLE_LOCK_DIR => "/tmp/xcat";
sub acquire_lock {
umask 0077;
mkpath(CONSOLE_LOCK_DIR);
print "Acquiring startup lock...";
unless (sysopen($lockfd, CONSOLE_LOCK_FILE, O_WRONLY | O_CREAT)) {
print "Unable to open file ".CONSOLE_LOCK_FILE."\n";
sleep(15);
exit 1;
}
unless (flock($lockfd, LOCK_EX)) {
print "Unable to lock file ".CONSOLE_LOCK_FILE."\n";
close($lockfd);
sleep(15);
exit 1;
}
print "done\n";
unless (syswrite($lockfd, $$, length($$))) {
print "Unable to write file ".CONSOLE_LOCK_FILE."\n";
close($lockfd);
sleep(15);
exit 1;
}
}
sub release_lock {
flock($lockfd, LOCK_UN);
close($lockfd);
}
use lib "$::XCATROOT/lib/perl";
require xCAT::Client;
sub getans {
my $rsp = shift;
if ($rsp->{node}) {
$bmcip = $rsp->{node}->[0]->{bmcip}->[0];
$username = $rsp->{node}->[0]->{username}->[0];
$password = $rsp->{node}->[0]->{passwd}->[0];
if (exists $rsp->{node}->[0]->{error}) {
my $error = $rsp->{node}->[0]->{error}->[0];
print "$error\n";
}
print "$bmcip, $username, $password\n";
}
}
my $cmdref = {
command => ["getopenbmccons"],
arg => ["text"],
noderange => [ $ARGV[0] ]
};
acquire_lock();
# avoid of congestion
sleep(0.1);
release_lock();
xCAT::Client::submit_request($cmdref, \&getans);
until (($username or $password) and $bmcip ) {
#Let other clients have a go
$sleepint = 10 + int(rand(20));
print "Console not ready, retrying in $sleepint seconds (Ctrl-e,c,o to skip delay) \n";
sleep ($sleepint);
acquire_lock();
sleep(0.1);
release_lock();
xCAT::Client::submit_request($cmdref, \&getans);
}
my $isintel = 0;
my $sleepint;
my $rc;
my $sshport = 2200;
if ($ENV{SSHCONSOLEPORT}) {
$sshport= $ENV{SSHCONSOLEPORT};
}
print "If the console cannot connect, please verify whether ssh keys has been configured on the bmc for $username user\n";
exec "ssh -p $sshport -l $username $bmcip";
@@ -180,6 +180,7 @@ echo "
# global value to store the running status of the postbootscripts,the value is non-zero if one postbootscript failed
return_value=0
# subroutine used to run postscripts
# \$1 argument is the script type
# rest argument is the script name and arguments
@@ -202,7 +203,6 @@ run_ps () {
fi
if [ -f \$1 ]; then
echo \"\`date\` Running \$scriptype: \$1\"
msgutil_r \"\$MASTER_IP\" \"info\" "\"\`date\` Running \$scriptype: \$1\"" \"\$logfile\"
if [ \"\$XCATDEBUGMODE\" = \"1\" ] || [ \"\$XCATDEBUGMODE\" = \"2\" ]; then
local compt=\$(file \$1)
@@ -211,25 +211,24 @@ run_ps () {
bash -x ./\$@ 2>&1
ret_local=\$?
else
./\$@ 2>&1 | tee -a \$logfile | logger -t xcat -p debug
./\$@ 2>&1 | logger -t xcat -p debug
ret_local=\${PIPESTATUS[0]}
fi
else
./\$@ 2>&1 | tee -a \$logfile
./\$@ 2>&1
ret_local=\${PIPESTATUS[0]}
fi
if [ \"\$ret_local\" -ne \"0\" ]; then
return_value=\$ret_local
fi
echo \"\$scriptype: \$1 exited with code \$ret_local\"
msgutil_r \"\$MASTER_IP\" \"info\" "\"\`date\` \$scriptype \$1 return with \$ret_local\"" \"\$logfile\"
else
echo \"\`date\` \$scriptype \$1 does NOT exist.\"
msgutil_r \"\$MASTER_IP\" \"info\" "\"\`date\` \$scriptype \$1 does NOT exist.\"" \"\$logfile\"
return_value=-1
fi
return 0
}
# subroutine end
@@ -392,6 +391,19 @@ fi
#create the preboot script and run here
TMP=`sed "/^#\s*postbootscripts-start-here/,/^#\s*postbootscripts-end-here/ d" /xcatpost/mypostscript`
echo "$TMP" > /xcatpost/mypostscript
echo "
#save bad return code to /opt/xcat/xcatinfo
if [ \"\$return_value\" -ne \"0\" ]; then
grep 'POSTSCRIPTS_RC' /opt/xcat/xcatinfo > /dev/null 2>&1
if [ \$? -eq 0 ]; then
sed -i \"s/POSTSCRIPTS_RC=.*/POSTSCRIPTS_RC=1/\" /opt/xcat/xcatinfo
else
echo \"POSTSCRIPTS_RC=1\" >> /opt/xcat/xcatinfo
fi
fi
" >> /xcatpost/mypostscript
chmod 755 /xcatpost/mypostscript
export ARCH=#TABLE:nodetype:THISNODE:arch#
@@ -386,7 +386,7 @@ while (scalar @checkdeps) {
unless (grep { $_ eq $dep } @ndrivers) { #only add if not added
unshift(@checkdeps, $dep); #recursively check dependencies
unshift(@ndrivers, $dep);
print "Added $dep as an autodetected depedency\n";
print "Added $dep as an autodetected dependency\n";
}
}
}
@@ -384,7 +384,7 @@ while (scalar @checkdeps) {
unless (grep { $_ eq $dep } @ndrivers) { #only add if not added
unshift(@checkdeps, $dep); #recursively check dependencies
unshift(@ndrivers, $dep);
print "Added $dep as an autodetected depedency\n";
print "Added $dep as an autodetected dependency\n";
}
}
}
@@ -393,7 +393,7 @@ while (scalar @checkdeps) {
unless (grep { $_ eq $dep } @ndrivers) { #only add if not added
unshift(@checkdeps, $dep); #recursively check dependencies
unshift(@ndrivers, $dep);
print "Added $dep as an autodetected depedency\n";
print "Added $dep as an autodetected dependency\n";
}
}
}
@@ -1,6 +1,5 @@
#!/bin/sh
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offs
et: 4; -*-
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
# ex: ts=8 sw=4 sts=4 et filetype=sh
# Parses the syslog commandline options
+2 -2
View File
@@ -686,7 +686,7 @@ while (scalar @checkdeps) {
foreach $dep (@deps) {
$dep =~ s/.*\///;
unless (grep { $_ eq $dep } @ndrivers) { #only add if not added
print "Added $dep as an autodetected depedency\n";
print "Added $dep as an autodetected dependency\n";
}
unshift(@checkdeps, $dep); #recursively check dependencies
unshift(@ndrivers, $dep);
@@ -1140,7 +1140,7 @@ sub mkinitrd {
unless (grep { $_ eq $dep } @ndrivers) { #only add if not added
unshift(@checkdeps, $dep); #recursively check dependencies
unshift(@ndrivers, $dep);
print "Added $dep as an autodetected depedency\n";
print "Added $dep as an autodetected dependency\n";
}
}
}
@@ -402,7 +402,7 @@ while (scalar @checkdeps) {
unless (grep { $_ eq $dep } @ndrivers) { #only add if not added
unshift(@checkdeps, $dep); #recursively check dependencies
unshift(@ndrivers, $dep);
print "Added $dep as an autodetected depedency\n";
print "Added $dep as an autodetected dependency\n";
}
}
}
@@ -134,13 +134,16 @@ function getdevfrommac() {
done
}
for lf in /tmp/dhclient.*.lease; do
netif=${lf#*.}
netif=${netif%.*}
cp $lf "$NEWROOT/var/lib/dhclient/dhclient-$netif.leases"
done
if [ -f $NEWROOT/etc/hostname ]; then
echo `hostname -s` > $NEWROOT/etc/hostname
fi
if [ ! -z "$ifname" ]; then
MACX=${ifname#*:}
ETHX=${ifname%:$MACX*}
+1 -1
View File
@@ -925,7 +925,7 @@ while (scalar @checkdeps) {
foreach $dep (@deps) {
$dep =~ s/.*\///;
unless (grep { $_ eq $dep } @ndrivers) { #only add if not added
print "Added $dep as an autodetected depedency\n";
print "Added $dep as an autodetected dependency\n";
}
unshift(@checkdeps, $dep); #recursively check dependencies
unshift(@ndrivers, $dep);
@@ -715,7 +715,7 @@ while (scalar @checkdeps) {
unless (grep { $_ eq $dep } @ndrivers) { #only add if not added
unshift(@checkdeps, $dep); #recursively check dependencies
unshift(@ndrivers, $dep);
print "Added $dep as an autodetected depedency\n";
print "Added $dep as an autodetected dependency\n";
}
}
}

Some files were not shown because too many files have changed in this diff Show More