2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-09-06 10:18:20 +00:00

Merge tag '2.13.7' into lenovobuild2.13

xCAT 2.13.7 release
This commit is contained in:
Jarrod Johnson
2017-09-27 15:52:44 -04:00
275 changed files with 13912 additions and 3187 deletions

View File

@@ -1,49 +1,65 @@
Andy Wray <awray@lenovo.com>
Andy Wray <awray@lenovo.com> <andywray@8638fb3e-16cb-4fca-ae20-7b5d299a9bcd>
Arif Ali <mail@arif-ali.co.uk>
Arif Ali <mail@arif-ali.co.uk> <arifali@8638fb3e-16cb-4fca-ae20-7b5d299a9bcd>
Arif Ali <mail@arif-ali.co.uk> <arif-ali@users.noreply.github.com>
BAI Yuan <bybai@cn.ibm.com>
Bill Wajda <billwajda@hotmail.com> <billwajda@8638fb3e-16cb-4fca-ae20-7b5d299a9bcd>
Bill Wajda <billwajda@hotmail.com>
Brian Elliott Finley <brian@thefinleys.com> <brianfinley@8638fb3e-16cb-4fca-ae20-7b5d299a9bcd>
Brian Elliott Finley <brian@thefinleys.com>
Bruce Potter <bp@us.ibm.com>
CAO Li <caoli@8638fb3e-16cb-4fca-ae20-7b5d299a9bcd>
Bruce Potter <bp@us.ibm.com> <bp-sawyers@8638fb3e-16cb-4fca-ae20-7b5d299a9bcd>
CAO Li <caoli@8638fb3e-16cb-4fca-ae20-7b5d299a9bcd>
CAO Meng Meng <bjcaomm@cn.ibm.com>
CAO Meng Meng <caomengmeng@users.noreply.github.com>
CAO Meng Meng <caomengmeng_1011@sina.com>
CAO Meng Meng <bjcaomm@cn.ibm.com> <caomengmeng@users.noreply.github.com>
CAO Meng Meng <bjcaomm@cn.ibm.com> <caomengmeng_1011@sina.com>
Casandra Qiu <cxhong@us.ibm.com> <abcdqiu@gmail.com>
Casandra Qiu <cxhong@us.ibm.com>
CHENG Long <chenglch@cn.ibm.com>
CHU De Gao <degaochu@cn.ibm.com> <chudegao@8638fb3e-16cb-4fca-ae20-7b5d299a9bcd>
CHU De Gao <degaochu@cn.ibm.com>
CHU De Gao <degaochu@cn.ibm.com> <degaochu@ibm.com.cn>
Chuck Brazie <brazie@us.ibm.com>
Chuck Brazie <brazie@us.ibm.com> <chuckbrazie@users.noreply.github.com>
Chuck Brazie <brazie@us.ibm.com> <cbrazie@stny.rr.com>
GAO Feng <gfgaogf@cn.ibm.com>
GAO Ling <linggao@8638fb3e-16cb-4fca-ae20-7b5d299a9bcd>
GAO Ling <linggao@us.ibm.com> <linggao@8638fb3e-16cb-4fca-ae20-7b5d299a9bcd>
GAO Ling <linggao@us.ibm.com>
GONG Jie <gongjie@cn.ibm.com>
GONG Jie <gongjie@cn.ibm.com> <gongjie.jie@gmail.com>
GONG Jie <gongjie@cn.ibm.com> <gongjie@linux.vnet.ibm.com>
HU Wei Hua <huweihua@cn.ibm.com>
Jarrod Johnson <jarrod.b.johnson@gmail.com>
Jarrod Johnson <jbjohnso@us.ibm.com>
Jarrod Johnson <jjohnson2@buildabear.labs.lenovo.com>
Jarrod Johnson <jjohnson2@lenovo.com>
Jarrod Johnson <jarrod.b.johnson@gmail.com> <jbjohnso@us.ibm.com>
Jarrod Johnson <jarrod.b.johnson@gmail.com> <jjohnson2@buildabear.labs.lenovo.com>
Jarrod Johnson <jarrod.b.johnson@gmail.com> <jjohnson2@lenovo.com>
Jarrod Johnson <jarrod.b.johnson@gmail.com> <jbjohnso@8638fb3e-16cb-4fca-ae20-7b5d299a9bcd>
JIN Jie Hua <jinjhua@cn.ibm.com>
JIN Jie Hua <jjhua@8638fb3e-16cb-4fca-ae20-7b5d299a9bcd>
JIN Jie Hua <jinjhua@cn.ibm.com> <jjhua@8638fb3e-16cb-4fca-ae20-7b5d299a9bcd>
John Dunham <jdunham@us.ibm.com>
LI Guang Cheng <liguangc@cn.ibm.com>
LI Guang Cheng <liguangc@cn.ibm.com> <ligc@8638fb3e-16cb-4fca-ae20-7b5d299a9bcd>
LI Guang Cheng <liguangc@cn.ibm.com> <ligc@cn.ibm.com>
LI Ting Ting <litingt@cn.ibm.com>
Linda O. Mellor <mellor@8638fb3e-16cb-4fca-ae20-7b5d299a9bcd>
LI Ting Ting <litingt@cn.ibm.com> <root@c910f02c07p02.(none)>
Linda O. Mellor <mellor@us.ibm.com> <mellor@8638fb3e-16cb-4fca-ae20-7b5d299a9bcd>
Linda O. Mellor <mellor@us.ibm.com>
Lissa Valletta <lissav@8638fb3e-16cb-4fca-ae20-7b5d299a9bcd>
Lissa Valletta <lissav@us.ibm.com> <lissav@8638fb3e-16cb-4fca-ae20-7b5d299a9bcd>
Lissa Valletta <lissav@us.ibm.com>
Mark Gurevich <gurevich@us.ibm.com>
Mark Gurevich <gurevich@us.ibm.com> <gurevich@c910loginx01.(none)>
Norm Nott <nott@8638fb3e-16cb-4fca-ae20-7b5d299a9bcd>
Norm Nott <nott@us.ibm.com>
Norm Nott <nott@us.ibm.com> <nott@8638fb3e-16cb-4fca-ae20-7b5d299a9bcd>
Patrick Lundgren <plundgr@us.ibm.com>
Patrick Lundgren <plundgr@us.ibm.com> <pdlun92@gmail.com>
Patrick Lundgren <plundgr@us.ibm.com> <plundgr@c910loginx01.(none)>
SUN Jing <sjing@8638fb3e-16cb-4fca-ae20-7b5d299a9bcd>
SUN Jing <sjing@cn.ibm.com>
SUN Jing <sjing@cn.ibm.com> <sjing@8638fb3e-16cb-4fca-ae20-7b5d299a9bcd>
Victor Hu <vhu@us.ibm.com>
Victor Hu <vhu@us.ibm.com> <vhu@victorvm7.pok.ibm.com>
Victor Hu <vhu@us.ibm.com> <whowutwut@gmail.com>
WANG Hua Zhong <wanghuaz@8638fb3e-16cb-4fca-ae20-7b5d299a9bcd>
WANG Hua Zhong <wanghuaz@cn.ibm.com> <wanghuaz@8638fb3e-16cb-4fca-ae20-7b5d299a9bcd>
WANG Hua Zhong <wanghuaz@cn.ibm.com>
WANG Jun Xia <junxiaw@cn.ibm.com>
WANG Xiao Peng <wxp@cn.ibm.com>
@@ -62,7 +78,7 @@ YANG Song <yangsbj@cn.ibm.com>
YANG Song <yangsbj@cn.ibm.com> <immarvin@8638fb3e-16cb-4fca-ae20-7b5d299a9bcd>
YANG Song <yangsbj@cn.ibm.com> <immarvin@users.noreply.github.com>
YANG Song <yangsbj@cn.ibm.com> <yangsbj@cn.ibm.comq>
YIN Le <yinle@8638fb3e-16cb-4fca-ae20-7b5d299a9bcd>
YIN Le <yinle@cn.ibm.com> <yinle@8638fb3e-16cb-4fca-ae20-7b5d299a9bcd>
YIN Le <yinle@cn.ibm.com>
ZHAO Er Tao <ertaozh@cn.ibm.com>
ZHAO Er Tao <ertaozh@cn.ibm.com> <ertaozh@cn.ibm.comls>

30
.travis.yml Normal file
View File

@@ -0,0 +1,30 @@
os: linux
dist: trusty
sudo: required
before_install:
- sudo apt-get install -y git reprepro devscripts debhelper libsoap-lite-perl libdbi-perl quilt openssh-server dpkg looptools genometools software-properties-common
- perl -v
- echo "yes" | sudo cpan -f -i Capture::Tiny
script:
- echo $TRAVIS_BUILD_ID
- echo $TRAVIS_EVENT_TYPE
- echo $TRAVIS_BUILD_NUMBER
- echo $TRAVIS_BUILD_DIR
- echo $TRAVIS_COMMIT
- echo $TRAVIS_COMMIT_MESSAGE
- echo $TRAVIS_COMMIT_RANGE
- echo $TRAVIS_JOB_ID
- echo $TRAVIS_JOB_NUMBER
- echo $TRAVIS_BRANCH
- echo $TRAVIS_COMMIT_MESSAGE
- echo $USERNAME
- echo $PASSWORD
- echo $GITHUB_TOKEN
- git log --pretty=format:"%s %b" -2
#- perl travis.pl
- if [ $TRAVIS_EVENT_TYPE == "pull_request" ]; then perl ./travis.pl; fi

View File

@@ -8,7 +8,7 @@ Documentation
xCAT documentation is available at: http://xcat-docs.readthedocs.io/en/latest/
|docs_latest| |docs_2134| |docs_2133| |docs_2132| |docs_2131| |docs_2130| |docs_212|
|docs_latest| |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 <http://xcat-docs.readthedocs.io/en/latest/developers/>`_
In particular the `GitHub <http://xcat-docs.readthedocs.io/en/latest/developers/github/>`_ related subsection.
.. |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%
:target: http://xcat-docs.readthedocs.io/en/2.13.5/
.. |docs_2134| image:: https://readthedocs.org/projects/xcat-docs/badge/?version=2.13.4
:alt: 2.13.4 documentation status
:scale: 100%

View File

@@ -1 +1 @@
2.13.5
2.13.7

View File

@@ -22,6 +22,8 @@
# When you are ready to release this build, use PROMOTE=1 without PREGA
# BUILDALL=1 - build all rpms, whether they changed or not. Should be used for snap builds that are in
# prep for a release.
# GPGSIGN=0 - Do not sign the repo in the end of the build. The repo will be signed by default
#
# LOG=<filename> - provide an LOG file option to redirect some output into log file
#
# For the dependency packages 1. All the xcat dependency deb packages should be uploaded to
@@ -125,16 +127,20 @@ if [ ! -z ${LOG} ]; then
WGET_CMD="wget -o ${LOG}"
fi
#sync the gpg key to the build machine local
gsa_url=http://pokgsa.ibm.com/projects/x/xcat/build/linux
mkdir -p $HOME/.gnupg
for key_name in pubring.gpg secring.gpg trustdb.gpg; do
if [ ! -f $HOME/.gnupg/$key_name ] || [ `wc -c $HOME/.gnupg/$key_name|cut -f 1 -d' '` == 0 ]; then
rm -f $HOME/.gnupg/$key_name
${WGET_CMD} -P $HOME/.gnupg $gsa_url/keys/$key_name
chmod 600 $HOME/.gnupg/$key_name
fi
done
if [ "$GPGSIGN" = "0" ];then
echo "GPGSIGN=$GPGSIGN specified, skip gnupg key downloading"
else
#sync the gpg key to the build machine local
gsa_url=http://pokgsa.ibm.com/projects/x/xcat/build/linux
mkdir -p $HOME/.gnupg
for key_name in pubring.gpg secring.gpg trustdb.gpg; do
if [ ! -f $HOME/.gnupg/$key_name ] || [ `wc -c $HOME/.gnupg/$key_name|cut -f 1 -d' '` == 0 ]; then
rm -f $HOME/.gnupg/$key_name
${WGET_CMD} -P $HOME/.gnupg $gsa_url/keys/$key_name
chmod 600 $HOME/.gnupg/$key_name
fi
done
fi
if [ "$c_flag" ]
then
@@ -323,10 +329,16 @@ Codename: $dist
Architectures: $tmp_out_arch
Components: main
Description: Repository automatically genereted conf
SignWith: yes
__EOF__
done
if [ "$GPGSIGN" = "0" ];then
echo "GPGSIGN=$GPGSIGN specified, the repo will not be signed"
echo "" >> conf/distributions
else
echo "SignWith: yes" >> conf/distributions
echo "" >> conf/distributions
fi
done
cat << __EOF__ > conf/options
verbose
@@ -444,11 +456,20 @@ Codename: $dist
Architectures: $tmp_out_arch
Components: main
Description: Repository automatically genereted conf
SignWith: yes
__EOF__
if [ "$GPGSIGN" = "0" ];then
echo "GPGSIGN=$GPGSIGN specified, the repo will not be signed"
echo "" >> conf/distributions
else
echo "SignWith: yes" >> conf/distributions
echo "" >> conf/distributions
fi
done
cat << __EOF__ > conf/options
verbose
ask-passphrase
@@ -503,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

View File

@@ -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 *

View File

@@ -26,20 +26,14 @@ Red Hat Enterprise Linux
perl-DBD-MySQL*
mysql-server-5.*
mysql-5.*
mysql-devel-5.*
mysql-bench-5.*
mysql-connector-odbc-*
* MariaDB - Using ``yum``, ensure that the following packages are installed on the management node: ::
mariadb-devel-5.*
mariadb-libs-5.*
mariadb-server-5.*
mariadb-bench-5.*
mariadb-5.*
perl-DBD-MySQL*
mysql-connector-odbc-*
unixODBC*
Suse Linux Enterprise Server
----------------------------

View File

@@ -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

View File

@@ -0,0 +1,7 @@
Migrate xCat Management node
============================
.. toctree::
:maxdepth: 2
migration.rst

View File

@@ -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=/<customized_dir>/post/otherpkgs/rhels7.4/x86_64
pkgdir=/<customized_pkgdir>/rhels7.4/x86_64
pkglist=/<customized_pkglist_dir>/compute.rhels7.pkglist
template=/<customized_temp_dir>/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 <your_backup_dir>
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 <rpm_package_basename>`` 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 <cn1>
2.11 Restart ``conserver``, use ``rcons`` to check console: ::
service conserver restart
rcons <cn1>
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

View File

@@ -1,51 +1,42 @@
Predict network adapter name before deployment
Predict network adapter name during discovery
==============================================
Traditionally, network interfaces in Linux are enumerated as eth[0123…], but
these names do not correspond to actual labels on the chassis. Now, most of
the linux distribution support naming the adapter with slot information which
makes adapter name predictable. xCAT add ``getadapter`` script which can be
run during discovery stage to detect the adapter names and pci slot
information to help customer configure the network.
Traditionally, network interfaces in Linux are enumerated as eth[0123…], but these names do not necessarily correspond to actual labels on the chassis. customer need a methods to get consistent and predictable network device name before provision or network configuration. xCAT provide a tool ``getadapter`` to help customer to resolve this problem.
**[Note]** : This feature needs to restart your target sever which you want to obtain network adapter from.
How to use get adapters
How to use getadapter
-----------------------
Set the chian table to run ``getadapter`` script ::
Using below command to obtain the network adapters information ::
getadapter <noderange>
chdef <noderange> chain="runcmd=getadapter"
Then will get output like below ::
After the discovery completed, the column ``nicsadapter`` of ```nics`` table is
updated.
View result with ``lsdef`` command ::
The whole scan result:
--------------------------------------
[node2] scan successfully, below are the latest data
node2:[1]->eno1!mac=34:40:b5:be:6a:80|pci=/pci0000:00/0000:00:01.0/0000:0c:00.0|candidatename=eno1/enp12s0f0/enx3440b5be6a80
node2:[2]->enp0s29u1u1u5!mac=36:40:b5:bf:44:33|pci=/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.1/2-1.1.5/2-1.1.5:1.0|candidatename=enp0s29u1u1u5/enx3640b5bf4433
--------------------------------------
[node1] scan successfully, below are the latest data
node1:[1]->eno1!mac=34:40:b5:be:6a:80|pci=/pci0000:00/0000:00:01.0/0000:0c:00.0|candidatename=eno1/enp12s0f0/enx3440b5be6a80
node1:[2]->enp0s29u1u1u5!mac=36:40:b5:bf:44:33|pci=/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.1/2-1.1.5/2-1.1.5:1.0|candidatename=enp0s29u1u1u5/enx3640b5bf4433
# lsdef <node>
.......
nicsadapter.enP3p3s0f0=mac=98:be:94:59:fa:cc linkstate=DOWN pci=/pci0003:00/0003:00:00.0/0003:01:00.0/0003:02:01.0/0003:03:00.0 candidatename=enP3p3s0f0/enx98be9459facc
nicsadapter.enP3p3s0f1=mac=98:be:94:59:fa:cd linkstate=DOWN pci=/pci0003:00/0003:00:00.0/0003:01:00.0/0003:02:01.0/0003:03:00.1 candidatename=enP3p3s0f1/enx98be9459facd
nicsadapter.enP3p3s0f2=mac=98:be:94:59:fa:ce linkstate=DOWN pci=/pci0003:00/0003:00:00.0/0003:01:00.0/0003:02:01.0/0003:03:00.2 candidatename=enP3p3s0f2/enx98be9459face
nicsadapter.enP3p3s0f3=mac=98:be:94:59:fa:cf linkstate=UP pci=/pci0003:00/0003:00:00.0/0003:01:00.0/0003:02:01.0/0003:03:00.3 candidatename=enP3p3s0f3/enx98be9459facf
.......
Below are the information ``getadapter`` trying to inspect:
Every node gets a separate section to display its all network adapters information, every network adapter owns single line which start as node name and followed by index and other information.
* **name**: the real adapter name used by genesis operation system
xCAT try its best to collect more information for each network adapter, but cant guarantee collect same much information for every one. If a network adapter can be derived by xcat genesis, this adapter will have a predictable name, if it cant be, it only has the information xcat can obtain.
below are the possible information:
* **name**: the consistent name which can be used by confignic directly in operating system which follow the same naming scheme with rhels7
* **pci**: the pci location
* **pci**: the pci slot location
* **mac**: the MAC address
* **candidatename**: All the names which satisfy predictable network device naming scheme, if customer needs to customize their network adapter name, they can choose one of them. (``confignic`` needs to do more work to support this. if customer want to use their own name, xcat should offer a interface to get customers input and change this column)
* **candidatename**: All the names which satisfy predictable network device naming scheme, if customer needs to customize their network adapter name, they can choose one of them. (``confignetwork`` needs to do more work to support this. if customer want to use their own name, xcat should offer a interface to get customers input and change this column)
* **vendor**: the vender of network device
* **modle**: the modle of network device
* **linkstate**: The link state of network device
* **linkstate**: The link state of network device

View File

@@ -7,6 +7,7 @@ The Open Network Install Environment, or "ONIE" [1]_. is an open source project
:maxdepth: 2
os_cumulus/index.rst
os_cumulus/ztp.rst
.. [1] Open Network Install Environment: Created by Cumulus Networks, Inc. in 2012, the Open Network Install Environment (ONIE) Project is a small operating system, pre-installed as firmware on bare metal network switches, that provides an environment for automated operating system provisioning.

View File

@@ -0,0 +1,91 @@
Setup ONIE switches with ZTP in large cluster
=============================================
Zero Touch Provisioning (ZTP) is a feature shipped in many network devices to enable them to be quickly deployed in large-scale environments. In Cumulus OS on ONIE switches with ZTP enabled, the URL of an user provided script can be specified in the DHCP response for the DHCP request trigged by one of the following events:
* Booting the switch
* Plugging a cable into or unplugging it from the eth0 port
* Disconnecting then reconnecting the switch's power cord.
the script will be then downloaded and executed on the network device.
Leveraging the ZTP mechanism, xCAT provides the capability to setup ONIE switches from white-box without touching anything, including Cumulus OS installation, discovery and configuration. Please follow the steps below to setup ONIE switches in the cluster:
1. Ensure that xCAT is configured with an DHCP open range to detect when new switches request DHCP IPs
(1). Make sure the network in which the management interface of the ONIE switches are connected has been defined in ``networks`` table ::
# tabdump networks
#netname,net,mask,mgtifname,gateway,dhcpserver,tftpserver,nameservers,ntpservers,logservers,dynamicrange,staticrange,staticrangeincrement,nodehostname,ddnsdomain,vlanid,domain,mtu,comments,disable
"172_21_0_0-255_255_0_0","172.21.0.0","255.255.0.0","enP3p3s0d1","<xcatmaster>","172.21.253.27","172.21.253.27",,,,"172.21.253.100-172.21.253.200",,,,,,,,,
(2). Prepare the DHCP configuration for ONIE switches setup
Add the management node's NIC facing the ONIE switches' management interface to the ``site.dhcpinterfaces`` ::
chdef -t site -p dhcpinterfaces=enP3p3s0d1
Add dynamic range for the temporary IP addresses used in the OS provision and discovery of ONIE switches ::
chdef -t network 172_21_0_0-255_255_0_0 dynamicrange="172.21.253.100-172.21.253.200"
Update DHCP configuration file ::
makedhcp -n
2. Predefine ONIE switches according to the network plan ::
mkdef mid05tor10 --template onieswitch ip=172.21.205.10 switch=mgmtsw01 switchport=10
``ip`` is the IP address of the management interface of the ONIE switch
``switch`` is the core switch to which the management interface of ONIE switch is connected.
``switchport`` is the port on the core switch to which the management interface of ONIE switch is connected.
3. Add the predefined switches into ``/etc/hosts`` ::
makehosts mid05tor10
4. [If the Cumulus OS have been installed on the ONIE switches, please skip this step] Prepare the Cumulus installation image, ``/install/onie/onie-installer`` is the hard-coded path of the Cumulus installation image, or the link to the Cumulus installation image on the management node ::
mkdir -p /install/onie/
cp /install/custom/sw_os/cumulus/cumulus-linux-3.1.0-bcm-armel.bin /install/onie/
ln -s /install/onie/cumulus-linux-3.1.0-bcm-armel.bin /install/onie/onie-installer
5. Plug the ONIE switches into the cluster according to the network plan and power on them.
For the white-box ONIE switches, the Cumulus OS will be installed, then the switches will be discovered and configured automaticaly, the whole process will take about 1 hour.
For the ONIE switches already with Cumulus OS installed, please make sure the ZTP have been enabled and none of the following manual configuration have been made:
* Password changes
* Users and groups changes
* Packages changes
* Interfaces changes
* The presence of an installed license
Otherwise, please run ``ztp -R`` on the switches to reset the ZTP state before switch boot up for setup. The whole setup process will take about 1-2 minutes.
6. The switch definition in xCAT will be updated when the switch is configured ::
# lsdef mid05tor10
Object name: mid05tor10
arch=armv7l
groups=switch
ip=172.21.205.10
mac=xx:xx:xx:xx:xx:xx
mgt=switch
netboot=onie
nodetype=switch
postbootscripts=otherpkgs
postscripts=syslog,remoteshell,syncfiles
serial=11S01FT690YA50YD73EACH
status=configured
statustime=06-22-2017 23:14:14
supportedarchs=armv7l
switch=mgmtsw01
switchport=10
switchtype=Edgecore Networks Switch
``status=configured`` indicates that the switch has been discovered and configured.

View File

@@ -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.
@@ -95,7 +95,6 @@ exclude_patterns = ['guides/install-guides/common_sections.rst',
'**ppc64le/discovery/pbmc_discovery_with_bmcdiscover.rst',
'**ppc64le/discovery/pbmc_discovery_with_lsslp.rst',
'**ppc64le/discovery/schedule_environment.rst',
'**ppc64le/discovery/standard_cn_definition.rst',
'**ppc64le/diskless/customize_image/cfg_partition.rst',
'**ppc64le/diskless/customize_image/raid_cfg.rst',
#'**chain/create_image_for_runimage.rst'

View File

@@ -1,10 +0,0 @@
Advanced Networking Configuration - confignetwork
=================================================
**Note:** ``confignetwork`` postscript is only supported on RHEL releases.
.. toctree::
:maxdepth: 2
.. include:: ../../../common/deployment/cfg_network_vlan.rst
.. include:: ../../../common/deployment/cfg_network_bond.rst

View File

@@ -1,58 +0,0 @@
Configure Two Bonded Adapters
-----------------------------
The following example set the xCAT properties for compute node ``cn1`` to create:
* Compute node ``cn1`` has two physical NICs: eth2 and eth3
* Bond eth2 and eth3 as ``bond0``
* Assign ip ``40.0.0.1`` to the bonded interface ``bond0``
Define attributes in the ``nics`` table
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#. Using the ``mkdef`` or ``chdef`` commands
a. Compute node ``cn1`` has two physical NICs: ``eth2`` and ``eth3`` ::
chdef cn1 nictypes.eth2=ethernet nictypes.eth3=ethernet
b. Define ``bond0`` and bond ``eth2`` and ``eth3`` as ``bond0`` ::
chdef cn1 nictypes.bond0=bond nicdevices.bond0="eth2|eth3"
chdef cn1 nicips.bond0=40.0.0.1
Add network object into the networks table
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Use the ``chdef`` command to add/modify the networks in the ``networks`` table ::
chdef -t network net40 net=40.0.0.0 mask=255.0.0.0
chdef cn1 nicnetworks.bond0=net40
Add ``confignetwork`` into the node's postscripts list
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Use command below to add ``confignetwork`` into the node's postscripts list ::
chdef cn1 -p postscripts=confignetwork
During OS deployment on compute node, ``confignetwork`` postscript will be executed.
If the compute node is already running, use ``updatenode`` command to run ``confignetwork`` postscript without rebooting the node::
updatenode cn1 -P confignetwork
Verify bonding mode
~~~~~~~~~~~~~~~~~~~
Login to compute node cn1 and check bonding options in ``/etc/sysconfig/network-scripts/ifcfg-bond0`` file ::
BONDING_OPTS="mode=802.3ad xmit_hash_policy=layer2+3"
* ``mode=802.3ad`` requires additional configuration on the switch.
* ``mode=2`` can be used for bonding without additional switch configuration.
If changes are made to ``/etc/sysconfig/network-scripts/ifcfg-bond0`` file, restart network service.

View File

@@ -1,109 +0,0 @@
Configure BOND, VLAN and BRIDGES
--------------------------------
The ``confignetwork`` postscript can be used to configure the network interfaces on the compute nodes to support VLAN, BONDs, and BRIDGES. In order for the ``confignetwork`` postscript to run successfully, the following attributes must be configured for the node in the ``nics`` table:
* ``nicips``
* ``nictypes``
* ``nicnetworks``
* ``nicdevices`` - resolves the relationship among the physical network interface devices
The following example set the xCAT properties for compute node ``cn1`` to achieve the following network configuration using the ``confignetwork`` postscript:
* Compute node ``cn1`` has two physical NICs: ``eth2`` and ``eth3``
* Bond ``eth2`` and ``eth3`` as ``bond0``
* From ``bond0``, create 2 VLANs: ``bond0.1`` and ``bond0.2``
* Make bridge ``br1`` using ``bond0.1`` with IP (10.0.0.1)
* Make bridge ``br2`` using ``bond0.2`` with IP (20.0.0.1)
Define attributes in the ``nics`` table
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Chose one of two methods described below:
#. Using the ``mkdef`` or ``chdef`` commands
a. Compute node ``cn1`` has two physical NICs: ``eth2`` and ``eth3`` ::
chdef cn1 nictypes.eth2=ethernet nictypes.eth3=ethernet
b. Define ``bond0`` and bond ``eth2`` and ``eth3`` as ``bond0`` ::
chdef cn1 nictypes.bond0=bond \
nicdevices.bond0="eth2|eth3"
c. From ``bond0``, create 2 VLANs: ``bond0.1`` and ``bond0.2`` ::
chdef cn1 nictypes.bond0.1=vlan \
nictypes.bond0.2=vlan \
nicdevices.bond0.1=bond0 \
nicdevices.bond0.2=bond0
d. Create bridge ``br1`` using ``bond0.1`` with IP (10.0.0.1) ::
chdef cn1 nictypes.br1=bridge \
nicdevices.br1=bond0.1 \
nicips.br1=10.0.0.1 \
nicnetworks.br1="net10"
e. Create bridge ``br2`` using ``bond0.2`` with IP (20.0.0.1) ::
chdef cn1 nictypes.br2=bridge \
nicdevices.br2=bond0.2 \
nicips.br2=20.0.0.1 \
nicnetworks.br2="net20"
#. Using an xCAT stanza file
- Prepare a stanza file ``<filename>.stanza`` with content similiar to the following: ::
# <xCAT data object stanza file>
cn1:
objtype=node
arch=x86_64
groups=kvm,vm,all
nicdevices.br1=bond0.1
nicdevices.br2=bond0.2
nicdevices.bond0.1=bond0
nicdevices.bond0.2=bond0
nicdevices.bond0=eth2|eth3
nictypes.eth2=ethernet
nictypes.eth3=ethernet
nictypes.bond0=bond
nictypes.bond0.1=vlan
nictypes.bond0.2=vlan
nictypes.br1=bridge
nictypes.br2=bridge
nicips.br1=10.0.0.1
nicips.br2=20.0.0.1
nicnetworks.br1=net10
nicnetworks.br2=net20
- Using the ``mkdef -z`` option, define the stanza file to xCAT: ::
cat <filename>.stanza | mkdef -z
Define the additional networks to xCAT
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If this is a new network being created on the compute nodes, an entry needs to be created into the xCAT database.
The ``nicnetworks`` attribute only defines the nic that uses the IP address.
Other information about the network should be defined in the ``networks`` table.
Use the ``chdef`` command to add/modify the networks in the ``networks`` table ::
chdef -t network net10 net=10.0.0.0 mask=255.0.0.0
chdef -t network net20 net=20.0.0.0 mask=255.0.0.0
Add ``confignetwork`` into the node's postscripts list
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Use the following command to add ``confignetwork`` into postscript list to execute on reboot: ::
chdef cn1 -p postscripts=confignetwork
If the compute node is already running, use ``updatenode`` command to run ``confignetwork`` postscript without rebooting the node::
updatenode cn1 -P confignetwork

View File

@@ -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 ``<startpoint>-<endpoint>`` or ``<percentage of the disk>``. 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

View File

@@ -0,0 +1,63 @@
Configure Aliases
-----------------
The following example sets the xCAT properties for compute node ``cn1`` to create:
* Compute node ``cn1`` with one physical NIC: ``eth2``
* User wants to configure aliases ``aliases1-1`` and ``aliases1-2``
* Assign ip ``11.1.0.100`` to ``aliases1-1`` and ``12.1.0.100`` to ``aliases1-2``
Add network object into the networks table
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Add/modify the networks in the ``networks`` table ::
chdef -t network -o 11_1_0_0-255_255_0_0 net=11.1.0.0 mask=255.255.0.0
chdef -t network -o 12_1_0_0-255_255_0_0 net=12.1.0.0 mask=255.255.0.0
Define attributes in the ``nics`` table
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#. Compute node ``cn1`` has one physical NICs: ``eth2`` ::
chdef cn1 nictypes.eth2=ethernet
#. Define ``nicips``, ``nicaliases``, ``nichostnamesuffixes`` ::
chdef cn1 nicips.eth2="11.1.0.100|12.1.0.100" nicaliases.eth2="aliases1-1|aliases1-2" nichostnamesuffixes.eth2="-eth2|-eth2-1"
#. Define ``nicnetworks`` ::
chdef cn1 nicnetworks.eth2="11_1_0_0-255_255_0_0|12_1_0_0-255_255_0_0"
Update /etc/hosts
~~~~~~~~~~~~~~~~~
#. Update the ``/etc/hosts`` file ::
makehosts cn1
#. Check the ``/etc/hosts`` file ::
11.1.0.100 cn1-eth2 cn1-eth2.cluster.com aliases1-1
12.1.0.100 cn1-eth2-1 cn1-eth2-1.cluster.com aliases1-2
Enable ``confignetwork`` to configure aliases
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#. Add ``confignetwork`` into the node's postscripts list, ``confignetwork`` will be executed during OS deployment on compute node ::
chdef cn1 -p postscripts=confignetwork
#. Or if the compute node is already running, use ``updatenode`` command to run ``confignetwork`` postscript ::
updatenode cn1 -P confignetwork
Check the result
~~~~~~~~~~~~~~~~
Check if eth2 is configured correctly ::
xdsh cn1 "ip addr show eth2"

View File

@@ -0,0 +1,53 @@
Configure Bond using two Ethernet Adapters
------------------------------------------
The following example sets the xCAT properties for compute node ``cn1`` to create:
* Compute node ``cn1`` with two physical NICs: ``eth2`` and ``eth3``
* Bond eth2 and eth3 as ``bond0``
* Assign ip ``40.0.0.1`` to the bonded interface ``bond0``
Add network object into the networks table
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Add the network ``net40`` in the ``networks`` table ::
chdef -t network net40 net=40.0.0.0 mask=255.0.0.0
Define attributes in the ``nics`` table
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#. Compute node ``cn1`` has two physical NICs: ``eth2`` and ``eth3`` ::
chdef cn1 nictypes.eth2=ethernet nictypes.eth3=ethernet
#. Define ``bond0`` and bond ``eth2`` and ``eth3`` as ``bond0`` ::
chdef cn1 nictypes.bond0=bond nicdevices.bond0="eth2|eth3"
chdef cn1 nicips.bond0=40.0.0.1
#. Define ``nicnetworks`` for ``bond0`` ::
chdef cn1 nicnetworks.bond0=net40
Enable ``confignetwork`` to configure bond
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#. If adding ``confignetwork`` into the node's postscripts list, ``confignetwork`` will be executed during OS deployment on compute node ::
chdef cn1 -p postscripts=confignetwork
#. Or if the compute node is already running, use ``updatenode`` command to run ``confignetwork`` postscript ::
updatenode cn1 -P confignetwork
Verify bonding mode
~~~~~~~~~~~~~~~~~~~
Login to compute node cn1 and check bonding options in ``/etc/sysconfig/network-scripts/ifcfg-bond0`` file ::
BONDING_OPTS="mode=802.3ad xmit_hash_policy=layer2+3"
* ``mode=802.3ad`` requires additional configuration on the switch.
* ``mode=2`` can be used for bonding without additional switch configuration.

View File

@@ -0,0 +1,75 @@
Configure Bridge Based on Bond Adapters
---------------------------------------
The following example sets the xCAT properties for compute node ``cn1`` to create:
* Compute node ``cn1`` with two physical NICs: ``eth2`` and ``eth3``
* Bond eth2 and eth3 as ``bond0``
* Create bridge ``br0`` based on ``bond0``
* Assign ip ``40.0.0.1`` to the bridge interface ``br0``
Add network object into the networks table
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Add/modify network data in the ``networks`` table ::
chdef -t network net40 net=40.0.0.0 mask=255.0.0.0
Define attributes in the ``nics`` table
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#. Compute node ``cn1`` has two physical NICs: ``eth2`` and ``eth3`` ::
chdef cn1 nictypes.eth2=ethernet nictypes.eth3=ethernet
#. Define ``bond0`` and bond ``eth2`` and ``eth3`` as ``bond0`` ::
chdef cn1 nictypes.bond0=bond nicdevices.bond0="eth2|eth3"
#. Define ``br0`` based on ``bond0`` ::
chdef cn1 nicips.br0=40.0.0.1 nictypes.br0=bridge
#. Define ``nicnetworks`` for ``br0`` ::
chdef cn1 nicnetworks.br0=net40
Enable ``confignetwork`` to configure bridge
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#. If adding ``confignetwork`` into the node's postscripts list, ``confignetwork`` will be executed during OS deployment on compute node ::
chdef cn1 -p postscripts=confignetwork
#. Or if the compute node is already running, use ``updatenode`` command to run ``confignetwork`` postscript ::
updatenode cn1 -P confignetwork
Verify bridge
~~~~~~~~~~~~~
Login to compute node cn1 and check bonding options in ``/etc/sysconfig/network-scripts/ifcfg-bond0`` file ::
DEVICE="bond0"
BOOTPROTO="none"
NAME="bond0"
BONDING_MASTER="yes"
ONBOOT="yes"
USERCTL="no"
TYPE="Bond"
BONDING_OPTS="mode=802.3ad miimon=100"
DHCLIENTARGS="-timeout 200"
BRIDGE=br0
Check ``ifcfg-br0`` under ``/etc/sysconfig/network-scripts/`` ::
DEVICE="br0"
BOOTPROTO="static"
IPADDR="40.0.0.1"
NETMASK="255.0.0.0"
NAME="br0"
ONBOOT="yes"
STP="on"
TYPE="Bridge"
Use ``ip addr`` command to check if ``br0`` and ``bond0`` are correct.

View File

@@ -0,0 +1,66 @@
Configure VLAN Based on Bond Adapters
-------------------------------------
The following example sets the xCAT properties for compute node ``cn1`` to create:
* Compute node ``cn1`` with two physical NICs: ``eth2`` and ``eth3``
* Bond eth2 and eth3 as ``bond0``
* Create bridge ``bond0.1`` based on ``bond0``
* Assign ip ``40.0.0.1`` to the bridge interface ``bond0.1``
Add network object into the networks table
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Add/modify the network ``net40`` in the ``networks`` table ::
chdef -t network net40 net=40.0.0.0 mask=255.0.0.0
Define attributes in the ``nics`` table
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#. Compute node ``cn1`` has two physical NICs: ``eth2`` and ``eth3`` ::
chdef cn1 nictypes.eth2=ethernet nictypes.eth3=ethernet
#. Define ``bond0`` and bond ``eth2`` and ``eth3`` as ``bond0`` ::
chdef cn1 nictypes.bond0=bond nicdevices.bond0="eth2|eth3"
#. Define VLAN ``bond0.1`` based on ``bond0`` ::
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
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#. If adding ``confignetwork`` into the node's postscripts list, ``confignetwork`` will be executed during OS deployment on compute node ::
chdef cn1 -p postscripts=confignetwork
#. Or if the compute node is already running, use ``updatenode`` command to run ``confignetwork`` postscript ::
updatenode cn1 -P confignetwork
Verify VLAN
~~~~~~~~~~~
Login to compute node cn1 and check ``ifcfg-bond0.1`` under ``/etc/sysconfig/network-scripts/`` ::
DEVICE="bond0.1"
BOOTPROTO="static"
IPADDR="40.0.0.1"
NETMASK="255.0.0.0"
NAME="bond0.1"
ONBOOT="yes"
USERCTL=no
VLAN=yes
Use ``ip addr`` command to check if ``br0`` and ``bond0`` are correct.

View File

@@ -0,0 +1,77 @@
Configure BOND, VLAN and BRIDGES
--------------------------------
The following example set the xCAT properties for compute node ``cn1`` to achieve the following network configuration using the ``confignetwork`` postscript:
* Compute node ``cn1`` has two physical NICs: ``eth2`` and ``eth3``
* Bond ``eth2`` and ``eth3`` as ``bond0``
* From ``bond0``, create 2 VLANs: ``bond0.1`` and ``bond0.2``
* Make bridge ``br1`` using ``bond0.1`` with IP (10.0.0.1)
* Make bridge ``br2`` using ``bond0.2`` with IP (20.0.0.1)
Define the additional networks to xCAT
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If this is a new network being created on the compute nodes, an entry needs to be created into the xCAT database.
The ``nicnetworks`` attribute only defines the nic that uses the IP address.
Other information about the network should be defined in the ``networks`` table.
Add/modify the networks in the ``networks`` table ::
chdef -t network net10 net=10.0.0.0 mask=255.0.0.0
chdef -t network net20 net=20.0.0.0 mask=255.0.0.0
Define attributes in the ``nics`` table
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#. Compute node ``cn1`` has two physical NICs: ``eth2`` and ``eth3`` ::
chdef cn1 nictypes.eth2=ethernet nictypes.eth3=ethernet
#. Define ``bond0`` and bond ``eth2`` and ``eth3`` as ``bond0`` ::
chdef cn1 nictypes.bond0=bond \
nicdevices.bond0="eth2|eth3"
#. From ``bond0``, create 2 VLANs: ``bond0.1`` and ``bond0.2`` ::
chdef cn1 nictypes.bond0.1=vlan \
nictypes.bond0.2=vlan \
nicdevices.bond0.1=bond0 \
nicdevices.bond0.2=bond0
#. Create bridge ``br1`` using ``bond0.1`` with IP (10.0.0.1) ::
chdef cn1 nictypes.br1=bridge \
nicdevices.br1=bond0.1 \
nicips.br1=10.0.0.1 \
nicnetworks.br1="net10"
#. Create bridge ``br2`` using ``bond0.2`` with IP (20.0.0.1) ::
chdef cn1 nictypes.br2=bridge \
nicdevices.br2=bond0.2 \
nicips.br2=20.0.0.1 \
nicnetworks.br2="net20"
Add ``confignetwork`` into the node's postscripts list
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#. Use the following command to add ``confignetwork`` into postscript list to execute on reboot: ::
chdef cn1 -p postscripts=confignetwork
#. If the compute node is already running, use ``updatenode`` command to run ``confignetwork`` postscript without rebooting the node::
updatenode cn1 -P confignetwork
Check result
~~~~~~~~~~~~
Use ``ip`` command on ``cn1`` to check all NICs ::
xdsh cn1 "ip addr"
Check all network configuration files under ``/etc/sysconfig/network-scripts/``.

View File

@@ -0,0 +1,56 @@
Configure Bridge Based On Ethernet NIC
--------------------------------------
The following example set the xCAT properties for compute node ``cn1`` to create:
* Compute node ``cn1`` has one physical NIC: eth1
* User wants to confgure 1 bridge br1 based on eth1
* Assign ip ``30.5.106.9`` to br0
Add network object into the networks table
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Add/modify the network ``net30`` in the ``networks`` table ::
chdef -t network net30 net=30.0.0.0 mask=255.0.0.0
Define attributes in the ``nics`` table
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#. Compute node ``cn1`` has one physical NIC: ``eth1`` ::
chdef cn1 nictypes.eth1=ethernet
#. Define bridge ``br1`` based on ``eth1`` ::
chdef cn1 nictypes.br1=bridge nicdevices.br1="eth1"
chdef cn1 nicips.br1=30.5.106.9
#. Define ``nicnetworks`` for ``br1`` ::
chdef cn1 nicnetworks.br1=net30
Enable ``confignetwork`` to configure bridge
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#. If add ``confignetwork`` into the node's postscripts list, ``confignetwork`` will be executed during OS deployment on compute node ::
chdef cn1 -p postscripts=confignetwork
#. Or if the compute node is already running, use ``updatenode`` command to run ``confignetwork`` postscript ::
updatenode cn1 -P confignetwork
Verify Bridge
~~~~~~~~~~~~~
Login to compute node cn1 and check configure files in ``ifcfg-br1`` under ``/etc/sysconfig/network-scripts/`` ::
TYPE=Bridge
STP=on
Check ``ifcfg-eth1`` under ``/etc/sysconfig/network-scripts/`` ::
BRIDGE=br1
Use ``ip addr`` command to check if ``br1``, ``eth0.6`` and ``eth0.7`` are correct.

View File

@@ -0,0 +1,30 @@
Use Customized Scripts To Configure NIC
---------------------------------------
If using customized script to configure NIC, ``niccustomscripts`` for the specified nic in ``nics`` table should be configured. In the customized scripts, it can use data from xCAT DB, These data are parsed as global value from ``/xcatpost/mypostscript`` in compute node. Here is a simple example :
#. Compute node ``cn1`` with one physical NIC: ``eth1``
#. Put customized script ``cfgeth1`` under xCAT MN ``/install/postscripts``
#. Configure ``niccustomscripts`` in ``nics`` table ::
chdef cn1 niccustomscripts.eth1=cfgeth1
#. The script ``cfgeth1`` uses data from xCAT DB, for example, it uses network ``net50`` from ``networks`` table ::
chdef -t network net50 net=50.0.0.0 mask=255.0.0.0
**Notes:** The network ``net50`` is parsed as ``NETWORKS_LINE1`` in ``/xcatpost/mypostscript`` as following, so script ``cfgeth1`` can use global value ``NETWORKS_LINE1`` directly ::
NETWORKS_LINE1='netname=net50||net=50.0.0.0||mask=255.0.0.0||mgtifname=||gateway=||dhcpserver=||tftpserver=||nameservers=||ntpservers=||logservers=||dynamicrange=||staticrange=||staticrangeincrement=||nodehostname=||ddnsdomain=||vlanid=||domain=||disable=||comments='
#. When ``confignetwork`` is running in ``cn1``, ``confignetwork`` will execute ``cfgeth1`` to configure eth1, so adding ``confignetwork`` into the node's postscripts list. During OS deployment on compute node, ``confignetwork`` postscript will be executed. ::
chdef cn1 -p postscripts=confignetwork
#. Or if the compute node is already running, use ``updatenode`` command to run ``confignetwork`` postscript without rebooting the node::
updatenode cn1 -P confignetwork
#. Use ``xdsh cn1 "ip addr show eth1"`` to check the NIC
#. Check ``ifcfg-eth1`` under ``/etc/sysconfig/network-scripts/``

View File

@@ -0,0 +1,76 @@
Configure Ethernet Network Interface
------------------------------------
The following example sets the xCAT properties for compute node ``cn1`` to create:
* Compute node ``cn1`` with two physical NICs: ``eth0`` and ``eth1``
* Management network is ``11.1.89.0``, application network is ``13.1.89.0``
* The install NIC is eth0, and application NIC is eth1
* Assign static ip ``11.1.89.7/24`` to eth0
* Assign static ip ``13.1.89.7/24`` to eth1
Add/update networks into the xCAT DB
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Add/update additional networks ``net11`` and ``net13`` into ``networks`` table::
chdef -t network net11 net=11.1.89.0 mask=255.255.255.0
chdef -t network net13 net=13.1.89.0 mask=255.255.255.0
**Note:** MTU can be customized as ``mtu`` in ``networks`` table for specified network.
Define Adapters in the nics table
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#. Provision ip is coming from DHCP, there is no need to configure install nic into ``nics`` table. Provision ip can be configured in node definition, but it is not required. ::
chdef cn1 ip=11.1.89.7
#. Data NIC ``eth1`` is not install NIC, configure ``eth1`` into ``nics`` table ::
chdef cn1 nicips.eth1="13.1.89.7" nicnetworks.eth1="net13" nictypes.eth1="Ethernet" nichostnamesuffixes.eth1=-eth2
Update /etc/hosts
~~~~~~~~~~~~~~~~~
#. Run the ``makehosts`` command to add the new configuration to the ``/etc/hosts`` file. ::
makehosts cn1
#. Check ``/etc/hosts`` ::
cat /etc/hosts
11.1.89.7 cn1 cn1.cluster.com
13.1.89.7 cn1-eth1 cn1-eth1.cluster.com
Configure adapters with static IPs
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#. Execute ``confignetwork -s`` to configure both provision ip ``11.1.89.7`` and application data ip ``13.1.89.7`` as static
a. Add ``confignetwork -s`` into postscript list to execute on reboot ::
chdef cn1 -p postscripts="confignetwork -s"
b. If the compute node is already running, use ``updatenode`` command to run ``confignetwork -s`` postscript without rebooting the node ::
updatenode cn1 -P "confignetwork -s"
#. If install NIC is not configured in ``nics`` table, and only configure all other NIC's data defined in ``nics`` table, execute ``confignetwork`` without ``-s``
a. Add ``confignetwork`` into postscript list to execute on reboot ::
chdef cn1 -p postscripts="confignetwork"
b. If the compute node is already running, use ``updatenode`` command to run ``confignetwork`` postscript without rebooting the node ::
updatenode cn1 -P "confignetwork"
**Notes:** Option "-s" writes the install NIC's information into configuration file for persistence. All other NIC's data defined in ``nics`` table will be written also. Without option "-s", ``confignetwork`` only configures all NIC's data defined in ``nics`` table.
Check result
~~~~~~~~~~~~
#. Use ``xdsh cn1 "ip addr"`` to check ``eth0`` and ``eth1``
#. Check ``ifcfg-eth0`` and ``ifcfg-eth1`` under ``/etc/sysconfig/network-scripts/``

View File

@@ -0,0 +1,21 @@
Use Extra Parameters In NIC Configuration File
----------------------------------------------
Use ``nicextraparams`` to customize attributes in NIC configuration file. For example :
#. Compute node ``cn1`` with one physical NIC: ``eth1``
#. Configure network into ``networks`` table, configure ``nicips``, ``nictypes`` and ``nicnetworks`` in ``nics`` table, like :doc:`Configure Ethernet Network Interface<cfg_network_ethernet_nic>`
#. In order to customize "MTU=1456 ONBOOT=no" for eth1. configure ``nicips``, ``nictypes`` and ``nicnetworks`` in ``nics`` table , also need to configure ``nicextraparams`` as following::
chdef cn1 nicextraparams.eth1="MTU=1456 ONBOOT=no"
#. After ``confignetwork`` is executed in ``cn1``, ``nicexraparams`` will overwrite the original value in ``/etc/sysconfig/network-scripts/ifcfg-eth1`` as ::
DEVICE=eth1
IPADDR=13.1.89.7
NETMASK=255.255.255.0
BOOTPROTO=static
ONBOOT=no
HWADDR=42:f5:0a:05:6a:09
MTU=1456

View File

@@ -0,0 +1,56 @@
Configure VLAN Based on Ethernet Adapter
----------------------------------------
The following example set the xCAT properties for compute node ``cn1`` to create:
* Compute node ``cn1`` has one physical NIC: eth0
* Confgure 2 vlans: eth0.6 and eth0.7 based on eth0
* Assign ip ``60.5.106.9`` to eth0.6 and ``70.5.106.9`` to eth0.7
Define the additional networks to xCAT
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Add/modify the networks ``net60`` and ``net70`` in the ``networks`` table ::
chdef -t network net60 net=60.0.0.0 mask=255.0.0.0
chdef -t network net70 net=70.0.0.0 mask=255.0.0.0
Define attributes in the ``nics`` table
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#. Compute node ``cn1`` has one physical NIC: ``eth0`` ::
chdef cn1 nictypes.eth0=ethernet
#. Define vlan ``eth0.6`` and ``eth0.7`` based on ``eth0`` ::
chdef cn1 nictypes.eth0.6=vlan nicdevices.eth0.6="eth0" nictypes.eth0.7=vlan nicdevices.eth0.7="eth0"
chdef cn1 nicips.eth0.6=60.5.106.9 nicips.eth0.7=70.5.106.9
#. Define ``nicnetworks`` for ``eth0.6`` and ``eth0.7`` ::
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
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#. Add ``confignetwork`` into postscript list to execute on reboot ::
chdef cn1 -p postscripts=confignetwork
#. If the compute node is already running, use ``updatenode`` command to run ``confignetwork`` postscript without rebooting the node ::
updatenode cn1 -P confignetwork
Verify VLAN
~~~~~~~~~~~
Login to compute node cn1 and check VLAN options in ``ifcfg-eth0.6`` and ``ifcfg-eth0.7`` under ``/etc/sysconfig/network-scripts/`` ::
VLAN=yes
Use ``ip addr`` command to check if ``eth0.6`` and ``eth0.7`` are there.

View File

@@ -0,0 +1,63 @@
Configure Bridge Based on VLAN
------------------------------
The following example set the xCAT properties for compute node ``cn1`` to create:
* Compute node ``cn1`` has one physical NIC: eth0
* Define 2 vlans: eth0.6 and eth0.7 based on eth0
* Define 2 bridge br1 and br2
* Assign ip ``60.5.106.9`` to br1 and ``70.5.106.9`` to br2
Define attributes in the ``nics`` table
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#. Using the ``mkdef`` or ``chdef`` commands
a. Compute node ``cn1`` has one physical NIC: ``eth0`` ::
chdef cn1 nictypes.eth0=ethernet
b. Define vlan ``eth0.6`` and ``eth0.7`` based on ``eth0`` ::
chdef cn1 nictypes.eth0.6=vlan nicdevices.eth0.6="eth0" nictypes.eth0.7=vlan nicdevices.eth0.7="eth0"
c. Define bridge ``br1`` and ``br2`` ::
chdef cn1 nicips.br1=60.5.106.9 nicips.br2=70.5.106.9 nictypes.br1=bridge nictypes.br2=bridge
Add network object into the networks table
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Use the ``chdef`` command to add/modify the networks in the ``networks`` table ::
chdef -t network net60 net=60.0.0.0 mask=255.0.0.0
chdef -t network net70 net=70.0.0.0 mask=255.0.0.0
chdef cn1 nicnetworks.br1=net60 nicnetworks.br2=net70
Add ``confignetwork`` into the node's postscripts list
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Use command below to add ``confignetwork`` into the node's postscripts list ::
chdef cn1 -p postscripts=confignetwork
During OS deployment on compute node, ``confignetwork`` postscript will be executed.
If the compute node is already running, use ``updatenode`` command to run ``confignetwork`` postscript without rebooting the node::
updatenode cn1 -P confignetwork
Verify Bridge
~~~~~~~~~~~~~
Login to compute node cn1 and check ``ifcfg-br1`` and ``ifcfg-br2`` under ``/etc/sysconfig/network-scripts/`` like ::
BOOTPROTO="static"
IPADDR="60.5.106.9"
NETMASK="255.0.0.0"
NAME="br1"
ONBOOT="yes"
STP="on"
TYPE="Bridge"
Use ``ip addr`` command to check if ``br1``, ``br2``, ``eth0.6`` and ``eth0.7``.

View File

@@ -1,5 +1,5 @@
Configure Additional Network Interfaces - confignics
====================================================
Configure Additional Network Interfaces old version - confignics - (deprecated)
===============================================================================
The **nics** table and the **confignics** postscript can be used to automatically configure additional network interfaces (multiple ethernets adapters, InfiniBand, etc) on the nodes as they are being deployed.

View File

@@ -0,0 +1,24 @@
Use new kernel patch
====================
This procedure assumes there are kernel RPM in /tmp, we take the osimage **rhels7.3-ppc64le-install-compute** as an example.
The RPM names below are only examples, substitute your specific level and architecture.
* **[RHEL]**
#. The RPM kernel package is usually named: kernel-<kernelver>.rpm. Append new kernel packages directory to osimage pkgdir ::
mkdir -p /install/kernels/<kernelver>
cp /tmp/kernel-*.rpm /install/kernels/<kernelver>
createrepo /install/kernels/<kernelver>/
chdef -t osimage rhels7.3-ppc64le-install-compute -p pkgdir=/install/kernels/<kernelver>
#. Inject the drivers from the new kernel RPMs into the initrd ::
mkdef -t osdistroupdate kernelupdate dirpath=/install/kernels/<kernelver>/
chdef -t osimage rhels7.3-ppc64le-install-compute osupdatename=kernelupdate
chdef -t osimage rhels7.3-ppc64le-install-compute netdrivers=updateonly
genitrd rhels7.3-ppc64le-install-compute --ignorekernelchk
nodeset <CN> osimage=rhels7.3-ppc64le-install-compute --noupdateinitrd
#. Boot CN from net normallly.

View File

@@ -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]** ::

View File

@@ -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``: ::

View File

@@ -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=<osimage_name>"
#. Define the compute nodes into xCAT: ::
cat predefined.stanzas | mkdef -z
#. Add the compute node IP information to ``/etc/hosts``: ::
makehosts cn01

View File

@@ -31,35 +31,41 @@ For more information about chain, refer to :doc:`Chain <../../../../../advanced/
Initialize the discovery process
````````````````````````````````
Specify the predefined nodes to the nodediscoverstart command to initialize the discovery process::
Specify the predefined nodes to the `nodediscoverstart` command to initialize the discovery process::
nodediscoverstart noderange=cn1
See "nodediscoverstart man page<TBD>" for more details.
See :doc:`nodediscoverstart </guides/admin-guides/references/man1/nodediscoverstart.1>` for more information.
Display information about the discovery process
```````````````````````````````````````````````
There are additional nodediscover commands you can run during the discovery process. See their man pages for more details.
There are additional `nodediscover*` commands you can run during the discovery process. See the man pages for more details.
Verify the status of discovery::
Verify the status of discovery using :doc:`nodediscoverstatus </guides/admin-guides/references/man1/nodediscoverstatus.1>`::
nodediscoverstatus
Show the nodes that have been discovered so far::
Show the nodes that have been discovered using :doc:`nodediscoverls </guides/admin-guides/references/man1/nodediscoverls.1>`::
nodediscoverls -t seq -l
Stop the current sequential discovery process::
Stop the current sequential discovery process using: :doc:`nodediscoverstop </guides/admin-guides/references/man1/nodediscoverstop.1>`::
nodediscoverstop
Note: The sequential discovery process will be stopped automatically when all of the node names in the node pool are used up.
**Note:** The sequential discovery process will stop automatically when all of the node names in the pool are consumed.
Start discovery process
-----------------------
To start the discovery process, the system administrator needs to power on the servers one by one manually. Then the hardware discovery process will start automatically.
.. include:: standard_cn_definition.rst
Verify Node Definition
----------------------
After discovery of the node, properties of the server will be added to the xCAT node definition.
Display the node definition and verify that the MAC address has been populated.

View File

@@ -1,25 +0,0 @@
Verify node definition
----------------------
The following is an example of the server node definition after hardware discovery::
# lsdef cn1
Object name: cn1
arch=ppc64
bmc=50.0.100.1
cons=ipmi
cpucount=192
cputype=POWER8E (raw), altivec supported
groups=powerLE,all
installnic=mac
ip=10.0.101.1
mac=6c:ae:8b:02:12:50
memory=65118MB
mgt=ipmi
mtm=8247-22L
netboot=petitboot
postbootscripts=otherpkgs
postscripts=syslog,remoteshell,syncfiles
primarynic=mac
serial=10112CA
supportedarchs=ppc64

View File

@@ -1 +0,0 @@
.. include:: ../../../common/deployment/cfg_network.rst

View File

@@ -1,8 +0,0 @@
Customize network adapter
=========================
.. toctree::
:maxdepth: 2
cfg_second_adapter.rst
cfg_network.rst

View File

@@ -1,2 +0,0 @@
.. include:: ../../../common/deployment/cfg_second_adapter.rst

View File

@@ -11,6 +11,7 @@ Optional means all the subitems in this page are not necessary to finish an OS d
pre_post_script.rst
syncfile.rst
additional_pkg.rst
cfg_network_adapter.rst
use_kernel_patch.rst
network/index.rst

View File

@@ -0,0 +1,42 @@
Configure Additional Network Interfaces - confignetwork
-------------------------------------------------------
The ``confignetwork`` postscript can be used to configure the network interfaces on the compute nodes to support Ethernet adapters, VLAN, BONDs, and BRIDGES. ``confignetwork`` can be used in postscripts during OS privision, it can also be executed in ``updatenode``. The way the ``confignetwork`` postscript decides what IP address to give the secondary adapter is by checking the ``nics`` table, in which the nic configuration information is stored. In order for the ``confignetwork`` postscript to run successfully, the following attributes must be configured for the node in the ``nics`` table:
* ``nicips``
* ``nictypes``
* ``nicnetworks``
If configuring VLAN, BOND, or BRIDGES, ``nicdevices`` in ``nics`` table must be configured. VLAN, BOND or BRIDGES is only supported on RHEL.
* ``nicdevices`` - resolves the relationship among the physical network interface devices
The following scenarios are examples to configure Ethernet adapters/BOND/VLAN/Bridge.
#. Configure Ethernet adapters:
* Scenario 1: :doc:`Configure Ethernet Network Interface <../../../../common/deployment/network/cfg_network_ethernet_nic>`
To configure Ethernet install NIC or other Ethernet network adapters as static
#. Configure BOND **[RHEL]**:
* Scenario 2: :doc:`Configure Bond using two Ethernet Adapters <../../../../common/deployment/network/cfg_network_bond>`
#. Configure VLAN **[RHEL]**:
* Scenario 3: :doc:`Configure VLAN Based on Ethernet Adapter <../../../../common/deployment/network/cfg_network_vlan>`
* Scenario 4: :doc:`Configure VLAN Based on Bond Adapters <../../../../common/deployment/network/cfg_network_bond_vlan>`
#. Configure Bridge **[RHEL]**:
* Scenario 5: :doc:`Configure Bridge Based On Ethernet NIC <../../../../common/deployment/network/cfg_network_bridge>`
* Scenario 6: :doc:`Configure Bridge Based on Bond Adapters <../../../../common/deployment/network/cfg_network_bond_bridge>`
* Scenario 7: :doc:`Configure Bridge Based on VLAN <../../../../common/deployment/network/cfg_network_vlan_bridge>`
* Scenario 8: :doc:`Configure Bridge Based on VLAN,VLAN use BOND adapter <../../../../common/deployment/network/cfg_network_bond_vlan_bridge>`
#. Advanced topics:
* :doc:`Use Customized Scripts To Configure NIC <../../../../common/deployment/network/cfg_network_custom_scripts>`
* :doc:`Use Extra Parameters In NIC Configuration File <../../../../common/deployment/network/cfg_network_extra_param>`
* :doc:`Configure Aliases <../../../../common/deployment/network/cfg_network_aliases>`

View File

@@ -0,0 +1,2 @@
.. include:: ../../../../common/deployment/network/cfg_second_adapter.rst

View File

@@ -0,0 +1,10 @@
Customize network adapter
=========================
This section describes how to configure network adapters with persistent configuration using xCAT. The ``confignetwork`` postscript can be used to configure the network interfaces on the compute nodes to support Ethernet adapters, VLAN, BONDs, and BRIDGES.
.. toctree::
:maxdepth: 1
cfg_network_adapter.rst
cfg_second_adapter.rst

View File

@@ -0,0 +1,2 @@
.. include:: ../../../common/deployment/use_kernel_patch.rst

View File

@@ -1 +0,0 @@
.. include:: ../../../common/deployment/cfg_network.rst

View File

@@ -1,8 +0,0 @@
Customize network adapter
=========================
.. toctree::
:maxdepth: 2
cfg_second_adapter.rst
cfg_network.rst

View File

@@ -1,2 +0,0 @@
.. include:: ../../../common/deployment/cfg_second_adapter.rst

View File

@@ -10,8 +10,9 @@ Optional means all the subitems in this page are not necessary to finish an OS d
pre_post_script.rst
syncfile.rst
additional_pkg.rst
cfg_network_adapter.rst
network/index.rst
enable_kdump.rst
install_new_kernel.rst
acc_initrd_rootimg_gen_ppc64le.rst
trim_diskless_rootimg.rst
localdisk.rst

View File

@@ -0,0 +1 @@
.. include:: ../../../common/deployment/enable_localdisk.rst

View File

@@ -0,0 +1,42 @@
Configure Additional Network Interfaces - confignetwork
-------------------------------------------------------
The ``confignetwork`` postscript can be used to configure the network interfaces on the compute nodes to support Ethernet adapters, VLAN, BONDs, and BRIDGES. ``confignetwork`` can be used in postscripts during OS privision, it can also be executed in ``updatenode``. The way the ``confignetwork`` postscript decides what IP address to give the secondary adapter is by checking the ``nics`` table, in which the nic configuration information is stored. In order for the ``confignetwork`` postscript to run successfully, the following attributes must be configured for the node in the ``nics`` table:
* ``nicips``
* ``nictypes``
* ``nicnetworks``
If configuring VLAN, BOND, or BRIDGES, ``nicdevices`` in ``nics`` table must be configured. VLAN, BOND or BRIDGES is only supported on RHEL.
* ``nicdevices`` - resolves the relationship among the physical network interface devices
The following scenarios are examples to configure Ethernet adapters/BOND/VLAN/Bridge.
#. Configure Ethernet adapters:
* Scenario 1: :doc:`Configure Ethernet Network Interface <../../../../common/deployment/network/cfg_network_ethernet_nic>`
To configure Ethernet install NIC or other Ethernet network adapters as static
#. Configure BOND **[RHEL]**:
* Scenario 2: :doc:`Configure Bond using two Ethernet Adapters <../../../../common/deployment/network/cfg_network_bond>`
#. Configure VLAN **[RHEL]**:
* Scenario 3: :doc:`Configure VLAN Based on Ethernet Adapter <../../../../common/deployment/network/cfg_network_vlan>`
* Scenario 4: :doc:`Configure VLAN Based on Bond Adapters <../../../../common/deployment/network/cfg_network_bond_vlan>`
#. Configure Bridge **[RHEL]**:
* Scenario 5: :doc:`Configure Bridge Based On Ethernet NIC <../../../../common/deployment/network/cfg_network_bridge>`
* Scenario 6: :doc:`Configure Bridge Based on Bond Adapters <../../../../common/deployment/network/cfg_network_bond_bridge>`
* Scenario 7: :doc:`Configure Bridge Based on VLAN <../../../../common/deployment/network/cfg_network_vlan_bridge>`
* Scenario 8: :doc:`Configure Bridge Based on VLAN,VLAN use BOND adapter <../../../../common/deployment/network/cfg_network_bond_vlan_bridge>`
#. Advanced topics:
* :doc:`Use Customized Scripts To Configure NIC <../../../../common/deployment/network/cfg_network_custom_scripts>`
* :doc:`Use Extra Parameters In NIC Configuration File <../../../../common/deployment/network/cfg_network_extra_param>`
* :doc:`Configure Aliases <../../../../common/deployment/network/cfg_network_aliases>`

View File

@@ -0,0 +1,2 @@
.. include:: ../../../../common/deployment/network/cfg_second_adapter.rst

View File

@@ -0,0 +1,10 @@
Customize network adapter
=========================
This section describes how to configure network adapters with persistent configuration using xCAT. The ``confignetwork`` postscript can be used to configure the network interfaces on the compute nodes to support Ethernet adapters, VLAN, BONDs, and BRIDGES.
.. toctree::
:maxdepth: 1
cfg_network_adapter.rst
cfg_second_adapter.rst

View File

@@ -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.

View File

@@ -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 ``<startpoint>-<endpoint>`` or ``<percentage of the disk>``. 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
````````````````````````````````

View File

@@ -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

View File

@@ -1,147 +0,0 @@
############
getadapter.1
############
.. highlight:: perl
****
NAME
****
\ **getadapter**\ - Obtain all network adapters's predictable name and some other information before provision or network configuration.
********
SYNOPSIS
********
\ **getadapter**\ \ *noderange*\ [\ **-f**\ ]
\ **getadapter**\ [\ **-h | -**\ **-help | -v | -**\ **-version | -V**\ ]
***********
DESCRIPTION
***********
Traditionally, network interfaces in Linux are enumerated as eth[0123...], but these names do not necessarily correspond to actual labels on the chassis. \ **getadapter**\ help customer to get predictable network device name and some other network adapter information before provision or network configuration.
\ **Since getadpter uses genesis to collect network adapters information, the target node will be restarted.**\
\ **getadapter**\ For each node within the <noderange>, follows below scheme:
If the target node is scanned for the first time, \ **getadapter**\ will trigger genesis to collect information then save the information at the \ **nicsadapter**\ column of nics table.
If the target node has ever been scanned, \ **getadapter**\ will use the information from nics table first.
If user hopes to scan the adapter information for the node but these information already exist, \ **-f**\ option can be used to start rescan process.
\ **getadapter**\ tries to collect more information for the target network device, but doesn't guarantee collect same much information for every network device.
******************************
\ **Collected information:**\
******************************
\ **name**\ : the consistent name which can be used by confignic directly in operating system which follow the same naming scheme with rhels7
\ **pci**\ : the pci location
\ **mac**\ : the MAC address
\ **candidatename**\ : All the names which satisfy predictable network device naming scheme. \ *(if xcat enhance confignic command later, user can use these names to configure their network adapter, even customize their name)*\
\ **vender**\ : the vender of network device
\ **model**\ : the model of network device
\ **linkstate**\ : the link state of network device
*******
OPTIONS
*******
\ **-h**\
Display usage message.
\ **-v**\
Command Version.
\ **-V**\
Display verbose message.
\ **-f**\
Force to trigger new round scan. ignore the data collected before.
********
EXAMPLES
********
1. To collect node[1-3]'s network device information, enter:
.. code-block:: perl
getadapter node[1-2]
Output is similar to:
.. code-block:: perl
-->Starting scan for: node1,node2
The whole scan result:
--------------------------------------
[node1]: Adapter information exists, no need to scan.
--------------------------------------
[node2] scan successfully, below are the latest data
node2:[1]->eno1!mac=34:40:b5:be:6a:80|pci=/pci0000:00/0000:00:01.0/0000:0c:00.0|candidatename=eno1/enp12s0f0/enx3440b5be6a80
node2:[2]->enp0s29u1u1u5!mac=36:40:b5:bf:44:33|pci=/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.1/2-1.1.5/2-1.1.5:1.0|candidatename=enp0s29u1u1u5/enx3640b5bf4433
Every node gets a separate section to display its all network adapters information, every network adapter owns single line which start as node name and followed by index and other information.
2. Force to trigger new round scan
.. code-block:: perl
getadatper node -f
********
SEE ALSO
********
noderange(3)|noderange.3

View File

@@ -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.

View File

@@ -23,7 +23,7 @@ SYNOPSIS
\ **pgsqlsetup**\ {\ **-v**\ | \ **-**\ **-version**\ }
\ **pgsqlsetup**\ {\ **-i**\ | \ **-**\ **-init**\ } [\ **-N**\ | \ **-**\ **-nostart**\ ] [\ **-P**\ | \ **-**\ **-PCM**\ ] [\ **-o**\ | \ **-**\ **-odbc**\ ] [\ **-V**\ | \ **-**\ **-verbose**\ ]
\ **pgsqlsetup**\ {\ **-i**\ | \ **-**\ **-init**\ } [\ **-N**\ | \ **-**\ **-nostart**\ ] [\ **-**\ **-listen**\ | \ **-l**\ \ *address*\ ] [\ **-**\ **-access**\ | \ **-a**\ \ *address*\ ] [\ **-P**\ | \ **-**\ **-PCM**\ ] [\ **-o**\ | \ **-**\ **-odbc**\ ] [\ **-V**\ | \ **-**\ **-verbose**\ ]
\ **pgsqlsetup**\ {\ **-o**\ | \ **-**\ **-setupODBC**\ } [\ **-V**\ | \ **-**\ **-verbose**\ ]
@@ -65,7 +65,7 @@ OPTIONS
The init option is used to setup an installed PostgreSQL database so that xCAT can use the database. This involves creating the xcat database, the xcat admin id, allowing access to the xcatdb database by the Management Node. It customizes the postgresql.conf configuration file, adds the management server to the pg_hba.conf and starts the PostgreSQL server. It also backs up the current xCAT database and restores it into the newly setup xcatdb PostgreSQL database. It creates the /etc/xcat/cfgloc file to point the xcatd daemon to the PostgreSQL database and restarts the xcatd daemon using the database.
On AIX, it additionally setup the xcatadm unix id and the postgres id and group. For AIX, you should be using the PostgreSQL rpms available from the xCAT website. For Linux, you should use the PostgreSQL rpms shipped with the OS. You can chose the -o option, to run after the init.
To add additional nodes to access the PostgreSQL server, setup on the Management Node, edit the pg_hba.conf file.
To add additional nodes to access the PostgreSQL server, setup on the Management Node, use the -a option.
For more documentation see:Setting_Up_PostgreSQL_as_the_xCAT_DB
@@ -77,6 +77,18 @@ OPTIONS
\ **-l|-**\ **-listen**\ \ *address*\
This option is used to specify additional IP addresses on which the PostgreSQL database will listen. Without it, only localhost (on Linux) and the management node's main IP (on Linux and AIX) will be configured. This option can be specified multiple times.
\ **-a|-**\ **-access**\ \ *address*\
This option is used to specify additional IP addresses from which the service nodes will connect to the PostgreSQL database. Without it, only the management node will be configured for database access. This option can be specified multiple times.
\ **-P|-**\ **-PCM**\
This option sets up PostgreSQL database to be used with xCAT running with PCM.

View File

@@ -11,7 +11,7 @@ Name
****
\ **rflash**\ - Performs Licensed Internal Code (LIC) update support for HMC-attached POWER5 and POWER6 Systems, and POWER7 systems using Direct FSP management. \ **rflash**\ is also able to update firmware for NextScale Fan Power Controllers (FPC).
\ **rflash**\ - Performs Licensed Internal Code (LIC) update or firmware update on supported xCAT managed nodes.
****************
@@ -46,11 +46,24 @@ NeXtScale FPC specific:
\ **rflash**\ \ *noderange*\ \ *http_directory*\
OpenPOWER BMC specific:
=======================
OpenPOWER BMC specific (using IPMI):
====================================
\ **rflash**\ \ *noderange*\ \ *hpm_file_path*\ [\ **-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*\ {[\ **-c | -**\ **-check**\ ] | [\ **-l | -**\ **-list**\ ]}
\ **rflash**\ \ *noderange*\ \ *tar_file_path*\ {[\ **-c | -**\ **-check**\ ] | [\ **-a | -**\ **-activate**\ ] | [\ **-u | -**\ **-upload**\ ]}
\ **rflash**\ \ *noderange*\ \ *image_id*\ {[\ **-a | -**\ **-activate**\ ] | [\ **-d | -**\ **-delete**\ ]}
@@ -118,11 +131,20 @@ NeXtScale FPC specific:
The command will update firmware for NeXtScale FPC when given an FPC node and the http information needed to access the firmware. The http information required includes both the MN IP address as well as the directory containing the firmware. It is recommended that the firmware be downloaded and placed in the /install directory structure as the xCAT MN /install directory is configured with the correct permissions for http. Refer to the doc to get more details: XCAT_NeXtScale_Clusters
OpenPOWER specific:
===================
OpenPOWER specific (using IPMI):
================================
The command will update firmware for OpenPOWER BMC when given an OpenPOWER node and the hpm1 formatted file path.
The command will update firmware for OpenPOWER BMC when given an OpenPOWER node and either the hpm formatted file path or path to a data directory.
\ **Note:**\ When using \ **rflash**\ in hierarchical environment, the hpm file or data directory must be accessible from Service Nodes.
OpenPOWER OpenBMC specific:
===========================
The command will update firmware for OpenPOWER OpenBMC when given an OpenPOWER node and either an update .tar file or an uploaded image id.
\ **Note:**\ When using \ **rflash**\ in hierarchical environment, the .tar file must be accessible from Service Nodes.
@@ -140,7 +162,7 @@ The command will update firmware for OpenPOWER BMC when given an OpenPOWER node
\ **-c|-**\ **-check**\
Check the firmware version of BMC and HPM file.
Check the firmware version of BMC and an update file.
@@ -152,8 +174,14 @@ The command will update firmware for OpenPOWER BMC when given an OpenPOWER node
\ **-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.
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.
\ **-**\ **-activate**\ {\ **concurrent**\ | \ **disruptive**\ }
@@ -170,8 +198,14 @@ The command will update firmware for OpenPOWER BMC when given an OpenPOWER node
\ **-**\ **-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*\
@@ -180,6 +214,30 @@ The command will update firmware for OpenPOWER BMC when given an OpenPOWER node
\ **-a|-**\ **-activate**\
Activate update image. Image id or update file must be specified.
\ **-l|-**\ **-list**\
List currently uploaded update images. "(\*)" indicates currently active image.
\ **-u|-**\ **-upload**\
Upload update image. Specified file must be in .tar format.
\ **-d|-**\ **-delete**\
Delete update image from BMC
\ **-v|-**\ **-version**\
Displays the command's version.
@@ -267,6 +325,26 @@ The command will update firmware for OpenPOWER BMC when given an OpenPOWER node
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:
.. code-block:: perl
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
****************
\ **Location**\

View File

@@ -45,7 +45,7 @@ OpenPOWER OpenBMC:
==================
\ **rpower**\ \ *noderange*\ [\ **off | on | reset | boot | stat | state | status**\ ]
\ **rpower**\ \ *noderange*\ [\ **off | on | softoff | reset | boot | bmcreboot | bmcstate | stat | state | status**\ ]
PPC (with IVM or HMC) specific:
@@ -380,6 +380,18 @@ OPTIONS
\ **bmcreboot**\
To reboot BMC.
\ **bmcstate**\
To get state of the BMC.
\ **state**\
To get state of the instance.

View File

@@ -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.

View File

@@ -47,7 +47,7 @@ OpenBMC specific:
=================
\ **rspconfig**\ \ *noderange*\ {\ **ip | netmask | gateway | vlan**\ }
\ **rspconfig**\ \ *noderange*\ {\ **ip | netmask | gateway | hostname | vlan | sshcfg**\ }
MPA specific:
@@ -251,8 +251,7 @@ DESCRIPTION
***********
\ **rspconfig**\ configures various settings in the nodes' service processors. If only a keyword is
specified, without the \ **=**\ , it displays the current value.
\ **rspconfig**\ configures various settings in the nodes' service processors.
For options \ **autopower | iocap | decfg | memdecfg | procdecfg | time | date | spdump | sysdump | network**\ , user need to use \ *chdef -t site enableASMI=yes*\ to enable ASMI first.
@@ -395,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].
@@ -526,6 +531,12 @@ OPTIONS
\ **sshcfg**\
Copy SSH keys.
\ **swnet**\ ={[\ *ip*\ ],[\ *gateway*\ ],[\ *netmask*\ ]}
Set the Switch network parameters.

View File

@@ -59,6 +59,12 @@ Name
conveniently specify a list of nodes. The result is that the command will
be applied to a range of nodes, often in parallel.
If you invoke xCAT \ **noderange**\ from a shell you may need to quote the
\ **noderange**\ if the shell would otherwise treat the punctuation marks in
the \ **noderange**\ as control operators. The affected punctuation marks may
include Asterisk (\`*'), Left Square Bracket (\`[') , Right Square Bracket
(\`]'), Circumflex Accent (\`^'), and Overline (\`~').
\ **noderange**\ is a comma-separated list. Each token (text between commas)
in the list can be any of the forms listed below:
@@ -357,6 +363,14 @@ Example of \ **xCAT Node Name Format**\ node/group names:
************
\ **Bugs**\
************
The special characters used by xCAT \ **noderange**\ are also special characters
to many shell programs. In particular, the characters \`*', \`[', \`]', \`^',
and \`~' may have to be escaped from the shell.
****************
\ **SEE ALSO**\
****************

View File

@@ -62,7 +62,7 @@ bootparams Attributes:
\ **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(" ")

View File

@@ -56,7 +56,7 @@ linuximage Attributes:
\ **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.

View File

@@ -129,7 +129,7 @@ nics Attributes:
\ **nicsadapter**\
Comma-separated list of extra parameters that will be used for each NIC configuration.
<nic1>!<param1=value1 param2=value2>|<param3=value3>,<nic2>!<param4=value4 param5=value5>|<param6=value6>, for example, eth0!MTU=1500|MTU=1460,ib0!MTU=65520 CONNECTED_MODE=yes.
<nic1>!<param1=value1 param2=value2>,<nic2>!<param4=value4 param5=value5>, for example, enP3p3s0f1!mac=98:be:94:59:fa:cd linkstate=DOWN,enP3p3s0f2!mac=98:be:94:59:fa:ce candidatename=enP3p3s0f2/enx98be9459face

View File

@@ -110,8 +110,9 @@ site Attributes:
dhcplease: The lease time for the dhcp client. The default value is 43200.
disjointdhcps: If set to '1', the .leases file on a service node only contains
the nodes it manages. The default value is '0'.
'0' value means include all the nodes in the subnet.
the nodes it manages. And when 'sharedtftp' is disabled, nodeset handles
boot loader configuration on a service node only for the nodes it manages.
The default value is '0'. It means include all the nodes in the subnet.
pruneservices: Whether to enable service pruning when noderm is run (i.e.
removing DHCP entries when noderm is executed)
@@ -389,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

View File

@@ -157,6 +157,27 @@ Before you panic, let me explain each column:
See http://www.perl.com/doc/manual/html/pod/perlre.html for information on perl regular expressions.
Regular Expression Helper Functions
============================
xCAT provides several functions that can simplify regular expressions.
\ **a2idx(character) **\
Turns a single character into a 1-indexed index. a maps to 1 and z maps to 26.
\ **a2zidx(character) **\
Turns a single character into a 0-indexed index. a maps to 0 and z maps to 25.
\ **dim2idx(value, [count, value...]) **\
Converts dimensions (such as row, column, chassis, etc) into an index. If each rack has 18 nodes, use dim2idx(racknum, 18, nodenum). Additional dimensions should be added at the beginning. All values are 1-indexed.
\ **skip(index, skiplist) **\
Return an index with certain values skipped. The skip list uses the format start[:count][,start[:count]...]
\ **ipadd(octet1, octet2, octet3, octet4, toadd, skipstart, skipend) **\
Add to an IP address. Generally only necessary 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.
Easy Regular Expressions
========================

View File

@@ -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.
<nic1>!<param1=value1 param2=value2>|<param3=value3>,<nic2>!<param4=value4 param5=value5>|<param6=value6>, for example, eth0!MTU=1500|MTU=1460,ib0!MTU=65520 CONNECTED_MODE=yes.
<nic1>!<param1=value1 param2=value2>,<nic2>!<param4=value4 param5=value5>, for example, enP3p3s0f1!mac=98:be:94:59:fa:cd linkstate=DOWN,enP3p3s0f2!mac=98:be:94:59:fa:ce candidatename=enP3p3s0f2/enx98be9459face

View File

@@ -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.
<nic1>!<param1=value1 param2=value2>|<param3=value3>,<nic2>!<param4=value4 param5=value5>|<param6=value6>, for example, eth0!MTU=1500|MTU=1460,ib0!MTU=65520 CONNECTED_MODE=yes.
<nic1>!<param1=value1 param2=value2>,<nic2>!<param4=value4 param5=value5>, for example, enP3p3s0f1!mac=98:be:94:59:fa:cd linkstate=DOWN,enP3p3s0f2!mac=98:be:94:59:fa:ce candidatename=enP3p3s0f2/enx98be9459face

View File

@@ -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.

View File

@@ -19,7 +19,7 @@ Name
****************
\ **nodeset**\ \ *noderange*\ [\ **boot**\ | \ **stat**\ | \ **offline**\ | \ **runcmd=bmcsetup**\ | \ **osimage**\ [=\ *imagename*\ ] | \ **shell**\ | \ **shutdown**\ ]
\ **nodeset**\ \ *noderange*\ [\ **boot**\ | \ **stat**\ [\ **-a**\ ]| \ **offline**\ | \ **runcmd=bmcsetup**\ | \ **osimage**\ [=\ *imagename*\ ] | \ **shell**\ | \ **shutdown**\ ] [\ **-V | -**\ **-verbose**\ ]
\ **nodeset**\ \ *noderange*\ \ **osimage**\ [=\ *imagename*\ ] [\ **-**\ **-noupdateinitrd**\ ] [\ **-**\ **-ignorekernelchk**\ ]
@@ -40,10 +40,16 @@ changing the network boot files. Each xCAT node always boots from the
network and downloads a boot file with instructions on what action to
take next.
\ **nodeset**\ will manipulate the boot configuration files of yaboot and pxelinux.0.
\ **nodeset**\ will manipulate the boot configuration files of xnba, grub2, petitboot, yaboot and pxelinux.0.
Assume that /tftpboot is the root for tftpd (set in site(5)|site.5).
\ **nodeset**\ for petitboot makes changes to /tftpboot/petitboot/{node name}
\ **nodeset**\ for xnba makes changes to /tftpboot/xcat/xnba/nodes/{node name}
\ **nodeset**\ for grub2 makes changes to /tftpboot/boot/grub2/{node name}
\ **nodeset**\ for pxe makes changes to /tftpboot/pxelinux.cfg/{node hex ip}
\ **nodeset**\ for yaboot makes changes to /tftpboot/etc/{node hex ip}
@@ -53,6 +59,8 @@ Assume that /tftpboot is the root for tftpd (set in site(5)|site.5).
\ **nodeset**\ is called by \ **rinstall**\ and \ **winstall**\ and is also called by the
installation process remotely to set the boot state back to "boot".
In a hierarchical cluster managed by service nodes, \ **nodeset**\ command is used to make sure compute node states are consistent on service and management nodes. When errors are reported, run the command with verbose mode. And the command will display additional service node information, which might be useful in identifying the problem.
A user can supply their own scripts to be run on the mn or on the service node (if a hierarchical cluster) for a node when the nodeset command is run. Such scripts are called \ **prescripts**\ . They should be copied to /install/prescripts directory. A table called \ *prescripts*\ is used to specify the scripts and their associated actions. The scripts to be run at the beginning of the nodeset command are stored in the 'begin' column of \ *prescripts*\ table. The scripts to be run at the end of the nodeset command are stored in the 'end' column of \ *prescripts*\ table. You can run 'tabdump -d prescripts' command for details. The following two environment variables will be passed to each script: NODES contains all the names of the nodes that need to run the script for and ACTION contains the current nodeset action. If \ *#xCAT setting:MAX_INSTANCE=number*\ is specified in the script, the script will get invoked for each node in parallel, but no more than \ *number*\ of instances will be invoked at a time. If it is not specified, the script will be invoked once for all the nodes.
@@ -101,7 +109,7 @@ A user can supply their own scripts to be run on the mn or on the service node (
\ **stat**\
Display the current boot loader config file description for the nodes requested
Display the current boot loader config file description for the nodes requested. When \ **disjointdhcps**\ is set, using \ **-a**\ to display them on all available service nodes.
@@ -125,6 +133,12 @@ A user can supply their own scripts to be run on the mn or on the service node (
\ **-V | -**\ **-verbose**\
Verbose mode.
\ **-h | -**\ **-help**\
Print help.

View File

@@ -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 <https:// | | | |
| github.com/xcat2/xcat-core/wiki | | | reventlog to get/clear event log|
| /XCAT_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 <https:// | | | |
| github.com/xcat2/xcat-core/wiki | | | rflash list/upload/activate |
| /XCAT_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 <https:// | | | rinstall |
| github.com/xcat2/xcat-core/wiki | | | bmcdiscover |
| /XCAT_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 |

View File

@@ -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"

View File

@@ -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);
}

View File

@@ -1129,6 +1129,13 @@ sub handle_response {
return;
}
my $msgsource;
if ($ENV{'XCATSHOWSVR'}) {
unless ($rsp->{NoSvrPrefix}) { # some plugins could disable the prefix forcely by seting the flag in response.
$msgsource = $rsp->{xcatdsource}->[0] if ($rsp->{xcatdsource});
}
}
#print "in handle_response\n";
# Handle errors
if (defined($rsp->{errorcode})) {
@@ -1141,24 +1148,23 @@ sub handle_response {
$xCAT::Client::EXITCODE |= $rsp->{errorcode};
} # assume it is a non-reference scalar
}
if ($rsp->{error}) {
#print "printing error\n";
if (ref($rsp->{error}) eq 'ARRAY') {
foreach my $text (@{ $rsp->{error} }) {
if ($rsp->{NoErrorPrefix}) {
print STDERR "$text\n";
} else {
print STDERR "Error: $text\n";
}
my $desc = "$text";
$desc = "[$msgsource]: $desc" if ($msgsource && $desc);
$desc = "Error: $desc" unless ($rsp->{NoErrorPrefix});
print STDERR "$desc\n";
}
}
else {
if ($rsp->{NoErrorPrefix}) {
print STDERR ($rsp->{error} . "\n");
} else {
print STDERR ("Error: " . $rsp->{error} . "\n");
}
my $desc = $rsp->{error};
$desc = "[$msgsource]: $desc" if ($msgsource && $desc);
$desc = "Error: $desc" unless ($rsp->{NoErrorPrefix});
print STDERR "$desc\n";
}
}
if ($rsp->{warning}) {
@@ -1166,19 +1172,17 @@ sub handle_response {
#print "printing warning\n";
if (ref($rsp->{warning}) eq 'ARRAY') {
foreach my $text (@{ $rsp->{warning} }) {
if ($rsp->{NoWarnPrefix}) {
print STDERR "$text\n";
} else {
print STDERR "Warning: $text\n";
}
my $desc = "$text";
$desc = "[$msgsource]: $desc" if ($msgsource && $desc);
$desc = "Warning: $desc" unless ($rsp->{NoWarnPrefix});
print STDERR "$desc\n";
}
}
else {
if ($rsp->{NoWarnPrefix}) {
print STDERR ($rsp->{warning} . "\n");
} else {
print STDERR ("Warning: " . $rsp->{warning} . "\n");
}
my $desc = $rsp->{warning};
$desc = "[$msgsource]: $desc" if ($msgsource && $desc);
$desc = "Warning: $desc" unless ($rsp->{NoWarnPrefix});
print STDERR "$desc\n";
}
}
if ($rsp->{info}) {
@@ -1186,11 +1190,15 @@ sub handle_response {
#print "printing info\n";
if (ref($rsp->{info}) eq 'ARRAY') {
foreach my $text (@{ $rsp->{info} }) {
print "$text\n";
my $desc = "$text";
$desc = "[$msgsource]: $desc" if ($msgsource && $desc);
print "$desc\n";
}
}
else {
print($rsp->{info} . "\n");
my $desc = $rsp->{info};
$desc = "[$msgsource]: $desc" if ($msgsource && $desc);
print "$desc\n";
}
}
@@ -1224,6 +1232,11 @@ sub handle_response {
} else {
$desc = $node->{name};
}
if ($desc) {
$desc = "$desc: [$msgsource]" if ($msgsource);
} else {
$desc = "[$msgsource]" if ($msgsource);
}
if ($node->{errorcode}) {
if (ref($node->{errorcode}) eq 'ARRAY') {
foreach my $ecode (@{ $node->{errorcode} }) {
@@ -1274,7 +1287,7 @@ sub handle_response {
if ($node->{base64_data}) {
$desc = $desc . ": " . decode_base64($node->{base64_data}->[0]);
}
if ($desc) {
if ($desc && $desc ne "[$msgsource]") {
if ($errflg == 1) {
print STDERR ("$desc\n");
} else {
@@ -1306,7 +1319,10 @@ sub handle_response {
}
}
}
if ($desc) { print "$desc\n"; }
if ($desc) {
$desc = "[$msgsource]: $desc" if ($msgsource);
print "$desc\n";
}
}
}
} # end of handle_response

View File

@@ -147,6 +147,12 @@ OID, and have the switch table port value match exactly the format suggested by
return 0;
}
#HP calls their PortChannel interfaces "trunks"
#designated as Trk1, etc. don't match those
if ($namepersnmp =~ /Trk/) {
return 0;
}
#The blacklist approach has been exhausted. For now, assuming that means good,
#if something ambiguous happens, the whitelist would have been:
#'Port','Port #','/' (if namepercfg has no /, then / would be...),
@@ -219,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, @$_;
}
}
@@ -303,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 = ();
@@ -331,7 +337,12 @@ sub dump_mac_info {
if ($self->{show_verbose_info}) {
xCAT::MsgUtils->message("I", { data => ["<INFO>$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 => ["<INFO>$switch: Finished refreshing switch information."] }, $self->{callback});
}
@@ -356,6 +367,8 @@ sub dump_mac_info {
}
}
@{ $ret{$switch}->{$snmpportname}->{MACaddress} } = @{ $self->{macinfo}->{$switch}->{$snmpportname} };
@{ $ret{$switch}->{$snmpportname}->{Vlanid} } = @{ $self->{vlaninfo}->{$switch}->{$snmpportname} };
@{ $ret{$switch}->{$snmpportname}->{Mtu} } = @{ $self->{mtuinfo}->{$switch}->{$snmpportname} };
}
}
}
@@ -395,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) };
}
@@ -411,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;
@@ -436,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');
@@ -469,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' ]);
@@ -489,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 "") {
@@ -526,7 +549,11 @@ sub refresh_table {
if ($cpid == 0) {
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);
@@ -607,6 +634,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
@@ -680,7 +710,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);
unless (@res) {
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");
@@ -720,6 +797,15 @@ sub refresh_switch {
return;
}
# get mtu
my $iftomtumap = walkoid($session, '.1.3.6.1.2.1.2.2.1.4', silentfail => 1, verbose => $self->{show_verbose_info}, switch => $switch, callback => $self->{callback});
unless (defined($iftomtumap)) {
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
@@ -748,6 +834,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;
@@ -770,6 +860,9 @@ 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');
@@ -780,6 +873,9 @@ 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;
@@ -799,22 +895,38 @@ sub refresh_switch {
}
if (defined($self->{collect_mac_info})) {
my %index_to_mac = ();
my %index_to_vlan = ();
foreach (keys %$mactoindexmap) {
my $index = $mactoindexmap->{$_};
my @tmp = split /\./, $_;
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;
# 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;
my $port_name = $namemap->{ $bridgetoifmap->{$port_index} };
my $mtu = $iftomtumap->{ $bridgetoifmap->{$port_index} };
if (defined($index_to_mac{$port_index})) {
push @{ $self->{macinfo}->{$switch}->{$port_name} }, @{ $index_to_mac{$port_index} };
}
else {
$self->{macinfo}->{$switch}->{$port_name}->[0] = '';
}
if (defined($index_to_vlan{$port_index})) {
push @{ $self->{vlaninfo}->{$switch}->{$port_name} }, @{ $index_to_vlan{$port_index} };
}
else {
$self->{vlaninfo}->{$switch}->{$port_name}->[0] = '';
}
push @{ $self->{mtuinfo}->{$switch}->{$port_name} } , $mtu;
}
return;
}

View File

@@ -1645,10 +1645,14 @@ sub getNodeIPaddress
{
require xCAT::Table;
my $nodetocheck = shift;
my $port = shift;
my $nodeip;
if ($nodetocheck eq 'xCAT::NetworkUtils') { #was called with -> syntax
$nodetocheck = shift;
}
$nodeip = xCAT::NetworkUtils->getipaddr($nodetocheck);
# Quick return if pass in an IP
return $nodetocheck if (xCAT::NetworkUtils->isIpaddr($nodetocheck));
my $nodeip = xCAT::NetworkUtils->getipaddr($nodetocheck);
if (!$nodeip)
{
my $hoststab = xCAT::Table->new('hosts');
@@ -1666,6 +1670,51 @@ sub getNodeIPaddress
}
#-------------------------------------------------------------------------------
=head3 checkNodeIPaddress
Arguments:
Node name only one at a time
Returns: a hash object contains IP or Error
Globals:
none
Example: my $ipresult = xCAT::NetworkUtils::checkNodeIPaddress($nodetocheck);
=cut
#-------------------------------------------------------------------------------
sub checkNodeIPaddress
{
require xCAT::Table;
my $nodetocheck = shift;
if ($nodetocheck eq 'xCAT::NetworkUtils') { #was called with -> syntax
$nodetocheck = shift;
}
my $ret;
my $nodeip;
my $hoststab = xCAT::Table->new('hosts');
my $ent = $hoststab->getNodeAttribs($nodetocheck, ['ip']);
if ($ent->{'ip'}) {
$nodeip = $ent->{'ip'};
}
# Get the IP from DNS
my $dnsip = xCAT::NetworkUtils->getipaddr($nodetocheck);
if (!$dnsip)
{
$ret->{'error'} = "The $nodetocheck can not be resolved.";
$ret->{'ip'} = $nodeip if ($nodeip);
} elsif (!$nodeip) {
$ret->{'ip'} = $dnsip;
} else {
$ret->{'ip'} = $nodeip;
$ret->{'error'} = "Defined IP address of $nodetocheck is inconsistent with DNS." if ($nodeip ne $dnsip);
}
return $ret;
}
#-------------------------------------------------------------------------------
@@ -2729,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;

View File

@@ -217,14 +217,16 @@ sub add_ppc {
###############################
# Update hosts table
###############################
if ($otherinterfaces) {
$db{hosts}->setNodeAttribs($name,
{ otherinterfaces => $ips });
} else {
$db{hosts}->setNodeAttribs($name,
{ ip => $ips });
if ($ips) {
if ($otherinterfaces) {
$db{hosts}->setNodeAttribs($name,
{ otherinterfaces => $ips });
} else {
$db{hosts}->setNodeAttribs($name,
{ ip => $ips });
}
$db{hosts}{commit} = 1;
}
$db{hosts}{commit} = 1;
###############################
# Update mac table

View File

@@ -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<virsh nodedev-list> 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<virsh nodedev-list> 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)",
@@ -331,8 +331,8 @@ passed as argument rather than by table value',
'kernel' => 'The kernel that network boot actions should currently acquire and use. Note this could be a chained boot loader such as memdisk or a non-linux boot loader',
'initrd' => 'The initial ramdisk image that network boot actions should use (could be a DOS floppy or hard drive image if using memdisk as kernel)',
'kcmdline' => 'Arguments to be passed to the kernel',
'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::"',
'dhcpstatements' => 'xCAT manipulated custom dhcp statements (not intended for user manipulation)',
'addkcmdline' => 'User specified kernel options for os provision process(no prefix) or the provisioned os(with prefix "R::"). The options should be delimited with spaces(" ")',
'dhcpstatements' => 'xCAT manipulated custom dhcp statements (not intended for user manipulation)',
'adddhcpstatements' => 'Custom dhcp statements for administrator use (not implemneted yet)',
comments => 'Any user-written notes.',
disable => "Set to 'yes' or '1' to comment out this row.",
@@ -799,7 +799,7 @@ passed as argument rather than by table value',
imagename => 'The name of this xCAT OS image definition.',
template => 'The fully qualified name of the template file that will be used to create the OS installer configuration file for stateful installations (e.g. kickstart for RedHat, autoyast for SLES).',
boottarget => 'The name of the boottarget definition. When this attribute is set, xCAT will use the kernel, initrd and kernel params defined in the boottarget definition instead of the default.',
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.',
addkcmdline => '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.',
pkglist => 'The fully qualified name of the file that stores the distro packages list that will be included in the image. Make sure that if the pkgs in the pkglist have dependency pkgs, the dependency pkgs should be found in one of the pkgdir',
pkgdir => 'The name of the directory where the distro packages are stored. It could be set to multiple paths. The multiple paths must be separated by ",". The first path in the value of osimage.pkgdir must be the OS base pkg dir path, such as pkgdir=/install/rhels6.2/x86_64,/install/updates . In the os base pkg path, there are default repository data. And in the other pkg path(s), the users should make sure there are repository data. If not, use "createrepo" command to create them. For ubuntu, multiple mirrors can be specified in the pkgdir attribute, the mirrors must be prefixed by the protocol(http/ssh) and delimited with "," between each other.',
otherpkglist => 'The fully qualified name of the file that stores non-distro package lists that will be included in the image. It could be set to multiple paths. The multiple paths must be separated by ",".',
@@ -1029,8 +1029,9 @@ passed as argument rather than by table value',
" dhcpsetup: If set to 'n', it will skip the dhcp setup process in the nodeset cmd.\n\n" .
" dhcplease: The lease time for the dhcp client. The default value is 43200.\n\n" .
" disjointdhcps: If set to '1', the .leases file on a service node only contains\n" .
" the nodes it manages. The default value is '0'.\n" .
" '0' value means include all the nodes in the subnet.\n\n" .
" the nodes it manages. And when 'sharedtftp' is disabled, nodeset handles\n" .
" boot loader configuration on a service node only for the nodes it manages.\n" .
" The default value is '0'. It means include all the nodes in the subnet.\n\n" .
" pruneservices: Whether to enable service pruning when noderm is run (i.e.\n" .
" removing DHCP entries when noderm is executed)\n\n" .
" managedaddressmode: The mode of networking configuration during node provision.\n" .
@@ -1242,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" .
@@ -1538,14 +1551,14 @@ passed as argument rather than by table value',
If multiple ip addresses are associated with each NIC:
<nic1>!<ext1>|<ext2>,<nic2>!<ext1>|<ext2>,..., for example, eth0!-eth0|-eth0-ipv6,ib0!-ib0|-ib0-ipv6.
The xCAT object definition commands support to use nichostnamesuffixes.<nicname> 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',
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:
<nic1>!<ext1>,<nic2>!<ext2>,..., for example, eth0!eth0-,ib0!ib-
If multiple ip addresses are associated with each NIC:
<nic1>!<ext1>|<ext2>,<nic2>!<ext1>|<ext2>,..., for example, eth0!eth0-|eth0-ipv6i-,ib0!ib-|ib-ipv6-.
The xCAT object definition commands support to use nichostnameprefixes.<nicname> 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',
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. <nic1>!<type1>,<nic2>!<type2>, e.g. eth0!Ethernet,ib0!Infiniband. The xCAT object definition commands support to use nictypes.<nicname> as the sub attributes.',
niccustomscripts => 'Comma-separated list of custom scripts per NIC. <nic1>!<script1>,<nic2>!<script2>, e.g. eth0!configeth eth0, ib0!configib ib0. The xCAT object definition commands support to use niccustomscripts.<nicname> as the sub attribute
.',
@@ -1566,7 +1579,7 @@ passed as argument rather than by table value',
The xCAT object definition commands support to use nicextraparams.<nicname> as the sub attributes.',
nicdevices => 'Comma-separated list of NIC device per NIC, multiple ethernet devices can be bonded as bond device, these ethernet devices are separated by | . <nic1>!<dev1>|<dev3>,<nic2>!<dev2>, e.g. bond0!eth0|eth2,br0!bond0. The xCAT object definition commands support to use nicdevices.<nicname> as the sub attributes.',
nicsadapter => 'Comma-separated list of extra parameters that will be used for each NIC configuration.
<nic1>!<param1=value1 param2=value2>|<param3=value3>,<nic2>!<param4=value4 param5=value5>|<param6=value6>, for example, eth0!MTU=1500|MTU=1460,ib0!MTU=65520 CONNECTED_MODE=yes.',
<nic1>!<param1=value1 param2=value2>,<nic2>!<param4=value4 param5=value5>, for example, enP3p3s0f1!mac=98:be:94:59:fa:cd linkstate=DOWN,enP3p3s0f2!mac=98:be:94:59:fa:ce candidatename=enP3p3s0f2/enx98be9459face',
comments => 'Any user-written notes.',
disable => "Set to 'yes' or '1' to comment out this row.",
},

View File

@@ -2,6 +2,7 @@ package xCAT::Scope;
use xCAT::Utils;
use xCAT::Table;
use xCAT::TableUtils;
use xCAT::ServiceNodeUtils qw(getSNList);
@@ -125,16 +126,17 @@ sub get_parallel_scope {
=head3 get_broadcast_scope_with_parallel
Convert a request object to an array of multiple requests according to the
splitted node range.
splitted node range. Also it replicates the requests to all required service
nodes or management node.
Arguments:
Reference of request
Callback: TODO, Optional, the Callback will be used to filter the nodes
SN list: Array of target service nodes
Returns: An array of requests
Error:
none
Example:
my $reqs = xCAT::Scope->get_broadcast_scope($request);
my $reqs = xCAT::Scope->get_broadcast_scope_with_parallel($request, \@snlist);
=cut
#-----------------------------------------------------------------------------
@@ -145,25 +147,118 @@ sub get_broadcast_scope_with_parallel {
}
#Exit if the packet has been preprocessed in its history
if ($req->{_xcatpreprocessed}->[0] == 1) { return [$req]; }
$req->{_xcatpreprocessed}->[0] = 1;
#Handle the one for current management/service node
my $reqs = get_parallel_scope($req);
my @requests = @$reqs;
my $snlist = shift;
#Broadcast the request to other management/service nodes
foreach (xCAT::ServiceNodeUtils->getSNList()) {
if (xCAT::NetworkUtils->thishostisnot($_)) {
my $xcatdest = $_;
my $reqcopy = {%$req};
$reqcopy->{'_xcatdest'} = $_;
$reqcopy->{_xcatpreprocessed}->[0] = 1;
#Apply callback to filter the node range in future.
$reqs = get_parallel_scope($reqcopy);
foreach (@$reqs) {
push @requests, {%$_};
}
my $reqs = get_parallel_scope($req);
my @requests = (); # The request array will be return.
push @requests, @$reqs;
# when this method is called on service node, it is required to broadcast to MN too.
# get site.master from DB in order to dispatch to MN ( MN will not be added in servicenode table)
if ( xCAT::Utils->isServiceNode() ) {
my @entries = xCAT::TableUtils->get_site_attribute("master");
my $master = $entries[0];
foreach (@$reqs) {
my $reqcopy = {%$_};
$reqcopy->{'_xcatdest'} = $master;
push @requests, $reqcopy;
}
}
#Broadcast the request to all service nodes
foreach (@$snlist) {
my $xcatdest = $_;
next unless (xCAT::NetworkUtils->thishostisnot($xcatdest));
foreach (@$reqs) {
my $reqcopy = {%$_};
$reqcopy->{'_xcatdest'} = $xcatdest;
push @requests, $reqcopy;
}
}
return \@requests;
}
#-----------------------------------------------------------------------------
=head3 get_broadcast_disjoint_scope_with_parallel
Convert a request object to an array of multiple requests according to the
splitted node range. Also it replicates the requests to all required service
nodes or management node, but the request to a service node will only contains
the node range it manages.
Arguments:
Reference of request
SN hash: Hash of target service nodes => Managed CNs
Special servers: Array of servers, those servers are required to handle whole noderange.
Returns: An array of requests
Error:
none
Example:
my $reqs = xCAT::Scope->get_broadcast_disjoint_scope_with_parallel($request, \@snhash);
=cut
#-----------------------------------------------------------------------------
sub get_broadcast_disjoint_scope_with_parallel {
my $req = shift;
if ($req =~ /xCAT::Scope/) {
$req = shift;
}
#Exit if the packet has been preprocessed in its history
if ($req->{_xcatpreprocessed}->[0] == 1) { return [$req]; }
$req->{_xcatpreprocessed}->[0] = 1;
my $sn_hash = shift;
my $extras = shift;
my @requests = (); # The request array will be return.
my $reqs = get_parallel_scope($req);
my $handled4me = 0; # indicate myself is already handled.
my %prehandledhash = ();# the servers which is already handled.
foreach (@$extras) {
my $xcatdest = $_;
if (xCAT::NetworkUtils->thishostisnot($xcatdest)) {
# TODO, To avoid sending request to a multi-home server many times.
foreach (@$reqs) {
my $reqcopy = {%$_};
$reqcopy->{'_xcatdest'} = $xcatdest;
push @requests, $reqcopy;
}
$prehandledhash{$xcatdest} = 1;
} elsif ($handled4me == 0) {
push @requests, @$reqs;
$handled4me = 1;
}
}
#Broadcast the request to all available service nodes
foreach (keys %$sn_hash) {
my $xcatdest = $_;
# to check if the SN already handled
next if (exists($prehandledhash{$xcatdest}));
if (xCAT::NetworkUtils->thishostisnot($xcatdest)) {
my $reqcopy = {%$req};
$reqcopy->{'_xcatdest'} = $xcatdest;
$reqcopy->{'node'} = $sn_hash->{$xcatdest};
$reqs = get_parallel_scope($reqcopy);
push @requests, @$reqs;
} elsif ($handled4me == 0) {
my $reqcopy = {%$req};
$reqcopy->{'node'} = $sn_hash->{$xcatdest};
$reqs = get_parallel_scope($reqcopy);
push @requests, @$reqs;
$handled4me = 1;
}
}
return \@requests;
}

View File

@@ -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);
@@ -844,12 +960,28 @@ sub new
}
my $oldumask = umask 0077;
unless ($::XCAT_DBHS->{ $self->{connstring}, $self->{dbuser}, $self->{dbpass}, $self->{realautocommit} }) { #= $self->{tabname};
$::XCAT_DBHS->{ $self->{connstring}, $self->{dbuser}, $self->{dbpass}, $self->{realautocommit} } =
DBI->connect($self->{connstring}, $self->{dbuser}, $self->{dbpass}, { AutoCommit => $self->{realautocommit} });
my $retry = 0;
while (!$::XCAT_DBHS->{ $self->{connstring}, $self->{dbuser}, $self->{dbpass}, $self->{realautocommit} }) {
eval {
local $SIG{__WARN__} = sub {
my $message = shift;
if ($retry == 3 && $message) {
xCAT::MsgUtils->message("S", "Failed to connect to ".$self->{tabname}." table after retrying $retry times: $message");
}
};
$::XCAT_DBHS->{ $self->{connstring}, $self->{dbuser}, $self->{dbpass}, $self->{realautocommit} } =
DBI->connect($self->{connstring}, $self->{dbuser}, $self->{dbpass}, { AutoCommit => $self->{realautocommit} });
};
if ($::XCAT_DBHS->{ $self->{connstring}, $self->{dbuser}, $self->{dbpass}, $self->{realautocommit} }) {
last;
} elsif ($retry == 3) {
last;
} else {
sleep (2**$retry);
}
$retry++;
}
umask $oldumask;
$self->{dbh} = $::XCAT_DBHS->{ $self->{connstring}, $self->{dbuser}, $self->{dbpass}, $self->{realautocommit} };
#Store the Table object reference as afflicted by changes to the DBH
@@ -1437,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;
@@ -1588,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}; }
@@ -1630,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();
@@ -1704,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;
@@ -1765,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;
@@ -1787,6 +1931,7 @@ sub setAttribs
xCAT::NotifHandler->notify($action, $self->{tabname},
\@notif_data, \%new_notif_data);
}
$self->trace_db(END_TYPE);
return 0;
}
@@ -1834,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 = "";
@@ -1848,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();
@@ -1887,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);
}
@@ -1907,6 +2058,7 @@ sub setAttribsWhere
\@notif_data, \%new_notif_data);
}
$sth->finish;
$self->trace_db(END_TYPE);
return 0;
}
@@ -1952,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 = ();
@@ -2009,6 +2162,7 @@ sub setNodesAttribs {
}
$self->{dbh}->commit; #commit pending transactions
$self->{dbh}->{AutoCommit} = $oldac; #restore autocommit semantics
$self->trace_db(END_TYPE);
return;
}
@@ -2050,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;
@@ -2077,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);
}
@@ -2089,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 ";
@@ -2111,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);
@@ -2119,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);
}
#--------------------------------------------------------------------------
@@ -2154,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 = ();
@@ -2186,6 +2348,12 @@ sub getNodesAttribs {
$self->{nodelist}->{_use_cache} = 1;
}
my $rethash;
my @hierarchy_attrs = ();
my $hierarchy_field = xCAT::TableUtils->get_site_attribute("hierarchicalattrs");
if ($hierarchy_field) {
@hierarchy_attrs = split(/,/, $hierarchy_field);
}
$options{hierarchy_attrs} = \@hierarchy_attrs;
foreach (@$nodelist) {
my @nodeentries = $self->getNodeAttribs($_, \@realattribs, %options);
$rethash->{$_} = \@nodeentries; #$self->getNodeAttribs($_,\@attribs);
@@ -2194,6 +2362,7 @@ sub getNodesAttribs {
if ($self->{tabname} ne 'nodelist') {
$self->{nodelist}->{_use_cache} = 0;
}
$self->trace_db(END_TYPE);
return $rethash;
}
@@ -2271,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} = {};
@@ -2294,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');
#--------------------------------------------------------------------------
@@ -2421,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.");
@@ -2435,6 +2752,16 @@ sub getNodeAttribs
} else {
@attribs = @_;
}
if (!exists($options{hierarchy_attrs})) {
my @hierarchy_attrs = ();
my $hierarchy_field = xCAT::TableUtils->get_site_attribute("hierarchicalattrs");
if ($hierarchy_field) {
@hierarchy_attrs = split(/,/, $hierarchy_field);
}
$options{hierarchy_attrs} = \@hierarchy_attrs;
}
my $datum;
my $oldusecache;
my $nloldusecache;
@@ -2556,6 +2883,7 @@ sub getNodeAttribs
}
}
}
$self->trace_db(END_TYPE);
return wantarray ? @data : $data[0];
}
@@ -2732,12 +3060,7 @@ sub getNodeAttribs_nosub_returnany
my $attrib;
my $result;
my @hierarchy_attrs;
my $hierarchy_field = xCAT::TableUtils->get_site_attribute("hierarchicalattrs");
if ($hierarchy_field) {
@hierarchy_attrs = split(/,/, $hierarchy_field);
}
my @hierarchy_attrs = @{ $options{hierarchy_attrs} };
my $data = $results[0];
if (defined {$data}) { #if there was some data for the node, loop through and check it
foreach $result (@results) {
@@ -2902,7 +3225,6 @@ sub getNodeAttribs_nosub_returnany
}
}
}
return @results;
}
@@ -2941,6 +3263,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.");
@@ -2955,12 +3278,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)
@@ -2973,6 +3299,7 @@ sub getAllEntries
push @rets, $data;
}
$query->finish();
$self->trace_db(END_TYPE);
return \@rets;
}
@@ -3035,6 +3362,7 @@ sub getAllAttribsWhere
if ($dbworkerpid > 0) {
return dbc_call($self, 'getAllAttribsWhere', @_);
}
$self->trace_db(START_TYPE);
my $clause = shift;
my $whereclause;
my @attribs = @_;
@@ -3051,8 +3379,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 = ();
@@ -3080,6 +3410,7 @@ sub getAllAttribsWhere
}
}
$query->finish();
$self->trace_db(END_TYPE);
return @results;
}
@@ -3118,6 +3449,7 @@ sub getAllNodeAttribs
if ($dbworkerpid > 0) {
return dbc_call($self, 'getAllNodeAttribs', @_);
}
$self->trace_db(START_TYPE);
my $attribq = shift;
my $hashretstyle = shift;
my %options = @_;
@@ -3138,8 +3470,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}) {
@@ -3170,7 +3504,13 @@ sub getAllNodeAttribs
#} end SF 3580
#my $localhash = $self->getNodesAttribs(\@nodes,$attribq); #NOTE: This is stupid, rebuilds the cache for every entry, FIXME
my %options;
my @hierarchy_attrs = ();
my $hierarchy_field = xCAT::TableUtils->get_site_attribute("hierarchicalattrs");
if ($hierarchy_field) {
@hierarchy_attrs = split(/,/, $hierarchy_field);
}
$options{hierarchy_attrs} = \@hierarchy_attrs;
foreach (@nodes)
{
if ($donenodes{$_}) { next; }
@@ -3184,7 +3524,7 @@ sub getAllNodeAttribs
# }
#} else {
my @attrs =
$self->getNodeAttribs($_, $attribq); #@{$localhash->{$_}} #$self->getNodeAttribs($_, $attribq)
$self->getNodeAttribs($_, $attribq, %options); #@{$localhash->{$_}} #$self->getNodeAttribs($_, $attribq)
; #Logic moves to getNodeAttribs
#}
#populate node attribute by default, this sort of expansion essentially requires it.
@@ -3205,6 +3545,7 @@ sub getAllNodeAttribs
$self->{_use_cache} = 0;
$self->{nodelist}->{_use_cache} = 0;
$query->finish();
$self->trace_db(END_TYPE);
if ($hashretstyle) {
return $rethash;
} else {
@@ -3246,9 +3587,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;
}
@@ -3278,8 +3620,10 @@ sub getAllAttribs
}
if (@results)
{
$self->trace_db(END_TYPE);
return @results; #return wantarray ? @results : $results[0];
}
$self->trace_db(END_TYPE);
return undef;
}
@@ -3288,10 +3632,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 = ();
@@ -3308,6 +3654,7 @@ sub getAllAttribs
}
}
$query->finish();
$self->trace_db(END_TYPE);
return @results;
}
@@ -3351,6 +3698,7 @@ sub delEntries
if ($dbworkerpid > 0) {
return dbc_call($self, 'delEntries', @_);
}
$self->trace_db(START_TYPE);
my $keyref = shift;
my @all_keyparis;
my %keypairs;
@@ -3395,10 +3743,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});
@@ -3433,8 +3781,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
@@ -3445,7 +3795,7 @@ sub delEntries
}
@pieces = splice(@all_keyparis, 0, $record_num);
}
$self->trace_db(END_TYPE);
}
#--------------------------------------------------------------------------
@@ -3484,6 +3834,7 @@ sub getAttribs
if ($dbworkerpid > 0) {
return dbc_call($self, 'getAttribs', @_);
}
$self->trace_db(START_TYPE);
#my $key = shift;
#my $keyval = shift;
@@ -3544,8 +3895,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;
}
@@ -3578,11 +3932,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())
{
@@ -3603,8 +3960,10 @@ sub getAttribs
$query->finish();
if (@return)
{
$self->trace_db(END_TYPE);
return wantarray ? @return : $return[0];
}
$self->trace_db(END_TYPE);
return undef;
}
@@ -3644,10 +4003,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())
{
@@ -3665,8 +4027,10 @@ sub getTable
$query->finish();
if (@return)
{
$self->trace_db(END_TYPE);
return @return;
}
$self->trace_db(END_TYPE);
return undef;
}
@@ -4123,6 +4487,7 @@ sub writeAllEntries
if ($dbworkerpid > 0) {
return dbc_call($self, 'writeAllEntries', @_);
}
$self->trace_db(START_TYPE);
my $filename = shift;
my $fh;
my $rc = 0;
@@ -4131,6 +4496,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;
@@ -4146,9 +4512,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)
@@ -4162,6 +4530,7 @@ sub writeAllEntries
}
$query->finish();
CORE::close($fh);
$self->trace_db(END_TYPE);
return $rc;
}
@@ -4204,6 +4573,7 @@ sub writeAllAttribsWhere
if ($dbworkerpid > 0) {
return dbc_call($self, 'writeAllAttribsWhere', @_);
}
$self->trace_db(START_TYPE);
my $clause = shift;
my $filename = shift;
my $whereclause;
@@ -4218,6 +4588,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;
@@ -4235,8 +4606,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) {
@@ -4250,6 +4623,7 @@ sub writeAllAttribsWhere
}
$query->finish();
CORE::close($fh);
$self->trace_db(END_TYPE);
return $rc;
}
@@ -4325,6 +4699,7 @@ sub getMAXMINEntries
if ($dbworkerpid > 0) {
return dbc_call($self, 'getMAXMINEntries', @_);
}
$self->trace_db(START_TYPE);
my $attr = shift;
my $rets;
my $query;
@@ -4338,9 +4713,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)
@@ -4362,9 +4739,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)
@@ -4378,6 +4757,7 @@ sub getMAXMINEntries
last; # better be only one value for min
}
}
$self->trace_db(END_TYPE);
return $rets;
}
1;

View File

@@ -32,7 +32,7 @@ my %usage = (
rpower noderange [on|off|reset|boot|stat|state|status]
rpower noderange [pduon|pduoff|pdustat]
OpenPOWER OpenBMC:
rpower noderange [on|off|reset|boot|stat|state|status]
rpower noderange [on|off|softoff|reset|boot|bmcreboot|bmcstate|stat|state|status]
KVM Virtualization specific:
rpower <noderange> [boot] [ -c <path to iso> ]
PPC (with IVM or HMC) specific:
@@ -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 <noderange> [all [-s]|clear|<number of entries to retrieve> [-s]] [-V|--verbose]
reventlog [-h|--help|-v|--version]",
@@ -118,7 +120,7 @@ my %usage = (
pdu specific:
rinv noderange ",
"rsetboot" =>
"Usage: rsetboot <noderange> [net|hd|cd|floppy|def|stat] [-V|--verbose] [-u] [-p]
"Usage: rsetboot <noderange> [net|hd|cd|floppy|def|stat] [-u] [-p]
rsetboot [-h|--help|-v|--version]",
"rbootseq" =>
"Usage:
@@ -143,7 +145,7 @@ my %usage = (
rspconfig <noderange> [garp=<number of 1/2 second>]
rspconfig <noderange> [userid=<userid> username=<username> password=<password>]
OpenBMC specific:
rspconfig <noderange> [ip|netmask|gateway|vlan]
rspconfig <noderange> [ip|netmask|gateway|hostname|vlan]
iDataplex specific:
rspconfig <noderange> [thermprofile]
rspconfig <noderange> [thermprofile=<two digit number from chassis>]
@@ -321,6 +323,9 @@ my %usage = (
"Usage: lsslp [-h|--help|-v|--version]
lsslp [<noderange>][-V|--verbose][-i ip[,ip..]][-w][-r|-x|-z][-n][-I][-s FRAME|CEC|MM|IVM|RSA|HMC|CMM|IMM2|FSP]
[-u] [--range IPranges][-t tries][--vpdtable][-C counts][-T timeout]",
"pdudiscover" =>
"Usage: pdudiscover [-h|--help|-v|--version]
pdudiscover [<noderange>|--range ipranges] [-r|-x|-z] [-w] [-V|--verbose] [--setup]",
"switchdiscover" =>
"Usage: switchdiscover [-h|--help|-v|--version]
switchdiscover [<noderange>|--range ipranges] [-s scan_methods] [-r|-x|-z] [-w] [-V|--verbose] [--setup]",
@@ -341,8 +346,13 @@ my %usage = (
rflash <noderange> -p <rpm_directory> [--activate {disruptive|deferred}] [-d <data_directory>]
rflash <noderange> [--commit | --recover] [-V|--verbose]
rflash <noderange> [--bpa_acdl]
PPC64LE (using BMC Management) specific:
rflash <noderange> [-c | --check] [--retry=<count>] [-V] <hpm_file>",
OpenPOWER BMC specific (using IPMI):
rflash <noderange> [<hpm_file_path>|-d <data_directory>] [-c|--check] [--retry=<count>] [-V]
rflash <noderange> --recover <bmc_file_path>
OpenPOWER OpenBMC specific:
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]}",
"mkhwconn" =>
"Usage:
mkhwconn [-h|--help]
@@ -483,7 +493,7 @@ Options:
"Usage:
Common:
nodeset [-h|--help|-v|--version]
nodeset <noderange> [shell|boot|runcmd=bmcsetup|osimage[=<imagename>]|offline|shutdown|stat]",
nodeset <noderange> [shell|boot|runcmd=bmcsetup|osimage[=<imagename>]|offline|shutdown|stat [-a]]",
"rmflexnode" =>
"Usage:
rmflexnode [-h|--help|-v|--version]

View File

@@ -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;
}
@@ -4017,14 +4024,14 @@ sub servicemap {
# (general service name) => {list of possible service names}
#
my %svchash = (
"dhcp" => [ "dhcp3-server", "dhcpd", "isc-dhcp-server" ],
"nfs" => [ "nfsserver", "nfs-server", "nfs", "nfs-kernel-server" ],
"named" => [ "named", "bind9" ],
"syslog" => [ "syslog", "syslogd", "rsyslog" ],
"firewall" => [ "iptables", "firewalld", "ufw" ],
"http" => [ "apache2", "httpd" ],
"ntpserver" => [ "ntpd", "ntp" ],
"mysql" => [ "mysqld", "mysql" ],
"dhcp" => [ "dhcp3-server", "dhcpd", "isc-dhcp-server" ],
"nfs" => [ "nfsserver", "nfs-server", "nfs", "nfs-kernel-server" ],
"named" => [ "named", "bind9" ],
"syslog" => [ "syslog", "syslogd", "rsyslog" ],
"firewall" => [ "iptables", "firewalld", "ufw" ],
"http" => [ "apache2", "httpd" ],
"ntpserver" => [ "ntpd", "ntp" ],
"mysql" => [ "mysqld", "mysql", "mariadb" ],
);
my $path = undef;
@@ -4903,4 +4910,5 @@ sub acquire_lock_imageop {
return (0,$lock);
}
1;

View File

@@ -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

525
travis.pl Normal file
View File

@@ -0,0 +1,525 @@
# IBM(c) 2007 EPL license http://www.eclipse.org/legal/epl-v10.html
use strict;
use warnings;
use Getopt::Long;
use Data::Dumper;
use Time::Local;
use File::Basename;
use File::Path;
use File::Find;
use LWP::UserAgent;
use HTTP::Request;
use Encode;
use Encode::CN;
use JSON;
use URI::Escape;
use LWP::Simple;
use Term::ANSIColor qw(:constants);
$Term::ANSIColor::AUTORESET = 1;
#---Global attributes---
my $rst = 0;
my $check_result_str="``CI CHECK RESULT`` : ";
my $last_func_start = timelocal(localtime());
#--------------------------------------------------------
# Fuction name: runcmd
# Description: run a command after 'cmd' label in one case
# Atrributes:
# Retrun code:
# $::RUNCMD_RC : the return code of command
# @$outref : the output of command
#--------------------------------------------------------
sub runcmd
{
my ($cmd) = @_;
my $rc = 0;
$::RUNCMD_RC = 0;
my $outref = [];
@$outref = `$cmd 2>&1`;
if ($?)
{
$rc = $?;
$rc = $rc >> 8;
$::RUNCMD_RC = $rc;
}
chomp(@$outref);
return @$outref;
}
#--------------------------------------------------------
# Fuction name: get_files_recursive
# Description: Search all file in one directory recursively
# Atrributes:
# $dir (input attribute)
# The target scan directory
# $files_path_ref (output attribute)
# the reference of array where save all vaild files under $dir
# Retrun code:
#--------------------------------------------------------
sub get_files_recursive
{
my $dir = shift;
my $files_path_ref = shift;
my $fd = undef;
if(!opendir($fd, $dir)){
print "[get_files_recursive]: failed to open $dir :$!\n";
return 1;
}
for (; ;)
{
my $direntry = readdir($fd);
last unless (defined($direntry));
next if ($direntry =~ m/^\.\w*/);
next if ($direntry eq '..');
my $target = "$dir/$direntry";
if (-d $target) {
get_files_recursive($target, $files_path_ref);
} else {
push(@{$files_path_ref}, glob("$target\n"));
}
}
closedir($fd);
return 0;
}
#--------------------------------------------------------
# Fuction name: check_pr_format
# Description:
# Atrributes:
# Retrun code:
#--------------------------------------------------------
sub check_pr_format{
if($ENV{'TRAVIS_EVENT_TYPE'} eq "pull_request"){
my $pr_url = "https://api.github.com/repos/$ENV{'TRAVIS_REPO_SLUG'}/pulls/$ENV{'TRAVIS_PULL_REQUEST'}";
my $pr_url_resp = get($pr_url);
my $pr_content = decode_json($pr_url_resp);
my $pr_title = $pr_content->{title};
my $pr_body = $pr_content->{body};
#print "[check_pr_format] Dumper pr_content:\n";
#print Dumper $pr_content;
print "[check_pr_format] pr title = $pr_title\n";
print "[check_pr_format] pr body = $pr_body \n";
my $checkrst="";
if(! $pr_title){
$checkrst.="Miss title.";
}
if(! $pr_body){
$checkrst.="Miss description.";
}
if(length($checkrst) == 0){
$check_result_str .= "> **PR FORMAT CORRECT**";
send_back_comment("$check_result_str");
}else{
$check_result_str .= "> **PR FORMAT ERROR** : $checkrst";
send_back_comment("$check_result_str");
return 1;
}
}
return 0;
}
#--------------------------------------------------------
# Fuction name: check_pr_format
# Description:
# Atrributes:
# Retrun code:
#--------------------------------------------------------
sub send_back_comment{
my $message = shift;
my $comment_url = "https://api.github.com/repos/$ENV{'TRAVIS_REPO_SLUG'}/issues/$ENV{'TRAVIS_PULL_REQUEST'}/comments";
my $comment_url_resp = get($comment_url);
my $json = new JSON;
my $comment_content = $json->decode($comment_url_resp);
my $comment_len = @$comment_content;
#print "\n\n>>>>>Dumper comment_content: $comment_len\n";
#print Dumper $comment_content;
my $post_url = $comment_url;
my $post_method = "POST";
if($comment_len > 0){
foreach my $comment (@{$comment_content}){
if($comment->{'body'} =~ /CI CHECK RESULT/) {
$post_url = $comment->{'url'};
$post_method = "PATCH";
}
}
}
print "[send_back_comment] method = $post_method to $post_url\n";
`curl -u "$ENV{'xcatbotuser'}:$ENV{'xcatbotpw'}" -X $post_method -d '{"body":"$message"}' $post_url`;
}
#--------------------------------------------------------
# Fuction name: build_xcat_core
# Description:
# Atrributes:
# Retrun code:
#--------------------------------------------------------
sub build_xcat_core{
my @output;
my @cmds = ("gpg --list-keys",
"sed -i '/SignWith: yes/d' $ENV{'PWD'}/build-ubunturepo");
foreach my $cmd (@cmds){
print "[build_xcat_core] to run $cmd\n";
@output = runcmd("$cmd");
if($::RUNCMD_RC){
print "[build_xcat_core] $cmd ....[Failed]\n";
send_back_comment("> **BUILD ERROR** : $cmd failed. Please click ``Details`` label in ``Merge pull request`` box for detailed information");
return 1;
}
}
my $cmd = "sudo ./build-ubunturepo -c UP=0 BUILDALL=1";
@output = runcmd("$cmd");
print ">>>>>Dumper the output of '$cmd'\n";
print Dumper \@output;
if($::RUNCMD_RC){
my $lastline = $output[-1];
$lastline =~ s/[\r\n\t\\"']*//g;
print "[build_xcat_core] $cmd ....[Failed]\n";
#print ">>>>>Dumper the output of '$cmd'\n";
#print Dumper \@output;
$check_result_str .= "> **BUILD ERROR**, Please click ``Details`` label in ``Merge pull request`` box for detailed information";
send_back_comment("$check_result_str");
return 1;
}else{
print "[build_xcat_core] $cmd ....[Pass]\n";
$check_result_str .= "> **BUILD SUCCESSFUL** ";
send_back_comment("$check_result_str");
}
# my $buildpath ="/home/travis/build/xcat-core/";
# my @buildfils = ();
# get_files_recursive("$buildpath", \@buildfils);
# print "\n-----------Dumper build files-----------\n";
# print Dumper \@buildfils;
return 0;
}
#--------------------------------------------------------
# Fuction name: install_xcat
# Description:
# Atrributes:
# Retrun code:
#--------------------------------------------------------
sub install_xcat{
my @cmds = ("cd ./../../xcat-core && sudo ./mklocalrepo.sh",
"sudo chmod 777 /etc/apt/sources.list",
"sudo echo \"deb [arch=amd64] http://xcat.org/files/xcat/repos/apt/xcat-dep trusty main\" >> /etc/apt/sources.list",
"sudo echo \"deb [arch=ppc64el] http://xcat.org/files/xcat/repos/apt/xcat-dep trusty main\" >> /etc/apt/sources.list",
"sudo wget -q -O - \"http://xcat.org/files/xcat/repos/apt/apt.key\" | sudo apt-key add -",
"sudo apt-get -qq update");
my @output;
foreach my $cmd (@cmds){
print "[install_xcat] to run $cmd\n";
@output = runcmd("$cmd");
if($::RUNCMD_RC){
print RED "[install_xcat] $cmd. ...[Failed]\n";
print "[install_xcat] error message:\n";
print Dumper \@output;
$check_result_str .= "> **INSTALL XCAT ERROR** : Please click ``Details`` label in ``Merge pull request`` box for detailed information ";
send_back_comment("$check_result_str");
return 1;
}
}
my $cmd = "sudo apt-get install xcat --force-yes";
@output = runcmd("$cmd");
#print ">>>>>Dumper the output of '$cmd'\n";
#print Dumper \@output;
if($::RUNCMD_RC){
my $lastline = $output[-1];
$lastline =~ s/[\r\n\t\\"']*//g;
print "[install_xcat] $cmd ....[Failed]\n";
print ">>>>>Dumper the output of '$cmd'\n";
print Dumper \@output;
$check_result_str .= "> **INSTALL XCAT ERROR** : Please click ``Details`` label in ``Merge pull request`` box for detailed information";
send_back_comment("$check_result_str");
return 1;
}else{
print "[install_xcat] $cmd ....[Pass]\n";
print "\n------To config xcat and check if xcat work correctly-----\n";
@cmds = ("sudo -s /opt/xcat/share/xcat/scripts/setup-local-client.sh -f travis",
"sudo -s /opt/xcat/sbin/chtab priority=1.1 policy.name=travis policy.rule=allow",
". /etc/profile.d/xcat.sh && tabdump policy",
". /etc/profile.d/xcat.sh && tabdump site",
". /etc/profile.d/xcat.sh && lsxcatd -a",
"ls /opt/xcat/sbin",
"service xcatd status");
my $ret = 0;
foreach my $cmd (@cmds){
print "\n[install_xcat] To run $cmd.....\n";
@output = runcmd("$cmd");
print Dumper \@output;
if($::RUNCMD_RC){
print RED "[install_xcat] $cmd. ...[Failed]\n";
#print Dumper \@output;
$ret = 1;
}else{
print "[install_xcat] $cmd....[Pass]\n";
}
}
if($ret){
$check_result_str .= "> **INSTALL XCAT ERROR** : Please click ``Details`` label in ``Merge pull request`` box for detailed information";
send_back_comment("$check_result_str");
return 1;
}
$check_result_str .= "> **INSTALL XCAT SUCCESSFUL**";
send_back_comment("$check_result_str");
}
return 0;
}
#--------------------------------------------------------
# Fuction name: check_syntax
# Description:
# Atrributes:
# Retrun code:
#--------------------------------------------------------
sub check_syntax{
my @output;
my @syntax_err;
my $ret = 0;
my @target_dirs=("/opt/xcat",
"/install");
foreach my $dir (@target_dirs){
my @files = ();
get_files_recursive("$dir", \@files);
foreach my $file (@files) {
next if($file =~ /\/opt\/xcat\/share\/xcat\/netboot\/genesis\//);
next if($file =~ /\/opt\/xcat\/probe\//);
@output = runcmd("file $file");
if($output[0] =~ /perl /i){
@output = runcmd("sudo bash -c '. /etc/profile.d/xcat.sh && perl -I /opt/xcat/lib/perl -I /opt/xcat/lib -I /usr/lib/perl5 -I /usr/share/perl -c $file'");
if($::RUNCMD_RC){
push @syntax_err, @output;
$ret = 1;
}
#}elsif($output[0] =~ /shell/i){
# @output = runcmd("sudo bash -c '. /etc/profile.d/xcat.sh && sh -n $file'");
# if($::RUNCMD_RC){
# push @syntax_err, @output;
# $ret = 1;
# }
}
}
}
if(@syntax_err){
print "[check_syntax] syntax checking ....[Failed]\n";
print "[check_syntax] Dumper error message:\n";
print Dumper @syntax_err;
$check_result_str .= "> **CODE SYNTAX ERROR** : Please click ``Details`` label in ``Merge pull request`` box for detailed information";
send_back_comment("$check_result_str");
}else{
print "[check_syntax] syntax checking ....[Pass]\n";
$check_result_str .= "> **CODE SYNTAX CORRECT**";
send_back_comment("$check_result_str");
}
return $ret;
}
#--------------------------------------------------------
# Fuction name: run_fast_regression_test
# Description:
# Atrributes:
# Retrun code:
#--------------------------------------------------------
sub run_fast_regression_test{
my $cmd = "sudo apt-get install xcat-test --force-yes";
my @output = runcmd("$cmd");
if($::RUNCMD_RC){
print RED "[run_fast_regression_test] $cmd ....[Failed]\n";
print Dumper \@output;
return 1;
}else{
print "[run_fast_regression_test] $cmd .....:\n";
print Dumper \@output;
}
$cmd = "sudo bash -c '. /etc/profile.d/xcat.sh && xcattest -l bundleinfo'";
@output = runcmd("$cmd");
if($::RUNCMD_RC){
print RED "[run_fast_regression_test] $cmd ....[Failed]\n";
print "[run_fast_regression_test] error dumper:\n";
print Dumper \@output;
return 1;
}else{
print "[run_fast_regression_test] $cmd .....:\n";
print Dumper \@output;
}
my $hostname = `hostname`;
chomp($hostname);
print "hostname = $hostname\n";
my $conf_file = "$ENV{'PWD'}/regression.conf";
$cmd = "echo '[System]' > $conf_file; echo 'MN=$hostname' >> $conf_file; echo '[Table_site]' >> $conf_file; echo 'key=domain' >>$conf_file; echo 'value=pok.stglabs.ibm.com' >> $conf_file";
@output = runcmd("$cmd");
if($::RUNCMD_RC){
print RED "[run_fast_regression_test] $cmd ....[Failed]";
print "[run_fast_regression_test] error dumper:\n";
print Dumper \@output;
return 1;
}
print "Dumper regression conf file:\n";
@output = runcmd("cat $conf_file");
print Dumper \@output;
my @caseslist = runcmd("sudo bash -c '. /etc/profile.d/xcat.sh && xcattest -l caselist -b MN_basic.bundle'");
my $casenum = @caseslist;
my $x = 0;
my @failcase;
my $passnum = 0;
my $failnum = 0;
foreach my $case (@caseslist){
++$x;
$cmd = "sudo bash -c '. /etc/profile.d/xcat.sh && xcattest -f $conf_file -t $case'";
print "[run_fast_regression_test] run $x: $cmd\n";
@output = runcmd("$cmd");
#print Dumper \@output;
for(my $i = $#output; $i>-1; --$i){
if($output[$i] =~ /------END::(.+)::Failed/){
push @failcase, $1;
++$failnum;
print Dumper \@output;
last;
}elsif ($output[$i] =~ /------END::(.+)::Passed/){
++$passnum;
last;
}
}
}
if($failnum){
my $log_str = join (",", @failcase );
$check_result_str .= "> **FAST REGRESSION TEST Failed**: Totalcase $casenum Pass $passnum failed $failnum FailedCases: $log_str. Please click ``Details`` label in ``Merge pull request`` box for detailed information";
send_back_comment("$check_result_str");
return 1;
}else{
$check_result_str .= "> **FAST REGRESSION TEST Successful**: Totalcase $casenum Pass $passnum failed $failnum";
send_back_comment("$check_result_str");
}
return 0;
}
#--------------------------------------------------------
# Fuction name: run_fast_regression_test
# Description:
# Atrributes:
# Retrun code:
#--------------------------------------------------------
sub mark_time{
my $func_name=shift;
my $nowtime = timelocal(localtime());
my $nowtime_str = scalar(localtime());
my $duration = $nowtime - $last_func_start;
$last_func_start = $nowtime;
print "[mark_time] $nowtime_str, ElapsedTime of $func_name is $duration s\n";
}
#===============Main Process=============================
#Dumper Travis Environment Attribute
print GREEN "\n------Dumper Travis Environment Attribute------\n";
my @travis_env_attr = ("TRAVIS_REPO_SLUG",
"TRAVIS_BRANCH",
"TRAVIS_EVENT_TYPE",
"TRAVIS_PULL_REQUEST",
"GITHUB_TOKEN",
"USERNAME",
"PASSWORD",
"PWD");
foreach (@travis_env_attr){
if($ENV{$_}) {
print "$_ = '$ENV{$_}'\n";
} else {
print "$_ = ''\n";
}
}
my @os_info = runcmd("cat /etc/os-release");
print "Current OS information:\n";
print Dumper \@os_info;
my @perl_vserion = runcmd("perl -v");
print "Current perl information:\n";
print Dumper \@perl_vserion;
#my @sh_version = runcmd("sudo bash -c 'sh --version'");
#print "Current sh information:\n";
#print Dumper \@sh_version;
my @disk = runcmd("df -h");
print "Disk information:\n";
print Dumper \@disk;
#Start to check the format of pull request
$last_func_start = timelocal(localtime());
print GREEN "\n------To Check Pull Request Format------\n";
$rst = check_pr_format();
if($rst){
print RED "Check pull request format failed\n";
exit $rst;
}
mark_time("check_pr_format");
#Start to build xcat core
print GREEN "\n------To Build xCAT core package------\n";
$rst = build_xcat_core();
if($rst){
print RED "Build xCAT core package failed\n";
exit $rst;
}
mark_time("build_xcat_core");
#Start to install xcat
print GREEN "\n------To install xcat------\n";
$rst = install_xcat();
if($rst){
print RED "Install xcat failed\n";
exit $rst;
}
mark_time("install_xcat");
#Check the syntax of changing code
print GREEN "\n------To check the syntax of changing code------\n";
$rst = check_syntax();
if($rst){
print RED "check the syntax of changing code failed\n";
exit $rst;
}
mark_time("check_syntax");
#run fast regression
print GREEN "\n------To run fast regression test------\n";
$rst = run_fast_regression_test();
if($rst){
print RED "Run fast regression test failed\n";
exit $rst;
}
mark_time("run_fast_regression_test");
exit 0;

View File

@@ -72,6 +72,8 @@ $::pgcmddir = "/usr/bin"; # pg cmds location
$::debiancfgdir = "/etc/postgresql/9.1/main";
my $INIT;
my $SETUPODBC;
my @LISTENADDRS;
my @ACCESSADDRS;
my $NOSTART;
my $SETUPPCM;
my $HELP;
@@ -83,6 +85,8 @@ if (
!GetOptions(
'i|init' => \$INIT,
'o|odbc' => \$SETUPODBC,
'l|listen=s'=> \@LISTENADDRS,
'a|access=s'=> \@ACCESSADDRS,
'N|nostart' => \$NOSTART,
'P|PCM' => \$SETUPPCM,
'h|help' => \$HELP,
@@ -128,6 +132,13 @@ if ((!($INIT)) && ($SETUPODBC))
}
# create comma-separated list of additional listen addresses
my $listenaddrs = undef;
if (@LISTENADDRS)
{
$listenaddrs = join ',', @LISTENADDRS;
}
#
# Get OS
#
@@ -428,7 +439,7 @@ sub usage
"Usage:\npgsqlsetup - Performs the setup of PostgreSQL for xCAT to use as its database. See man pgsqlsetup for more information."
);
my $msg =
"pgsqlsetup <-h|--help>\n <-v|--version>\n <-i|--init> [-N|--nostart] [-P|--PCM] [-o|--odbc] [-V|--verbose]\n <-o|--odbc> [-V|--verbose]";
"pgsqlsetup <-h|--help>\n <-v|--version>\n <-i|--init> [-N|--nostart] [-l|--listen address] [-a|--access address] [-P|--PCM] [-o|--odbc] [-V|--verbose]\n <-o|--odbc> [-V|--verbose]";
xCAT::MsgUtils->message('I', "$msg");
}
@@ -726,7 +737,8 @@ sub initpgdb
}
&runpostgrescmd($cmd);
# insert MN ip address in the # IPv4 local connections: stanza of
# insert MN ip address and any -a addresses
# in the # IPv4 local connections: stanza of
# the /var/lib/pgsql/data/pg_hba.conf file
# if it is not already there
@@ -735,43 +747,44 @@ sub initpgdb
if ($debianflag) {
$hbafile = $::debiancfgdir . "/pg_hba.conf";
}
$cmd = "fgrep $::MN $hbafile";
$cmd = "cp $hbafile $hbafile.org"; # backup the original
xCAT::Utils->runcmd($cmd, -1);
if ($::RUNCMD_RC != 0) # not already there
{
$cmd = "cp $hbafile $hbafile.org"; # backup the original
push @ACCESSADDRS, $::MN; # add management node to list
my $insertstr = undef; # start with empty string
for my $hbaaccess (@ACCESSADDRS)
{
$cmd = "fgrep $hbaaccess $hbafile";
xCAT::Utils->runcmd($cmd, -1);
my $insertstr = "host all all ";
$insertstr .= $::MN;
$insertstr .= "\/32 md5 ";
$cmd =
"awk '{gsub(\"\IPv4 local connections:\",\"\IPv4 local connections:\\n$insertstr \"); print}' $hbafile > $hbafile.xcat";
xCAT::Utils->runcmd($cmd, 0);
if ($::RUNCMD_RC != 0)
if ($::RUNCMD_RC != 0) # not already there
{
xCAT::MsgUtils->message("E", " $cmd failed.");
exit(1);
$insertstr .= "host all all ";
$insertstr .= $hbaaccess;
$insertstr .= "\/32 md5\\n "; # add entry line to string
}
$cmd = "cp -p $hbafile.xcat $hbafile ";
xCAT::Utils->runcmd($cmd, 0);
if ($::RUNCMD_RC != 0)
{
xCAT::MsgUtils->message("E", " $cmd failed.");
exit(1);
}
$cmd = "rm $hbafile.xcat ";
xCAT::Utils->runcmd($cmd, 0);
if ($::RUNCMD_RC != 0)
{
xCAT::MsgUtils->message("E", " $cmd failed.");
exit(1);
}
$dbrestart = 1;
}
}
$cmd = "awk '{gsub(\"\IPv4 local connections:\",\"\IPv4 local connections:\\n$insertstr \"); print}' $hbafile > $hbafile.xcat";
xCAT::Utils->runcmd($cmd, 0);
if ($::RUNCMD_RC != 0)
{
xCAT::MsgUtils->message("E", " $cmd failed.");
exit(1);
}
$cmd = "cp -p $hbafile.xcat $hbafile ";
xCAT::Utils->runcmd($cmd, 0);
if ($::RUNCMD_RC != 0)
{
xCAT::MsgUtils->message("E", " $cmd failed.");
exit(1);
}
$cmd = "rm $hbafile.xcat ";
xCAT::Utils->runcmd($cmd, 0);
if ($::RUNCMD_RC != 0)
{
xCAT::MsgUtils->message("E", " $cmd failed.");
exit(1);
}
$dbrestart = 1;
# setup the postgresql.conf file
my $pgconf = $::installdatadir;
@@ -789,6 +802,10 @@ sub initpgdb
if ($::osname eq 'Linux')
{
$cmd = qq~ echo listen_addresses = \\'localhost,$::MN\\' >> $pgconf~;
if ($::listenaddrs)
{
$cmd = qq~ echo listen_addresses = \\'localhost,$::MN,$::listenaddrs\\' >> $pgconf~;
}
`$cmd`;
}
@@ -796,6 +813,10 @@ sub initpgdb
if ($::osname eq 'AIX')
{
$cmd = qq~ echo listen_addresses = \\'$::MN\\' >> $pgconf~;
if ($::listenaddrs)
{
$cmd = qq~ echo listen_addresses = \\'$::MN,$::listenaddrs\\' >> $pgconf~;
}
`$cmd`;
$cmd = qq~echo logging_collector = on >> $pgconf~;
`$cmd`;

View File

@@ -65,15 +65,25 @@ while ($arg =~ /^-/) {
$cmdref->{noderange}->[0] = $arg;
push(@{ $cmdref->{arg} }, @ARGV);
my $startconsole=0;
if(grep m/^-c|--console$/,@ARGV){
$startconsole=1;
}
my $noderange = $cmdref->{noderange}->[0]; # save the noderange
# Allow to print server information when -V/--verbose
foreach (reverse(@ARGV)) {
if ($_ eq '-V' || $_ eq '--verbose') {
$ENV{'XCATSHOWSVR'} = 1;
last;
}
}
# ok call Client to run the plugin rinstall.pm
xCAT::Client::submit_request($cmdref, \&xCAT::Client::handle_response);
if ($xCAT::Client::EXITCODE == 0) # no errors
{
my $startconsole = $cmdref->{startconsole}->[0];
# if startconsole requested ( -c flag) for rinstall always for winstall
# This is set in the rinstall plugin
if ($startconsole == 1) {
@@ -82,9 +92,7 @@ if ($xCAT::Client::EXITCODE == 0) # no errors
exec("rcons $noderange");
}
elsif (basename($0) =~ /winstall/) {
# winstall can commence a wcons command to the noderange for monitoring the provision cycle
exec("wcons $noderange");
}
}

View File

@@ -200,5 +200,13 @@ foreach (keys %ENV) {
}
}
# Allow to print server information when -V/--verbose
foreach (reverse(@ARGV)) {
if ($_ eq '-V' || $_ eq '--verbose') {
$ENV{'XCATSHOWSVR'} = 1;
last;
}
}
xCAT::Client::submit_request($cmdref, \&xCAT::Client::handle_response);
exit $xCAT::Client::EXITCODE;

View File

@@ -102,5 +102,13 @@ foreach (keys %ENV) {
}
}
# Allow to print server information when -V
foreach (reverse(@ARGV)) {
if ($_ eq '-V') {
$ENV{'XCATSHOWSVR'} = 1;
last;
}
}
xCAT::Client::submit_request($cmdref, \&xCAT::Client::handle_response);
exit $xCAT::Client::EXITCODE;

View File

@@ -51,6 +51,14 @@ foreach (keys %ENV) {
}
}
# Allow to print server information when -V/--verbose
foreach (reverse(@ARGV)) {
if ($_ eq '-V' || $_ eq '--verbose') {
$ENV{'XCATSHOWSVR'} = 1;
last;
}
}
xCAT::Client::submit_request($cmdref, \&xCAT::Client::handle_response);
exit $xCAT::Client::EXITCODE;

View File

@@ -37,7 +37,6 @@ opt/xcat/bin/xcatclient opt/xcat/bin/lstree
opt/xcat/bin/xcatclient opt/xcat/bin/lsflexnode
opt/xcat/bin/xcatclient opt/xcat/bin/rmflexnode
opt/xcat/bin/xcatclient opt/xcat/bin/mkflexnode
opt/xcat/bin/xcatclient opt/xcat/bin/getadapter
opt/xcat/bin/xcatclientnnr opt/xcat/bin/lsslp
opt/xcat/bin/xcatclient opt/xcat/bin/imgcapture
opt/xcat/bin/xcatclientnnr opt/xcat/bin/swapnodes
@@ -126,6 +125,7 @@ opt/xcat/bin/xcatclientnnr opt/xcat/bin/rmzone
opt/xcat/bin/xcatclientnnr opt/xcat/bin/slpdiscover
opt/xcat/bin/xcatclient opt/xcat/bin/xCATWorld
opt/xcat/bin/xcatclientnnr opt/xcat/bin/switchdiscover
opt/xcat/bin/xcatclientnnr opt/xcat/bin/pdudiscover
opt/xcat/bin/xcatclientnnr opt/xcat/bin/bmcdiscover
opt/xcat/bin/xcatclientnnr opt/xcat/bin/makentp
opt/xcat/bin/xcatclientnnr opt/xcat/sbin/rescanplugins

View File

@@ -8,7 +8,7 @@ B<bmcdiscover> [B<-?>|B<-h>|B<--help>]
B<bmcdiscover> [B<-v>|B<--version>]
B<bmcdiscover> [B<-s> I<scan_method>] [B<-u> I<bmc_user>] [B<-p> I<bmc_passwd>] [B<-z>] [B<-w>] B<--range> I<ip_ranges>
B<bmcdiscover> [B<--sn> I<SN_nodename>] [B<-s> I<scan_method>] [B<-u> I<bmc_user>] [B<-p> I<bmc_passwd>] [B<-z>] [B<-w>] B<--range> I<ip_ranges>
B<bmcdiscover> B<-u> I<bmc_user> B<-p> I<bmc_passwd> B<-i> I<bmc_ip> B<--check>
@@ -33,6 +33,10 @@ Note: The scan method currently support is B<nmap>.
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<bmcdiscover> 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<nmap>)
@@ -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

View File

@@ -1,94 +0,0 @@
=head1 NAME
B<getadapter> - Obtain all network adapters's predictable name and some other information before provision or network configuration.
=head1 SYNOPSIS
B<getadapter> I<noderange> [B<-f>]
B<getadapter> [B<-h>|B<--help>|B<-v>|B<--version>|B<-V>]
=head1 DESCRIPTION
Traditionally, network interfaces in Linux are enumerated as eth[0123...], but these names do not necessarily correspond to actual labels on the chassis. B<getadapter> help customer to get predictable network device name and some other network adapter information before provision or network configuration.
B<Since getadpter uses genesis to collect network adapters information, the target node will be restarted.>
B<getadapter> For each node within the <noderange>, follows below scheme:
If the target node is scanned for the first time, B<getadapter> will trigger genesis to collect information then save the information at the B<nicsadapter> column of nics table.
If the target node has ever been scanned, B<getadapter> will use the information from nics table first.
If user hopes to scan the adapter information for the node but these information already exist, B<-f> option can be used to start rescan process.
B<getadapter> tries to collect more information for the target network device, but doesn't guarantee collect same much information for every network device.
=head1 B<Collected information:>
=over 2
=item B<name>: the consistent name which can be used by confignic directly in operating system which follow the same naming scheme with rhels7
=item B<pci>: the pci location
=item B<mac>: the MAC address
=item B<candidatename>: All the names which satisfy predictable network device naming scheme. I<(if xcat enhance confignic command later, user can use these names to configure their network adapter, even customize their name)>
=item B<vender>: the vender of network device
=item B<model>: the model of network device
=item B<linkstate>: the link state of network device
=back
=head1 OPTIONS
B<-h>
Display usage message.
B<-v>
Command Version.
B<-V>
Display verbose message.
B<-f>
Force to trigger new round scan. ignore the data collected before.
=head1 EXAMPLES
1. To collect node[1-3]'s network device information, enter:
getadapter node[1-2]
Output is similar to:
-->Starting scan for: node1,node2
The whole scan result:
--------------------------------------
[node1]: Adapter information exists, no need to scan.
--------------------------------------
[node2] scan successfully, below are the latest data
node2:[1]->eno1!mac=34:40:b5:be:6a:80|pci=/pci0000:00/0000:00:01.0/0000:0c:00.0|candidatename=eno1/enp12s0f0/enx3440b5be6a80
node2:[2]->enp0s29u1u1u5!mac=36:40:b5:bf:44:33|pci=/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.1/2-1.1.5/2-1.1.5:1.0|candidatename=enp0s29u1u1u5/enx3640b5bf4433
Every node gets a separate section to display its all network adapters information, every network adapter owns single line which start as node name and followed by index and other information.
2. Force to trigger new round scan
getadatper node -f
=head1 SEE ALSO
L<noderange(3)|noderange.3>

View File

@@ -9,7 +9,7 @@ B<pgsqlsetup> {B<-h> | B<--help>}
B<pgsqlsetup> {B<-v> | B<--version>}
B<pgsqlsetup> {B<-i> | B<--init>} [B<-N> | B<--nostart>] [B<-P> | B<--PCM>] [B<-o> | B<--odbc>] [B<-V> | B<--verbose>]
B<pgsqlsetup> {B<-i> | B<--init>} [B<-N> | B<--nostart>] [B<--listen> | B<-l> I<address>] [B<--access> | B<-a> I<address>] [B<-P> | B<--PCM>] [B<-o> | B<--odbc>] [B<-V> | B<--verbose>]
B<pgsqlsetup> {B<-o> | B<--setupODBC>} [B<-V> | B<--verbose>]
@@ -38,7 +38,7 @@ Displays verbose messages.
The init option is used to setup an installed PostgreSQL database so that xCAT can use the database. This involves creating the xcat database, the xcat admin id, allowing access to the xcatdb database by the Management Node. It customizes the postgresql.conf configuration file, adds the management server to the pg_hba.conf and starts the PostgreSQL server. It also backs up the current xCAT database and restores it into the newly setup xcatdb PostgreSQL database. It creates the /etc/xcat/cfgloc file to point the xcatd daemon to the PostgreSQL database and restarts the xcatd daemon using the database.
On AIX, it additionally setup the xcatadm unix id and the postgres id and group. For AIX, you should be using the PostgreSQL rpms available from the xCAT website. For Linux, you should use the PostgreSQL rpms shipped with the OS. You can chose the -o option, to run after the init.
To add additional nodes to access the PostgreSQL server, setup on the Management Node, edit the pg_hba.conf file.
To add additional nodes to access the PostgreSQL server, setup on the Management Node, use the -a option.
For more documentation see:Setting_Up_PostgreSQL_as_the_xCAT_DB
@@ -46,6 +46,14 @@ For more documentation see:Setting_Up_PostgreSQL_as_the_xCAT_DB
This option with the -i flag will create the database, but will not backup and restore xCAT tables into the database. It will create the cfgloc file such that the next start of xcatd will try and contact the database. This can be used to setup the xCAT PostgreSQL database during or before install.
=item B<-l|--listen> I<address>
This option is used to specify additional IP addresses on which the PostgreSQL database will listen. Without it, only localhost (on Linux) and the management node's main IP (on Linux and AIX) will be configured. This option can be specified multiple times.
=item B<-a|--access> I<address>
This option is used to specify additional IP addresses from which the service nodes will connect to the PostgreSQL database. Without it, only the management node will be configured for database access. This option can be specified multiple times.
=item B<-P|--PCM>
This option sets up PostgreSQL database to be used with xCAT running with PCM.

View File

@@ -1,6 +1,6 @@
=head1 Name
B<rflash> - Performs Licensed Internal Code (LIC) update support for HMC-attached POWER5 and POWER6 Systems, and POWER7 systems using Direct FSP management. B<rflash> is also able to update firmware for NextScale Fan Power Controllers (FPC).
B<rflash> - Performs Licensed Internal Code (LIC) update or firmware update on supported xCAT managed nodes.
=head1 B<Synopsis>
@@ -22,9 +22,19 @@ B<rflash> I<noderange> {B<--commit>|B<--recover>}
B<rflash> I<noderange> I<http_directory>
=head2 OpenPOWER BMC specific:
=head2 OpenPOWER BMC specific (using IPMI):
B<rflash> I<noderange> I<hpm_file_path> [B<-c>|B<--check>] [B<--retry=>I<count>] [B<-V>]
B<rflash> I<noderange> [I<hpm_file_path> | B<-d> I<data_directory>] [B<-c>|B<--check>] [B<--retry=>I<count>] [B<-V>]
B<rflash> I<noderange> B<--recover> I<bmc_file_path>
=head2 OpenPOWER OpenBMC specific :
B<rflash> I<noderange> {[B<-c>|B<--check>] | [B<-l>|B<--list>]}
B<rflash> I<noderange> I<tar_file_path> {[B<-c>|B<--check>] | [B<-a>|B<--activate>] | [B<-u>|B<--upload>]}
B<rflash> I<noderange> I<image_id> {[B<-a>|B<--activate>] | [B<-d>|B<--delete>]}
=head1 B<Description>
@@ -38,6 +48,7 @@ The I<noderange> can be an CEC or CEC list, a Lpar or Lpar list and a Frame or F
The command will update firmware for NeXtScale FPC when given an FPC node and the http information needed to access the firmware.
=head2 PPC (with HMC) specific:
The B<rflash> command uses the B<xdsh> command to connect to the HMC controlling the given managed system and perform the updates. Before running B<rflash>, use B<rspconfig> to check if the related HMC ssh is enabled. To enable a HMC ssh connection, use B<rspconfig> command.
@@ -78,9 +89,15 @@ For more details about the Firmware Update using Direct FSP/BPA Management, refe
The command will update firmware for NeXtScale FPC when given an FPC node and the http information needed to access the firmware. The http information required includes both the MN IP address as well as the directory containing the firmware. It is recommended that the firmware be downloaded and placed in the /install directory structure as the xCAT MN /install directory is configured with the correct permissions for http. Refer to the doc to get more details: XCAT_NeXtScale_Clusters
=head2 OpenPOWER specific:
=head2 OpenPOWER specific (using IPMI):
The command will update firmware for OpenPOWER BMC when given an OpenPOWER node and the hpm1 formatted file path.
The command will update firmware for OpenPOWER BMC when given an OpenPOWER node and either the hpm formatted file path or path to a data directory.
B<Note:> When using B<rflash> in hierarchical environment, the hpm file or data directory must be accessible from Service Nodes.
=head2 OpenPOWER OpenBMC specific:
The command will update firmware for OpenPOWER OpenBMC when given an OpenPOWER node and either an update .tar file or an uploaded image id.
B<Note:> When using B<rflash> in hierarchical environment, the .tar file must be accessible from Service Nodes.
=head1 B<Options>
@@ -92,7 +109,7 @@ Writes the command's usage statement to standard output.
=item B<-c|--check>
Check the firmware version of BMC and HPM file.
Check the firmware version of BMC and an update file.
=item B<-p> I<directory>
@@ -100,8 +117,14 @@ Specifies the directory where the packages are located.
=item B<-d> I<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.
OpenPOWER BMC specific (using IPMI):
Used for IBM Power S822LC for Big Data systems only. Specifies the directory where the B<pUpdate> utility and at least one of BMC or PNOR update files are located. The utility and update files can be downloaded from FixCentral.
=item B<--activate> {B<concurrent> | B<disruptive>}
Must be specified to activate the new Licensed Internal Code. The "disruptive" option will cause the target systems to be recycled. Without this flag, LIC updates will be installed only, not activated.
@@ -112,12 +135,34 @@ 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<count>
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 or update file must be specified.
=item B<-l|--list>
List currently uploaded update images. "(*)" indicates currently active image.
=item B<-u|--upload>
Upload update image. Specified file must be in .tar format.
=item B<-d|--delete>
Delete update image from BMC
=item B<-v|--version>
Displays the command's version.
@@ -167,6 +212,16 @@ Print verbose message to rflash log file (/var/log/xcat/rflash/fs3.log) when upd
rflash fs3 /firmware/8335_810.1543.20151021b_update.hpm -V
=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
=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
=head1 B<Location>

View File

@@ -22,7 +22,7 @@ B<rpower> I<noderange> [B<pduon>|B<pduoff>|B<pdustat>|B<pdureset>]
=head2 OpenPOWER OpenBMC:
B<rpower> I<noderange> [B<off>|B<on>|B<reset>|B<boot>|B<stat>|B<state>|B<status>]
B<rpower> I<noderange> [B<off>|B<on>|B<softoff>|B<reset>|B<boot>|B<bmcreboot>|B<bmcstate>|B<stat>|B<state>|B<status>]
=head2 PPC (with IVM or HMC) specific:
@@ -247,6 +247,14 @@ To pause all processes in the instance.
To unpause all processes in the instance.
=item B<bmcreboot>
To reboot BMC.
=item B<bmcstate>
To get state of the BMC.
=item B<state>
To get state of the instance.

View File

@@ -5,14 +5,14 @@ B<rsetboot> - Sets the boot device to be used for BMC-based servers for the next
=head1 SYNOPSIS
B<rsetboot> I<noderange> {B<hd>|B<net>|B<cd>|B<default>|B<stat>} [B<-u>] [B<-p>]
B<rsetboot> I<noderange> [B<hd>|B<net>|B<cd>|B<default>|B<stat>] [B<-u>] [B<-p>]
B<rsetboot> [B<-h>|B<--help>|B<-v>|B<--version>]
=head1 DESCRIPTION
B<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 L<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.
B<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 L<rpower(1)|rpower.1>), 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:

View File

@@ -24,7 +24,7 @@ B<rspconfig> I<noderange> B<garp>=I<time>
=head2 OpenBMC specific:
B<rspconfig> I<noderange> {B<ip>|B<netmask>|B<gateway>|B<vlan>}
B<rspconfig> I<noderange> {B<ip>|B<netmask>|B<gateway>|B<hostname>|B<vlan>|B<sshcfg>}
=head2 MPA specific:
@@ -204,8 +204,7 @@ B<rspconfig> I<noderange> B<--resetnet>
=head1 DESCRIPTION
B<rspconfig> configures various settings in the nodes' service processors. If only a keyword is
specified, without the B<=>, it displays the current value.
B<rspconfig> configures various settings in the nodes' service processors.
For options B<autopower>|B<iocap>|B<decfg>|B<memdecfg>|B<procdecfg>|B<time>|B<date>|B<spdump>|B<sysdump>|B<network>, user need to use I<chdef -t site enableASMI=yes> to enable ASMI first.
@@ -301,6 +300,10 @@ Set CEC/BPA system names to the names in xCAT DB or the input name.
Select the policy for I/O Adapter Enlarged Capacity. This option controls the size of PCI memory space allocated to each PCI slot.
=item B<hostname>
Get or set hostname on the service processor.
=item B<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].
@@ -390,6 +393,10 @@ Performs a service processor dump.
Enable or disable SSH on MPA.
=item B<sshcfg>
Copy SSH keys.
=item B<swnet>={[I<ip>],[I<gateway>],[I<netmask>]}
Set the Switch network parameters.

View File

@@ -36,6 +36,12 @@ B<noderange> is a syntax that can be used in most xCAT commands to
conveniently specify a list of nodes. The result is that the command will
be applied to a range of nodes, often in parallel.
If you invoke xCAT B<noderange> from a shell you may need to quote the
B<noderange> if the shell would otherwise treat the punctuation marks in
the B<noderange> as control operators. The affected punctuation marks may
include Asterisk (`*'), Left Square Bracket (`[') , Right Square Bracket
(`]'), Circumflex Accent (`^'), and Overline (`~').
B<noderange> is a comma-separated list. Each token (text between commas)
in the list can be any of the forms listed below:
@@ -231,6 +237,11 @@ Generate a list of nodes in the 1st two frames:
=back
=head1 B<Bugs>
The special characters used by xCAT B<noderange> are also special characters
to many shell programs. In particular, the characters `*', `[', `]', `^',
and `~' may have to be escaped from the shell.
=head1 B<SEE ALSO>

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