diff --git a/README.rst b/README.rst
index c9250eb90..a8377c82e 100644
--- a/README.rst
+++ b/README.rst
@@ -8,7 +8,7 @@ Documentation
xCAT documentation is available at: http://xcat-docs.readthedocs.io/en/latest/
-|docs_latest| |docs_2135| |docs_2134| |docs_2133| |docs_2132| |docs_2131| |docs_2130| |docs_212|
+|docs_latest| |docs_2137| |docs_2136| |docs_2135| |docs_2134| |docs_2133| |docs_2132| |docs_2131| |docs_2130| |docs_212|
Open Source License
-------------------
@@ -22,6 +22,16 @@ Developers
Developers and prospective contributors are encouraged to read the `Developers Guide `_
In particular the `GitHub `_ related subsection.
+.. |docs_2137| image:: https://readthedocs.org/projects/xcat-docs/badge/?version=2.13.7
+ :alt: 2.13.7 documentation status
+ :scale: 100%
+ :target: http://xcat-docs.readthedocs.io/en/2.13.7/
+
+.. |docs_2136| image:: https://readthedocs.org/projects/xcat-docs/badge/?version=2.13.6
+ :alt: 2.13.6 documentation status
+ :scale: 100%
+ :target: http://xcat-docs.readthedocs.io/en/2.13.6/
+
.. |docs_2135| image:: https://readthedocs.org/projects/xcat-docs/badge/?version=2.13.5
:alt: 2.13.5 documentation status
:scale: 100%
diff --git a/Version b/Version
index 14239ef15..c38dd67f3 100644
--- a/Version
+++ b/Version
@@ -1 +1 @@
-2.13.6
+2.13.8
diff --git a/build-ubunturepo b/build-ubunturepo
index 65e44c88d..729067680 100755
--- a/build-ubunturepo
+++ b/build-ubunturepo
@@ -524,7 +524,7 @@ __EOF__
FILES_PATH="files"
FRS="/var/www/${SERVER}/${FILES_PATH}"
APT_DIR="${FRS}/xcat"
- APT_REPO_DIR="${APT_DIR}/repos/apt"
+ APT_REPO_DIR="${APT_DIR}/repos/apt/devel"
# Decide whether to upload the xcat-dep package or NOT (default is to NOT upload xcat-dep
if [ "$UP" != "1" ]; then
diff --git a/builddep.sh b/builddep.sh
index 84ca78e40..1413dcca2 100755
--- a/builddep.sh
+++ b/builddep.sh
@@ -225,7 +225,7 @@ if [ "$OSNAME" == "AIX" ]; then
else
# Linux
SYSGRP=root
- YUM=yum
+ YUM=yum/devel
FRSDIR='2.x_Linux'
fi
chgrp -R -h $SYSGRP *
diff --git a/docs/source/advanced/index.rst b/docs/source/advanced/index.rst
index 3a78e0ac9..8c84eb6ac 100755
--- a/docs/source/advanced/index.rst
+++ b/docs/source/advanced/index.rst
@@ -6,6 +6,7 @@ Advanced Topics
chain/index.rst
cluster_maintenance/index.rst
+ migration/index.rst
confluent/index.rst
docker/index.rst
domain_name_resolution/index.rst
diff --git a/docs/source/advanced/migration/index.rst b/docs/source/advanced/migration/index.rst
new file mode 100644
index 000000000..7ceda4e45
--- /dev/null
+++ b/docs/source/advanced/migration/index.rst
@@ -0,0 +1,7 @@
+Migrate xCat Management node
+============================
+
+.. toctree::
+ :maxdepth: 2
+
+ migration.rst
diff --git a/docs/source/advanced/migration/migration.rst b/docs/source/advanced/migration/migration.rst
new file mode 100644
index 000000000..c93902f58
--- /dev/null
+++ b/docs/source/advanced/migration/migration.rst
@@ -0,0 +1,189 @@
+xCAT Management Node Migration
+==============================
+
+This document describes how to migrate xCAT Management node to a new node. The following example describes a typical scenario, this example is verified on redhat7.3.
+
+#. Initially, the first xcat management node is active, and the second node is passive.
+#. Backup all useful xCAT data from xCAT Management node to back-up server at regular intervals.
+#. When the first xCAT management node is broken, use backup to restore original xCAT data to the second node with the same host name and ip.
+
+Backup Old xCAT Management Node
+-------------------------------
+
+Backup xCAT management node data to backup server:
+
+1.1 Backup xCAT important files and directories:
+
+ #. Get ``installdir`` from ``site`` table, backup ``installdir`` directory,
+ in this case, back up ``install`` directory: ::
+
+ lsdef -t site clustersite -i installdir
+ Object name: clustersite
+ installdir=/install
+
+ #. Backup these two xCAT directories: ::
+
+ ~/.xcat
+ /etc/xcat
+
+ **Notes**: backing up ``~/.xcat`` is for all users who have xCAT client certs.
+
+ #. If there are customized files and directories for ``otherpkgdir``, ``pkgdir``, ``pkglist`` or ``template`` in some `osimage` definitions, backup these files and directories. for example: ::
+
+ lsdef -t osimage customized_rhels7.4-x86_64-install-compute -i otherpkgdir,pkgdir,pkglist,template
+ Object name: customized_rhels7.4-x86_64-install-compute
+ otherpkgdir=//post/otherpkgs/rhels7.4/x86_64
+ pkgdir=//rhels7.4/x86_64
+ pkglist=//compute.rhels7.pkglist
+ template=//compute.rhels7.tmpl
+
+1.2 Backup ssh related files: ::
+
+ /etc/ssh
+ ~/.ssh
+
+1.3 Backup host files: ::
+
+ /etc/resolv.conf
+ /etc/hosts
+ /etc/passwd
+ /etc/group
+
+1.4 Backup yum resource files: ::
+
+ /etc/yum.repos.d
+
+1.5 Backup conserver conf files: ::
+
+ /etc/conserver.cf
+
+1.6 Backup DNS related files: ::
+
+ /etc/named
+ /etc/named.conf
+ /etc/named.iscdlv.key
+ /etc/named.root.key
+ /etc/rndc.key
+ /etc/sysconfig/named
+ /var/named
+
+1.7 Backup dhcp files: ::
+
+ /etc/dhcp
+ /var/lib/dhcpd
+ /etc/sysconfig/dhcpd
+ /etc/sysconfig/dhcpd6
+
+1.8 Backup apache: ::
+
+ /etc/httpd
+ /var/www
+
+1.9 Backup tftp files: ::
+
+ /tftpboot
+
+1.10 Backup NTP configure file: ::
+
+ /etc/ntp.conf
+
+1.11 Backup database configure files (optional):
+
+ * **[PostgreSQL]** ::
+
+ /var/lib/pgsql/data/pg_hba.conf
+ /var/lib/pgsql/data/postgresql.conf
+
+1.12 Backup NFS (optional): ::
+
+ /etc/exports
+ /var/lib/nfs
+ /etc/sysconfig/nfs
+
+1.13 (optional)
+
+Besides the files mentioned above, there may be some additional customization files and production files that need to be backup, depending on your local unique requirements. Here are some example files that can be considered: ::
+
+ /.profile
+ /.rhosts
+ /etc/auto_master
+ /etc/auto/maps/auto.u
+ /etc/motd
+ /etc/security/limits
+ /etc/netscvc.conf
+ /etc/inetd.conf
+ /etc/security/passwd
+ /etc/security/group
+ /etc/services
+ /etc/inittab(andmore)
+
+1.14 Backup the xCAT database tables for the current configuration, using command: ::
+
+ dumpxCATdb -p
+
+1.15 Save all installed xCAT RPM names into a file: ::
+
+ rpm -qa|grep -i xCAT > xcat_rpm_names
+
+1.16 (Optional) Find customization made to files installed from packages, backup these files. For example ::
+
+ rpm -q --verify -a conserver-xcat
+ rpm -q --verify -a xCAT-server
+ rpm -q --verify -a syslinux-xcat
+ rpm -q --verify -a xCAT-client
+ rpm -q --verify -a xCAT
+
+
+Restore xCAT management node
+----------------------------
+
+2.1 Power off old xCAT management server before configuring new xCAT management server
+
+2.2 Configure new xCAT management server using the same ip and hostname as old xCAT management server. Configure the same additional network for hardware management network if needed, for example, bmc network or hmc network. xCAT management server setup refer to :doc:`Prepare the Management Node <../../guides/install-guides/yum/prepare_mgmt_node>`
+
+2.3 Overwrite files/directories methioned in above 1.2, 1.3, 1.4 from backup server to new xCAT management server
+
+2.4 Download xcat-core and xcat-dep tar ball, then install xCAT in new xCAT management server, refer to :doc:`install xCAT <../../guides/install-guides/yum/install>`
+
+2.5 Use ``rpm -qa|grep -i xCAT`` to list all xCAT RPMs in new xCAT management node, compare these RPMs base name with those in ``xcat_rpm_names`` from above 1.15. If some RPMs are missing, use ``yum install `` to install missing RPMs.
+
+2.6 If use ``MySQL``/``MariaDB``/``PostgreSQL``, migrate xCAT to use ``MySQL/MariaDB/PostgreSQL`` refer to :doc:`Configure a Database <../hierarchy/databases/index>`
+
+2.7 To restore the xCAT database
+
+ a. Restore xCAT database from the ``/dbbackup/db`` directory without ``auditlog`` and ``eventlog``, enter: ::
+
+ restorexCATdb -p /dbbackup/db
+
+ b. Restore the xCAT database including ``auditlog`` and ``eventlog`` from the ``/dbbackup/db`` directory, enter: ::
+
+ restorexCATdb -a -p /dbbackup/db
+
+ c. (optinal) Overwrite files in above 1.11, restart ``PostgreSQL``: ::
+
+ service postgresql restart
+
+2.8 Overwrite remaining files/directories methioned in above 1.1, 1.5, 1.6, 1.7, 1.8, 1.9, 1.10, 1.12; If needed, check if files exist based on above 1.13 and 1.16.
+
+2.9 Verify xCAT: ::
+
+ tabdump site
+
+2.10 Restart ``named``, use ``nslookup`` to check ``DNS``: ::
+
+ service named restart
+ nslookup
+
+2.11 Restart ``conserver``, use ``rcons`` to check console: ::
+
+ service conserver restart
+ rcons
+
+2.12 Configure DHCP: ::
+
+ makedhcp -n
+ makedhcp -a
+
+2.13 Restart ``httpd`` for REST API, for more information refer to :doc:`Rest API<../../../advanced/restapi/index>`: ::
+
+ service httpd restart
diff --git a/docs/source/advanced/networks/onie_switches/os_cumulus/index.rst b/docs/source/advanced/networks/onie_switches/os_cumulus/index.rst
index d2b369957..82f0e4e38 100644
--- a/docs/source/advanced/networks/onie_switches/os_cumulus/index.rst
+++ b/docs/source/advanced/networks/onie_switches/os_cumulus/index.rst
@@ -10,3 +10,4 @@ This documentation will focus on installing the Cumulus Network Operating System
prepare.rst
install.rst
manage.rst
+ upgrade.rst
diff --git a/docs/source/advanced/networks/onie_switches/os_cumulus/install.rst b/docs/source/advanced/networks/onie_switches/os_cumulus/install.rst
index e0d132dfb..8915d02af 100644
--- a/docs/source/advanced/networks/onie_switches/os_cumulus/install.rst
+++ b/docs/source/advanced/networks/onie_switches/os_cumulus/install.rst
@@ -78,6 +78,8 @@ Validate the ssh keys are correctly configured by running a ``xdsh`` command: ::
xdsh frame01sw1 uptime
+.. _activate-the-license:
+
Activate the License
--------------------
diff --git a/docs/source/advanced/networks/onie_switches/os_cumulus/manage.rst b/docs/source/advanced/networks/onie_switches/os_cumulus/manage.rst
index 0f3ce1184..512c4b1f4 100644
--- a/docs/source/advanced/networks/onie_switches/os_cumulus/manage.rst
+++ b/docs/source/advanced/networks/onie_switches/os_cumulus/manage.rst
@@ -1,10 +1,10 @@
Switch Management
=================
-VLAN Configuration
-------------------
+Switch Port and VLAN Configuration
+----------------------------------
-xCAT ships a simple configuration script that will set all the ports on the switch to be part of VLAN 1. See the Cumulus Networks documentation for more information regarding advanced networking configuration. ::
+xCAT expects the configuration for the front-panel ports to be located at ``/etc/network/interfaces.d/xCAT.intf`` on the switch. The ``configinterface`` postscript can download an interface configuration file from the management node. Place the configuration file in the directory ``/install/custom/sw_os/cumulus/interface/`` on the management node. It will first look for a file named the same as the switch's hostname, followed by the name of each group, followed by the word 'default'. If the postscript cannot find a configuration file on the management node, it will set all the ports on the switch to be part of VLAN 1. See the Cumulus Networks documentation for more information regarding advanced networking configuration. ::
updatenode -P configinterface
diff --git a/docs/source/advanced/networks/onie_switches/os_cumulus/upgrade.rst b/docs/source/advanced/networks/onie_switches/os_cumulus/upgrade.rst
new file mode 100644
index 000000000..da079129c
--- /dev/null
+++ b/docs/source/advanced/networks/onie_switches/os_cumulus/upgrade.rst
@@ -0,0 +1,62 @@
+Cumulus OS upgrade
+==================
+
+The Cumulus OS on the ONIE switches can be upgraded in 2 ways:
+
+* Upgrade only the changed packages, using ``apt-get update`` and ``apt-get upgrade``. If the ONIE switches has internet access, this is the preferred method, otherwise, you need to build up a local cumulus mirror in the cluster.
+
+ Since in a typical cluster setup, the switches usually do not have internet access, you can create a local mirror on the server which has internet access and can be reached from the switches, the steps are ::
+
+ mkdir -p /install/mirror/cumulus
+ cd /install/mirror/cumulus
+ #the wget might take a long time, it will be better if you can set up
+ #a cron job to sync the local mirror with upstream
+ wget -m --no-parent http://repo3.cumulusnetworks.com/repo/
+
+ then compose a ``sources.list`` file on MN like this(take 172.21.253.37 as ip address of the local mirror server) ::
+
+ #cat /tmp/sources.list
+ deb http://172.21.253.37/install/mirror/cumulus/repo3.cumulusnetworks.com/repo CumulusLinux-3 cumulus upstream
+ deb-src http://172.21.253.37/install/mirror/cumulus/repo3.cumulusnetworks.com/repo CumulusLinux-3 cumulus upstream
+
+ deb http://172.21.253.37/install/mirror/cumulus/repo3.cumulusnetworks.com/repo CumulusLinux-3-security-updates cumulus upstream
+ deb-src http://172.21.253.37/install/mirror/cumulus/repo3.cumulusnetworks.com/repo CumulusLinux-3-security-updates cumulus upstream
+
+ deb http://172.21.253.37/install/mirror/cumulus/repo3.cumulusnetworks.com/repo CumulusLinux-3-updates cumulus upstream
+ deb-src http://172.21.253.37/install/mirror/cumulus/repo3.cumulusnetworks.com/repo CumulusLinux-3-updates cumulus upstream
+
+ distribute the ``sources.list`` file to the switches to upgrade with ``xdcp``, take "switch1" as an example here ::
+
+ xdcp switch1 /tmp/sources.list /etc/apt/sources.list
+
+ then invoke ``apt-get update`` and ``apt-get install`` on the switches to start package upgrade, a reboot might be needed after upgrading ::
+
+ xdsh switch1 'apt-get update && apt-get upgrade && reboot'
+
+ check the `/etc/os-release` file to make sure the Cumulus OS has been upgraded ::
+
+ cat /etc/os-release
+
+
+
+* Performe a binary (full image) install of the new version, using ONIE. If you expect to upgrade between major versions or if you have the binary image to upgrade to, this way is the recommended one. Make sure to backup your data and configuration files because binary install will erase all the configuration and data on the switch.
+
+ The steps to perform a binary (full image) install of the new version are:
+
+ 1) place the binary image "cumulus-linux-3.4.1.bin" under ``/install`` directory on MN("172.21.253.37") ::
+
+ mkdir -p /install/onie/
+ cp cumulus-linux-3.4.1.bin /install/onie/
+
+ 2) invoke the upgrade on switches with ``xdsh`` ::
+
+ xdsh switch1 "/usr/cumulus/bin/onie-install -a -f -i http://172.21.253.37/install/onie/cumulus-linux-3.4.1.bin && reboot"
+
+ The full upgrade process might cost 30 min, you can ping the switch with ``ping switch1`` to check whether it finishes upgrade.
+
+ 3) After upgrading, the license should be installed, see :ref:`Activate the License ` for detailed steps.
+
+ 4) Restore your data and configuration files on the switch.
+
+
+
diff --git a/docs/source/conf.py b/docs/source/conf.py
index 270e99067..9d1b248b3 100644
--- a/docs/source/conf.py
+++ b/docs/source/conf.py
@@ -59,7 +59,7 @@ author = u'IBM Corporation'
# The short X.Y version.
version = '2'
# The full version, including alpha/beta/rc tags.
-release = '2.12'
+release = '2.13.6'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
diff --git a/docs/source/guides/admin-guides/basic_concepts/xcat_db/regexp_db.rst b/docs/source/guides/admin-guides/basic_concepts/xcat_db/regexp_db.rst
index 1e3c8482b..a39bf7c9d 100644
--- a/docs/source/guides/admin-guides/basic_concepts/xcat_db/regexp_db.rst
+++ b/docs/source/guides/admin-guides/basic_concepts/xcat_db/regexp_db.rst
@@ -95,6 +95,63 @@ Using easy regular expression support you would put this in the hosts table. ::
In the easy regx example, the expression only has the 2nd part of the expression from the previous example. xCAT will evaluate the node name, matching the number part of the node name, and create the 1st part of the expression . The 2nd part supplied is what value to give the ip attribute. The resulting output is the same.
+Regular Expression Helper Functions
+-----------------------------------
+
+xCAT provides several functions that can simplify regular expressions.
+
+\ **a2idx** ASCII Character to Index\
+ Usage: ``a2idx(character)``
+
+ Turns a single character into a 1-indexed index. ‘a’ maps to 1 and ‘z’ maps to 26.
+
+\ **a2zidx** ASCII Character to 0-Index\
+ Usage: ``a2zidx(character)``
+
+ Turns a single character into a 0-indexed index. ‘a’ maps to 0 and ‘z’ maps to 25.
+
+\ **dim2idx** Dimensions to Index\
+ Usage: ``dim2idx(value, [count, value...])``
+
+ Converts dimensions (such as row, column, chassis, etc) into an index. An example system consists of 8 racks, two rows with four columns each.
+
+ +-----------+-----------+-----------+-----------+
+ | row1-col1 | row1-col2 | row1-col3 | row1-col4 |
+ +-----------+-----------+-----------+-----------+
+ | row2-col1 | row2-col2 | row2-col3 | row2-col4 |
+ +-----------+-----------+-----------+-----------+
+ To obtain the rack index, use ``|row(\d+)-col(\d+)|(dim2idx($1, 4, $2))|``. This maps the racks to:
+
+ +---+---+---+---+
+ | 1 | 2 | 3 | 4 |
+ +---+---+---+---+
+ | 5 | 6 | 7 | 8 |
+ +---+---+---+---+
+ Note that the size of the highest dimension (2 rows) is not needed, and all values are one-indexed.
+
+ If each rack contains 20 nodes, use ``|row(\d+)-col(\d+)-node(\d+)|(dim2idx($1, 4, $2, 20, $3)`` to determine a node index (useful for determining IP addresses).
+
+\ **skip** Skip indices\
+ Usage: ``skip(index, skiplist)``
+
+ Return an index with certain values skipped. The skip list uses the format ``start[:count][,start[:count]...]``. Using the example above, to skip racks 3 and 4, use:
+
+ ``|row(\d+)-col(\d+)|(skip(dim2idx($1, 4, $2),'3:2')|``
+
+ The result would be:
+
+ +---+---+---+---+
+ | 1 | 2 | | |
+ +---+---+---+---+
+ | 3 | 4 | 5 | 6 |
+ +---+---+---+---+
+
+\ **ipadd** Add to an IP address\
+ Usage: ``ipadd(octet1, octet2, octet3, octet4, toadd, skipstart, skipend)``
+
+ This function is useful when you need to cross octets. Optionally skip addresses at the start and end of octets (like .0 or .255 - technically those are valid IP addresses, but sometimes software makes poor assumptions about which broadcast and gateway addresses).
+
+
Verify your regular expression
------------------------------
diff --git a/docs/source/guides/admin-guides/manage_clusters/common/deployment/enable_localdisk.rst b/docs/source/guides/admin-guides/manage_clusters/common/deployment/enable_localdisk.rst
new file mode 100644
index 000000000..5608abe72
--- /dev/null
+++ b/docs/source/guides/admin-guides/manage_clusters/common/deployment/enable_localdisk.rst
@@ -0,0 +1,85 @@
+Enabling the localdisk Option
+-----------------------------
+
+``Note``: You can skip this section if not using the ``localdisk`` option in your litefile table.
+
+Several things need to be done to enable the 'localdisk' support:
+
+Define how to partition the local disk
+``````````````````````````````````````
+
+When a node is deployed, the local hard disk needs to be partitioned and formatted before it can be used. This section explains how provide a configuration file that tells xCAT to partition a local disk and make it ready to use for the directories listed in the litefile table with the ``localdisk`` option.
+
+The configuration file needs to be specified in the ``partitionfile`` attribute of the osimage definition. The configuration file includes several parts:
+
+ * Global parameters to control enabling or disabling the function
+ * [disk] part to control the partitioning of the disk
+ * [localspace] part to control which partition will be used to store the localdisk directories listed in the litefile table
+ * [swapspace] part to control the enablement of the swap space for the node.
+
+An example localdisk configuration file: ::
+
+ enable=yes
+ enablepart=no
+
+ [disk]
+ dev=/dev/sdb
+ clear=yes
+ parts=100M-200M,1G-2G
+
+ [disk]
+ dev=/dev/sda
+ clear=yes
+ parts=10,20,30
+
+ [disk]
+ dev=/dev/sdc
+ clear=yes
+ parts=10,20,30
+
+ [localspace]
+ dev=/dev/sda1
+ fstype=ext3
+
+ [swapspace]
+ dev=/dev/sda2
+
+The two global parameters ``enable`` and ``enablepart`` can be used to control the enabling/disabling of the functions:
+
+ * enable: The localdisk feature only works when ``enable`` is set to *yes*. If it is set to *no*, the localdisk configuration will not be run.
+ * enablepart: The partition action (refer to the ``[disk]`` section) will be run only when ``enablepart=yes``.
+
+The ``[disk]`` section is used to configure how to partition a hard disk:
+
+ * dev: The path of the device file.
+ * clear: If set to ``yes`` it will clear all the existing partitions on this disk.
+ * fstype: The file system type for the new created partitions. ``ext3`` is the default value if not set.
+ * parts: A comma separated list of space ranges, one for each partition that will be created on the device. The valid format for each space range is ``-`` or ````. For example, you could set it to ``100M-10G`` or ``50``. If you set it to ``50``, that means 50% of the disk space will be assigned to that partition.
+
+The ``[localspace]`` section is used to specify which partition will be used as local storage for the node.
+
+ * dev: The path of the partition.
+ * fstype: The file system type on the partition.
+
+the ``[swapspace]`` section is used to configure the swap space for the statelite node.
+
+ * dev: The path of the partition file which will be used as the swap space.
+
+To enable the local disk capability, create the configuration file (for example in ``/install/custom``) and set the path in the partitionfile attribute for the osimage: ::
+
+ chdef -t osimage partitionfile=/install/custom/cfglocaldisk
+
+Now all nodes that use this osimage (i.e. have their provmethod attribute set to this osimage definition name), will have its local disk configured.
+
+Configure the files in the litefile table
+`````````````````````````````````````````
+
+For the files/directories that you would like xCAT to store on the local disk, add an entry in the litefile table like this: ::
+
+ "ALL","/tmp/","localdisk",,
+
+``Note``: you do not need to specify the swap space in the litefile table. Just putting it in the partitionfile config file is enough.
+
+Add an entry in policy table to permit the running of the ``getpartitioin`` command from the node ::
+
+ chtab priority=7.1 policy.commands=getpartition policy.rule=allow
diff --git a/docs/source/guides/admin-guides/manage_clusters/common/deployment/network/cfg_network_bond_vlan.rst b/docs/source/guides/admin-guides/manage_clusters/common/deployment/network/cfg_network_bond_vlan.rst
index 84130a096..ba249126f 100644
--- a/docs/source/guides/admin-guides/manage_clusters/common/deployment/network/cfg_network_bond_vlan.rst
+++ b/docs/source/guides/admin-guides/manage_clusters/common/deployment/network/cfg_network_bond_vlan.rst
@@ -31,8 +31,13 @@ Define attributes in the ``nics`` table
chdef cn1 nicips.bond0.1=40.0.0.1 nictypes.bond0.1=vlan
#. Define ``nicnetworks`` for ``bond0.1`` ::
+
chdef cn1 nicnetworks.bond0.1=net40
+#. Define ``nichostnamesuffixes`` for ``bond0.1`` in case ``makehosts`` to update ``/etc/hosts``, since the value for ``nichostnamesuffixes`` cannot contain ".", other characters are recommended instead of ".", like following: ::
+
+ chdef cn1 nichostnamesuffixes.bond0.1=-bond0-1
+
Enable ``confignetwork`` to configure bridge
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/docs/source/guides/admin-guides/manage_clusters/common/deployment/network/cfg_network_vlan.rst b/docs/source/guides/admin-guides/manage_clusters/common/deployment/network/cfg_network_vlan.rst
index 41ed6a0a9..65ee1de30 100644
--- a/docs/source/guides/admin-guides/manage_clusters/common/deployment/network/cfg_network_vlan.rst
+++ b/docs/source/guides/admin-guides/manage_clusters/common/deployment/network/cfg_network_vlan.rst
@@ -31,6 +31,10 @@ Define attributes in the ``nics`` table
chdef cn1 nicnetworks.eth0.6=net60 nicnetworks.eth0.7=net70
+#. Define ``nichostnamesuffixes`` for ``eth0.6`` and ``eth0.7`` in case ``makehosts`` to update ``/etc/hosts``, since the value for ``nichostnamesuffixes`` cannot contain ".", other characters are recommended instead of ".", like following: ::
+
+ chdef cn1 nichostnamesuffixes.eth0.6=-eth0-6 nichostnamesuffixes.eth0.7=-eth0-7
+
Enable ``confignetwork`` to configure VLAN
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/docs/source/guides/admin-guides/manage_clusters/common/kvm/manage_vm.rst b/docs/source/guides/admin-guides/manage_clusters/common/kvm/manage_vm.rst
index f383e065d..6aa25256c 100644
--- a/docs/source/guides/admin-guides/manage_clusters/common/kvm/manage_vm.rst
+++ b/docs/source/guides/admin-guides/manage_clusters/common/kvm/manage_vm.rst
@@ -2,7 +2,7 @@ Manage Virtual Machine (VM)
============================
-Now the MowerKVM hypervisor "kvmhost1" is ready, this section introduces the VM management in xCAT, including examples on how to create, remove and clone VMs.
+Now the PowerKVM hypervisor "kvmhost1" is ready, this section introduces the VM management in xCAT, including examples on how to create, remove and clone VMs.
Create Virtual Machine
----------------------
@@ -82,7 +82,27 @@ After the VM object is created, several key attributes need to be specified with
chtab node=vm1 vm.vidpassword=abc123
-10. Set **netboot** attribute
+10. (optional)For assigning PCI devices to the VM, set **othersettings** value: ::
+
+ chtab node=vm1 vm.othersettings="devpassthrough:0000:01:00.2"
+
+ Or: ::
+
+ chtab node=vm1 vm.othersettings="devpassthrough:pci_0000_01_00_2"
+
+ Take assigning SR-IOV VFs to the VM as an example:
+
+ * Use ``lspci`` to get VFs PCI from hypervisor: ::
+
+ lspci|grep -i "Virtual Function"
+ 0000:01:00.1 Infiniband controller: Mellanox Technologies MT27700 Family [ConnectX-4 Virtual Function]
+ 0000:01:00.2 Infiniband controller: Mellanox Technologies MT27700 Family [ConnectX-4 Virtual Function]
+
+ * Set the VFs PCI into ``vm`` table on MN: ::
+
+ chtab node=vm1 vm.othersettings="devpassthrough:0000:01:00.1,0000:01:00.2"
+
+11. Set **netboot** attribute
* **[x86_64]** ::
diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms/discovery_using_defined.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms/discovery_using_defined.rst
index d69d5d706..9ea41fc17 100644
--- a/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms/discovery_using_defined.rst
+++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms/discovery_using_defined.rst
@@ -12,7 +12,7 @@ The following example outlines the MTMS based hardware discovery for a single IP
+------------------------------+------------+
| Hostname | cn01 |
+------------------------------+------------+
-| IP address | 10.1.2.1 |
+| IP address | 10.0.101.1 |
+------------------------------+------------+
The BMC IP address is obtained by the open range dhcp server and the plan in this scenario is to change the IP address for the BMC to a static IP address in a different subnet than the open range addresses. The static IP address in this example is in the same subnet as the open range to simplify the networking configuration on the xCAT management node.
@@ -20,9 +20,9 @@ The BMC IP address is obtained by the open range dhcp server and the plan in thi
+------------------------------+------------+
| BMC Information | Value |
+==============================+============+
-| IP address - dhcp | 172.30.0.1 |
+| IP address - dhcp | 50.0.100.1 |
+------------------------------+------------+
-| IP address - static | 172.20.2.1 |
+| IP address - static | 50.0.101.1 |
+------------------------------+------------+
#. Detect the BMCs and add the node definitions into xCAT.
@@ -44,9 +44,9 @@ The BMC IP address is obtained by the open range dhcp server and the plan in thi
Use the ``bmcdiscover`` command to help discover the nodes over an IP range and easily create a starting file to define the compute nodes into xCAT.
- To discover the compute nodes for the BMCs with an IP address of 172.30.0.1, use the command: ::
+ To discover the compute nodes for the BMCs with an IP address of 50.0.100.1, use the command: ::
- bmcdiscover --range 172.30.0.1 -z > predefined.stanzas
+ bmcdiscover --range 50.0.100.1 -z > predefined.stanzas
The discovered nodes have the naming convention: node-<*model-type*>-<*serial-number*> ::
@@ -54,7 +54,7 @@ The BMC IP address is obtained by the open range dhcp server and the plan in thi
node-8247-22l-10112ca:
objtype=node
groups=all
- bmc=172.30.0.1
+ bmc=50.0.100.1
cons=ipmi
mgt=ipmi
mtm=8247-22L
@@ -73,7 +73,7 @@ The BMC IP address is obtained by the open range dhcp server and the plan in thi
#. Add a ``ip`` attribute and give it the compute node IP address: ::
- ip=10.1.2.1
+ ip=10.0.101.1
#. Remove ``nodetype`` and ``hwtype`` if defined in the ``predefined.stanza``.
@@ -86,13 +86,16 @@ The BMC IP address is obtained by the open range dhcp server and the plan in thi
cn01:
objtype=node
groups=all
- bmc=172.30.0.1
+ bmc=50.0.100.1
cons=ipmi
mgt=ipmi
mtm=8247-22L
serial=10112CA
- ip=10.1.2.1
+ ip=10.0.101.1
+#. Define the compute nodes into xCAT: ::
+
+ cat predefined.stanzas | mkdef -z
#. Set the chain table to run the ``bmcsetup`` script, this will set the BMC IP to static. ::
@@ -106,13 +109,10 @@ The BMC IP address is obtained by the open range dhcp server and the plan in thi
Set the BMC IP address to a different value for the **predefined** compute node definitions.
- To change the dhcp obtained IP address of 172.30.0.1 to a static IP address of 172.20.2.1, run the following command: ::
+ To change the dhcp obtained IP address of 50.0.100.1 to a static IP address of 50.0.101.1, run the following command: ::
- chdef cn01 bmc=172.20.2.1
+ chdef cn01 bmc=50.0.101.1
-#. Define the compute nodes into xCAT: ::
-
- cat predefined.stanzas | mkdef -z
#. Add the compute node IP information to ``/etc/hosts``: ::
diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms/discovery_using_dhcp.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms/discovery_using_dhcp.rst
index 3634c067b..5b22af650 100644
--- a/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms/discovery_using_dhcp.rst
+++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms/discovery_using_dhcp.rst
@@ -12,7 +12,7 @@ The following example outlines the MTMS based hardware discovery for a single IP
+------------------------------+------------+
| Hostname | cn01 |
+------------------------------+------------+
-| IP address | 10.1.2.1 |
+| IP address | 10.0.101.1 |
+------------------------------+------------+
The BMC IP address is obtained by the open range dhcp server and the plan is to leave the IP address the same, except we want to change the IP address to be static in the BMC.
@@ -20,9 +20,9 @@ The BMC IP address is obtained by the open range dhcp server and the plan is to
+------------------------------+------------+
| BMC Information | Value |
+==============================+============+
-| IP address - dhcp | 172.30.0.1 |
+| IP address - dhcp | 50.0.100.1 |
+------------------------------+------------+
-| IP address - static | 172.30.0.1 |
+| IP address - static | 50.0.100.1 |
+------------------------------+------------+
@@ -30,9 +30,9 @@ The BMC IP address is obtained by the open range dhcp server and the plan is to
Use the ``bmcdiscover`` command to help discover the nodes over an IP range and easily create a starting file to define the compute nodes into xCAT.
- To discover the compute nodes for the BMCs with an IP address of 172.30.0.1, use the command: ::
+ To discover the compute nodes for the BMCs with an IP address of 50.0.100.1, use the command: ::
- bmcdiscover --range 172.30.0.1 -z > predefined.stanzas
+ bmcdiscover --range 50.0.100.1 -z > predefined.stanzas
The discovered nodes have the naming convention: node-<*model-type*>-<*serial-number*> ::
@@ -40,7 +40,7 @@ The BMC IP address is obtained by the open range dhcp server and the plan is to
node-8247-22l-10112ca:
objtype=node
groups=all
- bmc=172.30.0.1
+ bmc=50.0.100.1
cons=ipmi
mgt=ipmi
mtm=8247-22L
@@ -59,7 +59,7 @@ The BMC IP address is obtained by the open range dhcp server and the plan is to
#. Add a ``ip`` attribute and give it the compute node IP address: ::
- ip=10.1.2.1
+ ip=10.0.101.1
#. Repeat for additional nodes in the ``predefined.stanza`` file based on the MTMS mapping.
@@ -70,13 +70,16 @@ The BMC IP address is obtained by the open range dhcp server and the plan is to
cn01:
objtype=node
groups=all
- bmc=172.30.0.1
+ bmc=50.0.100.1
cons=ipmi
mgt=ipmi
mtm=8247-22L
serial=10112CA
- ip=10.1.2.1
+ ip=10.0.101.1
+#. Define the compute nodes into xCAT: ::
+
+ cat predefined.stanzas | mkdef -z
#. Set the chain table to run the ``bmcsetup`` script, this will set the BMC IP to static. ::
@@ -86,10 +89,6 @@ The BMC IP address is obtained by the open range dhcp server and the plan is to
chdef cn01 -p chain="osimage="
-#. Define the compute nodes into xCAT: ::
-
- cat predefined.stanzas | mkdef -z
-
#. Add the compute node IP information to ``/etc/hosts``: ::
makehosts cn01
diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/diskless/customize_image/index.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/diskless/customize_image/index.rst
index 5d71d4223..7a9554d87 100644
--- a/docs/source/guides/admin-guides/manage_clusters/ppc64le/diskless/customize_image/index.rst
+++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/diskless/customize_image/index.rst
@@ -15,3 +15,4 @@ Optional means all the subitems in this page are not necessary to finish an OS d
install_new_kernel.rst
acc_initrd_rootimg_gen_ppc64le.rst
trim_diskless_rootimg.rst
+ localdisk.rst
diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/diskless/customize_image/localdisk.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/diskless/customize_image/localdisk.rst
new file mode 100644
index 000000000..52115d5ef
--- /dev/null
+++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/diskless/customize_image/localdisk.rst
@@ -0,0 +1 @@
+.. include:: ../../../common/deployment/enable_localdisk.rst
diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/diskless/localdisk.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/diskless/localdisk.rst
new file mode 100644
index 000000000..54922a50c
--- /dev/null
+++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/diskless/localdisk.rst
@@ -0,0 +1,6 @@
+.. include:: ../../../common/deployment/enable_localdisk.rst
+
+``Note``:
+ * `localdisk` feature won't syncronize the files/directories defined in `litefile` table from diskless image to local disk at the node boot time. It might casue issue to the application which depends on some of those directories. For example, the ``httpd`` service cannot be started if ``/var/log/`` is defined in `litefile` table. To work around this, you may copy the required contents to local disk and restart service manually at the first time.
+
+ * To keep the contents on local disk after you use ``enablepart=yes`` to do partitioin, make sure to set ``enablepart=no`` in partitioin configuration file after the node is booted.
\ No newline at end of file
diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/statelite/advanced_features.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/statelite/advanced_features.rst
index cb5aca4e9..089b1f066 100644
--- a/docs/source/guides/admin-guides/manage_clusters/ppc64le/statelite/advanced_features.rst
+++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/statelite/advanced_features.rst
@@ -162,91 +162,7 @@ Obtain you new kernel and kernel modules on the MN, for example here we have a n
uname -a
-Enabling the localdisk Option
------------------------------
-
-``Note``: You can skip this section if not using the ``localdisk`` option in your litefile table.
-
-Several things need to be done to enable the 'localdisk' support:
-
-Define how to partition the local disk
-``````````````````````````````````````
-
-When a node is deployed, the local hard disk needs to be partitioned and formatted before it can be used. This section explains how provide a configuration file that tells xCAT to partition a local disk and make it ready to use for the directories listed in the litefile table with the ``localdisk`` option.
-
-The configuration file needs to be specified in the ``partitionfile`` attribute of the osimage definition. The configuration file includes several parts:
-
- * Global parameters to control enabling or disabling the function
- * [disk] part to control the partitioning of the disk
- * [localspace] part to control which partition will be used to store the localdisk directories listed in the litefile table
- * [swapspace] part to control the enablement of the swap space for the node.
-
-An example localdisk configuration file: ::
-
- enable=yes
- enablepart=no
-
- [disk]
- dev=/dev/sdb
- clear=yes
- parts=100M-200M,1G-2G
-
- [disk]
- dev=/dev/sda
- clear=yes
- parts=10,20,30
-
- [disk]
- dev=/dev/sdc
- clear=yes
- parts=10,20,30
-
- [localspace]
- dev=/dev/sda1
- fstype=ext3
-
- [swapspace]
- dev=/dev/sda2
-
-The two global parameters ``enable`` and ``enablepart`` can be used to control the enabling/disabling of the functions:
-
- * enable: The localdisk feature only works when ``enable`` is set to *yes*. If it is set to *no*, the localdisk configuration will not be run.
- * enablepart: The partition action (refer to the ``[disk]`` section) will be run only when ``enablepart=yes``.
-
-The ``[disk]`` section is used to configure how to partition a hard disk:
-
- * dev: The path of the device file.
- * clear: If set to ``yes`` it will clear all the existing partitions on this disk.
- * fstype: The file system type for the new created partitions. ``ext3`` is the default value if not set.
- * parts: A comma separated list of space ranges, one for each partition that will be created on the device. The valid format for each space range is ``-`` or ````. For example, you could set it to ``100M-10G`` or ``50``. If you set it to ``50``, that means 50% of the disk space will be assigned to that partition.
-
-The ``[localspace]`` section is used to specify which partition will be used as local storage for the node.
-
- * dev: The path of the partition.
- * fstype: The file system type on the partition.
-
-the ``[swapspace]`` section is used to configure the swap space for the statelite node.
-
- * dev: The path of the partition file which will be used as the swap space.
-
-To enable the local disk capability, create the configuration file (for example in ``/install/custom``) and set the path in the partitionfile attribute for the osimage: ::
-
- chdef -t osimage partitionfile=/install/custom/cfglocaldisk
-
-Now all nodes that use this osimage (i.e. have their provmethod attribute set to this osimage definition name), will have its local disk configured.
-
-Configure the files in the litefile table
-`````````````````````````````````````````
-
-For the files/directories that you would like xCAT to store on the local disk, add an entry in the litefile table like this: ::
-
- "ALL","/tmp/","localdisk",,
-
-``Note``: you do not need to specify the swap space in the litefile table. Just putting it in the partitionfile config file is enough.
-
-Add an entry in policy table to permit the running of the ``getpartitioin`` command from the node ::
-
- chtab priority=7.1 policy.commands=getpartition policy.rule=allow
+.. include:: ../../common/deployment/enable_localdisk.rst
If Using the RAMdisk-based Image
````````````````````````````````
diff --git a/docs/source/guides/admin-guides/references/man1/bmcdiscover.1.rst b/docs/source/guides/admin-guides/references/man1/bmcdiscover.1.rst
index 7173c39f5..6fde20bb8 100644
--- a/docs/source/guides/admin-guides/references/man1/bmcdiscover.1.rst
+++ b/docs/source/guides/admin-guides/references/man1/bmcdiscover.1.rst
@@ -23,7 +23,7 @@ SYNOPSIS
\ **bmcdiscover**\ [\ **-v | -**\ **-version**\ ]
-\ **bmcdiscover**\ [\ **-s**\ \ *scan_method*\ ] [\ **-u**\ \ *bmc_user*\ ] [\ **-p**\ \ *bmc_passwd*\ ] [\ **-z**\ ] [\ **-w**\ ] \ **-**\ **-range**\ \ *ip_ranges*\
+\ **bmcdiscover**\ [\ **-**\ **-sn**\ \ *SN_nodename*\ ] [\ **-s**\ \ *scan_method*\ ] [\ **-u**\ \ *bmc_user*\ ] [\ **-p**\ \ *bmc_passwd*\ ] [\ **-z**\ ] [\ **-w**\ ] \ **-**\ **-range**\ \ *ip_ranges*\
\ **bmcdiscover**\ \ **-u**\ \ *bmc_user*\ \ **-p**\ \ *bmc_passwd*\ \ **-i**\ \ *bmc_ip*\ \ **-**\ **-check**\
@@ -56,6 +56,12 @@ OPTIONS
+\ **-**\ **-sn**\
+
+ Specify one or more service nodes on which bmcdiscover will run. In hierarchical cluster, the MN may not be able to access the BMC of CN directly, but SN can. With this option, bmcdiscover will be dispatched to the specified SNs. Then, the nodename of the service node that 'bmcdiscover' is running on will be set to the 'servicenode' attribute of the discovered BMC node.
+
+
+
\ **-s**\
Scan method (The only supported scan method at this time is \ **nmap**\ )
@@ -142,7 +148,7 @@ EXAMPLES
Note: Input for IP range can be in the form: scanme.nmap.org, microsoft.com/24, 192.168.0.1; 10.0.0-255.1-254.
-2. To get all BMSs in IP range "10.4.22-23.100-254", displayed in xCAT stanza format:
+2. To get all BMCs in IP range "10.4.22-23.100-254", displayed in xCAT stanza format:
.. code-block:: perl
@@ -150,7 +156,30 @@ Note: Input for IP range can be in the form: scanme.nmap.org, microsoft.com/24,
bmcdiscover -s nmap --range "10.4.22-23.100-254" -z
-3. Discover the BMCs and write the discovered-node definitions into the xCAT database and write out the stanza foramt to the console:
+3. To discover BMCs through sn01:
+
+
+.. code-block:: perl
+
+ bmcdiscover --sn sn01 -s nmap --range "10.4.22-23.100-254" -z
+
+
+Output is similar to:
+
+
+.. code-block:: perl
+
+ node-70e28414291b:
+ objtype=node
+ groups=all
+ bmc=10.4.22.101
+ cons=openbmc
+ mgt=openbmc
+ servicenode=sn01
+ conserver=sn01
+
+
+4. Discover the BMCs and write the discovered-node definitions into the xCAT database and write out the stanza foramt to the console:
.. code-block:: perl
@@ -158,7 +187,7 @@ Note: Input for IP range can be in the form: scanme.nmap.org, microsoft.com/24,
bmcdiscover -s nmap --range "10.4.22-23.100-254" -w -z
-4. To check if the username or password is correct against the BMC:
+5. To check if the username or password is correct against the BMC:
.. code-block:: perl
@@ -166,7 +195,7 @@ Note: Input for IP range can be in the form: scanme.nmap.org, microsoft.com/24,
bmcdiscover -i 10.4.23.254 -u USERID -p PASSW0RD --check
-5. Get BMC IP Address source, DHCP Address or static Address
+6. Get BMC IP Address source, DHCP Address or static Address
.. code-block:: perl
diff --git a/docs/source/guides/admin-guides/references/man1/nodediscoverls.1.rst b/docs/source/guides/admin-guides/references/man1/nodediscoverls.1.rst
index 8d1458b64..666477d78 100644
--- a/docs/source/guides/admin-guides/references/man1/nodediscoverls.1.rst
+++ b/docs/source/guides/admin-guides/references/man1/nodediscoverls.1.rst
@@ -19,7 +19,7 @@ SYNOPSIS
********
-\ **nodediscoverls**\ [\ **-t seq | profile | switch | blade | manual | undef | all**\ ] [\ **-l**\ ]
+\ **nodediscoverls**\ [\ **-t seq | profile | switch | blade | manual | mtms | undef | all**\ ] [\ **-l**\ ]
\ **nodediscoverls**\ [\ **-u**\ \ *uuid*\ ] [\ **-l**\ ]
@@ -47,7 +47,7 @@ OPTIONS
-\ **-t seq|profile|switch|blade|manual|undef|all**\
+\ **-t seq|profile|switch|blade|manual|mtms|undef|all**\
Display the nodes that have been discovered by the specified discovery method:
@@ -72,6 +72,10 @@ OPTIONS
+ \* \ **mtms**\ - MTMS discovery (used when node mtm and serial fields are filled in).
+
+
+
\* \ **undef**\ - Display the nodes that were in the discovery pool, but for which xCAT has not yet received a discovery request.
diff --git a/docs/source/guides/admin-guides/references/man1/rflash.1.rst b/docs/source/guides/admin-guides/references/man1/rflash.1.rst
index 84d176e49..12833968e 100644
--- a/docs/source/guides/admin-guides/references/man1/rflash.1.rst
+++ b/docs/source/guides/admin-guides/references/man1/rflash.1.rst
@@ -50,14 +50,20 @@ OpenPOWER BMC specific (using IPMI):
====================================
-\ **rflash**\ \ *noderange*\ [\ *hpm_file_path*\ | \ **-d=**\ \ *data_directory*\ ] [\ **-c | -**\ **-check**\ ] [\ **-**\ **-retry=**\ \ *count*\ ] [\ **-V**\ ]
+\ **rflash**\ \ *noderange*\ [\ *hpm_file_path*\ | \ **-d**\ \ *data_directory*\ ] [\ **-c | -**\ **-check**\ ] [\ **-**\ **-retry=**\ \ *count*\ ] [\ **-V**\ ]
+
+\ **rflash**\ \ *noderange*\ \ **-**\ **-recover**\ \ *bmc_file_path*\
OpenPOWER OpenBMC specific :
============================
-\ **rflash**\ \ *noderange*\ [\ *tar_file_path*\ | \ *image_id*\ ] [\ **-c | -**\ **-check**\ ] [\ **-a | -**\ **-activate**\ ] [\ **-l | -**\ **-list**\ ] [\ **-u | -**\ **-upload**\ ] [\ **-d | -**\ **-delete**\ ]
+\ **rflash**\ \ *noderange*\ {[\ **-c | -**\ **-check**\ ] | [\ **-l | -**\ **-list**\ ]}
+
+\ **rflash**\ \ *noderange*\ \ *tar_file_path*\ {[\ **-c | -**\ **-check**\ ] | [\ **-a | -**\ **-activate**\ ] | [\ **-u | -**\ **-upload**\ ]}
+
+\ **rflash**\ \ *noderange*\ \ *image_id*\ {[\ **-a | -**\ **-activate**\ ] | [\ **-d | -**\ **-delete**\ ]}
@@ -168,11 +174,11 @@ The command will update firmware for OpenPOWER OpenBMC when given an OpenPOWER n
\ **-d**\ \ *data_directory*\
+ PPC (without HMC, using Direct FSP Management) specific:
+
Specifies the directory where the raw data from rpm packages for each CEC/Frame are located. The default directory is /tmp. The option is only used in Direct FSP/BPA Management.
-
-
-\ **-d=**\ \ *data_directory*\
+ OpenPOWER BMC specific (using IPMI):
Used for IBM Power S822LC for Big Data systems only. Specifies the directory where the \ **pUpdate**\ utility and at least one of BMC or PNOR update files are located. The utility and update files can be downloaded from FixCentral.
@@ -192,8 +198,14 @@ The command will update firmware for OpenPOWER OpenBMC when given an OpenPOWER n
\ **-**\ **-recover**\
+ PPC (with HMC) and PPC (without HMC, using Direct FSP Management) specific:
+
Used to recover the flash image in the permanent side of the chip to the temporary side for both managed systems and power subsystems.
+ OpenPOWER BMC specific (using IPMI):
+
+ Used for IBM Power S822LC for Big Data systems only. Used to recover the BMC with a BMC image downloaded from FixCentral.
+
\ **-**\ **-retry=**\ \ *count*\
@@ -204,7 +216,7 @@ The command will update firmware for OpenPOWER OpenBMC when given an OpenPOWER n
\ **-a|-**\ **-activate**\
- Activate update image. Image id must be specified.
+ Activate update image. Image id or update file must be specified.
@@ -318,7 +330,17 @@ The command will update firmware for OpenPOWER OpenBMC when given an OpenPOWER n
.. code-block:: perl
- rflash briggs01 -d=/root/supermicro/OP825
+ rflash briggs01 -d /root/supermicro/OP825
+
+
+
+
+7. To update the firmware on the OpenBMC machine, specify the firmare update file to upload and activate:
+
+
+ .. code-block:: perl
+
+ rflash p9euh02 -a /tmp/witherspoon.pnor.squashfs.tar
diff --git a/docs/source/guides/admin-guides/references/man1/rsetboot.1.rst b/docs/source/guides/admin-guides/references/man1/rsetboot.1.rst
index 73f96eaf1..da5c3876e 100644
--- a/docs/source/guides/admin-guides/references/man1/rsetboot.1.rst
+++ b/docs/source/guides/admin-guides/references/man1/rsetboot.1.rst
@@ -11,7 +11,7 @@ SYNOPSIS
********
-\ **rsetboot**\ \ *noderange*\ {\ **hd | net | cd | default | stat**\ } [\ **-u**\ ] [\ **-p**\ ]
+\ **rsetboot**\ \ *noderange*\ [\ **hd | net | cd | default | stat**\ ] [\ **-u**\ ] [\ **-p**\ ]
\ **rsetboot**\ [\ **-h | -**\ **-help | -v | -**\ **-version**\ ]
@@ -21,7 +21,7 @@ DESCRIPTION
***********
-\ **rsetboot**\ sets the boot media and boot mode that should be used on the next boot of the specified nodes. After the nodes are booted with the specified device and boot mode (e.g. via rpower(1)|rpower.1), the nodes will return to using the default boot device specified in the BIOS. Currently this command is only supported for IPMI nodes.
+\ **rsetboot**\ sets the boot media and boot mode that should be used on the next boot of the specified nodes. After the nodes are booted with the specified device and boot mode (e.g. via rpower(1)|rpower.1), the nodes will return to using the default boot device specified in the BIOS.
*******
@@ -101,6 +101,14 @@ EXAMPLES
rsetboot node[14-56],node[70-203] stat
+ Or:
+
+
+ .. code-block:: perl
+
+ rsetboot node[14-56],node[70-203]
+
+
3.
diff --git a/docs/source/guides/admin-guides/references/man1/rspconfig.1.rst b/docs/source/guides/admin-guides/references/man1/rspconfig.1.rst
index c2a4d365c..038709fe0 100644
--- a/docs/source/guides/admin-guides/references/man1/rspconfig.1.rst
+++ b/docs/source/guides/admin-guides/references/man1/rspconfig.1.rst
@@ -47,7 +47,7 @@ OpenBMC specific:
=================
-\ **rspconfig**\ \ *noderange*\ {\ **ip | netmask | gateway | vlan | sshcfg**\ }
+\ **rspconfig**\ \ *noderange*\ {\ **ip | netmask | gateway | hostname | vlan | sshcfg**\ }
MPA specific:
@@ -394,6 +394,12 @@ OPTIONS
+\ **hostname**\
+
+ Get or set hostname on the service processor.
+
+
+
\ **vlan**\
Get or set vlan ID. For get vlan ID, if vlan is not enabled, 'BMC VLAN disabled' will be outputed. For set vlan ID, the valid value are [1-4096].
diff --git a/docs/source/guides/admin-guides/references/man1/switchdiscover.1.rst b/docs/source/guides/admin-guides/references/man1/switchdiscover.1.rst
index e84f3e74d..e219a5ea8 100644
--- a/docs/source/guides/admin-guides/references/man1/switchdiscover.1.rst
+++ b/docs/source/guides/admin-guides/references/man1/switchdiscover.1.rst
@@ -15,7 +15,7 @@ SYNOPSIS
\ **switchdiscover [-v| -**\ **-version]**\
-\ **switchdiscover**\ [\ *noderange*\ | \ **-**\ **-range**\ \ *ip_ranges*\ ] \ **[-V] [-w][-r|-x|-z][-s**\ \ *scan_methods*\ \ **-**\ **-setup**\ ]
+\ **switchdiscover**\ [\ *noderange*\ | \ **-**\ **-range**\ \ *ip_ranges*\ ] \ **[-V] [-w][-r|-x|-z][-s**\ \ *scan_methods*\ ] [\ **-**\ **-setup**\ ] [\ **-c**\ \ *community*\ ]
***********
@@ -31,7 +31,7 @@ To view all the switches defined in the xCAT database use \ **lsdef -w "nodetype
For lldp method, make sure that lldpd package is installed and lldpd is running on the xCAT management node. lldpd comes from xcat-dep package or you can get it from http://vincentbernat.github.io/lldpd/installation.html.
-For snmp method, make sure that snmpwalk command is installed and snmp is enabled for switches. To install snmpwalk, "yum install net-snmp-utils" for redhat and sles, "apt-get install snmp" for Ubuntu.
+For snmp method, make sure that snmpwalk command is installed and snmp is enabled for switches. To install snmpwalk, "yum install net-snmp-utils" for redhat and sles, "apt-get install snmp" for Ubuntu. The switchdiscover command only check the switches with default community string, if user already configured switch with other commmunity string, need to pass in with \ **-c**\ option for switchdiscover command to be able to discover.
*******
@@ -118,6 +118,12 @@ OPTIONS
+\ **-c**\
+
+ User defined community string for snmp scan.
+
+
+
************
RETURN VALUE
diff --git a/docs/source/guides/admin-guides/references/man5/nics.5.rst b/docs/source/guides/admin-guides/references/man5/nics.5.rst
index cf4aab58c..208523103 100644
--- a/docs/source/guides/admin-guides/references/man5/nics.5.rst
+++ b/docs/source/guides/admin-guides/references/man5/nics.5.rst
@@ -129,7 +129,7 @@ nics Attributes:
\ **nicsadapter**\
Comma-separated list of extra parameters that will be used for each NIC configuration.
- !|,!|, for example, eth0!MTU=1500|MTU=1460,ib0!MTU=65520 CONNECTED_MODE=yes.
+ !,!, for example, enP3p3s0f1!mac=98:be:94:59:fa:cd linkstate=DOWN,enP3p3s0f2!mac=98:be:94:59:fa:ce candidatename=enP3p3s0f2/enx98be9459face
diff --git a/docs/source/guides/admin-guides/references/man5/site.5.rst b/docs/source/guides/admin-guides/references/man5/site.5.rst
index 7fb2bf6cc..94259601d 100644
--- a/docs/source/guides/admin-guides/references/man5/site.5.rst
+++ b/docs/source/guides/admin-guides/references/man5/site.5.rst
@@ -390,6 +390,18 @@ site Attributes:
hierarchicalattrs: Table attributes(e.g. postscripts, postbootscripts) that will be
included hierarchically. Attribute values for all the node's groups
will be applied to the node in the groups' order except the repeat one.
+ dbtracelevel: The trace level for the database access log. To activate this setting, please.
+ restart xcatd or send HUP signal to the 'xcatd: DB Access' process, Like: .
+ ps -ef | grep 'xcatd: DB Access' | grep -v grep | awk '{print $2}' | xargs kill -HUP
+ Currrent support values:
+ 0: disable the trace log for db
+ 1: trace the calls of database subroutines
+ 2: Besides the log from level 1, trace the event to build the cache for the table
+ 3: Besides the log from level 2, trace the event with cache hit
+ 4: Besides the log from level 3, trace the SQL statement for the db access
+ With this configuration, xcat will send the log to syslog very frequently, some of the
+ log may be lost if imjournal is enabled by rsyslog.
+ Please see https://github.com/xcat2/xcat-core/issues/3910 for the detail.
-----------------------
VIRTUALIZATION ATTRIBUTES
diff --git a/docs/source/guides/admin-guides/references/man5/xcatdb.5.rst b/docs/source/guides/admin-guides/references/man5/xcatdb.5.rst
index e2cb86603..6fd7f9b94 100644
--- a/docs/source/guides/admin-guides/references/man5/xcatdb.5.rst
+++ b/docs/source/guides/admin-guides/references/man5/xcatdb.5.rst
@@ -166,6 +166,46 @@ As of xCAT 2.8.1, you can use a modified version of the regular expression suppo
http://xcat-docs.readthedocs.org/en/latest/guides/admin-guides/basic_concepts/xcat_db/regexp_db.html#easy-regular-expressions
+Regular Expression Helper Functions
+===================================
+
+
+xCAT provides several functions that can simplify regular expressions.
+
+
+\ **a2idx**\
+
+ ASCII Character to Index
+
+
+
+\ **a2zidx**\
+
+ ASCII Character to 0-Index
+
+
+
+\ **dim2idx**\
+
+ Dimensions to Index
+
+
+
+\ **skip**\
+
+ Skip indices
+
+
+
+\ **ipadd**\
+
+ Add to an IP address
+
+
+
+http://xcat-docs.readthedocs.org/en/latest/guides/admin-guides/basic_concepts/xcat_db/regexp_db.html#regular-expression-helper-functions
+
+
******************
OBJECT DEFINITIONS
diff --git a/docs/source/guides/admin-guides/references/man7/group.7.rst b/docs/source/guides/admin-guides/references/man7/group.7.rst
index 9a67dd224..a79e56ee8 100644
--- a/docs/source/guides/admin-guides/references/man7/group.7.rst
+++ b/docs/source/guides/admin-guides/references/man7/group.7.rst
@@ -41,7 +41,7 @@ group Attributes:
\ **addkcmdline**\ (bootparams.addkcmdline)
- User specified one or more parameters to be passed to the kernel. For the kernel options need to be persistent after installation, specify them with prefix "R::"
+ User specified kernel options for os provision process(no prefix) or the provisioned os(with prefix "R::"). The options should be delimited with spaces(" ")
@@ -669,7 +669,7 @@ group Attributes:
\ **nicsadapter**\ (nics.nicsadapter)
Comma-separated list of extra parameters that will be used for each NIC configuration.
- !|,!|, for example, eth0!MTU=1500|MTU=1460,ib0!MTU=65520 CONNECTED_MODE=yes.
+ !,!, for example, enP3p3s0f1!mac=98:be:94:59:fa:cd linkstate=DOWN,enP3p3s0f2!mac=98:be:94:59:fa:ce candidatename=enP3p3s0f2/enx98be9459face
diff --git a/docs/source/guides/admin-guides/references/man7/node.7.rst b/docs/source/guides/admin-guides/references/man7/node.7.rst
index 0ab71ac4d..fbf9ada59 100644
--- a/docs/source/guides/admin-guides/references/man7/node.7.rst
+++ b/docs/source/guides/admin-guides/references/man7/node.7.rst
@@ -41,7 +41,7 @@ node Attributes:
\ **addkcmdline**\ (bootparams.addkcmdline)
- User specified one or more parameters to be passed to the kernel. For the kernel options need to be persistent after installation, specify them with prefix "R::"
+ User specified kernel options for os provision process(no prefix) or the provisioned os(with prefix "R::"). The options should be delimited with spaces(" ")
@@ -669,7 +669,7 @@ node Attributes:
\ **nicsadapter**\ (nics.nicsadapter)
Comma-separated list of extra parameters that will be used for each NIC configuration.
- !|,!|, for example, eth0!MTU=1500|MTU=1460,ib0!MTU=65520 CONNECTED_MODE=yes.
+ !,!, for example, enP3p3s0f1!mac=98:be:94:59:fa:cd linkstate=DOWN,enP3p3s0f2!mac=98:be:94:59:fa:ce candidatename=enP3p3s0f2/enx98be9459face
diff --git a/docs/source/guides/admin-guides/references/man7/osimage.7.rst b/docs/source/guides/admin-guides/references/man7/osimage.7.rst
index c74014cf6..b4310d976 100644
--- a/docs/source/guides/admin-guides/references/man7/osimage.7.rst
+++ b/docs/source/guides/admin-guides/references/man7/osimage.7.rst
@@ -41,7 +41,7 @@ osimage Attributes:
\ **addkcmdline**\ (linuximage.addkcmdline)
- User specified arguments to be passed to the kernel. The user arguments are appended to xCAT.s default kernel arguments. For the kernel options need to be persistent after installation, specify them with prefix "R::". This attribute is ignored if linuximage.boottarget is set.
+ User specified kernel options for os provision process(no prefix) or the provisioned os(with prefix "R::"). The options should be delimited with spaces(" "). This attribute is ignored if linuximage.boottarget is set.
diff --git a/docs/source/overview/xcat2_release.rst b/docs/source/overview/xcat2_release.rst
index 2062b7c30..b3391d6b6 100644
--- a/docs/source/overview/xcat2_release.rst
+++ b/docs/source/overview/xcat2_release.rst
@@ -14,6 +14,84 @@ xCAT 2.13.x
|xCAT |New OS |New |New Feature |
|Version | |Hardware | |
+=================================+===============+=============+==================================+
+|| xCAT 2.13.7 | | |- OpenBMC support: |
+|| 2017/9/22 | | | |
+|| | | | rflash for OpenBMC and PNOR |
+| `2.13.7 Release Notes `_ | | | |
+| | | |- xcatprobe clusterstatus enhance |
+| | | | |
+| | | |- PDU support: discover, config |
+| | | | |
+| | | |- SRIOV support for VMs |
++---------------------------------+---------------+-------------+----------------------------------+
+|| xCAT 2.13.6 |- RHEL 7.4 |- Boston |- OpenBMC support |
+|| 2017/8/10 | | server | |
+|| | | | rsetboot net/hd/def |
+| `2.13.6 Release Notes `_ | | | /delete/check |
+| | | | |
+| | | | rspconfig retrieve OpenBMC ip/ |
+| | | | netmask/gateway information |
+| | | |- nodeset performance enhancement |
+| | | | (Phase 3) |
+| | | | |
+| | | | Dispatch request to the |
+| | | | specified service nodes with |
+| | | | 'disjointdhcps' |
+| | | | |
+| | | | Enhance the output of nodeset |
+| | | | in hierarchical cluster |
+| | | | |
+| | | |- network configuration interface:|
+| | | | |
+| | | | confignetwork is the only |
+| | | | interface to configure network |
+| | | | on SN/CN |
+| | | | |
+| | | |- For hardware discovery |
+| | | | |
+| | | | enhance bmcdiscover to use BMC |
+| | | | MAC address to identify BMC with|
+| | | | its host |
+| | | | |
+| | | | enhance "xcatprobe discovery" |
+| | | | tool to do configuration check |
+| | | | before starting hardware |
+| | | | discovery |
+| | | | |
+| | | |- [xcat-deps] xcat-genesis-base |
+| | | | package based on Fedora 26 ppc64|
++---------------------------------+---------------+-------------+----------------------------------+
+|| xCAT 2.13.5 | | |- OpenBMC support |
+|| 2017/6/30 | | | |
+|| | | | rinv |
+| `2.13.5 Release Notes `_ | | |- Enhancements to self testing |
+| | | | tool xcat-test |
+| | | |- Service node pool support for |
+| | | | rhels7 ppc64le diskless |
+| | | |- Mellanox cumulus switch ZTP |
+| | | | based discovery and |
+| | | | auto-configuration |
+| | | |- Performance enhancements |
+| | | | |
+| | | | makedhcp, makedns |
+| | | | nodeset |
+| | | |- [xcat-deps] ipmitool-xcat |
+| | | | package updated to version |
+| | | | 1.8.18 for |
+| | | | |
+| | | | RHEL7.x |
+| | | | SLES12.x |
+| | | | Ubuntu14.04.x |
+| | | |- [xcat-deps] conserver-xcat |
+| | | | package updated to version 8.2.1|
+| | | | |
++---------------------------------+---------------+-------------+----------------------------------+
|| xCAT 2.13.4 |- RHV 4.1 | |- OpenBMC support(experimental): |
|| 2017/5/19 | | | |
|| | | | rinv |
diff --git a/makerpm b/makerpm
index 4fc2bab20..b093e116d 100755
--- a/makerpm
+++ b/makerpm
@@ -145,6 +145,8 @@ function makexcat {
cp xcat.conf $RPMROOT/SOURCES
cp xcat.conf.apach24 $RPMROOT/SOURCES
cp xCATSN $RPMROOT/SOURCES
+ cp -a ../xCAT/etc/rsyslog.d $RPMROOT/
+ cp -a ../xCAT/etc/logrotate.d $RPMROOT/
cd - >/dev/null
elif [ "$RPMNAME" = "xCAT-buildkit" ]; then
ARCH="noarch"
diff --git a/perl-xCAT/db2man b/perl-xCAT/db2man
index da35965e9..ee73edc5e 100755
--- a/perl-xCAT/db2man
+++ b/perl-xCAT/db2man
@@ -271,6 +271,36 @@ As of xCAT 2.8.1, you can use a modified version of the regular expression suppo
http://xcat-docs.readthedocs.org/en/latest/guides/admin-guides/basic_concepts/xcat_db/regexp_db.html#easy-regular-expressions
+=head2 Regular Expression Helper Functions
+
+xCAT provides several functions that can simplify regular expressions.
+
+=over 4
+
+=item B
+
+ASCII Character to Index
+
+=item B
+
+ASCII Character to 0-Index
+
+=item B
+
+Dimensions to Index
+
+=item B
+
+Skip indices
+
+=item B
+
+Add to an IP address
+
+=back
+
+http://xcat-docs.readthedocs.org/en/latest/guides/admin-guides/basic_concepts/xcat_db/regexp_db.html#regular-expression-helper-functions
+
=head1 OBJECT DEFINITIONS
Because it can get confusing what attributes need to go in what tables, the xCAT database can also
diff --git a/perl-xCAT/xCAT/CFMUtils.pm b/perl-xCAT/xCAT/CFMUtils.pm
index e2563cfa4..d6a36c659 100644
--- a/perl-xCAT/xCAT/CFMUtils.pm
+++ b/perl-xCAT/xCAT/CFMUtils.pm
@@ -184,7 +184,7 @@ sub updateUserInfo {
# update the merge file
my $mergefile = $cfmdir . "/" . $file . ".merge";
- my @diff = xCAT::CFMUtils->arrayops("D", \@newrecords, \@oldrecords);
+ my @diff = xCAT::CFMUtils->arrayops("D", \@newrecords, \@oldrecords, 1);
# output the diff to merge files
my $fp;
@@ -865,6 +865,7 @@ sub trim {
$flag - "U"/"I"/"D"
\@array1 - reference to an arrary
\@array2 - reference to an arrary
+ $odered - flag to keep pervious order
Returns:
@union/@intersection/@difference
Globals:
@@ -878,7 +879,7 @@ sub trim {
#-----------------------------------------------------------------------------
sub arrayops {
- my ($class, $ops, $array1, $array2) = @_;
+ my ($class, $ops, $array1, $array2, $ordered) = @_;
my @union = ();
my @intersection = ();
@@ -886,21 +887,23 @@ sub arrayops {
my %count = ();
foreach my $element (@$array1, @$array2)
{
- $count{$element}++
+ $count{$element}++;
+ push @union, $element unless ( $count{$element} > 1 );
}
- foreach my $element (keys %count) {
- push @union, $element;
+ unless( defined($ordered) and $ordered ) {
+ @union = keys %count;
+ }
+
+ foreach my $element (@union) {
push @{ $count{$element} > 1 ? \@intersection : \@difference }, $element;
}
-
if ($ops eq "U") { return @union; }
if ($ops eq "I") { return @intersection; }
if ($ops eq "D") { return @difference; }
- #return (\@union, \@intersection, \@difference);
}
diff --git a/perl-xCAT/xCAT/MacMap.pm b/perl-xCAT/xCAT/MacMap.pm
index 426cf1619..7c3d8fe13 100644
--- a/perl-xCAT/xCAT/MacMap.pm
+++ b/perl-xCAT/xCAT/MacMap.pm
@@ -225,7 +225,7 @@ sub rvlan {
my $switchestab = xCAT::Table->new('switches', -create => 0);
my @switchesents;
if ($switchestab) {
- foreach (values %{ $switchestab->getNodesAttribs($switches, [qw(switch snmpversion username password privacy auth)]) }) {
+ foreach (values %{ $switchestab->getNodesAttribs($switches, [qw(switch snmpversion username password privacy auth switchtype)]) }) {
push @switchesents, @$_;
}
}
@@ -309,7 +309,7 @@ sub dump_mac_info {
}
}
my $switchestab = xCAT::Table->new('switches', -create => 0);
- my @switchesents = $switchestab->getAllNodeAttribs([qw(switch snmpversion username password privacy auth)]);
+ my @switchesents = $switchestab->getAllNodeAttribs([qw(switch snmpversion username password privacy auth switchtype)]);
$self->fill_switchparms(community => $community, switchesents => \@switchesents);
my $switchtab = xCAT::Table->new('switch', -create => 0);
my @entries = ();
@@ -337,7 +337,12 @@ sub dump_mac_info {
if ($self->{show_verbose_info}) {
xCAT::MsgUtils->message("I", { data => ["$switch: Attempting to refresh switch information..."] }, $self->{callback});
}
+ my $probestart = time;
$self->refresh_switch(undef, $community, $switch);
+ my $probestop = time;
+ my $probeduration = $probestop - $probestart;
+ xCAT::MsgUtils->message("S", "xcatprobe refresh_switch $switch ElapsedTime:$probeduration sec");
+
if ($self->{show_verbose_info}) {
xCAT::MsgUtils->message("I", { data => ["$switch: Finished refreshing switch information."] }, $self->{callback});
}
@@ -403,7 +408,13 @@ sub find_mac {
#If requesting a cache only check or the cache is a mere 20 seconds old
#don't bother querying switches
if ($cachedonly or ($self->{timestamp} > (time() - 20))) { return undef; }
+
+ my $runstart = time;
$self->refresh_table($discover_switch); #not cached or stale cache, refresh
+ my $runstop = time;
+ my $diffduration = $runstop - $runstart;
+ xCAT::MsgUtils->message("S", "refresh_table ElapsedTime:$diffduration sec");
+
if ($self->{mactable}->{ lc($mac) }) {
return $self->{mactable}->{ lc($mac) };
}
@@ -419,6 +430,7 @@ sub fill_switchparms {
foreach (@switchentries) {
my $curswitch = $_->{switch};
$self->{switchparmhash}->{$curswitch} = $_;
+ $self->{switchparmhash}->{$curswitch}->{switchtype}=$_->{switchtype};
if ($_->{snmpversion}) {
if ($_->{snmpversion} =~ /3/) { #clean up to accept things like v3 or ver3 or 3, whatever.
$self->{switchparmhash}->{$curswitch}->{snmpversion} = 3;
@@ -444,7 +456,7 @@ sub refresh_table {
$self->{mactable} = {};
$self->{switchtab} = xCAT::Table->new('switch', -create => 1);
$self->{switchestab} = xCAT::Table->new('switches', -create => 1);
- my @switchentries = $self->{switchestab}->getAllNodeAttribs([qw(switch snmpversion username password privacy auth)]);
+ my @switchentries = $self->{switchestab}->getAllNodeAttribs([qw(switch snmpversion username password privacy auth switchtype)]);
my $community = "public";
#$self->{sitetab} = xCAT::Table->new('site');
@@ -477,6 +489,9 @@ sub refresh_table {
unless (defined $_->{password}) { #if no password set, inherit the community
$self->{switchparmhash}->{$curswitch}->{password} = $community;
}
+ if (defined $_->{switchtype}){
+ $self->{switchparmhash}->{$curswitch}->{switchtype} =$_->{switchtype};
+ }
}
my %checked_pairs;
my @entries = $self->{switchtab}->getAllNodeAttribs([ 'node', 'port', 'switch' ]);
@@ -497,7 +512,7 @@ sub refresh_table {
my $ntype = $typehash->{$entry->{node}}->[0]->{nodetype};
if ( (($discover_switch) and ( $ntype ne "switch"))
or ( !($discover_switch) and ( $ntype eq "switch")) ){
- xCAT::MsgUtils->message("S", "refresh_table: skip $entry->{node} and $entry->{switch}");
+ xCAT::MsgUtils->message("S", "refresh_table: skip $entry->{node} and $entry->{switch}, $discover_switch , $ntype\n");
next;
}
if (defined($entry->{switch}) and $entry->{switch} ne "" and defined($entry->{port}) and $entry->{port} ne "") {
@@ -528,15 +543,28 @@ sub refresh_table {
pipe my $child, my $parent;
$child->autoflush(1);
$parent->autoflush(1);
+
$children++;
my $cpid = xCAT::Utils->xfork;
- unless (defined $cpid) { die "Cannot fork" }
+ unless (defined $cpid) {
+ $children--;
+ close($child);
+ close($parent);
+ xCAT::MsgUtils->message("S", "refresh_table: failed to fork refresh_switch process for $entry->{switch},skip...");
+ next;
+ }
if ($cpid == 0) {
+ $SIG{CHLD} = 'DEFAULT';
close($child);
+ my $runstart = time;
$self->refresh_switch($parent, $community, $entry->{switch});
+ my $runstop = time;
+ my $diffduration = $runstop - $runstart;
+ xCAT::MsgUtils->message("S", "refresh_switch $entry->{switch} ElapsedTime:$diffduration sec");
exit(0);
}
+
close($parent);
$inputs->add($child);
}
@@ -615,6 +643,9 @@ sub walkoid {
return $retmap;
}
+
+
+
sub getsnmpsession {
#gets an snmp v3 session appropriate for a switch using the switches table for guidance on the hows
@@ -688,7 +719,54 @@ sub refresh_switch {
my $community = shift;
my $switch = shift;
- #if ($error) { die $error; }
+ unless($self->{collect_mac_info})
+ {
+ if($self->{switchparmhash}->{$switch}->{switchtype} eq 'onie'){
+ #for cumulus switch, the MAC table can be retrieved with ssh
+ #which is much faster than snmp
+ my $mymac;
+ my $myport;
+
+ my @res=xCAT::Utils->runcmd("ssh -o StrictHostKeyChecking=no -o PasswordAuthentication=no $switch 'bridge fdb show|grep -i -v permanent|tr A-Z a-z 2>/dev/null' 2>/dev/null",-1);
+ if ($::RUNCMD_RC) {
+ xCAT::MsgUtils->message("S", "Failed to get mac table with ssh to $switch, fall back to snmp! To obtain mac table with ssh, please make sure the passwordless root ssh to $switch is available");
+ }else{
+ foreach (@res){
+ if($_ =~ m/^([0-9a-z]{2}:[0-9a-z]{2}:[0-9a-z]{2}:[0-9a-z]{2}:[0-9a-z]{2}:[0-9a-z]{2}) dev swp([0-9]+) .*/){
+ $mymac=$1;
+ $myport=$2;
+ $myport=sprintf("%d",$myport);
+
+ #try all the possible port number formats
+ #e.g, "5","swp5","05","swp05"
+ unless(exists $self->{switches}->{$switch}->{$myport}){
+ if(exists $self->{switches}->{$switch}->{"swp".$myport}){
+ $myport="swp".$myport;
+ }else{
+ $myport=sprintf("%02d",$myport);
+ unless(exists $self->{switches}->{$switch}->{$myport}){
+ if(exists $self->{switches}->{$switch}->{"swp".$myport}){
+ $myport="swp".$myport;
+ }else{
+ $myport="";
+ }
+ }
+ }
+ }
+
+ if($myport){
+ if($output){
+ printf $output "$mymac|%s\n", $self->{switches}->{$switch}->{$myport};
+ }
+ }
+ }
+
+ }
+ return;
+ }
+ }
+ }
+
my $session = $self->getsnmpsession('community' => $community, 'switch' => $switch);
unless ($session) {
xCAT::MsgUtils->message("S", "Failed to communicate with $switch");
@@ -734,6 +812,9 @@ sub refresh_switch {
xCAT::MsgUtils->message("I", "MTU information is not availabe for this switch $switch");
}
+ # get port state
+ my $mactostate = walkoid($session, '.1.3.6.1.2.1.17.7.1.2.2.1.3', silentfail => 1, verbose => $self->{show_verbose_info}, switch => $switch, callback => $self->{callback});
+
#Above is valid without community string indexing, on cisco, we need it on the next one and onward
my $iftovlanmap = walkoid($session, '.1.3.6.1.4.1.9.9.68.1.2.2.1.2', silentfail => 1, verbose => $self->{show_verbose_info}, switch => $switch, callback => $self->{callback}); #use cisco vlan membership mib to ascertain vlan
my $trunktovlanmap = walkoid($session, '.1.3.6.1.4.1.9.9.46.1.6.1.1.5', silentfail => 1, verbose => $self->{show_verbose_info}, switch => $switch, callback => $self->{callback}); #for trunk ports, we are interested in the native vlan, so we need cisco vtp mib too
@@ -762,6 +843,10 @@ sub refresh_switch {
$self->{nodeinfo}->{ $self->{switches}->{$switch}->{$portname} }->{vlans}->{$portname} = $trunktovlanmap->{$portid};
}
}
+ #still needs output if there are no switchport defined on the nodes
+ if (not defined $portname) {
+ $vlans_to_check{'NA'} = 1;
+ }
}
} else {
$vlans_to_check{'NA'} = 1;
@@ -784,9 +869,11 @@ sub refresh_switch {
my $bridgetoifmap = walkoid($session, '.1.3.6.1.2.1.17.1.4.1.2', ciscowarn => $iscisco, verbose => $self->{show_verbose_info}, switch => $switch, callback => $self->{callback}); # Good for all switches
if (not ref $bridgetoifmap or !keys %{$bridgetoifmap}) {
xCAT::MsgUtils->message("S", "Error communicating with " . $session->{DestHost} . ": failed to get a valid response to BRIDGE-MIB request");
+ if ($self->{collect_mac_info}) {
+ $self->{macinfo}->{$switch}->{ErrorStr} = "Failed to get a valid response to BRIDGE-MIB request";
+ }
return;
}
-
# my $mactoindexmap = walkoid($session,'.1.3.6.1.2.1.17.4.3.1.2');
my $mactoindexmap = walkoid($session, '.1.3.6.1.2.1.17.7.1.2.2.1.2', silentfail => 1, verbose => $self->{show_verbose_info}, switch => $switch, callback => $self->{callback});
unless (defined($mactoindexmap)) { #if no qbridge defined, try bridge mib, probably cisco
@@ -795,9 +882,26 @@ sub refresh_switch {
} #Ok, time to process the data
if (not ref $mactoindexmap or !keys %{$mactoindexmap}) {
xCAT::MsgUtils->message("S", "Error communicating with " . $session->{DestHost} . ": Unable to get MAC entries via either BRIDGE or Q-BRIDE MIB");
+ if ($self->{collect_mac_info}) {
+ $self->{macinfo}->{$switch}->{ErrorStr} = "Unable to get MAC entries via either BRIDGE or Q-BRIDE MIB";
+ }
return;
}
-
+ my $bridgeifvalid = 0;
+ foreach (keys %$mactoindexmap) {
+ my $index = $mactoindexmap->{$_};
+ if (defined($bridgetoifmap->{$index})) {
+ $bridgeifvalid = 1;
+ last;
+ }
+ }
+ unless ($bridgeifvalid) {
+ # create a dummy bridgetoifmap to cover switches that thing it should go straight to ifindex
+ $bridgetoifmap = {};
+ foreach (keys %$namemap) {
+ $bridgetoifmap->{$_} = $_;
+ }
+ }
if (defined($self->{collect_mac_info})) {
my %index_to_mac = ();
my %index_to_vlan = ();
@@ -807,8 +911,11 @@ sub refresh_switch {
my $vlan = @tmp[0];
my @mac = @tmp[ -6 .. -1 ];
my $macstring = sprintf("%02x:%02x:%02x:%02x:%02x:%02x", @mac);
- push @{ $index_to_mac{$index} }, $macstring;
- push @{ $index_to_vlan{$index} }, $vlan;
+ # Skip "permanent" ports
+ if (!defined($mactostate->{$_}) || $mactostate->{$_} != 4) {
+ push @{ $index_to_mac{$index} }, $macstring;
+ push @{ $index_to_vlan{$index} }, $vlan;
+ }
}
foreach my $boid (keys %$bridgetoifmap) {
my $port_index = $boid;
diff --git a/perl-xCAT/xCAT/NetworkUtils.pm b/perl-xCAT/xCAT/NetworkUtils.pm
index 9b65054a2..cb01ca93e 100755
--- a/perl-xCAT/xCAT/NetworkUtils.pm
+++ b/perl-xCAT/xCAT/NetworkUtils.pm
@@ -2778,4 +2778,35 @@ sub gen_net_boot_params
return $net_params;
}
+#--------------------------------------------------------------------------------
+=head3 send_tcp_msg
+ establish a tcp socket to the specified IP address and port, then send the specifid message via the socket
+ Arguments:
+ $destip : the destination IP address
+ $destport: the destination TCP port
+ $msg : the message to send
+ Returns:
+ 0 on success, 1 on fail
+=cut
+#--------------------------------------------------------------------------------
+sub send_tcp_msg {
+ my $self=shift;
+ my $destip=shift;
+ my $destport=shift;
+ my $msg=shift;
+
+ my $sock = new IO::Socket::INET(
+ PeerAddr => $destip,
+ PeerPort => $destport,
+ Timeout => '1',
+ Proto => 'tcp'
+ );
+ if ($sock) {
+ print $sock $msg;
+ close($sock);
+ return 0;
+ }else{
+ return 1;
+ }
+}
1;
diff --git a/perl-xCAT/xCAT/Schema.pm b/perl-xCAT/xCAT/Schema.pm
index fb822143b..f01edfd98 100755
--- a/perl-xCAT/xCAT/Schema.pm
+++ b/perl-xCAT/xCAT/Schema.pm
@@ -226,7 +226,7 @@ qq{ link,ro - The file is readonly, and will be placed in tmpfs on the booted no
'vncport' => 'Tracks the current VNC display port (currently not meant to be set',
'textconsole' => 'Tracks the Psuedo-TTY that maps to the serial port or console of a VM',
'powerstate' => "This flag is used by xCAT to track the last known power state of the VM.",
-'othersettings' => "This allows specifying a semicolon delimited list of key->value pairs to include in a vmx file of VMware or KVM. For partitioning on normal power machines, this option is used to specify the hugepage and/or bsr information, the value is like:'hugepage:1,bsr=2'. For KVM cpu pinning, this option is used to specify the physical cpu set on the host, the value is like:\"vcpupin:'0-15,^8'\",Its syntax is a comma separated list and a special markup using '-' and '^' (ex. '0-4', '0-3,^2') can also be allowed, the '-' denotes the range and the '^' denotes exclusive. For KVM memory binding, the value is like:'membind:0', restrict a guest to allocate memory from the specified set of NUMA nodes. For PCI passthrough, the value is like:'devpassthrough:pci_0001_01_00_0,pci_0000_03_00_0',the PCI devices are assigned to a virtual machine, and the virtual machine can use this I/O exclusively, the devices list are a list of PCI device names delimited with comma, the PCI device names can be obtained by running B on the host.",
+'othersettings' => "This allows specifying a semicolon delimited list of key->value pairs to include in a vmx file of VMware or KVM. For partitioning on normal power machines, this option is used to specify the hugepage and/or bsr information, the value is like:'hugepage:1,bsr=2'. For KVM cpu pinning, this option is used to specify the physical cpu set on the host, the value is like:\"vcpupin:'0-15,^8'\",Its syntax is a comma separated list and a special markup using '-' and '^' (ex. '0-4', '0-3,^2') can also be allowed, the '-' denotes the range and the '^' denotes exclusive. For KVM memory binding, the value is like:'membind:0', restrict a guest to allocate memory from the specified set of NUMA nodes. For PCI passthrough, the value is like:'devpassthrough:pci_0001_01_00_0,pci_0000_03_00_0', the value for PCI device format also can be like:'devpassthrough:0001:01:00.1', the PCI devices are assigned to a virtual machine, and the virtual machine can use this I/O exclusively, the devices list are a list of PCI device names delimited with comma, the PCI device names can be obtained by running B on the host.",
'guestostype' => "This allows administrator to specify an identifier for OS to pass through to virtualization stack. Normally this should be ignored as xCAT will translate from nodetype.os rather than requiring this field be used\n",
'beacon' => "This flag is used by xCAT to track the state of the identify LED with respect to the VM.",
'datacenter' => "Optionally specify a datacenter for the VM to exist in (only applicable to VMWare)",
@@ -1243,7 +1243,19 @@ passed as argument rather than by table value',
" Qualified Domain Name). Otherwise, the original behavior will be performed.\n\n" .
" hierarchicalattrs: Table attributes(e.g. postscripts, postbootscripts) that will be\n" .
" included hierarchically. Attribute values for all the node's groups\n" .
-" will be applied to the node in the groups' order except the repeat one.\n\n" .
+" will be applied to the node in the groups' order except the repeat one.\n" .
+" dbtracelevel: The trace level for the database access log. To activate this setting, please. \n".
+" restart xcatd or send HUP signal to the 'xcatd: DB Access' process, Like: .\n".
+" ps -ef | grep 'xcatd: DB Access' | grep -v grep | awk '{print \$2}' | xargs kill -HUP \n".
+" Currrent support values: \n" .
+" 0: disable the trace log for db \n" .
+" 1: trace the calls of database subroutines \n" .
+" 2: Besides the log from level 1, trace the event to build the cache for the table \n" .
+" 3: Besides the log from level 2, trace the event with cache hit \n" .
+" 4: Besides the log from level 3, trace the SQL statement for the db access \n" .
+" With this configuration, xcat will send the log to syslog very frequently, some of the \n".
+" log may be lost if imjournal is enabled by rsyslog. \n".
+" Please see https://github.com/xcat2/xcat-core/issues/3910 for the detail.\n\n" .
" -----------------------\n" .
"VIRTUALIZATION ATTRIBUTES\n" .
" -----------------------\n" .
@@ -1563,14 +1575,15 @@ zvmivp => {
If multiple ip addresses are associated with each NIC:
!|,!|,..., for example, eth0!-eth0|-eth0-ipv6,ib0!-ib0|-ib0-ipv6.
The xCAT object definition commands support to use nichostnamesuffixes. as the sub attributes.
- Note: According to DNS rules a hostname must be a text string up to 24 characters drawn from the alphabet (A-Z), digits (0-9), minus sign (-),and period (.). When you are specifying "nichostnamesuffixes" or "nicaliases" make sure the resulting hostnames will conform to this naming convention',
- nichostnameprefixes => 'Comma-separated list of hostname prefixes per NIC.
+
+ Note: According to DNS rules a hostname must be a text string up to 24 characters drawn from the alphabet (A-Z), digits (0-9) and minus sign (-). When you are specifying "nichostnamesuffixes" or "nicaliases" make sure the resulting hostnames will conform to this naming convention',
+ nichostnameprefixes => 'Comma-separated list of hostname prefixes per NIC.
If only one ip address is associated with each NIC:
!,!,..., for example, eth0!eth0-,ib0!ib-
If multiple ip addresses are associated with each NIC:
- !|,!|,..., for example, eth0!eth0-|eth0-ipv6i-,ib0!ib-|ib-ipv6-.
- The xCAT object definition commands support to use nichostnameprefixes. as the sub attributes.
- Note: According to DNS rules a hostname must be a text string up to 24 characters drawn from the alphabet (A-Z), digits (0-9), minus sign (-),and period (.). When you are specifying "nichostnameprefixes" or "nicaliases" make sure the resulting hostnames will conform to this naming convention',
+ !|,!|,..., for example, eth0!eth0-|eth0-ipv6i-,ib0!ib-|ib-ipv6-.
+ The xCAT object definition commands support to use nichostnameprefixes. as the sub attributes.
+ Note: According to DNS rules a hostname must be a text string up to 24 characters drawn from the alphabet (A-Z), digits (0-9) and minus sign (-). When you are specifying "nichostnameprefixes" or "nicaliases" make sure the resulting hostnames will conform to this naming convention',
nictypes => 'Comma-separated list of NIC types per NIC. !,!, e.g. eth0!Ethernet,ib0!Infiniband. The xCAT object definition commands support to use nictypes. as the sub attributes.',
niccustomscripts => 'Comma-separated list of custom scripts per NIC. !,!, e.g. eth0!configeth eth0, ib0!configib ib0. The xCAT object definition commands support to use niccustomscripts. as the sub attribute
.',
diff --git a/perl-xCAT/xCAT/Table.pm b/perl-xCAT/xCAT/Table.pm
index 508de47c7..b61786685 100644
--- a/perl-xCAT/xCAT/Table.pm
+++ b/perl-xCAT/xCAT/Table.pm
@@ -71,6 +71,9 @@ require xCAT::Schema;
require xCAT::NodeRange;
use Text::Balanced qw(extract_bracketed);
require xCAT::NotifHandler;
+use Time::HiRes qw/time/;
+use JSON;
+
#The process id of the database worker
# -1 db process has not been started, access db in direct access mode.
@@ -82,7 +85,19 @@ my $dbsockpath = "/var/run/xcat/dbworker.sock." . $$;
my $exitdbthread;
my $dbobjsforhandle;
my $intendedpid;
+my $dbtracelevel;
+my %elapsed;
+use constant BUILD_CACHE_TYPE => "build_cache";
+use constant CACHE_HIT_TYPE => "cache_hit";
+use constant START_TYPE => "start";
+use constant END_TYPE => "end";
+use constant START_SQL_TYPE => "start_sql";
+use constant END_SQL_TYPE => "end_sql";
+use constant INFO_TYPE => "info";
+
+my %trace_level_mapping = (START_TYPE() => 1, END_TYPE() => 1, BUILD_CACHE_TYPE() => 2,
+ CACHE_HIT_TYPE() => 3, START_SQL_TYPE() => 4, END_SQL_TYPE() => 4, INFO_TYPE() => 5);
sub dbc_call {
my $self = shift;
@@ -155,6 +170,99 @@ sub dbc_submit {
}
}
+
+#--------------------------------------------------------------------------------
+
+=head3 _trace_log
+
+ Private helper function to write log message in json format
+
+ Arguments:
+ $type: the type of the log content.
+ $msg: the message content
+ Returns:
+ none
+
+ Error:
+ none
+
+=cut
+
+#--------------------------------------------------------------------------------
+sub _trace_log
+{
+ my ($type, $msg) = @_;
+ if( $type eq START_TYPE || $type eq START_SQL_TYPE) {
+ $elapsed{$trace_level_mapping{$type}} = time();
+ }
+ my %hash = ("type" => $type, "msg" => $msg);
+ if($type eq END_TYPE || $type eq END_SQL_TYPE) {
+ if (!$elapsed{$trace_level_mapping{$type}}) {
+ return;
+ }
+ $hash{"elapsed"} = sprintf("%.5fs", time() - $elapsed{$trace_level_mapping{$type}});
+ }
+ xCAT::MsgUtils->message("S", "[DB Trace]: ".encode_json(\%hash));
+}
+
+
+#--------------------------------------------------------------------------------
+
+=head3 trace_db
+
+ Add log entries to trace db acccess
+
+ Arguments:
+ $type: the type of the log content. If it is "start", "start_sq"l, "end", "end_sql",
+ a timer will be used to help calculate the elapsed time. Note, "start" and "end"
+ or "start_sql" and "end_sql" must be used in pairs.
+ $addon: the addon message.
+ Returns:
+ none
+
+ Error:
+ none
+
+ Example:
+ $self->trace_db("start"); # timer started.
+ ......
+ $self->trace_db("end"); # print elapsed time.
+
+ $self->trace_db("start_sql"); # timer started.
+ ...... # statement to run the sql
+ $self->trace_db("end_sql"); # print elapsed time.
+
+=cut
+
+#--------------------------------------------------------------------------------
+sub trace_db {
+ my $self = shift;
+ my ($type, $addon) = @_;
+ if (!$dbtracelevel) {
+ return;
+ }
+ if($dbworkerpid > 0) {
+ return;
+ }
+ $type = INFO_TYPE if (!$type);
+ if (!exists($trace_level_mapping{$type})) {
+ xCAT::MsgUtils->message("S", "Unsupported db trace type $type");
+ return;
+ }
+ if (($trace_level_mapping{$type} == 1) && (caller(2))[3] ne "xCAT::Table::handle_dbc_request") {
+ # ignore internal calls
+ return;
+ }
+
+ if ($trace_level_mapping{$type} <= $dbtracelevel) {
+ my $msg;
+ $msg->{"table"} = $self->{tabname};
+ $msg->{"method"} = (caller(1))[3];
+ $msg->{"addon"} = $addon if $addon;
+ _trace_log($type, $msg);
+ }
+}
+
sub shut_dbworker {
$dbworkerpid = -1; #For now, just turn off usage of the db worker
#This was created as the monitoring framework shutdown code otherwise seems to have a race condition
@@ -188,6 +296,7 @@ sub init_dbworker {
}
unless ($dbworkerpid) {
$intendedpid = $$;
+ $dbtracelevel = xCAT::TableUtils->get_site_attribute("dbtracelevel");
$SIG{CHLD} = sub { while (waitpid(-1, WNOHANG) > 0) { } }; #avoid zombies from notification framework
#This process is the database worker, it's job is to manage database queries to reduce required handles and to permit cross-process caching
$0 = "xcatd: DB Access";
@@ -199,6 +308,13 @@ sub init_dbworker {
$SIG{ALRM} = sub { exit 0; };
alarm(10);
};
+ $SIG{HUP} = sub {
+ $dbtracelevel = xCAT::TableUtils->get_site_attribute("dbtracelevel");
+ xCAT::MsgUtils->message("S", "dbtracelevel has been reloaded, current value is $dbtracelevel");
+ foreach my $item ( keys %elapsed) {
+ $elapsed{$item} = undef;
+ }
+ };
unlink($dbsockpath);
umask(0077);
$dbworkersocket = IO::Socket::UNIX->new(Local => $dbsockpath, Type => SOCK_STREAM, Listen => 8192);
@@ -1453,8 +1569,10 @@ sub addAttribs
$qstring = $qstring . "?,";
}
$qstring =~ s/,$/)/;
+ $self->trace_db(START_SQL_TYPE, $qstring);
my $sth = $self->{dbh}->prepare($qstring);
$sth->execute(@bind);
+ $self->trace_db(END_SQL_TYPE);
#$self->{dbh}->commit;
@@ -1604,6 +1722,7 @@ sub setAttribs
if ($dbworkerpid > 0) {
return dbc_call($self, 'setAttribs', @_);
}
+ $self->trace_db(START_TYPE);
my $pKeypairs = shift;
my %keypairs = ();
if ($pKeypairs != undef) { %keypairs = %{$pKeypairs}; }
@@ -1646,8 +1765,10 @@ sub setAttribs
$qstring =~ s/ AND \z//;
#print "this is qstring1: $qstring\n";
+ $self->trace_db(START_SQL_TYPE, $qstring);
$query = $self->{dbh}->prepare($qstring);
$query->execute(@qargs);
+ $self->trace_db(END_SQL_TYPE);
#get the first row
$data = $query->fetchrow_arrayref();
@@ -1720,13 +1841,17 @@ sub setAttribs
}
}
$cmd =~ s/ AND \z//;
+ $self->trace_db(START_SQL_TYPE, $qstring);
my $sth = $self->{dbh}->prepare($cmd);
unless ($sth) {
+ $self->trace_db(END_TYPE, "LINE ".__LINE__.": Error attempting requested DB operation");
return (undef, "Error attempting requested DB operation");
}
my $err = $sth->execute(@bind);
+ $self->trace_db(END_SQL_TYPE);
if (not defined($err))
{
+ $self->trace_db(END_TYPE, "LINE ".__LINE__.": ".$sth->errstr);
return (undef, $sth->errstr);
}
$sth->finish;
@@ -1781,10 +1906,13 @@ sub setAttribs
$qstring = $qstring . "?,";
}
$qstring =~ s/,$/)/;
+ $self->trace_db(START_SQL_TYPE, $qstring);
my $sth = $self->{dbh}->prepare($qstring);
my $err = $sth->execute(@bind);
+ $self->trace_db(END_SQL_TYPE, $qstring);
if (not defined($err))
{
+ $self->trace_db(END_TYPE, "LINE ".__LINE__.": ". $sth->errstr);
return (undef, $sth->errstr);
}
$sth->finish;
@@ -1803,6 +1931,7 @@ sub setAttribs
xCAT::NotifHandler->notify($action, $self->{tabname},
\@notif_data, \%new_notif_data);
}
+ $self->trace_db(END_TYPE);
return 0;
}
@@ -1850,6 +1979,7 @@ sub setAttribsWhere
if ($dbworkerpid > 0) {
return dbc_call($self, 'setAttribsWhere', @_);
}
+ $self->trace_db(START_TYPE);
my $where_clause = shift;
my $elems = shift;
my $cols = "";
@@ -1864,8 +1994,10 @@ sub setAttribsWhere
}
my $qstring = "SELECT * FROM " . $self->{tabname} . " WHERE " . $where_clause;
my @qargs = ();
+ $self->trace_db(START_SQL_TYPE, $qstring);
my $query = $self->{dbh}->prepare($qstring);
$query->execute(@qargs);
+ $self->trace_db(END_SQL_TYPE);
#get the first row
my $data = $query->fetchrow_arrayref();
@@ -1903,10 +2035,13 @@ sub setAttribsWhere
}
chop($cols);
my $cmd = "UPDATE " . $self->{tabname} . " set $cols where " . $where_clause;
+ $self->trace_db(START_SQL_TYPE, $qstring);
my $sth = $self->{dbh}->prepare($cmd);
my $err = $sth->execute(@bind);
+ $self->trace_db(END_SQL_TYPE);
if (not defined($err))
{
+ $self->trace_db(END_TYPE, "LINE ".__LINE__.": ".$sth->errstr);
return (undef, $sth->errstr);
}
@@ -1923,6 +2058,7 @@ sub setAttribsWhere
\@notif_data, \%new_notif_data);
}
$sth->finish;
+ $self->trace_db(END_TYPE);
return 0;
}
@@ -1968,6 +2104,7 @@ sub setNodesAttribs {
if ($dbworkerpid > 0) {
return dbc_call($self, 'setNodesAttribs', @_);
}
+ $self->trace_db(START_TYPE);
my $nodelist = shift;
my $keyset = shift;
my %cols = ();
@@ -2025,6 +2162,7 @@ sub setNodesAttribs {
}
$self->{dbh}->commit; #commit pending transactions
$self->{dbh}->{AutoCommit} = $oldac; #restore autocommit semantics
+ $self->trace_db(END_TYPE);
return;
}
@@ -2066,8 +2204,10 @@ sub setNodesAttribs {
$qstring = "SELECT * FROM " . $self->{tabname} . " WHERE $dnodekey in (";
$qstring .= '?, ' x scalar(@currnodes);
$qstring =~ s/, $/)/;
+ $self->trace_db(START_SQL_TYPE, $qstring);
my $query = $self->{dbh}->prepare($qstring);
$query->execute(@currnodes);
+ $self->trace_db(END_SQL_TYPE);
my $rec;
while ($rec = $query->fetchrow_hashref()) {
$updatenodes{ $rec->{$nodekey} } = 1;
@@ -2093,7 +2233,7 @@ sub setNodesAttribs {
$bindhooks =~ s/, $//;
$columns =~ s/, $//;
my $instring = "INSERT INTO " . $self->{tabname} . " ($columns) VALUES ($bindhooks)";
-
+ $self->trace_db(START_SQL_TYPE, $instring);
#print $instring;
$insertsth = $self->{dbh}->prepare($instring);
}
@@ -2105,7 +2245,9 @@ sub setNodesAttribs {
foreach my $col (@orderedcols) {
push @args, $hashrec->{$node}->{$col};
}
+
$insertsth->execute(@args);
+ $self->trace_db(END_SQL_TYPE);
}
if (not $upsth and keys %updatenodes) { #prepare an insert statement since one will be needed
my $upstring = "UPDATE " . $self->{tabname} . " set ";
@@ -2127,7 +2269,9 @@ sub setNodesAttribs {
push @args, $hashrec->{$node}->{$col};
}
push @args, $node;
+ $self->trace_db(START_SQL_TYPE, $upstring);
$upsth->execute(@args);
+ $self->trace_db(END_SQL_TYPE);
}
}
@currnodes = splice(@$nodelist, 0, $nodesatatime);
@@ -2135,6 +2279,7 @@ sub setNodesAttribs {
$self->{dbh}->commit; #commit pending transactions
$self->{dbh}->{AutoCommit} = $oldac; #restore autocommit semantics
$self->_refresh_cache(); #cache is invalid, refresh
+ $self->trace_db(END_TYPE);
}
#--------------------------------------------------------------------------
@@ -2170,6 +2315,7 @@ sub getNodesAttribs {
if ($dbworkerpid > 0) {
return dbc_call($self, 'getNodesAttribs', @_);
}
+ $self->trace_db(START_TYPE);
my $nodelist = shift;
unless ($nodelist) { $nodelist = []; } #common to be invoked with undef seemingly
my %options = ();
@@ -2216,6 +2362,7 @@ sub getNodesAttribs {
if ($self->{tabname} ne 'nodelist') {
$self->{nodelist}->{_use_cache} = 0;
}
+ $self->trace_db(END_TYPE);
return $rethash;
}
@@ -2293,6 +2440,7 @@ sub _build_cache { #PRIVATE FUNCTION, PLEASE DON'T CALL DIRECTLY
unless (grep /^$nodekey$/, @$attriblist) {
push @$attriblist, $nodekey;
}
+ $self->trace_db(BUILD_CACHE_TYPE);
my @tabcache = $self->getAllAttribs(@$attriblist);
$self->{_tablecache} = \@tabcache;
$self->{_nodecache} = {};
@@ -2316,7 +2464,153 @@ sub mknum {
return $number;
}
+#--------------------------------------------------------------------------------
+
+=head3 a2idx
+ Description:
+ Turns a character into a 1-indexed index
+ Arguments:
+ character: The character to convert
+ Returns:
+ The index
+ Example:
+ a2zidx('a') returns 1
+ a2zidx('b') returns 2
+=cut
+
+#--------------------------------------------------------------------------------
+sub a2idx {
+ return ord(lc(shift)) - 96;
+}
+
+#--------------------------------------------------------------------------------
+
+=head3 a2zidx
+ Description:
+ Turns a character into a 0-indexed index
+ Arguments:
+ character: The character to convert
+ Returns:
+ The index
+ Example:
+ a2zidx('a') returns 0
+ a2zidx('b') returns 1
+=cut
+
+#--------------------------------------------------------------------------------
+sub a2zidx {
+ return ord(lc(shift)) - 97;
+}
+
+#--------------------------------------------------------------------------------
+
+=head3 dim2idx
+ Description:
+ Converts dimensions into an index
+ Arguments:
+ dim_value: the value of the current dimension
+ dim_total: the total number of elements in that dimension
+ Returns:
+ The index
+ Example:
+ A cluster has 4 rows
+ A row has 10 racks
+ A rack has 8 chassis
+ A chassis has 8 nodes
+
+ Row 2, rack 3, chassis 4, node 5
+ dim2idx(2, 10, 3, 8, 4, 8, 5) returns 797
+
+ Note the highest dimension is not needed and all values are 1-indexed
+=cut
+
+#--------------------------------------------------------------------------------
+sub dim2idx {
+ my $val = 0; # value to return
+ my $fn = 0; # math function to apply, 0 is add, 1 is multiply
+ while (defined(my $element = shift)) {
+ $val += $element - 1 if !$fn;
+ $val *= $element if $fn;
+ $fn = 1 - $fn;
+ }
+ return $val + 1;
+}
+
+#--------------------------------------------------------------------------------
+
+=head3 skip
+ Description:
+ Return an index with certain values skipped
+ Arguments:
+ index: The initial index
+ skips: Index values to skip
+ format start[:count][,start[:count]...]
+ Returns:
+ The updated index
+ Example:
+ skip(10, '3') returns 9
+ skip(10, '3:2') returns 8
+ skip(10, '3:2,6') returns 7
+=cut
+
+#--------------------------------------------------------------------------------
+sub skip {
+ my $idx = my $val = shift;
+ my $skips = shift;
+ foreach my $element (split /,/, $skips) {
+ my ($start, $count) = split /:/, $element;
+ $count = 1 if ! defined($count);
+ if ($idx >= $start) {
+ if ($idx < $start + $count) {return -1;}
+ $val-= $count;
+ } else {
+ last;
+ }
+ }
+ return $val;
+}
+
+#--------------------------------------------------------------------------------
+
+=head3 ipadd
+ Description:
+ Add to an IP address. Useful when you cross octets.
+ Optionally skip addresses at the start and end of octets (like .0 or .255).
+ Technically those are valid IP addresses, but sometimes software makes
+ poor assumptions about which broadcast and gateway addresses.
+ Arguments:
+ b1: Starting IP address first octet
+ b2: Starting IP address second octet
+ b3: Starting IP address third octet
+ b4: Starting IP address fourth octet
+ toadd: Value to add to the starting address
+ skipstart: Number of addresses to skip at the start of the last octet
+ skipend: Number of addresses to skip at the end of the last octet
+ Returns:
+ The new IP address
+ Example:
+ ipadd(10, 10, 10, 10, 0, 0, 0) returns 10.10.10.10
+ ipadd(10, 10, 10, 10, 10, 0, 0) returns 10.10.10.20
+ ipadd(10, 10, 10, 10, 245, 0, 0) returns 10.10.10.255
+ ipadd(10, 10, 10, 10, 246, 0, 0) returns 10.10.11.0
+=cut
+
+#--------------------------------------------------------------------------------
+sub ipadd {
+ use integer;
+ my ($b1, $b2, $b3, $b4, $toadd, $skipstart, $skipend) = @_;
+ my $offset = ($b4 >= $skipstart) ? $b4 - $skipstart : 0;
+ $b3 += ($offset + $toadd) / (256-$skipstart-$skipend);
+ $b4 = ($offset + $toadd) % (256-$skipstart-$skipend) + $skipstart;
+ return join('.', $b1, $b2, $b3, $b4);
+}
+
$evalcpt->share('&mknum');
+$evalcpt->share('&a2idx');
+$evalcpt->share('&a2zidx');
+$evalcpt->share('&dim2idx');
+$evalcpt->share('&skip');
+$evalcpt->share('&ipadd');
$evalcpt->permit('require');
#--------------------------------------------------------------------------
@@ -2443,6 +2737,7 @@ sub getNodeAttribs
#db worker scope
return dbc_call($self, 'getNodeAttribs', @_);
}
+ $self->trace_db(START_TYPE);
if (!defined($self->{dbh})) {
xCAT::MsgUtils->message("S", "xcatd: DBI is missing, Please check the db access process.");
@@ -2521,6 +2816,7 @@ sub getNodeAttribs
}
}
}
+ $self->trace_db(END_TYPE);
return wantarray ? @data : $data[0];
}
@@ -2862,7 +3158,6 @@ sub getNodeAttribs_nosub_returnany
}
}
}
-
return @results;
}
@@ -2901,6 +3196,7 @@ sub getAllEntries
if ($dbworkerpid > 0) {
return dbc_call($self, 'getAllEntries', @_);
}
+ $self->trace_db(START_TYPE);
if (!defined($self->{dbh})) {
xCAT::MsgUtils->message("S", "xcatd: DBI is missing, Please check the db access process.");
@@ -2915,12 +3211,15 @@ sub getAllEntries
my $disable = &delimitcol("disable");
if ($allentries) { # get all lines
$query = $self->{dbh}->prepare('SELECT * FROM ' . $self->{tabname});
+ $self->trace_db(START_SQL_TYPE, 'SELECT * FROM ' . $self->{tabname});
} else { # get only enabled lines
my $qstring = 'SELECT * FROM ' . $self->{tabname} . " WHERE " . $disable . " is NULL or " . $disable . " in ('0','no','NO','No','nO')";
$query = $self->{dbh}->prepare($qstring);
+ $self->trace_db(START_SQL_TYPE, $qstring);
}
$query->execute();
+ $self->trace_db(END_SQL_TYPE);
while (my $data = $query->fetchrow_hashref())
{
foreach (keys %$data)
@@ -2933,6 +3232,7 @@ sub getAllEntries
push @rets, $data;
}
$query->finish();
+ $self->trace_db(END_TYPE);
return \@rets;
}
@@ -2995,6 +3295,7 @@ sub getAllAttribsWhere
if ($dbworkerpid > 0) {
return dbc_call($self, 'getAllAttribsWhere', @_);
}
+ $self->trace_db(START_TYPE);
my $clause = shift;
my $whereclause;
my @attribs = @_;
@@ -3011,8 +3312,10 @@ sub getAllAttribsWhere
# delimit the disable column based on the DB
my $disable = &delimitcol("disable");
$query2 = 'SELECT * FROM ' . $self->{tabname} . ' WHERE (' . $whereclause . ") and ($disable is NULL or $disable in ('0','no','NO','No','nO'))";
+ $self->trace_db(START_SQL_TYPE, $query2);
$query = $self->{dbh}->prepare($query2);
$query->execute();
+ $self->trace_db(END_SQL_TYPE);
while (my $data = $query->fetchrow_hashref())
{
my %newrow = ();
@@ -3040,6 +3343,7 @@ sub getAllAttribsWhere
}
}
$query->finish();
+ $self->trace_db(END_TYPE);
return @results;
}
@@ -3078,6 +3382,7 @@ sub getAllNodeAttribs
if ($dbworkerpid > 0) {
return dbc_call($self, 'getAllNodeAttribs', @_);
}
+ $self->trace_db(START_TYPE);
my $attribq = shift;
my $hashretstyle = shift;
my %options = @_;
@@ -3098,8 +3403,10 @@ sub getAllNodeAttribs
my $qstring = 'SELECT ' . $dnodekey . ' FROM '
. $self->{tabname}
. " WHERE " . $disable . " is NULL or " . $disable . " in ('0','no','NO','No','nO')";
+ $self->trace_db(START_SQL_TYPE, $qstring);
$query = $self->{dbh}->prepare($qstring);
$query->execute();
+ $self->trace_db(END_SQL_TYPE);
xCAT::NodeRange::retain_cache(1);
unless ($options{prefetchcache}) {
@@ -3171,6 +3478,7 @@ sub getAllNodeAttribs
$self->{_use_cache} = 0;
$self->{nodelist}->{_use_cache} = 0;
$query->finish();
+ $self->trace_db(END_TYPE);
if ($hashretstyle) {
return $rethash;
} else {
@@ -3212,9 +3520,10 @@ sub getAllAttribs
if ($dbworkerpid > 0) {
return dbc_call($self, 'getAllAttribs', @_);
}
-
+ $self->trace_db(START_TYPE);
if (!defined($self->{dbh})) {
xCAT::MsgUtils->message("S", "xcatd: DBI is missing, Please check the db access process.");
+ $self->trace_db(END_TYPE, "LINE ".__LINE__.": DBI is missing");
return undef;
}
@@ -3244,8 +3553,10 @@ sub getAllAttribs
}
if (@results)
{
+ $self->trace_db(END_TYPE);
return @results; #return wantarray ? @results : $results[0];
}
+ $self->trace_db(END_TYPE);
return undef;
}
@@ -3254,10 +3565,12 @@ sub getAllAttribs
my $query;
my $qstring = "SELECT * FROM " . $self->{tabname}
. " WHERE " . $disable . " is NULL or " . $disable . " in ('0','no','NO','No','nO')";
+ $self->trace_db(START_SQL_TYPE, $qstring);
$query = $self->{dbh}->prepare($qstring);
#print $query;
$query->execute();
+ $self->trace_db(END_SQL_TYPE, $qstring);
while (my $data = $query->fetchrow_hashref())
{
my %newrow = ();
@@ -3274,6 +3587,7 @@ sub getAllAttribs
}
}
$query->finish();
+ $self->trace_db(END_TYPE);
return @results;
}
@@ -3317,6 +3631,7 @@ sub delEntries
if ($dbworkerpid > 0) {
return dbc_call($self, 'delEntries', @_);
}
+ $self->trace_db(START_TYPE);
my $keyref = shift;
my @all_keyparis;
my %keypairs;
@@ -3361,10 +3676,10 @@ sub delEntries
$qstring =~ s/\(\)//;
$qstring =~ s/ OR \z//;
-
+ $self->trace_db(START_SQL_TYPE, $qstring);
my $query = $self->{dbh}->prepare($qstring);
$query->execute(@qargs);
-
+ $self->trace_db(END_SQL_TYPE);
#prepare the notification data
#put the column names at the very front
push(@notif_data, $query->{NAME});
@@ -3399,8 +3714,10 @@ sub delEntries
}
$delstring =~ s/\(\)//;
$delstring =~ s/ OR \z//;
+ $self->trace_db(START_SQL_TYPE, $delstring);
my $stmt = $self->{dbh}->prepare($delstring);
$stmt->execute(@stargs);
+ $self->trace_db(END_SQL_TYPE);
$stmt->finish;
$self->_refresh_cache(); #cache is invalid, refresh
@@ -3411,7 +3728,7 @@ sub delEntries
}
@pieces = splice(@all_keyparis, 0, $record_num);
}
-
+ $self->trace_db(END_TYPE);
}
#--------------------------------------------------------------------------
@@ -3450,6 +3767,7 @@ sub getAttribs
if ($dbworkerpid > 0) {
return dbc_call($self, 'getAttribs', @_);
}
+ $self->trace_db(START_TYPE);
#my $key = shift;
#my $keyval = shift;
@@ -3510,8 +3828,11 @@ sub getAttribs
}
if (@results)
{
+ $self->trace_db(END_TYPE);
+ $self->trace_db(CACHE_HIT_TYPE);
return wantarray ? @results : $results[0];
}
+ $self->trace_db(END_TYPE);
return undef;
}
@@ -3544,11 +3865,14 @@ sub getAttribs
$statement .= "(" . $disable . " is NULL or " . $disable . " in ('0','no','NO','No','nO'))";
#print "This is my statement: $statement \n";
+ $self->trace_db(START_SQL_TYPE, $statement);
my $query = $self->{dbh}->prepare($statement);
unless (defined $query) {
+ $self->trace_db(END_TYPE, "LINE ".__LINE__.": undef");
return undef;
}
$query->execute(@exeargs);
+ $self->trace_db(END_SQL_TYPE);
my $data;
while ($data = $query->fetchrow_hashref())
{
@@ -3569,8 +3893,10 @@ sub getAttribs
$query->finish();
if (@return)
{
+ $self->trace_db(END_TYPE);
return wantarray ? @return : $return[0];
}
+ $self->trace_db(END_TYPE);
return undef;
}
@@ -3610,10 +3936,13 @@ sub getTable
if ($dbworkerpid > 0) {
return dbc_call($self, 'getTable', @_);
}
+ $self->trace_db(START_TYPE);
my @return;
my $statement = 'SELECT * FROM ' . $self->{tabname};
+ $self->trace_db(START_SQL_TYPE, $statement);
my $query = $self->{dbh}->prepare($statement);
$query->execute();
+ $self->trace_db(END_SQL_TYPE);
my $data;
while ($data = $query->fetchrow_hashref())
{
@@ -3631,8 +3960,10 @@ sub getTable
$query->finish();
if (@return)
{
+ $self->trace_db(END_TYPE);
return @return;
}
+ $self->trace_db(END_TYPE);
return undef;
}
@@ -4089,6 +4420,7 @@ sub writeAllEntries
if ($dbworkerpid > 0) {
return dbc_call($self, 'writeAllEntries', @_);
}
+ $self->trace_db(START_TYPE);
my $filename = shift;
my $fh;
my $rc = 0;
@@ -4097,6 +4429,7 @@ sub writeAllEntries
unless (open($fh, " > $filename")) {
my $msg = "Unable to open $filename for write \n.";
`logger -p local4.err -t xcat $msg`;
+ $self->trace_db(END_TYPE, "LINE ".__LINE__.": ".$msg);
return 1;
}
my $query;
@@ -4112,9 +4445,11 @@ sub writeAllEntries
# delimit the disable column based on the DB
my $disable = &delimitcol("disable");
+ $self->trace_db(START_SQL_TYPE, 'SELECT * FROM ' . $self->{tabname});
$query = $self->{dbh}->prepare('SELECT * FROM ' . $self->{tabname});
$query->execute();
+ $self->trace_db(END_SQL_TYPE);
while (my $data = $query->fetchrow_hashref())
{
foreach (keys %$data)
@@ -4128,6 +4463,7 @@ sub writeAllEntries
}
$query->finish();
CORE::close($fh);
+ $self->trace_db(END_TYPE);
return $rc;
}
@@ -4170,6 +4506,7 @@ sub writeAllAttribsWhere
if ($dbworkerpid > 0) {
return dbc_call($self, 'writeAllAttribsWhere', @_);
}
+ $self->trace_db(START_TYPE);
my $clause = shift;
my $filename = shift;
my $whereclause;
@@ -4184,6 +4521,7 @@ sub writeAllAttribsWhere
unless (open($fh, " > $filename")) {
my $msg = "Unable to open $filename for write \n.";
`logger -p local4.err -t xcat $msg`;
+ $self->trace_db(END_TYPE, "LINE ".__LINE__.": ".$msg);
return 1;
}
my $header;
@@ -4201,8 +4539,10 @@ sub writeAllAttribsWhere
# delimit the disable column based on the DB
my $disable = &delimitcol("disable");
$query2 = 'SELECT * FROM ' . $self->{tabname} . ' WHERE (' . $whereclause . ") and ($disable is NULL or $disable in ('0','no','NO','No','nO'))";
+ $self->trace_db(START_SQL_TYPE, $query2);
$query = $self->{dbh}->prepare($query2);
$query->execute();
+ $self->trace_db(END_SQL_TYPE);
while (my $data = $query->fetchrow_hashref())
{
foreach (keys %$data) {
@@ -4216,6 +4556,7 @@ sub writeAllAttribsWhere
}
$query->finish();
CORE::close($fh);
+ $self->trace_db(END_TYPE);
return $rc;
}
@@ -4291,6 +4632,7 @@ sub getMAXMINEntries
if ($dbworkerpid > 0) {
return dbc_call($self, 'getMAXMINEntries', @_);
}
+ $self->trace_db(START_TYPE);
my $attr = shift;
my $rets;
my $query;
@@ -4304,9 +4646,11 @@ sub getMAXMINEntries
} else {
$qstring = "SELECT MAX($attr) FROM " . $self->{tabname} . " WHERE " . $disable . " is NULL or " . $disable . " in ('0','no','NO','No','nO')";
}
+ $self->trace_db(START_SQL_TYPE, $qstring);
$query = $self->{dbh}->prepare($qstring);
$query->execute();
+ $self->trace_db(END_SQL_TYPE);
while (my $data = $query->fetchrow_hashref())
{
foreach (keys %$data)
@@ -4328,9 +4672,11 @@ sub getMAXMINEntries
} else {
$qstring = "SELECT MIN($attr) FROM " . $self->{tabname} . " WHERE " . $disable . " is NULL or " . $disable . " in ('0','no','NO','No','nO')";
}
+ $self->trace_db(START_SQL_TYPE, $qstring);
$query = $self->{dbh}->prepare($qstring);
$query->execute();
+ $self->trace_db(END_SQL_TYPE);
while (my $data = $query->fetchrow_hashref())
{
foreach (keys %$data)
@@ -4344,6 +4690,7 @@ sub getMAXMINEntries
last; # better be only one value for min
}
}
+ $self->trace_db(END_TYPE);
return $rets;
}
1;
diff --git a/perl-xCAT/xCAT/Usage.pm b/perl-xCAT/xCAT/Usage.pm
index b8978ee1e..8175f5522 100755
--- a/perl-xCAT/xCAT/Usage.pm
+++ b/perl-xCAT/xCAT/Usage.pm
@@ -85,7 +85,9 @@ my %usage = (
OpenPOWER (OpenBMC) specific:
rvitals noderange [temp|voltage|wattage|fanspeed|power|altitude|all]
MIC specific:
- rvitals noderange {thermal|all}",
+ rvitals noderange {thermal|all}
+ pdu specific:
+ rvitals noderange ",
"reventlog" =>
"Usage: reventlog [all [-s]|clear| [-s]] [-V|--verbose]
reventlog [-h|--help|-v|--version]",
@@ -143,7 +145,7 @@ my %usage = (
rspconfig [garp=]
rspconfig [userid= username= password=]
OpenBMC specific:
- rspconfig [ip|netmask|gateway|vlan]
+ rspconfig [ip|netmask|gateway|hostname|vlan]
iDataplex specific:
rspconfig [thermprofile]
rspconfig [thermprofile=]
@@ -329,7 +331,7 @@ my %usage = (
pdudiscover [|--range ipranges] [-r|-x|-z] [-w] [-V|--verbose] [--setup]",
"switchdiscover" =>
"Usage: switchdiscover [-h|--help|-v|--version]
- switchdiscover [|--range ipranges] [-s scan_methods] [-r|-x|-z] [-w] [-V|--verbose] [--setup]",
+ switchdiscover [|--range ipranges] [-s scan_methods] [-c community] [-r|-x|-z] [-w] [-V|--verbose] [--setup]",
"switchprobe" =>
"Usage: switchprobe [] [-V|--verbose | -c|--check]",
"makentp" =>
@@ -345,10 +347,13 @@ my %usage = (
rflash -p [--activate {disruptive|deferred}] [-d ]
rflash [--commit | --recover] [-V|--verbose]
rflash [--bpa_acdl]
- PPC64LE (using IPMI Management) specific:
- rflash [-c|--check] [--retry=] [-V] [|-d=]
- PPC64LE (using OpenBMC Management) specific:
- rflash [-c|--check] [-l|--list] [-a|--activate] [-u|--upload] [-d|--delete] [|]",
+ OpenPOWER BMC specific (using IPMI):
+ rflash [|-d ] [-c|--check] [--retry=] [-V]
+ rflash --recover
+ OpenPOWER OpenBMC specific:
+ rflash {[-c|--check] | [-l|--list]}
+ rflash {[-c|--check] | [-a|--activate] | [-u|--upload]}
+ rflash {[-a|--activate] | [-d|--delete]}",
"mkhwconn" =>
"Usage:
mkhwconn [-h|--help]
diff --git a/perl-xCAT/xCAT/Utils.pm b/perl-xCAT/xCAT/Utils.pm
index 29ea8a6f1..35b9abea2 100644
--- a/perl-xCAT/xCAT/Utils.pm
+++ b/perl-xCAT/xCAT/Utils.pm
@@ -19,6 +19,7 @@ use lib "$::XCATROOT/lib/perl";
# needing it to avoid reprocessing of user tables ( ExtTab.pm) for each command call
use POSIX qw(ceil);
use File::Path;
+#use Data::Dumper;
use Socket;
use strict;
use Symbol;
@@ -42,7 +43,6 @@ require xCAT::InstUtils;
#require xCAT::NetworkUtils;
require xCAT::Schema;
-#require Data::Dumper;
require xCAT::NodeRange;
require xCAT::Version;
require DBI;
@@ -575,6 +575,13 @@ sub isLinux
sub Version
{
my $version = shift;
+
+ #force reload the xCAT::Version in case the perl-xcat is upgraded but xcatd is not restarted
+ if($INC{'xCAT/Version.pm'}){
+ delete $INC{'xCAT/Version.pm'};
+ }
+
+ require xCAT::Version;
$version = xCAT::Version->Version();
return $version;
}
@@ -4911,4 +4918,5 @@ sub acquire_lock_imageop {
return (0,$lock);
}
+
1;
diff --git a/perl-xCAT/xCAT/data/switchinfo.pm b/perl-xCAT/xCAT/data/switchinfo.pm
index 79c36abfa..cf8f1af80 100644
--- a/perl-xCAT/xCAT/data/switchinfo.pm
+++ b/perl-xCAT/xCAT/data/switchinfo.pm
@@ -18,7 +18,10 @@ our %global_mac_identity = (
"fc:cf:62" => "BNT G8124 switch",
"7c:fe:90" => "Mellanox IB switch",
"cc:37:ab" => "Edgecore Networks Switch",
- "8c:ea:1b" => "Edgecore Networks Switch"
+ "8c:ea:1b" => "Edgecore Networks Switch",
+ "a8:2b:b5" => "Edgecore Networks Switch",
+ "3c:2c:99" => "Edgecore Networks Switch",
+ "70:72:cf" => "Edgecore Networks Switch"
);
#the hash to lookup switch type with vendor
diff --git a/xCAT-client/bin/pasu b/xCAT-client/bin/pasu
index 4139f00de..08b77e746 100755
--- a/xCAT-client/bin/pasu
+++ b/xCAT-client/bin/pasu
@@ -23,13 +23,24 @@ use Getopt::Long;
use POSIX qw(:signal_h :errno_h :sys_wait_h);
use Thread qw(yield);
+
+$::onecli = 0;
if ($iam =~ /pasu/) {
- $::utilcmd = '/opt/lenovo/toolscenter/asu/asu64';
+ $::utilcmd = '/opt/lenovo/onecli/asu';
+ $::onecli = 1;
+ if (!-x $::utilcmd) {
+ $::onecli = 0;
+ $::utilcmd = '/opt/lenovo/toolscenter/asu/asu64';
+ }
if (!-x $::utilcmd) {
$::utilcmd = '/opt/ibm/toolscenter/asu/asu64';
}
} elsif ($iam =~ /piflash/) {
- $::utilcmd = '/opt/xcat/sbin/iflash64 --unattended';
+ $::utilcmd = '/opt/lenovo/onecli/iflash64';
+ if (!-x $::utilcmd) {
+ $::utilcmd = '/opt/xcat/sbin/iflash64';
+ }
+ $::utilcmd .= ' --unattended'
}
my $interface;
my $username;
@@ -198,7 +209,17 @@ sub processoutput { #This way, one arbiter handles output, no interrupting
$line !~ /Licensed Materials - Property of Lenovo/i &&
$line !~ /\(C\) Copyright IBM Corp. \d+-\d+ All Rights Reserved/i &&
$line !~ /\(C\) Copyright Lenovo Corp. \d+-\d+ All Rights Reserved/i &&
- $line !~ /Connected to IMM at IP address/i)) {
+ $line !~ /Connected to IMM at IP address/i &&
+ $line !~ /Lenovo ASU/i &&
+ $line !~ /^\s*$/i &&
+ $line !~ /Lenovo ToolsCenterSuite CLI/i &&
+ $line !~ /Lenovo XClarity Essentials OneCLI/i &&
+ $line !~ /Invoking SHOW command .../i &&
+ $line !~ /Invoking SET command .../i &&
+ $line !~ /Connected to BMC by IP address/i &&
+ $line !~ /Succeeded running the command /i &&
+ $line !~ /Based on module version /i &&
+ $line !~ /Succeed running command /i)) {
print $nodehdl{$readyh} . ": " . $line . "\n";
}
}
@@ -225,6 +246,9 @@ sub utilnode {
} else {
foreach my $a (@_) { $args .= ' ' . xCAT::Utils->quote($a); }
}
+ if ($::onecli and $bmc =~ /:/) {
+ $bmc = "[$bmc]";
+ }
my $cmd = "$::utilcmd $args --host '$bmc' --user '$username' --password '$passwd' 2>&1 |";
if ($::VERBOSE) { print "forking $cmd\n"; }
my $pid = open($$out, $cmd);
diff --git a/xCAT-client/bin/rinstall b/xCAT-client/bin/rinstall
index 90cc60e12..2d68b3f37 100755
--- a/xCAT-client/bin/rinstall
+++ b/xCAT-client/bin/rinstall
@@ -21,7 +21,6 @@ use Getopt::Long;
use xCAT::MsgUtils;
use xCAT::Utils;
use xCAT::Client;
-use xCAT::NodeRange;
use Cwd;
use strict;
@@ -72,12 +71,6 @@ if(grep m/^-c|--console$/,@ARGV){
}
my $noderange = $cmdref->{noderange}->[0]; # save the noderange
-my @noderange=xCAT::NodeRange::noderange($noderange);
-
-if($bname eq "rinstall" and $startconsole==1 and scalar @noderange!=1 ){
- xCAT::MsgUtils->message("E", "Error: rinstall -c/--console can only be run against one node! Please use winstall -c/--console for multiple nodes.");
- exit 1;
-}
# Allow to print server information when -V/--verbose
foreach (reverse(@ARGV)) {
diff --git a/xCAT-client/bin/xcoll b/xCAT-client/bin/xcoll
index 03a14a0ef..ffe8005aa 100755
--- a/xCAT-client/bin/xcoll
+++ b/xCAT-client/bin/xcoll
@@ -8,6 +8,7 @@ use xCAT::Client;
use Getopt::Long;
use strict;
my %output;
+my %outputhdrs;
my $option;
my $printcount;
@@ -45,7 +46,7 @@ sub fillerup {
}
}
if ($individual) {
- foreach my $node (keys %output) {
+ foreach my $node (sort { $a <=> $b or $a cmp $b } keys %output) {
print "====================================\n";
print "$node\n";
print "====================================\n";
@@ -63,6 +64,11 @@ foreach my $output (keys %collated) {
unless ($option) {
xCAT::Client::submit_request($cmdref, \&fillerup);
}
+ $outputhdrs{$nodes} = $output;
+}
+foreach my $hdr (sort { $a <=> $b or $a cmp $b } keys %outputhdrs) {
+ $nodes = $hdr;
+ my $output = $outputhdrs{$hdr};
print "====================================\n";
print "$nodes\n";
print "====================================\n";
diff --git a/xCAT-client/pods/man1/bmcdiscover.1.pod b/xCAT-client/pods/man1/bmcdiscover.1.pod
index 2e967fab5..fc9ddfe5a 100644
--- a/xCAT-client/pods/man1/bmcdiscover.1.pod
+++ b/xCAT-client/pods/man1/bmcdiscover.1.pod
@@ -8,7 +8,7 @@ B [B<-?>|B<-h>|B<--help>]
B [B<-v>|B<--version>]
-B [B<-s> I] [B<-u> I] [B<-p> I] [B<-z>] [B<-w>] B<--range> I
+B [B<--sn> I] [B<-s> I] [B<-u> I] [B<-p> I] [B<-z>] [B<-w>] B<--range> I
B B<-u> I B<-p> I B<-i> I B<--check>
@@ -33,6 +33,10 @@ Note: The scan method currently support is B.
Specify one or more IP ranges acceptable to nmap. IP range can be hostnames, IP addresses, networks, etc. A single IP address (10.1.2.3) or an IP range (10.1.2.0/24) can be specified. If the range is very large, the B command may take a long time to return.
+=item B<--sn>
+
+Specify one or more service nodes on which bmcdiscover will run. In hierarchical cluster, the MN may not be able to access the BMC of CN directly, but SN can. With this option, bmcdiscover will be dispatched to the specified SNs. Then, the nodename of the service node that 'bmcdiscover' is running on will be set to the 'servicenode' attribute of the discovered BMC node.
+
=item B<-s>
Scan method (The only supported scan method at this time is B)
@@ -90,19 +94,34 @@ Display version information
Note: Input for IP range can be in the form: scanme.nmap.org, microsoft.com/24, 192.168.0.1; 10.0.0-255.1-254.
-2. To get all BMSs in IP range "10.4.22-23.100-254", displayed in xCAT stanza format:
+2. To get all BMCs in IP range "10.4.22-23.100-254", displayed in xCAT stanza format:
bmcdiscover -s nmap --range "10.4.22-23.100-254" -z
-3. Discover the BMCs and write the discovered-node definitions into the xCAT database and write out the stanza foramt to the console:
+3. To discover BMCs through sn01:
+
+ bmcdiscover --sn sn01 -s nmap --range "10.4.22-23.100-254" -z
+
+Output is similar to:
+
+ node-70e28414291b:
+ objtype=node
+ groups=all
+ bmc=10.4.22.101
+ cons=openbmc
+ mgt=openbmc
+ servicenode=sn01
+ conserver=sn01
+
+4. Discover the BMCs and write the discovered-node definitions into the xCAT database and write out the stanza foramt to the console:
bmcdiscover -s nmap --range "10.4.22-23.100-254" -w -z
-4. To check if the username or password is correct against the BMC:
+5. To check if the username or password is correct against the BMC:
bmcdiscover -i 10.4.23.254 -u USERID -p PASSW0RD --check
-5. Get BMC IP Address source, DHCP Address or static Address
+6. Get BMC IP Address source, DHCP Address or static Address
bmcdiscover -i 10.4.23.254 -u USERID -p PASSW0RD --ipsource
diff --git a/xCAT-client/pods/man1/rflash.1.pod b/xCAT-client/pods/man1/rflash.1.pod
index 70c964d15..ee2b29da1 100644
--- a/xCAT-client/pods/man1/rflash.1.pod
+++ b/xCAT-client/pods/man1/rflash.1.pod
@@ -24,11 +24,17 @@ B I I
=head2 OpenPOWER BMC specific (using IPMI):
-B I [I | B<-d=>I] [B<-c>|B<--check>] [B<--retry=>I] [B<-V>]
+B I [I | B<-d> I] [B<-c>|B<--check>] [B<--retry=>I] [B<-V>]
+
+B I B<--recover> I
=head2 OpenPOWER OpenBMC specific :
-B I [I | I] [B<-c>|B<--check>] [B<-a>|B<--activate>] [B<-l>|B<--list>] [B<-u>|B<--upload>] [B<-d>|B<--delete>]
+B I {[B<-c>|B<--check>] | [B<-l>|B<--list>]}
+
+B I I {[B<-c>|B<--check>] | [B<-a>|B<--activate>] | [B<-u>|B<--upload>]}
+
+B I I {[B<-a>|B<--activate>] | [B<-d>|B<--delete>]}
=head1 B
@@ -111,9 +117,11 @@ Specifies the directory where the packages are located.
=item B<-d> I
+PPC (without HMC, using Direct FSP Management) specific:
+
Specifies the directory where the raw data from rpm packages for each CEC/Frame are located. The default directory is /tmp. The option is only used in Direct FSP/BPA Management.
-=item B<-d=>I
+OpenPOWER BMC specific (using IPMI):
Used for IBM Power S822LC for Big Data systems only. Specifies the directory where the B utility and at least one of BMC or PNOR update files are located. The utility and update files can be downloaded from FixCentral.
@@ -127,15 +135,21 @@ Used to commit the flash image in the temporary side of the chip to the permanen
=item B<--recover>
+PPC (with HMC) and PPC (without HMC, using Direct FSP Management) specific:
+
Used to recover the flash image in the permanent side of the chip to the temporary side for both managed systems and power subsystems.
+OpenPOWER BMC specific (using IPMI):
+
+Used for IBM Power S822LC for Big Data systems only. Used to recover the BMC with a BMC image downloaded from FixCentral.
+
=item B<--retry=>I
Specify number of times to retry the update if failure is detected. Default value is 2. Value of 0 can be used to indicate no retries.
=item B<-a|--activate>
-Activate update image. Image id must be specified.
+Activate update image. Image id or update file must be specified.
=item B<-l|--list>
@@ -201,7 +215,12 @@ Print verbose message to rflash log file (/var/log/xcat/rflash/fs3.log) when upd
=item 6.
To update the firmware on IBM Power S822LC for Big Data machine specify the node name and the file path of the data directory containing pUpdate utility and BMC and/or PNOR update files:
- rflash briggs01 -d=/root/supermicro/OP825
+ rflash briggs01 -d /root/supermicro/OP825
+
+=item 7.
+To update the firmware on the OpenBMC machine, specify the firmare update file to upload and activate:
+
+ rflash p9euh02 -a /tmp/witherspoon.pnor.squashfs.tar
=back
diff --git a/xCAT-client/pods/man1/rsetboot.1.pod b/xCAT-client/pods/man1/rsetboot.1.pod
index c9e6b1fd6..75a2e9ef7 100644
--- a/xCAT-client/pods/man1/rsetboot.1.pod
+++ b/xCAT-client/pods/man1/rsetboot.1.pod
@@ -5,14 +5,14 @@ B - Sets the boot device to be used for BMC-based servers for the next
=head1 SYNOPSIS
-B I {B|B|B|B|B} [B<-u>] [B<-p>]
+B I [B|B|B|B|B] [B<-u>] [B<-p>]
B [B<-h>|B<--help>|B<-v>|B<--version>]
=head1 DESCRIPTION
-B sets the boot media and boot mode that should be used on the next boot of the specified nodes. After the nodes are booted with the specified device and boot mode (e.g. via L), the nodes will return to using the default boot device specified in the BIOS. Currently this command is only supported for IPMI nodes.
+B sets the boot media and boot mode that should be used on the next boot of the specified nodes. After the nodes are booted with the specified device and boot mode (e.g. via L), the nodes will return to using the default boot device specified in the BIOS.
=head1 OPTIONS
@@ -64,6 +64,10 @@ Display the next-boot value for nodes 14-56 and 70-203:
rsetboot node[14-56],node[70-203] stat
+Or:
+
+ rsetboot node[14-56],node[70-203]
+
=item 3.
Restore the next-boot value for these nodes back to their default set in the BIOS:
diff --git a/xCAT-client/pods/man1/rspconfig.1.pod b/xCAT-client/pods/man1/rspconfig.1.pod
index 972aa649b..3f88d1152 100644
--- a/xCAT-client/pods/man1/rspconfig.1.pod
+++ b/xCAT-client/pods/man1/rspconfig.1.pod
@@ -24,7 +24,7 @@ B I B=I