2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-05-30 17:46:38 +00:00

Merge pull request #2389 from xcat2/master

Merge master to 2.13 branch for 2.13.1 release.(1)
This commit is contained in:
zet809 2017-01-10 17:47:14 +08:00 committed by GitHub
commit ae037ed33f
165 changed files with 1716 additions and 897 deletions

View File

@ -8,7 +8,7 @@ Documentation
xCAT documentation is available at: http://xcat-docs.readthedocs.io/en/latest/
|docs_latest| |docs_2124| |docs_2123| |docs_2122| |docs_212| |docs_211|
|docs_latest| |docs_2130| |docs_212| |docs_211|
Open Source License
-------------------
@ -22,26 +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_2124| image:: https://readthedocs.org/projects/xcat-docs/badge/?version=2.12.4
:alt: 2.12.4 documentation status
.. |docs_2130| image:: https://readthedocs.org/projects/xcat-docs/badge/?version=2.13.0
:alt: 2.13.0 documentation status
:scale: 100%
:target: http://xcat-docs.readthedocs.io/en/2.12.4/
.. |docs_2123| image:: https://readthedocs.org/projects/xcat-docs/badge/?version=2.12.3
:alt: 2.12.3 documentation status
:scale: 100%
:target: http://xcat-docs.readthedocs.io/en/2.12.3/
:target: http://xcat-docs.readthedocs.io/en/2.13.0/
.. |docs_2122| image:: https://readthedocs.org/projects/xcat-docs/badge/?version=2.12.2
:alt: 2.12.2 documentation status
.. |docs_212| image:: https://readthedocs.org/projects/xcat-docs/badge/?version=2.12
:alt: 2.12 documentation status
:scale: 100%
:target: http://xcat-docs.readthedocs.io/en/2.12.2/
.. |docs_212| image:: https://readthedocs.org/projects/xcat-docs/badge/?version=2.12.0
:alt: 2.12.0 documentation status
:scale: 100%
:target: http://xcat-docs.readthedocs.io/en/2.12.0/
:target: http://xcat-docs.readthedocs.io/en/2.12/
.. |docs_211| image:: https://readthedocs.org/projects/xcat-docs/badge/?version=2.11
:alt: 2.11 documentation status
:scale: 100%

1
Release Normal file
View File

@ -0,0 +1 @@
snap000000000000

View File

@ -1 +1 @@
2.13.0
2.13.1

View File

@ -4,7 +4,7 @@
# Author: Leonardo Tonetto (tonetto@linux.vnet.ibm.com)
# Revisor: Arif Ali (aali@ocf.co.uk)
#
#
#
# Getting Started:
# - Clone the xcat-core git repository int a directory called <rel>/src/xcat-core, where <rel>
# is the same name as the release dir it is uploaded to xcat.org (e.g devel, 2.9, 2.10)
@ -15,21 +15,21 @@
# PROMOTE=1 - if the attribute "PROMOTE" is specified, means an official dot release. This does not
# actually build xcat, just uploads the most recent snap build to http://xcat.org/files/xcat/ .
# If not specified, a snap build is assumed, which uploads to https://xcat.org/files/xcat/
# PREGA=1 - use this option with PROMOTE=1 on a branch that already has a released dot release, but this
# build is a GA candidate build, not to be released yet. This will result in the tarball
# PREGA=1 - use this option with PROMOTE=1 on a branch that already has a released dot release, but this
# build is a GA candidate build, not to be released yet. This will result in the tarball
# being uploaded to http://xcat.org/files/xcat/repos/apt
# (but the tarball file name will be like a released tarball, not a snap build).
# (but the tarball file name will be like a released tarball, not a snap build).
# 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
# BUILDALL=1 - build all rpms, whether they changed or not. Should be used for snap builds that are in
# prep for a release.
# UP=0 or UP=1 - override the default upload behavior
# 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
# For the dependency packages 1. All the xcat dependency deb packages should be uploaded to
# "pokgsa/projects/x/xcat/build/ubuntu/xcat-dep/debs/" on GSA
# 2. run ./build-ubunturepo -d
#
# 3. the built xcat-dep deb packages tarball can be found in "../../xcat-dep"
# 3. the built xcat-dep deb packages tarball can be found in "../../xcat-dep"
# related to the path of this script
############################
printusage()
@ -39,10 +39,10 @@ printusage()
echo " -d : Create the xcat-dep repo."
}
# For the purpose of getting the distribution name
if [[ ! -f /etc/lsb-release ]]; then
if [[ ! -f /etc/lsb-release ]]; then
echo "ERROR: Could not find /etc/lsb-release, is this script executed on a Ubuntu machine?"
exit 1
fi
fi
. /etc/lsb-release
# Check the necessary packages before starting the build
@ -84,7 +84,7 @@ do
r) r_flag=1
genesis_rpm_path="$OPTARG"
;;
?) printusage
?) printusage
exit 2
;;
esac
@ -129,7 +129,7 @@ fi
export HOME=/root
WGET_CMD="wget"
if [ ! -z ${LOG} ]; then
if [ ! -z ${LOG} ]; then
WGET_CMD="wget -o ${LOG}"
fi
@ -211,13 +211,13 @@ then
build_string="Snap_Build"
cur_date=`date +%Y%m%d%H%M`
pkg_version="${ver}-${pkg_type}${cur_date}"
if [ ! -d ../../$package_dir_name ];then
mkdir -p "../../$package_dir_name"
fi
packages="xCAT-client xCAT-genesis-scripts perl-xCAT xCAT-server xCAT xCATsn xCAT-test xCAT-buildkit xCAT-vlan xCAT-confluent xCAT-probe"
target_archs=(amd64 ppc64el)
for file in `echo $packages`
for file in $packages
do
file_low=`echo $file | tr '[A-Z]' '[a-z]'`
if [ "$file" = "xCAT" -o "$file" = "xCAT-genesis-scripts" ]; then
@ -225,13 +225,14 @@ then
else
target_archs="all"
fi
for target_arch in `echo $target_archs`
for target_arch in $target_archs
do
if grep -q $file $update_log || [ "$BUILDALL" == 1 -o "$file" = "perl-xCAT" ]; then
rm -f ../../$package_dir_name/${file_low}_*.$target_arch.deb
#genesis scripts package, don't remove genesis amd64 files
#rm -f ../../$package_dir_name/${file_low}-amd64_*.deb
cd $file
CURDIR=$(pwd)
dch -v $pkg_version -b -c debian/changelog $build_string
if [ "$target_arch" = "all" ]; then
#xcat probe use some functions shipped by xCAT, for below reasons we need to copy files to xCAT-probe directory
@ -239,24 +240,43 @@ then
#2 don't maintain two files for each script
#3 symbolic link can't work during package
if [ $file_low = "xcat-probe" ]; then
CURDIR=$(pwd)
mkdir -p ${CURDIR}/lib/perl/xCAT/
cp -f ${CURDIR}/../perl-xCAT/xCAT/NetworkUtils.pm ${CURDIR}/lib/perl/xCAT/
cp -f ${CURDIR}/../perl-xCAT/xCAT/GlobalDef.pm ${CURDIR}/lib/perl/xCAT/
cp -f ${CURDIR}/../perl-xCAT/xCAT/ServiceNodeUtils.pm ${CURDIR}/lib/perl/xCAT/
fi
dpkg-buildpackage -uc -us
CURDIR=$(pwd)
cp ${CURDIR}/debian/control ${CURDIR}/debian/control.save.998
# Magic string used here
sed -i -e "s#>= 2.13-snap000000000000#= ${pkg_version}#g" ${CURDIR}/debian/control
dpkg-buildpackage -rfakeroot -uc -us
mv ${CURDIR}/debian/control.save.998 ${CURDIR}/debian/control
else
if [ "$file" = "xCAT-genesis-scripts" ]; then
CURDIR=$(pwd)
echo "Rename control file to build pkg: mv ${CURDIR}/debian/control-${target_arch} ${CURDIR}/debian/control"
mv ${CURDIR}/debian/control-${target_arch} ${CURDIR}/debian/control
cp ${CURDIR}/debian/control-${target_arch} ${CURDIR}/debian/control
elif [ "$file" = "xCAT" ]; then
# shipping bmcsetup and getipmi scripts as part of postscripts
files=("bmcsetup" "getipmi")
for f in "${files[@]}"; do
cp ${CURDIR}/../xCAT-genesis-scripts/bin/$f ${CURDIR}/postscripts/$f
sed -i "s/xcat.genesis.$f/$f/g" ${CURDIR}/postscripts/$f
done
fi
dpkg-buildpackage -uc -us -a$target_arch
CURDIR=$(pwd)
cp ${CURDIR}/debian/control ${CURDIR}/debian/control.save.998
# Magic string used here
sed -i -e "s#>= 2.13-snap000000000000#= ${pkg_version}#g" ${CURDIR}/debian/control
dpkg-buildpackage -rfakeroot -uc -us -a$target_arch
mv ${CURDIR}/debian/control.save.998 ${CURDIR}/debian/control
if [ "$file" = "xCAT-genesis-scripts" ]; then
CURDIR=$(pwd)
echo "Move control file back: mv ${CURDIR}/debian/control ${CURDIR}/debian/control-${target_arch}"
mv ${CURDIR}/debian/control ${CURDIR}/debian/control-${target_arch}
rm ${CURDIR}/debian/control
elif [ "$file" = "xCAT" ]; then
files=("bmcsetup" "getipmi")
for f in "${files[@]}"; do
rm -f ${CURDIR}/postscripts/$f
done
fi
fi
rc=$?
@ -317,7 +337,7 @@ Label: xcat-core bazaar repository
Codename: $dist
Architectures: $tmp_out_arch
Components: main
Description: Repository automatically genereted conf
Description: Repository automatically genereted conf
SignWith: yes
__EOF__
@ -357,12 +377,12 @@ __EOF__
chmod 775 mklocalrepo.sh
#create the xcat-core.list file
#create the xcat-core.list file
cd ../
if ! grep xcat /etc/group ; then
groupadd xcat
fi
fi
chgrp -R root xcat-core
chmod -R g+w xcat-core
@ -388,7 +408,7 @@ then
#the path of ubuntu xcat-dep deb packages on GSA
GSA="/gsa/pokgsa/projects/x/xcat/build/ubuntu/xcat-dep"
if [ ! -d $GSA ]; then
echo "build-ubunturepo: It appears that you do not have gsa installed to access the xcat-dep pkgs."
exit 1;
@ -400,10 +420,10 @@ then
echo "Syncing RPMs from $GSA/ to $local_dep_repo_path/../ ..."
rsync -ilrtpu --delete $GSA/ $local_dep_repo_path/../
if [ $? -ne 0 ]; then
if [ $? -ne 0 ]; then
echo "Error from rsync, cannot continue!"
exit 1
fi
fi
#clean all old files
if [ -e $local_dep_repo_path ];then
@ -427,7 +447,7 @@ Label: xcat-dep bazaar repository
Codename: $dist
Architectures: $tmp_out_arch
Components: main
Description: Repository automatically genereted conf
Description: Repository automatically genereted conf
SignWith: yes
__EOF__
@ -482,7 +502,7 @@ __EOF__
chmod g+w $dep_tar_name
# Decide whether to upload or not (default NOT to upload)
if [ "$UP" != "1" ]; then
if [ "$UP" != "1" ]; then
echo "Upload not specified, Done! (rerun with UP=1, to upload)"
cd $old_pwd
exit 0

View File

@ -8,7 +8,7 @@
# - On AIX: Install openssl and openssh installp pkgs and run updtvpkg. Install from http://www.perzl.org/aix/ :
# apr, apr-util, bash, bzip2, db4, expat, gdbm, gettext, glib2, gmp, info, libidn, neon, openssl (won't
# conflict with the installp version - but i don't think you need this), pcre, perl-DBD-SQLite, perl-DBI,
# popt, python, readline, rsynce, sqlite, subversion, unixODBC, zlib.
# popt, python, readline, rsynce, sqlite, subversion, unixODBC, zlib.
# Install wget from http://www-03.ibm.com/systems/power/software/aix/linux/toolbox/alpha.html
# - Run this script from the xcat-core directory. It will create the other directories that are needed.
#
@ -24,7 +24,7 @@
# (but the tarball file name will be like a released tarball, not a snap build). 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.
# UP=0 or UP=1 - override the default upload behavior
# UP=0 or UP=1 - override the default upload behavior
# GITUP=<filename> - control which rpms get built by specifying a coregitup file
# EMBED=<embedded-environment> - the environment for which a minimal version of xcat should be built, e.g. zvm or flex
# VERBOSE=1 - to see lots of verbose output
@ -39,10 +39,10 @@ UPLOADUSER=litingt
USER=xcat
SERVER=xcat.org
FILES_PATH="files"
FRS=/var/www/${SERVER}/${FILES_PATH}
FRS="/var/www/${SERVER}/${FILES_PATH}"
RELEASE=github.com/xcat2/xcat-core/releases
YUMDIR=$FRS
YUMDIR="${FRS}"
YUMREPOURL="http://${SERVER}/${FILES_PATH}/xcat/repos/yum"
if [ "$1" = "-h" ] || [ "$1" = "-help" ] || [ "$1" = "--help" ]; then
@ -71,8 +71,8 @@ ALLBUILD="perl-xCAT xCAT-client xCAT-server xCAT-test xCAT-buildkit xCAT xCATsn
ZVMBUILD="perl-xCAT xCAT-server xCAT-UI"
ZVMLINK="xCAT-client xCAT xCATsn"
# xCAT and xCATsn have PCM specific configuration - conserver-xcat, syslinux-xcat
# xCAT-server has PCM specific configuration - RESTAPI(perl-JSON)
# xCAT-client has PCM specific configuration - getxcatdocs(perl-JSON)
# xCAT-server has PCM specific configuration - RESTAPI(perl-JSON)
# xCAT-client has PCM specific configuration - getxcatdocs(perl-JSON)
PCMBUILD="xCAT xCAT-server xCAT-client xCATsn"
PCMLINK="perl-xCAT xCAT-buildkit xCAT-genesis-scripts-x86_64 xCAT-genesis-scripts-ppc64 xCAT-vlan xCAT-probe"
# Note: for FSM, the FlexCAT rpm is built separately from gsa/git
@ -103,7 +103,7 @@ OSNAME=$(uname)
if [ "$OSNAME" != "AIX" ]; then
GSA=http://pokgsa.ibm.com/projects/x/xcat/build/linux
if [ "$(id -u)" == "0" ]; then
# Get a lock, so can not do 2 builds at once
exec 8>/var/lock/xcatbld-$REL.lock
@ -186,10 +186,36 @@ function setversionvars {
BUILD_TIME=`date`
BUILD_MACHINE=`hostname`
COMMIT_ID=`git rev-parse --short HEAD`
XCAT_RELEASE="snap$(date '+%Y%m%d%H%M')"
echo "$XCAT_RELEASE" >Release
}
RELEASE_FILE="Release"
RELEASE_FILE_SAVE="${RELEASE_FILE}.save.998"
if [ "$PROMOTE" != 1 ]; then # very long if statement to not do builds if we are promoting
function internal_backup()
{
# Create a backup for file `Release'
if [ ! -f "${RELEASE_FILE_SAVE}" ]
then
mv "${RELEASE_FILE}" "${RELEASE_FILE_SAVE}"
cp "${RELEASE_FILE_SAVE}" "${RELEASE_FILE}"
fi
}
function internal_cleanup()
{
# Restore file `Release'
if [ -f "${RELEASE_FILE_SAVE}" ]
then
mv "${RELEASE_FILE_SAVE}" "${RELEASE_FILE}"
fi
}
internal_backup
trap internal_cleanup 0
if [ "$PROMOTE" != 1 ]; then # very long if statement to not do builds if we are promoting ### @LINE460 ###
# we are doing a snap build
CORE="core-snap"
if [ "$OSNAME" = "AIX" ]; then
@ -217,14 +243,14 @@ else
#echo "source=$source"
fi
#
# If no pre-defined update file is provided, do a "git pull" to try and detect
#
# If no pre-defined update file is provided, do a "git pull" to try and detect
# if anything has changed in the source directories
#
#
SOMETHINGCHANGED=0
if [ "$GIT" = "1" ]; then
#
# To enable local sandbox build, GITPULL is disabled by default.
#
# To enable local sandbox build, GITPULL is disabled by default.
#
if [ "$GITPULL" = "1" ] || [ ${PWD} == *"autobuild"* ]; then
# TODO: This is really not necessary since the autobuild scripts
@ -339,7 +365,7 @@ if [ "$OSNAME" != "AIX" ]; then
fi
# Build the xCAT and xCATsn rpms for all platforms
for rpmname in xCAT xCATsn; do
for rpmname in xCAT xCATsn; do
if [[ " $EMBEDBUILD " != *\ $rpmname\ * ]]; then continue; fi
if [ $SOMETHINGCHANGED == 1 -o "$BUILDALL" == 1 ]; then # used to be: if $GREP -E "^[UAD] +$rpmname/" $GITUP; then
UPLOAD=1
@ -402,48 +428,49 @@ fi
# Prepare the RPMs for pkging and upload
WGET_CMD="wget"
if [ ! -z ${LOG} ]; then
if [ ! -z ${LOG} ]; then
WGET_CMD="wget -o ${LOG}"
fi
# get gpg keys in place
if [ "$OSNAME" != "AIX" ]; then
if [ -z "$RPMSIGN" -o "$RPMSIGN" == "1" ]; then
mkdir -p $HOME/.gnupg
for i in pubring.gpg secring.gpg trustdb.gpg; do
if [ ! -f $HOME/.gnupg/$i ] || [ `wc -c $HOME/.gnupg/$i|cut -f 1 -d' '` == 0 ]; then
rm -f $HOME/.gnupg/$i
${WGET_CMD} -P $HOME/.gnupg $GSA/keys/$i
chmod 600 $HOME/.gnupg/$i
mkdir -p $HOME/.gnupg
for i in pubring.gpg secring.gpg trustdb.gpg; do
if [ ! -f $HOME/.gnupg/$i ] ||
[ `wc -c $HOME/.gnupg/$i|cut -f 1 -d' '` == 0 ]; then
rm -f $HOME/.gnupg/$i
${WGET_CMD} -P $HOME/.gnupg $GSA/keys/$i
chmod 600 $HOME/.gnupg/$i
fi
done
# tell rpm to use gpg to sign
MACROS=$HOME/.rpmmacros
if ! $GREP '%_signature gpg' $MACROS 2>/dev/null; then
echo '%_signature gpg' >> $MACROS
fi
done
# tell rpm to use gpg to sign
MACROS=$HOME/.rpmmacros
if ! $GREP '%_signature gpg' $MACROS 2>/dev/null; then
echo '%_signature gpg' >> $MACROS
if ! $GREP '%_gpg_name' $MACROS 2>/dev/null; then
echo '%_gpg_name xCAT Security Key' >> $MACROS
fi
echo "Signing RPMs..."
build-utils/rpmsign.exp `find $DESTDIR -type f -name '*.rpm'` | grep -v -E '(already contains identical signature|was already signed|rpm --quiet --resign|WARNING: standard input reopened)'
build-utils/rpmsign.exp $SRCDIR/*rpm | grep -v -E '(already contains identical signature|was already signed|rpm --quiet --resign|WARNING: standard input reopened)'
createrepo --checksum sha $DESTDIR # specifying checksum so the repo will work on rhel5
createrepo --checksum sha $SRCDIR
rm -f $SRCDIR/repodata/repomd.xml.asc
rm -f $DESTDIR/repodata/repomd.xml.asc
gpg -a --detach-sign $DESTDIR/repodata/repomd.xml
gpg -a --detach-sign $SRCDIR/repodata/repomd.xml
if [ ! -f $DESTDIR/repodata/repomd.xml.key ]; then
${WGET_CMD} -q -P $DESTDIR/repodata $GSA/keys/repomd.xml.key
fi
if [ ! -f $SRCDIR/repodata/repomd.xml.key ]; then
${WGET_CMD} -P $SRCDIR/repodata $GSA/keys/repomd.xml.key
fi
else
createrepo --checksum sha $DESTDIR
createrepo --checksum sha $SRCDIR
fi
if ! $GREP '%_gpg_name' $MACROS 2>/dev/null; then
echo '%_gpg_name xCAT Security Key' >> $MACROS
fi
echo "Signing RPMs..."
build-utils/rpmsign.exp `find $DESTDIR -type f -name '*.rpm'` | grep -v -E '(already contains identical signature|was already signed|rpm --quiet --resign|WARNING: standard input reopened)'
build-utils/rpmsign.exp $SRCDIR/*rpm | grep -v -E '(already contains identical signature|was already signed|rpm --quiet --resign|WARNING: standard input reopened)'
createrepo --checksum sha $DESTDIR # specifying checksum so the repo will work on rhel5
createrepo --checksum sha $SRCDIR
rm -f $SRCDIR/repodata/repomd.xml.asc
rm -f $DESTDIR/repodata/repomd.xml.asc
gpg -a --detach-sign $DESTDIR/repodata/repomd.xml
gpg -a --detach-sign $SRCDIR/repodata/repomd.xml
if [ ! -f $DESTDIR/repodata/repomd.xml.key ]; then
${WGET_CMD} -q -P $DESTDIR/repodata $GSA/keys/repomd.xml.key
fi
if [ ! -f $SRCDIR/repodata/repomd.xml.key ]; then
${WGET_CMD} -P $SRCDIR/repodata $GSA/keys/repomd.xml.key
fi
else
createrepo --checksum sha $DESTDIR
createrepo --checksum sha $SRCDIR
fi
fi
# set group and permissions correctly on the built rpms
@ -455,7 +482,7 @@ chmod -R g+w $DESTDIR
chgrp -R $SYSGRP $SRCDIR
chmod -R g+w $SRCDIR
else # end of very long if-not-promote
else # end of very long if-not-promote ### @LINE193 ###
# we are only promoting (not building)
setversionvars
setbranch
@ -490,7 +517,7 @@ EOF
#!/bin/sh
cd `dirname $0`
REPOFILE=`basename xCAT-*.repo`
if [[ $REPOFILE == "xCAT-*.repo" ]]; then
if [[ $REPOFILE == "xCAT-*.repo" ]]; then
echo "ERROR: For xcat-dep, please execute $0 in the correct <os>/<arch> subdirectory"
exit 1
fi
@ -498,10 +525,10 @@ fi
# default to RHEL yum, if doesn't exist try Zypper
#
DIRECTORY="/etc/yum.repos.d"
if [[ ! -d ${DIRECTORY} ]]; then
DIRECTORY="/etc/zypp/repos.d"
if [ ! -d "$DIRECTORY" ]; then
DIRECTORY="/etc/zypp/repos.d"
fi
sed -e 's|baseurl=.*|baseurl=file://'"`pwd`"'|' $REPOFILE | sed -e 's|gpgkey=.*|gpgkey=file://'"`pwd`"'/repodata/repomd.xml.key|' > ${DIRECTORY}/$REPOFILE
sed -e 's|baseurl=.*|baseurl=file://'"`pwd`"'|' $REPOFILE | sed -e 's|gpgkey=.*|gpgkey=file://'"`pwd`"'/repodata/repomd.xml.key|' > "$DIRECTORY/$REPOFILE"
cd -
EOF2
chmod 775 mklocalrepo.sh
@ -521,6 +548,7 @@ fi
#
BUILDINFO=$XCATCORE/buildinfo
echo "VERSION=$VER" > $BUILDINFO
echo "RELEASE=$XCAT_RELEASE" >> $BUILDINFO
echo "BUILD_TIME=$BUILD_TIME" >> $BUILDINFO
echo "BUILD_MACHINE=$BUILD_MACHINE" >> $BUILDINFO
echo "COMMIT_ID=$COMMIT_ID" >> $BUILDINFO
@ -545,7 +573,7 @@ if [ -n "$UP" ] && [ "$UP" == 0 ]; then
fi
#else we will continue
# Upload the individual RPMs to xcat.org
# Upload the individual RPMs to xcat.org
if [ "$OSNAME" = "AIX" ]; then
YUM=aix
else
@ -561,13 +589,13 @@ if [ "$REL" = "devel" -o "$PREGA" != 1 ]; then
do : ; done
fi
# Upload the individual source RPMs to xcat.org
# Upload the individual source RPMs to xcat.org
i=0
echo "Uploading src RPMs from $SRCD to $YUMDIR/$YUM/$REL$EMBEDDIR/ ..."
while [ $((i+=1)) -le 5 ] && ! rsync -urLv --delete $SRCD $USER@$SERVER:$YUMDIR/$YUM/$REL$EMBEDDIR/
do : ; done
# Upload the tarball to xcat.org
# Upload the tarball to xcat.org
if [ "$PROMOTE" = 1 -a "$REL" != "devel" -a "$PREGA" != 1 ]; then
# upload tarball to FRS area
i=0

View File

@ -1,129 +0,0 @@
Edgecore Switch
===============
The Edgecore switch from Mellanox is 1Gb top-of-rack switch. It's coming with ONIE installer. Open Network Install Environment (ONIE)is an open source initiative that defines an open "install environment" for bare metal network switches. For more information, see http://onie.opencompute.org/. Mellanox will ship the switch with Cumulus Network OS and along with a license file installed. In some case, user may get whitebox without OS and licenses. Since edgecore switch has different configuration than other switches that xCAT supports, xCAT handles edgecore switch differently.
ONIE Mode
---------
If the switch arrives without an OS pre-loaded, the ONIE installer and management port is the only thing enabled on the switch. Once the switch connects to the xCAT network, the switch should get a dynamic IP address. The xCAT DHCP server will get requests from the onie-installer from the switch and attempt to find an OS binary file to execute. The following messages will be logged in /var/log/messages on the management node. ::
Info: Fetching http://172.1.0.1/onie-installer-arm-accton_as4610_54-r0 ...
Info: Fetching http://172.1.0.1/onie-installer-arm-accton_as4610_54 ...
Info: Fetching http://172.1.0.1/onie-installer-accton_as4610_54 ...
Info: Fetching http://172.1.0.1/onie-installer-arm ...
Info: Fetching http://172.1.0.1/onie-installer .
To remove the installed Cumulus Linux OS to boot back to ONIE mode, connect to the switch via serial-port or ssh and execute the following commands: ::
ssh cumulus@172.1.0.1
#clean up all the configuration
sudo onie-select -k
sudo reboot
#boot back to onie mode
sudo onie-select -i
sudo reboot
After switch reboots, it will enter ONIE mode and send DHCP request to attempt to fetch the OS binary file.
Discover Edgecore Switch
------------------------
ONIE supports a number of methods for locating OS binary file. xCAT choose to use a DHCP server to provide specific information to the switch.
* IP address of the switch
* URL of the OS binary file on the Web server
With the xCAT DHCP configuration, ONIE picks up an IP address and downloads the URL specified by the user and start to install of the OS. The steps take to discover the edgecore switch and process request from ONIE installer as follows:
#. Pre-define switch object into xCAT db, make sure ip adress, netboot and provemethod are set, also define core switch and port number where edgecore switch connect to. ::
#lsdef edgecoresw1
Object name: edgecoresw1
groups=switch
ip=192.168.23.1
mgt=switch
netboot=onie
nodetype=switch
postbootscripts=otherpkgs
postscripts=syslog,remoteshell,syncfiles
provmethod=/install/custom/sw/edgecore/cumulus-linux-3.1.0-bcm-armel-1471981017.dc7e2adzfb43f6b.bin
switch=switch-10-5-23-1
switchport=1
#makehosts edgecoresw1
#. Run ``switchdiscover`` command, it will find edgecore switch and update mac address on pre-defined switch node definition. ::
#switchdiscover --range 192.168.5.170-190 -s nmap
#lsdef edgecoresw1
Object name: edgecoresw1
groups=switch
ip=192.168.23.1
mac=8C:EA:1B:12:CA:40
mgt=switch
netboot=onie
nodetype=switch
postbootscripts=otherpkgs
postscripts=syslog,remoteshell,syncfiles
provmethod=/install/custom/sw/edgecore/cumulus-linux-3.1.0-bcm-armel-1471981017.dc7e2adzfb43f6b.bin
status=Matched
switch=switch-10-5-23-1
switchport=1
switchtype=cumulus
usercomment=Edgecore switch
#. Run ``makedhcp`` after edgecore switch discovered, it will update ``dhcpd.conf`` and response the DHCP request from the onie-installer. ::
#makedhcp -n
#makedhcp -a edgecoresw1
#. Installation of the Cumulus Linux OS takes about 50 minutes. Monitor the /var/log/messages to check the status of the installation. ::
Oct 27 15:28:08 fs4 dhcpd: DHCPDISCOVER from 8c:ea:1b:12:ca:40 via enP4p1s0f2
Oct 27 15:28:08 fs4 dhcpd: DHCPOFFER on 192.168.23.1 to 8c:ea:1b:12:ca:40 via enP4p1s0f2
Oct 27 15:28:08 fs4 dhcpd: DHCPREQUEST for 192.168.23.1 (192.168.3.25) from 8c:ea:1b:12:ca:40 via enP4p1s0f2
Oct 27 15:28:08 fs4 dhcpd: DHCPACK on 192.168.23.1 to 8c:ea:1b:12:ca:40 via enP4p1s0f2
#. Once installation finished, the pre-defined switch name and IP address will be configured on edgecore switch. ::
cumulus@edgecoresw1:~$ ifconfig
eth0 Link encap:Ethernet HWaddr 8c:ea:1b:12:ca:40
inet addr:192.168.23.1 Bcast:192.168.255.255 Mask:255.255.0.0
inet6 addr: fe80::8eea:1bff:fe12:ca40/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
cumulus@edgecoresw1:~$ hostname
edgecoresw1
Configure Edgecore Switch
-------------------------
xCAT provides a script ``/opt/xcat/share/xcat/script/configcumulus`` to configure attributes in the Cumulus Switch. Use the ``--help`` option to see more details. ::
#configcumulus --help
Usage:
configcumulus [-?│-h│--help]
configcumulus [--switches switchnames] [--all]
configcumulus [--switches switchnames] [--ssh]
configcumulus [--switches switchnames] [--license filename ]
configcumulus [--switches switchnames] [--snmp] [--user snmp_user] [--password snmp_password]
configcumulus [--switches switchnames] [--ntp]

View File

@ -1,7 +1,7 @@
Edgecore Switches
=================
ONIE Compatible Bare Metal Switches
===================================
.. toctree::
:maxdepth: 2
edgecore_switches.rst
onie_switches.rst

View File

@ -0,0 +1,135 @@
ONIE compatible bare metal switch
=================================
The ONIE [1]_. compatible bare metal switches(abbreviated as "ONIE switch") from vendors such as Mellanox or Edgecore are often used as top-of-rack switches in the cluster. Usually, the switches are shipped with a Cumulus Network OS(https://cumulusnetworks.com) and a license pre-installed. In some cases, user may get whitebox switch hardware with a standalone Cumulus installer and license file. This documentation presents a typical workflow on how to setup ONIE switch from white box, then configure and manage the switch with xCAT.
.. [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.
Create an ONIE switch object
-------------------------------
The ONIE switch object can be created with the "onieswitch" template shipped in xCAT, the ip address and mac of the switch management ethernet port should be specified : ::
mkdef edgecoresw1 --template onieswitch arch=armv71 ip=192.168.5.191 mac=8C:EA:1B:12:CA:40
Provision the Cumulus OS on ONIE switch
---------------------------------------
To provision Cumulus OS, the Cumulus installation file, a binary shipped with the switch, should be saved in a directory exported in the http server.
Run ``chdef`` to specify the "provmethod" attribute of the switch object to the full path of the installation file: ::
chdef edgecoresw1 netboot=onie provmethod="/install/custom/sw/edgecore/cumulus-linux-3.1.0-bcm-armel-1471981017.dc7e2adzfb43f6b.bin"
Run ``makedhcp`` to prepare the DHCP/BOOTP lease. ::
makedhcp -a edgecoresw1
The command or operation to start the provision dependes on the status of switch:
1. If the switch is a white box without Cumulus OS installed, simply connect the management ethernet port of the switch to xCAT management node, then power on the switch.
2. If a Cumulus OS has been installed on the switch, you need to login to the switch(the default user is ``cumulus`` and the password is ``CumulusLinux!``) and run a batch of commands: ::
sudo onie-select -i
sudo reboot
If the passwordless-ssh of "root" has been enabled, the commands can be issued with: ::
xdsh edgecoresw1 "/usr/cumulus/bin/onie-select -i -f;reboot"
After reboot, the switch will enter ONIE install mode and begin the installation. The provision might take about 50 minutes.
Switch Configuration
--------------------
Enable the passwordless ssh for "root"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In a newly installed Cumulus OS, a default user ``cumulus`` will be created, the switch can be accessed via ssh with the default password ``CumulusLinux!``.
The passwordless ssh access of "root" should be enabled with the script ``/opt/xcat/share/xcat/scripts/configcumulus`` ::
/opt/xcat/share/xcat/scripts/configcumulus --switches edgecoresw1 --ssh
After the passwordless access for "root" is setup successfully, the switch can be managed with the node management commands such as ``xdsh``, ``xdcp`` and ``updatenode``, etc.
Licence file installation
~~~~~~~~~~~~~~~~~~~~~~~~~
On the newly installed switch, only the serial console and the management ethernet port are enabled. To activate the data ports, the licence file shipped with the switch should be installed: ::
xdcp edgecoresw1 /install/custom/sw/edgecore/licensefile.txt /tmp
xdsh edgecoresw1 "/usr/cumulus/bin/cl-license -i /tmp/licensefile.txt"
To check whether the license file is installed successfully: ::
~: xdsh edgecoresw1 /usr/cumulus/bin/cl-license
edgecoresw1: xxx@xx.com|xxxxxxxxxxxxxxx
Reboot the switch to apply the licence file: ::
xdsh edgecoresw1 reboot
Enable SNMP
~~~~~~~~~~~
The snmpd in the switch is not enabled by default, xCAT ships a postscript to enable it: ::
updatenode edgecoresw1 -P enablesnmp
Switch Discovery
----------------
The ONIE switch can be scaned and discovered with ``switchdiscover`` ::
~: switchdiscover --range 192.168.23.1-10
Discovering switches using nmap for 192.168.23.1-10. It may take long time...
ip name vendor mac
------------ ------------ ------------ ------------
192.168.23.1 edgecoresw1 Edgecore switch 8C:EA:1B:12:CA:40
Switch discovered: edgecoresw1
Once SNMP on the ONIE switch is enabled, the ONIE switch can be discovered with "snmp" method: ::
~: switchdiscover --range 192.168.23.1-10 -s snmp
Discovering switches using snmpwalk for 192.168.23.1-10 ....
ip name vendor mac
------------ ------------ ------------ ------------
192.168.23.1 edgecoresw1 Linux edgecoresw1 4.1.0-cl-2-iproc #1 SMP Debian 4.1.25-1+cl3u4 (2016-08-13) armv7l 8c:ea:1b:12:ca:40
Switch discovered: edgecoresw1
Switch Management
-----------------
File Dispatch
~~~~~~~~~~~~~
The files can be dispatched to ONIE switches with ``xdcp`` ::
xdcp edgecoresw1 <path of file to dispatch> <destination path of the file on switch>
Refer to :doc:`xdcp manpage </guides/admin-guides/references/man1/xdcp.1>` for details.
Remote Commands
~~~~~~~~~~~~~~~
Commands can be run on ONIE switches remotely with ``xdsh`` ::
xdsh edgecoresw1 <remote commands>
Refer to :doc:`xdsh manpage </guides/admin-guides/references/man1/xdsh.1>` for details.
Run scripts remotely
~~~~~~~~~~~~~~~~~~~~
The scripts under "/install/postscripts" can be run on ONIE switches with ``updatenode -P`` ::
updatenode edgecoresw1 -P <script name>
Refer to :doc:`updatenode manpage </guides/admin-guides/references/man1/updatenode.1>` for details.

View File

@ -35,7 +35,7 @@ The \ **copycds**\ command copies all contents of Distribution DVDs/ISOs or Ser
You can specify \ **-i**\ or \ **-**\ **-inspection**\ option to check whether the DVDs/ISOs can be recognized by xCAT. If recognized, the distribution name, architecture and the disc no (the disc sequence number of DVDs/ISOs in multi-disk distribution) of the DVD/ISO is displayed. If xCAT doesn't recognize the DVD/ISO, you must manually specify the distro name and architecture using the \ **-n**\ and \ **-a**\ options. This is sometimes the case for distros that have very recently been released, and the xCAT code hasn't been updated for it yet.
You can get xCAT to recognize new DVDs/ISOs by adding them to /opt/xcat/lib/perl/xCAT/data/discinfo.pm and reloading xcatd (\ **service xcatd reload**\ ).
You can get xCAT to recognize new DVDs/ISOs by adding them to /opt/xcat/lib/perl/xCAT/data/discinfo.pm (the key of the hash is the first line of .discinfo) and reloading xcatd (\ **service xcatd reload**\ ).
*******

View File

@ -19,7 +19,7 @@ SYNOPSIS
********
\ **makeconservercf**\ [\ **-V|-**\ **-verbose**\ ] [\ **-d|-**\ **-delete**\ ] \ *noderange*\
\ **makeconservercf**\ [\ **-V|-**\ **-verbose**\ ] [\ **-d|-**\ **-delete**\ ] [\ *noderange*\ ]
\ **makeconservercf**\ [\ **-V|-**\ **-verbose**\ ] [\ **-l|-**\ **-local**\ ] [\ *noderange*\ ]
@ -36,14 +36,16 @@ DESCRIPTION
The \ **makeconservercf**\ command will write out the /etc/conserver.cf, using information from the nodehm table
and related tables (e.g. mp, ipmi, ppc). Normally, \ **makeconservercf**\ will write all nodes to the conserver.cf
file. If a noderange is specified, it will write on those nodes to the file. In either case, if a node
and related tables (e.g. mp, ipmi, ppc). Normally, \ **makeconservercf**\ will write all nodes to the /etc/conserver.cf
file. If a \ *noderange*\ is specified, it will write only those nodes to the file. In either case, if a node
does not have nodehm.cons set, it will not be written to the file.
If \ **-d**\ is specified, \ **makeconservercf**\ will remove specified nodes from /etc/conserver.cf file. If \ *noderange*\ is not specified, all xCAT nodes will be removed from /etc/conserver.cf file.
In the case of a hierarchical cluster (i.e. one with service nodes) \ **makeconservercf**\ will determine
which nodes will have their consoles accessed from the management node and which from a service node
(based on the nodehm.conserver attribute). The /etc/conserver.cf file will be created accordingly on
all relevant management/service nodes. If -l is specified, it will only create the local file.
all relevant management/service nodes. If \ **-l**\ is specified, it will only create the local file.
*******

View File

@ -3,6 +3,6 @@ Updating xCAT
If at a later date you want to update xCAT, first, update the software repositories and then run: ::
apt-get update
apt-get --only-upgrade install xcat*
apt-get -y --only-upgrade install .*xcat.*

13
makerpm
View File

@ -107,6 +107,13 @@ function makexcat {
TARGET="--target $ARCH"
if [ "$RPMNAME" = "xCAT" ]; then
cd `dirname $0`/
# shipping bmcsetup and getipmi scripts as part of postscripts
files=("bmcsetup" "getipmi")
for f in "${files[@]}"; do
cp "xCAT-genesis-scripts/bin/"$f ${RPMNAME}/postscripts/$f
sed -i "s/xcat.genesis.$f/$f/g" ${RPMNAME}/postscripts/$f
done
cd `dirname $0`/$RPMNAME
tar --exclude .svn --exclude upflag -czf $RPMROOT/SOURCES/postscripts.tar.gz postscripts LICENSE.html
tar --exclude .svn -czf $RPMROOT/SOURCES/prescripts.tar.gz prescripts
@ -139,6 +146,12 @@ function makexcat {
echo "Building $RPMROOT/RPMS/$ARCH/$RPMNAME-$VER-snap*.$ARCH.rpm $EMBEDTXT..."
rpmbuild $QUIET -ba $RPMNAME/$RPMNAME.spec $TARGET --define "version $VER" $REL "$EASE"
RC=$?
if [ "$RPMNAME" = "xCAT" ]; then
files=("bmcsetup" "getipmi")
for f in "${files[@]}"; do
rm -f `dirname $0`/${RPMNAME}/postscripts/$f
done
fi
fi
}

View File

@ -1 +1 @@
5
9

View File

@ -2,12 +2,13 @@ Source: perl-xcat
Section: libs
Priority: extra
Maintainer: xCAT <xcat-user@lists.sourceforge.net>
Build-Depends: debhelper (>= 5), libsoap-lite-perl, libdbi-perl
Standards-Version: 3.7.2
Build-Depends: debhelper (>= 9), libsoap-lite-perl, libdbi-perl
Standards-Version: 3.9.4
Homepage: https://xcat.org/
Package: perl-xcat
Architecture: all
Depends: ${perl:Depends}
Depends: ${perl:Depends}
Description: xCAT perl libraries
Provides perl xCAT libraries for core functionality. Required for all xCAT installations.
Includes xCAT::Table, xCAT::NodeRange, among others.

View File

@ -9,9 +9,6 @@
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
export DH_COMPAT=5
build:
dh_testdir
./db2man
@ -27,7 +24,6 @@ install:
dh_installdirs
dh_install -X".svn"
# Build architecture-independent files here.
binary-indep: build install
# We have nothing to do by default.
@ -36,7 +32,7 @@ binary-indep: build install
binary-arch: build install
dh_testdir
dh_testroot
dh_installchangelogs
dh_installchangelogs
dh_installdocs
# dh_installexamples
dh_install -X".svn"

View File

@ -1,7 +1,7 @@
Summary: xCAT perl libraries
Name: perl-xCAT
Version: %{?version:%{version}}%{!?version:%(cat Version)}
Release: %{?release:%{release}}%{!?release:snap%(date +"%Y%m%d%H%M")}
Release: %{?release:%{release}}%{!?release:%(cat Release)}
Epoch: 4
License: EPL
Group: System Environment/Libraries
@ -17,8 +17,6 @@ BuildArch: noarch
#Requires: perl-SOAP-Lite
%endif
Provides: perl-xCAT = %{epoch}:%{version}
%description
Provides perl xCAT libraries for core functionality. Required for all xCAT installations.
Includes xCAT::Table, xCAT::NodeRange, among others.

View File

@ -1 +1 @@
5
9

View File

@ -2,14 +2,14 @@ Source: xcat-ibmhpc
Section: admin
Priority: extra
Maintainer: Arif Ali <aali@ocf.co.uk>
Build-Depends: debhelper (>= 5)
Standards-Version: 3.7.2
Build-Depends: debhelper (>= 9)
Standards-Version: 3.9.4
Package: xcat-ibmhpc
Architecture: all
Depends: ${perl:Depends}, perl-xcat (>= 2.8.0), xcat-client (>= 2.8.0)
Description: Install and configuration utilities for IBM HPC products in an xCAT cluster
xCAT-IBMhpc provides sample installation and configuration scripts for running
the IBM HPC software stack in an xCAT cluser. Support for the following IBM
products is provided: GPFS, LoadLeveler, Parallel Environment, ESSL and Parallel
Depends: ${perl:Depends}, perl-xcat (>= 2.13-snap000000000000), xcat-client (>= 2.13-snap000000000000)
Description: Utilities for manage IBM HPC products in an xCAT cluster
xCAT-IBMhpc provides sample installation and configuration scripts for running
the IBM HPC software stack in an xCAT cluser. Support for the following IBM
products is provided: GPFS, LoadLeveler, Parallel Environment, ESSL and Parallel
ESSL libraries, some compilers (vac, xlC, xlf).

View File

@ -9,9 +9,6 @@
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
export DH_COMPAT=5
build:
pwd
dh_quilt_patch
@ -29,7 +26,6 @@ install:
dh_install -X".svn"
dh_link
# Build architecture-independent files here.
binary-indep: build install
# We have nothing to do by default.
@ -39,7 +35,7 @@ binary-arch:
pwd
dh_testdir
dh_testroot
dh_installchangelogs
dh_installchangelogs
dh_installdocs
# dh_installexamples
dh_install -X".svn"

View File

@ -1,7 +1,7 @@
Summary: Install and configuration utilities for IBM HPC products in an xCAT cluster
Name: xCAT-IBMhpc
Version: %{?version:%{version}}%{!?version:%(cat Version)}
Release: %{?release:%{release}}%{!?release:snap%(date +"%Y%m%d%H%M")}
Release: %{?release:%{release}}%{!?release:%(cat Release)}
Epoch: 4
License: EPL
Group: Applications/System
@ -20,7 +20,6 @@ AutoReqProv: no
# also need to fix Requires for AIX
%ifos linux
BuildArch: noarch
#Requires:
%endif
Requires: perl-xCAT >= %{epoch}:%{version}
@ -85,7 +84,3 @@ fi
%post
%preun

View File

@ -1 +1 @@
8
9

View File

@ -2,13 +2,11 @@ Source: xcat-openstack-baremetal
Section: admin
Priority: extra
Maintainer: xCAT <xcat-user@lists.sourceforge.net>
Build-Depends: debhelper (>= 8.0.0)
Build-Depends: debhelper (>= 9)
Standards-Version: 3.9.4
Homepage: http://xcat.org
#Vcs-Git: git://git.debian.org/collab-maint/xcat-openstack-baremetal.git
#Vcs-Browser: http://git.debian.org/?p=collab-maint/xcat-openstack-baremetal.git;a=summary
Homepage: https://xcat.org/
Package: xcat-openstack-baremetal
Architecture: all
Depends: xcat-client
Description: Executables and data of the xCAT baremetal driver for OpenStack
Description: Executables and data of xCAT baremetal driver for OpenStack

View File

@ -1,7 +1,7 @@
Summary: Executables and data of the xCAT baremetal driver for OpenStack
Name: xCAT-OpenStack-baremetal
Version: %{?version:%{version}}%{!?version:%(cat Version)}
Release: %{?release:%{release}}%{!?release:snap%(date +"%Y%m%d%H%M")}
Release: %{?release:%{release}}%{!?release:%(cat Release)}
Epoch: 4
License: IBM
Group: Applications/System

View File

@ -1 +1 @@
8
9

View File

@ -2,13 +2,13 @@ Source: xcat-openstack
Section: admin
Priority: extra
Maintainer: xCAT <xcat-user@lists.sourceforge.net>
Build-Depends: debhelper (>= 8.0.0)
Standards-Version: 3.9.2
#Vcs-Git: git://git.debian.org/collab-maint/xcat-openstack.git
#Vcs-Browser: http://git.debian.org/?p=collab-maint/xcat-openstack.git;a=summary
Build-Depends: debhelper (>= 9)
Standards-Version: 3.9.4
Package: xcat-openstack
Architecture: all
Depends: xcat
Description: Meta-Metapackage for a common, default xCAT management node setup with OpenStack
xCAT-OpenStack is an xCAT management node package intended for at-scale management with OpenStack, including hardware management and software management.
Description: Metapackage for a xCAT management node setup with OpenStack
xCAT-OpenStack is an xCAT management node package intended for at-scale
management with OpenStack, including hardware management and software
management.

View File

@ -1,7 +1,7 @@
Summary: Meta-Metapackage for a common, default xCAT management node setup with OpenStack
Summary: Meta-Metapackage for a common, default xCAT management node setup with OpenStack
Name: xCAT-OpenStack
Version: %{?version:%{version}}%{!?version:%(cat Version)}
Release: %{?release:%{release}}%{!?release:snap%(date +"%Y%m%d%H%M")}
Release: %{?release:%{release}}%{!?release:%(cat Release)}
License: EPL
Group: Applications/System
Vendor: IBM Corp.
@ -16,8 +16,8 @@ Provides: xCAT-OpenStack = %{version}
Requires: xCAT
%description
xCAT-OpenStack is an xCAT management node package intended for at-scale
management with OpenStack, including hardware management and software
xCAT-OpenStack is an xCAT management node package intended for at-scale
management with OpenStack, including hardware management and software
management.
%prep
@ -28,7 +28,6 @@ management.
# Then convert the pods to man pages and html pages.
./db2man
%install
mkdir -p $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT_schema
mkdir -p $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT_plugin
@ -89,9 +88,8 @@ rm -rf $RPM_BUILD_ROOT
%ifos linux
if [ -f "/proc/cmdline" ]; then # prevent running it during install into chroot image
if [ -f $RPM_INSTALL_PREFIX0/sbin/xcatd ]; then
/etc/init.d/xcatd restart
/etc/init.d/xcatd restart
fi
fi
%endif
exit 0

View File

@ -1,7 +1,7 @@
Summary: Utilities to make xCAT work in a SoftLayer environment
Name: xCAT-SoftLayer
Version: %{?version:%{version}}%{!?version:%(cat Version)}
Release: %{?release:%{release}}%{!?release:snap%(date +"%Y%m%d%H%M")}
Release: %{?release:%{release}}%{!?release:%(cat Release)}
Epoch: 4
License: EPL
Group: Applications/System

View File

@ -1 +1 @@
5
9

View File

@ -2,11 +2,12 @@ Source: xcat-ui
Section: admin
Priority: extra
Maintainer: xCAT <xcat-user@lists.sourceforge.net>
Build-Depends: debhelper (>= 5)
Standards-Version: 3.7.2
Build-Depends: debhelper (>= 9)
Standards-Version: 3.9.4
Package: xcat-ui
Architecture: all
Depends: ${perl:Depends}, python (>= 2.3), apache2, libapache2-mod-php5
Description: Provides a browser-based interface for xCAT (extreme Cluster Administration Tool).
Provides a browser-based interface for xCAT (extreme Cluster Administration Tool).
Depends: ${perl:Depends}, python (>= 2.3), apache2, libapache2-mod-php
Description: Provides a browser-based interface for xCAT
Provides a browser-based interface for xCAT (extreme Cluster Administration
Tool).

View File

@ -9,9 +9,6 @@
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
export DH_COMPAT=5
build:
pwd
@ -38,7 +35,7 @@ binary-arch:
pwd
dh_testdir
dh_testroot
dh_installchangelogs
dh_installchangelogs
dh_installdocs
# dh_installexamples
dh_install -X".svn"

View File

@ -1,12 +1,12 @@
Summary: Web Client for xCAT 2
Name: xCAT-UI
Version: %{?version:%{version}}%{!?version:%(cat Version)}
Release: %{?release:%{release}}%{!?release:snap%(date +"%Y%m%d%H%M")}
Release: %{?release:%{release}}%{!?release:%(cat Release)}
License: EPL
Group: Applications/System
URL: http://xcat.org
URL: https://xcat.org/
Packager: IBM
Vendor: IBM
Vendor: IBM Corp.
Source: xCAT-UI-%{version}.tar.gz
BuildRoot: /var/tmp/%{name}-%{version}-%{release}-root

View File

@ -1 +1 @@
5
9

View File

@ -1,11 +1,11 @@
Source: xcat-buildkit
Section: admin
Priority: extra
Maintainer: xu qing <qxuqxu@cn.ibm.com>
Build-Depends: debhelper (>= 5)
Standards-Version: 3.7.2
Maintainer: Xu Qing <qxuqxu@cn.ibm.com>
Build-Depends: debhelper (>= 9)
Standards-Version: 3.9.4
Package: xcat-buildkit
Architecture: all
Depends: dpkg-dev, devscripts, debhelper
Description: xCAT-buildkit provides the buildkit tool and sample kit files to build an xCAT kit.
Description: Provides build tools and sample files to build an xCAT kit

View File

@ -9,9 +9,6 @@
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
export DH_COMPAT=5
build:
pwd
mkdir -p share/man/man1
@ -40,7 +37,6 @@ install:
find debian/xcat-buildkit/opt/xcat/share/doc/packages/xCAT-buildkit -type f -exec chmod 644 {} \;
dh_link
# Build architecture-independent files here.
binary-indep: build install
dh_installchangelogs

View File

@ -14,7 +14,6 @@ BuildRoot: /var/tmp/%{name}-%{version}-%{release}-root
%ifos linux
BuildArch: noarch
#Requires:
%endif
Provides: pkg2 = %{epoch}:%{version}

View File

@ -14,7 +14,6 @@ BuildRoot: /var/tmp/%{name}-%{version}-%{release}-root
%ifos linux
BuildArch: noarch
#Requires:
%endif
Provides: pkg3 = %{epoch}:%{version}

View File

@ -1,7 +1,7 @@
Summary: xCAT buildkit tools and sample kit
Name: xCAT-buildkit
Version: %{?version:%{version}}%{!?version:%(cat Version)}
Release: %{?release:%{release}}%{!?release:snap%(date +"%Y%m%d%H%M")}
Release: %{?release:%{release}}%{!?release:%(cat Release)}
Epoch: 4
License: EPL
Group: Applications/System
@ -20,15 +20,12 @@ AutoReqProv: no
# also need to fix Requires for AIX
%ifos linux
BuildArch: noarch
#Requires:
%endif
# No dependencies on any other xCAT rpms
# so that this rpm can be installed in a separate build server
Requires: /usr/bin/rpmbuild
Provides: xCAT-buildkit = %{epoch}:%{version}
%description
xCAT-buildkit provides the buildkit tool and sample kit files to build an xCAT kit.
@ -41,8 +38,6 @@ mkdir -p share/doc/man1
pod2man pods/man1/buildkit.1.pod > share/man/man1/buildkit.1
pod2html pods/man1/buildkit.1.pod > share/doc/man1/buildkit.1.html
%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/%{prefix}/share/xcat/kits
@ -57,7 +52,6 @@ chmod 444 $RPM_BUILD_ROOT/%{prefix}/share/man/man1/*
cp share/doc/man1/* $RPM_BUILD_ROOT/%{prefix}/share/doc/man1
chmod 644 $RPM_BUILD_ROOT/%{prefix}/share/doc/man1/*
%ifos linux
cp -aR share/xcat/kits/* $RPM_BUILD_ROOT/%{prefix}/share/xcat/kits/
#chmod -R 644 $RPM_BUILD_ROOT/%{prefix}/share/xcat/kits/*
@ -110,7 +104,3 @@ fi
%post
%preun

View File

@ -165,12 +165,8 @@ if ($::linuxos == "sles12") {
close($relfile);
chomp(@lines);
# if == 12.1
if (grep /VERSION_ID="12.1"/, @lines) {
#$::linuxos == "sles12.1";
$sp1flag = 1;
}
# for sles12.x
$sp1flag = 1;
}
# set flag

View File

@ -10,6 +10,9 @@ use xCAT::MsgUtils;
use xCAT::DSHCLI;
use locale;
use Getopt::Std;
eval "use Sort::Versions qw/versioncmp/; 1;" or *versioncmp = sub ($$) { ($a,$b)= @_ ; return $a cmp $b };
#####################################################################
# #
# Module: xdshbak #
@ -21,6 +24,7 @@ use Getopt::Std;
# output from multiple nodes preceded by the hostname #
# #
# Inputs: #
# -b : bare output, don't prepend hostname per line. only with -x #
# -c : list distinct output only once #
# -h : usage #
# -x : omit extra header output for each node. #
@ -50,7 +54,7 @@ $::dsh_command = 'xdshbak';
#
# Process the command line...
#
if (!getopts('cxhq'))
if (!getopts('bcxhq'))
{ # Gather options; if errors
&d_syntax;
exit(-1);
@ -68,6 +72,11 @@ if ($::opt_c && $::opt_x)
exit(-1);
} # these 2 options are mutually exclusive
if ($::opt_b && !($::opt_x)) {
&d_syntax;
exit(-1);
} # -b only makes sense with -x
if ($::opt_c)
{
$compress++;
@ -110,8 +119,7 @@ while (<STDIN>)
#
$num_lines++;
if (!($quiet)) {
if ($::opt_x) { $num_lines % 100 == 0 && print STDOUT "."; }
else { $num_lines % 1000 == 0 && print STDOUT "."; }
$num_lines % 1000 == 0 && print STDOUT ".";
}
if (/: /)
{
@ -170,7 +178,7 @@ while (<STDIN>)
# The hostnames are sorted alphabetically
#
$num_lines > 999 && print STDOUT "\n";
!($quiet) && $num_lines > 999 && print STDOUT "\n";
if ($compress)
{
if ($long_ln eq $prev_ln)
@ -199,14 +207,15 @@ else
sub d_syntax
{
my $usage1 = "Usage: xdshbak [-c | -x | -h | -q] \n";
my $usage2 =
"-c : compresses the output by listing unique output only once.\n";
my $usage3 = "-h : help \n";
my $usage4 =
"-x : omit extra header output for each node. Can not be used with -c. \n";
my $usage5 = "-q : quiet mode.\n";
my $usage = $usage1 .= $usage2 .= $usage3 .= $usage4 .= $usage5;
# Duplicates POD - pod2usage ?
my @usage;
push @usage, "Usage: xdshbak [-c | -x [-b] | -h | -q]";
push @usage, " -b : bare output, don't prepend hostname per line. only with -x";
push @usage, " -c : compresses the output by listing unique output only once.";
push @usage, " -h : help";
push @usage, " -x : omit extra header output for each node. Can not be used with -c.";
push @usage, " -q : quiet mode.";
my $usage = join "\n", @usage;
xCAT::MsgUtils->message("I", $usage);
}
@ -232,17 +241,25 @@ sub print_list
local (@lines, $numhosts, $hn_string, $l_string);
foreach $hostname (sort @hs)
foreach $hostname (sort { versioncmp($a, $b) } @hs)
{
if (!$::opt_x) { ($num_hosts >= 1) && print "\n"; }
$num_hosts++;
if ($::opt_x) { print "$hostname: $ls{$hostname}"; }
if ($::opt_x) {
if ($::opt_b) {
# Bare output
print $ls{$hostname};
} else {
# No header. hostname prepended on every line
map { print "$hostname: $_\n" } split(/\n/, $ls{$hostname});
}
}
else
{
#$hn_string = `$SPMSG DSH $MSGCAT INFO510 'HOST: %1\$s\n' $hostname`;
xCAT::MsgUtils->message("I", "HOST:$hostname\n");
xCAT::MsgUtils->message("I", "HOST:$hostname");
printf '%.' . (6 + length($hostname)) . "s\n",
'---------------------------------------------------------------';
@ -296,16 +313,15 @@ sub print_tree
($num_hosts >= 1) && print "\n";
$num_hosts++;
@wc = split(/:/, $hdr{$index});
@wc = sort(@wc);
@wc = sort { versioncmp($a, $b) } @wc;
#system "$SPMSG DSH $MSGCAT INFO511 'HOSTS '";
xCAT::MsgUtils->message("I", "HOSTS:");
print
"-------------------------------------------------------------------------\n";
xCAT::MsgUtils->message("I",
"HOSTS -------------------------------------------------------------------------"
);
&display_wc;
print
"-------------------------------------------------------------------------------\n";
"-------------------------------------------------------------------------------\n";
print $str{$index};
}
}

View File

@ -1 +1 @@
5
9

View File

@ -2,11 +2,14 @@ Source: xcat-client
Section: admin
Priority: extra
Maintainer: xCAT <xcat-user@lists.sourceforge.net>
Build-Depends: debhelper (>= 5)
Standards-Version: 3.7.2
Build-Depends: debhelper (>= 9)
Standards-Version: 3.9.4
Package: xcat-client
Architecture: all
Depends: ${perl:Depends}, nmap, perl-xcat
Depends: ${perl:Depends}, perl-xcat (>= 2.13-snap000000000000)
Recommends: libsort-versions-perl, nmap
Description: Core executables and data of the xCAT management project
xCAT-client provides the fundamental xCAT commands (chtab, chnode, rpower, etc) helpful in administrating systems at scale, with particular attention paid to large HPC clusters.
xCAT-client provides the fundamental xCAT commands (chtab, chnode, rpower,
etc) helpful in administrating systems at scale, with particular attention
paid to large HPC clusters.

View File

@ -9,9 +9,6 @@
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
export DH_COMPAT=5
build:
pwd
./xpod2man
@ -29,7 +26,6 @@ install:
dh_install -X".svn"
dh_link
# Build architecture-independent files here.
binary-indep: build install
# We have nothing to do by default.
@ -39,7 +35,7 @@ binary-arch:
pwd
dh_testdir
dh_testroot
dh_installchangelogs
dh_installchangelogs
dh_installdocs
# dh_installexamples
dh_install -X".svn"

View File

@ -4,7 +4,7 @@ B<xdshbak> - Formats the output of the B<xdsh> command.
=head1 B<SYNOPSIS>
B<xdshbak> [B<-c> | B<-x> | B<-h> | B<-q>]
B<xdshbak> [B<-c> | B<-x> [ B<-b> ] | B<-h> | B<-q>]
=head1 DESCRIPTION
@ -62,6 +62,9 @@ the output by hostname for easier viewing:
.
.
If the B<-b> flag is specified in addition to B<-x>, the hostname at the beginning
of each line is stripped.
=head2 Standard Error
When the B<xdshbak> filter is used and standard error messages are generated,
@ -72,6 +75,11 @@ output messages. This is true with and without the B<-c> flag.
=over 6
=item B<-b>
Strip the host prefix from the beginning of the lines. This only
works with the B<-x> option.
=item B<-c>
If the output from multiple nodes is identical it will be collapsed

View File

@ -16,7 +16,7 @@ The B<copycds> command copies all contents of Distribution DVDs/ISOs or Service
You can specify B<-i> or B<--inspection> option to check whether the DVDs/ISOs can be recognized by xCAT. If recognized, the distribution name, architecture and the disc no (the disc sequence number of DVDs/ISOs in multi-disk distribution) of the DVD/ISO is displayed. If xCAT doesn't recognize the DVD/ISO, you must manually specify the distro name and architecture using the B<-n> and B<-a> options. This is sometimes the case for distros that have very recently been released, and the xCAT code hasn't been updated for it yet.
You can get xCAT to recognize new DVDs/ISOs by adding them to /opt/xcat/lib/perl/xCAT/data/discinfo.pm and reloading xcatd (B<service xcatd reload>).
You can get xCAT to recognize new DVDs/ISOs by adding them to /opt/xcat/lib/perl/xCAT/data/discinfo.pm (the key of the hash is the first line of .discinfo) and reloading xcatd (B<service xcatd reload>).
=head1 OPTIONS

View File

@ -4,7 +4,7 @@ B<makeconservercf> - creates the conserver configuration file from info in the x
=head1 SYNOPSIS
B<makeconservercf> [B<-V|--verbose>] [B<-d|--delete>] I<noderange>
B<makeconservercf> [B<-V|--verbose>] [B<-d|--delete>] [I<noderange>]
B<makeconservercf> [B<-V|--verbose>] [B<-l|--local>] [I<noderange>]
@ -18,14 +18,16 @@ B<makeconservercf> [B<-h|--help|-v|--version>]
=head1 DESCRIPTION
The B<makeconservercf> command will write out the /etc/conserver.cf, using information from the nodehm table
and related tables (e.g. mp, ipmi, ppc). Normally, B<makeconservercf> will write all nodes to the conserver.cf
file. If a noderange is specified, it will write on those nodes to the file. In either case, if a node
and related tables (e.g. mp, ipmi, ppc). Normally, B<makeconservercf> will write all nodes to the /etc/conserver.cf
file. If a I<noderange> is specified, it will write only those nodes to the file. In either case, if a node
does not have nodehm.cons set, it will not be written to the file.
If B<-d> is specified, B<makeconservercf> will remove specified nodes from /etc/conserver.cf file. If I<noderange> is not specified, all xCAT nodes will be removed from /etc/conserver.cf file.
In the case of a hierarchical cluster (i.e. one with service nodes) B<makeconservercf> will determine
which nodes will have their consoles accessed from the management node and which from a service node
(based on the nodehm.conserver attribute). The /etc/conserver.cf file will be created accordingly on
all relevant management/service nodes. If -l is specified, it will only create the local file.
all relevant management/service nodes. If B<-l> is specified, it will only create the local file.
=head1 OPTIONS

View File

@ -1,7 +1,7 @@
Summary: Core executables and data of the xCAT management project
Name: xCAT-client
Version: %{?version:%{version}}%{!?version:%(cat Version)}
Release: %{?release:%{release}}%{!?release:snap%(date +"%Y%m%d%H%M")}
Release: %{?release:%{release}}%{!?release:%(cat Release)}
Epoch: 4
License: EPL
Group: Applications/System
@ -21,15 +21,13 @@ BuildRoot: /var/tmp/%{name}-%{version}-%{release}-root
BuildArch: noarch
%endif
Provides: xCAT-client = %{epoch}:%{version}
Requires: perl-xCAT >= %{epoch}:%{version}
Requires: perl-xCAT = 4:%{version}-%{release}
# fping or nmap is needed by pping (in case xCAT-client is installed by itself on a remote client)
%ifos linux
Requires: nmap perl-XML-Simple perl-XML-Parser
%else
Requires: expat
Requires: expat
%endif
%description
@ -355,4 +353,3 @@ if [ $1 == 0 ]; then #This means only on -e
rm -f /etc/profile.d/xcat.*
fi
%endif

View File

@ -1,7 +1,7 @@
Summary: xCAT integration with confluent systems management server
Name: xCAT-confluent
Version: %{?version:%{version}}%{!?version:%(cat Version)}
Release: %{?release:%{release}}%{!?release:snap%(date +"%Y%m%d%H%M")}
Release: %{?release:%{release}}%{!?release:%(cat Release)}
Epoch: 4
License: EPL
Group: Applications/System

View File

@ -1,7 +1,7 @@
Summary: Packages for installation of CSM nodes
Name: xCAT-csm
Version: %{?version:%{version}}%{!?version:%(cat Version)}
Release: %{?release:%{release}}%{!?release:snap%(date +"%Y%m%d%H%M")}
Release: %{?release:%{release}}%{!?release:%(cat Release)}
Epoch: 4
License: IBM
Group: Applications/System

View File

@ -1 +1 @@
5
9

View File

@ -2,15 +2,15 @@ Source: xcat-genesis-base-amd64
Section: admin
Priority: extra
Maintainer: xCAT <xcat-user@lists.sourceforge.net>
Build-Depends: debhelper (>= 8.0.0)
Standards-Version: 3.7.2
Build-Depends: debhelper (>= 9)
Standards-Version: 3.9.4
Package: xcat-genesis-base-amd64
Architecture: all
Depends:
Depends:
Replaces: xcat-genesis-amd64
Breaks: xcat-genesis-amd64
Description: xCAT Genesis netboot image
xCAT genesis (Genesis Enhanced Netboot Environment for System Information
and Servicing) is a small, embedded-like environment for xCAT's use in
discovery and management actions when interaction with an OS is infeasible.
discovery and management actions when interaction with an OS is infeasible.

View File

@ -9,7 +9,7 @@ dracut_install efibootmgr
#dracut_install libvirtd /usr/share/libvirt/cpu_map.xml /usr/bin/qemu-img /usr/libexec/qemu-kvm
dracut_install mkswap df brctl vconfig ifenslave ssh-keygen scp clear dhclient lldpad
dracut_install lldptool /lib64/libnss_dns-2.12.so /lib64/libnss_dns.so.2
dracut_install poweroff ntpq ntpd hwclock date /usr/share/terminfo/x/xterm /usr/share/terminfo/s/screen /etc/nsswitch.conf /etc/services
dracut_install poweroff ntpq ntpd ntp-wait hwclock date /usr/share/terminfo/x/xterm /usr/share/terminfo/s/screen /etc/nsswitch.conf /etc/services
dracut_install /sbin/rsyslogd /etc/protocols umount /bin/rpm /usr/lib/rpm/rpmrc
dracut_install chmod /lib/libc.so.6 /lib/ld-linux.so.2 /lib/libdl.so.2 /lib/libm.so.6 /sbin/route /sbin/ifconfig /usr/bin/whoami /usr/bin/head /usr/bin/tail basename /etc/redhat-release ping tr lsusb /usr/share/hwdata/usb.ids #ibm fw wrapper requirements
dracut_install dmidecode /usr/lib64/libstdc++.so.6 #uxspi prereqs, but will use dmidecode to improve decision on loading ipmi_si

View File

@ -10,7 +10,7 @@ dracut_install efibootmgr
#dracut_install libvirtd /usr/share/libvirt/cpu_map.xml /usr/bin/qemu-img /usr/libexec/qemu-kvm
dracut_install mkswap df brctl vconfig ifenslave ssh-keygen scp clear dhclient lldpad
dracut_install lldptool
dracut_install poweroff ntpq ntpd hwclock date /usr/share/terminfo/x/xterms /etc/nsswitch.conf /etc/services
dracut_install poweroff ntpq ntp-wait ntpd hwclock date /usr/share/terminfo/x/xterms /etc/nsswitch.conf /etc/services
dracut_install /usr/sbin/rsyslogd /etc/protocols umount /usr/bin/dpkg /usr/bin/rpm /usr/lib/rpm/rpmrc
if [ -n $version12 ];then
dracut_install /lib/x86_64-linux-gnu/libnss_dns-2.15.so /lib/x86_64-linux-gnu/libnss_dns.so.2

View File

@ -1,6 +1,6 @@
%define version %%REPLACE_CURRENT_VERSION%%
Version: %{?version:%{version}}%{!?version:%(cat Version)}
Release: %{?release:%{release}}%{!?release:snap%(date +"%Y%m%d%H%M")}
Release: %{?release:%{release}}%{!?release:%(cat Release)}
%ifarch i386 i586 i686 x86
%define tarch x86
%endif
@ -27,10 +27,11 @@ Group: System/Utilities
License: Various (see individual packages for details)
Vendor: IBM Corp.
Summary: xCAT Genesis netboot image
URL: http://xcat.org
URL: https://xcat.org/
Source1: xCAT-genesis-base-%{tarch}.tar.bz2
Buildroot: %{_localstatedir}/tmp/xCAT-genesis
BuildRequires: /usr/sbin/ntp-wait
Packager: IBM Corp.
%Description

View File

@ -1,7 +1,7 @@
BuildArch: noarch
%define name xCAT-genesis-builder
Version: %{?version:%{version}}%{!?version:%(cat Version)}
Release: %{?release:%{release}}%{!?release:snap%(date +"%Y%m%d%H%M")}
Release: %{?release:%{release}}%{!?release:%(cat Release)}
Epoch: 1
AutoReq: false
Requires: ipmitool screen btrfs-progs lldpad rpm-build compat-libstdc++-33 mstflint xfsprogs nc reiserfs-utils
@ -15,7 +15,7 @@ Group: System/Utilities
License: EPL
Vendor: IBM Corp.
Summary: Tooling to create xCAT's discovery/maintenance/debugging environment
URL: http://xcat.org
URL: https://xcat.org/
Source1: xCAT-genesis-builder.tar.bz2
Buildroot: %{_localstatedir}/tmp/xCAT-genesis-builder

View File

@ -29,6 +29,7 @@ TIMEOUT=15
function cold_reset_bmc() {
if [ -z $XPROD ]; then
logger -s -t $log_label -p local4.crit "CRITICAL ERROR - XPROD must be set before calling ${FUNCNAME[0]}"
rm -f /tmp/ipmicfg.xml
exit 1
fi
if [ "$XPROD" = "43707" -a "$IPMIMFG" != '0' ]; then
@ -87,6 +88,7 @@ function cold_reset_bmc() {
function snooze() {
if [ -z $XPROD ]; then
logger -s -t $log_label -p local4.crit "CRITICAL ERROR - XPROD must be set before calling ${FUNCNAME[0]}"
rm -f /tmp/ipmicfg.xml
exit 1
fi
if [ "$XPROD" = "43707" -a "$IPMIMFG" != '0' ]; then
@ -100,7 +102,15 @@ function snooze() {
logger -s -t $log_label -p local4.debug "snooze for 1 second..."
sleep 1
fi
}
}
if which ipmitool 2>&1 | grep no; then
echo "No ipmitool find, please install it first";
exit 1;
fi
# Add ipmi_devintf module to allow the ipmitool operation in-band
modprobe ipmi_devintf
allowcred.awk &
CREDPID=$!
@ -605,3 +615,5 @@ while [ $idev -gt 0 ]; do
fi
done
# remove the bmc configuration information before exit
rm -f /tmp/ipmicfg.xml

View File

@ -262,18 +262,24 @@ openssl genrsa -out /etc/xcat/certkey.pem 4096 > /dev/null 2>&1 &
logger -s -t $log_label -p local4.info "Acquired IPv4 address on $bootnic"
ip addr show dev $bootnic|grep -v 'scope link'|grep -v 'dynamic'|grep -v inet6|grep inet|awk '{print $2}'
logger -s -t $log_label -p local4.info "Starting ntpd..."
ntpd -g -x
logger -s -t $log_label -p local4.info "Waiting for ntpd to synchronize..."
ntp-wait -n 1999 -s 1 -v
if [ $? -ne 0 ]
then
logger -s -t $log_label -p local4.info "... ntpd did not synchronize."
fi
if [ -e "/dev/rtc" ]; then
( sleep 8 ; hwclock --systohc ) </dev/null >/dev/null 2>&1 &
logger -s -t $log_label -p local4.info "Attempting to sync hardware clock..."
( hwclock --systohc ) </dev/null >/dev/null 2>&1 &
disown
fi
# rv 0 state does not work with the new ntp versions
while [ "`ntpq -c 'rv 0 offset' | awk -F '=' '/offset=/ { print $2 }' | awk -F '.' '{ print $1 }' | sed s/-//`" -ge 1000 ]; do
sleep 1
done
logger -s -t $log_label -p local4.info "Restarting syslog..."
read -r RSYSLOG_PID </var/run/syslogd.pid 2>/dev/null
kill "$RSYSLOG_PID" 2>/dev/null
while kill -0 "$RSYSLOG_PID" 2>/dev/null

View File

@ -1,4 +1,5 @@
#!/bin/bash
log_label="xcat.genesis.getipmi"
allowcred.awk &
@ -6,6 +7,8 @@ CREDPID=$!
if [ -z "$XCATDEST" ]; then
XCATDEST=$1
fi
# This section only works in genesis
if [ -z "$XCATDEST" ]; then
for parm in `cat /proc/cmdline` ; do
if echo $parm |grep xcatd= > /dev/null; then
@ -13,6 +16,12 @@ if [ -z "$XCATDEST" ]; then
fi
done
fi
# This section works in diskless/diskful
# The environment MASTER_IP and XCATDPORT is exported by mypostscript
if [ -z "$XCATDEST" ]; then
XCATDEST=$MASTER_IP:$XCATDPORT
fi
for LANCHAN in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16; do
if ipmitool channel info $LANCHAN 2> /dev/null | grep 802.3 > /dev/null 2>&1 && ipmitool raw 0xc 2 $LANCHAN 5 0 0 > /dev/null 2>&1;
then break;

View File

@ -1 +1 @@
8
9

View File

@ -2,14 +2,17 @@ Source: xcat-genesis-scripts
Section: admin
Priority: extra
Maintainer: xCAT <xcat-user@lists.sourceforge.net>
Build-Depends: debhelper (>= 8.0.0)
Standards-Version: 3.9.2
Build-Depends: debhelper (>= 9)
Standards-Version: 3.9.4
Package: xcat-genesis-scripts-amd64
Architecture: all
Architecture: all
Depends: xcat-genesis-base-amd64 (>=2.13.0)
Conflicts: xcat-genesis-scripts,xcat-genesis-scripts-x86-64
Replaces: xcat-genesis-scripts,xcat-genesis-scripts-x86-64
Description: xCAT genesis
(Genesis Enhanced Netboot Environment for System Information and Servicing) is a small, embedded-like environment for xCAT's use in discovery and management actions when interaction with an OS is infeasible. This package reperesents the EPL content that is more tightly bound to specific xcat-core versions
Conflicts: xcat-genesis-scripts, xcat-genesis-scripts-x86-64
Replaces: xcat-genesis-scripts, xcat-genesis-scripts-x86-64
Description: xCAT genesis
(Genesis Enhanced Netboot Environment for System Information and Servicing)
is a small, embedded-like environment for xCAT's use in discovery and
management actions when interaction with an OS is infeasible. This package
reperesents the EPL content that is more tightly bound to specific xcat-core
versions.

View File

@ -2,14 +2,17 @@ Source: xcat-genesis-scripts
Section: admin
Priority: extra
Maintainer: xCAT <xcat-user@lists.sourceforge.net>
Build-Depends: debhelper (>= 8.0.0)
Standards-Version: 3.9.2
Build-Depends: debhelper (>= 9)
Standards-Version: 3.9.4
Package: xcat-genesis-scripts-ppc64
Architecture: all
Depends: xcat-genesis-base-ppc64 (>=2.13.0)
Conflicts: xcat-genesis-scripts
Replaces: xcat-genesis-scripts
Description: xCAT genesis
(Genesis Enhanced Netboot Environment for System Information and Servicing) is a small, embedded-like environment for xCAT's use in discovery and management actions when interaction with an OS is infeasible. This package reperesents the EPL content that is more tightly bound to specific xcat-core versions
Description: xCAT genesis
(Genesis Enhanced Netboot Environment for System Information and Servicing)
is a small, embedded-like environment for xCAT's use in discovery and
management actions when interaction with an OS is infeasible. This package
reperesents the EPL content that is more tightly bound to specific xcat-core
versions.

View File

@ -13,8 +13,8 @@ BuildArch: noarch
%define __spec_install_post :
%define debug_package %{nil}
%define __prelink_undo_cmd %{nil}
Version: %{?version:%{version}}%{!?version:%{version}}
Release: %{?release:%{release}}%{!?release:snap%(date +"%Y%m%d%H%M")}
Version: %{?version:%{version}}%{!?version:%(cat Version)}
Release: %{?release:%{release}}%{!?release:%(cat Release)}
Epoch: 1
AutoReq: false
Prefix: /opt/xcat
@ -22,14 +22,12 @@ AutoProv: false
Obsoletes: xCAT-genesis-%{tarch}
Provides: xCAT-genesis-%{tarch}
Name: %{name}
Group: System/Utilities
License: EPL
Vendor: IBM Corp
Vendor: IBM Corp.
Summary: xCAT Genesis netboot image - Core content
URL: http://xcat.org
URL: https://xcat.org/
Source1: xCAT-genesis-scripts.tar.bz2
Requires: xCAT-genesis-base-%{tarch} >= 2:2.13.0
@ -41,7 +39,6 @@ xCAT genesis (Genesis Enhanced Netboot Environment for System Information and Se
This package reperesents the EPL content that is more tightly bound to specific xcat-core versions
%Prep
%Build
%Install
@ -55,7 +52,6 @@ rm opt/xcat/share/xcat/netboot/genesis/%{tarch}/fs/*.spec
rm opt/xcat/share/xcat/netboot/genesis/%{tarch}/fs/LICENSE.html
cd -
# Since this rpm is being installed/updated, we need to run mknb to combine it with
# xCAT-genesis-base-x86_64, but mknb will not work during an initial install of xcat
# until the xCAT meta pkg has run xcatconfig or xCATsn has started xcatd. Use of a trigger
@ -72,7 +68,6 @@ echo "If you are installing/updating xCAT-genesis-base separately, not as part o
mkdir -p /etc/xcat
touch /etc/xcat/genesis-scripts-updated
%Files
%defattr(-,root,root)
#%dir %attr(-,root,root) %{rpminstallroot}
@ -103,5 +98,5 @@ touch /etc/xcat/genesis-scripts-updated
%{rpminstallroot}/etc/udev/rules.d/99-imm.rules
%{rpminstallroot}/etc/udev/rules.d/98-mlx.rules
%{rpminstallroot}/sbin/setupimmnic
%{rpminstallroot}/sbin/loadmlxeth
%{rpminstallroot}/sbin/loadmlxeth
%exclude %{rpminstallroot}/debian/*

View File

@ -1 +1 @@
5
9

View File

@ -2,11 +2,11 @@ Source: xcat-probe
Section: admin
Priority: extra
Maintainer: xCAT <xcat-user@lists.sourceforge.net>
Build-Depends: debhelper (>= 5)
Standards-Version: 3.7.2
Build-Depends: debhelper (>= 9)
Standards-Version: 3.9.4
Package: xcat-probe
Architecture: all
Depends: ${perl:Depends}
Recommends: wget, dnsutils, tftp-hpa
Description: Provides a toolkit to help probe all the possible issues in xCAT
Description: Provides a toolkit to probe possible issues in xCAT

View File

@ -9,9 +9,6 @@
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
export DH_COMPAT=5
build:
dh_testdir
pwd
@ -29,7 +26,6 @@ install:
dh_install -X".svn"
dh_link
# Build architecture-independent files here.
binary-indep: build install
# We have nothing to do by default.
@ -40,7 +36,7 @@ binary-arch:
export
dh_testdir
dh_testroot
dh_installchangelogs
dh_installchangelogs
dh_installdocs
# dh_installexamples
dh_install -X".svn"

View File

@ -23,6 +23,7 @@ use File::Basename;
Arguments:
Public attributes:
$self->{verbose}:scalar, Offer verbose information, used for handling feature logic
$self->{load_type}:scalar, $::MONITOR or $::REPLAY, used for distinguishing monitor and replay.
private attributes:
$self->{log_open_info}: reference of a hash, used to save the log file operating information.
$self->{current_ref_year}: scalar, the year information of current time. such as 2016. Used for log time parsing
@ -50,6 +51,7 @@ sub new {
my $self = {};
my $class = shift;
$self->{verbose} = shift;
$self->{load_type} = shift;
my %log_open_info;
$self->{log_open_info} = \%log_open_info;
@ -478,6 +480,7 @@ sub obtain_log_content {
if ($log_type == $::LOGTYPE_RSYSLOG) {
if ($split_line[0] =~ /(\d+)-(\d+)-(\d+)T(\d+):(\d+):(\d+)(.+)-(.+)/) {
$log_content{time_record} = "$4:$5:$6";
$log_content{time} = $self->convert_to_epoch_seconds($split_line[0]);
if (!xCAT::NetworkUtils->isIpaddr($split_line[1])) {
my @sender_tmp = split(/\./, $split_line[1]);
@ -505,7 +508,8 @@ sub obtain_log_content {
}
} else {
my $timestamp = join(" ", @split_line[ 0 .. 2 ]);
$log_content{time} = $self->convert_to_epoch_seconds($timestamp);
$log_content{time_record} = $split_line[2];
$log_content{time} = $self->convert_to_epoch_seconds($timestamp);
if (!xCAT::NetworkUtils->isIpaddr($split_line[3])) {
my @sender_tmp = split(/\./, $split_line[3]);
$log_content{sender} = $sender_tmp[0];
@ -533,6 +537,9 @@ sub obtain_log_content {
}
} elsif ($log_type == $::LOGTYPE_HTTP) {
$split_line[3] =~ s/^\[(.+)/$1/g;
if ($split_line[3] =~ /(\d+)\/(\w+)\/(\d+):(\d+):(\d+):(\d+)/) {
$log_content{time_record} = "$4:$5:$6";
}
$log_content{time} = $self->convert_to_epoch_seconds($split_line[3]);
if (!xCAT::NetworkUtils->isIpaddr($split_line[0])) {
my @sender_tmp = split(/\./, $split_line[0]);
@ -581,15 +588,23 @@ sub convert_to_epoch_seconds {
($mday, $dday, $h, $m, $s) = ($1, $2, $3, $4, $5);
$yday = $self->{current_ref_year};
$epoch_seconds = timelocal($s, $m, $h, $dday, $monthsmap{$mday}, $yday);
if ($epoch_seconds > $self->{current_ref_time}) {
--$yday;
$epoch_seconds = timelocal($s, $m, $h, $dday, $monthsmap{$mday}, $yday);
if ($self->{load_type} == $::MONITOR) {
if ($epoch_seconds < $self->{current_ref_time}) {
++$yday;
$epoch_seconds = timelocal($s, $m, $h, $dday, $monthsmap{$mday}, $yday);
}
} else {
if ($epoch_seconds > $self->{current_ref_time}) {
--$yday;
$epoch_seconds = timelocal($s, $m, $h, $dday, $monthsmap{$mday}, $yday);
}
}
# The time format looks like "15/Aug/2016:01:10:24"
} elsif ($timestr =~ /(\d+)\/(\w+)\/(\d+):(\d+):(\d+):(\d+)/) {
$epoch_seconds = timelocal($6, $5, $4, $1, $monthsmap{$2}, $3);
}
return $epoch_seconds;
}

View File

@ -2,6 +2,10 @@
# IBM(c) 2007 EPL license http://www.eclipse.org/legal/epl-v10.html
package probe_global_constant;
#The type of load log
$::MONITOR = 0;
$::REPLAY = 1;
#The type of log
$::LOGTYPE_RSYSLOG = 0; #rsyslog
$::LOGTYPE_HTTP = 1; #apache log

View File

@ -257,6 +257,7 @@ sub is_firewall_open {
Test if http service is ready to use in current operating system
Arguments:
ip: http server's ip
errormsg_ref: (output attribute) if there is something wrong for HTTP service, this attribute save the possible reason.
Returns:
1 : yes
0 : no
@ -266,20 +267,70 @@ sub is_firewall_open {
sub is_http_ready {
my $mnip = shift;
$mnip = shift if (($mnip) && ($mnip =~ /probe_utils/));
my $installdir = shift;
my $errormsg_ref = shift;
my $http = "http://$mnip/install/postscripts/syslog";
rename("./syslog", "./syslog.org") if (-e "./syslog");
my $http = "http://$mnip/$installdir/postscripts/syslog";
my %httperror = (
"400" => "The request $http could not be understood by the server due to malformed syntax",
"401" => "The request requires user authentication.",
"403" => "The server understood the request, but is refusing to fulfill it.",
"404" => "The server has not found anything matching the test Request-URI $http.",
"405" => "The method specified in the Request-Line $http is not allowe.",
"406" => "The method specified in the Request-Line $http is not acceptable.",
"407" => "The wget client must first authenticate itself with the proxy.",
"408" => "The client did not produce a request within the time that the server was prepared to wait. The client MAY repeat the request without modifications at any later time.",
"409" => "The request could not be completed due to a conflict with the current state of the resource.",
"410" => "The requested resource $http is no longer available at the server and no forwarding address is known.",
"411" => "The server refuses to accept the request without a defined Content- Length.",
"412" => "The precondition given in one or more of the request-header fields evaluated to false when it was tested on the server.",
"413" => "The server is refusing to process a request because the request entity is larger than the server is willing or able to process.",
"414" => "The server is refusing to service the request because the Request-URI is longer than the server is willing to interpret.",
"415" => "The server is refusing to service the request because the entity of the request is in a format not supported by the requested resource for the requested method.",
"416" => "Requested Range Not Satisfiable",
"417" => "The expectation given in an Expect request-header field could not be met by this server",
"500" => "The server encountered an unexpected condition which prevented it from fulfilling the request.",
"501" => "The server does not recognize the request method and is not capable of supporting it for any resource.",
"502" => "The server, while acting as a gateway or proxy, received an invalid response from the upstream server it accessed in attempting to fulfill the reques.",
"503" => "The server is currently unable to handle the request due to a temporary overloading or maintenance of the server.",
"504" => "The server, while acting as a gateway or proxy, did not receive a timely response from the upstream server specified by the URI or some other auxiliary server it needed to access in attempting to complete the request.",
"505" => "The server does not support, or refuses to support, the HTTP protocol version that was used in the request message.");
my $outputtmp = `wget $http 2>&1`;
my $rst = $?;
if (($outputtmp =~ /200 OK/) && (!$rst) && (-e "./syslog")) {
unlink("./syslog");
rename("./syslog.org", "./syslog") if (-e "./syslog.org");
return 1;
} else {
rename("./syslog.org", "./syslog") if (-e "./syslog.org");
my $tmpdir = "/tmp/xcatprobe$$/";
if(! mkpath("$tmpdir")){
$$errormsg_ref = "Prepare test environment error: $!";
return 0;
}
my @outputtmp = `wget -O $tmpdir/syslog $http 2>&1`;
my $rst = $?;
$rst = $rst >> 8;
if ((!$rst) && (-e "$tmpdir/syslog")) {
unlink("$tmpdir/syslog");
rmdir ("$tmpdir");
return 1;
} elsif ($rst == 4) {
$$errormsg_ref = "Network failure, the server refuse connection. Please check if httpd service is running first.";
} elsif ($rst == 5) {
$$errormsg_ref = "SSL verification failure, the server refuse connection";
} elsif ($rst == 6) {
$$errormsg_ref = "Username/password authentication failure, the server refuse connection";
} elsif ($rst == 8) {
my $returncode = $outputtmp[2];
chomp($returncode);
$returncode =~ s/.+(\d\d\d).+/$1/g;
if(exists($httperror{$returncode})){
$$errormsg_ref = $httperror{$returncode};
}else{
#should not hit this block normally
$$errormsg_ref = "Unknown return code of wget <$returncode>.";
}
}
unlink("$tmpdir/syslog");
if(! rmdir ("$tmpdir")){
$$errormsg_ref .= " Clean test environment error(rmdir $tmpdir): $!";
}
return 0;
}
#------------------------------------------
@ -298,20 +349,21 @@ sub is_http_ready {
sub is_tftp_ready {
my $mnip = shift;
$mnip = shift if (($mnip) && ($mnip =~ /probe_utils/));
rename("/tftpboot/tftptestt.tmp", "/tftpboot/tftptestt.tmp.old") if (-e "/tftpboot/tftptestt.tmp");
my $tftpdir = shift;
rename("/$tftpdir/tftptestt.tmp", "/$tftpdir/tftptestt.tmp.old") if (-e "/$tftpdir/tftptestt.tmp");
rename("./tftptestt.tmp", "./tftptestt.tmp.old") if (-e "./tftptestt.tmp");
system("touch /tftpboot/tftptestt.tmp");
system("touch /$tftpdir/tftptestt.tmp");
my $output = `tftp -4 -v $mnip -c get tftptestt.tmp`;
if ((!$?) && (-e "./tftptestt.tmp")) {
unlink("./tftptestt.tmp");
rename("./tftptestt.tmp.old", "./tftptestt.tmp") if (-e "./tftptestt.tmp.old");
rename("/tftpboot/tftptestt.tmp.old", "/tftpboot/tftptestt.tmp") if (-e "/tftpboot/tftptestt.tmp.old");
rename("/$tftpdir/tftptestt.tmp.old", "/$tftpdir/tftptestt.tmp") if (-e "/$tftpdir/tftptestt.tmp.old");
return 1;
} else {
rename("./tftptestt.tmp.old", "./tftptestt.tmp") if (-e "./tftptestt.tmp.old");
rename("/tftpboot/tftptestt.tmp.old", "/tftpboot/tftptestt.tmp") if (-e "/tftpboot/tftptestt.tmp.old");
rename("/$tftpdir/tftptestt.tmp.old", "/$tftpdir/tftptestt.tmp") if (-e "/$tftpdir/tftptestt.tmp.old");
return 0;
}
}
@ -436,4 +488,66 @@ sub parse_node_range {
chomp @nodeslist;
return @nodeslist;
}
#------------------------------------------
=head3
Description:
Test if ntp service is ready to use in current operating system
Arguments:
errormsg_ref: (output attribute) if there is something wrong for ntp service, this attribute save the possible reason.
Returns:
1 : yes
0 : no
=cut
#------------------------------------------
sub is_ntp_ready{
my $errormsg_ref = shift;
$errormsg_ref= shift if (($errormsg_ref) && ($errormsg_ref =~ /probe_utils/));
my $cmd = 'ntpq -c "rv 0"';
$| = 1;
#wait 5 seconds for ntpd synchronize at most
for (my $i = 0; $i < 5; ++$i) {
if(!open(NTP, $cmd." 2>&1 |")){
$$errormsg_ref = "Can't start ntpq: $!";
return 0;
}else{
while(<NTP>) {
chomp;
if (/^associd=0 status=(\S{4}) (\S+),/) {
my $leap=$2;
last if ($leap =~ /(sync|leap)_alarm/);
if ($leap =~ /leap_(none|((add|del)_sec))/){
close(NTP);
return 1;
}
#should not hit below 3 lines normally
$$errormsg_ref = "Unexpected ntpq output ('leap' status <$leap>), please contact xCAT team";
close(NTP);
return 0;
}elsif(/Connection refused/) {
$$errormsg_ref = "ntpd service is not running! Please setup ntp in current node";
close(NTP);
return 0;
}else{
#should not hit this block normally
$$errormsg_ref = "Unexpected ntpq output <$_>, please contact xCAT team";
close(NTP);
return 0;
}
}
}
close(NTP);
sleep 1;
}
$$errormsg_ref = "ntpd did not synchronize.";
return 0;
}
1;

View File

@ -242,7 +242,7 @@ sub check_pre_defined_node {
foreach my $mtmsnode (@{$mtms_node{$mtms}}) {
next if ($mtmsnode eq $node);
if (exists($nodecheckrst{$mtmsnode})) {
if (($nodecheckrst{$mtmsnode}{"nodetype"} eq $nodecheckrst{$node}{"nodetype"}) and ($nodecheckrst{$mtmsnode}{"mp"} eq $nodecheckrst{$node}{"hwtype"})) {
if (($nodecheckrst{$mtmsnode}{"nodetype"} eq $nodecheckrst{$node}{"nodetype"}) and ($nodecheckrst{$mtmsnode}{"hwtype"} eq $nodecheckrst{$node}{"hwtype"})) {
push @error_mtms, $mtms if (!grep {$_ eq $mtms} @error_mtms);
}
} else {
@ -315,10 +315,20 @@ sub check_pre_defined_node {
my $keystring;
foreach my $node (keys %nodecheckrst) {
{
last if ($nodecheckrst{$node}{"nodetype"} eq "switch");
my @error_attribute = ();
$keystring = "";
if (!(exists($nodecheckrst{$node}{"switch"}) && exists($nodecheckrst{$node}{"switchport"}))) {
last if ($nodecheckrst{$node}{"nodetype"} eq "switch");
$keystring = "Atrribute 'switch' or 'switchport' isn't defined for '$discovery_type' type discovery";
if (!(exists($nodecheckrst{$node}{"switch"})) or $nodecheckrst{$node}{"switch"} !~ /^\w/) {
push @error_attribute, "switch";
}
if (!(exists($nodecheckrst{$node}{"switchport"})) or $nodecheckrst{$node}{"switchport"} !~ /^\w/) {
push @error_attribute, "switchport";
}
if (@error_attribute) {
$keystring = "Attribute " . join(", ", @error_attribute) . " Invalid";
last;
} else {
my $switchport = "$nodecheckrst{$node}{\"switch\"}*$nodecheckrst{$node}{\"switchport\"}";
@ -914,7 +924,7 @@ sub do_monitor {
my %fd_filetype_map;
{ #a very important brace to hold a code block
my $log_parse = LogParse->new($verbose);
my $log_parse = LogParse->new($verbose, $::MONITOR);
my $candidate_log_ref = $log_parse->obtain_log_file_list();
#open candidate log file to obtain realtime log
@ -1071,7 +1081,7 @@ sub do_replay {
print Dumper \%node_state;
}
my $log_parse = LogParse->new($verbose);
my $log_parse = LogParse->new($verbose, $::REPLAY);
my @candidate_mn_hostname_in_log = $log_parse->obtain_candidate_mn_hostname_in_log();
while ($start_time_of_replay < $end_time_of_replay) {
@ -1188,11 +1198,11 @@ sub handle_dhcp_msg {
my $nic = $2;
if ($3 =~ /no free leases/) {
probe_utils->send_msg("stdout", "d", "[$mac] Received DHCPDISCOVER from $mac via $nic, no free leases") if ($monitor);
probe_utils->send_msg("stdout", "d", "[$mac] $log_ref->{time_record} Received DHCPDISCOVER from $mac via $nic, no free leases") if ($monitor);
return 0;
}
my $record = "Received DHCPDISCOVER from $mac via $nic";
probe_utils->send_msg("stdout", "d", "[$mac] $record") if ($monitor);
probe_utils->send_msg("stdout", "d", "[$mac] $log_ref->{time_record} $record") if ($monitor);
push(@{ $node_state_ref->{$mac}{log} }, $log_ref->{msg}) if ($debug);
} elsif ($log_ref->{msg} =~ /DHCPOFFER\s+on\s+(.+)\s+to\s+(\w\w:\w\w:\w\w:\w\w:\w\w:\w\w).+via\s+(.+)/i) {
my $ip = $1;
@ -1200,7 +1210,7 @@ sub handle_dhcp_msg {
my $nic = $3;
my $record = "Sent DHCPOFFER on $ip back to $mac via $nic";
probe_utils->send_msg("stdout", "d", "[$mac] $record") if ($monitor);
probe_utils->send_msg("stdout", "d", "[$mac] $log_ref->{time_record} $record") if ($monitor);
push(@{ $node_state_ref->{$mac}{log} }, $log_ref->{msg}) if ($debug);
} elsif ($log_ref->{msg} =~ /DHCPREQUEST\s+for\s+(.+)\s+[\(\)0-9\.]*\s*from\s+(\w\w:\w\w:\w\w:\w\w:\w\w:\w\w).+via\s+(.+)/) {
my $ip = $1;
@ -1208,7 +1218,7 @@ sub handle_dhcp_msg {
my $nic = $3;
my $record = "Received DHCPREQUEST from $mac for $ip via $nic";
probe_utils->send_msg("stdout", "d", "[$mac] $record") if ($monitor);
probe_utils->send_msg("stdout", "d", "[$mac] $log_ref->{time_record} $record") if ($monitor);
push(@{ $node_state_ref->{$mac}{log} }, $log_ref->{msg}) if ($debug);
} elsif ($log_ref->{msg} =~ /DHCPACK\s+on\s+(.+)\s+to\s+(\w\w:\w\w:\w\w:\w\w:\w\w:\w\w).+via\s+(.+)/) {
my $ip = $1;
@ -1216,7 +1226,7 @@ sub handle_dhcp_msg {
my $nic = $3;
my $record = "Sent DHCPACK on $ip back to $mac via $nic";
probe_utils->send_msg("stdout", "d", "[$mac] $record") if ($monitor);
probe_utils->send_msg("stdout", "d", "[$mac] $log_ref->{time_record} $record") if ($monitor);
push(@{ $node_state_ref->{$mac}{log} }, $log_ref->{msg}) if ($debug);
$ipmacmap{$ip} = $mac;
$node_state_ref->{$mac}{type} = "mac";
@ -1225,11 +1235,11 @@ sub handle_dhcp_msg {
my $mac = $1;
my $nic = $2;
if ($3 =~ /no dynamic leases/) {
probe_utils->send_msg("stdout", "d", "Received DHCPDISCOVER from $mac via $nic, no free leases") if ($monitor);
probe_utils->send_msg("stdout", "d", "[$mac] $log_ref->{time_record} Received DHCPDISCOVER from $mac via $nic, no free leases") if ($monitor);
return 0;
}
my $record = "Received BOOTREQUEST from $mac via $nic";
probe_utils->send_msg("stdout", "d", "[$mac] $record") if ($monitor);
probe_utils->send_msg("stdout", "d", "[$mac] $log_ref->{time_record} $record") if ($monitor);
push(@{ $node_state_ref->{$mac}{log} }, $log_ref->{msg}) if ($debug);
} elsif ($log_ref->{msg} =~ /BOOTREPLY\s+for\s+(.+)\s+to\s+.+(\w\w:\w\w:\w\w:\w\w:\w\w:\w\w).+via\s+(.+)/) {
my $ip = $1;
@ -1237,7 +1247,7 @@ sub handle_dhcp_msg {
my $nic = $3;
my $record = "Sent BOOTREPLY on $ip back to $mac via $nic";
probe_utils->send_msg("stdout", "d", "[$mac] $record") if ($monitor);
probe_utils->send_msg("stdout", "d", "[$mac] $log_ref->{time_record} $record") if ($monitor);
push(@{ $node_state_ref->{$mac}{log} }, $log_ref->{msg}) if ($debug);
$ipmacmap{$ip} = $mac;
$node_state_ref->{$mac}{type} = "mac";
@ -1269,7 +1279,7 @@ sub handle_tftp_msg {
if (exists($node_state_ref->{$mac})) {
my $record = "Via TFTP $ip download $file";
probe_utils->send_msg("stdout", "d", "[$mac] $record") if ($monitor);
probe_utils->send_msg("stdout", "d", "[$mac] $log_ref->{time_record} $record") if ($monitor);
push(@{ $node_state_ref->{$mac}{log} }, $log_ref->{msg}) if ($debug);
if ($file =~ /\/pxelinux.cfg\//i or $file =~ /\/xcat\/xnba\/nets\//i) {
@ -1309,7 +1319,7 @@ sub handle_http_msg {
if ($file =~ /\/install\//i) {
return;
}
probe_utils->send_msg("stdout", "d", "[$mac] $record") if ($monitor);
probe_utils->send_msg("stdout", "d", "[$mac] $log_ref->{time_record} $record") if ($monitor);
push(@{ $node_state_ref->{$mac}{log} }, $log_ref->{msg}) if ($debug);
if ($file =~ /\/pxelinux.cfg\//i or $file =~ /\/xcat\/xnba\/nets\//i) {
@ -1349,13 +1359,13 @@ sub handle_cluster_msg {
$node_state_ref->{$node}{id} = $mac;
$node_state_ref->{$node}{discoverytype} = $type;
my $record = "Start to update node information, discovery type is $type";
probe_utils->send_msg("stdout", "d", "[$mac] $record") if ($monitor);
probe_utils->send_msg("stdout", "d", "[$mac] $log_ref->{time_record} $record") if ($monitor);
set_node_state($node_state_ref, $mac, $::STATE_DISCOVER_UPDATE);
push(@{ $node_state_ref->{$mac}{log} }, $log_ref->{msg}) if ($debug);
} elsif ($log_ref->{msg} =~ /xcat.discovery.$discovery_type: \((.+)\) Warning: Could not find any nodes using (.+) discovery/i) {
my $mac = $1;
my $type = $2;
probe_utils->send_msg("stdout", "w", "[$mac] Could not find any nodes using $type discovery") if ($monitor);
probe_utils->send_msg("stdout", "w", "[$mac] $log_ref->{time_record} Could not find any nodes using $type discovery") if ($monitor);
set_node_state($node_state_ref, $mac, $::STATE_DISCOVER_FAILED);
push(@{ $node_state_ref->{$mac}{log} }, $log_ref->{msg}) if ($debug);
}
@ -1381,7 +1391,7 @@ sub handle_compute_msg {
my $mac = $ipmacmap{$ip};
if (exists $node_state_ref->{$mac}) {
probe_utils->send_msg("stdout", "d", "[$mac] ($ip) $log_ref->{msg}") if ($monitor);
probe_utils->send_msg("stdout", "d", "[$mac] $log_ref->{time_record} ($ip) $log_ref->{msg}") if ($monitor);
push(@{ $node_state_ref->{$mac}{log} }, $log_ref->{msg}) if ($debug);
if ($log_ref->{label} == $::LOGLABEL_DOXCAT) {
@ -1403,7 +1413,7 @@ sub handle_compute_msg {
}
if ($node ne "") {
$node_state_ref->{$node}{done} = 1;
probe_utils->send_msg("stdout", "o", "[$mac] node $node discovery completed") if ($monitor);
probe_utils->send_msg("stdout", "o", "[$mac] $log_ref->{time_record} node $node discovery completed") if ($monitor);
set_node_state($node_state_ref, $mac, $::STATE_DISCOVER_COMPLETED);
}
}

View File

@ -293,6 +293,17 @@ sub check_noderange {
$mac =~ s/\!\*NOIP\*//g;
$macmap{$mac}{"ip"} = "NOIP";
$macmap{$mac}{"node"} = $node;
} elsif ($mac =~ /(\w{2}:\w{2}:\w{2}:\w{2}:\w{2}:\w{2})\!(.+)/) {
$mac = $1;
my $tmp_node = $2;
$macmap{$mac}{"node"} = $node;
my $tmp_ip = xCAT::NetworkUtils->getipaddr($tmp_node);
if ($tmp_ip) {
$macmap{$mac}{"ip"} = $tmp_ip;
$ipnodemap{ $nodecheckrst{$node}{"ip"} } = $node;
} else {
$macmap{$mac}{"ip"} = "NOIP";
}
} else {
$macmap{$mac}{"node"} = $node;
$macmap{$mac}{"ip"} = $nodecheckrst{$node}{"ip"};
@ -330,6 +341,7 @@ sub init_node_state {
my @nodes = probe_utils->parse_node_range($noderange);
foreach my $node (@nodes) {
@{ $node_state_ref->{$node}{statehistory} } = ();
%{ $node_state_ref->{$node}{errors} } = ();
$node_state_ref->{$node}{done} = 0;
}
}
@ -374,7 +386,7 @@ sub do_replay {
print Dumper \%node_state;
}
my $log_parse = LogParse->new($verbose);
my $log_parse = LogParse->new($verbose, $::REPLAY);
my @candidate_mn_hostname_in_log = $log_parse->obtain_candidate_mn_hostname_in_log();
while ($start_time_of_replay < $end_time_of_replay) {
@ -454,7 +466,6 @@ sub conclusion_report {
my $stop_stage = 0;
my $start_rpower = 0;
my $power_on = 0;
my $isntalling = 0;
my $postbootscript = 0;
@ -463,32 +474,36 @@ sub conclusion_report {
foreach (@{ $node_state_ref->{$node}{statehistory} }) {
$stop_stage = $_ if ($stop_stage < $_);
$start_rpower = 1 if ($_ == $::STATE_POWER_ON);
$power_on = 1 if ($_ == $::STATE_POWERINGON);
$isntalling = 1 if ($_ == $::STATE_INSTALLING);
$postbootscript = 1 if ($_ == $::STATE_POSTBOOTSCRIPT);
}
# Cover limited non-privision error
# 1 if xcatd receive reboot command to do provision (such like rpower, rnetboot, rinstall...) but the node status didn't change to "powering-on"
# that means reboot target node failed.
# 2 if power on target node successfully and there is 'running postbootscript' in node state history, but without "installing" state,
# Cover limited non-privision error
# 1 if power on target node successfully and there is 'running postbootscript' in node state history, but without "installing" state,
# It is very possible to just do reboot process
# 3 There isn't reboot operation for target node during the rollback time window
# 2 When replay, if there isn't reboot operation for target node during the rollback time window
# That means there isn't provision process happened
if ($start_rpower && !$power_on) {
$failed_node{$node}{non_provision_prediction} = "Trigger target node reboot failed";
} elsif ($start_rpower && $power_on && !$isntalling && $postbootscript) {
$failed_node{$node}{non_provision_prediction} = "Target node just reboot from disk";
} elsif (! $start_rpower){
$failed_node{$node}{non_provision_prediction} = "Without provision process during rollback time window";
if ($monitor) {
if (!$isntalling && $postbootscript) {
$failed_node{$node}{non_provision_prediction} = "Target node just reboot from disk";
next;
}
} else {
if ($stop_stage != $::STATE_COMPLETED) {
$failed_node{$node}{provision_stop_point} = $stop_stage;
if (! $start_rpower) {
$failed_node{$node}{non_provision_prediction} = "Without provision process during rollback time window";
next;
} elsif (!$isntalling && $postbootscript) {
$failed_node{$node}{non_provision_prediction} = "Target node just reboot from disk";
next;
}
}
}
# if not completed or completed but with postscript error, add node to failed_node hash
if ($stop_stage != $::STATE_COMPLETED or @{ $node_state_ref->{$node}{errors}{$::STATE_POSTSCRIPT} }) {
$failed_node{$node}{provision_stop_point} = $stop_stage;
}
}
if (%failed_node) {
my $failed_node_num = keys %failed_node;
@ -502,7 +517,22 @@ sub conclusion_report {
if ($failed_node{$node}{non_provision_prediction}) {
probe_utils->send_msg("stdout", "f", "$node : $failed_node{$node}{non_provision_prediction}");
} else {
my $node_length = length($node);
my $space_str = " " x ($length_node + 2);
# if stop at stage before postscript, means there is error at current stage, print error message
probe_utils->send_msg("stdout", "f", "$node : stop at stage '$::STATE_DESC{$failed_node{$node}{provision_stop_point}}'");
if ($failed_node{$node}{provision_stop_point} < $::STATE_POSTSCRIPT) {
foreach my $node_error (@{ $node_state_ref->{$node}{errors}{$failed_node{$node}{provision_stop_point}} }) {
probe_utils->send_msg("stdout", "d", "$space_str $node_error");
}
} else {
# if stop at postscript or after postscript, check whether has error from postscript, if has print
for (my $stage = $::STATE_POSTSCRIPT; $stage <= $::STATE_COMPLETED; $stage++) {
foreach my $node_error (@{ $node_state_ref->{$node}{errors}{$stage} }) {
probe_utils->send_msg("stdout", "d", "$space_str $node_error");
}
}
}
}
}
} else {
@ -548,7 +578,7 @@ Start capturing every message during OS provision process....
my %fd_filetype_map;
{ #a very important brace to hold a code block
my $log_parse = LogParse->new($verbose);
my $log_parse = LogParse->new($verbose, $::MONITOR);
my $candidate_log_ref = $log_parse->obtain_log_file_list();
#open candidate log file to obtain realtime log
@ -718,7 +748,7 @@ sub handle_dhcp_msg {
if (exists $macmap{$mac}) {
my $node = $macmap{$mac}{"node"};
my $record = "Receive DHCPDISCOVER via $nic";
probe_utils->send_msg("stdout", "d", "[$node] $record") if ($monitor);
probe_utils->send_msg("stdout", "d", "[$node] $log_ref->{time_record} $record") if ($monitor);
push(@{ $node_state_ref->{$node}{log} }, $log_ref->{msg}) if ($debug);
}
} elsif ($log_ref->{msg} =~ /DHCPOFFER\s+on\s+(.+)\s+to\s+(.+)\s+via\s+(.+)/i) {
@ -729,7 +759,7 @@ sub handle_dhcp_msg {
if (exists $macmap{$mac}) {
my $node = $macmap{$mac}{"node"};
my $record = "Send DHCPOFFER on $ip back to $mac via $nic";
probe_utils->send_msg("stdout", "d", "[$node] $record") if ($monitor);
probe_utils->send_msg("stdout", "d", "[$node] $log_ref->{time_record} $record") if ($monitor);
push(@{ $node_state_ref->{$node}{log} }, $log_ref->{msg}) if ($debug);
}
} elsif ($log_ref->{msg} =~ /DHCPREQUEST\s+for\s+(.+)\s+[\(\)0-9\.]*\s*from\s+(.+)\s+via\s+(.+)/) {
@ -740,7 +770,7 @@ sub handle_dhcp_msg {
if (exists $macmap{$mac}) {
my $node = $macmap{$mac}{"node"};
my $record = $log_ref->{msg};
probe_utils->send_msg("stdout", "d", "[$node] $record") if ($monitor);
probe_utils->send_msg("stdout", "d", "[$node] $log_ref->{time_record} $record") if ($monitor);
push(@{ $node_state_ref->{$node}{log} }, $log_ref->{msg}) if ($debug);
}
} elsif ($log_ref->{msg} =~ /DHCPACK\s+on\s+(.+)\s+to\s+(.+)\s+via\s+(.+)/) {
@ -751,7 +781,7 @@ sub handle_dhcp_msg {
if (exists $macmap{$mac}) {
my $node = $macmap{$mac}{"node"};
my $record = "Send DHCPACK on $ip back to $mac via $nic";
probe_utils->send_msg("stdout", "d", "[$node] $record") if ($monitor);
probe_utils->send_msg("stdout", "d", "[$node] $log_ref->{time_record} $record") if ($monitor);
push(@{ $node_state_ref->{$node}{log} }, $log_ref->{msg}) if ($debug);
if ($macmap{$mac}{"ip"} != "NOIP" and $macmap{$mac}{"ip"} != $ip) {
@ -770,7 +800,7 @@ sub handle_dhcp_msg {
if (exists $macmap{$mac}) {
my $node = $macmap{$mac}{"node"};
my $record = "Receive BOOTREQUEST from $mac via $nic";
probe_utils->send_msg("stdout", "d", "[$node] $record") if ($monitor);
probe_utils->send_msg("stdout", "d", "[$node] $log_ref->{time_record} $record") if ($monitor);
push(@{ $node_state_ref->{$node}{log} }, $log_ref->{msg}) if ($debug);
}
} elsif ($log_ref->{msg} =~ /BOOTREPLY\s+for\s+(.+)\s+to\s+.+(\w\w:\w\w:\w\w:\w\w:\w\w:\w\w).+via\s+(.+)/) {
@ -781,7 +811,7 @@ sub handle_dhcp_msg {
if (exists $macmap{$mac}) {
my $node = $macmap{$mac}{"node"};
my $record = "Send BOOTREPLY on $ip back to $mac via $nic";
probe_utils->send_msg("stdout", "d", "[$node] $record") if ($monitor);
probe_utils->send_msg("stdout", "d", "[$node] $log_ref->{time_record} $record") if ($monitor);
push(@{ $node_state_ref->{$node}{log} }, $log_ref->{msg}) if ($debug);
if ($macmap{$mac}{"ip"} != "NOIP" and $macmap{$mac}{"ip"} != $ip) {
@ -817,7 +847,7 @@ sub handle_tftp_msg {
my $file = $2;
my $record = "Via TFTP download $file";
if (exists($node_state_ref->{ $ipnodemap{$ip} })) {
probe_utils->send_msg("stdout", "d", "[$ipnodemap{$ip}] $record") if ($monitor);
probe_utils->send_msg("stdout", "d", "[$ipnodemap{$ip}] $log_ref->{time_record} $record") if ($monitor);
push(@{ $node_state_ref->{ $ipnodemap{$ip} }{log} }, $log_ref->{msg}) if ($debug);
if ($file =~ /xcat\/xnba.*/i or $file =~ /\/boot\/grub2\/powerpc-ieee1275\//i or $file =~ /\/yb\/node\/yaboot\-/i) {
@ -852,21 +882,26 @@ sub handle_http_msg {
if (exists($node_state_ref->{ $ipnodemap{$ip} })) {
if ($log_ref->{msg} =~ /GET\s+(.+)\s+HTTP.+/ or $log_ref->{msg} =~ /HEAD\s+(.+)\s+HTTP.+/) {
if ($log_ref->{msg} =~ /"GET\s+(.+)\s+HTTP.+" (\d+)/ or $log_ref->{msg} =~ /"HEAD\s+(.+)\s+HTTP.+" (\d+)/) {
my $file = $1;
my $http_code = $2;
my $record = "Via HTTP get $file";
probe_utils->send_msg("stdout", "d", "[$ipnodemap{$ip}] $record") if ($monitor);
probe_utils->send_msg("stdout", "d", "[$ipnodemap{$ip}] $log_ref->{time_record} $record") if ($monitor);
push(@{ $node_state_ref->{ $ipnodemap{$ip} }{log} }, $log_ref->{msg}) if ($debug);
if ($file =~ /vmlinuz|inst64/i or ($file =~ /linux/i and $file =~ /osimage/i)) {
set_node_state($node_state_ref, $ipnodemap{$ip}, $::STATE_KERNEL);
push (@{ $node_state_ref->{ $ipnodemap{$ip} }{errors}{$::STATE_KERNEL} }, "$record failed with $http_code") if ($http_code >= 400);
} elsif ($file =~ /initrd/i and $file =~ /osimage/i) {
set_node_state($node_state_ref, $ipnodemap{$ip}, $::STATE_INITRD);
push (@{ $node_state_ref->{ $ipnodemap{$ip} }{errors}{$::STATE_INITRD} }, "$record failed with $http_code") if ($http_code >= 400);
} elsif (($file =~ /^\/install\/autoinst\//i) and ($file !~ /getinstdisk$/i) and ($file !~ /\.pre$/i) and ($file !~ /\.post$/i)) {
set_node_state($node_state_ref, $ipnodemap{$ip}, $::STATE_KICKSTART);
push (@{ $node_state_ref->{ $ipnodemap{$ip} }{errors}{$::STATE_KICKSTART} }, "$record failed with $http_code") if ($http_code >= 400);
} elsif ($file =~ /\.deb$/i or $file =~ /\/Packages\/.+\.rpm$/ or $file =~ /\/suse\/noarch\/.+\.rpm$/i) {
set_node_state($node_state_ref, $ipnodemap{$ip}, $::STATE_INSTALLRPM);
push (@{ $node_state_ref->{ $ipnodemap{$ip} }{errors}{$::STATE_INSTALLRPM} }, "$record failed with $http_code") if ($http_code >= 400);
}
}
}
@ -897,11 +932,11 @@ sub handle_cluster_msg {
my $nodes_str = $split_log[4];
my $sub_command = $split_log[5];
if ($command eq "rinstall" or $command eq "rnetboot" or ($command eq "rpower" and $sub_command =~ /on|boot|reset/)) {
if ($command eq "rinstall" or $command eq "rnetboot" or ($command eq "rpower" and $sub_command =~ /on|boot|reset/) or ($command eq "xdsh" and $log_msg =~ /reboot|shutdown -r/)) {
my @nodes = probe_utils->parse_node_range($nodes_str);
foreach my $node (@nodes) {
if (exists $node_state_ref->{$node}) {
probe_utils->send_msg("stdout", "d", "[$node] Use command $command to reboot node $node") if ($monitor);
probe_utils->send_msg("stdout", "d", "[$node] $log_ref->{time_record} Use command $command to reboot node $node") if ($monitor);
push(@{ $node_state_ref->{$node}{log} }, $log_ref->{msg}) if ($debug);
set_node_state($node_state_ref, $node, $::STATE_POWER_ON);
}
@ -915,7 +950,7 @@ sub handle_cluster_msg {
foreach my $node (@split_node) {
if (exists $node_state_ref->{$node}) {
probe_utils->send_msg("stdout", "d", "[$node] $record") if ($monitor);
probe_utils->send_msg("stdout", "d", "[$node] $log_ref->{time_record} $record") if ($monitor);
push(@{ $node_state_ref->{$node}{log} }, $log_ref->{msg}) if ($debug);
if ($status eq "installing") {
@ -951,16 +986,36 @@ sub handle_compute_msg {
my $node = $log_ref->{sender};
if (exists $node_state_ref->{$node}) {
probe_utils->send_msg("stdout", "d", "[$node] $log_ref->{msg}") if ($monitor);
probe_utils->send_msg("stdout", "d", "[$node] $log_ref->{time_record} $log_ref->{msg}") if ($monitor);
push(@{ $node_state_ref->{$node}{log} }, $log_ref->{msg}) if ($debug);
if ($log_ref->{msg} =~ /Running postscript:/i) {
set_node_state($node_state_ref, $node, $::STATE_POSTSCRIPT);
} elsif ($log_ref->{msg} =~ /postscript (.+) return with (\d+)/) {
my $script_name = $1;
my $return_code = $2;
if ($return_code != 0) {
my $error_str = "postscript $script_name return with $return_code";
# when monitor, will show 2 same messages, so filter to show only one
unless (grep {$_ eq $error_str} @{ $node_state_ref->{$node}{errors}{$::STATE_POSTSCRIPT} }) {
push @{ $node_state_ref->{$node}{errors}{$::STATE_POSTSCRIPT} }, $error_str;
}
}
} elsif ($log_ref->{msg} =~ /Running postbootscript:/i) {
set_node_state($node_state_ref, $node, $::STATE_POSTBOOTSCRIPT);
} elsif ($log_ref->{msg} =~ /postbootscript (.+) return with (\d+)/) {
my $script_name = $1;
my $return_code = $2;
if ($return_code != 0) {
my $error_str = "postbootscript $script_name return with $return_code";
# when monitor, will show 2 same messages, so filter to show only one
unless (grep {$_ eq $error_str} @{ $node_state_ref->{$node}{errors}{$::STATE_POSTBOOTSCRIPT} }) {
push @{ $node_state_ref->{$node}{errors}{$::STATE_POSTBOOTSCRIPT} }, $error_str;
}
}
} elsif ($log_ref->{msg} =~ /provision completed/) {
set_node_state($node_state_ref, $node, $::STATE_COMPLETED);
$node_state_ref->{$node}{done} = 1;
probe_utils->send_msg("stdout", "o", "[$node] provision completed") if ($monitor);
probe_utils->send_msg("stdout", "o", "[$node] $log_ref->{time_record} provision completed") if ($monitor);
}
}
}
@ -1021,6 +1076,7 @@ sub set_node_state {
if ($newstate == $::STATE_POWER_ON) {
push @{ $node_state_ref->{$node}{allstatehistory} }, @{ $node_state_ref->{$node}{statehistory} };
@{ $node_state_ref->{$node}{statehistory} } = ();
%{ $node_state_ref->{$node}{errors} } = ();
push @{ $node_state_ref->{$node}{statehistory} }, $newstate;
} else {
my $index = @{ $node_state_ref->{$node}{statehistory} } - 1;

View File

@ -59,83 +59,75 @@ sub do_main_job {
my $installnicip;
#check if all xcat deamons are running
$checkpoint = "All xCAT deamons are running";
$rst = check_all_xcat_deamons(\@error);
$rst = check_all_xcat_deamons(\$checkpoint, \@error);
print_check_result($checkpoint, "f", $rst, \@error);
return $rst if ($rst);
#check if xcatd can receive request
$checkpoint = "xcatd can receive command request";
$rst = check_xcatd_receive_request(\@error);
$rst = check_xcatd_receive_request(\$checkpoint, \@error);
print_check_result($checkpoint, "f", $rst, \@error);
return $rst if ($rst);
#check 'site' table configuratiions
my %sitetable;
$checkpoint = "'site' table is configured correctly";
$rst = check_site_table(\%sitetable, \@error);
$rst = check_site_table(\%sitetable, \$checkpoint, \@error);
print_check_result($checkpoint, "f", $rst, \@error);
return $rst if ($rst);
#check network configuratiions
$checkpoint = "Provision network is configured correctly";
$rst = check_network(\%sitetable, \$installnicip, \@error);
$rst = check_network(\%sitetable, \$installnicip, \$checkpoint, \@error);
print_check_result($checkpoint, "f", $rst, \@error);
return $rst if ($rst);
#check 'passwd' table configuratiions
$checkpoint = "'passwd' table is configured correctly";
$rst = check_passwd_table(\@error);
$rst = check_passwd_table(\$checkpoint, \@error);
print_check_result($checkpoint, "f", $rst, \@error);
$rc |= $rst;
#check important directory
$checkpoint = "Important directory is configured correctly";
$rst = check_directory(\%sitetable, \@error);
$rst = check_directory(\%sitetable, \$checkpoint, \@error);
print_check_result($checkpoint, "f", $rst, \@error);
$rc |= $rst;
#check if SElinux is disabled
$checkpoint = "SELinux is disabled on current server";
$rst = check_selinux(\@error);
$rst = check_selinux(\$checkpoint, \@error);
print_check_result($checkpoint, "f", $rst, \@error);
$rc |= $rst;
#check http service
$checkpoint = "HTTP service works well";
$rst = check_http_service($installnicip, \@error);
$rst = check_http_service($installnicip, \$checkpoint, \@error);
print_check_result($checkpoint, "f", $rst, \@error);
$rc |= $rst;
#check tftp service
$checkpoint = "TFTP service works well";
$rst = check_tftp_service($installnicip, \@error);
$rst = check_tftp_service($installnicip, \$checkpoint, \@error);
print_check_result($checkpoint, "f", $rst, \@error);
$rc |= $rst;
#check DNS service
$checkpoint = "DNS service works well";
$rst = check_dns_service(\%sitetable, $installnicip, \@error);
$rst = check_dns_service(\%sitetable, $installnicip, \$checkpoint, \@error);
print_check_result($checkpoint, "f", $rst, \@error);
$rc |= $rst;
#check DHCP service
$checkpoint = "DHCP service works well";
$rst = check_dhcp_service($installnicip, \@error);
$rst = check_dhcp_service($installnicip, \$checkpoint, \@error);
print_check_result($checkpoint, "f", $rst, \@error);
$rc |= $rst;
#check NTP service
$rst = check_ntp_service(\$checkpoint, \@error);
print_check_result($checkpoint, "f", $rst, \@error);
$rc |= $rst;
#Below are the 'warning` level check points
#check if firewall is close
$checkpoint = "Firewall is closed on current server";
$rst = check_firewall(\@error);
$rst = check_firewall(\$checkpoint, \@error);
print_check_result($checkpoint, "w", $rst, \@error);
$rc |= $rst;
#check disk space
$checkpoint = "The disk space is enough for xCAT to work";
$rst = check_disk(\@error);
$rst = check_disk(\$checkpoint, \@error);
print_check_result($checkpoint, "w", $rst, \@error);
$rc |= $rst;
@ -144,18 +136,17 @@ sub do_main_job {
if (!$is_sn) {
#check if server ip is a static ip in MN
$checkpoint = "The IP of master is a static IP address";
$rst = check_server_ip_static($installnicip, \@error);
$rst = check_server_ip_static($installnicip,\$checkpoint, \@error);
print_check_result($checkpoint, "w", $rst, \@error);
$rc |= $rst;
#check if dhcpd.leases is less than 100M
$checkpoint = "The dhcpd.leases file is less than 100M";
$rst = check_dhcp_leases(\@error);
$rst = check_dhcp_leases(\$checkpoint, \@error);
print_check_result($checkpoint, "w", $rst, \@error);
$rc |= $rst;
}
cleanup();
return $rc;
}
@ -167,18 +158,18 @@ sub summary_all_jobs_output {
}
#DO SUMMARY DEPENDING ON YOUR SUB_COMMAND NEED
probe_utils->send_msg("$output", "d", "======================do summary=====================");
probe_utils->send_msg("$output", "d", "=================================== SUMMARY ====================================");
#print "summaryoutput:\n";
#print Dumper \%summaryoutput;
my @summary;
push @summary, "[ok]:[MN]: Check on MN PASS.";
push @summary, "[ok]:[MN]: Checking on MN...";
my $ok_section = 0;
foreach my $line (@{ $summaryoutput{mn} }) {
if ($line =~ /(\[failed\]\s*):\s*(.*)/) {
push @summary, "$1: $2";
$summary[0] = "[failed]:[MN]: Check on MN FAILED.";
$summary[0] = "[failed]:[MN]: Checking on MN...";
$ok_section = 0;
} elsif ($line =~ /(\[warning\]\s*):\s*(.*)/) {
push @summary, "$1: $2";
@ -195,13 +186,13 @@ sub summary_all_jobs_output {
foreach my $node (keys %summaryoutput) {
next if ($node eq "mn");
${ $summary_sn{$node}{"rst"} } = 1;
push @{ $summary_sn{$node}{"details"} }, "[ok]:[SN:$node]: Check on SN $node PASS.";
push @{ $summary_sn{$node}{"details"} }, "[ok]:[SN:$node]: Checking on SN $node...";
$ok_section = 0;
foreach my $log (@{ $summaryoutput{$node} }) {
if ($log =~ /(\[failed\]\s*):\s*(.*)/) {
push @{ $summary_sn{$node}{"details"} }, "$1: $2";
${ $summary_sn{$node}{"rst"} } = 0;
$summary_sn{$node}{"details"}[0] = "[failed]:[SN:$node]: Check on SN $node FAILED.";
$summary_sn{$node}{"details"}[0] = "[failed]:[SN:$node]: Checking on SN $node...";
$ok_section = 0;
} elsif ($log =~ /(\[warning\]\s*):\s*(.*)/) {
push @{ $summary_sn{$node}{"details"} }, "$1: $2";
@ -213,7 +204,7 @@ sub summary_all_jobs_output {
} elsif ($log !~ /^(\[\w+\]\s*):\s*(.*)/) {
push @{ $summary_sn{$node}{"details"} }, "[failed]: $log";
${ $summary_sn{$node}{"rst"} } = 0;
$summary_sn{$node}{"details"}[0] = "[failed]:[SN:$node]: Check on SN $node FAILED.";
$summary_sn{$node}{"details"}[0] = "[failed]:[SN:$node]: Checking on SN $node...";
$ok_section = 0;
}
}
@ -267,10 +258,13 @@ sub print_check_result {
}
sub check_all_xcat_deamons {
my $checkpoint_ref = shift;
my $error_ref = shift;
my $rst = 0;
$$checkpoint_ref = "Checking all xCAT deamons are running...";
@$error_ref = ();
my @deamon_list = ("SSL listener",
"DB Access",
"UDP listener",
@ -290,8 +284,11 @@ sub check_all_xcat_deamons {
}
sub check_xcatd_receive_request {
my $checkpoint_ref = shift;
my $error_ref = shift;
my $rst = 0;
$$checkpoint_ref = "Checking xcatd can receive command request...";
@$error_ref = ();
#check important port
@ -325,10 +322,13 @@ sub check_xcatd_receive_request {
sub check_site_table {
my $sitetable_ref = shift;
my $checkpoint_ref = shift;
my $error_ref = shift;
my $rst = 0;
$$checkpoint_ref = "Checking 'site' table is configured...";
@$error_ref = ();
my @attr_list = ("master", "domain", "installdir", "tftpdir");
foreach my $attr (@attr_list) {
my $value;
@ -350,9 +350,12 @@ sub check_site_table {
}
sub check_passwd_table {
my $checkpoint_ref = shift;
my $error_ref = shift;
my $rst = 0;
@$error_ref = ();
$$checkpoint_ref = "Checking 'passwd' table is configured...";
my $passwd = `tabdump passwd |awk -F',' '/system/ { gsub(/"/, "", \$2); gsub(/"/, "", \$3); print \$2,\$3 }'`;
chomp($passwd);
@ -368,10 +371,12 @@ sub check_passwd_table {
sub check_network {
my $sitetable_ref = shift;
my $serverip_ref = shift; #output arguments
my $checkpoint_ref = shift; #output arguments
my $error_ref = shift; #output arguments
my $rst = 0;
@$error_ref = ();
$$checkpoint_ref = "Checking provision network is configured...";
if ($is_sn) {
@ -433,9 +438,11 @@ sub check_network {
sub check_server_ip_static {
my $serverip = shift;
my $checkpoint_ref = shift;
my $error_ref = shift;
my $rst = 0;
$$checkpoint_ref = "Checking xCAT management node IP: <$serverip> is configured to static...";
@$error_ref = ();
if (!probe_utils->is_static_ip("$serverip", "$installnic")) {
@ -448,18 +455,22 @@ sub check_server_ip_static {
sub check_directory {
my $sitetable_ref = shift;
my $checkpoint_ref = shift;
my $error_ref = shift;
my $rst = 0;
@$error_ref = ();
my @dir_list = ("installdir", "tftpdir");
my $dir_list_str = join(",",@dir_list);
$$checkpoint_ref = "Checking important directories($dir_list_str) are configured...";
@$error_ref = ();
foreach my $dir (@dir_list) {
if ($sitetable_ref->{$dir} eq "") {
push @$error_ref, "There isn't '$dir' definition in 'site' table";
$rst = 1;
} else {
if (!-e "$sitetable_ref->{$dir}") {
push @$error_ref, "There isn't '$sitetable_ref->{$dir}' directory on current server";
push @$error_ref, "There isn't '$sitetable_ref->{$dir}' directory on current server, there is something wrong during xCAT installation";
$rst = 1;
} else {
if ($is_sn) {
@ -477,7 +488,7 @@ sub check_directory {
}
if ($mountip ne $sitetable_ref->{master}) {
push @$error_ref, "$dir '$sitetable_ref->{$dir}' isn't mounted from the management node";
push @$error_ref, "$dir '$sitetable_ref->{$dir}' isn't mounted from the management node,please check SN's configuration";
$rst = 1;
}
}
@ -490,35 +501,51 @@ sub check_directory {
sub check_disk {
my $checkpoint_ref = shift;
my $error_ref = shift;
my $rst = 0;
@$error_ref = ();
my %dir_expectedspace_list = ("/var" => 1, "/tmp" => 1, "/install" => 10);
my $installdir = `lsdef -t site -i installdir -c | awk -F'=' '{print \$2}'`;
chomp($installdir);
my %dir_expectedspace_list = ("/var" => 1, "/tmp" => 1, "$installdir" => 10);
my $disk_str="[";
foreach (keys %dir_expectedspace_list){
$disk_str.="'$_' needs $dir_expectedspace_list{$_}GB;";
}
$disk_str=~s/;$/]/g;
$$checkpoint_ref = "Checking minimum disk space for xCAT $disk_str...";
my $msg = "";
my %mountpointinfo;
foreach my $dir (keys %dir_expectedspace_list) {
my $output = `df --block-size=1G $dir|tail -n 1`;
chomp($output);
my @splitoutput = split(" ", $output);
$mountpointinfo{ $splitoutput[5] }{available} = $splitoutput[3];
$mountpointinfo{ $splitoutput[5] }{need} += $dir_expectedspace_list{$dir};
push @{ $mountpointinfo{ $splitoutput[5] }{mount} }, $dir;
if(! -d "$dir"){
$msg.="There isn't '$dir' in current server.";
$rst = 1;
}else{
my $output = `df --block-size=1G $dir|tail -n 1`;
chomp($output);
my @splitoutput = split(" ", $output);
$mountpointinfo{ $splitoutput[5] }{available} = $splitoutput[3];
$mountpointinfo{ $splitoutput[5] }{need} += $dir_expectedspace_list{$dir};
push @{ $mountpointinfo{ $splitoutput[5] }{mount} }, $dir;
}
}
my $msg = "";
foreach $mountpoint (keys %mountpointinfo) {
if ($mountpointinfo{$mountpoint}{need} > $mountpointinfo{$mountpoint}{available}) {
foreach (@{ $mountpointinfo{$mountpoint}{mount} }) {
$msg .= "'$_' needs $dir_expectedspace_list{$_} GiB disk space. ";
unless($rst){
foreach $mountpoint (keys %mountpointinfo) {
if ($mountpointinfo{$mountpoint}{need} > $mountpointinfo{$mountpoint}{available}) {
foreach (@{ $mountpointinfo{$mountpoint}{mount} }) {
$msg .= "'$_',";
}
my $mountmun = $#{$mountpointinfo{$mountpoint}{mount}} +1 ;
if($mountmun >1){
$msg .= "these directories are parts of file system '$mountpoint'. The free space available in directory '$mountpoint' is $mountpointinfo{$mountpoint}{available} GiB, it is not enough.";
}else{
$msg .= "this directory is a part of file system '$mountpoint'. The free space available in directory '$mountpoint' is $mountpointinfo{$mountpoint}{available} GiB, it is not enough.";
}
$rst = 1;
}
my $mountmun = $#{$mountpointinfo{$mountpoint}{mount}} +1 ;
if($mountmun >1){
$msg .= "These directories are parts of file system '$mountpoint'. The free space available in directory '$mountpoint' is $mountpointinfo{$mountpoint}{available} GiB, it is not enough.";
}else{
$msg .= "This directory is a part of file system '$mountpoint'. The free space available in directory '$mountpoint' is $mountpointinfo{$mountpoint}{available} GiB, it is not enough.";
}
$rst = 1;
}
}
if ($rst) {
@ -529,8 +556,11 @@ sub check_disk {
}
sub check_selinux {
my $checkpoint_ref = shift;
my $error_ref = shift;
my $rst = 0;
$$checkpoint_ref = "Checking SELinux is disabled...";
@$error_ref = ();
if (probe_utils->is_selinux_enable()) {
@ -542,8 +572,11 @@ sub check_selinux {
}
sub check_firewall {
my $checkpoint_ref = shift;
my $error_ref = shift;
my $rst = 0;
$$checkpoint_ref = "Checking firewall is disabled...";
@$error_ref = ();
if (probe_utils->is_firewall_open()) {
@ -556,18 +589,37 @@ sub check_firewall {
sub check_http_service {
my $serverip = shift;
my $checkpoint_ref = shift;
my $error_ref = shift;
my $rst = 0;
my $rst = 1;
$$checkpoint_ref = "Checking HTTP service is configured...";
@$error_ref = ();
`which wget > /dev/null 2>&1`;
if ($?) {
push @$error_ref, "HTTP check need 'wget' tool, please install 'wget' tool and try again";
$rst = 1;
} else {
if (!probe_utils->is_http_ready("$serverip")) {
push @$error_ref, "HTTP service isn't ready on $serverip";
$rst = 1;
{
my $installdir = `lsdef -t site -i installdir -c | awk -F'=' '{print \$2}'`;
chomp($installdir);
unless($installdir){
push @$error_ref, "HTTP work path(installdir) isn't configured in 'sit' table";
last;
}
unless(-d "$installdir"){
push @$error_ref, "There isn't '$installdir' directory on current server";
last;
}
my $errormsg;
unless(probe_utils->is_http_ready("$serverip", $installdir, \$errormsg)) {
push @$error_ref, "$errormsg";
last;
}
$rst = 0;
}
}
@ -577,8 +629,11 @@ sub check_http_service {
sub check_tftp_service {
my $serverip = shift;
my $checkpoint_ref = shift;
my $error_ref = shift;
my $rst = 0;
my $rst = 1;
$$checkpoint_ref = "Checking TFTP service is configured...";
@$error_ref = ();
my $nodename = `hostname -s`;
@ -595,12 +650,23 @@ sub check_tftp_service {
`which tftp > /dev/null 2>&1`;
if ($?) {
push @$error_ref, "TFTP check need 'tftp' tool, please install 'tftp' tool and try again";
$rst = 1;
} else {
$msg = "TFTP service is ready on $serverip";
if (!probe_utils->is_tftp_ready("$serverip")) {
push @$error_ref, "TFTP service isn't ready on $serverip";
$rst = 1;
{
my $tftpdir = `lsdef -t site -i tftpdir -c | awk -F'=' '{print \$2}'`;
chomp($tftpdir);
unless($tftpdir){
push @$error_ref, "TFTP work path isn't configured in 'sit' table";
last;
}
unless(-d "$tftpdir"){
push @$error_ref, "There isn't '$tftpdir' directory on current server";
last;
}
unless(probe_utils->is_tftp_ready("$serverip", $tftpdir)) {
push @$error_ref, "TFTP service isn't ready on $serverip";
last;
}
$rst = 0;
}
}
} else {
@ -610,11 +676,37 @@ sub check_tftp_service {
return $rst;
}
sub check_ntp_service{
my $checkpoint_ref = shift;
my $error_ref = shift;
my $rst = 0;
$$checkpoint_ref = "Checking NTP service is configured...";
@$error_ref = ();
`which ntpq > /dev/null 2>&1`;
if($?){
push @$error_ref, "ntp service check need 'ntpq' tool, please install 'ntpq' toll and try again";
$rst = 1;
}else{
my $error;
if(!probe_utils->is_ntp_ready(\$error)){
push @$error_ref, "$error";
$rst = 1;
}
}
return $rst;
}
sub check_dns_service {
my $sitetable_ref = shift;
my $serverip = shift;
my $checkpoint_ref = shift;
my $error_ref = shift;
my $rst = 0;
$$checkpoint_ref = "Checking DNS service is configured...";
@$error_ref = ();
my $nodename = `hostname -s`;
@ -681,9 +773,11 @@ sub check_dns_service {
sub check_dhcp_service {
my $serverip = shift;
my $checkpoint_ref = shift;
my $error_ref = shift;
my $rst = 0;
$$checkpoint_ref = "Checking DHCP service is configured...";
@$error_ref = ();
@ -798,9 +892,11 @@ sub check_dhcp_service {
}
sub check_dhcp_leases {
my $checkpoint_ref = shift;
my $error_ref = shift;
my $rst = 0;
$$checkpoint_ref = "Checking dhcpd.leases file is less than 100M...";
@$error_ref = ();
my $leasefile = "";
@ -923,7 +1019,7 @@ while ($hierarchy_instance->read_reply(\%reply_cache)) {
if ($reply_cache{$servers}->[$_] =~ /^(\w+)\s*:\s*(\[\w+\]\s*):\s*(.*)/) {
if ("$1" eq "$server") {
$logmsg = "$2: $3";
$msg = "$2:<$server>: $3";
$msg = "$2:[$server]: $3";
}
#For cases like below:
@ -931,7 +1027,7 @@ while ($hierarchy_instance->read_reply(\%reply_cache)) {
} elsif ($reply_cache{$servers}->[$_] =~ /^(\w+)\s*:\s*(.*)/) {
if ("$1" eq "$server") {
$logmsg = "$2";
$msg = "<$server>: $2";
$msg = "[$server]: $2";
}
#For cases like below:

View File

@ -1,7 +1,7 @@
Summary: xCAT diagnostic tool
Summary: xCAT diagnostic tool
Name: xCAT-probe
Version: %{?version:%{version}}%{!?version:%(cat Version)}
Release: %{?release:%{release}}%{!?release:snap%(date +"%Y%m%d%H%M")}
Release: %{?release:%{release}}%{!?release:%(cat Release)}
Epoch: 4
License: EPL
Group: Applications/System
@ -17,14 +17,12 @@ BuildArch: noarch
%endif
%ifos linux
#Below tools are required by sub-command 'xcatmn'
#Below tools are required by sub-command 'xcatmn'
Requires: /usr/bin/nslookup
Requires: /usr/bin/tftp
Requires: /usr/bin/wget
%endif
Provides: xCAT-probe = %{version}
%description
xCAT-probe provides a toolkits to probe potential issues with the xCAT cluster.

View File

@ -141,7 +141,10 @@ sub format_cmd_output {
if ($flag) {
my $leftspace = $maxlen - length($finalmsg[$i]);
my $spacenum = (($leftspace >= $flaglen) ? ($leftspace - $flaglen) : ($screenwidth - length($finalmsg[$i]) + $maxlen - $flaglen));
my $spacenum = 0;
if($flag !~ /debug/i) {
$spacenum = (($leftspace >= $flaglen) ? ($leftspace - $flaglen) : ($screenwidth - length($finalmsg[$i]) + $maxlen - $flaglen));
}
my $spacestr = " " x $spacenum;
print "$finalmsg[$i]$spacestr";

View File

@ -1 +1 @@
5
9

View File

@ -2,11 +2,11 @@ Source: xcat-rmc
Section: admin
Priority: extra
Maintainer: Arif Ali <aali@ocf.co.uk>
Build-Depends: debhelper (>= 5)
Standards-Version: 3.7.2
Build-Depends: debhelper (>= 9)
Standards-Version: 3.9.4
Package: xcat-rmc
Architecture: all
Depends: ${perl:Depends}, perl-xcat, xcat-server
Depends: ${perl:Depends}, perl-xcat (>= 2.13-snap000000000000), xcat-server (>= 2.13-snap000000000000)
Description: RMC monitoring plug-in for xCAT
Provides RMC monitoring plug-in module for xCAT, configuration scripts, predefined conditions, responses and sensors

View File

@ -9,9 +9,6 @@
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
export DH_COMPAT=5
build:
pwd
@ -28,7 +25,6 @@ install:
dh_install -X".svn"
dh_link
# Build architecture-independent files here.
binary-indep: build install
# We have nothing to do by default.
@ -39,7 +35,7 @@ binary-arch:
export
dh_testdir
dh_testroot
dh_installchangelogs
dh_installchangelogs
dh_installdocs
# dh_installexamples
dh_install -X".svn"

View File

@ -1,7 +1,7 @@
Summary: RMC monitoring plug-in for xCAT
Name: xCAT-rmc
Version: %{?version:%{version}}%{!?version:%(cat Version)}
Release: %{?release:%{release}}%{!?release:snap%(date +"%Y%m%d%H%M")}
Release: %{?release:%{release}}%{!?release:%(cat Release)}
Epoch: 4
License: EPL
Group: System Environment/Libraries
@ -15,10 +15,8 @@ BuildRoot: /var/tmp/%{name}-%{version}-%{release}-root
BuildArch: noarch
%endif
Requires: perl-xCAT >= %{epoch}:%{version}
Requires: xCAT-server >= %{epoch}:%{version}
Provides: xCAT-rmc = %{version}
Requires: perl-xCAT = 4:%{version}-%{release}
Requires: xCAT-server = 4:%{version}-%{release}
%description
Provides RMC monitoring plug-in module for xCAT, configuration scripts, predefined conditions, responses and sensors.
@ -42,7 +40,6 @@ chmod 755 $RPM_BUILD_ROOT/%{prefix}/sbin/rmcmon/*
cp lib/perl/TEAL/* $RPM_BUILD_ROOT/%{prefix}/lib/perl/TEAL
%clean
rm -rf $RPM_BUILD_ROOT
@ -82,7 +79,7 @@ else
needCopyFiles=1;
fi
fi
if [ $needCopyFiles -eq 1 ]; then
echo "Copying files to /install/postscripts directory..."
mkdir -p /install/postscripts
@ -90,23 +87,23 @@ if [ $needCopyFiles -eq 1 ]; then
mkdir -p /install/postscripts/rmcmon/scripts
cp $RPM_INSTALL_PREFIX0/sbin/rmcmon/configrmcnode /install/postscripts
chmod 755 /install/postscripts/configrmcnode
FILES_TO_COPY=`cat $RPM_INSTALL_PREFIX0/sbin/rmcmon/scripts_to_node|tr '\n' ' '`
FILES_TO_COPY=`cat $RPM_INSTALL_PREFIX0/sbin/rmcmon/scripts_to_node|tr '\n' ' '`
for file in $FILES_TO_COPY
do
#echo "file=$file"
cp $RPM_INSTALL_PREFIX0/sbin/rmcmon/$file /install/postscripts/rmcmon/scripts
done
chmod 755 /install/postscripts/rmcmon/scripts/*
cp -r $RPM_INSTALL_PREFIX0/lib/perl/xCAT_monitoring/rmc/resources/node/* /install/postscripts/rmcmon/resources/node
fi
fi
%ifos linux
if [ -f "/proc/cmdline" ]; then # prevent running it during install into chroot image
if [ -f $RPM_INSTALL_PREFIX0/sbin/xcatd ]; then
/etc/init.d/xcatd restart
/etc/init.d/xcatd restart
fi
fi
%else
@ -117,13 +114,7 @@ fi
echo "Do not restartxcatd in not running system"
else
XCATROOT=$RPM_INSTALL_PREFIX0 $RPM_INSTALL_PREFIX0/sbin/restartxcatd -r
fi
fi
fi
%endif
exit 0

View File

@ -1 +1 @@
5
9

View File

@ -2,11 +2,15 @@ Source: xcat-server
Section: admin
Priority: extra
Maintainer: xCAT <xcat-user@lists.sourceforge.net>
Build-Depends: debhelper (>= 5)
Standards-Version: 3.7.2
Build-Depends: debhelper (>= 9)
Standards-Version: 3.9.4
Homepage: https://xcat.org/
Package: xcat-server
Architecture: all
Depends: ${perl:Depends}, grub2-xcat, perl-xcat (>= 2.5.0-1), xcat-client (>= 2.5.0-1), libsys-syslog-perl, libio-socket-ssl-perl, libxml-simple-perl, make, libdbd-sqlite3-perl, libexpect-perl, libnet-dns-perl, libsoap-lite-perl, libxml-libxml-perl, libsnmp-perl, debootstrap, libdigest-sha-perl,libcrypt-rijndael-perl,libcrypt-cbc-perl,libjson-perl, libnet-https-nb-perl, libhttp-async-perl
Description: Server and configuration utilities of the xCAT management project
xCAT-server provides the core server and configuration management components of xCAT. This package should be installed on your management server
Depends: ${perl:Depends}, grub2-xcat, perl-xcat (>= 2.13-snap000000000000), xcat-client (>= 2.13-snap000000000000), libsys-syslog-perl, libio-socket-ssl-perl, libxml-simple-perl, make, libdbd-sqlite3-perl, libexpect-perl, libnet-dns-perl, libsoap-lite-perl, libxml-libxml-perl, libsnmp-perl, debootstrap, libdigest-sha-perl,libcrypt-rijndael-perl,libcrypt-cbc-perl,libjson-perl, libnet-https-nb-perl, libhttp-async-perl
Description: Server and configuration utilities of xCAT
xCAT-server provides the core server and configuration management components
of xCAT.
.
This package should be installed on the xCAT management node.

View File

@ -19,7 +19,6 @@ share/xcat/devicetype/* opt/xcat/share/xcat/devicetype
share/xcat/ib/netboot/sles/* opt/xcat/share/xcat/ib/netboot/sles
share/xcat/ib/netboot/rh/* opt/xcat/share/xcat/ib/netboot/rh
lib/perl/xCAT/* opt/xcat/lib/perl/xCAT/
lib/xcat/plugins/* opt/xcat/lib/perl/xCAT_plugin/
lib/xcat/schema/* opt/xcat/lib/perl/xCAT_schema/

View File

@ -9,7 +9,6 @@
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
export DH_COMPAT=5
export buildroot=$(PWD)/debian/xcat-server
export prefix=/opt/xcat
export rootdir=$(buildroot)/$(prefix)
@ -41,7 +40,7 @@ binary-arch:
pwd
dh_testdir
dh_testroot
dh_installchangelogs
dh_installchangelogs
dh_installdocs
# dh_installexamples
dh_install -X".svn"

View File

@ -2266,6 +2266,20 @@ sub copycd
}
close($dinfo);
}
elsif ($desc =~ /^[\d\.]+$/)
{
open($dinfo, $mntpath . "/.treeinfo");
while (<$dinfo>) {
chomp($_);
s/\s+$//; #remove trailing spaces
next if /^\s*$/; #-- skip empty lines
if ($_ =~ /family\s*=\s*CentOS/i) {
$distname = "centos" . $desc;
last;
}
}
close($dinfo);
}
else
{
print "INFO - Could not auto-detect operating system.\n";

View File

@ -910,19 +910,16 @@ sub bmcdiscovery_ipmi {
if (($::RUNCMD_RC eq 0) && @fru_output_array) {
my $fru_output = join(" ", @fru_output_array);
if ($fru_cmd_num == 0) {
if (($fru_output =~ /Product Part Number :\s*(\S*).*Product Serial :\s*(\S*)/)) {
$mtm = $1;
$serial = $2;
last;
}
if (($fru_output =~ /Chassis Part Number\s*:\s*(\S*).*Chassis Serial\s*:\s*(\S*)/)) {
$mtm = $1;
$serial = $2;
last;
}
else {
if (($fru_output =~ /Chassis Part Number\s*:\s*(\S*).*Chassis Serial\s*:\s*(\S*)/)) {
$mtm = $1;
$serial = $2;
last;
}
if (($fru_output =~ /Product Part Number :\s*(\S*).*Product Serial :\s*(\S*)/)) {
$mtm = $1;
$serial = $2;
last;
}
}
}

View File

@ -428,7 +428,7 @@ sub makeconservercf {
# Now add into the file all the node entries that we kept
my $node;
if ($node = donodeent(\%cfgenthash, \@filecontent)) {
if ($node = donodeent(\%cfgenthash, \@filecontent, $delmode)) {
# donodeent will return the 1st node in error
#$cb->({node=>[{name=>$node,error=>"Bad configuration, check attributes under the nodehm category",errorcode=>1}]});

View File

@ -1222,7 +1222,7 @@ sub update_namedconf {
push @newnamed, $line;
}
}
} else {
} elsif ($line !~ /generated by xCAT/) {
push @newnamed, $line;
}
}
@ -1370,6 +1370,9 @@ sub update_namedconf {
flock($newnameconf, LOCK_EX);
seek($newnameconf, 0, 0);
truncate($newnameconf, 0);
if ($newnameconf !~ /generated by xCAT/) {
print $newnameconf "\#generated by xCAT: /opt/xcat/sbin/makedns command \n";
}
for my $l (@newnamed) { print $newnameconf $l; }
flock($newnameconf, LOCK_UN);
close($newnameconf);

View File

@ -393,7 +393,8 @@ sub setdestiny {
if ($errored) {
my @myself = xCAT::NetworkUtils->determinehostname();
my $myname = $myself[ (scalar @myself) - 1 ];
$callback->({ errorcode => [1], error => "Some nodes failed to set up $state resources on server $myname, aborting" });
# The callback function point to xcatd::build_response, it use dclone to clone data, but it can only accept a reference. The error msg here is a simple string, and will cause dclone failed. Seems to be string array can be used by dclone.
$callback->({ errorcode => [1], error => ["Some nodes failed to set up $state resources on server $myname, aborting"] });
return;
}

View File

@ -185,8 +185,8 @@ sub setstate {
my $cref = $chainhash{$node}->[0]; #$chaintab->getNodeAttribs($node,['currstate']);
# remove the old boot configuration file and create a new one, but only if not offline directive
unlink($tftpdir . "/boot/grub2/" . $node);
# remove the old boot configuration files and create a new one, but only if not offline directive
system("find . -inum \$(stat --printf \%i $tftpdir/boot/grub2/$node 2>/dev/null) -exec rm -f {} \\; 2>/dev/null");
if ($cref and $cref->{currstate} ne "offline") {
open($pcfg, '>', $tftpdir . "/boot/grub2/" . $node);
print $pcfg "#" . $cref->{currstate} . "\n";
@ -334,7 +334,6 @@ sub setstate {
}
if (! $nodemac and $macstring) {
$nodemac = xCAT::Utils->parseMacTabEntry($macstring, $node);
}

View File

@ -351,7 +351,7 @@ sub rinstall {
}
if ($line =~ /dhcp server is not running/) {
my $rsp = {};
$rsp->{error}->[0] = "Fatal error";
$rsp->{error}->[0] = "Fatal error: dhcp server is not running";
$rsp->{errorcode}->[0] = 1;
xCAT::MsgUtils->message("E", $rsp, $callback);
return 1;

View File

@ -2252,6 +2252,9 @@ s/Running of postscripts has completed/Redeliver security files has completed/;
}
}
}
if($response->{errorcode}) {
$rsp->{errorcode} = $response->{errorcode};
}
$CALLBACK->($rsp);
}

View File

@ -1514,9 +1514,6 @@ until ($quit) {
$$progname = "xcatd SSL: Instance for " . ($peername ? $peername . "@" . $peerhost : $peerhost) if $peerhost;
service_connection($connection, $peername, $peerhost, $peerfqdn, $peerhostorg);
$debugmsg = "xcatd: close connection with " . ($peername ? $peername . "@" . $peerhost : $peerhost) . "\n";
xCAT::MsgUtils->trace(0, "D", "$debugmsg");
xexit(0);
}
if ($sslfudgefactor) { $sslfudgefactor -= 1; }
@ -2636,7 +2633,6 @@ sub service_connection {
my $peerfqdn = shift;
my $peerhostorg = shift;
my $peerport = $sock->peerport;
my %tables = ();
# some paranoid measures could reduce a third party abusing stage3 image to attempting to get USER/PASS for BMCs:
# -Well, minimally, ignore requests if requesting node is not in spconfig mode (stage3)
@ -2873,12 +2869,10 @@ sub service_connection {
cmdlog_submitlog();
# ----used for command log end---------
my $debugmsg = "xcatd: close connection with " . ($peername ? $peername . "@" . $peerhost : $peerhost) . "\n";
xCAT::MsgUtils->trace(0, "D", "$debugmsg");
$SIG{ALRM} = sub { xCAT::MsgUtils->message("S", "$$ failed shutting down"); die; };
alarm(10);
foreach (keys %tables) {
$tables{$_}->commit;
}
$sock->close(SSL_fast_shutdown => 1);
if ($timedout == 1) {
printf("Client timeout");

View File

@ -460,15 +460,11 @@ ProcessType () {
CHAREND=`echo ${STRPATH} | /usr/bin/cut -c${STRLEN}`
if [ "${CHAREND}" = "/" ]; then # it is one directory
if [ ! -d ${STRPATH} ]; then
/bin/rm -rf ${STRPATH}
/bin/mkdir ${STRPATH}
fi
else
if [ ! -f ${STRPATH} ]; then
/bin/rm -rf ${STRPATH}
/bin/touch ${STRPATH}
fi
fi
echo "mout --bind -o ro ${1} ${MNTDIR}${2}" >>$LOG 2>&1

View File

@ -1748,39 +1748,12 @@ END
#if "nonodestatus" specified,do not update the nodestatus
system("mkdir -p /tmp/xcatinitrd.$$/tmp/");
open($inifile, ">", "/tmp/xcatinitrd.$$/tmp/updateflag");
cp("$installroot/postscripts/updateflag.awk","/tmp/xcatinitrd.$$/tmp/updateflag");
$perm = (stat("$installroot/postscripts/updateflag.awk"))[2];
chmod($perm & 07777, "/tmp/xcatinitrd.$$/tmp/updateflag");
print $inifile <<EOMS;
#!/usr/bin/awk -f
BEGIN {
xcatdhost = ARGV[1]
xcatiport = ARGV[2]
ns = "/inet/tcp/0/" xcatdhost "/" xcatiport
print "xCAT_xcatd" |& ns
while(1) {
ns |& getline
if(\$0 == "ready")
print ARGV[3] |& ns
if(\$0 == "done")
break
}
close(ns)
exit 0
}
EOMS
close($inifile);
chmod(0755, "/tmp/xcatinitrd.$$/init");
chmod(0755, "/tmp/xcatinitrd.$$/bin/netstart");
chmod(0755, "/tmp/xcatinitrd.$$/tmp/updateflag");
@filestoadd = ();
foreach (@ndrivers) {

View File

@ -302,6 +302,7 @@ unless ($onlyinitrd) {
# apt-get update and apt-get install should be added env param
my $aptgetcmd = "DEBIAN_FRONTEND=noninteractive chroot $rootimg_dir apt-get update";
my $aptgetcmdby = "DEBIAN_FRONTEND=noninteractive chroot $rootimg_dir apt-get $non_interactive ";
my $aptdistupgrade = "DEBIAN_FRONTEND=noninteractive chroot $rootimg_dir apt-get $non_interactive dist-upgrade";
my $aptcachecmd = "DEBIAN_FRONTEND=noninteractive chroot $rootimg_dir apt-get update && chroot $rootimg_dir apt-cache $non_interactive ";
my $aptcmd1 = "debootstrap";
my $aptcmd2;
@ -587,6 +588,9 @@ unless ($onlyinitrd) {
my $aptgetcmd_update = $aptgetcmd . "&&" . $aptgetcmdby . " upgrade ";
$rc = system("$aptgetcmd_update");
#run dist-upgrade for not upgraded packages
$rc = system("$aptdistupgrade");
# ignore any return code
}

View File

@ -158,7 +158,7 @@ sub config_ip {
# don't need to set if ip addresses are same
if ($dip eq $static_ip) {
print "static ip $static_ip and discovery ip $dip is same, will not process command for $switch\n";
$cmd = "chdef $csw otherinterfaces=";
$cmd = "chdef $switch otherinterfaces=";
$rc= xCAT::Utils->runcmd($cmd, 0);
next;
}
@ -545,15 +545,16 @@ sub config_desc {
sub usage
{
print "Usage:
configBNT [-?│-h│--help]
configBNT [--switches switchnames] [--all]
configBNT [--switches switchnames] [--ip]
configBNT [--switches switchnames] [--name ]
configBNT [--switches switchnames] [--snmp] [--user snmp_user] [--password snmp_password] [--group snmp_group]
configBNT [--switches switchnames] [--port port] [--vlan vlan]
configBNT -h│--help
configBNT --switches switchnames --ip
configBNT --switches switchnames --name
configBNT --switches switchnames --snmp [--user snmp_user] [--password snmp_password] [--group snmp_group]
configBNT --switches switchnames --port port --vlan vlan
To set the ip address, hostname and config snmp:
configBNT --switches switchnames --all
To set the description for a port on the switch:
configBNT --switches switchnames --port port --desc \"description\"
\n";
}

View File

@ -329,12 +329,16 @@ sub run_rspconfig {
sub usage
{
print "Usage:
configMellanox [-?│-h│--help]
configMellanox [--switches switchnames] [--all]
configMellanox [--switches switchnames] [--ip]
configMellanox [--switches switchnames] [--name]
configMellanox [--switches switchnames] [--snmp] [--user snmp_user] [--password snmp_password] [--auth snmp_auth]
configMellanox [--switches switchnames] [--config]
configMellanox -h│--help
configMellanox --switches switchnames --ip
configMellanox --switches switchnames --name
configMellanox --switches switchnames --snmp [--user snmp_user] [--password snmp_password] [--auth snmp_auth]
To set the ip address, hostname, config snmp and run rspconfig command:
configMellanox --switches switchnames --all
To run rspconfig command:
configMellanox --switches switchnames --config
\n";
}

View File

@ -73,7 +73,7 @@ if ($::SWITCH) {
my $switchestab = xCAT::Table->new('switches');
my $switches_hash = $switchestab->getNodesAttribs(\@filternodes,['switchtype']);
foreach my $fsw (@filternodes) {
if (($switches_hash->{$fsw}->[0]->{switchtype}) =~ /cumulus/) {
if (($switches_hash->{$fsw}->[0]->{switchtype}) =~ /onie/) {
push @nodes, $fsw;
} else {
xCAT::MsgUtils->message("E","The $fsw is not cumulus switch, will not config");
@ -227,6 +227,7 @@ sub install_license {
print "file = $license_file\n";
if (!(-e $license_file) ) {
print "$license_file is not exist\n";
return;
}
foreach my $switch (@nodes) {
@ -371,21 +372,6 @@ sub config_ntp {
}
sub config_vlan {
if ($::PORT) {
$port = $::PORT;
} else {
&usage;
exit(1);
}
$vlan = $::VLAN;
print "Tagging VLAN=$vlan for $switches port $port\n";
#create vlan, tagged vlan
#$cmd = `xdsh $switches --devicetype EthSwitch::BNT "enable;configure terminal;vlan $vlan;exit;interface port $port;switchport mode trunk;switchport trunk allowed vlan $vlan;write memory;exit;exit"`;
}
#---------------------------------------------------------
=head3 usage
@ -398,13 +384,14 @@ sub config_vlan {
sub usage
{
print "Usage:
configBNT [-?│-h│--help]
configBNT [--switches switchnames] [--all]
configBNT [--switches switchnames] [--ssh]
configBNT [--switches switchnames] [--license filename ]
configBNT [--switches switchnames] [--snmp] [--user snmp_user] [--password snmp_password] [--group snmp_group]
configBNT [--switches switchnames] [--ntp]
configBNT [--switches switchnames] [--port port] [--vlan vlan]
configcumulus -h│--help
configcumulus --switches switchnames --ssh
configcumulus --switches switchnames --license filename
configcumulus --switches switchnames --snmp [--user snmp_user] [--password snmp_password] [--group snmp_group]
configcumulus --switches switchnames --ntp
To set ssh, install license(license file: /root/license.txt), config snmp and ntp:
configcumulus --switches switchnames --all
\n";
}

View File

@ -1,7 +1,7 @@
Summary: Server and configuration utilities of the xCAT management project
Name: xCAT-server
Version: %{?version:%{version}}%{!?version:%(cat Version)}
Release: %{?release:%{release}}%{!?release:snap%(date +"%Y%m%d%H%M")}
Release: %{?release:%{release}}%{!?release:%(cat Release)}
Epoch: 4
License: EPL
Group: Applications/System
@ -47,11 +47,8 @@ Requires: perl-IO-Tty perl-Crypt-SSLeay make
%endif
%endif
Requires: perl-xCAT >= %{epoch}:%{version}
Requires: xCAT-client >= %{epoch}:%{version}
Provides: xCAT-server = %{epoch}:%{version}
Requires: perl-xCAT = 4:%{version}-%{release}
Requires: xCAT-client = 4:%{version}-%{release}
%description
xCAT-server provides the core server and configuration management components of xCAT. This package should be installed on your management server
@ -349,8 +346,8 @@ echo "ScriptAlias /xcatws %{prefix}/ws/xcatws.cgi" >> $RPM_BUILD_ROOT/etc/xcat/c
cat $RPM_BUILD_ROOT/%{prefix}/ws/xcat-ws.conf.apache22 >> $RPM_BUILD_ROOT/etc/xcat/conf.orig/xcat-ws.conf.apache22
cat $RPM_BUILD_ROOT/%{prefix}/ws/xcat-ws.conf.apache24 >> $RPM_BUILD_ROOT/etc/xcat/conf.orig/xcat-ws.conf.apache24
#install lower version(<2.4) apache/httpd conf files by default
cp $RPM_BUILD_ROOT/etc/xcat/conf.orig/xcat-ws.conf.apache22 $RPM_BUILD_ROOT/etc/apache2/conf.d/xcat-ws.conf
cp $RPM_BUILD_ROOT/etc/xcat/conf.orig/xcat-ws.conf.apache22 $RPM_BUILD_ROOT/etc/httpd/conf.d/xcat-ws.conf
cp $RPM_BUILD_ROOT/etc/xcat/conf.orig/xcat-ws.conf.apache22 $RPM_BUILD_ROOT/etc/apache2/conf.d/xcat-ws.conf
cp $RPM_BUILD_ROOT/etc/xcat/conf.orig/xcat-ws.conf.apache22 $RPM_BUILD_ROOT/etc/httpd/conf.d/xcat-ws.conf
%endif
@ -401,7 +398,7 @@ fi
%endif
# The Juniper directory is switched to Jun and a sylink is created
if [ -d $RPM_INSTALL_PREFIX0/share/xcat/devicetype/EthSwitch/Juniper ]; then
if [ -d $RPM_INSTALL_PREFIX0/share/xcat/devicetype/EthSwitch/Juniper ]; then
# need to remove the old directory otherwise the symlink won't get creatd correctly
rm -rf $RPM_INSTALL_PREFIX0/share/xcat/devicetype/EthSwitch/Juniper
fi
@ -428,17 +425,16 @@ fi
%else
if [ "$1" -gt "1" ]; then #only on upgrade for AIX...
#migration issue for monitoring
XCATROOT=$RPM_INSTALL_PREFIX0 $RPM_INSTALL_PREFIX0/sbin/chtab filename=monitorctrl.pm notification -d
XCATROOT=$RPM_INSTALL_PREFIX0 $RPM_INSTALL_PREFIX0/sbin/chtab filename=monitorctrl.pm notification -d
fi
fi
%endif
#Apply the correct httpd/apache configuration file according to the httpd/apache version
if [ -n "$(httpd -v 2>&1 |grep -e '^Server version\s*:.*\/2.4')" ]
then
rm -rf /etc/httpd/conf.d/xcat-ws.conf
cp /etc/xcat/conf.orig/xcat-ws.conf.apache24 /etc/httpd/conf.d/xcat-ws.conf
cp /etc/xcat/conf.orig/xcat-ws.conf.apache24 /etc/httpd/conf.d/xcat-ws.conf
fi
if [ -n "$(apachectl -v 2>&1 |grep -e '^Server version\s*:.*\/2.4')" ]
@ -453,7 +449,6 @@ then
cp /etc/xcat/conf.orig/xcat-ws.conf.apache24 /etc/apache2/conf.d/xcat-ws.conf
fi
exit 0
%preun

View File

@ -1,3 +1,4 @@
setup_vm
reg_linux_diskfull_installation_flat
makehosts_h
makehosts_help

View File

@ -1,3 +1,4 @@
setup_vm
reg_linux_diskfull_installation_flat
go_xcat_local_repo_case7
go_xcat_noinput

View File

@ -1,3 +1,4 @@
setup_vm
Diskless_installation_flat_p8_le
Full_installation_flat_p8_le
go_xcat_local_repo_case7

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