mirror of
https://github.com/xcat2/xcat-core.git
synced 2026-06-25 00:40:48 +00:00
Merge branch 'master' into ZVM_XCAT_DEV
This commit is contained in:
@@ -2,11 +2,6 @@
|
||||
|
||||
The latest docs are here: http://xcat-docs.readthedocs.io/en/latest/
|
||||
|
||||
Status:
|
||||
[](http://xcat-docs.readthedocs.io/en/latest/?badge=latest)
|
||||
[](http://xcat-docs.readthedocs.io/en/2.11/?badge=2.11)
|
||||
|
||||
|
||||
The documentation project is written in restructured text (.rst) using Sphinx and hosted on ReadTheDocs.
|
||||
|
||||
## Building Documentation
|
||||
|
||||
@@ -109,4 +109,39 @@ In order to utilize ``xcatprobe switch_macmap``, snmp needs to be enabled. To e
|
||||
|
||||
updatenode frame01sw1 -P enablesnmp
|
||||
|
||||
To configuring SNMPv3 after enable snmp, set user, authentication and/or encryption for the switches: ::
|
||||
|
||||
chdef frame01sw1 snmpauth=sha snmppassword=xcatpassw0rd snmpprivacy=DES snmpusername=xcatadmin
|
||||
|
||||
then execute the ``configonie`` command to add the snmp user for the switch: ::
|
||||
|
||||
/opt/xcat/share/xcat/scripts/configonie --switches frame01sw1 --snmp
|
||||
|
||||
To verify the SNMPv3 configuration, run ``xcatprobe switch_macmap`` command, will show following results: ::
|
||||
|
||||
#xcatprobe switch_macmap frame01sw1 -V
|
||||
<INFO>frame1sw1: Attempting to refresh switch information...
|
||||
<INFO>frame1sw1: Generate SNMP session with parameter:
|
||||
'UseNumeric' => '1'
|
||||
'SecName' => 'xcatadmin'
|
||||
'AuthPass' => 'xcatpassw0rd'
|
||||
'Version' => '3'
|
||||
'PrivProto' => 'DES'
|
||||
'DestHost' => '172.21.253.102'
|
||||
'SecLevel' => 'authPriv'
|
||||
'AuthProto' => 'SHA'
|
||||
'PrivPass' => 'xcatpassw0rd'
|
||||
<INFO>frame1sw1: SNMP Session query OID:".1.3.6.1.2.1.31.1.1.1.1"
|
||||
<INFO>frame1sw1: SNMP Session get data for OID:".1.3.6.1.2.1.31.1.1.1.1":
|
||||
'1' => 'lo'
|
||||
'2' => 'eth0'
|
||||
'3' => 'swp1'
|
||||
'4' => 'swp2'
|
||||
'5' => 'swp3'
|
||||
|
||||
...........................more output.....................
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -11,4 +11,3 @@ The sections are organized based on hardware architecture.
|
||||
|
||||
ppc64le/index.rst
|
||||
x86_64/index.rst
|
||||
openbmc/index.rst
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
Configure passwords
|
||||
===================
|
||||
|
||||
Configure the passwords for Management modules of the compute nodes.
|
||||
|
||||
* For OpenBMC managed systems: ::
|
||||
|
||||
chtab key=openbmc passwd.username=root passwd.password=0penBMC
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
OpenPOWER (OpenBMC managed)
|
||||
===========================
|
||||
|
||||
The following sections document the procedures in managing OpenPOWER servers in an xCAT cluster.
|
||||
OpenPower servers are machines that use IBM Power Architecture and are **OpenBMC** managed.
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
|
||||
configure.rst
|
||||
openbmc.rst
|
||||
@@ -1,60 +0,0 @@
|
||||
Manually Define Nodes
|
||||
=====================
|
||||
|
||||
If admin knows the detailed information of the physical server, ``mkdef`` command can be used to manually define it into xCAT database.
|
||||
|
||||
In this document, the following configuration is used as an example
|
||||
|
||||
Compute Node info::
|
||||
|
||||
CN Hostname: cn1
|
||||
BMC Address: 50.0.101.1
|
||||
OpenBMC username: root
|
||||
OpenBMC Password: 0penBMC
|
||||
|
||||
Run ``mkdef`` command to define the node: ::
|
||||
|
||||
mkdef -t node cn1 groups=openbmc,all mgt=openbmc cons=openbmc bmc=50.0.101.1 bmcusername=root bmcpassword=0penBmc
|
||||
|
||||
The manually defined node will be ::
|
||||
|
||||
# lsdef cn1
|
||||
Object name: cn1
|
||||
bmc=50.0.101.1
|
||||
bmcpassword=0penBmc
|
||||
bmcusername=root
|
||||
cons=openbmc
|
||||
groups=openbmc,all
|
||||
mgt=openbmc
|
||||
postbootscripts=otherpkgs
|
||||
postscripts=syslog,remoteshell,syncfiles
|
||||
|
||||
Hardware Management
|
||||
===================
|
||||
|
||||
Remote Power Control
|
||||
````````````````````
|
||||
|
||||
``rpower`` command can be used to control the power of a remote physical machine. ::
|
||||
|
||||
rpower cn1 on
|
||||
rpower cn1 off
|
||||
rpower cn1 boot
|
||||
rpower cn1 reset
|
||||
|
||||
To get the current rpower state of a machine: ::
|
||||
|
||||
# rpower cn1 state
|
||||
cn1: on
|
||||
|
||||
Remote Console
|
||||
``````````````
|
||||
|
||||
``rcons`` command can be used to get command line remote console.
|
||||
|
||||
#. Make sure the ``conserver`` is configured by running ``makeconservercf cn1``.
|
||||
|
||||
#. Start command line remote console: ::
|
||||
|
||||
rcons cn1
|
||||
|
||||
@@ -3,46 +3,45 @@ Configure passwords
|
||||
|
||||
#. Configure the system password for the ``root`` user on the compute nodes.
|
||||
|
||||
* Set using the :doc:`chtab </guides/admin-guides/references/man8/chtab.8>` command: (**Recommended**) ::
|
||||
* Set using the :doc:`chtab </guides/admin-guides/references/man8/chtab.8>` command: ::
|
||||
|
||||
chtab key=system passwd.username=root passwd.password=abc123
|
||||
chtab key=system passwd.username=root passwd.password=abc123
|
||||
|
||||
To encrypt the password using ``openssl``, use the following command: ::
|
||||
To encrypt the password using ``openssl``, use the following command: ::
|
||||
|
||||
chtab key=system passwd.username=root passwd.password=`openssl passwd -1 abc123`
|
||||
|
||||
* Directly edit the passwd table using the :doc:`tabedit </guides/admin-guides/references/man8/tabedit.8>` command.
|
||||
chtab key=system passwd.username=root passwd.password=`openssl passwd -1 abc123`
|
||||
|
||||
|
||||
#. Configure the passwords for Management modules of the compute nodes.
|
||||
|
||||
* For OpenBMC managed systems: ::
|
||||
|
||||
chtab key=openbmc passwd.username=root passwd.password=0penBmc
|
||||
|
||||
* For IPMI/BMC managed systems: ::
|
||||
|
||||
chtab key=ipmi passwd.username=USERID passwd.password=PASSW0RD
|
||||
chtab key=ipmi passwd.username=ADMIN passwd.password=admin
|
||||
|
||||
* For HMC managed systems: ::
|
||||
|
||||
chtab key=hmc passwd.username=hscroot passwd.password=abc123
|
||||
|
||||
The username and password for the HMC can be assigned directly to the HMC node object definition in xCAT. This is needed when the HMC username/password is different for each HMC. ::
|
||||
|
||||
mkdef -t node -o hmc1 groups=hmc,all nodetype=ppc hwtype=hmc mgt=hmc \
|
||||
username=hscroot password=hmcPassw0rd
|
||||
If the username/password is different for multiple HMCs, set the ``username`` and ``password`` attribute for each HMC node object in xCAT
|
||||
|
||||
* For Blade managed systems: ::
|
||||
|
||||
chtab key=blade passwd.username=USERID passwd.password=PASSW0RD
|
||||
|
||||
* For FSP/BPA (Flexible Service Processor/Bulk Power Assembly), if the passwords are set to the factory defaults, you must change them before running and commands to them. ::
|
||||
* For FSP/BPA (Flexible Service Processor/Bulk Power Assembly) the factory default passwords must be changed before running commands against them. ::
|
||||
|
||||
rspconfig frame general_passwd=general,<newpassword>
|
||||
rspconfig frame admin_passwd=admin,<newpassword>
|
||||
rspconfig frame HMC_passwd=,<newpassword>
|
||||
|
||||
|
||||
#. If the REST API is being used configure a user and set a policy rule in xCAT.
|
||||
#. If using the xCAT REST API
|
||||
|
||||
#. Create a non root user that will be used to make the REST API calls. ::
|
||||
#. Create a non-root user that will be used to make the REST API calls. ::
|
||||
|
||||
useradd xcatws
|
||||
passwd xcatws # set the password
|
||||
@@ -56,4 +55,4 @@ Configure passwords
|
||||
mkdef -t policy 6 name=xcatws rule=allow
|
||||
|
||||
|
||||
When making calls to the xCAT REST API, pass in the credentials using the following attributes: ``userName`` and ``userPW``
|
||||
When making calls to the xCAT REST API, pass in the credentials using the following attributes: ``userName`` and ``userPW``
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
IBM Power LE / OpenPOWER
|
||||
=========================
|
||||
|
||||
The following sections documents the procedures in managing IBM Power LE (Little Endian) / OpenPOWER servers in an xCAT cluster.
|
||||
These are machines use the IBM Power Architecture and is **IPMI** managed.
|
||||
Most of the content is general information for xCAT, the focus and examples are for management of IBM OpenPower servers.
|
||||
|
||||
IBM OpenPower Servers
|
||||
* based on Power8 Processor Technology is IPMI managed
|
||||
* based on Power9 Processor Technology is OpenBmc managed [**Alpha**]
|
||||
|
||||
|
||||
.. toctree::
|
||||
@@ -10,7 +13,7 @@ These are machines use the IBM Power Architecture and is **IPMI** managed.
|
||||
|
||||
configure/index.rst
|
||||
discovery/index.rst
|
||||
management.rst
|
||||
management/index.rst
|
||||
diskful/index.rst
|
||||
diskless/index.rst
|
||||
statelite/index.rst
|
||||
|
||||
@@ -1,124 +0,0 @@
|
||||
Hardware Management
|
||||
===================
|
||||
|
||||
Basic Operation
|
||||
---------------
|
||||
|
||||
The Beacon Light
|
||||
````````````````
|
||||
|
||||
Most of modern enterprise level server machines have LEDs installed on their front panel and/or rear panel, which are called beacon lights. When this light has been turned on, the system administrator can use this light to indicate one physical machine out of a bunch of enclosures in a server frame. It makes life easier.
|
||||
|
||||
With xCAT, the end user can turn the beacon light on or off with the commands show below. ::
|
||||
|
||||
rbeacon cn1 on
|
||||
rbeacon cn1 off
|
||||
|
||||
The current state of the beacon light can not be queried remotely. As a workaround, one can always use the ``rbeacon`` command to turn all the beacon lights in one frame off, and then turn a particular beacon light on. ::
|
||||
|
||||
rbeacon a_group_of_cn off
|
||||
rbeacon cn5 on
|
||||
|
||||
Remote Power Control
|
||||
````````````````````
|
||||
|
||||
The next important thing is to control the power of a remote physical machine. For this purpose, ``rpower`` command is involved. ::
|
||||
|
||||
rpower cn1 on
|
||||
rpower cn1 off
|
||||
|
||||
In order to reboot a remote physical machine, run ::
|
||||
|
||||
rpower cn1 boot
|
||||
|
||||
Or do a hardware reset, run ::
|
||||
|
||||
rpower cn1 reset
|
||||
|
||||
Get the current rpower state of a machine, refer to the example below. ::
|
||||
|
||||
# rpower cn1 state
|
||||
cn1: Running
|
||||
|
||||
Remote Console
|
||||
``````````````
|
||||
|
||||
Most enterprise level servers do not have video adapters installed with the machine. Meaning, the end user can not connect a monitor to the machine and get display output. In most cases, the console can be viewed using the serial port or LAN port, through Serial-over-LAN. Serial cable or network cable are used to get a command line interface of the machine. From there, the end user can get the basic machine booting information, firmware settings interface, local command line console, etc.
|
||||
|
||||
In order to get the command line console remotely. xCAT provides the ``rcons`` command.
|
||||
|
||||
#. Make sure the ``conserver`` is configured by running ``makeconservercf``.
|
||||
|
||||
#. Check if the ``conserver`` is up and running ::
|
||||
|
||||
ps ax | grep conserver
|
||||
|
||||
#. If ``conserver`` is not running, start ::
|
||||
|
||||
[sysvinit] service conserver start
|
||||
[systemd] systemctl start conserver.service
|
||||
|
||||
or restart, if changes to the configuration were made ::
|
||||
|
||||
[sysvinit] service conserver restart
|
||||
[systemd] systemctl restart conserver.service
|
||||
|
||||
|
||||
#. After that, you can get the command line console for a specific machine with the ``rcons`` command ::
|
||||
|
||||
rcons cn1
|
||||
|
||||
Advanced operation
|
||||
------------------
|
||||
|
||||
Remote Hardware Inventory
|
||||
`````````````````````````
|
||||
|
||||
When you have a lot of physical machines in one place, the most important thing is identify which is which. Mapping the model type and/or serial number of a machine with its host name. Command ``rinv`` is involved in such a situation. With this command, most of the important information to distinct one machine from all the others can be obtained remotely.
|
||||
|
||||
To get all the hardware information, which including the model type, serial number, firmware version, detail configuration, et al. ::
|
||||
|
||||
rinv cn1 all
|
||||
|
||||
As an example, in order to get only the information of firmware version, the following command can be used. ::
|
||||
|
||||
rinv cn1 firm
|
||||
|
||||
Remote Hardware Vitals
|
||||
``````````````````````
|
||||
|
||||
Collect runtime information from running physical machine is also a big requirement for real life system administrators. This kind of information includes, temperature of CPU, internal voltage of particular socket, wattage with workload, speed of cooling fan, et al.
|
||||
|
||||
In order to get such information, use ``rvitals`` command. This kind of information varies among different model types of the machine. Thus, check the actual output of the ``rvitals`` command against your machine, to verify which kinds of information can be extracted. The information may change after the firmware update of the machine. ::
|
||||
|
||||
rvitals cn1 all
|
||||
|
||||
As an example, get only the temperature information of a particular machine. ::
|
||||
|
||||
rvitals cn1 temp
|
||||
|
||||
Firmware Updating
|
||||
`````````````````
|
||||
|
||||
For OpenPOWER machines, use the ``rflash`` command to update firmware.
|
||||
|
||||
Check firmware version of the node and the HPM file: ::
|
||||
|
||||
rflash cn1 -c /firmware/8335_810.1543.20151021b_update.hpm
|
||||
|
||||
Update node firmware to the version of the HPM file
|
||||
|
||||
::
|
||||
|
||||
rflash cn1 /firmware/8335_810.1543.20151021b_update.hpm
|
||||
|
||||
Configures Nodes' Service Processors
|
||||
````````````````````````````````````
|
||||
|
||||
Here comes the command, ``rspconfig``. It is used to configure the service processor of a physical machine. On a OpenPower system, the service processor is the BMC, Baseboard Management Controller. Various variables can be set through the command. Also notice, the actual configuration may change among different machine-model types.
|
||||
|
||||
Examples
|
||||
|
||||
To turn on SNMP alerts for cn5: ::
|
||||
|
||||
rspconfig cn5 alert=on
|
||||
@@ -0,0 +1,10 @@
|
||||
Advanced Operations
|
||||
===================
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
|
||||
rinv.rst
|
||||
rvitals.rst
|
||||
rflash.rst
|
||||
rspconfig.rst
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
``rflash`` - Remote Firmware Flashing
|
||||
=====================================
|
||||
|
||||
See :doc:`rflash manpage </guides/admin-guides/references/man1/rflash.1>` for more information.
|
||||
|
||||
The ``rflash`` command is provided to assist the system administrator in updating firmware.
|
||||
|
||||
To check the current firmware version on the node's BMC and the HPM file: ::
|
||||
|
||||
rflash <noderange> -c /firmware/8335_810.1543.20151021b_update.hpm
|
||||
|
||||
To update the firmware on the node's BMC to version in the HPM file: ::
|
||||
|
||||
rflash <noderange> /firmware/8335_810.1543.20151021b_update.hpm
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
``rinv`` - Remote Hardware Inventory
|
||||
====================================
|
||||
|
||||
See :doc:`rinv manpage </guides/admin-guides/references/man1/rinv.1>` for more information.
|
||||
|
||||
Use ``rinv`` command to remotely obtain inventory information of a physical machine. This will help to distinguish one machine from another and aid in mapping the model type and/or serial number of a machine with its host name.
|
||||
|
||||
To get all the hardware information for node ``cn1``: ::
|
||||
|
||||
rinv cn1 all
|
||||
|
||||
To get just the firmware information for ``cn1``: ::
|
||||
|
||||
rinv cn1 firm
|
||||
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
``rspconfig`` - Remote Configuration of Service Processors
|
||||
==========================================================
|
||||
|
||||
See :doc:`rspconfig manpage </guides/admin-guides/references/man1/rspconfig.1>` for more information.
|
||||
|
||||
The ``rspconfig`` command can be used to configure the service processor, or Baseboard Management Controller (BMC), of a physical machine.
|
||||
|
||||
For example, to turn on SNMP alerts for node ``cn5``: ::
|
||||
|
||||
rspconfig cn5 alert=on
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
``rvitals`` - Remote Hardware Vitals
|
||||
====================================
|
||||
|
||||
See :doc:`rvitals manpage </guides/admin-guides/references/man1/rvitals.1>` for more information.
|
||||
|
||||
Collecting runtime information from a running physical machine is an important part of system administration. Data can be obtained from the service processor including temperature, voltage, cooling fans, etc.
|
||||
|
||||
Use the ``rvitals`` command to obtain this information. ::
|
||||
|
||||
rvitals <noderange> all
|
||||
|
||||
To only get the temperature information of machines in a particular noderange: ::
|
||||
|
||||
rvitals <noderange> temp
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
Basic Operations
|
||||
================
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
|
||||
rbeacon.rst
|
||||
rpower.rst
|
||||
rcons.rst
|
||||
@@ -0,0 +1,9 @@
|
||||
``rbeacon`` - Beacon Light
|
||||
==========================
|
||||
|
||||
See :doc:`rbeacon manpage </guides/admin-guides/references/man1/rbeacon.1>` for more information.
|
||||
|
||||
|
||||
Most enterprise level servers have LEDs on their front and/or rear panels, one of which is a beacon light. If turned on, this light can assist the system administrator in locating one physical machine in the cluster.
|
||||
|
||||
Using xCAT, administrators can turn on and off the beacon light using: ``rbeacon <node> on|off``
|
||||
@@ -0,0 +1,53 @@
|
||||
``rcons`` - Remote Console
|
||||
==========================
|
||||
|
||||
See :doc:`rcons manpage </guides/admin-guides/references/man1/rcons.1>` for more information.
|
||||
|
||||
Most enterprise servers do not have video adapters installed with the machine and often do not provide a method for attaching a physical monitor/keyboard/mouse to get the display output. For this purpose xCAT can assist the system administrator to view the console over a "Serial-over-LAN" (SOL) connection through the BMC.
|
||||
|
||||
Configure the correct console management by modifying the node definition:
|
||||
|
||||
* For OpenPower, **IPMI** managed server: ::
|
||||
|
||||
chdef -t node -o <noderange> cons=ipmi
|
||||
|
||||
* For OpenPower, **OpenBMC** managed servers: ::
|
||||
|
||||
chdef -t node -o <noderange> cons=openbmc
|
||||
|
||||
Open a console to ``compute1``: ::
|
||||
|
||||
rcons compute1
|
||||
|
||||
**Note:** The keystroke ``ctrl+e c .`` will disconnect you from the console.
|
||||
|
||||
|
||||
Troubleshooting
|
||||
---------------
|
||||
|
||||
General
|
||||
```````
|
||||
|
||||
The xCAT ``rcons`` command relies on conserver (http://www.conserver.com/). The ``conserver`` package should have been installed with xCAT as it's part of the xCAT dependency package. If you are having problems seeing the console, try the following.
|
||||
|
||||
#. Make sure ``conserver`` is configured by running ``makeconservercf``.
|
||||
|
||||
#. Check if ``conserver`` is up and running ::
|
||||
|
||||
[sysvinit] service conserver status
|
||||
[systemd] systemctl status conserver.service
|
||||
|
||||
#. If ``conserver`` is not running, start the service using: ::
|
||||
|
||||
[sysvinit] service conserver start
|
||||
[systemd] systemctl start conserver.service
|
||||
|
||||
#. After this, try invoking the console again: ``rcons <node>``
|
||||
|
||||
|
||||
OpenBMC Specific
|
||||
```````````````
|
||||
|
||||
#. For OpenBMC managed servers, the root user must be able to ssh passwordless to the BMC for the ``rcons`` function to work.
|
||||
|
||||
Copy the ``/root/.ssh/id_rsa.pub`` public key to the BMC's ``~/.ssh/authorized_keys`` file.
|
||||
@@ -0,0 +1,15 @@
|
||||
``rpower`` - Remote Power Control
|
||||
=================================
|
||||
|
||||
See :doc:`rpower manpage </guides/admin-guides/references/man1/rpower.1>` for more information.
|
||||
|
||||
Use the ``rpower`` command to remotely power on and off a single server or a range of servers. ::
|
||||
|
||||
rpower <noderange> on
|
||||
rpower <noderange> off
|
||||
|
||||
Other actions include:
|
||||
|
||||
* To get the current power state of a server: ``rpower <noderange> state``
|
||||
* To boot/reboot a server: ``rpower <noderange> boot``
|
||||
* To hardware reset a server: ``rpower <noderange> reset``
|
||||
@@ -0,0 +1,8 @@
|
||||
Hardware Management
|
||||
===================
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
|
||||
basic/index.rst
|
||||
advanced/index.rst
|
||||
@@ -43,7 +43,7 @@ OPTIONS
|
||||
|
||||
\ **-a|-**\ **-all**\
|
||||
|
||||
Setup NTP servers for both management node and the service node.
|
||||
Setup NTP servers for both management node and the service node. If management node has SLES installed and used as \ *ntpservers*\ , it is recommanded to use the \ **setupntp**\ postscript to set up NTP server for service nodes.
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -28,13 +28,20 @@ BMC/MPA specific:
|
||||
\ **rinv**\ \ *noderange*\ {\ **pci | model | serial | asset | vpd | mprom | deviceid | guid | firm | diag | dimm | bios | mparom | mac | all**\ }
|
||||
|
||||
|
||||
OpenPOWER server specific:
|
||||
==========================
|
||||
OpenPOWER (using ipmi) server specific:
|
||||
=======================================
|
||||
|
||||
|
||||
\ **rinv**\ \ *noderange*\ {\ **model | serial | deviceid | uuid | guid | vpd | mprom | firm | all**\ }
|
||||
|
||||
|
||||
OpenPOWER (using openbmc) server specific:
|
||||
==========================================
|
||||
|
||||
|
||||
\ **rinv**\ \ *noderange*\ {\ **model | serial | deviceid | uuid | guid | vpd | mprom | firm | cpu | dimm | all**\ }
|
||||
|
||||
|
||||
PPC (with HMC) specific:
|
||||
========================
|
||||
|
||||
|
||||
@@ -23,8 +23,8 @@ SYNOPSIS
|
||||
|
||||
\ **rpower**\ [\ **-h | -**\ **-help | -v | -**\ **-version**\ ]
|
||||
|
||||
BMC (using IPMI) specific:
|
||||
==========================
|
||||
BMC (using IPMI):
|
||||
=================
|
||||
|
||||
|
||||
\ **rpower**\ \ *noderange*\ [\ **on | off | softoff | reset | boot | stat | state | status | wake | suspend**\ [\ **-w**\ \ *timeout*\ ] [\ **-o**\ ] [\ **-r**\ ]]
|
||||
@@ -32,8 +32,17 @@ BMC (using IPMI) specific:
|
||||
\ **rpower**\ \ *noderange*\ [\ **pduon | pduoff | pdustat | pdureset**\ ]
|
||||
|
||||
|
||||
OpenBMC specific:
|
||||
=================
|
||||
OpenPower BMC (using IPMI):
|
||||
===========================
|
||||
|
||||
|
||||
\ **rpower**\ \ *noderange*\ [\ **on | off | reset | boot | stat | state | status**\ ]
|
||||
|
||||
\ **rpower**\ \ *noderange*\ [\ **pduon | pduoff | pdustat | pdureset**\ ]
|
||||
|
||||
|
||||
OpenPower OpenBMC:
|
||||
==================
|
||||
|
||||
|
||||
\ **rpower**\ \ *noderange*\ [\ **off | on | reset | boot | stat | state | status**\ ]
|
||||
@@ -97,6 +106,13 @@ Blade specific:
|
||||
\ **rpower**\ \ *noderange*\ [\ **cycle | softoff**\ ]
|
||||
|
||||
|
||||
Lenovo High-Density Server specific:
|
||||
====================================
|
||||
|
||||
|
||||
\ **rpower**\ \ *noderange*\ [\ **on | off | reset | boot | reseat**\ ]
|
||||
|
||||
|
||||
zVM specific:
|
||||
=============
|
||||
|
||||
@@ -270,6 +286,12 @@ OPTIONS
|
||||
|
||||
|
||||
|
||||
\ **reseat**\
|
||||
|
||||
For Lenovo high-density servers, simulates unplugging and replugging the node into the chassis.
|
||||
|
||||
|
||||
|
||||
\ **of**\
|
||||
|
||||
Boot the node to open firmware console mode.
|
||||
|
||||
@@ -38,11 +38,18 @@ BMC specific:
|
||||
=============
|
||||
|
||||
|
||||
\ **rspconfig**\ \ *noderange*\ {\ **vlan | ip | netmask | gateway | backupgateway | garp**\ }
|
||||
\ **rspconfig**\ \ *noderange*\ {\ **ip | netmask | gateway | backupgateway | garp | vlan**\ }
|
||||
|
||||
\ **rspconfig**\ \ *noderange*\ \ **garp**\ =\ *time*\
|
||||
|
||||
|
||||
OpenBMC specific:
|
||||
=================
|
||||
|
||||
|
||||
\ **rspconfig**\ \ *noderange*\ {\ **ip | netmask | gateway | vlan**\ }
|
||||
|
||||
|
||||
MPA specific:
|
||||
=============
|
||||
|
||||
|
||||
@@ -0,0 +1,213 @@
|
||||
|
||||
##############
|
||||
xcatperftest.1
|
||||
##############
|
||||
|
||||
.. highlight:: perl
|
||||
|
||||
|
||||
****
|
||||
NAME
|
||||
****
|
||||
|
||||
|
||||
\ **xcatperftest**\ - Run xCAT command performance baseline testing on fake nodes.
|
||||
|
||||
|
||||
********
|
||||
SYNOPSIS
|
||||
********
|
||||
|
||||
|
||||
\ **xcatperftest**\ [\ **-?|-h**\ ]
|
||||
|
||||
[\ **PERF_DRYRUN**\ =y] [\ **PERF_NOCREATE**\ =y] \ **xcatperftest**\ <total> [\ *command-list-file*\ ]
|
||||
|
||||
|
||||
***********
|
||||
DESCRIPTION
|
||||
***********
|
||||
|
||||
|
||||
The xcatperftest command runs commandes defined in a command list file and get their execution response time baseline for performance purpose.
|
||||
The xcatperftest command is part of the xCAT package xCAT-test, and you can run it standalone or leverage it to build up your automation test cases.
|
||||
|
||||
Any commands could be defined in the command list file, however, it is recommended that the one-time initial configuration are well prepared prior to run xcatperftest command.
|
||||
For example, the network object, osdistor and osimage image objects.
|
||||
|
||||
Follow the below steps to run xcatperftest command:
|
||||
|
||||
1, Install xCAT-test on a xCAT management nodes.
|
||||
|
||||
2, Prepare a command list in which the commands are what you want to messure.
|
||||
|
||||
3, Prepare the initial configuration based on the command list to make sure all commands could be executed in techinal.
|
||||
|
||||
4, Run xcatperftest with the total fake nodes number and the above command list file.
|
||||
|
||||
Node: It is suggested to run the command in background as it normally takes long time to finish all the performanc testing with large amount of fake nodes.
|
||||
|
||||
|
||||
*******
|
||||
OPTIONS
|
||||
*******
|
||||
|
||||
|
||||
|
||||
\ **-?|-h**\
|
||||
|
||||
Display usage message.
|
||||
|
||||
|
||||
|
||||
<command-list-file>
|
||||
|
||||
Specifies the command list file with full-path. xCAT supports an example command file: /opt/xcat/share/xcat/tools/autotest/perfcmds.lst
|
||||
|
||||
|
||||
|
||||
<total>
|
||||
|
||||
Total number of fake nodes will be defined during the testing.
|
||||
|
||||
|
||||
|
||||
|
||||
************
|
||||
RETURN VALUE
|
||||
************
|
||||
|
||||
|
||||
0 The command completed successfully.
|
||||
|
||||
1 An error has occurred.
|
||||
|
||||
|
||||
*****************
|
||||
COMMAND LIST FILE
|
||||
*****************
|
||||
|
||||
|
||||
The command list file is in flat text format, the testing framework will parse the file line by line, here is an example of the commannd list file:
|
||||
|
||||
|
||||
.. code-block:: perl
|
||||
|
||||
#SERIES# 1,50,100,250,500,1000,2500,5000
|
||||
mkdef -z -f < #STANZ#
|
||||
lsdef #NODES#
|
||||
makehosts #NODES#
|
||||
makedns -n #NODES#
|
||||
makedhcp #NODES#
|
||||
makeknownhosts #NODES#
|
||||
nodech #NODES# groups,=group1
|
||||
nodels #NODES# noderes
|
||||
nodeset #NODES# osimage=rhels7.3-GA-ppc64le-install-compute
|
||||
chdef -t node -o #NODES# postscripts="fake" profile="install" netboot="grub2"
|
||||
rmdef -t node #PERFGRP#
|
||||
mkdef -z < #STANZ#
|
||||
noderm #PERFGRP#
|
||||
|
||||
|
||||
\ **Note**\ : Each line defines one command, and the commands dependency should be handled by the line order.
|
||||
If you define a node range series line (started with #SERIES#) in this file, xcatperftest will run the command for each node range defined in series line.
|
||||
|
||||
\ **#SERIES#**\ To define a node range series, and the series should be an comma split incremental number sequence.
|
||||
|
||||
\ **#STANZ#**\ It will be replaced with real stanz file path when this command line runs.
|
||||
|
||||
\ **#NODES#**\ It will be replaced with real node range defined in #SERIES# line when this command line runs. If no series line, the node group will be used.
|
||||
|
||||
\ **#PERFGRP#**\ It will be replaced with node group when this command line runs.
|
||||
|
||||
|
||||
********************
|
||||
ENVIRONMENT VARIABLE
|
||||
********************
|
||||
|
||||
|
||||
The xcatperftest command supports be customized by some environment variables.
|
||||
|
||||
\ **FAKE_NODE_PREFIX**\
|
||||
|
||||
Optional, the prefix of the fake compute node name. By default, the value is 'fake'
|
||||
|
||||
\ **FAKE_NODE_GROUP**\
|
||||
|
||||
# Optional, the group name of all the fake compute nodes. By default, the value is 'perftest'
|
||||
|
||||
\ **FAKE_NETWORK_PRO**\
|
||||
|
||||
Mandatory, the Provision network for all the fake compute nodes. By default, the value is '192.168'.
|
||||
It must be a string like 'A.B', and be matched with \`tabdump networks\`
|
||||
|
||||
\ **FAKE_NETWORK_BMC**\
|
||||
|
||||
Mandatory, the BMC network for all the fake compute nodes. By default, the value is '192.168'. Note: It could not be the same subnet as 'FAKE_NETWORK_PRO'
|
||||
It must be a string like 'A.B' and no need to be defined in 'networks' table.
|
||||
|
||||
\ **PERF_NODETEMPL**\
|
||||
|
||||
Optional, The node template name used for generating fake nodes. By default, it will be auto-detected according to the current arch.
|
||||
|
||||
\ **PERF_DRYRUN**\
|
||||
|
||||
Optional, Indicate no real commands will be executed if the environment variable is set.
|
||||
|
||||
\ **PERF_NOCREATE**\
|
||||
|
||||
Optional, Indicate no new fake nodes will be created if the environment variable is set.
|
||||
|
||||
|
||||
********
|
||||
EXAMPLES
|
||||
********
|
||||
|
||||
|
||||
|
||||
1.
|
||||
|
||||
To run the performance testing for the commands defined in /tmp/cmd.lst on 5000 fake nodes:
|
||||
|
||||
|
||||
.. code-block:: perl
|
||||
|
||||
xcatperftest 5000 /tmp/cmd.lst
|
||||
|
||||
|
||||
|
||||
|
||||
2.
|
||||
|
||||
To generate an xCAT node object stanz file for 10000 nodes in subnet 10.100.0.0:
|
||||
|
||||
|
||||
.. code-block:: perl
|
||||
|
||||
FAKE_NETWORK_PRO=10.100 FAKE_NETWORK_BMC=10.200 xcatperftest 10000
|
||||
|
||||
|
||||
|
||||
|
||||
3.
|
||||
|
||||
To run the performance testing for the commands defined in /opt/xcat/share/xcat/tools/autotest/perfcmds.lst on 5000 existing fake nodes:
|
||||
|
||||
|
||||
.. code-block:: perl
|
||||
|
||||
PERF_NOCREATE=y xcatperftest 5000 /opt/xcat/share/xcat/tools/autotest/perfcmds.lst
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
*****
|
||||
FILES
|
||||
*****
|
||||
|
||||
|
||||
/opt/xcat/bin/xcatperftest
|
||||
|
||||
/opt/xcat/share/xcat/tools/autotest/perfcmds.lst
|
||||
|
||||
@@ -19,7 +19,7 @@ SYNOPSIS
|
||||
********
|
||||
|
||||
|
||||
\ **openbmc Attributes:**\ \ *node*\ , \ *bmc*\ , \ *username*\ , \ *password*\ , \ *comments*\ , \ *disable*\
|
||||
\ **openbmc Attributes:**\ \ *node*\ , \ *bmc*\ , \ *consport*\ , \ *taggedvlan*\ , \ *username*\ , \ *password*\ , \ *comments*\ , \ *disable*\
|
||||
|
||||
|
||||
***********
|
||||
@@ -48,6 +48,18 @@ openbmc Attributes:
|
||||
|
||||
|
||||
|
||||
\ **consport**\
|
||||
|
||||
The console port for OpenBMC.
|
||||
|
||||
|
||||
|
||||
\ **taggedvlan**\
|
||||
|
||||
bmcsetup script will configure the network interface of the BMC to be tagged to the VLAN specified.
|
||||
|
||||
|
||||
|
||||
\ **username**\
|
||||
|
||||
The BMC userid.
|
||||
|
||||
@@ -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*\ , \ *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*\
|
||||
\ **group Attributes:**\ \ *addkcmdline*\ , \ *arch*\ , \ *authdomain*\ , \ *bmc*\ , \ *bmcpassword*\ , \ *bmcport*\ , \ *bmcusername*\ , \ *bmcvlantag*\ , \ *cfgmgr*\ , \ *cfgmgtroles*\ , \ *cfgserver*\ , \ *chain*\ , \ *chassis*\ , \ *cmdmapping*\ , \ *cons*\ , \ *conserver*\ , \ *consoleondemand*\ , \ *consport*\ , \ *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*\
|
||||
|
||||
|
||||
***********
|
||||
@@ -133,7 +133,11 @@ group Attributes:
|
||||
|
||||
|
||||
|
||||
\ **bmcvlantag**\ (ipmi.taggedvlan)
|
||||
\ **bmcvlantag**\ (ipmi.taggedvlan, openbmc.taggedvlan)
|
||||
|
||||
bmcsetup script will configure the network interface of the BMC to be tagged to the VLAN specified.
|
||||
|
||||
or
|
||||
|
||||
bmcsetup script will configure the network interface of the BMC to be tagged to the VLAN specified.
|
||||
|
||||
@@ -193,6 +197,12 @@ group Attributes:
|
||||
|
||||
|
||||
|
||||
\ **consport**\ (openbmc.consport)
|
||||
|
||||
The console port for OpenBMC.
|
||||
|
||||
|
||||
|
||||
\ **cpucount**\ (hwinv.cpucount)
|
||||
|
||||
The number of cpus for the node.
|
||||
|
||||
@@ -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*\ , \ *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*\
|
||||
\ **node Attributes:**\ \ *addkcmdline*\ , \ *appstatus*\ , \ *appstatustime*\ , \ *arch*\ , \ *authdomain*\ , \ *bmc*\ , \ *bmcpassword*\ , \ *bmcport*\ , \ *bmcusername*\ , \ *bmcvlantag*\ , \ *cfgmgr*\ , \ *cfgmgtroles*\ , \ *cfgserver*\ , \ *chain*\ , \ *chassis*\ , \ *cmdmapping*\ , \ *cons*\ , \ *conserver*\ , \ *consoleondemand*\ , \ *consport*\ , \ *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*\
|
||||
|
||||
|
||||
***********
|
||||
@@ -145,7 +145,11 @@ node Attributes:
|
||||
|
||||
|
||||
|
||||
\ **bmcvlantag**\ (ipmi.taggedvlan)
|
||||
\ **bmcvlantag**\ (ipmi.taggedvlan, openbmc.taggedvlan)
|
||||
|
||||
bmcsetup script will configure the network interface of the BMC to be tagged to the VLAN specified.
|
||||
|
||||
or
|
||||
|
||||
bmcsetup script will configure the network interface of the BMC to be tagged to the VLAN specified.
|
||||
|
||||
@@ -205,6 +209,12 @@ node Attributes:
|
||||
|
||||
|
||||
|
||||
\ **consport**\ (openbmc.consport)
|
||||
|
||||
The console port for OpenBMC.
|
||||
|
||||
|
||||
|
||||
\ **cpucount**\ (hwinv.cpucount)
|
||||
|
||||
The number of cpus for the node.
|
||||
|
||||
@@ -444,12 +444,14 @@ passed as argument rather than by table value',
|
||||
},
|
||||
},
|
||||
openbmc => {
|
||||
cols => [qw(node bmc username password comments disable)],
|
||||
cols => [qw(node bmc consport taggedvlan username password comments disable)],
|
||||
keys => [qw(node)],
|
||||
table_desc => 'Setting for nodes that are controlled by an on-board OpenBmc.',
|
||||
descriptions => {
|
||||
node => 'The node name or group name.',
|
||||
bmc => 'The hostname of the BMC adapter.',
|
||||
consport => 'The console port for OpenBMC.',
|
||||
taggedvlan => 'bmcsetup script will configure the network interface of the BMC to be tagged to the VLAN specified.',
|
||||
username => 'The BMC userid.',
|
||||
password => 'The BMC password.',
|
||||
comments => 'Any user-written notes.',
|
||||
@@ -2327,6 +2329,11 @@ my @nodeattrs = (
|
||||
tabentry => 'mp.nodetype',
|
||||
access_tabentry => 'mp.node=attr:node',
|
||||
},
|
||||
{ attr_name => 'hwtype',
|
||||
only_if => 'mgt=openbmc',
|
||||
tabentry => 'mp.nodetype',
|
||||
access_tabentry => 'mp.node=attr:node',
|
||||
},
|
||||
{ attr_name => 'supernode',
|
||||
tabentry => 'ppc.supernode',
|
||||
access_tabentry => 'ppc.node=attr:node',
|
||||
@@ -2505,6 +2512,16 @@ my @nodeattrs = (
|
||||
tabentry => 'openbmc.password',
|
||||
access_tabentry => 'openbmc.node=attr:node',
|
||||
},
|
||||
{ attr_name => 'consport',
|
||||
only_if => 'mgt=openbmc',
|
||||
tabentry => 'openbmc.consport',
|
||||
access_tabentry => 'openbmc.node=attr:node',
|
||||
},
|
||||
{ attr_name => 'bmcvlantag',
|
||||
only_if => 'mgt=openbmc',
|
||||
tabentry => 'openbmc.taggedvlan',
|
||||
access_tabentry => 'openbmc.node=attr:node',
|
||||
},
|
||||
|
||||
######################
|
||||
# nodepos table #
|
||||
|
||||
+14
-4
@@ -26,7 +26,13 @@ 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:
|
||||
BMC (using IPMI):
|
||||
rpower noderange [on|off|softoff|reset|boot|stat|state|status|wake|suspend [-w timeout] [-o] [-r]]
|
||||
rpower noderange [pduon|pduoff|pdustat]
|
||||
OpenPower BMC:
|
||||
rpower noderange [on|off|reset|boot|stat|state|status]
|
||||
rpower noderange [pduon|pduoff|pdustat]
|
||||
OpenPower OpenBMC:
|
||||
rpower noderange [on|off|reset|boot|stat|state|status]
|
||||
KVM Virtualization specific:
|
||||
rpower <noderange> [boot] [ -c <path to iso> ]
|
||||
@@ -89,8 +95,10 @@ my %usage = (
|
||||
rinv [-h|--help|-v|--version]
|
||||
BMC specific:
|
||||
rinv <noderange> [mprom|deviceid|uuid|guid|vpd|dimm|all]
|
||||
OpenPOWER server specific:
|
||||
rinv <noderange> [model|serial|deviceid|uuid|guid|vpd|mprom|firm|all]
|
||||
OpenPOWER (using ipmi) server specific:
|
||||
rinv <noderange> [model|serial|deviceid|uuid|guid|vpd|mprom|firm|all]
|
||||
OpenPOWER (using openbmc) server specific:
|
||||
rinv <noderange> [model|serial|deviceid|uuid|guid|vpd|mprom|firm|cpu|dimm|all
|
||||
MPA specific:
|
||||
rinv <noderange> [firm|bios|diag|mprom|sprom|mparom|mac|mtm]
|
||||
PPC specific(with HMC):
|
||||
@@ -132,9 +140,11 @@ my %usage = (
|
||||
rspconfig <noderange> [snmpdest|alert|community] [-V|--verbose]
|
||||
rspconfig <noderange> [snmpdest=<dest ip address>|alert=<on|off|en|dis|enable|disable>|community=<string>]
|
||||
BMC specific:
|
||||
rspconfig <noderange> [ip|netmask|gateway|backupgateway|garp]
|
||||
rspconfig <noderange> [ip|netmask|gateway|backupgateway|garp|vlan]
|
||||
rspconfig <noderange> [garp=<number of 1/2 second>]
|
||||
rspconfig <noderange> [userid=<userid> username=<username> password=<password>]
|
||||
OpenBMC specific:
|
||||
rspconfig <noderange> [ip|netmask|gateway|vlan]
|
||||
iDataplex specific:
|
||||
rspconfig <noderange> [thermprofile]
|
||||
rspconfig <noderange> [thermprofile=<two digit number from chassis>]
|
||||
|
||||
@@ -38,7 +38,7 @@ To setup NTP on the compute node, add B<setupntp> postscript to the I<postscript
|
||||
|
||||
=item B<-a|--all>
|
||||
|
||||
Setup NTP servers for both management node and the service node.
|
||||
Setup NTP servers for both management node and the service node. If management node has SLES installed and used as I<ntpservers>, it is recommanded to use the B<setupntp> postscript to set up NTP server for service nodes.
|
||||
|
||||
|
||||
=item B<-h|--help>
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
|
||||
=head1 NAME
|
||||
|
||||
B<piflash> - Remotely applies firmware updates to servers.
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
B<piflash> <noderange> --package <filename>
|
||||
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
B<piflash> Remotely applies firmware updates to servers.
|
||||
@@ -10,10 +10,14 @@ B<rinv> [B<-h>|B<--help>|B<-v>|B<--version>]
|
||||
|
||||
B<rinv> I<noderange> {B<pci>|B<model>|B<serial>|B<asset>|B<vpd>|B<mprom>|B<deviceid>|B<guid>|B<firm>|B<diag>|B<dimm>|B<bios>|B<mparom>|B<mac>|B<all>}
|
||||
|
||||
=head2 OpenPOWER server specific:
|
||||
=head2 OpenPOWER (using ipmi) server specific:
|
||||
|
||||
B<rinv> I<noderange> {B<model>|B<serial>|B<deviceid>|B<uuid>|B<guid>|B<vpd>|B<mprom>|B<firm>|B<all>}
|
||||
|
||||
=head2 OpenPOWER (using openbmc) server specific:
|
||||
|
||||
B<rinv> I<noderange> {B<model>|B<serial>|B<deviceid>|B<uuid>|B<guid>|B<vpd>|B<mprom>|B<firm>|B<cpu>|B<dimm>|B<all>}
|
||||
|
||||
=head2 PPC (with HMC) specific:
|
||||
|
||||
B<rinv> I<noderange> {B<bus>|B<config>|B<serial>|B<model>|B<firm>|B<all>}
|
||||
|
||||
@@ -8,13 +8,19 @@ B<rpower> I<noderange> [B<--nodeps>] [B<on>|B<onstandby>|B<off>|B<suspend>|B<sta
|
||||
|
||||
B<rpower> [B<-h>|B<--help>|B<-v>|B<--version>]
|
||||
|
||||
=head2 BMC (using IPMI) specific:
|
||||
=head2 BMC (using IPMI):
|
||||
|
||||
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<pdureset>]
|
||||
|
||||
=head2 OpenBMC specific:
|
||||
=head2 OpenPower BMC (using IPMI):
|
||||
|
||||
B<rpower> I<noderange> [B<on>|B<off>|B<reset>|B<boot>|B<stat>|B<state>|B<status>]
|
||||
|
||||
B<rpower> I<noderange> [B<pduon>|B<pduoff>|B<pdustat>|B<pdureset>]
|
||||
|
||||
=head2 OpenPower OpenBMC:
|
||||
|
||||
B<rpower> I<noderange> [B<off>|B<on>|B<reset>|B<boot>|B<stat>|B<state>|B<status>]
|
||||
|
||||
|
||||
@@ -18,10 +18,14 @@ B<rspconfig> I<noderange> B<community>={B<public> | I<string>}
|
||||
|
||||
=head2 BMC specific:
|
||||
|
||||
B<rspconfig> I<noderange> {B<vlan>|B<ip>|B<netmask>|B<gateway>|B<backupgateway>|B<garp>}
|
||||
B<rspconfig> I<noderange> {B<ip>|B<netmask>|B<gateway>|B<backupgateway>|B<garp>|B<vlan>}
|
||||
|
||||
B<rspconfig> I<noderange> B<garp>=I<time>
|
||||
|
||||
=head2 OpenBMC specific:
|
||||
|
||||
B<rspconfig> I<noderange> {B<ip>|B<netmask>|B<gateway>|B<vlan>}
|
||||
|
||||
=head2 MPA specific:
|
||||
|
||||
B<rspconfig> I<noderange> {B<sshcfg>|B<snmpcfg>|B<pd1>|B<pd2>|B<network>|B<swnet>|B<ntp>|B<textid>|B<frame>}
|
||||
|
||||
@@ -112,6 +112,13 @@ fi
|
||||
# Add ipmi_devintf module to allow the ipmitool operation in-band
|
||||
modprobe ipmi_devintf
|
||||
|
||||
for parm in `cat /proc/cmdline`; do
|
||||
key=`echo $parm|awk -F= '{print $1}'`
|
||||
if [ "$key" = "xcatd" ]; then
|
||||
XCATMASTER=`echo $parm|awk -F= '{print $2}'|awk -F: '{print $1}'`
|
||||
fi
|
||||
done
|
||||
|
||||
allowcred.awk &
|
||||
CREDPID=$!
|
||||
sleep 5
|
||||
@@ -161,6 +168,7 @@ logger -s -t $log_label -p local4.info "IPMIVER=$IPMIVER, IPMIMFG=$IPMIMFG, XPRO
|
||||
#
|
||||
# IPMIMFG=2 = IBM
|
||||
# IPMIMFG=0 = OpenPower
|
||||
# IPMIMFG=42817 and XPROD=16975 = OpenBMC
|
||||
#
|
||||
if [ "$IPMIMFG" == 2 ]; then #IBM
|
||||
if [ "$XPROD" == "220" ]; then
|
||||
@@ -258,13 +266,20 @@ elif [ "$IPMIMFG" == "674" ]; then # DELL
|
||||
ipmitool delloem lan set shared with lom$BMCPORT &>/dev/null
|
||||
ipmitool delloem lan set shared with failover all loms &>dev/null
|
||||
fi
|
||||
elif [ "$IPMIMFG" = "42817" -a "$XPROD" = "16975" ]; then # IBM OpenPOWER servers with OpenBMC
|
||||
ISOPENBMC=1
|
||||
fi
|
||||
|
||||
LAN_MED_TYPE="802.3"
|
||||
if [ ! -z "$ISOPENBMC" ]; then
|
||||
# Overvide the default value for OpenBMC
|
||||
LAN_MED_TYPE="Other LAN"
|
||||
fi
|
||||
while [ -z "$LANCHAN" ]; do
|
||||
logger -s -t $log_label -p local4.info "Auto detecting LAN channel..."
|
||||
for TLANCHAN in {1..16}; do
|
||||
# Try to get the channel information; then get the MAC which is used for the channel
|
||||
if ipmitool channel info $TLANCHAN 2> /dev/null | grep 802.3 > /dev/null 2>&1 && ipmitool raw 0xc 2 $TLANCHAN 5 0 0 > /dev/null 2>&1; then
|
||||
if ipmitool channel info $TLANCHAN 2> /dev/null | grep "$LAN_MED_TYPE" > /dev/null 2>&1 && ipmitool raw 0xc 2 $TLANCHAN 5 0 0 > /dev/null 2>&1; then
|
||||
LANCHAN=$TLANCHAN
|
||||
break;
|
||||
fi;
|
||||
@@ -279,6 +294,9 @@ logger -s -t $log_label -p local4.info "Detected LAN channel $LANCHAN"
|
||||
|
||||
let idev=NUMBMCS
|
||||
if [ $IPCFGMETHOD="static" ]; then
|
||||
if [ ! -z "$ISOPENBMC" ]; then
|
||||
let idev=0
|
||||
fi
|
||||
while [ $idev -gt 0 ]; do
|
||||
let idev=idev-1
|
||||
TRIES=0
|
||||
@@ -334,7 +352,11 @@ if [ $IPCFGMETHOD="static" ]; then
|
||||
done
|
||||
fi
|
||||
else
|
||||
let idev=NUMBMCS
|
||||
if [ -z "$ISOPENBMC" ];then
|
||||
let idev=NUMBMCS
|
||||
else
|
||||
let idev=0
|
||||
fi
|
||||
while [ $idev -gt 0 ]; do
|
||||
let idev=idev-1
|
||||
TRIES=0
|
||||
@@ -363,6 +385,37 @@ for b in $BMCVLAN; do
|
||||
let idev=idev+1
|
||||
done
|
||||
|
||||
|
||||
|
||||
# update the node status to 'bmcready' for openbmc, no more configuration is needed.
|
||||
if [ ! -z "$ISOPENBMC" ]; then
|
||||
# To enable network configuration for openbmc
|
||||
TRIES=0
|
||||
bmc_config_rc=0
|
||||
# Set Channel Access to apply network setting
|
||||
#while ! ipmitool -d 0 lan set $LANCHAN access on; do
|
||||
while ! ipmitool -d 0 raw 0x06 0x40 $LANCHAN 0x42 0x44 > /dev/null; do
|
||||
snooze
|
||||
let TRIES=TRIES+1
|
||||
if [ $TRIES -gt $TIMEOUT ]; then
|
||||
bmc_config_rc=1
|
||||
break;
|
||||
fi
|
||||
done
|
||||
|
||||
# update the node status to 'bmcready'
|
||||
if [ ! -z "$XCATMASTER" ]; then
|
||||
if [ "$bmc_config_rc" = "0" ]; then
|
||||
# Wait for some time for the new network setting is ready
|
||||
snooze
|
||||
updateflag.awk $XCATMASTER 3002 "installstatus bmcready"
|
||||
else
|
||||
updateflag.awk $XCATMASTER 3002 "installstatus failed"
|
||||
fi
|
||||
fi
|
||||
rm -f /tmp/ipmicfg.xml
|
||||
exit $bmc_config_rc
|
||||
fi
|
||||
# After network commands are issued, pause to allow the BMC to apply (OpenPower)
|
||||
snooze
|
||||
|
||||
@@ -587,12 +640,6 @@ while [ $idev -gt 0 ]; do
|
||||
cold_reset_bmc
|
||||
|
||||
# update the node status to 'bmcready'
|
||||
for parm in `cat /proc/cmdline`; do
|
||||
key=`echo $parm|awk -F= '{print $1}'`
|
||||
if [ "$key" = "xcatd" ]; then
|
||||
XCATMASTER=`echo $parm|awk -F= '{print $2}'|awk -F: '{print $1}'`
|
||||
fi
|
||||
done
|
||||
if [ ! -z "$XCATMASTER" ]; then
|
||||
updateflag.awk $XCATMASTER 3002 "installstatus bmcready"
|
||||
fi
|
||||
|
||||
@@ -29,10 +29,17 @@ for LANCHAN in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16; do
|
||||
done
|
||||
BMCMAC=`ipmitool lan print $LANCHAN|grep ^MAC|awk '{print $4}'` #bmcconfig may opt to use DHCP, if so we need to feed up the mac address
|
||||
#TODO: need a way to get the DUID the service processor may use, perhaps reserve that for 'ibmsetup' since spec doesn't touch ipv6?
|
||||
|
||||
IPMIMFG=`ipmitool mc info |grep "^Manufacturer ID"|awk '{print $4}'`
|
||||
XPROD=`ipmitool mc info | grep "^Product ID"|awk '{print $4}'`
|
||||
if [ "$IPMIMFG" == "42817" -a "$XPROD" == "16975" ]; then
|
||||
ISOPENBMC=1
|
||||
else
|
||||
ISOPENBMC=0
|
||||
fi
|
||||
echo "<xcatrequest>
|
||||
<command>getbmcconfig</command>
|
||||
<callback_port>300</callback_port>
|
||||
<isopenbmc>$ISOPENBMC</isopenbmc>
|
||||
<bmcmac>$BMCMAC</bmcmac>
|
||||
</xcatrequest>" > /tmp/bmcreq.xml
|
||||
rm -f /tmp/ipmicfg.xml
|
||||
|
||||
@@ -30,10 +30,14 @@ sub getIPMIAuth {
|
||||
my $noderange = $args{noderange};
|
||||
my $ipmihash = $args{ipmihash};
|
||||
my $mphash = $args{mphash};
|
||||
my $key = $args{keytype};
|
||||
unless($key) {
|
||||
$key = "ipmi";
|
||||
}
|
||||
my $tmp;
|
||||
my %authmap;
|
||||
unless ($ipmihash) { #in the event that calling code does not pass us a prefetched set of values, pull it ourselves
|
||||
my $ipmitab = xCAT::Table->new('ipmi', -create => 0);
|
||||
my $ipmitab = xCAT::Table->new("$key", -create => 0);
|
||||
if ($ipmitab) { $ipmihash = $ipmitab->getNodesAttribs($noderange, [ 'username', 'password' ]); }
|
||||
}
|
||||
unless ($mphash) {
|
||||
@@ -42,7 +46,7 @@ sub getIPMIAuth {
|
||||
}
|
||||
my $passtab = xCAT::Table->new('passwd');
|
||||
if ($passtab) {
|
||||
($tmp) = $passtab->getAttribs({ 'key' => 'ipmi' }, 'username', 'password');
|
||||
($tmp) = $passtab->getAttribs({ 'key' => "$key" }, 'username', 'password');
|
||||
if (defined($tmp)) {
|
||||
$ipmiuser = $tmp->{username};
|
||||
$ipmipass = $tmp->{password};
|
||||
|
||||
@@ -1986,12 +1986,16 @@ sub getPostScripts
|
||||
{
|
||||
$nodecfg = "$tftpdir/pxelinux.cfg/$node";
|
||||
|
||||
} elsif($netboot eq "petitboot"){
|
||||
$nodecfg = "$tftpdir/petitboot/$node";
|
||||
}
|
||||
|
||||
my $rc = system("grep net.ifnames=0 $nodecfg >/dev/null 2>&1");
|
||||
if ($rc == 0)
|
||||
{
|
||||
$result .= "disableconsistentNICrename\n";
|
||||
if( -f "$nodecfg"){
|
||||
my $rc = system("grep net.ifnames=0 $nodecfg >/dev/null 2>&1");
|
||||
if ($rc == 0)
|
||||
{
|
||||
$result .= "disableconsistentNICrename\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1566,6 +1566,7 @@ sub sendmsg {
|
||||
$rc = $text->[0];
|
||||
$text = $text->[1];
|
||||
}
|
||||
my $text_origin = $text; # Save original text string
|
||||
if ($text =~ /:/) {
|
||||
($descr, $text) = split /:/, $text, 2;
|
||||
}
|
||||
@@ -1582,7 +1583,7 @@ sub sendmsg {
|
||||
}
|
||||
if ($rc) {
|
||||
$curptr->{errorcode} = [$rc];
|
||||
$curptr->{error} = [$text];
|
||||
$curptr->{error} = [$text_origin];
|
||||
$curptr = $curptr->{error}->[0];
|
||||
if (defined $node && %allerrornodes) {
|
||||
$allerrornodes{$node} = 1;
|
||||
|
||||
@@ -96,20 +96,24 @@ sub process_request {
|
||||
my $request = shift;
|
||||
my $callback = shift;
|
||||
my $node = $request->{'_xcat_clienthost'}->[0];
|
||||
my $bmc_mgmt_type = "ipmi";
|
||||
if ($request->{isopenbmc}->[0]) {
|
||||
$bmc_mgmt_type = "openbmc";
|
||||
}
|
||||
unless (ok_with_node($node, 300)) {
|
||||
$callback->({ error => ["Unable to prove root on your IP approves of this request"], errorcode => [1] });
|
||||
return;
|
||||
}
|
||||
|
||||
#my $sitetable = xCAT::Table->new('site');
|
||||
my $ipmitable = xCAT::Table->new('ipmi');
|
||||
my $ipmitable = xCAT::Table->new("$bmc_mgmt_type");
|
||||
my $tmphash;
|
||||
my $username;
|
||||
my $gennedpassword = 0;
|
||||
my $bmc;
|
||||
my $password;
|
||||
$tmphash = $ipmitable->getNodesAttribs([$node], [ 'bmc', 'username', 'bmcport', 'password', 'taggedvlan' ]);
|
||||
my $authmap = xCAT::PasswordUtils::getIPMIAuth(noderange => [$node], ipmihash => $tmphash);
|
||||
my $authmap = xCAT::PasswordUtils::getIPMIAuth(noderange => [$node], ipmihash => $tmphash, keytype => $bmc_mgmt_type);
|
||||
|
||||
if ($::XCATSITEVALS{genpasswords} eq "1" or $::XCATSITEVALS{genpasswords} =~ /y(es)?/i) {
|
||||
$password = genpassword(10) . "1cA!";
|
||||
|
||||
@@ -29,6 +29,7 @@ use Data::Dumper;
|
||||
use File::Basename;
|
||||
use File::Path;
|
||||
use Cwd;
|
||||
use JSON;
|
||||
|
||||
my $nmap_path;
|
||||
|
||||
@@ -388,7 +389,7 @@ sub get_bmc_ip_source {
|
||||
# all other errors
|
||||
push @{ $rsp->{data} }, "$error_msg";
|
||||
}
|
||||
xCAT::MsgUtils->message("E", $rsp, $::CALLBACK);
|
||||
xCAT::MsgUtils->message("W", $rsp, $::CALLBACK);
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
@@ -452,7 +453,7 @@ sub check_auth_process {
|
||||
else {
|
||||
push @{ $rsp->{data} }, "Unknown Error: $output";
|
||||
}
|
||||
xCAT::MsgUtils->message("E", $rsp, $::CALLBACK);
|
||||
xCAT::MsgUtils->message("W", $rsp, $::CALLBACK);
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
@@ -575,7 +576,21 @@ sub scan_process {
|
||||
|
||||
# Set child process default, if not the function runcmd may return error
|
||||
$SIG{CHLD} = 'DEFAULT';
|
||||
bmcdiscovery_ipmi(${$live_ip}[$i], $opz, $opw, $request_command);
|
||||
|
||||
my $nmap_cmd = "nmap ${$live_ip}[$i] -p 2200 -Pn";
|
||||
my $nmap_output = xCAT::Utils->runcmd($nmap_cmd, -1);
|
||||
if ($nmap_output =~ /2200\/tcp (\w+)/) {
|
||||
my $port_stat = $1;
|
||||
if ($port_stat eq "open") {
|
||||
bmcdiscovery_openbmc(${$live_ip}[$i], $opz, $opw, $request_command);
|
||||
} else {
|
||||
bmcdiscovery_ipmi(${$live_ip}[$i], $opz, $opw, $request_command);
|
||||
}
|
||||
} else {
|
||||
xCAT::MsgUtils->message("E", "Can not get status of 2200 port.", $::CALLBACK);
|
||||
exit 1;
|
||||
}
|
||||
|
||||
exit 0;
|
||||
} else {
|
||||
|
||||
@@ -606,7 +621,7 @@ sub scan_process {
|
||||
{
|
||||
my $rsp = {};
|
||||
push @{ $rsp->{data} }, "No bmc found.\n";
|
||||
xCAT::MsgUtils->message("E", $rsp, $::CALLBACK);
|
||||
xCAT::MsgUtils->message("W", $rsp, $::CALLBACK);
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
@@ -625,14 +640,15 @@ sub scan_process {
|
||||
sub format_stanza {
|
||||
my $node = shift;
|
||||
my $data = shift;
|
||||
my $mgt_type = shift;
|
||||
my ($bmcip, $bmcmtm, $bmcserial, $bmcuser, $bmcpass, $nodetype, $hwtype) = split(/,/, $data);
|
||||
my $result;
|
||||
if (defined($bmcip)) {
|
||||
$result .= "$node:\n\tobjtype=node\n";
|
||||
$result .= "\tgroups=all\n";
|
||||
$result .= "\tbmc=$bmcip\n";
|
||||
$result .= "\tcons=ipmi\n";
|
||||
$result .= "\tmgt=ipmi\n";
|
||||
$result .= "\tcons=$mgt_type\n";
|
||||
$result .= "\tmgt=$mgt_type\n";
|
||||
if ($bmcmtm) {
|
||||
$result .= "\tmtm=$bmcmtm\n";
|
||||
}
|
||||
@@ -665,11 +681,17 @@ sub format_stanza {
|
||||
sub write_to_xcatdb {
|
||||
my $node = shift;
|
||||
my $data = shift;
|
||||
my $mgt_type = shift;
|
||||
my ($bmcip, $bmcmtm, $bmcserial, $bmcuser, $bmcpass, $nodetype, $hwtype) = split(/,/, $data);
|
||||
my $request_command = shift;
|
||||
my $ret;
|
||||
|
||||
$ret = xCAT::Utils->runxcmd({ command => ['chdef'], arg => [ '-t', 'node', '-o', $node, "bmc=$bmcip", "cons=ipmi", "mgt=ipmi", "mtm=$bmcmtm", "serial=$bmcserial", "bmcusername=$bmcuser", "bmcpassword=$bmcpass", "nodetype=$nodetype", "hwtype=$hwtype", "groups=all" ] }, $request_command, 0, 1);
|
||||
$ret = xCAT::Utils->runxcmd({ command => ['chdef'],
|
||||
arg => [ '-t', 'node', '-o', $node, "bmc=$bmcip", "cons=$mgt_type",
|
||||
"mgt=$mgt_type", "mtm=$bmcmtm", "serial=$bmcserial",
|
||||
"bmcusername=$bmcuser", "bmcpassword=$bmcpass", "nodetype=$nodetype",
|
||||
"hwtype=$hwtype", "groups=all" ] },
|
||||
$request_command, 0, 1);
|
||||
if ($::RUNCMD_RC != 0) {
|
||||
my $rsp = {};
|
||||
push @{ $rsp->{data} }, "create or modify node is failed.\n";
|
||||
@@ -696,7 +718,6 @@ sub write_to_xcatdb {
|
||||
|
||||
sub send_rep {
|
||||
my $resp = shift;
|
||||
|
||||
unless ($resp) { return; }
|
||||
store_fd($resp, $parent_fd);
|
||||
}
|
||||
@@ -892,13 +913,15 @@ sub bmcdiscovery_ipmi {
|
||||
if ($bmc_pass) {
|
||||
$bmcpassword = "-P $bmc_pass";
|
||||
}
|
||||
|
||||
my $node_data = $ip;
|
||||
my $icmd = "/opt/xcat/bin/ipmitool-xcat -vv -I lanplus $bmcusername $bmcpassword -H $ip chassis status ";
|
||||
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;
|
||||
xCAT::MsgUtils->message("W", { data => ["$2: $1 for $ip"] }, $::CALLBACK);
|
||||
return;
|
||||
}
|
||||
|
||||
# The output contains System Power indicated the username/password is correct, then try to get MTMS
|
||||
@@ -936,44 +959,125 @@ sub bmcdiscovery_ipmi {
|
||||
}
|
||||
}
|
||||
|
||||
$ip .= ",$mtm";
|
||||
$ip .= ",$serial";
|
||||
$node_data .= ",$mtm";
|
||||
$node_data .= ",$serial";
|
||||
if ($::opt_P) {
|
||||
if ($::opt_U) {
|
||||
$ip .= ",$::opt_U,$::opt_P";
|
||||
$node_data .= ",$::opt_U,$::opt_P";
|
||||
} else {
|
||||
$ip .= ",,$::opt_P";
|
||||
$node_data .= ",,$::opt_P";
|
||||
}
|
||||
} else {
|
||||
$ip .= ",,";
|
||||
$node_data .= ",,";
|
||||
}
|
||||
$ip .= ",mp,bmc";
|
||||
$node_data .= ",mp,bmc";
|
||||
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);
|
||||
return 1;
|
||||
xCAT::MsgUtils->message("W", { data => ["BMC username is incorrect for $ip"] }, $::CALLBACK);
|
||||
return;
|
||||
} elsif ($output =~ /RAKP \S* \S* is invalid/) {
|
||||
xCAT::MsgUtils->message("E", { data => ["BMC password is incorrect for $ip"] }, $::CALLBACK);
|
||||
return 1;
|
||||
xCAT::MsgUtils->message("W", { data => ["BMC password is incorrect for $ip"] }, $::CALLBACK);
|
||||
return;
|
||||
}
|
||||
if (defined($opz) || defined($opw))
|
||||
{
|
||||
format_stanza($node, $ip);
|
||||
format_stanza($node, $node_data, "ipmi");
|
||||
if (defined($opw))
|
||||
{
|
||||
write_to_xcatdb($node, $ip, $request_command);
|
||||
write_to_xcatdb($node, $node_data, "ipmi", $request_command);
|
||||
}
|
||||
}
|
||||
else {
|
||||
my $rsp = {};
|
||||
push @{ $rsp->{data} }, "$ip";
|
||||
push @{ $rsp->{data} }, "$node_data";
|
||||
xCAT::MsgUtils->message("I", $rsp, $::CALLBACK);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
=head3 bmcdiscovery_openbmc
|
||||
|
||||
Support for discovering bmc using openbmc
|
||||
Returns:
|
||||
if it is openbmc, it returns bmc ip or host;
|
||||
if it is not openbmc, it returns nothing;
|
||||
|
||||
=cut
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
sub bmcdiscovery_openbmc{
|
||||
my $ip = shift;
|
||||
my $opz = shift;
|
||||
my $opw = shift;
|
||||
my $request_command = shift;
|
||||
my $node = sprintf("node-%08x", unpack("N*", inet_aton($ip)));
|
||||
|
||||
my $node_data = $ip;
|
||||
my $cjar_file = "/tmp/cjar_$ip";
|
||||
my $data = '{"data": [ "' . $bmc_user .'", "' . $bmc_pass . '" ] }';
|
||||
|
||||
my $output = `curl -c $cjar_file -k -X POST -H \"Content-Type: application/json\" -d '$data' https://$ip/login`;
|
||||
|
||||
if ($output =~ /\"status\": \"ok\"/) {
|
||||
my $req_output = `curl -b $cjar_file -k https://$ip/xyz/openbmc_project/inventory/system/chassis/motherboard`;
|
||||
my $response = decode_json $req_output;
|
||||
my $mtm;
|
||||
my $serial;
|
||||
|
||||
if (defined($response->{data}) and defined($response->{data}->{Model}) and defined($response->{data}->{SerialNumber})) {
|
||||
$mtm = $response->{data}->{Model};
|
||||
$serial = $response->{data}->{SerialNumber};
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
||||
# delete space before and after
|
||||
$mtm =~ s/^\s+|\s+$//g;
|
||||
$serial =~ s/^\s+|\s+$//g;
|
||||
|
||||
# format info string for format_stanza function
|
||||
$node_data .= ",$mtm";
|
||||
$node_data .= ",$serial";
|
||||
if ($::opt_P) {
|
||||
if ($::opt_U) {
|
||||
$node_data .= ",$::opt_U,$::opt_P";
|
||||
} else {
|
||||
$node_data .= ",,$::opt_P";
|
||||
}
|
||||
} else {
|
||||
$node_data .= ",,";
|
||||
}
|
||||
$node_data .= ",mp,bmc";
|
||||
if ($mtm and $serial) {
|
||||
$node = "node-$mtm-$serial";
|
||||
$node =~ s/(.*)/\L$1/g;
|
||||
$node =~ s/[\s:\._]/-/g;
|
||||
}
|
||||
|
||||
unlink $cjar_file;
|
||||
} else {
|
||||
if ($output =~ /\"description\": \"Invalid username or password\"/) {
|
||||
xCAT::MsgUtils->message("W", { data => ["Invalid username or password for $ip"] }, $::CALLBACK);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (defined($opz) || defined($opw)) {
|
||||
format_stanza($node, $node_data, "openbmc");
|
||||
if (defined($opw)) {
|
||||
write_to_xcatdb($node, $node_data, "openbmc", $request_command);
|
||||
}
|
||||
} else {
|
||||
my $rsp = {};
|
||||
push @{ $rsp->{data} }, "$node_data";
|
||||
xCAT::MsgUtils->message("I", $rsp, $::CALLBACK);
|
||||
}
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
@@ -513,11 +513,31 @@ sub process_request {
|
||||
#if not shared tftpdir, then filter, otherwise, set up everything
|
||||
if ($request->{'_disparatetftp'}->[0]) { #reading hint from preprocess_command
|
||||
@nodes = ();
|
||||
my @hostinfo = xCAT::NetworkUtils->determinehostname();
|
||||
my $cur_xmaster = pop @hostinfo;
|
||||
xCAT::MsgUtils->trace(0, "d", "grub2: running on $cur_xmaster");
|
||||
|
||||
# Get current server managed node list
|
||||
my $sn_hash = xCAT::ServiceNodeUtils->getSNformattedhash(\@rnodes, "xcat", "MN");
|
||||
my %managed = {};
|
||||
foreach (@{ $sn_hash->{$cur_xmaster} }) { $managed{$_} = 1; }
|
||||
|
||||
foreach (@rnodes) {
|
||||
if (xCAT::NetworkUtils->nodeonmynet($_)) {
|
||||
push @nodes, $_;
|
||||
} else {
|
||||
xCAT::MsgUtils->message("S", "$_: grub2 netboot: stop configuration because of none sharedtftp and not on same network with its xcatmaster.");
|
||||
my $msg = "grub2 configuration file was not created for node [$_] because sharedtftp attribute is not set and the node is not on same network as this xcatmaster";
|
||||
if ( $cur_xmaster ) {
|
||||
$msg .= ": $cur_xmaster";
|
||||
}
|
||||
if ( exists( $managed{$_} ) ) {
|
||||
# report error when it is under my control but I cannot handle it.
|
||||
my $rsp;
|
||||
$rsp->{data}->[0] = $msg;
|
||||
xCAT::MsgUtils->message("E", $rsp, $callback);
|
||||
} else {
|
||||
xCAT::MsgUtils->message("S", $msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -1762,6 +1762,56 @@ sub check_bmc_status_with_ipmitool {
|
||||
return 0;
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------#
|
||||
# Wait for OS to reboot by checking "nodestat" to be "sshd" :
|
||||
# Arguments:
|
||||
# initial_sleep: seconds to sleep before checking loop start
|
||||
# inteval: inteval time to check
|
||||
# retry: max retry time
|
||||
# sessdata: session data for display
|
||||
# verbose: verbose output
|
||||
# Returns:
|
||||
# 1 when OS is up
|
||||
# 0 when no response of "sshd" from OS
|
||||
#----------------------------------------------------------------#
|
||||
sub wait_for_os_to_reboot {
|
||||
my $initial_sleep = shift;
|
||||
my $interval = shift;
|
||||
my $retry = shift;
|
||||
my $sessdata = shift;
|
||||
my $verbose = shift;
|
||||
my $cmd;
|
||||
my $output;
|
||||
if ($verbose) {
|
||||
xCAT::SvrUtils::sendmsg("Sleeping for a few min waiting for node to power on before attempting to continue", $callback, $sessdata->{node}, %allerrornodes);
|
||||
}
|
||||
sleep($initial_sleep); # sleep initially for $initial_sleep seconds for node to reboot
|
||||
# Start testing every $interval sec for node to be booted. Give up after $retry times.
|
||||
foreach (1..$retry) {
|
||||
# Test node is booted in to OS
|
||||
$cmd = "nodestat $sessdata->{node} | /usr/bin/grep sshd";
|
||||
$output = xCAT::Utils->runcmd($cmd, -1);
|
||||
if ($::RUNCMD_RC == 0) {
|
||||
# Node is ready to retry an upgrage
|
||||
if ($verbose) {
|
||||
xCAT::SvrUtils::sendmsg("Detected node booted. Will retry upgrade", $callback, $sessdata->{node}, %allerrornodes);
|
||||
}
|
||||
return 1; #Node booted
|
||||
}
|
||||
else {
|
||||
# Still not booted, wait for $interval sec and try again
|
||||
if ($verbose) {
|
||||
$cmd = "nodestat $sessdata->{node}";
|
||||
$output = xCAT::Utils->runcmd($cmd, -1);
|
||||
my ($nodename, $state) = split(/:/, $output);
|
||||
xCAT::SvrUtils::sendmsg("($_) Node still not ready. Current state - $state, test again in $interval sec.", $callback, $sessdata->{node}, %allerrornodes);
|
||||
}
|
||||
sleep($interval);
|
||||
}
|
||||
}
|
||||
return 0; #Node did not boot after requested delay
|
||||
}
|
||||
|
||||
sub do_firmware_update {
|
||||
my $sessdata = shift;
|
||||
my $ret;
|
||||
@@ -1769,6 +1819,9 @@ sub do_firmware_update {
|
||||
my $verbose = 0;
|
||||
my $retry = 2;
|
||||
my $verbose_opt;
|
||||
my $is_firestone = 0;
|
||||
my $firestone_update_version;
|
||||
my $htm_update_version;
|
||||
$ret = get_ipmitool_version(\$ipmitool_ver);
|
||||
exit $ret if $ret < 0;
|
||||
|
||||
@@ -1789,7 +1842,7 @@ sub do_firmware_update {
|
||||
|
||||
my $exit_with_success_func = sub {
|
||||
my ($node, $callback, $message) = @_;
|
||||
my $status = "success to update firmware";
|
||||
my $status = "success updating firmware";
|
||||
my $nodelist_table = xCAT::Table->new('nodelist');
|
||||
if (!$nodelist_table) {
|
||||
xCAT::MsgUtils->message("S", "Unable to open nodelist table, denying");
|
||||
@@ -1883,8 +1936,6 @@ sub do_firmware_update {
|
||||
}
|
||||
}
|
||||
|
||||
xCAT::SvrUtils::sendmsg("rflash started, upgrade failure will be retried up to $retry times. Please wait...",
|
||||
$callback, $sessdata->{node}, %allerrornodes);
|
||||
|
||||
# check for 8335-GTB Firmware above 1610A release. If below, exit
|
||||
if ($output =~ /8335-GTB/) {
|
||||
@@ -1903,6 +1954,69 @@ sub do_firmware_update {
|
||||
"Error: Current firmware level OP8v_$grs_version requires one-time manual update to at least version OP8v_1.7_2.55");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
# For Firestone the update from 810 to 820 or from 820 to 810 needs to be done in 3 steps
|
||||
# instead of usual one.
|
||||
if ($output =~ /8335-GCA|8335-GTA/) {
|
||||
$is_firestone = 1;
|
||||
$cmd = $pre_cmd . " fru print 47";
|
||||
$output = xCAT::Utils->runcmd($cmd, -1);
|
||||
if ($::RUNCMD_RC != 0) {
|
||||
$exit_with_error_func->($sessdata->{node}, $callback,
|
||||
"Running ipmitool command $cmd failed: $output");
|
||||
}
|
||||
# Check what firmware version is currently running on the machine
|
||||
if ($output =~ /OP8_v\d\.\d+_(\d+)\.\d+/) {
|
||||
my $frs_version = $1;
|
||||
if ($frs_version == 1) {
|
||||
$firestone_update_version = "810";
|
||||
}
|
||||
if ($frs_version == 2) {
|
||||
$firestone_update_version = "820";
|
||||
}
|
||||
}
|
||||
else {
|
||||
$exit_with_error_func->($sessdata->{node}, $callback,
|
||||
"Unable to determine firmware version currently installed. Verify that \"$cmd | grep OP8_v\" command returns a version.");
|
||||
}
|
||||
|
||||
# Check what firmware version is specified in htm file
|
||||
$cmd = "/usr/bin/grep -a FW_DESC $hpm_file";
|
||||
$output = xCAT::Utils->runcmd($cmd, -1);
|
||||
if ($::RUNCMD_RC != 0) {
|
||||
$exit_with_error_func->($sessdata->{node}, $callback,
|
||||
"Running ipmitool command $cmd failed: $output");
|
||||
}
|
||||
# Parse out build date from the description string
|
||||
if ($output =~ /FW_DESC=8335 \w+ \w+ \w+ (\w+)/) {
|
||||
my $htm_date= $1;
|
||||
# Parse out the year from "mmddyyyy" (skip 4 digits, grab last 4)
|
||||
if ($htm_date =~ /\d{4}(\d+)/) {
|
||||
my $htm_year = $1;
|
||||
if ($htm_year == 2016) {
|
||||
$htm_update_version = "810";
|
||||
}
|
||||
if ($htm_year == 2017) {
|
||||
$htm_update_version = "820";
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
$exit_with_error_func->($sessdata->{node}, $callback,
|
||||
"Unable to determine firmware version of $hpm_file.");
|
||||
}
|
||||
}
|
||||
|
||||
if ($is_firestone and
|
||||
(($firestone_update_version eq "820" and $htm_update_version eq "810") or
|
||||
($firestone_update_version eq "810" and $htm_update_version eq "820"))
|
||||
) {
|
||||
xCAT::SvrUtils::sendmsg("rflash started, Please wait...", $callback, $sessdata->{node}, %allerrornodes);
|
||||
$retry = 0; # No retry support for 3 step update process
|
||||
}
|
||||
else {
|
||||
xCAT::SvrUtils::sendmsg("rflash started, upgrade failure will be retried up to $retry times. Please wait...", $callback, $sessdata->{node}, %allerrornodes);
|
||||
}
|
||||
|
||||
RETRY_UPGRADE:
|
||||
@@ -1942,38 +2056,120 @@ RETRY_UPGRADE:
|
||||
}
|
||||
|
||||
# step 4 upgrade firmware
|
||||
$cmd = $pre_cmd . " -z " . $buffer_size . " hpm upgrade $hpm_file force ";
|
||||
$cmd .= $verbose_opt;
|
||||
|
||||
# For firestone machines if updating from 810 to 820 version or from 820 to 810,
|
||||
# extra steps are needed. Hanled in "if" block, "else" block is normal update in a single step.
|
||||
my $rflash_log_file = xCAT::Utils->full_path($sessdata->{node}.".log", RFLASH_LOG_DIR);
|
||||
$cmd .= " >".$rflash_log_file." 2>&1";
|
||||
if ($verbose) {
|
||||
xCAT::SvrUtils::sendmsg([ 0,
|
||||
"rflashing ... See the detail progress :\"tail -f $rflash_log_file\"" ],
|
||||
$callback, $sessdata->{node});
|
||||
}
|
||||
if ($is_firestone and
|
||||
(($firestone_update_version eq "820" and $htm_update_version eq "810") or
|
||||
($firestone_update_version eq "810" and $htm_update_version eq "820"))
|
||||
) {
|
||||
|
||||
$output = xCAT::Utils->runcmd($cmd, -1);
|
||||
# if upgrade command failed and we exausted number of retries
|
||||
# report an error, exit to the caller and leave node in powered off state
|
||||
# otherwise report an error, power on the node and try upgrade again
|
||||
if ($::RUNCMD_RC != 0) {
|
||||
# Since "hpm update" command in step 4 above redirects standard out and error to a log file,
|
||||
# nothing gets returned from execution of the command. Here if RC is not zero, we
|
||||
# extract all lines containing "Error" from that log file and display them in the sendmsg below
|
||||
my $get_error_cmd = "/usr/bin/grep Error $rflash_log_file";
|
||||
$output = xCAT::Utils->runcmd($get_error_cmd, 0);
|
||||
if ($retry == 0) {
|
||||
# No more retries left, report an error and exit
|
||||
# Step 4.1
|
||||
$cmd = $pre_cmd . " -z " . $buffer_size . " hpm upgrade $hpm_file component 0 force ";
|
||||
$cmd .= $verbose_opt;
|
||||
|
||||
$cmd .= " >".$rflash_log_file." 2>&1";
|
||||
if ($verbose) {
|
||||
xCAT::SvrUtils::sendmsg([ 0,
|
||||
"rflashing component 0, see the detail progress :\"tail -f $rflash_log_file\"" ],
|
||||
$callback, $sessdata->{node});
|
||||
}
|
||||
$output = xCAT::Utils->runcmd($cmd, -1);
|
||||
if ($::RUNCMD_RC != 0) {
|
||||
# Since "hpm update" command in step 4.1 above redirects standard out and error to a log file,
|
||||
# nothing gets returned from execution of the command. Here if RC is not zero, we
|
||||
# extract all lines containing "Error" from that log file and display them in the sendmsg below
|
||||
my $get_error_cmd = "/usr/bin/grep Error $rflash_log_file";
|
||||
$output = xCAT::Utils->runcmd($get_error_cmd, 0);
|
||||
$exit_with_error_func->($sessdata->{node}, $callback,
|
||||
"Running ipmitool command $cmd failed with rc=$::RUNCMD_RC and the following error messages:\n$output\nSee the $rflash_log_file for details.");
|
||||
}
|
||||
else {
|
||||
# Error upgrading, set a flag to attempt a retry
|
||||
xCAT::SvrUtils::sendmsg("Running attempt $retry of ipmitool command $cmd failed with rc=$::RUNCMD_RC and the following error messages:\n$output\nSee the $rflash_log_file for details.", $callback, $sessdata->{node}, %allerrornodes);
|
||||
$failed_upgrade = 1;
|
||||
|
||||
sleep(1); # Sleep for a second before next step
|
||||
|
||||
# Step 4.2
|
||||
$cmd = $pre_cmd . " -z " . $buffer_size . " hpm upgrade $hpm_file component 1 force ";
|
||||
$cmd .= $verbose_opt;
|
||||
|
||||
$cmd .= " >>".$rflash_log_file." 2>&1";
|
||||
if ($verbose) {
|
||||
xCAT::SvrUtils::sendmsg([ 0,
|
||||
"rflashing component 1, see the detail progress :\"tail -f $rflash_log_file\"" ],
|
||||
$callback, $sessdata->{node});
|
||||
}
|
||||
$output = xCAT::Utils->runcmd($cmd, -1);
|
||||
if ($::RUNCMD_RC != 0) {
|
||||
# Since "hpm update" command in step 4.2 above redirects standard out and error to a log file,
|
||||
# nothing gets returned from execution of the command. Here if RC is not zero, we
|
||||
# extract all lines containing "Error" from that log file and display them in the sendmsg below
|
||||
my $get_error_cmd = "/usr/bin/grep Error $rflash_log_file";
|
||||
$output = xCAT::Utils->runcmd($get_error_cmd, 0);
|
||||
$exit_with_error_func->($sessdata->{node}, $callback,
|
||||
"Running ipmitool command $cmd failed with rc=$::RUNCMD_RC and the following error messages:\n$output\nSee the $rflash_log_file for details.");
|
||||
}
|
||||
|
||||
# Wait for BMC to reboot before continuing to next step
|
||||
unless (check_bmc_status_with_ipmitool($pre_cmd, 5, 60, 10, $sessdata, $verbose)) {
|
||||
$exit_with_error_func->($sessdata->{node}, $callback,
|
||||
"Timeout waiting for the bmc ready status. Firmware update suspended");
|
||||
}
|
||||
|
||||
# Step 4.3
|
||||
$cmd = $pre_cmd . " -z " . $buffer_size . " hpm upgrade $hpm_file component 2 force ";
|
||||
$cmd .= $verbose_opt;
|
||||
|
||||
$cmd .= " >>".$rflash_log_file." 2>&1";
|
||||
if ($verbose) {
|
||||
xCAT::SvrUtils::sendmsg([ 0,
|
||||
"rflashing component 2, see the detail progress :\"tail -f $rflash_log_file\"" ],
|
||||
$callback, $sessdata->{node});
|
||||
}
|
||||
$output = xCAT::Utils->runcmd($cmd, -1);
|
||||
if ($::RUNCMD_RC != 0) {
|
||||
# Since "hpm update" command in step 4.3 above redirects standard out and error to a log file,
|
||||
# nothing gets returned from execution of the command. Here if RC is not zero, we
|
||||
# extract all lines containing "Error" from that log file and display them in the sendmsg below
|
||||
my $get_error_cmd = "/usr/bin/grep Error $rflash_log_file";
|
||||
$output = xCAT::Utils->runcmd($get_error_cmd, 0);
|
||||
$exit_with_error_func->($sessdata->{node}, $callback,
|
||||
"Running ipmitool command $cmd failed with rc=$::RUNCMD_RC and the following error messages:\n$output\nSee the $rflash_log_file for details.");
|
||||
}
|
||||
}
|
||||
|
||||
else {
|
||||
$cmd = $pre_cmd . " -z " . $buffer_size . " hpm upgrade $hpm_file force ";
|
||||
$cmd .= $verbose_opt;
|
||||
|
||||
$cmd .= " >".$rflash_log_file." 2>&1";
|
||||
if ($verbose) {
|
||||
xCAT::SvrUtils::sendmsg([ 0,
|
||||
"rflashing ... See the detail progress :\"tail -f $rflash_log_file\"" ],
|
||||
$callback, $sessdata->{node});
|
||||
}
|
||||
|
||||
$output = xCAT::Utils->runcmd($cmd, -1);
|
||||
# if upgrade command failed and we exausted number of retries
|
||||
# report an error, exit to the caller and leave node in powered off state
|
||||
# otherwise report an error, power on the node and try upgrade again
|
||||
if ($::RUNCMD_RC != 0) {
|
||||
# Since "hpm update" command in step 4 above redirects standard out and error to a log file,
|
||||
# nothing gets returned from execution of the command. Here if RC is not zero, we
|
||||
# extract all lines containing "Error" from that log file and display them in the sendmsg below
|
||||
my $get_error_cmd = "/usr/bin/grep Error $rflash_log_file";
|
||||
$output = xCAT::Utils->runcmd($get_error_cmd, 0);
|
||||
if ($retry == 0) {
|
||||
# No more retries left, report an error and exit
|
||||
$exit_with_error_func->($sessdata->{node}, $callback,
|
||||
"Running ipmitool command $cmd failed with rc=$::RUNCMD_RC and the following error messages:\n$output\nSee the $rflash_log_file for details.");
|
||||
}
|
||||
else {
|
||||
# Error upgrading, set a flag to attempt a retry
|
||||
xCAT::SvrUtils::sendmsg("Running attempt $retry of ipmitool command $cmd failed with rc=$::RUNCMD_RC and the following error messages:\n$output\nSee the $rflash_log_file for details.", $callback, $sessdata->{node}, %allerrornodes);
|
||||
$failed_upgrade = 1;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# step 5 power on
|
||||
@@ -1999,34 +2195,9 @@ RETRY_UPGRADE:
|
||||
"Running ipmitool command $cmd failed: $output");
|
||||
}
|
||||
|
||||
my $node_ready_for_retry = 0;
|
||||
if ($failed_upgrade) {
|
||||
# Update has failed in step 4. Wait for node to reboot and try again
|
||||
if ($verbose) {
|
||||
xCAT::SvrUtils::sendmsg("Sleeping for a few min waiting for node to power on before attempting a retry", $callback, $sessdata->{node}, %allerrornodes);
|
||||
}
|
||||
sleep(300); # sleep for 5 min for node to reboot
|
||||
# Start testing every 10 sec for node to be booted. Give up after 5 min.
|
||||
foreach (1..30) {
|
||||
# Test node is booted in to OS
|
||||
$cmd = "nodestat $sessdata->{node} | grep sshd";
|
||||
$output = xCAT::Utils->runcmd($cmd, -1);
|
||||
if ($::RUNCMD_RC == 0) {
|
||||
# Node is ready to retry an upgrage
|
||||
if ($verbose) {
|
||||
xCAT::SvrUtils::sendmsg("Detected node booted. Will retry upgrade", $callback, $sessdata->{node}, %allerrornodes);
|
||||
}
|
||||
$node_ready_for_retry = 1;
|
||||
last;
|
||||
}
|
||||
else {
|
||||
# Still not booted, wait for 10 sec and try again
|
||||
if ($verbose) {
|
||||
xCAT::SvrUtils::sendmsg("Node still not ready, Test again in 10 sec.", $callback, $sessdata->{node}, %allerrornodes);
|
||||
}
|
||||
sleep(10);
|
||||
}
|
||||
}
|
||||
my $node_ready_for_retry = wait_for_os_to_reboot(300,10,30,$sessdata,$verbose);
|
||||
if ($node_ready_for_retry) {
|
||||
$retry--; # decrement number of retries left
|
||||
# Yes, it is a goto statement here. Ugly, but removes the need to restructure
|
||||
@@ -2364,6 +2535,12 @@ sub power {
|
||||
my $rc = 0;
|
||||
my $text;
|
||||
my $code;
|
||||
|
||||
if (($sessdata->{subcommand} !~ /^on$|^off$|^reset$|^boot$|^stat$|^state$|^status$/) and isopenpower($sessdata)) {
|
||||
xCAT::SvrUtils::sendmsg([ 1, "unsupported command rpower $sessdata->{subcommand} for OpenPower" ], $callback, $sessdata->{node}, %allerrornodes);
|
||||
return;
|
||||
}
|
||||
|
||||
if ($sessdata->{subcommand} eq "reseat") {
|
||||
reseat_node($sessdata);
|
||||
} elsif (not $sessdata->{acpistate} and is_systemx($sessdata)) { #Only implemented for IBM servers
|
||||
@@ -2510,6 +2687,7 @@ sub power_response {
|
||||
my $text = $codes{ $rsp->{code} };
|
||||
unless ($text) { $text = sprintf("Unknown response %02xh", $rsp->{code}); }
|
||||
xCAT::SvrUtils::sendmsg([ 1, $text ], $callback, $sessdata->{node}, %allerrornodes);
|
||||
return;
|
||||
} else {
|
||||
my $command = $sessdata->{subcommand};
|
||||
my $status = $sessdata->{powerstatus};
|
||||
@@ -4354,8 +4532,9 @@ sub extractfield { #idx is location of the type/length byte, returns something a
|
||||
my $language = shift;
|
||||
my $data;
|
||||
if ($idx >= scalar @$area) {
|
||||
xCAT::SvrUtils::sendmsg([ 1, "Error parsing FRU data from BMC" ], $callback);
|
||||
return -1, undef, undef;
|
||||
# The global_sessdata store the sessdata for a node when parsefru, and it is cleaned after parsefru
|
||||
xCAT::SvrUtils::sendmsg([ 1, "Error encountered when parsing FRU data from BMC" ], $callback, $global_sessdata->{node}, %allerrornodes);
|
||||
return 0, undef, undef;
|
||||
}
|
||||
my $size = $area->[$idx] & 0b00111111;
|
||||
my $encoding = ($area->[$idx] & 0b11000000) >> 6;
|
||||
|
||||
@@ -2712,7 +2712,9 @@ sub promote_vm_to_master {
|
||||
$target = $sourcedir . "/" . $target;
|
||||
}
|
||||
unless ($target =~ /^nfs:\/\//) {
|
||||
xCAT::SvrUtils::sendmsg([ 1, "KVM plugin only has nfs://<server>/<path>/<mastername> support for cloning at this moment" ], $callback, $node);
|
||||
my $rsp;
|
||||
push @{ $rsp->{data} }, "VM cloning is only supported for nfs server vmstorage attribute. Current setting is $target";
|
||||
xCAT::MsgUtils->message('E', $rsp, $callback);
|
||||
return;
|
||||
}
|
||||
my $dom;
|
||||
|
||||
@@ -50,17 +50,17 @@ sub unsupported {
|
||||
#-------------------------------------------------------
|
||||
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',
|
||||
reventlog => 'nodehm:mgt',
|
||||
rflash => 'nodehm:mgt',
|
||||
rinv => 'nodehm:mgt',
|
||||
rpower => 'nodehm:mgt',
|
||||
rsetboot => 'nodehm:mgt',
|
||||
rspconfig => 'nodehm:mgt',
|
||||
rspreset => 'nodehm:mgt',
|
||||
rvitals => 'nodehm:mgt',
|
||||
};
|
||||
}
|
||||
|
||||
@@ -82,6 +82,30 @@ my %status_info = (
|
||||
process => \&login_response,
|
||||
},
|
||||
|
||||
REVENTLOG_REQUEST => {
|
||||
method => "GET",
|
||||
init_url => "$openbmc_project_url/logging/enumerate",
|
||||
},
|
||||
REVENTLOG_RESPONSE => {
|
||||
process => \&reventlog_response,
|
||||
},
|
||||
REVENTLOG_CLEAR_REQUEST => {
|
||||
method => "POST",
|
||||
init_url => "$openbmc_url/records/events/action/clear",
|
||||
data => "",
|
||||
},
|
||||
REVENTLOG_CLEAR_RESPONSE => {
|
||||
process => \&reventlog_response,
|
||||
},
|
||||
|
||||
RINV_REQUEST => {
|
||||
method => "GET",
|
||||
init_url => "$openbmc_project_url/inventory/enumerate",
|
||||
},
|
||||
RINV_RESPONSE => {
|
||||
process => \&rinv_response,
|
||||
},
|
||||
|
||||
RPOWER_ON_REQUEST => {
|
||||
method => "PUT",
|
||||
init_url => "$openbmc_project_url/state/host0/attr/RequestedHostTransition",
|
||||
@@ -114,43 +138,11 @@ my %status_info = (
|
||||
process => \&rpower_response,
|
||||
},
|
||||
|
||||
RINV_REQUEST => {
|
||||
method => "GET",
|
||||
init_url => "$openbmc_project_url/inventory/enumerate",
|
||||
},
|
||||
RINV_RESPONSE => {
|
||||
process => \&rinv_response,
|
||||
},
|
||||
RSETBOOT_HD_REQUEST => {
|
||||
RSETBOOT_SET_REQUEST => {
|
||||
method => "PUT",
|
||||
init_url => "",
|
||||
data => "",
|
||||
},
|
||||
RSETBOOT_HD_RESPONSE => {
|
||||
process => \&rsetboot_response,
|
||||
},
|
||||
RSETBOOT_NET_REQUEST => {
|
||||
method => "PUT",
|
||||
init_url => "",
|
||||
data => "",
|
||||
},
|
||||
RSETBOOT_NET_RESPONSE => {
|
||||
process => \&rsetboot_response,
|
||||
},
|
||||
RSETBOOT_CD_REQUEST => {
|
||||
method => "PUT",
|
||||
init_url => "",
|
||||
data => "",
|
||||
},
|
||||
RSETBOOT_CD_RESPONSE => {
|
||||
process => \&rsetboot_response,
|
||||
},
|
||||
RSETBOOT_DEF_REQUEST => {
|
||||
method => "PUT",
|
||||
init_url => "",
|
||||
data => "",
|
||||
},
|
||||
RSETBOOT_DEF_RESPONSE => {
|
||||
RSETBOOT_SET_RESPONSE => {
|
||||
process => \&rsetboot_response,
|
||||
},
|
||||
RSETBOOT_STATUS_REQUEST => {
|
||||
@@ -160,20 +152,21 @@ my %status_info = (
|
||||
RSETBOOT_STATUS_RESPONSE => {
|
||||
process => \&rsetboot_response,
|
||||
},
|
||||
REVENTLOG_REQUEST => {
|
||||
|
||||
RSPCONFIG_GET_REQUEST => {
|
||||
method => "GET",
|
||||
init_url => "$openbmc_project_url/logging/enumerate",
|
||||
init_url => "",
|
||||
},
|
||||
REVENTLOG_RESPONSE => {
|
||||
process => \&reventlog_response,
|
||||
RSPCONFIG_GET_RESPONSE => {
|
||||
process => \&rspconfig_response,
|
||||
},
|
||||
REVENTLOG_CLEAR_REQUEST => {
|
||||
RSPCONFIG_SET_REQUEST => {
|
||||
method => "POST",
|
||||
init_url => "$openbmc_url/records/events/action/clear",
|
||||
init_url => "",
|
||||
data => "",
|
||||
},
|
||||
REVENTLOG_CLEAR_RESPONSE => {
|
||||
process => \&reventlog_response,
|
||||
RSPCONFIG_SET_RESPONSE => {
|
||||
process => \&rspconfig_response,
|
||||
},
|
||||
);
|
||||
|
||||
@@ -193,11 +186,10 @@ $::RESPONSE_SERVICE_UNAVAILABLE = "503 Service Unavailable";
|
||||
cur_status => "LOGIN_REQUEST",
|
||||
cur_url => "",
|
||||
method => "",
|
||||
back_urls => (),
|
||||
},
|
||||
);
|
||||
|
||||
'cur_url', 'method', 'back_urls' used for path has a trailing-slash
|
||||
'cur_url', 'method' used for path has a trailing-slash
|
||||
|
||||
=cut
|
||||
|
||||
@@ -260,9 +252,9 @@ sub preprocess_request {
|
||||
return;
|
||||
}
|
||||
|
||||
my $parse_result = parse_args($command, $extrargs);
|
||||
my $parse_result = parse_args($command, $extrargs, $noderange);
|
||||
if (ref($parse_result) eq 'ARRAY') {
|
||||
$callback->({ errorcode => $parse_result->[0], data => $parse_result->[1] });
|
||||
$callback->({ errorcode => [$parse_result->[0]], data => [$parse_result->[1]] });
|
||||
$request = {};
|
||||
return;
|
||||
}
|
||||
@@ -293,8 +285,9 @@ sub process_request {
|
||||
my $command = $request->{command}->[0];
|
||||
my $noderange = $request->{node};
|
||||
|
||||
parse_node_info($noderange);
|
||||
parse_command_status($command);
|
||||
my $check = parse_node_info($noderange);
|
||||
my $rst = parse_command_status($command);
|
||||
return if ($rst);
|
||||
|
||||
if ($request->{command}->[0] ne "getopenbmccons") {
|
||||
$cookie_jar = HTTP::Cookies->new({});
|
||||
@@ -338,7 +331,6 @@ sub process_request {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
while (1) {
|
||||
last unless ($wait_node_num);
|
||||
while (my ($response, $handle_id) = $async->wait_for_next_response) {
|
||||
@@ -346,6 +338,7 @@ sub process_request {
|
||||
}
|
||||
}
|
||||
|
||||
$callback->({ errorcode => $check }) if ($check);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -361,31 +354,31 @@ sub process_request {
|
||||
sub parse_args {
|
||||
my $command = shift;
|
||||
my $extrargs = shift;
|
||||
my $noderange = shift;
|
||||
my $check = undef;
|
||||
|
||||
if (!defined($extrargs) and $command =~ /rpower|rsetboot|rspconfig/) {
|
||||
return ([ 1, "No option specified for $command" ]);
|
||||
}
|
||||
|
||||
if (scalar(@ARGV) > 1 and $command ne "rsetboot" and $command ne "reventlog") {
|
||||
if (scalar(@ARGV) > 1 and ($command =~ /rpower|rinv|rsetboot/)) {
|
||||
return ([ 1, "Only one option is supported at the same time" ]);
|
||||
}
|
||||
|
||||
my $subcommand = $ARGV[0];
|
||||
if ($command eq "rpower") {
|
||||
#
|
||||
# disable function until fully tested
|
||||
# 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
|
||||
# disable function until fully tested
|
||||
#
|
||||
$check = unsupported($callback); if (ref($check) eq "ARRAY") { return $check; }
|
||||
|
||||
$subcommand = "all" if (!defined($ARGV[0]));
|
||||
unless ($subcommand =~ /^cpu$|^dimm$|^model$|^serial$|^firm$|^mac$|^vpd$|^mprom$|^deviceid$|^guid$|^uuid$|^all$/) {
|
||||
return ([ 1, "Unsupported command: $command $subcommand" ]);
|
||||
@@ -393,12 +386,9 @@ sub parse_args {
|
||||
} elsif ($command eq "getopenbmccons") {
|
||||
#command for openbmc rcons
|
||||
} elsif ($command eq "rsetboot") {
|
||||
if (!defined($extrargs)) {
|
||||
return ([ 1, "No option specified for $command" ]);
|
||||
}
|
||||
#
|
||||
# disable function until fully tested
|
||||
#
|
||||
#
|
||||
$check = unsupported($callback); if (ref($check) eq "ARRAY") { return $check; }
|
||||
unless ($subcommand =~ /^net$|^hd$|^cd$|^def$|^default$|^stat$/) {
|
||||
return ([ 1, "Unsupported command: $command $subcommand" ]);
|
||||
@@ -406,13 +396,39 @@ sub parse_args {
|
||||
} elsif ($command eq "reventlog") {
|
||||
#
|
||||
# disable function until fully tested
|
||||
#
|
||||
$subcommand = "all" if (!defined($ARGV[0]));
|
||||
#
|
||||
$check = unsupported($callback); if (ref($check) eq "ARRAY") { return $check; }
|
||||
$subcommand = "all" if (!defined($ARGV[0]));
|
||||
unless ($subcommand =~ /^\d$|^\d+$|^all$|^clear$/) {
|
||||
return ([ 1, "Unsupported command: $command $subcommand" ]);
|
||||
}
|
||||
} elsif ($command eq "rspconfig") {
|
||||
#
|
||||
# disable function until fully tested
|
||||
#
|
||||
$check = unsupported($callback); if (ref($check) eq "ARRAY") { return $check; }
|
||||
my $setorget;
|
||||
foreach $subcommand (@ARGV) {
|
||||
if ($subcommand =~ /^(\w+)=(.*)/) {
|
||||
return ([ 1, "Can not configure and display nodes' value at the same time" ]) if ($setorget and $setorget eq "get");
|
||||
my $key = $1;
|
||||
my $value = $2;
|
||||
return ([ 1, "Unsupported command: $command $key" ]) unless ($key =~ /^ip$|^netmask$|^gateway$|^vlan$/);
|
||||
|
||||
my $nodes_num = @$noderange;
|
||||
return ([ 1, "Invalid parameter for option $key" ]) unless ($value);
|
||||
return ([ 1, "Invalid parameter for option $key: $value" ]) unless (xCAT::NetworkUtils->isIpaddr($value));
|
||||
if ($key eq "ip") {
|
||||
return ([ 1, "Can not configure more than 1 nodes' ip at the same time" ]) if ($nodes_num >= 2);
|
||||
}
|
||||
$setorget = "set";
|
||||
} elsif ($subcommand =~ /^ip$|^netmask$|^gateway$|^vlan$/) {
|
||||
return ([ 1, "Can not configure and display nodes' value at the same time" ]) if ($setorget and $setorget eq "set");
|
||||
$setorget = "get";
|
||||
} else {
|
||||
return ([ 1, "Unsupported command: $command $subcommand" ]);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
return ([ 1, "Command is not supported." ]);
|
||||
}
|
||||
@@ -475,40 +491,30 @@ sub parse_command_status {
|
||||
if ($command eq "rsetboot") {
|
||||
my $persistent = 0;
|
||||
unless (GetOptions("p" => \$persistent,)) {
|
||||
xCAT::SvrUtils::sendmsg([ 1, "Error parsing arguments" ], $callback);
|
||||
exit 1;
|
||||
xCAT::SvrUtils::sendmsg("Error parsing arguments.", $callback);
|
||||
return 1;
|
||||
}
|
||||
|
||||
$subcommand = $ARGV[0];
|
||||
if ($subcommand eq "hd") {
|
||||
$next_status{LOGIN_RESPONSE} = "RSETBOOT_HD_REQUEST";
|
||||
$next_status{RSETBOOT_HD_REQUEST} = "RSETBOOT_HD_RESPONSE";
|
||||
# modify $status_info{RSETBOOT_SET_REQUEST}{data} if $persistent or $uefi
|
||||
} elsif ($subcommand eq "net") {
|
||||
$next_status{LOGIN_RESPONSE} = "RSETBOOT_NET_REQUEST";
|
||||
$next_status{RSETBOOT_NET_REQUEST} = "RSETBOOT_NET_RESPONSE";
|
||||
# modify $status_info{RSETBOOT_SET_REQUEST}{data} if $persistent or $uefi
|
||||
} elsif ($subcommand eq "cd"){
|
||||
$next_status{LOGIN_RESPONSE} = "RSETBOOT_CD_REQUEST";
|
||||
$next_status{RSETBOOT_CD_REQUEST} = "RSETBOOT_CD_RESPONSE";
|
||||
# modify $status_info{RSETBOOT_SET_REQUEST}{data} if $persistent or $uefi
|
||||
} elsif ($subcommand eq "default" or $subcommand eq "def") {
|
||||
$next_status{LOGIN_RESPONSE} = "RSETBOOT_DEF_REQUEST";
|
||||
$next_status{RSETBOOT_DEF_REQUEST} = "RSETBOOT_DEF_RESPONSE";
|
||||
# modify $status_info{RSETBOOT_SET_REQUEST}{data} if $persistent or $uefi
|
||||
if ($subcommand =~ /^hd$|^net$|^cd$|^default$|^def$/) {
|
||||
$next_status{LOGIN_RESPONSE} = "RSETBOOT_SET_REQUEST";
|
||||
$next_status{RSETBOOT_SET_REQUEST} = "RSETBOOT_SET_RESPONSE";
|
||||
# modify $status_info{RSETBOOT_SET_REQUEST}{data}
|
||||
$next_status{RSETBOOT_SET_RESPONSE} = "RSETBOOT_STATUS_REQUEST";
|
||||
$next_status{RSETBOOT_STATUS_REQUEST} = "RSETBOOT_STATUS_RESPONSE";
|
||||
} elsif ($subcommand eq "stat") {
|
||||
$next_status{LOGIN_RESPONSE} = "RSETBOOT_STATUS_REQUEST";
|
||||
$next_status{RSETBOOT_STATUS_REQUEST} = "RSETBOOT_STATUS_RESPONSE";
|
||||
}
|
||||
xCAT::SvrUtils::sendmsg("Command $command is not available now!", $callback);
|
||||
exit;
|
||||
return 1;
|
||||
}
|
||||
|
||||
if ($command eq "reventlog") {
|
||||
my $option_s = 0;
|
||||
unless (GetOptions("s" => \$option_s,)) {
|
||||
xCAT::SvrUtils::sendmsg([ 1, "Error parsing arguments" ], $callback);
|
||||
exit 1;
|
||||
xCAT::SvrUtils::sendmsg("Error parsing arguments.", $callback);
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (defined($ARGV[0])) {
|
||||
@@ -520,6 +526,8 @@ sub parse_command_status {
|
||||
if ($subcommand eq "clear") {
|
||||
$next_status{LOGIN_RESPONSE} = "REVENTLOG_CLEAR_REQUEST";
|
||||
$next_status{REVENTLOG_CLEAR_REQUEST} = "REVENTLOG_CLEAR_RESPONSE";
|
||||
xCAT::SvrUtils::sendmsg("Command $command is not available now!", $callback);
|
||||
return 1;
|
||||
} else {
|
||||
$next_status{LOGIN_RESPONSE} = "REVENTLOG_REQUEST";
|
||||
$next_status{REVENTLOG_REQUEST} = "REVENTLOG_RESPONSE";
|
||||
@@ -528,7 +536,34 @@ sub parse_command_status {
|
||||
}
|
||||
}
|
||||
|
||||
if ($command eq "rspconfig") {
|
||||
my @options = ();
|
||||
foreach $subcommand (@ARGV) {
|
||||
if ($subcommand =~ /^ip$|^netmask$|^gateway$/) {
|
||||
$next_status{LOGIN_RESPONSE} = "RSPCONFIG_GET_REQUEST";
|
||||
$next_status{RSPCONFIG_GET_REQUEST} = "RSPCONFIG_GET_RESPONSE";
|
||||
push @options, $subcommand;
|
||||
} elsif ($subcommand =~ /^(\w+)=(.+)/) {
|
||||
my $key = $1;
|
||||
my $value = $2;
|
||||
$next_status{LOGIN_RESPONSE} = "RSPCONFIG_SET_REQUEST";
|
||||
$next_status{RSPCONFIG_SET_REQUEST} = "RSPCONFIG_SET_RESPONSE";
|
||||
$next_status{RSPCONFIG_SET_RESPONSE} = "RSPCONFIG_GET_REQUEST";
|
||||
$next_status{RSPCONFIG_GET_REQUEST} = "RSPCONFIG_GET_RESPONSE";
|
||||
if ($key eq "ip") {
|
||||
$status_info{RSPCONFIG_SET_RESPONSE}{ip} = $value;
|
||||
}
|
||||
$status_info{RSPCONFIG_SET_REQUEST}{data} = ""; # wait for interface, ip/netmask/gateway is $value
|
||||
push @options, $key;
|
||||
}
|
||||
}
|
||||
$next_status{RSPCONFIG_GET_RESPONSE}{argv} = join(",", @options);
|
||||
xCAT::SvrUtils::sendmsg("Command $command is not available now!", $callback);
|
||||
return 1;
|
||||
}
|
||||
|
||||
print Dumper(\%next_status) . "\n";
|
||||
return;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------
|
||||
@@ -542,6 +577,7 @@ sub parse_command_status {
|
||||
#-------------------------------------------------------
|
||||
sub parse_node_info {
|
||||
my $noderange = shift;
|
||||
my $rst = 0;
|
||||
|
||||
my $passwd_table = xCAT::Table->new('passwd');
|
||||
my $passwd_hash = $passwd_table->getAttribs({ 'key' => 'openbmc' }, qw(username password));
|
||||
@@ -555,6 +591,7 @@ sub parse_node_info {
|
||||
$node_info{$node}{bmc} = $openbmc_hash->{$node}->[0]->{'bmc'};
|
||||
} else {
|
||||
xCAT::SvrUtils::sendmsg("Unable to get attribute bmc", $callback, $node);
|
||||
$rst = 1;
|
||||
next;
|
||||
}
|
||||
|
||||
@@ -565,6 +602,7 @@ sub parse_node_info {
|
||||
} else {
|
||||
xCAT::SvrUtils::sendmsg("Unable to get attribute username", $callback, $node);
|
||||
delete $node_info{$node};
|
||||
$rst = 1;
|
||||
next;
|
||||
}
|
||||
|
||||
@@ -575,19 +613,21 @@ sub parse_node_info {
|
||||
} else {
|
||||
xCAT::SvrUtils::sendmsg("Unable to get attribute password", $callback, $node);
|
||||
delete $node_info{$node};
|
||||
$rst = 1;
|
||||
next;
|
||||
}
|
||||
|
||||
$node_info{$node}{cur_status} = "LOGIN_REQUEST";
|
||||
} else {
|
||||
xCAT::SvrUtils::sendmsg("Unable to get information from openbmc table", $callback, $node);
|
||||
$rst = 1;
|
||||
next;
|
||||
}
|
||||
}
|
||||
|
||||
print Dumper(\%node_info) ."\n";
|
||||
|
||||
return;
|
||||
return $rst;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------
|
||||
@@ -734,6 +774,11 @@ sub rpower_response {
|
||||
|
||||
my $response_info = decode_json $response->content;
|
||||
|
||||
foreach my $key (keys %{$response_info->{data}}) {
|
||||
# Debug, print out the Current and Transition States
|
||||
print "$node: DEBUG host_states $key=$response_info->{'data'}->{$key}\n";
|
||||
}
|
||||
|
||||
if ($node_info{$node}{cur_status} eq "RPOWER_ON_RESPONSE") {
|
||||
if ($response_info->{'message'} eq $::RESPONSE_OK) {
|
||||
xCAT::SvrUtils::sendmsg("on", $callback, $node);
|
||||
@@ -912,32 +957,11 @@ sub rsetboot_response {
|
||||
|
||||
my $response_info = decode_json $response->content;
|
||||
|
||||
if ($node_info{$node}{cur_status} eq "RSETBOOT_HD_RESPONSE") {
|
||||
if ($response_info->{'message'} eq $::RESPONSE_OK) {
|
||||
xCAT::SvrUtils::sendmsg("Hard Drive", $callback, $node);
|
||||
}
|
||||
}
|
||||
|
||||
if ($node_info{$node}{cur_status} eq "RSETBOOT_NET_RESPONSE") {
|
||||
if ($response_info->{'message'} eq $::RESPONSE_OK) {
|
||||
xCAT::SvrUtils::sendmsg("Network", $callback, $node);
|
||||
}
|
||||
}
|
||||
|
||||
if ($node_info{$node}{cur_status} eq "RSETBOOT_CD_RESPONSE") {
|
||||
if ($response_info->{'message'} eq $::RESPONSE_OK) {
|
||||
xCAT::SvrUtils::sendmsg("CD/DVD", $callback, $node);
|
||||
}
|
||||
}
|
||||
|
||||
if ($node_info{$node}{cur_status} eq "RSETBOOT_DEF_RESPONSE") {
|
||||
if ($response_info->{'message'} eq $::RESPONSE_OK) {
|
||||
xCAT::SvrUtils::sendmsg("boot override inactive", $callback, $node);
|
||||
}
|
||||
}
|
||||
|
||||
if ($node_info{$node}{cur_status} eq "RSETBOOT_STATUS_RESPONSE") {
|
||||
# wait for more information
|
||||
if ($node_info{$node}{cur_status} eq "RSETBOOT_GET_RESPONSE") {
|
||||
xCAT::SvrUtils::sendmsg("Hard Drive", $callback, $node); #if response data is hd
|
||||
xCAT::SvrUtils::sendmsg("Network", $callback, $node); #if response data is net
|
||||
xCAT::SvrUtils::sendmsg("CD/DVD", $callback, $node); #if response data is net
|
||||
xCAT::SvrUtils::sendmsg("boot override inactive", $callback, $node); #if response data is def
|
||||
}
|
||||
|
||||
if ($next_status{ $node_info{$node}{cur_status} }) {
|
||||
@@ -1009,4 +1033,61 @@ sub reventlog_response {
|
||||
}
|
||||
}
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head3 rspconfig_response
|
||||
|
||||
Deal with response of rspconfig command
|
||||
Input:
|
||||
$node: nodename of current response
|
||||
$response: Async return response
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
sub rspconfig_response {
|
||||
my $node = shift;
|
||||
my $response = shift;
|
||||
|
||||
my $response_info = decode_json $response->content;
|
||||
|
||||
if ($node_info{$node}{cur_status} eq "RSPCONFIG_GET_RESPONSE") {
|
||||
my $grep_string = $status_info{RSPCONFIG_GET_RESPONSE}{argv};
|
||||
my $data;
|
||||
my @output;
|
||||
if ($grep_string =~ "ip") {
|
||||
$data = ""; # got data from response
|
||||
push @output, "BMC IP: $data";
|
||||
}
|
||||
if ($grep_string =~ "netmask") {
|
||||
$data = ""; # got data from response
|
||||
push @output, "BMC Netmask: $data";
|
||||
}
|
||||
if ($grep_string =~ "gateway") {
|
||||
$data = ""; # got data from response
|
||||
push @output, "BMC Gateway: $data";
|
||||
}
|
||||
if ($grep_string =~ "vlan") {
|
||||
$data = ""; # got data from response
|
||||
push @output, "BMC VLAN ID enabled: $data";
|
||||
}
|
||||
|
||||
xCAT::SvrUtils::sendmsg("$_", $callback, $node) foreach (@output);
|
||||
}
|
||||
|
||||
if ($node_info{$node}{cur_status} eq "RSPCONFIG_SET_RESPONSE" and $response_info->{'message'} eq $::RESPONSE_OK) {
|
||||
if ($status_info{RSPCONFIG_SET_RESPONSE}{ip}) {
|
||||
$node_info{$node}{bmc} = $status_info{RSPCONFIG_SET_RESPONSE}{ip};
|
||||
print "$node: DEBUG BMC IP is $node_info{$node}{bmc}\n";
|
||||
}
|
||||
}
|
||||
|
||||
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--;
|
||||
}
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
@@ -203,8 +203,12 @@ sub setstate {
|
||||
} elsif ($kern and $kern->{kernel} and $cref and $cref->{currstate} ne "offline") {
|
||||
|
||||
#It's time to set petitboot for this node to boot the kernel, but only if not offline directive
|
||||
print $pcfg "default xCAT\n";
|
||||
print $pcfg "label xCAT\n";
|
||||
my $label = "xCAT";
|
||||
if ($cref->{currstate} eq "shell") {
|
||||
$label = "xCAT Genesis shell";
|
||||
}
|
||||
print $pcfg "default $label\n";
|
||||
print $pcfg "label $label\n";
|
||||
print $pcfg "\tkernel $kern->{kernel}\n";
|
||||
if ($kern and $kern->{initrd}) {
|
||||
print $pcfg "\tinitrd " . $kern->{initrd} . "\n";
|
||||
@@ -404,11 +408,31 @@ sub process_request {
|
||||
#if not shared tftpdir, then filter, otherwise, set up everything
|
||||
if ($request->{'_disparatetftp'}->[0]) { #reading hint from preprocess_command
|
||||
@nodes = ();
|
||||
my @hostinfo = xCAT::NetworkUtils->determinehostname();
|
||||
my $cur_xmaster = pop @hostinfo;
|
||||
xCAT::MsgUtils->trace(0, "d", "petitboot: running on $cur_xmaster");
|
||||
|
||||
# Get current server managed node list
|
||||
my $sn_hash = xCAT::ServiceNodeUtils->getSNformattedhash(\@rnodes, "xcat", "MN");
|
||||
my %managed = {};
|
||||
foreach (@{ $sn_hash->{$cur_xmaster} }) { $managed{$_} = 1; }
|
||||
|
||||
foreach (@rnodes) {
|
||||
if (xCAT::NetworkUtils->nodeonmynet($_)) {
|
||||
push @nodes, $_;
|
||||
} else {
|
||||
xCAT::MsgUtils->message("S", "$_: petitboot netboot: stop configuration because of none sharedtftp and not on same network with its xcatmaster.");
|
||||
my $msg = "petitboot configuration file was not created for node [$_] because sharedtftp attribute is not set and the node is not on same network as this xcatmaster";
|
||||
if ( $cur_xmaster ) {
|
||||
$msg .= ": $cur_xmaster";
|
||||
}
|
||||
if ( exists( $managed{$_} ) ) {
|
||||
# report error when it is under my control but I cannot handle it.
|
||||
my $rsp;
|
||||
$rsp->{data}->[0] = $msg;
|
||||
xCAT::MsgUtils->message("E", $rsp, $callback);
|
||||
} else {
|
||||
xCAT::MsgUtils->message("S", $msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -477,7 +501,11 @@ sub process_request {
|
||||
if ($args[0] eq 'next') {
|
||||
$sub_req->({ command => ['rsetboot'],
|
||||
node => \@nodes,
|
||||
arg => ['default'] });
|
||||
arg => ['default'],
|
||||
#todo: do not need to pass the XCAT_OPENBMC_DEVEL after the openbmc dev work finish
|
||||
#this does not hurt anything for other plugins
|
||||
environment => {XCAT_OPENBMC_DEVEL=>"YES"}
|
||||
});
|
||||
xCAT::MsgUtils->message("S", "xCAT: petitboot netboot: clear node(s): @nodes boot device setting.");
|
||||
}
|
||||
my $chaintab = xCAT::Table->new('chain', -create => 1);
|
||||
|
||||
@@ -333,7 +333,7 @@ sub rinstall {
|
||||
my @cmd = "Run command: nodeset @nodes @parameter";
|
||||
push @{ $rsp->{data} }, @cmd;
|
||||
push @{ $rsp->{data} }, @$res;
|
||||
xCAT::MsgUtils->message("I", $rsp, $callback);
|
||||
xCAT::MsgUtils->message("D", $rsp, $callback);
|
||||
}
|
||||
unless ($rc == 0) {
|
||||
|
||||
@@ -382,7 +382,7 @@ sub rinstall {
|
||||
foreach my $hmkey (keys %hmhash) {
|
||||
$::RUNCMD_RC = 0;
|
||||
my @nodes = @{ $hmhash{$hmkey} };
|
||||
unless (($hmkey =~ /^ipmi$/) or ($hmkey =~ /^blade$/) or ($hmkey =~ /^hmc$/) or ($hmkey =~ /^ivm$/) or ($hmkey =~ /^fsp$/) or ($hmkey =~ /^kvm$/) or ($hmkey =~ /^esx$/) or ($hmkey =~ /^rhevm$/)) {
|
||||
unless ($hmkey =~ /^(ipmi|blade|hmc|ivm|fsp|kvm|esx|rhevm|openbmc)$/) {
|
||||
my $rsp = {};
|
||||
$rsp->{error}->[0] = "@nodes: rinstall only support nodehm.mgt type 'ipmi', 'blade', 'hmc', 'ivm', 'fsp', 'kvm', 'esx', 'rhevm'.";
|
||||
$rsp->{errorcode}->[0] = 1;
|
||||
@@ -401,13 +401,14 @@ sub rinstall {
|
||||
},
|
||||
$subreq, -1, 1);
|
||||
|
||||
|
||||
$rc = $::RUNCMD_RC;
|
||||
my $rsp = {};
|
||||
if ($VERBOSE) {
|
||||
my @cmd = "Run command: rnetboot @nodes";
|
||||
push @{ $rsp->{data} }, @cmd;
|
||||
push @{ $rsp->{data} }, @$res;
|
||||
xCAT::MsgUtils->message("I", $rsp, $callback);
|
||||
xCAT::MsgUtils->message("D", $rsp, $callback);
|
||||
}
|
||||
unless ($rc == 0) {
|
||||
|
||||
@@ -435,8 +436,8 @@ sub rinstall {
|
||||
}
|
||||
}
|
||||
else {
|
||||
# Call "rsetboot" to set the boot order of the nodehm.mgt=ipmi nodes
|
||||
if ($hmkey =~ /^ipmi$/) {
|
||||
# Call "rsetboot" to set the boot order of the nodehm.mgt=ipmi/openbmc nodes
|
||||
if ($hmkey =~ /^(ipmi|openbmc)$/) {
|
||||
%nodes = map { $_, 1 } @nodes;
|
||||
|
||||
# Run rsetboot $noderange net
|
||||
@@ -445,25 +446,33 @@ sub rinstall {
|
||||
if ($UEFIMODE) {
|
||||
push @rsetbootarg, "-u";
|
||||
}
|
||||
my $res =
|
||||
xCAT::Utils->runxcmd(
|
||||
{
|
||||
|
||||
my %req=(
|
||||
command => ["rsetboot"],
|
||||
node => \@nodes,
|
||||
arg => \@rsetbootarg
|
||||
},
|
||||
);
|
||||
|
||||
#TODO: When OPENBMC support is finished, this line should be removed
|
||||
if($hmkey =~ /^openbmc$/){
|
||||
$req{environment}{XCAT_OPENBMC_DEVEL}= "YES";
|
||||
}
|
||||
|
||||
my $res =
|
||||
xCAT::Utils->runxcmd(
|
||||
\%req,
|
||||
$subreq, -1, 1);
|
||||
|
||||
|
||||
$rc = $::RUNCMD_RC;
|
||||
my $rsp = {};
|
||||
if ($VERBOSE) {
|
||||
my @cmd = "Run command: rsetboot @nodes @rsetbootarg";
|
||||
push @{ $rsp->{data} }, @cmd;
|
||||
push @{ $rsp->{data} }, @$res;
|
||||
xCAT::MsgUtils->message("I", $rsp, $callback);
|
||||
xCAT::MsgUtils->message("D", $rsp, $callback);
|
||||
}
|
||||
unless ($rc == 0) {
|
||||
|
||||
# We got an error with the rsetboot
|
||||
my @successnodes;
|
||||
my @failurenodes;
|
||||
@@ -497,13 +506,20 @@ sub rinstall {
|
||||
# Run rpower $noderange boot
|
||||
my @rpowerarg;
|
||||
push @rpowerarg, "boot";
|
||||
my $res =
|
||||
xCAT::Utils->runxcmd(
|
||||
{
|
||||
my %req=(
|
||||
command => ["rpower"],
|
||||
node => \@nodes,
|
||||
arg => \@rpowerarg
|
||||
},
|
||||
);
|
||||
|
||||
#TODO: When OPENBMC support is finished, this line should be removed
|
||||
if($hmkey =~ /^openbmc$/){
|
||||
$req{environment}{XCAT_OPENBMC_DEVEL} = "YES";
|
||||
}
|
||||
|
||||
my $res =
|
||||
xCAT::Utils->runxcmd(
|
||||
\%req,
|
||||
$subreq, -1, 1);
|
||||
|
||||
$rc = $::RUNCMD_RC;
|
||||
@@ -512,10 +528,9 @@ sub rinstall {
|
||||
my @cmd = "Run command: rpower @nodes @rpowerarg";
|
||||
push @{ $rsp->{data} }, @cmd;
|
||||
push @{ $rsp->{data} }, @$res;
|
||||
xCAT::MsgUtils->message("I", $rsp, $callback);
|
||||
xCAT::MsgUtils->message("D", $rsp, $callback);
|
||||
}
|
||||
unless ($rc == 0) {
|
||||
|
||||
# We got an error with the rpower
|
||||
my @failurenodes;
|
||||
foreach my $line (@$res) {
|
||||
|
||||
@@ -449,11 +449,33 @@ sub process_request {
|
||||
#if not shared, then help sync up
|
||||
if ($::XNBA_request->{'_disparatetftp'}->[0]) { #reading hint from preprocess_command
|
||||
@nodes = ();
|
||||
my @hostinfo = xCAT::NetworkUtils->determinehostname();
|
||||
my $cur_xmaster = pop @hostinfo;
|
||||
xCAT::MsgUtils->trace(0, "d", "xnba: running on $cur_xmaster");
|
||||
|
||||
# Get current server managed node list
|
||||
my $sn_hash = xCAT::ServiceNodeUtils->getSNformattedhash(\@rnodes, "xcat", "MN");
|
||||
my %managed = {};
|
||||
foreach (@{ $sn_hash->{$cur_xmaster} }) { $managed{$_} = 1; }
|
||||
|
||||
# Whatever the node managed by this xcatmaster explicitly, if the node in same subnet, we need to handle its boot configuration files
|
||||
foreach (@rnodes) {
|
||||
if (xCAT::NetworkUtils->nodeonmynet($_)) {
|
||||
push @nodes, $_;
|
||||
} else {
|
||||
xCAT::MsgUtils->message("S", "$_: xnba netboot: stop configuration because of none sharedtftp and not on same network with its xcatmaster.");
|
||||
my $msg = "xnba configuration file was not created for node [$_] because sharedtftp attribute is not set and the node is not on same network as this xcatmaster";
|
||||
if ( $cur_xmaster ) {
|
||||
$msg .= ": $cur_xmaster";
|
||||
}
|
||||
if ( exists( $managed{$_} ) ) {
|
||||
# report error when it is under my control but I cannot handle it.
|
||||
my $rsp;
|
||||
$rsp->{data}->[0] = $msg;
|
||||
xCAT::MsgUtils->message("E", $rsp, $::XNBA_callback);
|
||||
} else {
|
||||
xCAT::MsgUtils->message("S", $msg);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env perl
|
||||
|
||||
#---------------------------------------------------------
|
||||
# Configure Ethnet BNT switches
|
||||
# Configure cumulus/onie switches
|
||||
#---------------------------------------------------------
|
||||
|
||||
BEGIN
|
||||
@@ -42,8 +42,6 @@ if (
|
||||
'switches=s' => \$::SWITCH,
|
||||
'port=s' => \$::PORT,
|
||||
'vlan=s' => \$::VLAN,
|
||||
'user=s' => \$::USER,
|
||||
'password=s' => \$::PASSWORD,
|
||||
'snmp' => \$::SNMP,
|
||||
'ssh' => \$::SSH,
|
||||
'license=s' => \$::LICENSE,
|
||||
@@ -254,34 +252,11 @@ sub install_license {
|
||||
}
|
||||
|
||||
|
||||
#setup secure SNMP v3
|
||||
#get snmp attributes from switches tabele and setup secure SNMP v3
|
||||
sub config_snmp {
|
||||
my $snmp_user;
|
||||
my $snmp_passwd;
|
||||
my @config_switches;
|
||||
my $cmd;
|
||||
|
||||
print "start to config_snmp\n";
|
||||
if ($::USER) {
|
||||
$snmp_user = $::USER;
|
||||
} else {
|
||||
$snmp_user = "xcatadmin";
|
||||
}
|
||||
if ($::PASSWORD) {
|
||||
$snmp_passwd = $::PASSWORD;
|
||||
} else {
|
||||
$snmp_passwd = "xcatpassw0rd";
|
||||
}
|
||||
|
||||
my $file = "temp.txt";
|
||||
open(FILE , ">$file")
|
||||
or die "cannot open file $file\n";
|
||||
print FILE "#xCAT modify following line\n";
|
||||
print FILE "agentAddress udp:161,udp6:[::1]:161\n";
|
||||
print FILE "rocommunity public default\n";
|
||||
print FILE "rocommunity public default -V systemonly\n";
|
||||
print FILE "createUser $snmp_user SHA $snmp_passwd\n";
|
||||
print FILE "rwuser $snmp_user\n";
|
||||
my $switchestab = xCAT::Table->new('switches');
|
||||
my $switches_hash = $switchestab->getNodesAttribs(\@nodes,['username','password','privacy','auth']);
|
||||
|
||||
foreach my $switch (@nodes) {
|
||||
#check if xdsh works
|
||||
@@ -291,29 +266,37 @@ sub config_snmp {
|
||||
xCAT::MsgUtils->message("E","xdsh command to $switch failed");
|
||||
next;
|
||||
}
|
||||
my $cmd_line = "sed -i 's/^agentAddress/#agentAddress/g' /etc/snmp/snmpd.conf";
|
||||
$cmd = "xdsh $switch $cmd_line";
|
||||
$rc= xCAT::Utils->runcmd($cmd, 0);
|
||||
|
||||
$cmd = "xdcp $switch $file";
|
||||
$rc= xCAT::Utils->runcmd($cmd, 0);
|
||||
$cmd = "xdsh $switch 'cat $file >> /etc/snmp/snmpd.conf;rm -fr $file;systemctl restart snmpd;systemctl enable snmpd' ";
|
||||
$rc= xCAT::Utils->runcmd($cmd, 0);
|
||||
my $username = $switches_hash->{$switch}->[0]->{username};
|
||||
my $password = $switches_hash->{$switch}->[0]->{password};
|
||||
my $auth = $switches_hash->{$switch}->[0]->{auth};
|
||||
my $privacy = $switches_hash->{$switch}->[0]->{privacy};
|
||||
my $privpwd;
|
||||
if (defined $privacy) {
|
||||
$privpwd = $password;
|
||||
}
|
||||
|
||||
my $libconf = "/var/lib/snmp/snmpd.conf";
|
||||
my $etcconf = "/etc/snmp/snmpd.conf";
|
||||
|
||||
my $cmd_prefix = "xdsh $switch ";
|
||||
my $cmd;
|
||||
$cmd = $cmd . "systemctl stop snmpd.service;";
|
||||
$cmd = $cmd . "sed -i '/$username/d' $libconf;";
|
||||
$cmd = $cmd . "sed -i '/$username/d' $etcconf;";
|
||||
$cmd = $cmd . "echo 'createUser $username $auth $password $privacy $privpwd' >> $etcconf;";
|
||||
$cmd = $cmd . "echo 'rwuser $username' >> $etcconf;";
|
||||
$cmd = $cmd . "systemctl start snmpd.service;";
|
||||
|
||||
my $dshcmd = $cmd_prefix . " \"" . $cmd . "\"";
|
||||
|
||||
$rc= xCAT::Utils->runcmd($dshcmd, 0);
|
||||
if ($::RUNCMD_RC != 0) {
|
||||
xCAT::MsgUtils->message("E","Failed to update snmpd.conf for $switch");
|
||||
next;
|
||||
}
|
||||
push (@config_switches, $switch);
|
||||
print "Add username=$username, password=$password, privacy=$privacy, auth=$auth to snmp service for $switch \n";
|
||||
}
|
||||
close FILE;
|
||||
$cmd = `rm -rf $file`;
|
||||
if (@config_switches) {
|
||||
#update switch status
|
||||
my $csw = join(",",@config_switches);
|
||||
$cmd = "chdef $csw status=snmp_configed snmpversion=3 snmpauth=sha snmpusername=$snmp_user snmppassword=$snmp_passwd";
|
||||
$rc= xCAT::Utils->runcmd($cmd, 0);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
sub config_ntp {
|
||||
@@ -387,7 +370,7 @@ sub usage
|
||||
configonie -h│--help
|
||||
configonie --switches switchnames --ssh
|
||||
configonie --switches switchnames --license filename
|
||||
configonie --switches switchnames --snmp [--user snmp_user] [--password snmp_password] [--group snmp_group]
|
||||
configonie --switches switchnames --snmp
|
||||
configonie --switches switchnames --ntp
|
||||
|
||||
To set ssh, install license(license file: /root/license.txt), config snmp and ntp:
|
||||
|
||||
@@ -1,9 +1,4 @@
|
||||
reg_linux_diskfull_installation_flat
|
||||
go_xcat_local_repo_case7
|
||||
go_xcat_noinput
|
||||
go_xcat_with_x
|
||||
go_xcat_with_xcat-version-1
|
||||
go_xcat_online_repo_case6
|
||||
updatenode_h
|
||||
updatenode_v
|
||||
updatenode_diskful_syncfiles
|
||||
|
||||
@@ -1,10 +1,5 @@
|
||||
setup_vm
|
||||
reg_linux_diskfull_installation_flat
|
||||
go_xcat_local_repo_case7
|
||||
go_xcat_noinput
|
||||
go_xcat_with_x
|
||||
go_xcat_with_xcat-version-1
|
||||
go_xcat_online_repo_case6
|
||||
makehosts_h
|
||||
makehosts_help
|
||||
makehosts_n
|
||||
|
||||
@@ -1,9 +1,4 @@
|
||||
reg_linux_diskfull_installation_flat
|
||||
go_xcat_local_repo_case7
|
||||
go_xcat_noinput
|
||||
go_xcat_with_x
|
||||
go_xcat_with_xcat-version-1
|
||||
go_xcat_online_repo_case6
|
||||
updatenode_h
|
||||
updatenode_v
|
||||
updatenode_diskful_syncfiles
|
||||
|
||||
@@ -1,10 +1,5 @@
|
||||
setup_vm
|
||||
reg_linux_diskfull_installation_flat
|
||||
go_xcat_local_repo_case7
|
||||
go_xcat_noinput
|
||||
go_xcat_with_x
|
||||
go_xcat_with_xcat-version-1
|
||||
go_xcat_online_repo_case6
|
||||
makehosts_h
|
||||
makehosts_help
|
||||
makehosts_n
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
description:the cases in this bundle are used to test hardware control against P9 server and 2 kinds provision on P9 server.
|
||||
bmcdiscover_q
|
||||
bmcdiscover_help
|
||||
bmcdiscover_version
|
||||
bmcdiscover_h
|
||||
bmcdiscover_nmap_range
|
||||
bmcdiscover_v
|
||||
bmcdiscover_check_paswd
|
||||
bmcdiscover_check_passwd_wrong
|
||||
bmcdiscover_get_ipsource
|
||||
bmcdiscover_range_w
|
||||
bmcdiscover_range_u_p_i_ipsource
|
||||
bmcdiscover_range_z
|
||||
rpower_off
|
||||
rpower_stat
|
||||
rpower_boot
|
||||
rpower_status
|
||||
rpower_state
|
||||
rpower_on
|
||||
rpower_reset
|
||||
rsetboot_h
|
||||
rsetboot_help
|
||||
rsetboot_v
|
||||
rsetboot_node_invalidnode
|
||||
rsetboot_noderange_net
|
||||
rsetboot_node_invalidaction
|
||||
rsetboot_group_net
|
||||
rsetboot_hd_statcheck
|
||||
rsetboot_net_statcheck
|
||||
rsetboot_cd_statcheck
|
||||
rsetboot_default_statcheck
|
||||
reventlog_null
|
||||
reventlog_all
|
||||
reventlog_clear
|
||||
reventlog_numofentries
|
||||
rspconfig_ip
|
||||
rspconfig_ip_invalid
|
||||
rspconfig_netmask
|
||||
rspconfig_netmask_invalid
|
||||
rspconfig_gateway
|
||||
rspconfig_gateway_invalid
|
||||
rspconfig_node_invalid
|
||||
rspconfig_ip_null
|
||||
reg_linux_diskfull_installation_flat
|
||||
reg_linux_diskless_installation_flat
|
||||
@@ -1,9 +1,4 @@
|
||||
reg_linux_diskfull_installation_flat
|
||||
go_xcat_local_repo_case7
|
||||
go_xcat_noinput
|
||||
go_xcat_with_x
|
||||
go_xcat_with_xcat-version-1
|
||||
go_xcat_online_repo_case6
|
||||
updatenode_h
|
||||
updatenode_v
|
||||
updatenode_diskful_syncfiles
|
||||
|
||||
@@ -1,11 +1,6 @@
|
||||
setup_vm
|
||||
Diskless_installation_flat_p8_le
|
||||
Full_installation_flat_p8_le
|
||||
go_xcat_local_repo_case7
|
||||
go_xcat_noinput
|
||||
go_xcat_with_x
|
||||
go_xcat_with_xcat-version-1
|
||||
go_xcat_online_repo_case6
|
||||
updatenode_h
|
||||
updatenode_v
|
||||
updatenode_diskful_syncfiles
|
||||
|
||||
@@ -1,10 +1,5 @@
|
||||
setup_vm
|
||||
reg_linux_diskfull_installation_flat
|
||||
go_xcat_local_repo_case7
|
||||
go_xcat_noinput
|
||||
go_xcat_with_x
|
||||
go_xcat_with_xcat-version-1
|
||||
go_xcat_online_repo_case6
|
||||
makehosts_h
|
||||
makehosts_help
|
||||
makehosts_n
|
||||
|
||||
@@ -1,9 +1,4 @@
|
||||
reg_linux_diskfull_installation_flat
|
||||
go_xcat_local_repo_case7
|
||||
go_xcat_noinput
|
||||
go_xcat_with_x
|
||||
go_xcat_with_xcat-version-1
|
||||
go_xcat_online_repo_case6
|
||||
updatenode_h
|
||||
updatenode_v
|
||||
updatenode_diskful_syncfiles
|
||||
|
||||
@@ -1,11 +1,7 @@
|
||||
setup_vm
|
||||
reg_linux_diskless_installation_flat
|
||||
reg_linux_diskfull_installation_flat
|
||||
go_xcat_local_repo_case7
|
||||
go_xcat_noinput
|
||||
go_xcat_with_x
|
||||
go_xcat_with_xcat-version-1
|
||||
go_xcat_online_repo_case6
|
||||
updatenode_h
|
||||
updatenode_v
|
||||
updatenode_diskful_syncfiles
|
||||
|
||||
@@ -1,10 +1,5 @@
|
||||
setup_vm
|
||||
reg_linux_diskfull_installation_flat
|
||||
go_xcat_local_repo_case7
|
||||
go_xcat_noinput
|
||||
go_xcat_with_x
|
||||
go_xcat_with_xcat-version-1
|
||||
go_xcat_online_repo_case6
|
||||
makehosts_h
|
||||
makehosts_help
|
||||
makehosts_n
|
||||
|
||||
@@ -1,9 +1,4 @@
|
||||
reg_linux_diskfull_installation_flat
|
||||
go_xcat_local_repo_case7
|
||||
go_xcat_noinput
|
||||
go_xcat_with_x
|
||||
go_xcat_with_xcat-version-1
|
||||
go_xcat_online_repo_case6
|
||||
chdef_null
|
||||
chdef_t_node
|
||||
chdef_t_network
|
||||
|
||||
@@ -1,10 +1,5 @@
|
||||
setup_vm
|
||||
reg_linux_diskfull_installation_flat
|
||||
go_xcat_local_repo_case7
|
||||
go_xcat_noinput
|
||||
go_xcat_with_x
|
||||
go_xcat_with_xcat-version-1
|
||||
go_xcat_online_repo_case6
|
||||
makehosts_h
|
||||
makehosts_help
|
||||
makehosts_n
|
||||
|
||||
@@ -1,11 +1,6 @@
|
||||
setup_vm
|
||||
reg_linux_diskless_installation_flat
|
||||
reg_linux_diskfull_installation_flat
|
||||
go_xcat_local_repo_case7
|
||||
go_xcat_noinput
|
||||
go_xcat_with_x
|
||||
go_xcat_with_xcat-version-1
|
||||
go_xcat_online_repo_case6
|
||||
makehosts_h
|
||||
makehosts_help
|
||||
makehosts_n
|
||||
|
||||
@@ -1,10 +1,5 @@
|
||||
setup_vm
|
||||
reg_linux_diskfull_installation_flat
|
||||
go_xcat_local_repo_case7
|
||||
go_xcat_noinput
|
||||
go_xcat_with_x
|
||||
go_xcat_with_xcat-version-1
|
||||
go_xcat_online_repo_case6
|
||||
makehosts_h
|
||||
makehosts_help
|
||||
makehosts_n
|
||||
|
||||
@@ -1,11 +1,6 @@
|
||||
setup_vm
|
||||
reg_linux_diskless_installation_flat
|
||||
reg_linux_diskfull_installation_flat
|
||||
go_xcat_local_repo_case7
|
||||
go_xcat_noinput
|
||||
go_xcat_with_x
|
||||
go_xcat_with_xcat-version-1
|
||||
go_xcat_online_repo_case6
|
||||
makehosts_h
|
||||
makehosts_help
|
||||
makehosts_n
|
||||
|
||||
@@ -1,10 +1,5 @@
|
||||
setup_vm
|
||||
reg_linux_diskfull_installation_flat
|
||||
go_xcat_local_repo_case7
|
||||
go_xcat_noinput
|
||||
go_xcat_with_x
|
||||
go_xcat_with_xcat-version-1
|
||||
go_xcat_online_repo_case6
|
||||
makehosts_h
|
||||
makehosts_help
|
||||
makehosts_n
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
setup_vm
|
||||
reg_linux_diskless_installation_flat
|
||||
reg_linux_diskfull_installation_flat
|
||||
go_xcat_local_repo_case7
|
||||
go_xcat_noinput
|
||||
go_xcat_with_xcat-version-1
|
||||
go_xcat_online_repo_case6
|
||||
makehosts_h
|
||||
makehosts_help
|
||||
makehosts_n_noderange
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
setup_vm
|
||||
reg_linux_diskless_installation_flat
|
||||
reg_linux_diskfull_installation_flat
|
||||
go_xcat_local_repo_case7
|
||||
go_xcat_noinput
|
||||
go_xcat_with_xcat-version-1
|
||||
go_xcat_online_repo_case6
|
||||
makehosts_h
|
||||
makehosts_help
|
||||
makehosts_n_noderange
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
setup_vm
|
||||
reg_linux_diskless_installation_flat
|
||||
reg_linux_diskfull_installation_flat
|
||||
go_xcat_local_repo_case7
|
||||
go_xcat_noinput
|
||||
go_xcat_with_xcat-version-1
|
||||
go_xcat_online_repo_case6
|
||||
makehosts_h
|
||||
makehosts_help
|
||||
makehosts_n_noderange
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
setup_vm
|
||||
reg_linux_diskless_installation_flat
|
||||
reg_linux_diskfull_installation_flat
|
||||
go_xcat_local_repo_case7
|
||||
go_xcat_noinput
|
||||
go_xcat_with_xcat-version-1
|
||||
go_xcat_online_repo_case6
|
||||
makehosts_h
|
||||
makehosts_help
|
||||
makehosts_n_noderange
|
||||
|
||||
@@ -1,11 +1,7 @@
|
||||
setup_vm
|
||||
reg_linux_diskless_installation_flat
|
||||
reg_linux_diskfull_installation_flat
|
||||
go_xcat_local_repo_case7
|
||||
go_xcat_noinput
|
||||
go_xcat_with_x
|
||||
go_xcat_with_xcat-version-1
|
||||
go_xcat_online_repo_case6
|
||||
makehosts_h
|
||||
makehosts_help
|
||||
makehosts_n_noderange
|
||||
|
||||
@@ -1,11 +1,6 @@
|
||||
setup_vm
|
||||
reg_linux_diskless_installation_flat
|
||||
reg_linux_diskfull_installation_flat
|
||||
go_xcat_local_repo_case7
|
||||
go_xcat_noinput
|
||||
go_xcat_with_x
|
||||
go_xcat_with_xcat-version-1
|
||||
go_xcat_online_repo_case6
|
||||
makehosts_h
|
||||
makehosts_help
|
||||
makehosts_n_noderange
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
#SERIES# 1,50,100,250,500,1000,2500,5000,10000
|
||||
lsdef #NODES#
|
||||
makehosts #NODES#
|
||||
makedns -n #NODES#
|
||||
makedhcp #NODES#
|
||||
makeknownhosts #NODES#
|
||||
nodech #NODES# groups,=group1
|
||||
nodels #NODES# noderes
|
||||
nodeset #NODES# osimage=rhels7.3-GA-ppc64le-install-compute
|
||||
chdef -t node -o #NODES# postscripts="fake" profile="install" netboot="grub2"
|
||||
rmdef -t node #PERFGRP#
|
||||
mkdef -z < #STANZ#
|
||||
noderm #PERFGRP#
|
||||
@@ -49,19 +49,19 @@ checkout:output=~xCAT Version
|
||||
end
|
||||
|
||||
start:bmcdiscover_check_paswd
|
||||
cmd:bmcdiscover -i $$bmcrange -u USERID -p PASSW0RD --check
|
||||
cmd:bmcdiscover -i $$bmcrange -u $$bmcusername -p $$bmcpasswd --check
|
||||
check:rc==0
|
||||
check:output=~Correct ADMINISTRATOR
|
||||
end
|
||||
|
||||
start:bmcdiscover_check_passwd_wrong
|
||||
cmd:bmcdiscover -i $$bmcrange -u USERID -p PASSW0RDw --check
|
||||
check:rc!=0
|
||||
check:output=~Error: Wrong BMC password
|
||||
cmd:bmcdiscover -i $$bmcrange -u $$bmcusername -p test$$bmcpasswd --check
|
||||
check:rc==0
|
||||
check:output=~Invalid username or password | Wrong BMC password
|
||||
end
|
||||
|
||||
start:bmcdiscover_get_ipsource
|
||||
cmd:bmcdiscover -i $$bmcrange -u USERID -p PASSW0RD --ipsource
|
||||
cmd:bmcdiscover -i $$bmcrange -u $$bmcusername -p $$bmcpasswd --ipsource
|
||||
check:rc==0
|
||||
check:output=~Static Address
|
||||
end
|
||||
|
||||
+69
@@ -0,0 +1,69 @@
|
||||
start:reg_linux_diskfull_installation_flat_postscripts_failed
|
||||
description:This case is for postscripts failed the status will return failed during diskfull installation.
|
||||
attribute:$$CN-The operation object of diskfull installation.
|
||||
os:Linux
|
||||
|
||||
cmd:if ping -c 1 $$SN > /dev/null;then rpower $$SN off > /dev/null;fi
|
||||
cmd:MINIISO=NUll;if [[ "__GETNODEATTR($$CN,os)__" =~ "ubuntu" ]] && [[ "__GETNODEATTR($$CN,arch)__" =~ "ppc64" ]];then mkdir /tmp/iso; mount -o loop $$MINIISO /tmp/iso ; mkdir -p /install/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/install/netboot; cp /tmp/iso/install/initrd.gz /install/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/install/netboot;umount /tmp/iso; rmdir /tmp/iso; fi
|
||||
check:rc==0
|
||||
|
||||
cmd:chdef -t node -o $$CN servicenode= monserver=$$MN nfsserver=$$MN tftpserver=$$MN xcatmaster=$$MN
|
||||
check:rc==0
|
||||
cmd:makedns -n
|
||||
check:rc==0
|
||||
cmd:makeconservercf
|
||||
check:rc==0
|
||||
cmd:cat /etc/conserver.cf | grep $$CN
|
||||
check:output=~$$CN
|
||||
cmd:sleep 20
|
||||
cmd:if [[ "__GETNODEATTR($$CN,arch)__" = "ppc64" ]] && [[ "__GETNODEATTR($$CN,mgt)__" != "ipmi" ]]; then getmacs -D $$CN; fi
|
||||
check:rc==0
|
||||
cmd:chtab key=extntpservers site.value=""
|
||||
check:rc==0
|
||||
cmd:chtab key=ntpservers site.value="<xcatmaster>"
|
||||
check:rc==0
|
||||
cmd:makentp
|
||||
check:rc==0
|
||||
cmd:makedhcp -n
|
||||
check:rc==0
|
||||
cmd:makedhcp -a
|
||||
check:rc==0
|
||||
cmd:sleep 10
|
||||
cmd:a=0;while true; do [ $a -eq 100 ] && exit 1;output=$(makedhcp -q $$CN);[ $? -ne 0 ] && exit 1;echo $output|grep $$CN 2>/dev/null && exit 0;a=$[$a+1];sleep 1;done
|
||||
check:rc==0
|
||||
cmd:copycds $$ISO
|
||||
check:rc==0
|
||||
cmd:/opt/xcat/share/xcat/tools/autotest/testcase/installation/setup_postscript_failed.sh
|
||||
check:rc==0
|
||||
cmd:chmod 777 /install/postscripts/test
|
||||
check:rc==0
|
||||
cmd:chdef $$CN -p postscripts=test
|
||||
check:rc==0
|
||||
cmd:lsdef -l $$CN
|
||||
check:rc==0
|
||||
cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute
|
||||
check:rc==0
|
||||
check:output=~Provision node\(s\)\: $$CN
|
||||
|
||||
cmd:sleep 300
|
||||
cmd:a=0;while ! `lsdef -l $$CN|grep status|grep failed >/dev/null`; do sleep 20;((a++));if [ $a -gt 300 ];then break;fi done
|
||||
|
||||
cmd:ping $$CN -c 3
|
||||
check:rc==0
|
||||
check:output=~64 bytes from $$CN
|
||||
cmd:lsdef -l $$CN | grep status
|
||||
check:rc==0
|
||||
check:output=~failed
|
||||
cmd:xdsh $$CN date
|
||||
check:rc==0
|
||||
check:output=~\d\d:\d\d:\d\d
|
||||
cmd:xdsh $$CN mount
|
||||
check:rc==0
|
||||
cmd:sleep 120
|
||||
cmd:lsdef -l $$CN
|
||||
cmd:ping $$CN -c 3
|
||||
check:rc==0
|
||||
check:output=~64 bytes from $$CN
|
||||
cmd:xdsh $$CN "cat /var/log/xcat/xcat.log"
|
||||
cmd: chdef -t node -o $$CN -m postscripts="test"; rm -rf /install/postscripts/test
|
||||
end
|
||||
@@ -36,7 +36,7 @@ check:rc==0
|
||||
cmd:if [[ -f /test.synclist ]] ;then mv -f /test.synclist /test.synclist.bak;fi;
|
||||
cmd:echo "/test.synclist -> /test.synclist" > /test.synclist;chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute synclists=/test.synclist
|
||||
check:rc==0
|
||||
cmd:nodeset $$CN osimage= __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute
|
||||
cmd:nodeset $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute
|
||||
check:rc==0
|
||||
cmd:updatenode $$CN -f
|
||||
check:rc==0
|
||||
|
||||
+77
@@ -0,0 +1,77 @@
|
||||
start:reg_linux_diskless_installation_flat_postscripts_failed
|
||||
description:This case is for postscripts failed the status will return failed during diskless installation.
|
||||
attribute:$$CN-The operation object of diskless installation.
|
||||
os:Linux
|
||||
|
||||
cmd:chdef -t node -o $$CN servicenode= monserver=$$MN nfsserver=$$MN tftpserver=$$MN xcatmaster=$$MN
|
||||
check:rc==0
|
||||
|
||||
cmd:makedns -n
|
||||
check:rc==0
|
||||
cmd:makeconservercf $$CN
|
||||
check:rc==0
|
||||
cmd:cat /etc/conserver.cf | grep $$CN
|
||||
check:output=~$$CN
|
||||
cmd:sleep 20
|
||||
cmd:if [[ "__GETNODEATTR($$CN,arch)__" = "ppc64" ]] && [[ "__GETNODEATTR($$CN,mgt)__" != "ipmi" ]]; then getmacs -D $$CN; fi
|
||||
check:rc==0
|
||||
cmd:makedhcp -n
|
||||
check:rc==0
|
||||
cmd:makedhcp -a
|
||||
check:rc==0
|
||||
cmd:a=0;while true; do [ $a -eq 100 ] && exit 1;output=$(makedhcp -q $$CN);[ $? -ne 0 ] && exit 1;echo $output|grep $$CN 2>/dev/null && exit 0;a=$[$a+1];sleep 1;done
|
||||
check:rc==0
|
||||
|
||||
cmd:copycds $$ISO
|
||||
check:rc==0
|
||||
cmd:/opt/xcat/share/xcat/tools/autotest/testcase/installation/setup_postscript_failed.sh
|
||||
check:rc==0
|
||||
cmd:chmod 777 /install/postscripts/test
|
||||
check:rc==0
|
||||
cmd:chdef $$CN -p postscripts=test
|
||||
check:rc==0
|
||||
cmd:rootimgdir=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute|grep rootimgdir|awk -F'=' '{print $2}'`; if [ -d $rootimgdir ]; then mv $rootimgdir $rootimgdir.regbak -f;fi
|
||||
check:rc==0
|
||||
|
||||
cmd:if [ ! -d /tmp/mountoutput ]; then mkdir -p /tmp/mountoutput; fi
|
||||
cmd:mount |sort > /tmp/mountoutput/file.org
|
||||
cmd:cat /tmp/mountoutput/file.org
|
||||
cmd:genimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute
|
||||
check:rc==0
|
||||
cmd:mount |sort > /tmp/mountoutput/file.new
|
||||
cmd:cat /tmp/mountoutput/file.new
|
||||
cmd:diff /tmp/mountoutput/file.org /tmp/mountoutput/file.new
|
||||
check:rc==0
|
||||
cmd:rm -rf /tmp/mountoutput
|
||||
cmd:packimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute
|
||||
check:rc==0
|
||||
|
||||
cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute
|
||||
check:rc==0
|
||||
check:output=~Provision node\(s\)\: $$CN
|
||||
|
||||
cmd:sleep 900
|
||||
cmd:a=0;while ! `lsdef -l $$CN|grep status|grep failed >/dev/null`; do sleep 10;((a++));if [ $a -gt 60 ];then break;fi done
|
||||
|
||||
cmd:ping $$CN -c 3
|
||||
check:rc==0
|
||||
check:output=~64 bytes from $$CN
|
||||
cmd:lsdef -l $$CN | grep status
|
||||
check:rc==0
|
||||
check:output=~failed
|
||||
cmd:xdsh $$CN date
|
||||
check:rc==0
|
||||
check:output=~\d\d:\d\d:\d\d
|
||||
cmd:xdsh $$CN mount
|
||||
check:rc==0
|
||||
check:output=~on / type tmpfs
|
||||
cmd:sleep 120
|
||||
cmd:ping $$CN -c 3
|
||||
check:rc==0
|
||||
check:output=~64 bytes from $$CN
|
||||
|
||||
cmd:rootimgdir=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute|grep rootimgdir|awk -F'=' '{print $2}'`; if [ -d $rootimgdir.regbak ]; then rm -rf $rootimgdir; mv $rootimgdir.regbak $rootimgdir; fi
|
||||
check:rc==0
|
||||
cmd:xdsh $$CN "cat /var/log/xcat/xcat.log"
|
||||
cmd: chdef -t node -o $$CN -m postscripts="test"; rm -rf /install/postscripts/test
|
||||
end
|
||||
@@ -37,16 +37,16 @@ check:rc==0
|
||||
cmd:if [[ -f /test.synclist ]] ;then mv -f /test.synclist /test.synclist.bak;fi;
|
||||
cmd:echo "/test.synclist -> /test.synclist" > /test.synclist;chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute synclists=/test.synclist
|
||||
check:rc==0
|
||||
cmd:nodeset $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute
|
||||
check:rc==0
|
||||
cmd:updatenode $$CN -f
|
||||
check:rc==0
|
||||
cmd:genimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute
|
||||
check:rc==0
|
||||
cmd:packimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute
|
||||
check:rc==0
|
||||
|
||||
cmd:nodeset $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute
|
||||
check:rc==0
|
||||
|
||||
cmd:updatenode $$CN -f
|
||||
check:rc==0
|
||||
cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute
|
||||
check:rc==0
|
||||
check:output=~Provision node\(s\)\: $$CN
|
||||
|
||||
@@ -114,9 +114,6 @@ cmd:ping $$CN -c 3
|
||||
check:rc==0
|
||||
check:output=~64 bytes from $$CN
|
||||
cmd:xdsh $$CN "cat /var/log/xcat/xcat.log"
|
||||
cmd:xdsh $$CN "echo "test"> /test.statelite"
|
||||
check:rc!=0
|
||||
cmd:output=$(xdsh $$CN ls -al / |grep test.statelite);if [[ $? -eq 0 ]];then xdsh $$CN rm -rf /test.tatelite;fi
|
||||
cmd:rm -rf /tmp/image;mkdir /tmp/image
|
||||
check:rc==0
|
||||
cmd:imgexport __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-statelite-compute /tmp/image/image.tgz
|
||||
|
||||
-3
@@ -89,9 +89,6 @@ check:rc==0
|
||||
check:output=~/nodedata/$$CN on /.statelite/persistent
|
||||
check:output=~rootfs on / type
|
||||
cmd:xdsh $$CN "cat /var/log/xcat/xcat.log"
|
||||
cmd:xdsh $$CN "echo "test"> /test.statelite"
|
||||
check:rc!=0
|
||||
cmd:output=$(xdsh $$CN ls -al / |grep test.statelite);if [[ $? -eq 0 ]];then xdsh $$CN rm -rf /test.tatelite;fi
|
||||
cmd:rootimgdir=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-statelite-compute|grep rootimgdir|awk -F'=' '{print $2}'`; if [ -d $rootimgdir.regbak ]; then rm -rf $rootimgdir; mv $rootimgdir.regbak $rootimgdir; fi
|
||||
check:rc==0
|
||||
end
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
#!/bin/bash
|
||||
cat >> /install/postscripts/test <<EOF
|
||||
#!/bin/bash
|
||||
echo "test"
|
||||
exit 1
|
||||
EOF
|
||||
@@ -24,7 +24,7 @@ cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-in
|
||||
check:rc==0
|
||||
check:output=~Provision node\(s\)\: $$CN
|
||||
|
||||
cmd:a=0;while ! `lsdef -l $$CN|grep status|grep booted >/dev/null`; do sleep 10;((a++));if [ $a -gt 60 ];then break;fi done
|
||||
cmd:a=0;while ! `lsdef -l $$CN|grep status|grep booted >/dev/null`; do sleep 10;((a++));if [ $a -gt 360 ];then break;fi done
|
||||
|
||||
cmd:ping $$CN -c 3
|
||||
check:output=~64 bytes from $$CN
|
||||
|
||||
@@ -134,42 +134,37 @@ cmd:lsdef s01r1b01;if [ $? -eq 0 ]; then lsdef -l s01r1b01 -z >/tmp/s01r1b01.sta
|
||||
check:rc==0
|
||||
cmd:nodeadd s01 groups=service; chdef s01 ip=70.2.0.254;nodeadd s01r1b01 groups=compute; chdef s01r1b01 ip=80.2.0.254;makehosts
|
||||
check:rc==0
|
||||
cmd:rc1=`cat /etc/hosts | grep "70.2.0.254" | grep s01`;rc2=`cat /etc/hosts | grep "80.2.0.254" | grep s01r1b01`;if [[ $rc1 =~ "70.2.0.254 s01" ]] && [[ $rc2 =~ "80.2.0.254 s01r1b01" ]];then exit 0;else exit 1;fi
|
||||
cmd:a=0;while true; do [ $a -eq 60 ] && exit 1;rc=`cat /etc/hosts`;if [[ $rc =~ "70.2.0.254 s01" ]] && [[ $rc =~ "80.2.0.254 s01r1b01" ]];then exit 0;else a=$[$a+1];sleep 1;echo $a;fi;done
|
||||
check:rc==0
|
||||
cmd:makehosts s01
|
||||
check:rc==0
|
||||
cmd:sleep 20
|
||||
cmd:cat /etc/hosts
|
||||
cmd:rc1=`cat /etc/hosts | grep "70.2.0.254" | grep s01`;rc2=`cat /etc/hosts | grep "80.2.0.254" | grep s01r1b01`;if [[ $rc1 =~ "70.2.0.254 s01" ]] && [[ $rc2 =~ "80.2.0.254 s01r1b01" ]];then exit 0;else exit 1;fi
|
||||
cmd:a=0;while true; do [ $a -eq 60 ] && exit 1;rc=`cat /etc/hosts`;if [[ $rc =~ "70.2.0.254 s01" ]] && [[ $rc =~ "80.2.0.254 s01r1b01" ]];then exit 0;else a=$[$a+1];sleep 1;echo $a;fi;done
|
||||
check:rc==0
|
||||
cmd:makehosts service
|
||||
check:rc==0
|
||||
cmd:sleep 20
|
||||
cmd:cat /etc/hosts
|
||||
cmd:rc1=`cat /etc/hosts | grep "70.2.0.254" | grep s01`;rc2=`cat /etc/hosts | grep "80.2.0.254" | grep s01r1b01`;if [[ $rc1 =~ "70.2.0.254 s01" ]] && [[ $rc2 =~ "80.2.0.254 s01r1b01" ]];then exit 0;else exit 1;fi
|
||||
cmd:a=0;while true; do [ $a -eq 60 ] && exit 1;rc=`cat /etc/hosts`;if [[ $rc =~ "70.2.0.254 s01" ]] && [[ $rc =~ "80.2.0.254 s01r1b01" ]];then exit 0;else a=$[$a+1];sleep 1;echo $a;fi;done
|
||||
check:rc==0
|
||||
cmd:cat /etc/hosts
|
||||
cmd:makehosts -d s01
|
||||
check:rc==0
|
||||
cmd:sleep 20
|
||||
cmd:cat /etc/hosts
|
||||
cmd:rc1=`cat /etc/hosts | grep "70.2.0.254" | grep s01`;rc2=`cat /etc/hosts | grep "80.2.0.254" | grep s01r1b01`;if [[ $rc1 = "" ]] && [[ $rc2 =~ "80.2.0.254 s01r1b01" ]];then exit 0;else exit 1;fi
|
||||
cmd:a=0;while true; do [ $a -eq 60 ] && exit 1;rc=`cat /etc/hosts`;if !([[ $rc =~ "70.2.0.254 s01" ]]) && [[ $rc =~ "80.2.0.254 s01r1b01" ]];then exit 0;else a=$[$a+1];sleep 1;echo $a;fi;done
|
||||
check:rc==0
|
||||
cmd:cat /etc/hosts
|
||||
cmd:makehosts
|
||||
check:rc==0
|
||||
cmd:makehosts -d service
|
||||
check:rc==0
|
||||
cmd:sleep 20
|
||||
cmd:cat /etc/hosts
|
||||
cmd:rc1=`cat /etc/hosts | grep "70.2.0.254" | grep s01`;rc2=`cat /etc/hosts | grep "80.2.0.254" | grep s01r1b01`;if [[ $rc1 = "" ]] && [[ $rc2 =~ "80.2.0.254 s01r1b01" ]];then exit 0;else exit 1;fi
|
||||
cmd:a=0;while true; do [ $a -eq 60 ] && exit 1;rc=`cat /etc/hosts`;if !([[ $rc =~ "70.2.0.254 s01" ]]) && [[ $rc =~ "80.2.0.254 s01r1b01" ]];then exit 0;else a=$[$a+1];sleep 1;echo $a;fi;done
|
||||
check:rc==0
|
||||
cmd:cat /etc/hosts
|
||||
cmd:makehosts
|
||||
check:rc==0
|
||||
cmd:makehosts -d s01r1b01
|
||||
check:rc==0
|
||||
cmd:sleep 20
|
||||
cmd:cat /etc/hosts
|
||||
cmd:rc1=`cat /etc/hosts | grep "70.2.0.254" | grep s01`;rc2=`cat /etc/hosts | grep "80.2.0.254" | grep s01r1b01`;if [[ $rc1 =~ "70.2.0.254 s01" ]] && [[ $rc2 = "" ]];then exit 0;else exit 1;fi
|
||||
cmd:a=0;while true; do [ $a -eq 60 ] && exit 1;rc=`cat /etc/hosts`;if [[ $rc =~ "70.2.0.254 s01" ]] && !([[ $rc =~ "80.2.0.254 s01r1b01" ]]);then exit 0;else a=$[$a+1];sleep 1;echo $a;fi;done
|
||||
check:rc==0
|
||||
cmd:cat /etc/hosts
|
||||
cmd:if [ -e /tmp/s01.standa ]; then rmdef s01; cat /tmp/s01.standa | mkdef -z; rm -rf /tmp/s01.standa; else rmdef s01;fi
|
||||
check:rc==0
|
||||
cmd:if [ -e /tmp/s01r1b01.standa ]; then rmdef s01r1b01; cat /tmp/s01r1b01.standa | mkdef -z; rm -rf /tmp/s01r1b01.standa;else rmdef s01r1b01; fi
|
||||
|
||||
@@ -9,3 +9,55 @@ check:rc==0
|
||||
cmd:rmdef mgt02
|
||||
cmd:rmdef -t group doubletrouble
|
||||
end
|
||||
|
||||
start:mkdef_regex_bmc
|
||||
description:The second example in xCAT document Using Regular Expressions in the xCAT Tables
|
||||
cmd:chtab node=compute 'ipmi.bmc=/\z/-bmc/'
|
||||
check:rc==0
|
||||
cmd:mkdef com02 groups=compute mgt=ipmi
|
||||
check:rc==0
|
||||
cmd:lsdef com02 -i bmc | grep 'bmc=com02-bmc$'
|
||||
check:rc==0
|
||||
cmd:rmdef com02
|
||||
check:rc==0
|
||||
cmd:chtab -d node=compute ipmi
|
||||
check:rc==0
|
||||
end
|
||||
|
||||
start:mkdef_regex_ip
|
||||
description:The third example in xCAT document Using Regular Expressions in the xCAT Tables
|
||||
cmd:chtab node=compute 'hosts.ip=|node(\d+)|10.0.0.($1+0)|'
|
||||
check:rc==0
|
||||
cmd:mkdef node254 groups=compute
|
||||
check:rc==0
|
||||
cmd:lsdef node254 -i ip | grep 'ip=10.0.0.254$'
|
||||
check:rc==0
|
||||
cmd:rmdef node254
|
||||
check:rc==0
|
||||
cmd:chtab -d node=compute hosts
|
||||
check:rc==0
|
||||
end
|
||||
|
||||
start:mkdef_regex_kvm
|
||||
description:The fourth example in xCAT document Using Regular Expressions in the xCAT Tables
|
||||
cmd:chtab node=kvms 'vm.host=|\D+(\d+)\D+(\d+)\D+(\d+)\D+(\d+)|c($1)f($2)x($3)|' 'vm.storage=|\D+(\d+)\D+(\d+)\D+(\d+)\D+(\d+)|dir:///install/vms/vm($4+0)|' vm.memory=3072 vm.cpus=2 vm.nics=virbr2 vm.nicmodel=virtio
|
||||
check:rc==0
|
||||
cmd:mkdef -t node -o c01f02x03v04 groups=kvms mgt=kvm
|
||||
check:rc==0
|
||||
cmd:chdef c910f02x03v04 -i vmcpus | grep 'vmcpus=2$'
|
||||
check:rc==0
|
||||
cmd:chdef c910f02x03v04 -i vmhost | grep 'vmhost=c01f02x03$'
|
||||
check:rc==0
|
||||
cmd:chdef c910f02x03v04 -i vmmemory | grep 'vmmemory=3072$'
|
||||
check:rc==0
|
||||
cmd:chdef c910f02x03v04 -i vmnicnicmodel | grep 'vmnicnicmodel=virtio$'
|
||||
check:rc==0
|
||||
cmd:chdef c910f02x03v04 -i vmnics | grep 'vmnics=virbr2$'
|
||||
check:rc==0
|
||||
cmd:chdef c910f02x03v04 -i vmstorage | grep 'vmstorage=dir:///install/vms/vm4$'
|
||||
check:rc==0
|
||||
cmd:rmdef -t node c01f02x03v04
|
||||
check:rc==0
|
||||
cmd:chtab -d node=kvms vm
|
||||
check:rc==0
|
||||
end
|
||||
|
||||
@@ -1,45 +1,69 @@
|
||||
start:rsetboot_hd_statcheck
|
||||
description:set the boot device from hd
|
||||
Attribute: $$CN-The operation object of rsetboot command.
|
||||
cmd:if [[ -f /tmp/rsetboot.stat ]];then mv -f /tmp/rsetboot.stat /tmp/rsetboot.stat.bak;fi; rsetboot $$CN state > /tmp/rsetboot.stat;
|
||||
check:rc==0
|
||||
cmd:rsetboot $$CN hd
|
||||
check:rc==0
|
||||
check:output=~Hard Drive
|
||||
cmd:rsetboot $$CN stat
|
||||
check:rc==0
|
||||
check:output=~$$CN: Hard Drive
|
||||
cmd:if [[ `grep CD /tmp/rsetboot.stat` ]];then rsetboot $$CN cd;elif [[ `grep Network /tmp/rsetboot.stat` ]];then rsetboot $$CN net;else rsetboot $$CN hd;fi
|
||||
check:rc==0
|
||||
cmd:if [[ -f /tmp/rsetboot.stat.bak ]];then mv -f /tmp/rsetboot.stat.bak /tmp/rsetboot.stat;else rm -rf /tmp/rsetboot.stat;fi
|
||||
check:rc==0
|
||||
end
|
||||
|
||||
start:rsetboot_net_statcheck
|
||||
description:set the boot device from net
|
||||
Attribute: $$CN-The operation object of rsetboot command.
|
||||
cmd:if [[ -f /tmp/rsetboot.stat ]];then mv -f /tmp/rsetboot.stat /tmp/rsetboot.stat.bak;fi; rsetboot $$CN state > /tmp/rsetboot.stat;
|
||||
check:rc==0
|
||||
cmd:rsetboot $$CN net
|
||||
check:rc==0
|
||||
check:output=~Network
|
||||
cmd:rsetboot $$CN stat
|
||||
check:rc==0
|
||||
check:output=~$$CN: Network
|
||||
cmd:if [[ `grep CD /tmp/rsetboot.stat` ]];then rsetboot $$CN cd;elif [[ `grep Network /tmp/rsetboot.stat` ]];then rsetboot $$CN net;else rsetboot $$CN hd;fi
|
||||
check:rc==0
|
||||
cmd:if [[ -f /tmp/rsetboot.stat.bak ]];then mv -f /tmp/rsetboot.stat.bak /tmp/rsetboot.stat;else rm -rf /tmp/rsetboot.stat;fi
|
||||
check:rc==0
|
||||
end
|
||||
|
||||
start:rsetboot_cd_statcheck
|
||||
description:set the boot device from CD/DVD
|
||||
Attribute: $$CN-The operation object of rsetboot command.
|
||||
cmd:if [[ -f /tmp/rsetboot.stat ]];then mv -f /tmp/rsetboot.stat /tmp/rsetboot.stat.bak;fi; rsetboot $$CN state > /tmp/rsetboot.stat;
|
||||
check:rc==0
|
||||
cmd:rsetboot $$CN cd
|
||||
check:rc==0
|
||||
check:output=~CD/DVD
|
||||
cmd:rsetboot $$CN stat
|
||||
check:rc==0
|
||||
check:output=~$$CN: CD/DVD
|
||||
cmd:if [[ `grep CD /tmp/rsetboot.stat` ]];then rsetboot $$CN cd;elif [[ `grep Network /tmp/rsetboot.stat` ]];then rsetboot $$CN net;else rsetboot $$CN hd;fi
|
||||
check:rc==0
|
||||
cmd:if [[ -f /tmp/rsetboot.stat.bak ]];then mv -f /tmp/rsetboot.stat.bak /tmp/rsetboot.stat;else rm -rf /tmp/rsetboot.stat;fi
|
||||
check:rc==0
|
||||
end
|
||||
|
||||
start:rsetboot_default_statcheck
|
||||
description:set the boot device default
|
||||
Attribute: $$CN-The operation object of rsetboot command.
|
||||
cmd:if [[ -f /tmp/rsetboot.stat ]];then mv -f /tmp/rsetboot.stat /tmp/rsetboot.stat.bak;fi; rsetboot $$CN state > /tmp/rsetboot.stat;
|
||||
check:rc==0
|
||||
cmd:rsetboot $$CN default
|
||||
check:rc==0
|
||||
check:output=~boot override inactive
|
||||
cmd:rsetboot $$CN stat
|
||||
check:rc==0
|
||||
check:output=~$$CN: boot override inactive
|
||||
cmd:if [[ `grep CD /tmp/rsetboot.stat` ]];then rsetboot $$CN cd;elif [[ `grep Network /tmp/rsetboot.stat` ]];then rsetboot $$CN net;else rsetboot $$CN hd;fi
|
||||
check:rc==0
|
||||
cmd:if [[ -f /tmp/rsetboot.stat.bak ]];then mv -f /tmp/rsetboot.stat.bak /tmp/rsetboot.stat;else rm -rf /tmp/rsetboot.stat;fi
|
||||
check:rc==0
|
||||
end
|
||||
|
||||
start:rsetboot_h
|
||||
@@ -62,22 +86,33 @@ cmd:rsetboot -v
|
||||
check:rc==0
|
||||
check:output=~Version
|
||||
end
|
||||
|
||||
start:rsetboot_node_invalidnode
|
||||
desription:rsetboot using invalidenode
|
||||
cmd:rsetboot testnode boot
|
||||
check:rc!=0
|
||||
check:output=~Error: Invalid nodes
|
||||
end
|
||||
|
||||
start:rsetboot_noderange_net
|
||||
description:rsetboot noderange net
|
||||
Attribute: $$CN,$$BC-The operation object of rsetboot command.
|
||||
cmd:rsetboot $$CN,$$BC net
|
||||
Attribute: $$CN-The operation object of rsetboot command.
|
||||
cmd:test=$(lsdef testnode);if [[ $? -eq 0 ]]; then lsdef -l testnode -z >/tmp/testnode.stanza ;rmdef testnode;fi
|
||||
check:rc==0
|
||||
cmd:chdef testnode groups=test mgt=__GETNODEATTR($$CN,mgt)__
|
||||
check:rc==0
|
||||
cmd:if [[ -f /tmp/rsetboot.stat ]];then mv -f /tmp/rsetboot.stat /tmp/rsetboot.stat.bak;fi; rsetboot $$CN state > /tmp/rsetboot.stat;
|
||||
check:rc==0
|
||||
cmd:rsetboot $$CN,testnode net
|
||||
check:output=~$$CN: Network
|
||||
cmd:rsetboot $$CN,$$BC stat
|
||||
check:output=~testnode: Error
|
||||
cmd:rsetboot $$CN,testnode stat
|
||||
check:output=~$$CN: Network
|
||||
check:output=~$$BC: Network
|
||||
check:output=~testnode: Error
|
||||
cmd:if [[ `grep CD /tmp/rsetboot.stat` ]];then rsetboot $$CN cd;elif [[ `grep Network /tmp/rsetboot.stat` ]];then rsetboot $$CN net;else rsetboot $$CN hd;fi
|
||||
check:rc==0
|
||||
cmd:if [[ -f /tmp/rsetboot.stat.bak ]];then mv -f /tmp/rsetboot.stat.bak /tmp/rsetboot.stat;else rm -rf /tmp/rsetboot.stat;fi
|
||||
check:rc==0
|
||||
cmd:rmdef testnode;if [[ -e /tmp/testnode.stanza ]]; then cat /tmp/testnode.stanza | chdef -z;rm -rf /tmp/testnode.stanza;fi
|
||||
check:rc==0
|
||||
end
|
||||
|
||||
start:rsetboot_node_invalidaction
|
||||
@@ -91,8 +126,24 @@ end
|
||||
start:rsetboot_group_net
|
||||
description:rsetboot group node
|
||||
Attribute: $$CN-The operation object of rsetboot command.
|
||||
cmd:rsetboot __GETNODEATTR($$CN,groups)__ net
|
||||
cmd:test=$(lsdef testnode);if [[ $? -eq 0 ]]; then lsdef -l testnode -z >/tmp/testnode.stanza ;rmdef testnode;fi
|
||||
check:rc==0
|
||||
cmd:if [[ -f /tmp/rsetboot.stat ]];then mv -f /tmp/rsetboot.stat /tmp/rsetboot.stat.bak;fi; rsetboot $$CN state > /tmp/rsetboot.stat;
|
||||
check:rc==0
|
||||
cmd:chdef testnode groups=test mgt=__GETNODEATTR($$CN,mgt)__
|
||||
check:rc==0
|
||||
cmd:chdef -p -t node -o $$CN groups="test"
|
||||
check:rc==0
|
||||
cmd:rsetboot test net
|
||||
check:output=~$$CN: Network
|
||||
cmd:rsetboot __GETNODEATTR($$CN,groups)__ stat
|
||||
cmd:rsetboot test stat
|
||||
check:output=~$$CN: Network
|
||||
cmd:if [[ `grep CD /tmp/rsetboot.stat` ]];then rsetboot $$CN cd;elif [[ `grep Network /tmp/rsetboot.stat` ]];then rsetboot $$CN net;else rsetboot $$CN hd;fi
|
||||
check:rc==0
|
||||
cmd:if [[ -f /tmp/rsetboot.stat.bak ]];then mv -f /tmp/rsetboot.stat.bak /tmp/rsetboot.stat;else rm -rf /tmp/rsetboot.stat;fi
|
||||
check:rc==0
|
||||
cmd:chdef -m -t node -o $$CN groups="test"
|
||||
check:rc==0
|
||||
cmd:rmdef testnode;if [[ -e /tmp/testnode.stanza ]]; then cat /tmp/testnode.stanza | chdef -z;rm -rf /tmp/testnode.stanza;fi
|
||||
check:rc==0
|
||||
end
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
start:updatenode_diskful_syncfiles_failing
|
||||
description: Test exit code when syncfiles failing.
|
||||
cmd:mkdir -p /install/custom/install/__GETNODEATTR($$CN,os)__/
|
||||
check:rc==0
|
||||
cmd:echo "/tmp/non-existent -> /etc/motd" > /install/custom/install/__GETNODEATTR($$CN,os)__/booboo.synclist
|
||||
check:rc==0
|
||||
cmd:chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute synclists=/install/custom/install/__GETNODEATTR($$CN,os)__/booboo.synclist
|
||||
check:rc==0
|
||||
cmd:updatenode $$CN -F >/tmp/updatenode.F.out
|
||||
check:rc!=0
|
||||
cmd:grep 'updatenode exited with code 1' /tmp/updatenode.F.out
|
||||
check:rc==0
|
||||
cmd:chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute synclists=
|
||||
check:rc==0
|
||||
cmd:rm -f /install/custom/install/__GETNODEATTR($$CN,os)__/booboo.synclist
|
||||
end
|
||||
Executable
+294
@@ -0,0 +1,294 @@
|
||||
#!/bin/bash
|
||||
# IBM(c) 2017 EPL license http://www.eclipse.org/legal/epl-v10.html
|
||||
#(C)IBM Corp
|
||||
#
|
||||
###################################################################
|
||||
#
|
||||
# Description:
|
||||
# This script is used for performance testing purpose. It could
|
||||
# generate n*250 fake nodes based on a predefined template (/opt/xcat/share/xcat/templates/objects/node/),
|
||||
# and then run the performance testing on a batch of xCAT commands.
|
||||
#
|
||||
# Note: It is availabe for the commands which require management node only.
|
||||
#
|
||||
# Syntax:
|
||||
# $prog <total> [command-list-file]
|
||||
#
|
||||
###################################################################
|
||||
|
||||
if [ -z $LC_ALL ]; then
|
||||
export LC_ALL=C
|
||||
fi
|
||||
|
||||
# Used for number parameter validation
|
||||
isNumber()
|
||||
{
|
||||
expr $1 + 0 &>/dev/null
|
||||
}
|
||||
|
||||
# Give a simple usage
|
||||
if [ -z "$1" ] || [ "$1" = "-h" ] || [ "$1" = "--help" ]; then
|
||||
echo "[PERF_DRYRUN=y] [PERF_NOCREATE=y] $0 <total> [command-list-file]"
|
||||
exit
|
||||
else
|
||||
isNumber $1
|
||||
if [ ! $? -eq 0 ]; then
|
||||
echo "You must input an numeric string for total nodes number."
|
||||
exit -1
|
||||
fi
|
||||
fi
|
||||
|
||||
# Source xCAT profile to make sure the xCAT commands could be executed without absolute path.
|
||||
if [ -z $XCATROOT ]; then
|
||||
if [ -r /etc/profile.d/xcat.sh ]; then
|
||||
. /etc/profile.d/xcat.sh
|
||||
fi
|
||||
fi
|
||||
|
||||
# Mandatory, to specify the number of total fake nodes which will be created for testing
|
||||
FAKE_NODE_TOTAL=$1
|
||||
|
||||
# Optional, the prefix of the fake compute node name.
|
||||
# By default, it is 'fake' but it could be changed when you set environment variable `FAKE_NODE_PREFIX`
|
||||
if [ -z $FAKE_NODE_PREFIX ]; then
|
||||
FAKE_NODE_PREFIX='fake'
|
||||
fi
|
||||
|
||||
# Optional, the group name of all the fake compute nodes.
|
||||
# By default, it is 'perftest' but it could be changed when you set environment variable `FAKE_NODE_GROUP`
|
||||
if [ -z $FAKE_NODE_GROUP ]; then
|
||||
FAKE_NODE_GROUP='perftest'
|
||||
fi
|
||||
|
||||
# Mandatory, the Provision network for all the fake compute nodes. It must be a string like 'A.B', and be matched with `tabdump networks`
|
||||
# By default, it is '192.168' but it could be changed when you set environment variable `FAKE_NETWORK_PRO`
|
||||
if [ -z $FAKE_NETWORK_PRO ]; then
|
||||
FAKE_NETWORK_PRO='192.168'
|
||||
fi
|
||||
|
||||
# Mandatory, the BMC network for all the fake compute nodes. It must be a string like 'A.B' and no need to be defined in 'networks' table.
|
||||
# By default, it is '192.169' but it could be changed when you set environment variable `FAKE_NETWORK_BMC`
|
||||
# Note: it could not be the same subnet as 'FAKE_NETWORK_PRO'
|
||||
if [ -z $FAKE_NETWORK_BMC ]; then
|
||||
FAKE_NETWORK_BMC='192.169'
|
||||
fi
|
||||
|
||||
# Optional, The node template name used for generating fake nodes.
|
||||
# By default, it is '<arch>-template' but it could be changed when you set environment variable `FAKE_NODE_GROUP`
|
||||
if [ -z $PERF_NODETEMPL ]; then
|
||||
PERF_NODETEMPL="`arch`-template"
|
||||
fi
|
||||
|
||||
# IP address assinged to node will be in [1-250]
|
||||
NODE_PER_ROW=250
|
||||
|
||||
PERFORMANCE_DIR=/tmp/xcat-performance
|
||||
PERFORMANCE_NODE_TMPL=$PERFORMANCE_DIR/node.tmpl
|
||||
PERFORMANCE_REPORT=$PERFORMANCE_DIR/report-$FAKE_NODE_TOTAL.$$
|
||||
PERFORMANCE_STANZ=$PERFORMANCE_DIR/stanz-$FAKE_NODE_TOTAL.$$
|
||||
|
||||
# If the command list file is not specified, the tool will only create the stanz file for fake nodes.
|
||||
# If it is specified but not exists, the tool will exit with error.
|
||||
if [ ! -z $2 ]; then
|
||||
if [ -f $2 ]; then
|
||||
RUN_CMD_LIST=$2
|
||||
else
|
||||
echo "ERROR: The command list file you specified does not exist."
|
||||
exit -1
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
# Get a random MAC address
|
||||
genMAC()
|
||||
{
|
||||
printf '00:60:2F:%02X:%02X:%02X' $[RANDOM%256] $[RANDOM%256] $[RANDOM%256]
|
||||
}
|
||||
|
||||
# Generate stanz file for all fake nodes
|
||||
genStanz()
|
||||
{
|
||||
if [ ! -z $PERF_DRYRUN ]; then
|
||||
echo $1, $2, $3, $4
|
||||
else
|
||||
echo -n .
|
||||
fi
|
||||
|
||||
sed -e '/Object name:/c \'"$1"':\n objtype=node' \
|
||||
-e '/ip=/c \ ip='"$3"'' \
|
||||
-e '/mac=/c \ mac='"$2"'' \
|
||||
-e '/bmc=/c \ bmc='"$4"'' \
|
||||
-e '/bmcusername=/c \ bmcusername=fake' \
|
||||
-e '/bmcpassword=/c \ bmcpassword=fake' \
|
||||
-e '/groups=/c \ groups=all,'"$FAKE_NODE_GROUP"'' \
|
||||
-e '/postscripts=/c \ postscripts=mypostboot' \
|
||||
-e '/postbootscripts=/c \ postbootscripts=mypostboot' \
|
||||
$PERFORMANCE_NODE_TMPL >> $PERFORMANCE_STANZ
|
||||
}
|
||||
|
||||
# Create a fake xCAT node definition
|
||||
fakeNode()
|
||||
{
|
||||
# TODO: support regular expression for IP
|
||||
genStanz $FAKE_NODE_PREFIX$1 $(genMAC) $FAKE_NETWORK_PRO.$2.$3 $FAKE_NETWORK_BMC.$2.$3
|
||||
#mkdef -f -t node $FAKE_NODE_PREFIX$1 --template $PERF_NODETEMPL ip=$FAKE_NETWORK_PRO.$2.$3 mac=$(genMAC) \
|
||||
# bmc=$FAKE_NETWORK_BMC.$2.$3 bmcpassword=fake bmcusername=fake groups=all,performance > /dev/null 2>&1
|
||||
}
|
||||
|
||||
# Create batch fake nodes stanz file for testing
|
||||
bootstrap()
|
||||
{
|
||||
declare -i count=0
|
||||
[ $rack = 0 ] && rack=1
|
||||
for i in $(seq 0 $(expr $rack - 1))
|
||||
do
|
||||
for j in $(seq 1 $NODE_PER_ROW)
|
||||
do
|
||||
count+=1
|
||||
fakeNode $count $i $j
|
||||
[ $(($count % $1)) = 0 ] && echo
|
||||
[ "x$count" == "x$FAKE_NODE_TOTAL" ] && break
|
||||
done
|
||||
done
|
||||
}
|
||||
|
||||
# Get current time
|
||||
getTime()
|
||||
{
|
||||
date +%s -d "$1"
|
||||
}
|
||||
|
||||
# Executing the testing on specific commands defined in command list file
|
||||
# All MACROs defined in command list file will be replaced with the real value
|
||||
runTest()
|
||||
{
|
||||
|
||||
cmd=$1
|
||||
if [[ $cmd =~ '#STANZ#' ]]; then
|
||||
#mkdef -z
|
||||
execCmd "${cmd/\#STANZ\#/$PERFORMANCE_STANZ}" "$FAKE_NODE_TOTAL"
|
||||
|
||||
elif [[ $cmd =~ '#NODES#' ]]; then
|
||||
#noderange operation
|
||||
if [ -z "$2" ]; then
|
||||
# No SERIES defined, run command on the whole group
|
||||
execCmd "${cmd/\#NODES\#/$FAKE_NODE_GROUP}" "$FAKE_NODE_TOTAL"
|
||||
else
|
||||
# run the command for each number in SERIES
|
||||
for num in $2
|
||||
do
|
||||
isNumber $num || continue
|
||||
if [[ $num -le $FAKE_NODE_TOTAL ]]; then
|
||||
cmd=$1
|
||||
execCmd "${cmd/\#NODES\#/$FAKE_NODE_PREFIX[1-$num]}" "$num"
|
||||
fi
|
||||
done
|
||||
fi
|
||||
elif [[ $cmd =~ '#PERFGRP#' ]]; then
|
||||
execCmd "${cmd/\#PERFGRP\#/$FAKE_NODE_GROUP}" "$FAKE_NODE_TOTAL"
|
||||
else
|
||||
execCmd "$cmd" "N/A"
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
# Output performance result for each command.
|
||||
printResult()
|
||||
{
|
||||
cmd=`echo "$1" | awk '{print $1}'`
|
||||
result=$([[ $4 = 0 ]] && echo "SUCESS" || echo "FAIL")
|
||||
# TOTAL, CMD, NODERANGE, TIME, SUCESS, FULL COMMAND
|
||||
echo "$FAKE_NODE_TOTAL", "$cmd", "$2", "$3", $result, \"$1\" >> $PERFORMANCE_REPORT
|
||||
}
|
||||
|
||||
# Executing each command and print the result to report file
|
||||
execCmd()
|
||||
{
|
||||
echo "Testing for [ $1 ] ..."
|
||||
if [ ! -z $PERF_DRYRUN ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
starttime=`date +'%Y-%m-%d %H:%M:%S'`
|
||||
start=$(getTime "$starttime")
|
||||
eval "$1" > /dev/null 2>&1
|
||||
retval=$?
|
||||
endtime=`date +'%Y-%m-%d %H:%M:%S'`
|
||||
end=$(getTime "$endtime")
|
||||
|
||||
printResult "$1" "$2" "$(($end-$start))" "$retval"
|
||||
}
|
||||
|
||||
#################################################
|
||||
# Main Loop of the performance baseline testing #
|
||||
#################################################
|
||||
lsxcatd -a
|
||||
if [ 0 != $? ]; then
|
||||
echo "ERROR: xCAT daemon is not running"
|
||||
#exit 99
|
||||
fi
|
||||
|
||||
mkdir -p /tmp/xcat-performance
|
||||
|
||||
lsdef -t node --template $PERF_NODETEMPL > $PERFORMANCE_NODE_TMPL 2>/dev/null
|
||||
if [ 0 != $? ]; then
|
||||
echo "ERROR: Cannot find the default template for `arch`, make sure it exists and rerun the script."
|
||||
exit 99
|
||||
fi
|
||||
|
||||
rack=$(expr $FAKE_NODE_TOTAL / $NODE_PER_ROW)
|
||||
|
||||
echo "=================================================="
|
||||
# Starting to add fake nodes
|
||||
starttime=`date +'%Y-%m-%d %H:%M:%S'`
|
||||
start=$(getTime "$starttime")
|
||||
bootstrap 50
|
||||
endtime=`date +'%Y-%m-%d %H:%M:%S'`
|
||||
end=$(getTime "$endtime")
|
||||
echo
|
||||
echo "=================================================="
|
||||
|
||||
#echo "It takes $(($end-$start)) seconds to create $FAKE_NODE_TOTAL nodes"
|
||||
#echo "$FAKE_NODE_TOTAL", "$(($end-$start))", "mkdef" >> $PERFORMANCE_REPORT
|
||||
|
||||
if [ -z $RUN_CMD_LIST ]; then
|
||||
echo "Done. Check the stanz file in $PERFORMANCE_STANZ"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "Continue the performance testing for commands in $RUN_CMD_LIST "
|
||||
echo "=================================================="
|
||||
|
||||
# Initial Populate the fake nodes into DB
|
||||
if [ -z $PERF_NOCREATE ]; then
|
||||
execCmd "mkdef -z -f < $PERFORMANCE_STANZ" "$FAKE_NODE_TOTAL"
|
||||
fi
|
||||
|
||||
series=`grep '^#SERIES#' $RUN_CMD_LIST | awk '{print $2}'`
|
||||
if [ ! -z $series ]; then
|
||||
series=${series//,/ }
|
||||
fi
|
||||
#echo $series
|
||||
|
||||
cmdlist=`cat $RUN_CMD_LIST`
|
||||
IFS_BAK=$IFS
|
||||
IFS=$'\n'
|
||||
for line in $cmdlist
|
||||
do
|
||||
[ "x${line:0:1}" = "x#" ] && continue
|
||||
|
||||
# begin to run the command
|
||||
IFS=$IFS_BAK
|
||||
runTest "$line" "$series"
|
||||
IFS=$'\n'
|
||||
done
|
||||
IFS=$IFS_BAK
|
||||
IFS_BAK=
|
||||
|
||||
rm -f $PERFORMANCE_NODE_TMPL
|
||||
rm -f $PERFORMANCE_STANZ
|
||||
|
||||
if [ -z $PERF_DRYRUN ]; then
|
||||
echo
|
||||
echo "Done. Check the performance result in $PERFORMANCE_REPORT"
|
||||
fi
|
||||
@@ -1,4 +1,5 @@
|
||||
xcattest opt/xcat/bin
|
||||
bin/xcatperftest opt/xcat/bin
|
||||
share/man/man1/* opt/xcat/share/man/man1
|
||||
share/doc/man1/* opt/xcat/share/doc/man1
|
||||
autotest opt/xcat/share/xcat/tools
|
||||
autotest opt/xcat/share/xcat/tools
|
||||
|
||||
@@ -0,0 +1,151 @@
|
||||
=head1 NAME
|
||||
|
||||
B<xcatperftest> - Run xCAT command performance baseline testing on fake nodes.
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
B<xcatperftest> [B<-?|-h>]
|
||||
|
||||
[B<PERF_DRYRUN>=y] [B<PERF_NOCREATE>=y] B<xcatperftest> <total> [I<command-list-file>]
|
||||
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
The xcatperftest command runs commandes defined in a command list file and get their execution response time baseline for performance purpose.
|
||||
The xcatperftest command is part of the xCAT package xCAT-test, and you can run it standalone or leverage it to build up your automation test cases.
|
||||
|
||||
Any commands could be defined in the command list file, however, it is recommended that the one-time initial configuration are well prepared prior to run xcatperftest command.
|
||||
For example, the network object, osdistor and osimage image objects.
|
||||
|
||||
Follow the below steps to run xcatperftest command:
|
||||
|
||||
1, Install xCAT-test on a xCAT management nodes.
|
||||
|
||||
2, Prepare a command list in which the commands are what you want to messure.
|
||||
|
||||
3, Prepare the initial configuration based on the command list to make sure all commands could be executed in techinal.
|
||||
|
||||
4, Run xcatperftest with the total fake nodes number and the above command list file.
|
||||
|
||||
Node: It is suggested to run the command in background as it normally takes long time to finish all the performanc testing with large amount of fake nodes.
|
||||
|
||||
=head1 OPTIONS
|
||||
|
||||
=over 10
|
||||
|
||||
=item B<-?|-h>
|
||||
|
||||
Display usage message.
|
||||
|
||||
=item <command-list-file>
|
||||
|
||||
Specifies the command list file with full-path. xCAT supports an example command file: /opt/xcat/share/xcat/tools/autotest/perfcmds.lst
|
||||
|
||||
=item <total>
|
||||
|
||||
Total number of fake nodes will be defined during the testing.
|
||||
|
||||
=back
|
||||
|
||||
=head1 RETURN VALUE
|
||||
|
||||
0 The command completed successfully.
|
||||
|
||||
1 An error has occurred.
|
||||
|
||||
|
||||
=head1 COMMAND LIST FILE
|
||||
|
||||
The command list file is in flat text format, the testing framework will parse the file line by line, here is an example of the commannd list file:
|
||||
|
||||
#SERIES# 1,50,100,250,500,1000,2500,5000
|
||||
mkdef -z -f < #STANZ#
|
||||
lsdef #NODES#
|
||||
makehosts #NODES#
|
||||
makedns -n #NODES#
|
||||
makedhcp #NODES#
|
||||
makeknownhosts #NODES#
|
||||
nodech #NODES# groups,=group1
|
||||
nodels #NODES# noderes
|
||||
nodeset #NODES# osimage=rhels7.3-GA-ppc64le-install-compute
|
||||
chdef -t node -o #NODES# postscripts="fake" profile="install" netboot="grub2"
|
||||
rmdef -t node #PERFGRP#
|
||||
mkdef -z < #STANZ#
|
||||
noderm #PERFGRP#
|
||||
|
||||
|
||||
B<Note>: Each line defines one command, and the commands dependency should be handled by the line order.
|
||||
If you define a node range series line (started with #SERIES#) in this file, xcatperftest will run the command for each node range defined in series line.
|
||||
|
||||
B<#SERIES#> To define a node range series, and the series should be an comma split incremental number sequence.
|
||||
|
||||
B<#STANZ#> It will be replaced with real stanz file path when this command line runs.
|
||||
|
||||
B<#NODES#> It will be replaced with real node range defined in #SERIES# line when this command line runs. If no series line, the node group will be used.
|
||||
|
||||
B<#PERFGRP#> It will be replaced with node group when this command line runs.
|
||||
|
||||
=head1 ENVIRONMENT VARIABLE
|
||||
|
||||
The xcatperftest command supports be customized by some environment variables.
|
||||
|
||||
|
||||
B<FAKE_NODE_PREFIX>
|
||||
|
||||
Optional, the prefix of the fake compute node name. By default, the value is 'fake'
|
||||
|
||||
B<FAKE_NODE_GROUP>
|
||||
|
||||
# Optional, the group name of all the fake compute nodes. By default, the value is 'perftest'
|
||||
|
||||
B<FAKE_NETWORK_PRO>
|
||||
|
||||
Mandatory, the Provision network for all the fake compute nodes. By default, the value is '192.168'.
|
||||
It must be a string like 'A.B', and be matched with `tabdump networks`
|
||||
|
||||
B<FAKE_NETWORK_BMC>
|
||||
|
||||
Mandatory, the BMC network for all the fake compute nodes. By default, the value is '192.168'. Note: It could not be the same subnet as 'FAKE_NETWORK_PRO'
|
||||
It must be a string like 'A.B' and no need to be defined in 'networks' table.
|
||||
|
||||
B<PERF_NODETEMPL>
|
||||
|
||||
Optional, The node template name used for generating fake nodes. By default, it will be auto-detected according to the current arch.
|
||||
|
||||
B<PERF_DRYRUN>
|
||||
|
||||
Optional, Indicate no real commands will be executed if the environment variable is set.
|
||||
|
||||
B<PERF_NOCREATE>
|
||||
|
||||
Optional, Indicate no new fake nodes will be created if the environment variable is set.
|
||||
|
||||
=head1 EXAMPLES
|
||||
|
||||
=over 4
|
||||
|
||||
=item 1.
|
||||
|
||||
To run the performance testing for the commands defined in /tmp/cmd.lst on 5000 fake nodes:
|
||||
|
||||
xcatperftest 5000 /tmp/cmd.lst
|
||||
|
||||
=item 2.
|
||||
|
||||
To generate an xCAT node object stanz file for 10000 nodes in subnet 10.100.0.0:
|
||||
|
||||
FAKE_NETWORK_PRO=10.100 FAKE_NETWORK_BMC=10.200 xcatperftest 10000
|
||||
|
||||
=item 3.
|
||||
|
||||
To run the performance testing for the commands defined in /opt/xcat/share/xcat/tools/autotest/perfcmds.lst on 5000 existing fake nodes:
|
||||
|
||||
PERF_NOCREATE=y xcatperftest 5000 /opt/xcat/share/xcat/tools/autotest/perfcmds.lst
|
||||
|
||||
=back
|
||||
|
||||
=head1 FILES
|
||||
|
||||
/opt/xcat/bin/xcatperftest
|
||||
|
||||
/opt/xcat/share/xcat/tools/autotest/perfcmds.lst
|
||||
@@ -42,6 +42,7 @@ mkdir -p $RPM_BUILD_ROOT/%{prefix}/share/xcat/tools/autotest
|
||||
mkdir -p $RPM_BUILD_ROOT/%{prefix}/share/man/man1
|
||||
mkdir -p $RPM_BUILD_ROOT/%{prefix}/share/doc/man1
|
||||
|
||||
cp bin/* $RPM_BUILD_ROOT/%{prefix}/bin
|
||||
cp xcattest $RPM_BUILD_ROOT/%{prefix}/bin
|
||||
chmod 755 $RPM_BUILD_ROOT/%{prefix}/bin/*
|
||||
|
||||
|
||||
@@ -312,6 +312,7 @@ function query_nicnetworks_nic {
|
||||
function query_nicnetworks_net {
|
||||
query_nicnetworks fkey=1 vkey=$1 fval=2
|
||||
}
|
||||
|
||||
#######################################################################################
|
||||
#
|
||||
# get network attribute from NETWORKS_LINEX
|
||||
@@ -419,6 +420,7 @@ function create_persistent_ifcfg {
|
||||
local xcatnet=""
|
||||
local _ipaddr=""
|
||||
local _netmask=""
|
||||
local _mtu=""
|
||||
local inattrs=""
|
||||
|
||||
# parser input arguments
|
||||
@@ -430,6 +432,7 @@ function create_persistent_ifcfg {
|
||||
[ "$key" = "xcatnet" ] || \
|
||||
[ "$key" = "_ipaddr" ] || \
|
||||
[ "$key" = "_netmask" ] || \
|
||||
[ "$key" = "_mtu" ] || \
|
||||
[ "$key" = "inattrs" ]; then
|
||||
eval "$1"
|
||||
fi
|
||||
@@ -452,6 +455,12 @@ function create_persistent_ifcfg {
|
||||
if [ -z "$_netmask" ]; then
|
||||
_netmask=`get_network_attr $xcatnet mask`
|
||||
fi
|
||||
|
||||
# Query mtu value from "networks" table
|
||||
if [ -z "$_mtu" ]; then
|
||||
_mtu=`get_network_attr $xcatnet mtu`
|
||||
fi
|
||||
|
||||
fi
|
||||
local attrs=""
|
||||
attrs=${attrs}${attrs:+,}"DEVICE=$ifname"
|
||||
@@ -460,6 +469,8 @@ function create_persistent_ifcfg {
|
||||
attrs=${attrs}${attrs:+,}"IPADDR=$_ipaddr"
|
||||
[ -n "$_netmask" ] && \
|
||||
attrs=${attrs}${attrs:+,}"NETMASK=$_netmask"
|
||||
[ -n "$_mtu" ] && \
|
||||
attrs=${attrs}${attrs:+,}"MTU=$_mtu"
|
||||
|
||||
# NetworkManager attributes
|
||||
attrs=${attrs}${attrs:+,}"NAME=$ifname"
|
||||
@@ -817,6 +828,11 @@ function create_bridge_interface {
|
||||
log_info "Pickup xcatnet, \"$xcatnet\", from NICNETWORKS for interface \"$ifname\"."
|
||||
fi
|
||||
|
||||
# Query mtu value from "networks" table
|
||||
if [ -z "$_mtu" ]; then
|
||||
_mtu=`get_network_attr $xcatnet mtu`
|
||||
fi
|
||||
|
||||
if [ x$_pretype == "xethernet" ]; then
|
||||
create_raw_ethernet_for_br \
|
||||
ifname=$_port \
|
||||
@@ -933,6 +949,11 @@ function create_ethernet_interface {
|
||||
return 1
|
||||
fi
|
||||
|
||||
# Query mtu value from "networks" table
|
||||
if [ -z "$_mtu" ]; then
|
||||
_mtu=`get_network_attr $xcatnet mtu`
|
||||
fi
|
||||
|
||||
# define and bring up interface
|
||||
cfg=""
|
||||
cfg="${cfg}${cfg:+,}ONBOOT=yes"
|
||||
@@ -1015,6 +1036,11 @@ function create_vlan_interface {
|
||||
log_info "Pickup xcatnet, \"$xcatnet\", from NICNETWORKS for interface \"$ifname\"."
|
||||
fi
|
||||
|
||||
# Query mtu value from "networks" table
|
||||
if [ -z "$_mtu" ]; then
|
||||
_mtu=`get_network_attr $xcatnet mtu`
|
||||
fi
|
||||
|
||||
|
||||
#load the 8021q module if not loaded.
|
||||
load_kmod module=8021q retry=10 interval=0.5
|
||||
@@ -1186,7 +1212,12 @@ function create_bond_interface {
|
||||
if [ -n "$_bonding_opts" ]; then
|
||||
_bonding_opts=`echo "$_bonding_opts" | $sed -e 's/,/ /g'`
|
||||
fi
|
||||
|
||||
|
||||
# Query mtu value from "networks" table
|
||||
if [ -z "$_mtu" ]; then
|
||||
_mtu=`get_network_attr $xcatnet mtu`
|
||||
fi
|
||||
|
||||
##############################
|
||||
# Create target bond interface
|
||||
# if target bond device was already exists, assume succ.
|
||||
|
||||
@@ -466,7 +466,6 @@ fi
|
||||
|
||||
# start up the sshd for syncfiles postscript to do the sync work
|
||||
logger -t xcat -p local4.info "start up sshd"
|
||||
|
||||
if [[ $OSVER == ubuntu* || $OSVER == debian* ]]
|
||||
then
|
||||
if [ ! -d /var/run/sshd ];then
|
||||
@@ -485,10 +484,12 @@ else
|
||||
#service sshd restart
|
||||
# sshd is not enabled on SLES 12 by default
|
||||
# does not hurt anything to re-enable if it is enabled already
|
||||
enableservice sshd
|
||||
# and disable enable service for diskless and statelite
|
||||
if [[ "$NODESETSTATE" != netboot && "$NODESETSTATE" != statelite ]]; then
|
||||
enableservice sshd
|
||||
fi
|
||||
restartservice sshd
|
||||
fi
|
||||
|
||||
#if the service restart with "service/systemctl" failed
|
||||
#try to kill the process and start
|
||||
if [ "$?" != "0" ];then
|
||||
@@ -496,5 +497,4 @@ if [ "$?" != "0" ];then
|
||||
[ -n "$PIDLIST" ] && kill 9 $PIDLIST
|
||||
/usr/sbin/sshd
|
||||
fi
|
||||
|
||||
kill -9 $CREDPID
|
||||
|
||||
@@ -46,8 +46,7 @@ ln -s /etc/init.d/xcatpostinit1 /etc/rc.d/rc3.d/S84xcatpostinit1
|
||||
ln -s /etc/init.d/xcatpostinit1 /etc/rc.d/rc4.d/S84xcatpostinit1
|
||||
ln -s /etc/init.d/xcatpostinit1 /etc/rc.d/rc5.d/S84xcatpostinit1
|
||||
|
||||
cp -f /xcatpost/xcatinstallpost /opt/xcat/xcatinstallpost
|
||||
cat >> /opt/xcat/xcatinstallpost << EOF
|
||||
cat > /opt/xcat/xcatinstallpost << EOF
|
||||
if [ -f /xcatpost/mypostscript.post ]; then
|
||||
RUNBOOTSCRIPTS=`grep 'RUNBOOTSCRIPTS=' /xcatpost/mypostscript.post |cut -d= -f2`
|
||||
fi
|
||||
@@ -55,6 +54,7 @@ if [ "$RUNBOOTSCRIPTS" != "'yes'" ]; then
|
||||
chkconfig xcatpostinit1 off
|
||||
fi
|
||||
EOF
|
||||
cat /xcatpost/xcatinstallpost >> /opt/xcat/xcatinstallpost
|
||||
chmod 755 /opt/xcat/xcatinstallpost
|
||||
|
||||
ls /etc | grep -i suse
|
||||
|
||||
@@ -36,7 +36,7 @@ while true; do
|
||||
|
||||
if [ $RETRY -eq 90 ];then
|
||||
#timeout, complain and exit
|
||||
msgutil_r "$MASTER_IP" "err" "`date`: xcatinstallpost: the network between the node and $MASTER_IP is not ready, please check..." "/var/log/xcat/xcat.log"
|
||||
msgutil_r "$MASTER_IP" "err" "`date`: xcatinstallpost: the network between the node and $MASTER_IP is not ready, please check[retry=$RETRY]..." "/var/log/xcat/xcat.log"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user