diff --git a/.gitignore b/.gitignore index e5d06cdf0..893951706 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ # ignore the documentation build files docs/build +# Ignore the temporary file for creating the Release version +Release.save* diff --git a/README.rst b/README.rst index 15abed55c..d7f1ae9f6 100644 --- a/README.rst +++ b/README.rst @@ -8,7 +8,7 @@ Documentation xCAT documentation is available at: http://xcat-docs.readthedocs.io/en/latest/ -|docs_latest| |docs_2124| |docs_2123| |docs_2122| |docs_212| |docs_211| +|docs_latest| |docs_2132| |docs_2131| |docs_2130| |docs_212| |docs_211| Open Source License ------------------- @@ -22,26 +22,26 @@ Developers Developers and prospective contributors are encouraged to read the `Developers Guide `_ In particular the `GitHub `_ related subsection. -.. |docs_2124| image:: https://readthedocs.org/projects/xcat-docs/badge/?version=2.12.4 - :alt: 2.12.4 documentation status +.. |docs_2132| image:: https://readthedocs.org/projects/xcat-docs/badge/?version=2.13.2 + :alt: 2.13.2 documentation status :scale: 100% - :target: http://xcat-docs.readthedocs.io/en/2.12.4/ + :target: http://xcat-docs.readthedocs.io/en/2.13.2/ -.. |docs_2123| image:: https://readthedocs.org/projects/xcat-docs/badge/?version=2.12.3 - :alt: 2.12.3 documentation status +.. |docs_2131| image:: https://readthedocs.org/projects/xcat-docs/badge/?version=2.13.1 + :alt: 2.13.1 documentation status :scale: 100% - :target: http://xcat-docs.readthedocs.io/en/2.12.3/ - -.. |docs_2122| image:: https://readthedocs.org/projects/xcat-docs/badge/?version=2.12.2 - :alt: 2.12.2 documentation status + :target: http://xcat-docs.readthedocs.io/en/2.13.1/ + +.. |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.2/ + :target: http://xcat-docs.readthedocs.io/en/2.13.0/ -.. |docs_212| image:: https://readthedocs.org/projects/xcat-docs/badge/?version=2.12.0 - :alt: 2.12.0 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.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% diff --git a/Release b/Release new file mode 100644 index 000000000..a33a0ed75 --- /dev/null +++ b/Release @@ -0,0 +1 @@ +snap000000000000 diff --git a/Version b/Version index fb2c0766b..a1a4224dd 100644 --- a/Version +++ b/Version @@ -1 +1 @@ -2.13.0 +2.13.3 diff --git a/build-ubunturepo b/build-ubunturepo index b4220b4a6..49e46cf63 100755 --- a/build-ubunturepo +++ b/build-ubunturepo @@ -4,32 +4,31 @@ # 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 /src/xcat-core, where -# is the same name as the release dir it is uploaded to xcat.org (e.g devel, 2.9, 2.10) +# - Clone the xcat-core git repository under a directory named "xcat-core/src" # - make sure reprepro is installed on the build machine -# - Run this script from the local git repository you just created. It will create the other directories that are needed. +# - Run this script from the local git repository you just created. +# ./build-ubunturepo -c BUILDALL=1 # Usage: attr=value attr=value ... ./build-ubunturepo { -c | -d } # 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= - 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 +38,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 +83,7 @@ do r) r_flag=1 genesis_rpm_path="$OPTARG" ;; - ?) printusage + ?) printusage exit 2 ;; esac @@ -96,13 +95,6 @@ if [ -z "$c_flag" -a -z "$d_flag" ];then exit 2 fi -USER="xcat" -SERVER="xcat.org" -FILES_PATH="files" -FRS="/var/www/${SERVER}/${FILES_PATH}" -APT_DIR="${FRS}/xcat" -APT_REPO_DIR="${APT_DIR}/repos/apt" - if [ "$c_flag" -a "$d_flag" ];then printusage exit 2 @@ -118,7 +110,7 @@ curdir=`pwd` local_core_repo_path="$curdir/../../xcat-core" local_dep_repo_path="$curdir/../../xcat-dep/xcat-dep" -#use flock to only one person build at the same time +# Use flock to only one person build at the same time # Get a lock, so can not do 2 builds at once exec 8>/var/lock/xcatbld.lock if ! flock -n 8; then @@ -129,7 +121,7 @@ fi export HOME=/root WGET_CMD="wget" -if [ ! -z ${LOG} ]; then +if [ ! -z ${LOG} ]; then WGET_CMD="wget -o ${LOG}" fi @@ -146,51 +138,46 @@ done if [ "$c_flag" ] then - # strip the /src/xcat-core from the end of the dir to get the next dir up and use as the release + # + # The format of the directory for Ubuntu builds needs to be "xcat-core/src/xcat-core" so + # that the output build files are created under "xcat-core". + # TODO: This should be fixed in the future.... + # if [ -z "$REL" ]; then t=${curdir%/src/xcat-core} REL=`basename $t` fi + if [ "$REL" != "xcat-core" ]; then + echo "ERROR: REL='$REL'needs to be 'xcat-core'. Ensure the path is 'xcat-core/src/xcat-core'" + exit 1 + fi - ver=`cat Version` if [ "$PROMOTE" != 1 ]; then code_change=0 update_log='' - #get the version - if [ "$REL" = "xcat-core" ];then - git_flag=1 - REL=`git rev-parse --abbrev-ref HEAD` - if [ "$REL" = "master" ]; then - REL="devel" - fi - if [ -z "$GITUP" ];then - update_log=../coregitup - echo "git pull > $update_log" - git pull > $update_log - else - update_log=$GITUP - fi - - if ! grep -q 'Already up-to-date' $update_log; then - code_change=1 - fi + # get the version + git_flag=1 + REL=`git rev-parse --abbrev-ref HEAD` + if [ "$REL" = "master" ]; then + REL="devel" + fi + if [ -z "$GITUP" ];then + update_log=../coregitup + echo "git pull > $update_log" + git pull > $update_log else - git_flag=0 - if [ -z "$SVNUP" ]; then - update_log=../coresvnup - echo "svn up > $update_log" - svn up > $update_log - else - update_log=$SVNUP - fi + update_log=$GITUP + fi - if ! grep -q 'At revision' $update_log;then - code_change=1 - fi + if ! grep -q 'Already up-to-date' $update_log; then + code_change=1 fi ver=`cat Version` short_ver=`cat Version|cut -d. -f 1,2` short_short_ver=`cat Version|cut -d. -f 1` + build_time=`date` + build_machine=`hostname` + commit_id=`git rev-parse --short HEAD` package_dir_name=debs$REL #TODO: define the core path and tarball name @@ -206,18 +193,17 @@ then echo "###############################" #the package type: local | snap | alpha - #the build introduce stirng - pkg_type="snap" + #the build introduce string build_string="Snap_Build" - cur_date=`date +%Y%m%d%H%M` - pkg_version="${ver}-${pkg_type}${cur_date}" - + xcat_release="snap$(date '+%Y%m%d%H%M')" + pkg_version="${ver}-${xcat_release}" + 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 +211,12 @@ 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 +224,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 +321,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 +361,22 @@ __EOF__ chmod 775 mklocalrepo.sh - #create the xcat-core.list file + # + # Add a buildinfo file under xcat-core to track information about the build + # + buildinfo=$local_core_repo_path/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 + + #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 +402,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 +414,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 +441,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__ @@ -481,8 +495,16 @@ __EOF__ chgrp root $dep_tar_name chmod g+w $dep_tar_name - # Decide whether to upload or not (default NOT to upload) - if [ "$UP" != "1" ]; then + + USER="xcat" + SERVER="xcat.org" + FILES_PATH="files" + FRS="/var/www/${SERVER}/${FILES_PATH}" + APT_DIR="${FRS}/xcat" + APT_REPO_DIR="${APT_DIR}/repos/apt" + + # Decide whether to upload the xcat-dep package or NOT (default is to NOT upload xcat-dep + if [ "$UP" != "1" ]; then echo "Upload not specified, Done! (rerun with UP=1, to upload)" cd $old_pwd exit 0 @@ -507,7 +529,7 @@ __EOF__ while [ $((i+=1)) -le 5 ] && ! rsync -v --force README $USER@${SERVER}:${APT_DIR}/xcat-dep/2.x_Ubuntu/ do : ; done - cd $old_pwd - exit 0 fi + +cd $old_pwd exit 0 diff --git a/buildcore.sh b/buildcore.sh index e85ff7e67..4a90cd6e0 100755 --- a/buildcore.sh +++ b/buildcore.sh @@ -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= - control which rpms get built by specifying a coregitup file # EMBED= - 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 @@ -35,14 +35,17 @@ # The following environment variables can be modified if you need # +SCRIPT=$(readlink -f $0) +SCRIPTPATH=`dirname $SCRIPT` + 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 +74,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 +106,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 +189,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="${SCRIPTPATH}/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 @@ -214,33 +243,27 @@ else echo "Error: Could not determine rpmbuild's root directory." exit 2 fi - #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 - # are building the xcat code in a new directory each time + # Do some checking for modified files MODIFIED_FILES=`git ls-files --modified | tr '\n' ', '` if [ $MODIFIED_FILES ]; then - echo "The following files have been modified in the local repository: $MODIFIED_FILES..." - echo "Not a clean build, aborting..." - exit 3 + echo "WARNING: The following files have been modified in the local repository: $MODIFIED_FILES..." fi - # check if there's any modifications to git current repo + # Do some checking for untracked files UNTRACKED_FILES=`git ls-files --others | tr '\n' ', '` if [ -n "$UNTRACKED_FILES" ]; then - echo "The following files are not tracked in git: $UNTRACKED_FILES..." - echo "Not a clean build, aborting..." - exit 3 + echo "WARNING: The following files are not tracked in git: $UNTRACKED_FILES..." fi if [ -z "$GITUP" ]; then if [ ! -z "$COMMITID" ]; then @@ -339,7 +362,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 +425,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 +479,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 +514,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 / subdirectory" exit 1 fi @@ -498,10 +522,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 +545,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 +570,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 +586,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 diff --git a/docs/source/advanced/cluster_maintenance/mgmt_node/changing_hostname_ip.rst b/docs/source/advanced/cluster_maintenance/mgmt_node/changing_hostname_ip.rst index fda96e1ad..72282f3fb 100644 --- a/docs/source/advanced/cluster_maintenance/mgmt_node/changing_hostname_ip.rst +++ b/docs/source/advanced/cluster_maintenance/mgmt_node/changing_hostname_ip.rst @@ -52,7 +52,7 @@ Change the Management Hostname hostname -* Edit hostname configuration file +* Update the hostname configuration files: | Add hostname in ``/etc/hostname`` | Add HOSTNAME attribute in ``/etc/sysconfig/network`` (only for [RHEL]) @@ -60,29 +60,29 @@ Change the Management Hostname Update Database Files --------------------- -You need to update the new MN hostname or IP address in several database -configuration files. +You need to update the new MN hostname or IP address in several database configuration files. SQLite ^^^^^^ Nothing to do. -Postgresql +PostgreSQL ^^^^^^^^^^ -- Edit ``/etc/xcat/cfgloc`` file, replace ``Pg:dbname=xcatdb;host=|xcatadm|xcat20`` - with ``Pg:dbname=xcatdb;host=|xcatadm|xcat20``. +- Edit ``/etc/xcat/cfgloc`` file... -- Edit config database config file ``/var/lib/pgsql/data/pg_hba.conf``, - replace ``host all all /32 md5`` - with ``host all all /32 md5``. + Replace ``Pg:dbname=xcatdb;host=|xcatadm|xcat20`` with ``Pg:dbname=xcatdb;host=|xcatadm|xcat20``. -Mysql +- Edit config database config file ``/var/lib/pgsql/data/pg_hba.conf``... + + Replace ``host all all /32 md5`` with ``host all all /32 md5`` + +MySQL ^^^^^ -Edit ``/etc/xcat/cfglooc``, replace ``mysql:dbname=xcatdb;host=|xcatadmin|xcat20`` -with ``mysql:dbname=xcatdb;host=|xcatadmin|xcat20``. +- Edit ``/etc/xcat/cfglooc``... + Replace ``mysql:dbname=xcatdb;host=|xcatadmin|xcat20`` with ``mysql:dbname=xcatdb;host=|xcatadmin|xcat20`` Start the database ------------------ @@ -116,12 +116,12 @@ Change the site table master attribute Change all IP address attribute relevant to the MN IP address ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -For example, old address was "10.6.0.1" +For example, the old IP address was "10.6.0.1" -* Query the attributes with old address :: +* Query all the attributes with old address :: lsdef -t node -l | grep "10.6.0.1" - # the output may looks like + ... conserver=10.6.0.1 conserver=10.6.0.1 conserver=10.6.0.1 @@ -138,26 +138,23 @@ For example, old address was "10.6.0.1" servicenode=10.6.0.1 xcatmaster=10.6.0.1 -* As the attribute with the old IP address is list above, take conserver as - a example, query the nodes with ``conserver=10.6.0.1``. - - :: +* Looking at the list above, taking ``conserver`` as an example, query the nodes with ``conserver=10.6.0.1``: :: lsdef -t node -w conserver="10.6.0.1" - # the output looks like + ... cn1 (node) cn2 (node) cn3 (node) cn4 (node) -* Change the conserver address for cn1,cn2,cn3,cn4 :: +* Change the conserver address for nodes ``cn1,cn2,cn3,cn4`` :: chdef -t node cn1-cn4 conserver= -Repeat the same process for the other attributes. +* Repeat the same process for the other attributes containing the old IP address. Change networks table -^^^^^^^^^^^^^^^^^^^^^^ +^^^^^^^^^^^^^^^^^^^^^ Check your networks table to see if the network definitions are still correct, if not edit accordingly :: @@ -166,7 +163,7 @@ if not edit accordingly :: chdef -t network Check Result -^^^^^^^^^^^^^ +^^^^^^^^^^^^ You can check whether all the old address has been changed using :: @@ -174,25 +171,24 @@ You can check whether all the old address has been changed using :: cd fgrep "10.6.0.1" *.csv -If the old address still exists in the ``*.csv` file, you can edit this file, -then use the following command to restore the records :: +If the old address still exists in the ``*.csv`` file, you can edit this file, then use the following command to restore the records :: tabrestore Generate SSL credentials(optional) ---------------------------------- -If you do not generate new credentials, skip this section. -If you decide generate new credentials, then you will use the following -command. +Use the following command to generate new SSL credentials: ``xcatconfig -c``. -* Generate new credentials :: +Then update the following in xCAT: - xcatconfig -c +* Update the policy table with new management node name and replace: :: -* Update the policy table with new MN name, - replace ``"1.4","old_MN_name",,,,,,"trusted",,`` with - ``"1.4","new_MN_name",,,,,,"trusted",,`` + "1.4","old_MN_name",,,,,,"trusted",, + + with: :: + + "1.4","new_MN_name",,,,,,"trusted",,`` * Setup up conserver with new credentials :: diff --git a/docs/source/advanced/cluster_maintenance/service_node/changing_hostname_ip.rst b/docs/source/advanced/cluster_maintenance/service_node/changing_hostname_ip.rst index e99134962..f971eb7ba 100644 --- a/docs/source/advanced/cluster_maintenance/service_node/changing_hostname_ip.rst +++ b/docs/source/advanced/cluster_maintenance/service_node/changing_hostname_ip.rst @@ -36,11 +36,7 @@ Database Connection Changes Granting or revoking access privilege in the database for the service node. -* For mysql, refer to :ref:`grante_revoke_mysql_access_label`. -.. There is no procedure in old document on sourceforge for postgress to - grant or revoke the access privilege for service node. - -* For postgress, refer to `TODO `_. +* For MySQL, refer to :ref:`grante_revoke_mysql_access_label`. Update Provision Environment on Service Node -------------------------------------------- diff --git a/docs/source/advanced/domain_name_resolution/domain_name_resolution.rst b/docs/source/advanced/domain_name_resolution/domain_name_resolution.rst index d8745b6ee..984bf79fe 100644 --- a/docs/source/advanced/domain_name_resolution/domain_name_resolution.rst +++ b/docs/source/advanced/domain_name_resolution/domain_name_resolution.rst @@ -459,19 +459,6 @@ You can either specify the base nic* attribute name or the expanded name for a s nicips.eth1=11.1.89.7 nichostnamesuffixes.eth1=-lab -"otherinterfaces" vs. nic* attributes -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -For now the "otherinterfaces" attribute will still be supported but it may be dropped in future releases.Any new network interface information should be provided using the new nic attributes. - -If you are currently using the "otherinterfaces" node attribute you do not have to move it to the nic* attributes at this time. However, be careful to avoid any overlap or conflict with the information provided for each. - -If you are using "otherinterfaces" and add additional interfaces using the nic* attributes the makehosts command will add both to the /etc/hosts table. - -When both the "otherinterfaces" and nic attributes are used the "otherinterfaces" attribute is processed before the nic attributes. - -To do more nic introduce (refer to :ref:`confignics_label` ). - Setting addition interface information using the xCAT tabedit command ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/docs/source/advanced/hamn/setup_ha_mgmt_node_with_shared_data.rst b/docs/source/advanced/hamn/setup_ha_mgmt_node_with_shared_data.rst index 5a80aade9..6a3e1b98a 100644 --- a/docs/source/advanced/hamn/setup_ha_mgmt_node_with_shared_data.rst +++ b/docs/source/advanced/hamn/setup_ha_mgmt_node_with_shared_data.rst @@ -56,7 +56,7 @@ The configuration procedure will be quite different based on the shared data mec / -``Note``:For mysql, the database directory is ``/var/lib/mysql``; for postgresql, the database directory is ``/var/lib/pgsql``; for DB2, the database directory is specified with the site attribute databaseloc; for sqlite, the database directory is /etc/xcat, already listed above. +``Note``:For MySQL, the database directory is ``/var/lib/mysql``; for PostGreSQL, the database directory is ``/var/lib/pgsql``; for DB2, the database directory is specified with the site attribute databaseloc; for sqlite, the database directory is /etc/xcat, already listed above. Here is an example of how to make directories be shared data through NFS: :: @@ -125,7 +125,7 @@ Setup xCAT on the Primary Management Node service dhcpd stop chkconfig --level 2345 dhcpd off -#. Stop Database and prevent the database from auto starting at boot time, use mysql as an example: :: +#. Stop Database and prevent the database from auto starting at boot time, use MySQL as an example: :: service mysqld stop chkconfig mysqld off @@ -180,7 +180,7 @@ Setup xCAT on the Standby Management Node service dhcpd stop chkconfig --level 2345 dhcpd off -#. Stop Database and prevent the database from auto starting at boot time. Use mysql as an example: :: +#. Stop Database and prevent the database from auto starting at boot time. Use MySQL as an example: :: service mysqld stop chkconfig mysqld off @@ -303,7 +303,7 @@ If the management node is still available and running the cluster, perform the f #. Stop database - Use mysql as an example: :: + Use MySQL as an example: :: service mysqld stop @@ -346,7 +346,7 @@ On the new primary management node: mount /.xcat mount /db2database -#. Start database, use mysql as an example: :: +#. Start database, use MySQL as an example: :: service mysql start diff --git a/docs/source/advanced/hierarchy/appendix/appendix_b_diagnostics.rst b/docs/source/advanced/hierarchy/appendix/appendix_b_diagnostics.rst index ca259ecb3..d30fc59db 100644 --- a/docs/source/advanced/hierarchy/appendix/appendix_b_diagnostics.rst +++ b/docs/source/advanced/hierarchy/appendix/appendix_b_diagnostics.rst @@ -1,66 +1,18 @@ Appendix B: Diagnostics ======================= -* **root ssh keys not setup** -- If you are prompted for a password when ssh to - the service node, then check to see if /root/.ssh has authorized_keys. If - the directory does not exist or no keys, on the MN, run xdsh service -K, - to exchange the ssh keys for root. You will be prompted for the root - password, which should be the password you set for the key=system in the - passwd table. -* **XCAT rpms not on SN** --On the SN, run rpm -qa | grep xCAT and make sure - the appropriate xCAT rpms are installed on the servicenode. See the list of - xCAT rpms in :ref:`setup_service_node_stateful_label`. If rpms - missing check your install setup as outlined in Build the Service Node - Stateless Image for diskless or :ref:`setup_service_node_stateful_label` for - diskful installs. -* **otherpkgs(including xCAT rpms) installation failed on the SN** --The OS - repository is not created on the SN. When the "yum" command is processing - the dependency, the rpm packages (including expect, nmap, and httpd, etc) - required by xCATsn can't be found. In this case, check whether the - ``/install/postscripts/repos///`` directory exists on the MN. - If it is not on the MN, you need to re-run the "copycds" command, and there - will be some file created under the - ``/install/postscripts/repos//`` directory on the MN. Then, you - need to re-install the SN, and this issue should be gone. -* **Error finding the database/starting xcatd** -- If on the Service node when - you run tabdump site, you get "Connection failure: IO::Socket::SSL: - connect: Connection refused at ``/opt/xcat/lib/perl/xCAT/Client.pm``". Then - restart the xcatd daemon and see if it passes by running the command: - service xcatd restart. If it fails with the same error, then check to see - if ``/etc/xcat/cfgloc`` file exists. It should exist and be the same as - ``/etc/xcat/cfgloc`` on the MN. If it is not there, copy it from the MN to - the SN. The run service xcatd restart. This indicates the servicenode - postscripts did not complete successfully. Check to see your postscripts - table was setup correctly in :ref:`add_service_node_postscripts_label` to the - postscripts table. -* **Error accessing database/starting xcatd credential failure**-- If you run - tabdump site on the servicenode and you get "Connection failure: - IO::Socket::SSL: SSL connect attempt failed because of handshake - problemserror:14094418:SSL routines:SSL3_READ_BYTES:tlsv1 alert unknown ca - at ``/opt/xcat/lib/perl/xCAT/Client.pm``", check ``/etc/xcat/cert``. The - directory should contain the files ca.pem and server-cred.pem. These were - suppose to transfer from the MN ``/etc/xcat/cert`` directory during the - install. Also check the ``/etc/xcat/ca`` directory. This directory should - contain most files from the ``/etc/xcat/ca`` directory on the MN. You can - manually copy them from the MN to the SN, recursively. This indicates the - the servicenode postscripts did not complete successfully. Check to see - your postscripts table was setup correctly in - :ref:`add_service_node_postscripts_label` to the postscripts table. Again - service xcatd restart and try the tabdump site again. -* **Missing ssh hostkeys** -- Check to see if ``/etc/xcat/hostkeys`` on the SN, - has the same files as ``/etc/xcat/hostkeys`` on the MN. These are the ssh - keys that will be installed on the compute nodes, so root can ssh between - compute nodes without password prompting. If they are not there copy them - from the MN to the SN. Again, these should have been setup by the - servicenode postscripts. +* **root ssh keys not setup** -- If you are prompted for a password when ssh to the service node, then check to see if ``/root/.ssh`` directory on MN has ``authorized_keys`` file. If the directory does not exist or no keys, run ``xdsh service -K``, to exchange the ssh keys for root. You will be prompted for the root password, which should be the password you set for the ``key=system`` in the passwd table. -* **Errors running hierarchical commands such as xdsh** -- xCAT has a number of - commands that run hierarchically. That is, the commands are sent from xcatd - on the management node to the correct service node xcatd, which in turn - processes the command and sends the results back to xcatd on the management - node. If a hierarchical command such as xcatd fails with something like - "Error: Permission denied for request", check ``/var/log/messages`` on the - management node for errors. One error might be "Request matched no policy - rule". This may mean you will need to add policy table entries for your - xCAT management node and service node: +* **XCAT rpms not on SN** -- On the SN, run ``rpm -qa | grep xCAT`` and make sure the appropriate xCAT rpms are installed on the servicenode. See the list of xCAT rpms in :ref:`setup_service_node_stateful_label`. If rpms are missing, check your install setup as outlined in :ref:`setup_service_node_stateless_label` for diskless or :ref:`setup_service_node_stateful_label` for diskful installs. +* **otherpkgs(including xCAT rpms) installation failed on the SN** -- The OS repository is not created on the SN. When the "yum" command is processing the dependency, the rpm packages (including expect, nmap, and httpd, etc) required by xCATsn can't be found. In this case, check whether the ``/install/postscripts/repos///`` directory exists on the MN. If it is not on the MN, you need to re-run the ``copycds`` command, and there will be files created under the ``/install/postscripts/repos//`` directory on the MN. Then, you need to re-install the SN. + +* **Error finding the database/starting xcatd** -- If on the Service node when you run tabdump site, you get "Connection failure: IO::Socket::SSL: connect: Connection refused at ``/opt/xcat/lib/perl/xCAT/Client.pm``". Then restart the xcatd daemon and see if it passes by running the command ``service xcatd restart``. If it fails with the same error, then check to see if ``/etc/xcat/cfgloc`` file exists. It should exist and be the same as ``/etc/xcat/cfgloc`` on the MN. If it is not there, copy it from the MN to the SN. The run ``service xcatd restart``. This indicates the servicenode postscripts did not complete successfully. Run ``lsdef -i postscripts -c`` and verify ``servicenode`` postscript appears on the list.. + +* **Error accessing database/starting xcatd credential failure**-- If you run ``tabdump site`` on the service node and get "Connection failure: IO::Socket::SSL: SSL connect attempt failed because of handshake problemserror:14094418:SSL routines:SSL3_READ_BYTES:tlsv1 alert unknown at ``/opt/xcat/lib/perl/xCAT/Client.pm``", check ``/etc/xcat/cert``. The directory should contain the files ``ca.pem`` and ``server-cred.pem``. These were suppose to transfer from the MN ``/etc/xcat/cert`` directory during the install. Also check the ``/etc/xcat/ca`` directory. This directory should contain most files from the ``/etc/xcat/ca`` directory on the MN. You can manually copy them from the MN to the SN, recursively. This indicates the the servicenode postscripts did not complete successfully. Run ``lsdef -i postscripts -c`` and verify ``servicenode`` postscript appears on the list. Run ``service xcatd restart`` again and try the tabdump site again. + +* **Missing ssh hostkeys** -- Check to see if ``/etc/xcat/hostkeys`` on the SN, has the same files as ``/etc/xcat/hostkeys`` on the MN. These are the ssh keys that will be installed on the compute nodes, so root can ssh between compute nodes without password prompting. If they are not there copy them from the MN to the SN. Again, these should have been setup by the servicenode postscripts. + +* **Errors running hierarchical commands such as xdsh** -- xCAT has a number of commands that run hierarchically. That is, the commands are sent from xcatd on the management node to the correct service node xcatd, which in turn processes the command and sends the results back to xcatd on the management node. If a hierarchical command such as xcatd fails with something like "Error: Permission denied for request", check ``/var/log/messages`` on the management node for errors. One error might be "Request matched no policy rule". This may mean you will need to add policy table entries for your xCAT management node and service node. + +* **/install is not mounted on service node from managemen mode** -- If service node does not have ``/install`` directory mounted from management node, run ``lsdef -t site clustersite -i installloc`` and verify ``installloc="/install"`` diff --git a/docs/source/advanced/hierarchy/define_service_nodes.rst b/docs/source/advanced/hierarchy/define_service_nodes.rst index e031b56c9..aa9b64171 100644 --- a/docs/source/advanced/hierarchy/define_service_nodes.rst +++ b/docs/source/advanced/hierarchy/define_service_nodes.rst @@ -53,7 +53,7 @@ The following table illustrates the cluster being used in this example: setupconserver=1 **Tips/Hint** - * Even if you do not want xCAT to configure any services, you must define the service nodes in the ``servicenode`` table with at least one attribute, set to 0, otherwise xCAT will not recognize the node as a service node** + * Even if you do not want xCAT to configure any services, you must define the service nodes in the ``servicenode`` table with at least one attribute, set to 0, otherwise xCAT will not recognize the node as a service node * See the ``setup*`` attributes in the node definition man page for the list of available services: ``man node`` * For clusters with subnetted management networks, you might want to set ``setupupforward=1`` @@ -82,4 +82,20 @@ The following table illustrates the cluster being used in this example: chdef -t group -o rack1 conserver=r1n01 monserver=r1n01 chdef -t group -o rack2 conserver=r2n01 monserver=r2n01 +#. Choose location of ``/install`` and ``/tftpboot`` directories (optional). + The ``site`` table attributes ``installloc`` and ``sharedtftp`` control mounting of ``/install`` and ``/tftpboot`` directories from Management Node to Service node. + + To mount ``/install`` and ``/tftpboot`` directories from Management node to each Service Node: :: + + chdef -t site clustersite sharedtftp=1 + chdef -t site clustersite installloc="/install" + + To make ``/install`` and ``/tftpboot`` directories local on each Service Node, set ``site`` table attributes and "sync" ``/install`` and ``/tftpoot`` directory contents from Management Node to Service Nodes: :: + + chdef -t site clustersite sharedtftp=0 + chdef -t site clustersite installloc= + rsync -auv --exclude 'autoinst' /install r1n01:/ + rsync -auv --exclude 'autoinst' /install r2n01:/ + rsync -auv --exclude 'autoinst' /tftpboot r1n01:/ + rsync -auv --exclude 'autoinst' /tftpboot r2n01:/ diff --git a/docs/source/advanced/hierarchy/provision/diskful_sn.rst b/docs/source/advanced/hierarchy/provision/diskful_sn.rst index 20813fd38..972a81712 100644 --- a/docs/source/advanced/hierarchy/provision/diskful_sn.rst +++ b/docs/source/advanced/hierarchy/provision/diskful_sn.rst @@ -6,33 +6,51 @@ Diskful (Stateful) Installation Any cluster using statelite compute nodes must use a stateful (diskful) Service Nodes. -**Note: All xCAT Service Nodes must be at the exact same xCAT version as the xCAT Management Node**. Copy the files to the Management Node (MN) and untar them in the appropriate sub-directory of ``/install/post/otherpkgs`` +**Note:** All xCAT Service Nodes must be at the exact same xCAT version as the xCAT Management Node. -**Note for the appropriate directory below, check the ``otherpkgdir=/install/post/otherpkgs/rhels7/x86_64`` attribute of the osimage defined for the servicenode.** - -For example, for osimage rhels7-x86_64-install-service :: +Configure ``otherpkgdir`` and ``otherpkglist`` for service node osimage +----------------------------------------------------------------------- - mkdir -p /install/post/otherpkgs/**rhels7**/x86_64/xcat - cd /install/post/otherpkgs/**rhels7**/x86_64/xcat + * Create a subdirectory ``xcat`` under a path specified by ``otherpkgdir`` attribute of the service node os image, selected during the :doc:`../define_service_nodes` step. + + For example, for osimage *rhels7-x86_64-install-service* :: + + [root@fs4 xcat]# lsdef -t osimage rhels7-x86_64-install-service -i otherpkgdir + Object name: rhels7-x86_64-install-service + otherpkgdir=/install/post/otherpkgs/rhels7/x86_64 + [root@fs4 xcat]# mkdir -p /install/post/otherpkgs/rhels7/x86_64/xcat + + * Download or copy `xcat-core` and `xcat-dep` .bz2 files into that `xcat` directory :: + + wget https://xcat.org/files/xcat/xcat-core/_Linux/xcat-core/xcat-core--linux.tar.bz2 + wget https://xcat.org/files/xcat/xcat-dep/_Linux/xcat-dep--linux.tar.bz2 + + * untar the `xcat-core` and `xcat-dep` .bz2 files :: + + cd /install/post/otherpkgs///xcat tar jxvf core-rpms-snap.tar.bz2 tar jxvf xcat-dep-*.tar.bz2 -Next, add rpm names into your own version of service...otherpkgs.pkglist file. In most cases, you can find an initial copy of this file under ``/opt/xcat/share/xcat/install/`` . Or copy one from another similar platform. :: + * Verify the following entries are included in the package file specified by the ``otherpkglist`` attribute of the service node osimage. :: - mkdir -p /install/custom/install/rh - cp /opt/xcat/share/xcat/install/rh/service.rhels7.x86_64.otherpkgs.pkglist \ - /install/custom/install/rh - vi /install/custom/install/rh/service.rhels7.x86_64.otherpkgs.pkglist + xcat/xcat-dep///xCATsn + xcat/xcat-dep///conserver-xcat + xcat/xcat-dep///perl-Net-Telnet + xcat/xcat-dep///perl-Expect -Make sure the following entries are included in the -/install/custom/install/rh/service.rhels7.x86_64.otherpkgs.pkglist: :: + For example, for the osimage *rhels7-x86_64-install-service* :: - xCATsn - conserver-xcat - perl-Net-Telnet - perl-Expect + [root@fs4 ~]# lsdef -t osimage rhels7-x86_64-install-service -i otherpkglist + Object name: rhels7-x86_64-install-service + otherpkglist=/opt/xcat/share/xcat/install/rh/service.rhels7.x86_64.otherpkgs.pkglist + [root@fs4 ~]# cat /opt/xcat/share/xcat/install/rh/service.rhels7.x86_64.otherpkgs.pkglist + xcat/xcat-core/xCATsn + xcat/xcat-dep/rh7/x86_64/conserver-xcat + xcat/xcat-dep/rh7/x86_64/perl-Net-Telnet + xcat/xcat-dep/rh7/x86_64/perl-Expect + [root@fs4 ~]# -**Note: you will be installing the xCAT Service Node rpm xCATsn meta-package on the Service Node, not the xCAT Management Node meta-package. Do not install both.** +**Note:** you will be installing the xCAT Service Node rpm xCATsn meta-package on the Service Node, not the xCAT Management Node meta-package. Do not install both. Update the rhels6 RPM repository (rhels6 only) ---------------------------------------------- @@ -69,26 +87,18 @@ Update the rhels6 RPM repository (rhels6 only) createrepo \ -g repodata /98462d05248098ef1724eddb2c0a127954aade64d4bb7d4e693cff32ab1e463c-comps-rhel6-Server.xml -**Note:** you should use comps-rhel6-Server.xml with its key as the group file. +**Note:** you should use ``comps-rhel6-Server.xml`` with its key as the group file. -Set the node status to ready for installation ---------------------------------------------- - -Run nodeset to the osimage name defined in the provmethod attribute on your Service Node. :: - - nodeset service osimage="" - -For example :: - - nodeset osimage="rhels7-x86_64-install-service" - -Initialize network boot to install Service Nodes ------------------------------------------------- +Install Service Nodes +--------------------- :: - rsetboot net - rpower boot + rinstall osimage="" + +For example :: + + rinstall osimage="rhels7-x86_64-install-service" Monitor the Installation ------------------------ diff --git a/docs/source/advanced/hierarchy/provision/diskless_sn.rst b/docs/source/advanced/hierarchy/provision/diskless_sn.rst index 4f521aa48..717d3ee18 100644 --- a/docs/source/advanced/hierarchy/provision/diskless_sn.rst +++ b/docs/source/advanced/hierarchy/provision/diskless_sn.rst @@ -1,3 +1,5 @@ +.. _setup_service_node_stateless_label: + Diskless (Stateless) Installation ================================= diff --git a/docs/source/advanced/hierarchy/provision/verify_sn.rst b/docs/source/advanced/hierarchy/provision/verify_sn.rst index 0b111fab2..3c6210ef1 100644 --- a/docs/source/advanced/hierarchy/provision/verify_sn.rst +++ b/docs/source/advanced/hierarchy/provision/verify_sn.rst @@ -2,10 +2,10 @@ Verify Service Node Installation ================================ * ssh to the service nodes. You should not be prompted for a password. -* Check to see that the xcat daemon xcatd is running. -* Run some database command on the service node, e.g tabdump site, or nodels, - and see that the database can be accessed from the service node. -* Check that ``/install`` and ``/tftpboot`` are mounted on the service node - from the Management Node, if appropriate. -* Make sure that the Service Node has Name resolution for all nodes, it will - service. +* Check to see that the xcat daemon ``xcatd`` is running. +* Run some database command on the service node, e.g ``tabdump site``, or ``nodels``, and see that the database can be accessed from the service node. +* Check that ``/install`` and ``/tftpboot`` are mounted on the service node from the Management Node, if appropriate. +* Make sure that the Service Node has name resolution for all nodes it will service. +* Run ``updatenode -V -s`` on management node and verify output contains ``Running command on `` that indicates the command from management node is sent to service node to run against compute node target. + +See :doc:`Appendix B <../appendix/appendix_b_diagnostics>` for possible solutions. diff --git a/docs/source/advanced/index.rst b/docs/source/advanced/index.rst index 7193f3b71..3a78e0ac9 100755 --- a/docs/source/advanced/index.rst +++ b/docs/source/advanced/index.rst @@ -15,6 +15,7 @@ Advanced Topics kit/index.rst mixed_cluster/index.rst networks/index.rst + pdu/index.rst ports/xcat_ports.rst probe/index.rst raid/index.rst diff --git a/docs/source/advanced/networks/edgecore_switches/edgecore_switches.rst b/docs/source/advanced/networks/edgecore_switches/edgecore_switches.rst deleted file mode 100644 index db9a3cc11..000000000 --- a/docs/source/advanced/networks/edgecore_switches/edgecore_switches.rst +++ /dev/null @@ -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] - - - - - - - - diff --git a/docs/source/advanced/networks/edgecore_switches/index.rst b/docs/source/advanced/networks/edgecore_switches/index.rst deleted file mode 100644 index 6d3bdf038..000000000 --- a/docs/source/advanced/networks/edgecore_switches/index.rst +++ /dev/null @@ -1,7 +0,0 @@ -Edgecore Switches -================= - -.. toctree:: - :maxdepth: 2 - - edgecore_switches.rst diff --git a/docs/source/advanced/networks/index.rst b/docs/source/advanced/networks/index.rst index 5f19f7890..cd29cd51f 100644 --- a/docs/source/advanced/networks/index.rst +++ b/docs/source/advanced/networks/index.rst @@ -5,7 +5,7 @@ Networks :maxdepth: 2 ethernet_switches/index.rst + onie_switches/index.rst switchdiscover/index.rst infiniband/index.rst ipv6/index.rst - edgecore_switches/index.rst diff --git a/docs/source/advanced/networks/infiniband/mlnxofed_ib_install_v2_diskful.rst b/docs/source/advanced/networks/infiniband/mlnxofed_ib_install_v2_diskful.rst index 0db6df69e..610dd6384 100644 --- a/docs/source/advanced/networks/infiniband/mlnxofed_ib_install_v2_diskful.rst +++ b/docs/source/advanced/networks/infiniband/mlnxofed_ib_install_v2_diskful.rst @@ -24,14 +24,12 @@ Diskful Installation -p postscripts="mlnxofed_ib_install -p /install// \ -m --add-kernel-support -end-" -#. Provision the node +#. Provision the node :: + + rinstall osimage= #. Verification - * The Mellanox IB drivers are located at: ``/lib/modules//extra/`` - - * Use the ``ibv_devinfo`` comamnd to obtain information about the InfiniBand adapter - * Check the status of ``openibd`` service sysVinit: :: @@ -42,3 +40,6 @@ Diskful Installation systemctl status openibd.service + * Verify that the Mellanox IB drivers are located at: ``/lib/modules//extra/`` + + * Use the ``ibv_devinfo`` comamnd to obtain information about the InfiniBand adapter. diff --git a/docs/source/advanced/networks/infiniband/mlnxofed_ib_install_v2_diskless.rst b/docs/source/advanced/networks/infiniband/mlnxofed_ib_install_v2_diskless.rst index ae1be14ca..36af543e7 100644 --- a/docs/source/advanced/networks/infiniband/mlnxofed_ib_install_v2_diskless.rst +++ b/docs/source/advanced/networks/infiniband/mlnxofed_ib_install_v2_diskless.rst @@ -44,14 +44,12 @@ Diskless Installation packimage -#. Provision the node +#. Provision the node :: + rinstall osimage=rhels7.2-ppc64le-netboot-compute + #. Verification - * The Mellanox IB drivers are located at: ``/lib/modules//extra/`` - - * Use the ``ibv_devinfo`` comamnd to obtain information about the InfiniBand adapter - * Check the status of ``openibd`` service sysVinit: :: @@ -62,3 +60,6 @@ Diskless Installation systemctl status openibd.service + * Verify that the Mellanox IB drivers are located at: ``/lib/modules//extra/`` + + * Use the ``ibv_devinfo`` comamnd to obtain information about the InfiniBand adapter. diff --git a/docs/source/advanced/networks/onie_switches/index.rst b/docs/source/advanced/networks/onie_switches/index.rst new file mode 100644 index 000000000..1539acb9b --- /dev/null +++ b/docs/source/advanced/networks/onie_switches/index.rst @@ -0,0 +1,12 @@ +Open Network Install Environment Switches +========================================= + +The Open Network Install Environment, or "ONIE" [1]_. is an open source project definining an **install environment** for bare metal switches. This environment allows choice for the end users when selecting a network operating system to install onto these bare metal switches. + +.. toctree:: + :maxdepth: 2 + + os_cumulus/index.rst + + +.. [1] Open Network Install Environment: Created by Cumulus Networks, Inc. in 2012, the Open Network Install Environment (ONIE) Project is a small operating system, pre-installed as firmware on bare metal network switches, that provides an environment for automated operating system provisioning. diff --git a/docs/source/advanced/networks/onie_switches/os_cumulus/index.rst b/docs/source/advanced/networks/onie_switches/os_cumulus/index.rst new file mode 100644 index 000000000..d2b369957 --- /dev/null +++ b/docs/source/advanced/networks/onie_switches/os_cumulus/index.rst @@ -0,0 +1,12 @@ +Cumulus Linux OS +================ + +This documentation will focus on installing the Cumulus Network Operating System (https://www.cumulusnetworks.com/) onto a "white-box" Edgecore switch but the same concepts should apply to other ONIE enabled switches using other network operating systems. + + +.. toctree:: + :maxdepth: 2 + + prepare.rst + install.rst + manage.rst diff --git a/docs/source/advanced/networks/onie_switches/os_cumulus/install.rst b/docs/source/advanced/networks/onie_switches/os_cumulus/install.rst new file mode 100644 index 000000000..8623a973e --- /dev/null +++ b/docs/source/advanced/networks/onie_switches/os_cumulus/install.rst @@ -0,0 +1,112 @@ +Installation and Configuration +============================== + +Cumulus OS Installtion +---------------------- + +**Note:** *The following assumes that the physical switches have power and have obtained a DHCP IP address from the xCAT open range.* + +xCAT provides support for detecting and installing the Cumulus Linux OS into ONIE enabled switches by utilizing DHCP to detect "**onie_vendor**" from the ``vendor-class-identifier`` string and then send it the Cumulus Linux OS installer. + +#. Create a pre-defined switch definition for the ONIE switch using the ``onieswitch`` template. + + The mac address of the switch management port is required for xCAT to configure the DHCP information and send over the OS to install on the switch. + + **[small clusters]** If you know the mac address of the management port on the switch, create the pre-defined switch defintion providing the mac address. :: + + mkdef frame01sw1 --template onieswitch arch=armv71 \ + ip=192.168.1.1 mac="aa:bb:cc:dd:ee:ff" + + **[large clusters]** xCAT's :doc:`switchdiscover ` command can be used to discover the mac address and fill in the predefined switch definitions based on the switch/switchport mapping. + + + #. Define all the switch objects providing the switch/switchport mapping: :: + + mkdef frame01sw1 --template onieswitch arch=armv71 \ + ip=192.168.1.1 switch=coresw1 switchport=1 + mkdef frame02sw1 --template onieswitch arch=armv71 \ + ip=192.168.2.1 switch=coresw1 switchport=2 + mkdef frame03sw1 --template onieswitch arch=armv71 \ + ip=192.168.3.1 switch=coresw1 switchport=3 + mkdef frame04sw1 --template onieswitch arch=armv71 \ + ip=192.168.4.1 switch=coresw1 switchport=4 + ... + + #. Leverage ``switchdiscover`` over the DHCP range to automatically detect the MAC address and write them into the predefined swtiches above. :: + + switchdiscover --range + + +#. Set the ``provmethod`` attribute of the target switch(es) to the Cumulus Linux install image: :: + + chdef frame[01-04]sw1 \ + provmethod="/install/custom/sw_os/cumulus/cumulus-linux-3.1.0-bcm-armel.bin" + +#. Run ``makedhcp`` to prepare the DHCP/BOOTP lease information for the switch: :: + + makedhcp -a frame[01-04]sw1 + + Executing the ``makedhcp`` command will kick off the network install of the ONIE enabled switch. If there is no OS pre-loaded on the switch, the switch continues to send a DHCPREQUEST out to the network. After ``makedhcp`` is run against the switch, an entry is added to the leases file that will respond to the request with the Cumulus Linux installer file. :: + + host frame1sw1 { + dynamic; + hardware ethernet 8c:ea:1b:12:ca:40; + fixed-address 192.168.3.200; + supersede server.ddns-hostname = "frame1sw1"; + supersede host-name = "frame1sw1"; + if substring (option vendor-class-identifier, 0, 11) = "onie_vendor" { + supersede www-server = "http://192.168.27.1/install/custom/sw_os/cumulus/cumulus-linux-3.1.0-bcm-armel.bin"; + } + } + + *Typical installation time is around 1 hour* + + +Configure xCAT Remote Commands +------------------------------ + +After Cumulus Linux OS is installed, a default user ``cumulus`` will be created with default password: ``CumulusLinux!``. + +To ease in the management of the switch, xCAT provides a script to help configure password-less ssh as the ``root`` user. This script sends over the xCAT ssh keys so that the xCAT remote commands (``xdsh``, ``xdcp``, etc) can be run against the ONIE switches. + +Execute the following to sync the xCAT keys to the switch: :: + + /opt/xcat/share/xcat/scripts/configonie --switches frame01sw1 --ssh + +Validate the ssh keys are correctly configured by running a ``xdsh`` command: :: + + xdsh frame01sw1 uptime + + +Activate the License +-------------------- + +After Cumulus Linux OS is installed onto the ONIE switch, only the serial port console and the management ethernet port is enabled. To activate the rest of the switch ports, the license file needs to be installed onto the switch. + +#. Copy the license file to the switch: :: + + xdcp frame01sw1 /install/custom/sw_os/cumulus/licensefile.txt /root/ + +#. Activate the license: :: + + xdsh frame01sw1 "/usr/cumulus/bin/cl-license -i /root/licensefile.txt" + +#. Verify that the license file is successfully installed: :: + + xdsh frame01sw1 /usr/cumulus/bin/cl-license + + Output should be similar to: ``frame01sw1 xxx@xx.com|xxxxxxxxxxxxxxx`` + +#. Reboot the switch to apply the license file: :: + + xdsh frame01sw1 reboot + + +Enable SNMP +------------ + +In order to utilize ``xcatprobe switch_macmap``, snmp needs to be enabled. To enable, run the ``enablesnmp`` postscript on the switch: :: + + updatenode frame01sw1 -P enablesnmp + + diff --git a/docs/source/advanced/networks/onie_switches/os_cumulus/manage.rst b/docs/source/advanced/networks/onie_switches/os_cumulus/manage.rst new file mode 100644 index 000000000..0f3ce1184 --- /dev/null +++ b/docs/source/advanced/networks/onie_switches/os_cumulus/manage.rst @@ -0,0 +1,28 @@ +Switch Management +================= + +VLAN Configuration +------------------ + +xCAT ships a simple configuration script that will set all the ports on the switch to be part of VLAN 1. See the Cumulus Networks documentation for more information regarding advanced networking configuration. :: + + updatenode -P configinterface + + +Re-install OS +------------- + +There may be occasions where a re-install of the OS is required. Assuming the files are available on the xCAT management node, the following commands will invoke the install process: + +* **[use xCAT]** ``xdsh`` can be used to invoke the reinstall of the OS: :: + + # to clear out all the previous configuration, use the -k option (optional) + xdsh "/usr/cumulus/bin/onie-select -k + + # to invoke the reinstall of the OS + xdsh "/usr/cumulus/bin/onie-select -i -f;reboot" + +* **[manually]** Log into the Cumulus OS switch and run the following commands: :: + + sudo onie-select -i + sudo reboot diff --git a/docs/source/advanced/networks/onie_switches/os_cumulus/prepare.rst b/docs/source/advanced/networks/onie_switches/os_cumulus/prepare.rst new file mode 100644 index 000000000..e68fd0895 --- /dev/null +++ b/docs/source/advanced/networks/onie_switches/os_cumulus/prepare.rst @@ -0,0 +1,19 @@ +Preparation +=========== + +Prepare the Cumulus Linux files on the xCAT Management Node. + +#. Obtain a valid Cumulus Linux License and download the Cumulus Linux OS installer. + +#. Copy the above files into a location under the xCAT ``/install`` directory. :: + + # Create a directory to hold the cumulus linux files + mkdir -p /install/custom/sw_os/cumulus/ + + # copy the license file + cp licensefile.txt /install/custom/sw_os/cumulus/ + + # copy the installer + cp cumulus-linux-3.1.0-bcm-armel.bin /install/custom/sw_os/cumulus/ + + diff --git a/docs/source/advanced/networks/switchdiscover/switch_based_switch_discovery.rst b/docs/source/advanced/networks/switchdiscover/switch_based_switch_discovery.rst index f67b76d10..d2b9df8b7 100644 --- a/docs/source/advanced/networks/switchdiscover/switch_based_switch_discovery.rst +++ b/docs/source/advanced/networks/switchdiscover/switch_based_switch_discovery.rst @@ -8,34 +8,28 @@ Pre-requirement In order to do switch-based switch discovery, the admin -1. Needs to manually setup and configure core-switch, SNMP v3 needs to be enabled in order for xCAT access to it. **username** and **userpassword** attributes are for the remote login. It can be for **ssh** or **telnet**. If it is for **telnet**, set protocol to “telnet”. If the **username** is blank, the **username** and **password** will be retrieved from the passwd table with “switch” as the key. SNMP attributes will used for SNMPv3 communication. **nodetype** has to be set to "switch" to differentiate between switch-based node discovery or switch-based switch discovery. Refer to switches table attributes. Example of core-switch definition: +1. Needs to manually setup and configure core-switch, SNMP v3 needs to be enabled in order for xCAT access to it. **username** and **userpassword** attributes are for the remote login. It can be for **ssh** or **telnet**. If it is for **telnet**, set protocol to “telnet”. If the **username** is blank, the **username** and **password** will be retrieved from the passwd table with “switch” as the key. SNMP attributes will used for SNMPv3 communication. **nodetype** has to be set to "switch" to differentiate between switch-based node discovery or switch-based switch discovery. Refer to switches table attributes. Example of core-switch definition: :: -:: + lsdef switch-10-5-23-1 + Object name: switch-10-5-23-1 + groups=switch + ip=10.5.23.1 + mac=ab:cd:ef:gh:dc + mgt=switch + nodetype=switch + password=admin + postbootscripts=otherpkgs + postscripts=syslog,remoteshell,syncfiles + protocol=telnet + snmpauth=sha + snmppassword=userpassword + snmpusername=snmpadmin + snmpversion=3 + switchtype=BNT + usercomment=IBM + username=root - lsdef switch-10-5-23-1 - Object name: switch-10-5-23-1 - groups=switch - ip=10.5.23.1 - mac=ab:cd:ef:gh:dc - mgt=switch - nodetype=switch - password=admin - postbootscripts=otherpkgs - postscripts=syslog,remoteshell,syncfiles - protocol=telnet - snmpauth=sha - snmppassword=userpassword - snmpusername=snmpadmin - snmpversion=3 - switchtype=BNT - usercomment=IBM - username=root - - - -2. Predefine all top-rack switches which connect to core-switch. The attribute **ip** is static ip address for the switch. When ``switchdiscover --setup`` command is issued, this ip address will replace dhcp IP address on the switch. **nodetype=switch** needs to be set to differentiate between switch-based node discovery or switch-based switch discovery during discovery process. the attribute **switch** is hostname of core-switch and **switchport** is the port number in the core-switch that top-rack switch is connected to. - -:: +2. Predefine all top-rack switches which connect to core-switch. The attribute **ip** is static IP address for the switch. When ``switchdiscover --setup`` command is issued, this IP address will replace dhcp IP address on the switch. **nodetype=switch** needs to be set to differentiate between switch-based node discovery or switch-based switch discovery during discovery process. the attribute **switch** is hostname of core-switch and **switchport** is the port number in the core-switch that top-rack switch is connected to. :: lsdef switch-192-168-5-22 objtype=node @@ -50,13 +44,13 @@ In order to do switch-based switch discovery, the admin 3. Add switches to /etc/hosts for hostname lookup and xdsh command. :: - makehosts switch-192-168-5-23 - makehosts switch-192-168-5-22 + makehosts switch-192-168-5-23 + makehosts switch-192-168-5-22 4. Setup Dynamic IP range in network table for discovered switches to use. :: - # tabdump networks + # tabdump networks #netname,net,mask,mgtifname,gateway,dhcpserver,tftpserver,nameservers,ntpservers,logservers,dynamicrange,staticrange,staticrangeincrement,nodehostname,ddnsdomain,vlanid,domain,mtu,comments,disable "192_168_0_0-255_255_0_0","192.168.0.0","255.255.0.0","enP4p1s0f2","",,"192.168.3.29",,,,"192.168.5.150-192.168.5.170",,,,,,,,, @@ -67,7 +61,7 @@ dhcp should be restarted after seting up dynamic IP range. Discover Switches ~~~~~~~~~~~~~~~~~ -xCAT supports **switchdiscover** command to discover the switches that are attached to the subnets on xCAT management node. Refer to http://xcat-docs.readthedocs.io/en/latest/advanced/networks/switchdiscover/switches_discovery.html for more info. +xCAT supports **switchdiscover** command to discover the switches that are attached to the subnets on xCAT management node. Refer to :doc:`/advanced/networks/switchdiscover/switches_discovery` for more info. For the switch-based switch discovery, we add **–setup** flag: :: @@ -125,13 +119,11 @@ if **--setup** flag is specified, the command will perform following steps: Configure switches ~~~~~~~~~~~~~~~~~~ -The **switchdiscover** command with ``--setup`` flag will set up switches with static ip address, change the hostname from predefine switches and enable snmpv3 configuration. For other switches configuration, Refer to http://xcat-docs.readthedocs.io/en/latest/advanced/networks/ethernet_switches/ethernet_switches.html and http://xcat-docs.readthedocs.io/en/latest/advanced/networks/infiniband/switch_configuration.html +The **switchdiscover** command with ``--setup`` flag will set up switches with static IP address, change the hostname from predefine switches and enable snmpv3 configuration. For other switches configuration, refer to :doc:`/advanced/networks/ethernet_switches/ethernet_switches` and :doc:`/advanced/networks/infiniband/switch_configuration`. -These two config files are located in the **/opt/xcat/share/xcat/scripts**. The **switchdiscover** process will call the config files with ``--all`` option. User can call these scripts to setup one of options manually. +These two config files are located in the **/opt/xcat/share/xcat/scripts** directory. The **switchdiscover** process will call the config files with ``--all`` option. User can call these scripts to setup one of options manually. -1. **configBNT** is for configure BNT switches. - -:: +1. **configBNT** is for configure BNT switches. :: ./configBNT --help Usage: @@ -142,21 +134,22 @@ These two config files are located in the **/opt/xcat/share/xcat/scripts**. The configBNT [--switches switchnames] [--snmp] [--user snmp_user] [--password snmp_password] [--group snmp_group] configBNT [--switches switchnames] [--port port] [--vlan vlan] -2. **configMellanox** is for configuring Mellanox switch. The script will configure ntp service on the switch with xCAT MN and will use rspconfig command to - * enable ssh - * enable snmp function on the switch - * enable the snmp trap - * set logging destination to xCAT MN +2. **configMellanox** is for configuring Mellanox switch. The script will configure ntp service on the switch with xCAT MN and will use rspconfig command to -:: + * enable ssh + * enable snmp function on the switch + * enable the snmp trap + * set logging destination to xCAT MN - ./configMellanox --help - Usage: - configMellonax [-?│-h│--help] - configMellonax [--switches switchnames] [--all] - configMellonax [--switches switchnames] [--ip] - configMellonax [--switches switchnames] [--name] - configMellonax [--switches switchnames] [--config] + :: + + ./configMellanox --help + Usage: + configMellonax [-?│-h│--help] + configMellonax [--switches switchnames] [--all] + configMellonax [--switches switchnames] [--ip] + configMellonax [--switches switchnames] [--name] + configMellonax [--switches switchnames] [--config] Switch Status @@ -166,7 +159,7 @@ During the switch-based switch discovery process, there are four states displaye **Matched** --- Discovered switch is matched to predefine switch, **otherinterfaces** attribute is updated to dhcp IP address, and mac address, **switch type** and **usercomment** also updated with vendor information for the predefined switch. -**ip_configed** --- switch is set up to static ip address based on predefine switch IP address. If failure to set up IP address, the status will stay as **Matched**. +**ip_configed** --- switch is set up to static IP address based on predefine switch IP address. If failure to set up IP address, the status will stay as **Matched**. **hostname_configed** -- switch host name is changed based on predefine switch hostname. If failure to change hostname on the switch, the status will stay as **ip_configed**. diff --git a/docs/source/advanced/pdu/index.rst b/docs/source/advanced/pdu/index.rst new file mode 100644 index 000000000..5141a09f5 --- /dev/null +++ b/docs/source/advanced/pdu/index.rst @@ -0,0 +1,10 @@ +PDUs +==== + +Power Distribution Units (PDUs) are devices that distribute power to servers in a frame. Intelligent PDUs have the capability of monitoring the amount of power that is being used by devices plugged into it. + + +.. toctree:: + :maxdepth: 2 + + pdu.rst diff --git a/docs/source/advanced/pdu/pdu.rst b/docs/source/advanced/pdu/pdu.rst new file mode 100644 index 000000000..781a7dbc9 --- /dev/null +++ b/docs/source/advanced/pdu/pdu.rst @@ -0,0 +1,125 @@ +PDU +=== + +xCAT provides basic remote management for each power outlet plugged into the PDUs using SNMP communication. This documentation will focus on configuration of the PDU and Node objects to allow xCAT to control power at the PDU outlet level. + + +Define PDU Objects +------------------ + + + +#. Define pdu object :: + + mkdef f5pdu3 groups=pdu ip=50.0.0.8 mgt=pdu nodetype=pdu + +#. Add hostname to /etc/hosts:: + + makehosts f5pdu3 + +#. Verify the SNMP command responds against the PDU: :: + + snmpwalk -v1 -cpublic -mALL f5pdu3 .1.3.6.1.2.1.1 + + +Define PDU Attribute +-------------------- + +Administrators will need to know the exact mapping of the outlets to each server in the frame. xCAT cannot validate the physical cable is connected to the correct server. + +Add a ``pdu`` attribute to the compute node definition in the form "PDU_Name:outlet": :: + + # + # Compute server cn01 has two power supplies + # connected to outlet 6 and 7 on pdu=f5pdu3 + # + chdef cn01 pdu=f5pdu3:6,f5pdu3:7 + + +Verify the setting: ``lsdef cn01 -i pdu`` + + +PDU Commands +------------ + +The following commands are supported against a compute node: + + * Check the pdu status for a compute node: :: + + # rpower cn01 pdustat + cn01: f5pdu3 outlet 6 is on + cn01: f5pdu3 outlet 7 is on + + + * Power off the PDU outlets on a compute node: :: + + # rpower cn01 pduoff + cn01: f5pdu3 outlet 6 is off + cn01: f5pdu3 outlet 7 is off + + * Power on the PDU outlets on a compute node: :: + + # rpower cn01 pduon + cn01: f5pdu3 outlet 6 is on + cn01: f5pdu3 outlet 7 is on + +The following commands are supported against a PDU: + + * Check the status of the full PDU: :: + + # rinv f5pdu3 + f5pdu3: outlet 1 is on + f5pdu3: outlet 2 is on + f5pdu3: outlet 3 is on + f5pdu3: outlet 4 is on + f5pdu3: outlet 5 is on + f5pdu3: outlet 6 is off + f5pdu3: outlet 7 is off + f5pdu3: outlet 8 is on + f5pdu3: outlet 9 is on + f5pdu3: outlet 10 is on + f5pdu3: outlet 11 is on + f5pdu3: outlet 12 is on + + * Power off the full PDU: :: + + # rpower f5pdu3 off + f5pdu3: outlet 1 is off + f5pdu3: outlet 2 is off + f5pdu3: outlet 3 is off + f5pdu3: outlet 4 is off + f5pdu3: outlet 5 is off + f5pdu3: outlet 6 is off + f5pdu3: outlet 7 is off + f5pdu3: outlet 8 is off + f5pdu3: outlet 9 is off + f5pdu3: outlet 10 is off + f5pdu3: outlet 11 is off + f5pdu3: outlet 12 is off + + * Power on the full PDU: :: + + # rpower f5pdu3 on + f5pdu3: outlet 1 is on + f5pdu3: outlet 2 is on + f5pdu3: outlet 3 is on + f5pdu3: outlet 4 is on + f5pdu3: outlet 5 is on + f5pdu3: outlet 6 is on + f5pdu3: outlet 7 is on + f5pdu3: outlet 8 is on + f5pdu3: outlet 9 is on + f5pdu3: outlet 10 is on + f5pdu3: outlet 11 is on + f5pdu3: outlet 12 is on + + +**Note:** For BMC based compute nodes, turning the PDU outlet power on does not automatically power on the compute side. Users will need to issue ``rpower on`` to power on the compute node after the BMC boots. + + + + + + + + diff --git a/docs/source/guides/admin-guides/manage_clusters/common/deployment/additionalpkg/ubuntu_os_other_pkg.rst b/docs/source/guides/admin-guides/manage_clusters/common/deployment/additionalpkg/ubuntu_os_other_pkg.rst index e7a3fa7db..f8caa0e95 100644 --- a/docs/source/guides/admin-guides/manage_clusters/common/deployment/additionalpkg/ubuntu_os_other_pkg.rst +++ b/docs/source/guides/admin-guides/manage_clusters/common/deployment/additionalpkg/ubuntu_os_other_pkg.rst @@ -32,5 +32,8 @@ Compute nodes can access the internet Compute nodes can not access the internet ------------------------------------------ -If compute nodes cannot access the internet, there are two ways to install additional packages:use apt proxy or use local mirror according to :ref:`ubuntu-install-non-internet` +If compute nodes cannot access the internet, there are two ways to install additional packages + + * use apt proxy + * use local mirror diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms/discovery_using_defined.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms/discovery_using_defined.rst index d9fe7c2a0..d69d5d706 100644 --- a/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms/discovery_using_defined.rst +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms/discovery_using_defined.rst @@ -27,27 +27,17 @@ The BMC IP address is obtained by the open range dhcp server and the plan in thi #. Detect the BMCs and add the node definitions into xCAT. - Use the ``bmcdiscover`` command to discover the BMCs responding over an IP range and automatically write the output into the xCAT database. You **must** use the ``-w`` option to automatically write the output into the xCAT database. + Use the :doc:`bmcdiscover ` command to discover the BMCs responding over an IP range and write the output into the xCAT database. This discovered BMC node is used to control the physical server during hardware discovery and will be deleted after the correct server node object is matched to a pre-defined node. You **must** use the ``-w`` option to write the output into the xCAT database. - To discover the BMC with an IP address of 172.30.0.1, use the command: :: + To discover the BMC with an IP address range of 50.0.100.1-100: :: - bmcdiscover --range 172.30.0.1 -z -w + bmcdiscover --range 50.0.100.1-100 -z -w - The discovered nodes will be written to xCAT database: :: + The discovered nodes will be written to xCAT database. The discovered BMC nodes are in the form **node-model_type-serial**. To view the discovered nodes: :: - # lsdef node-8247-22l-10112ca - Object name: node-8247-22l-10112ca - bmc=172.30.0.1 - cons=ipmi - groups=all - hwtype=bmc - mgt=ipmi - mtm=8247-22L - nodetype=mp - postbootscripts=otherpkgs - postscripts=syslog,remoteshell,syncfiles - serial=10112CA - nodetype=mp + lsdef /node-.* + + **Note:** The ``bmcdiscover`` command will use the username/password from the ``passwd`` table corresponding to ``key=ipmi``. To overwrite with a different username/password use the ``-u`` and ``-p`` option to ``bmcdiscover``. #. **Pre-define** the compute nodes: diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/pbmc_discovery_with_bmcdiscover.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/pbmc_discovery_with_bmcdiscover.rst index f3388c855..3b3245171 100644 --- a/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/pbmc_discovery_with_bmcdiscover.rst +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/pbmc_discovery_with_bmcdiscover.rst @@ -3,31 +3,18 @@ Discover server and define After environment is ready, and the server is powered, we can start server discovery process. The first thing to do is discovering the FSP/BMC of the server. It is automatically powered on when the physical server is powered. -The following command can be used to discovery BMC within an IP range and write the discovered node definition into xCAT database:: +Use the :doc:`bmcdiscover ` command to discover the BMCs responding over an IP range and write the output into the xCAT database. This discovered BMC node is used to control the physical server during hardware discovery and will be deleted after the correct server node object is matched to a pre-defined node. You **must** use the ``-w`` option to write the output into the xCAT database. - bmcdiscover -s nmap --range 50.0.100.1-100 -z -w +To discover the BMC with an IP address range of 50.0.100.1-100: :: -The discovered BMC node will be like this:: + bmcdiscover --range 50.0.100.1-100 -z -w - # lsdef node-8247-42l-10112ca - Object name: node-8247-42l-10112ca - bmc=50.0.100.1 - cons=ipmi - groups=all - hwtype=bmc - mgt=ipmi - mtm=8247-42L - nodetype=mp - postbootscripts=otherpkgs - postscripts=syslog,remoteshell,syncfiles - serial=10112CA +The discovered nodes will be written to xCAT database. The discovered BMC nodes are in the form **node-model_type-serial**. To view the discovered nodes: :: -**Note**: - 1. The BMC node is just used to control the physical during hardware discovery process, it will be deleted after the correct server node object is found. - - 2. bmcdiscover will use username/password pair set in ``passwd`` table with **key** equal **ipmi**. If you'd like to use other username/password pair, you can use :: + lsdef /node-.* + +**Note:** The ``bmcdiscover`` command will use the username/password from the ``passwd`` table corresponding to ``key=ipmi``. To overwrite with a different username/password use the ``-u`` and ``-p`` option to ``bmcdiscover``. - bmcdiscover -s nmap --range 50.0.100.1-100 -z -w -u -p Start discovery process ----------------------- diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/index.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/index.rst index 882086fa2..8744168df 100644 --- a/docs/source/guides/admin-guides/manage_clusters/ppc64le/index.rst +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/index.rst @@ -13,6 +13,7 @@ These are machines use the IBM Power Architecture and is **IPMI** managed. management.rst diskful/index.rst diskless/index.rst + statelite/index.rst updatenode.rst parallel_cmd.rst virtual_machines/index.rst diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/statelite/advanced_features.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/statelite/advanced_features.rst new file mode 100644 index 000000000..cb5aca4e9 --- /dev/null +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/statelite/advanced_features.rst @@ -0,0 +1,266 @@ +Advanced features +================= + +Both directory and its child items coexist in litefile table +------------------------------------------------------------ + +As described in the above chapters, we can add the files/directories to litefile table. Sometimes, it is necessary to put one directory and also its child item(s) into the litefile table. Due to the implementation of the statelite on Linux, some scenarios works, but some doesn't work. + +Here are some examples of both directory and its child items coexisting: + + Both the parent directory and the child file coexist: :: + + "ALL","/root/testblank/",,, + "ALL","/root/testblank/tempfschild","tempfs",, + + One more complex example: :: + + "ALL","/root/",,, + "ALL","/root/testblank/tempfschild","tempfs",, + + Another more complex example, but we don't intend to support such one scenario: :: + + "ALL","/root/",,, + "ALL","/root/testblank/",,, + "ALL","/root/testblank/tempfschild","tempfs",, + +For example, in scenario 1, the parent is ``/root/testblank/``, and the child is ``/root/testblank/tempfschild``. +In scenario 2, the parent is ``/root/``, and the child is ``/root/testblank/tempfschild``. + +In order to describe the hierarchy scenarios we can use , ``P`` to denote parent, and ``C`` to denote child. + ++--------------+-----------------------------------------------------+-------------------------------------------------+ +| Option | Example | Remarks | ++==============+=====================================================+=================================================+ +| P:tmpfs | "ALL","/root/testblank/",,, | Both the parent and the child are mounted to | +| | "ALL","/root/testblanktempfschild","tempfs",, | tmpfs on the booted node following their | +| | | respective options. Only the parent are mounted | +| | | to the local file system. | ++--------------+-----------------------------------------------------+-------------------------------------------------+ +| P:tmpfs | "ALL","/root/testblank/",,, | Both parent and child are mounted to tmpfs | +| C:persistent | "ALL","/root/testblank/testpersfile","persistent",, | on the booted node following their respective | +| | | options. Only the parent is mounted to the local| +| | | file | ++--------------+-----------------------------------------------------+-------------------------------------------------+ +| P:persistent | "ALL","/root/testblank/","persistent",, | Not permitted now. But plan to support it. | +| C:tmpfs | "ALL","/root/testblank/tempfschild",,, | | ++--------------+-----------------------------------------------------+-------------------------------------------------+ +| P:persistent | "ALL","/root/testblank/","persistent",, | Both parent and child are mounted to tmpfs | +| C:persistent | "ALL","/root/testblank/testpersfile","persistent",, | on the booted node following their respective | +| | | options. Only the parent is mounted to local | +| | | file system. | ++--------------+-----------------------------------------------------+-------------------------------------------------+ +| P:ro C:any | | Not permitted | ++--------------+-----------------------------------------------------+-------------------------------------------------+ +| P:tmpfs C:ro | | Both parent and child are mounted to tmpfs | +| | | on the booted node following their respective | +| | | options. Only the parent is mounted to local | +| | | file system. | ++--------------+-----------------------------------------------------+-------------------------------------------------+ +| P:tmpfs | | Both parent and child are mounted to tmpfs | +| C:con | | on the booted node following their respective | +| | | options. Only the parent is mounted to local | +| | | file system. | ++--------------+-----------------------------------------------------+-------------------------------------------------+ +| P:link | "ALL","/root/testlink/","link",, | Both parent and child are created in tmpfs | +| C:link | "ALL","/root/testlink/testlinkchild","link",, | on the booted node following their respective | +| | | options; there's only one symbolic link of | +| | | the parent is created in the local file system. | ++--------------+-----------------------------------------------------+-------------------------------------------------+ +| P: link C: | "ALL","/root/testlinkpers/","link",, | Both parent and child are created in tmpfs | +| link, | "ALL","/root/testlink/testlinkchild",, | on the booted node following their respective | +| persistent | "link,persistent" | options; there's only one symbolic link of | +| | | the parent is created in the local file system. | ++--------------+-----------------------------------------------------+-------------------------------------------------+ +| P:link, | "ALL","/root/testlinkpers/","link,persistent",, | NOT permitted | +| persistent | | | +| C: link | "ALL","/root/testlink/testlinkchild","link" | | ++--------------+-----------------------------------------------------+-------------------------------------------------+ +| P:link, | "ALL","/root/testlinkpers/","link,persistent",, | Both parent and child are created in tmpfs | +| persistent | "ALL","/root/testlink | on the booted node following "link,persistent" | +| C:link, | | way; there's only one symbolic link of the | +| persistent | | parent is created in the local file system. | ++--------------+-----------------------------------------------------+-------------------------------------------------+ +| P:link | "ALL","/root/testlink/","link",, | Both parent and child are created in tmpfs | +| C:link,ro | "ALL","/root/testlink/testlinkro","link,ro",, | on the booted node, there's only one symbolic | +| | | link of the parent is created in the local | +| | | file system. | ++--------------+-----------------------------------------------------+-------------------------------------------------+ +| P:link | "ALL","/root/testlink/","link",, | Both parent and child are created in tmpfs | +| C:link,con | "ALL","/root/testlink/testlinkconchild","link,con",,| on the booted node, there's only one symbolic | +| | | link of the parent in the local file system. | ++--------------+-----------------------------------------------------+-------------------------------------------------+ +| P:link, | | NOT Permitted | +| persistent | | | +| C:link,ro | | | ++--------------+-----------------------------------------------------+-------------------------------------------------+ +| P:link, | | NOT Permitted | +| persistent | | | +| C:link,con | | | ++--------------+-----------------------------------------------------+-------------------------------------------------+ +| P:tmpfs | | NOT Permitted | +| C:link | | | ++--------------+-----------------------------------------------------+-------------------------------------------------+ +| P:link | | NOT Permitted | +| C:persistent | | | ++--------------+-----------------------------------------------------+-------------------------------------------------+ + +litetree table +-------------- + +The litetree table controls where the initial content of the files in the litefile table come from, and the long term content of the ``ro`` files. When a node boots up in statelite mode, it will by default copy all of its tmpfs files from the ``/.default`` directory of the root image, so there is not requirement to setup a litetree table. If you decide that you want some of the files pulled from different locations that are different per node, you can use this table. + +See litetree man page for description of attributes. + +For example, a user may have two directories with a different ``/etc/motd`` that should be used for nodes in two locations: :: + + 10.0.0.1:/syncdirs/newyork-590Madison/rhels5.4/x86_64/compute/etc/motd + 10.0.0.1:/syncdirs/shanghai-11foo/rhels5.4/x86_64/compute/etc/motd + +You can specify this in one row in the litetree table: :: + + 1,,10.0.0.1:/syncdirs/$nodepos.room/$nodetype.os/$nodetype.arch/$nodetype.profile + +When each statelite node boots, the variables in the litetree table will be substituted with the values for that node to locate the correct directory to use. Assuming that ``/etc/motd`` was specified in the litefile table, it will be searched for in all of the directories specified in the litetree table and found in this one. + +You may also want to look by default into directories containing the node name first: :: + + $noderes.nfsserver:/syncdirs/$node + +The litetree prioritizes where node files are found. The first field is the priority. The second field is the image name (ALL for all images) and the final field is the mount point. + +Our example is as follows: :: + + 1,,$noderes.nfsserver:/statelite/$node + 2,,cnfs:/gpfs/dallas/ + +The two directories ``/statelite/$node`` on the node's $noderes.nfsserver and the ``/gpfs/dallas`` on the node cnfs contain root tree structures that are sparsely populated with files that we want to place in those nodes. If files are not found in the first directory, it goes to the next directory. If none of the files can be found in the litetree hierarchy, then they are searched for in ``/.default`` on the local image. + +Installing a new Kernel in the statelite image +---------------------------------------------- + +Obtain you new kernel and kernel modules on the MN, for example here we have a new SLES kernel. + +#. Copy the kernel into /boot : :: + + cp **vmlinux-2.6.32.10-0.5-ppc64**/boot + +#. Copy the kernel modules into ``/lib/modules/`` :: + + /lib/modules # ls -al + total 16 + drwxr-xr-x 4 root root 4096 Apr 19 10:39 . + drwxr-xr-x 17 root root 4096 Apr 13 08:39 .. + drwxr-xr-x 3 root root 4096 Apr 13 08:51 2.6.32.10-0.4-ppc64 + **drwxr-xr-x 4 root root 4096 Apr 19 10:12 2.6.32.10-0.5-ppc64** + +#. Run genimage to update the statelite image with the new kernel :: + + genimage -k 2.6.32.10-0.5-ppc64 + +#. Then after a nodeset command and netbooti, shows the new kernel:: + + uname -a + +Enabling the localdisk Option +----------------------------- + +``Note``: You can skip this section if not using the ``localdisk`` option in your litefile table. + +Several things need to be done to enable the 'localdisk' support: + +Define how to partition the local disk +`````````````````````````````````````` + +When a node is deployed, the local hard disk needs to be partitioned and formatted before it can be used. This section explains how provide a configuration file that tells xCAT to partition a local disk and make it ready to use for the directories listed in the litefile table with the ``localdisk`` option. + +The configuration file needs to be specified in the ``partitionfile`` attribute of the osimage definition. The configuration file includes several parts: + + * Global parameters to control enabling or disabling the function + * [disk] part to control the partitioning of the disk + * [localspace] part to control which partition will be used to store the localdisk directories listed in the litefile table + * [swapspace] part to control the enablement of the swap space for the node. + +An example localdisk configuration file: :: + + enable=yes + enablepart=no + + [disk] + dev=/dev/sdb + clear=yes + parts=100M-200M,1G-2G + + [disk] + dev=/dev/sda + clear=yes + parts=10,20,30 + + [disk] + dev=/dev/sdc + clear=yes + parts=10,20,30 + + [localspace] + dev=/dev/sda1 + fstype=ext3 + + [swapspace] + dev=/dev/sda2 + +The two global parameters ``enable`` and ``enablepart`` can be used to control the enabling/disabling of the functions: + + * enable: The localdisk feature only works when ``enable`` is set to *yes*. If it is set to *no*, the localdisk configuration will not be run. + * enablepart: The partition action (refer to the ``[disk]`` section) will be run only when ``enablepart=yes``. + +The ``[disk]`` section is used to configure how to partition a hard disk: + + * dev: The path of the device file. + * clear: If set to ``yes`` it will clear all the existing partitions on this disk. + * fstype: The file system type for the new created partitions. ``ext3`` is the default value if not set. + * parts: A comma separated list of space ranges, one for each partition that will be created on the device. The valid format for each space range is ``-`` or ````. For example, you could set it to ``100M-10G`` or ``50``. If you set it to ``50``, that means 50% of the disk space will be assigned to that partition. + +The ``[localspace]`` section is used to specify which partition will be used as local storage for the node. + + * dev: The path of the partition. + * fstype: The file system type on the partition. + +the ``[swapspace]`` section is used to configure the swap space for the statelite node. + + * dev: The path of the partition file which will be used as the swap space. + +To enable the local disk capability, create the configuration file (for example in ``/install/custom``) and set the path in the partitionfile attribute for the osimage: :: + + chdef -t osimage partitionfile=/install/custom/cfglocaldisk + +Now all nodes that use this osimage (i.e. have their provmethod attribute set to this osimage definition name), will have its local disk configured. + +Configure the files in the litefile table +````````````````````````````````````````` + +For the files/directories that you would like xCAT to store on the local disk, add an entry in the litefile table like this: :: + + "ALL","/tmp/","localdisk",, + +``Note``: you do not need to specify the swap space in the litefile table. Just putting it in the partitionfile config file is enough. + +Add an entry in policy table to permit the running of the ``getpartitioin`` command from the node :: + + chtab priority=7.1 policy.commands=getpartition policy.rule=allow + +If Using the RAMdisk-based Image +```````````````````````````````` + +If you want to use the local disk option with a RAMdisk-based image, remember to follow the instructions in :doc:`Switch to the RAMdisk based solution <./provision_statelite>`. + +If your reason for using a RAMdisk image is to avoid compute node runtime dependencies on the service node or management node, then the only entries you should have in the litefile table should be files/dirs that use the localdisk option. + +Debugging techniques +-------------------- + + When a node boots up in statelite mode, there is a script that runs called statelite that is in the root directory of ``$imageroot/etc/init.d/statelite``. This script is not run as part of the rc scripts, but as part of the pre-switch root environment. Thus, all the linking is done in this script. There is a ``set x`` near the top of the file. You can uncomment it and see what the script runs. You will then see lots of mkdirs and links on the console. + + You can also set the machine to shell. Just add the word ``shell`` on the end of the pxeboot file of the node in the append line. This will make the init script in the initramfs pause 3 times before doing a switch_root. + + When all the files are linked they are logged in ``/.statelite/statelite.log`` on the node. You can get into the node after it has booted and look in the ``/.statelite`` directory. + diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/statelite/config_statelite.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/statelite/config_statelite.rst new file mode 100644 index 000000000..9e8a9c312 --- /dev/null +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/statelite/config_statelite.rst @@ -0,0 +1,134 @@ +Configuration +============= + +Statelite configuration is done using the following tables in xCAT: + * litefile + * litetree + * statelite + * policy + * noderes + +litefile table +-------------- + +The litefile table specifies the directories and files on the statelite nodes that should be read/write, persistent, or read-only overlay. All other files in the statelite nodes come from the read-only statelite image. + +#. The first column in the litefile table is the image name this row applies to. It can be an exact osimage definition name, an osimage group (set in the groups attribute of osimages), or the keyword ``ALL``. + +#. The second column in the litefile table is the full path of the directory or file on the node that you are setting options for. + +#. The third column in the litefile table specifies options for the directory or file: + + #. tmpfs - It provides a file or directory for the node to use when booting, its permission will be the same as the original version on the server. In most cases, it is read-write; however, on the next statelite boot, the original version of the file or directory on the server will be used, it means it is non-persistent. This option can be performed on files and directories. + #. rw - Same as Above.Its name "rw" does NOT mean it always be read-write, even in most cases it is read-write. Do not confuse it with the "rw" permission in the file system. + #. persistent - It provides a mounted file or directory that is copied to the xCAT persistent location and then over-mounted on the local file or directory. Anything written to that file or directory is preserved. It means, if the file/directory does not exist at first, it will be copied to the persistent location. Next time the file/directory in the persistent location will be used. The file/directory will be persistent across reboots. Its permission will be the same as the original one in the statelite location. It requires the statelite table to be filled out with a spot for persistent statelite. This option can be performed on files and directories. + #. con - The contents of the pathname are concatenated to the contents of the existing file. For this directive the searching in the litetree hierarchy does not stop when the first match is found. All files found in the hierarchy will be concatenated to the file when found. The permission of the file will be "-rw-r--r--", which means it is read-write for the root user, but readonly for the others. It is non-persistent, when the node reboots, all changes to the file will be lost. It can only be performed on files. Do not use it for one directory. + #. ro - The file/directory will be overmounted read-only on the local file/directory. It will be located in the directory hierarchy specified in the litetree table. Changes made to this file or directory on the server will be immediately seen in this file/directory on the node. This option requires that the file/directory to be mounted must be available in one of the entries in the litetree table. This option can be performed on files and directories. + #. tmpfs,rw - Only for compatibility it is used as the default option if you leave the options column blank. It has the same semantics with the link option, so when adding new items into the _litefile table, the link option is recommended. + #. link - It provides one file/directory for the node to use when booting, it is copied from the server, and will be placed in tmpfs on the booted node. In the local file system of the booted node, it is one symbolic link to one file/directory in tmpfs. And the permission of the symbolic link is "lrwxrwxrwx", which is not the real permission of the file/directory on the node. So for some application sensitive to file permissions, it will be one issue to use "link" as its option, for example, "/root/.ssh/", which is used for SSH, should NOT use "link" as its option. It is non-persistent, when the node is rebooted, all changes to the file/directory will be lost. This option can be performed on files and directories. + #. link,ro - The file is readonly, and will be placed in tmpfs on the booted node. In the local file system of the booted node, it is one symbolic link to the tmpfs. It is non-persistent, when the node is rebooted, all changes to the file/directory will be lost. This option requires that the file/directory to be mounted must be available in one of the entries in the litetree table. The option can be performed on files and directories. + #. link,con - Similar to the "con" option. All the files found in the litetree hierarchy will be concatenated to the file when found. The final file will be put to the tmpfs on the booted node. In the local file system of the booted node, it is one symbolic link to the file/directory in tmpfs. It is non-persistent, when the node is rebooted, all changes to the file will be lost. The option can only be performed on files. + #. link,persistent - It provides a mounted file or directory that is copied to the xCAT persistent location and then over-mounted to the tmpfs on the booted node, and finally the symbolic link in the local file system will be linked to the over-mounted tmpfs file/directory on the booted node. The file/directory will be persistent across reboots. The permission of the file/directory where the symbolic link points to will be the same as the original one in the statelite location. It requires the statelite table to be filled out with a spot for persistent statelite. The option can be performed on files and directories. + #. localdisk - The file or directory will be stored in the local disk of the statelite node. Refer to the section To enable the localdisk option to enable the 'localdisk' support. + +Currently, xCAT does not handle the relative links very well. The relative links are commonly used by the system libraries, for example, under ``/lib/`` directory, there will be one relative link matching one ``.so`` file. So, when you add one relative link to the litefile table (Not recommend), make sure the real file also be included, or put its directory name into the litefile table. + +**Note**: It is recommended that you specify at least the entries listed below in the litefile table, because most of these files need to be writeable for the node to boot up successfully. When any changes are made to their options, make sure they won't affect the whole system. + +Sample Data for Redhat statelite setup +`````````````````````````````````````` + +This is the minimal list of files needed, you can add additional files to the litefile table. :: + + #image,file,options,comments,disable + "ALL","/etc/adjtime","tmpfs",, + "ALL","/etc/securetty","tmpfs",, + "ALL","/etc/lvm/","tmpfs",, + "ALL","/etc/ntp.conf","tmpfs",, + "ALL","/etc/rsyslog.conf","tmpfs",, + "ALL","/etc/rsyslog.conf.XCATORIG","tmpfs",, + "ALL","/etc/udev/","tmpfs",, + "ALL","/etc/ntp.conf.predhclient","tmpfs",, + "ALL","/etc/resolv.conf","tmpfs",, + "ALL","/etc/yp.conf","tmpfs",, + "ALL","/etc/resolv.conf.predhclient","tmpfs",, + "ALL","/etc/sysconfig/","tmpfs",, + "ALL","/etc/ssh/","tmpfs",, + "ALL","/etc/inittab","tmpfs",, + "ALL","/tmp/","tmpfs",, + "ALL","/var/","tmpfs",, + "ALL","/opt/xcat/","tmpfs",, + "ALL","/xcatpost/","tmpfs",, + "ALL","/etc/systemd/system/multi-user.target.wants/","tmpfs",, + "ALL","/root/.ssh/","tmpfs",, + "ALL","/etc/rc3.d/","tmpfs",, + "ALL","/etc/rc2.d/","tmpfs",, + "ALL","/etc/rc4.d/","tmpfs",, + "ALL","/etc/rc5.d/","tmpfs",, + +Sample Data for SLES statelite setup +```````````````````````````````````` + +This is the minimal list of files needed, you can add additional files to the litefile table. :: + + #image,file,options,comments,disable + "ALL","/etc/lvm/","tmpfs",, + "ALL","/etc/ntp.conf","tmpfs",, + "ALL","/etc/ntp.conf.org","tmpfs",, + "ALL","/etc/resolv.conf","tmpfs",, + "ALL","/etc/ssh/","tmpfs",, + "ALL","/etc/sysconfig/","tmpfs",, + "ALL","/etc/syslog-ng/","tmpfs",, + "ALL","/etc/inittab","tmpfs",, + "ALL","/tmp/","tmpfs",, + "ALL","/etc/init.d/rc3.d/","tmpfs",, + "ALL","/etc/init.d/rc5.d/","tmpfs",, + "ALL","/var/","tmpfs",, + "ALL","/etc/yp.conf","tmpfs",, + "ALL","/etc/fstab","tmpfs",, + "ALL","/opt/xcat/","tmpfs",, + "ALL","/xcatpost/","tmpfs",, + "ALL","/root/.ssh/","tmpfs",, + +litetree table +-------------- + +The litetree table controls where the initial content of the files in the litefile table come from, and the long term content of the ``ro`` files. When a node boots up in statelite mode, it will by default copy all of its tmpfs files from the ``.default`` directory of the root image, for example ``/install/netboot/rhels7.3/x86_64/compute/rootimg/.default``, so there is not required to set up a litetree table. If you decide that you want some of the files pulled from different locations that are different per node, you can use this table. + +You can choose to use the defaults and not set up a litetree table. + +statelite table +--------------- + +The statelite table specifies location on an NFS server where a nodes persistent files are stored. This is done by entering the information into the statelite table. + +In the statelite table, the node or nodegroups in the table must be unique; that is a node or group should appear only once in the first column table. This makes sure that only one statelite image can be assigned to a node. An example would be: :: + + "compute",,":/gpfs/state",, + +Any nodes in the compute node group will have their state stored in the ``/gpfs/state`` directory on the machine with ```` as its IP address. + +When the node boots up, then the value of the ``statemnt`` attribute will be mounted to ``/.statelite/persistent``. The code will then create the following subdirectory ``/.statelite/persistent/``, if there are persistent files that have been added in the litefile table. This directory will be the root of the image for this node's persistent files. By default, xCAT will do a hard NFS mount of the directory. You can change the mount options by setting the mntopts attribute in the statelite table. + +Also, to set the ``statemnt`` attribute, you can use variables from xCAT database. It follows the same grammar as the litetree table. For example: :: + + #node,image,statemnt,mntopts,comments,disable + "cn1",,"$noderes.nfsserver:/lite/state/$nodetype.profile","soft,timeo=30",, + +``Note``: Do not name your persistent storage directory with the node name, as the node name will be added in the directory automatically. If you do, then a directory named ``/state/cn1`` will have its state tree inside ``/state/cn1/cn1``. + +Policy +------ + +Ensure policies are set up correctly in the Policy Table. When a node boots up, it queries the xCAT database to get the litefile and litetree table information. In order for this to work, the commands (of the same name) must be set in the policy table to allow nodes to request it. This should happen automatically when xCAT is installed, but you may want to verify that the following lines are in the policy table: :: + + chdef -t policy -o 4.7 commands=litefile rule=allow + chdef -t policy -o 4.8 commands=litetree rule=allow + +noderes +------- + +``noderes.nfsserver`` attribute can be set for the NFSroot server. If this is not set, then the default is the Management Node. + +``noderes.nfsdir`` can be set. If this is not set, the the default is ``/install`` + diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/statelite/hierarchy_support.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/statelite/hierarchy_support.rst new file mode 100644 index 000000000..449533bfe --- /dev/null +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/statelite/hierarchy_support.rst @@ -0,0 +1,43 @@ +Hierarchy Support +----------------- + +In the ``statelite`` environment, the service node needs to provide NFS service for the compute node with ``statelite``, the service nodes must to be setup with diskfull installation. + +Setup the diskfull service node +``````````````````````````````` + +#. Setup one diskfull service node at first. + +#. Since statelite is a kind of NFS-hybrid method, you should remove the installloc attribute in the site table. This makes sure that the service node does not mount the ``/install`` directory from the management node on the service node. + +Generate the statelite image +```````````````````````````` + +To generate the statelite image for your own profile follow instructions in :doc:`Customize your statelite osimage <./provision_statelite>`. + +``NOTE``: if the NFS directories defined in the litetree table are on the service node, it is better to setup the NFS directories in the service node following the chapter. + +Sync the ``/install`` directory +``````````````````````````````` + +The command prsync is used to sync the ``/install`` directory to the service nodes. + +Run the following: :: + + cd / + prsync install :/ + +```` is the hostname of the service node you defined. + +Since the ``prsync`` command will sync all the contents in the ``/install`` directory to the service nodes, the first time will take a long time. But after the first time, it will take very short time to sync. + +``NOTE``: if you make any changes in the ``/install`` directory on the management node, and the changes can affect the statelite image, you need to sync the ``/install`` directory to the service node again. + +Set the boot state to statelite +``````````````````````````````` + +You can now deploy the node: :: + + rinstall osimage=rhel5.3-x86_64-statelite-compute + +This will create the necessary files in ``/tftpboot`` for the node to boot correctly. diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/statelite/index.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/statelite/index.rst new file mode 100644 index 000000000..7ae22087e --- /dev/null +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/statelite/index.rst @@ -0,0 +1,45 @@ +Statelite Installation +====================== + +**Overview** + +This document details the design and setup for the statelite solution of xCAT. **Statelite** is an intermediate mode between **diskful** and **diskless**. + +Statelite provides two kinds of efficient and flexible solutions, most of the OS image can be NFS mounted read-only, or the OS image can be in the ramdisk with tmpfs type. Different from the stateless solution, statelite provides a configurable list of directories and files that can be read-write. These read-write directories and files can be configured to either persist or not persist across reboots. + +**Solutions** + +There are two solutions: ``NFSROOT-based`` and ``RAMdisk-based``. + +#. NFSROOT-based(default): + #. rootfstype in the osimage xCAT data objects is left as blank, or set to ``nfs``, the ``NFSROOT-base`` statelite solution will be enabled. + #. the ROOTFS is NFS mounted read-only. + +#. RAMdisk-based: + #. rootfstype in the osimage xCAT data objects is set to ``ramdisk``. + #. one image file will be downloaded when the node is booting up, and the file will be extracted to the ramdisk, and used as the ROOTFS. + +**Advantages** + +``Statelite`` offers the following advantages over xCAT's stateless (RAMdisk) implementation: + +#. Some files can be made persistent over reboot. This is useful for license files or database servers where some state is needed. However, you still get the advantage of only having to manage a single image. +#. Changes to hundreds of machines can take place instantly, and automatically, by updating one main image. In most cases, machines do not need to reboot for these changes to take affect. This is only for the ``NFSROOT-based`` solution. +#. Ease of administration by being able to lock down an image. Many parts of the image can be read-only, so no modifications can transpire without updating the central image. +#. Files can be managed in a hierarchical manner. For example: Suppose you have a machine that is in one lab in Tokyo and another in London. You could set table values for those machines in the xCAT database to allow machines to sync from different places based on their attributes. This allows you to have one base image with multiple sources of file overlay. +#. Ideal for virtualization. In a virtual environment, you may not want a disk image (neither stateless nor stateful) on every virtual node as it consumes memory and disk. Virtualizing with the statelite approach allows for images to be smaller, easier to manage, use less disk, less memory, and more flexible. + +**Disadvantages** + +However, there're still several disadvantages, especially for the ``NFSROOT-based`` solution. + +#. NFS Root requires more network traffic to run as the majority of the disk image runs over NFS. This may depend on your workload, but can be minimized. Since the bulk of the image is read-only, NFS caching on the server helps minimize the disk access on the server, and NFS caching on the client helps reduce the network traffic. +#. NFS Root can be complex to set up. As more files are created in different places, there are greater chances for failures. This flexibility is also one of the great virtues of Statelite. The image can work in nearly any environment. + +.. toctree:: + :maxdepth: 2 + + config_statelite.rst + provision_statelite.rst + hierarchy_support.rst + advanced_features.rst diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/statelite/provision_statelite.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/statelite/provision_statelite.rst new file mode 100644 index 000000000..240aed782 --- /dev/null +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/statelite/provision_statelite.rst @@ -0,0 +1,257 @@ +Provision statelite +=================== + +Show current provisioning method +-------------------------------- + +To determine the current provisioning method of your node, execute: :: + + lsdef -i provmethod + +``Note``: syncfiles is not currently supported for statelite nodes. + +Generate default statelite image from distoro media +--------------------------------------------------- + +In this example, we are going to create a new compute node osimage for ``rhels7.3`` on ``ppc64le``. We will set up a test directory structure that we can use to create our image. Later we can just move that into production. + +Use the copycds command to copy the appropriate iso image into the ``/install`` directory for xCAT. The copycds commands will copy the contents to ``/install/rhels7.3/``. For example: :: + + copycds RHEL-7.3-20161019.0-Server-ppc64le-dvd1.iso + +The contents are copied into ``/install/rhels7.3/ppc64le/`` + +The configuration files pointed to by the attributes are the defaults shipped with xCAT. We will want to copy them to the ``/install`` directory, in our example the ``/install/test`` directory and modify them as needed. + +Statelite Directory Structure +----------------------------- + +Each statelite image will have the following directories: :: + + /.statelite/tmpfs/ + /.default/ + /etc/init.d/statelite + +All files with link options, which are symbolic links, will link to ``/.statelite/tmpfs``. + +tmpfs files that are persistent link to ``/.statelite/persistent//``, ``/.statelite/persistent/`` is the directory where the node's individual storage will be mounted to. + +``/.default`` is where default files will be copied to from the image to tmpfs if the files are not found in the litetree hierarchy. + +Customize your statelite osimage +-------------------------------- + +Create the osimage definition +````````````````````````````` + +Setup your osimage/linuximage tables with new test image name, osvers,osarch, and paths to all the files for building and installing the node. So using the above generated ``rhels7.3-ppc64le-statelite-compute`` as an example, I am going to create my own image. The value for the provisioning method attribute is osimage in my example.:: + + mkdef rhels7.3-custom-statelite -u profile=compute provmethod=statelite + +Check your setup: :: + + lsdef -t osimage rhels7.3-custom-statelite + +Customize the paths to your ``pkglist``, ``syncfile``, etc to the osimage definition, that you require. ``Note``, if you modify the files on the ``/opt/xcat/share/...`` path then copy to the appropriate ``/install/custom/...`` path. Remember all files must be under ``/install`` if using hierarchy (service nodes). + +Copy the sample ``*list`` files and modify as needed: :: + + mkdir -p /install/test/netboot/rh + cp -p /opt/xcat/share/xcat/netboot/rh/compute.rhels7.ppc64le.pkglist \ + /install/test/netboot/rh/compute.rhels7.ppc64le.pkglist + cp -p /opt/xcat/share/xcat/netboot/rh/compute.exlist \ + /install/test/netboot/rh/compute.exlist + + chdef -t osimage -o rhels7.3-custom-statelite \ + pkgdir=/install/rhels7.3/ppc64le \ + pkglist=/install/test/netboot/rh/compute.rhels7.ppc64le.pkglist \ + exlist=/install/test/netboot/rh/compute.exlist \ + rootimgdir=/install/test/netboot/rh/ppc64le/compute + +Setup pkglists +`````````````` + +In the above example, you have defined your pkglist to be in ``/install/test/netboot/rh/compute.rhels7.ppc64le.pkglist``. + +Edit ``compute.rhels7.ppc64le.pkglist`` and ``compute.exlist`` as needed. :: + + vi /install/test/netboot/rh/compute.rhels7.ppc64le.pkglist + vi /install/test/netboot/rh/compute.exlist + +Make sure nothing is excluded in compute.exlist that you need. + +Install other specific packages +``````````````````````````````` + +Make the directory to hold additional rpms to install on the compute node. :: + + mkdir -p /install/test/post/otherpkgs/rh/ppc64le + +Now copy all the additional OS rpms you want to install into ``/install/test/post/otherpkgs/rh/ppc64le``. + +At first you need to create one text file which contains the complete list of files to include in the repository. The name of the text file is rpms.list and must be in ``/install/test/post/otherpkgs/rh/ppc64le`` directory. Create rpms.list: :: + + cd /install/test/post/otherpkgs/rh/ppc64le + ls *.rpm > rpms.list + +Then, run the following command to create the repodata for the newly-added packages: :: + + createrepo -i rpms.list /install/test/post/otherpkgs/rh/ppc64le + +The ``createrepo`` command with -i rpms.list option will create the repository for the rpm packages listed in the rpms.list file. It won't destroy or affect the rpm packages that are in the same directory, but have been included into another repository. + +Or, if you create a sub-directory to contain the rpm packages, for example, named other in ``/install/test/post/otherpkgs/rh/ppc64le``. Run the following command to create repodata for the directory ``/install/test/post/otherpkgs/rh/ppc64le``. :: + + createrepo /install/post/otherpkgs///**other** + +``Note``: Replace other with your real directory name. + +Define the location of of your otherpkgs in your osimage: :: + + chdef -t osimage -o rhels7.3-custom-statelite \ + otherpkgdir=/install/test/post/otherpkgs/rh/ppc64le \ + otherpkglist=/install/test/netboot/rh/compute.otherpkgs.pkglist + +There are examples under ``/opt/xcat/share/xcat/netboot/`` of typical ``*otherpkgs.pkglist`` files that can used as an example of the format. + +Set up Post scripts for statelite +````````````````````````````````` + +The rules to create post install scripts for statelite image is the same as the rules for stateless/diskless install images. + +There're two kinds of postscripts for statelite (also for stateless/diskless). + +The first kind of postscript is executed at genimage time, it is executed again the image itself on the MN . It was setup in The postinstall file section before the image was generated. + +The second kind of postscript is the script that runs on the node during node deployment time. During init.d timeframe, ``/etc/init.d/gettyset`` calls ``/opt/xcat/xcatdsklspost`` that is in the image. This script uses wget to get all the postscripts under ``mn:/install/postscripts`` and copy them to the ``/xcatpost`` directory on the node. It uses openssl or stunnel to connect to the xcatd on the mn to get all the postscript names for the node from the postscripts table. It then runs the postscripts for the node. + +Setting up postinstall files (optional) +``````````````````````````````````````` + +Using postinstall files is optional. There are some examples shipped in ``/opt/xcat/share/xcat/netboot/``. + +If you define a postinstall file to be used by genimage, then :: + + chdef -t osimage -o rhels7.3-custom-statelite postinstall=. + +Generate the image +------------------ + +Run the following command to generate the image based on your osimage named ``rhels7.3-custom-statelite``. Adjust your genimage parameters to your architecture and network settings. See man genimage. :: + + genimage rhels7.3-custom-statelite + +The genimage will create a default ``/etc/fstab`` in the image, if you want to change the defaults, on the management node, edit fstab in the image: :: + + cd /install/netboot/rhels7/ppc64le/compute/rootimg/etc + cp fstab fstab.ORIG + vi fstab + +``Note``: adding ``/tmp`` and ``/var/tmp`` to ``/etc/fstab`` is optional, most installations can simply use ``/``. It was documented her to show that you can restrict the size of filesystems, if you need to. The indicated values are just and example, and you may need much bigger filessystems, if running applications like OpenMPI. + +Pack the image +-------------- + +Execute liteimg :: + + liteimg rhels7.3-custom-statelite + +Boot the statelite node +----------------------- + +Execute ``rinstall`` :: + + rinstall node1 osimage=rhels7.3-custom-statelite + +Switch to the RAMdisk based solution +------------------------------------ + +It is optional, if you want to use RAMdisk-based solution, follow this section. + +Set rootfstype +`````````````` + +If you want the node to boot with a RAMdisk-based image instead of the NFS-base image, set the rootfstype attribute for the osimage to ``ramdisk``. For example: :: + + chdef -t osimage -o rhels7.3-custom-statelite rootfstype=ramdisk + +Run liteimg command +``````````````````` + +The ``liteimg`` command will modify your statelite image (the image that ``genimage`` just created) by creating a series of links. Once you are satisfied with your image contains what you want it to, run ``liteimg ``: :: + + liteimg rhels7.3-custom-statelite + +For files with link options, the ``liteimg`` command creates two levels of indirection, so that files can be modified while in their image state as well as during runtime. For example, a file like ``$imageroot/etc/ntp.conf`` with link option in the litefile table, will have the following operations done to it: + +In our case ``$imageroot`` is ``/install/netboot/rhels5.3/x86_64/compute/rootimg`` + +The ``liteimg`` script, for example, does the following to create the two levels of indirection. :: + + mkdir -p $imageroot/.default/etc + mkdir -p $imageroot/.statelite/tmpfs/etc + mv $imgroot/etc/ntp.conf $imgroot/.default/etc + cd $imgroot/.statelite/tmpfs/etc + ln -sf ../../../.default/etc/ntp.conf . + cd $imgroot/etc + ln -sf ../.statelite/tmpfs/etc/ntp.conf . + +When finished, the original file will reside in ``$imgroot/.default/etc/ntp.conf``. ``$imgroot/etc/ntp.conf`` will link to ``$imgroot/.statelite/tmpfs/etc/ntp.conf`` which will in turn link to ``$imgroot/.default/etc/ntp.conf``. + +But for files without link options, the ``liteimg`` command only creates clones in ``$imageroot/.default/`` directory, when the node is booting up, the mount command with ``--bind`` option will get the corresponding files from the ``litetree`` places or ``.default`` directory to the sysroot directory. + +``Note``: If you make any changes to your litefile table after running ``liteimg`` then you will need to rerun ``liteimg`` again. This is because files and directories need to have the two levels of redirects created. + +Boot the statelite node +``````````````````````` + +Make sure you have set up all the attributes in your node definitions correctly following the node installation instructions corresponding to your hardware: + +You can now deploy the node by running the following commmands: :: + + rinstall + +You can then use ``rcons`` or ``wcons`` to watch the node boot up. + +Adding/updating software and files for the running nodes +-------------------------------------------------------- + +Make changes to the files which configured in the litefile table +```````````````````````````````````````````````````````````````` + +During the preparation or booting of node against statelite mode, there are specific processes to handle the files which configured in the litefile table. The following operations need to be done after made changes to the statelite files. + +#. Run ``liteimg`` against the osimage and reboot the node : Added, removed or changed the entries in the litefile table. + +#. Reboot the node : + + * Changed the location directory in the litetree table. + * Changed the location directory in the statelite table. + * Changed, removed the original files in the location of litetree or statelite table. + +``Note``: Thing should not do: + + * When there are node running on the nfs-based statelite osimage, do not run the packimage against this osimage. + +Make changes to the common files +```````````````````````````````` + +Because most of system files for the nodes are NFS mounted on the Management Node with read-only option, installing or updating software and files should be done to the image. The image is located under ``/install/netboot////rootimg`` directory. + +To install or update an rpm, do the following: + + * Install the rpm package into rootimg :: + + rpm --root /install/netboot////rootimg -ivh rpm_name + + * Restart the software application on the nodes :: + + xdsh + +It is recommended to follow the section (Adding third party softeware) to add the new rpm to the otherpkgs.pkglist file, so that the rpm will get installed into the new image next time the image is rebuilt. + +``Note``: The newly added rpms are not shown when running ``rpm -qa`` on the nodes although the rpm is installed. It will shown next time the node is rebooted. + +To create or update a file for the nodes, just modify the file in the image and restart any application that uses the file. + +For the ramdisk-based node, you need to reboot the node to take the changes. diff --git a/docs/source/guides/admin-guides/references/man1/pping.1.rst b/docs/source/guides/admin-guides/references/man1/pping.1.rst index 3d0763566..92e680380 100644 --- a/docs/source/guides/admin-guides/references/man1/pping.1.rst +++ b/docs/source/guides/admin-guides/references/man1/pping.1.rst @@ -25,7 +25,7 @@ DESCRIPTION \ **pping**\ is a utility used to ping a list of nodes in parallel. \ **pping**\ will return an unsorted list of nodes with a ping or noping status. -\ **pping**\ front-ends nmap or fping if available. +\ **pping**\ front-ends \ **nmap**\ or \ **fping**\ if available. This command does not support the xcatd client/server communication. It must be run on the management node. @@ -48,7 +48,7 @@ OPTIONS \ **-f | -**\ **-use_fping**\ - Use fping instead of nmap + Use \ **fping**\ instead of \ **nmap**\ diff --git a/docs/source/guides/admin-guides/references/man1/prsync.1.rst b/docs/source/guides/admin-guides/references/man1/prsync.1.rst index 352f4db03..7bee4871f 100644 --- a/docs/source/guides/admin-guides/references/man1/prsync.1.rst +++ b/docs/source/guides/admin-guides/references/man1/prsync.1.rst @@ -21,7 +21,7 @@ prsync - parallel rsync \ **prsync**\ \ *filename*\ [\ *filename*\ \ *...*\ ] \ *noderange:destinationdirectory*\ -\ **prsync**\ [\ **-o**\ \ *rsync options*\ ] [\ **-f**\ \ *fanout*\ ] [\ *filename*\ \ *filename*\ \ *...*\ ] [\ *directory*\ \ *directory*\ \ *...*\ ] +\ **prsync**\ [\ **-o**\ \ *rsyncopts*\ ] [\ **-f**\ \ *fanout*\ ] [\ *filename*\ \ *filename*\ \ *...*\ ] [\ *directory*\ \ *directory*\ \ *...*\ ] \ *noderange:destinationdirectory*\ \ **prsync**\ {\ **-h | -**\ **-help | -v | -**\ **-version**\ } @@ -32,11 +32,9 @@ prsync - parallel rsync ******************* -\ **prsync**\ is a front-end to rsync for a single or range of nodes and/or -groups in parallel. +\ **prsync**\ is a front-end to rsync for a single or range of nodes and/or groups in parallel. -Note: this command does not support the xcatd client/server communication and therefore must be run on the management node. It does not support hierarchy, use xdcp -F to run rsync from the -management node to the compute node via a service node +Note: this command does not support the xcatd client/server communication and therefore must be run on the management node. It does not support hierarchy, use \ **xdcp -F**\ to run rsync from the management node to the compute node via a service node \ **prsync**\ is NOT multicast, but is parallel unicasts. @@ -47,7 +45,7 @@ management node to the compute node via a service node -\ *rsyncopts*\ +\ **-o**\ \ *rsyncopts*\ rsync options. See \ **rsync(1)**\ . @@ -55,8 +53,7 @@ management node to the compute node via a service node \ **-f**\ \ *fanout*\ - Specifies a fanout value for the maximum number of concur- - rently executing remote shell processes. + Specifies a fanout value for the maximum number of concurrently executing remote shell processes. diff --git a/docs/source/guides/admin-guides/references/man1/rinv.1.rst b/docs/source/guides/admin-guides/references/man1/rinv.1.rst index cb7675e8d..bc796df6a 100644 --- a/docs/source/guides/admin-guides/references/man1/rinv.1.rst +++ b/docs/source/guides/admin-guides/references/man1/rinv.1.rst @@ -25,7 +25,7 @@ BMC/MPA specific: ================= -\ **rinv**\ \ *noderange*\ {\ **pci | model | serial | asset | vpd | mprom | deviceid | guid | firm | diag | bios | mparom | mac | all**\ } +\ **rinv**\ \ *noderange*\ {\ **pci | model | serial | asset | vpd | mprom | deviceid | guid | firm | diag | dimm | bios | mparom | mac | all**\ } OpenPOWER server specific: @@ -65,6 +65,13 @@ VMware specific: \ **rinv**\ \ *noderange*\ [\ **-t**\ ] +pdu specific: +============= + + +\ **rinv**\ \ *noderange*\ + + zVM specific: ============= diff --git a/docs/source/guides/admin-guides/references/man1/rpower.1.rst b/docs/source/guides/admin-guides/references/man1/rpower.1.rst index 86239842f..9eda41449 100644 --- a/docs/source/guides/admin-guides/references/man1/rpower.1.rst +++ b/docs/source/guides/admin-guides/references/man1/rpower.1.rst @@ -29,6 +29,8 @@ BMC (using IPMI) specific: \ **rpower**\ \ *noderange*\ [\ **on | off | softoff | reset | boot | stat | state | status | wake | suspend**\ [\ **-w**\ \ *timeout*\ ] [\ **-o**\ ] [\ **-r**\ ]] +\ **rpower**\ \ *noderange*\ [\ **pduon | pduoff | pdustat**\ ] + PPC (with IVM or HMC) specific: =============================== @@ -102,6 +104,13 @@ docker specific: \ **rpower**\ \ *noderange*\ [\ **start | stop | restart | pause | unpause | state**\ ] +pdu specific: +============= + + +\ **rpower**\ \ *noderange*\ [\ **stat | off | on**\ ] + + *********** DESCRIPTION diff --git a/docs/source/guides/admin-guides/references/man1/rvitals.1.rst b/docs/source/guides/admin-guides/references/man1/rvitals.1.rst index 74cb1bc39..55d29d53b 100644 --- a/docs/source/guides/admin-guides/references/man1/rvitals.1.rst +++ b/docs/source/guides/admin-guides/references/man1/rvitals.1.rst @@ -142,14 +142,16 @@ Processor for a single or range of nodes and groups. \ **powertime**\ Retrieves total power uptime. This value only increases, unless - the Service Processor flash gets updated. + the Service Processor flash gets updated. This option is not valid + for x86 architecture systems. \ **reboot**\ Retrieves total number of reboots. This value only increases, - unless the Service Processor flash gets updated. + unless the Service Processor flash gets updated. This option + is not valid for x86 architecture systems. diff --git a/docs/source/guides/admin-guides/references/man1/xdsh.1.rst b/docs/source/guides/admin-guides/references/man1/xdsh.1.rst index fb84e802b..51f71f74d 100644 --- a/docs/source/guides/admin-guides/references/man1/xdsh.1.rst +++ b/docs/source/guides/admin-guides/references/man1/xdsh.1.rst @@ -527,8 +527,7 @@ running commands, are terminated (SIGTERM). \ **DSH_TIMEOUT**\ Specifies the time, in seconds, to wait for output from - each remote target. This variable is overridden by the \ **-t**\ - flag. + each remote target. This variable is overridden by the \ **-t**\ flag. diff --git a/docs/source/guides/admin-guides/references/man1/xdshbak.1.rst b/docs/source/guides/admin-guides/references/man1/xdshbak.1.rst index 91326fd13..aa9e3a74e 100644 --- a/docs/source/guides/admin-guides/references/man1/xdshbak.1.rst +++ b/docs/source/guides/admin-guides/references/man1/xdshbak.1.rst @@ -19,7 +19,7 @@ NAME **************** -\ **xdshbak**\ [\ **-c**\ | \ **-x**\ | \ **-h**\ | \ **-q**\ ] +\ **xdshbak**\ [\ **-c**\ | \ **-x**\ [ \ **-b**\ ] | \ **-h**\ | \ **-q**\ ] *********** @@ -93,6 +93,9 @@ the output by hostname for easier viewing: . +If the \ **-b**\ flag is specified in addition to \ **-x**\ , the hostname at the beginning +of each line is stripped. + Standard Error ============== @@ -109,6 +112,13 @@ OPTIONS +\ **-b**\ + + Strip the host prefix from the beginning of the lines. This only + works with the \ **-x**\ option. + + + \ **-c**\ If the output from multiple nodes is identical it will be collapsed diff --git a/docs/source/guides/admin-guides/references/man5/pdu.5.rst b/docs/source/guides/admin-guides/references/man5/pdu.5.rst new file mode 100644 index 000000000..a77ea0b32 --- /dev/null +++ b/docs/source/guides/admin-guides/references/man5/pdu.5.rst @@ -0,0 +1,82 @@ + +##### +pdu.5 +##### + +.. highlight:: perl + + +**** +NAME +**** + + +\ **pdu**\ - a table in the xCAT database. + + +******** +SYNOPSIS +******** + + +\ **pdu Attributes:**\ \ *pdu*\ , \ *machinetype*\ , \ *modelnum*\ , \ *serialnum*\ , \ *outletCount*\ , \ *comments*\ , \ *disable*\ + + +*********** +DESCRIPTION +*********** + + +Parameters to use when interrogating pdus + + +*************** +pdu Attributes: +*************** + + + +\ **pdu**\ + + The hostname/address of the pdu to which the settings apply + + + +\ **machinetype**\ + + The pdu machine type + + + +\ **modelnum**\ + + The pdu model number + + + +\ **serialnum**\ + + The pdu serial number + + + +\ **outletCount**\ + + + +\ **comments**\ + + + +\ **disable**\ + + + + +******** +SEE ALSO +******** + + +\ **nodels(1)**\ , \ **chtab(8)**\ , \ **tabdump(8)**\ , \ **tabedit(8)**\ + diff --git a/docs/source/guides/admin-guides/references/man5/pduoutlet.5.rst b/docs/source/guides/admin-guides/references/man5/pduoutlet.5.rst new file mode 100644 index 000000000..cbed931c1 --- /dev/null +++ b/docs/source/guides/admin-guides/references/man5/pduoutlet.5.rst @@ -0,0 +1,70 @@ + +########### +pduoutlet.5 +########### + +.. highlight:: perl + + +**** +NAME +**** + + +\ **pduoutlet**\ - a table in the xCAT database. + + +******** +SYNOPSIS +******** + + +\ **pduoutlet Attributes:**\ \ *node*\ , \ *pdu*\ , \ *comments*\ , \ *disable*\ + + +*********** +DESCRIPTION +*********** + + +Contains list of outlet numbers on the pdu each node is connected to. + + +********************* +pduoutlet Attributes: +********************* + + + +\ **node**\ + + The node name or group name. + + + +\ **pdu**\ + + a comma-separated list of outlet number for each PDU, ex: pdu1:outlet1,pdu2:outlet1 + + + +\ **comments**\ + + Any user-written notes. + + + +\ **disable**\ + + Set to 'yes' or '1' to comment out this row. + + + + +******** +SEE ALSO +******** + + +\ **nodels(1)**\ , \ **chtab(8)**\ , \ **tabdump(8)**\ , \ **tabedit(8)**\ + diff --git a/docs/source/guides/admin-guides/references/man5/xcatdb.5.rst b/docs/source/guides/admin-guides/references/man5/xcatdb.5.rst index 2e15caff4..e95ece5c8 100644 --- a/docs/source/guides/admin-guides/references/man5/xcatdb.5.rst +++ b/docs/source/guides/admin-guides/references/man5/xcatdb.5.rst @@ -585,6 +585,18 @@ passwd(5)|passwd.5 +pdu(5)|pdu.5 + + Parameters to use when interrogating pdus + + + +pduoutlet(5)|pduoutlet.5 + + Contains list of outlet numbers on the pdu each node is connected to. + + + performance(5)|performance.5 Describes the system performance every interval unit of time. diff --git a/docs/source/guides/admin-guides/references/man7/group.7.rst b/docs/source/guides/admin-guides/references/man7/group.7.rst index 36f2c82b3..4a9954df5 100644 --- a/docs/source/guides/admin-guides/references/man7/group.7.rst +++ b/docs/source/guides/admin-guides/references/man7/group.7.rst @@ -19,7 +19,7 @@ SYNOPSIS ******** -\ **group Attributes:**\ \ *addkcmdline*\ , \ *arch*\ , \ *authdomain*\ , \ *bmc*\ , \ *bmcpassword*\ , \ *bmcport*\ , \ *bmcusername*\ , \ *bmcvlantag*\ , \ *cfgmgr*\ , \ *cfgmgtroles*\ , \ *cfgserver*\ , \ *chain*\ , \ *chassis*\ , \ *cmdmapping*\ , \ *cons*\ , \ *conserver*\ , \ *consoleondemand*\ , \ *cpucount*\ , \ *cputype*\ , \ *currchain*\ , \ *currstate*\ , \ *dhcpinterfaces*\ , \ *disksize*\ , \ *displayname*\ , \ *dockercpus*\ , \ *dockerflag*\ , \ *dockerhost*\ , \ *dockermemory*\ , \ *dockernics*\ , \ *domainadminpassword*\ , \ *domainadminuser*\ , \ *domaintype*\ , \ *getmac*\ , \ *groupname*\ , \ *grouptype*\ , \ *hcp*\ , \ *height*\ , \ *hostcluster*\ , \ *hostinterface*\ , \ *hostmanager*\ , \ *hostnames*\ , \ *hosttype*\ , \ *hwtype*\ , \ *id*\ , \ *initrd*\ , \ *installnic*\ , \ *interface*\ , \ *ip*\ , \ *iscsipassword*\ , \ *iscsiserver*\ , \ *iscsitarget*\ , \ *iscsiuserid*\ , \ *kcmdline*\ , \ *kernel*\ , \ *linkports*\ , \ *mac*\ , \ *membergroups*\ , \ *members*\ , \ *memory*\ , \ *mgt*\ , \ *micbridge*\ , \ *michost*\ , \ *micid*\ , \ *miconboot*\ , \ *micpowermgt*\ , \ *micvlog*\ , \ *migrationdest*\ , \ *monserver*\ , \ *mpa*\ , \ *mtm*\ , \ *nameservers*\ , \ *netboot*\ , \ *nfsdir*\ , \ *nfsserver*\ , \ *nicaliases*\ , \ *niccustomscripts*\ , \ *nicdevices*\ , \ *nicextraparams*\ , \ *nichostnameprefixes*\ , \ *nichostnamesuffixes*\ , \ *nicips*\ , \ *nicnetworks*\ , \ *nicsadapter*\ , \ *nictypes*\ , \ *nimserver*\ , \ *nodetype*\ , \ *ondiscover*\ , \ *os*\ , \ *osvolume*\ , \ *otherinterfaces*\ , \ *ou*\ , \ *parent*\ , \ *passwd.HMC*\ , \ *passwd.admin*\ , \ *passwd.celogin*\ , \ *passwd.general*\ , \ *passwd.hscroot*\ , \ *password*\ , \ *postbootscripts*\ , \ *postscripts*\ , \ *power*\ , \ *pprofile*\ , \ *prescripts-begin*\ , \ *prescripts-end*\ , \ *primarynic*\ , \ *productkey*\ , \ *profile*\ , \ *protocol*\ , \ *provmethod*\ , \ *rack*\ , \ *room*\ , \ *routenames*\ , \ *serial*\ , \ *serialflow*\ , \ *serialport*\ , \ *serialspeed*\ , \ *servicenode*\ , \ *setupconserver*\ , \ *setupdhcp*\ , \ *setupftp*\ , \ *setupipforward*\ , \ *setupldap*\ , \ *setupnameserver*\ , \ *setupnfs*\ , \ *setupnim*\ , \ *setupntp*\ , \ *setupproxydhcp*\ , \ *setuptftp*\ , \ *sfp*\ , \ *side*\ , \ *slot*\ , \ *slotid*\ , \ *slots*\ , \ *snmpauth*\ , \ *snmppassword*\ , \ *snmpprivacy*\ , \ *snmpusername*\ , \ *snmpversion*\ , \ *storagcontroller*\ , \ *storagetype*\ , \ *supernode*\ , \ *supportedarchs*\ , \ *supportproxydhcp*\ , \ *switch*\ , \ *switchinterface*\ , \ *switchport*\ , \ *switchtype*\ , \ *switchvlan*\ , \ *syslog*\ , \ *termport*\ , \ *termserver*\ , \ *tftpdir*\ , \ *tftpserver*\ , \ *unit*\ , \ *urlpath*\ , \ *usercomment*\ , \ *userid*\ , \ *username*\ , \ *vmbeacon*\ , \ *vmbootorder*\ , \ *vmcfgstore*\ , \ *vmcluster*\ , \ *vmcpus*\ , \ *vmhost*\ , \ *vmmanager*\ , \ *vmmaster*\ , \ *vmmemory*\ , \ *vmnicnicmodel*\ , \ *vmnics*\ , \ *vmothersetting*\ , \ *vmphyslots*\ , \ *vmstorage*\ , \ *vmstoragecache*\ , \ *vmstorageformat*\ , \ *vmstoragemodel*\ , \ *vmtextconsole*\ , \ *vmvirtflags*\ , \ *vmvncport*\ , \ *webport*\ , \ *wherevals*\ , \ *xcatmaster*\ +\ **group Attributes:**\ \ *addkcmdline*\ , \ *arch*\ , \ *authdomain*\ , \ *bmc*\ , \ *bmcpassword*\ , \ *bmcport*\ , \ *bmcusername*\ , \ *bmcvlantag*\ , \ *cfgmgr*\ , \ *cfgmgtroles*\ , \ *cfgserver*\ , \ *chain*\ , \ *chassis*\ , \ *cmdmapping*\ , \ *cons*\ , \ *conserver*\ , \ *consoleondemand*\ , \ *cpucount*\ , \ *cputype*\ , \ *currchain*\ , \ *currstate*\ , \ *dhcpinterfaces*\ , \ *disksize*\ , \ *displayname*\ , \ *dockercpus*\ , \ *dockerflag*\ , \ *dockerhost*\ , \ *dockermemory*\ , \ *dockernics*\ , \ *domainadminpassword*\ , \ *domainadminuser*\ , \ *domaintype*\ , \ *getmac*\ , \ *groupname*\ , \ *grouptype*\ , \ *hcp*\ , \ *height*\ , \ *hostcluster*\ , \ *hostinterface*\ , \ *hostmanager*\ , \ *hostnames*\ , \ *hosttype*\ , \ *hwtype*\ , \ *id*\ , \ *initrd*\ , \ *installnic*\ , \ *interface*\ , \ *ip*\ , \ *iscsipassword*\ , \ *iscsiserver*\ , \ *iscsitarget*\ , \ *iscsiuserid*\ , \ *kcmdline*\ , \ *kernel*\ , \ *linkports*\ , \ *mac*\ , \ *machinetype*\ , \ *membergroups*\ , \ *members*\ , \ *memory*\ , \ *mgt*\ , \ *micbridge*\ , \ *michost*\ , \ *micid*\ , \ *miconboot*\ , \ *micpowermgt*\ , \ *micvlog*\ , \ *migrationdest*\ , \ *modelnum*\ , \ *monserver*\ , \ *mpa*\ , \ *mtm*\ , \ *nameservers*\ , \ *netboot*\ , \ *nfsdir*\ , \ *nfsserver*\ , \ *nicaliases*\ , \ *niccustomscripts*\ , \ *nicdevices*\ , \ *nicextraparams*\ , \ *nichostnameprefixes*\ , \ *nichostnamesuffixes*\ , \ *nicips*\ , \ *nicnetworks*\ , \ *nicsadapter*\ , \ *nictypes*\ , \ *nimserver*\ , \ *nodetype*\ , \ *ondiscover*\ , \ *os*\ , \ *osvolume*\ , \ *otherinterfaces*\ , \ *ou*\ , \ *outletcount*\ , \ *parent*\ , \ *passwd.HMC*\ , \ *passwd.admin*\ , \ *passwd.celogin*\ , \ *passwd.general*\ , \ *passwd.hscroot*\ , \ *password*\ , \ *pdu*\ , \ *postbootscripts*\ , \ *postscripts*\ , \ *power*\ , \ *pprofile*\ , \ *prescripts-begin*\ , \ *prescripts-end*\ , \ *primarynic*\ , \ *productkey*\ , \ *profile*\ , \ *protocol*\ , \ *provmethod*\ , \ *rack*\ , \ *room*\ , \ *routenames*\ , \ *serial*\ , \ *serialflow*\ , \ *serialnum*\ , \ *serialport*\ , \ *serialspeed*\ , \ *servicenode*\ , \ *setupconserver*\ , \ *setupdhcp*\ , \ *setupftp*\ , \ *setupipforward*\ , \ *setupldap*\ , \ *setupnameserver*\ , \ *setupnfs*\ , \ *setupnim*\ , \ *setupntp*\ , \ *setupproxydhcp*\ , \ *setuptftp*\ , \ *sfp*\ , \ *side*\ , \ *slot*\ , \ *slotid*\ , \ *slots*\ , \ *snmpauth*\ , \ *snmppassword*\ , \ *snmpprivacy*\ , \ *snmpusername*\ , \ *snmpversion*\ , \ *storagcontroller*\ , \ *storagetype*\ , \ *supernode*\ , \ *supportedarchs*\ , \ *supportproxydhcp*\ , \ *switch*\ , \ *switchinterface*\ , \ *switchport*\ , \ *switchtype*\ , \ *switchvlan*\ , \ *syslog*\ , \ *termport*\ , \ *termserver*\ , \ *tftpdir*\ , \ *tftpserver*\ , \ *unit*\ , \ *urlpath*\ , \ *usercomment*\ , \ *userid*\ , \ *username*\ , \ *vmbeacon*\ , \ *vmbootorder*\ , \ *vmcfgstore*\ , \ *vmcluster*\ , \ *vmcpus*\ , \ *vmhost*\ , \ *vmmanager*\ , \ *vmmaster*\ , \ *vmmemory*\ , \ *vmnicnicmodel*\ , \ *vmnics*\ , \ *vmothersetting*\ , \ *vmphyslots*\ , \ *vmstorage*\ , \ *vmstoragecache*\ , \ *vmstorageformat*\ , \ *vmstoragemodel*\ , \ *vmtextconsole*\ , \ *vmvirtflags*\ , \ *vmvncport*\ , \ *webport*\ , \ *wherevals*\ , \ *xcatmaster*\ *********** @@ -435,6 +435,12 @@ group Attributes: +\ **machinetype**\ (pdu.machinetype) + + The pdu machine type + + + \ **membergroups**\ (nodegroup.membergroups) This attribute stores a comma-separated list of nodegroups that this nodegroup refers to. This attribute is only used by PCM. @@ -501,6 +507,12 @@ group Attributes: +\ **modelnum**\ (pdu.modelnum) + + The pdu model number + + + \ **monserver**\ (noderes.monserver) The monitoring aggregation point for this node. The format is "x,y" where x is the ip address as known by the management node and y is the ip address as known by the node. @@ -695,6 +707,12 @@ group Attributes: +\ **outletcount**\ (pdu.outletcount) + + The pdu outlet count + + + \ **parent**\ (ppc.parent) For LPARs: the CEC; for FSPs: the CEC; for CEC: the frame (if one exists); for BPA: the frame; for frame: the building block number (which consists 1 or more service nodes and compute/storage nodes that are serviced by them - optional). @@ -749,6 +767,12 @@ group Attributes: +\ **pdu**\ (pduoutlet.pdu) + + a comma-separated list of outlet number for each PDU, ex: pdu1:outlet1,pdu2:outlet1 + + + \ **postbootscripts**\ (postscripts.postbootscripts) Comma separated list of scripts that should be run on this node after diskful installation or diskless boot. Each script can take zero or more parameters. For example: "script1 p1 p2,script2,...". On AIX these scripts are run during the processing of /etc/inittab. On Linux they are run at the init.d time. xCAT automatically adds the scripts in the xcatdefaults.postbootscripts attribute to run first in the list. @@ -866,6 +890,12 @@ group Attributes: +\ **serialnum**\ (pdu.serialnum) + + The pdu serial number + + + \ **serialport**\ (nodehm.serialport) The serial port for this node, in the linux numbering style (0=COM1/ttyS0, 1=COM2/ttyS1). For SOL on IBM blades, this is typically 1. For rackmount IBM servers, this is typically 0. diff --git a/docs/source/guides/admin-guides/references/man7/node.7.rst b/docs/source/guides/admin-guides/references/man7/node.7.rst index e430a5316..b06375b96 100644 --- a/docs/source/guides/admin-guides/references/man7/node.7.rst +++ b/docs/source/guides/admin-guides/references/man7/node.7.rst @@ -19,7 +19,7 @@ SYNOPSIS ******** -\ **node Attributes:**\ \ *addkcmdline*\ , \ *appstatus*\ , \ *appstatustime*\ , \ *arch*\ , \ *authdomain*\ , \ *bmc*\ , \ *bmcpassword*\ , \ *bmcport*\ , \ *bmcusername*\ , \ *bmcvlantag*\ , \ *cfgmgr*\ , \ *cfgmgtroles*\ , \ *cfgserver*\ , \ *chain*\ , \ *chassis*\ , \ *cmdmapping*\ , \ *cons*\ , \ *conserver*\ , \ *consoleondemand*\ , \ *cpucount*\ , \ *cputype*\ , \ *currchain*\ , \ *currstate*\ , \ *dhcpinterfaces*\ , \ *disksize*\ , \ *displayname*\ , \ *dockercpus*\ , \ *dockerflag*\ , \ *dockerhost*\ , \ *dockermemory*\ , \ *dockernics*\ , \ *domainadminpassword*\ , \ *domainadminuser*\ , \ *domaintype*\ , \ *getmac*\ , \ *groups*\ , \ *hcp*\ , \ *height*\ , \ *hidden*\ , \ *hostcluster*\ , \ *hostinterface*\ , \ *hostmanager*\ , \ *hostnames*\ , \ *hosttype*\ , \ *hwtype*\ , \ *id*\ , \ *initrd*\ , \ *installnic*\ , \ *interface*\ , \ *ip*\ , \ *iscsipassword*\ , \ *iscsiserver*\ , \ *iscsitarget*\ , \ *iscsiuserid*\ , \ *kcmdline*\ , \ *kernel*\ , \ *linkports*\ , \ *mac*\ , \ *memory*\ , \ *mgt*\ , \ *micbridge*\ , \ *michost*\ , \ *micid*\ , \ *miconboot*\ , \ *micpowermgt*\ , \ *micvlog*\ , \ *migrationdest*\ , \ *monserver*\ , \ *mpa*\ , \ *mtm*\ , \ *nameservers*\ , \ *netboot*\ , \ *nfsdir*\ , \ *nfsserver*\ , \ *nicaliases*\ , \ *niccustomscripts*\ , \ *nicdevices*\ , \ *nicextraparams*\ , \ *nichostnameprefixes*\ , \ *nichostnamesuffixes*\ , \ *nicips*\ , \ *nicnetworks*\ , \ *nicsadapter*\ , \ *nictypes*\ , \ *nimserver*\ , \ *node*\ , \ *nodetype*\ , \ *ondiscover*\ , \ *os*\ , \ *osvolume*\ , \ *otherinterfaces*\ , \ *ou*\ , \ *parent*\ , \ *passwd.HMC*\ , \ *passwd.admin*\ , \ *passwd.celogin*\ , \ *passwd.general*\ , \ *passwd.hscroot*\ , \ *password*\ , \ *postbootscripts*\ , \ *postscripts*\ , \ *power*\ , \ *pprofile*\ , \ *prescripts-begin*\ , \ *prescripts-end*\ , \ *primarynic*\ , \ *primarysn*\ , \ *productkey*\ , \ *profile*\ , \ *protocol*\ , \ *provmethod*\ , \ *rack*\ , \ *room*\ , \ *routenames*\ , \ *serial*\ , \ *serialflow*\ , \ *serialport*\ , \ *serialspeed*\ , \ *servicenode*\ , \ *setupconserver*\ , \ *setupdhcp*\ , \ *setupftp*\ , \ *setupipforward*\ , \ *setupldap*\ , \ *setupnameserver*\ , \ *setupnfs*\ , \ *setupnim*\ , \ *setupntp*\ , \ *setupproxydhcp*\ , \ *setuptftp*\ , \ *sfp*\ , \ *side*\ , \ *slot*\ , \ *slotid*\ , \ *slots*\ , \ *snmpauth*\ , \ *snmppassword*\ , \ *snmpprivacy*\ , \ *snmpusername*\ , \ *snmpversion*\ , \ *status*\ , \ *statustime*\ , \ *storagcontroller*\ , \ *storagetype*\ , \ *supernode*\ , \ *supportedarchs*\ , \ *supportproxydhcp*\ , \ *switch*\ , \ *switchinterface*\ , \ *switchport*\ , \ *switchtype*\ , \ *switchvlan*\ , \ *syslog*\ , \ *termport*\ , \ *termserver*\ , \ *tftpdir*\ , \ *tftpserver*\ , \ *unit*\ , \ *updatestatus*\ , \ *updatestatustime*\ , \ *urlpath*\ , \ *usercomment*\ , \ *userid*\ , \ *username*\ , \ *vmbeacon*\ , \ *vmbootorder*\ , \ *vmcfgstore*\ , \ *vmcluster*\ , \ *vmcpus*\ , \ *vmhost*\ , \ *vmmanager*\ , \ *vmmaster*\ , \ *vmmemory*\ , \ *vmnicnicmodel*\ , \ *vmnics*\ , \ *vmothersetting*\ , \ *vmphyslots*\ , \ *vmstorage*\ , \ *vmstoragecache*\ , \ *vmstorageformat*\ , \ *vmstoragemodel*\ , \ *vmtextconsole*\ , \ *vmvirtflags*\ , \ *vmvncport*\ , \ *webport*\ , \ *xcatmaster*\ , \ *zonename*\ +\ **node Attributes:**\ \ *addkcmdline*\ , \ *appstatus*\ , \ *appstatustime*\ , \ *arch*\ , \ *authdomain*\ , \ *bmc*\ , \ *bmcpassword*\ , \ *bmcport*\ , \ *bmcusername*\ , \ *bmcvlantag*\ , \ *cfgmgr*\ , \ *cfgmgtroles*\ , \ *cfgserver*\ , \ *chain*\ , \ *chassis*\ , \ *cmdmapping*\ , \ *cons*\ , \ *conserver*\ , \ *consoleondemand*\ , \ *cpucount*\ , \ *cputype*\ , \ *currchain*\ , \ *currstate*\ , \ *dhcpinterfaces*\ , \ *disksize*\ , \ *displayname*\ , \ *dockercpus*\ , \ *dockerflag*\ , \ *dockerhost*\ , \ *dockermemory*\ , \ *dockernics*\ , \ *domainadminpassword*\ , \ *domainadminuser*\ , \ *domaintype*\ , \ *getmac*\ , \ *groups*\ , \ *hcp*\ , \ *height*\ , \ *hidden*\ , \ *hostcluster*\ , \ *hostinterface*\ , \ *hostmanager*\ , \ *hostnames*\ , \ *hosttype*\ , \ *hwtype*\ , \ *id*\ , \ *initrd*\ , \ *installnic*\ , \ *interface*\ , \ *ip*\ , \ *iscsipassword*\ , \ *iscsiserver*\ , \ *iscsitarget*\ , \ *iscsiuserid*\ , \ *kcmdline*\ , \ *kernel*\ , \ *linkports*\ , \ *mac*\ , \ *machinetype*\ , \ *memory*\ , \ *mgt*\ , \ *micbridge*\ , \ *michost*\ , \ *micid*\ , \ *miconboot*\ , \ *micpowermgt*\ , \ *micvlog*\ , \ *migrationdest*\ , \ *modelnum*\ , \ *monserver*\ , \ *mpa*\ , \ *mtm*\ , \ *nameservers*\ , \ *netboot*\ , \ *nfsdir*\ , \ *nfsserver*\ , \ *nicaliases*\ , \ *niccustomscripts*\ , \ *nicdevices*\ , \ *nicextraparams*\ , \ *nichostnameprefixes*\ , \ *nichostnamesuffixes*\ , \ *nicips*\ , \ *nicnetworks*\ , \ *nicsadapter*\ , \ *nictypes*\ , \ *nimserver*\ , \ *node*\ , \ *nodetype*\ , \ *ondiscover*\ , \ *os*\ , \ *osvolume*\ , \ *otherinterfaces*\ , \ *ou*\ , \ *outletcount*\ , \ *parent*\ , \ *passwd.HMC*\ , \ *passwd.admin*\ , \ *passwd.celogin*\ , \ *passwd.general*\ , \ *passwd.hscroot*\ , \ *password*\ , \ *pdu*\ , \ *postbootscripts*\ , \ *postscripts*\ , \ *power*\ , \ *pprofile*\ , \ *prescripts-begin*\ , \ *prescripts-end*\ , \ *primarynic*\ , \ *primarysn*\ , \ *productkey*\ , \ *profile*\ , \ *protocol*\ , \ *provmethod*\ , \ *rack*\ , \ *room*\ , \ *routenames*\ , \ *serial*\ , \ *serialflow*\ , \ *serialnum*\ , \ *serialport*\ , \ *serialspeed*\ , \ *servicenode*\ , \ *setupconserver*\ , \ *setupdhcp*\ , \ *setupftp*\ , \ *setupipforward*\ , \ *setupldap*\ , \ *setupnameserver*\ , \ *setupnfs*\ , \ *setupnim*\ , \ *setupntp*\ , \ *setupproxydhcp*\ , \ *setuptftp*\ , \ *sfp*\ , \ *side*\ , \ *slot*\ , \ *slotid*\ , \ *slots*\ , \ *snmpauth*\ , \ *snmppassword*\ , \ *snmpprivacy*\ , \ *snmpusername*\ , \ *snmpversion*\ , \ *status*\ , \ *statustime*\ , \ *storagcontroller*\ , \ *storagetype*\ , \ *supernode*\ , \ *supportedarchs*\ , \ *supportproxydhcp*\ , \ *switch*\ , \ *switchinterface*\ , \ *switchport*\ , \ *switchtype*\ , \ *switchvlan*\ , \ *syslog*\ , \ *termport*\ , \ *termserver*\ , \ *tftpdir*\ , \ *tftpserver*\ , \ *unit*\ , \ *updatestatus*\ , \ *updatestatustime*\ , \ *urlpath*\ , \ *usercomment*\ , \ *userid*\ , \ *username*\ , \ *vmbeacon*\ , \ *vmbootorder*\ , \ *vmcfgstore*\ , \ *vmcluster*\ , \ *vmcpus*\ , \ *vmhost*\ , \ *vmmanager*\ , \ *vmmaster*\ , \ *vmmemory*\ , \ *vmnicnicmodel*\ , \ *vmnics*\ , \ *vmothersetting*\ , \ *vmphyslots*\ , \ *vmstorage*\ , \ *vmstoragecache*\ , \ *vmstorageformat*\ , \ *vmstoragemodel*\ , \ *vmtextconsole*\ , \ *vmvirtflags*\ , \ *vmvncport*\ , \ *webport*\ , \ *xcatmaster*\ , \ *zonename*\ *********** @@ -447,6 +447,12 @@ node Attributes: +\ **machinetype**\ (pdu.machinetype) + + The pdu machine type + + + \ **memory**\ (hwinv.memory) The size of the memory for the node in MB. @@ -501,6 +507,12 @@ node Attributes: +\ **modelnum**\ (pdu.modelnum) + + The pdu model number + + + \ **monserver**\ (noderes.monserver) The monitoring aggregation point for this node. The format is "x,y" where x is the ip address as known by the management node and y is the ip address as known by the node. @@ -701,6 +713,12 @@ node Attributes: +\ **outletcount**\ (pdu.outletcount) + + The pdu outlet count + + + \ **parent**\ (ppc.parent) For LPARs: the CEC; for FSPs: the CEC; for CEC: the frame (if one exists); for BPA: the frame; for frame: the building block number (which consists 1 or more service nodes and compute/storage nodes that are serviced by them - optional). @@ -755,6 +773,12 @@ node Attributes: +\ **pdu**\ (pduoutlet.pdu) + + a comma-separated list of outlet number for each PDU, ex: pdu1:outlet1,pdu2:outlet1 + + + \ **postbootscripts**\ (postscripts.postbootscripts) Comma separated list of scripts that should be run on this node after diskful installation or diskless boot. Each script can take zero or more parameters. For example: "script1 p1 p2,script2,...". On AIX these scripts are run during the processing of /etc/inittab. On Linux they are run at the init.d time. xCAT automatically adds the scripts in the xcatdefaults.postbootscripts attribute to run first in the list. @@ -878,6 +902,12 @@ node Attributes: +\ **serialnum**\ (pdu.serialnum) + + The pdu serial number + + + \ **serialport**\ (nodehm.serialport) The serial port for this node, in the linux numbering style (0=COM1/ttyS0, 1=COM2/ttyS1). For SOL on IBM blades, this is typically 1. For rackmount IBM servers, this is typically 0. diff --git a/docs/source/guides/admin-guides/references/man8/copycds.8.rst b/docs/source/guides/admin-guides/references/man8/copycds.8.rst index a5ba210ec..37c399113 100644 --- a/docs/source/guides/admin-guides/references/man8/copycds.8.rst +++ b/docs/source/guides/admin-guides/references/man8/copycds.8.rst @@ -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**\ ). ******* diff --git a/docs/source/guides/admin-guides/references/man8/makeconservercf.8.rst b/docs/source/guides/admin-guides/references/man8/makeconservercf.8.rst index 28221da31..19ae43ea6 100644 --- a/docs/source/guides/admin-guides/references/man8/makeconservercf.8.rst +++ b/docs/source/guides/admin-guides/references/man8/makeconservercf.8.rst @@ -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. ******* diff --git a/docs/source/guides/admin-guides/references/man8/makeknownhosts.8.rst b/docs/source/guides/admin-guides/references/man8/makeknownhosts.8.rst index 94b90dec3..8dad0e800 100644 --- a/docs/source/guides/admin-guides/references/man8/makeknownhosts.8.rst +++ b/docs/source/guides/admin-guides/references/man8/makeknownhosts.8.rst @@ -29,7 +29,7 @@ DESCRIPTION *********** -\ **makeknownhosts**\ Replaces or removes in the known_hosts file in the $ROOTHOME/.ssh directory, the enties for the nodes from the noderange input to the command. +\ **makeknownhosts**\ Replaces or removes entries for the nodes in the known_hosts file in the $ROOTHOME/.ssh directory. The known_hosts file entry is built from the shared ssh host key that xCAT distributes to the installed nodes. HMCs, AMM, switches, etc., where xCAT does not distribute the shared ssh host key, should not be put in the noderange. @@ -37,7 +37,7 @@ HMCs, AMM, switches, etc., where xCAT does not distribute the shared ssh host ke To build the known_hosts entry for a node, you are only required to have the node in the database, and name resolution working for the node. You do not have to be able to access the node. Having this file with correct entries, will avoid the ssh warning when nodes are automatically added to the known_hosts file. -The file should be distributed using xdcp to all the nodes, if you want node to node communication not to display the warning. +The file should be distributed using \ **xdcp**\ to all the nodes, if you want node to node communication not to display the warning. ******* @@ -49,7 +49,7 @@ OPTIONS \ *noderange*\ A set of comma delimited node names and/or group names. - See the "noderange" man page for details on supported formats. + See the \ *noderange*\ man page for details on supported formats. diff --git a/docs/source/guides/install-guides/apt/update_xcat.rst b/docs/source/guides/install-guides/apt/update_xcat.rst index dfa08f6f5..650a03f8e 100644 --- a/docs/source/guides/install-guides/apt/update_xcat.rst +++ b/docs/source/guides/install-guides/apt/update_xcat.rst @@ -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.* diff --git a/docs/source/overview/xcat2_release.rst b/docs/source/overview/xcat2_release.rst index ec71b0834..a87d50a50 100644 --- a/docs/source/overview/xcat2_release.rst +++ b/docs/source/overview/xcat2_release.rst @@ -7,6 +7,38 @@ The following table is a summary of the new operating system (OS), hardware, and * **SLES** - Suse Linux Enterprise Server * **UBT** - Ubuntu +xCAT 2.13.x +----------- + ++---------------------------------+---------------+-------------+----------------------------------+ +|xCAT |New OS |New |New Feature | +|Version | |Hardware | | ++=================================+===============+=============+==================================+ +|| xCAT 2.13.2 | | |- Refine ONIE switch support doc | +|| 2017/2/24 | | |- Add -p for xcatprobe osdeploy | +|| | | | to support performance calculate| +| `2.13.2 Release Notes `_ | | | | +| | | | | ++---------------------------------+---------------+-------------+----------------------------------+ +|| xCAT 2.13.1 | | |- ONIE switch support | +|| 2017/1/13 | | |- refine xcatprobe subcommand: | +|| | | | xcatmn, osdeploy | +| `2.13.1 Release Notes `_ | | | | +| | | | | ++---------------------------------+---------------+-------------+----------------------------------+ +|| xCAT 2.13 |- SLES 12.2 | |- update drivers for genesis-base | +|| 2016/12/09 | | | mlx4-en 3.2-1.0.1.1 | +|| | | | i40e 1.5.16 | +| `2.13 Release Notes `_ | | |- statelite image create by copyds| +| | | | | ++---------------------------------+---------------+-------------+----------------------------------+ + xCAT 2.12.x ----------- diff --git a/docs/source/security/2017/20170126_openssl.rst b/docs/source/security/2017/20170126_openssl.rst new file mode 100644 index 000000000..037ad97cb --- /dev/null +++ b/docs/source/security/2017/20170126_openssl.rst @@ -0,0 +1,27 @@ +2017-01-27 - OpenSSL Vulnerabilities +==================================== + +*Jan 26, 2017*, OpenSSL announced the following security advisories: https://www.openssl.org/news/secadv/20170126.txt + + +Advisory CVEs +------------- + +* CVE-2017-3731 - **Truncated packet could crash via OOB read** (Severity:Moderate) + +* CVE-2017-3730 - **Bad (EC)DHE parameters cause a client crash** (Severity: Moderate) + +* CVE-2017-3732 - **BN_mod_exp may produce incorrect results on x86_64** (Severity: Moderate) + +* CVE-2016-7055 - **Montgomery multiplication may produce incorrect results** (Severity: Low) + +Please see the security bulletin above for patch, upgrade, or suggested work around information. + +Action +------ + +xCAT uses OpenSSL for client-server communication but **does not** ship it. + +It is highly recommended to keep your OpenSSL levels up-to-date with the indicated versions in the security bulletins to prevent any potential security threats. Obtain the updated software packages from your Operating system distribution channels. + + diff --git a/docs/source/security/2017/index.rst b/docs/source/security/2017/index.rst new file mode 100644 index 000000000..7c5b764ff --- /dev/null +++ b/docs/source/security/2017/index.rst @@ -0,0 +1,7 @@ +2017 Notices +============ + +.. toctree:: + :maxdepth: 1 + + 20170126_openssl.rst diff --git a/docs/source/security/index.rst b/docs/source/security/index.rst index 4f9535ac9..911c9ec62 100644 --- a/docs/source/security/index.rst +++ b/docs/source/security/index.rst @@ -4,5 +4,6 @@ Security Notices .. toctree:: :maxdepth: 2 + 2017/index.rst 2016/index.rst 2015/index.rst diff --git a/makerpm b/makerpm index c80ed0edf..4fc2bab20 100755 --- a/makerpm +++ b/makerpm @@ -9,7 +9,29 @@ # set -x -# Make one of the following rpms: perl-xCAT, xCAT-server, xCAT-client, xCAT-IBMhpc, xCAT-rmc, xCAT-UI, xCAT-test +function xcat_probe_copy { + # xCAT-probe uses some functions shipped with xCAT, copying for the following reasons: + # 1. make xCAT-probe code be self-contained + # 2. do not maintain two files for each script + # 3. symbolic link can't work during packaging + RPMNAME=${1} + if [ $RPMNAME = "xCAT-probe" ]; then + mkdir -p ${RPMNAME}/lib/perl/xCAT/ + files=("NetworkUtils.pm" "GlobalDef.pm" "ServiceNodeUtils.pm") + for f in "${files[@]}"; do + cp perl-xCAT/xCAT/$f ${RPMNAME}/lib/perl/xCAT/ + done + fi +} + +function xcat_probe_cleanup { + RPMNAME=${1} + if [ $RPMNAME = "xCAT-probe" ]; then + rm -rf ${RPMNAME}/lib/perl/xCAT/ + fi +} + +# Make the noarch rpms function makenoarch { RPMNAME=$1 if [ "$OSNAME" = "AIX" ]; then @@ -41,17 +63,7 @@ function makenoarch { fi fi - #xcat probe use some functions shipped by xCAT, for below reasons we need to copy files to xCAT-probe directory - #1 make xcat probe code to be self-contained - #2 don't maintain two files for each script - #3 symbolic link can't work during package - if [ $RPMNAME = "xCAT-probe" ]; then - CURDIR=$(pwd) - mkdir -p ${CURDIR}/xCAT-probe/lib/perl/xCAT/ - cp -f ${CURDIR}/perl-xCAT/xCAT/NetworkUtils.pm ${CURDIR}/xCAT-probe/lib/perl/xCAT/ - cp -f ${CURDIR}/perl-xCAT/xCAT/GlobalDef.pm ${CURDIR}/xCAT-probe/lib/perl/xCAT/ - cp -f ${CURDIR}/perl-xCAT/xCAT/ServiceNodeUtils.pm ${CURDIR}/xCAT-probe/lib/perl/xCAT/ - fi + xcat_probe_copy ${RPMNAME} tar --exclude .svn -czf $RPMROOT/SOURCES/$RPMNAME-$VER.tar.gz $RPMNAME rm -f $RPMROOT/SRPMS/$RPMNAME-$VER*rpm $RPMROOT/RPMS/noarch/$RPMNAME-$VER*rpm @@ -62,6 +74,9 @@ function makenoarch { # undo the modifications above to leave the sandbox prestine on the build machine git checkout xCAT-UI/xCAT-UI.spec fi + + xcat_probe_cleanup ${RPMNAME} + fi } @@ -107,6 +122,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 +161,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 } diff --git a/perl-xCAT/debian/compat b/perl-xCAT/debian/compat index 7ed6ff82d..ec635144f 100644 --- a/perl-xCAT/debian/compat +++ b/perl-xCAT/debian/compat @@ -1 +1 @@ -5 +9 diff --git a/perl-xCAT/debian/control b/perl-xCAT/debian/control index 5222978b0..cd7877d24 100644 --- a/perl-xCAT/debian/control +++ b/perl-xCAT/debian/control @@ -2,12 +2,13 @@ Source: perl-xcat Section: libs Priority: extra Maintainer: xCAT -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. diff --git a/perl-xCAT/debian/rules b/perl-xCAT/debian/rules index e5a0aa6fd..763812bba 100755 --- a/perl-xCAT/debian/rules +++ b/perl-xCAT/debian/rules @@ -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" diff --git a/perl-xCAT/perl-xCAT.spec b/perl-xCAT/perl-xCAT.spec index b1bb44274..86c15f41a 100644 --- a/perl-xCAT/perl-xCAT.spec +++ b/perl-xCAT/perl-xCAT.spec @@ -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. diff --git a/perl-xCAT/xCAT/DBobjUtils.pm b/perl-xCAT/xCAT/DBobjUtils.pm index 5400fb7c8..31bc6c14a 100755 --- a/perl-xCAT/xCAT/DBobjUtils.pm +++ b/perl-xCAT/xCAT/DBobjUtils.pm @@ -424,7 +424,6 @@ sub getobjdefs # get the key to look for, for this object type my $objkey = $datatype->{'objkey'}; - # go through the list of valid attrs foreach my $this_attr (@{ $datatype->{'attrs'} }) { my $ent; @@ -487,7 +486,6 @@ sub getobjdefs my $intabhash = 0; my $notsearched = 0; foreach my $lookup_attr (keys %{ $tabentry{'lookup_attrs'} }) { - # Check whether the attribute is already in %tabhash # The %tabhash is for performance considerations if (($lookup_attr eq 'node') && ($objtype eq 'node')) { @@ -513,7 +511,6 @@ sub getobjdefs # Not in tabhash, # Need to lookup the table if ($intabhash == 0 && $notsearched == 1) { - # look up attr values my @rows = xCAT::DBobjUtils->getDBtable($lookup_table); if (@rows) { @@ -2502,6 +2499,7 @@ sub judge_node Arguments: nicsattr value, like niccsips=eth0!1.1.1.1|2.1.1.1,eth1!3.1.1.1|4.1.1.1 + node name, like frame10node10 nicnames: only return the value for specific nics, like "eth0,eth1" Returns: expanded format, like: @@ -2524,8 +2522,8 @@ sub expandnicsattr() if (($nicstr) && ($nicstr =~ /xCAT::/)) { $nicstr = shift; } + my $node = shift; my $nicnames = shift; - my $ret; $nicstr =~ /^(.*?)=(.*?)$/; @@ -2547,7 +2545,6 @@ sub expandnicsattr() #$nicval Value: node(d+)|eth0!192.1.1.($1+10) if (($nicval) && ($nicval =~ /\|/)) { my ($str1, $str2) = split('\|', $nicval); - #$nivval Value: eth0!192.1.1.($1+10) $nicval = $str2; } @@ -2576,6 +2573,7 @@ sub expandnicsattr() } } + $nicv[1]= xCAT::Table::transRegexAttrs($node, $nicv[1]); # ignore the line that does not have nicname or value if ($nicv[0] && $nicv[1]) { $ret .= " $nicattr.$nicv[0]=$nicv[1]\n"; @@ -2628,7 +2626,6 @@ sub collapsenicsattr() $nodeattrhash = shift; } my $objname = shift; - my %nicattrs = (); foreach my $nodeattr (keys %{$nodeattrhash}) { diff --git a/perl-xCAT/xCAT/DSHCLI.pm b/perl-xCAT/xCAT/DSHCLI.pm index a0b5788c9..8121f475d 100644 --- a/perl-xCAT/xCAT/DSHCLI.pm +++ b/perl-xCAT/xCAT/DSHCLI.pm @@ -979,8 +979,9 @@ sub fork_fanout_dsh ) = @_; - #get username and passeword for ether net switches (EthSwitch type) - if ($$options{'devicetype'} =~ /EthSwitch/) { + #get username and passeword for switches + if (($$options{'devicetype'} =~ /EthSwitch/) || + (($$options{'devicetype'} =~ /IBSwitch/) && !($$options{'user'})) ){ if (@$targets_waiting > 0) { if ($ENV{'DSH_REMOTE_PASSWORD'}) { foreach my $t (keys(%$resolved_targets)) { @@ -1010,13 +1011,15 @@ sub fork_fanout_dsh if (defined($entry->[0]->{protocol})) { $protocol = $entry->[0]->{protocol}; } - if ((!$username) && (!$password) && (!$protocol)) { #use passwd table as default + if ((!$username) && (!$password)) { #use passwd table as default if (defined($passwd_ent[0]->{username})) { $username = $passwd_ent[0]->{username}; } if (defined($passwd_ent[0]->{password})) { $password = $passwd_ent[0]->{password}; } + } + if (!$protocol){ if (defined($passwd_ent[0]->{comments}) && ($passwd_ent[0]->{comments} eq "telnet")) { $protocol = $passwd_ent[0]->{comments}; } diff --git a/perl-xCAT/xCAT/FSPvm.pm b/perl-xCAT/xCAT/FSPvm.pm index 15badd518..a00285672 100644 --- a/perl-xCAT/xCAT/FSPvm.pm +++ b/perl-xCAT/xCAT/FSPvm.pm @@ -2037,7 +2037,7 @@ sub query_cec_info { if (scalar(@$rethash)) { push @result, @$rethash; } else { - push @result, [ $name, "No information got", -1 ]; + push @result, [ $name, "No information obtained.", -1 ]; last; } $lpar_hash{$name} = \%tmp_hash; @@ -2048,7 +2048,7 @@ sub query_cec_info { if (scalar(@$rethash)) { push @result, @$rethash; } else { - push @result, [ @td[3], "No information got", -1 ]; + push @result, [ @td[3], "No information obtained.", -1 ]; last; } diff --git a/perl-xCAT/xCAT/MacMap.pm b/perl-xCAT/xCAT/MacMap.pm index e857cf9f5..54edb1824 100644 --- a/perl-xCAT/xCAT/MacMap.pm +++ b/perl-xCAT/xCAT/MacMap.pm @@ -329,14 +329,14 @@ sub dump_mac_info { foreach my $switch (keys %{ $self->{switchparmhash} }) { if ($dump_all_switches or defined($switches_to_dump{$switch})) { if ($self->{show_verbose_info}) { - xCAT::MsgUtils->message("I", { data => ["$switch: Start to get information"] }, $self->{callback}); + xCAT::MsgUtils->message("I", { data => ["$switch: Attempting to refresh switch information..."] }, $self->{callback}); } $self->refresh_switch(undef, $community, $switch); if ($self->{show_verbose_info}) { - xCAT::MsgUtils->message("I", { data => ["$switch: Finish to get information"] }, $self->{callback}); + xCAT::MsgUtils->message("I", { data => ["$switch: Finished refreshing switch information."] }, $self->{callback}); } if (!defined($self->{macinfo}->{$switch})) { - $ret{$switch}->{ErrorStr} = "No information get"; + $ret{$switch}->{ErrorStr} = "No switch information obtained."; foreach my $defportname (keys %{ $self->{switches}->{$switch} }) { $ret{$switch}->{$defportname}->{Node} = $self->{switches}->{$switch}->{$defportname}; } diff --git a/perl-xCAT/xCAT/NetworkUtils.pm b/perl-xCAT/xCAT/NetworkUtils.pm index 423ea320d..a66576cf4 100755 --- a/perl-xCAT/xCAT/NetworkUtils.pm +++ b/perl-xCAT/xCAT/NetworkUtils.pm @@ -1471,7 +1471,7 @@ sub nodeonmynet my $nettab = xCAT::Table->new("networks"); my @vnets = $nettab->getAllAttribs('net', 'mgtifname', 'mask'); foreach (@vnets) { - if ((defined $_->{mgtifname}) && ($_->{mgtifname} eq '!remote!')) + if ((defined $_->{mgtifname}) && ($_->{mgtifname} =~ /!remote!/)) { if (xCAT::NetworkUtils->ishostinsubnet($nodeip, $_->{mask}, $_->{net})) { @@ -1508,7 +1508,7 @@ sub nodeonmynet my $nettab = xCAT::Table->new("networks"); my @vnets = $nettab->getAllAttribs('net', 'mgtifname', 'mask'); foreach (@vnets) { - if ((defined $_->{mgtifname}) && ($_->{mgtifname} eq '!remote!')) + if ((defined $_->{mgtifname}) && ($_->{mgtifname} =~ /!remote!/)) { #global scoped network my $curm = unpack("N", inet_aton($_->{mask})); my $bits = 32; diff --git a/perl-xCAT/xCAT/Schema.pm b/perl-xCAT/xCAT/Schema.pm index 228ab4770..8a0639ea4 100755 --- a/perl-xCAT/xCAT/Schema.pm +++ b/perl-xCAT/xCAT/Schema.pm @@ -678,6 +678,20 @@ passed as argument rather than by table value', disable => "Set to 'yes' or '1' to comment out this row.", }, }, + pdu => { + cols => [qw(node nodetype machinetype modelnum serialnum outletCount comments disable)], + keys => [qw(node)], + nodecol => "node", + table_desc => 'Parameters to use when interrogating pdus', + descriptions => { + node => 'The hostname/address of the pdu to which the settings apply', + nodetype => 'The node type should be pdu ', + machinetype => 'The pdu machine type', + modelnum => 'The pdu model number', + serialnum => 'The pdu serial number', + outletcount => 'The pdu outlet count', + }, + }, switches => { cols => [qw(switch snmpversion username password privacy auth linkports sshusername sshpassword protocol switchtype comments disable)], keys => [qw(switch)], @@ -1255,6 +1269,17 @@ passed as argument rather than by table value', disable => "Set to 'yes' or '1' to comment out this row.", }, }, + pduoutlet => { + cols => [qw(node pdu comments disable)], + keys => [qw(node)], + table_desc => 'Contains list of outlet numbers on the pdu each node is connected to.', + descriptions => { + node => 'The node name or group name.', + pdu => 'a comma-separated list of outlet number for each PDU, ex: pdu1:outlet1,pdu2:outlet1', + comments => 'Any user-written notes.', + disable => "Set to 'yes' or '1' to comment out this row.", + } + }, switch => { cols => [qw(node switch port vlan interface comments disable)], keys => [qw(node switch port)], @@ -1816,6 +1841,7 @@ foreach my $tabname (keys(%xCAT::ExtTab::ext_tabspec)) { zone => { attrs => [], attrhash => {}, objkey => 'zonename' }, firmware => { attrs => [], attrhash => {}, objkey => 'cfgfile' }, taskstate => { attrs => [], attrhash => {}, objkey => 'node' }, + pdu => { attrs => [], attrhash => {}, objkey => 'node' }, ); @@ -2699,6 +2725,14 @@ my @nodeattrs = ( tabentry => 'websrv.password', access_tabentry => 'websrv.node=attr:node', }, +###################### + # pduoutlet table # +###################### + { attr_name => 'pdu', + tabentry => 'pduoutlet.pdu', + access_tabentry => 'pduoutlet.node=attr:node', + }, + ###################### # switch table # ###################### @@ -2817,6 +2851,35 @@ my @nodeattrs = ( access_tabentry => 'hwinv.node=attr:node', }, +######################### +## pdu table # +######################### + { attr_name => 'nodetype', + only_if => 'nodetype=pdu', + tabentry => 'pdu.nodetype', + access_tabentry => 'pdu.node=attr:node', + }, + { attr_name => 'machinetype', + only_if => 'nodetype=pdu', + tabentry => 'pdu.machinetype', + access_tabentry => 'pdu.node=attr:node', + }, + { attr_name => 'modelnum', + only_if => 'nodetype=pdu', + tabentry => 'pdu.modelnum', + access_tabentry => 'pdu.node=attr:node', + }, + { attr_name => 'serialnum', + only_if => 'nodetype=pdu', + tabentry => 'pdu.serialnum', + access_tabentry => 'pdu.node=attr:node', + }, + { attr_name => 'outletcount', + only_if => 'nodetype=pdu', + tabentry => 'pdu.outletcount', + access_tabentry => 'pdu.node=attr:node', + }, + ######################### ## switches table # ######################### @@ -4019,6 +4082,47 @@ push(@{ $defspec{group}->{'attrs'} }, @nodeattrs); }, ); +############################# +# pdu object # +############################# +############################# +# pdu table # +############################# +@{ $defspec{pdu}->{'attrs'} } = + ( + { attr_name => 'node', + only_if => 'nodetype=pdu', + tabentry => 'pdu.node', + access_tabentry => 'pdu.node=attr:node', + }, + { attr_name => 'nodetype', + only_if => 'nodetype=pdu', + tabentry => 'pdu.nodetype', + access_tabentry => 'pdu.node=attr:node', + }, + { attr_name => 'machinetype', + only_if => 'nodetype=pdu', + tabentry => 'pdu.machinetype', + access_tabentry => 'pdu.node=attr:node', + }, + { attr_name => 'modelnum', + only_if => 'nodetype=pdu', + tabentry => 'pdu.modelnum', + access_tabentry => 'pdu.node=attr:node', + }, + { attr_name => 'serialnum', + only_if => 'nodetype=pdu', + tabentry => 'pdu.serialnum', + access_tabentry => 'pdu.node=attr:node', + }, + { attr_name => 'outletcount', + only_if => 'nodetype=pdu', + tabentry => 'pdu.outletcount', + access_tabentry => 'pdu.node=attr:node', + }, +); + + ################################################### diff --git a/perl-xCAT/xCAT/Table.pm b/perl-xCAT/xCAT/Table.pm index 67b1b2b8f..5f1714f50 100644 --- a/perl-xCAT/xCAT/Table.pm +++ b/perl-xCAT/xCAT/Table.pm @@ -2299,6 +2299,91 @@ $evalcpt->permit('require'); #-------------------------------------------------------------------------- +=head3 transRegexAttrs + + Description: Transform the regular expression attribute to the target value + based on the node name. + + Arguments: + Node + Attribute value (may have regular expression) + Returns: + Attribute value + undef + Globals: + + Error: + + Example: + if (defined($retval = transRegexAttrs($node, $datum->{$attrib}))) { + $datum->{$attrib} = $retval; + } else { + delete $datum->{$attrib}; + } + + Comments: + none + +=cut + +#--------------------------------------------------------------------------- +sub transRegexAttrs +{ + my ($node, $attr) = @_; + my $retval = $attr; + if ($attr =~ /^\/[^\/]*\/[^\/]*\/$/) { + my $exp = substr($attr, 1); + chop $exp; + my @parts = split('/', $exp, 2); + $retval = $node; + $retval =~ s/$parts[0]/$parts[1]/; + } elsif ($attr =~ /^\|.*\|$/) { + my $exp = substr($attr, 1); + chop $exp; + my @parts = split('\|', $exp, 2); + my $arraySize = @parts; + if ($arraySize < 2) { # easy regx, generate lhs from node + my $lhs; + my @numbers = $node =~ m/[\D0]*(\d+)/g; + $lhs = '[\D0]*(\d+)' x scalar(@numbers); + $lhs .= '.*$'; + unshift(@parts, $lhs); + } + my ($curr, $next, $prev); + $retval = $parts[1]; + + ($curr, $next, $prev) = + extract_bracketed($retval, '()', qr/[^()]*/); + unless ($curr) { #If there were no paramaters to save, treat this one like a plain regex + undef $@; #extract_bracketed would have set $@ if it didn't return, undef $@ + $retval = $node; + $retval =~ s/$parts[0]/$parts[1]/; + } + while ($curr) + { + my $value = $node; + $value =~ s/$parts[0]/$curr/; + $value = $evalcpt->reval('use integer;' . $value); + $retval = $prev . $value . $next; + ($curr, $next, $prev) = + extract_bracketed($retval, '()', qr/[^()]*/); + } + undef $@; + + #At this point, $retval is the expression after being arithmetically contemplated, a generated regex, and therefore + #must be applied in total + my $answval = $node; + $answval =~ s/$parts[0]/$retval/; + $retval = $answval; + } + if ($retval =~ /^$/) { + $retval = undef; + } + return $retval; +} + +#-------------------------------------------------------------------------- + =head3 getNodeAttribs Description: Retrieves the requested attribute @@ -2392,77 +2477,10 @@ sub getNodeAttribs #skip undefined values, save time next; } - if ($datum->{$attrib} =~ /^\/[^\/]*\/[^\/]*\/$/) - { - my $exp = substr($datum->{$attrib}, 1); - chop $exp; - my @parts = split('/', $exp, 2); - my $retval = $node; - $retval =~ s/$parts[0]/$parts[1]/; + my $retval; + if (defined($retval = transRegexAttrs($node, $datum->{$attrib}))) { $datum->{$attrib} = $retval; - } - elsif ($datum->{$attrib} =~ /^\|.*\|$/) - { - - #Perform arithmetic and only arithmetic operations in bracketed issues on the right. - #Tricky part: don't allow potentially dangerous code, only eval if - #to-be-evaled expression is only made up of ()\d+-/%$ - #Futher paranoia? use Safe module to make sure I'm good - my $exp = substr($datum->{$attrib}, 1); - chop $exp; - my @parts = split('\|', $exp, 2); - my $arraySize = @parts; - if ($arraySize < 2) { # easy regx, generate lhs from node - my $lhs; - my @numbers = $node =~ m/[\D0]*(\d+)/g; - $lhs = '[\D0]*(\d+)' x scalar(@numbers); - $lhs .= '.*$'; - unshift(@parts, $lhs); - } - my $curr; - my $next; - my $prev; - my $retval = $parts[1]; - ($curr, $next, $prev) = - extract_bracketed($retval, '()', qr/[^()]*/); - - unless ($curr) { #If there were no paramaters to save, treat this one like a plain regex - undef $@; #extract_bracketed would have set $@ if it didn't return, undef $@ - $retval = $node; - $retval =~ s/$parts[0]/$parts[1]/; - $datum->{$attrib} = $retval; - if ($datum->{$attrib} =~ /^$/) { - - #If regex forces a blank, act like a normal blank does - delete $datum->{$attrib}; - } - next; #skip the redundancy that follows otherwise - } - while ($curr) - { - - #my $next = $comps[0]; - my $value = $node; - $value =~ s/$parts[0]/$curr/; - $value = $evalcpt->reval('use integer;' . $value); - $retval = $prev . $value . $next; - ($curr, $next, $prev) = - extract_bracketed($retval, '()', qr/[^()]*/); - } - undef $@; - - #At this point, $retval is the expression after being arithmetically contemplated, a generated regex, and therefore - #must be applied in total - my $answval = $node; - $answval =~ s/$parts[0]/$retval/; - $datum->{$attrib} = $answval; #$retval; - - #print Data::Dumper::Dumper(extract_bracketed($parts[1],'()',qr/[^()]*/)); - #use text::balanced extract_bracketed to parse earch atom, make sure nothing but arith operators, parans, and numbers are in it to guard against code execution - } - if ($datum->{$attrib} =~ /^$/) { - - #If regex forces a blank, act like a normal blank does + } else { delete $datum->{$attrib}; } } diff --git a/perl-xCAT/xCAT/Usage.pm b/perl-xCAT/xCAT/Usage.pm index 5dfb9494c..1b8e1d5c3 100755 --- a/perl-xCAT/xCAT/Usage.pm +++ b/perl-xCAT/xCAT/Usage.pm @@ -50,6 +50,9 @@ my %usage = ( rpower noderange [stat|state|on|off|reset|boot] docker specific: rpower noderange [start|stop|restart|pause|unpause|state] + pdu specific: + rpower noderange [off|on|stat] + rpower noderange [pduoff|pduon|pdustat] ", "rbeacon" => "Usage: rbeacon [on|off|stat] [-V|--verbose] @@ -81,7 +84,7 @@ my %usage = ( rinv [all|model|serial] [-V|--verbose] rinv [-h|--help|-v|--version] BMC specific: - rinv [mprom|deviceid|uuid|guid|vpd|all] + rinv [mprom|deviceid|uuid|guid|vpd|dimm|all] OpenPOWER server specific: rinv [model|serial|deviceid|uuid|guid|vpd|mprom|firm|all] MPA specific: @@ -100,7 +103,9 @@ my %usage = ( zVM specific: rinv noderange [all|config] MIC specific: - rinv noderange [system|ver|board|core|gddr|all]", + rinv noderange [system|ver|board|core|gddr|all] + pdu specific: + rinv noderange ", "rsetboot" => "Usage: rsetboot [net|hd|cd|floppy|def|stat] [-V|--verbose] [-u] [-p] rsetboot [-h|--help|-v|--version]", diff --git a/perl-xCAT/xCAT/Utils.pm b/perl-xCAT/xCAT/Utils.pm index af8f42fcf..a39ea8bb2 100644 --- a/perl-xCAT/xCAT/Utils.pm +++ b/perl-xCAT/xCAT/Utils.pm @@ -4645,7 +4645,7 @@ sub splitkcmdline { my %cmdhash; - my @cmdlist = split(/[, ]/, $kcmdline); + my @cmdlist = split(/[ ]/, $kcmdline); foreach my $cmd (@cmdlist) { if ($cmd =~ /^R::(.*)$/) { $cmdhash{persistent} .= "$1 "; diff --git a/perl-xCAT/xCAT/data/discinfo.pm b/perl-xCAT/xCAT/data/discinfo.pm index 43272157d..75274be3e 100755 --- a/perl-xCAT/xCAT/data/discinfo.pm +++ b/perl-xCAT/xCAT/data/discinfo.pm @@ -12,34 +12,42 @@ require Exporter; @EXPORT_OK = qw(distnames numdiscs); -%distnames = ( - "1310229985.226287" => "centos6", - "1323560292.885204" => "centos6.2", - "1341569670.539525" => "centos6.3", #x86 - "1362445555.957609" => "centos6.4", #x86_64 - "1385726732.061157" => "centos6.5", #x86_64 - "1438724467.511049" => "centos6.7", #x86_64 - "1463897259.552895" => "centos6.8", #x86_64 - "1404489053.504589" => "centos7.0", - "1427495138.035654" => "centos7.1", +my %distnames = ( + "1480943823.812754" => "centos7.3", #x86_64 "1450147276.351714" => "centos7.2", #ppc64le + "1449699925.561114" => "centos7.2", #x86_64 + "1427495138.035654" => "centos7.1", + "1404489053.504589" => "centos7.0", + + "1463897259.552895" => "centos6.8", #x86_64 + "1438724467.511049" => "centos6.7", #x86_64 + "1414159991.958686" => "centos6.6", + "1385726732.061157" => "centos6.5", #x86_64 + "1362445555.957609" => "centos6.4", #x86_64 + "1341569670.539525" => "centos6.3", #x86 + "1323560292.885204" => "centos6.2", + "1310229985.226287" => "centos6", + + "1381776971.473332" => "centos5.10", #x86_64 + "1357930415.252042" => "centos5.9", #x86_64 + "1330913492.861127" => "centos5.8", #x86_64 + "1301444731.448392" => "centos5.6", + "1272326751.405938" => "centos5.5", + "1254416275.453877" => "centos5.4", #x86_64 + "1237641529.260981" => "centos5.3", + "1214240246.285059" => "centos5.2", + "1213888991.267240" => "centos5.2", + "1195929637.060433" => "centos5.1", + "1195929648.203590" => "centos5.1", "1176234647.982657" => "centos5", + "1156364963.862322" => "centos4.4", "1178480581.024704" => "centos4.5", - "1195929648.203590" => "centos5.1", - "1195929637.060433" => "centos5.1", - "1213888991.267240" => "centos5.2", - "1214240246.285059" => "centos5.2", - "1237641529.260981" => "centos5.3", - "1272326751.405938" => "centos5.5", - "1330913492.861127" => "centos5.8", #x86_64 - "1357930415.252042" => "centos5.9", #x86_64 - "1381776971.473332" => "centos5.10", #x86_64 "1195488871.805863" => "centos4.6", "1195487524.127458" => "centos4.6", - "1301444731.448392" => "centos5.6", - "1414159991.958686" => "centos6.6", + "1170973598.629055" => "rhelc5", + "1170978545.752040" => "rhels5", "1192660014.052098" => "rhels5.1", "1192663619.181374" => "rhels5.1", @@ -87,6 +95,7 @@ require Exporter; "1446216863.790260" => "rhels7.2", #x86_64 "1446216863.764721" => "rhels7.2", #ppc64 "1446216863.771788" => "rhels7.2", #ppc64le + "1285193176.593806" => "rhelhpc6", #x86_64 "1305067719.718814" => "rhelhpc6.1", #x86_64 "1321545261.599847" => "rhelhpc6.2", #x86_64 @@ -99,6 +108,7 @@ require Exporter; "1399449226.140088" => "rhelhpc7.0", #x86_64, RHEL ComputeNode "1424360759.772760" => "rhelhpc7.1", #x86_64, RHEL ComputeNode "1446216863.725127" => "rhelhpc7.2", #x86_64, RHEL ComputeNode + "1194015916.783841" => "fedora8", "1194015385.299901" => "fedora8", "1210112435.291709" => "fedora9", @@ -113,6 +123,7 @@ require Exporter; "1372355769.065812" => "fedora19", #x86_64 DVD ISO "1372402928.663653" => "fedora19", #ppc64 DVD ISO "1386856788.124593" => "fedora20", #x86_64 DVD ISO + "1194512200.047708" => "rhas4.6", "1194512327.501046" => "rhas4.6", "1241464993.830723" => "rhas4.8", #x86-64 diff --git a/xCAT-IBMhpc/debian/compat b/xCAT-IBMhpc/debian/compat index 7ed6ff82d..ec635144f 100644 --- a/xCAT-IBMhpc/debian/compat +++ b/xCAT-IBMhpc/debian/compat @@ -1 +1 @@ -5 +9 diff --git a/xCAT-IBMhpc/debian/control b/xCAT-IBMhpc/debian/control index 38a06c9af..2bdffb1be 100644 --- a/xCAT-IBMhpc/debian/control +++ b/xCAT-IBMhpc/debian/control @@ -2,14 +2,14 @@ Source: xcat-ibmhpc Section: admin Priority: extra Maintainer: Arif Ali -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). diff --git a/xCAT-IBMhpc/debian/rules b/xCAT-IBMhpc/debian/rules index 659821bd5..1bd639730 100755 --- a/xCAT-IBMhpc/debian/rules +++ b/xCAT-IBMhpc/debian/rules @@ -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" diff --git a/xCAT-IBMhpc/xCAT-IBMhpc.spec b/xCAT-IBMhpc/xCAT-IBMhpc.spec index 32ed7f3d8..5de637f3d 100644 --- a/xCAT-IBMhpc/xCAT-IBMhpc.spec +++ b/xCAT-IBMhpc/xCAT-IBMhpc.spec @@ -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 - - - - diff --git a/xCAT-OpenStack-baremetal/debian/compat b/xCAT-OpenStack-baremetal/debian/compat index 45a4fb75d..ec635144f 100644 --- a/xCAT-OpenStack-baremetal/debian/compat +++ b/xCAT-OpenStack-baremetal/debian/compat @@ -1 +1 @@ -8 +9 diff --git a/xCAT-OpenStack-baremetal/debian/control b/xCAT-OpenStack-baremetal/debian/control index 61ad678eb..b62fc34bb 100644 --- a/xCAT-OpenStack-baremetal/debian/control +++ b/xCAT-OpenStack-baremetal/debian/control @@ -2,13 +2,11 @@ Source: xcat-openstack-baremetal Section: admin Priority: extra Maintainer: xCAT -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 diff --git a/xCAT-OpenStack-baremetal/xCAT-OpenStack-baremetal.spec b/xCAT-OpenStack-baremetal/xCAT-OpenStack-baremetal.spec index c82d9b36e..ff45e5bd6 100644 --- a/xCAT-OpenStack-baremetal/xCAT-OpenStack-baremetal.spec +++ b/xCAT-OpenStack-baremetal/xCAT-OpenStack-baremetal.spec @@ -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 diff --git a/xCAT-OpenStack/debian/compat b/xCAT-OpenStack/debian/compat index 45a4fb75d..ec635144f 100644 --- a/xCAT-OpenStack/debian/compat +++ b/xCAT-OpenStack/debian/compat @@ -1 +1 @@ -8 +9 diff --git a/xCAT-OpenStack/debian/control b/xCAT-OpenStack/debian/control index 04cff6ab9..9f6ac5661 100644 --- a/xCAT-OpenStack/debian/control +++ b/xCAT-OpenStack/debian/control @@ -2,13 +2,13 @@ Source: xcat-openstack Section: admin Priority: extra Maintainer: xCAT -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. diff --git a/xCAT-OpenStack/xCAT-OpenStack.spec b/xCAT-OpenStack/xCAT-OpenStack.spec index b1fae31be..a502b20d5 100644 --- a/xCAT-OpenStack/xCAT-OpenStack.spec +++ b/xCAT-OpenStack/xCAT-OpenStack.spec @@ -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 - diff --git a/xCAT-SoftLayer/xCAT-SoftLayer.spec b/xCAT-SoftLayer/xCAT-SoftLayer.spec index 7166d1e9d..683b98ea8 100644 --- a/xCAT-SoftLayer/xCAT-SoftLayer.spec +++ b/xCAT-SoftLayer/xCAT-SoftLayer.spec @@ -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 diff --git a/xCAT-UI/debian/compat b/xCAT-UI/debian/compat index 7ed6ff82d..ec635144f 100644 --- a/xCAT-UI/debian/compat +++ b/xCAT-UI/debian/compat @@ -1 +1 @@ -5 +9 diff --git a/xCAT-UI/debian/control b/xCAT-UI/debian/control index 4e91971ef..f9fe95278 100644 --- a/xCAT-UI/debian/control +++ b/xCAT-UI/debian/control @@ -2,11 +2,12 @@ Source: xcat-ui Section: admin Priority: extra Maintainer: xCAT -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). diff --git a/xCAT-UI/debian/rules b/xCAT-UI/debian/rules index ce79be57f..1cf265aa1 100755 --- a/xCAT-UI/debian/rules +++ b/xCAT-UI/debian/rules @@ -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" diff --git a/xCAT-UI/etc/apache2/conf.d/xcat-ui.conf b/xCAT-UI/etc/apache2/conf.d/xcat-ui.conf index 2d94d8887..11d5b3445 100644 --- a/xCAT-UI/etc/apache2/conf.d/xcat-ui.conf +++ b/xCAT-UI/etc/apache2/conf.d/xcat-ui.conf @@ -1,5 +1,12 @@ Alias /xcat "/opt/xcat/ui" PHPINIDir "/opt/xcat/ui" + +# Redirect all http request to https +RewriteEngine On +RewriteCond %{SERVER_PORT} 80 +RewriteCond %{HTTPS} !=on +RewriteRule ^/?xcat/(.*) https://%{SERVER_NAME}/xcat/$1 [R,L] + Options FollowSymLinks AllowOverride None diff --git a/xCAT-UI/js/configure/service.js b/xCAT-UI/js/configure/service.js index 352c01d14..515b86296 100644 --- a/xCAT-UI/js/configure/service.js +++ b/xCAT-UI/js/configure/service.js @@ -60,7 +60,7 @@ function loadServicePage(tabId) { title = 'z/VM'; // Get zVM host names - if (!$.cookie('zvms')){ + if (!$.cookie('xcat_zvms')){ $.ajax( { url : 'lib/cmd.php', dataType : 'json', diff --git a/xCAT-UI/js/configure/update.js b/xCAT-UI/js/configure/update.js index 1422f1023..65d339292 100644 --- a/xCAT-UI/js/configure/update.js +++ b/xCAT-UI/js/configure/update.js @@ -39,7 +39,7 @@ function loadUpdatePage() { /** * Show the RPM repository (it can use the user's last choice and input) - * + * * @param data Data returned from HTTP request */ function showRepository(data) { @@ -61,7 +61,7 @@ function showRepository(data) { // Display the Devel Repository, remember user's last selection show = show + "
  • "; @@ -70,7 +70,7 @@ function showRepository(data) { // Display the Stable Repository, remember user's last selection show = "
  • "; @@ -78,23 +78,23 @@ function showRepository(data) { repoList.append(show); // Display the Input Repository, remember user's last selection - if (($.cookie('xcatrepository')) && ($.cookie('xcatrepository') != 1) - && ($.cookie('xcatrepository') != 2)) { + if (($.cookie('xcat_repository')) && ($.cookie('xcat_repository') != 1) + && ($.cookie('xcat_repository') != 2)) { show = "
  • Other: "; show += ""; + + $.cookie('xcat_repository') + "'
  • "; } else { show = "
  • Other: "; show += ""; } repoList.append(show); - + $('#repository fieldset').append(repoList); } /** * Show all xCAT RPMs - * + * * @param data Data returned from HTTP request */ function showRpmInfo(data) { @@ -109,7 +109,7 @@ function showRpmInfo(data) { } rpms = data.rsp.split(/\n/); - + // No rpm installed, return if (1 > rpms.length) { $('#rpm fieldset').append("No RPMs installed!"); @@ -201,7 +201,7 @@ function updateRpm() { if (pattern.test(rpms)) { return true; } - + rpms = rpms + temp + ","; }); @@ -227,8 +227,9 @@ function updateRpm() { } // Remember users' choice and input - $.cookie('xcatrepository', rpmPathType, { + $.cookie('xcat_repository', rpmPathType, { path : '/xcat', + secure : true, expires : 10 }); @@ -255,7 +256,7 @@ function updateRpm() { /** * Show the results of the RPM update - * + * * @param data Data returned from HTTP request */ function showUpdateResult(data) { diff --git a/xCAT-UI/js/custom/blade.js b/xCAT-UI/js/custom/blade.js index bf722afc2..adbfefb66 100644 --- a/xCAT-UI/js/custom/blade.js +++ b/xCAT-UI/js/custom/blade.js @@ -14,14 +14,14 @@ var bladePlugin = function() { /** * Load node inventory - * + * * @param data Data from HTTP request */ bladePlugin.prototype.loadInventory = function(data) { var args = data.msg.split(','); var tabId = args[0].replace('out=', ''); var node = args[1].replace('node=', ''); - + // Get node inventory var inv = data.rsp; @@ -30,7 +30,7 @@ bladePlugin.prototype.loadInventory = function(data) { // Create division to hold inventory var invDiv = $('
    '); - + // Create a fieldset var fieldSet = $('
    '); var legend = $('Hardware'); @@ -58,7 +58,7 @@ bladePlugin.prototype.loadInventory = function(data) { /** * Load clone page - * + * * @param node Source node to clone */ bladePlugin.prototype.loadClonePage = function(node) { @@ -78,13 +78,13 @@ bladePlugin.prototype.loadClonePage = function(node) { // Add clone tab tab.add(newTabId, 'Clone', cloneForm, true); } - + tab.select(newTabId); }; /** * Load provision page - * + * * @param tabId The provision tab ID */ bladePlugin.prototype.loadProvisionPage = function(tabId) { @@ -142,14 +142,14 @@ bladePlugin.prototype.loadResources = function() { var tabId = 'bladeResourceTab'; // Remove loader $('#' + tabId).find('img').remove(); - + // Create info bar var infoBar = createInfoBar('Not yet supported'); // Create resource form var resrcForm = $('
    '); resrcForm.append(infoBar); - + $('#' + tabId).append(resrcForm); }; @@ -160,18 +160,18 @@ bladePlugin.prototype.addNode = function() { var addNodeForm = $('
    '); var info = createInfoBar('Add a BladeCenter node'); addNodeForm.append(info); - + var typeFS = $('
    '); var typeLegend = $('Type'); typeFS.append(typeLegend); addNodeForm.append(typeFS); - + var settingsFS = $('
    '); var nodeLegend = $('Settings'); settingsFS.append(nodeLegend); addNodeForm.append(settingsFS); - - typeFS.append('
    ' + + + typeFS.append('
    ' + '' + '' + '
    '); - + // Change dialog width $('#addBladeCenter').dialog('option', 'width', '400'); - + typeFS.find('#typeSelect').bind('change', function(){ // Remove any existing warnings $('#addBladeCenter .ui-state-error').remove(); settingsFS.find('div').remove(); - + // Change dialog width $('#addBladeCenter').dialog('option', 'width', '400'); - + var nodeType = $(this).val(); switch (nodeType) { case 'amm': @@ -208,17 +208,17 @@ bladePlugin.prototype.addNode = function() { break; case 'scan': settingsFS.append('
    '); - + // Change dialog width $('#addBladeCenter').dialog('option', 'width', '650'); break; } - + // Do not continue if node type is AMM if ($(this).val() == 'amm') { return; } - + // Gather AMM nodes settingsFS.find('select:eq(0)').after(createLoader()); $.ajax({ @@ -234,16 +234,16 @@ bladePlugin.prototype.addNode = function() { var position = 0; var tmp = ''; var options = ''; - + // Remove the loading image settingsFS.find('img').remove(); - + // Do not continue if no AMM nodes are found if (data.rsp.length < 1) { $('#addBladeCenter').prepend(createWarnBar('Please define an AMM node before continuing')); return; } - + // Create options for AMM nodes for (var i in data.rsp){ tmp = data.rsp[i]; @@ -257,7 +257,7 @@ bladePlugin.prototype.addNode = function() { if (data.msg != 'scan') { return; } - + // Create Scan button var scan = createButton('Scan'); scan.bind('click', function(){ @@ -273,10 +273,10 @@ bladePlugin.prototype.addNode = function() { args : '', msg : '' }, - + /** * Show scanned results for AMM - * + * * @param data Data returned from HTTP request */ success: function(data){ @@ -284,12 +284,12 @@ bladePlugin.prototype.addNode = function() { } }); }); - + settingsFS.find('select:eq(0)').after(scan); } }); }); - + // Create dialog for BladeCenter addNodeForm.dialog({ modal : true, @@ -306,7 +306,7 @@ bladePlugin.prototype.addNode = function() { // Remove any existing warnings $('#addBladeCenter .ui-state-error').remove(); var addMethod = $('#typeSelect').val(); - + if (addMethod == "amm") { addAmmNode(); } else if(addMethod == "blade") { @@ -320,7 +320,7 @@ bladePlugin.prototype.addNode = function() { } } }); - + addNodeForm.find('#typeSelect').trigger('change'); }; @@ -331,16 +331,16 @@ bladePlugin.prototype.addNode = function() { function addAmmNode(){ var args = ''; var errorMsg = ''; - + // Check for missing inputs $('#addBladeCenter input').each(function(){ if (!$(this).val()) { errorMsg = 'Please provide a value for each missing field!'; } - + args += $(this).val() + ','; }); - + // Do not continue if error was found if (errorMsg) { $('#addBladeCenter').prepend(createWarnBar(errorMsg)); @@ -348,7 +348,7 @@ function addAmmNode(){ } args = args.substring(0, args.length - 1); - + // Add the loader $('#addBladeCenter').append(createLoader()); $('.ui-dialog-buttonpane .ui-button').attr('disabled', true); @@ -385,17 +385,17 @@ function addBladeNode(){ var series = $('#bcSettings input[name="bladeSeries"]:selected').val(); var mpa = $('#bcSettings select[name="bladeMpa"]').val(); - var args = '-t;node;-o;' + name - + ';id=' + id - + ';nodetype=osi;groups=' + group - + ';mgt=blade;mpa=' + mpa + var args = '-t;node;-o;' + name + + ';id=' + id + + ';nodetype=osi;groups=' + group + + ';mgt=blade;mpa=' + mpa + ';serialflow=hard'; - + // Set the serial speed and port for LS series blade if (series != 'js') { args += ';serialspeed=19200;serialport=1'; } - + // Check for missing inputs if (!name || !group || !id || !mpa) { $('#addBladeCenter').prepend(createWarnBar("Please provide a value for each missing field!")); @@ -427,7 +427,7 @@ function addBladeNode(){ // Append response message to dialog $('#addBladeCenter').prepend(createInfoBar(rspMessage)); - + // Change dialog button $('#addBladeCenter').dialog("option", "buttons", { "Close" : function() { @@ -440,29 +440,29 @@ function addBladeNode(){ /** * Show rscan results - * + * * @param results Results from rscan of blade MPA */ function showScanAmmResult(results){ var rSection = $('
    '); - + // Create table to hold results var rTable = $('
    '); - + // Reset scan results area $('#addBladeCenter #scanResults').remove(); $('#bcSettings img').remove(); $('#bcSettings button').attr('disabled', ''); if (!results) return; - + // Do not continue if there are no results var rows = results.split("\n"); if (rows.length < 2){ $('#bcSettings').prepend(createWarnBar(rows[0])); return; } - + // Add the table header var fields = rows[0].match(/\S+/g); var column = fields.length; @@ -472,23 +472,23 @@ function showScanAmmResult(results){ row.append('' + fields[i] + ''); } rTable.append(row); - + // Add table body var line; for (var i = 1; i < rows.length; i++) { line = rows[i]; - + if (!line) continue; - + var fields = line.match(/\S+/g); if (fields[0] == 'mm') continue; - + // Create a row for each result var row = $(''); row.append(''); - + // Add column for each field for (var j = 0; j < column; j++){ if (fields[j]) { @@ -501,11 +501,11 @@ function showScanAmmResult(results){ row.append(''); } } - + // Append row to table rTable.append(row); } - + rSection.append(rTable); $('#bcSettings').prepend(rSection); } @@ -517,25 +517,25 @@ function addMmScanNode(){ // Get the AMM name var ammName = $('#bcSettings select').val(); var nodeName = ''; - + $('#bcSettings :checked').each(function() { if ($(this).attr('name')) { nodeName += $(this).attr('name') + ','; nodeName += $(this).parents('tr').find('input').eq(1).val() + ','; } }); - + if (!nodeName) { $('#addBladeCenter').prepend(createWarnBar('Please select a node!')); return; } - + // Disabled button $('.ui-dialog-buttonpane button').attr('disabled', 'disabled'); - + nodeName = nodeName.substr(0, nodeName.length - 1); $('#nodeAttrs').append(createLoader()); - + // Send add request $.ajax({ url : 'lib/cmd.php', @@ -554,7 +554,7 @@ function addMmScanNode(){ /** * Create provision existing node division - * + * * @param inst Provision tab instance * @return Provision existing node division */ @@ -566,22 +566,22 @@ function createBladeProvisionExisting(inst) { var nodeFS = $('
    '); var nodeLegend = $('Node'); nodeFS.append(nodeLegend); - + var nodeAttr = $('
    '); nodeFS.append($('
    ')); nodeFS.append(nodeAttr); - + // Create image fieldset var imgFS = $('
    '); var imgLegend = $('Image'); imgFS.append(imgLegend); - + var imgAttr = $('
    '); imgFS.append($('
    ')); imgFS.append(imgAttr); - + provExisting.append(nodeFS, imgFS); - + // Create group input var group = $('
    '); var groupLabel = $(''); @@ -589,7 +589,7 @@ function createBladeProvisionExisting(inst) { // Turn on auto complete for group var dTableDivId = 'bladeNodesDatatableDIV' + inst; // Division ID where nodes datatable will be appended - var groupNames = $.cookie('groups'); + var groupNames = $.cookie('xcat_groups'); if (groupNames) { // Split group names into an array var tmp = groupNames.split(','); @@ -642,13 +642,13 @@ function createBladeProvisionExisting(inst) { method.append(methodLabel); method.append(methodSelect); imgAttr.append(method); - + // Create operating system input var os = $('
    '); var osLabel = $(''); var osInput = $(''); osInput.one('focus', function() { - var tmp = $.cookie('osvers'); + var tmp = $.cookie('xcat_osvers'); if (tmp) { // Turn on auto complete $(this).autocomplete({ @@ -665,7 +665,7 @@ function createBladeProvisionExisting(inst) { var archLabel = $(''); var archInput = $(''); archInput.one('focus', function() { - var tmp = $.cookie('osarchs'); + var tmp = $.cookie('xcat_osarchs'); if (tmp) { // Turn on auto complete $(this).autocomplete({ @@ -682,7 +682,7 @@ function createBladeProvisionExisting(inst) { var profileLabel = $(''); var profileInput = $(''); profileInput.one('focus', function() { - var tmp = $.cookie('profiles'); + var tmp = $.cookie('xcat_profiles'); if (tmp) { // Turn on auto complete $(this).autocomplete({ @@ -706,7 +706,7 @@ function createBladeProvisionExisting(inst) { // Get provision tab ID var thisTabId = 'bladeProvisionTab' + inst; - + // Get nodes that were checked var dTableId = 'bladeNodesDatatable' + inst; var tgts = getNodesChecked(dTableId); @@ -714,7 +714,7 @@ function createBladeProvisionExisting(inst) { errorMessage += 'You need to select a node. '; ready = false; } - + // Check booth method var boot = $('#' + thisTabId + ' select[name=bootMethod]'); if (!boot.val()) { @@ -724,7 +724,7 @@ function createBladeProvisionExisting(inst) { } else { boot.css('border', 'solid #BDBDBD 1px'); } - + // Check operating system image var os = $('#' + thisTabId + ' input[name=os]'); if (!os.val()) { @@ -734,7 +734,7 @@ function createBladeProvisionExisting(inst) { } else { os.css('border', 'solid #BDBDBD 1px'); } - + // Check architecture var arch = $('#' + thisTabId + ' input[name=arch]'); if (!arch.val()) { @@ -744,7 +744,7 @@ function createBladeProvisionExisting(inst) { } else { arch.css('border', 'solid #BDBDBD 1px'); } - + // Check profile var profile = $('#' + thisTabId + ' input[name=profile]'); if (!profile.val()) { @@ -754,12 +754,12 @@ function createBladeProvisionExisting(inst) { } else { profile.css('border', 'solid #BDBDBD 1px'); } - + // If all inputs are valid, ready to provision - if (ready) { + if (ready) { // Disable provision button $(this).attr('disabled', 'true'); - + // Prepend status bar var statBar = createStatusBar('bladeProvisionStatBar' + inst); statBar.append(createLoader('')); @@ -768,11 +768,11 @@ function createBladeProvisionExisting(inst) { // Disable all inputs var inputs = $('#' + thisTabId + ' input'); inputs.attr('disabled', 'disabled'); - + // Disable all selects var selects = $('#' + thisTabId + ' select'); selects.attr('disabled', 'disabled'); - + /** * (1) Set operating system */ @@ -801,7 +801,7 @@ function createBladeProvisionExisting(inst) { /** * Update the provision existing node status - * + * * @param data Data returned from HTTP request */ function updateBladeProvisionExistingStatus(data) { @@ -813,11 +813,11 @@ function updateBladeProvisionExistingStatus(data) { var cmd = args[0].replace('cmd=', ''); // Get provision tab instance var inst = args[1].replace('out=', ''); - + // Get provision tab and status bar ID var statBarId = 'bladeProvisionStatBar' + inst; var tabId = 'bladeProvisionTab' + inst; - + /** * (2) Remote install */ @@ -830,11 +830,11 @@ function updateBladeProvisionExistingStatus(data) { var os = $('#' + tabId + ' input[name="os"]').val(); var profile = $('#' + tabId + ' input[name="profile"]').val(); var arch = $('#' + tabId + ' input[name="arch"]').val(); - + // Get nodes that were checked var dTableId = 'bladeNodesDatatable' + inst; var tgts = getNodesChecked(dTableId); - + // Begin installation $.ajax( { url : 'lib/cmd.php', @@ -848,19 +848,19 @@ function updateBladeProvisionExistingStatus(data) { success : updateBladeProvisionExistingStatus }); - } - + } + /** * (3) Prepare node for boot */ if (cmd == 'nodeadd') { // Get provision method var bootMethod = $('#' + tabId + ' select[name=bootMethod]').val(); - + // Get nodes that were checked var dTableId = 'bladeNodesDatatable' + inst; var tgts = getNodesChecked(dTableId); - + // Prepare node for boot $.ajax( { url : 'lib/cmd.php', @@ -875,18 +875,18 @@ function updateBladeProvisionExistingStatus(data) { success : updateBladeProvisionExistingStatus }); } - + /** * (4) Power on node */ if (cmd == 'nodeset') { - var prg = writeRsp(rsp, ''); + var prg = writeRsp(rsp, ''); $('#' + statBarId).find('div').append(prg); - + // Get nodes that were checked var dTableId = 'bladeNodesDatatable' + inst; var tgts = getNodesChecked(dTableId); - + // Prepare node for boot $.ajax( { url : 'lib/cmd.php', @@ -901,16 +901,16 @@ function updateBladeProvisionExistingStatus(data) { success : updateBladeProvisionExistingStatus }); } - + /** * (5) Done */ else if (cmd == 'rpower') { // Write ajax response to status bar - var prg = writeRsp(rsp, ''); + var prg = writeRsp(rsp, ''); $('#' + statBarId).find('div').append(prg); $('#' + statBarId).find('img').remove(); - + // If installation was successful if (prg.html().indexOf('Error') == -1) { $('#' + statBarId).find('div').append('
    It will take several minutes before the nodes are up and ready. Use rcons to monitor the status of the install.
    '); diff --git a/xCAT-UI/js/custom/customUtils.js b/xCAT-UI/js/custom/customUtils.js index 51ab0498b..56b10854c 100644 --- a/xCAT-UI/js/custom/customUtils.js +++ b/xCAT-UI/js/custom/customUtils.js @@ -1,6 +1,6 @@ /** * Create nodes datatable for a given group - * + * * @param group Group name * @param outId Division ID to append datatable * @return Nodes datatable @@ -19,26 +19,26 @@ function createNodesDatatable(group, outId) { /** * Create nodes datatable - * + * * @param data Data returned from HTTP request */ success : function(data) { // Data returned var rsp = data.rsp; - + // Get output ID var outId = data.msg; // Get datatable ID var dTableId = outId.replace('DIV', ''); - + // Node attributes hash var attrs = new Object(); // Node attributes var headers = new Object(); - + // Clear nodes datatable division $('#' + outId).empty(); - + // Create nodes datatable var node = null; var args; @@ -48,22 +48,22 @@ function createNodesDatatable(group, outId) { if (pos > -1) { var temp = rsp[i].split(': '); node = jQuery.trim(temp[1]); - + // Create a hash for the node attributes attrs[node] = new Object(); i++; } - + // Get key and value args = rsp[i].split('='); var key = jQuery.trim(args[0]); var val = jQuery.trim(args[1]); - + // Create hash table attrs[node][key] = val; headers[key] = 1; } - + // Sort headers var sorted = new Array(); for ( var key in headers) { @@ -73,14 +73,14 @@ function createNodesDatatable(group, outId) { } } sorted.sort(); - + // Add column for check box and node sorted.unshift('', 'node'); - + // Create nodes datatable var dTable = new DataTable(dTableId); dTable.init(sorted); - + // Go through each node for ( var node in attrs) { // Create a row @@ -88,7 +88,7 @@ function createNodesDatatable(group, outId) { // Create a check box var checkBx = ''; row.push(checkBx, node); - + // Go through each header for ( var i = 2; i < sorted.length; i++) { // Add node attributes to the row @@ -100,11 +100,11 @@ function createNodesDatatable(group, outId) { row.push(''); } } - + // Add row to table dTable.add(row); } - + $('#' + outId).append(dTable.object()); $('#' + dTableId).dataTable({ 'iDisplayLength': 50, @@ -120,7 +120,7 @@ function createNodesDatatable(group, outId) { } } }); - + // Fix table styling $('#' + dTableId + '_wrapper .dataTables_filter label').css('width', '250px'); } // End of function(data) @@ -129,7 +129,7 @@ function createNodesDatatable(group, outId) { /** * Create provision existing node division - * + * * @param plugin Plugin name to create division for * @param inst Provision tab instance * @return Provision existing node division @@ -145,7 +145,7 @@ function createProvisionExisting(plugin, inst) { // Turn on auto complete for group var dTableDivId = plugin + 'NodesDatatableDIV' + inst; // Division ID where nodes datatable will be appended - var groupNames = $.cookie('groups'); + var groupNames = $.cookie('xcat_groups'); if (groupNames) { // Split group names into an array var tmp = groupNames.split(','); @@ -215,7 +215,7 @@ function createProvisionExisting(plugin, inst) { var osLabel = $(''); var osInput = $(''); osInput.one('focus', function() { - var tmp = $.cookie('osvers'); + var tmp = $.cookie('xcat_osvers'); if (tmp) { // Turn on auto complete $(this).autocomplete({ @@ -232,7 +232,7 @@ function createProvisionExisting(plugin, inst) { var archLabel = $(''); var archInput = $(''); archInput.one('focus', function() { - var tmp = $.cookie('osarchs'); + var tmp = $.cookie('xcat_osarchs'); if (tmp) { // Turn on auto complete $(this).autocomplete({ @@ -249,7 +249,7 @@ function createProvisionExisting(plugin, inst) { var profileLabel = $(''); var profileInput = $(''); profileInput.one('focus', function() { - var tmp = $.cookie('profiles'); + var tmp = $.cookie('xcat_profiles'); if (tmp) { // Turn on auto complete $(this).autocomplete({ @@ -276,7 +276,7 @@ function createProvisionExisting(plugin, inst) { /** * Create provision new node division - * + * * @param inst Provision tab instance * @return Provision new node division */ @@ -293,7 +293,7 @@ function createProvisionNew(plugin, inst) { var groupLabel = $(''); var groupInput = $(''); groupInput.one('focus', function() { - var groupNames = $.cookie('groups'); + var groupNames = $.cookie('xcat_groups'); if (groupNames) { // Turn on auto complete $(this).autocomplete({ @@ -336,7 +336,7 @@ function createProvisionNew(plugin, inst) { var osLabel = $(''); var osInput = $(''); osInput.one('focus', function() { - var tmp = $.cookie('osvers'); + var tmp = $.cookie('xcat_osvers'); if (tmp) { // Turn on auto complete $(this).autocomplete({ @@ -353,7 +353,7 @@ function createProvisionNew(plugin, inst) { var archLabel = $(''); var archInput = $(''); archInput.one('focus', function() { - var tmp = $.cookie('osarchs'); + var tmp = $.cookie('xcat_osarchs'); if (tmp) { // Turn on auto complete $(this).autocomplete({ @@ -370,7 +370,7 @@ function createProvisionNew(plugin, inst) { var profileLabel = $(''); var profileInput = $(''); profileInput.one('focus', function() { - var tmp = $.cookie('profiles'); + var tmp = $.cookie('xcat_profiles'); if (tmp) { // Turn on auto complete $(this).autocomplete({ @@ -397,31 +397,31 @@ function createProvisionNew(plugin, inst) { /** * Create section to provision node - * + * * @param plugin Plugin name * @param container Container to hold provision section */ function appendProvisionSection(plugin, container) { // Get provision tab ID var tabId = container.parents('.tab').attr('id'); - - if (plugin == 'quick') + + if (plugin == 'quick') appendProvision4Url(container); // For provisioning based on argmunents found in URL else appendProvision4NoUrl(plugin, container); - + // Add provision button var provisionBtn = createButton('Provision'); provisionBtn.bind('click', function(){ provisionNode(tabId); }); container.append(provisionBtn); - + // Bind image select to change event container.find('select[name=image]').bind('change', function() { createAdvancedOptions($(this).val(), tabId); }); - + $.ajax({ url : 'lib/cmd.php', dataType : 'json', @@ -441,15 +441,15 @@ function appendProvisionSection(plugin, container) { $('#' + tabId).prepend(createWarnBar('Please run copycds and genimage in provision page before continuing!')); return; } - + for (i in data.rsp) { imageName = data.rsp[i]; position = imageName.indexOf(' '); imageName = imageName.substr(0, position); - + $('#' + tabId + ' select[name=image]').append($('')); } - + // Trigger select change event $('#' + tabId + ' select[name=image]').trigger('change'); // Show provision button @@ -460,102 +460,102 @@ function appendProvisionSection(plugin, container) { /** * Create provision node section using URL - * + * * @param container Container to hold provision section * @returns Nothing */ -function appendProvision4Url(container){ +function appendProvision4Url(container){ // Create node fieldset var nodeFS = $('
    '); var nodeLegend = $('Node'); nodeFS.append(nodeLegend); container.append(nodeFS); - + var nodeAttr = $('
    '); nodeFS.append($('
    ')); nodeFS.append(nodeAttr); - + // Create image fieldset var imgFS = $('
    '); var imgLegend = $('Image'); imgFS.append(imgLegend); container.append(imgFS); - + var imgAttr = $('
    '); imgFS.append($('
    ')); imgFS.append(imgAttr); - + var query = window.location.search; var args = query.substr(1).split('&'); var parms = new Object(); var tmp; - + // Turn URL arguments into hash array for (var i = 0; i < args.length; i++) { tmp = args[i].split('='); parms[tmp[0]] = tmp[1]; } - + var master = ''; if (parms['master']) master = parms['master']; - + var nfsserver = ''; if (parms['nfsserver']) nfsserver = parms['nfsserver']; - + var tftpserver = ''; if (parms['tftpserver']) tftpserver = parms['tftpserver']; - + nodeAttr.append('
    '); - + imgAttr.append('
    '); imgAttr.append('
    '); imgAttr.append( '
    '); - imgAttr.append('
    '); + imgAttr.append('
    '); imgAttr.append('
    '); imgAttr.append('
    '); imgAttr.append('
    '); - + return; } /** * Create section to provision node using no URL - * + * * @param plugin Create provision section for given plugin * @param container Container to hold provision section */ function appendProvision4NoUrl(plugin, container){ // Get provision tab ID var tabId = container.parents('.tab').attr('id'); - + // Create node fieldset var nodeFS = $('
    '); var nodeLegend = $('Node'); nodeFS.append(nodeLegend); container.append(nodeFS); - + var nodeAttr = $('
    '); nodeFS.append($('
    ')); nodeFS.append(nodeAttr); - + // Create image fieldset var imgFS = $('
    '); var imgLegend = $('Image'); imgFS.append(imgLegend); container.append(imgFS); - + var imgAttr = $('
    '); imgFS.append($('
    ')); imgFS.append(imgAttr); - + // Select group name var group = $('
    ').append(''); var groupSelect = $(''); group.append(groupSelect); - var groupNames = $.cookie('groups'); + var groupNames = $.cookie('xcat_groups'); if (groupNames) { var tmp = groupNames.split(','); groupSelect.append(''); // Append empty group name @@ -569,14 +569,14 @@ function appendProvision4NoUrl(plugin, container){ var nodesTable = $('

    Select a group to view its nodes

    '); nodes.append(nodesTable); nodeAttr.append(nodes); - + // Select architecture - var arch = $('
    ').append(''); - var archName = $.cookie('osarchs'); + var arch = $('
    ').append(''); + var archName = $.cookie('xcat_osarchs'); if (archName) { var archSelect = $(''); arch.append(archSelect); - + var tmp = archName.split(','); for (var i in tmp) archSelect.append(''); @@ -591,30 +591,30 @@ function appendProvision4NoUrl(plugin, container){ imgAttr.append('
    '); imgAttr.append('
    '); imgAttr.append('
    '); - + // When a group is selected, show the nodes belonging to that group groupSelect.bind('change', function() { var nodesTableId = '#' + tabId + ' #nodesTable'; $(nodesTableId).append(createLoader()); createNodesTable($(this).val(), nodesTableId); }); - + return; } /** * Provision node - * + * * @param tabId Provision tab ID */ function provisionNode(tabId) { var errorMessage = ""; var args = new Array(); var node = ""; - + // Delete any existing warnings $('#' + tabId + ' .ui-state-error').remove(); - + // Go through each input $('#' + tabId + ' input[type!="checkbox"]').each(function() { if (!$(this).val()) { @@ -624,13 +624,13 @@ function provisionNode(tabId) { args.push($(this).val()); } }); - + // Do not continue if error was found if (errorMessage) { $('#' + tabId).prepend(createWarnBar(errorMessage)); return; } - + // If jumped from nodes page, get node name if (tabId == 'quick') { node = args.shift(); @@ -639,25 +639,25 @@ function provisionNode(tabId) { args.unshift($('#' + tabId + ' input[name=arch]').val()); node = getCheckedByObj($('#' + tabId + ' #nodesTable')); } - + // Do not continue if a node is not given if (!node) { $('#' + tabId).prepend(createWarnBar('Please select a node!')); return; } - + var software = getCheckedByObj($('#' + tabId + ' #advanced')); var imageName = $('#' + tabId + ' select[name=image]').val(); var provision = args.join(','); - - var url = 'lib/cmd.php?cmd=webrun&tgt=&args=provision;' + + + var url = 'lib/cmd.php?cmd=webrun&tgt=&args=provision;' + node + ';' + imageName + ';' + provision + ';' + software + '&msg=&opts=flush'; $('#' + tabId).prepend(createIFrame(url)); } /** * Create advance option - * + * * @param image Image name * @param outId Output area ID */ @@ -678,29 +678,29 @@ function createAdvancedOptions(image, outId) { var provMethod = ''; var tmpStr = ''; var position = 0; - + for (var i = 0; i < data.rsp.length; i++) { tmpStr = data.rsp[i]; if (tmpStr.indexOf('osname') != -1) { position = tmpStr.indexOf('='); osName = tmpStr.substr(position + 1); } - + if (tmpStr.indexOf('provmethod') != -1) { position = tmpStr.indexOf('='); provMethod = tmpStr.substr(position + 1); } } - + $('#' + outId + ' #advanced').remove(); if (osName.toLowerCase() == 'aix') return; - + if (provMethod == 'install') { // Create advanced fieldset var advancedFS = $('
    ').append($('Advanced')); $('#' + outId + ' div.form fieldset:eq(1)').after(advancedFS); - + advancedFS.append('
    Install Ganglia monitoring
    '); } } @@ -709,11 +709,11 @@ function createAdvancedOptions(image, outId) { /** * Create nodes table - * + * * @param group Group name * @param outId Output section ID */ -function createNodesTable(group, outId) { +function createNodesTable(group, outId) { // Get group nodes $.ajax({ url : 'lib/cmd.php', @@ -728,26 +728,26 @@ function createNodesTable(group, outId) { success : function(data) { var outId = $(data.msg); var nodes = data.rsp; - + // Create table to hold nodes var nTable = $('
    '); var tHead = $(' Node '); nTable.append(tHead); var tBody = $(''); nTable.append(tBody); - + for (var i in nodes) { var node = nodes[i][0]; - + // Go to next node if there is nothing here if (!node) continue; // Insert node into table tBody.append('' + node + ''); } - + outId.empty().append(nTable); - + if (nodes.length > 10) outId.css('height', '300px'); else @@ -758,13 +758,13 @@ function createNodesTable(group, outId) { /** * Get select element names - * + * * @param obj Object to get selected element names * @return Nodes name seperate by a comma */ function getCheckedByObj(obj) { var str = ''; - + // Get nodes that were checked obj.find('input:checked').each(function() { if ($(this).attr('name')) { @@ -781,7 +781,7 @@ function getCheckedByObj(obj) { /** * Select all checkboxes in the table - * + * * @param event Event on element * @param obj Object triggering event */ diff --git a/xCAT-UI/js/custom/esx.js b/xCAT-UI/js/custom/esx.js index 901e8f95a..c20b05c3c 100644 --- a/xCAT-UI/js/custom/esx.js +++ b/xCAT-UI/js/custom/esx.js @@ -7,7 +7,7 @@ $(document).ready(function() { /** * Constructor - * + * * @return Nothing */ var esxPlugin = function() { @@ -17,9 +17,9 @@ var esxPlugin = function() { /** * Configure self-service page */ -esxPlugin.prototype.loadConfigPage = function(tabId) { +esxPlugin.prototype.loadConfigPage = function(tabId) { var configAccordion = $('
    '); - + // Create accordion panel for profiles var profileSection = $('
    '); var profileLnk = $('

    Profiles

    ').click(function () { @@ -34,11 +34,11 @@ esxPlugin.prototype.loadConfigPage = function(tabId) { // Add info bar $('#esxConfigProfile').append(createInfoBar('Not yet supported')); - + // Resize accordion configAccordion.accordion('resize'); }); - + // Create accordion panel for images var imgSection = $('
    '); var imgLnk = $('

    Images

    ').click(function () { @@ -50,7 +50,7 @@ esxPlugin.prototype.loadConfigPage = function(tabId) { queryImages('esxConfigImages'); }); - + // Create accordion panel for groups var groupsSection = $('
    '); var groupsLnk = $('

    Groups

    ').click(function () { @@ -62,17 +62,17 @@ esxPlugin.prototype.loadConfigPage = function(tabId) { queryGroups('esxConfigGroups'); }); - + configAccordion.append(profileLnk, profileSection, imgLnk, imgSection, groupsLnk, groupsSection); $('#' + tabId).append(configAccordion); configAccordion.accordion(); - + profileLnk.trigger('click'); }; /** * Migrate node - * + * * @param node Node to migrate */ esxPlugin.prototype.loadMigratePage = function(node) { @@ -81,7 +81,7 @@ esxPlugin.prototype.loadMigratePage = function(node) { /** * Clone node (service page) - * + * * @param node Node to clone */ esxPlugin.prototype.serviceClone = function(node) { @@ -90,7 +90,7 @@ esxPlugin.prototype.serviceClone = function(node) { /** * Load provision page (service page) - * + * * @param tabId * Tab ID where page will reside * @return Nothing @@ -101,23 +101,23 @@ esxPlugin.prototype.loadServiceProvisionPage = function(tabId) { /** * Show node inventory (service page) - * + * * @param data Data from HTTP request */ esxPlugin.prototype.loadServiceInventory = function(data) { - + }; /** * Load node inventory - * + * * @param data Data from HTTP request */ esxPlugin.prototype.loadInventory = function(data) { var args = data.msg.split(','); var tabId = args[0].replace('out=', ''); var node = args[1].replace('node=', ''); - + // Get node inventory var inv = data.rsp; @@ -127,12 +127,12 @@ esxPlugin.prototype.loadInventory = function(data) { // Create division to hold inventory var invDivId = tabId + 'Inventory'; var invDiv = $('
    '); - + // Create a fieldset var fieldSet = $('
    '); var legend = $('Hardware'); fieldSet.append(legend); - + var oList = $('
      '); fieldSet.append(oList); invDiv.append(fieldSet); @@ -156,7 +156,7 @@ esxPlugin.prototype.loadInventory = function(data) { /** * Load clone page - * + * * @param node Source node to clone */ esxPlugin.prototype.loadClonePage = function(node) { @@ -176,13 +176,13 @@ esxPlugin.prototype.loadClonePage = function(node) { // Add clone tab tab.add(newTabId, 'Clone', cloneForm, true); } - + tab.select(newTabId); }; /** * Load provision page - * + * * @param tabId The provision tab ID */ esxPlugin.prototype.loadProvisionPage = function(tabId) { @@ -223,36 +223,36 @@ esxPlugin.prototype.loadProvisionPage = function(tabId) { // Append to provision tab $('#' + tabId).append(provForm); - + // Create VM fieldset var vmFS = $('
      '); var vmLegend = $('Virtual Machine'); vmFS.append(vmLegend); - + var vmAttr = $('
      '); vmFS.append($('
      ')); vmFS.append(vmAttr); - + // Create hardware fieldset var hwFS = $('
      '); var hwLegend = $('Hardware'); hwFS.append(hwLegend); - + var hwAttr = $('
      '); hwFS.append($('
      ')); hwFS.append(hwAttr); - + // Create image fieldset var imgFS = $('
      '); var imgLegend = $('Image'); imgFS.append(imgLegend); - + var imgAttr = $('
      '); imgFS.append($('
      ')); imgFS.append(imgAttr); - + provForm.append(vmFS, hwFS, imgFS); - + // Create hypervisor input var host = $('
      '); var hostLabel = $(''); @@ -260,14 +260,14 @@ esxPlugin.prototype.loadProvisionPage = function(tabId) { var hostInput = $(''); host.append(hostInput); vmAttr.append(host); - + // Create group input var group = $('
      '); var groupLabel = $(''); group.append(groupLabel); // Turn on auto complete for group - var groupNames = $.cookie('groups'); + var groupNames = $.cookie('xcat_groups'); if (groupNames) { // Split group names into an array var tmp = groupNames.split(','); @@ -303,7 +303,7 @@ esxPlugin.prototype.loadProvisionPage = function(tabId) { memory.append(memoryLabel); memory.append(memoryInput); hwAttr.append(memory); - + // Create processor dropdown var cpu = $('
      '); var cpuLabel = $(''); @@ -320,7 +320,7 @@ esxPlugin.prototype.loadProvisionPage = function(tabId) { cpu.append(cpuLabel); cpu.append(cpuSelect); hwAttr.append(cpu); - + // Create NIC dropdown var nic = $('
      '); var nicLabel = $(''); @@ -328,7 +328,7 @@ esxPlugin.prototype.loadProvisionPage = function(tabId) { nic.append(nicLabel); nic.append(nicInput); hwAttr.append(nic); - + // Create disk input var disk = $('
      '); var diskLabel = $(''); @@ -339,7 +339,7 @@ esxPlugin.prototype.loadProvisionPage = function(tabId) { ); disk.append(diskLabel, diskInput, diskSizeSelect); hwAttr.append(disk); - + // Create disk storage input var storage = $('
      '); var storageLabel = $(''); @@ -347,13 +347,13 @@ esxPlugin.prototype.loadProvisionPage = function(tabId) { storage.append(storageLabel); storage.append(storageInput); hwAttr.append(storage); - + // Create operating system input var os = $('
      '); var osLabel = $(''); var osInput = $(''); osInput.one('focus', function() { - var tmp = $.cookie('osvers'); + var tmp = $.cookie('xcat_osvers'); if (tmp) { // Turn on auto complete $(this).autocomplete({ @@ -364,13 +364,13 @@ esxPlugin.prototype.loadProvisionPage = function(tabId) { os.append(osLabel); os.append(osInput); imgAttr.append(os); - + // Create architecture input var arch = $('
      '); var archLabel = $(''); var archInput = $(''); archInput.one('focus', function() { - var tmp = $.cookie('osarchs'); + var tmp = $.cookie('xcat_osarchs'); if (tmp) { // Turn on auto complete $(this).autocomplete({ @@ -381,13 +381,13 @@ esxPlugin.prototype.loadProvisionPage = function(tabId) { arch.append(archLabel); arch.append(archInput); imgAttr.append(arch); - + // Create profile input var profile = $('
      '); var profileLabel = $(''); var profileInput = $(''); profileInput.one('focus', function() { - var tmp = $.cookie('profiles'); + var tmp = $.cookie('xcat_profiles'); if (tmp) { // Turn on auto complete $(this).autocomplete({ @@ -398,7 +398,7 @@ esxPlugin.prototype.loadProvisionPage = function(tabId) { profile.append(profileLabel); profile.append(profileInput); imgAttr.append(profile); - + // Create boot method dropdown var method = $('
      '); var methodLabel = $(''); @@ -422,10 +422,10 @@ esxPlugin.prototype.loadProvisionPage = function(tabId) { // Remove any warning messages $(this).parents('.ui-tabs-panel').find('.ui-state-error').remove(); var ready = true; - + // Get tab ID var tabId = $(this).parents('.ui-tabs-panel').attr('id'); - + // Check if fields are properly filled in var inputs = $('#' + tabId + ' input:visible'); for ( var i = 0; i < inputs.length; i++) { @@ -436,7 +436,7 @@ esxPlugin.prototype.loadProvisionPage = function(tabId) { inputs.eq(i).css('border', 'solid #BDBDBD 1px'); } } - + var selects = $('#' + tabId + ' select:visible'); for ( var i = 0; i < selects.length; i++) { if (!selects.eq(i).val()) { @@ -446,30 +446,30 @@ esxPlugin.prototype.loadProvisionPage = function(tabId) { selects.eq(i).css('border', 'solid #BDBDBD 1px'); } } - + if (ready) { var inst = tabId.replace('kvmProvisionTab', ''); - + // Prepend status bar var statBar = createStatusBar('kvmProvisionStatBar' + inst); statBar.append(createLoader('')); statBar.prependTo($('#' + tabId)); - + var host = $('#' + tabId + ' input[name=host]').val(); var group = $('#' + tabId + ' select[name=group]').val(); var node = $('#' + tabId + ' input[name=node]').val(); - + var memory = $('#' + tabId + ' input[name=memory]').val(); var cpu = $('#' + tabId + ' select[name=cpu]').val(); var nic = $('#' + tabId + ' input[name=nic]').val(); var disk = $('#' + tabId + ' input[name=disk]').val() + $('#' + tabId + ' select[name=diskUnit]').val(); var storage = $('#' + tabId + ' input[name=storage]').val(); - + var os = $('#' + tabId + ' input[name=os]').val(); var arch = $('#' + tabId + ' input[name=arch]').val(); var profile = $('#' + tabId + ' input[name=profile]').val(); var boot = $('#' + tabId + ' select[name=bootMethod]').val(); - + /** * (1) Define node */ @@ -517,14 +517,14 @@ esxPlugin.prototype.loadResources = function() { var tabId = 'esxResourceTab'; // Remove loader $('#' + tabId).find('img').remove(); - + // Create info bar var infoBar = createInfoBar('Not yet supported'); // Create resource form var resrcForm = $('
      '); resrcForm.append(infoBar); - + $('#' + tabId).append(resrcForm); }; @@ -535,13 +535,13 @@ esxPlugin.prototype.addNode = function() { var dialog = $('
      '); var info = createInfoBar('Add a ESX node'); dialog.append(info); - + // Create node inputs dialog.append($('
      ')); dialog.append($('
      ')); dialog.append($('
      ')); dialog.append($('
      ')); - + dialog.dialog({ title: 'Add node', modal: true, @@ -560,13 +560,13 @@ esxPlugin.prototype.addNode = function() { function addEsxNode(){ var attr, args; var errorMessage = ''; - + // Remove existing warnings $('#addEsx .ui-state-error').remove(); - + // Return input border colors to normal $('#addEsx input').css('border', 'solid #BDBDBD 1px'); - + // Check node attributes $('#addEsx input').each(function(){ attr = $(this).val(); @@ -575,28 +575,28 @@ function addEsxNode(){ $(this).css('border', 'solid #FF0000 1px'); } }); - + // Show error message (if any) if (errorMessage) { $('#addEsx').prepend(createWarnBar(errorMessage)); return; } - + // Create loader $('#addEsx').append(createLoader()); - + // Change dialog buttons $('#addEsx').dialog('option', 'buttons', { 'Close':function() { $('#addEsx').dialog('destroy').remove(); } }); - + // Generate chdef arguments args = '-t;node;-o;' + $('#addEsx input[name="node"]').val() + ';ip=' + $('#addEsx input[name="ip"]').val() - + ';groups=' + $('#addEsx input[name="groups"]').val() - + ';vmhost=' + $('#addEsx input[name="vmhost"]').val() + + ';groups=' + $('#addEsx input[name="groups"]').val() + + ';vmhost=' + $('#addEsx input[name="vmhost"]').val() + ';mgt=esx;netboot=xnba;nodetype=osi;profile=compute'; $.ajax({ url : 'lib/cmd.php', @@ -619,16 +619,16 @@ function addEsxNode(){ msg : '' } }); - + // Remove loader $('#addEsx img').remove(); - + // Get return message var message = ''; for (var i in data.rsp) { message += data.rsp[i] + '
      '; } - + // Show return message if (message) $('#addEsx').prepend(createInfoBar(message)); @@ -638,7 +638,7 @@ function addEsxNode(){ /** * Update the provision node status - * + * * @param data Data returned from HTTP request */ function updateESXProvisionStatus(data) { @@ -650,24 +650,24 @@ function updateESXProvisionStatus(data) { var cmd = args[0].replace('cmd=', ''); // Get provision tab instance var inst = args[1].replace('out=', ''); - + // Get provision tab and status bar ID var statBarId = 'kvmProvisionStatBar' + inst; var tabId = 'kvmProvisionTab' + inst; - + var node = $('#' + tabId + ' input[name=node]').val(); - + /** * (2) Create virtual machine */ if (cmd == 'chdef') { // Write ajax response to status bar - var prg = writeRsp(rsp, ''); + var prg = writeRsp(rsp, ''); $('#' + statBarId).find('div').append(prg); // Get parameters var disk = $('#' + tabId + ' input[name=disk]').val() + $('#' + tabId + ' select[name=diskUnit]').val(); - + // Begin installation $.ajax( { url : 'lib/cmd.php', @@ -681,19 +681,19 @@ function updateESXProvisionStatus(data) { success : updateESXProvisionStatus }); - } - + } + /** * (3) Prepare node for boot */ if (cmd == 'mkvm') { // Write ajax response to status bar - var prg = writeRsp(rsp, ''); + var prg = writeRsp(rsp, ''); $('#' + statBarId).find('div').append(prg); - + // Get provision method var boot = $('#' + tabId + ' select[name=bootMethod]').val(); - + // Prepare node for boot $.ajax( { url : 'lib/cmd.php', @@ -708,14 +708,14 @@ function updateESXProvisionStatus(data) { success : updateESXProvisionStatus }); } - + /** * (4) Power on node */ if (cmd == 'nodeset') { - var prg = writeRsp(rsp, ''); + var prg = writeRsp(rsp, ''); $('#' + statBarId).find('div').append(prg); - + // Prepare node for boot $.ajax( { url : 'lib/cmd.php', @@ -730,16 +730,16 @@ function updateESXProvisionStatus(data) { success : updateESXProvisionStatus }); } - + /** * (5) Done */ else if (cmd == 'rpower') { // Write ajax response to status bar - var prg = writeRsp(rsp, ''); + var prg = writeRsp(rsp, ''); $('#' + statBarId).find('div').append(prg); $('#' + statBarId).find('img').remove(); - + // If installation was successful if (prg.html().indexOf('Error') == -1) { $('#' + statBarId).find('div').append('
      It will take several minutes before the nodes are up and ready. Use rcons to monitor the status of the install.
      '); diff --git a/xCAT-UI/js/custom/ipmi.js b/xCAT-UI/js/custom/ipmi.js index 839d94d60..8adf1c915 100644 --- a/xCAT-UI/js/custom/ipmi.js +++ b/xCAT-UI/js/custom/ipmi.js @@ -14,7 +14,7 @@ var ipmiPlugin = function() { /** * Steps for hardware discovery wizard - * + * * @return Discovery steps */ ipmiPlugin.prototype.getStep = function() { @@ -37,7 +37,7 @@ ipmiPlugin.prototype.getNextFunction = function() { /** * Load node inventory - * + * * @param data Data from HTTP request */ ipmiPlugin.prototype.loadInventory = function(data) { @@ -82,7 +82,7 @@ ipmiPlugin.prototype.loadInventory = function(data) { /** * Load clone page - * + * * @param node Source node to clone */ ipmiPlugin.prototype.loadClonePage = function(node) { @@ -108,7 +108,7 @@ ipmiPlugin.prototype.loadClonePage = function(node) { /** * Load provision page - * + * * @param tabId The provision tab ID */ ipmiPlugin.prototype.loadProvisionPage = function(tabId) { @@ -297,7 +297,7 @@ function addIdataplex() { /** * Create provision existing node division - * + * * @param inst Provision tab instance * @return Provision existing node division */ @@ -336,7 +336,7 @@ function createIpmiProvisionExisting(inst) { var dTableDivId = 'ipmiNodesDatatableDIV' + inst; // Division ID where // nodes datatable will // be appended - var groupNames = $.cookie('groups'); + var groupNames = $.cookie('xcat_groups'); if (groupNames) { // Split group names into an array var tmp = groupNames.split(','); @@ -397,7 +397,7 @@ function createIpmiProvisionExisting(inst) { var osLabel = $(''); var osInput = $(''); osInput.one('focus', function() { - var tmp = $.cookie('osvers'); + var tmp = $.cookie('xcat_osvers'); if (tmp) { // Turn on auto complete $(this).autocomplete({ @@ -414,7 +414,7 @@ function createIpmiProvisionExisting(inst) { var archLabel = $(''); var archInput = $(''); archInput.one('focus', function() { - var tmp = $.cookie('osarchs'); + var tmp = $.cookie('xcat_osarchs'); if (tmp) { // Turn on auto complete $(this).autocomplete({ @@ -431,7 +431,7 @@ function createIpmiProvisionExisting(inst) { var profileLabel = $(''); var profileInput = $(''); profileInput.one('focus', function() { - var tmp = $.cookie('profiles'); + var tmp = $.cookie('xcat_profiles'); if (tmp) { // Turn on auto complete $(this).autocomplete({ @@ -553,7 +553,7 @@ function createIpmiProvisionExisting(inst) { /** * Update the provision existing node status - * + * * @param data Data returned from HTTP request */ function updateIpmiProvisionExistingStatus(data) { @@ -645,17 +645,17 @@ function idataplexInitBasic() { } showString += 'Start IP:'; - + showString += 'Nodes number
      per Frame:'; - + showString += '

      BMCs:

      '; showString += 'Name Range:'; - + if (getDiscoverEnv('idataplexbmcip')) { tempip = getDiscoverEnv('idataplexbmcip'); } else { @@ -663,12 +663,12 @@ function idataplexInitBasic() { } showString += 'Start IP:'; - + showString += '

      Switches:

      '; showString += 'Name Range:'; - + if (getDiscoverEnv('idataplexswitchip')) { tempip = getDiscoverEnv('idataplexswitchip'); } else { @@ -676,7 +676,7 @@ function idataplexInitBasic() { } showString += 'Start IP:'; - + showString += 'Nodes number
      per Switch:
      '); - + // Create accordion panel for profiles var profileSection = $('
      '); var profileLnk = $('

      Profiles

      ').click(function () { @@ -32,11 +32,11 @@ kvmPlugin.prototype.loadConfigPage = function(tabId) { // Add info bar $('#kvmConfigProfile').append(createInfoBar('Not yet supported')); - + // Resize accordion configAccordion.accordion('resize'); }); - + // Create accordion panel for images var imgSection = $('
      '); var imgLnk = $('

      Images

      ').click(function () { @@ -48,7 +48,7 @@ kvmPlugin.prototype.loadConfigPage = function(tabId) { queryImages('kvmConfigImages'); }); - + // Create accordion panel for groups var groupsSection = $('
      '); var groupsLnk = $('

      Groups

      ').click(function () { @@ -60,17 +60,17 @@ kvmPlugin.prototype.loadConfigPage = function(tabId) { queryGroups('kvmConfigGroups'); }); - + configAccordion.append(profileLnk, profileSection, imgLnk, imgSection, groupsLnk, groupsSection); $('#' + tabId).append(configAccordion); configAccordion.accordion(); - + profileLnk.trigger('click'); }; /** * Migrate node - * + * * @param node Node to migrate */ kvmPlugin.prototype.loadMigratePage = function(node) { @@ -79,7 +79,7 @@ kvmPlugin.prototype.loadMigratePage = function(node) { /** * Clone node (service page) - * + * * @param node Node to clone */ kvmPlugin.prototype.serviceClone = function(node) { @@ -88,7 +88,7 @@ kvmPlugin.prototype.serviceClone = function(node) { /** * Load provision page (service page) - * + * * @param tabId Tab ID where page will reside */ kvmPlugin.prototype.loadServiceProvisionPage = function(tabId) { @@ -97,23 +97,23 @@ kvmPlugin.prototype.loadServiceProvisionPage = function(tabId) { /** * Show node inventory (service page) - * + * * @param data Data from HTTP request */ kvmPlugin.prototype.loadServiceInventory = function(data) { - + }; /** * Load node inventory - * + * * @param data Data from HTTP request */ kvmPlugin.prototype.loadInventory = function(data) { var args = data.msg.split(','); var tabId = args[0].replace('out=', ''); var node = args[1].replace('node=', ''); - + // Get node inventory var inv = data.rsp; @@ -122,12 +122,12 @@ kvmPlugin.prototype.loadInventory = function(data) { // Create division to hold inventory var invDiv = $('
      '); - + // Create a fieldset var fieldSet = $('
      '); var legend = $('Hardware'); fieldSet.append(legend); - + var oList = $('
        '); fieldSet.append(oList); invDiv.append(fieldSet); @@ -151,7 +151,7 @@ kvmPlugin.prototype.loadInventory = function(data) { /** * Load clone page - * + * * @param node Source node to clone */ kvmPlugin.prototype.loadClonePage = function(node) { @@ -171,13 +171,13 @@ kvmPlugin.prototype.loadClonePage = function(node) { // Add clone tab tab.add(newTabId, 'Clone', cloneForm, true); } - + tab.select(newTabId); }; /** * Load provision page - * + * * @param tabId The provision tab ID */ kvmPlugin.prototype.loadProvisionPage = function(tabId) { @@ -218,36 +218,36 @@ kvmPlugin.prototype.loadProvisionPage = function(tabId) { // Append to provision tab $('#' + tabId).append(provForm); - + // Create VM fieldset var vmFS = $('
        '); var vmLegend = $('Virtual Machine'); vmFS.append(vmLegend); - + var vmAttr = $('
        '); vmFS.append($('
        ')); vmFS.append(vmAttr); - + // Create hardware fieldset var hwFS = $('
        '); var hwLegend = $('Hardware'); hwFS.append(hwLegend); - + var hwAttr = $('
        '); hwFS.append($('
        ')); hwFS.append(hwAttr); - + // Create image fieldset var imgFS = $('
        '); var imgLegend = $('Image'); imgFS.append(imgLegend); - + var imgAttr = $('
        '); imgFS.append($('
        ')); imgFS.append(imgAttr); - + provForm.append(vmFS, hwFS, imgFS); - + // Create hypervisor input var host = $('
        '); var hostLabel = $(''); @@ -255,14 +255,14 @@ kvmPlugin.prototype.loadProvisionPage = function(tabId) { var hostInput = $(''); host.append(hostInput); vmAttr.append(host); - + // Create group input var group = $('
        '); var groupLabel = $(''); group.append(groupLabel); // Turn on auto complete for group - var groupNames = $.cookie('groups'); + var groupNames = $.cookie('xcat_groups'); if (groupNames) { // Split group names into an array var tmp = groupNames.split(','); @@ -298,7 +298,7 @@ kvmPlugin.prototype.loadProvisionPage = function(tabId) { memory.append(memoryLabel); memory.append(memoryInput); hwAttr.append(memory); - + // Create processor dropdown var cpu = $('
        '); var cpuLabel = $(''); @@ -315,7 +315,7 @@ kvmPlugin.prototype.loadProvisionPage = function(tabId) { cpu.append(cpuLabel); cpu.append(cpuSelect); hwAttr.append(cpu); - + // Create NIC dropdown var nic = $('
        '); var nicLabel = $(''); @@ -323,7 +323,7 @@ kvmPlugin.prototype.loadProvisionPage = function(tabId) { nic.append(nicLabel); nic.append(nicInput); hwAttr.append(nic); - + // Create disk input var disk = $('
        '); var diskLabel = $(''); @@ -334,7 +334,7 @@ kvmPlugin.prototype.loadProvisionPage = function(tabId) { ); disk.append(diskLabel, diskInput, diskSizeSelect); hwAttr.append(disk); - + // Create disk storage input var storage = $('
        '); var storageLabel = $(''); @@ -342,13 +342,13 @@ kvmPlugin.prototype.loadProvisionPage = function(tabId) { storage.append(storageLabel); storage.append(storageInput); hwAttr.append(storage); - + // Create operating system input var os = $('
        '); var osLabel = $(''); var osInput = $(''); osInput.one('focus', function() { - var tmp = $.cookie('osvers'); + var tmp = $.cookie('xcat_osvers'); if (tmp) { // Turn on auto complete $(this).autocomplete({ @@ -359,13 +359,13 @@ kvmPlugin.prototype.loadProvisionPage = function(tabId) { os.append(osLabel); os.append(osInput); imgAttr.append(os); - + // Create architecture input var arch = $('
        '); var archLabel = $(''); var archInput = $(''); archInput.one('focus', function() { - var tmp = $.cookie('osarchs'); + var tmp = $.cookie('xcat_osarchs'); if (tmp) { // Turn on auto complete $(this).autocomplete({ @@ -376,13 +376,13 @@ kvmPlugin.prototype.loadProvisionPage = function(tabId) { arch.append(archLabel); arch.append(archInput); imgAttr.append(arch); - + // Create profile input var profile = $('
        '); var profileLabel = $(''); var profileInput = $(''); profileInput.one('focus', function() { - var tmp = $.cookie('profiles'); + var tmp = $.cookie('xcat_profiles'); if (tmp) { // Turn on auto complete $(this).autocomplete({ @@ -393,7 +393,7 @@ kvmPlugin.prototype.loadProvisionPage = function(tabId) { profile.append(profileLabel); profile.append(profileInput); imgAttr.append(profile); - + // Create boot method dropdown var method = $('
        '); var methodLabel = $(''); @@ -417,10 +417,10 @@ kvmPlugin.prototype.loadProvisionPage = function(tabId) { // Remove any warning messages $(this).parents('.ui-tabs-panel').find('.ui-state-error').remove(); var ready = true; - + // Get tab ID var tabId = $(this).parents('.ui-tabs-panel').attr('id'); - + // Check if fields are properly filled in var inputs = $('#' + tabId + ' input:visible'); for ( var i = 0; i < inputs.length; i++) { @@ -431,7 +431,7 @@ kvmPlugin.prototype.loadProvisionPage = function(tabId) { inputs.eq(i).css('border', 'solid #BDBDBD 1px'); } } - + var selects = $('#' + tabId + ' select:visible'); for ( var i = 0; i < selects.length; i++) { if (!selects.eq(i).val()) { @@ -441,30 +441,30 @@ kvmPlugin.prototype.loadProvisionPage = function(tabId) { selects.eq(i).css('border', 'solid #BDBDBD 1px'); } } - + if (ready) { var inst = tabId.replace('kvmProvisionTab', ''); - + // Prepend status bar var statBar = createStatusBar('kvmProvisionStatBar' + inst); statBar.append(createLoader('')); statBar.prependTo($('#' + tabId)); - + var host = $('#' + tabId + ' input[name=host]').val(); var group = $('#' + tabId + ' select[name=group]').val(); var node = $('#' + tabId + ' input[name=node]').val(); - + var memory = $('#' + tabId + ' input[name=memory]').val(); var cpu = $('#' + tabId + ' select[name=cpu]').val(); var nic = $('#' + tabId + ' input[name=nic]').val(); var disk = $('#' + tabId + ' input[name=disk]').val() + $('#' + tabId + ' select[name=diskUnit]').val(); var storage = $('#' + tabId + ' input[name=storage]').val(); - + var os = $('#' + tabId + ' input[name=os]').val(); var arch = $('#' + tabId + ' input[name=arch]').val(); var profile = $('#' + tabId + ' input[name=profile]').val(); var boot = $('#' + tabId + ' select[name=bootMethod]').val(); - + /** * (1) Define node */ @@ -512,14 +512,14 @@ kvmPlugin.prototype.loadResources = function() { var tabId = 'kvmResourceTab'; // Remove loader $('#' + tabId).find('img').remove(); - + // Create info bar var infoBar = createInfoBar('Not yet supported'); // Create resource form var resrcForm = $('
        '); resrcForm.append(infoBar); - + $('#' + tabId).append(resrcForm); }; @@ -530,13 +530,13 @@ kvmPlugin.prototype.addNode = function() { var dialog = $('
        '); var info = createInfoBar('Add a KVM node'); dialog.append(info); - + // Create node inputs dialog.append($('
        ')); dialog.append($('
        ')); dialog.append($('
        ')); dialog.append($('
        ')); - + dialog.dialog({ title: 'Add node', modal: true, @@ -555,13 +555,13 @@ kvmPlugin.prototype.addNode = function() { function addKvmNode(){ var attr, args; var errorMessage = ''; - + // Remove existing warnings $('#addKvm .ui-state-error').remove(); - + // Return input border colors to normal $('#addKvm input').css('border', 'solid #BDBDBD 1px'); - + // Check node attributes $('#addKvm input').each(function(){ attr = $(this).val(); @@ -570,28 +570,28 @@ function addKvmNode(){ $(this).css('border', 'solid #FF0000 1px'); } }); - + // Show error message (if any) if (errorMessage) { $('#addKvm').prepend(createWarnBar(errorMessage)); return; } - + // Create loader $('#addKvm').append(createLoader()); - + // Change dialog buttons $('#addKvm').dialog('option', 'buttons', { 'Close':function(){ $('#addKvm').dialog('destroy').remove(); } }); - + // Generate chdef arguments args = '-t;node;-o;' + $('#addKvm input[name="node"]').val() + ';ip=' + $('#addKvm input[name="ip"]').val() - + ';groups=' + $('#addKvm input[name="groups"]').val() - + ';vmhost=' + $('#addKvm input[name="vmhost"]').val() + + ';groups=' + $('#addKvm input[name="groups"]').val() + + ';vmhost=' + $('#addKvm input[name="vmhost"]').val() + ';mgt=kvm;netboot=xnba;nodetype=osi;profile=compute'; $.ajax({ url : 'lib/cmd.php', @@ -614,16 +614,16 @@ function addKvmNode(){ msg : '' } }); - + // Remove loader $('#addKvm img').remove(); - + // Get return message var message = ''; for (var i in data.rsp) { message += data.rsp[i] + '
        '; } - + // Show return message if (message) $('#addKvm').prepend(createInfoBar(message)); @@ -633,7 +633,7 @@ function addKvmNode(){ /** * Update the provision node status - * + * * @param data Data returned from HTTP request */ function updateKVMProvisionStatus(data) { @@ -645,24 +645,24 @@ function updateKVMProvisionStatus(data) { var cmd = args[0].replace('cmd=', ''); // Get provision tab instance var inst = args[1].replace('out=', ''); - + // Get provision tab and status bar ID var statBarId = 'kvmProvisionStatBar' + inst; var tabId = 'kvmProvisionTab' + inst; - + var node = $('#' + tabId + ' input[name=node]').val(); - + /** * (2) Create virtual machine */ if (cmd == 'chdef') { // Write ajax response to status bar - var prg = writeRsp(rsp, ''); + var prg = writeRsp(rsp, ''); $('#' + statBarId).find('div').append(prg); // Get parameters var disk = $('#' + tabId + ' input[name=disk]').val() + $('#' + tabId + ' select[name=diskUnit]').val(); - + // Begin installation $.ajax( { url : 'lib/cmd.php', @@ -676,19 +676,19 @@ function updateKVMProvisionStatus(data) { success : updateKVMProvisionStatus }); - } - + } + /** * (3) Prepare node for boot */ if (cmd == 'mkvm') { // Write ajax response to status bar - var prg = writeRsp(rsp, ''); + var prg = writeRsp(rsp, ''); $('#' + statBarId).find('div').append(prg); - + // Get provision method var boot = $('#' + tabId + ' select[name=bootMethod]').val(); - + // Prepare node for boot $.ajax( { url : 'lib/cmd.php', @@ -703,14 +703,14 @@ function updateKVMProvisionStatus(data) { success : updateKVMProvisionStatus }); } - + /** * (4) Power on node */ if (cmd == 'nodeset') { - var prg = writeRsp(rsp, ''); + var prg = writeRsp(rsp, ''); $('#' + statBarId).find('div').append(prg); - + // Prepare node for boot $.ajax( { url : 'lib/cmd.php', @@ -725,16 +725,16 @@ function updateKVMProvisionStatus(data) { success : updateKVMProvisionStatus }); } - + /** * (5) Done */ else if (cmd == 'rpower') { // Write ajax response to status bar - var prg = writeRsp(rsp, ''); + var prg = writeRsp(rsp, ''); $('#' + statBarId).find('div').append(prg); $('#' + statBarId).find('img').remove(); - + // If installation was successful if (prg.html().indexOf('Error') == -1) { $('#' + statBarId).find('div').append('
        It will take several minutes before the nodes are up and ready. Use rcons to monitor the status of the install.
        '); diff --git a/xCAT-UI/js/custom/zvm.js b/xCAT-UI/js/custom/zvm.js index 98e1311d6..9d6525481 100644 --- a/xCAT-UI/js/custom/zvm.js +++ b/xCAT-UI/js/custom/zvm.js @@ -166,7 +166,7 @@ zvmPlugin.prototype.loadServiceProvisionPage = function(tabId) { loadGoldenImages(imgCol); // Get zVM host names - if (!$.cookie('zvms')){ + if (!$.cookie('xcat_zvms')){ $.ajax( { url : 'lib/srv_cmd.php', dataType : 'json', @@ -669,7 +669,7 @@ zvmPlugin.prototype.loadClonePage = function(node, nodeOS, nodeArch) { var groupLabel = $(''); var groupInput = $(''); groupInput.one('focus', function(){ - var groupNames = $.cookie('groups'); + var groupNames = $.cookie('xcat_groups'); if (groupNames) { // Turn on auto complete $(this).autocomplete({ @@ -704,7 +704,7 @@ zvmPlugin.prototype.loadClonePage = function(node, nodeOS, nodeArch) { } // Get list of disk pools var temp = hcp.split('.'); - var diskPools = $.cookie(temp[0] + 'diskpools'); + var diskPools = $.cookie('xcat_' + temp[0] + 'diskpools'); // Create disk pool input var poolDiv = $('
        '); @@ -992,7 +992,7 @@ zvmPlugin.prototype.loadInventory = function(data) { // Get node var node = args[1].replace('node=', ''); // Clear any existing cookie - $.cookie(node + 'processes', null); + $.cookie('xcat_' + node + 'processes', null, {path: '/xcat', secure:true }); // Remove loader $('#' + tabId).find('img').remove(); @@ -1127,7 +1127,7 @@ zvmPlugin.prototype.loadInventory = function(data) { // Start off an ajax request to save the zhcp node name // in a cookie for possible later use by addNic dialog var hcpHostname = attrs['hcp']; - if (!$.cookie(node+'_hcpnodename')){ + if (!$.cookie('xcat_' + node+'_hcpnodename')){ $.ajax( { url : 'lib/cmd.php', dataType : 'json', @@ -2310,7 +2310,7 @@ zvmPlugin.prototype.addNode = function() { * @param tgtNode Targets to migrate */ zvmPlugin.prototype.loadMigratePage = function(tgtNode, fromhcp) { - var hosts = $.cookie('zvms').split(','); + var hosts = $.cookie('xcat_zvms').split(','); var radio, zvmBlock, args; var zvms = new Array(); var hcp = new Object(); diff --git a/xCAT-UI/js/custom/zvmUtils.js b/xCAT-UI/js/custom/zvmUtils.js index 33926ad27..3ff044834 100644 --- a/xCAT-UI/js/custom/zvmUtils.js +++ b/xCAT-UI/js/custom/zvmUtils.js @@ -124,7 +124,7 @@ function loadHcpInfo(data) { if (userEntry[0].indexOf('Failed') < 0) { if (hcp) { // If there is no cookie for the disk pool names - if (!$.cookie(hcp + 'diskpools') || $.cookie(hcp + 'diskpools') === null) { + if (!$.cookie('xcat_' + hcp + 'diskpools') || $.cookie('xcat_' + hcp + 'diskpools') === null) { if (nodeInfoBar !== null) { nodeInfoBar.append("
        Finding pools and networks..."); findingPools = 1; @@ -152,7 +152,7 @@ function loadHcpInfo(data) { } // If there is no cookie for the zFCP pool names - if (!$.cookie(hcp + 'zfcppools') || $.cookie(hcp + 'zfcppools') === null) { + if (!$.cookie('xcat_' + hcp + 'zfcppools') || $.cookie('xcat_' + hcp + 'zfcppools') === null) { if (nodeInfoBar !== null) { if (findingPools = 0) { @@ -183,7 +183,7 @@ function loadHcpInfo(data) { } // If there is no cookie for the network names - if (!$.cookie(hcp + 'networks') || $.cookie(hcp + 'networks') === null) { + if (!$.cookie('xcat_' + hcp + 'networks') || $.cookie('xcat_' + hcp + 'networks') === null) { if (nodeInfoBar !== null) { if (findingPools = 0) { @@ -374,13 +374,13 @@ function loadUserEntry(data) { */ function incrementNodeProcess(node) { // Get current processes - var procs = $.cookie(node + 'processes'); + var procs = $.cookie('xcat_' + node + 'processes'); if (procs) { // One more process procs = parseInt(procs) + 1; - $.cookie(node + 'processes', procs); + $.cookie('xcat_' + node + 'processes', procs); } else { - $.cookie(node + 'processes', 1); + $.cookie('xcat_' + node + 'processes', 1); } } @@ -517,7 +517,7 @@ function updateZProvisionNewStatus(data) { // Set cookie for number of disks var diskRows = $('#' + tabId + ' table:eq(0):visible tbody tr'); - $.cookie('disks2add' + out2Id, diskRows.length); + $.cookie('xcat_disks2add' + out2Id, diskRows.length, {path: '/xcat', secure:true }); if (diskRows.length > 0) { for (var i = 0; i < diskRows.length; i++) { var diskArgs = diskRows.eq(i).find('td'); @@ -558,7 +558,7 @@ function updateZProvisionNewStatus(data) { // Set cookie for number of zFCP devices var zfcpRows = $('#' + tabId + ' table:eq(1):visible tbody tr'); - $.cookie('zfcp2add' + out2Id, zfcpRows.length); + $.cookie('xcat_zfcp2add' + out2Id, zfcpRows.length, {path: '/xcat', secure:true }); if (zfcpRows.length > 0) { for ( var i = 0; i < zfcpRows.length; i++) { var diskArgs = zfcpRows.eq(i).find('td'); @@ -581,10 +581,16 @@ function updateZProvisionNewStatus(data) { var args = '--addzfcp;' + pool + ';' + address + ';' + loaddev + ';' + size; if (tag && tag != "null") { args += ';' + tag; + } else { + args += ';'; } if (portName && tag != "null") { args += ';' + portName; + } else { + args += ';'; } if (unitNo && tag != "null") { args += ';' + unitNo; + } else { + args += ';'; } // Attach zFCP device to node @@ -625,19 +631,19 @@ function updateZProvisionNewStatus(data) { } else { // Set cookie for number of disks // One less disk to add - var disks2add = $.cookie('disks2add' + out2Id); + var disks2add = $.cookie('xcat_disks2add' + out2Id); if (lastCmd == 'chvm-disk') { if (disks2add > 0) { disks2add--; - $.cookie('disks2add' + out2Id, disks2add); + $.cookie('xcat_disks2add' + out2Id, disks2add, {path: '/xcat', secure:true }); } } - var zfcp2add = $.cookie('zfcp2add' + out2Id); + var zfcp2add = $.cookie('xcat_zfcp2add' + out2Id); if (lastCmd == 'chvm-zfcp') { if (zfcp2add > 0) { zfcp2add--; - $.cookie('zfcp2add' + out2Id, zfcp2add); + $.cookie('xcat_zfcp2add' + out2Id, zfcp2add, {path: '/xcat', secure:true }); } } @@ -887,10 +893,10 @@ function updateZNodeStatus(data) { var rsp = data.rsp; // Get cookie for number processes performed against this node - var actions = $.cookie(node + 'processes'); + var actions = $.cookie('xcat_' + node + 'processes'); // One less process actions = actions - 1; - $.cookie(node + 'processes', actions); + $.cookie('xcat_' + node + 'processes', actions, {path: '/xcat', secure:true }); if (actions < 1) { // Hide loader when there are no more processes @@ -1116,7 +1122,7 @@ function getZResources(data) { } // Set hardware control point cookie - $.cookie('hcp', hcps); + $.cookie('xcat_hcp', hcps, {path: '/xcat', secure:true }); // Delete loader $('#' + tabId).find('img[src="images/loader.gif"]').remove(); @@ -1137,10 +1143,10 @@ function getZResources(data) { // Create a array for hardware control points var hcps = new Array(); - if ($.cookie('hcp').indexOf(',') > -1) { - hcps = $.cookie('hcp').split(','); + if ($.cookie('xcat_hcp').indexOf(',') > -1) { + hcps = $.cookie('xcat_hcp').split(','); } else { - hcps.push($.cookie('hcp')); + hcps.push($.cookie('xcat_hcp')); } // Query the disk pools for each hcp @@ -1185,10 +1191,10 @@ function getZResources(data) { // Create a array for hardware control points var hcps = new Array(); - if ($.cookie('hcp').indexOf(',') > -1) { - hcps = $.cookie('hcp').split(','); + if ($.cookie('xcat_hcp').indexOf(',') > -1) { + hcps = $.cookie('xcat_hcp').split(','); } else { - hcps.push($.cookie('hcp')); + hcps.push($.cookie('xcat_hcp')); } @@ -1235,10 +1241,10 @@ function getZResources(data) { // Create a array for hardware control points var hcps = new Array(); - if ($.cookie('hcp').indexOf(',') > -1) { - hcps = $.cookie('hcp').split(','); + if ($.cookie('xcat_hcp').indexOf(',') > -1) { + hcps = $.cookie('xcat_hcp').split(','); } else { - hcps.push($.cookie('hcp')); + hcps.push($.cookie('xcat_hcp')); } // Query the networks for each @@ -1442,7 +1448,7 @@ function openAddProcDialog(node) { */ function openAddDiskDialog(node, hcp) { // Get list of disk pools - var cookie = $.cookie(hcp + 'diskpools'); + var cookie = $.cookie('xcat_' + hcp + 'diskpools'); var pools = new Array(); if (cookie) { pools = cookie.split(','); @@ -1605,7 +1611,7 @@ function openAddDiskDialog(node, hcp) { */ function openAddZfcpDialog(node, hcp, zvm) { // Get list of disk pools - var cookie = $.cookie(hcp + 'zfcppools'); + var cookie = $.cookie('xcat_' + hcp + 'zfcppools'); var pools = new Array(); if (cookie) { pools = cookie.split(','); @@ -2492,8 +2498,8 @@ function openAddScsi2SystemDialog(hcp) { var fcpWwpn = $(''); devPathRow.append(fcpWwpn); - if ($.cookie('zvms')) { - zvms = $.cookie('zvms').split(','); + if ($.cookie('xcat_zvms')) { + zvms = $.cookie('xcat_zvms').split(','); var zvm; for (var i in zvms) { if( !zvms[i] || 0 === zvms[i].length) continue; @@ -2807,7 +2813,7 @@ function openAddNicDialog(node, hcp) { // Get the hcp node name for the node // Should be in a cookie, else just take first part of hostname - var hcpNode = $.cookie(node+'_hcpnodename'); + var hcpNode = $.cookie('xcat_' + node+'_hcpnodename'); if (!hcpNode) { if (typeof console == "object"){ console.log("openAddNicDialog did not find cookie for <"+node+"_hcpnodename> Using first token in hostname"); @@ -2819,7 +2825,7 @@ function openAddNicDialog(node, hcp) { } // Get network names - var cookie = $.cookie(hcpNode + 'networks'); + var cookie = $.cookie('xcat_' + hcpNode + 'networks'); var networks = new Array(); if (cookie) { networks = cookie.split(','); @@ -3772,14 +3778,14 @@ function removeNic(node, nic) { * @param data Data from HTTP request */ function setNetworkCookies(data) { - if (data.rsp.length && data.rsp[0].indexOf("Failed") == -1) { + if (data.rsp.length && data.rsp[0].indexOf("Failed") == -1 && data.rsp[0].indexOf("Error") == -1) { var node = data.msg; var networks = data.rsp[0].split(node + ': '); // Set cookie to expire in 60 minutes var exDate = new Date(); exDate.setTime(exDate.getTime() + (60 * 60 * 1000)); - $.cookie(node + 'networks', networks, { expires: exDate }); + $.cookie('xcat_' + node + 'networks', networks, { expires: exDate, path: '/xcat', secure:true }); } } @@ -3789,7 +3795,7 @@ function setNetworkCookies(data) { * @param data HTTP request data */ function getDiskPool(data) { - if (data.rsp.length && data.rsp[0].indexOf("Failed") == -1 && data.rsp[0].indexOf("Invalid") == -1) { + if (data.rsp.length && data.rsp[0].indexOf("Failed") == -1 && data.rsp[0].indexOf("Invalid") == -1 && data.rsp[0].indexOf("Error") == -1) { var hcp = data.msg; var pools = data.rsp[0].split(hcp + ': '); @@ -3854,9 +3860,10 @@ function getZfcpPool(data) { if (typeof console == "object"){ console.log("Entering getZfcpPool."); } - if (data.rsp.length && data.rsp[0].indexOf("Failed") == -1 && data.rsp[0].indexOf("Invalid") == -1) { + if (data.rsp.length && data.rsp[0].indexOf("Failed") == -1 && data.rsp[0].indexOf("Invalid") == -1 && data.rsp[0].indexOf("Error") == -1) { var hcp = data.msg; var pools = data.rsp[0].split(hcp + ': '); + zhcpQueryCountForZfcps = 0; // Get contents of each disk pool for (var i in pools) { pools[i] = jQuery.trim(pools[i]); @@ -3900,7 +3907,7 @@ function getZfcpPool(data) { * @param data HTTP request data */ function getNetwork(data) { - if (data.rsp.length && data.rsp[0].indexOf("Failed") == -1 && data.rsp[0].indexOf("Invalid") == -1) { + if (data.rsp.length && data.rsp[0].indexOf("Failed") == -1 && data.rsp[0].indexOf("Invalid") == -1 && data.rsp[0].indexOf("Error") == -1) { var hcp = data.msg; var networks = data.rsp[0].split(hcp + ': '); if (typeof console == "object"){ @@ -3962,7 +3969,7 @@ function loadDiskPoolTable(data) { var args, hcp, pool, stat, tmp; if (data && typeof data.rsp != "undefined") { // Do not continue if the call failed - if (!data.rsp.length && data.rsp[0].indexOf("Failed") > 0) { + if (!data.rsp.length && data.rsp[0].indexOf("Failed") > 0 && data.rsp[0].indexOf("Error") > 0) { return; } @@ -4065,10 +4072,10 @@ function loadDiskPoolTable(data) { // Create a array for hardware control points var hcps = new Array(); - if ($.cookie('hcp').indexOf(',') > -1) - hcps = $.cookie('hcp').split(','); + if ($.cookie('xcat_hcp').indexOf(',') > -1) + hcps = $.cookie('xcat_hcp').split(','); else - hcps.push($.cookie('hcp')); + hcps.push($.cookie('xcat_hcp')); zhcpQueryCountForDisks = hcps.length; // Query the disk pools for each @@ -4179,15 +4186,45 @@ function loadZfcpPoolTable(data) { } // Delete loader if last one var panelId = 'zfcpResource'; - if (!zhcpQueryCountForZfcps) { + if (zhcpQueryCountForZfcps <= 0) { $('#' + panelId).find('img[src="images/loader.gif"]').remove(); } var hcp2zvm = new Object(); var args, hcp, pool, tmp; + + // Resource tab ID + var info = $('#' + panelId).find('.ui-state-highlight'); + + // Is there any data passed? Process if some if (typeof data.rsp != "undefined") { - // Do not continue if the call failed - if (!data.rsp.length && data.rsp[0].indexOf("Failed") > 0) { + // Do not continue if no data to add + if (!data.rsp.length) { + if (typeof console == "object"){ + console.log("data.rsp.length is 0."); + } + // If there is no info bar, create info bar + var msgError = '
        Unexpected, no data returned on the lsvm --zfcppool call.'; + if (!info.length) { + info = createInfoBar(msgError); + $('#' + panelId).append(info); + } else { + info.append(msgError); + } + return; + } + if (data.rsp[0].indexOf("Failed") > 0 || data.rsp[0].indexOf("Error") > 0) { + if (typeof console == "object"){ + console.log("Failed on lsvm call for --zfcppool"); + } + var msgError = '
        Error: Error on call to check zfcp pools: '+ data.rsp[0]; + // If there is no info bar, create info bar + if (!info.length) { + info = createInfoBar(msgError); + $('#' + panelId).append(info); + } else { + info.append(msgError); + } return; } @@ -4200,13 +4237,14 @@ function loadZfcpPoolTable(data) { tmp = data.rsp[0].split(hcp + ': '); } else { // Provide empty values so the table will be generated + if (typeof console == "object"){ + console.log("Creating empty zfcp pool table."); + } hcp = ''; pool = '' tmp = new Array(); } - // Resource tab ID - var info = $('#' + panelId).find('.ui-state-highlight'); // If there is no info bar, create info bar if (!info.length) { info = createInfoBar('Below are devices that are defined internally in the zFCP pools.'); @@ -4248,7 +4286,8 @@ function loadZfcpPoolTable(data) { tmp[i] = jQuery.trim(tmp[i]); var diskAttrs = tmp[i].split(','); diskAttrs[0] = diskAttrs[0].toLowerCase(); - var key = hcp2zvm[hcp] + '-' + pool + '-' + diskAttrs[2]; + // Key contains row data to be returned when the checkbox is selected + var key = hcp2zvm[hcp] + '-' + pool + '-' + diskAttrs[2] + '-' + diskAttrs[1]; dTable.fnAddData( [ '', hcp2zvm[hcp], pool, diskAttrs[0], diskAttrs[1], diskAttrs[2], diskAttrs[3], diskAttrs[4], diskAttrs[5], diskAttrs[6], diskAttrs[7] ]); } } @@ -4266,6 +4305,9 @@ function loadZfcpPoolTable(data) { // Delete disk from pool var removeLnk = $('Remove'); removeLnk.bind('click', function(event){ + if (typeof console == "object"){ + console.log("Remove button clicked for tableId:"+tableId); + } var disks = getNodesChecked(tableId); openRemoveZfcpFromPoolDialog(disks); }); @@ -4278,10 +4320,10 @@ function loadZfcpPoolTable(data) { // Create a array for hardware control points var hcps = new Array(); - if ($.cookie('hcp').indexOf(',') > -1) - hcps = $.cookie('hcp').split(','); + if ($.cookie('xcat_hcp').indexOf(',') > -1) + hcps = $.cookie('xcat_hcp').split(','); else - hcps.push($.cookie('hcp')); + hcps.push($.cookie('xcat_hcp')); // Query the disk pools for each zhcpQueryCountForZfcps = hcps.length; @@ -4643,7 +4685,11 @@ function openRemoveZfcpFromPoolDialog(devices2remove) { // Verify disks are in the same zFCP pool var devices = devices2remove.split(','); + if (typeof console == "object"){ + console.log("Entering openRemoveZfcpFromPoolDialog. Device to remove:<"+devices2remove+">"); + } var tmp, tgtPool, tgtHcp; + var tgtPort = ""; var tgtUnitNo = ""; for (var i in devices) { if( !devices[i] || 0 === devices[i].length) continue; @@ -4658,6 +4704,7 @@ function openRemoveZfcpFromPoolDialog(devices2remove) { tgtHcp = tmp[0]; // Assume it is just one zHCP. Otherwise, this cannot be done on multiple zHCPs. tgtUnitNo += tmp[2] + ","; + tgtPort = tmp[3]; } // Strip out last comma @@ -4673,7 +4720,7 @@ function openRemoveZfcpFromPoolDialog(devices2remove) { var pool = $('
        '); var unitNo = $('
        '); - var portName = $('
        '); + var portName = $('
        '); deleteDiskForm.append(system, pool, unitNo, portName); // Append options for hardware control points @@ -4760,7 +4807,9 @@ function openRemoveZfcpFromPoolDialog(devices2remove) { msg : dialogId }, - success : updateResourceDialog + success : function(data) { + updateResourceDialog(data); + } }); }, "Cancel": function() { @@ -4984,7 +5033,7 @@ function loadNetworkTable(data) { } // Get zVM host names - if (!$.cookie('zvms')) { + if (!$.cookie('xcat_zvms')) { $.ajax({ url : 'lib/cmd.php', dataType : 'json', @@ -5002,7 +5051,7 @@ function loadNetworkTable(data) { }); } - var zvms = $.cookie('zvms').split(','); + var zvms = $.cookie('xcat_zvms').split(','); var hcp2zvm = new Object(); var args, zvm, iHcp, tmp; for (var i in zvms) { @@ -5132,10 +5181,10 @@ function loadNetworkTable(data) { // Create a array for hardware control points var hcps = new Array(); - if ($.cookie('hcp').indexOf(',') > -1) - hcps = $.cookie('hcp').split(','); + if ($.cookie('xcat_hcp').indexOf(',') > -1) + hcps = $.cookie('xcat_hcp').split(','); else - hcps.push($.cookie('hcp')); + hcps.push($.cookie('xcat_hcp')); // Query networks zhcpQueryCountForNetworks = hcps.length; @@ -5206,7 +5255,7 @@ function connect2GuestLan(data) { $('#' + node + 'StatusBar').find('div').append(prg); // Continue if no errors found - if (data.rsp.length && data.rsp[0].indexOf("Failed") == -1) { + if (data.rsp.length && data.rsp[0].indexOf("Failed") == -1 && data.rsp[0].indexOf("Error") == -1) { // Connect NIC to Guest LAN $.ajax( { url : 'lib/cmd.php', @@ -5261,7 +5310,7 @@ function connect2VSwitch(data) { $('#' + node + 'StatusBar').find('div').append(prg); // Continue if no errors found - if (data.rsp.length && data.rsp[0].indexOf("Failed") == -1) { + if (data.rsp.length && data.rsp[0].indexOf("Failed") == -1 && data.rsp[0].indexOf("Error") == -1) { // Connect NIC to VSwitch $.ajax( { url : 'lib/cmd.php', @@ -5317,7 +5366,7 @@ function createZProvisionExisting(inst) { group.append(groupLabel); // Turn on auto complete for group - var groupNames = $.cookie('groups'); + var groupNames = $.cookie('xcat_groups'); if (groupNames) { // Split group names into an array var tmp = groupNames.split(','); @@ -5363,7 +5412,7 @@ function createZProvisionExisting(inst) { var osSelect = $(''); osSelect.append($('')); - var imageNames = $.cookie('imagenames').split(','); + var imageNames = $.cookie('xcat_imagenames').split(','); if (imageNames) { imageNames.sort(); for (var i in imageNames) { @@ -5542,7 +5591,7 @@ function createZProvisionNew(inst) { var groupInput = $(''); // Get groups on-focus groupInput.one('focus', function(){ - var groupNames = $.cookie('groups'); + var groupNames = $.cookie('xcat_groups'); if (groupNames) { // Turn on auto complete $(this).autocomplete({ @@ -5603,7 +5652,7 @@ function createZProvisionNew(inst) { }, success: function(data) { - if (data.rsp.length && (data.rsp[0].indexOf("Failed") > -1 || data.rsp[0].indexOf("Invalid") > -1) ) { + if (data.rsp.length && (data.rsp[0].indexOf("Failed") > -1 || data.rsp[0].indexOf("Invalid") > -1 || data.rsp[0].indexOf("Error") > -1) ) { // Remove the progress gif, since bailing out removeProvisionLoadingGif(provisionStatusBar); @@ -5711,7 +5760,7 @@ function createZProvisionNew(inst) { console.log("Looking for cookies from <" + zhcpToCheck + ">"); } - if (!$.cookie(zhcpToCheck + 'diskpools')) { + if (!$.cookie('xcat_' + zhcpToCheck + 'diskpools')) { // Get disk pools $.ajax({ url : 'lib/cmd.php', @@ -5732,7 +5781,7 @@ function createZProvisionNew(inst) { checkProvisionCallsDone(provisionStatusBar, ajaxCalls, "diskpoolnames"); } - if (!$.cookie(zhcpToCheck + 'zfcppools')) { + if (!$.cookie('xcat_' + zhcpToCheck + 'zfcppools')) { // Get zFCP pools $.ajax({ url : 'lib/cmd.php', @@ -5753,7 +5802,7 @@ function createZProvisionNew(inst) { checkProvisionCallsDone(provisionStatusBar, ajaxCalls, "zfcppoolnames"); } - if (!$.cookie(zhcpToCheck + 'userprofiles')) { + if (!$.cookie('xcat_' + zhcpToCheck + 'userprofiles')) { // Get zFCP pools $.ajax( { url : 'lib/cmd.php', @@ -5780,7 +5829,7 @@ function createZProvisionNew(inst) { var thisUserProfile = $('#' + thisTabId + ' select[name=userProfile]'); thisUserProfile.children().remove(); - var definedUserProfiles = $.cookie(zhcpToCheck + 'userprofiles').split(','); + var definedUserProfiles = $.cookie('xcat_' + zhcpToCheck + 'userprofiles').split(','); for (var i in definedUserProfiles) { if( !definedUserProfiles[i] || 0 === definedUserProfiles[i].length) continue; thisUserProfile.append(''); @@ -5789,7 +5838,7 @@ function createZProvisionNew(inst) { var thisNetwork = $('#' + thisTabId + ' select[name=network]'); thisNetwork.children().remove(); thisNetwork.append(''); // No profile option - var definedNetworks = $.cookie(zhcpToCheck + 'networks').split(','); + var definedNetworks = $.cookie('xcat_' + zhcpToCheck + 'networks').split(','); for (var i in definedNetworks) { if( !definedNetworks[i] || 0 === definedNetworks[i].length) continue; if (!jQuery.trim(definedNetworks[i])) @@ -5854,7 +5903,7 @@ function createZProvisionNew(inst) { var osSelect = $(''); osSelect.append($('')); - var imageNames = $.cookie('imagenames').split(','); + var imageNames = $.cookie('xcat_imagenames').split(','); if (imageNames) { imageNames.sort(); for (var i in imageNames) { @@ -5939,7 +5988,6 @@ function createZProvisionNew(inst) { '' + ''); var cpuSelect = $(''); + var zfcpTag = $(''); zfcpRow.append(zfcpTag); // Create device port name @@ -6399,6 +6447,35 @@ function createZProvisionNew(inst) { ready = false; } + // If this is basic mode, check for a disk with IPL radio button and zFCP with LOADDEV button + // Cannot have both. (In advanced mode they create the directory entries.) + if (hwTabIndex == 0) { + // Find a device to be IPLed? + var ECKD_FBA_diskRows = $('#' + thisTabId + ' table:eq(0):visible tbody tr'); + var iplSet = 0; + for (var i = 0; i < ECKD_FBA_diskRows.length; i++) { + var diskArgs = ECKD_FBA_diskRows.eq(i).find('td'); + if (diskArgs.eq(7).find('input').attr("checked") === true) { + iplSet = 1; + break; + } + } + + // Check if zFCP loaddev checked + var zfcpRows = $('#' + thisTabId + ' table:eq(1):visible tbody tr'); + if (zfcpRows.length > 0) { + for ( var i = 0; i < zfcpRows.length; i++) { + var diskArgs = zfcpRows.eq(i).find('td'); + // This is either true or false + var loaddev = diskArgs.eq(7).find('input').attr('checked'); + if (loaddev && iplSet) { + errMsg = errMsg + 'You cannot have both disk IPL and zFCP LOADDEV, can only IPL one device.
        '; + ready = false; + } + } + } + } + // If inputs are valid, ready to provision if (ready) { // Generate user directory entry if basic tab is selected @@ -6641,13 +6718,13 @@ function checkProvisionCallsDone(provisionStatBar, table, finishedKey) { */ function loadzVMs(col) { // Get group names and description and append to group column - if (!$.cookie('zvms')) { + if (!$.cookie('xcat_zvms')) { var infoBar = createInfoBar('No selectable z/VM available'); col.append(infoBar); return; } - var zNames = $.cookie('zvms').split(','); + var zNames = $.cookie('xcat_zvms').split(','); var radio, zBlock, args, zvm, hcp; for (var i in zNames) { @@ -6689,13 +6766,13 @@ function loadzVMs(col) { */ function loadSrvGroups(col) { // Get group names and description and append to group column - if (!$.cookie('srv_groups')) { + if (!$.cookie('xcat_srv_groups')) { var infoBar = createInfoBar('No selectable group available'); col.append(infoBar); return; } - var groupNames = $.cookie('srv_groups').split(','); + var groupNames = $.cookie('xcat_srv_groups').split(','); var groupBlock, radio, args, name, ip, hostname, desc; for (var i in groupNames) { @@ -6739,13 +6816,13 @@ function loadSrvGroups(col) { */ function loadOSImages(col) { // Get group names and description and append to group column - if (!$.cookie('srv_imagenames')) { + if (!$.cookie('xcat_srv_imagenames')) { var infoBar = createInfoBar('No selectable image available'); col.append(infoBar); return; } - var imgNames = $.cookie('srv_imagenames').split(','); + var imgNames = $.cookie('xcat_srv_imagenames').split(','); var imgBlock, radio, args, name, desc; for (var i in imgNames) { @@ -6790,13 +6867,13 @@ function loadOSImages(col) { */ function loadGoldenImages(col) { // Get group names and description and append to group column - if (!$.cookie('srv_goldenimages')) { + if (!$.cookie('xcat_srv_goldenimages')) { var infoBar = createInfoBar('No selectable master copies available'); col.append(infoBar); return; } - var imgNames = $.cookie('srv_goldenimages').split(','); + var imgNames = $.cookie('xcat_srv_goldenimages').split(','); var imgBlock, radio, args, name, desc; for (var i in imgNames) { @@ -6844,7 +6921,7 @@ function loadGoldenImages(col) { * @param data Data from HTTP request */ function setzVMCookies(data) { - if (data.rsp.length && data.rsp[0].indexOf("Failed") == -1) { + if (data.rsp.length && data.rsp[0].indexOf("Failed") == -1 && data.rsp[0].indexOf("Error") == -1) { var zvms = new Array(); var hosts = data.rsp[0].split("\n"); for ( var i = 0; i < hosts.length; i++) { @@ -6859,7 +6936,7 @@ function setzVMCookies(data) { // Set cookie to expire in 60 minutes var exDate = new Date(); exDate.setTime(exDate.getTime() + (60 * 60 * 1000)); - $.cookie('zvms', zvms, { expires: exDate }); + $.cookie('xcat_zvms', zvms, { expires: exDate, path: '/xcat', secure:true }); } } @@ -6869,7 +6946,7 @@ function setzVMCookies(data) { * @param data Data from HTTP request */ function setGoldenImagesCookies(data) { - if (data.rsp.length && data.rsp[0].indexOf("Failed") == -1) { + if (data.rsp.length && data.rsp[0].indexOf("Failed") == -1 && data.rsp[0].indexOf("Error") == -1) { var copies = new Array(); var tmp = data.rsp[0].split(","); for ( var i = 0; i < tmp.length; i++) { @@ -6881,7 +6958,7 @@ function setGoldenImagesCookies(data) { // Set cookie to expire in 60 minutes var exDate = new Date(); exDate.setTime(exDate.getTime() + (60 * 60 * 1000)); - $.cookie('srv_goldenimages', copies, { expires: exDate }); + $.cookie('xcat_srv_goldenimages', copies, { expires: exDate, path: '/xcat', secure:true }); } } @@ -6891,7 +6968,7 @@ function setGoldenImagesCookies(data) { * @param data Data from HTTP request */ function setDiskPoolCookies(data) { - if (data.rsp.length && data.rsp[0].indexOf("Failed") == -1) { + if (data.rsp.length && data.rsp[0].indexOf("Failed") == -1 && data.rsp[0].indexOf("Error") == -1) { var node = data.msg; var pools = data.rsp[0].split(node + ": "); var pools2 = []; @@ -6904,7 +6981,7 @@ function setDiskPoolCookies(data) { // Set cookie to expire in 60 minutes var exDate = new Date(); exDate.setTime(exDate.getTime() + (60 * 60 * 1000)); - $.cookie(node + 'diskpools', pools2, { expires: exDate }); + $.cookie('xcat_' + node + 'diskpools', pools2, { expires: exDate, path: '/xcat', secure:true }); } } @@ -6914,7 +6991,7 @@ function setDiskPoolCookies(data) { * @param data Data from HTTP request */ function setZfcpPoolCookies(data) { - if (data.rsp.length && data.rsp[0].indexOf("Failed") == -1) { + if (data.rsp.length && data.rsp[0].indexOf("Failed") == -1 && data.rsp[0].indexOf("Error") == -1) { var node = data.msg; var pools = data.rsp[0].split(node + ': '); var pools2 = []; @@ -6927,7 +7004,7 @@ function setZfcpPoolCookies(data) { // Set cookie to expire in 60 minutes var exDate = new Date(); exDate.setTime(exDate.getTime() + (60 * 60 * 1000)); - $.cookie(node + 'zfcppools', pools2, { expires: exDate }); + $.cookie('xcat_' + node + 'zfcppools', pools2, { expires: exDate, path: '/xcat', secure:true }); } } @@ -6941,7 +7018,7 @@ function setzHcpCookies(zhcps) { // Set cookie to expire in 60 minutes var exDate = new Date(); exDate.setTime(exDate.getTime() + (60 * 60 * 1000)); - $.cookie('zhcps', zhcps, { expires: exDate }); + $.cookie('xcat_zhcps', zhcps, { expires: exDate, path: '/xcat', secure:true }); } } @@ -6951,7 +7028,7 @@ function setzHcpCookies(zhcps) { * @param data Data from HTTP request */ function setUserProfilesCookies(data) { - if (data.rsp.length && data.rsp[0].indexOf("Failed") == -1) { + if (data.rsp.length && data.rsp[0].indexOf("Failed") == -1 && data.rsp[0].indexOf("Error") == -1) { var node = data.msg; var profiles = data.rsp[0].split(node + ': '); var profiles2 = []; @@ -6964,7 +7041,7 @@ function setUserProfilesCookies(data) { // Set cookie to expire in 60 minutes var exDate = new Date(); exDate.setTime(exDate.getTime() + (60 * 60 * 1000)); - $.cookie(node + 'userprofiles', profiles2, { expires: exDate }); + $.cookie('xcat_' + node + 'userprofiles', profiles2, { expires: exDate, path: '/xcat', secure:true }); } } @@ -7025,7 +7102,7 @@ function configProfilePanel(panelId) { table.init(['', 'Profile', 'Disk pool', 'Disk size', 'Directory entry']); // Insert profiles into table - var profiles = $.cookie('profiles').split(','); + var profiles = $.cookie('xcat_profiles').split(','); profiles.push('default'); // Add default profile for (var i in profiles) { if (profiles[i]) { @@ -7245,7 +7322,7 @@ function profileDialog() { // Insert profiles into select var profileSelect = $(''); - var profiles = $.cookie('profiles').split(','); + var profiles = $.cookie('xcat_profiles').split(','); profiles.push('default'); // Add default profile for (var i in profiles) { if (profiles[i]) { @@ -7420,7 +7497,7 @@ function editProfileDialog(profile, pool, size, entry) { // Insert profiles into select var profileSelect = $(''); - var profiles = $.cookie('profiles').split(','); + var profiles = $.cookie('xcat_profiles').split(','); profiles.push('default'); // Add default profile for (var i in profiles) { if (profiles[i]) { @@ -7541,7 +7618,7 @@ function editProfileDialog(profile, pool, size, entry) { */ function getHcpZvmHash() { // Get zVM host names - if (!$.cookie('zvms')) { + if (!$.cookie('xcat_zvms')) { $.ajax({ url : 'lib/cmd.php', dataType : 'json', @@ -7559,7 +7636,7 @@ function getHcpZvmHash() { }); } - var zvms = $.cookie('zvms').split(','); + var zvms = $.cookie('xcat_zvms').split(','); var hcp2zvm = new Object(); var args, zvm, iHcp, tmp; for (var i in zvms) { @@ -7656,6 +7733,20 @@ function updateUserEntry(tabId) { } } + // Check if zFCP loaddev checked, if so ipl the fcp card + var zfcpRows = $('#' + tabId + ' table:eq(1):visible tbody tr'); + if (zfcpRows.length > 0) { + for ( var i = 0; i < zfcpRows.length; i++) { + var diskArgs = zfcpRows.eq(i).find('td'); + var address = diskArgs.eq(1).find('input').val(); + // This is either true or false + var loaddev = diskArgs.eq(7).find('input').attr('checked'); + if (loaddev) { + ipl = address; + } + } + } + // Only update directory entry if the basic tab is selected var inst = tabId.replace('zvmProvisionTab', ''); var hwTabIndex = $("#hwConfig" + inst).tabs('option', 'selected'); @@ -7699,6 +7790,20 @@ function updateUserEntry(tabId) { } } + // Check if zFCP loaddev checked, if so ipl the fcp card + var zfcpRows = $('#' + tabId + ' table:eq(1):visible tbody tr'); + if (zfcpRows.length > 0) { + for ( var i = 0; i < zfcpRows.length; i++) { + var diskArgs = zfcpRows.eq(i).find('td'); + var address = diskArgs.eq(1).find('input').val(); + // This is either true or false + var loaddev = diskArgs.eq(7).find('input').attr('checked'); + if (loaddev) { + ipl = address; + } + } + } + // Only update directory entry if the basic tab is selected var inst = tabId.replace('zvmProvisionTab', ''); var hwTabIndex = $("#hwConfig" + inst).tabs('option', 'selected'); @@ -7742,6 +7847,20 @@ function updateUserEntry(tabId) { } } + // Check if zFCP loaddev checked, if so ipl the fcp card + var zfcpRows = $('#' + tabId + ' table:eq(1):visible tbody tr'); + if (zfcpRows.length > 0) { + for ( var i = 0; i < zfcpRows.length; i++) { + var diskArgs = zfcpRows.eq(i).find('td'); + var address = diskArgs.eq(1).find('input').val(); + // This is either true or false + var loaddev = diskArgs.eq(7).find('input').attr('checked'); + if (loaddev) { + ipl = address; + } + } + } + // Only update directory entry if the basic tab is selected var inst = tabId.replace('zvmProvisionTab', ''); var hwTabIndex = $("#hwConfig" + inst).tabs('option', 'selected'); @@ -7836,6 +7955,10 @@ function generateUserEntry(userId, password, memory, privilege, profile, cpuCoun userDirectoryEntry += "SPOOL 000D 2540 PUNCH A\n"; userDirectoryEntry += "SPOOL 000E 1403 A\n"; + if (typeof console == "object"){ + console.log("Exiting generateUserEntry. Directory created:"+userDirectoryEntry); + } + return userDirectoryEntry; } @@ -7936,7 +8059,7 @@ function getNetworkDetails(hcpNode, vswitchname, hashId, tabId) { console.log("getNetworkDetails. creating new hash[[]] table!!" + "hashindex<" + hashindex + ">" ); } } - if (data.rsp.length && (data.rsp[0].indexOf("Failed") > -1 || (foundInvalid == 1) ) ) { + if (data.rsp.length && (data.rsp[0].indexOf("Failed") > -1 || (foundInvalid == 1) || data.rsp[0].indexOf("Error") > -1 ) ) { if (typeof console == "object") { console.log("getNetworkDetails. failure getting the network data for " + hcpNode + " network "+ vswitchname); } @@ -7993,7 +8116,7 @@ function getNetworkDetails(hcpNode, vswitchname, hashId, tabId) { * @param data Data from HTTP request */ function setNodeZhcpNodename(data) { - if (data.rsp.length && data.rsp[0].indexOf("Failed") == -1) { + if (data.rsp.length && data.rsp[0].indexOf("Failed") == -1 && data.rsp[0].indexOf("Error") == -1) { var savedTokens = data.msg.split(';'); var node = savedTokens[0]; var hcphostname = savedTokens[1]; @@ -8010,7 +8133,7 @@ function setNodeZhcpNodename(data) { // Set cookie to expire in 60 minutes var exDate = new Date(); exDate.setTime(exDate.getTime() + (60 * 60 * 1000)); - $.cookie(node+'_hcpnodename', nodename, { expires: exDate }); + $.cookie('xcat_' + node+'_hcpnodename', nodename, { expires: exDate, path: '/xcat', secure:true }); } } } diff --git a/xCAT-UI/js/help/help.js b/xCAT-UI/js/help/help.js index a9b8ce454..694198e51 100644 --- a/xCAT-UI/js/help/help.js +++ b/xCAT-UI/js/help/help.js @@ -1,9 +1,29 @@ /** - * Load the help page + * Global variables + */ +var helpTab; // Help tabs +var ivpChoices = new Array; +var ivpChoiceValues = new Array; +var selectInfo = new Object(); + + +/** + * Load the help page and create the tabs. */ function loadHelpPage(){ + createHelpTab(); + createVerifyXCATTab(); +} + +/** + * Create the Help Tab + * + * @return Tab object + */ +function createHelpTab(){ // Create help tab var tab = new Tab(); + setHelpTab(tab); tab.init(); $('#content').append(tab.object()); @@ -28,4 +48,693 @@ function loadHelpPage(){ '' + ''); tab.add('helpTab', 'Help', helpForm, false); -} \ No newline at end of file +} + + +/** + * Create the Verify xCAT Tab + * + * @return Tab object + */ +function createVerifyXCATTab() { + var comments = 'Description of the IVP run'; + var ivpEnabled = 'checked'; + var ivpDisabled = ''; + + // Get the tab + var tab = getHelpTab(); + var fs, legend; + + // Generate new tab ID + var instance = 0; + var newTabId = 'verifyXCATTab' + instance; + while ($('#' + newTabId).length) { + // If one already exists, generate another one + instance = instance + 1; + newTabId = 'verifyXCATTab' + instance; + } + + // Build the list of IVPs in the table + readIvpTable(); + + // Create info bar and status bar + var infoBar = createInfoBar( 'Run or schedule Installation Verification Procedures to verify:
        ' + + '-xCAT MN/ZHCP Environment, or
        ' + + '-xCAT MN/ZHCP and OpenStack Environment.' ); + + var statBarId = 'verifyXCATStatusBar' + instance; + var statBar = createStatusBar(statBarId).hide(); + var loader = createLoader( '' ); + statBar.find('div').append( loader ); + + // Create the verify form and put info and status bars on the form. + var verifyXCATForm = $( '
        ' ); + verifyXCATForm.append( infoBar, statBar ); + + // Create 'Create a Verify xCAT' fieldset + fs = $( '
        ' ); + fs.append( $( 'Verify:' )); + fs.append( $( '
        ' + + '' + + '
        ' )); + fs.append( $('
        Type of IVP Run:
        ')); + fs.append( $('
        Basic IVP: xCAT MN/ZHCP Verification
        ' )); + fs.append( $('
        Full IVP: xCAT MN/ZHCP and OpenStack Verification
        ' )); + fs.append( $('
        Basic and Full IVP Parameters:
        ')); + fs.append( $('
        ' )); + fs.append( $('
        ' )); + fs.append( $('
        Full IVP Parameters:
        ')); + fs.append( $('
        ' )); + fs.append( $('
        ' )); + fs.append( $('
        ' )); + fs.append( $('
        Automated IVP Parameters:
        ')); + fs.append( $('
        ' )); + fs.append( '
        '+ + ''+ + ''+ + ''+ + ''+ + ''+ + ''+ + ''+ + ''+ + ''+ + ''+ + ''+ + ''+ + ''+ + ''+ + ''+ + ''+ + ''+ + ''+ + ''+ + ''+ + ''+ + ''+ + ''+ + ''+ + ''+ + ''+ + ''+ + ''+ + ''+ + ''+ + ''+ + ''+ + ''+ + '
        ScheduleEvery hour
        Midnight1 am2 am3 am4 am5 am
        6 am7 am8 am9 am10 am11 am
        Noon1 pm2 pm3 pm4 pm5 pm
        6 pm7 pm8 pm9 pm10 pm11 pm
        '+ + '
        '); + fs.append( $('
        Disable or Enable the IVP Run:
        ')); + fs.append( $('
        Enabled to be run periodically
        ' )); + fs.append( $('
        Disabled from running periodically
        ' )); + verifyXCATForm.append( fs ); + + var verifyBtn = createButton( 'Run an IVP Now' ); + verifyBtn.click(function() { + var driveFunction = 1; + var argList = ''; + + // Remove any warning messages + $(this).parents('.ui-tabs-panel').find('.ui-state-error').remove(); + + var runType = $(this).parent().find('input[name="runType"]:checked').val(); + if ( runType == 'verifyBasic' ) { + argList += '||--basicivp'; + } else if ( runType == 'verifyOpenStack' ) { + argList += '||--fullivp'; + var openstackIP = $(this).parent().find('input[name=openstackIP]').val(); + if ( openstackIP != '' ) { + argList += '||--openstackip ' + openstackIP; + } else { + // Show an information message. + $('#' + statBarId).find('div').append( + 'You did not specify the IP address of the OpenStack system. The IVP ' + + 'will use the IP address of the system running the xCAT management node as ' + + 'the OpenStack IP address.
        '); + } + var openstackUser = $(this).parent().find('input[name=openstackUser]').val(); + if ( openstackUser != '' ) { + argList += '||--openstackuser ' + hexEncode( openstackUser ); + } + var prepParms = $(this).parent().find('input[name=prepParms]').val(); + if ( prepParms != '' ) { + argList += '||--prepparms ' + hexEncode( prepParms ); + } + } else { + // Show warning message + var warn = createWarnBar('You did not select a basic or full IVP.'); + warn.prependTo($(this).parents('.ui-tabs-panel')); + driveFunction = 0; + } + var orchParms = $(this).parent().find('input[name=orchParms]').val(); + if ( orchParms != '' ) { + argList += '||--orchparms ' + hexEncode( orchParms ); + } + var mainParms = $(this).parent().find('input[name=mainParms]').val(); + if ( mainParms != '' ) { + argList += '||--zxcatparms ' + hexEncode( mainParms ); + } + argList += '||end'; + + if ( driveFunction == 1 ) { + $('#' + statBarId).find('div').append( 'Invoking verifynode to run the IVP.
        ' ); + $('#' + statBarId).find('img').show(); + $.ajax( { + url : 'lib/cmd.php', + dataType : 'json', + data : { + cmd : 'webrun', + tgt : '', + args : 'verifynode '+ argList, + msg : 'out=' + statBarId + ';cmd=verifynode' + }, + success : updateStatusBar + }); + + // Show status bar + statBar.show(); + } + }); + verifyXCATForm.append( verifyBtn ); + + var scheduleBtn = createButton( 'Schedule an IVP Run' ); + scheduleBtn.click(function() { + var driveFunction = 1; + var argList = ''; + + // Remove any warning messages + $(this).parents('.ui-tabs-panel').find('.ui-state-error').remove(); + + var ivpId = $(this).parent().find('select[name=ivpId]').val(); + if ( ivpId != 'NEW' ) { + argList += '||--id ' + ivpId; + } + var runType = $(this).parent().find('input[name="runType"]:checked').val(); + if ( runType == 'verifyBasic' ) { + argList += '||--type basicivp'; + } else if ( runType == 'verifyOpenStack' ) { + argList += '||--type fullivp'; + var openstackIP = $(this).parent().find('input[name=openstackIP]').val(); + if ( openstackIP != '' ) { + argList = argList + '||--openstackip ' + openstackIP; + } else { + // Show an information message. + $('#' + statBarId).find('div').append( + 'You did not specify the IP address of the OpenStack system. The IVP ' + + 'will use the IP address of the system running the xCAT management node as ' + + 'the OpenStack IP address.
        '); + } + var openstackUser = $(this).parent().find('input[name=openstackUser]').val(); + if ( openstackUser != '' ) { + argList += '||--openstackuser ' + hexEncode( openstackUser ); + } else { + argList += '||--openstackuser \'\''; + } + var prepParms = $(this).parent().find('input[name=prepParms]').val(); + if ( prepParms != '' ) { + argList += '||--prepparms ' + hexEncode( prepParms ); + } else { + argList += '||--prepparms \'\''; + } + } else { + // Show warning message + var warn = createWarnBar('You did not select a basic or full IVP.'); + warn.prependTo($(this).parents('.ui-tabs-panel')); + driveFunction = 0; + } + var checkboxes = $(this).parent().find('input[name="ivpSchedule"]:checked'); + var ivpSchedule = ""; + for ( var i=0, n=checkboxes.length; i' ); + $('#' + statBarId).find('img').show(); + $.ajax( { + url : 'lib/cmd.php', + dataType : 'json', + data : { + cmd : 'webrun', + tgt : '', + args : 'verifynode '+ argList, + msg : 'out=' + statBarId + ';cmd=verifynode' + }, + success : function(data) { + updateStatusBar(data); + readIvpTable(); + } + }); + + // Show status bar + statBar.show(); + } + }); + verifyXCATForm.append( scheduleBtn ); + + var removeBtn = createButton( 'Remove an IVP Run' ); + removeBtn.click(function() { + var driveFunction = 1; + var argList = ''; + + // Remove any warning messages + $(this).parents('.ui-tabs-panel').find('.ui-state-error').remove(); + + var ivpId = $(this).parent().find('select[name=ivpId]').val(); + if ( ivpId != 'NEW' ) { + argList = '||--remove' + '||--id ' + ivpId + '||end'; + } else { + // Show warning message + var warn = createWarnBar('You did not select the ID of an existing run.'); + warn.prependTo($(this).parents('.ui-tabs-panel')); + driveFunction = 0; + } + + if ( driveFunction == 1 ) { + $('#' + statBarId).find('div').append( 'Invoking verifynode to remove the IVP.
        ' ); + $('#' + statBarId).find('img').show(); + $.ajax( { + url : 'lib/cmd.php', + dataType : 'json', + data : { + cmd : 'webrun', + tgt : '', + args : 'verifynode '+ argList, + msg : 'out=' + statBarId + ';cmd=verifynode' + }, + success : function(data) { + updateStatusBar(data); + readIvpTable(); + } + }); + + // Show status bar + statBar.show(); + } + }); + verifyXCATForm.append( removeBtn ); + + tab.add( newTabId, 'Verify xCAT', verifyXCATForm, false ); + +} + + +/** + * Get node tab + * + * @return Tab object + */ +function getHelpTab() { + return helpTab; +} + + +/** + * Drive the tabdump API to obtain the scheduled IVP information. + * + * @param None. + */ +function readIvpTable() { + // Get IVP information + if (!$.cookie('xcat_ivpinfo')){ + $.ajax( { + url : 'lib/cmd.php', + dataType : 'json', + data : { + cmd : 'tabdump', + tgt : '', + args : 'zvmivp', + msg : '' + }, + + success : setArrays + }); + } +} + + +/** + * Decodes a printable hex string back into the javascript + * unicode string that it represents. + * + * @param hexVal Printable hex string to convert + * back into its original javascript string form. + */ +hexDecode = function( hexVal ){ + var result = ""; + + if ( hexVal.match("^HexEncoded:") ) { + hexVal = hexVal.replace( 'HexEncoded:', '' ); + var hexes = hexVal.match(/.{1,4}/g) || []; + for( var i = 0; i < hexes.length; i++ ) { + result += String.fromCharCode( parseInt( hexes[i], 16 ) ); + } + } else { + result = hexVal; + } + + return result; +} + + +/** + * Encode a string into printable hex. This avoids + * an issues with escaping quotes or handling unicode. + * + * @param str String to encode into printable hex. + */ +function hexEncode( str ){ + var hex; + + var result = 'HexEncoded:'; + for (var i=0; i < str.length; i++) { + hex = str.charCodeAt(i).toString(16); + result += ("000"+hex).slice(-4); + } + + return result; +} + + +/** + * Setup the arrays/hashes with the data from the zvmivp table + * + * @param data Data from HTTP request + */ +function setArrays(data) { + // Get response + var rsp = data.rsp; + + // Clear the list of IVP information. + ivpChoices = new Array(); + ivpChoiceValues = new Array(); + selectInfo = new Object(); + + // Get column value + var idPos = 0; + var ipPos = 0; + var schedulePos = 0; + var lrPos = 0; + var torPos = 0; + var aUserPos = 0; + var oParmsPos = 0; + var pParmsPos = 0; + var mainParmsPos = 0; + var cmntPos = 0; + + var colNameArray = rsp[0].substr(1).split(','); + for ( var i in colNameArray ) { + switch ( colNameArray[i] ) { + case 'id': + idPos = i; + break; + case 'ip': + ipPos = i; + break; + case 'schedule': + schedulePos = i; + break; + case 'last_run': + lrPos = i; + break; + case 'type_of_run': + typeOfRunPos = i; + break; + case 'access_user': + aUserPos = i; + break; + case 'orch_parms': + oParmsPos = i; + break; + case 'prep_parms': + pParmsPos = i; + break; + case 'main_ivp_parms': + mainParmsPos = i; + break; + case 'comments': + cmntPos = i; + break; + case 'disable': + disablePos = i; + break; + default : + break; + } + } + + // Get IVP information from the table data. + for (var i = 1; i < rsp.length; i++) { + var cols = rsp[i].split(','); + var id = cols[idPos].replace(new RegExp('"', 'g'), ''); + var ip = cols[ipPos].replace(new RegExp('"', 'g'), ''); + var schedule = cols[schedulePos].replace(new RegExp('"', 'g'), ''); + var typeOfRun = cols[typeOfRunPos].replace(new RegExp('"', 'g'), ''); + var openstackUser = cols[aUserPos].replace(new RegExp('"', 'g'), ''); + var orchParms = cols[oParmsPos].replace(new RegExp('"', 'g'), ''); + var prepParms = cols[pParmsPos].replace(new RegExp('"', 'g'), ''); + var mainParms = cols[mainParmsPos].replace(new RegExp('"', 'g'), ''); + var comments = cols[cmntPos].replace(new RegExp('"', 'g'), ''); + var disable = cols[disablePos].replace(new RegExp('"', 'g'), ''); + + ivpChoiceValues.push( id ); + selectInfo[id] = new Object(); + selectInfo[id]['id'] = id; + selectInfo[id]['ip'] = ip; + selectInfo[id]['schedule'] = schedule; + selectInfo[id]['typeOfRun'] = typeOfRun.toLowerCase(); + selectInfo[id]['openstackUser'] = hexDecode( openstackUser ); + selectInfo[id]['orchParms'] = hexDecode( orchParms ); + selectInfo[id]['prepParms'] = hexDecode( prepParms ); + selectInfo[id]['mainParms'] = hexDecode( mainParms ); + selectInfo[id]['comments'] = hexDecode(comments); + selectInfo[id]['disable'] = disable.toLowerCase(); + } + + // Sort the choices so we get a pretty list and build the choice strings. + ivpChoiceValues.sort( function(a, b) { + if ( ! isNaN(a) && ! isNaN(b) ) { + // Both are numbers, do a numeric compare + return a-b; + } else if ( isNaN(a) && isNaN(b) ) { + // Both are strings, do a string compare + return a.localeCompare( b ); + } else if ( isNaN(a) ) { + // Strings go after numbers + return 1; + } else { + // Numbers go before strings + return -1; + } + } ); + ivpChoiceValues.forEach( function( id ) { + var idComments; + if ( selectInfo[id]['comments'] != '' ) { + idComments = id + ': ' + selectInfo[id]['comments']; + } else { + idComments = id + ': A comment was not specified.'; + } + ivpChoices.push( idComments ); + }, this); + + // Clear out a hash element for the 'NEW' choice. + selectInfo['NEW'] = new Object(); + selectInfo['NEW']['id'] = ''; + selectInfo['NEW']['ip'] = ''; + selectInfo['NEW']['schedule'] = ''; + selectInfo['NEW']['typeOfRun'] = ''; + selectInfo['NEW']['openstackUser'] = ''; + selectInfo['NEW']['orchParms'] = ''; + selectInfo['NEW']['prepParms'] = ''; + selectInfo['NEW']['mainParms'] = ''; + selectInfo['NEW']['comments'] = ''; + selectInfo['NEW']['disable'] = ''; + + // Add in the NEW option at the top of the array. + ivpChoices.unshift( "NEW: New IVP" ); + ivpChoiceValues.unshift( "NEW" ); + + // Construct the new Select option choices + var ivpChoicesLen = ivpChoices.length; + var selectIdOptions = ''; + for ( var i = 0; i < ivpChoicesLen; i++ ) { + selectIdOptions += ''; + } + + // Find the division containing the select and replace its contents + var thisTabId = $(this).parents('.tab').attr('id'); + var thisIvpSelect = $( '#' + thisTabId + ' select[name=ivpId]' ); + thisIvpSelect.children().remove(); + thisIvpSelect.append( selectIdOptions ); +} + + +/** + * Set node tab + * + * @param tab + * Tab object + * @return Nothing + */ +function setHelpTab(tab) { + helpTab = tab; +} + + +/** + * Set IVP variables based on the chosen Id + * + * @param data Data from HTTP request + */ +function setVarsForId( selected ) { + var id = selected.value; + + // Change the form fields based on the selected ID. + var thisTabId = $(this).parents('.tab').attr('id'); + + var thisField = $( '#' + thisTabId + ' input[name="runType"]' ); + if ( selectInfo[id]['typeOfRun'] == 'basicivp' ) { + thisField.val(['verifyBasic']); + } else if ( selectInfo[id]['typeOfRun'] == 'fullivp' ) { + thisField.val(['verifyOpenStack']); + } else { + var warn = createWarnBar('IVP with the id of '+id+' has an unrecognized type of run value: '+selectInfo[id]['typeOfRun']); + warn.prependTo($(this).parents('.ui-tabs-panel')); + } + + thisField = $( '#' + thisTabId + ' input[name=orchParms]' ); + thisField.val( selectInfo[id]['orchParms'] ); + + thisField = $( '#' + thisTabId + ' input[name=prepParms]' ); + thisField.val( selectInfo[id]['prepParms'] ); + + var thisfield = $( '#' + thisTabId + ' input[name=mainParms]' ); + thisfield.val( selectInfo[id]['mainParms'] ); + + thisField = $( '#' + thisTabId + ' input[name=openstackIP]' ); + thisField.val( selectInfo[id]['ip'] ); + + thisField = $( '#' + thisTabId + ' input[name=openstackUser]' ); + thisField.val( selectInfo[id]['openstackUser'] ); + + var hours = new Object(); + var fullDay = 1; + var hour = selectInfo[id]['schedule'].split(' '); + for ( var j = 0; j < hour.length; j++ ) { + hours[hour[j]] = 1; + } + + for (var i = 0; i <= 23; i++) { + thisField = $( '#' + thisTabId + ' input[name=ivpSchedule][value='+i+']' ); + if ( hours[i] == 1 ) { + thisField.attr( 'checked', true ); + } else { + fullDay = 0; + thisField.attr( 'checked', false ); + } + } + if ( fullDay == 1 ) { + thisField = $( '#' + thisTabId + ' input[name=ivpSchedule][value=Every hour]' ); + thisField.attr( 'checked', true ); + for (var i = 0; i <= 23; i++) { + thisField = $( '#' + thisTabId + ' input[name=ivpSchedule][value='+i+']' ); + thisField.attr( 'checked', false ); + } + } + + thisField = $( '#' + thisTabId + ' input[name=comments]' ); + thisField.val( selectInfo[id]['comments'] ); + + thisField = $( '#' + thisTabId + ' input[name=disable]' ); + if ( selectInfo[id]['disable'] == 1 || selectInfo[id]['disable'] == 'yes' ) { + thisField.val(['disabled']); + } else if ( selectInfo[id]['disable'] == '' || selectInfo[id]['disable'] == 0 ) { + thisField.val(['enabled']); + } else { + var warn = createWarnBar('IVP with the id of '+id+' has an unrecognized disable value: '+selectInfo[id]['disable']); + warn.prependTo($(this).parents('.ui-tabs-panel')); + } +} + + +/** + * Update status bar of a given tab + * + * @param data Data returned from HTTP request + */ +function updateStatusBar(data) { + // Get ajax response + var rsp = data.rsp; + var args = data.msg.split(';'); + var statBarId = ''; + var cmd = ''; + for ( var i=0; i < args.length; i++ ) { + if ( args[i].match('^cmd=') ) { + cmd = args[i].replace('cmd=', ''); + } else if ( args[i].match('^out=') ) { + statBarId = args[i].replace('out=', ''); + } + } + + if (cmd == 'verifynode') { + // Hide loader + $('#' + statBarId).find('img').hide(); + + // Write ajax response to status bar + var prg = writeRsp(rsp, ''); + $('#' + statBarId).find('div').append(prg); + + // Put a check box after the response. + var icon = $('').css({ + 'vertical-align': 'top' + }); + $('#' + statBarId).find( 'div' ).append(icon); + $('#' + statBarId).find( 'div' ).append( '

        ' ); + } else { + // Hide loader + $('#' + statBarId).find('img').hide(); + + // Write ajax response to status bar + var prg = writeRsp(rsp, ''); + $('#' + statBarId).find('div').append(prg); + } +} diff --git a/xCAT-UI/js/monitor/gangliamon.js b/xCAT-UI/js/monitor/gangliamon.js index a5e93b656..411d6a382 100644 --- a/xCAT-UI/js/monitor/gangliamon.js +++ b/xCAT-UI/js/monitor/gangliamon.js @@ -8,8 +8,8 @@ var gridData; // Save nodes path, used for getting detail from rrd file var nodePath = new Object(); -// Save nodes current status, -// unknown = -2, error = -1, warning = 0, normal = 1 are used for sorting +// Save nodes current status, +// unknown = -2, error = -1, warning = 0, normal = 1 are used for sorting var nodeStatus = new Object(); // Update timer @@ -28,14 +28,14 @@ var otherhash; /** * Load Ganglia monitoring tool - * + * * @return Nothing */ function loadGangliaMon() { $('#gangliamon').append(createInfoBar('Checking RPMs')); - + // Get groups and set cookie - if (!$.cookie('groups')) { + if (!$.cookie('xcat_groups')) { $.ajax( { url : 'lib/cmd.php', dataType : 'json', @@ -49,7 +49,7 @@ function loadGangliaMon() { success : setGroupsCookies }); } - + // Check whether Ganglia RPMs are installed on the xCAT MN $.ajax({ url : 'lib/systemcmd.php', @@ -65,13 +65,13 @@ function loadGangliaMon() { /** * Check whether Ganglia RPMs are installed - * + * * @param data Data returned from HTTP request */ function checkGangliaRPMs(data) { var gangliaTab = $('#gangliamon'); gangliaTab.empty(); - + // Get the list of Ganglia RPMs installed var status = data.rsp.split(/\n/); var gangliaRPMs = ["rrdtool", "ganglia-gmetad", "ganglia-gmond"]; @@ -91,7 +91,7 @@ function checkGangliaRPMs(data) { warningBar.prependTo(gangliaTab); } else { gangliaTab.append(createInfoBar('Checking running status')); - + // Check if ganglia is running on the xCAT MN $.ajax( { url : 'lib/cmd.php', @@ -106,19 +106,19 @@ function checkGangliaRPMs(data) { success : checkGangliaRunning }); } - + return; } /** * Check whether Ganglia is running - * + * * @param data Data returned from HTTP request */ function checkGangliaRunning(data) { var gangliaTab = $('#gangliamon'); gangliaTab.empty(); - + // If Ganglia is not started if (data.rsp[0].indexOf("not-monitored") > -1) { // Create link to start Ganglia @@ -151,13 +151,13 @@ function checkGangliaRunning(data) { // If there are any warning messages, append this warning after it var curWarnings = $('#gangliamon').find('.ui-state-error'); - + if (curWarnings.length) { curWarnings.after(warningBar); } else { warningBar.prependTo(gangliaTab); } - + return; } @@ -168,7 +168,7 @@ function checkGangliaRunning(data) { ' Error' + ' Unknown' + ''; - + // Gganglia grid overview var showStr = '

        Grid Overview

        ' + '[Hide]

        ' + @@ -181,11 +181,11 @@ function checkGangliaRunning(data) { // Get summary data and draw on page $('#gangliaGridSummary').append('Getting grid summary data '); sendGridSummaryAjax(); - + // Get all nodes location data which can support the zoom monitor $('#gangliaNodes').append('Getting all nodes status '); sendLocationAjax(); - + // Bind the hide/show button event $('#gangliamon #hidesup').bind('click', function(){ if ('[Hide]' == $(this).text()) { @@ -193,7 +193,7 @@ function checkGangliaRunning(data) { } else { $(this).html('[Hide]'); } - + $('#gangliaGridSummary').toggle(); }); } @@ -211,16 +211,16 @@ function sendLocationAjax() { args : 'graph', msg : '' }, - + success: function(data){ if (!data.rsp[0]) { return; } - + extractLocationlData(data.rsp[0]); // Get nodes current status and draw on the page sendNodeCurrentAjax(); - + // Start the timer to update page per minute gangliaTimer = window.setTimeout('updateGangliaPage()', 60000); } @@ -235,14 +235,14 @@ function extractLocationlData(locationData) { cechash = new Object(); bladehash = new Object(); rackhash = new Object(); - + // Linux nodes which has no parent linuxArray = new Array(); - + // Other unknown nodes only have one parent, use number 1 as there parent otherhash = new Object(); otherhash[1] = new Array(); - + var allnodearray = locationData.split(';'); var temparray; var parent = ''; @@ -250,7 +250,7 @@ function extractLocationlData(locationData) { for (var i in allnodearray) { temparray = allnodearray[i].split(':'); name = temparray[0]; - + // If there is not parent (or mpa, or rack) information parent = temparray[2]; if (!parent) { @@ -258,26 +258,26 @@ function extractLocationlData(locationData) { otherhash[1].push(name); continue; } - + switch (temparray[1].toLowerCase()) { case 'blade': { if (!bladehash[parent]) { bladehash[parent] = new Array(); } - + bladehash[parent].push(name); } break; - + case 'systemx': { if (!rackhash[parent]) { rackhash[parent] = new Array(); } - + rackhash[parent].push(name); } break; - + case 'frame': { if (!framehash[name]) { framehash[name] = new Array(); @@ -289,21 +289,21 @@ function extractLocationlData(locationData) { if (!framehash[parent]) { framehash[parent] = new Array(); } - + framehash[parent].push(name); } break; - + case 'lpar': case 'lpar,osi': case 'osi,lpar': { if (!cechash[parent]) { cechash[parent] = new Array(); } - + cechash[parent].push(name); } - + break; default: { otherhash[1].push(name); @@ -327,7 +327,7 @@ function sendGridSummaryAjax() { args : 'gangliashow;_grid_;hour;_summary_', msg : '' }, - + success: function(data) { createGridSummaryData(data.rsp[0]); drawGridSummary(); @@ -339,7 +339,7 @@ function sendGridSummaryAjax() { * Send AJAX request to get nodes current load information */ function sendNodeCurrentAjax() { - + // Get all nodes current status $.ajax({ url : 'lib/cmd.php', @@ -350,7 +350,7 @@ function sendNodeCurrentAjax() { args : 'gangliacurrent;node;', msg : '' }, - + success: function(data){ createNodeStatusData(data.rsp[0]); drawGangliaNodesArea($('#gangliaorder').val()); @@ -372,7 +372,7 @@ function sendGridCurrentAjax(){ args : 'gangliacurrent;grid', msg : '' }, - + success: function(data){ updateGridSummaryData(data.rsp[0]); drawGridSummary(); @@ -381,13 +381,13 @@ function sendGridCurrentAjax(){ } /** - * Save the grid summary data to local global variable + * Save the grid summary data to local global variable */ function createGridSummaryData(summaryString){ // Empty the global data // The data structure looks like: metric1:time11,val11,time12,val12,...;metric2:time21,val21,time22,val22,...;.... gridData = new Object(); - + var metricArray = summaryString.split(';'); var metricname = ''; var valueArray = ''; @@ -395,13 +395,13 @@ function createGridSummaryData(summaryString){ var tempLength = 0; for (var index = 0; index < metricArray.length; index++) { position = metricArray[index].indexOf(':'); - + // Get the metric name and init its global array to save timestamp and value pair metricname = metricArray[index].substr(0, position); gridData[metricname] = new Array(); valueArray = metricArray[index].substr(position + 1).split(','); tempLength = valueArray.length; - + // Save timestamp and value into global array for (var i = 0; i < tempLength; i++) { gridData[metricname].push(Number(valueArray[i])); @@ -420,7 +420,7 @@ function updateGridSummaryData(currentString){ var tempLength = 0; var index = 0; var tempArray; - + tempLength = metricArray.length; for (index = 0; index < tempLength; index++) { position = metricArray[index].indexOf(':'); @@ -442,19 +442,19 @@ function drawGridSummary() { var gridDrawArea = $('#gangliaGridSummary'); var showStr = ''; var tempStr = $('#gangliamon').attr('class'); - + // jqflot only draws on the visible area // If the tab is hide, return directly if (tempStr.indexOf('hide') != -1) { return; } - + if ($('#gangliamon #hidesup').text() == '[Show]') { return; } - + gridDrawArea.empty(); - showStr = '' + + showStr = '
        ' + '' + '' + '' + @@ -470,7 +470,7 @@ function drawGridSummary() { /** * Draw the load flot by data (summary data or one node data) - * + * * @param areaid Which DIV draw this flot * @param loadpair The load timestamp and value pair * @param cpupair The CPU number and value pair @@ -481,7 +481,7 @@ function drawLoadFlot(areaid, titleprefix, loadpair, cpupair) { var index = 0; var yaxismax = 0; var interval = 1; - + $('#' + areaid).empty(); // Parse load pair, the timestamp must mutiply 1000, javascript time stamp is millisecond for (index = 0; index < loadpair.length; index += 2) { @@ -490,7 +490,7 @@ function drawLoadFlot(areaid, titleprefix, loadpair, cpupair) { yaxismax = loadpair[index + 1]; } } - + // Parse cpu pair for (index = 0; index < cpupair.length; index += 2) { cpunum.push([cpupair[index] * 1000, cpupair[index + 1]]); @@ -498,12 +498,12 @@ function drawLoadFlot(areaid, titleprefix, loadpair, cpupair) { yaxismax = cpupair[index + 1]; } } - + interval = parseInt(yaxismax / 3); if (interval < 1) { interval = 1; } - + $.jqplot(areaid, [load, cpunum], { title: titleprefix + ' Loads/Procs Last Hour', axes:{ @@ -531,7 +531,7 @@ function drawLoadFlot(areaid, titleprefix, loadpair, cpupair) { /** * Draw the CPU usage flot by data (maybe summary data or one node data) - * + * * @param areaid Which DIV draw this flot * @param titleprefix Title used name * @param cpupair The CPU timestamp and value pair @@ -539,15 +539,15 @@ function drawLoadFlot(areaid, titleprefix, loadpair, cpupair) { function drawCpuFlot(areaid, titleprefix, cpupair) { var cpu = new Array(); var index = 0; - + $('#' + areaid).empty(); - + // Time stamp should be mutiplied by 1000 // We get the CPU idle from server for (index = 0; index < cpupair.length; index +=2) { cpu.push([(cpupair[index] * 1000), (100 - cpupair[index + 1])]); } - + $.jqplot(areaid, [cpu],{ title: titleprefix + ' Cpu Use Last Hour', axes:{ @@ -571,7 +571,7 @@ function drawCpuFlot(areaid, titleprefix, cpupair) { /** * Draw the memory usage flot by data (summary data or one node data) - * + * * @param areaid Which DIV draw this flot * @param titleprefix Title used name * @param cpupair The CPU timestamp and value pair @@ -581,14 +581,14 @@ function drawMemFlot(areaid, titleprefix, freepair, totalpair){ var total = new Array(); var tempsize = 0; var index = 0; - + $('#' + areaid).empty(); if (freepair.length < totalpair.length) { tempsize = freepair.length; } else { tempsize = freepair.length; } - + for (index = 0; index < tempsize; index += 2) { var temptotal = totalpair[index + 1]; var tempuse = temptotal - freepair[index + 1]; @@ -597,7 +597,7 @@ function drawMemFlot(areaid, titleprefix, freepair, totalpair){ total.push([totalpair[index] * 1000, temptotal]); use.push([freepair[index] * 1000, tempuse]); } - + $.jqplot(areaid, [use, total], { title: titleprefix + ' Memory Use Last Hour', axes:{ @@ -625,7 +625,7 @@ function drawMemFlot(areaid, titleprefix, freepair, totalpair){ /** * Draw the disk usage flot by data (summary data or one node's data) - * + * * @param areaid Which div draw this flot * @param titleprefix Title used name * @param freepair The free disk number, Ganglia only logs the free data @@ -636,21 +636,21 @@ function drawDiskFlot(areaid, titleprefix, freepair, totalpair) { var total = new Array(); var tempsize = 0; var index = 0; - + $('#' + areaid).empty(); if (freepair.length < totalpair.length) { tempsize = freepair.length; } else{ tempsize = freepair.length; } - + for (index = 0; index < tempsize; index += 2) { var temptotal = totalpair[index + 1]; var tempuse = temptotal - freepair[index + 1]; total.push([totalpair[index] * 1000, temptotal]); use.push([freepair[index] * 1000, tempuse]); } - + $.jqplot(areaid, [use, total], { title: titleprefix + ' Disk Use Last Hour', axes:{ @@ -678,7 +678,7 @@ function drawDiskFlot(areaid, titleprefix, freepair, totalpair) { /** * Draw the network load flot by data (summary data or one node data) - * + * * @param areaid Which div draw this flot * @param titleprefix Title used name * @param inpair The timestamp and value pair for download @@ -691,19 +691,19 @@ function drawNetworkFlot(areaid, titleprefix, inpair, outpair) { var maxvalue = 0; var unitname = 'B'; var divisor = 1; - + for (index = 0; index < inpair.length; index += 2) { if (inpair[index + 1] > maxvalue) { maxvalue = inpair[index + 1]; } } - + for (index = 0; index < outpair.length; index += 2) { if (outpair[index + 1] > maxvalue) { maxvalue = outpair[index + 1]; } } - + if (maxvalue > 3000000) { divisor = 1000000; unitname = 'GB'; @@ -713,15 +713,15 @@ function drawNetworkFlot(areaid, titleprefix, inpair, outpair) { } else { // Do nothing } - + for (index = 0; index < inpair.length; index += 2) { inArray.push([(inpair[index] * 1000), (inpair[index + 1] / divisor)]); } - + for (index = 0; index < outpair.length; index += 2) { outArray.push([(outpair[index] * 1000), (outpair[index + 1] / divisor)]); } - + $.jqplot(areaid, [inArray, outArray], { title: titleprefix + ' Network Last Hour', axes:{ @@ -749,7 +749,7 @@ function drawNetworkFlot(areaid, titleprefix, inpair, outpair) { /** * Create node status data - * + * * @param nodesStatus Node status */ function createNodeStatusData(nodesStatus) { @@ -759,15 +759,15 @@ function createNodeStatusData(nodesStatus) { var index = 0; var tempArray; var tempStr = ''; - + for (index in nodePath) { delete(nodePath[index]); } - + for (index in nodeStatus) { delete(nodeStatus[index]); } - + for (index = 0; index < nodesArray.length; index++) { tempStr = nodesArray[index]; position = tempStr.indexOf(':'); @@ -785,18 +785,18 @@ function createNodeStatusData(nodesStatus) { */ function drawGangliaNodesArea() { var position = 0; - + // Find out the last child's type and name var currentobj = $('#zoomDiv span:last'); var type = currentobj.attr('name').toLowerCase(); var name = currentobj.text(); position = name.indexOf('('); - + if (position > -1) { name = name.substr(3, position - 3); } $('#gangliaNodes').empty(); - + switch (type) { // Draw the node current status case 'blade': @@ -806,7 +806,7 @@ function drawGangliaNodesArea() { drawGangliaNodesAreaPic(type, name); } break; - + // Draw a summary table case 'all': case 'frame': { @@ -825,7 +825,7 @@ function drawGangliaNodesAreaPic(type, name) { var showStr = ''; var nodename = ''; var temparray; - + switch(type) { case 'blade': { arraypoint = bladehash[name]; @@ -846,10 +846,10 @@ function drawGangliaNodesAreaPic(type, name) { break; } $('#gangliaNodes').html('
          '); - + temparray = arraypoint.sort(); templength = arraypoint.length; - + for (index = 0; index < templength; index++) { nodename = temparray[index]; switch (nodeStatus[nodename]) { @@ -868,7 +868,7 @@ function drawGangliaNodesAreaPic(type, name) { } $('#gangliaNodes ul').append(showStr); } - + // Bind all normal and warning nodes click event $('.monitor-normal,.monitorwarning').bind('click', function() { var nodename = $(this).attr('title'); @@ -881,45 +881,45 @@ function drawGangliaNodesAreaTable(type, name) { var table = $('
          '); var row = ''; var usedCec = new Object(); - + var header = $(' NameTypeNormalHeavy LoadErrorUnknown '); table.append(header); - + if (type == 'all') { for (var i in framehash) { var framename = i; - row = '' + framename + 'Frame' + + row = '' + framename + 'Frame' + monitorStatAgg('frame', framehash[i]) + ''; table.append(row); for(var j in framehash[i]){ usedCec[framehash[i][j]] = 1; } } - + for (var i in cechash) { if (usedCec[i]) { continue; } var cecname = i; - row = '' + cecname + 'CEC' + + row = '' + cecname + 'CEC' + monitorStatAgg('cec', cechash[i]) + ''; table.append(row); } - + for (var i in bladehash) { var bladename = i; - row = '' + bladename + 'Blade' + + row = '' + bladename + 'Blade' + monitorStatAgg('blade', bladehash[i]) + ''; table.append(row); } - + for (var i in rackhash) { var rackname = i; row = '' + rackname + 'Rack' + monitorStatAgg('rack', rackhash[i]) + ''; table.append(row); } - + if (otherhash[1].length > 0) { row = 'OtherOther' + monitorStatAgg('other', otherhash[1]) + ''; @@ -933,7 +933,7 @@ function drawGangliaNodesAreaTable(type, name) { table.append(row); } } - + $('#gangliaNodes').append(table); } @@ -947,7 +947,7 @@ function monitorStatAgg(type, inputarray) { var nuknownnum = 0; var tempArray; var tempname; - + switch (type) { case 'blade': case 'cec': @@ -970,7 +970,7 @@ function monitorStatAgg(type, inputarray) { return; break; } - + for (var i in tempArray) { tempname = tempArray[i]; switch(nodeStatus[tempname]) { @@ -988,12 +988,12 @@ function monitorStatAgg(type, inputarray) { break; } } - + normalnum = normalnum?normalnum:'-'; warningnum = warningnum?warningnum:'-'; errornum = errornum?errornum:'-'; nuknownnum = nuknownnum?nuknownnum:'-'; - + return ('' + normalnum + '' + warningnum + '' + errornum + '' + nuknownnum + ''); } @@ -1004,10 +1004,10 @@ function updateGangliaPage() { if ($('#gangliaNodes').size() < 1) { return; } - + sendGridCurrentAjax(); sendNodeCurrentAjax(); - + gangliaTimer = window.setTimeout('updateGangliaPage()', 60000); } @@ -1021,7 +1021,7 @@ function updateZoom(obj) { } $(obj).removeClass('monitor-zoom-link'); $(obj).unbind('click'); - + drawGangliaNodesArea(); } @@ -1031,16 +1031,16 @@ function updateZoom(obj) { function addZoomDiv(obj) { var name = $(obj).text(); var type = $(obj).attr('name'); - + var lastzoomobj = $('#zoomDiv span:last'); lastzoomobj.addClass('monitor-zoom-link'); lastzoomobj.bind('click', function() { updateZoom(this); }); - + var newcontent = ' > ' + name + '(' + type.toUpperCase() + ')'; var newli = '' + newcontent + ''; $('#zoomDiv').append(newli); - + drawGangliaNodesArea(); } \ No newline at end of file diff --git a/xCAT-UI/js/nodes/nodes.js b/xCAT-UI/js/nodes/nodes.js index 0ded38d52..769aa5e87 100644 --- a/xCAT-UI/js/nodes/nodes.js +++ b/xCAT-UI/js/nodes/nodes.js @@ -97,7 +97,7 @@ function loadNodesPage() { success : function(data){ loadGroups(data); - var cookieGroup = $.cookie('selectgrouponnodes'); + var cookieGroup = $.cookie('xcat_selectgrouponnodes'); if (cookieGroup) { $('#groups .groupdiv div').each(function(){ if ($(this).text() == cookieGroup){ @@ -231,7 +231,7 @@ function loadGroups(data) { $(this).addClass('selectgroup'); // Save selected group into cookie - $.cookie('selectgrouponnodes', thisGroup, { expires: 7 }); + $.cookie('xcat_selectgrouponnodes', thisGroup, { expires: 7, path: '/xcat', secure:true }); drawNodesArea(thisGroup,'',thisGroup); }); @@ -347,8 +347,8 @@ function drawNodesArea(targetgroup, cmdargs, message){ // Get last view (if any) // This can be summary, nodes, or graphic - if ($.cookie('tabindex_history')) { - var order = $.cookie('tabindex_history').split(','); + if ($.cookie('xcat_tabindex_history')) { + var order = $.cookie('xcat_tabindex_history').split(','); order[0] = parseInt(order[0]); order[1] = parseInt(order[1]); if (order[0] == 0 || order[1] == 0) { @@ -1095,7 +1095,7 @@ function loadNodes(data) { // Remove any warning messages $(this).parents('.ui-tabs-panel').find('.ui-state-error').remove(); - var zhcpsCheck = $.cookie('zhcps').split(','); + var zhcpsCheck = $.cookie('xcat_zhcps').split(','); var zhcpHash = new Object(); for (var h in zhcpsCheck) { if (!zhcpHash[zhcpsCheck[h]]) { @@ -1917,7 +1917,7 @@ function loadNode(e) { newTabId = 'nodeTab' + inst; } // Reset node process - $.cookie(node + 'Processes', 0); + $.cookie('xcat_' + node + 'Processes', 0, { path: '/xcat', secure:true }); // Add new tab, only if one does not exist var loader = createLoader(newTabId + 'TabLoader'); @@ -2909,28 +2909,28 @@ function setOSImageCookies(data) { } // Save image names in a cookie - $.cookie('imagenames', imageNames); + $.cookie('xcat_imagenames', imageNames, { path: '/xcat', secure:true }); // Save profiles in a cookie var tmp = new Array; for (var key in profilesHash) { tmp.push(key); } - $.cookie('profiles', tmp); + $.cookie('xcat_profiles', tmp, { path: '/xcat', secure:true }); // Save OS versions in a cookie tmp = new Array; for (var key in osVersHash) { tmp.push(key); } - $.cookie('osvers', tmp); + $.cookie('xcat_osvers', tmp, { path: '/xcat', secure:true }); // Save OS architectures in a cookie tmp = new Array; for (var key in osArchsHash) { tmp.push(key); } - $.cookie('osarchs', tmp); + $.cookie('xcat_osarchs', tmp, { path: '/xcat', secure:true }); } /** @@ -2940,7 +2940,7 @@ function setOSImageCookies(data) { */ function setGroupsCookies(data) { var rsp = data.rsp; - $.cookie('groups', rsp); + $.cookie('xcat_groups', rsp, { path: '/xcat', secure:true }); } /** @@ -4202,7 +4202,7 @@ function advancedLoad(group){ zhcpHash[args[0]] = 1; // If there are no disk pools or network names cookie for this hcp - if (!$.cookie(args[0] + 'diskpools') || !$.cookie(args[0] + 'networks')) { + if (!$.cookie('xcat_' + args[0] + 'diskpools') || !$.cookie('xcat_' + args[0] + 'networks')) { // Check if SMAPI is online $.ajax({ url : 'lib/cmd.php', @@ -4226,7 +4226,7 @@ function advancedLoad(group){ setzHcpCookies(shortzHcps); // Retrieve z/VM hypervisors and their zHCPs - if (!$.cookie('zvms')) { + if (!$.cookie('xcat_zvms')) { $.ajax( { url : 'lib/cmd.php', dataType : 'json', diff --git a/xCAT-UI/js/nodes/nodeset.js b/xCAT-UI/js/nodes/nodeset.js index aea3ea310..c1b2acfe8 100644 --- a/xCAT-UI/js/nodes/nodeset.js +++ b/xCAT-UI/js/nodes/nodeset.js @@ -87,7 +87,7 @@ function loadNodesetPage(tgtNodes) { var osSelect = $(''); osSelect.append($('')); - var imageNames = $.cookie('imagenames').split(','); + var imageNames = $.cookie('xcat_imagenames').split(','); if (imageNames) { imageNames.sort(); for (var i in imageNames) { diff --git a/xCAT-UI/js/nodes/physical.js b/xCAT-UI/js/nodes/physical.js index 227a002cf..e8df2d4c8 100644 --- a/xCAT-UI/js/nodes/physical.js +++ b/xCAT-UI/js/nodes/physical.js @@ -9,7 +9,7 @@ var selectNode; /** * Get all nodes useful attributes from remote server - * + * * @param dataTypeIndex The index in the array which contains attributes we need. * @param attrNullNode The target node list for this attribute */ @@ -36,7 +36,7 @@ function initGraphicalData() { /** * Extract all nodes userful data into a hash, which will be used for creating graphical - * + * * @param data The response from xCAT command 'nodels all nodetype.nodetype ppc.parent ...' * @return nodes list for next time query */ @@ -115,7 +115,7 @@ function createPhysicalLayout(nodeList) { } function getNodesAndDraw() { - var groupName = $.cookie('selectgrouponnodes'); + var groupName = $.cookie('xcat_selectgrouponnodes'); $.ajax({ url : 'lib/cmd.php', dataType : 'json', @@ -183,64 +183,64 @@ function fillList(nodeName, defaultnodetype) { } switch (nodeType) { - case 'frame': + case 'frame': if (undefined == bpaList[nodeName]) { bpaList[nodeName] = new Array(); } - + break; case 'lpar,osi': case 'lpar': - case 'osi': + case 'osi': if ('' == parentName) { break; } - + if (undefined == fspList[parentName]) { fillList(parentName, 'cec'); } - + fspList[parentName]['children'].push(nodeName); lparList[nodeName] = status; - + break; - case 'cec': + case 'cec': if (undefined != fspList[nodeName]) { break; } - + fspList[nodeName] = new Object(); fspList[nodeName]['children'] = new Array(); fspList[nodeName]['mtm'] = mtm; - + if ('' == parentName) { break; } - + if (undefined == bpaList[parentName]) { fillList(parentName, 'frame'); } - + bpaList[parentName].push(nodeName); break; - case 'blade': + case 'blade': if (undefined == bladeList[mpa]) { bladeList[mpa] = new Array(); } bladeList[mpa].push(nodeName + ',' + unit); - + break; - case 'systemx': + case 'systemx': if (!rack) { rack = '_notsupply_'; } - + if (undefined == rackList[rack]) { rackList[rack] = new Array(); } - + rackList[rack].push(nodeName + ',' + unit); - + break; default: unknownList.push(nodeName); @@ -276,8 +276,8 @@ function createGraphical() { /** * Create the physical/graphical layout for System p machines - * - * @param bpa All BPA and their related FSPs + * + * @param bpa All BPA and their related FSPs * @param fsp All FSP and their related LPARs * @param area The element to append graphical layout */ @@ -310,7 +310,7 @@ function createSystempGraphical(bpa, fsp, area) { + '">'); - // For P7-IH, all the CECs are insert into the frame from bottom to up, + // For P7-IH, all the CECs are insert into the frame from bottom to up, // so we have to show the CECs same as the physical layout var tempBlankDiv = $('
          '); var tempHeight = 0; @@ -322,7 +322,7 @@ function createSystempGraphical(bpa, fsp, area) { if ((0 == fspIndex) && ('9125-F2C' == fsp[fspName]['mtm'])) { frameDiv.append(tempBlankDiv); } - + frameDiv.append(createFspDiv(fspName, fsp[fspName]['mtm'], fsp)); frameDiv.append(createFspTip(fspName, fsp[fspName]['mtm'], fsp)); @@ -430,7 +430,7 @@ function createSystempGraphical(bpa, fsp, area) { changeNode(lparName, 'unselect'); } } - + // No selected LPARs on the cec, so add all LPARs into selectNode hash else { for (var lparIndex in fspList[fspName]['children']) { @@ -458,8 +458,8 @@ function createSystempGraphical(bpa, fsp, area) { /** * Create the physical/graphical layout for blades - * - * @param blades The blade list in global + * + * @param blades The blade list in global * @param area The element to append the graphical layout */ function createBladeGraphical(blades, area) { @@ -529,8 +529,8 @@ function createBladeGraphical(blades, area) { /** * Create the physical/graphical layout for System x machines - * - * @param xnodes The system x node list in global + * + * @param xnodes The system x node list in global * @param area The element to append graphical layout */ function createSystemxGraphical(xnodes, area) { @@ -765,7 +765,7 @@ function createFspDiv(fspName, mtm, fsp) { if (lparIndex >= 8) { break; } - + var lparName = fsp[fspName]['children'][lparIndex]; var color = statusMap(lparList[lparName]); lparStatusRow += ''; @@ -778,11 +778,11 @@ function createFspDiv(fspName, mtm, fsp) { } else { temp = mtm; } - + if (!hardwareInfo[temp]){ hardwareInfo[temp] = ['unkown', 2]; } - + if (hardwareInfo[temp][1]) { divClass += 'fspDiv' + hardwareInfo[temp][1]; } else { @@ -830,7 +830,7 @@ function createFspTip(fspName, mtm, fsp) { } /** * Map the LPAR status into a color - * + * * @param status LPAR status in nodelist table * @return Corresponding color name */ @@ -844,7 +844,7 @@ function statusMap(status) { case 'sshd': case 'booting': case 'booted': - case 'ping': + case 'ping': color = 'green'; break; case 'noping': @@ -869,7 +869,7 @@ function selectAllLpars(checkbox) { /** * Export all LPAR names from selectNode - * + * * @return lpars' string */ function getSelectNodes() { @@ -904,7 +904,7 @@ function changeNode(lparName, status) { /** * The P7-IH's CECs are insert from bottom to up, so we had to calculate the blank height - * + * * @return Height for the CEC */ function calculateBlank(mtm) { @@ -917,13 +917,13 @@ function calculateBlank(mtm) { } switch (hardwareInfo[mtm][1]) { - case 1: + case 1: return 13; break; - case 2: + case 2: return 24; break; - case 4: + case 4: return 47; break; default: diff --git a/xCAT-UI/js/nodes/updatenode.js b/xCAT-UI/js/nodes/updatenode.js index a38b7db28..943972e8e 100644 --- a/xCAT-UI/js/nodes/updatenode.js +++ b/xCAT-UI/js/nodes/updatenode.js @@ -1,6 +1,6 @@ /** * Load updatenode page - * + * * @param tgtNodes Targets to run updatenode against */ function loadUpdatenodePage(tgtNodes) { @@ -17,7 +17,7 @@ function loadUpdatenodePage(tgtNodes) { success : setOSImageCookies }); - + // Get node OS var osHash = new Object(); var nodes = tgtNodes.split(','); @@ -28,7 +28,7 @@ function loadUpdatenodePage(tgtNodes) { nodes[osBase] = 1; } } - + // Get nodes tab var tab = getNodesTab(); @@ -40,10 +40,10 @@ function loadUpdatenodePage(tgtNodes) { inst = inst + 1; newTabId = 'updatenodeTab' + inst; } - + // Create rscan form var updatenodeForm = $('
          '); - + // Create status bar var statBarId = 'updatenodeStatusBar' + inst; var statusBar = createStatusBar(statBarId).hide(); @@ -55,35 +55,35 @@ function loadUpdatenodePage(tgtNodes) { // Create info bar var infoBar = createInfoBar('Update nodes in an xCAT environment'); updatenodeForm.append(statusBar, infoBar); - + // Create VM fieldset var vmFS = $('
          '); var vmLegend = $('Virtual Machine'); vmFS.append(vmLegend); updatenodeForm.append(vmFS); - + var vmAttr = $('
          '); vmFS.append($('
          ')); vmFS.append(vmAttr); - + // Create options fieldset var optionsFS = $('
          '); var optionsLegend = $('Options'); optionsFS.append(optionsLegend); updatenodeForm.append(optionsFS); - + var optionsAttr = $('
          '); optionsFS.append($('
          ')); optionsFS.append(optionsAttr); - + // Create target node or group input var tgt = $('
          '); vmAttr.append(tgt); - // Create options + // Create options var optionsList = $('
            '); optionsAttr.append(optionsList); - + // Create update all software checkbox (only AIX) if (osHash['AIX']) { var updateAllOption = $('
          • '); @@ -91,7 +91,7 @@ function loadUpdatenodePage(tgtNodes) { updateAllOption.append(updateAllChkBox); optionsList.append(updateAllOption); updateAllOption.append('Install or update all software contained in the source directory'); - + // Create source directory input var allSwScrDirectory = $('
          • '); // Browse server directory and files @@ -131,14 +131,14 @@ function loadUpdatenodePage(tgtNodes) { } }); } - + // Create update software checkbox var updateOption = $('
          • '); var updateChkBox = $(''); optionsList.append(updateOption); updateOption.append(updateChkBox); updateOption.append('Update existing software'); - + // Create source directory input var scrDirectory = $('
          • '); // Browse server directory and files @@ -168,27 +168,27 @@ function loadUpdatenodePage(tgtNodes) { scrDirectory.append(srcDirBrowse); scrDirectory.hide(); optionsList.append(scrDirectory); - + // Create other packages input var otherPkgs = $('
          • '); otherPkgs.hide(); optionsList.append(otherPkgs); - + // Create RPM flags input (only AIX) var aixRpmFlags = $('
          • '); aixRpmFlags.hide(); optionsList.append(aixRpmFlags); - + // Create installp flags input (only AIX) var aixInstallPFlags = $('
          • '); aixInstallPFlags.hide(); optionsList.append(aixInstallPFlags); - + // Create emgr flags input (only AIX) var aixEmgrFlags = $('
          • '); aixEmgrFlags.hide(); optionsList.append(aixEmgrFlags); - + // Show flags when checked updateChkBox.bind('click', function(event) { if ($(this).is(':checked')) { @@ -209,7 +209,7 @@ function loadUpdatenodePage(tgtNodes) { } } }); - + // Create postscripts input var postOption = $('
          • '); var postChkBox = $(''); @@ -219,7 +219,7 @@ function loadUpdatenodePage(tgtNodes) { var postscripts = $('
          • '); postscripts.hide(); optionsList.append(postscripts); - + // Show alternate source directory when checked postChkBox.bind('click', function(event) { if ($(this).is(':checked')) { @@ -230,7 +230,7 @@ function loadUpdatenodePage(tgtNodes) { }); optionsList.append('
          • Distribute and synchronize files
          • '); optionsList.append('
          • Update the ssh keys and host keys for the service nodes and compute nodes
          • '); - + // Create update OS checkbox if (!osHash['AIX']) { var osOption = $('
          • '); @@ -238,12 +238,12 @@ function loadUpdatenodePage(tgtNodes) { optionsList.append(osOption); osOption.append(osChkBox); osOption.append('Update the operating system'); - + var os = $('
          • ').hide(); var osLabel = $(''); var osInput = $(''); osInput.one('focus', function(){ - var tmp = $.cookie('osvers'); + var tmp = $.cookie('xcat_osvers'); if (tmp) { // Turn on auto complete $(this).autocomplete({ @@ -254,7 +254,7 @@ function loadUpdatenodePage(tgtNodes) { os.append(osLabel); os.append(osInput); optionsList.append(os); - + // Show alternate source directory when checked osChkBox.bind('click', function(event) { if ($(this).is(':checked')) { @@ -264,7 +264,7 @@ function loadUpdatenodePage(tgtNodes) { } }); } - + // Generate tooltips updatenodeForm.find('div input[title]').tooltip({ position: "center right", @@ -279,7 +279,7 @@ function loadUpdatenodePage(tgtNodes) { tooltip : "mouseover,mouseout" } }); - + /** * Ok */ @@ -292,7 +292,7 @@ function loadUpdatenodePage(tgtNodes) { // Remove any warning messages $(this).parents('.ui-tabs-panel').find('.ui-state-error').remove(); var ready = true; - + // Generate arguments var chkBoxes = $("#" + newTabId + " input[type='checkbox']:checked"); var optionsStr = ''; @@ -300,7 +300,7 @@ function loadUpdatenodePage(tgtNodes) { for ( var i = 0; i < chkBoxes.length; i++) { option = chkBoxes.eq(i).attr('name'); optionsStr += '-' + option; - + // If update all software is checked if (option == 'S') { var srcDir = $('#' + newTabId + ' input[name=allSwSrcDirectory]').val(); @@ -316,50 +316,50 @@ function loadUpdatenodePage(tgtNodes) { if (srcDirectory) { optionsStr += ';-d;' + srcDirectory; } - + // Get otherpkgs var otherpkgs = $('#' + newTabId + ' input[name=otherpkgs]').val(); if (otherpkgs) { optionsStr += ';otherpkgs=' + otherpkgs; } - + // Get rpm_flags var rpm_flags = $('#' + newTabId + ' input[name=rpm_flags]').val(); if (rpm_flags) { optionsStr += ';rpm_flags=' + rpm_flags; } - + // Get installp_flags var installp_flags = $('#' + newTabId + ' input[name=installp_flags]').val(); if (installp_flags) { optionsStr += ';installp_flags=' + installp_flags; } - + // Get emgr_flags var emgr_flags = $('#' + newTabId + ' input[name=emgr_flags]').val(); if (emgr_flags) { optionsStr += ';emgr_flags=' + emgr_flags; } } - + // If postscripts is checked if (option == 'P') { // Get postscripts optionsStr += ';' + $('#' + newTabId + ' input[name=postscripts]').val(); } - + // If operating system is checked if (option == 'o') { // Get the OS optionsStr += ';' + $('#' + newTabId + ' input[name=os]').val(); } - + // Append ; to end of string if (i < (chkBoxes.length - 1)) { optionsStr += ';'; } } - + // If no inputs are empty if (ready) { // Get nodes @@ -368,7 +368,7 @@ function loadUpdatenodePage(tgtNodes) { // Disable all inputs and Ok button $('#' + newTabId + ' input').attr('disabled', 'disabled'); $(this).attr('disabled', 'true'); - + /** * (1) Boot to network */ diff --git a/xCAT-UI/js/provision/images.js b/xCAT-UI/js/provision/images.js index 59ad4c467..d1a6f174d 100644 --- a/xCAT-UI/js/provision/images.js +++ b/xCAT-UI/js/provision/images.js @@ -48,7 +48,7 @@ function loadImages(data) { // Data returned var rsp = data.rsp; if (rsp[0].indexOf('Could not find any object definitions') > -1) { - rsp = new Array(); + rsp = new Array(); } // Image attributes hash @@ -198,7 +198,7 @@ function loadImages(data) { // Turn table into a datatable var myDataTable = $('#' + imgTableId).dataTable({ - 'iDisplayLength': 50, + 'iDisplayLength': 50, 'bLengthChange': false, "bScrollCollapse": true, "sScrollY": "400px", @@ -502,7 +502,7 @@ function openAddImageDialog() { imageAttr.append(imageName, imageType, architecture, osName, osVersion, profile, provisionMethod); optionAttr.append(otherpkgDirectory, packageDirectory, packageList, template); - // Generate tooltips + // Generate tooltips addImageForm.find('div input[title],select[title]').tooltip({ position: "center right", offset: [-2, 10], @@ -720,9 +720,9 @@ function loadCreateImage() { return; } - var imageOsVers = $.cookie("osvers").split(","); - var imageArch = $.cookie("osarchs").split(","); - var profiles = $.cookie("profiles").split(","); + var imageOsVers = $.cookie("xcat_osvers").split(","); + var imageArch = $.cookie("xcat_osarchs").split(","); + var profiles = $.cookie("xcat_profiles").split(","); var createImgForm = $('
            '); var createImgFS = $('
            ').append('Create Image'); @@ -1329,7 +1329,7 @@ function openCopyCdDialog() { basePath : '/install' // Limit user to only install directory }); - // Generate tooltips + // Generate tooltips copyLinuxForm.find('div input[title],select[title]').tooltip({ position: "center right", offset: [-2, 10], diff --git a/xCAT-UI/js/provision/provision.js b/xCAT-UI/js/provision/provision.js index a732f5653..00a059080 100644 --- a/xCAT-UI/js/provision/provision.js +++ b/xCAT-UI/js/provision/provision.js @@ -33,7 +33,7 @@ function loadProvisionPage() { } // Get OS image names - if (!$.cookie('imagenames')){ + if (!$.cookie('xcat_imagenames')){ $.ajax( { url : 'lib/cmd.php', dataType : 'json', @@ -49,7 +49,7 @@ function loadProvisionPage() { } // Get groups - if (!$.cookie('groups')){ + if (!$.cookie('xcat_groups')){ $.ajax( { url : 'lib/cmd.php', dataType : 'json', diff --git a/xCAT-UI/js/service/service.js b/xCAT-UI/js/service/service.js index 96be4c75a..3d49b98d9 100644 --- a/xCAT-UI/js/service/service.js +++ b/xCAT-UI/js/service/service.js @@ -73,7 +73,7 @@ function initServicePage() { loadServicePage(); // Initialize tab index history - $.cookie('tabindex_history', '0,0'); + $.cookie('xcat_tabindex_history', '0,0', { path: '/xcat', secure:true }); } /** @@ -185,14 +185,14 @@ function loadServiceProvisionPage(tabId) { var okBtn = createButton('Ok'); okBtn.bind('click', function(event) { var userName = $.cookie('xcat_username'); - var tmp = $.cookie(userName + '_usrnodes'); + var tmp = $.cookie('xcat_' + userName + '_usrnodes'); // Get maximun number for nodes from cookie var nodes = ''; var maxVM = 0; if (tmp.length) { nodes = tmp.split(','); - maxVM = parseInt($.cookie(userName + '_maxvm')); + maxVM = parseInt($.cookie('xcat_' + userName + '_maxvm')); // Do not allow user to clone if the maximum number of VMs is reached if (nodes.length >= maxVM) { @@ -302,7 +302,7 @@ function loadManagePage(tabId) { */ function getUserNodesDef() { var userName = $.cookie('xcat_username'); - var userNodes = $.cookie(userName + '_usrnodes'); + var userNodes = $.cookie('xcat_' + userName + '_usrnodes'); if (userNodes) { // Get nodes definitions $.ajax( { @@ -597,7 +597,7 @@ function loadNodesTable(data) { // Refresh nodes table var userName = $.cookie('xcat_username'); - var userNodes = $.cookie(userName + '_usrnodes'); + var userNodes = $.cookie('xcat_' + userName + '_usrnodes'); if (userNodes) { // Get nodes definitions $.ajax( { @@ -932,7 +932,7 @@ function setGroupCookies(data) { // Set cookie to expire in 60 minutes var exDate = new Date(); exDate.setTime(exDate.getTime() + (240 * 60 * 1000)); - $.cookie('srv_groups', groups, { expires: exDate }); + $.cookie('xcat_srv_groups', groups, { expires: exDate, path: '/xcat', secure:true }); } } @@ -1041,28 +1041,28 @@ function setOSImageCookies(data) { } // Save image names in a cookie - $.cookie('srv_imagenames', imageNames); + $.cookie('xcat_srv_imagenames', imageNames); // Save profiles in a cookie var tmp = new Array; for (var key in profilesHash) { tmp.push(key); } - $.cookie('srv_profiles', tmp); + $.cookie('xcat_srv_profiles', tmp); // Save OS versions in a cookie tmp = new Array; for (var key in osVersHash) { tmp.push(key); } - $.cookie('srv_osvers', tmp); + $.cookie('xcat_srv_osvers', tmp); // Save OS architectures in a cookie tmp = new Array; for (var key in osArchsHash) { tmp.push(key); } - $.cookie('srv_osarchs', tmp); + $.cookie('xcat_srv_osarchs', tmp); } @@ -1111,7 +1111,7 @@ function setUserNodes(data) { // Set cookie to expire in 240 minutes var exDate = new Date(); exDate.setTime(exDate.getTime() + (240 * 60 * 1000)); - $.cookie(userName + '_usrnodes', usrNodes, { expires: exDate }); + $.cookie('xcat_' + userName + '_usrnodes', usrNodes, { expires: exDate, path: '/xcat', secure:true }); } // End of if } @@ -1316,10 +1316,10 @@ function monitorNode(node, monitor) { function cloneNode(tgtNodes) { var userName = $.cookie('xcat_username'); var nodes = tgtNodes.split(','); - var tmp = $.cookie(userName + '_usrnodes'); + var tmp = $.cookie('xcat_' + userName + '_usrnodes'); var usrNodes = tmp.split(','); - var maxVM = parseInt($.cookie(userName + '_maxvm')); + var maxVM = parseInt($.cookie('xcat_' + userName + '_maxvm')); // Do not allow user to clone if the maximum number of VMs is reached if (usrNodes.length >= maxVM) { @@ -1596,7 +1596,7 @@ function unlockNode(tgtNodes) { */ function getNodesCurrentLoad(){ var userName = $.cookie('xcat_username'); - var nodes = $.cookie(userName + '_usrnodes'); + var nodes = $.cookie('xcat_' + userName + '_usrnodes'); // Get nodes current status $.ajax({ @@ -2147,7 +2147,7 @@ function setMaxVM() { // Set cookie to expire in 60 minutes var exDate = new Date(); exDate.setTime(exDate.getTime() + (240 * 60 * 1000)); - $.cookie(userName + '_maxvm', rsp, { expires: exDate }); + $.cookie('xcat_' + userName + '_maxvm', rsp, { expires: exDate }); } }); } \ No newline at end of file diff --git a/xCAT-UI/js/srv_xcatauth.js b/xCAT-UI/js/srv_xcatauth.js index c86d56af4..be3314432 100644 --- a/xCAT-UI/js/srv_xcatauth.js +++ b/xCAT-UI/js/srv_xcatauth.js @@ -4,30 +4,30 @@ $(document).ready(function() { $('#header').remove(); $('#content').remove(); - + var winHeight = document.body.clientHeight; var diagHeight = $('#login').css('height'); diagHeight = diagHeight.substr(0, diagHeight.length - 2); diagHeight = Number(diagHeight); - + // The window's height is to small to show the dialog var tmpHeight = 0; if ((winHeight - 50) < diagHeight){ tmpHeight = 0; } else { - tmpHeight = parseInt((winHeight - diagHeight - 50) / 2); + tmpHeight = parseInt((winHeight - diagHeight - 50) / 2); } - + $('#login').css('margin', tmpHeight + 'px auto'); $('button').bind('click', function(){ authenticate(); }).button(); - + if (document.location.protocol == 'http:') { $('#login-status').html('You are using an unencrypted session!'); $('#login-status').css('color', 'red'); } - + if (!$("#login input[name='username']").val()) { $("#login input[name='username']").focus(); } else { @@ -51,7 +51,7 @@ $(document).ready(function() { /** * Update login dialog - * + * * @param data Data returned from AJAX call * @param txtStatus Status of login */ @@ -62,11 +62,11 @@ function onlogin(data, txtStatus) { if (data.authenticated == 'yes') { $('#login-status').text('Login successful'); window.location = 'service.php'; - + // Set user name cookie var exDate = new Date(); exDate.setTime(exDate.getTime() + (240 * 60 * 1000)); - $.cookie('xcat_username', usrName, { expires: exDate }); + $.cookie('xcat_username', usrName, { expires: exDate, path: '/xcat', secure:true }); } else { $('#login-status').text('Authentication failure'); $('#login-status').css('color', '#FF0000'); @@ -79,7 +79,7 @@ function onlogin(data, txtStatus) { function authenticate() { $('#login-status').css('color', '#000000'); $('#login-status').html('Authenticating...'); - + var passwd = $("#login input[name='password']").val(); $.post('lib/srv_log.php', { username : $("#login input[name='username']").val(), diff --git a/xCAT-UI/js/ui.js b/xCAT-UI/js/ui.js index c0600d7a5..771fa5d65 100644 --- a/xCAT-UI/js/ui.js +++ b/xCAT-UI/js/ui.js @@ -1,8 +1,11 @@ /** * Tab constructor * - * @param tabId Tab ID - * @param tabName Tab name + * @param tabId + * Tab ID + * @param tabName + * Tab name + * @return Nothing */ var Tab = function(tabId) { this.tabId = tabId; @@ -29,8 +32,8 @@ Tab.prototype.init = function() { tabs.bind('tabsselect', function(event, ui){ // Save the order tabs were selected var order; - if ($.cookie('tabindex_history')) { - order = $.cookie('tabindex_history').split(','); + if ($.cookie('xcat_tabindex_history')) { + order = $.cookie('xcat_tabindex_history').split(','); order[1] = order[0]; // Set index 1 to last selected tab order[0] = ui.index; // Set index 0 to currently selected tab } else { @@ -40,7 +43,7 @@ Tab.prototype.init = function() { order[1] = ui.index; } - $.cookie('tabindex_history', order); + $.cookie('xcat_tabindex_history', order, { path: '/xcat', secure:true }); }); // Remove dummy tab @@ -97,7 +100,7 @@ Tab.prototype.add = function(tabId, tabName, tabCont, closeable) { // Go back to last tab if user is trying to close currently selected tab if (tabs.tabs('option', 'selected') == tabIndex) { // Get last selected tab from history - var order = $.cookie('tabindex_history').split(','); + var order = $.cookie('xcat_tabindex_history').split(','); if (order[1]) { tabs.tabs('select', parseInt(order[1])); } else { diff --git a/xCAT-UI/js/xcatauth.js b/xCAT-UI/js/xcatauth.js index ef363759d..3aad393d1 100644 --- a/xCAT-UI/js/xcatauth.js +++ b/xCAT-UI/js/xcatauth.js @@ -4,32 +4,32 @@ $(document).ready(function() { $('#header').remove(); $('#content').remove(); - + var winheight = document.body.clientHeight; var diaheight = $('#login').css('height'); diaheight = diaheight.substr(0, diaheight.length - 2); diaheight = Number(diaheight); - + // The window's height is to small to show the dialog var tempheight = 0; if ((winheight - 50) < diaheight){ tempheight = 0; } else { - tempheight = parseInt((winheight - diaheight - 50) / 2); + tempheight = parseInt((winheight - diaheight - 50) / 2); } - + $('#login').css('margin', tempheight + 'px auto'); $('button').bind('click', function(){ authenticate(); }); - + $('#login button').button(); - + if (document.location.protocol == "http:") { $("#login-status").html("You are using an unencrypted session!"); $("#login-status").css("color", "#ff0000"); } - + if ($("#login input[name='username']").val() == "") { $("#login input[name='username']").focus(); } else { @@ -53,7 +53,7 @@ $(document).ready(function() { /** * Update login dialog - * + * * @param data Data returned from AJAX call * @param txtStatus Status of login */ @@ -64,25 +64,26 @@ function onlogin(data, txtStatus) { $("#login-status").text("Login successful"); // Not the first time to log - if ($.cookie('logonflag')){ + if ($.cookie('xcat_logonflag')){ // Remembered what page they were trying to go to window.location = window.location.pathname; } else { window.location = 'help.php'; } - + // Set user name cookie var usrName = $("#login input[name='username']").val(); var exDate = new Date(); exDate.setTime(exDate.getTime() + (240 * 60 * 1000)); - $.cookie('xcat_username', usrName, { expires: exDate }); - + $.cookie('xcat_username', usrName, { expires: exDate, path: '/xcat', secure:true }); + // Set the logonflag - $.cookie('logonflag', 'yes', { + $.cookie('xcat_logonflag', 'yes', { path : '/xcat', - expires : 100 + expires : 100, + secure:true }); - + } else { $("#login-status").text("Authentication failure").css("color", "#FF0000"); } diff --git a/xCAT-UI/lib/functions.php b/xCAT-UI/lib/functions.php index 51827fc4e..20c27efa6 100644 --- a/xCAT-UI/lib/functions.php +++ b/xCAT-UI/lib/functions.php @@ -101,7 +101,7 @@ function submit_request($req, $skipVerify, $opts_array){ if ($flush){ echo str_pad('',1024)."\n"; } - + while (!feof($fp)) { // Read until there is no more // Remove newlines and add it to the response @@ -118,7 +118,7 @@ function submit_request($req, $skipVerify, $opts_array){ } else { $flushtail = ''; } - + $str = preg_replace('/.*<\/errorcode>/', '', $str); // Strip HTML tags from output if ($tmp = trim(strip_tags($str))) { @@ -127,7 +127,7 @@ function submit_request($req, $skipVerify, $opts_array){ format_TBD($tmp); } else { $tmp = preg_replace('/\n\s*/', "\n", $tmp); - + // Print out output by default echo '
            ' . $tmp . '
            '; ob_flush(); @@ -180,7 +180,7 @@ function submit_request($req, $skipVerify, $opts_array){ $rsp = FALSE; } } - + return $rsp; } @@ -201,10 +201,10 @@ function xorcrypt($data, $key) { * Get password */ function getpassword() { - if (isset($GLOBALS['xcatauthsecret'])) { - $cryptext = $GLOBALS['xcatauthsecret']; - } else if (isset($_COOKIE["xcatauthsecret"])) { - $cryptext = $_COOKIE["xcatauthsecret"]; + if (isset($GLOBALS['xcat_authsecret'])) { + $cryptext = $GLOBALS['xcat_authsecret']; + } else if (isset($_COOKIE["xcat_authsecret"])) { + $cryptext = $_COOKIE["xcat_authsecret"]; } else { return false; } @@ -214,7 +214,7 @@ function getpassword() { /** * Get the password splitting knowledge between server and client side persistant storage. - * Caller should regenerate session ID when contemplating a new user/password, + * Caller should regenerate session ID when contemplating a new user/password, * to preclude session fixation, though fixation is limited without the secret. * * @param $password Password @@ -226,8 +226,8 @@ function setpassword($password) { // Non-ascii characters, encode it in base64 $cryptext = base64_encode($cryptext); - setcookie("xcatauthsecret",$cryptext,0,'/'); - $GLOBALS["xcatauthsecret"] = $cryptext; + setcookie("xcat_authsecret",$cryptext,0,'/xcat','',true); + $GLOBALS["xcat_authsecret"] = $cryptext; $_SESSION["secretkey"] = $key; } @@ -342,18 +342,31 @@ function isRootAcess() { * Log out of current user session */ function logout() { + session_start(); // Clear the secret cookie from browser - if (isset($_COOKIE["xcatauthsecret"])) { - setcookie("xcatauthsecret",'',time()-86400*7,'/'); + if (isset($_COOKIE["xcat_authsecret"])) { + setcookie("xcat_authsecret",'',time()-86400*7,'/xcat','',true); + } + + // Clear any cookies where the key starts with "xcat_" + foreach ($_COOKIE as $key => $value) { + if (substr($key,0,5) === "xcat_") { + unset($_COOKIE[$key]); + setcookie($key, null, time() - 3600, '/xcat','',true); + } } // Expire session cookie if (isset($_COOKIE[session_name()])) { - setcookie(session_name(),"",time()-86400*7,"/"); + setcookie(session_name(),"",time()-86400*7,"/xcat",'',true); } + // Clear session id + setcookie(session_id(),"",time()-86400*7,"/"); + // Clear server store of data $_SESSION=array(); + session_destroy(); } /** diff --git a/xCAT-UI/lib/srv_functions.php b/xCAT-UI/lib/srv_functions.php index 6dafe540e..4481eba3c 100644 --- a/xCAT-UI/lib/srv_functions.php +++ b/xCAT-UI/lib/srv_functions.php @@ -208,10 +208,10 @@ function format_TBD($str) { * Get password */ function getpassword() { - if (isset($GLOBALS['xcatauthsecret'])) { - $cryptext = $GLOBALS['xcatauthsecret']; - } else if (isset($_COOKIE["xcatauthsecret"])) { - $cryptext = $_COOKIE["xcatauthsecret"]; + if (isset($GLOBALS['xcat_authsecret'])) { + $cryptext = $GLOBALS['xcat_authsecret']; + } else if (isset($_COOKIE["xcat_authsecret"])) { + $cryptext = $_COOKIE["xcat_authsecret"]; } else { return false; } @@ -233,8 +233,8 @@ function setpassword($password) { // Non-ascii characters, encode it in base64 $cryptext = base64_encode($cryptext); - setcookie("xcatauthsecret",$cryptext,0,'/'); - $GLOBALS["xcatauthsecret"] = $cryptext; + setcookie("xcat_authsecret",$cryptext,0,'/xcat','',true); + $GLOBALS["xcat_authsecret"] = $cryptext; $_SESSION["secretkey"] = $key; } @@ -285,13 +285,13 @@ function isAuthenticated() { */ function logout() { // Clear the secret cookie from browser - if (isset($_COOKIE["xcatauthsecret"])) { - setcookie("xcatauthsecret",'',time()-86400*7,'/'); + if (isset($_COOKIE["xcat_authsecret"])) { + setcookie("xcat_authsecret",'',time()-86400*7,'/xcat','',true); } // Expire session cookie if (isset($_COOKIE[session_name()])) { - setcookie(session_name(),"",time()-86400*7,"/"); + setcookie(session_name(),"",time()-86400*7,"/xcat",'',true); } // Clear server store of data diff --git a/xCAT-UI/xCAT-UI.spec b/xCAT-UI/xCAT-UI.spec index 0881b8f8a..15b714315 100644 --- a/xCAT-UI/xCAT-UI.spec +++ b/xCAT-UI/xCAT-UI.spec @@ -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 diff --git a/xCAT-buildkit/debian/compat b/xCAT-buildkit/debian/compat index 7ed6ff82d..ec635144f 100644 --- a/xCAT-buildkit/debian/compat +++ b/xCAT-buildkit/debian/compat @@ -1 +1 @@ -5 +9 diff --git a/xCAT-buildkit/debian/control b/xCAT-buildkit/debian/control index dfe2c644d..ee045d41e 100644 --- a/xCAT-buildkit/debian/control +++ b/xCAT-buildkit/debian/control @@ -1,11 +1,11 @@ Source: xcat-buildkit Section: admin Priority: extra -Maintainer: xu qing -Build-Depends: debhelper (>= 5) -Standards-Version: 3.7.2 +Maintainer: Xu Qing +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 diff --git a/xCAT-buildkit/debian/rules b/xCAT-buildkit/debian/rules index b5e90c11b..c792c4f31 100755 --- a/xCAT-buildkit/debian/rules +++ b/xCAT-buildkit/debian/rules @@ -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 diff --git a/xCAT-buildkit/share/xcat/kits/kit_template/source_packages/sample/pkg2/pkg2.spec b/xCAT-buildkit/share/xcat/kits/kit_template/source_packages/sample/pkg2/pkg2.spec index d513149d9..a6d191cd9 100644 --- a/xCAT-buildkit/share/xcat/kits/kit_template/source_packages/sample/pkg2/pkg2.spec +++ b/xCAT-buildkit/share/xcat/kits/kit_template/source_packages/sample/pkg2/pkg2.spec @@ -14,7 +14,6 @@ BuildRoot: /var/tmp/%{name}-%{version}-%{release}-root %ifos linux BuildArch: noarch -#Requires: %endif Provides: pkg2 = %{epoch}:%{version} diff --git a/xCAT-buildkit/share/xcat/kits/kit_template/source_packages/sample/pkg3/pkg3.spec b/xCAT-buildkit/share/xcat/kits/kit_template/source_packages/sample/pkg3/pkg3.spec index 17270eeaf..a4d361cf6 100644 --- a/xCAT-buildkit/share/xcat/kits/kit_template/source_packages/sample/pkg3/pkg3.spec +++ b/xCAT-buildkit/share/xcat/kits/kit_template/source_packages/sample/pkg3/pkg3.spec @@ -14,7 +14,6 @@ BuildRoot: /var/tmp/%{name}-%{version}-%{release}-root %ifos linux BuildArch: noarch -#Requires: %endif Provides: pkg3 = %{epoch}:%{version} diff --git a/xCAT-buildkit/xCAT-buildkit.spec b/xCAT-buildkit/xCAT-buildkit.spec index 6809507c7..8531dac38 100644 --- a/xCAT-buildkit/xCAT-buildkit.spec +++ b/xCAT-buildkit/xCAT-buildkit.spec @@ -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 - - - - diff --git a/xCAT-client/bin/mysqlsetup b/xCAT-client/bin/mysqlsetup index e242ed930..b8936aa30 100755 --- a/xCAT-client/bin/mysqlsetup +++ b/xCAT-client/bin/mysqlsetup @@ -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 diff --git a/xCAT-client/bin/pping b/xCAT-client/bin/pping index 09bf8cdba..af13369d4 100755 --- a/xCAT-client/bin/pping +++ b/xCAT-client/bin/pping @@ -162,6 +162,11 @@ sub fping_pping { } else { + if (!-x '/usr/bin/fping') + { + print "fping is not available, please install missing package fping.\n"; + exit 1; + } open(FPING, "fping " . join(' ', @$nodes) . " 2>&1 |") or die("Cannot open fping pipe: $!"); } while () { diff --git a/xCAT-client/bin/rcons b/xCAT-client/bin/rcons index 1f6eadd74..98cbc69fe 100755 --- a/xCAT-client/bin/rcons +++ b/xCAT-client/bin/rcons @@ -73,7 +73,7 @@ fi if [ $USE_CONFLUENT == "1" ] && ([ -x "/opt/confluent/bin/confetty" ] || [ -x "/usr/bin/confetty" ] || [ -x "/usr/local/bin/confetty" ]); then # use confluent, make sure conserver is not also running - CONSERVER_RC=`service conserver status >> /dev/null; echo $?` + CONSERVER_RC=`service conserver status >& /dev/null; echo $?` if [[ ${CONSERVER_RC} == 0 ]]; then echo "Error: consoleservice is set to 'confluent' but conserver is running. Stop conserver, run makeconfluentcfg, and retry..." exit 1 @@ -107,7 +107,7 @@ elif [ -f "/usr/bin/console" ] || [ -f "/bin/console" ]; then # use conserver # make sure confluent is not also running, only if confluent is installed if [[ -f "/etc/init.d/confluent" ]]; then - CONFLUENT_RC=`service confluent status >> /dev/null; echo $?` + CONFLUENT_RC=`service confluent status >& /dev/null; echo $?` if [[ ${CONFLUENT_RC} == 0 ]]; then echo "Error: consoleservice is set to 'conserver' but confluent is running. Stop confluent, run makeconservercf, and retry..." exit 1 diff --git a/xCAT-client/bin/xdshbak b/xCAT-client/bin/xdshbak index 66bc59ff3..fd343f30f 100644 --- a/xCAT-client/bin/xdshbak +++ b/xCAT-client/bin/xdshbak @@ -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 () # $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 () # 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}; } } diff --git a/xCAT-client/debian/compat b/xCAT-client/debian/compat index 7ed6ff82d..ec635144f 100644 --- a/xCAT-client/debian/compat +++ b/xCAT-client/debian/compat @@ -1 +1 @@ -5 +9 diff --git a/xCAT-client/debian/control b/xCAT-client/debian/control index 321fc1b19..db9b62fe4 100644 --- a/xCAT-client/debian/control +++ b/xCAT-client/debian/control @@ -2,11 +2,14 @@ Source: xcat-client Section: admin Priority: extra Maintainer: xCAT -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. diff --git a/xCAT-client/debian/rules b/xCAT-client/debian/rules index 5beff8b73..17e87fad6 100755 --- a/xCAT-client/debian/rules +++ b/xCAT-client/debian/rules @@ -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" diff --git a/xCAT-client/pods/man1/pping.1.pod b/xCAT-client/pods/man1/pping.1.pod index 8e563ed41..93eac03f4 100644 --- a/xCAT-client/pods/man1/pping.1.pod +++ b/xCAT-client/pods/man1/pping.1.pod @@ -16,7 +16,7 @@ B {B<-v>|B<--version>} B is a utility used to ping a list of nodes in parallel. B will return an unsorted list of nodes with a ping or noping status. -B front-ends nmap or fping if available. +B front-ends B or B if available. This command does not support the xcatd client/server communication. It must be run on the management node. @@ -34,7 +34,7 @@ If more than one interface is specified, each interface will be combined with th =item B<-f>|B<--use_fping> -Use fping instead of nmap +Use B instead of B =item B<-h>|B<--help> diff --git a/xCAT-client/pods/man1/prsync.1.pod b/xCAT-client/pods/man1/prsync.1.pod index acb3276ca..5278774e2 100644 --- a/xCAT-client/pods/man1/prsync.1.pod +++ b/xCAT-client/pods/man1/prsync.1.pod @@ -6,18 +6,16 @@ prsync - parallel rsync B I [I I<...>] I -B [B<-o> I] [B<-f> I] [I I I<...>] [I I I<...>] +B [B<-o> I] [B<-f> I] [I I I<...>] [I I I<...>] I B {B<-h>|B<--help>|B<-v>|B<--version>} =head1 B -B is a front-end to rsync for a single or range of nodes and/or -groups in parallel. +B is a front-end to rsync for a single or range of nodes and/or groups in parallel. -Note: this command does not support the xcatd client/server communication and therefore must be run on the management node. It does not support hierarchy, use xdcp -F to run rsync from the -management node to the compute node via a service node +Note: this command does not support the xcatd client/server communication and therefore must be run on the management node. It does not support hierarchy, use B to run rsync from the management node to the compute node via a service node B is NOT multicast, but is parallel unicasts. @@ -25,14 +23,13 @@ B is NOT multicast, but is parallel unicasts. =over 7 -=item I +=item B<-o> I rsync options. See B. =item B<-f> I -Specifies a fanout value for the maximum number of concur- -rently executing remote shell processes. +Specifies a fanout value for the maximum number of concurrently executing remote shell processes. =item I diff --git a/xCAT-client/pods/man1/rinv.1.pod b/xCAT-client/pods/man1/rinv.1.pod index 2a0540235..e65e78bde 100644 --- a/xCAT-client/pods/man1/rinv.1.pod +++ b/xCAT-client/pods/man1/rinv.1.pod @@ -8,7 +8,7 @@ B [B<-h>|B<--help>|B<-v>|B<--version>] =head2 BMC/MPA specific: -B I {B|B|B|B|B|B|B|B|B|B|B|B|B|B} +B I {B|B|B|B|B|B|B|B|B|B|B|B|B|B|B} =head2 OpenPOWER server specific: @@ -32,6 +32,11 @@ B I {B|B|B|B|B|B|B B I [B<-t>] +=head2 pdu specific: + +B I + + =head2 zVM specific: B I [B|B] diff --git a/xCAT-client/pods/man1/rpower.1.pod b/xCAT-client/pods/man1/rpower.1.pod index a15206d67..d9ca23bf4 100644 --- a/xCAT-client/pods/man1/rpower.1.pod +++ b/xCAT-client/pods/man1/rpower.1.pod @@ -12,6 +12,8 @@ B [B<-h>|B<--help>|B<-v>|B<--version>] B I [B|B|B|B|B|B|B|B|B|B [B<-w> I] [B<-o>] [B<-r>]] +B I [B|B|B] + =head2 PPC (with IVM or HMC) specific: B I [B<--nodeps>] {B} @@ -54,6 +56,10 @@ B I [B|B|B|B|B] B I [B|B|B|B|B|B] +=head2 pdu specific: + +B I [B|B|B] + =head1 DESCRIPTION B controls the power for a single or range of nodes, via the out-of-band path. diff --git a/xCAT-client/pods/man1/rvitals.1.pod b/xCAT-client/pods/man1/rvitals.1.pod index c34a42b6b..3bce77fa8 100644 --- a/xCAT-client/pods/man1/rvitals.1.pod +++ b/xCAT-client/pods/man1/rvitals.1.pod @@ -82,12 +82,14 @@ Retrieves power status. =item B Retrieves total power uptime. This value only increases, unless -the Service Processor flash gets updated. +the Service Processor flash gets updated. This option is not valid +for x86 architecture systems. =item B Retrieves total number of reboots. This value only increases, -unless the Service Processor flash gets updated. +unless the Service Processor flash gets updated. This option +is not valid for x86 architecture systems. =item B diff --git a/xCAT-client/pods/man1/xdsh.1.pod b/xCAT-client/pods/man1/xdsh.1.pod index 72d3ede24..a9d06a6c4 100644 --- a/xCAT-client/pods/man1/xdsh.1.pod +++ b/xCAT-client/pods/man1/xdsh.1.pod @@ -442,8 +442,7 @@ variable is overridden by the B<-S> flag. =item B Specifies the time, in seconds, to wait for output from -each remote target. This variable is overridden by the B<-t> -flag. +each remote target. This variable is overridden by the B<-t> flag. =back diff --git a/xCAT-client/pods/man1/xdshbak.1.pod b/xCAT-client/pods/man1/xdshbak.1.pod index 61262572e..fed91b77d 100644 --- a/xCAT-client/pods/man1/xdshbak.1.pod +++ b/xCAT-client/pods/man1/xdshbak.1.pod @@ -4,7 +4,7 @@ B - Formats the output of the B command. =head1 B -B [B<-c> | B<-x> | B<-h> | B<-q>] +B [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 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 diff --git a/xCAT-client/pods/man8/copycds.8.pod b/xCAT-client/pods/man8/copycds.8.pod index 234c1e375..23a6af93e 100644 --- a/xCAT-client/pods/man8/copycds.8.pod +++ b/xCAT-client/pods/man8/copycds.8.pod @@ -16,7 +16,7 @@ The B 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). +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). =head1 OPTIONS diff --git a/xCAT-client/pods/man8/makeconservercf.8.pod b/xCAT-client/pods/man8/makeconservercf.8.pod index 06ea193c6..5b4dad03d 100644 --- a/xCAT-client/pods/man8/makeconservercf.8.pod +++ b/xCAT-client/pods/man8/makeconservercf.8.pod @@ -4,7 +4,7 @@ B - creates the conserver configuration file from info in the x =head1 SYNOPSIS -B [B<-V|--verbose>] [B<-d|--delete>] I +B [B<-V|--verbose>] [B<-d|--delete>] [I] B [B<-V|--verbose>] [B<-l|--local>] [I] @@ -18,14 +18,16 @@ B [B<-h|--help|-v|--version>] =head1 DESCRIPTION The B command will write out the /etc/conserver.cf, using information from the nodehm table -and related tables (e.g. mp, ipmi, ppc). Normally, B 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 will write all nodes to the /etc/conserver.cf +file. If a I 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 will remove specified nodes from /etc/conserver.cf file. If I 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 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 diff --git a/xCAT-client/pods/man8/makeknownhosts.8.pod b/xCAT-client/pods/man8/makeknownhosts.8.pod index 150932b5c..612c04b7e 100644 --- a/xCAT-client/pods/man8/makeknownhosts.8.pod +++ b/xCAT-client/pods/man8/makeknownhosts.8.pod @@ -10,7 +10,7 @@ B [B<-h>|B<--help>] =head1 DESCRIPTION -B Replaces or removes in the known_hosts file in the $ROOTHOME/.ssh directory, the enties for the nodes from the noderange input to the command. +B Replaces or removes entries for the nodes in the known_hosts file in the $ROOTHOME/.ssh directory. The known_hosts file entry is built from the shared ssh host key that xCAT distributes to the installed nodes. HMCs, AMM, switches, etc., where xCAT does not distribute the shared ssh host key, should not be put in the noderange. @@ -18,7 +18,7 @@ HMCs, AMM, switches, etc., where xCAT does not distribute the shared ssh host ke To build the known_hosts entry for a node, you are only required to have the node in the database, and name resolution working for the node. You do not have to be able to access the node. Having this file with correct entries, will avoid the ssh warning when nodes are automatically added to the known_hosts file. -The file should be distributed using xdcp to all the nodes, if you want node to node communication not to display the warning. +The file should be distributed using B to all the nodes, if you want node to node communication not to display the warning. =head1 OPTIONS @@ -27,7 +27,7 @@ The file should be distributed using xdcp to all the nodes, if you want node to =item I A set of comma delimited node names and/or group names. -See the "noderange" man page for details on supported formats. +See the I man page for details on supported formats. =item B<-r|--remove> diff --git a/xCAT-client/xCAT-client.spec b/xCAT-client/xCAT-client.spec index d44961f2a..44235d213 100644 --- a/xCAT-client/xCAT-client.spec +++ b/xCAT-client/xCAT-client.spec @@ -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 - diff --git a/xCAT-confluent/xCAT-confluent.spec b/xCAT-confluent/xCAT-confluent.spec index 44111fb73..8b3dc9e1f 100644 --- a/xCAT-confluent/xCAT-confluent.spec +++ b/xCAT-confluent/xCAT-confluent.spec @@ -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 diff --git a/xCAT-csm/xCAT-csm.spec b/xCAT-csm/xCAT-csm.spec index e0d993026..b173e3043 100644 --- a/xCAT-csm/xCAT-csm.spec +++ b/xCAT-csm/xCAT-csm.spec @@ -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 diff --git a/xCAT-genesis-builder/buildrpm b/xCAT-genesis-builder/buildrpm index 2bad105ca..f301961a3 100755 --- a/xCAT-genesis-builder/buildrpm +++ b/xCAT-genesis-builder/buildrpm @@ -188,6 +188,17 @@ echo Expanding the initramfs into /tmp/xcatgenesis.$$/opt/xcat/share/xcat/netboo cd /tmp/xcatgenesis.$$/opt/xcat/share/xcat/netboot/genesis/$BUILDARCH/fs zcat /tmp/xcatgenesis.$$.rfs|cpio -dumi +# add the perl library +PERL_LIB_DIR="/usr/share/perl5 /usr/lib64/perl5 /usr/local/lib64/perl5 /usr/local/share/perl5" +for d in `echo $PERL_LIB_DIR`; do + if [ -e $d ]; then + echo Adding perl libary "$d" + TEMP_DIR=/tmp/xcatgenesis.$$/opt/xcat/share/xcat/netboot/genesis/$BUILDARCH/fs/"$d" + mkdir -p $TEMP_DIR + cp -a -t $TEMP_DIR $d/. + fi +done + if [ $? -ne 0 ]; then echo "ERROR - expanding the initramfs, please correct the issues and try again" exit 1 diff --git a/xCAT-genesis-builder/debian/compat b/xCAT-genesis-builder/debian/compat index 7ed6ff82d..ec635144f 100644 --- a/xCAT-genesis-builder/debian/compat +++ b/xCAT-genesis-builder/debian/compat @@ -1 +1 @@ -5 +9 diff --git a/xCAT-genesis-builder/debian/control b/xCAT-genesis-builder/debian/control index b107a09ab..ebb738dcf 100644 --- a/xCAT-genesis-builder/debian/control +++ b/xCAT-genesis-builder/debian/control @@ -2,15 +2,15 @@ Source: xcat-genesis-base-amd64 Section: admin Priority: extra Maintainer: xCAT -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. diff --git a/xCAT-genesis-builder/install b/xCAT-genesis-builder/install index 67e6950fa..2f1d0507f 100755 --- a/xCAT-genesis-builder/install +++ b/xCAT-genesis-builder/install @@ -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 diff --git a/xCAT-genesis-builder/install.ubuntu b/xCAT-genesis-builder/install.ubuntu index 9ae3f5af2..f073efff0 100755 --- a/xCAT-genesis-builder/install.ubuntu +++ b/xCAT-genesis-builder/install.ubuntu @@ -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 diff --git a/xCAT-genesis-builder/xCAT-genesis-base.spec b/xCAT-genesis-builder/xCAT-genesis-base.spec index 989980591..95e1e719d 100755 --- a/xCAT-genesis-builder/xCAT-genesis-base.spec +++ b/xCAT-genesis-builder/xCAT-genesis-base.spec @@ -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 diff --git a/xCAT-genesis-builder/xCAT-genesis-builder.spec b/xCAT-genesis-builder/xCAT-genesis-builder.spec index a8b1b30a2..e067b59d2 100644 --- a/xCAT-genesis-builder/xCAT-genesis-builder.spec +++ b/xCAT-genesis-builder/xCAT-genesis-builder.spec @@ -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/ Source: xCAT-genesis-builder.tar.bz2 Buildroot: %{_localstatedir}/tmp/xCAT-genesis-builder diff --git a/xCAT-genesis-scripts/bin/bmcsetup b/xCAT-genesis-scripts/bin/bmcsetup index 1be072fcd..13a6eb47d 100755 --- a/xCAT-genesis-scripts/bin/bmcsetup +++ b/xCAT-genesis-scripts/bin/bmcsetup @@ -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 ! ipmitool -V 2>/dev/null| grep "version"; 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=$! @@ -243,7 +253,7 @@ elif [ "$IPMIMFG" == "674" ]; then # DELL logger -s -t $log_label -p local4.info "BMCPORT is $BMCPORT" if [ "$BMCPORT" == "0" ]; then # dedicated ipmitool delloem lan set dedicated &>/dev/null - elif [ "$BMCPORT" == "1" -o "$BMCPORT" == "2" -o "$BMCPORT" == "3" -o "$BMCPORT" == "4"]; then # shared + elif [ "$BMCPORT" == "1" -o "$BMCPORT" == "2" -o "$BMCPORT" == "3" -o "$BMCPORT" == "4" ]; then # shared ipmitool delloem lan set shared &>/dev/null ipmitool delloem lan set shared with lom$BMCPORT &>/dev/null ipmitool delloem lan set shared with failover all loms &>dev/null @@ -430,7 +440,7 @@ for user in $BMCUS; do TRIES=0 if [ "$CURRENTUSER" != "$user" ]; then # Change the user name, if necessary - while ! ipmitool -d $idev user set name $USERSLOT $user; do + while ! ipmitool -d $idev user set name $USERSLOT "$user"; do sleep 1 let TRIES=TRIES+1 if [ $TRIES -gt $TIMEOUT ]; then break; fi @@ -445,7 +455,7 @@ for bmcp in $BMCPW; do TRIES=0 # Set the password for the specified user - while ! ipmitool -d $idev user set password $USERSLOT $bmcp; do + while ! ipmitool -d $idev user set password $USERSLOT "$bmcp"; do sleep 1 let TRIES=TRIES+1 if [ $TRIES -gt $TIMEOUT ]; then break; fi @@ -605,3 +615,5 @@ while [ $idev -gt 0 ]; do fi done +# remove the bmc configuration information before exit +rm -f /tmp/ipmicfg.xml diff --git a/xCAT-genesis-scripts/bin/doxcat b/xCAT-genesis-scripts/bin/doxcat index e03df7a83..0f39e1e89 100755 --- a/xCAT-genesis-scripts/bin/doxcat +++ b/xCAT-genesis-scripts/bin/doxcat @@ -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 2>&1 & + logger -s -t $log_label -p local4.info "Attempting to sync hardware clock..." + ( hwclock --systohc ) /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 /dev/null kill "$RSYSLOG_PID" 2>/dev/null while kill -0 "$RSYSLOG_PID" 2>/dev/null diff --git a/xCAT-genesis-scripts/bin/getipmi b/xCAT-genesis-scripts/bin/getipmi index f129cb382..ecc046213 100755 --- a/xCAT-genesis-scripts/bin/getipmi +++ b/xCAT-genesis-scripts/bin/getipmi @@ -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; diff --git a/xCAT-genesis-scripts/debian/compat b/xCAT-genesis-scripts/debian/compat index 45a4fb75d..ec635144f 100644 --- a/xCAT-genesis-scripts/debian/compat +++ b/xCAT-genesis-scripts/debian/compat @@ -1 +1 @@ -8 +9 diff --git a/xCAT-genesis-scripts/debian/control-amd64 b/xCAT-genesis-scripts/debian/control-amd64 index ada257a83..01223cc6f 100644 --- a/xCAT-genesis-scripts/debian/control-amd64 +++ b/xCAT-genesis-scripts/debian/control-amd64 @@ -2,14 +2,17 @@ Source: xcat-genesis-scripts Section: admin Priority: extra Maintainer: xCAT -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 -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 - +Architecture: all +Depends: xcat-genesis-base-amd64 (>=2.13.2) +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. diff --git a/xCAT-genesis-scripts/debian/control-ppc64el b/xCAT-genesis-scripts/debian/control-ppc64el index 825592d88..af9ad5ed8 100644 --- a/xCAT-genesis-scripts/debian/control-ppc64el +++ b/xCAT-genesis-scripts/debian/control-ppc64el @@ -2,14 +2,17 @@ Source: xcat-genesis-scripts Section: admin Priority: extra Maintainer: xCAT -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) +Depends: xcat-genesis-base-ppc64 (>=2.13.2) 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. diff --git a/xCAT-genesis-scripts/xCAT-genesis-scripts.spec b/xCAT-genesis-scripts/xCAT-genesis-scripts.spec index 2dcd33925..2a35f23af 100755 --- a/xCAT-genesis-scripts/xCAT-genesis-scripts.spec +++ b/xCAT-genesis-scripts/xCAT-genesis-scripts.spec @@ -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,16 +22,14 @@ 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 +Requires: xCAT-genesis-base-%{tarch} >= 2:2.13.2 Buildroot: %{_localstatedir}/tmp/xCAT-genesis Packager: IBM Corp. @@ -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/* diff --git a/xCAT-probe/debian/compat b/xCAT-probe/debian/compat index 7ed6ff82d..ec635144f 100644 --- a/xCAT-probe/debian/compat +++ b/xCAT-probe/debian/compat @@ -1 +1 @@ -5 +9 diff --git a/xCAT-probe/debian/control b/xCAT-probe/debian/control index f0b56bb3f..2a7549362 100644 --- a/xCAT-probe/debian/control +++ b/xCAT-probe/debian/control @@ -2,11 +2,11 @@ Source: xcat-probe Section: admin Priority: extra Maintainer: xCAT -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 diff --git a/xCAT-probe/debian/rules b/xCAT-probe/debian/rules index cb48348a6..bb1842ebe 100755 --- a/xCAT-probe/debian/rules +++ b/xCAT-probe/debian/rules @@ -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" diff --git a/xCAT-probe/lib/perl/LogParse.pm b/xCAT-probe/lib/perl/LogParse.pm index a7c6e5379..3161703ac 100644 --- a/xCAT-probe/lib/perl/LogParse.pm +++ b/xCAT-probe/lib/perl/LogParse.pm @@ -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; } diff --git a/xCAT-probe/lib/perl/probe_global_constant.pm b/xCAT-probe/lib/perl/probe_global_constant.pm index 44b683117..454d58f36 100644 --- a/xCAT-probe/lib/perl/probe_global_constant.pm +++ b/xCAT-probe/lib/perl/probe_global_constant.pm @@ -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 @@ -23,12 +27,14 @@ $::STATE_BOOTLODER = 4; $::STATE_KERNEL = 5; $::STATE_INITRD = 6; $::STATE_KICKSTART = 7; -$::STATE_INSTALLING = 8; -$::STATE_INSTALLRPM = 9; -$::STATE_POSTSCRIPT = 10; -$::STATE_BOOTING = 11; -$::STATE_POSTBOOTSCRIPT = 12; -$::STATE_COMPLETED = 13; +$::STATE_NETBOOTING = 8; +$::STATE_ROOTIMG = 9; +$::STATE_INSTALLING = 10; +$::STATE_INSTALLRPM = 11; +$::STATE_POSTSCRIPT = 12; +$::STATE_BOOTING = 13; +$::STATE_POSTBOOTSCRIPT = 14; +$::STATE_COMPLETED = 15; #The description of every important stage of provision process %::STATE_DESC = ( @@ -73,5 +79,7 @@ $::STATE_DISCOVER_COMPLETED = 10; $::STATE_DISCOVER_COMPLETED => "discovery_complete", ); +$::DISKFUL = 1; +$::DISKLESS = 2; 1; diff --git a/xCAT-probe/lib/perl/probe_utils.pm b/xCAT-probe/lib/perl/probe_utils.pm index db96fdc24..47034b700 100644 --- a/xCAT-probe/lib/perl/probe_utils.pm +++ b/xCAT-probe/lib/perl/probe_utils.pm @@ -7,6 +7,7 @@ use File::Path; use File::Copy; use Time::Local; use Socket; +use List::Util qw/sum/; #----------------------------------------- @@ -257,6 +258,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 +268,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 +350,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 +489,211 @@ 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() { + 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; +} + +#------------------------------------------ + +=head3 + Description: + Convert second to time + Arguments: + second_in : the time in seconds + Returns: + xx:xx:xx xx hours xx minutes xx seconds +=cut + +#------------------------------------------ +sub convert_second_to_time { + my $second_in = shift; + $second_in = shift if (($second_in) && ($second_in =~ /probe_utils/)); + my @time = (); + my $result; + + if ($second_in == 0) { + return "00:00:00"; + } + + my $count = 0; + while ($count < 3) { + my $tmp_second; + if ($count == 2) { + $tmp_second = $second_in % 100; + } else { + $tmp_second = $second_in % 60; + } + + if ($tmp_second < 10) { + push @time, "0$tmp_second"; + } else { + push @time, "$tmp_second"; + } + + $second_in = ($second_in - $tmp_second) / 60; + $count++; + } + + my @time_result = reverse @time; + $result = join(":", @time_result); + + return $result; +} + +#------------------------------------------ + +=head3 + Description: + print table + Arguments: + content: double dimensional array + has_title: whether has title in content + + eg: @content = ($title, + @content1, + @content2, + ...... + ); + $has_title = 1; + print_table(\@content, $has_title); + + or @content = (@content1, + @content2, + ...... + ); + $has_title = 0; + print_table(\@content, $has_title); + + Ouput: + -------------------------- + | xxxxxxx | + -------------------------- + | xxx | xxxx | xx | xx | + -------------------------- + | xx | xxxx | xxxx | xx | + -------------------------- + + or + + -------------------------- + | xxx | xxxx | xx | xx | + -------------------------- + | xx | xxxx | xxxx | xx | + -------------------------- + +=cut + +#------------------------------------------ +sub print_table { + my $content = shift; + $content = shift if (($content) && ($content =~ /probe_utils/)); + my $has_title = shift; + my $title; + + if ($has_title) { + $title = shift(@$content); + } + + my @length_array; + foreach my $row (@$content) { + for (my $i = 0; $i < @{$row}; $i++) { + my $ele_length = length(${$row}[$i]); + $length_array[$i] = $ele_length if ($length_array[$i] < $ele_length); + } + } + + my @content_new; + my @row_new; + my $row_line; + my $whole_length; + foreach my $row (@$content) { + @row_new = (); + for (my $i = 0; $i < @{$row}; $i++) { + push @row_new, ${$row}[$i] . " " x ($length_array[$i] - length(${$row}[$i])); + } + $row_line = "| " . join(" | ", @row_new) . " |"; + push @content_new, $row_line; + } + $whole_length = length($row_line); + + my $title_new; + my $title_length = length($title); + if ($has_title) { + if ($whole_length - 1 <= $title_length) { + $title_new = $title; + } else { + $title_new = " " x (($whole_length - 2 - $title_length)/2) . "$title"; + $title_new .= " " x ($whole_length - 2 - length($title_new)); + $title_new = "|" . $title_new . "|"; + } + } + + my $format_line = "-" x $whole_length; + print $format_line . "\n" if ($has_title); + print $title_new . "\n" if ($has_title); + print $format_line . "\n"; + foreach (@content_new) { + print $_ . "\n"; + } + print $format_line . "\n"; +} + 1; diff --git a/xCAT-probe/subcmds/discovery b/xCAT-probe/subcmds/discovery index 080d10ce0..c47a1add1 100755 --- a/xCAT-probe/subcmds/discovery +++ b/xCAT-probe/subcmds/discovery @@ -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); } } diff --git a/xCAT-probe/subcmds/osdeploy b/xCAT-probe/subcmds/osdeploy index 63231b5e2..e6b4f1f51 100755 --- a/xCAT-probe/subcmds/osdeploy +++ b/xCAT-probe/subcmds/osdeploy @@ -41,14 +41,16 @@ my $monitor = 1; #used by developer, to debug the detail information about function running my $debug = 0; +my $osdeploy_start_time; + #--------------------------------------------- # Command Usage #--------------------------------------------- my $program_name = basename("$0"); $::USAGE = "Usage: $program_name -h - $program_name -n [-t ] [-V] - $program_name -n -r [-V] + $program_name -n [-t ] [-p ] [-V] + $program_name -n -r [-p ] [-V] Description: Probe operating system provision process. Supports two modes - 'Realtime monitor' and 'Replay history'. @@ -65,6 +67,11 @@ Options: -r : Trigger 'Replay history' mode. Follow the duration of rolling back. Units are 'h' (hour) or 'm' (minute) Supported format examples: 3h30m (3 hours and 30 minutes ago), 2h (2 hours ago), 40m (40 minutes ago) and 3 (3 hours ago). If unit is not specified, hour will be used by default. + -p Show elapsed time of each stage during provision for each node + Support 3 output format: + 'compact': Elapsed time of provision for each node. + 'phase' : Elapsed time for DHCP, INSTALL, POSTSCRIPTS and POSTBOOTSCRIPTS stages, and time for whole provision. + 'origin' : Show origin start time of each stage. "; @@ -82,6 +89,7 @@ if ( !GetOptions("--help|h|?" => \$help, "T" => \$test, "V" => \$verbose, + "p=s" => \$performance, "t=s" => \$maxwaittime, "r=s" => \$rollforward_time_of_replay, "n=s" => \$noderange)) @@ -115,6 +123,14 @@ if ($rollforward_time_of_replay) { } } +if ($performance) { + if ($performance ne "compact" and $performance ne "phase" and $performance ne "origin") { + probe_utils->send_msg("stdout", "f", "Unsupported parameter for option '-p'"); + probe_utils->send_msg("stdout", "", "$::USAGE"); + exit 1; + } +} + my $rst = do_pre_check($noderange); if ($debug) { print "Dumper macmap--------\n"; @@ -127,6 +143,9 @@ if ($debug) { #if failed to pass pre-check, exit directly exit $rst if ($rst); +# record every status's start time and end time for each node +# $node_status_time{$node}{$status}{start_time} = $start_time; +my %node_status_time = () if ($performance); if ($rollforward_time_of_replay) { $monitor = 0; @@ -293,6 +312,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 +360,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 +405,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) { @@ -421,7 +452,7 @@ sub do_replay { sub conclusion_report { my $node_state_ref = shift; - probe_utils->send_msg("stdout", "", "==================osdeploy_probe_report================="); + probe_utils->send_msg("stdout", "", "====================== Summary ====================="); if ($debug) { print "---->the result of %node_state<------\n"; @@ -454,43 +485,45 @@ sub conclusion_report { my $stop_stage = 0; my $start_rpower = 0; - my $power_on = 0; my $isntalling = 0; my $postbootscript = 0; + my $completed = 0; #calculate node provision result #the max value of all state is the final stop stage 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); + $completed = 1 if ($_ == $::STATE_COMPLETED) } - # 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 when replay + # 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 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"; - } else { - if ($stop_stage != $::STATE_COMPLETED) { - $failed_node{$node}{provision_stop_point} = $stop_stage; + unless ($monitor) { + if (! $start_rpower) { + $failed_node{$node}{non_provision_prediction} = "Without provision process during rollback time window"; + next; + } elsif (!$isntalling && $postbootscript && !$completed) { + $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; + } } - + my $is_success = 1; if (%failed_node) { + $is_success = 0; my $failed_node_num = keys %failed_node; if ($failed_node_num > 1) { probe_utils->send_msg("stdout", "d", "There are $failed_node_num node provision failures"); @@ -502,17 +535,195 @@ 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 { probe_utils->send_msg("stdout", "o", "All nodes provisioned successfully"); } + + performance_calculation($is_success) if ($performance); + return 0; } #------------------------------------------ +=head3 + Description: + Calculate the performance of provision (for each node) + Arguments: + performance: compact: calculate how much time spent for provision + phase: calculate how much time spent for each status (DHCP, INSTALL, POSTSCRIPTS, POSTBOOTSCRIPTS) + origin : show time point for each status + reserve: reserve for other type + Returns: +=cut + +#------------------------------------------ +sub performance_calculation { + my $is_success = shift; + #print Dumper(%node_status_time); + + return if (!%node_status_time); + + # Currently, only diskful is supported + my $provision_type = $::DISKFUL; + + my @status_for_time = (); + my $isnull = 0; + my @time_content; + # print table's first line + # @status_for_time: the status that needed to calculate time + + my @title_lines = ( + [qw/NODE ELAPSED/], + [qw/NODE SVRBOOT INSTALL POST POSTBOOT ELAPSED/], + [qw/NODE RPOWER DHCP BOOTLOADER KERNEL INITRD INSTALL POST POSTBOOT COMPLETED/], + [qw/NODE RPOWER DHCP BOOTLOADER KERNEL INITRD NETBOOTING ROOTIMG POSTBOOT COMPLETED/], + [qw/NODE DHCP BOOTLOADER KERNEL INITRD NETBOOTING ROOTIMG POSTBOOT ELAPSED/]); + + if ($performance eq "compact") { + push @time_content, "Provision Time"; + push @time_content, $title_lines[0]; + @status_for_time = ($::STATE_COMPLETED); + } + + if ($performance eq "phase") { + push @time_content, "Time for Phases"; + push @time_content, $title_lines[1]; + @status_for_time = ($::STATE_DHCP, $::STATE_INSTALLRPM, $::STATE_POSTSCRIPT, $::STATE_POSTBOOTSCRIPT, $::STATE_COMPLETED); + } + + if ($performance eq "origin") { + push @time_content, "Start Time for Stage"; + if ($provision_type == $::DISKFUL){ + push @time_content, $title_lines[2]; + @status_for_time = ($::STATE_POWER_ON, $::STATE_DHCP, $::STATE_BOOTLODER, $::STATE_KERNEL, $::STATE_INITRD, $::STATE_INSTALLRPM, $::STATE_POSTSCRIPT, $::STATE_POSTBOOTSCRIPT, $::STATE_COMPLETED); + } else { # reserved for diskless + push @time_content, $title_lines[3]; + @status_for_time = ($::STATE_POWER_ON, $::STATE_DHCP, $::STATE_BOOTLODER, $::STATE_KERNEL, $::STATE_INITRD, $::STATE_NETBOOTING, $::STATE_ROOTIMG, $::STATE_POSTBOOTSCRIPT, $::STATE_COMPLETED); + } + } + + if ($performance eq "reserve") { + push @time_content, $title_lines[4]; + @status_for_time = ($::STATE_DHCP, $::STATE_BOOTLODER, $::STATE_KERNEL, $::STATE_INITRD, $::STATE_NETBOOTING, $::STATE_ROOTIMG, $::STATE_POSTBOOTSCRIPT, $::STATE_COMPLETED); + } + + # calculate time for each node and status + foreach my $node (keys %node_status_time) { + + my @timeinfo = (); + push @timeinfo, $node; + + if ($performance eq "origin") { + foreach my $status (@status_for_time) { + if ($node_status_time{$node}{$status}{time_point}) { + if ($status == $::STATE_DHCP or $status == $::STATE_BOOTLODER) { + # If there is no start time of kernel, means osdeploy start after kernel download + if (!$node_status_time{$node}{$::STATE_KERNEL}{start_time}) { + push @timeinfo, "NULL"; + $isnull = 1; + # If there is start time of kernel, but dhcp or bootloader's time value larger than kernel. It means dhcp and bootloader is after kernel, not the value we wanted. + } elsif ($node_status_time{$node}{$status}{start_time} > $node_status_time{$node}{$::STATE_KERNEL}{start_time}) { + push @timeinfo, "NULL"; + $isnull = 1; + } else { + push @timeinfo, $node_status_time{$node}{$status}{time_point}; + } + } elsif ($status >= $::STATE_INSTALLRPM and (!$node_status_time{$node}{$status-1}{start_time} and !$node_status_time{$node}{$status-1}{end_time})) { + push @timeinfo, "NULL"; + $isnull = 1; + } else { + push @timeinfo, $node_status_time{$node}{$status}{time_point}; + } + } else { + push @timeinfo, "NULL"; + $isnull = 1; + } + } + push @time_content, [ @timeinfo ]; + next; + } + + # get the start time and end time for each step + foreach my $status (@status_for_time) { + my $tmp_status; + my $tmp_detail_status; + if ($performance eq "phase") { + # when phase, if the status is DHCP, use power on time as it's start time + $tmp_detail_status = $::STATE_DHCP; + } else { + # if not phase, power on time is the start time for each steps + $tmp_detail_status = $::STATE_COMPLETED; + } + + if ($status <= $tmp_detail_status or $status == $::STATE_COMPLETED) { + $tmp_status = $::STATE_POWER_ON; + } else { + $tmp_status = $status; + } + + my $tmp_start_time = $node_status_time{$node}{$tmp_status}{start_time}; + my $tmp_end_time = $node_status_time{$node}{$status}{end_time}; + $tmp_end_time = $node_status_time{$node}{$status}{start_time} if ($status != $::STATE_DHCP and $status != $::STATE_INSTALLRPM and $status != $::STATE_POSTSCRIPT and $status != $::STATE_POSTBOOTSCRIPT and $node_status_time{$node}{$status}{start_time}); + + if ($tmp_start_time && $tmp_end_time) { + if ($status >= $::STATE_INSTALLRPM and (!$node_status_time{$node}{$status-1}{start_time} and !$node_status_time{$node}{$status-1}{end_time})) { + push @timeinfo, "NULL"; + $isnull = 1; + } else { + push @timeinfo, probe_utils->convert_second_to_time($tmp_end_time - $tmp_start_time); + } + } else { + push @timeinfo, "NULL"; + $isnull = 1; + } + } + push @time_content, [ @timeinfo ]; + } + + probe_utils->print_table(\@time_content, 1); + + if ($performance eq "phase") { + print "SVRBOOT : Time from rpower to acquire ip\n"; + print "INSTALL : Time to download all rpm/deb packages\n"; + print "POST : Postscript execution time\n"; + print "POSTBOOT : Postbootscript execution time\n"; + print "ELAPSED : Total provision time\n"; + } + + if ($isnull and $is_success) { + my $command_input = "xcatprobe -w $program_name"; + $command_input .= " -n $noderange" if ($noderange); + $command_input .= " -p $performance"; + $command_input .= " -V" if ($verbose); + my $osdeploy_end_time = time(); + my $time_for_replay = $osdeploy_end_time - $osdeploy_start_time; + my $time_hour = ($time_for_replay - $time_for_replay%3600) / 3600 + 1; + $command_input .= " -r $time_hour" . "h"; + probe_utils->send_msg("stdout", "", "Did not get correct time, please run '$command_input' to get correct time"); + } +} + +#------------------------------------------ + =head3 Description: Implement the monitor feature @@ -532,6 +743,8 @@ sub do_monitor { my $rst = 0; my $terminal = 0; + $osdeploy_start_time = time() if ($performance); + $SIG{TERM} = $SIG{INT} = sub { $terminal = 1; }; @@ -548,7 +761,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 +931,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,18 +942,18 @@ 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+(.+)/) { my $ip = $1; my $mac = $2; my $nic = $3; - + 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 +964,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) { @@ -763,6 +976,10 @@ sub handle_dhcp_msg { $ipnodemap{$ip} = $node; set_node_state($node_state_ref, $node, $::STATE_DHCP); + if ($performance and !$node_status_time{$node}{$::STATE_DHCP}{end_time}) { + $node_status_time{$node}{$::STATE_DHCP}{time_point} = $log_ref->{time_record}; + $node_status_time{$node}{$::STATE_DHCP}{end_time} = $log_ref->{time}; + } } } elsif ($log_ref->{msg} =~ /BOOTREQUEST\s+from\s+(.+)\s+via\s+([^:]+)(.*)/) { my $mac = $1; @@ -770,7 +987,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 +998,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) { @@ -791,6 +1008,10 @@ sub handle_dhcp_msg { $ipnodemap{$ip} = $node; set_node_state($node_state_ref, $node, $::STATE_DHCP); + if ($performance and !$node_status_time{$node}{$::STATE_DHCP}{end_time}) { + $node_status_time{$node}{$::STATE_DHCP}{end_time} = $log_ref->{time}; + $node_status_time{$node}{$::STATE_DHCP}{time_point} = $log_ref->{time_record}; + } } } } @@ -817,15 +1038,27 @@ 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) { set_node_state($node_state_ref, $ipnodemap{$ip}, $::STATE_BOOTLODER); + if ($performance) { + $node_status_time{$ipnodemap{$ip}}{$::STATE_BOOTLODER}{start_time} = $log_ref->{time} if (!$node_status_time{$ipnodemap{$ip}}{$::STATE_BOOTLODER}{start_time}); + $node_status_time{$ipnodemap{$ip}}{$::STATE_BOOTLODER}{time_point} = $log_ref->{time_record} if (!$node_status_time{$ipnodemap{$ip}}{$::STATE_BOOTLODER}{time_point}); + } } elsif ($file =~ /vmlinuz|inst64|linux/) { set_node_state($node_state_ref, $ipnodemap{$ip}, $::STATE_KERNEL); + if ($performance) { + $node_status_time{$ipnodemap{$ip}}{$::STATE_KERNEL}{start_time} = $log_ref->{time}; + $node_status_time{$ipnodemap{$ip}}{$::STATE_KERNEL}{time_point} = $log_ref->{time_record}; + } } elsif ($file =~ /initrd/i) { set_node_state($node_state_ref, $ipnodemap{$ip}, $::STATE_INITRD); + if ($performance) { + $node_status_time{$ipnodemap{$ip}}{$::STATE_INITRD}{start_time} = $log_ref->{time}; + $node_status_time{$ipnodemap{$ip}}{$::STATE_INITRD}{time_point} = $log_ref->{time_record}; + } } } } @@ -852,21 +1085,49 @@ 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); + if ($performance) { + $node_status_time{$ipnodemap{$ip}}{$::STATE_KERNEL}{start_time} = $log_ref->{time}; + $node_status_time{$ipnodemap{$ip}}{$::STATE_KERNEL}{time_point} = $log_ref->{time_record}; + } + 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); + if ($performance) { + $node_status_time{$ipnodemap{$ip}}{$::STATE_INITRD}{start_time} = $log_ref->{time}; + $node_status_time{$ipnodemap{$ip}}{$::STATE_INITRD}{time_point} = $log_ref->{time_record}; + } + 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); + if ($performance) { + $node_status_time{$ipnodemap{$ip}}{$::STATE_KICKSTART}{start_time} = $log_ref->{time}; + $node_status_time{$ipnodemap{$ip}}{$::STATE_KICKSTART}{time_point} = $log_ref->{time_record}; + } + 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); + if ($performance) { + $node_status_time{$ipnodemap{$ip}}{$::STATE_INSTALLRPM}{end_time} = $log_ref->{time}; + $node_status_time{$ipnodemap{$ip}}{$::STATE_INSTALLRPM}{start_time} = $log_ref->{time} unless ( $node_status_time{$ipnodemap{$ip}}{$::STATE_INSTALLRPM}{start_time} ); + $node_status_time{$ipnodemap{$ip}}{$::STATE_INSTALLRPM}{time_point} = $log_ref->{time_record} unless ( $node_status_time{$ipnodemap{$ip}}{$::STATE_INSTALLRPM}{time_point} ); + } + push (@{ $node_state_ref->{ $ipnodemap{$ip} }{errors}{$::STATE_INSTALLRPM} }, "$record failed with $http_code") if ($http_code >= 400); + } elsif ($file =~ /rootimg/) { + set_node_state($node_state_ref, $ipnodemap{$ip}, $::STATE_ROOTIMG); + if ($performance) { + $node_status_time{$ipnodemap{$ip}}{$::STATE_ROOTIMG}{start_time} = $log_ref->{time}; + $node_status_time{$ipnodemap{$ip}}{$::STATE_ROOTIMG}{time_point} = $log_ref->{time_record}; + } } } } @@ -897,13 +1158,17 @@ 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); + if ($performance) { + $node_status_time{$node}{$::STATE_POWER_ON}{start_time} = $log_ref->{time}; + $node_status_time{$node}{$::STATE_POWER_ON}{time_point} = $log_ref->{time_record}; + } } } } @@ -915,15 +1180,33 @@ 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") { set_node_state($node_state_ref, $node, $::STATE_INSTALLING); + if ($performance) { + $node_status_time{$node}{$::STATE_INSTALLING}{start_time} = $log_ref->{time}; + $node_status_time{$node}{$::STATE_INSTALLING}{time_point} = $log_ref->{time_record}; + } } elsif ($status eq "powering-on") { set_node_state($node_state_ref, $node, $::STATE_POWERINGON); + if ($performance) { + $node_status_time{$node}{$::STATE_POWERINGON}{start_time} = $log_ref->{time}; + $node_status_time{$node}{$::STATE_POWERINGON}{time_point} = $log_ref->{time_record}; + } } elsif ($status eq "booting") { set_node_state($node_state_ref, $node, $::STATE_BOOTING); + if ($performance) { + $node_status_time{$node}{$::STATE_BOOTING}{start_time} = $log_ref->{time}; + $node_status_time{$node}{$::STATE_BOOTING}{time_point} = $log_ref->{time_record}; + } + } elsif ($status eq "netbooting") { + set_node_state($node_state_ref, $node, $::STATE_NETBOOTING); + if ($performance) { + $node_status_time{$node}{$::STATE_NETBOOTING}{start_time} = $log_ref->{time}; + $node_status_time{$node}{$::STATE_NETBOOTING}{time_point} = $log_ref->{time_record}; + } } elsif ($status eq "failed") { $node_state_ref->{$node}{done} = 1; } @@ -951,16 +1234,50 @@ 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); + if ($performance) { + $node_status_time{$node}{$::STATE_POSTSCRIPT}{start_time} = $log_ref->{time} unless ($node_status_time{$node}{$::STATE_POSTSCRIPT}{start_time}); + $node_status_time{$node}{$::STATE_POSTSCRIPT}{time_point} = $log_ref->{time_record} unless ($node_status_time{$node}{$::STATE_POSTSCRIPT}{time_point}); + } + } 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; + } + } + $node_status_time{$node}{$::STATE_POSTSCRIPT}{end_time} = $log_ref->{time} if ($performance); } elsif ($log_ref->{msg} =~ /Running postbootscript:/i) { set_node_state($node_state_ref, $node, $::STATE_POSTBOOTSCRIPT); + if ($performance) { + $node_status_time{$node}{$::STATE_POSTBOOTSCRIPT}{start_time} = $log_ref->{time} unless ($node_status_time{$node}{$::STATE_POSTBOOTSCRIPT}{start_time}); + $node_status_time{$node}{$::STATE_POSTBOOTSCRIPT}{time_point} = $log_ref->{time_record} unless ($node_status_time{$node}{$::STATE_POSTBOOTSCRIPT}{time_point}); + } + } 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; + } + } + $node_status_time{$node}{$::STATE_POSTBOOTSCRIPT}{end_time} = $log_ref->{time} if ($performance); } 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); + if ($performance) { + $node_status_time{$node}{$::STATE_COMPLETED}{start_time} = $log_ref->{time}; + $node_status_time{$node}{$::STATE_COMPLETED}{time_point} = $log_ref->{time_record}; + } } } } @@ -1021,7 +1338,9 @@ 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; + $node_status_time{$node} = (); } else { my $index = @{ $node_state_ref->{$node}{statehistory} } - 1; diff --git a/xCAT-probe/subcmds/switch-macmap b/xCAT-probe/subcmds/switch_macmap similarity index 100% rename from xCAT-probe/subcmds/switch-macmap rename to xCAT-probe/subcmds/switch_macmap diff --git a/xCAT-probe/subcmds/xcatmn b/xCAT-probe/subcmds/xcatmn index 37d7ac33f..d192ae60d 100755 --- a/xCAT-probe/subcmds/xcatmn +++ b/xCAT-probe/subcmds/xcatmn @@ -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", @@ -278,7 +272,7 @@ sub check_all_xcat_deamons { "Discovery worker", "Command log writer"); - my $output = `ps aux|grep -v grep|grep xcatd`; + my $output = `ps aux 2>&1|grep -v grep|grep xcatd`; foreach my $deamon (@deamon_list) { if ($output !~ /$deamon/) { push @$error_ref, "Deamon '$deamon' isn't running"; @@ -290,17 +284,34 @@ 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 = (); + #send one command to test if xcatd can receive request + my $cmdoutput = `lsxcatd -a 2>&1`; + my $tmprst = $?; + chomp($cmdoutput); + if ($tmprst) { + my @lines = split("[\n\r]", $cmdoutput); + push @$error_ref, $_ foreach (@lines); + $rst = 1; + }elsif($cmdoutput =~ /Permission denied for request/){ + push @$error_ref, "Permission denied for request, please checking xcatd"; + $rst = 1; + } + return $rst if ($rst); + #check important port my @port_list = ("xcatdport", "xcatiport"); foreach my $port_attr (@port_list) { - my $port = `lsdef -t site -i $port_attr -c| awk -F'=' '{print \$2}'`; + my $port = `lsdef -t site -i $port_attr -c 2>&1| awk -F'=' '{print \$2}'`; chomp($port); if ($port) { - my $cmdoutput = `netstat -ant|grep LISTEN|grep $port`; + my $cmdoutput = `netstat -ant 2>&1|grep LISTEN|grep $port`; if ($?) { push @$error_ref, "Attribute '$port_attr' in site table is set to $port, but xcatd isn't listening on $port"; $rst = 1; @@ -310,29 +321,23 @@ sub check_xcatd_receive_request { $rst = 1; } } - return $rst if ($rst); - - #send one command to test if xcatd can receive request - my $cmdoutput = `lsxcatd -a 2>&1`; - if ($?) { - my @lines = split("[\n\r]", $cmdoutput); - push @$error_ref, $_ foreach (@lines); - $rst = 1; - } return $rst; } 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; - $value = `lsdef -t site -i $attr -c | awk -F'=' '{print \$2}'`; + $value = `lsdef -t site -i $attr -c 2>&1 | awk -F'=' '{print \$2}'`; chomp($value); if ($value eq "") { push @$error_ref, "There isn't '$attr' definition in 'site' table"; @@ -350,11 +355,14 @@ sub check_site_table { } sub check_passwd_table { + my $checkpoint_ref = shift; my $error_ref = shift; my $rst = 0; - @$error_ref = (); - my $passwd = `tabdump passwd |awk -F',' '/system/ { gsub(/"/, "", \$2); gsub(/"/, "", \$3); print \$2,\$3 }'`; + @$error_ref = (); + $$checkpoint_ref = "Checking 'passwd' table is configured..."; + + my $passwd = `tabdump passwd 2>&1|awk -F',' '/system/ { gsub(/"/, "", \$2); gsub(/"/, "", \$3); print \$2,\$3 }'`; chomp($passwd); my ($username, $pw) = split(" ", $passwd); if ($username eq "" || $pw eq "") { @@ -368,16 +376,18 @@ 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) { # on SN, get ip address by compare 'master' attribute in 'site' table # choose the one in the same network with 'master' - my @ipoutput = `ip addr show | grep inet | grep -v inet6 2>&1`; + my @ipoutput = `ip addr show 2>&1| grep inet | grep -v inet6`; foreach (@ipoutput) { if ($_ =~ /inet\s+(.+)\/(.+)\s+brd\s+(.+)\s+scope global/i) { if (xCAT::NetworkUtils::isInSameSubnet($sitetable_ref->{master}, $1, $2, 1)) { @@ -395,7 +405,7 @@ sub check_network { push @$error_ref, "There isn't NIC '$installnic' in current server"; $rst = 1; } else { - $$serverip_ref = `ip addr show $installnic | awk -F" " '/inet / {print \$2}'|awk -F"/" '{print \$1}'`; + $$serverip_ref = `ip addr show $installnic 2>&1| awk -F" " '/inet / {print \$2}'|awk -F"/" '{print \$1}'`; chomp($$serverip_ref); if (!defined($$serverip_ref) || ($$serverip_ref eq "")) { push @$error_ref, "There isn't IP address assigned to NIC $installnic"; @@ -409,7 +419,7 @@ sub check_network { } } - my $networks = `tabdump networks|grep -v "^#"`; + my $networks = `tabdump networks 2>&1|grep -v "^#"`; $networks =~ s/\"//g; my $netcnt = `echo "$networks"|wc -l`; my $hit = 0; @@ -433,9 +443,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,22 +460,26 @@ 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) { - my $mountoutput = `mount | grep '$sitetable_ref->{$dir}'`; + my $mountoutput = `mount 2>&1| grep '$sitetable_ref->{$dir}'`; chomp($mountoutput); my $mountip; @@ -477,7 +493,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 +506,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 2>&1| 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 +561,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 +577,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 +594,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 2>&1 | 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,30 +634,44 @@ 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`; + my $nodename = `hostname -s 2>&1`; chomp($nodename); # For sn, 'setuptftp' attribute could be set to '0' or '1'. # if '0', sn does not need to provie TFTP service, will not check it my $checktftp = 1; if ($is_sn) { - $checktftp = `lsdef $nodename -i setuptftp -c | awk -F'=' '{print \$2}' `; + $checktftp = `lsdef $nodename -i setuptftp -c 2>&1 | awk -F'=' '{print \$2}' `; chomp($checktftp); } if ($checktftp) { `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 2>&1| 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,21 +681,47 @@ 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`; + my $nodename = `hostname -s 2>&1`; chomp($nodename); # For sn, 'setupdns' attribute could be set to '0' or '1'. # if '0', sn does not need to provie DNS service, will not check it my $checkdns = 1; if ($is_sn) { - $checkdns = `lsdef $nodename -i setupnameserver -c | awk -F'=' '{print \$2}'`; + $checkdns = `lsdef $nodename -i setupnameserver -c 2>&1| awk -F'=' '{print \$2}'`; chomp($checkdns); } @@ -648,7 +745,7 @@ sub check_dns_service { my @snlist = xCAT::ServiceNodeUtils->getAllSN(); my $sntmp = shift(@snlist); if ($sntmp) { - my $sninfo = `cat /etc/hosts | grep $sntmp`; + my $sninfo = `cat /etc/hosts 2>&1| grep $sntmp`; if ($sninfo =~ /(\d+).(\d+).(\d+).(\d+)/) { my $snip = "$1.$2.$3.$4"; if (!probe_utils->is_dns_ready("$snip", "$serverip", "$sntmp", "$sitetable_ref->{domain}")) { @@ -681,23 +778,25 @@ 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 = (); # For sn, 'setupdhcp' attribute could be set to '0' or '1'. # if '0', sn does not need to provie DHCP service, will not check it if ($is_sn) { - my $nodename = `hostname -s`; + my $nodename = `hostname -s 2>&1`; chomp($nodename); - my $checkdhcp = `lsdef $nodename -i setupdhcp -c | awk -F'=' '{print \$2}'`; + my $checkdhcp = `lsdef $nodename -i setupdhcp -c 2>&1| awk -F'=' '{print \$2}'`; chomp($checkdhcp); if ($checkdhcp) { # on sn, just check dhcpd service whether running - my $dhcpoutput = `ps aux | grep dhcpd |grep -v grep`; + my $dhcpoutput = `ps aux 2>&1| grep dhcpd |grep -v grep`; if (!$dhcpoutput) { push @$error_ref, "There isn't 'dhcpd' deamon in current server"; $rst = 1; @@ -711,7 +810,7 @@ sub check_dhcp_service { my @snlist = xCAT::ServiceNodeUtils->getAllSN(); my $sntmp = shift(@snlist); if ($sntmp) { - my $tmp = `makedhcp -q $sntmp`; + my $tmp = `makedhcp -q $sntmp 2>&1`; if ($?) { push @$error_ref, "makedhcp -q $sntmp failed"; returncmdoutput($tmp, $error_ref) if ($verbose); @@ -720,7 +819,7 @@ sub check_dhcp_service { } chomp($tmp); my $snip = xCAT::NetworkUtils->getipaddr($sntmp); - my $snmac = `lsdef $sntmp -i mac -c | awk -F'=' '{print \$2}'`; + my $snmac = `lsdef $sntmp -i mac -c 2>&1| awk -F'=' '{print \$2}'`; chomp($snmac); my $tmpmac; if ($tmp =~ /$sntmp: ip-address = $snip, hardware-address = (.+)/) { @@ -737,7 +836,7 @@ sub check_dhcp_service { } } else { - my $tmp = `chdef xcatmntest groups=all ip=$serverip mac=aa:aa:aa:aa:aa:aa`; + my $tmp = `chdef xcatmntest groups=all ip=$serverip mac=aa:aa:aa:aa:aa:aa 2>&1`; if ($?) { push @$error_ref, "Node simulation by 'chdef' has failed"; returncmdoutput($tmp, $error_ref) if ($verbose); @@ -759,16 +858,16 @@ sub check_dhcp_service { push @$error_ref, "makedhcp xcatmntest failed"; returncmdoutput($tmp, $error_ref) if ($verbose); $rc = 1; - `rmdef xcatmntest`; + `rmdef xcatmntest 2>&1`; last; } - $tmp = `makedhcp -q xcatmntest`; + $tmp = `makedhcp -q xcatmntest 2>&1`; if ($?) { push @$error_ref, "makedhcp -q xcatmntest failed"; returncmdoutput($tmp, $error_ref) if ($verbose); $rc = 1; - `makedhcp -d xcatmntest && rmdef xcatmntest`; + `makedhcp -d xcatmntest 2>&1 && rmdef xcatmntest 2>&1`; last; } chomp($tmp); @@ -776,12 +875,12 @@ sub check_dhcp_service { push @$error_ref, "DHCP server reply is wrong"; returncmdoutput($tmp, $error_ref) if ($verbose); $rc = 1; - `makedhcp -d xcatmntest && rmdef xcatmntest`; + `makedhcp -d xcatmntest 2>&1 && rmdef xcatmntest 2>&1`; last; } push @$error_ref, "Start clearing simulation information for dhcp test" if ($verbose); - $tmp = `makedhcp -d xcatmntest && rmdef xcatmntest`; + $tmp = `makedhcp -d xcatmntest 2>&1 && rmdef xcatmntest 2>&1`; returncmdoutput($tmp, $error_ref) if ($verbose); unlink "/etc/hosts"; @@ -798,9 +897,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 +1024,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 +1032,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: diff --git a/xCAT-probe/xCAT-probe.spec b/xCAT-probe/xCAT-probe.spec index 26e5d5404..8a1fda11b 100644 --- a/xCAT-probe/xCAT-probe.spec +++ b/xCAT-probe/xCAT-probe.spec @@ -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. diff --git a/xCAT-probe/xcatprobe b/xCAT-probe/xcatprobe index dae96b42a..ef7d0bef1 100755 --- a/xCAT-probe/xcatprobe +++ b/xCAT-probe/xcatprobe @@ -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"; diff --git a/xCAT-rmc/debian/compat b/xCAT-rmc/debian/compat index 7ed6ff82d..ec635144f 100644 --- a/xCAT-rmc/debian/compat +++ b/xCAT-rmc/debian/compat @@ -1 +1 @@ -5 +9 diff --git a/xCAT-rmc/debian/control b/xCAT-rmc/debian/control index 33f8bc9cd..e8e97d82d 100644 --- a/xCAT-rmc/debian/control +++ b/xCAT-rmc/debian/control @@ -2,11 +2,11 @@ Source: xcat-rmc Section: admin Priority: extra Maintainer: Arif Ali -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 diff --git a/xCAT-rmc/debian/rules b/xCAT-rmc/debian/rules index 5099b8b4b..d880b083b 100755 --- a/xCAT-rmc/debian/rules +++ b/xCAT-rmc/debian/rules @@ -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" diff --git a/xCAT-rmc/xCAT-rmc.spec b/xCAT-rmc/xCAT-rmc.spec index 56f57d6fd..235d0d2da 100644 --- a/xCAT-rmc/xCAT-rmc.spec +++ b/xCAT-rmc/xCAT-rmc.spec @@ -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 - - - - - - diff --git a/xCAT-server/debian/compat b/xCAT-server/debian/compat index 7ed6ff82d..ec635144f 100644 --- a/xCAT-server/debian/compat +++ b/xCAT-server/debian/compat @@ -1 +1 @@ -5 +9 diff --git a/xCAT-server/debian/control b/xCAT-server/debian/control index 83eb791fb..ae2306ed9 100644 --- a/xCAT-server/debian/control +++ b/xCAT-server/debian/control @@ -2,11 +2,15 @@ Source: xcat-server Section: admin Priority: extra Maintainer: xCAT -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. diff --git a/xCAT-server/debian/install b/xCAT-server/debian/install index 7941d95c2..ec21c731e 100644 --- a/xCAT-server/debian/install +++ b/xCAT-server/debian/install @@ -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/ diff --git a/xCAT-server/debian/rules b/xCAT-server/debian/rules index 027559171..72d780fc1 100755 --- a/xCAT-server/debian/rules +++ b/xCAT-server/debian/rules @@ -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" diff --git a/xCAT-server/lib/perl/xCAT/PPC.pm b/xCAT-server/lib/perl/xCAT/PPC.pm index 15c26cc94..cfb58162c 100644 --- a/xCAT-server/lib/perl/xCAT/PPC.pm +++ b/xCAT-server/lib/perl/xCAT/PPC.pm @@ -233,6 +233,12 @@ sub process_command { if (($command eq 'rpower') || ($command eq 'rnetboot')) { my $subcommand = "temp"; if ($command eq 'rpower') { $subcommand = $request->{op}; } + + #pdu commands will be handled in the pdu plugin + if(($subcommand eq 'pduoff') || ($subcommand eq 'pduon') || ($subcommand eq 'pdustat')){ + return 0; + } + if (($global_check) && ($subcommand ne 'stat') && ($subcommand ne 'status') && ($subcommand ne 'state')) { $check = 1; my $noderange = $request->{node}; diff --git a/xCAT-server/lib/xcat/plugins/AAsn.pm b/xCAT-server/lib/xcat/plugins/AAsn.pm index 40191f9e4..2bf735b03 100755 --- a/xCAT-server/lib/xcat/plugins/AAsn.pm +++ b/xCAT-server/lib/xcat/plugins/AAsn.pm @@ -125,7 +125,8 @@ sub init_plugin if (xCAT::Utils->isServiceNode()) { # service node &setup_TFTP($nodename, $doreq); # setup TFTP } else { # management node - &enable_TFTPhpa(); + &stop_TFTP(); + &enable_TFTP(); } } @@ -1204,10 +1205,13 @@ sub setup_TFTP } } + $rc = stop_TFTP(); + if($rc !=0) { + xCAT::MsgUtils->message("S", "Failed to stop tftp service."); + } # enable the tftp-hpa - $rc = enable_TFTPhpa(); - + $rc = enable_TFTP(); if ($rc == 0) { @@ -1262,29 +1266,95 @@ sub setup_HTTP #----------------------------------------------------------------------------- # -#=head3 enable_TFTPhpa +#=head3 stop_TFTP # -# Configure and enable the tftp-hpa in the xinetd. +# Stop tftp process for multiple platforms +# +# return: +# 1 on faled +# 0 on success # #=cut # #----------------------------------------------------------------------------- -sub enable_TFTPhpa +sub stop_TFTP { + my $distro; # Check whether the tftp-hpa has been installed, the ubuntu tftpd-hpa configure file is under /etc/default unless (-x "/usr/sbin/in.tftpd" and (-e "/etc/xinetd.d/tftp" or -e "/etc/default/tftpd-hpa")) { xCAT::MsgUtils->message("S", "ERROR: The tftpd was not installed, enable the tftp failed."); return 1; } - # kill the process of atftp if it's there my @output = xCAT::Utils->runcmd("ps -ef | grep atftpd | grep -v grep", -1); foreach my $ps (@output) { $ps =~ s/^\s+//; # strip any leading spaces my ($uid, $pid, $ppid, $desc) = split /\s+/, $ps; - system("kill -9 $pid >/dev/null 2>&1"); + my $cmd = "kill -9 $pid >/dev/null 2>&1"; + system($cmd); + if ($? != 0) { + xCAT::MsgUtils->message("S", "ERROR: Can not execute command $cmd."); + return 1; + } } + if (-x "/usr/sbin/in.tftpd") { + system("killall in.tftpd >/dev/null 2>&1"); #xinetd can leave behind blocking tftp servers even if it won't start new ones + if ($distro =~ /ubuntu.*/i || $distro =~ /debian.*/i) { + sleep 1; + my @checkproc = `ps axf|grep -v grep|grep in.tftpd`; + if (@checkproc) { + if (xCAT::Utils->stopservice("tftpd-hpa") != 0) { + xCAT::MsgUtils->message("S", "ERROR: Can not stop tftpd-hpa service."); + return 1; + } + } + } + my @tftpprocpids = `ps axf | grep -v 'awk /in.tftpd/' | awk '/in.tftpd/ {print \$1}'`; + if (@tftpprocpids) { + my %pids_map; + my $count = 0; + map { chomp; $pids_map{$_} = 1 } @tftpprocpids; + while (keys %pids_map) { + foreach my $pid (keys %pids_map) { + if (xCAT::Utils::is_process_exists($pid)) { + $count++; + if ($count == 5) { + my $tftpinfo = `ps axf|grep -v grep|grep in.tftpd`; + xCAT::MsgUtils->message("S", "ERROR: Can not stop tftp process $pid [$tftpinfo] in 5 seconds, stop it again."); + my $cmd = "killall -s KILL in.tftpd >/dev/null 2>&1"; + system($cmd); + if($? != 0) { + xCAT::MsgUtils->message("S", "ERROR: Can not execute command $cmd."); + return 1; + } + } + if ($count > 10) { + xCAT::MsgUtils->message("S", "ERROR: Can not stop tftp process in 10 seconds."); + return 1; + } + sleep 1; + } else { + delete $pids_map{$pid} + } + } + } + } + } + return 0; +} + +#----------------------------------------------------------------------------- +# +#=head3 enable_TFTP +# +# Configure and enable the tftp service. +# +#=cut +# +#----------------------------------------------------------------------------- +sub enable_TFTP +{ # read tftpdir directory from database my $tftpdir = xCAT::TableUtils->getTftpDir(); if (!(-e $tftpdir)) { @@ -1381,7 +1451,6 @@ sub enable_TFTPhpa "Error on restart xinetd\n"); } - #if (grep(/running/, @output)) #{ # print ' '; # indent service output to separate it from the xcatd service output @@ -1429,43 +1498,12 @@ sub enable_TFTPhpa $startcmd = "/usr/sbin/in.tftpd $v4only $tftpflags"; } - - if (-x "/usr/sbin/in.tftpd") { - system("killall in.tftpd"); #xinetd can leave behind blocking tftp servers even if it won't start new ones - if ($distro =~ /ubuntu.*/i || $distro =~ /debian.*/i) { - sleep 1; - my @checkproc = `ps axf|grep -v grep|grep in.tftpd`; - if (@checkproc) { - xCAT::Utils->stopservice("tftpd-hpa"); - } - } - - my @tftpprocpids = `ps axf | grep -v 'awk /in.tftpd/' | awk '/in.tftpd/ {print \$1}'`; - if (@tftpprocpids) { - my %pids_map; - my $count = 0; - map { chomp; $pids_map{$_} = 1 } @tftpprocpids; - while (keys %pids_map) { - foreach my $pid (keys %pids_map) { - if (xCAT::Utils::is_process_exists($pid)) { - $count++; - if ($count == 5) { - my $tftpinfo = `ps axf|grep -v grep|grep in.tftpd`; - xCAT::MsgUtils->message("S", "ERROR: Can not stop tftp process $pid [$tftpinfo] in 5 seconds, stop it again."); - system("killall -s KILL in.tftpd"); - } - if ($count > 10) { - xCAT::MsgUtils->message("S", "ERROR: Can not stop tftp process in 10 seconds."); - return 1; - } - sleep 1; - } else { - delete $pids_map{$pid} - } - } - } - } + if ( -x "/usr/sbin/in.tftpd") { system("$startcmd"); + if($? != 0) { + xCAT::MsgUtils->message("S", "ERROR: Can not execute command $startcmd."); + return 1; + } } return 0; } diff --git a/xCAT-server/lib/xcat/plugins/DBobjectdefs.pm b/xCAT-server/lib/xcat/plugins/DBobjectdefs.pm index 90ddb541f..d91d51c3e 100755 --- a/xCAT-server/lib/xcat/plugins/DBobjectdefs.pm +++ b/xCAT-server/lib/xcat/plugins/DBobjectdefs.pm @@ -2973,7 +2973,6 @@ sub setFINALattrs } } } - # $tmphash{nicips} = "eth0!1.1.1.1|1.2.1.1,eth1!2.1.1.1|2.2.1.1" foreach my $nicattr (keys %tmphash) { @@ -3189,7 +3188,6 @@ sub defls } } - # if just provided type list then find all objects of these types if (!defined $::opt_template && $::objectsfrom_optt) { @@ -3845,11 +3843,11 @@ sub defls my $nicsstr; if ($nicnames) { - $nicsstr = xCAT::DBobjUtils->expandnicsattr($nicval, $nicnames); + $nicsstr = xCAT::DBobjUtils->expandnicsattr($nicval, $obj, $nicnames); } else { - $nicsstr = xCAT::DBobjUtils->expandnicsattr($nicval); + $nicsstr = xCAT::DBobjUtils->expandnicsattr($nicval, $obj); } # Compress mode, format the output @@ -3902,7 +3900,7 @@ sub defls if ($showattr =~ /^nic/) { my $nicval = "$showattr=$attrval"; - my $nicsstr = xCAT::DBobjUtils->expandnicsattr($nicval); + my $nicsstr = xCAT::DBobjUtils->expandnicsattr($nicval, $obj); if ($nicsstr) { push(@{ $rsp_info->{data} }, "$nicsstr"); diff --git a/xCAT-server/lib/xcat/plugins/anaconda.pm b/xCAT-server/lib/xcat/plugins/anaconda.pm index 6decce701..0fc2da096 100644 --- a/xCAT-server/lib/xcat/plugins/anaconda.pm +++ b/xCAT-server/lib/xcat/plugins/anaconda.pm @@ -172,6 +172,7 @@ sub mknetboot if ($req->{command}->[0] =~ 'mkstatelite') { $statelite = "true"; } + my $bootparams = ${$req->{bootparams}}; my $globaltftpdir = "/tftpboot"; my $nodes = @{ $req->{node} }; my @args = @{ $req->{arg} } if (exists($req->{arg})); @@ -232,7 +233,6 @@ sub mknetboot my %donetftp = (); my %oents = %{ $ostab->getNodesAttribs(\@nodes, [qw(os arch profile provmethod)]) }; my $restab = xCAT::Table->new('noderes'); - my $bptab = xCAT::Table->new('bootparams', -create => 1); my $hmtab = xCAT::Table->new('nodehm'); my $mactab = xCAT::Table->new('mac'); @@ -249,8 +249,6 @@ sub mknetboot $stateHash = $statetab->getNodesAttribs(\@nodes, ['statemnt']); } - #my $addkcmdhash = - # $bptab->getNodesAttribs(\@nodes, ['addkcmdline']); # Warning message for nodeset install/netboot/statelite foreach my $knode (keys %oents) @@ -950,15 +948,9 @@ sub mknetboot $kcmdline .= " MNTOPTS=$mntoptions"; } } - - $bptab->setNodeAttribs( - $node, - { - kernel => $kernstr, - initrd => $initrdstr, - kcmdline => $kcmdline - } - ); + $bootparams->{$node}->[0]->{kernel} = $kernstr; + $bootparams->{$node}->[0]->{initrd} = $initrdstr; + $bootparams->{$node}->[0]->{kcmdline} = $kcmdline; } } @@ -971,6 +963,7 @@ sub mkinstall my @nodes = @{ $request->{node} }; my $noupdateinitrd = $request->{'noupdateinitrd'}; my $ignorekernelchk = $request->{'ignorekernelchk'}; + my $bootparams = ${$request->{bootparams}}; #my $sitetab = xCAT::Table->new('site'); my $linuximagetab; @@ -1023,7 +1016,6 @@ sub mkinstall my $ostab = xCAT::Table->new('nodetype'); my %donetftp; my $restab = xCAT::Table->new('noderes'); - my $bptab = xCAT::Table->new('bootparams', -create => 1); my $hmtab = xCAT::Table->new('nodehm'); my $mactab = xCAT::Table->new('mac'); my %osents = %{ $ostab->getNodesAttribs(\@nodes, [ 'profile', 'os', 'arch', 'provmethod' ]) }; @@ -1033,8 +1025,6 @@ sub mkinstall [ 'serialport', 'serialspeed', 'serialflow' ]) }; my %macents = %{ $mactab->getNodesAttribs(\@nodes, ['mac']) }; - #my $addkcmdhash = - # $bptab->getNodesAttribs(\@nodes, ['addkcmdline']); require xCAT::Template; # Warning message for nodeset install/netboot/statelite @@ -1668,14 +1658,9 @@ sub mkinstall xCAT::MsgUtils->trace($verbose_on_off, "d", "anaconda->mkinstall: kcmdline=$kcmdline kernal=$k initrd=$i"); - $bptab->setNodeAttribs( - $node, - { - kernel => $k, - initrd => $i, - kcmdline => $kcmdline - } - ); + $bootparams->{$node}->[0]->{kernel} = $k; + $bootparams->{$node}->[0]->{initrd} = $i; + $bootparams->{$node}->[0]->{kcmdline} = $kcmdline; } else { @@ -1701,6 +1686,7 @@ sub mksysclone my $callback = shift; my $doreq = shift; my @nodes = @{ $request->{node} }; + my $bootparams = ${$request->{bootparams}}; my $linuximagetab; my $osimagetab; my %img_hash = (); @@ -1727,7 +1713,6 @@ sub mksysclone my $ostab = xCAT::Table->new('nodetype'); my %donetftp; my $restab = xCAT::Table->new('noderes'); - my $bptab = xCAT::Table->new('bootparams', -create => 1); my $hmtab = xCAT::Table->new('nodehm'); my $mactab = xCAT::Table->new('mac'); @@ -2064,15 +2049,9 @@ sub mksysclone $k = "xcat/$kernpath"; $i = "xcat/$initrdpath"; - - $bptab->setNodeAttribs( - $node, - { - kernel => $k, - initrd => $i, - kcmdline => $kcmdline - } - ); + $bootparams->{$node}->[0]->{kernel} = $k; + $bootparams->{$node}->[0]->{initrd} = $i; + $bootparams->{$node}->[0]->{kcmdline} = $kcmdline; } else { @@ -2266,6 +2245,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"; diff --git a/xCAT-server/lib/xcat/plugins/blade.pm b/xCAT-server/lib/xcat/plugins/blade.pm index 7ff063a48..5eaac006c 100644 --- a/xCAT-server/lib/xcat/plugins/blade.pm +++ b/xCAT-server/lib/xcat/plugins/blade.pm @@ -4400,6 +4400,11 @@ sub process_request { if ($request->{moreinfo}) { $moreinfo = $request->{moreinfo}; } else { $moreinfo = build_more_info($noderange, $callback); } + #pdu commands will be handled in the pdu plugin + if ($command eq "rpower" and grep(/^pduon|pduoff|pdustat$/, @exargs)) { + return; + } + if ($command eq "rpower" and grep(/^on|off|boot|reset|cycle$/, @exargs)) { if (my ($index) = grep($exargs[$_] =~ /^--nodeps$/, 0 .. $#exargs)) { diff --git a/xCAT-server/lib/xcat/plugins/bmcdiscover.pm b/xCAT-server/lib/xcat/plugins/bmcdiscover.pm index 54d7ce8b7..18e3a09e2 100644 --- a/xCAT-server/lib/xcat/plugins/bmcdiscover.pm +++ b/xCAT-server/lib/xcat/plugins/bmcdiscover.pm @@ -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; } } } diff --git a/xCAT-server/lib/xcat/plugins/confluent.pm b/xCAT-server/lib/xcat/plugins/confluent.pm index 85b344f95..09fcaeb48 100644 --- a/xCAT-server/lib/xcat/plugins/confluent.pm +++ b/xCAT-server/lib/xcat/plugins/confluent.pm @@ -342,7 +342,7 @@ sub makeconfluentcfg { die "confluent does not currently support termserver"; $termservers{ $_->{termserver} } = 1; # dont add this one again } - if ($type{ $_->{node} } =~ /fsp|bpa|hmc|ivm/) { + if ($type{$_->{node}} and $type{ $_->{node} } =~ /fsp|bpa|hmc|ivm/) { $keepdoing = 0; # these types dont have consoles } } @@ -450,14 +450,16 @@ sub donodeent { } my %parameters; if ($cmeth) { $parameters{'console.method'} = $cmeth; } - if ($cmeth eq 'ipmi' or not $cmeth) { + if (not $cmeth or $cmeth eq 'ipmi') { $parameters{'secret.hardwaremanagementuser'} = $ipmiauthdata->{$node}->{username}; $parameters{'secret.hardwaremanagementpassword'} = $ipmiauthdata->{$node}->{password}; my $bmc = $ipmientries->{$node}->[0]->{bmc}; - $bmc =~ s/,.*//; - $parameters{'hardwaremanagement.manager'} = $bmc; + if ($bmc) { + $bmc =~ s/,.*//; + $parameters{'hardwaremanagement.manager'} = $bmc; + } } if (defined($cfgent->{consoleondemand})) { if ($cfgent->{consoleondemand}) { diff --git a/xCAT-server/lib/xcat/plugins/conserver.pm b/xCAT-server/lib/xcat/plugins/conserver.pm index 8fdc5dfec..24336d186 100644 --- a/xCAT-server/lib/xcat/plugins/conserver.pm +++ b/xCAT-server/lib/xcat/plugins/conserver.pm @@ -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}]}); diff --git a/xCAT-server/lib/xcat/plugins/ddns.pm b/xCAT-server/lib/xcat/plugins/ddns.pm index 6f8ef970e..9291488b1 100755 --- a/xCAT-server/lib/xcat/plugins/ddns.pm +++ b/xCAT-server/lib/xcat/plugins/ddns.pm @@ -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); diff --git a/xCAT-server/lib/xcat/plugins/debian.pm b/xCAT-server/lib/xcat/plugins/debian.pm index 89c405cbf..8260874ea 100644 --- a/xCAT-server/lib/xcat/plugins/debian.pm +++ b/xCAT-server/lib/xcat/plugins/debian.pm @@ -445,6 +445,7 @@ sub mkinstall { my $callback = shift; my $doreq = shift; my @nodes = @{ $request->{node} }; + my $bootparams = ${$request->{bootparams}}; my $sitetab = xCAT::Table->new('site'); my $linuximagetab; my $osimagetab; @@ -490,7 +491,6 @@ sub mkinstall { my $ostab = xCAT::Table->new('nodetype'); my %donetftp; my $restab = xCAT::Table->new('noderes'); - my $bptab = xCAT::Table->new('bootparams', -create => 1); my $hmtab = xCAT::Table->new('nodehm'); my $mactab = xCAT::Table->new('mac'); my %osents = %{ $ostab->getNodesAttribs(\@nodes, [ 'profile', 'os', 'arch', 'provmethod' ]) }; @@ -502,8 +502,6 @@ sub mkinstall { [ 'serialport', 'serialspeed', 'serialflow' ]) }; my %macents = %{ $mactab->getNodesAttribs(\@nodes, ['mac']) }; - #my $addkcmdhash = - # $bptab->getNodesAttribs(\@nodes, ['addkcmdline']); require xCAT::Template; # Warning message for nodeset install/netboot/statelite @@ -923,10 +921,9 @@ sub mkinstall { } xCAT::MsgUtils->trace($verbose_on_off, "d", "debian->mkinstall: kcmdline=$kcmdline kernal=$rtftppath/vmlinuz initrd=$rtftppath/initrd.img"); - - $bptab->setNodeAttribs($node, { kernel => "$rtftppath/vmlinuz", - initrd => "$rtftppath/initrd.img", - kcmdline => $kcmdline }); + $bootparams->{$node}->[0]->{kernel} = "$rtftppath/vmlinuz"; + $bootparams->{$node}->[0]->{initrd} = "$rtftppath/initrd.img"; + $bootparams->{$node}->[0]->{kcmdline} = $kcmdline; } else { $callback->({ error => ["Install image not found in $installroot/$os/$arch"], @@ -945,6 +942,7 @@ sub mknetboot if ($req->{command}->[0] =~ 'mkstatelite') { $statelite = "true"; } + my $bootparams = ${$req->{bootparams}}; my $tftpdir = "/tftpboot"; my $nodes = @{ $req->{node} }; my @args = @{ $req->{arg} }; @@ -991,7 +989,6 @@ sub mknetboot my %donetftp = (); my %oents = %{ $ostab->getNodesAttribs(\@nodes, [qw(os arch profile provmethod)]) }; my $restab = xCAT::Table->new('noderes'); - my $bptab = xCAT::Table->new('bootparams', -create => 1); my $hmtab = xCAT::Table->new('nodehm'); my $mactab = xCAT::Table->new('mac'); @@ -1008,9 +1005,6 @@ sub mknetboot $stateHash = $statetab->getNodesAttribs(\@nodes, ['statemnt']); } - #my $addkcmdhash = - # $bptab->getNodesAttribs(\@nodes, ['addkcmdline']); - # Warning message for nodeset install/netboot/statelite foreach my $knode (keys %oents) { my $ent = $oents{$knode}->[0]; @@ -1589,15 +1583,9 @@ sub mknetboot $kcmdline .= " MNTOPTS=$mntoptions"; } } - - $bptab->setNodeAttribs( - $node, - { - kernel => "$kernstr", - initrd => "$initrdstr", - kcmdline => $kcmdline - } - ); + $bootparams->{$node}->[0]->{kernel} = $kernstr; + $bootparams->{$node}->[0]->{initrd} = $initrdstr; + $bootparams->{$node}->[0]->{kcmdline} = $kcmdline; } #my $rc = xCAT::TableUtils->create_postscripts_tar(); diff --git a/xCAT-server/lib/xcat/plugins/destiny.pm b/xCAT-server/lib/xcat/plugins/destiny.pm index d2eb6b26d..54a7804c7 100755 --- a/xCAT-server/lib/xcat/plugins/destiny.pm +++ b/xCAT-server/lib/xcat/plugins/destiny.pm @@ -26,7 +26,6 @@ my $errored = 0; #DESTINY SCOPED GLOBALS my $chaintab; my $iscsitab; -my $bptab; my $typetab; my $restab; @@ -94,6 +93,7 @@ sub setdestiny { my $noupdate = shift; $chaintab = xCAT::Table->new('chain', -create => 1); my @nodes = @{ $req->{node} }; + my $bphash = $req->{bootparams}; @ARGV = @{ $req->{arg} }; my $noupdateinitrd; @@ -157,7 +157,6 @@ sub setdestiny { unless ($iscsitab) { $callback->({ error => "Unable to open iscsi table to get iscsiboot parameters", errorcode => [1] }); } - my $bptab = xCAT::Table->new('bootparams', -create => 1); my $nodetype = xCAT::Table->new('nodetype'); my $ntents = $nodetype->getNodesAttribs($req->{node}, [qw(os arch profile)]); my $ients = $iscsitab->getNodesAttribs($req->{node}, [qw(kernel kcmdline initrd)]); @@ -168,11 +167,9 @@ sub setdestiny { unless ($ntent and $ntent->{arch} =~ /x86/ and -f ("$tftpdir/undionly.kpxe" or -f "$tftpdir/xcat/xnba.kpxe")) { $callback->({ error => "$_: No iscsi boot data available", errorcode => [1] }); } #If x86 node and undionly.kpxe exists, presume they know what they are doing next; } - my $hash; - $hash->{kernel} = $ient->{kernel}; - if ($ient->{initrd}) { $hash->{initrd} = $ient->{initrd} } - if ($ient->{kcmdline}) { $hash->{kcmdline} = $ient->{kcmdline} } - $bptab->setNodeAttribs($_, $hash); + $bphash->{kernel} = $ient->{kernel}; + if ($ient->{initrd}) { $bphash->{initrd} = $ient->{initrd} } + if ($ient->{kcmdline}) { $bphash->{kcmdline} = $ient->{kcmdline} } } } elsif ($state =~ /^install[=\$]/ or $state eq 'install' or $state =~ /^netboot[=\$]/ or $state eq 'netboot' or $state eq "image" or $state eq "winshell" or $state =~ /^osimage/ or $state =~ /^statelite/) { my %state_hash; @@ -389,16 +386,19 @@ sub setdestiny { $subreq->({ command => ["mk$tempstate"], node => $samestatenodes, noupdateinitrd => $noupdateinitrd, - ignorekernelchk => $ignorekernelchk, }, \&relay_response); + ignorekernelchk => $ignorekernelchk, + bootparams => \$bphash}, \&relay_response); 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; } my $ntents = $nodetypetable->getNodesAttribs($samestatenodes, [qw(os arch profile)]); + my $updates; foreach (@{$samestatenodes}) { $nstates{$_} = $tempstate; #local copy of state variable for mod my $ntent = $ntents->{$_}->[0]; #$nodetype->getNodeAttribs($_,[qw(os arch profile)]); @@ -418,9 +418,10 @@ sub setdestiny { } else { $errored = 1; $callback->({ errorcode => [1], error => "nodetype.profile not defined for $_" }); } } if ($errored) { return; } - - #statelite - unless ($tempstate =~ /^netboot|^statelite/) { $chaintab->setNodeAttribs($_, { currchain => "boot" }); } + $updates->{$_}->{'currchain'} = "boot"; + } + unless ($tempstate =~ /^netboot|^statelite/) { + $chaintab->setNodesAttribs($updates); } if ($action eq "reboot4deploy") { @@ -436,7 +437,6 @@ sub setdestiny { } } elsif ($state eq "shell" or $state eq "standby" or $state =~ /^runcmd/ or $state =~ /^runimage/) { $restab = xCAT::Table->new('noderes', -create => 1); - my $bootparms = xCAT::Table->new('bootparams', -create => 1); my $nodetype = xCAT::Table->new('nodetype'); #my $sitetab = xCAT::Table->new('site'); @@ -508,18 +508,18 @@ sub setdestiny { } } if (-r "$tftpdir/xcat/genesis.fs.$arch.$bestsuffix") { - $bootparms->setNodeAttribs($_, { kernel => "xcat/genesis.kernel.$arch", - initrd => "xcat/genesis.fs.$arch.$bestsuffix", - kcmdline => $kcmdline . "xcatd=$master:$xcatdport destiny=$state" }); + $bphash->{$_}->[0]->{kernel} = "xcat/genesis.kernel.$arch"; + $bphash->{$_}->[0]->{initrd} = "xcat/genesis.fs.$arch.$bestsuffix"; + $bphash->{$_}->[0]->{kcmdline} = $kcmdline . "xcatd=$master:$xcatdport destiny=$state"; } else { - $bootparms->setNodeAttribs($_, { kernel => "xcat/genesis.kernel.$arch", - initrd => "xcat/genesis.fs.$arch.$othersuffix", - kcmdline => $kcmdline . "xcatd=$master:$xcatdport destiny=$state" }); + $bphash->{$_}->[0]->{kernel} = "xcat/genesis.kernel.$arch"; + $bphash->{$_}->[0]->{initrd} = "xcat/genesis.fs.$arch.$othersuffix"; + $bphash->{$_}->[0]->{kcmdline} = $kcmdline . "xcatd=$master:$xcatdport destiny=$state"; } } else { #'legacy' environment - $bootparms->setNodeAttribs($_, { kernel => "xcat/nbk.$arch", - initrd => "xcat/nbfs.$arch.gz", - kcmdline => $kcmdline . "xcatd=$master:$xcatdport" }); + $bphash->{$_}->[0]->{kernel} = "xcat/nbk.$arch"; + $bphash->{$_}->[0]->{initrd} = "xcat/nkfs.$arch.gz"; + $bphash->{$_}->[0]->{kcmdline} = $kcmdline . "xcatd=$master:$xcatdport"; } } @@ -602,18 +602,20 @@ sub setdestiny { } if ($noupdate) { return; } #skip table manipulation if just doing 'enact' + my $updates; foreach (@nodes) { my $lstate = $state; if ($nstates{$_}) { $lstate = $nstates{$_}; } - $chaintab->setNodeAttribs($_, { currstate => $lstate }); + $updates->{$_}->{'currstate'} = $lstate; # if there are multiple actions in the state argument, set the rest of states (shift out the first one) # to chain.currchain so that the rest ones could be used by nextdestiny command if ($reststates) { - $chaintab->setNodeAttribs($_, { currchain => $reststates }); + $updates->{$_}->{'currchain'} = $reststates; } + $chaintab->setNodesAttribs($updates); } return getdestiny($flag + 1); } @@ -746,7 +748,7 @@ sub getdestiny { my $chaintab = xCAT::Table->new('chain'); my $chainents = $chaintab->getNodesAttribs(\@nodes, [qw(currstate chain)]); my $nrents = $restab->getNodesAttribs(\@nodes, [qw(tftpserver xcatmaster)]); - $bptab = xCAT::Table->new('bootparams', -create => 1); + my $bptab = xCAT::Table->new('bootparams', -create => 1); my $bpents = $bptab->getNodesAttribs(\@nodes, [qw(kernel initrd kcmdline xcatmaster)]); #my $sitetab= xCAT::Table->new('site'); diff --git a/xCAT-server/lib/xcat/plugins/dhcp.pm b/xCAT-server/lib/xcat/plugins/dhcp.pm index 831609b83..e2ff8556a 100644 --- a/xCAT-server/lib/xcat/plugins/dhcp.pm +++ b/xCAT-server/lib/xcat/plugins/dhcp.pm @@ -1964,7 +1964,7 @@ sub process_request } else { $chainents = undef; } - $nrhash = $nrtab->getNodesAttribs($req->{node}, [ 'tftpserver', 'netboot', 'proxydhcp' ]); + $nrhash = $nrtab->getNodesAttribs($req->{node}, [ 'tftpserver', 'netboot', 'proxydhcp', 'xcatmaster', 'servicenode']); my $nodetypetab; $nodetypetab = xCAT::Table->new('nodetype', -create => 0); if ($nodetypetab) { @@ -2607,16 +2607,16 @@ sub addnet } if ($ddnserver) { - push @netent, " primary $ddnserver; key xcat_key; \n"; + push @netent, " primary $ddnserver; key xcat_key; \n"; } - push @netent, " }\n"; + push @netent, " }\n"; foreach (getzonesfornet($net, $mask)) { - push @netent, "zone $_ {\n"; + push @netent, " zone $_ {\n"; if ($ddnserver) { - push @netent, " primary $ddnserver; key xcat_key; \n"; + push @netent, " primary $ddnserver; key xcat_key; \n"; } - push @netent, " }\n"; + push @netent, " }\n"; } } @@ -2629,32 +2629,32 @@ sub addnet # $lstatements = 'if exists gpxe.bus-id { filename = \"\"; } else if exists client-architecture { filename = \"xcat/xnba.kpxe\"; } '.$lstatements; push @netent, " if option user-class-identifier = \"xNBA\" and option client-architecture = 00:00 { #x86, xCAT Network Boot Agent\n"; - push @netent, " always-broadcast on;\n"; - push @netent, " filename = \"http://$tftp/tftpboot/xcat/xnba/nets/" . $net . "_" . $maskbits . "\";\n"; + push @netent, " always-broadcast on;\n"; + push @netent, " filename = \"http://$tftp/tftpboot/xcat/xnba/nets/" . $net . "_" . $maskbits . "\";\n"; push @netent, " } else if option user-class-identifier = \"xNBA\" and option client-architecture = 00:09 { #x86, xCAT Network Boot Agent\n"; - push @netent, " filename = \"http://$tftp/tftpboot/xcat/xnba/nets/" . $net . "_" . $maskbits . ".uefi\";\n"; + push @netent, " filename = \"http://$tftp/tftpboot/xcat/xnba/nets/" . $net . "_" . $maskbits . ".uefi\";\n"; push @netent, " } else if option client-architecture = 00:00 { #x86\n"; - push @netent, " filename \"xcat/xnba.kpxe\";\n"; + push @netent, " filename \"xcat/xnba.kpxe\";\n"; push @netent, " } else if option vendor-class-identifier = \"Etherboot-5.4\" { #x86\n"; - push @netent, " filename \"xcat/xnba.kpxe\";\n"; + push @netent, " filename \"xcat/xnba.kpxe\";\n"; push @netent, " } else if option client-architecture = 00:07 { #x86_64 uefi\n "; - push @netent, " filename \"xcat/xnba.efi\";\n"; + push @netent, " filename \"xcat/xnba.efi\";\n"; push @netent, " } else if option client-architecture = 00:09 { #x86_64 uefi alternative id\n "; - push @netent, " filename \"xcat/xnba.efi\";\n"; + push @netent, " filename \"xcat/xnba.efi\";\n"; push @netent, " } else if option client-architecture = 00:02 { #ia64\n "; - push @netent, " filename \"elilo.efi\";\n"; + push @netent, " filename \"elilo.efi\";\n"; push @netent, " } else if option client-architecture = 00:0e { #OPAL-v3\n "; - push @netent, " option conf-file = \"http://$tftp/tftpboot/pxelinux.cfg/p/" . $net . "_" . $maskbits . "\";\n"; + push @netent, " option conf-file = \"http://$tftp/tftpboot/pxelinux.cfg/p/" . $net . "_" . $maskbits . "\";\n"; push @netent, " } else if substring (option vendor-class-identifier,0,11) = \"onie_vendor\" { #for onie on cumulus switch\n"; - push @netent, " option www-server = \"http://$tftp/install/onie/onie-installer\";\n"; + push @netent, " option www-server = \"http://$tftp/install/onie/onie-installer\";\n"; push @netent, " } else if substring(filename,0,1) = null { #otherwise, provide yaboot if the client isn't specific\n "; - push @netent, " filename \"/yaboot\";\n"; + push @netent, " filename \"/yaboot\";\n"; push @netent, " }\n"; if ($range) { diff --git a/xCAT-server/lib/xcat/plugins/esx.pm b/xCAT-server/lib/xcat/plugins/esx.pm index a91632fb1..ece31bb02 100644 --- a/xCAT-server/lib/xcat/plugins/esx.pm +++ b/xCAT-server/lib/xcat/plugins/esx.pm @@ -406,6 +406,10 @@ sub process_request { @exargs = ($request->{arg}); } + #pdu commands will be handled in the pdu plugin + if ($command eq "rpower" and grep(/^pduon|pduoff|pdustat$/, @exargs)) { + return; + } #my $sitetab = xCAT::Table->new('site'); #if($sitetab){ #(my $ref) = $sitetab->getAttribs({key => 'usehostnamesforvcenter'}, 'value'); diff --git a/xCAT-server/lib/xcat/plugins/grub2.pm b/xCAT-server/lib/xcat/plugins/grub2.pm index 34ddd9d8a..25446d0e1 100644 --- a/xCAT-server/lib/xcat/plugins/grub2.pm +++ b/xCAT-server/lib/xcat/plugins/grub2.pm @@ -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 $tftpdir/boot/grub2/ -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); } @@ -571,17 +570,18 @@ sub process_request { if (exists($request->{inittime})) { $inittime = $request->{inittime}->[0]; } if (!$inittime) { $inittime = 0; } $errored = 0; + my %bphash; unless ($args[0] eq 'stat') { # or $args[0] eq 'enact') { xCAT::MsgUtils->trace($verbose_on_off, "d", "grub2: issue setdestiny request"); $sub_req->({ command => ['setdestiny'], node => \@nodes, inittime => [$inittime], - arg => \@args }, \&pass_along); + arg => \@args, + bootparams => \%bphash + }, \&pass_along); } if ($errored) { return; } - my $bptab = xCAT::Table->new('bootparams', -create => 1); - my $bphash = $bptab->getNodesAttribs(\@nodes, [ 'kernel', 'initrd', 'kcmdline', 'addkcmdline' ]); my $chaintab = xCAT::Table->new('chain', -create => 1); my $chainhash = $chaintab->getNodesAttribs(\@nodes, ['currstate']); my $noderestab = xCAT::Table->new('noderes', -create => 1); @@ -618,7 +618,7 @@ sub process_request { $linuximghash = $linuximgtab->getAttribs({ imagename => $osimgname }, 'boottarget', 'addkcmdline'); } - ($rc, $errstr) = setstate($_, $bphash, $chainhash, $machash, $tftpdir, $nrhash, $linuximghash); + ($rc, $errstr) = setstate($_, \%bphash, $chainhash, $machash, $tftpdir, $nrhash, $linuximghash); if ($rc) { $response{node}->[0]->{errorcode}->[0] = $rc; $response{node}->[0]->{errorc}->[0] = $errstr; diff --git a/xCAT-server/lib/xcat/plugins/hosts.pm b/xCAT-server/lib/xcat/plugins/hosts.pm index 15b96132f..6cfb16694 100755 --- a/xCAT-server/lib/xcat/plugins/hosts.pm +++ b/xCAT-server/lib/xcat/plugins/hosts.pm @@ -87,13 +87,10 @@ sub addnode # we're processing the nics table and we found an # existing entry for this ip so just add this - # ode name as an alias for the existing entry + # node name as an alias for the existing entry chomp($hosts[$idx]); my ($hip, $hnode, $hdom, $hother) = split(/ /, $hosts[$idx]); - # at this point "othernames", if any is just a space - # elimited list - so just add the node name to the list - $othernames .= " $node"; $hosts[$idx] = build_line($callback, $ip, $hnode, $domain, $othernames); } else { diff --git a/xCAT-server/lib/xcat/plugins/hpblade.pm b/xCAT-server/lib/xcat/plugins/hpblade.pm index edab62629..090bb6738 100755 --- a/xCAT-server/lib/xcat/plugins/hpblade.pm +++ b/xCAT-server/lib/xcat/plugins/hpblade.pm @@ -646,6 +646,11 @@ sub process_request { if ($request->{moreinfo}) { $moreinfo = $request->{moreinfo}; } else { $moreinfo = build_more_info($noderange, $callback); } + #pdu commands will be handled in the pdu plugin + if ($command eq "rpower" and grep(/^pduon|pduoff|pdustat$/, @exargs)) { + return; + } + if ($command eq "rpower" and grep(/^on|off|boot|reset|cycle$/, @exargs)) { if (my ($index) = grep($exargs[$_] =~ /^--nodeps$/, 0 .. $#exargs)) { diff --git a/xCAT-server/lib/xcat/plugins/hpilo.pm b/xCAT-server/lib/xcat/plugins/hpilo.pm index 5bfeb352e..72855e11a 100755 --- a/xCAT-server/lib/xcat/plugins/hpilo.pm +++ b/xCAT-server/lib/xcat/plugins/hpilo.pm @@ -360,6 +360,12 @@ sub process_request { if (ref($extrargs)) { @exargs = @$extrargs; } + + #pdu commands will be handled in the pdu plugin + if (($extrargs->[0] eq 'pdustat') || ($extrargs->[0] eq 'pduon') || ($extrargs->[0] eq 'pduoff')) { + return; + } + my $ipmitab = xCAT::Table->new('ipmi'); my $ilouser = "USERID"; diff --git a/xCAT-server/lib/xcat/plugins/ipmi.pm b/xCAT-server/lib/xcat/plugins/ipmi.pm index 1138bac9b..ae76557c1 100644 --- a/xCAT-server/lib/xcat/plugins/ipmi.pm +++ b/xCAT-server/lib/xcat/plugins/ipmi.pm @@ -2566,6 +2566,9 @@ sub inv { $sessdata->{skipfru} = 1; #full fru read is expensive, skip it @types = qw(guid); } + elsif ($subcommand eq "hw" or $subcommand eq "dimm" or $subcommand eq "misc") { + @types = ($subcommand); + } else { my $usage_string = xCAT::Usage->getUsage($command); $callback->({ error => ["$usage_string"], errorcode => [1] }); @@ -7678,6 +7681,11 @@ sub preprocess_request { return 0; } + #pdu commands will be handled in the pdu plugin + if(($subcmd eq 'pduoff') || ($subcmd eq 'pduon') || ($subcmd eq 'pdustat')){ + return 0; + } + if (($subcmd ne 'reseat') && ($subcmd ne 'stat') && ($subcmd ne 'state') && ($subcmd ne 'status') && ($subcmd ne 'on') && ($subcmd ne 'off') && ($subcmd ne 'softoff') && ($subcmd ne 'nmi') && ($subcmd ne 'cycle') && ($subcmd ne 'reset') && ($subcmd ne 'boot') && ($subcmd ne 'wake') && ($subcmd ne 'suspend')) { #$callback->({data=>["Unsupported command: $command $subcmd", $usage_string]}); diff --git a/xCAT-server/lib/xcat/plugins/kvm.pm b/xCAT-server/lib/xcat/plugins/kvm.pm index ec87a53eb..7e83f850f 100755 --- a/xCAT-server/lib/xcat/plugins/kvm.pm +++ b/xCAT-server/lib/xcat/plugins/kvm.pm @@ -588,11 +588,11 @@ sub build_diskstruct { } my $cdprefix = 'hd'; - # device name vd* doesn't work for CDROM, so delete it. - #if ($storagemodel eq 'virtio') { - # $cdprefix='vd'; - #} els - if ($storagemodel eq 'scsi') { + # Normally for vmstoragemodel=virtio, we would set prefix of "vd", but device name vd* + # doesn't work for CDROM, so for now use the same prefix "sd" as for vmstoragemodel=scsi. + if ($storagemodel eq 'virtio') { + $cdprefix='sd'; + } elsif ($storagemodel eq 'scsi') { $cdprefix = 'sd'; } $suffidx += 1; @@ -3660,6 +3660,13 @@ sub process_request { } else { @exargs = ($request->{arg}); } + + #pdu commands will be handled in the pdu plugin + if ($command eq "rpower" and grep(/^pduon|pduoff|pdustat$/, @exargs)) { + return; + } + + my $forcemode = 0; my %orphans = (); if ($command eq 'vmstatenotify') { @@ -4045,7 +4052,8 @@ sub dohyp { my %newnodestatus; foreach $node (sort (keys %{ $hyphash{$hyp}->{nodes} })) { - if ($confdata->{$hyp}->{cpumodel} and $confdata->{$hyp}->{cpumodel} =~ /ppc64/i) { + unless ($confdata->{vm}->{$node}->[0]->{storagemodel}) { + # Storage model is not set, default to scsi for all architectures $confdata->{vm}->{$node}->[0]->{storagemodel} = "scsi"; } if ($confdata->{$hyp}->{cpu_thread}) { diff --git a/xCAT-server/lib/xcat/plugins/makentp.pm b/xCAT-server/lib/xcat/plugins/makentp.pm index 9f404ae1c..4e6f19a40 100755 --- a/xCAT-server/lib/xcat/plugins/makentp.pm +++ b/xCAT-server/lib/xcat/plugins/makentp.pm @@ -309,11 +309,17 @@ sub process_request { } } + my $os = xCAT::Utils->osver("all"); + + #for sles, /var/lib/ntp/drift is a dir if (xCAT::Utils->isAIX()) { print CFGFILE "driftfile /etc/ntp.drift\n"; print CFGFILE "tracefile /etc/ntp.trace\n"; print CFGFILE "disable auth\n"; print CFGFILE "broadcastclient\n"; + } elsif ($os =~ /sles/) { + print CFGFILE "driftfile /var/lib/ntp/drift/ntp.drift\n"; + print CFGFILE "disable auth\n"; } else { print CFGFILE "driftfile /var/lib/ntp/drift\n"; print CFGFILE "disable auth\n"; @@ -325,7 +331,6 @@ sub process_request { close CFGFILE; - my $os = xCAT::Utils->osver("all"); my $ntp_service = "ntpserver"; #stop ntpd @@ -361,6 +366,7 @@ sub process_request { } if ($::RUNCMD_RC != 0) { send_msg(\%request, 1, "Error from command $cmd\n $result."); + send_msg(\%request, 1, "Please check $ntp_master, make sure time is synced (can be validated by 'ntpq -p'), then rerun makentp command again "); return 1; } } @@ -384,17 +390,23 @@ sub process_request { #setup the RTC is UTC format, which will be used by os if ($os =~ /sles/) { - `sed -i 's/.*HWCLOCK.*/HWCLOCK="-u"/' /etc/sysconfig/clock`; + $grep_cmd = "grep -i HWCLOCK /etc/sysconfig/clock"; + $rc = xCAT::Utils->runcmd($grep_cmd, 0); + if ($::RUNCMD_RC == 0) { + `sed -i 's/.*HWCLOCK.*/HWCLOCK=\"-u\"/' /etc/sysconfig/clock`; + } else { + `echo HWCLOCK=\"-u\" >> /etc/sysconfig/clock`; + } } elsif (-f "/etc/debian_version") { - `sed -i "s/.*UTC.*/UTC=yes/" /etc/default/rcS`; + `sed -i 's/.*UTC.*/UTC=\"yes\"/' /etc/default/rcS`; } else { if (-f "/etc/sysconfig/clock") { $grep_cmd = "grep -i utc /etc/sysconfig/clock"; $rc = xCAT::Utils->runcmd($grep_cmd, 0); - if ($::RUNCMD_RC != 0) { - `sed -i 's/.*UTC.*/UTC=yes/' /etc/sysconfig/clock`; + if ($::RUNCMD_RC == 0) { + `sed -i 's/.*UTC.*/UTC=\"yes\"/' /etc/sysconfig/clock`; } else { - `echo "UTC=yes" >> /etc/sysconfig/clock`; + `echo UTC=\"yes\" >> /etc/sysconfig/clock`; } } else { `type -P timedatectl >/dev/null 2>&1`; @@ -406,11 +418,15 @@ sub process_request { if (-f "/etc/sysconfig/ntpd") { $grep_cmd = "grep -i SYNC_HWCLOCK /etc/sysconfig/ntpd"; $rc = xCAT::Utils->runcmd($grep_cmd, 0); - if ($::RUNCMD_RC != 0) { - `sed -i "s/.*SYNC_HWCLOCK.*/SYNC_HWCLOCK=yes/" /etc/sysconfig/ntpd`; + if ($::RUNCMD_RC == 0) { + `sed -i 's/.*SYNC_HWCLOCK.*/SYNC_HWCLOCK=\"yes\"/' /etc/sysconfig/ntpd`; } else { - `echo "SYNC_HWCLOCK=yes" >> /etc/sysconfig/ntpd`; + `echo SYNC_HWCLOCK=\"yes\" >> /etc/sysconfig/ntpd`; } + } elsif (-f "/etc/sysconfig/ntp") { + `sed -i 's/.*SYNC_HWCLOCK.*/NTPD_FORCE_SYNC_HWCLOCK_ON_STARTUP=\"yes\"/' /etc/sysconfig/ntp`; + `sed -i 's/^NTPD_FORCE_SYNC_ON.*/NTPD_FORCE_SYNC_ON_STARTUP=\"yes\"/' /etc/sysconfig/ntp`; + `sed -i 's/.*RUN_CHROOTED.*/NTPD_RUN_CHROOTED=\"yes\"/' /etc/sysconfig/ntp`; } else { my $cron_file = "/etc/cron.daily/xcatsethwclock"; if (!-f "$cron_file") { diff --git a/xCAT-server/lib/xcat/plugins/pdu.pm b/xCAT-server/lib/xcat/plugins/pdu.pm new file mode 100644 index 000000000..7e107d529 --- /dev/null +++ b/xCAT-server/lib/xcat/plugins/pdu.pm @@ -0,0 +1,383 @@ +# IBM(c) 2007 EPL license http://www.eclipse.org/legal/epl-v10.html +#------------------------------------------------------- + +=head1 + xCAT plugin package to handle pdu + + Supported command: + rpower + rinv + +=cut + +#------------------------------------------------------- +package xCAT_plugin::pdu; + +BEGIN { + $::XCATROOT = $ENV{'XCATROOT'} ? $ENV{'XCATROOT'} : -d '/opt/xcat' ? '/opt/xcat' : '/usr'; +} +use lib "$::XCATROOT/lib/perl"; + +use xCAT::Table; +use xCAT::Utils; +use xCAT::FifoPipe; +use xCAT::MsgUtils; +use xCAT::State; +use xCAT::SvrUtils; +use xCAT::Usage; +use xCAT::NodeRange; +use Data::Dumper; +use Getopt::Long; +use File::Path; +use Term::ANSIColor; +use Time::Local; +use strict; +use Class::Struct; +use XML::Simple; +use Storable qw(dclone); +use SNMP; + +my $VERBOSE = 0; +my %allerrornodes = (); +my $callback; + + +#------------------------------------------------------- + +=head3 handled_commands + +Return list of commands handled by this plugin + +=cut + +#------------------------------------------------------- + +sub handled_commands +{ + return { + rpower => ["nodehm:mgt","pduoutlet:pdu=\.\*"], + rinv => ["nodehm:mgt"], + nodeset => ["nodehm:mgt"], + }; +} + +#-------------------------------------------------------------------------------- +=head3 preprocess_request + +Parse the arguments and display the usage or the version string. + +=cut +#-------------------------------------------------------------------------------- +sub preprocess_request { + my $req = shift; + if ($req->{_xcatpreprocessed}->[0] == 1) { return [$req]; } + my $callback=shift; + my @requests; + + my $command = $req->{command}->[0]; + my $noderange = $req->{node}; #Should be arrayref + my $extrargs = $req->{arg}; + my @exargs=($req->{arg}); + if (ref($extrargs)) { + @exargs=@$extrargs; + } + my $usage_string=xCAT::Usage->parseCommand($command, @exargs); + if ($usage_string) { + $callback->({data=>[$usage_string]}); + $req = {}; + return; + } + + if (!$noderange) { + $usage_string = xCAT::Usage->getUsage($command); + $callback->({ data => $usage_string }); + $req = {}; + return; + } + + my @result = (); + my $mncopy = {%$req}; + push @result, $mncopy; + return \@result; + +} + + +#------------------------------------------------------- + +=head3 process_request + + Process the command. + +=cut + +#------------------------------------------------------- +sub process_request +{ + my $request = shift; + my $callback = shift; + my $subreq = shift; + my $command = $request->{command}->[0]; + my $noderange = $request->{node}; #Should be arrayref + my $extrargs = $request->{arg}; + my @exargs = ($request->{arg}); + + if (ref($extrargs)) { + @exargs = @$extrargs; + } + + if( $command eq "rinv") { + #for higher performance, handle node in batch + return powerstat($noderange, $callback); + }elsif ($command eq "rpower") { + my $subcmd = $exargs[0]; + if(($subcmd eq 'on') || ($subcmd eq 'off') || ($subcmd eq 'stat')){ + #------------------------------------------- + #there are 2 cases will enter this black + #one is if node's mgt is pdu + #another is if node has pdu attribute but mgt isn't pdu + #if the node has pdu attribute but mgt isn't pdu, + #should do nothing for this node, let other plugin to hanle this node + #------------------------------------------- + my @allpdunodes=(); + my $nodehm = xCAT::Table->new('nodehm'); + my $nodehmhash = $nodehm->getNodesAttribs($noderange, ['mgt']); + foreach my $node (@$noderange) { + if($nodehmhash->{$node}->[0]->{mgt} eq 'pdu'){ + push @allpdunodes, $node; + } + } + return powerpdu(\@allpdunodes, $subcmd, $callback); + }elsif(($subcmd eq 'pduoff') || ($subcmd eq 'pduon') || ($subcmd eq 'pdustat')){ + #if one day, pdu node have pdu attribute, handle in this section too + return powerpduoutlet($noderange, $subcmd, $callback); + }else{ + $callback->({ errorcode => [1],error => "The input command $subcmd is not support for pdu"}); + } + }elsif($command eq "nodeset") { + $callback->({ errorcode => [1],error => "The input $command is not support for pdu"}); + + }else{ + #reserve for other new command in future + } + + return; +} + +#------------------------------------------------------- + +=head3 powerpdu + + Process power command (stat/off/on) for pdu/pdus + +=cut + +#------------------------------------------------------- +sub powerpdu { + my $noderange = shift; + my $subcmd = shift; + my $callback = shift; + my $outletnum = ".1.3.6.1.4.1.2.6.223.8.2.1.0"; + + if ($subcmd eq "stat") { + return powerstat($noderange, $callback); + } + + foreach my $node (@$noderange) { + my $session = connectTopdu($node,$callback); + my $count = $session->get("$outletnum"); + my $value; + my $statstr; + if ($subcmd eq "off") { + $value = 0; + $statstr = "off"; + } else { + $value = 1; + $statstr = "on"; + } + + for (my $outlet =1; $outlet <= $count; $outlet++) + { + outletpower($session, $outlet, $value); + if ($session->{ErrorStr}) { + $callback->({ error => "$session->{ErrorStr}"}); + } else { + my $output = " outlet $outlet is $statstr"; + xCAT::SvrUtils::sendmsg($output, $callback, $node, %allerrornodes); + } + } + } +} + +#------------------------------------------------------- + +=head3 powerpduoutlet + + Process power command (pdustat/pduoff/pduon) for compute nodes, + the pdu attribute needs to be set + +=cut + +#------------------------------------------------------- +sub powerpduoutlet { + my $noderange = shift; + my $subcmd = shift; + my $callback = shift; + my $output; + my $value; + my $statstr; + + my $oid = ".1.3.6.1.4.1.2.6.223.8.2.2.1.11"; + my $type = "INTEGER"; + my $tmpnodestr = join(",", @$noderange); + + my $nodetab = xCAT::Table->new('pduoutlet'); + my $nodepdu = $nodetab->getNodesAttribs($noderange,['pdu']); + foreach my $node (@$noderange) { + # the pdu attribute needs to be set + if(! $nodepdu->{$node}->[0]->{pdu}){ + $callback->({ error => "$node: without pdu attribute"}); + next; + } + + my @pdus = split /,/, $nodepdu->{$node}->[0]->{pdu}; + foreach my $pdu_outlet (@pdus) { + my ($pdu, $outlet) = split /:/, $pdu_outlet; + my $session = connectTopdu($pdu,$callback); + my $cmd; + if ($subcmd eq "pdustat") { + $statstr=outletstat($session, $outlet); + } elsif ($subcmd eq "pduoff") { + $value = 0; + $statstr = "off"; + outletpower($session, $outlet, $value); + } elsif ($subcmd eq "pduon") { + $value = 1; + $statstr = "on"; + outletpower($session, $outlet, $value); + } else { + $callback->({ error => "$subcmd is not support"}); + } + + if ($session->{ErrorStr}) { + $callback->({ error => "$session->{ErrorStr}"}); + } else { + $output = "$pdu outlet $outlet is $statstr"; + xCAT::SvrUtils::sendmsg($output, $callback, $node, %allerrornodes); + } + } + } +} + +#------------------------------------------------------- + +=head3 outletpower + + Process power command for one pdu outlet, + +=cut + +#------------------------------------------------------- +sub outletpower { + my $session = shift; + my $outlet = shift; + my $value = shift; + + my $oid = ".1.3.6.1.4.1.2.6.223.8.2.2.1.11"; + my $type = "INTEGER"; + + my $varbind = new SNMP::Varbind([ $oid, $outlet, $value, $type ]); + return $session->set($varbind); +} + +#------------------------------------------------------- + +=head3 powerstat + + Process command to query status of pdu + +=cut + +#------------------------------------------------------- +sub powerstat { + my $noderange = shift; + my $callback = shift; + my $output; + + my $outletnum = ".1.3.6.1.4.1.2.6.223.8.2.1.0"; + foreach my $pdu (@$noderange) { + my $session = connectTopdu($pdu,$callback); + my $count = $session->get("$outletnum"); + for (my $outlet =1; $outlet <= $count; $outlet++) + { + my $statstr = outletstat($session, $outlet); + my $msg = " outlet $outlet is $statstr"; + xCAT::SvrUtils::sendmsg($msg, $callback, $pdu, %allerrornodes); + } + } +} + +#------------------------------------------------------- + +=head3 outletstat + + Process command to query status of one pdu outlet + +=cut + +#------------------------------------------------------- +sub outletstat { + my $session = shift; + my $outlet = shift; + + my $oid = ".1.3.6.1.4.1.2.6.223.8.2.2.1.11"; + my $output; + my $statstr; + + $output = $session->get("$oid.$outlet"); + if ($output eq 1) { + $statstr = "on"; + } else { + $statstr = "off"; + } + return $statstr; +} + +#------------------------------------------------------- + +=head3 connectTopdu + + connect pdu via snmp session + +=cut + +#------------------------------------------------------- +sub connectTopdu { + my $pdu = shift; + my $callback = shift; + + my $snmpver = "1"; + my $community = "public"; + my $session; + my $msg = "connectTopdu"; + + $session = new SNMP::Session( + DestHost => $pdu, + Version => $snmpver, + Community => $community, + UseSprintValue => 1, + ); + unless ($session) { + $msg = "Failed to connect to $pdu"; + xCAT::SvrUtils::sendmsg($msg, $callback, $pdu, %allerrornodes); + return; + } + return $session; + +} + + + + + +1; diff --git a/xCAT-server/lib/xcat/plugins/petitboot.pm b/xCAT-server/lib/xcat/plugins/petitboot.pm index 3d3d7fa6d..cea7eeaea 100644 --- a/xCAT-server/lib/xcat/plugins/petitboot.pm +++ b/xCAT-server/lib/xcat/plugins/petitboot.pm @@ -460,12 +460,15 @@ sub process_request { if (exists($request->{inittime})) { $inittime = $request->{inittime}->[0]; } if (!$inittime) { $inittime = 0; } $errored = 0; + my %bphash; unless ($args[0] eq 'stat') { # or $args[0] eq 'enact') { xCAT::MsgUtils->trace($verbose_on_off, "d", "petitboot: issue setdestiny request"); $sub_req->({ command => ['setdestiny'], node => \@nodes, inittime => [$inittime], - arg => \@args }, \&pass_along); + arg => \@args, + bootparams => \%bphash}, + \&pass_along); } if ($errored) { return; } @@ -476,8 +479,6 @@ sub process_request { arg => ['default'] }); xCAT::MsgUtils->message("S", "xCAT: petitboot netboot: clear node(s): @nodes boot device setting."); } - my $bptab = xCAT::Table->new('bootparams', -create => 1); - my $bphash = $bptab->getNodesAttribs(\@nodes, [ 'kernel', 'initrd', 'kcmdline', 'addkcmdline' ]); my $chaintab = xCAT::Table->new('chain', -create => 1); my $chainhash = $chaintab->getNodesAttribs(\@nodes, ['currstate']); my $noderestab = xCAT::Table->new('noderes', -create => 1); @@ -510,7 +511,7 @@ sub process_request { my $linuximghash = $linuximghash = $linuximgtab->getAttribs({ imagename => $osimgname }, 'boottarget', 'addkcmdline'); - ($rc, $errstr) = setstate($_, $bphash, $chainhash, $machash, $tftpdir, $nodereshash, $linuximghash); + ($rc, $errstr) = setstate($_, \%bphash, $chainhash, $machash, $tftpdir, $nodereshash, $linuximghash); if ($rc) { $response{node}->[0]->{errorcode}->[0] = $rc; $response{node}->[0]->{errorc}->[0] = $errstr; diff --git a/xCAT-server/lib/xcat/plugins/pxe.pm b/xCAT-server/lib/xcat/plugins/pxe.pm index 4b0d937dc..f35afae12 100644 --- a/xCAT-server/lib/xcat/plugins/pxe.pm +++ b/xCAT-server/lib/xcat/plugins/pxe.pm @@ -497,6 +497,7 @@ sub process_request { $errored = 0; + my %bphash; my $inittime = 0; if (exists($::PXE_request->{inittime})) { $inittime = $::PXE_request->{inittime}->[0]; } if (!$inittime) { $inittime = 0; } @@ -505,19 +506,19 @@ sub process_request { $sub_req->({ command => ['setdestiny'], node => \@nodes, inittime => [$inittime], - arg => \@args }, \&pass_along); + arg => \@args, + bootparams => \%bphash + }, \&pass_along); } if ($errored) { return; } #Time to actually configure the nodes, first extract database data with the scalable calls - my $bptab = xCAT::Table->new('bootparams', -create => 1); my $chaintab = xCAT::Table->new('chain'); my $mactab = xCAT::Table->new('mac'); #to get all the hostnames my $typetab = xCAT::Table->new('nodetype'); my $restab = xCAT::Table->new('noderes'); my $linuximgtab = xCAT::Table->new('linuximage', -create => 1); my %nrhash = %{ $restab->getNodesAttribs(\@nodes, [qw(tftpdir)]) }; - my %bphash = %{ $bptab->getNodesAttribs(\@nodes, [qw(kernel initrd kcmdline addkcmdline)]) }; my %chainhash = %{ $chaintab->getNodesAttribs(\@nodes, [qw(currstate)]) }; my %machash = %{ $mactab->getNodesAttribs(\@nodes, [qw(mac)]) }; my %nthash = %{ $typetab->getNodesAttribs(\@nodes, [qw(os provmethod)]) }; diff --git a/xCAT-server/lib/xcat/plugins/rhevm.pm b/xCAT-server/lib/xcat/plugins/rhevm.pm index 9e988e523..5a45e7870 100644 --- a/xCAT-server/lib/xcat/plugins/rhevm.pm +++ b/xCAT-server/lib/xcat/plugins/rhevm.pm @@ -103,6 +103,7 @@ sub preprocess_request { my $command = $request->{command}->[0]; my $extraargs = $request->{arg}; + if ($extraargs) { @ARGV = @{$extraargs}; my $help; @@ -125,6 +126,11 @@ sub preprocess_request { } } + #pdu commands will be handled in the pdu plugin + if (($extraargs->[0] eq 'pdustat') || ($extraargs->[0] eq 'pduon') || ($extraargs->[0] eq 'pduoff')) { + return; + } + # Read the user password for the rhevm # Only support the general password in passwd table my $passtab = xCAT::Table->new('passwd'); diff --git a/xCAT-server/lib/xcat/plugins/rinstall.pm b/xCAT-server/lib/xcat/plugins/rinstall.pm index 1e1915aad..666935592 100644 --- a/xCAT-server/lib/xcat/plugins/rinstall.pm +++ b/xCAT-server/lib/xcat/plugins/rinstall.pm @@ -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; diff --git a/xCAT-server/lib/xcat/plugins/sles.pm b/xCAT-server/lib/xcat/plugins/sles.pm index d564f74eb..12d560770 100644 --- a/xCAT-server/lib/xcat/plugins/sles.pm +++ b/xCAT-server/lib/xcat/plugins/sles.pm @@ -54,6 +54,7 @@ sub mknetboot if ($req->{command}->[0] =~ 'mkstatelite') { $statelite = "true"; } + my $bootparams = ${$req->{bootparams}}; my $globaltftpdir = "/tftpboot"; my $nodes = @{ $req->{node} }; @@ -445,7 +446,6 @@ sub mknetboot } # TODO: move the table operations out of the foreach loop - my $bptab = xCAT::Table->new('bootparams', -create => 1); my $hmtab = xCAT::Table->new('nodehm'); my $sent = $hmtab->getNodeAttribs($node, @@ -720,13 +720,9 @@ sub mknetboot $kcmdline .= "MNTOPTS=\'$mntoptions\'"; } } - $bptab->setNodeAttribs( - $node, - { - kernel => "$rtftppath/kernel", - initrd => $initrdstr, - kcmdline => $kcmdline - }); + $bootparams->{$node}->[0]->{kernel} = "$rtftppath/kernel"; + $bootparams->{$node}->[0]->{initrd} = $initrdstr; + $bootparams->{$node}->[0]->{kcmdline} = $kcmdline; } } @@ -770,6 +766,7 @@ sub mkinstall my $noupdateinitrd = $request->{'noupdateinitrd'}; my $ignorekernelchk = $request->{'ignorekernelchk'}; + my $bootparams = ${$request->{bootparams}}; my @nodes = @{ $request->{node} }; my $node; my $ostab = xCAT::Table->new('nodetype'); @@ -799,7 +796,6 @@ sub mkinstall my $installroot; $installroot = "/install"; my $restab = xCAT::Table->new('noderes'); - my $bptab = xCAT::Table->new('bootparams', -create => 1); my $hmtab = xCAT::Table->new('nodehm'); my $resents = $restab->getNodesAttribs( @@ -1365,14 +1361,9 @@ sub mkinstall $kernelpath = "$rtftppath/linux"; $initrdpath = "$rtftppath/initrd"; xCAT::MsgUtils->trace($verbose_on_off, "d", "sles->mkinstall: kcmdline=$kcmdline kernal=$kernelpath initrd=$initrdpath"); - $bptab->setNodeAttribs( - $node, - { - kernel => $kernelpath, - initrd => $initrdpath, - kcmdline => $kcmdline - } - ); + $bootparams->{$node}->[0]->{kernel} = $kernelpath; + $bootparams->{$node}->[0]->{initrd} = $initrdpath; + $bootparams->{$node}->[0]->{kcmdline} = $kcmdline; } elsif ($arch eq "ppc64") { @@ -1384,14 +1375,9 @@ sub mkinstall $kernelpath = "$rtftppath/linux64"; $initrdpath = "$rtftppath/initrd64"; xCAT::MsgUtils->trace($verbose_on_off, "d", "sles->mkinstall: kcmdline=$kcmdline kernal=$kernelpath initrd=$initrdpath"); - $bptab->setNodeAttribs( - $node, - { - kernel => $kernelpath, - initrd => $initrdpath, - kcmdline => $kcmdline - } - ); + $bootparams->{$node}->[0]->{kernel} = $kernelpath; + $bootparams->{$node}->[0]->{initrd} = $initrdpath; + $bootparams->{$node}->[0]->{kcmdline} = $kcmdline; } elsif (-r "$tftppath/inst64") { @@ -1399,14 +1385,9 @@ sub mkinstall #suseboot/inst64 can not be run on Power8 BE $kernelpath = "$rtftppath/inst64"; xCAT::MsgUtils->trace($verbose_on_off, "d", "sles->mkinstall: kcmdline=$kcmdline kernal=$kernelpath initrd="); - $bptab->setNodeAttribs( - $node, - { - kernel => $kernelpath, - initrd => "", - kcmdline => $kcmdline - } - ); + $bootparams->{$node}->[0]->{kernel} = $kernelpath; + $bootparams->{$node}->[0]->{initrd} = ""; + $bootparams->{$node}->[0]->{kcmdline} = $kcmdline; } } } @@ -1436,6 +1417,7 @@ sub mksysclone my $callback = shift; my $doreq = shift; my @nodes = @{ $request->{node} }; + my $bootparams = ${$request->{bootparams}}; my $osimagetab; my %img_hash = (); @@ -1460,7 +1442,6 @@ sub mksysclone my $node; my $ostab = xCAT::Table->new('nodetype'); my $restab = xCAT::Table->new('noderes'); - my $bptab = xCAT::Table->new('bootparams', -create => 1); my $hmtab = xCAT::Table->new('nodehm'); my %osents = %{ $ostab->getNodesAttribs(\@nodes, [ 'os', 'arch', 'provmethod' ]) }; my %rents = @@ -1645,14 +1626,9 @@ sub mksysclone if (-r "$tftpdir/xcat/genesis.fs.$arch.lzma") { $i = "xcat/genesis.fs.$arch.lzma"; } - $bptab->setNodeAttribs( - $node, - { - kernel => "xcat/genesis.kernel.$arch", - initrd => $i, - kcmdline => $kcmdline - } - ); + $bootparams->{$node}->[0]->{kernel} = "xcat/genesis.kernel.$arch"; + $bootparams->{$node}->[0]->{initrd} = $i; + $bootparams->{$node}->[0]->{kcmdline} = $kcmdline; } else { diff --git a/xCAT-server/lib/xcat/plugins/switchdiscover.pm b/xCAT-server/lib/xcat/plugins/switchdiscover.pm index 1b90ea155..4966a24ff 100644 --- a/xCAT-server/lib/xcat/plugins/switchdiscover.pm +++ b/xCAT-server/lib/xcat/plugins/switchdiscover.pm @@ -37,7 +37,7 @@ my %global_mac_identity = ( "6c:ae:8b" => "BNT G8264-T switch", "fc:cf:62" => "BNT G8124 switch", "7c:fe:90" => "Mellanox IB switch", - "8c:ea:1b" => "Edgecore switch" + "8c:ea:1b" => "Edgecore Networks Switch" ); my %global_switch_type = ( @@ -53,7 +53,7 @@ my %global_switch_type = ( mellanox => "Mellanox", MLNX => "Mellanox", MELLAN => "Mellanox", - Edgecore => "cumulus" + Edgecore => "onie" ); @@ -1440,8 +1440,8 @@ sub switchsetup { my $config_script = "$::XCATROOT/share/xcat/scripts/config".$mytype; if (-r -x $config_script) { my $switches = join(",",@{${nodes_to_config}->{$mytype}}); - if ($mytype eq "cumulus") { - send_msg($request, 0, "Cumulus switch needs to take 50 mins to install, please run /opt/xcat/share/xcat/script/configcumulus after cumulus OS installed on switch\n"); + if ($mytype eq "onie") { + send_msg($request, 0, "onie switch needs to take 50 mins to install, please run /opt/xcat/share/xcat/script/configonie after Cumulus OS installed on switch\n"); } else { send_msg($request, 0, "call to config $mytype switches $switches\n"); my $out = `$config_script --switches $switches --all`; diff --git a/xCAT-server/lib/xcat/plugins/updatenode.pm b/xCAT-server/lib/xcat/plugins/updatenode.pm index 2b9c9e6af..a81388bbc 100644 --- a/xCAT-server/lib/xcat/plugins/updatenode.pm +++ b/xCAT-server/lib/xcat/plugins/updatenode.pm @@ -2252,6 +2252,9 @@ s/Running of postscripts has completed/Redeliver security files has completed/; } } } + if($response->{errorcode}) { + $rsp->{errorcode} = $response->{errorcode}; + } $CALLBACK->($rsp); } diff --git a/xCAT-server/lib/xcat/plugins/vsmppxe.pm b/xCAT-server/lib/xcat/plugins/vsmppxe.pm index 60e0cab30..aa22a24ed 100644 --- a/xCAT-server/lib/xcat/plugins/vsmppxe.pm +++ b/xCAT-server/lib/xcat/plugins/vsmppxe.pm @@ -402,6 +402,7 @@ sub process_request { $errored = 0; + my %bphash; my $inittime = 0; if (exists($::VSMPPXE_request->{inittime})) { $inittime = $::VSMPPXE_request->{inittime}->[0]; } if (!$inittime) { $inittime = 0; } @@ -409,15 +410,15 @@ sub process_request { $sub_req->({ command => ['setdestiny'], node => \@nodes, inittime => [$inittime], - arg => [ $args[0] ] }, \&pass_along); + arg => [ $args[0] ], + bootparams => \%bphash + }, \&pass_along); } if ($errored) { return; } #Time to actually configure the nodes, first extract database data with the scalable calls - my $bptab = xCAT::Table->new('bootparams', -create => 1); my $chaintab = xCAT::Table->new('chain'); my $mactab = xCAT::Table->new('mac'); #to get all the hostnames - my %bphash = %{ $bptab->getNodesAttribs(\@nodes, [qw(kernel initrd kcmdline addkcmdline)]) }; my %chainhash = %{ $chaintab->getNodesAttribs(\@nodes, [qw(currstate)]) }; my %machash = %{ $mactab->getNodesAttribs(\@nodes, [qw(mac)]) }; foreach (@nodes) { diff --git a/xCAT-server/lib/xcat/plugins/xen.pm b/xCAT-server/lib/xcat/plugins/xen.pm index 9d9289e18..7a552e7aa 100644 --- a/xCAT-server/lib/xcat/plugins/xen.pm +++ b/xCAT-server/lib/xcat/plugins/xen.pm @@ -704,6 +704,12 @@ sub process_request { } else { @exargs = ($request->{arg}); } + + #pdu commands will be handled in the pdu plugin + if ($command eq "rpower" and grep(/^pduon|pduoff|pdustat$/, @exargs)) { + return; + } + if ($command eq 'revacuate') { my $newnoderange; foreach (@$noderange) { diff --git a/xCAT-server/lib/xcat/plugins/xnba.pm b/xCAT-server/lib/xcat/plugins/xnba.pm index bdf93d294..fc485dd4e 100644 --- a/xCAT-server/lib/xcat/plugins/xnba.pm +++ b/xCAT-server/lib/xcat/plugins/xnba.pm @@ -108,7 +108,7 @@ sub setstate { my $linuximghashref = shift; if (ref $linuximghashref) { %linuximghash = %{$linuximghashref}; } my $imgaddkcmdline = ($linuximghash{'boottarget'}) ? undef : $linuximghash{'addkcmdline'}; - my $kern = $bphash{$node}->[0]; #$bptab->getNodeAttribs($node,['kernel','initrd','kcmdline']); + my $kern = $bphash{$node}->[0]; unless ($::XNBA_addkcmdlinehandled->{$node}) { #Tag to let us know the plugin had a special syntax implemented for addkcmdline if ($kern->{addkcmdline} or ($imgaddkcmdline)) { @@ -520,22 +520,24 @@ sub process_request { if (exists($::XNBA_request->{inittime})) { $inittime = $::XNBA_request->{inittime}->[0]; } if (!$inittime) { $inittime = 0; } $errored = 0; + my %bphash; unless ($args[0] eq 'stat') { # or $args[0] eq 'enact') { xCAT::MsgUtils->trace($verbose_on_off, "d", "xnba: issue setdestiny request"); $sub_req->({ command => ['setdestiny'], node => \@nodes, inittime => [$inittime], - arg => \@args }, \&pass_along); + arg => \@args , + bootparams => \%bphash}, + \&pass_along); } + if ($errored) { return; } #Time to actually configure the nodes, first extract database data with the scalable calls - my $bptab = xCAT::Table->new('bootparams', -create => 1); my $chaintab = xCAT::Table->new('chain'); my $noderestab = xCAT::Table->new('noderes'); #in order to detect per-node tftp directories my $mactab = xCAT::Table->new('mac'); #to get all the hostnames my %nrhash = %{ $noderestab->getNodesAttribs(\@nodes, [qw(tftpdir)]) }; - my %bphash = %{ $bptab->getNodesAttribs(\@nodes, [qw(kernel initrd kcmdline addkcmdline)]) }; my %chainhash = %{ $chaintab->getNodesAttribs(\@nodes, [qw(currstate)]) }; my %iscsihash; my $iscsitab = xCAT::Table->new('iscsi'); diff --git a/xCAT-server/lib/xcat/plugins/yaboot.pm b/xCAT-server/lib/xcat/plugins/yaboot.pm index a1bde29f0..8e8ac37c9 100644 --- a/xCAT-server/lib/xcat/plugins/yaboot.pm +++ b/xCAT-server/lib/xcat/plugins/yaboot.pm @@ -95,7 +95,7 @@ sub setstate { my $tftpdir = shift; my %nrhash = %{ shift() }; my $linuximghash = shift(); - my $kern = $bphash{$node}->[0]; #$bptab->getNodeAttribs($node,['kernel','initrd','kcmdline']); + my $kern = $bphash{$node}->[0]; if ($kern->{kcmdline} =~ /!myipfn!/) { my $ipfn; my @ipfnd = xCAT::NetworkUtils->my_ip_facing($node); @@ -567,17 +567,18 @@ sub process_request { if (exists($::YABOOT_request->{inittime})) { $inittime = $::YABOOT_request->{inittime}->[0]; } if (!$inittime) { $inittime = 0; } $errored = 0; + my %bphash; unless ($args[0] eq 'stat') { # or $args[0] eq 'enact') { xCAT::MsgUtils->trace($verbose_on_off, "d", "yaboot: issue setdestiny request"); $sub_req->({ command => ['setdestiny'], node => \@nodes, inittime => [$inittime], - arg => \@args }, \&pass_along); + arg => \@args, + bootparams => \%bphash}, + \&pass_along); } if ($errored) { return; } - my $bptab = xCAT::Table->new('bootparams', -create => 1); - my $bphash = $bptab->getNodesAttribs(\@nodes, [ 'kernel', 'initrd', 'kcmdline', 'addkcmdline' ]); my $chaintab = xCAT::Table->new('chain', -create => 1); my $chainhash = $chaintab->getNodesAttribs(\@nodes, ['currstate']); my $noderestab = xCAT::Table->new('noderes', -create => 1); @@ -614,7 +615,7 @@ sub process_request { $linuximghash = $linuximgtab->getAttribs({ imagename => $osimgname }, 'boottarget', 'addkcmdline'); } - ($rc, $errstr) = setstate($_, $bphash, $chainhash, $machash, $tftpdir, $nrhash, $linuximghash); + ($rc, $errstr) = setstate($_, \%bphash, $chainhash, $machash, $tftpdir, $nrhash, $linuximghash); if ($rc) { $response{node}->[0]->{errorcode}->[0] = $rc; $response{node}->[0]->{errorc}->[0] = $errstr; diff --git a/xCAT-server/lib/xcat/plugins/zvm.pm b/xCAT-server/lib/xcat/plugins/zvm.pm index ee74b4fa0..911be973e 100644 --- a/xCAT-server/lib/xcat/plugins/zvm.pm +++ b/xCAT-server/lib/xcat/plugins/zvm.pm @@ -2317,6 +2317,11 @@ sub powerVM { # Output string my $out; + + ##pdu commands will be handled in the pdu plugin + if ($args->[0] eq 'pduon' || $args->[0] eq 'pduoff' || $args->[0] eq 'pdustat') { + return; + } # Power on virtual server if ($args->[0] eq 'on') { diff --git a/xCAT-server/sbin/xcatd b/xCAT-server/sbin/xcatd old mode 100644 new mode 100755 index 2cffabf5c..4b21cd981 --- a/xCAT-server/sbin/xcatd +++ b/xCAT-server/sbin/xcatd @@ -139,6 +139,7 @@ Getopt::Long::Configure("pass_through"); use Storable qw(dclone); use POSIX qw(WNOHANG setsid :errno_h); my $pidfile; +my $reload; my $foreground; GetOptions( 'pidfile|p=s' => \$pidfile, @@ -217,6 +218,7 @@ if ($tmp) { $cmdlog_port = $tmp->{value}; } my $cmdlog_alllog = "====================================================\n"; +my $cmdlog_starttime=undef; # ----used for command log end--------- @@ -394,9 +396,12 @@ sub do_installm_service { ($client_name, $client_aliases) = gethostbyaddr($conn->peeraddr, AF_INET); } unless ($client_name) { - my $myaddr = inet_ntoa($conn->peeraddr); + my $addrfamily=sockaddr_family(getpeername($conn)); + my $myaddr=Socket::inet_ntop($addrfamily,$conn->peeraddr); xCAT::MsgUtils->message("S", "xcatd received a connection request from unknown host with ip address $myaddr, please check whether the reverse name resolution works correctly. The connection request will be ignored"); print "xcatd received a connection request from unknown host with ip address $myaddr, please check whether the reverse name resolution works correctly. The connection request will be ignored\n"; + close($conn); + next; } $clients[0] = $client_name; @@ -1274,6 +1279,7 @@ $SIG{USR2} = sub { if ($listener) { unlink("/var/run/xcat/mainservice.pid"); close($listener); $quit = 1; $listener = 0; $udpctl = 0; + $reload = 1; xCAT::MsgUtils->message("S", "xcatd main service $$ quiescing"); } }; @@ -1514,9 +1520,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; } @@ -1551,6 +1554,25 @@ if ($dbmaster) { # stop the monitoring process xCAT_monitoring::monitorctrl::stop($$); +if (! $reload) { + stop_tftp_service(); +} + +sub stop_tftp_service { + eval { + require xCAT_plugin::AAsn; + }; + if ($@) { + xCAT::MsgUtils->message("S", "Failed to load AAsn module"); + return; + } + no strict 'refs'; + if (!defined(${ "xCAT_plugin::AAsn::" }{stop_TFTP})) { + return; + } + xCAT_plugin::AAsn::stop_TFTP(); + use strict 'refs'; +} my $parent_fd; my %resps; @@ -2106,12 +2128,11 @@ sub dispatch_request { # ----used for trace start--------- my $str_cmd = $req->{command}->[0] . " "; - if (exists($req->{noderange})) { - foreach my $n (@{ $req->{noderange} }) { - $str_cmd .= $n . ","; - } - $str_cmd =~ s/(.+),$/$1 /g; + if (exists($req->{noderange}) && defined($req->{noderange}->[0])) { + my $tmpstr = join(",", @{$req->{noderange}}); + $str_cmd .= "$tmpstr "; } + if (exists($req->{arg})) { foreach my $arg (@{ $req->{arg} }) { $str_cmd .= $arg . " "; @@ -2636,7 +2657,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) @@ -2670,7 +2690,8 @@ sub service_connection { unless ($req) { last; } # ----used for command log start---------- - my ($sec, $min, $hour, $mday, $mon, $year) = localtime(time()); + $cmdlog_starttime = time(); + my ($sec, $min, $hour, $mday, $mon, $year) = localtime($cmdlog_starttime); $year += 1900; $mon += 1; my $strmon = ($mon > 9 ? $mon : "0" . $mon); @@ -2680,16 +2701,11 @@ sub service_connection { my $strsec = ($sec > 9 ? $sec : "0" . $sec); $cmdlog_alllog .= "[Date] $year-$strmon-$strmday $strhour:$strmin:$strsec\n"; - #print ">>>>>>>cmdlog request dumper>>>>>>>>\n"; - #print Dumper $req; - $cmdlog_alllog .= "[ClientType] " . $req->{clienttype}->[0] . " \n"; $cmdlog_alllog .= "[Request] " . $req->{command}->[0] . " "; - if (exists($req->{noderange})) { - foreach my $node (@{ $req->{noderange} }) { - $cmdlog_alllog .= $node . ","; - } - $cmdlog_alllog =~ s/(.+),$/$1 /g; + if (exists($req->{noderange}) && defined($req->{noderange}->[0])) { + my $tmpstr = join(",", @{$req->{noderange}}); + $cmdlog_alllog .= "$tmpstr "; } if (exists($req->{arg})) { @@ -2870,15 +2886,15 @@ sub service_connection { } # ----used for command log start------- + my $reqhandletime = time()-$cmdlog_starttime; + $cmdlog_alllog .= "[ElapsedTime] $reqhandletime s\n"; 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"); @@ -2941,6 +2957,8 @@ sub relay_fds { # Relays file descriptors from pipes to children to the SSL sock # ----used for command log start------- $cmdlog_alllog .= "Client abort requested\n"; + my $reqhandletime = time()-$cmdlog_starttime; + $cmdlog_alllog .= "[ElapsedTime] $reqhandletime s\n"; cmdlog_submitlog(); # ----used for command log end--------- diff --git a/xCAT-server/share/xcat/cons/blade b/xCAT-server/share/xcat/cons/blade index 66e50dfbc..cb4bb08d5 100755 --- a/xCAT-server/share/xcat/cons/blade +++ b/xCAT-server/share/xcat/cons/blade @@ -32,57 +32,19 @@ BEGIN exit 0; } get_lock(); - - #my $sleepint=int(rand(10)); #Stagger start to avoid overwhelming conserver/xCATd - #print "Opening console in ".(2+(0.5*$sleepint))." seconds...\n"; - #sleep $sleepint; } my $sleepint = int(rand(10)); #Stagger start to avoid overwhelming conserver/xCATd use lib "$::XCATROOT/lib/perl"; require xCAT::Client; - -#require xCAT::Table; -#require xCAT::Utils; require File::Basename; import File::Basename; my $scriptname = $0; -#$mptab = xCAT::Table->new('mp'); -#unless ($mptab) { -#sleep 5; #Try not to overwhelm logfiles... -# die "mp table must be configured"; -#} -#$mpatab = xCAT::Table->new('mpa'); -#$passtab = xCAT::Table->new('passwd'); - my $username = "USERID"; my $passsword = "PASSW0RD"; my $mm; my $slot; -#my $dba; -#if ($passtab) { -# ($dba) = $passtab->getAttribs({key=>blade},qw(username password)); -# if ($dba->{username}) { -# $username = $dba->{username}; -# } -# if ($dba->{password}) { -# $password = $dba->{password}; -# } -#} - -#$dba = $mptab->getNodeAttribs($ARGV[0],[qw(mpa id)]); -#$mm = $dba->{mpa}; -#$slot = $dba->{id}; -#if ($mpatab) { -# ($dba) = $mpatab->getAttribs({mpa=>$mm},qw(username password)); -# if ($dba) { -# if ($dba->{username}) { $username = $dba->{username}; } -# if ($dba->{password}) { $password = $dba->{password}; } -# } -#} -#xCAT::Utils::close_all_dbhs; -#sleep 5; #Slow start, I know, but with exec, can't return sub getans { my $rsp = shift; if ($rsp->{node}) { @@ -117,9 +79,6 @@ while ($solstatus !~ /SOL Session: Ready/ and $solstatus !~ /SOL Session: Active } exec "ssh -t $username" . "@" . "$mm console -o -T blade[$slot]"; -#my $pathtochild= dirname($scriptname). "/"; -#exec $pathtochild."blade.expect $mm $slot $username $password"; - #SECURITY: In this case, the authentication is expected to be done using the script user's ssh keys. As such, #this script does not receive any particularly sensitive data from the xCAT server. diff --git a/xCAT-server/share/xcat/cons/fsp b/xCAT-server/share/xcat/cons/fsp index b2030b127..3abd0b46e 100755 --- a/xCAT-server/share/xcat/cons/fsp +++ b/xCAT-server/share/xcat/cons/fsp @@ -32,24 +32,14 @@ BEGIN exit 0; } get_lock(); - - #my $sleepint=int(rand(10)); #Stagger start to avoid overwhelming conserver/xCATd - #print "Opening console in ".(2+(0.5*$sleepint))." seconds...\n"; - #sleep $sleepint; } my $sleepint = int(rand(10)); use lib "$::XCATROOT/lib/perl"; require xCAT::Client; require xCAT::Utils; use strict; - -#use Getopt::Long; -#use xCAT::Table; -#use xCAT::PPCdb; use Expect; -#use xCAT::DBobjUtils; -#use Data::Dumper; require File::Basename; import File::Basename; my $scriptname = $0; @@ -63,108 +53,6 @@ my $ips; my $id; my $hwtype; -########################################## -# Database errors -########################################## -#my %errmsg = ( -# NODE_UNDEF =>"Node not defined in '%s' database", -# NO_ATTR =>"'%s' not defined in '%s' database", -# DB_UNDEF =>"'%s' database not defined" -#); - - - -########################################################################## -# Parse the command line for options and operands -########################################################################## -#sub parse_args { - -# my %opt = (); -# my @VERSION = qw( 2.0 ); -# -# ############################################# -# # Responds with usage statement -# ############################################# -# local *usage = sub { -# -# my $cmd = __FILE__; -# $cmd =~ s/.*([\w]{3}$)/$1/; -# -# if ( defined( $_[0] )) { -# print STDERR "$_[0]\n"; -# } -# my @msg = ( -# "$cmd -h|--help\n", -# "$cmd -v|--version\n", -# "$cmd singlenode [-V|-Verbose]\n" ); -# print STDERR @msg; -# }; -# ############################################# -# # Process command-line arguments -# ############################################# -# if ( !defined( @ARGV )) { -# usage( "No node specified" ); -# return(1); -# } -# ############################################# -# # Checks case in GetOptions, allows opts -# # to be grouped (e.g. -vx), and terminates -# # at the first unrecognized option. -# ############################################# -# $Getopt::Long::ignorecase = 0; -# Getopt::Long::Configure( "bundling" ); -# -# if ( !GetOptions( \%opt, qw(h|help V|Verbose v|version) )) { -# usage(); -# return(1); -# } -# ####################################### -# # Option -h for Help -# ####################################### -# if ( exists( $opt{h} )) { -# usage(); -# return(1); -# } -# ####################################### -# # Option -v for version -# ####################################### -# if ( exists( $opt{v} )) { -# print STDERR \@VERSION; -# return(1); -# } -# ####################################### -# # Option -V for verbose output -# ####################################### -# if ( exists( $opt{V} )) { -# $verbose = 1; -# } -# ####################################### -# # Check for "-" with no option -# ####################################### -# if ( grep(/^-$/, @ARGV )) { -# usage( "Missing option: -" ); -# return(1); -# } -# ####################################### -# # Get node -# ####################################### -# if ( !defined( $ARGV[0] )) { -# usage( "No node specified" ); -# return(1); -# } -# ####################################### -# # Check for extra argument -# ####################################### -# $node = shift @ARGV; -# if ( defined( $ARGV[0] )) { -# usage( "Invalid Argument: $ARGV[0]" ); -# return(1); -# } -# return(0); -#} - - - ########################################################################## # Open remote console ########################################################################## @@ -179,88 +67,16 @@ sub invoke_cmd { } else { $machine = "CEC"; } - - #my @attribs = qw(id parent hcp); - #my %tabs = (); - - ################################## - # Open databases needed - ################################## - #foreach ( qw(ppc vpd nodetype) ) { - # $tabs{$_} = xCAT::Table->new($_); - # - # if ( !exists( $tabs{$_} )) { - # return( sprintf( $errmsg{DB_UNDEF}, $_ )); - # } - #} - ################################## - # Get node power type - ################################## - #my $hwtype = __FILE__; - #$hwtype =~ s/.*([\w]{3})$/$1/; - # - ################################# - # Get node type - ################################# - #my ($ent) = $tabs{nodetype}->getNodeAttribs($node, ["nodetype"] ); - #if ( !defined( $ent )) { - # return( sprintf( $errmsg{NODE_UNDEF}, "nodetype" )); - #} - ################################# - # Check for type - ################################# - #if ( !exists( $ent->{nodetype} )) { - # return( sprintf( $errmsg{NO_ATTR}, $ent->{nodetype},"nodetype" )); - #} - ################################# - # Check for valid "type" - ################################# - #my @types = split /,/, $ent->{nodetype}; - #my ($type) = grep( /^(lpar|osi)$/, @types ); - # - #if ( !defined( $type )) { - # return( "Invalid node type: $ent->{nodetype}" ); - #} - ################################# - # Get attributes - ################################# - #my ($att) = $tabs{ppc}->getAttribs({'node'=>$node}, @attribs ); - # - #if ( !defined( $att )) { - # return( sprintf( $errmsg{NODE_UNDEF}, "ppc" )); - #} - ################################# - # Verify required attributes - ################################# - #foreach my $at ( @attribs ) { - # if ( !exists( $att->{$at} )) { - # return( sprintf( $errmsg{NO_ATTR}, $at, "ppc" )); - # } - #} - # - #my $fsp_name = $att->{hcp}; - #my $id = $att->{id}; - #use xcatd to get the attribute $fsp_name and $id of the node. - - #my $fsp_api ="/opt/xcat/sbin/fsp-api"; my $fsp_api = ($::XCATROOT) ? "$::XCATROOT/sbin/fsp-api" : "/opt/xcat/sbin/fsp-api"; my $action = "console"; my $type = "0"; - - #my $fsp_ip = (); my $Rc = 0; - - #$fsp_ip = xCAT::NetworkUtils::getNodeIPaddress( $fsp_name ); - #if(!defined($fsp_ip)) { - # return "Failed to get the $fsp_name\'s ip"; - #} my $power_state_cmd = "$fsp_api -a cec_state -t $type:$fsp_ip:$id:$node: 2>&1"; my $res; my $index = 0; my $pre_state = undef; - #my $wait_interval =20; my $ipl_num = 0; while (1) { $res = xCAT::Utils->runcmd($power_state_cmd, -1); @@ -317,18 +133,11 @@ sub invoke_cmd { sleep 5; } else { $pre_state = $res; - - #print "."; sleep 20; } - - #$wait_interval =20+int(rand(20)); - #sleep $wait_interval; } my $cmd = "$fsp_api -a $action -t $type:$fsp_ip:$id:$node:\r"; - - #print "cmd: $cmd\n"; my $running_failed_code = "Reason code: 0x1000000"; my $fsp_standby_msg = "Reason code: 0x1300"; my $fsp_lock_msg = "Reason code: 0x1f00"; @@ -397,9 +206,6 @@ sub invoke_cmd { ############################################## # Start main body of code ############################################## -#if ( parse_args() ) { -# exit(1); -#} sub getans { my $rsp = shift; if ($rsp->{node}) { @@ -434,6 +240,3 @@ if ($result ne "0") { } exit(0); - - - diff --git a/xCAT-server/share/xcat/cons/hmc b/xCAT-server/share/xcat/cons/hmc index b956f4f0f..ae0425731 100644 --- a/xCAT-server/share/xcat/cons/hmc +++ b/xCAT-server/share/xcat/cons/hmc @@ -32,19 +32,11 @@ BEGIN exit 0; } get_lock(); - - #my $sleepint=int(rand(10)); #Stagger start to avoid overwhelming conserver/xCATd - #print "Opening console in ".(2+(0.5*$sleepint))." seconds...\n"; - #sleep $sleepint; } my $sleepint = int(rand(10)); use lib "$::XCATROOT/lib/perl"; require xCAT::Client; use strict; - -#use Getopt::Long; -#use xCAT::Table; -#use xCAT::PPCdb; use xCAT::PPCcli qw(SUCCESS EXPECT_ERROR RC_ERROR NR_ERROR); use Data::Dumper; require File::Basename; @@ -62,192 +54,10 @@ my $mtms; my @cred; my $credencial; -########################################## -# Database errors -########################################## -#my %errmsg = ( -# NODE_UNDEF =>"Node not defined in '%s' database", -# NO_ATTR =>"'%s' not defined in '%s' database", -# DB_UNDEF =>"'%s' database not defined" -#); - - - -########################################################################## -# Parse the command line for options and operands -########################################################################## -#sub parse_args { -# -# my %opt = (); -# my @VERSION = qw( 2.0 ); -# -# ############################################# -# # Responds with usage statement -# ############################################# -# local *usage = sub { -# -# my $cmd = __FILE__; -# $cmd =~ s/.*([\w]{3}$)/$1/; -# -# if ( defined( $_[0] )) { -# print STDERR "$_[0]\n"; -# } -# my @msg = ( -# "$cmd -h|--help\n", -# "$cmd -v|--version\n", -# "$cmd singlenode [-V|-Verbose]\n" ); -# print STDERR @msg; -# }; -# ############################################# -# # Process command-line arguments -# ############################################# -# if ( !defined( @ARGV )) { -# usage( "No node specified" ); -# return(1); -# } -# ############################################# -# # Checks case in GetOptions, allows opts -# # to be grouped (e.g. -vx), and terminates -# # at the first unrecognized option. -# ############################################# -# $Getopt::Long::ignorecase = 0; -# Getopt::Long::Configure( "bundling" ); -# -# if ( !GetOptions( \%opt, qw(h|help V|Verbose v|version) )) { -# usage(); -# return(1); -# } -# ####################################### -# # Option -h for Help -# ####################################### -# if ( exists( $opt{h} )) { -# usage(); -# return(1); -# } -# ####################################### -# # Option -v for version -# ####################################### -# if ( exists( $opt{v} )) { -# print STDERR \@VERSION; -# return(1); -# } -# ####################################### -# # Option -V for verbose output -# ####################################### -# if ( exists( $opt{V} )) { -# $verbose = 1; -# } -# ####################################### -# # Check for "-" with no option -# ####################################### -# if ( grep(/^-$/, @ARGV )) { -# usage( "Missing option: -" ); -# return(1); -# } -# ####################################### -# # Get node -# ####################################### -# if ( !defined( $ARGV[0] )) { -# usage( "No node specified" ); -# return(1); -# } -# ####################################### -# # Check for extra argument -# ####################################### -# $node = shift @ARGV; -# if ( defined( $ARGV[0] )) { -# usage( "Invalid Argument: $ARGV[0]" ); -# return(1); -# } -# return(0); -#} - - - ########################################################################## # Open remote console ########################################################################## sub invoke_cmd { - - #my @attribs = qw(id parent hcp); - #my %tabs = (); - # - ################################### - ## Open databases needed - ################################### - #foreach ( qw(ppc vpd nodetype) ) { - # $tabs{$_} = xCAT::Table->new($_); - # - # if ( !exists( $tabs{$_} )) { - # return( sprintf( $errmsg{DB_UNDEF}, $_ )); - # } - #} - ################################### - ## Get node power type - ################################### - #my $hwtype = __FILE__; - #$hwtype =~ s/.*([\w]{3})$/$1/; - # - ################################## - ## Get node type - ################################## - #my ($ent) = $tabs{nodetype}->getNodeAttribs($node, ["nodetype"] ); - #if ( !defined( $ent )) { - # return( sprintf( $errmsg{NODE_UNDEF}, "nodetype" )); - #} - ################################## - ## Check for type - ################################## - #if ( !exists( $ent->{nodetype} )) { - # return( sprintf( $errmsg{NO_ATTR}, $ent->{nodetype},"nodetype" )); - #} - ################################## - ## Check for valid "type" - ################################## - #my @types = split /,/, $ent->{nodetype}; - #my ($type) = grep( /^(lpar|osi)$/, @types ); - # - #if ( !defined( $type )) { - # return( "Invalid node type: $ent->{nodetype}" ); - #} - ################################## - ## Get attributes - ################################## - #my ($att) = $tabs{ppc}->getAttribs({'node'=>$node}, @attribs ); - # - #if ( !defined( $att )) { - # return( sprintf( $errmsg{NODE_UNDEF}, "ppc" )); - #} - ################################## - ## Verify required attributes - ################################## - #foreach my $at ( @attribs ) { - # if ( !exists( $att->{$at} )) { - # return( sprintf( $errmsg{NO_ATTR}, $at, "ppc" )); - # } - #} - ################################## - ## Find MTMS in vpd database - ################################## - #my @attrs = qw(mtm serial); - #my ($vpd) = $tabs{vpd}->getNodeAttribs($att->{parent}, \@attrs ); - # - #if ( !defined( $vpd )) { - # return( sprintf( $errmsg{NODE_UNDEF}, "vpd" )); - #} - ################################# - ## Verify both vpd attributes - ################################# - #foreach ( @attrs ) { - # if ( !exists( $vpd->{$_} )) { - # return( sprintf( $errmsg{NO_ATTR}, $_, "vpd" )); - # } - #} - #my $mtms = "$vpd->{mtm}*$vpd->{serial}"; - #my $host = $att->{hcp}; - #my $lparid = $att->{id}; - #$type = "lpar"; - my $type = "lpar"; my $hwtype = "hmc"; my %request = ( @@ -257,7 +67,6 @@ sub invoke_cmd { ################################# # Get userid and password ################################# - #my @cred = xCAT::PPCdb::credentials( $host, $hwtype ); @cred = split(/,/, $credencial); $request{$host}{cred} = \@cred; ################################# @@ -281,9 +90,6 @@ sub invoke_cmd { ############################################## # Start main body of code ############################################## -#if ( parse_args() ) { -# exit(1); -#} sub getans { my $rsp = shift; if ($rsp->{node}) { @@ -308,7 +114,7 @@ until ($lparid and $host and $mtms) { get_lock(); xCAT::Client::submit_request($cmdref, \&getans); } -release_lock(); #done with xcatd, can run with near impunity +release_lock(); #done with xcatd, can run with near impunity $node = $ARGV[0]; @@ -319,6 +125,3 @@ if ($result ne "0") { } exit(0); - - - diff --git a/xCAT-server/share/xcat/cons/hpblade b/xCAT-server/share/xcat/cons/hpblade index 2fe780c51..1a63bfd6e 100755 --- a/xCAT-server/share/xcat/cons/hpblade +++ b/xCAT-server/share/xcat/cons/hpblade @@ -38,10 +38,6 @@ BEGIN exit 0; } get_lock(); - - #my $sleepint=int(rand(10)); #Stagger start to avoid overwhelming conserver/xCATd - #print "Opening console in ".(2+(0.5*$sleepint))." seconds...\n"; - #sleep $sleepint; } my $sleepint = int(rand(10)); #Stagger start to avoid overwhelming conserver/xCATd use lib "$::XCATROOT/lib/perl"; @@ -51,43 +47,11 @@ require xCAT::Client; require File::Basename; import File::Basename; my $scriptname = $0; - -#$mptab = xCAT::Table->new('mp'); -#unless ($mptab) { -#sleep 5; #Try not to overwhelm logfiles... -# die "mp table must be configured"; -#} -#$mpatab = xCAT::Table->new('mpa'); -#$passtab = xCAT::Table->new('passwd'); - my $username = "admin"; my $passsword = "PASSW0RD"; my $mm; my $slot; -#my $dba; -#if ($passtab) { -# ($dba) = $passtab->getAttribs({key=>blade},qw(username password)); -# if ($dba->{username}) { -# $username = $dba->{username}; -# } -# if ($dba->{password}) { -# $password = $dba->{password}; -# } -#} - -#$dba = $mptab->getNodeAttribs($ARGV[0],[qw(mpa id)]); -#$mm = $dba->{mpa}; -#$slot = $dba->{id}; -#if ($mpatab) { -# ($dba) = $mpatab->getAttribs({mpa=>$mm},qw(username password)); -# if ($dba) { -# if ($dba->{username}) { $username = $dba->{username}; } -# if ($dba->{password}) { $password = $dba->{password}; } -# } -#} -#xCAT::Utils::close_all_dbhs; -#sleep 5; #Slow start, I know, but with exec, can't return sub getans { my $rsp = shift; if ($rsp->{node}) { @@ -115,8 +79,6 @@ $sleepint = 10 + int(rand(30)); #Stagger sleep to take it easy on AMM/hosting se exec "ssh -t $username" . "@" . "$mm vsp"; my $pathtochild = dirname($scriptname) . "/"; -#exec $pathtochild."hpblade.expect"; - #SECURITY: In this case, the authentication is expected to be done using the script user's ssh keys. As such, #this script does not receive any particularly sensitive data from the xCAT server. diff --git a/xCAT-server/share/xcat/cons/ipmi b/xCAT-server/share/xcat/cons/ipmi index 48d22d406..6dc4a4ed0 100755 --- a/xCAT-server/share/xcat/cons/ipmi +++ b/xCAT-server/share/xcat/cons/ipmi @@ -94,28 +94,6 @@ if ($password) { $pass = ''; } -#require xCAT::Table; -#require xCAT::Utils; -#my $dba; -#my $ipmitab = xCAT::Table->new('ipmi'); -#unless ($ipmitab) { die "Unable to open IPMI table"; } -#my $passtab = xCAT::Table->new('passwd'); -#if ($passtab) { -# ($dba) = $passtab->getAttribs({key=>'ipmi'},qw(username password)); -# if ($dba) { -# if ($dba->{username}) { $username = $dba->{username}; } -# if ($dba->{password}) { $password = $dba->{password}; } -# } -#} - -#$dba = $ipmitab->getNodeAttribs($ARGV[0],[qw(bmc username password)]); -#if ($dba) { -# if ($dba->{bmc}) { $bmc = $dba->{bmc}; } -# if ($dba->{username}) { $username = $dba->{username}; } -# if ($dba->{password}) { $password = $dba->{password}; } -#} -#xCAT::Utils::close_all_dbhs; -#my $isintel = system "ipmitool -I lanplus -U $username -P $password -H $bmc chassis status > /dev/null 2>&1"; my $isintel = 0; my $sleepint; my $rc; @@ -123,7 +101,7 @@ my $ipmitool = "ipmitool"; if (-x "$XCATROOT/bin/ipmitool-xcat") { $ipmitool = "$XCATROOT/bin/ipmitool-xcat"; } -my @mcinfo = `$ipmitool -I lanplus $user $pass -H $bmc mc info`; #| grep 'Manufacturer ID : 343' > /dev/null 2>&1"; +my @mcinfo = `$ipmitool -I lanplus $user $pass -H $bmc mc info`; $rc = $?; if ($rc) { #some shoddy vendors ignore the IPMI 2.0 requirement to support IPMI 1.5 formats for BMC capability determination, attempt IPMI 2.0 even without the ability to confirm IPMI 2.0 support. Though SOL was not baked in prior IPMI 2.0, this script supports pre-2.0 'ISOL' on older devices, hence why we are checking for 1.5/2.0 before proceeding normally @mcinfo = `$ipmitool -I lan $user $pass -H $bmc mc info`; @@ -133,7 +111,7 @@ while ($rc != 0) { $sleepint = 10 + int(rand(20)); print "Failure to reach IPMI device, retrying in $sleepint seconds (Hit Ctrl-E,c,o to skip)\n"; sleep ($sleepint); - @mcinfo = `$ipmitool -I lanplus $user $pass -H $bmc mc info`; #| grep 'Manufacturer ID : 343' > /dev/null 2>&1"; + @mcinfo = `$ipmitool -I lanplus $user $pass -H $bmc mc info`; $rc = $?; if ($rc) { #repeat workaround for shoddy vendors @mcinfo = `$ipmitool -I lan $user $pass -H $bmc mc info`; diff --git a/xCAT-server/share/xcat/cons/ivm b/xCAT-server/share/xcat/cons/ivm index 40e847b52..a84e7f659 100755 --- a/xCAT-server/share/xcat/cons/ivm +++ b/xCAT-server/share/xcat/cons/ivm @@ -62,192 +62,10 @@ my $mtms; my @cred; my $credencial; -########################################## -# Database errors -########################################## -#my %errmsg = ( -# NODE_UNDEF =>"Node not defined in '%s' database", -# NO_ATTR =>"'%s' not defined in '%s' database", -# DB_UNDEF =>"'%s' database not defined" -#); - - - -########################################################################## -# Parse the command line for options and operands -########################################################################## -#sub parse_args { -# -# my %opt = (); -# my @VERSION = qw( 2.0 ); -# -# ############################################# -# # Responds with usage statement -# ############################################# -# local *usage = sub { -# -# my $cmd = __FILE__; -# $cmd =~ s/.*([\w]{3}$)/$1/; -# -# if ( defined( $_[0] )) { -# print STDERR "$_[0]\n"; -# } -# my @msg = ( -# "$cmd -h|--help\n", -# "$cmd -v|--version\n", -# "$cmd singlenode [-V|-Verbose]\n" ); -# print STDERR @msg; -# }; -# ############################################# -# # Process command-line arguments -# ############################################# -# if ( !defined( @ARGV )) { -# usage( "No node specified" ); -# return(1); -# } -# ############################################# -# # Checks case in GetOptions, allows opts -# # to be grouped (e.g. -vx), and terminates -# # at the first unrecognized option. -# ############################################# -# $Getopt::Long::ignorecase = 0; -# Getopt::Long::Configure( "bundling" ); -# -# if ( !GetOptions( \%opt, qw(h|help V|Verbose v|version) )) { -# usage(); -# return(1); -# } -# ####################################### -# # Option -h for Help -# ####################################### -# if ( exists( $opt{h} )) { -# usage(); -# return(1); -# } -# ####################################### -# # Option -v for version -# ####################################### -# if ( exists( $opt{v} )) { -# print STDERR \@VERSION; -# return(1); -# } -# ####################################### -# # Option -V for verbose output -# ####################################### -# if ( exists( $opt{V} )) { -# $verbose = 1; -# } -# ####################################### -# # Check for "-" with no option -# ####################################### -# if ( grep(/^-$/, @ARGV )) { -# usage( "Missing option: -" ); -# return(1); -# } -# ####################################### -# # Get node -# ####################################### -# if ( !defined( $ARGV[0] )) { -# usage( "No node specified" ); -# return(1); -# } -# ####################################### -# # Check for extra argument -# ####################################### -# $node = shift @ARGV; -# if ( defined( $ARGV[0] )) { -# usage( "Invalid Argument: $ARGV[0]" ); -# return(1); -# } -# return(0); -#} - - - ########################################################################## # Open remote console ########################################################################## sub invoke_cmd { - - #my @attribs = qw(id parent hcp); - #my %tabs = (); - # - ################################### - ## Open databases needed - ################################### - #foreach ( qw(ppc vpd nodetype) ) { - # $tabs{$_} = xCAT::Table->new($_); - # - # if ( !exists( $tabs{$_} )) { - # return( sprintf( $errmsg{DB_UNDEF}, $_ )); - # } - #} - ################################### - ## Get node power type - ################################### - #my $hwtype = __FILE__; - #$hwtype =~ s/.*([\w]{3})$/$1/; - # - ################################## - ## Get node type - ################################## - #my ($ent) = $tabs{nodetype}->getNodeAttribs($node, ["nodetype"] ); - #if ( !defined( $ent )) { - # return( sprintf( $errmsg{NODE_UNDEF}, "nodetype" )); - #} - ################################## - ## Check for type - ################################## - #if ( !exists( $ent->{nodetype} )) { - # return( sprintf( $errmsg{NO_ATTR}, $ent->{nodetype},"nodetype" )); - #} - ################################## - ## Check for valid "type" - ################################## - #my @types = split /,/, $ent->{nodetype}; - #my ($type) = grep( /^(lpar|osi)$/, @types ); - # - #if ( !defined( $type )) { - # return( "Invalid node type: $ent->{nodetype}" ); - #} - ################################## - ## Get attributes - ################################## - #my ($att) = $tabs{ppc}->getAttribs({'node'=>$node}, @attribs ); - # - #if ( !defined( $att )) { - # return( sprintf( $errmsg{NODE_UNDEF}, "ppc" )); - #} - ################################## - ## Verify required attributes - ################################## - #foreach my $at ( @attribs ) { - # if ( !exists( $att->{$at} )) { - # return( sprintf( $errmsg{NO_ATTR}, $at, "ppc" )); - # } - #} - ################################## - ## Find MTMS in vpd database - ################################## - #my @attrs = qw(mtm serial); - #my ($vpd) = $tabs{vpd}->getNodeAttribs($att->{parent}, \@attrs ); - # - #if ( !defined( $vpd )) { - # return( sprintf( $errmsg{NODE_UNDEF}, "vpd" )); - #} - ################################# - ## Verify both vpd attributes - ################################# - #foreach ( @attrs ) { - # if ( !exists( $vpd->{$_} )) { - # return( sprintf( $errmsg{NO_ATTR}, $_, "vpd" )); - # } - #} - #my $mtms = "$vpd->{mtm}*$vpd->{serial}"; - #my $host = $att->{hcp}; - #my $lparid = $att->{id}; - #$type = "lpar"; - my $type = "lpar"; my $hwtype = "ivm"; my %request = ( @@ -257,7 +75,6 @@ sub invoke_cmd { ################################# # Get userid and password ################################# - #my @cred = xCAT::PPCdb::credentials( $host, $hwtype ); @cred = split(/,/, $credencial); $request{$host}{cred} = \@cred; ################################# @@ -281,9 +98,6 @@ sub invoke_cmd { ############################################## # Start main body of code ############################################## -#if ( parse_args() ) { -# exit(1); -#} sub getans { my $rsp = shift; @@ -322,7 +136,3 @@ if ($result ne "0") { exit(1); } exit(0); - - - - diff --git a/xCAT-server/share/xcat/cons/kvm b/xCAT-server/share/xcat/cons/kvm index c122799ad..c5b9899cd 100755 --- a/xCAT-server/share/xcat/cons/kvm +++ b/xCAT-server/share/xcat/cons/kvm @@ -33,19 +33,8 @@ BEGIN } get_lock(); - #my $sleepint=int(rand(10)); - #print "Opening console in ".(2+(0.5*$sleepint))." seconds...\n"; - #sleep $sleepint; } -#BEGIN -#{ -# use Time::HiRes qw(sleep); -# $::XCATROOT = $ENV{'XCATROOT'} ? $ENV{'XCATROOT'} : '/opt/xcat'; -# my $sleepint=int(rand(10)); -# print "Opening console in ".(0.5*$sleepint)." seconds...\n"; -# sleep (0.5*$sleepint); -#} my $sleepint; use lib "$::XCATROOT/lib/perl"; require xCAT::Client; @@ -90,9 +79,3 @@ if (!$ENV{'TERM'}) { exec "ssh -t $dsthost screen -U -a -O -e ^]a -d -R -S serial-" . $ARGV[0] . "-cons -A $dstty $speed"; -#my $pathtochild= dirname($scriptname). "/"; -#exec $pathtochild."blade.expect $mm $slot $username $password"; - - - - diff --git a/xCAT-server/share/xcat/cons/multiple b/xCAT-server/share/xcat/cons/multiple index ff0feccf6..8e7d41f1e 100755 --- a/xCAT-server/share/xcat/cons/multiple +++ b/xCAT-server/share/xcat/cons/multiple @@ -138,7 +138,6 @@ sub invoke_hmc { ################################# # Get userid and password ################################# - #my @cred = xCAT::PPCdb::credentials( $host, $hwtype ); @cred = split(/,/, $credencial); $request{$host}{cred} = \@cred; ################################# @@ -228,7 +227,3 @@ for my $thishcp (keys %{ ${$hcps}[0] }) { } } exit(0); - - - - diff --git a/xCAT-server/share/xcat/cons/xen b/xCAT-server/share/xcat/cons/xen index 2cdf0b051..0d475b039 100755 --- a/xCAT-server/share/xcat/cons/xen +++ b/xCAT-server/share/xcat/cons/xen @@ -32,20 +32,8 @@ BEGIN exit 0; } get_lock(); - - #my $sleepint=int(rand(10)); - #print "Opening console in ".(2+(0.5*$sleepint))." seconds...\n"; - #sleep $sleepint; } -#BEGIN -#{ -# use Time::HiRes qw(sleep); -# $::XCATROOT = $ENV{'XCATROOT'} ? $ENV{'XCATROOT'} : '/opt/xcat'; -# my $sleepint=int(rand(10)); -# print "Opening console in ".(0.5*$sleepint)." seconds...\n"; -# sleep (0.5*$sleepint); -#} my $sleepint; use lib "$::XCATROOT/lib/perl"; require xCAT::Client; @@ -81,10 +69,3 @@ until ($dsthost and $speed and $dstty) { } release_lock(); exec "ssh -t $dsthost screen -U -a -O -e ^]a -d -R -S serial-" . $ARGV[0] . "-cons -A $dstty $speed"; - -#my $pathtochild= dirname($scriptname). "/"; -#exec $pathtochild."blade.expect $mm $slot $username $password"; - - - - diff --git a/xCAT-server/share/xcat/netboot/add-on/statelite/rc.statelite b/xCAT-server/share/xcat/netboot/add-on/statelite/rc.statelite index 49e2fb3f1..6199919fd 100755 --- a/xCAT-server/share/xcat/netboot/add-on/statelite/rc.statelite +++ b/xCAT-server/share/xcat/netboot/add-on/statelite/rc.statelite @@ -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 diff --git a/xCAT-server/share/xcat/netboot/rh/compute.rhels7.ppc64.exlist b/xCAT-server/share/xcat/netboot/rh/compute.rhels7.ppc64.exlist index cdef4819d..38de24002 100644 --- a/xCAT-server/share/xcat/netboot/rh/compute.rhels7.ppc64.exlist +++ b/xCAT-server/share/xcat/netboot/rh/compute.rhels7.ppc64.exlist @@ -32,4 +32,4 @@ ./usr/share/zoneinfo* ./var/cache/man* ./var/lib/yum* - +./tmp* diff --git a/xCAT-server/share/xcat/netboot/rh/compute.rhels7.x86_64.exlist b/xCAT-server/share/xcat/netboot/rh/compute.rhels7.x86_64.exlist index cdef4819d..38de24002 100644 --- a/xCAT-server/share/xcat/netboot/rh/compute.rhels7.x86_64.exlist +++ b/xCAT-server/share/xcat/netboot/rh/compute.rhels7.x86_64.exlist @@ -32,4 +32,4 @@ ./usr/share/zoneinfo* ./var/cache/man* ./var/lib/yum* - +./tmp* diff --git a/xCAT-server/share/xcat/netboot/rh/dracut_033/xcatroot b/xCAT-server/share/xcat/netboot/rh/dracut_033/xcatroot index 94e1f026e..0c1b3ce8e 100755 --- a/xCAT-server/share/xcat/netboot/rh/dracut_033/xcatroot +++ b/xCAT-server/share/xcat/netboot/rh/dracut_033/xcatroot @@ -1,4 +1,5 @@ #!/bin/sh +log_label="xcat.dracut_033" NEWROOT=$3 RWDIR=.statelite @@ -8,7 +9,9 @@ XCAT="$(getarg XCAT=)" XCATMASTER=$XCAT STATEMNT="$(getarg STATEMNT=)" rootlimit="$(getarg rootlimit=)" +xcatdebugmode="$(getarg xcatdebugmode=)" +[ "$xcatdebugmode" > "0" ] && logger -t $log_label -p local4.debug "in dracut, executing xcatroot..." getarg nonodestatus NODESTATUS=$? @@ -18,247 +21,248 @@ if [ $? -ne 0 ]; then XCATIPORT="3002" fi -xcatdebugmode="$(getarg xcatdebugmode=)" - -[ "$xcatdebugmode" > "0" ] && logger -t xcat -p debug "running xcatroot...." -[ "$xcatdebugmode" > "0" ] && logger -t xcat -p debug "MASTER=$MASTER XCATIPORT=$XCATIPORT" +[ "$xcatdebugmode" > "0" ] && logger -t $log_label -p local4.debug "MASTER=$MASTER XCATIPORT=$XCATIPORT NODESTATUS=$NODESTATUS" if [ "$NODESTATUS" != "0" ]; then -[ "$xcatdebugmode" > "0" ] && logger -t xcat -p debug "nodestatus: netbooting,reporting..." +[ "$xcatdebugmode" > "0" ] && logger -t $log_label -p local4.debug "Reporting installstatus=netbooting..." /tmp/updateflag $MASTER $XCATIPORT "installstatus netbooting" fi imgurl="$(getarg imgurl=)"; if [ ! -z "$imgurl" ]; then - if [ xhttp = x${imgurl%%:*} ]; then - NFS=0 - FILENAME=${imgurl##*/} - while [ ! -r "$FILENAME" ]; do - [ "$xcatdebugmode" > "0" ] && logger -t xcat -p debug "downloading $imgurl...." - echo Getting $imgurl... - if ! wget -nv $imgurl; then - [ "$xcatdebugmode" > "0" ] && logger -t xcat -p debug "downloading $imgurl failed,retrying...." - rm -f $FILENAME - sleep 27 - fi - done - elif [ xnfs = x${imgurl%%:*} ]; then - NFS=1 - SERVER=${imgurl#nfs:} - SERVER=${SERVER#/} - SERVER=${SERVER#/} - ROOTDIR=$SERVER - SERVER=${SERVER%%/*} - SERVER=${SERVER%:} - ROOTDIR=/${ROOTDIR#*/} - fi + if [ xhttp = x${imgurl%%:*} ]; then + NFS=0 + FILENAME=${imgurl##*/} + while [ ! -r "$FILENAME" ]; do + [ "$xcatdebugmode" > "0" ] && logger -t $log_label -p local4.debug "Downloading $imgurl..." + echo Getting $imgurl... + if ! wget -nv $imgurl; then + [ "$xcatdebugmode" > "0" ] && logger -t $log_label -p local4.debug "Downloading $imgurl FAILED, retrying..." + rm -f $FILENAME + sleep 27 + fi + done + [ "$xcatdebugmode" > "0" ] && logger -t $log_label -p local4.debug "Download complete." + elif [ xnfs = x${imgurl%%:*} ]; then + NFS=1 + SERVER=${imgurl#nfs:} + SERVER=${SERVER#/} + SERVER=${SERVER#/} + ROOTDIR=$SERVER + SERVER=${SERVER%%/*} + SERVER=${SERVER%:} + ROOTDIR=/${ROOTDIR#*/} + fi fi #echo 0 > /proc/sys/vm/zone_reclaim_mode #Avoid kernel bug if [ -r /rootimg.sfs ]; then - echo Setting up squashfs with ram overlay. - mknod /dev/loop0 b 7 0 - mkdir -p /ro - mkdir -p /rw - mount -t squashfs /rootimg.sfs /ro - mount -t tmpfs rw /rw - mount -t aufs -o dirs=/rw:/ro mergedroot $NEWROOT - mkdir -p $NEWROOT/ro - mkdir -p $NEWROOT/rw - mount --move /ro $NEWROOT/ro - mount --move /rw $NEWROOT/rw + echo Setting up squashfs with ram overlay. + mknod /dev/loop0 b 7 0 + mkdir -p /ro + mkdir -p /rw + mount -t squashfs /rootimg.sfs /ro + mount -t tmpfs rw /rw + mount -t aufs -o dirs=/rw:/ro mergedroot $NEWROOT + mkdir -p $NEWROOT/ro + mkdir -p $NEWROOT/rw + mount --move /ro $NEWROOT/ro + mount --move /rw $NEWROOT/rw elif [ -r /rootimg.cpio.gz ] || [ -r /rootimg.cpio.xz ]; then - [ "$xcatdebugmode" > "0" ] && logger -t xcat -p debug "rootimg downloaded,setting up RAM-root tmpfs...." - echo Setting up RAM-root tmpfs. - if [ -z $rootlimit ];then - mount -t tmpfs -o mode=755 rootfs $NEWROOT - else - mount -t tmpfs -o mode=755,size=$rootlimit rootfs $NEWROOT - fi + [ "$xcatdebugmode" > "0" ] && logger -t $log_label -p local4.debug "Downloaded rootimg.cpio.[gz/xz]...Setting up RAM-root tmpfs." + echo Setting up RAM-root tmpfs. + if [ -z $rootlimit ];then + mount -t tmpfs -o mode=755 rootfs $NEWROOT + else + mount -t tmpfs -o mode=755,size=$rootlimit rootfs $NEWROOT + fi - cd $NEWROOT - [ "$xcatdebugmode" > "0" ] && logger -t xcat -p debug "Extracting root filesystem:" - echo -n "Extracting root filesystem:" - if [ -r /rootimg.cpio.gz ]; then - if [ -x /bin/cpio ]; then - gzip -cd /rootimg.cpio.gz |/bin/cpio -idum - else - gzip -cd /rootimg.cpio.gz |cpio -idum + cd $NEWROOT + [ "$xcatdebugmode" > "0" ] && logger -t $log_label -p local4.debug "Extracting the root filesystem..." + echo "Extracting the root filesystem..." + if [ -r /rootimg.cpio.gz ]; then + if [ -x /bin/cpio ]; then + gzip -cd /rootimg.cpio.gz |/bin/cpio -idum + else + gzip -cd /rootimg.cpio.gz |cpio -idum + fi + elif [ -r /rootimg.cpio.xz ]; then + if [ -x /bin/cpio ]; then + xz -cd /rootimg.cpio.xz |/bin/cpio -idum + else + xz -cd /rootimg.cpio.xz |cpio -idum + fi fi - elif [ -r /rootimg.cpio.xz ]; then - if [ -x /bin/cpio ]; then - xz -cd /rootimg.cpio.xz |/bin/cpio -idum - else - xz -cd /rootimg.cpio.xz |cpio -idum - fi - fi - $NEWROOT/etc/init.d/localdisk - [ "$xcatdebugmode" > "0" ] && logger -t xcat -p debug "Done...." - echo Done + $NEWROOT/etc/init.d/localdisk + [ "$xcatdebugmode" > "0" ] && logger -t $log_label -p local4.debug "Done extracting the root filesystem..." + echo "Done extracting the root filesystem..." elif [ -r /rootimg.tar.gz ] || [ -r /rootimg.tar.xz ]; then - [ "$xcatdebugmode" > "0" ] && logger -t xcat -p debug "rootimg downloaded,setting up RAM-root tmpfs...." - echo Setting up RAM-root tmpfs. - if [ -z $rootlimit ];then - mount -t tmpfs -o mode=755 rootfs $NEWROOT - else - mount -t tmpfs -o mode=755,size=$rootlimit rootfs $NEWROOT - fi + [ "$xcatdebugmode" > "0" ] && logger -t $log_label -p local4.debug "Downloaded rootimg.tar.[gz/xz]...Setting up RAM-root tmpfs." + echo Setting up RAM-root tmpfs. + if [ -z $rootlimit ];then + mount -t tmpfs -o mode=755 rootfs $NEWROOT + else + mount -t tmpfs -o mode=755,size=$rootlimit rootfs $NEWROOT + fi - cd $NEWROOT - [ "$xcatdebugmode" > "0" ] && logger -t xcat -p debug "Extracting root filesystem:" - echo -n "Extracting root filesystem:" - if [ -r /rootimg.tar.gz ]; then - tar --selinux --xattrs-include='*' -zxf /rootimg.tar.gz - if [ $? -ne 0 ]; then - tar --selinux -zxf /rootimg.tar.gz + cd $NEWROOT + [ "$xcatdebugmode" > "0" ] && logger -t $log_label -p local4.debug "Extracting the root filesystem..." + echo "Extracting the root filesystem..." + if [ -r /rootimg.tar.gz ]; then + tar --selinux --xattrs-include='*' -zxf /rootimg.tar.gz + if [ $? -ne 0 ]; then + tar --selinux -zxf /rootimg.tar.gz + fi + elif [ -r /rootimg.tar.xz ]; then + tar --selinux --xattrs-include='*' -Jxf /rootimg.tar.xz + if [ $? -ne 0 ]; then + tar --selinux -Jxf /rootimg.tar.xz + fi fi - elif [ -r /rootimg.tar.xz ]; then - tar --selinux --xattrs-include='*' -Jxf /rootimg.tar.xz - if [ $? -ne 0 ]; then - tar --selinux -Jxf /rootimg.tar.xz - fi - fi - $NEWROOT/etc/init.d/localdisk - [ "$xcatdebugmode" > "0" ] && logger -t xcat -p debug "Done...." - echo Done + $NEWROOT/etc/init.d/localdisk + [ "$xcatdebugmode" > "0" ] && logger -t $log_label -p local4.debug "Done extracting the root filesystem." + echo "Done extracting the root filesystem." elif [ -r /rootimg-statelite.gz ]; then - echo Setting up RAM-root tmpfs for statelite mode. + [ "$xcatdebugmode" > "0" ] && logger -t $log_label -p local4.debug "Setting up RAM-root tmpfs for statelite mode." + echo Setting up RAM-root tmpfs for statelite mode. - if [ -z $rootlimit];then - mount -t tmpfs -o mode=755 rootfs $NEWROOT - else - mount -t tmpfs -o mode=755,size=$rootlimit rootfs $NEWROOT - fi - - cd $NEWROOT - echo -n "Extracting root filesystem:" - if [ -x /bin/cpio ]; then - gzip -cd /rootimg-statelite.gz |/bin/cpio -idum - else - gzip -cd /rootimg-statelite.gz |cpio -idum - fi - echo Done - # then, the statelite staffs will be processed - echo Setting up Statelite - modprobe nfs - MAXTRIES=7 - ITER=0 - if [ ! -e "$NEWROOT/$RWDIR" ]; then - echo "" - echo "The /$RWDIR directory doesn't exist in the rootimg... " - echo "" - /bin/sh - fi - - if [ ! -e "$NEWROOT/etc/init.d/statelite" ]; then - echo "" - echo "$NEWROOT/etc/init.d/statelite doesn't exist... " - echo "" - /bin/sh - fi - - mount -t tmpfs rw $NEWROOT/$RWDIR - mkdir -p $NEWROOT/$RWDIR/tmpfs - ME=`hostname -s` - if [ ! -z $NODE ]; then - ME=$NODE - fi - - - # mount the SNAPSHOT directory here for persistent use. - if [ ! -z $STATEMNT ]; then - SNAPSHOTSERVER=${STATEMNT%:*} - SNAPSHOTROOT=${STATEMNT#*/} - if [ -z $SNAPSHOTROOT ]; then - SNAPSHOTROOT=$SNAPSHOTSERVER - SNAPSHOTSERVER= + if [ -z $rootlimit];then + mount -t tmpfs -o mode=755 rootfs $NEWROOT + else + mount -t tmpfs -o mode=755,size=$rootlimit rootfs $NEWROOT fi - fi - if [ ! -z $SNAPSHOTSERVER ]; then - mkdir -p $NEWROOT/$RWDIR/persistent - MAXTRIES=5 + cd $NEWROOT + [ "$xcatdebugmode" > "0" ] && logger -t $log_label -p local4.debug "Extracting the root filesystem..." + echo "Extracting root filesystem..." + if [ -x /bin/cpio ]; then + gzip -cd /rootimg-statelite.gz |/bin/cpio -idum + else + gzip -cd /rootimg-statelite.gz |cpio -idum + fi + [ "$xcatdebugmode" > "0" ] && logger -t $log_label -p local4.debug "Done extracting the root filesystem." + echo "Done extracting the root filesystem." + # then, the statelite staffs will be processed + echo Setting up Statelite + modprobe nfs + MAXTRIES=7 ITER=0 - if [ -z $MNTOPTS ]; then - MNT_OPTIONS="nolock,rsize=32768,tcp,nfsvers=3,timeo=14" - else - MNT_OPTIONS=$MNTOPTS - fi - while ! mount $SNAPSHOTSERVER:/$SNAPSHOTROOT $NEWROOT/$RWDIR/persistent -o $MNT_OPTIONS; do - ITER=$(( ITER + 1 )) - if [ "$ITER" == "$MAXTRIES" ]; then - echo "You are dead, rpower $ME boot to play again." - echo "Possible problems: + if [ ! -e "$NEWROOT/$RWDIR" ]; then + echo "" + echo "The /$RWDIR directory doesn't exist in the rootimg... " + echo "" + /bin/sh + fi + + if [ ! -e "$NEWROOT/etc/init.d/statelite" ]; then + echo "" + echo "$NEWROOT/etc/init.d/statelite doesn't exist... " + echo "" + /bin/sh + fi + + mount -t tmpfs rw $NEWROOT/$RWDIR + mkdir -p $NEWROOT/$RWDIR/tmpfs + ME=`hostname -s` + if [ ! -z $NODE ]; then + ME=$NODE + fi + + + # mount the SNAPSHOT directory here for persistent use. + if [ ! -z $STATEMNT ]; then + SNAPSHOTSERVER=${STATEMNT%:*} + SNAPSHOTROOT=${STATEMNT#*/} + if [ -z $SNAPSHOTROOT ]; then + SNAPSHOTROOT=$SNAPSHOTSERVER + SNAPSHOTSERVER= + fi + fi + + if [ ! -z $SNAPSHOTSERVER ]; then + mkdir -p $NEWROOT/$RWDIR/persistent + MAXTRIES=5 + ITER=0 + if [ -z $MNTOPTS ]; then + MNT_OPTIONS="nolock,rsize=32768,tcp,nfsvers=3,timeo=14" + else + MNT_OPTIONS=$MNTOPTS + fi + while ! mount $SNAPSHOTSERVER:/$SNAPSHOTROOT $NEWROOT/$RWDIR/persistent -o $MNT_OPTIONS; do + ITER=$(( ITER + 1 )) + if [ "$ITER" == "$MAXTRIES" ]; then + echo "You are dead, rpower $ME boot to play again." + echo "Possible problems: 1. $SNAPSHOTSERVER is not exporting $SNAPSHOTROOT ? 2. Is DNS set up? Maybe that's why I can't mount $SNAPSHOTSERVER." - /bin/sh - exit - fi - RS=$(( $RANDOM % 20 )) - echo "Trying again in $RS seconds ..." - sleep $RS - done + /bin/sh + exit + fi + RS=$(( $RANDOM % 20 )) + echo "Trying again in $RS seconds ..." + sleep $RS + done + + # create directory which is named after my node name + mkdir -p $NEWROOT/$RWDIR/persistent/$ME + ITER=0 + # umount current persistent mount + while ! umount -l $NEWROOT/$RWDIR/persistent; do + ITER=$(( ITER + 1 )) + if [ "$ITER" == "$MAXTRIES" ]; then + echo "Your are dead, rpower $ME boot to play again." + echo "Cannot umount $NEWROOT/$RWDIR/persistent." + /bin/sh + exit + fi + RS=$(( $RANDOM % 20 )) + echo "Trying again in $RS seconds..." + sleep $RS + done - # create directory which is named after my node name - mkdir -p $NEWROOT/$RWDIR/persistent/$ME - ITER=0 - # umount current persistent mount - while ! umount -l $NEWROOT/$RWDIR/persistent; do - ITER=$(( ITER + 1 )) - if [ "$ITER" == "$MAXTRIES" ]; then - echo "Your are dead, rpower $ME boot to play again." - echo "Cannot umount $NEWROOT/$RWDIR/persistent." - /bin/sh - exit - fi - RS=$(( $RANDOM % 20 )) - echo "Trying again in $RS seconds..." - sleep $RS - done + # mount persistent to server:/rootpath/nodename + ITER=0 + while ! mount $SNAPSHOTSERVER:/$SNAPSHOTROOT/$ME $NEWROOT/$RWDIR/persistent -o $MNT_OPTIONS; do + ITER=$(( ITER + 1 )) + if [ "$ITER" == "$MAXTRIES" ]; then + echo "Your are dead, rpower $ME boot to play again." + echo "Possible problems: cannot mount to $SNAPSHOTSERVER:/$SNAPSHOTROOT/$ME." + /bin/sh + exit + fi + RS=$(( $RANDOM % 20 )) + echo "Trying again in $RS seconds..." + sleep $RS + done + fi - # mount persistent to server:/rootpath/nodename - ITER=0 - while ! mount $SNAPSHOTSERVER:/$SNAPSHOTROOT/$ME $NEWROOT/$RWDIR/persistent -o $MNT_OPTIONS; do - ITER=$(( ITER + 1 )) - if [ "$ITER" == "$MAXTRIES" ]; then - echo "Your are dead, rpower $ME boot to play again." - echo "Possible problems: cannot mount to $SNAPSHOTSERVER:/$SNAPSHOTROOT/$ME." - /bin/sh - exit - fi - RS=$(( $RANDOM % 20 )) - echo "Trying again in $RS seconds..." - sleep $RS - done - fi + $NEWROOT/etc/init.d/localdisk + $NEWROOT/etc/init.d/statelite + fastboot=yes + export fastboot + keep_old_ip=yes + export keep_old_ip - $NEWROOT/etc/init.d/localdisk - $NEWROOT/etc/init.d/statelite - fastboot=yes - export fastboot - keep_old_ip=yes - export keep_old_ip - - mount -n --bind /dev $NEWROOT/dev - mount -n --bind /proc $NEWROOT/proc - mount -n --bind /sys $NEWROOT/sys + mount -n --bind /dev $NEWROOT/dev + mount -n --bind /proc $NEWROOT/proc + mount -n --bind /sys $NEWROOT/sys else - [ "$xcatdebugmode" > "0" ] && logger -t xcat -p debug "Failed to download image, panicing in 5..." - echo -n Failed to download image, panicing in 5... - for i in 4 3 2 1 0; do - /bin/sleep 1 - [ "$xcatdebugmode" > "0" ] && logger -t xcat -p debug "$i..." - echo -n $i... - done - [ "$xcatdebugmode" > "0" ] && logger -t xcat -p debug "You're dead. rpower nodename reset to play again." - [ "$xcatdebugmode" > "0" ] && logger -t xcat -p debug "* Did you packimage with -m cpio, -m squashfs, or -m nfs?" - [ "$xcatdebugmode" > "0" ] && logger -t xcat -p debug "* If using -m squashfs did you include aufs.ko with geninitrd? e.g.: -n tg3,squashfs,aufs,loop" - [ "$xcatdebugmode" > "0" ] && logger -t xcat -p debug "If using -m nfs did you export NFS and sync rootimg? And did you include the aufs and nfs modules in the proper order: e.g.: -n tg3,aufs,loop,sunrpc,lockd,nfs_acl,nfs" + [ "$xcatdebugmode" > "0" ] && logger -t $log_label -p local4.debug "Failed to download image, panic in 5..." + echo -n Failed to download image, panic in 5... + for i in 4 3 2 1 0; do + /bin/sleep 1 + [ "$xcatdebugmode" > "0" ] && logger -t $log_label -p local4.debug "$i..." + echo -n $i... + done + [ "$xcatdebugmode" > "0" ] && logger -t $log_label -p local4.debug "You're dead. rpower nodename reset to play again." + [ "$xcatdebugmode" > "0" ] && logger -t $log_label -p local4.debug "* Did you packimage with -m cpio, -m squashfs, or -m nfs?" + [ "$xcatdebugmode" > "0" ] && logger -t $log_label -p local4.debug "* If using -m squashfs did you include aufs.ko with geninitrd? e.g.: -n tg3,squashfs,aufs,loop" + [ "$xcatdebugmode" > "0" ] && logger -t $log_label -p local4.debug "If using -m nfs did you export NFS and sync rootimg? And did you include the aufs and nfs modules in the proper order: e.g.: -n tg3,aufs,loop,sunrpc,lockd,nfs_acl,nfs" - echo - echo "You're dead. rpower nodename reset to play again. + echo + echo "You're dead. rpower nodename reset to play again. * Did you packimage with -m cpio, -m squashfs, or -m nfs? * If using -m squashfs did you include aufs.ko with geninitrd? @@ -268,8 +272,8 @@ else e.g.: -n tg3,aufs,loop,sunrpc,lockd,nfs_acl,nfs " - /bin/sh - exit + /bin/sh + exit fi cd / @@ -293,52 +297,52 @@ function getdevfrommac() { if [ -z $STATEMNT ]; then - for lf in /tmp/dhclient.*.lease; do - netif=${lf#*.} - netif=${netif%.*} - cp $lf "$NEWROOT/var/lib/dhclient/dhclient-$netif.leases" - [ "$xcatdebugmode" > "0" ] && logger -t xcat -p debug "saving $NEWROOT/var/lib/dhclient/dhclient-$netif.leases" - done + for lf in /tmp/dhclient.*.lease; do + netif=${lf#*.} + netif=${netif%.*} + cp $lf "$NEWROOT/var/lib/dhclient/dhclient-$netif.leases" + [ "$xcatdebugmode" > "0" ] && logger -t $log_label -p local4.debug "Saving $NEWROOT/var/lib/dhclient/dhclient-$netif.leases" + done - ifname="$(getarg ifname=)" - netdev="$(getarg netdev=)" - BOOTIF="$(getarg BOOTIF=)" - if [ ! -z "$ifname" ]; then - MACX=${ifname#*:} - ETHX=${ifname%:$MACX*} - elif [ ! -z "$netdev" ]; then - ETHX=$netdev - MACX=`ip link show $netdev | grep ether | awk '{print $2}'` - elif [ ! -z "$BOOTIF" ]; then - MACX=$BOOTIF - MACX=${MACX#01-} - MACX=${MACX//-/:} - ETHX=$(getdevfrommac $MACX) - fi - - - if [ ! -z "$MACX" ] && [ ! -z "$ETHX" ]; then - if [ ! -e $NEWROOT/etc/sysconfig/network-scripts/ifcfg-$ETHX ]; then - [ "$xcatdebugmode" > "0" ] && logger -t xcat -p debug "creating $NEWROOT/etc/sysconfig/network-scripts/ifcfg-$ETHX" - touch $NEWROOT/etc/sysconfig/network-scripts/ifcfg-$ETHX + ifname="$(getarg ifname=)" + netdev="$(getarg netdev=)" + BOOTIF="$(getarg BOOTIF=)" + if [ ! -z "$ifname" ]; then + MACX=${ifname#*:} + ETHX=${ifname%:$MACX*} + elif [ ! -z "$netdev" ]; then + ETHX=$netdev + MACX=`ip link show $netdev | grep ether | awk '{print $2}'` + elif [ ! -z "$BOOTIF" ]; then + MACX=$BOOTIF + MACX=${MACX#01-} + MACX=${MACX//-/:} + ETHX=$(getdevfrommac $MACX) + fi + + + if [ ! -z "$MACX" ] && [ ! -z "$ETHX" ]; then + if [ ! -e $NEWROOT/etc/sysconfig/network-scripts/ifcfg-$ETHX ]; then + [ "$xcatdebugmode" > "0" ] && logger -t $log_label -p local4.debug "Creating $NEWROOT/etc/sysconfig/network-scripts/ifcfg-$ETHX" + touch $NEWROOT/etc/sysconfig/network-scripts/ifcfg-$ETHX + fi + [ "$xcatdebugmode" > "0" ] && logger -t $log_label -p local4.debug "Writing $NEWROOT/etc/sysconfig/network-scripts/ifcfg-$ETHX: DEVICE=$ETHX;BOOTPROTO=dhcp;HWADDR=$MACX;ONBOOT=yes" + echo "DEVICE=$ETHX" > $NEWROOT/etc/sysconfig/network-scripts/ifcfg-$ETHX + echo "BOOTPROTO=dhcp" >> $NEWROOT/etc/sysconfig/network-scripts/ifcfg-$ETHX + echo "HWADDR=$MACX" >> $NEWROOT/etc/sysconfig/network-scripts/ifcfg-$ETHX + echo "ONBOOT=yes" >> $NEWROOT/etc/sysconfig/network-scripts/ifcfg-$ETHX fi - [ "$xcatdebugmode" > "0" ] && logger -t xcat -p debug "writing $NEWROOT/etc/sysconfig/network-scripts/ifcfg-$ETHX: DEVICE=$ETHX;BOOTPROTO=dhcp;HWADDR=$MACX;ONBOOT=yes" - echo "DEVICE=$ETHX" > $NEWROOT/etc/sysconfig/network-scripts/ifcfg-$ETHX - echo "BOOTPROTO=dhcp" >> $NEWROOT/etc/sysconfig/network-scripts/ifcfg-$ETHX - echo "HWADDR=$MACX" >> $NEWROOT/etc/sysconfig/network-scripts/ifcfg-$ETHX - echo "ONBOOT=yes" >> $NEWROOT/etc/sysconfig/network-scripts/ifcfg-$ETHX - fi fi -[ "$xcatdebugmode" > "0" ] && logger -t xcat -p debug "saving $NEWROOT/etc/resolv.conf" +[ "$xcatdebugmode" > "0" ] && logger -t $log_label -p local4.debug "Saving $NEWROOT/etc/resolv.conf" cp /etc/resolv.conf "$NEWROOT/etc/" if [ -d "$NEWROOT/etc/sysconfig" -a ! -e "$NEWROOT/etc/sysconfig/selinux" ]; then - [ "$xcatdebugmode" > "0" ] && logger -t xcat -p debug "disable selinux ..." - echo "SELINUX=disabled" >> "$NEWROOT/etc/sysconfig/selinux" + [ "$xcatdebugmode" > "0" ] && logger -t $log_label -p local4.debug "disable selinux ..." + echo "SELINUX=disabled" >> "$NEWROOT/etc/sysconfig/selinux" fi -[ "$xcatdebugmode" > "0" ] && logger -t xcat -p debug "exiting xcatroot..." +[ "$xcatdebugmode" > "0" ] && logger -t $log_label -p local4.debug "exiting xcatroot..." # inject new exit_if_exists echo 'settle_exit_if_exists="--exit-if-exists=/dev/root"; rm "$job"' > $hookdir/initqueue/xcat.sh # force udevsettle to break diff --git a/xCAT-server/share/xcat/netboot/sles/genimage b/xCAT-server/share/xcat/netboot/sles/genimage index c8edb667d..0092945e9 100755 --- a/xCAT-server/share/xcat/netboot/sles/genimage +++ b/xCAT-server/share/xcat/netboot/sles/genimage @@ -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 <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"; } diff --git a/xCAT-server/share/xcat/scripts/configMellanox b/xCAT-server/share/xcat/scripts/configMellanox index f0a771488..2e6f1db34 100755 --- a/xCAT-server/share/xcat/scripts/configMellanox +++ b/xCAT-server/share/xcat/scripts/configMellanox @@ -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"; } diff --git a/xCAT-server/share/xcat/scripts/configcumulus b/xCAT-server/share/xcat/scripts/configonie similarity index 91% rename from xCAT-server/share/xcat/scripts/configcumulus rename to xCAT-server/share/xcat/scripts/configonie index 7a6cbb55d..aaa1b175a 100755 --- a/xCAT-server/share/xcat/scripts/configcumulus +++ b/xCAT-server/share/xcat/scripts/configonie @@ -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"); @@ -217,7 +217,7 @@ sub cumulus_exec { sub install_license { my @config_switches; print "install_license\n"; - my $license_file; + my $license_file = "/root/license.txt"; my $file_name = "/root/license.txt"; if ($::LICENSE) { @@ -226,7 +226,8 @@ sub install_license { print "file = $license_file\n"; if (!(-e $license_file) ) { - print "$license_file is not exist\n"; + print "license file $license_file does 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] + configonie -h│--help + configonie --switches switchnames --ssh + configonie --switches switchnames --license filename + configonie --switches switchnames --snmp [--user snmp_user] [--password snmp_password] [--group snmp_group] + configonie --switches switchnames --ntp + + To set ssh, install license(license file: /root/license.txt), config snmp and ntp: + configonie --switches switchnames --all \n"; } diff --git a/xCAT-server/share/xcat/tools/go-xcat b/xCAT-server/share/xcat/tools/go-xcat index efa921180..5acda794c 100755 --- a/xCAT-server/share/xcat/tools/go-xcat +++ b/xCAT-server/share/xcat/tools/go-xcat @@ -2,7 +2,7 @@ # # go-xcat - Install xCAT automatically. # -# Version 1.0.12 +# Version 1.0.13 # # Copyright (C) 2016 International Business Machines # Eclipse Public License, Version 1.0 (EPL-1.0) @@ -606,14 +606,20 @@ function get_package_list_apt() [[ -d /var/lib/apt/lists ]] || return 255 local repo_id="$1" [[ -z "${repo_id}" ]] && return 1 + local -i rc=0 awk '/^Package: / { print $2 }' \ "/var/lib/apt/lists/"*"_${repo_id}_dists"*"_main_binary-"*"_Packages" \ 2>/dev/null # This is a dirty hack, and use recursion. # For the `devel' branch of the online repo for apt, it has the # subdirectory name of `core-snap' instead of `xcat-core'. - [[ "$?" -ne "0" && "${repo_id}" = "xcat-core" ]] && + rc="$?" + if [[ "${rc}" -ne "0" && "${repo_id}" = "xcat-core" ]] + then "${FUNCNAME}" "core-snap" + rc="$?" + fi + return "${rc}" } # $1 repo id diff --git a/xCAT-server/xCAT-server.spec b/xCAT-server/xCAT-server.spec index a3670db9d..f4fb5acb9 100644 --- a/xCAT-server/xCAT-server.spec +++ b/xCAT-server/xCAT-server.spec @@ -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 diff --git a/xCAT-test/autotest/bundle/rhels6.7_x86_64.bundle b/xCAT-test/autotest/bundle/rhels6.7_x86_64.bundle index 49377b612..a7b7767d1 100644 --- a/xCAT-test/autotest/bundle/rhels6.7_x86_64.bundle +++ b/xCAT-test/autotest/bundle/rhels6.7_x86_64.bundle @@ -1,3 +1,4 @@ +setup_vm reg_linux_diskfull_installation_flat makehosts_h makehosts_help diff --git a/xCAT-test/autotest/bundle/rhels6.8_ppc64.bundle b/xCAT-test/autotest/bundle/rhels6.8_ppc64.bundle index a3693a1f2..3d27a17b1 100644 --- a/xCAT-test/autotest/bundle/rhels6.8_ppc64.bundle +++ b/xCAT-test/autotest/bundle/rhels6.8_ppc64.bundle @@ -265,6 +265,15 @@ xdsh_t xdsh_q xdsh_T xdsh_o +psh_h +psh_v +psh_node_cmd_linux +psh_l +psh_i +prsync_h +prsync_v +prsync_dir_node +prsync_file_node switchdiscover_range_default switchdiscover_h switchdiscover_range_s diff --git a/xCAT-test/autotest/bundle/rhels6.8_x86_64.bundle b/xCAT-test/autotest/bundle/rhels6.8_x86_64.bundle index 15676669e..96f9b67e8 100644 --- a/xCAT-test/autotest/bundle/rhels6.8_x86_64.bundle +++ b/xCAT-test/autotest/bundle/rhels6.8_x86_64.bundle @@ -1,3 +1,4 @@ +setup_vm reg_linux_diskfull_installation_flat go_xcat_local_repo_case7 go_xcat_noinput @@ -191,6 +192,15 @@ xdsh_t xdsh_q xdsh_T xdsh_o +psh_h +psh_v +psh_node_cmd_linux +psh_l +psh_i +prsync_h +prsync_v +prsync_dir_node +prsync_file_node switchdiscover_range_default switchdiscover_h switchdiscover_range_s diff --git a/xCAT-test/autotest/bundle/rhels7.2_ppc64.bundle b/xCAT-test/autotest/bundle/rhels7.2_ppc64.bundle index a3693a1f2..3d27a17b1 100644 --- a/xCAT-test/autotest/bundle/rhels7.2_ppc64.bundle +++ b/xCAT-test/autotest/bundle/rhels7.2_ppc64.bundle @@ -265,6 +265,15 @@ xdsh_t xdsh_q xdsh_T xdsh_o +psh_h +psh_v +psh_node_cmd_linux +psh_l +psh_i +prsync_h +prsync_v +prsync_dir_node +prsync_file_node switchdiscover_range_default switchdiscover_h switchdiscover_range_s diff --git a/xCAT-test/autotest/bundle/rhels7.2_ppc64le.bundle b/xCAT-test/autotest/bundle/rhels7.2_ppc64le.bundle index bfbec794d..72e0bfe20 100644 --- a/xCAT-test/autotest/bundle/rhels7.2_ppc64le.bundle +++ b/xCAT-test/autotest/bundle/rhels7.2_ppc64le.bundle @@ -1,3 +1,4 @@ +setup_vm Diskless_installation_flat_p8_le Full_installation_flat_p8_le go_xcat_local_repo_case7 @@ -193,6 +194,15 @@ xdsh_t xdsh_q xdsh_T xdsh_o +psh_h +psh_v +psh_node_cmd_linux +psh_l +psh_i +prsync_h +prsync_v +prsync_dir_node +prsync_file_node switchdiscover_range_default switchdiscover_h switchdiscover_range_s diff --git a/xCAT-test/autotest/bundle/rhels7.2_x86_64.bundle b/xCAT-test/autotest/bundle/rhels7.2_x86_64.bundle index e5ff83cf1..1457aa03f 100644 --- a/xCAT-test/autotest/bundle/rhels7.2_x86_64.bundle +++ b/xCAT-test/autotest/bundle/rhels7.2_x86_64.bundle @@ -1,3 +1,4 @@ +setup_vm reg_linux_diskfull_installation_flat go_xcat_local_repo_case7 go_xcat_noinput @@ -191,6 +192,15 @@ xdsh_t xdsh_q xdsh_T xdsh_o +psh_h +psh_v +psh_node_cmd_linux +psh_l +psh_i +prsync_h +prsync_v +prsync_dir_node +prsync_file_node switchdiscover_range_default switchdiscover_h switchdiscover_range_s diff --git a/xCAT-test/autotest/bundle/rhels7.3_ppc64.bundle b/xCAT-test/autotest/bundle/rhels7.3_ppc64.bundle index a3693a1f2..3d27a17b1 100644 --- a/xCAT-test/autotest/bundle/rhels7.3_ppc64.bundle +++ b/xCAT-test/autotest/bundle/rhels7.3_ppc64.bundle @@ -265,6 +265,15 @@ xdsh_t xdsh_q xdsh_T xdsh_o +psh_h +psh_v +psh_node_cmd_linux +psh_l +psh_i +prsync_h +prsync_v +prsync_dir_node +prsync_file_node switchdiscover_range_default switchdiscover_h switchdiscover_range_s diff --git a/xCAT-test/autotest/bundle/rhels7.3_ppc64le.bundle b/xCAT-test/autotest/bundle/rhels7.3_ppc64le.bundle index 27578b5ea..1b3103b19 100644 --- a/xCAT-test/autotest/bundle/rhels7.3_ppc64le.bundle +++ b/xCAT-test/autotest/bundle/rhels7.3_ppc64le.bundle @@ -1,3 +1,4 @@ +setup_vm Diskless_installation_flat_p8_le Full_installation_flat_p8_le go_xcat_local_repo_case7 @@ -193,6 +194,15 @@ xdsh_t xdsh_q xdsh_T xdsh_o +psh_h +psh_v +psh_node_cmd_linux +psh_l +psh_i +prsync_h +prsync_v +prsync_dir_node +prsync_file_node switchdiscover_range_default switchdiscover_h switchdiscover_range_s diff --git a/xCAT-test/autotest/bundle/rhels7.3_x86_64.bundle b/xCAT-test/autotest/bundle/rhels7.3_x86_64.bundle index f858555ad..497756717 100644 --- a/xCAT-test/autotest/bundle/rhels7.3_x86_64.bundle +++ b/xCAT-test/autotest/bundle/rhels7.3_x86_64.bundle @@ -1,3 +1,4 @@ +setup_vm reg_linux_diskfull_installation_flat go_xcat_local_repo_case7 go_xcat_noinput @@ -197,6 +198,15 @@ xdsh_t xdsh_q xdsh_T xdsh_o +psh_h +psh_v +psh_node_cmd_linux +psh_l +psh_i +prsync_h +prsync_v +prsync_dir_node +prsync_file_node switchdiscover_range_default switchdiscover_h switchdiscover_range_s diff --git a/xCAT-test/autotest/bundle/sles11.4_ppc64.bundle b/xCAT-test/autotest/bundle/sles11.4_ppc64.bundle index 6084ed160..66b390c1d 100644 --- a/xCAT-test/autotest/bundle/sles11.4_ppc64.bundle +++ b/xCAT-test/autotest/bundle/sles11.4_ppc64.bundle @@ -247,6 +247,15 @@ xdsh_t xdsh_q xdsh_T xdsh_o +psh_h +psh_v +psh_node_cmd_linux +psh_l +psh_i +prsync_h +prsync_v +prsync_dir_node +prsync_file_node switchdiscover_range_default switchdiscover_h switchdiscover_range_s diff --git a/xCAT-test/autotest/bundle/sles11.4_x86_64.bundle b/xCAT-test/autotest/bundle/sles11.4_x86_64.bundle index c4dbf5754..620a1d9a4 100644 --- a/xCAT-test/autotest/bundle/sles11.4_x86_64.bundle +++ b/xCAT-test/autotest/bundle/sles11.4_x86_64.bundle @@ -1,3 +1,4 @@ +setup_vm reg_linux_diskfull_installation_flat go_xcat_local_repo_case7 go_xcat_noinput @@ -195,6 +196,15 @@ xdsh_t xdsh_q xdsh_T xdsh_o +psh_h +psh_v +psh_node_cmd_linux +psh_l +psh_i +prsync_h +prsync_v +prsync_dir_node +prsync_file_node switchdiscover_range_default switchdiscover_h switchdiscover_range_s diff --git a/xCAT-test/autotest/bundle/sles12.1_ppc64le.bundle b/xCAT-test/autotest/bundle/sles12.1_ppc64le.bundle index 469a3527c..65ff91ea2 100644 --- a/xCAT-test/autotest/bundle/sles12.1_ppc64le.bundle +++ b/xCAT-test/autotest/bundle/sles12.1_ppc64le.bundle @@ -1,3 +1,4 @@ +setup_vm Diskless_installation_flat_p8_le Full_installation_flat_p8_le go_xcat_local_repo_case7 @@ -199,6 +200,15 @@ xdsh_t xdsh_q xdsh_T xdsh_o +psh_h +psh_v +psh_node_cmd_linux +psh_l +psh_i +prsync_h +prsync_v +prsync_dir_node +prsync_file_node switchdiscover_range_default switchdiscover_h switchdiscover_range_s diff --git a/xCAT-test/autotest/bundle/sles12.1_x86_64.bundle b/xCAT-test/autotest/bundle/sles12.1_x86_64.bundle index 225f6cdad..4003012a6 100644 --- a/xCAT-test/autotest/bundle/sles12.1_x86_64.bundle +++ b/xCAT-test/autotest/bundle/sles12.1_x86_64.bundle @@ -1,3 +1,4 @@ +setup_vm reg_linux_diskfull_installation_flat go_xcat_local_repo_case7 go_xcat_noinput @@ -195,6 +196,15 @@ xdsh_t xdsh_q xdsh_T xdsh_o +psh_h +psh_v +psh_node_cmd_linux +psh_l +psh_i +prsync_h +prsync_v +prsync_dir_node +prsync_file_node switchdiscover_range_default switchdiscover_h switchdiscover_range_s diff --git a/xCAT-test/autotest/bundle/sles12.2_ppc64le.bundle b/xCAT-test/autotest/bundle/sles12.2_ppc64le.bundle new file mode 100644 index 000000000..65ff91ea2 --- /dev/null +++ b/xCAT-test/autotest/bundle/sles12.2_ppc64le.bundle @@ -0,0 +1,238 @@ +setup_vm +Diskless_installation_flat_p8_le +Full_installation_flat_p8_le +go_xcat_local_repo_case7 +go_xcat_noinput +go_xcat_with_x +go_xcat_with_xcat-version-1 +go_xcat_online_repo_case6 +makehosts_h +makehosts_help +makehosts_n +makehosts_n_noderange +chdef_null +chdef_z +chdef_t_o_error +chtab_null +chtab_d +chtab_modify_node +chtab_modify_key +chtab_err_symble +chtab_err_table +chtab_h +chtab_v +packimage_o_p_a_m +packimage_imagename +packimage_h +packimage_v +packimage_m_cpio_c_gzip +packimage_m_cpio_c_pigz +packimage_m_cpio_c_xz +packimage_m_tar_c_pigz +packimage_m_tar_c_gzip +packimage_m_tar_c_xz +packimage_m_invalid_archive_method +packimage_m_invalid_compress_method +pping_h +pping_v +pping_node +gettab_key_table +gettab_H +gettab_err +gettab_h +lsdef_null +lsdef_a +lsdef_t_o_l +lsdef_t_o_l_z +lsdef_t +lsdef_t_i_o +lsdef_t_w +lsdef_t_err +makeconservercf_null +makeconservercf_noderange +makeconservercf_d +makedhcp_n +makedhcp_a +makedhcp_a_d +makedhcp_d +mkdef_null +mkdef_z +mkdef_t_o_error +nodeadd_noderange +nodeadd_err_symbol +nodeadd_null +nodeadd_noderange_nodetype +nodeadd_v +nodeadd_h +nodegrpch_v +nodegrpch_h +nodegrpch_groups +nodegrpch_err +nodech_noderange_table +nodech_noderange_table_comma +nodech_noderange_table_arrow +nodech_noderanage_table_at +nodech_delete +nodech_error_node +nodech_error_table +nodech_h +nodech_v +nodech_noderange_table_include +nodech_noderange_table_uninclude +nodech_noderange_table_equal +nodech_noderange_table_unequal +nodech_noderange_shortname_groups +nodech_noderange_shortname_tags +nodech_noderange_shortname_mgt +nodels_null +nodels_H +nodels_noderange +nodels_err_symbol +nodels_err_noderange +nodels_noderange_shortname_groups +nodels_noderange_shortname_tags +nodels_noderange_shortname_mgt +nodels_table_include +nodels_noderange_table_uninclude +nodels_noderange_table_equal +nodels_noderange_table_unequal +nodels_b +nodels_S +nodels_noderange_table +nodels_tablevalue +nodels_tablevalue_tablecolumn +nodels_noderange_tablecolumn +nodels_h +nodels_v +xcatstanzafile_colon +xcatstanzafile_attribute +xcatstanzafile_objtype +xcatstanzafile_tab +xcatstanzafile_multattr +xcatstanzafile_defaultvalue +xcatstanzafile_specificvalue +noderm_noderange +noderm_h +noderm_null +noderm_err_node +nodeset_stat +nodeset_noderange +nodestat_err_node +rinv_noderange_err +rmdef_null +rmdef_t_err +rpower_err_noderange +rvitals_noderange_err +tabdump_table +tabdump_d +tabdump_v +tabdump_h +tabdump_help +tabdump_w_match +tabdump_w_equal +tabdump_w_ne +tabdump_w_notmatch +tabdump_w_gt +tabdump_w_ge +tabdump_w_lt +tabdump_w_le +tabdump_f_d +tabdump_d_nodehm +tabprune_h +tabprune_v +tabprune_a_eventlog +tabprune_V_a_eventlog +tabprune_i_auditlog +tabprune_V_n_auditlog +tabgrep_node +tabgrep_null +tabgrep_h +tabgrep_err +tabrestore_table +tabrestore_null +tabrestore_h +tabrestore_err +dumpxCATdb_h +dumpxCATdb_v +dumpxCATdb_p_nullskiptables +dumpxCATdb_a_p_nullskiptables +dumpxCATdb_p_skiptables +dumpxCATdb_a_p_skiptables +dumpxCATdb_p_nullskiptables_V +dumpxCATdb_a_p_nullskiptables_V +dumpxCATdb_p_V +restorexCAT_h +restorexCATdb_v +restorexCATdb_p_V +restorexCATdb_a_p_V +restorexCATdb_wrongpath +regnotif_null +regnotif_o +regnotif_err +regnotif_h +regnotif_v +unregnotif_null +unregnotif_f +unregnotif_h +unregnotif_v +lsxcatd_null +lsxcatd_h +lsxcatd_d +lsxcatd_a +makedns_d_node +makedns_n +makedns +copycds_iso +copycds_n +copycds_a +copycds_n_a +copycds_a_err +copycds_n_err +xdsh_h +xdsh_V +xdsh_regular_command +xdsh_Q_command +xdsh_c_cn +xdsh_e_filename +xdsh_E +xdsh_i_linux +xdsh_t +xdsh_q +xdsh_T +xdsh_o +psh_h +psh_v +psh_node_cmd_linux +psh_l +psh_i +prsync_h +prsync_v +prsync_dir_node +prsync_file_node +switchdiscover_range_default +switchdiscover_h +switchdiscover_range_s +switchdiscover_range_default_w +switchdiscover_range_r +switchdiscover_range_x +switchdiscover_range_z +switchdiscover_range_z_V +nodeset_shell +nodeset_cmdline +nodeset_runimg +xcatd_start_systemd +xcatd_stop_systemd +xcatd_restart_systemd +run_command_with_XCATBYPASS_systemd +disable_root_permission_in_policy_table_systemd +assign_certain_command_permission_systemd +xcatconfig_u_check_xcatsslversion_rhels_sles +sles_migration1 +sles_migration2 +reg_linux_statelite_installation_flat +SN_setup_case +reg_linux_diskfull_installation_hierarchy +reg_linux_diskless_installation_hierarchy +reg_linux_statelite_installation_hierarchy_by_ramdisk +reg_linux_statelite_installation_hierarchy_by_nfs +clean_up_env diff --git a/xCAT-test/autotest/bundle/sles12.2_x86_64.bundle b/xCAT-test/autotest/bundle/sles12.2_x86_64.bundle new file mode 100644 index 000000000..4003012a6 --- /dev/null +++ b/xCAT-test/autotest/bundle/sles12.2_x86_64.bundle @@ -0,0 +1,244 @@ +setup_vm +reg_linux_diskfull_installation_flat +go_xcat_local_repo_case7 +go_xcat_noinput +go_xcat_with_x +go_xcat_with_xcat-version-1 +go_xcat_online_repo_case6 +makehosts_h +makehosts_help +makehosts_n +makehosts_n_noderange +chdef_null +chdef_z +chdef_t_o_error +chtab_null +chtab_d +chtab_modify_node +chtab_modify_key +chtab_err_symble +chtab_err_table +chtab_h +chtab_v +packimage_o_p_a_m +packimage_imagename +packimage_h +packimage_v +pping_h +pping_v +pping_node +gettab_key_table +gettab_H +gettab_err +gettab_h +lsdef_null +lsdef_a +lsdef_t_o_l +lsdef_t_o_l_z +lsdef_t +lsdef_t_i_o +lsdef_t_w +lsdef_t_err +lslite_i +lslite_noderange +lslite_h +makeconservercf_null +makeconservercf_noderange +makeconservercf_d +makedhcp_n +makedhcp_a +makedhcp_a_d +makedhcp_d +mkdef_null +mkdef_z +mkdef_t_o_error +nodeadd_noderange +nodeadd_err_symbol +nodeadd_null +nodeadd_noderange_nodetype +nodeadd_v +nodeadd_h +nodegrpch_v +nodegrpch_h +nodegrpch_groups +nodegrpch_err +nodech_noderange_table +nodech_noderange_table_comma +nodech_noderange_table_arrow +nodech_noderanage_table_at +nodech_delete +nodech_error_node +nodech_error_table +nodech_h +nodech_v +nodech_noderange_table_include +nodech_noderange_table_uninclude +nodech_noderange_table_equal +nodech_noderange_table_unequal +nodech_noderange_shortname_groups +nodech_noderange_shortname_tags +nodech_noderange_shortname_mgt +nodels_null +nodels_H +nodels_noderange +nodels_err_symbol +nodels_err_noderange +nodels_noderange_shortname_groups +nodels_noderange_shortname_tags +nodels_noderange_shortname_mgt +nodels_table_include +nodels_noderange_table_uninclude +nodels_noderange_table_equal +nodels_noderange_table_unequal +nodels_b +nodels_S +nodels_noderange_table +nodels_tablevalue +nodels_tablevalue_tablecolumn +nodels_noderange_tablecolumn +nodels_h +nodels_v +xcatstanzafile_normal +xcatstanzafile_colon +xcatstanzafile_attribute +xcatstanzafile_objtype +xcatstanzafile_tab +xcatstanzafile_multattr +xcatstanzafile_defaultvalue +xcatstanzafile_specificvalue +noderm_noderange +noderm_h +noderm_null +noderm_err_node +nodeset_stat +nodeset_noderange +nodestat_noderange +nodestat_err_node +rinv_noderange_err +rmdef_null +rmdef_t_err +rpower_err_noderange +rvitals_noderange_err +tabdump_table +tabdump_d +tabdump_v +tabdump_h +tabdump_help +tabdump_w_match +tabdump_w_equal +tabdump_w_ne +tabdump_w_notmatch +tabdump_w_gt +tabdump_w_ge +tabdump_w_lt +tabdump_w_le +tabdump_f_d +tabdump_d_nodehm +tabprune_h +tabprune_v +tabprune_a_eventlog +tabprune_V_a_eventlog +tabprune_i_auditlog +tabprune_V_n_auditlog +tabgrep_node +tabgrep_null +tabgrep_h +tabgrep_err +tabrestore_table +tabrestore_null +tabrestore_h +tabrestore_err +dumpxCATdb_h +dumpxCATdb_v +dumpxCATdb_p_nullskiptables +dumpxCATdb_a_p_nullskiptables +dumpxCATdb_p_skiptables +dumpxCATdb_a_p_skiptables +dumpxCATdb_p_nullskiptables_V +dumpxCATdb_a_p_nullskiptables_V +dumpxCATdb_p_V +restorexCAT_h +restorexCATdb_v +restorexCATdb_p_V +restorexCATdb_a_p_V +restorexCATdb_wrongpath +regnotif_null +regnotif_o +regnotif_err +regnotif_h +regnotif_v +unregnotif_null +unregnotif_f +unregnotif_h +unregnotif_v +lsxcatd_null +lsxcatd_h +lsxcatd_d +lsxcatd_a +makedns_d_node +makedns_n +makedns +copycds_iso +copycds_n +copycds_a +copycds_n_a +copycds_a_err +copycds_n_err +xdsh_h +xdsh_V +xdsh_regular_command +xdsh_Q_command +xdsh_c_cn +xdsh_e_filename +xdsh_E +xdsh_i_linux +xdsh_t +xdsh_q +xdsh_T +xdsh_o +psh_h +psh_v +psh_node_cmd_linux +psh_l +psh_i +prsync_h +prsync_v +prsync_dir_node +prsync_file_node +switchdiscover_range_default +switchdiscover_h +switchdiscover_range_s +switchdiscover_range_default_w +switchdiscover_range_r +switchdiscover_range_x +switchdiscover_range_z +switchdiscover_range_z_V +nodeset_shell +nodeset_cmdline +nodeset_runimg +nodeset_check_warninginfo +xcatd_start_systemd +xcatd_stop_systemd +xcatd_restart_systemd +run_command_with_XCATBYPASS_systemd +disable_root_permission_in_policy_table_systemd +assign_certain_command_permission_systemd +xcatconfig_u_check_xcatsslversion_rhels_sles +sles_migration1 +sles_migration2 +reg_linux_diskless_installation_flat +packimage_m_cpio_c_gzip +packimage_m_cpio_c_pigz +packimage_m_cpio_c_xz +packimage_m_tar_c_pigz +packimage_m_tar_c_gzip +packimage_m_tar_c_xz +packimage_m_invalid_archive_method +packimage_m_invalid_compress_method +reg_linux_statelite_installation_flat +SN_setup_case +reg_linux_diskfull_installation_hierarchy +reg_linux_diskless_installation_hierarchy +reg_linux_statelite_installation_hierarchy_by_ramdisk +reg_linux_statelite_installation_hierarchy_by_nfs +clean_up_env diff --git a/xCAT-test/autotest/bundle/sles12_ppc64le.bundle b/xCAT-test/autotest/bundle/sles12_ppc64le.bundle index e362196b8..31b05bf80 100644 --- a/xCAT-test/autotest/bundle/sles12_ppc64le.bundle +++ b/xCAT-test/autotest/bundle/sles12_ppc64le.bundle @@ -1,3 +1,4 @@ +setup_vm Diskless_installation_flat_p8_le Full_installation_flat_p8_le makehosts_h diff --git a/xCAT-test/autotest/bundle/sles12_x86_64.bundle b/xCAT-test/autotest/bundle/sles12_x86_64.bundle index 241612a0e..91afe00d7 100644 --- a/xCAT-test/autotest/bundle/sles12_x86_64.bundle +++ b/xCAT-test/autotest/bundle/sles12_x86_64.bundle @@ -1,3 +1,4 @@ +setup_vm reg_linux_diskfull_installation_flat makehosts_h makehosts_help diff --git a/xCAT-test/autotest/bundle/ubuntu14.04.3_ppc64le.bundle b/xCAT-test/autotest/bundle/ubuntu14.04.3_ppc64le.bundle index 4c1d1b7bd..9aecea63a 100644 --- a/xCAT-test/autotest/bundle/ubuntu14.04.3_ppc64le.bundle +++ b/xCAT-test/autotest/bundle/ubuntu14.04.3_ppc64le.bundle @@ -1,3 +1,4 @@ +setup_vm Diskless_installation_flat_p8_le Full_installation_flat_p8_le makehosts_h diff --git a/xCAT-test/autotest/bundle/ubuntu14.04.3_x86_64.bundle b/xCAT-test/autotest/bundle/ubuntu14.04.3_x86_64.bundle index 2bfb17f88..b714108f4 100644 --- a/xCAT-test/autotest/bundle/ubuntu14.04.3_x86_64.bundle +++ b/xCAT-test/autotest/bundle/ubuntu14.04.3_x86_64.bundle @@ -1,3 +1,4 @@ +setup_vm Ubuntu_diskless_installation_flat_x86_vm Ubuntu_full_installation_flat_x86_vm makehosts_h diff --git a/xCAT-test/autotest/bundle/ubuntu14.04.4_ppc64le.bundle b/xCAT-test/autotest/bundle/ubuntu14.04.4_ppc64le.bundle index c49e45be8..be6932c9d 100644 --- a/xCAT-test/autotest/bundle/ubuntu14.04.4_ppc64le.bundle +++ b/xCAT-test/autotest/bundle/ubuntu14.04.4_ppc64le.bundle @@ -1,3 +1,4 @@ +setup_vm Diskless_installation_flat_p8_le Full_installation_flat_p8_le go_xcat_local_repo_case7 @@ -235,6 +236,15 @@ xdsh_t xdsh_q xdsh_T xdsh_o +psh_h +psh_v +psh_node_cmd_linux +psh_l +psh_i +prsync_h +prsync_v +prsync_dir_node +prsync_file_node switchdiscover_range_default switchdiscover_h switchdiscover_range_s diff --git a/xCAT-test/autotest/bundle/ubuntu14.04.4_x86_64.bundle b/xCAT-test/autotest/bundle/ubuntu14.04.4_x86_64.bundle index 9c4309d93..72d300f72 100644 --- a/xCAT-test/autotest/bundle/ubuntu14.04.4_x86_64.bundle +++ b/xCAT-test/autotest/bundle/ubuntu14.04.4_x86_64.bundle @@ -1,3 +1,4 @@ +setup_vm Ubuntu_diskless_installation_flat_x86_vm Ubuntu_full_installation_flat_x86_vm go_xcat_local_repo_case7 @@ -243,6 +244,15 @@ xdsh_t xdsh_q xdsh_T xdsh_o +psh_h +psh_v +psh_node_cmd_linux +psh_l +psh_i +prsync_h +prsync_v +prsync_dir_node +prsync_file_node switchdiscover_range_default switchdiscover_h switchdiscover_range_s diff --git a/xCAT-test/autotest/bundle/ubuntu16.04.1_ppc64le.bundle b/xCAT-test/autotest/bundle/ubuntu16.04.1_ppc64le.bundle index 09b1af592..74df70cbe 100644 --- a/xCAT-test/autotest/bundle/ubuntu16.04.1_ppc64le.bundle +++ b/xCAT-test/autotest/bundle/ubuntu16.04.1_ppc64le.bundle @@ -1,3 +1,4 @@ +setup_vm Diskless_installation_flat_p8_le Full_installation_flat_p8_le go_xcat_local_repo_case7 @@ -235,6 +236,15 @@ xdsh_t xdsh_q xdsh_T xdsh_o +psh_h +psh_v +psh_node_cmd_linux +psh_l +psh_i +prsync_h +prsync_v +prsync_dir_node +prsync_file_node switchdiscover_range_default switchdiscover_h switchdiscover_range_s diff --git a/xCAT-test/autotest/bundle/ubuntu16.04.1_x86_64.bundle b/xCAT-test/autotest/bundle/ubuntu16.04.1_x86_64.bundle index 5caa4de79..51decc528 100644 --- a/xCAT-test/autotest/bundle/ubuntu16.04.1_x86_64.bundle +++ b/xCAT-test/autotest/bundle/ubuntu16.04.1_x86_64.bundle @@ -1,3 +1,4 @@ +setup_vm Ubuntu_diskless_installation_flat_x86_vm Ubuntu_full_installation_flat_x86_vm go_xcat_local_repo_case7 @@ -243,6 +244,15 @@ xdsh_t xdsh_q xdsh_T xdsh_o +psh_h +psh_v +psh_node_cmd_linux +psh_l +psh_i +prsync_h +prsync_v +prsync_dir_node +prsync_file_node switchdiscover_range_default switchdiscover_h switchdiscover_range_s diff --git a/xCAT-test/autotest/bundle/ubuntu16.04_ppc64le.bundle b/xCAT-test/autotest/bundle/ubuntu16.04_ppc64le.bundle index 6a8bad79a..db2beed03 100644 --- a/xCAT-test/autotest/bundle/ubuntu16.04_ppc64le.bundle +++ b/xCAT-test/autotest/bundle/ubuntu16.04_ppc64le.bundle @@ -1,3 +1,4 @@ +setup_vm Diskless_installation_flat_p8_le Full_installation_flat_p8_le go_xcat_local_repo_case7 diff --git a/xCAT-test/autotest/bundle/ubuntu16.04_x86_64.bundle b/xCAT-test/autotest/bundle/ubuntu16.04_x86_64.bundle index ec034a3af..07491602a 100644 --- a/xCAT-test/autotest/bundle/ubuntu16.04_x86_64.bundle +++ b/xCAT-test/autotest/bundle/ubuntu16.04_x86_64.bundle @@ -1,3 +1,4 @@ +setup_vm Ubuntu_diskless_installation_flat_x86_vm Ubuntu_full_installation_flat_x86_vm go_xcat_local_repo_case7 diff --git a/xCAT-test/autotest/testcase/dockercommand/cases0 b/xCAT-test/autotest/testcase/dockercommand/cases0 index b3dcf2cd4..a8b4844d5 100644 --- a/xCAT-test/autotest/testcase/dockercommand/cases0 +++ b/xCAT-test/autotest/testcase/dockercommand/cases0 @@ -122,7 +122,7 @@ cmd:mkdocker $$DOCKERCN image=$$DOCKERIMAGE command=$$DOCKERCOMMAND dockerflag= check:rc==0 cmd:rpower $$DOCKERCN pause check:rc!=0 -check:output=~$$DOCKERCN: Error: Container +check:output=~$$DOCKERCN: Error cmd:rpower $$DOCKERCN start check:rc==0 cmd:rpower $$DOCKERCN pause @@ -223,7 +223,7 @@ cmd:rmdocker $$DOCKERCN check:rc==0 cmd:lsdocker -l $$DOCKERCN check:rc!=0 -check:output=~ Error: No such container +check:output=~$$DOCKERCN: Error cmd:makehosts -d $$DOCKERCN check:rc==0 cmd:rmdef $$DOCKERCN diff --git a/xCAT-test/autotest/testcase/genesis/genesistest.pl b/xCAT-test/autotest/testcase/genesis/genesistest.pl index a7301f1b3..73c3bc3b4 100755 --- a/xCAT-test/autotest/testcase/genesis/genesistest.pl +++ b/xCAT-test/autotest/testcase/genesis/genesistest.pl @@ -198,13 +198,9 @@ sub rungenesiscmd { if ($?) { send_msg(0, "mknb $arch failed for runcmd test."); } - `nodeset $noderange "runcmd=cmdtest,shell"`; + `rinstall $noderange "runcmd=cmdtest,shell"`; if ($?) { - send_msg(0, "nodeset noderange shell failed for runcmd test"); - } - `rpower $noderange boot`; - if ($?) { - send_msg(0, "rpower noderange boot failed for runcmd test"); + send_msg(0, "rinstall noderange shell failed for runcmd test"); } return $value; } @@ -240,13 +236,9 @@ sub rungenesisimg { chmod 0755, "/install/my_image/runme.sh"; `tar -zcvf /tmp/my_image.tgz -C /install/my_image .`; copy("/tmp/my_image.tgz", "/install/my_image") or die "Copy failed: $!"; - `nodeset $noderange "runimage=http://$master/install/my_image/my_image.tgz",shell`; + `rinstall $noderange "runimage=http://$master/install/my_image/my_image.tgz",shell`; if ($?) { - send_msg(0, "nodeset noderange failed for runimg"); - } - `rpower $noderange boot`; - if ($?) { - send_msg(0, "rpower boot failed for runimg test"); + send_msg(0, "rinstall noderange failed for runimg"); } return $value; } @@ -311,14 +303,9 @@ sub clearenv { exit 1; } } - `nodeset $noderange boot`; + `rinstall $noderange boot`; if ($?) { - send_msg(0, "nodeset node failed"); - exit 1; - } - `rpower $noderange boot`; - if ($?) { - send_msg(0, "rpower node failed"); + send_msg(0, "rinstall node failed"); exit 1; } return 0; diff --git a/xCAT-test/autotest/testcase/get_install_disk/fresh_install_disk b/xCAT-test/autotest/testcase/get_install_disk/fresh_install_disk index b79bab100..8ca69dbcb 100644 --- a/xCAT-test/autotest/testcase/get_install_disk/fresh_install_disk +++ b/xCAT-test/autotest/testcase/get_install_disk/fresh_install_disk @@ -4,9 +4,6 @@ description:check fresh install disk, usded for x86 multi disk only, and not che cmd:xdsh $$CN "dd if=/dev/zero of=/dev/sdb bs=1048576 count=100" cmd:xdsh $$CN "dd if=/dev/zero of=/dev/sdb bs=1048576 count=300 seek=60858" -cmd:if [[ "__GETNODEATTR($$CN,arch)__" != "ppc64" ]]; then tabdump -w node==$$CN kvm_nodedata |grep -i $$CN; fi -cmd:if [ "__GETNODEATTR($$CN,arch)__" != "ppc64" -a "__GETNODEATTR($$CN,mgt)__" != "ipmi" ];then if [[ "__GETNODEATTR($$CN,vmstorage)__" =~ "phy" ]]; then rmvm $$CN -f -p && mkvm $$CN; else rmvm $$CN -f -p && mkvm $$CN -s 20G; fi;fi -check:rc=0 cmd:makedns -n check:rc==0 cmd:makeconservercf @@ -27,15 +24,9 @@ check:output=~$$CN cmd:if cat /etc/*release |grep "7.2" |grep "Red Hat">/dev/null;then mkdef $$STATELITE -u profile=compute provmethod=statelite osvers=rhels7.2;else mkdef $$STATELITE -u profile=compute provmethod=statelite; fi cmd:chdef $$CN status= check:rc==0 -cmd:nodeset $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute -check:rc==0 -cmd:lsdef $$CN |grep provmethod -check:rc==0 -check:output=~__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute -cmd:if [[ "__GETNODEATTR($$CN,mgt)__" = "ipmi" ]]; then rsetboot $$CN net; fi -check:rc==0 -cmd:if [ "__GETNODEATTR($$CN,mgt)__" != "ipmi" ];then if [ "__GETNODEATTR($$CN,arch)__" = "ppc64" ];then rnetboot $$CN;else rpower $$CN boot;fi else rpower $$CN boot;fi +cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute check:rc==0 +check:output=~Provision node\(s\)\: $$CN cmd:sleep 600 cmd:a=0;while ! `lsdef -l $$CN|grep status|grep booted >/dev/null`; do sleep 30;((a++));if [ $a -gt 100 ];then break;fi done diff --git a/xCAT-test/autotest/testcase/get_install_disk/reinstall_disk b/xCAT-test/autotest/testcase/get_install_disk/reinstall_disk index b9fb12825..27a4b1ffa 100644 --- a/xCAT-test/autotest/testcase/get_install_disk/reinstall_disk +++ b/xCAT-test/autotest/testcase/get_install_disk/reinstall_disk @@ -4,8 +4,6 @@ description:check reinstall disk, usded for x86 multi disk only, and not check R cmd:xdsh $$CN "dd if=/dev/zero of=/dev/sdb bs=1048576 count=100" cmd:xdsh $$CN "dd if=/dev/zero of=/dev/sdb bs=1048576 count=300 seek=60858" -cmd:if [ "__GETNODEATTR($$CN,arch)__" != "ppc64" -a "__GETNODEATTR($$CN,mgt)__" != "ipmi" ];then if [[ "__GETNODEATTR($$CN,vmstorage)__" =~ "phy" ]]; then rmvm $$CN -f -p && mkvm $$CN; else rmvm $$CN -f -p && mkvm $$CN -s 20G; fi;fi -check:rc=0 cmd:makedns -n check:rc==0 cmd:makeconservercf @@ -26,15 +24,9 @@ check:output=~$$CN cmd:if cat /etc/*release |grep "7.2" |grep "Red Hat">/dev/null;then mkdef $$STATELITE -u profile=compute provmethod=statelite osvers=rhels7.2;else mkdef $$STATELITE -u profile=compute provmethod=statelite; fi cmd:chdef $$CN status= check:rc==0 -cmd:nodeset $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute -check:rc==0 -cmd:lsdef $$CN |grep provmethod -check:rc==0 -check:output=~__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute -cmd:if [[ "__GETNODEATTR($$CN,mgt)__" = "ipmi" ]]; then rsetboot $$CN net; fi -check:rc==0 -cmd:if [ "__GETNODEATTR($$CN,mgt)__" != "ipmi" ];then if [ "__GETNODEATTR($$CN,arch)__" = "ppc64" ];then rnetboot $$CN;else rpower $$CN boot;fi else rpower $$CN boot;fi +cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute check:rc==0 +check:output=~Provision node\(s\)\: $$CN cmd:a=0;while ! `lsdef -l $$CN|grep status|grep booted >/dev/null`; do sleep 30;((a++));if [ $a -gt 100 ];then break;fi done cmd:lsdef -l $$CN | grep status @@ -47,15 +39,9 @@ check:output=~sdb cmd:chdef $$CN status= check:rc==0 -cmd:nodeset $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute -check:rc==0 -cmd:lsdef $$CN |grep provmethod -check:rc==0 -check:output=~__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute -cmd:if [[ "__GETNODEATTR($$CN,mgt)__" = "ipmi" ]]; then rsetboot $$CN net; fi -check:rc==0 -cmd:if [ "__GETNODEATTR($$CN,mgt)__" != "ipmi" ];then if [ "__GETNODEATTR($$CN,arch)__" = "ppc64" ];then rnetboot $$CN;else rpower $$CN boot;fi else rpower $$CN boot;fi +cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute check:rc==0 +check:output=~Provision node\(s\)\: $$CN cmd:a=0;while ! `lsdef -l $$CN|grep status|grep booted >/dev/null`; do sleep 30;((a++));if [ $a -gt 100 ];then break;fi done cmd:lsdef -l $$CN | grep status diff --git a/xCAT-test/autotest/testcase/go-xcat/case0 b/xCAT-test/autotest/testcase/go-xcat/case0 index ea16ba1b8..eb620e312 100644 --- a/xCAT-test/autotest/testcase/go-xcat/case0 +++ b/xCAT-test/autotest/testcase/go-xcat/case0 @@ -230,7 +230,7 @@ end start:go_xcat_local_repo_case7 description:test go_xcat with the option --xcat-core=/path/to/xcat-core.tar.bz2 --xcat-dep=/path/to/xcat-dep.tar.bz2 install os:Linux -cmd:if xdsh $$CN "zypper -h"; then xdsh $$CN "zypper remove -y *xCAT*"; elif xdsh $$CN "yum -h";then xdsh $$CN "yum remove -y *xCAT*"; elif xdsh $$CN "apt-get -h";then xdsh $$CN "apt-get purge perl-xcat xcat-client xcat-server xcat -y"; else echo "Sorry,this is not supported os"; fi +cmd:if xdsh $$CN "zypper -h"; then xdsh $$CN "zypper remove -y *xCAT*"; elif xdsh $$CN "yum -h";then xdsh $$CN "yum remove -y *xCAT*"; elif xdsh $$CN "apt-get -h";then xdsh $$CN "apt-get purge perl-xcat xcat-client xcat-server xcat xcat-buildkit xcat-genesis-scripts xcat-genesis-base-amd64 xcat-genesis-base-ppc64 -y"; else echo "Sorry,this is not supported os"; fi cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "dpkg -l |grep -i perl-xcat";else xdsh $$CN "rpm -qa |grep -i perl-xcat";fi check:rc!=0 cmd:if xdsh $$CN "grep \"Red Hat\" /etc/*release >/dev/null"; then xdsh $$CN "yum install -y yum-utils bzip2"; fi @@ -254,7 +254,7 @@ cmd:xdsh $$CN "service xcatd status" check:rc==0 check:output=~running cmd:xdsh $$CN "service xcatd stop" -cmd:if grep SUSE /etc/*release;then xdsh $$CN "zypper remove -y *xCAT*" && xdsh $$CN "rm -rf /etc/zypp/repos.d/xCAT-*.repo"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "yum remove -y *xCAT*" && xdsh $$CN "rm -rf /etc/yum.repos.d/xCAT-*.repo"; elif grep Ubuntu /etc/*release;then xdsh $$CN "apt-get purge perl-xcat xcat-client xcat-server xcat -y" && xdsh $$CN "rm -rf /etc/apt/sources.list.d/xcat-*.list"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "zypper remove -y *xCAT*" && xdsh $$CN "rm -rf /etc/zypp/repos.d/xCAT-*.repo"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "yum remove -y *xCAT*" && xdsh $$CN "rm -rf /etc/yum.repos.d/xCAT-*.repo"; elif grep Ubuntu /etc/*release;then xdsh $$CN "apt-get purge perl-xcat xcat-client xcat-server xcat xcat-buildkit xcat-genesis-scripts xcat-genesis-base-amd64 xcat-genesis-base-ppc64 -y" && xdsh $$CN "rm -rf /etc/apt/sources.list.d/xcat-*.list"; fi check:rc==0 cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "dpkg -l |grep -i perl-xcat";else xdsh $$CN "rpm -qa|grep -i perl-xcat";fi check:rc!=0 diff --git a/xCAT-test/autotest/testcase/go-xcat/case1 b/xCAT-test/autotest/testcase/go-xcat/case1 index 2d2791199..fd3688eae 100644 --- a/xCAT-test/autotest/testcase/go-xcat/case1 +++ b/xCAT-test/autotest/testcase/go-xcat/case1 @@ -1,7 +1,7 @@ start:go_xcat_noinput description:test go_xcat without any input parameters os:Linux -cmd:if xdsh $$CN "zypper -h"; then xdsh $$CN "zypper remove -y *xCAT*"; elif xdsh $$CN "yum -h";then xdsh $$CN "yum remove -y *xCAT*"; elif xdsh $$CN "apt-get -h";then xdsh $$CN "apt-get purge perl-xcat xcat-client xcat-server xcat -y"; else echo "Sorry,this is not supported os"; fi +cmd:if xdsh $$CN "zypper -h"; then xdsh $$CN "zypper remove -y *xCAT*"; elif xdsh $$CN "yum -h";then xdsh $$CN "yum remove -y *xCAT*"; elif xdsh $$CN "apt-get -h";then xdsh $$CN "apt-get purge perl-xcat xcat-client xcat-server xcat xcat-buildkit xcat-genesis-scripts xcat-genesis-base-amd64 xcat-genesis-base-ppc64 -y"; else echo "Sorry,this is not supported os"; fi cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "dpkg -l |grep -i perl-xcat";else xdsh $$CN "rpm -qa |grep -i perl-xcat";fi check:rc!=0 cmd:if xdsh $$CN "grep \"Red Hat\" /etc/*release >/dev/null"; then xdsh $$CN "yum install -y yum-utils bzip2"; fi @@ -23,7 +23,7 @@ cmd:xdsh $$CN "service xcatd status" check:rc==0 check:output=~running cmd:xdsh $$CN "service xcatd stop" -cmd:if grep SUSE /etc/*release;then xdsh $$CN "zypper remove -y *xCAT*" && xdsh $$CN "rm -rf /etc/zypp/repos.d/xCAT-*.repo"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "yum remove -y *xCAT*" && xdsh $$CN "rm -rf /etc/yum.repos.d/xCAT-*.repo"; elif grep Ubuntu /etc/*release;then xdsh $$CN "apt-get purge perl-xcat xcat-client xcat-server xcat -y" && xdsh $$CN "rm -rf /etc/apt/sources.list.d/xcat-*.list"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "zypper remove -y *xCAT*" && xdsh $$CN "rm -rf /etc/zypp/repos.d/xCAT-*.repo"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "yum remove -y *xCAT*" && xdsh $$CN "rm -rf /etc/yum.repos.d/xCAT-*.repo"; elif grep Ubuntu /etc/*release;then xdsh $$CN "apt-get purge perl-xcat xcat-client xcat-server xcat xcat-buildkit xcat-genesis-scripts xcat-genesis-base-amd64 xcat-genesis-base-ppc64 -y" && xdsh $$CN "rm -rf /etc/apt/sources.list.d/xcat-*.list"; fi check:rc==0 cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "dpkg -l |grep -i perl-xcat";else xdsh $$CN "rpm -qa|grep -i perl-xcat";fi check:rc!=0 @@ -33,7 +33,7 @@ end start:go_xcat_with_x description:test go_xcat with the option -x version -y install os:Linux -cmd:if xdsh $$CN "zypper -h"; then xdsh $$CN "zypper remove -y *xCAT*"; elif xdsh $$CN "yum -h";then xdsh $$CN "yum remove -y *xCAT*"; elif xdsh $$CN "apt-get -h";then xdsh $$CN "apt-get purge perl-xcat xcat-client xcat-server xcat -y"; else echo "Sorry,this is not supported os"; fi +cmd:if xdsh $$CN "zypper -h"; then xdsh $$CN "zypper remove -y *xCAT*"; elif xdsh $$CN "yum -h";then xdsh $$CN "yum remove -y *xCAT*"; elif xdsh $$CN "apt-get -h";then xdsh $$CN "apt-get purge perl-xcat xcat-client xcat-server xcat xcat-buildkit xcat-genesis-scripts xcat-genesis-base-amd64 xcat-genesis-base-ppc64 -y"; else echo "Sorry,this is not supported os"; fi cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "dpkg -l |grep -i perl-xcat";else xdsh $$CN "rpm -qa |grep -i perl-xcat";fi check:rc!=0 cmd:if xdsh $$CN "grep \"Red Hat\" /etc/*release >/dev/null"; then xdsh $$CN "yum install -y yum-utils bzip2"; fi @@ -47,15 +47,15 @@ cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "scp -r $$MN:/etc/resolv.conf /e check:rc==0 cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "apt-get clean && apt-get update"; fi check:rc==0 -cmd:xdsh $$CN "cd /; ./go-xcat -x $$MIGRATION1_VERSION -y install" +cmd:xdsh $$CN "cd /; ./go-xcat -x $$MIGRATION2_VERSION -y install" check:rc==0 cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsxcatd -v" -check:output=~Version $$MIGRATION1_VERSION +check:output=~Version $$MIGRATION2_VERSION cmd:xdsh $$CN "service xcatd status" check:rc==0 check:output=~running cmd:xdsh $$CN "service xcatd stop" -cmd:if grep SUSE /etc/*release;then xdsh $$CN "zypper remove -y *xCAT*" && xdsh $$CN "rm -rf /etc/zypp/repos.d/xCAT-*.repo"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "yum remove -y *xCAT*" && xdsh $$CN "rm -rf /etc/yum.repos.d/xCAT-*.repo"; elif grep Ubuntu /etc/*release;then xdsh $$CN "apt-get purge perl-xcat xcat-client xcat-server xcat -y" && xdsh $$CN "rm -rf /etc/apt/sources.list.d/xcat-*.list"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "zypper remove -y *xCAT*" && xdsh $$CN "rm -rf /etc/zypp/repos.d/xCAT-*.repo"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "yum remove -y *xCAT*" && xdsh $$CN "rm -rf /etc/yum.repos.d/xCAT-*.repo"; elif grep Ubuntu /etc/*release;then xdsh $$CN "apt-get purge perl-xcat xcat-client xcat-server xcat xcat-buildkit xcat-genesis-scripts xcat-genesis-base-amd64 xcat-genesis-base-ppc64 -y" && xdsh $$CN "rm -rf /etc/apt/sources.list.d/xcat-*.list"; fi check:rc==0 cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "dpkg -l |grep -i perl-xcat";else xdsh $$CN "rpm -qa|grep -i perl-xcat";fi check:rc!=0 @@ -65,7 +65,7 @@ end start:go_xcat_with_xcat-version-1 description:test go_xcat with the option --xcat-version=devel install os:Linux -cmd:if xdsh $$CN "zypper -h"; then xdsh $$CN "zypper remove -y *xCAT*"; elif xdsh $$CN "yum -h";then xdsh $$CN "yum remove -y *xCAT*"; elif xdsh $$CN "apt-get -h";then xdsh $$CN "apt-get purge perl-xcat xcat-client xcat-server xcat -y"; else echo "Sorry,this is not supported os"; fi +cmd:if xdsh $$CN "zypper -h"; then xdsh $$CN "zypper remove -y *xCAT*"; elif xdsh $$CN "yum -h";then xdsh $$CN "yum remove -y *xCAT*"; elif xdsh $$CN "apt-get -h";then xdsh $$CN "apt-get purge perl-xcat xcat-client xcat-server xcat xcat-buildkit xcat-genesis-scripts xcat-genesis-base-amd64 xcat-genesis-base-ppc64 -y"; else echo "Sorry,this is not supported os"; fi cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "dpkg -l |grep -i perl-xcat";else xdsh $$CN "rpm -qa |grep -i perl-xcat";fi check:rc!=0 cmd:if xdsh $$CN "grep \"Red Hat\" /etc/*release >/dev/null"; then xdsh $$CN "yum install -y yum-utils bzip2"; fi @@ -87,7 +87,7 @@ cmd:xdsh $$CN "service xcatd status" check:rc==0 check:output=~running cmd:xdsh $$CN "service xcatd stop" -cmd:if grep SUSE /etc/*release;then xdsh $$CN "zypper remove -y *xCAT*" && xdsh $$CN "rm -rf /etc/zypp/repos.d/xCAT-*.repo"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "yum remove -y *xCAT*" && xdsh $$CN "rm -rf /etc/yum.repos.d/xCAT-*.repo"; elif grep Ubuntu /etc/*release;then xdsh $$CN "apt-get purge perl-xcat xcat-client xcat-server xcat -y" && xdsh $$CN "rm -rf /etc/apt/sources.list.d/xcat-*.list"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "zypper remove -y *xCAT*" && xdsh $$CN "rm -rf /etc/zypp/repos.d/xCAT-*.repo"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "yum remove -y *xCAT*" && xdsh $$CN "rm -rf /etc/yum.repos.d/xCAT-*.repo"; elif grep Ubuntu /etc/*release;then xdsh $$CN "apt-get purge perl-xcat xcat-client xcat-server xcat xcat-buildkit xcat-genesis-scripts xcat-genesis-base-amd64 xcat-genesis-base-ppc64 -y" && xdsh $$CN "rm -rf /etc/apt/sources.list.d/xcat-*.list"; fi check:rc==0 cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "dpkg -l |grep -i perl-xcat";else xdsh $$CN "rpm -qa|grep -i perl-xcat";fi check:rc!=0 diff --git a/xCAT-test/autotest/testcase/go-xcat/case2 b/xCAT-test/autotest/testcase/go-xcat/case2 index 989e7a09d..1ffdb3734 100644 --- a/xCAT-test/autotest/testcase/go-xcat/case2 +++ b/xCAT-test/autotest/testcase/go-xcat/case2 @@ -154,7 +154,7 @@ end start:go_xcat_online_repo_case6 description:test go_xcat with the option --xcat-core=http://xcat.org/path/to/xcat-core.tar.bz2 --xcat-dep=http://xcat.org/path/to/xcat-dep.tar.bz2 install os:Linux -cmd:if xdsh $$CN "zypper -h"; then xdsh $$CN "zypper remove -y *xCAT*"; elif xdsh $$CN "yum -h";then xdsh $$CN "yum remove -y *xCAT*"; elif xdsh $$CN "apt-get -h";then xdsh $$CN "apt-get purge perl-xcat xcat-client xcat-server xcat -y"; else echo "Sorry,this is not supported os"; fi +cmd:if xdsh $$CN "zypper -h"; then xdsh $$CN "zypper remove -y *xCAT*"; elif xdsh $$CN "yum -h";then xdsh $$CN "yum remove -y *xCAT*"; elif xdsh $$CN "apt-get -h";then xdsh $$CN "apt-get purge perl-xcat xcat-client xcat-server xcat xcat-buildkit xcat-genesis-scripts xcat-genesis-base-amd64 xcat-genesis-base-ppc64 -y"; else echo "Sorry,this is not supported os"; fi cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "dpkg -l |grep -i perl-xcat";else xdsh $$CN "rpm -qa |grep -i perl-xcat";fi check:rc!=0 cmd:if xdsh $$CN "grep \"Red Hat\" /etc/*release >/dev/null"; then xdsh $$CN "yum install -y yum-utils bzip2"; fi @@ -178,7 +178,7 @@ cmd:xdsh $$CN "service xcatd status" check:rc==0 check:output=~running cmd:xdsh $$CN "service xcatd stop" -cmd:if grep SUSE /etc/*release;then xdsh $$CN "zypper remove -y *xCAT*" && xdsh $$CN "rm -rf /etc/zypp/repos.d/xCAT-*.repo"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "yum remove -y *xCAT*" && xdsh $$CN "rm -rf /etc/yum.repos.d/xCAT-*.repo"; elif grep Ubuntu /etc/*release;then xdsh $$CN "apt-get purge perl-xcat xcat-client xcat-server xcat -y" && xdsh $$CN "rm -rf /etc/apt/sources.list.d/xcat-*.list"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "zypper remove -y *xCAT*" && xdsh $$CN "rm -rf /etc/zypp/repos.d/xCAT-*.repo"; elif grep "Red Hat" /etc/*release;then xdsh $$CN "yum remove -y *xCAT*" && xdsh $$CN "rm -rf /etc/yum.repos.d/xCAT-*.repo"; elif grep Ubuntu /etc/*release;then xdsh $$CN "apt-get purge perl-xcat xcat-client xcat-server xcat xcat-buildkit xcat-genesis-scripts xcat-genesis-base-amd64 xcat-genesis-base-ppc64 -y" && xdsh $$CN "rm -rf /etc/apt/sources.list.d/xcat-*.list"; fi check:rc==0 cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "dpkg -l |grep -i perl-xcat";else xdsh $$CN "rpm -qa|grep -i perl-xcat";fi check:rc!=0 diff --git a/xCAT-test/autotest/testcase/installation/Diskless_installation_flat_p8_le b/xCAT-test/autotest/testcase/installation/Diskless_installation_flat_p8_le index 0c4459990..532a4f0d8 100644 --- a/xCAT-test/autotest/testcase/installation/Diskless_installation_flat_p8_le +++ b/xCAT-test/autotest/testcase/installation/Diskless_installation_flat_p8_le @@ -1,14 +1,9 @@ start:Diskless_installation_flat_p8_le os:Linux +stop:yes cmd:copycds $$ISO check:rc==0 -cmd:if [[ "__GETNODEATTR($$CN,arch)__" != "ppc64" ]]; then tabdump -w node==$$CN kvm_nodedata; fi -check:rc==0 -#comment for vm debug -#cmd:if [ "__GETNODEATTR($$CN,arch)__" != "ppc64" -a "__GETNODEATTR($$CN,mgt)__" != "ipmi" ];then if [[ "__GETNODEATTR($$CN,vmstorage)__" =~ "phy" ]]; then rmvm $$CN -f -p; mkvm $$CN; else rmvm $$CN -f -p ;mkvm $$CN -s 20G; fi;fi -cmd:if [ "__GETNODEATTR($$CN,arch)__" != "ppc64" -a "__GETNODEATTR($$CN,mgt)__" != "ipmi" ];then if [[ "__GETNODEATTR($$CN,vmstorage)__" =~ "phy" ]]; then rmvm $$CN -f -p; mkvm $$CN; else rmvm $$CN -f -p;mkvm $$CN;rmvm $$CN -f -p;mkvm $$CN -s 20G; fi;fi -check:rc==0 cmd:makedns -n check:rc==0 cmd:makedhcp -n @@ -40,12 +35,9 @@ cmd:packimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-comput check:rc==0 cmd:chdef $$CN status= check:rc==0 -cmd:nodeset $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute -check:rc==0 -cmd:if [[ "__GETNODEATTR($$CN,mgt)__" = "ipmi" ]]; then rsetboot $$CN net; fi -check:rc==0 -cmd:rpower $$CN boot +cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute check:rc==0 +check:output=~Provision node\(s\)\: $$CN cmd:sleep 200 cmd:a=0;while ! `lsdef -l $$CN|grep status|grep booted >/dev/null`; do sleep 10;((a++));if [ $a -gt 100 ];then break;fi done cmd:lsdef -l $$CN | grep status @@ -54,9 +46,7 @@ cmd:xdsh $$CN date check:rc==0 check:output=~\d\d:\d\d:\d\d cmd:xdsh $$CN "cat /var/log/xcat/xcat.log" -cmd:nodeset $$CN osimage -check:rc==0 -cmd:rpower $$CN reset +cmd:rinstall $$CN osimage check:rc==0 cmd:sleep 200 cmd:a=0;while ! `lsdef -l $$CN|grep status|grep booted >/dev/null`; do sleep 10;((a++));if [ $a -gt 100 ];then break;fi done diff --git a/xCAT-test/autotest/testcase/installation/Full_installation_flat_p8_le b/xCAT-test/autotest/testcase/installation/Full_installation_flat_p8_le index a058f5560..9722176aa 100644 --- a/xCAT-test/autotest/testcase/installation/Full_installation_flat_p8_le +++ b/xCAT-test/autotest/testcase/installation/Full_installation_flat_p8_le @@ -16,21 +16,20 @@ cmd:makedhcp -n check:rc==0 cmd:makedhcp -a check:rc==0 -cmd:makedhcp -q $$CN +cmd:a=0;while true; do [ $a -eq 100 ] && exit 1;output=$(makedhcp -q $$CN);[ $? -ne 0 ] && exit 1;echo $output|grep $$CN 2>/dev/null && exit 0;a=$[$a+1];sleep 1;done check:rc==0 -check:output=~$$CN cmd:makedns -n check:rc==0 cmd:makeconservercf $$CN check:rc==0 cmd:cat /etc/conserver.cf | grep $$CN check:output=~$$CN -cmd:chdef -t node -o $$CN postscripts=setupntp +cmd:if [ "__GETNODEATTR($$CN,os)__" != "sles12.1" ];then chdef -t node -o $$CN postscripts=setupntp; fi +cmd:lsdef -l $$CN check:rc==0 -cmd:nodeset $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute -check:rc==0 -cmd:rpower $$CN boot +cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute check:rc==0 +check:output=~Provision node\(s\)\: $$CN cmd:sleep 600 cmd:a=0;while ! `lsdef -l $$CN|grep status|grep booted >/dev/null`; do sleep 60;((a++));if [ $a -gt 50 ];then break;fi done cmd:ping $$CN -c 3 diff --git a/xCAT-test/autotest/testcase/installation/SN_setup_case b/xCAT-test/autotest/testcase/installation/SN_setup_case index 9b6ea5490..1873a0efd 100644 --- a/xCAT-test/autotest/testcase/installation/SN_setup_case +++ b/xCAT-test/autotest/testcase/installation/SN_setup_case @@ -7,12 +7,6 @@ check:rc==0 cmd:chtab key=nameservers site.value="" check:rc==0 -#cmd:if [ "__GETNODEATTR($$SN,arch)__" != "ppc64" -a "__GETNODEATTR($$SN,mgt)__" != "ipmi" ];then if [[ "__GETNODEATTR($$SN,vmstorage)__" =~ "phy" ]]; then rmvm $$SN -f -p && mkvm $$SN; else rmvm $$SN -f -p && mkvm $$SN -s 20G; fi;fi -#Add for debug rmvm issue -cmd:if [[ "__GETNODEATTR($$CN,arch)__" != "ppc64" ]]; then tabdump -w node==$$SN kvm_nodedata; fi -check:rc==0 -cmd:if [ "__GETNODEATTR($$SN,arch)__" != "ppc64" -a "__GETNODEATTR($$SN,mgt)__" != "ipmi" ];then if [[ "__GETNODEATTR($$SN,vmstorage)__" =~ "phy" ]]; then rmvm $$SN -f -p ;mkvm $$SN; else rmvm $$SN -f -p;mkvm $$SN;rmvm $$SN -f -p;mkvm $$SN -s 20G; fi;fi -check:rc==0 cmd:makedns -n check:rc==0 @@ -62,10 +56,9 @@ check:rc==0 #cmd:chdef -t osimage __GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-install-service pkgdir="/install/__GETNODEATTR($$SN,os)__/__GETNODEATTR($$SN,arch)__" #check:rc==0 -cmd:nodeset $$SN osimage=__GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-install-service -check:rc==0 -cmd:if [[ "__GETNODEATTR($$SN,arch)__" = "ppc64" ]]; then rnetboot $$SN;else rpower $$SN boot; fi +cmd:rinstall $$SN osimage=__GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-install-service check:rc==0 +check:output=~Provision node\(s\)\: $$SN cmd:/opt/xcat/share/xcat/tools/autotest/testcase/installation/customize_sleep_for_sn __GETNODEATTR($$SN,os)__ __GETNODEATTR($$SN,arch)__ diff --git a/xCAT-test/autotest/testcase/installation/litefile_sles.csv b/xCAT-test/autotest/testcase/installation/litefile_sles.csv index 09c02b082..e4a30153b 100644 --- a/xCAT-test/autotest/testcase/installation/litefile_sles.csv +++ b/xCAT-test/autotest/testcase/installation/litefile_sles.csv @@ -14,3 +14,5 @@ "ALL","/opt/xcat/","tmpfs",, "ALL","/xcatpost/","tmpfs",, "ALL","/root/.ssh/","tmpfs",, +"ALL","/etc/init.d/rc3.d/","tmpfs",, +"ALL","/etc/init.d/rc5.d/","tmpfs",, diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_SN_installation_hierarchy b/xCAT-test/autotest/testcase/installation/reg_linux_SN_installation_hierarchy index 0ff095d64..b79e4e9fd 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_SN_installation_hierarchy +++ b/xCAT-test/autotest/testcase/installation/reg_linux_SN_installation_hierarchy @@ -3,10 +3,6 @@ os:Linux cmd:chtab key=nameservers site.value="" check:rc==0 -cmd:if [[ "__GETNODEATTR($$CN,arch)__" != "ppc64" ]]; then tabdump -w node==$$SN kvm_nodedata; fi -check:rc==0 -#cmd:if [[ "__GETNODEATTR($$SN,arch)__" =~ "x86_64" ]];then rmvm $$SN -f -p && mkvm $$SN -s 40G; fi -cmd:if [ "__GETNODEATTR($$SN,arch)__" != "ppc64" -a "__GETNODEATTR($$SN,mgt)__" != "ipmi" ];then if [[ "__GETNODEATTR($$SN,vmstorage)__" =~ "phy" ]]; then rmvm $$SN -f -p; mkvm $$SN; else rmvm $$SN -f -p;mkvm $$SN;rmvm $$SN -f -p;mkvm $$SN -s 40G; fi;fi cmd:makedns -n check:rc==0 cmd:makeconservercf @@ -20,9 +16,8 @@ cmd:makedhcp -n check:rc==0 cmd:makedhcp -a check:rc==0 -cmd:makedhcp -q $$SN +cmd:a=0;while true; do [ $a -eq 100 ] && exit 1;output=$(makedhcp -q $$SN);[ $? -ne 0 ] && exit 1;echo $output|grep $$SN 2>/dev/null && exit 0;a=$[$a+1];sleep 1;done check:rc==0 -check:output=~$$SN cmd:chdef -t node $$SN groups=service,all check:rc==0 cmd:chdef -t group -o service profile=service primarynic=mac installnic=mac @@ -63,11 +58,9 @@ check:rc==0 cmd:chdef -t osimage __GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-install-service pkgdir="/install/__GETNODEATTR($$SN,os)__/__GETNODEATTR($$SN,arch)__" check:rc==0 - -cmd:nodeset $$SN osimage=__GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-install-service -check:rc==0 -cmd:if [[ "__GETNODEATTR($$SN,arch)__" =~ "ppc64" ]]; then rnetboot $$SN;elif [[ "__GETNODEATTR($$SN,arch)__" =~ "x86_64" ]];then rpower $$SN boot; fi +cmd:rinstall $$SN osimage=__GETNODEATTR($$SN,os)__-__GETNODEATTR($$SN,arch)__-install-service check:rc==0 +check:output=~Provision node\(s\)\: $$SN cmd:sleep 600 cmd:a=0;while ! `lsdef -l $$SN|grep status|grep booted >/dev/null`; do sleep 60;((a++));if [ $a -gt 70 ];then break;fi done diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_flat b/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_flat index b9c7d65bf..89f9d73d8 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_flat +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_flat @@ -1,13 +1,11 @@ start:reg_linux_diskfull_installation_flat os:Linux +stop:yes cmd:if ping -c 1 $$SN > /dev/null;then rpower $$SN off > /dev/null;fi cmd:chdef -t node -o $$CN servicenode= monserver=$$MN nfsserver=$$MN tftpserver=$$MN xcatmaster=$$MN check:rc==0 -#cmd:if [ "__GETNODEATTR($$CN,arch)__" != "ppc64" -a "__GETNODEATTR($$CN,mgt)__" != "ipmi" ];then if [[ "__GETNODEATTR($$CN,vmstorage)__" =~ "phy" ]]; then rmvm $$CN -f -p && mkvm $$CN; else rmvm $$CN -f -p && mkvm $$CN -s 20G; fi;fi -cmd:if [ "__GETNODEATTR($$CN,arch)__" != "ppc64" -a "__GETNODEATTR($$CN,mgt)__" != "ipmi" ];then if [[ "__GETNODEATTR($$CN,vmstorage)__" =~ "phy" ]]; then rmvm $$CN -f -p; mkvm $$CN; else rmvm $$CN -f -p;mkvm $$CN;rmvm $$CN -f -p;mkvm $$CN -s 20G; fi;fi -check:rc=0 cmd:makedns -n check:rc==0 cmd:makeconservercf @@ -28,22 +26,16 @@ check:rc==0 cmd:makedhcp -a check:rc==0 cmd:sleep 10 -cmd:makedhcp -q $$CN +cmd:a=0;while true; do [ $a -eq 100 ] && exit 1;output=$(makedhcp -q $$CN);[ $? -ne 0 ] && exit 1;echo $output|grep $$CN 2>/dev/null && exit 0;a=$[$a+1];sleep 1;done check:rc==0 -check:output=~$$CN cmd:copycds $$ISO check:rc==0 -cmd:chdef -t node -o $$CN postscripts=setupntp +cmd:if [ "__GETNODEATTR($$CN,os)__" != "sles12.1" ];then chdef -t node -o $$CN postscripts=setupntp; fi +cmd:lsdef -l $$CN check:rc==0 -cmd:nodeset $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute -check:rc==0 -cmd:lsdef $$CN |grep provmethod -check:rc==0 -check:output=~__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute -cmd:if [[ "__GETNODEATTR($$CN,mgt)__" = "ipmi" ]]; then rsetboot $$CN net; fi -check:rc==0 -cmd:if [ "__GETNODEATTR($$CN,mgt)__" != "ipmi" ];then if [ "__GETNODEATTR($$CN,arch)__" = "ppc64" ];then rnetboot $$CN;else rpower $$CN boot;fi else rpower $$CN boot;fi +cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute check:rc==0 +check:output=~Provision node\(s\)\: $$CN cmd:sleep 300 cmd:a=0;while ! `lsdef -l $$CN|grep status|grep booted >/dev/null`; do sleep 20;((a++));if [ $a -gt 300 ];then break;fi done diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_hierarchy b/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_hierarchy index 355887076..86ac6d80f 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_hierarchy +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskfull_installation_hierarchy @@ -23,19 +23,14 @@ cmd:makedhcp -n check:rc==0 cmd:makedhcp -a check:rc==0 -cmd:makedhcp -q $$CN -check:output=~$$CN +cmd:a=0;while true; do [ $a -eq 100 ] && exit 1;output=$(makedhcp -q $$CN);[ $? -ne 0 ] && exit 1;echo $output|grep $$CN 2>/dev/null && exit 0;a=$[$a+1];sleep 1;done check:rc==0 cmd:copycds $$ISO check:rc==0 -cmd:nodeset $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute -check:rc==0 -cmd:lsdef $$CN |grep provmethod -check:rc==0 -check:output=~__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute -cmd:if [[ "__GETNODEATTR($$CN,arch)__" = "ppc64" ]]; then rnetboot $$CN;else rpower $$CN boot; fi +cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute check:rc==0 +check:output=~Provision node\(s\)\: $$CN cmd:if [[ "__GETNODEATTR($$CN,arch)__" =~ "ppc" ]]; then sleep 120;elif [[ "__GETNODEATTR($$CN,arch)__" =~ "x86_64" ]];then sleep 200;else sleep 180;fi diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat index 32cd3a986..227085f4a 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat @@ -1,5 +1,6 @@ start:reg_linux_diskless_installation_flat os:Linux +stop:yes cmd:chdef -t node -o $$CN servicenode= monserver=$$MN nfsserver=$$MN tftpserver=$$MN xcatmaster=$$MN check:rc==0 @@ -17,9 +18,8 @@ cmd:makedhcp -n check:rc==0 cmd:makedhcp -a check:rc==0 -cmd:makedhcp -q $$CN +cmd:a=0;while true; do [ $a -eq 100 ] && exit 1;output=$(makedhcp -q $$CN);[ $? -ne 0 ] && exit 1;echo $output|grep $$CN 2>/dev/null && exit 0;a=$[$a+1];sleep 1;done check:rc==0 -check:output=~$$CN cmd:copycds $$ISO check:rc==0 @@ -47,14 +47,9 @@ cmd:rm -rf /tmp/mountoutput cmd:packimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute check:rc==0 -cmd:nodeset $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute -check:rc==0 -cmd:lsdef $$CN |grep provmethod -check:rc==0 -check:output=~__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute - -cmd:if [[ "__GETNODEATTR($$CN,arch)__" =~ "ppc64" ]]; then rnetboot $$CN;elif [[ "__GETNODEATTR($$CN,arch)__" =~ "x86_64" ]];then rpower $$CN boot; fi +cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute check:rc==0 +check:output=~Provision node\(s\)\: $$CN cmd:sleep 900 cmd:a=0;while ! `lsdef -l $$CN|grep status|grep booted >/dev/null`; do sleep 10;((a++));if [ $a -gt 60 ];then break;fi done diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy index 43de73914..83d12c37a 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy @@ -1,5 +1,6 @@ start:reg_linux_diskless_installation_hierarchy os:Linux +stop:yes cmd:chdef -t node -o $$CN servicenode=$$SN monserver=$$SN nfsserver=$$SN tftpserver=$$SN xcatmaster=$$SN check:rc==0 @@ -21,9 +22,8 @@ cmd:makedhcp -a check:rc==0 cmd:service dhcpd restart check:rc==0 -cmd:makedhcp -q $$CN +cmd:a=0;while true; do [ $a -eq 100 ] && exit 1;output=$(makedhcp -q $$CN);[ $? -ne 0 ] && exit 1;echo $output|grep $$CN 2>/dev/null && exit 0;a=$[$a+1];sleep 1;done check:rc==0 -check:output=~$$CN cmd:copycds $$ISO check:rc==0 @@ -43,13 +43,10 @@ check:rc==0 cmd:packimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute check:rc==0 -cmd:nodeset $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute -check:rc==0 -cmd:lsdef $$CN |grep provmethod -check:rc==0 -check:output=~__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute -cmd:if [[ "__GETNODEATTR($$CN,arch)__" = "ppc64" ]]; then rnetboot $$CN;else rpower $$CN boot; fi + +cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute check:rc==0 +check:output=~Provision node\(s\)\: $$CN cmd:sleep 900 cmd:a=0;while ! `lsdef -l $$CN|grep status|grep booted >/dev/null`; do sleep 10;((a++));if [ $a -gt 60 ];then break;fi done diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_flat b/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_flat index f70ef0b70..e36a65826 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_flat +++ b/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_flat @@ -1,5 +1,6 @@ start:reg_linux_statelite_installation_flat os:Linux +stop:yes cmd:chdef -t node -o $$CN servicenode= monserver=$$MN nfsserver=$$MN tftpserver=$$MN xcatmaster=$$MN check:rc==0 @@ -58,13 +59,9 @@ check:rc==0 cmd:liteimg __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-statelite-compute check:rc==0 -cmd:nodeset $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-statelite-compute -check:rc==0 -cmd:lsdef $$CN |grep provmethod -check:rc==0 -check:output=~statelite -cmd:if [[ "__GETNODEATTR($$CN,arch)__" = "ppc64" ]]; then rnetboot $$CN;else rpower $$CN boot; fi +cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-statelite-compute check:rc==0 +check:output=~Provision node\(s\)\: $$CN cmd:sleep 900 cmd:a=0;while ! `lsdef -l $$CN|grep status|grep booted >/dev/null`; do sleep 10;((a++));if [ $a -gt 60 ];then break;fi done @@ -93,13 +90,10 @@ check:rc==0 cmd:liteimg __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-statelite-compute check:rc==0 -cmd:nodeset $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-statelite-compute -check:rc==0 -cmd:lsdef $$CN |grep provmethod -check:rc==0 -check:output=~__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-statelite-compute -cmd:if [[ "__GETNODEATTR($$CN,arch)__" = "ppc64" ]]; then rnetboot $$CN;else rpower $$CN boot; fi +cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-statelite-compute check:rc==0 +check:output=~Provision node\(s\)\: $$CN + cmd:sleep 900 cmd:a=0;while ! `lsdef -l $$CN|grep status|grep booted >/dev/null`; do sleep 10;((a++));if [ $a -gt 60 ];then break;fi done diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_nfs b/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_nfs index 316c12604..64098d579 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_nfs +++ b/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_nfs @@ -66,13 +66,9 @@ check:rc==0 cmd:prsync /install $$SN:/ check:rc==0 -cmd:nodeset $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-statelite-compute -check:rc==0 -cmd:lsdef $$CN |grep provmethod -check:rc==0 -check:output=~statelite -cmd:if [[ "__GETNODEATTR($$CN,arch)__" = "ppc64" ]]; then rnetboot $$CN;else rpower $$CN boot; fi +cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-statelite-compute check:rc==0 +check:output=~Provision node\(s\)\: $$CN cmd:sleep 900 cmd:a=0;while ! `lsdef -l $$CN|grep status|grep booted >/dev/null`; do sleep 10;((a++));if [ $a -gt 60 ];then break;fi done diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_ramdisk b/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_ramdisk index e2bd85350..ab4d5d101 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_ramdisk +++ b/xCAT-test/autotest/testcase/installation/reg_linux_statelite_installation_hierarchy_by_ramdisk @@ -68,13 +68,10 @@ check:rc==0 cmd:prsync /install $$SN:/ check:rc==0 -cmd:nodeset $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-statelite-compute -check:rc==0 -cmd:lsdef $$CN |grep provmethod -check:rc==0 -check:output=~__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-statelite-compute -cmd:if [[ "__GETNODEATTR($$CN,arch)__" = "ppc64" ]]; then rnetboot $$CN;else rpower $$CN boot; fi + +cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-statelite-compute check:rc==0 +check:output=~Provision node\(s\)\: $$CN cmd:sleep 900 cmd:a=0;while ! `lsdef -l $$CN|grep status|grep booted >/dev/null`; do sleep 10;((a++));if [ $a -gt 60 ];then break;fi done diff --git a/xCAT-test/autotest/testcase/installation/setup_vm b/xCAT-test/autotest/testcase/installation/setup_vm new file mode 100644 index 000000000..7e02d8fb4 --- /dev/null +++ b/xCAT-test/autotest/testcase/installation/setup_vm @@ -0,0 +1,20 @@ +start:setup_vm +description:set up vm environment +cmd:var=`expr substr "__GETNODEATTR($$CN,vmstorage)__" 1 3`;echo $var;if [ "__GETNODEATTR($$CN,arch)__" != "ppc64" -a "__GETNODEATTR($$CN,mgt)__" != "ipmi" ];then rmvm $$CN -f -p;if [[ "$var" = "phy" ]]; then mkvm $$CN;exit $? ; elif [[ "$var" = "dir" ]];then mkvm $$CN ; rmvm $$CN -f -p ; mkvm $$CN -s 20G ;exit $? ;elif [ "$var" = "nfs" -o "$var" = "lvm" ];then echo "Need to fix me. ";exit 2;else echo "Could not surpport vmstorage.";exit 3;fi;fi +check:rc==0 +cmd:rpower $$CN on +check:rc==0 +cmd:rpower $$CN stat +check:output=~on +cmd:var=`expr substr "__GETNODEATTR($$SN,vmstorage)__" 1 3`;echo $var;if [ "__GETNODEATTR($$SN,arch)__" != "ppc64" -a "__GETNODEATTR($$SN,mgt)__" != "ipmi" ];then rmvm $$SN -f -p;if [[ "$var" = "phy" ]]; then mkvm $$SN;exit $? ; elif [[ "$var" = "dir" ]];then mkvm $$SN ; rmvm $$SN -f -p ; mkvm $$SN -s 20G ;exit $? ;elif [ "$var" = "nfs" -o "$var" = "lvm" ];then echo "Need to fix me. ";exit 2;else echo "Could not surpport vmstorage.";exit 3;fi;fi +check:rc==0 +cmd:rpower $$SN on +check:rc==0 +cmd:rpower $$SN stat +check:output=~on +#Add for debug rmvm issue +cmd:if [ "__GETNODEATTR($$CN,arch)__" != "ppc64" -a "__GETNODEATTR($$CN,mgt)__" != "ipmi" ]; then tabdump -w node==$$CN kvm_nodedata; fi +check:rc==0 +cmd:if [ "__GETNODEATTR($$SN,arch)__" != "ppc64" -a "__GETNODEATTR($$SN,mgt)__" != "ipmi" ]; then tabdump -w node==$$SN kvm_nodedata; fi +check:rc==0 +end diff --git a/xCAT-test/autotest/testcase/installation/ubuntu_diskless_installation_vm b/xCAT-test/autotest/testcase/installation/ubuntu_diskless_installation_vm index 568c3125f..107cca3dc 100644 --- a/xCAT-test/autotest/testcase/installation/ubuntu_diskless_installation_vm +++ b/xCAT-test/autotest/testcase/installation/ubuntu_diskless_installation_vm @@ -15,9 +15,8 @@ cmd:makedhcp -n check:rc==0 cmd:makedhcp -a check:rc==0 -cmd:makedhcp -q $$CN +cmd:a=0;while true; do [ $a -eq 100 ] && exit 1;output=$(makedhcp -q $$CN);[ $? -ne 0 ] && exit 1;echo $output|grep $$CN 2>/dev/null && exit 0;a=$[$a+1];sleep 1;done check:rc==0 -check:output=~$$CN cmd:makeconservercf $$CN check:rc==0 cmd:rootimgdir=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute|grep rootimgdir|awk -F'=' '{print $2}'`; if [ -d $rootimgdir ]; then mv $rootimgdir $rootimgdir.regbak -f;fi @@ -26,10 +25,9 @@ cmd:genimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute check:rc==0 cmd:packimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute check:rc==0 -cmd:nodeset $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute -check:rc==0 -cmd:rpower $$CN boot +cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute check:rc==0 +check:output=~Provision node\(s\)\: $$CN cmd:sleep 200 cmd:a=0;while ! `lsdef -l $$CN|grep status|grep booted >/dev/null`; do sleep 10;((a++));if [ $a -gt 300 ];then break;fi done cmd:lsdef -l $$CN | grep status @@ -38,9 +36,7 @@ cmd:xdsh $$CN date check:rc==0 check:output=~\d\d:\d\d:\d\d cmd:xdsh $$CN "cat /var/log/xcat/xcat.log" -cmd:nodeset $$CN osimage -check:rc==0 -cmd:rpower $$CN reset +cmd:rinstall $$CN osimage check:rc==0 cmd:sleep 200 cmd:lsdef -l $$CN | grep status diff --git a/xCAT-test/autotest/testcase/installation/ubuntu_full_installation_vm b/xCAT-test/autotest/testcase/installation/ubuntu_full_installation_vm index 274ad028f..35f0dd22b 100644 --- a/xCAT-test/autotest/testcase/installation/ubuntu_full_installation_vm +++ b/xCAT-test/autotest/testcase/installation/ubuntu_full_installation_vm @@ -10,17 +10,15 @@ cmd:makedhcp -n check:rc==0 cmd:makedhcp -a check:rc==0 -cmd:makedhcp -q $$CN +cmd:a=0;while true; do [ $a -eq 100 ] && exit 1;output=$(makedhcp -q $$CN);[ $? -ne 0 ] && exit 1;echo $output|grep $$CN 2>/dev/null && exit 0;a=$[$a+1];sleep 1;done check:rc==0 -check:output=~$$CN cmd:makeconservercf $$CN check:rc==0 cmd:cat /etc/conserver.cf | grep $$CN check:output=~$$CN -cmd:nodeset $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute -check:rc==0 -cmd:rpower $$CN boot +cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute check:rc==0 +check:output=~Provision node\(s\)\: $$CN cmd:sleep 300 cmd:a=0;while ! `lsdef -l $$CN|grep status|grep booted >/dev/null`; do sleep 10;((a++));if [ $a -gt 300 ];then break;fi done cmd:ping $$CN -c 3 diff --git a/xCAT-test/autotest/testcase/installation/ubuntu_full_installation_vm_docker b/xCAT-test/autotest/testcase/installation/ubuntu_full_installation_vm_docker index e6d948e68..573974230 100644 --- a/xCAT-test/autotest/testcase/installation/ubuntu_full_installation_vm_docker +++ b/xCAT-test/autotest/testcase/installation/ubuntu_full_installation_vm_docker @@ -2,11 +2,6 @@ start:Full_installation_flat_docker os:Linux cmd:copycds $$ISO check:rc==0 -cmd:if [[ "__GETNODEATTR($$CN,arch)__" != "ppc64" ]]; then tabdump -w node==$$CN kvm_nodedata; fi -check:rc==0 -#cmd:if [ "__GETNODEATTR($$CN,arch)__" != "ppc64" -a "__GETNODEATTR($$CN,mgt)__" != "ipmi" ];then if [[ "__GETNODEATTR($$CN,vmstorage)__" =~ "phy" ]]; then rmvm $$CN -f -p && mkvm $$CN; else rmvm $$CN -f -p && mkvm $$CN -s 20G; fi;fi -cmd:if [ "__GETNODEATTR($$CN,arch)__" != "ppc64" -a "__GETNODEATTR($$CN,mgt)__" != "ipmi" ];then if [[ "__GETNODEATTR($$CN,vmstorage)__" =~ "phy" ]]; then rmvm $$CN -f -p; mkvm $$CN; else rmvm $$CN -f -p;mkvm $$CN;rmvm $$CN -f -p;mkvm $$CN -s 20G; fi;fi -check:rc=0 cmd:makedns -n check:rc==0 cmd:makeconservercf @@ -25,12 +20,10 @@ cmd:if [[ "__GETNODEATTR($$CN,os)__" =~ "ubuntu14.04" ]];then ver=`cat /etc/*-re check:rc==0 cmd: chdef $$CN -p postbootscripts="setupdockerhost mynet0=$$MYNET0VALUE@$$DOCKERHOSIP:$$NICNAME" check:rc==0 -cmd:nodeset $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-dockerhost -check:rc==0 -cmd:rpower $$CN boot +cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-dockerhost check:rc==0 +check:output=~Provision node\(s\)\: $$CN -cmd:sleep 900 cmd:a=0;while ! `lsdef -l $$CN|grep status|grep booted >/dev/null`; do sleep 10;((a++));if [ $a -gt 60 ];then break;fi done cmd:ping $$CN -c 3 @@ -43,7 +36,8 @@ check:rc==0 cmd:xdsh $$CN "docker -v" check:output=~Docker version check:rc==0 -cmd:xdsh $$CN "docker pull $$DOCKERIMAGE" + +cmd:a=0;while true; do [ $a -eq 100 ] && exit 1;xdsh $$CN "docker pull $$DOCKERIMAGE";output=$(xdsh $$CN "docker images");echo $output|grep $$DOCKERIMAGE 2>/dev/null && exit 0;a=$[$a+1];sleep 1;done check:rc==0 cmd:rmdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-dockerhost check:rc==0 diff --git a/xCAT-test/autotest/testcase/makentp/cases0 b/xCAT-test/autotest/testcase/makentp/cases0 index b47ff3316..17ac57c65 100644 --- a/xCAT-test/autotest/testcase/makentp/cases0 +++ b/xCAT-test/autotest/testcase/makentp/cases0 @@ -100,3 +100,22 @@ check:rc==0 cmd:rm -rf /tmp/postscript end + +start:makentp_initialize +descriptiop:start ntp service on management node and synchronize time with external ntp server +cmd:chtab key=extntpservers site.value="$$extntpserversip" +check:rc==0 +cmd:makentp -V +check:rc==0 +check:output=~configuring management node: $$MN +check:output=~checking if nptd is installed +check:output=~backing up the ntp configuration file /etc/ntp.conf +check:output=~ntp servers are: $$extntpserversip +check:output=~stopping ntpserver +check:output=~starting ntpserver +check:output=~enabling ntpserver +cmd:if [[ "__GETNODEATTR($$CN,os)__" =~ "ubuntu" ]] || [[ "__GETNODEATTR($$CN,os)__" = "sles11.4" ]];then service ntp status;else service ntpd status; fi +check:rc==0 +cmd:a=0;until ntpq -n -c peers | tail -n +2 | grep -q '^*'; do sleep 30;((a++));if [ $a -gt 30 ];then exit 1;fi done +check:rc==0 +end diff --git a/xCAT-test/autotest/testcase/migration/redhat_migration b/xCAT-test/autotest/testcase/migration/redhat_migration index a5fad7718..27a489882 100644 --- a/xCAT-test/autotest/testcase/migration/redhat_migration +++ b/xCAT-test/autotest/testcase/migration/redhat_migration @@ -1,13 +1,10 @@ start:redhat_migration1 os:Linux -description:update xCAT from $$MIGRATION1_VERSION to $$LATEST_VERSION, these two global parameter defined in config file +description:update xCAT from $$MIGRATION1_VERSION to latest version, these two global parameter defined in config file #cmd:if ping -c 1 $$SN > /dev/null;then rpower $$SN off > /dev/null;fi #cmd:chdef -t node -o $$CN servicenode= monserver=$$MN nfsserver=$$MN tftpserver=$$MN xcatmaster=$$MN #check:rc==0 -cmd:if [[ "__GETNODEATTR($$CN,arch)__" != "ppc64" ]]; then tabdump -w node==$$CN kvm_nodedata; fi -check:rc==0 -cmd:if [ "__GETNODEATTR($$CN,arch)__" != "ppc64" -a "__GETNODEATTR($$CN,mgt)__" != "ipmi" ];then if [[ "__GETNODEATTR($$CN,vmstorage)__" =~ "phy" ]]; then rmvm $$CN -f -p; mkvm $$CN; else rmvm $$CN -f -p;mkvm $$CN;rmvm $$CN -f -p;mkvm $$CN -s 20G; fi;fi cmd:rscan __GETNODEATTR($$CN,hcp)__ -w check:rc==0 cmd:makedns -n @@ -31,15 +28,9 @@ cmd:if cat /etc/*release |grep SUSE >/dev/null;then cat /var/lib/dhcp/db/dhcpd.l check:output=~$$CN cmd:copycds $$ISO check:rc==0 -cmd:nodeset $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute -check:rc==0 -cmd:lsdef $$CN |grep provmethod -check:rc==0 -check:output=~__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute -cmd:if [[ "__GETNODEATTR($$CN,mgt)__" = "ipmi" ]]; then rsetboot $$CN net; fi -check:rc==0 -cmd:if [ "__GETNODEATTR($$CN,mgt)__" != "ipmi" ];then if [ "__GETNODEATTR($$CN,arch)__" = "ppc64" ];then rnetboot $$CN;else rpower $$CN boot;fi else rpower $$CN boot;fi +cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute check:rc==0 +check:output=~Provision node\(s\)\: $$CN cmd:sleep 600 cmd:lsdef -l $$CN | grep status cmd:a=0;while ! `lsdef -l $$CN|grep status|grep booted >/dev/null`; do sleep 10;((a++));if [ $a -gt 300 ];then break;fi done @@ -103,22 +94,18 @@ cmd:xdsh $$CN "lsdef" check:output=~node0001 cmd:xdsh $$CN "noderm node0001" check:rc==0 -cmd:xdsh $$CN "lsxcatd -v" +cmd:latest_version_info=`lsxcatd -v`;xdsh $$CN "lsxcatd -v" | grep "$latest_version_info" check:rc==0 -check:output=~$$LATEST_VERSION end start:redhat_migration2 os:Linux -description:update xCAT from $$MIGRATION2_VERSION to $$LATEST_VERSION, these two global parameter defined in config file +description:update xCAT from $$MIGRATION2_VERSION to latest version, these two global parameter defined in config file stop:yes #cmd:if ping -c 1 $$SN > /dev/null;then rpower $$SN off > /dev/null;fi #cmd:chdef -t node -o $$CN servicenode= monserver=$$MN nfsserver=$$MN tftpserver=$$MN xcatmaster=$$MN #check:rc==0 -cmd:if [[ "__GETNODEATTR($$CN,arch)__" != "ppc64" ]]; then tabdump -w node==$$CN kvm_nodedata; fi -check:rc==0 -cmd:if [ "__GETNODEATTR($$CN,arch)__" != "ppc64" -a "__GETNODEATTR($$CN,mgt)__" != "ipmi" ];then if [[ "__GETNODEATTR($$CN,vmstorage)__" =~ "phy" ]]; then rmvm $$CN -f -p; mkvm $$CN; else rmvm $$CN -f -p;mkvm $$CN;rmvm $$CN -f -p;mkvm $$CN -s 20G; fi;fi cmd:rscan __GETNODEATTR($$CN,hcp)__ -w check:rc==0 cmd:makedns -n @@ -142,15 +129,9 @@ cmd:if cat /etc/*release |grep SUSE >/dev/null;then cat /var/lib/dhcp/db/dhcpd.l check:output=~$$CN cmd:copycds $$ISO check:rc==0 -cmd:nodeset $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute -check:rc==0 -cmd:lsdef $$CN |grep provmethod -check:rc==0 -check:output=~__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute -cmd:if [[ "__GETNODEATTR($$CN,mgt)__" = "ipmi" ]]; then rsetboot $$CN net; fi -check:rc==0 -cmd:if [ "__GETNODEATTR($$CN,mgt)__" != "ipmi" ];then if [ "__GETNODEATTR($$CN,arch)__" = "ppc64" ];then rnetboot $$CN;else rpower $$CN boot;fi else rpower $$CN boot;fi +cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute check:rc==0 +check:output=~Provision node\(s\)\: $$CN cmd:sleep 600 cmd:lsdef -l $$CN | grep status cmd:a=0;while ! `lsdef -l $$CN|grep status|grep booted >/dev/null`; do sleep 10;((a++));if [ $a -gt 300 ];then break;fi done @@ -214,8 +195,7 @@ cmd:xdsh $$CN "lsdef" check:output=~node0001 cmd:xdsh $$CN "noderm node0001" check:rc==0 -cmd:xdsh $$CN "lsxcatd -v" +cmd:latest_version_info=`lsxcatd -v`;xdsh $$CN "lsxcatd -v" | grep "$latest_version_info" check:rc==0 -check:output=~$$LATEST_VERSION end diff --git a/xCAT-test/autotest/testcase/migration/sles_migration b/xCAT-test/autotest/testcase/migration/sles_migration index a41e56828..7a7236475 100644 --- a/xCAT-test/autotest/testcase/migration/sles_migration +++ b/xCAT-test/autotest/testcase/migration/sles_migration @@ -1,13 +1,10 @@ start:sles_migration1 os:Linux -description:update xCAT from $$MIGRATION1_VERSION to $$LATEST_VERSION, these two global parameter defined in config file +description:update xCAT from $$MIGRATION1_VERSION to latest version, these two global parameter defined in config file #cmd:if ping -c 1 $$SN > /dev/null;then rpower $$SN off > /dev/null;fi #cmd:chdef -t node -o $$CN servicenode= monserver=$$MN nfsserver=$$MN tftpserver=$$MN xcatmaster=$$MN #check:rc==0 -cmd:if [[ "__GETNODEATTR($$CN,arch)__" != "ppc64" ]]; then tabdump -w node==$$CN kvm_nodedata; fi -check:rc==0 -cmd:if [ "__GETNODEATTR($$CN,arch)__" != "ppc64" -a "__GETNODEATTR($$CN,mgt)__" != "ipmi" ];then if [[ "__GETNODEATTR($$CN,vmstorage)__" =~ "phy" ]]; then rmvm $$CN -f -p; mkvm $$CN; else rmvm $$CN -f -p;mkvm $$CN;rmvm $$CN -f -p;mkvm $$CN -s 20G; fi;fi cmd:rscan __GETNODEATTR($$CN,hcp)__ -w check:rc==0 cmd:makedns -n @@ -31,15 +28,9 @@ cmd:if cat /etc/*release |grep SUSE >/dev/null;then cat /var/lib/dhcp/db/dhcpd.l check:output=~$$CN cmd:copycds $$ISO check:rc==0 -cmd:nodeset $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute -check:rc==0 -cmd:lsdef $$CN |grep provmethod -check:rc==0 -check:output=~__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute -cmd:if [[ "__GETNODEATTR($$CN,mgt)__" = "ipmi" ]]; then rsetboot $$CN net; fi -check:rc==0 -cmd:if [ "__GETNODEATTR($$CN,mgt)__" != "ipmi" ];then if [ "__GETNODEATTR($$CN,arch)__" = "ppc64" ];then rnetboot $$CN;else rpower $$CN boot;fi else rpower $$CN boot;fi +cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute check:rc==0 +check:output=~Provision node\(s\)\: $$CN cmd:sleep 600 cmd:lsdef -l $$CN | grep status cmd:a=0;while ! `lsdef -l $$CN|grep status|grep booted >/dev/null`; do sleep 10;((a++));if [ $a -gt 300 ];then break;fi done @@ -106,21 +97,17 @@ cmd:xdsh $$CN "lsdef" check:output=~node0001 cmd:xdsh $$CN "noderm node0001" check:rc==0 -cmd:xdsh $$CN "lsxcatd -v" +cmd:latest_version_info=`lsxcatd -v`;xdsh $$CN "lsxcatd -v" | grep "$latest_version_info" check:rc==0 -check:output=~$$LATEST_VERSION end start:sles_migration2 os:Linux -description:update xCAT from $$MIGRATION22VERSION to $$LATEST_VERSION, these two global parameter defined in config file +description:update xCAT from $$MIGRATION22VERSION to latest version, these two global parameter defined in config file #cmd:if ping -c 1 $$SN > /dev/null;then rpower $$SN off > /dev/null;fi #cmd:chdef -t node -o $$CN servicenode= monserver=$$MN nfsserver=$$MN tftpserver=$$MN xcatmaster=$$MN #check:rc==0 -cmd:if [[ "__GETNODEATTR($$CN,arch)__" != "ppc64" ]]; then tabdump -w node==$$CN kvm_nodedata; fi -check:rc==0 -cmd:if [ "__GETNODEATTR($$CN,arch)__" != "ppc64" -a "__GETNODEATTR($$CN,mgt)__" != "ipmi" ];then if [[ "__GETNODEATTR($$CN,vmstorage)__" =~ "phy" ]]; then rmvm $$CN -f -p; mkvm $$CN; else rmvm $$CN -f -p;mkvm $$CN;rmvm $$CN -f -p;mkvm $$CN -s 20G; fi;fi cmd:rscan __GETNODEATTR($$CN,hcp)__ -w check:rc==0 cmd:makedns -n @@ -144,15 +131,9 @@ cmd:if cat /etc/*release |grep SUSE >/dev/null;then cat /var/lib/dhcp/db/dhcpd.l check:output=~$$CN cmd:copycds $$ISO check:rc==0 -cmd:nodeset $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute -check:rc==0 -cmd:lsdef $$CN |grep provmethod -check:rc==0 -check:output=~__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute -cmd:if [[ "__GETNODEATTR($$CN,mgt)__" = "ipmi" ]]; then rsetboot $$CN net; fi -check:rc==0 -cmd:if [ "__GETNODEATTR($$CN,mgt)__" != "ipmi" ];then if [ "__GETNODEATTR($$CN,arch)__" = "ppc64" ];then rnetboot $$CN;else rpower $$CN boot;fi else rpower $$CN boot;fi +cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute check:rc==0 +check:output=~Provision node\(s\)\: $$CN cmd:sleep 600 cmd:lsdef -l $$CN | grep status cmd:a=0;while ! `lsdef -l $$CN|grep status|grep booted >/dev/null`; do sleep 10;((a++));if [ $a -gt 300 ];then break;fi done @@ -219,8 +200,7 @@ cmd:xdsh $$CN "lsdef" check:output=~node0001 cmd:xdsh $$CN "noderm node0001" check:rc==0 -cmd:xdsh $$CN "lsxcatd -v" +cmd:latest_version_info=`lsxcatd -v`;xdsh $$CN "lsxcatd -v" | grep "$latest_version_info" check:rc==0 -check:output=~$$LATEST_VERSION end diff --git a/xCAT-test/autotest/testcase/migration/ubuntu_migration1_p8le b/xCAT-test/autotest/testcase/migration/ubuntu_migration1_p8le index 3e6d26560..cf77bd24f 100644 --- a/xCAT-test/autotest/testcase/migration/ubuntu_migration1_p8le +++ b/xCAT-test/autotest/testcase/migration/ubuntu_migration1_p8le @@ -1,6 +1,6 @@ start:ubuntu_migration1_p8le os:Linux -description:update xCAT from $$UBUNTU_MIGRATION1_VERSION to $$LATEST_VERSION, these two global parameter defined in config file +description:update xCAT from $$UBUNTU_MIGRATION1_VERSION to latest version, these two global parameter defined in config file cmd:copycds $$ISO check:rc==0 @@ -16,10 +16,9 @@ cmd:makeconservercf $$CN check:rc==0 cmd:cat /etc/conserver.cf | grep $$CN check:output=~$$CN -cmd:nodeset $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute -check:rc==0 -cmd:rpower $$CN boot +cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute check:rc==0 +check:output=~Provision node\(s\)\: $$CN cmd:sleep 600 cmd:a=0;while ! `lsdef -l $$CN|grep status|grep booted >/dev/null`; do sleep 60;((a++));if [ $a -gt 50 ];then break;fi done cmd:ping $$CN -c 3 @@ -104,11 +103,13 @@ cmd:xdsh $$CN "apt-get clean all" check:rc==0 cmd:xdsh $$CN "apt-get update" check:rc==0 -cmd:xdsh $$CN "apt-get -y upgrade xcat xcat-test" +cmd:xdsh $$CN "apt-get -y --only-upgrade install .*xcat.*" check:rc==0 cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsxcatd -v > /newxcat/new_version" check:rc==0 -cmd:xdsh $$CN "cat /newxcat/new_version|grep $$LATEST_VERSION" +cmd:lsxcatd -v > /latest_version_info;scp /latest_version_info root@$$CN:/newxcat/ +check:rc==0 +cmd:xdsh $$CN diff /newxcat/latest_version_info /newxcat/new_version check:rc==0 cmd:xdsh $$CN "service xcatd status" check:rc==0 diff --git a/xCAT-test/autotest/testcase/migration/ubuntu_migration1_vm b/xCAT-test/autotest/testcase/migration/ubuntu_migration1_vm index 7b7133c17..636553292 100644 --- a/xCAT-test/autotest/testcase/migration/ubuntu_migration1_vm +++ b/xCAT-test/autotest/testcase/migration/ubuntu_migration1_vm @@ -1,6 +1,6 @@ start:ubuntu_migration1_vm os:Linux -description:update xCAT from $$UBUNTU_MIGRATION1_VERSION to $$LATEST_VERSION, these two global parameter defined in config file +description:update xCAT from $$UBUNTU_MIGRATION1_VERSION to latest version, these two global parameter defined in config file cmd:copycds $$ISO check:rc==0 @@ -15,10 +15,9 @@ cmd:makeconservercf $$CN check:rc==0 cmd:cat /etc/conserver.cf | grep $$CN check:output=~$$CN -cmd:nodeset $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute -check:rc==0 -cmd:rpower $$CN boot +cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute check:rc==0 +check:output=~Provision node\(s\)\: $$CN cmd:sleep 600 cmd:a=0;while ! `lsdef -l $$CN|grep status|grep booted >/dev/null`; do sleep 60;((a++));if [ $a -gt 50 ];then break;fi done cmd:ping $$CN -c 3 @@ -103,11 +102,13 @@ cmd:xdsh $$CN "apt-get clean all" check:rc==0 cmd:xdsh $$CN "apt-get update" check:rc==0 -cmd:xdsh $$CN "apt-get -y upgrade xcat xcat-test" +cmd:xdsh $$CN "apt-get -y --only-upgrade install .*xcat.*" check:rc==0 cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsxcatd -v > /newxcat/new_version" check:rc==0 -cmd:xdsh $$CN "cat /newxcat/new_version|grep $$LATEST_VERSION" +cmd:lsxcatd -v > /latest_version_info;scp /latest_version_info root@$$CN:/newxcat/ +check:rc==0 +cmd:xdsh $$CN diff /newxcat/latest_version_info /newxcat/new_version check:rc==0 cmd:xdsh $$CN "service xcatd status" check:rc==0 diff --git a/xCAT-test/autotest/testcase/migration/ubuntu_migration2_p8le b/xCAT-test/autotest/testcase/migration/ubuntu_migration2_p8le index 25d1707cc..1d3216e8c 100644 --- a/xCAT-test/autotest/testcase/migration/ubuntu_migration2_p8le +++ b/xCAT-test/autotest/testcase/migration/ubuntu_migration2_p8le @@ -1,6 +1,6 @@ start:ubuntu_migration2_p8le os:Linux -description:update xCAT from $$UBUNTU_MIGRATION2_VERSION to $$LATEST_VERSION, these two global parameter defined in config file +description:update xCAT from $$UBUNTU_MIGRATION2_VERSION to latest version, these two global parameter defined in config file cmd:copycds $$ISO check:rc==0 @@ -16,10 +16,9 @@ cmd:makeconservercf $$CN check:rc==0 cmd:cat /etc/conserver.cf | grep $$CN check:output=~$$CN -cmd:nodeset $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute -check:rc==0 -cmd:rpower $$CN boot +cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute check:rc==0 +check:output=~Provision node\(s\)\: $$CN cmd:sleep 300 cmd:a=0;while ! `lsdef -l $$CN|grep status|grep booted >/dev/null`; do sleep 10;((a++));if [ $a -gt 300 ];then break;fi done cmd:ping $$CN -c 3 @@ -104,11 +103,13 @@ cmd:xdsh $$CN "apt-get clean all" check:rc==0 cmd:xdsh $$CN "apt-get update" check:rc==0 -cmd:xdsh $$CN "apt-get -y upgrade xcat xcat-test" +cmd:xdsh $$CN "apt-get -y --only-upgrade install .*xcat.*" check:rc==0 cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsxcatd -v > /newxcat/new_version" check:rc==0 -cmd:xdsh $$CN "cat /newxcat/new_version|grep $$LATEST_VERSION" +cmd:lsxcatd -v > /latest_version_info;scp /latest_version_info root@$$CN:/newxcat/ +check:rc==0 +cmd:xdsh $$CN diff /newxcat/latest_version_info /newxcat/new_version check:rc==0 cmd:xdsh $$CN "service xcatd status" check:rc==0 diff --git a/xCAT-test/autotest/testcase/migration/ubuntu_migration2_vm b/xCAT-test/autotest/testcase/migration/ubuntu_migration2_vm index c8acb1318..34c7123cb 100644 --- a/xCAT-test/autotest/testcase/migration/ubuntu_migration2_vm +++ b/xCAT-test/autotest/testcase/migration/ubuntu_migration2_vm @@ -1,6 +1,6 @@ start:ubuntu_migration2_vm os:Linux -description:update xCAT from $$UBUNTU_MIGRATION2_VERSION to $$LATEST_VERSION, these two global parameter defined in config file +description:update xCAT from $$UBUNTU_MIGRATION2_VERSION to latest version, these two global parameter defined in config file cmd:copycds $$ISO check:rc==0 @@ -15,10 +15,9 @@ cmd:makeconservercf $$CN check:rc==0 cmd:cat /etc/conserver.cf | grep $$CN check:output=~$$CN -cmd:nodeset $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute -check:rc==0 -cmd:rpower $$CN boot +cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute check:rc==0 +check:output=~Provision node\(s\)\: $$CN cmd:sleep 600 cmd:a=0;while ! `lsdef -l $$CN|grep status|grep booted >/dev/null`; do sleep 60;((a++));if [ $a -gt 50 ];then break;fi done cmd:ping $$CN -c 3 @@ -103,11 +102,13 @@ cmd:xdsh $$CN "apt-get clean all" check:rc==0 cmd:xdsh $$CN "apt-get update" check:rc==0 -cmd:xdsh $$CN "apt-get -y upgrade xcat xcat-test" +cmd:xdsh $$CN "apt-get -y --only-upgrade install .*xcat.*" check:rc==0 cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsxcatd -v > /newxcat/new_version" check:rc==0 -cmd:xdsh $$CN "cat /newxcat/new_version|grep $$LATEST_VERSION" +cmd:lsxcatd -v > /latest_version_info;scp /latest_version_info root@$$CN:/newxcat/ +check:rc==0 +cmd:xdsh $$CN diff /newxcat/latest_version_info /newxcat/new_version check:rc==0 cmd:xdsh $$CN "service xcatd status" check:rc==0 diff --git a/xCAT-test/autotest/testcase/osdeploy/cases0 b/xCAT-test/autotest/testcase/osdeploy/cases0 new file mode 100644 index 000000000..bb76c2f3b --- /dev/null +++ b/xCAT-test/autotest/testcase/osdeploy/cases0 @@ -0,0 +1,72 @@ +start:osdeploy_usage +description: osdeploy check usage +cmd:xcatprobe osdeploy -h +check:rc==0 +check:output~=Usage +check:output~=osdeploy -h +check:output~=Description +end + +start:osdeploy_n +description: osdeploy -n node to probe osdeploy +cmd:if [ -e /tmp/osdeploy.test ];then rm -rf /tmp/osdeploy.test*;fi +check:rc==0 +cmd:xcatprobe osdeploy -n $$CN >> /tmp/osdeploy.test & +check:rc==0 +cmd:nodeset $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute +check:rc==0 +cmd:rpower $$CN boot +check:rc==0 +cmd:sleep 300 +cmd:a=0;while ! `lsdef -l $$CN|grep status|grep booted >/dev/null`; do sleep 20;((a++));if [ $a -gt 300 ];then break;fi done +cmd:cat /tmp/osdeploy.test |grep "All nodes provisioned successfully"|grep OK +check:rc==0 +cmd:rm -rf /tmp/osdeploy.test +check:rc==0 +end + +start:osdeploy_n_r +description: osdeploy -n -r node to probe osdeploy to trigger 'Replay history' mode. +cmd:if [ -e /tmp/osdeploy.test ];then rm -rf /tmp/osdeploy.test*;fi +check:rc==0 +cmd:xcatprobe osdeploy -n $$CN >> /tmp/osdeploy.test & +check:rc==0 +cmd:nodeset $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute +check:rc==0 +cmd:rpower $$CN boot +check:rc==0 +cmd:sleep 300 +cmd:a=0;while ! `lsdef -l $$CN|grep status|grep booted >/dev/null`; do sleep 20;((a++));if [ $a -gt 300 ];then break;fi done +cmd:cat /tmp/osdeploy.test |grep "All nodes provisioned successfully"|grep OK +check:rc==0 +cmd:rm -rf /tmp/osdeploy.test +check:rc==0 +cmd:xcatprobe osdeploy -n $$CN -r 1h>> /tmp/osdeploy.test +check:rc==0 +cmd:cat /tmp/osdeploy.test |grep "All nodes provisioned successfully"|grep "OK" +check:rc==0 +cmd:rm -rf /tmp/osdeploy.test +check:rc==0 +cmd:xcatprobe osdeploy -n $$CN -r 5m >> /tmp/osdeploy.test +check:rc==0 +cmd:cat /tmp/osdeploy.test |grep "Without provision process during rollback time window"|grep "FAIL" +check:rc==0 +cmd:rm -rf /tmp/osdeploy.test +check:rc==0 +end + +start:osdeploy_n_t +description: osdeploy -n node -t 1m,probe osdeploy in 1min +cmd:if [ -e /tmp/osdeploy.test ];then rm -rf /tmp/osdeploy.test*;fi +check:rc==0 +cmd:xcatprobe osdeploy -n $$CN -t 1m >> /tmp/osdeploy.test & +check:rc==0 +cmd:sleep 120 +check:rc==0 +cmd: cat /tmp/osdeploy.test |grep "1m minutes have expired, stop monitoring" +check:rc==0 +cmd:rm -rf /tmp/osdeploy.test +check:rc==0 +end + + diff --git a/xCAT-test/autotest/testcase/packimg/cases0 b/xCAT-test/autotest/testcase/packimg/cases0 index b0e2d1502..d8f8f7c2d 100644 --- a/xCAT-test/autotest/testcase/packimg/cases0 +++ b/xCAT-test/autotest/testcase/packimg/cases0 @@ -198,10 +198,9 @@ check:output=~archive method:tar check:output=~compress method:pigz cmd:ls -l /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg.tar.gz check:rc==0 -cmd:nodeset $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute -check:rc==0 -cmd:if [[ "__GETNODEATTR($$CN,arch)__" = "ppc64" ]]; then rnetboot $$CN;else rpower $$CN boot; fi +cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute check:rc==0 +check:output=~Provision node\(s\)\: $$CN cmd:a=0;while ! `lsdef -l $$CN|grep status|grep booted >/dev/null`; do sleep 10;((a++));if [ $a -gt 150 ];then break;fi done cmd:ping $$CN -c 3 check:rc==0 @@ -239,10 +238,9 @@ check:output=~archive method:tar check:output=~compress method:gzip cmd:ls -l /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg.tar.gz check:rc==0 -cmd:nodeset $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute -check:rc==0 -cmd:if [[ "__GETNODEATTR($$CN,arch)__" = "ppc64" ]]; then rnetboot $$CN;else rpower $$CN boot; fi +cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute check:rc==0 +check:output=~Provision node\(s\)\: $$CN cmd:a=0;while ! `lsdef -l $$CN|grep status|grep booted >/dev/null`; do sleep 10;((a++));if [ $a -gt 150 ];then break;fi done cmd:ping $$CN -c 3 check:rc==0 @@ -280,10 +278,9 @@ check:output=~archive method:tar check:output=~compress method:xz cmd:ls -l /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg.tar.xz check:rc==0 -cmd:nodeset $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute -check:rc==0 -cmd:if [[ "__GETNODEATTR($$CN,arch)__" = "ppc64" ]]; then rnetboot $$CN;else rpower $$CN boot; fi +cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute check:rc==0 +check:output=~Provision node\(s\)\: $$CN cmd:a=0;while ! `lsdef -l $$CN|grep status|grep booted >/dev/null`; do sleep 10;((a++));if [ $a -gt 150 ];then break;fi done cmd:ping $$CN -c 3 check:rc==0 diff --git a/xCAT-test/autotest/testcase/prsync/cases0 b/xCAT-test/autotest/testcase/prsync/cases0 index babccfcf1..3d2120028 100644 --- a/xCAT-test/autotest/testcase/prsync/cases0 +++ b/xCAT-test/autotest/testcase/prsync/cases0 @@ -1,23 +1,29 @@ start:prsync_h +description: prsync -h +os:Linux cmd:prsync -h check:rc==0 check:output=~Usage end start:prsync_v +description: prsync -v +os:Linux cmd:prsync -v check:rc==0 check:output=~Version end start:prsync_dir_node +description: run prsync to copy files in dir from MN to CN +os:Linux cmd: mkdir -p /tmp/pscp check:rc==0 cmd:echo "test" > /tmp/pscp/pscp.tmp check:rc==0 cmd:prsync -o "crz" /tmp/pscp $$CN:/tmp/ check:rc==0 -check:$$CN: done +check:output=~$$CN: done cmd:xdsh $$CN "ls -l /tmp |grep pscp" check:rc==0 check:output=~pscp @@ -34,11 +40,13 @@ check:rc==0 end start:prsync_file_node +description: run prsync to copy file from MN to CN +os:Linux cmd: echo "prsync-test" > prsync.test check:rc==0 cmd:prsync prsync.test $$CN:/tmp/ check:rc==0 -check:$$CN: done +check:output=~$$CN: done cmd:xdsh $$CN "ls -l /tmp |grep prsync.test" check:rc==0 check:output=~prsync.test diff --git a/xCAT-test/autotest/testcase/psh/cases0 b/xCAT-test/autotest/testcase/psh/cases0 index d65fde5b5..fed79f18a 100644 --- a/xCAT-test/autotest/testcase/psh/cases0 +++ b/xCAT-test/autotest/testcase/psh/cases0 @@ -1,4 +1,6 @@ start:psh_h +description: psh -h and psh -help +os:Linux cmd:psh -h check:rc==0 check:output=~Usage @@ -8,17 +10,16 @@ check:output=~Usage end start:psh_v +description: psh -v +os:Linux cmd:psh -v -check:rc==0 -end - -start:psh_i -cmd:psh -i __GETNODEATTR($$CN,mgtifname)__ $$CN 'uptime' +check:output=~Version check:rc==0 end start:psh_node_cmd_linux -os:Aix +description: psh CN 'pwd' in linux +os:Linux cmd:psh $$CN 'pwd' check:rc==0 check:output=~$$CN @@ -26,10 +27,33 @@ check:output=~/ end start:psh_node_cmd_aix -os:Linux +description: psh CN 'pwd' in AIX +os:Aix cmd:psh $$CN 'pwd' check:rc==0 check:output=~$$CN check:output=~/root end +start:psh_l +description: psh -l user CN 'uptime' in linux +os:Linux +cmd:psh -l root $$CN 'uptime' +check:rc==0 +check:output=~$$CN +end + + +start:psh_i +description: psh -i interface CN 'uptime' in linux +os:Linux +cmd:cp /etc/hosts /etc/hostsBK +check:rc==0 +cmd:interface=`xdsh $$CN 'ifconfig' | sed -n 1p | awk -F : '{print $2}' | awk -F ' ' '{print $1}'`;sed -i "/$$CN/s/$/ $$CN-$interface/g" '/etc/hosts';psh -i $interface $$CN 'uptime' +check:output=~$$CN +check:rc==0 +cmd:rm -rf /etc/hosts +cmd:cp /etc/hostsBK /etc/hosts +check:rc==0 +end + diff --git a/xCAT-test/autotest/testcase/rinv/cases1 b/xCAT-test/autotest/testcase/rinv/cases1 new file mode 100644 index 000000000..292e9b915 --- /dev/null +++ b/xCAT-test/autotest/testcase/rinv/cases1 @@ -0,0 +1,70 @@ +start:rinv_serial +arch:ppc64le +hcp:ipmi +cmd:rinv $$CN serial +check:rc==0 +check:output=~NODE 1 Chassis Serial Number:\s*\w{7} +end + +start:rinv_model +arch:ppc64le +hcp:ipmi +cmd:rinv $$CN model +check:rc==0 +check:output=~NODE 1 Chassis Part Number\s*:\s*\w{4}-\w{3} +end + +start:rinv_firm +arch:ppc64le +hcp:ipmi +cmd:rinv $$CN firm +check:rc==0 +check:output=~BMC Firmware\s*:\s*\w+.\w+ +end + +start:rinv_deviceid +hcp:ipmi +arch:ppc64le +cmd:rinv $$CN deviceid +check:rc==0 +check:output=~Device ID:\s*\w+ +check:output=~Product ID:\s*\w+ +check:output=~Manufacturer ID:\s*\w+ +end + + +start:rinv_vpd +hcp:ipmi +arch:ppc64le +cmd:rinv $$CN vpd +check:rc==0 +check:output=~Manufacturer ID:\s*\w+ +check:output=~Device ID:\s*\w+ +check:output=~BMC Firmware:\s*\w+.\w+ +check:output=~NODE 1 Chassis Serial Number:\s*\w{7} +check:output=~NODE 1 Chassis Part Number\s*:\s*\w{4}-\w{3} +end + + +start:rinv_all +hcp:ipmi +arch:ppc64le +cmd:rinv $$CN all +check:rc==0 +check:output=~BMC Firmware:\s*\w+.\w+ +check:output=~BMCCARD Board Part Number:\s*\w{7} +check:output=~UUID/GUID:\s*\w+-\w+-\w+-\w+-\w+ +check:output=~Product ID:\s*\d+ +check:output=~Manufacturer ID:\s*\d+ +check:output=~Device ID:\s*\d+ +check:output=~BMCCARD Board Serial Number:\s*\w+ +end + +start:rinv_noderange_err +hcp:ipmi +arch:ppc64le +cmd:rinv testnode +check:rc!=0 +check:output=~Error +end + diff --git a/xCAT-test/autotest/testcase/runcmdinstaller/cases0 b/xCAT-test/autotest/testcase/runcmdinstaller/cases0 index 9505023c1..6e17e0224 100644 --- a/xCAT-test/autotest/testcase/runcmdinstaller/cases0 +++ b/xCAT-test/autotest/testcase/runcmdinstaller/cases0 @@ -8,10 +8,9 @@ start:runcmdinstaller_command descriptiop:runcmdinstaller cmd:chtab key=xcatdebugmode site.value="2" check:rc==0 -cmd:nodeset $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute -check:rc==0 -cmd:if [[ "__GETNODEATTR($$CN,arch)__" =~ "ppc64" ]]; then rnetboot $$CN;elif [[ "__GETNODEATTR($$CN,arch)__" =~ "x86_64" ]];then rpower $$CN boot; fi +cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute check:rc==0 +check:output=~Provision node\(s\)\: $$CN cmd:a=0;while ! `lsdef -l $$CN|grep status|grep installing >/dev/null`; do sleep 20;((a++));if [ $a -gt 30 ];then break;fi done cmd:lsdef -l $$CN | grep status cmd:runcmdinstaller $$CN "ls /" @@ -23,10 +22,9 @@ start:get_xcat_postscripts_loginfo description:get xcat post scripts loginfo cmd:chtab key=xcatdebugmode site.value="1" check:rc==0 -cmd:nodeset $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute -check:rc==0 -cmd:if [[ "__GETNODEATTR($$CN,arch)__" =~ "ppc64" ]]; then rnetboot $$CN;elif [[ "__GETNODEATTR($$CN,arch)__" =~ "x86_64" ]];then rpower $$CN boot; fi +cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute check:rc==0 +check:output=~Provision node\(s\)\: $$CN cmd:a=0;while ! `lsdef -l $$CN|grep status|grep booted >/dev/null`; do sleep 10;((a++));if [ $a -gt 300 ];then break;fi done cmd:cat /var/log/messages /var/log/xcat/computes.log 2>/dev/null | grep "Running post-installation scripts" cmd:rc==0 diff --git a/xCAT-test/autotest/testcase/rvitals/cases1 b/xCAT-test/autotest/testcase/rvitals/cases1 new file mode 100644 index 000000000..8a43aedb6 --- /dev/null +++ b/xCAT-test/autotest/testcase/rvitals/cases1 @@ -0,0 +1,61 @@ +start:rvitals_temp +arch:ppc64le +hcp:ipmi +cmd:rvitals $$CN temp +check:rc==0 +check:output=~Ambient Temp +end + +start:rvitals_disktemp +arch:ppc64le +hcp:ipmi +cmd:rvitals $$CN disktemp +check:rc==0 +check:output=~Ambient Temp +end + +start:rvitals_cputemp +arch:ppc64le +hcp:ipmi +cmd:rvitals $$CN cputemp +check:rc==0 +check:output=~Ambient Temp +end + +start:rvitals_fanspeed +arch:ppc64le +hcp:ipmi +cmd:rvitals $$CN fanspeed +check:rc==0 +check:output=~Fan\s*\d:\s*\w+\s*RPM +end + +start:rvitals_voltage +arch:ppc64le +hcp:ipmi +cmd:rvitals $$CN voltage +check:rc==0 +check:output=~CPU VDD Volt +end + +start:rvitals_all +arch:ppc64le +hcp:ipmi +cmd:rvitals $$CN all +check:rc==0 +check:output=~Power Status +check:output=~Power Overload +check:output=~Power Interlock +check:output=~Power Fault +check:output=~Power Control Fault +check:output=~Power Restore Policy +check:output=~Ambient Temp +end + +start:rvitals_noderange_err +arch:ppc64le +hcp:ipmi +cmd:rvitals testnode +check:rc!=0 +check:output=~Error +end diff --git a/xCAT-test/autotest/testcase/sysclone/cases0 b/xCAT-test/autotest/testcase/sysclone/cases0 index 53cabf3eb..90dd67c79 100644 --- a/xCAT-test/autotest/testcase/sysclone/cases0 +++ b/xCAT-test/autotest/testcase/sysclone/cases0 @@ -40,12 +40,9 @@ check:rc==0 cmd:chdef -t osimage -o $$GOS-x86_64-install-compute otherpkglist=$$OTHERPKGLIST check:rc==0 -cmd:nodeset $$GOLDEN_CLIENT osimage=$$GOS-x86_64-install-compute -check:rc==0 -cmd:rsetboot $$GOLDEN_CLIENT net -check:rc==0 -cmd:rpower $$GOLDEN_CLIENT reset +cmd:rinstall $$GOLDEN_CLIENT osimage=$$GOS-x86_64-install-compute check:rc==0 +check:output=~Provision node\(s\)\: $$GOLDEN_CLIENT cmd:sleep 500 cmd:a=0;while ! `lsdef -l $$GOLDEN_CLIENT|grep status|grep booted >/dev/null`; do sleep 10;((a++));if [ $a -gt 200 ];then break;fi done @@ -75,12 +72,9 @@ check:rc==0 cmd:lsdef -t osimage goldenclient-osimage-$$GOS-$$MODE| grep provmethod check:output=~sysclone -cmd:nodeset $$TARGET_NODE osimage=goldenclient-osimage-$$GOS-$$MODE -check:rc==0 -cmd:rsetboot $$TARGET_NODE net -check:rc==0 -cmd:rpower $$TARGET_NODE reset +cmd:rinstall $$TARGET_NODE osimage=goldenclient-osimage-$$GOS-$$MODE check:rc==0 +check:output=~Provision node\(s\)\: $$TARGET_NODE cmd:sleep 300 cmd:a=0;while ! `lsdef -l $$TARGET_NODE|grep status|grep booted >/dev/null`; do sleep 10;((a++));if [ $a -gt 60 ];then break;fi done diff --git a/xCAT-test/autotest/testcase/xcatdebugmode/rhels_xcatdebugmode_diskful b/xCAT-test/autotest/testcase/xcatdebugmode/rhels_xcatdebugmode_diskful index 9e5bd01d9..916c526ae 100644 --- a/xCAT-test/autotest/testcase/xcatdebugmode/rhels_xcatdebugmode_diskful +++ b/xCAT-test/autotest/testcase/xcatdebugmode/rhels_xcatdebugmode_diskful @@ -4,8 +4,6 @@ description:site.xcatdebugmode value is 0, the following logs will be shown and cmd:if ping -c 1 $$SN > /dev/null;then rpower $$SN off > /dev/null;fi cmd:chdef -t node -o $$CN servicenode= monserver=$$MN nfsserver=$$MN tftpserver=$$MN xcatmaster=$$MN check:rc==0 -cmd:if [ "__GETNODEATTR($$CN,arch)__" != "ppc64" -a "__GETNODEATTR($$CN,mgt)__" != "ipmi" ];then if [[ "__GETNODEATTR($$CN,vmstorage)__" =~ "phy" ]]; then rmvm $$CN -f -p && mkvm $$CN; else rmvm $$CN -f -p && mkvm $$CN -s 20G; fi;fi -check:rc=0 cmd:makedns -n check:rc==0 cmd:makeconservercf @@ -26,12 +24,9 @@ cmd:copycds $$ISO check:rc==0 cmd:chtab key=xcatdebugmode site.value="0" check:rc==0 -cmd:nodeset $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute -check:rc==0 -cmd:if [[ "__GETNODEATTR($$CN,mgt)__" = "ipmi" ]]; then rsetboot $$CN net; fi -check:rc==0 -cmd:if [ "__GETNODEATTR($$CN,mgt)__" != "ipmi" ];then if [ "__GETNODEATTR($$CN,arch)__" = "ppc64" ];then rnetboot $$CN;else rpower $$CN boot;fi else rpower $$CN boot;fi +cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute check:rc==0 +check:output=~Provision node\(s\)\: $$CN cmd:a=0;while ! `lsdef -l $$CN|grep status|grep installing >/dev/null`; do sleep 20;((a++));if [ $a -gt 30 ];then break;fi done cmd:sleep 120 cmd:xdsh $$CN date @@ -68,8 +63,6 @@ check:rc==0 cmd:if ping -c 1 $$SN > /dev/null;then rpower $$SN off > /dev/null;fi cmd:chdef -t node -o $$CN servicenode= monserver=$$MN nfsserver=$$MN tftpserver=$$MN xcatmaster=$$MN check:rc==0 -cmd:if [ "__GETNODEATTR($$CN,arch)__" != "ppc64" -a "__GETNODEATTR($$CN,mgt)__" != "ipmi" ];then if [[ "__GETNODEATTR($$CN,vmstorage)__" =~ "phy" ]]; then rmvm $$CN -f -p && mkvm $$CN; else rmvm $$CN -f -p && mkvm $$CN -s 20G; fi;fi -check:rc=0 cmd:makedns -n check:rc==0 cmd:makeconservercf @@ -90,13 +83,9 @@ cmd:copycds $$ISO check:rc==0 cmd:chtab key=xcatdebugmode site.value="1" check:rc==0 -cmd:nodeset $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute +cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute check:rc==0 -cmd:if [[ "__GETNODEATTR($$CN,mgt)__" = "ipmi" ]]; then rsetboot $$CN net; fi -check:rc==0 -cmd:if [ "__GETNODEATTR($$CN,mgt)__" != "ipmi" ];then if [ "__GETNODEATTR($$CN,arch)__" = "ppc64" ];then rnetboot $$CN;else rpower $$CN boot;fi else rpower $$CN boot;fi -check:rc==0 -cmd:a=0;while ! `lsdef -l $$CN|grep status|grep installing >/dev/null`; do sleep 20;((a++));if [ $a -gt 30 ];then break;fi done +check:output=~Provision node\(s\)\: $$CN cmd:sleep 120 cmd:xdsh $$CN date check:output=~(Connection refused|No route to host) @@ -161,8 +150,6 @@ check:rc==0 cmd:if ping -c 1 $$SN > /dev/null;then rpower $$SN off > /dev/null;fi cmd:chdef -t node -o $$CN servicenode= monserver=$$MN nfsserver=$$MN tftpserver=$$MN xcatmaster=$$MN check:rc==0 -cmd:if [ "__GETNODEATTR($$CN,arch)__" != "ppc64" -a "__GETNODEATTR($$CN,mgt)__" != "ipmi" ];then if [[ "__GETNODEATTR($$CN,vmstorage)__" =~ "phy" ]]; then rmvm $$CN -f -p && mkvm $$CN; else rmvm $$CN -f -p && mkvm $$CN -s 20G; fi;fi -check:rc=0 cmd:makedns -n check:rc==0 cmd:makeconservercf @@ -183,12 +170,9 @@ cmd:copycds $$ISO check:rc==0 cmd:chtab key=xcatdebugmode site.value="2" check:rc==0 -cmd:nodeset $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute -check:rc==0 -cmd:if [[ "__GETNODEATTR($$CN,mgt)__" = "ipmi" ]]; then rsetboot $$CN net; fi -check:rc==0 -cmd:if [ "__GETNODEATTR($$CN,mgt)__" != "ipmi" ];then if [ "__GETNODEATTR($$CN,arch)__" = "ppc64" ];then rnetboot $$CN;else rpower $$CN boot;fi else rpower $$CN boot;fi +cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute check:rc==0 +check:output=~Provision node\(s\)\: $$CN cmd:a=0;while ! `lsdef -l $$CN|grep status|grep installing >/dev/null`; do sleep 20;((a++));if [ $a -gt 30 ];then break;fi done cmd:sleep 120 cmd:xdsh $$CN date @@ -264,10 +248,9 @@ cmd:makeconservercf $$CN check:rc==0 cmd:cat /etc/conserver.cf | grep $$CN check:output=~$$CN -cmd:nodeset $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute -check:rc==0 -cmd:rpower $$CN boot +cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute check:rc==0 +check:output=~Provision node\(s\)\: $$CN cmd:a=0;while ! `lsdef -l $$CN|grep status|grep installing >/dev/null`; do sleep 20;((a++));if [ $a -gt 30 ];then break;fi done cmd:sleep 120 @@ -319,10 +302,9 @@ cmd:makeconservercf $$CN check:rc==0 cmd:cat /etc/conserver.cf | grep $$CN check:output=~$$CN -cmd:nodeset $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute -check:rc==0 -cmd:rpower $$CN boot +cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute check:rc==0 +check:output=~Provision node\(s\)\: $$CN cmd:a=0;while ! `lsdef -l $$CN|grep status|grep installing >/dev/null`; do sleep 20;((a++));if [ $a -gt 30 ];then break;fi done cmd:sleep 120 @@ -409,10 +391,9 @@ cmd:makeconservercf $$CN check:rc==0 cmd:cat /etc/conserver.cf | grep $$CN check:output=~$$CN -cmd:nodeset $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute -check:rc==0 -cmd:rpower $$CN boot +cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute check:rc==0 +check:output=~Provision node\(s\)\: $$CN cmd:a=0;while ! `lsdef -l $$CN|grep status|grep installing >/dev/null`; do sleep 20;((a++));if [ $a -gt 30 ];then break;fi done cmd:sleep 120 diff --git a/xCAT-test/autotest/testcase/xcatdebugmode/sles_xcatdebugmode_diskful b/xCAT-test/autotest/testcase/xcatdebugmode/sles_xcatdebugmode_diskful index 3ba3a5bca..f9aab96f5 100644 --- a/xCAT-test/autotest/testcase/xcatdebugmode/sles_xcatdebugmode_diskful +++ b/xCAT-test/autotest/testcase/xcatdebugmode/sles_xcatdebugmode_diskful @@ -5,8 +5,6 @@ description:site.xcatdebugmode value is 0, the following logs will be shown and cmd:if ping -c 1 $$SN > /dev/null;then rpower $$SN off > /dev/null;fi cmd:chdef -t node -o $$CN servicenode= monserver=$$MN nfsserver=$$MN tftpserver=$$MN xcatmaster=$$MN check:rc==0 -cmd:if [ "__GETNODEATTR($$CN,arch)__" != "ppc64" -a "__GETNODEATTR($$CN,mgt)__" != "ipmi" ];then if [[ "__GETNODEATTR($$CN,vmstorage)__" =~ "phy" ]]; then rmvm $$CN -f -p && mkvm $$CN; else rmvm $$CN -f -p && mkvm $$CN -s 20G; fi;fi -check:rc=0 cmd:makedns -n check:rc==0 cmd:makeconservercf @@ -27,12 +25,9 @@ cmd:copycds $$ISO check:rc==0 cmd:chtab key=xcatdebugmode site.value="0" check:rc==0 -cmd:nodeset $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute -check:rc==0 -cmd:if [[ "__GETNODEATTR($$CN,mgt)__" = "ipmi" ]]; then rsetboot $$CN net; fi -check:rc==0 -cmd:if [ "__GETNODEATTR($$CN,mgt)__" != "ipmi" ];then if [ "__GETNODEATTR($$CN,arch)__" = "ppc64" ];then rnetboot $$CN;else rpower $$CN boot;fi else rpower $$CN boot;fi +cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute check:rc==0 +check:output=~Provision node\(s\)\: $$CN cmd:a=0;while ! `lsdef -l $$CN|grep status|grep installing >/dev/null`; do sleep 20;((a++));if [ $a -gt 30 ];then break;fi done cmd:sleep 120 @@ -78,8 +73,6 @@ check:rc==0 cmd:if ping -c 1 $$SN > /dev/null;then rpower $$SN off > /dev/null;fi cmd:chdef -t node -o $$CN servicenode= monserver=$$MN nfsserver=$$MN tftpserver=$$MN xcatmaster=$$MN check:rc==0 -cmd:if [ "__GETNODEATTR($$CN,arch)__" != "ppc64" -a "__GETNODEATTR($$CN,mgt)__" != "ipmi" ];then if [[ "__GETNODEATTR($$CN,vmstorage)__" =~ "phy" ]]; then rmvm $$CN -f -p && mkvm $$CN; else rmvm $$CN -f -p && mkvm $$CN -s 20G; fi;fi -check:rc=0 cmd:makedns -n check:rc==0 cmd:makeconservercf @@ -98,12 +91,9 @@ cmd:if cat /etc/*release |grep SUSE >/dev/null;then cat /var/lib/dhcp/db/dhcpd.l check:output=~$$CN cmd:chtab key=xcatdebugmode site.value="1" check:rc==0 -cmd:nodeset $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute -check:rc==0 -cmd:if [[ "__GETNODEATTR($$CN,mgt)__" = "ipmi" ]]; then rsetboot $$CN net; fi -check:rc==0 -cmd:if [ "__GETNODEATTR($$CN,mgt)__" != "ipmi" ];then if [ "__GETNODEATTR($$CN,arch)__" = "ppc64" ];then rnetboot $$CN;else rpower $$CN boot;fi else rpower $$CN boot;fi +cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute check:rc==0 +check:output=~Provision node\(s\)\: $$CN cmd:a=0;while ! `lsdef -l $$CN|grep status|grep installing >/dev/null`; do sleep 20;((a++));if [ $a -gt 30 ];then break;fi done cmd:sleep 120 @@ -188,10 +178,9 @@ cmd:makeconservercf $$CN check:rc==0 cmd:cat /etc/conserver.cf | grep $$CN check:output=~$$CN -cmd:nodeset $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute -check:rc==0 -cmd:rpower $$CN boot +cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute check:rc==0 +check:output=~Provision node\(s\)\: $$CN cmd:a=0;while ! `lsdef -l $$CN|grep status|grep installing >/dev/null`; do sleep 20;((a++));if [ $a -gt 30 ];then break;fi done cmd:sleep 120 @@ -252,10 +241,9 @@ cmd:makeconservercf $$CN check:rc==0 cmd:cat /etc/conserver.cf | grep $$CN check:output=~$$CN -cmd:nodeset $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute -check:rc==0 -cmd:rpower $$CN boot +cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute check:rc==0 +check:output=~Provision node\(s\)\: $$CN cmd:a=0;while ! `lsdef -l $$CN|grep status|grep installing >/dev/null`; do sleep 20;((a++));if [ $a -gt 30 ];then break;fi done cmd:sleep 120 diff --git a/xCAT-test/autotest/testcase/xcatdebugmode/ubuntu_xcatdebugmode_diskful b/xCAT-test/autotest/testcase/xcatdebugmode/ubuntu_xcatdebugmode_diskful index babb2402f..534ed9c31 100644 --- a/xCAT-test/autotest/testcase/xcatdebugmode/ubuntu_xcatdebugmode_diskful +++ b/xCAT-test/autotest/testcase/xcatdebugmode/ubuntu_xcatdebugmode_diskful @@ -17,10 +17,9 @@ cmd:makeconservercf $$CN check:rc==0 cmd:cat /etc/conserver.cf | grep $$CN check:output=~$$CN -cmd:nodeset $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute -check:rc==0 -cmd:rpower $$CN boot +cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute check:rc==0 +check:output=~Provision node\(s\)\: $$CN cmd:a=0;while ! `lsdef -l $$CN|grep status|grep installing >/dev/null`; do sleep 20;((a++));if [ $a -gt 30 ];then break;fi done cmd:xdsh $$CN date check:output=~(Connection refused|No route to host) @@ -60,10 +59,9 @@ cmd:copycds $$ISO check:rc==0 cmd:chtab key=xcatdebugmode site.value="0" check:rc==0 -cmd:nodeset $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute -check:rc==0 -cmd:rpower $$CN boot +cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute check:rc==0 +check:output=~Provision node\(s\)\: $$CN cmd:a=0;while ! `lsdef -l $$CN|grep status|grep installing >/dev/null`; do sleep 20;((a++));if [ $a -gt 30 ];then break;fi done cmd:xdsh $$CN date check:output=~(Connection refused|No route to host) @@ -106,10 +104,9 @@ cmd:cat /etc/conserver.cf | grep $$CN check:output=~$$CN cmd:copycds $$ISO check:rc==0 -cmd:nodeset $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute -check:rc==0 -cmd:rpower $$CN boot +cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute check:rc==0 +check:output=~Provision node\(s\)\: $$CN cmd:a=0;while ! `lsdef -l $$CN|grep status|grep installing >/dev/null`; do sleep 20;((a++));if [ $a -gt 30 ];then break;fi done cmd:xdsh $$CN date check:output=~(Connection refused|No route to host) @@ -178,10 +175,9 @@ cmd:cat /etc/conserver.cf | grep $$CN check:output=~$$CN cmd:copycds $$ISO check:rc==0 -cmd:nodeset $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute -check:rc==0 -cmd:rpower $$CN boot +cmd:rinstall $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute check:rc==0 +check:output=~Provision node\(s\)\: $$CN cmd:a=0;while ! `lsdef -l $$CN|grep status|grep installing >/dev/null`; do sleep 20;((a++));if [ $a -gt 30 ];then break;fi done cmd:xdsh $$CN date check:output=~(Connection refused|No route to host) diff --git a/xCAT-test/debian/compat b/xCAT-test/debian/compat index 7ed6ff82d..ec635144f 100644 --- a/xCAT-test/debian/compat +++ b/xCAT-test/debian/compat @@ -1 +1 @@ -5 +9 diff --git a/xCAT-test/debian/control b/xCAT-test/debian/control index 10e475fb5..fa073a669 100644 --- a/xCAT-test/debian/control +++ b/xCAT-test/debian/control @@ -2,10 +2,13 @@ Source: xcat-test Section: admin Priority: extra Maintainer: xCAT -Build-Depends: debhelper (>= 5) -Standards-Version: 3.7.2 +Build-Depends: debhelper (>= 9) +Standards-Version: 3.9.4 +Homepage: https://xcat.org/ Package: xcat-test Architecture: all Depends: ${perl:Depends} -Description: Provides automated test tool and buckets to help test xCAT commands automatically +Description: xCAT automated test tool + Provides automated test tool and buckets to help test xCAT commands + automatically. diff --git a/xCAT-test/debian/rules b/xCAT-test/debian/rules index 2d65f3a62..ad419b385 100755 --- a/xCAT-test/debian/rules +++ b/xCAT-test/debian/rules @@ -9,9 +9,6 @@ # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 -export DH_COMPAT=5 - - build: dh_testdir mkdir -p share/man/man1 @@ -33,7 +30,6 @@ install: dh_install -X".svn" dh_link - # Build architecture-independent files here. binary-indep: build install # We have nothing to do by default. @@ -44,7 +40,7 @@ binary-arch: export dh_testdir dh_testroot - dh_installchangelogs + dh_installchangelogs dh_installdocs # dh_installexamples dh_install -X".svn" diff --git a/xCAT-test/xCAT-test.spec b/xCAT-test/xCAT-test.spec index f5aca2460..6906896da 100644 --- a/xCAT-test/xCAT-test.spec +++ b/xCAT-test/xCAT-test.spec @@ -1,7 +1,7 @@ Summary: xCAT automated test tool Name: xCAT-test 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,8 +17,6 @@ BuildRoot: /var/tmp/%{name}-%{version}-%{release}-root BuildArch: noarch %endif -Provides: xCAT-test = %{version} - %description Provides automated test tool and buckets to help test xCAT commands automatically. diff --git a/xCAT-vlan/debian/compat b/xCAT-vlan/debian/compat index 45a4fb75d..ec635144f 100755 --- a/xCAT-vlan/debian/compat +++ b/xCAT-vlan/debian/compat @@ -1 +1 @@ -8 +9 diff --git a/xCAT-vlan/debian/control b/xCAT-vlan/debian/control index b6d89e310..5eddaa6e8 100755 --- a/xCAT-vlan/debian/control +++ b/xCAT-vlan/debian/control @@ -2,12 +2,11 @@ Source: xcat-vlan Section: admin Priority: extra Maintainer: root -Build-Depends: debhelper (>= 8.0.0) -Standards-Version: 3.9.2 -#Vcs-Git: git://git.debian.org/collab-maint/xcat-vlan.git -#Vcs-Browser: http://git.debian.org/?p=collab-maint/xcat-vlan.git;a=summary +Build-Depends: debhelper (>= 9) +Standards-Version: 3.9.4 +Homepage: https://xcat.org/ Package: xcat-vlan Architecture: all -Depends: xcat-client +Depends: xcat-client (>= 2.13-snap000000000000) Description: xCAT-vlan provides the xCAT vlan confiuration. diff --git a/xCAT-vlan/debian/rules b/xCAT-vlan/debian/rules index 4ab16dbff..2ab51a5dd 100755 --- a/xCAT-vlan/debian/rules +++ b/xCAT-vlan/debian/rules @@ -11,10 +11,12 @@ build: ./xpod2man + clean: dh_testdir dh_testroot dh_clean -d + install: pwd dh_installdirs diff --git a/xCAT-vlan/xCAT-vlan.spec b/xCAT-vlan/xCAT-vlan.spec index 6e46f2ebe..487dbcb12 100755 --- a/xCAT-vlan/xCAT-vlan.spec +++ b/xCAT-vlan/xCAT-vlan.spec @@ -1,7 +1,7 @@ Summary: Executables and data of the xCAT vlan management project Name: xCAT-vlan 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 @@ -16,11 +16,7 @@ BuildRoot: /var/tmp/%{name}-%{version}-%{release}-root BuildArch: noarch %endif - -Provides: xCAT-vlan = %{epoch}:%{version} - - -Requires: xCAT-client +Requires: xCAT-client = 4:%{version}-%{release} %description xCAT-vlan provides the xCAT vlan confiuration. @@ -45,14 +41,12 @@ mkdir -p $RPM_BUILD_ROOT/install/postscripts mkdir -p $RPM_BUILD_ROOT/%{prefix}/share/man/man1 mkdir -p $RPM_BUILD_ROOT/%{prefix}/share/doc/man1 - set +x cp xCAT/* $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT cp -R xCAT_plugin/* $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT_plugin cp install/postscripts/* $RPM_BUILD_ROOT/install/postscripts - # These were built dynamically in the build phase cp share/man/man1/* $RPM_BUILD_ROOT/%{prefix}/share/man/man1 chmod 444 $RPM_BUILD_ROOT/%{prefix}/share/man/man1/* @@ -68,7 +62,6 @@ ln -sf ../bin/xcatclientnnr $RPM_BUILD_ROOT/%{prefix}/bin/rmvlan ln -sf ../bin/xcatclientnnr $RPM_BUILD_ROOT/%{prefix}/bin/lsvlan ln -sf ../bin/xcatclientnnr $RPM_BUILD_ROOT/%{prefix}/bin/chvlanports - %clean # This step does not happen until *after* the %files packaging below rm -rf $RPM_BUILD_ROOT @@ -80,7 +73,6 @@ rm -rf $RPM_BUILD_ROOT %{prefix} /install/postscripts - %changelog %post @@ -104,5 +96,3 @@ rm -rf $RPM_BUILD_ROOT exit 0 %preun - - diff --git a/xCAT/debian/compat b/xCAT/debian/compat index 7ed6ff82d..ec635144f 100644 --- a/xCAT/debian/compat +++ b/xCAT/debian/compat @@ -1 +1 @@ -5 +9 diff --git a/xCAT/debian/control b/xCAT/debian/control index 913d00c94..fae5030f6 100644 --- a/xCAT/debian/control +++ b/xCAT/debian/control @@ -2,11 +2,29 @@ Source: xcat Section: admin Priority: extra Maintainer: xCAT -Build-Depends: debhelper (>= 5) -Standards-Version: 3.7.2 +Build-Depends: debhelper (>= 9) +Standards-Version: 3.9.4 +Vcs-browser: https://github.com/xcat2/xcat-core.git +Homepage: https://xcat.org/ Package: xcat Architecture: amd64 ppc64el -Depends: ${perl:Depends}, xcat-server, xcat-client, libdbd-sqlite3-perl, isc-dhcp-server, apache2, nfs-kernel-server, nmap, bind9, libxml-parser-perl, xinetd, tftpd-hpa, tftp-hpa, conserver-xcat, libnet-telnet-perl, ipmitool-xcat (>=1.8.17-1), syslinux[any-amd64], libsys-virt-perl, syslinux-xcat, xnba-undi, xcat-genesis-scripts-ppc64, xcat-genesis-scripts-amd64, elilo-xcat, xcat-buildkit, xcat-probe (>=2.12) -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}, xcat-server (>= 2.13-snap000000000000), xcat-client (>= 2.13-snap000000000000), libdbd-sqlite3-perl, isc-dhcp-server, apache2, nfs-kernel-server, libxml-parser-perl, xinetd, tftpd-hpa, conserver-xcat, libnet-telnet-perl, xcat-genesis-scripts-ppc64 (>= 2.13-snap000000000000), xcat-genesis-scripts-amd64 (>= 2.13-snap000000000000) +Recommends: bind9, nmap, tftp-hpa, ipmitool-xcat (>= 1.8.17-1), syslinux[any-amd64], libsys-virt-perl, syslinux-xcat, xnba-undi, elilo-xcat, xcat-buildkit (>= 2.13-snap000000000000), xcat-probe (>= 2.13-snap000000000000) +Suggests: yaboot-xcat +Description: Metapackage for a common, default xCAT setup + xCAT is Extreme Cluster/Cloud Administration Toolkit. xCAT offers complete + management for HPC clusters, RenderFarms, Grids, WebFarms, Online Gaming + Infrastructure, Clouds, Datacenters, and whatever tomorrow's buzzwords may + be. It is agile, extensible, and based on years of system administration best + practices and experience. + . + It enables you to: + . + * Provision Operating Systems on physical or virtual machines: RHEL, CentOS, + Fedora, SLES, Ubuntu, AIX, Windows, VMWare, KVM, PowerVM, PowerKVM, zVM. + * Provision using scripted install, stateless, statelite, iSCSI, or cloning + * Remotely manage systems: lights-out management, remote console, and + distributed shell support + * Quickly configure and control management node services: DNS, HTTP, DHCP, + TFTP, NFS diff --git a/xCAT/debian/rules b/xCAT/debian/rules index b45ba65a7..14d8be8b1 100755 --- a/xCAT/debian/rules +++ b/xCAT/debian/rules @@ -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" diff --git a/xCAT/postscripts/configbond b/xCAT/postscripts/configbond index f80aee336..f2567193a 100755 --- a/xCAT/postscripts/configbond +++ b/xCAT/postscripts/configbond @@ -242,7 +242,7 @@ fi # add bonding driver alias for echo "alias $str_bond_name bonding" > /etc/modprobe.d/$str_bond_name.conf -# Bring down the salve devices first +# Bring down the slave devices first for slave in ${str_bond_name} ${array_bond_slaves[*]}; do $(ifdown $slave &>/dev/null) done diff --git a/xCAT/postscripts/configinterface b/xCAT/postscripts/configinterface new file mode 100755 index 000000000..40deeb269 --- /dev/null +++ b/xCAT/postscripts/configinterface @@ -0,0 +1,48 @@ +#!/bin/bash + +#the postscript to configure interface in ONIE compatible switches + +if ! cat /etc/os-release |grep -i '^NAME=[ "]*Cumulus Linux[ "]*$' >/dev/null 2>&1 ; then + echo "This script is only supported on Cumulus OS in ONIE switch" + exit 2 +fi + +xcat_intf="/etc/network/interfaces.d/xCAT.intf" + +echo "#This is sample interface file provided by xCAT" > $xcat_intf +echo "# bridge-vlan-aware: set to yes to indicate that the bridge is VLAN-aware. " >> $xcat_intf +echo "# bridge-access: declares the access port. " >> $xcat_intf +echo "# bridge-pvid: specifies native VLANs if the ID is other than 1. " >> $xcat_intf +echo "# bridge-vids: declares the VLANs associated with this bridge. " >> $xcat_intf +echo " " >> $xcat_intf + +#create default bridge +echo "auto br0" >> $xcat_intf +echo "iface br0" >> $xcat_intf +echo " bridge-vlan-aware yes" >> $xcat_intf +echo " bridge-ports glob swp1-52" >> $xcat_intf +echo " bridge-stp on" >> $xcat_intf +echo " bridge-vids 1 " >> $xcat_intf +echo " bridge-pvid 1" >> $xcat_intf +echo " " >> $xcat_intf + +#create each interface + +for i in `seq 1 52`; +do + echo "auto swp$i">> $xcat_intf + echo "iface swp$i" >> $xcat_intf + echo " mstpctl-portadminedge yes" >> $xcat_intf + echo " " >> $xcat_intf +done + +# license needs to set before start switchd +if [ ! -e /etc/cumulus/.license* ]; then + echo "ERROR: cumulus license file is not exist"; + exit 1; +fi + +systemctl enable switchd +systemctl restart switchd +ifreload -a + diff --git a/xCAT/postscripts/confignics b/xCAT/postscripts/confignics index c651ecc1c..41f15db31 100755 --- a/xCAT/postscripts/confignics +++ b/xCAT/postscripts/confignics @@ -202,7 +202,7 @@ if [ "$str_temp" = "mac" ];then else str_inst_nic=`ip -o link | grep -i "$MACADDRESS" | awk '{print $2;}' | sed s/://` fi -elif [ `echo $str_temp | grep -E "e(n|th)[0-9a-z]+"` ];then +elif [ `echo $str_temp | grep -E "e(n|th|m)[0-9a-zA-Z]+"` ];then str_inst_nic=$str_temp fi @@ -236,9 +236,9 @@ fi #do not configure the loopback nic if [ $bool_remove -eq 1 ];then if [ "$str_os_type" = "aix" ];then - str_temp=`ifconfig -a | grep flags | grep -vi loopback | grep -v SALVE | grep -v MASTER | awk -F: {'print $1'}` + str_temp=`ifconfig -a | grep flags | grep -vi loopback | grep -v SLAVE | grep -v MASTER | awk -F: {'print $1'}` else - str_temp=`ip link show | grep -v link | grep -vi loopback | grep -v SALVE | grep -v MASTER | awk {'print $2'} | sed s/://` + str_temp=`ip link show | grep -v link | grep -vi loopback | grep -v SLAVE | grep -v MASTER | awk {'print $2'} | sed s/://` fi old_ifs=$IFS IFS=$'\n' @@ -247,7 +247,7 @@ if [ $bool_remove -eq 1 ];then for str_temp_nic in ${array_nics_temp[@]} do #the nic type should be ethernet - echo $str_temp_nic | grep -E "e(n|th)[0-9a-z]+" + echo $str_temp_nic | grep -E "e(n|th|m)[0-9a-zA-Z]+" if [ $? -ne 0 ];then continue fi diff --git a/xCAT/postscripts/enablesnmp b/xCAT/postscripts/enablesnmp new file mode 100755 index 000000000..2d4f2fd96 --- /dev/null +++ b/xCAT/postscripts/enablesnmp @@ -0,0 +1,36 @@ +#!/bin/bash + +#the postscript to enable snmpd in ONIE compatible switches + +if ! cat /etc/os-release |grep -i '^NAME=[ "]*Cumulus Linux[ "]*$' >/dev/null 2>&1 ; then + echo "This script is only supported on Cumulus OS in ONIE switch" + exit 2 +fi +snmp_conf="/etc/snmp/snmpd.conf" + +[ -f "$snmp_conf" ] || exit -1 + +[ -z "$snmp_user" ] && snmp_user="xcatadmin" +[ -z "$snmp_passwd" ] && snmp_passwd="xcatpassw0rd" + +[ -f ${snmp_conf}.orig ] || cp $snmp_conf ${snmp_conf}.orig +sed -i "1i\#xCAT customized snmpd configuration" $snmp_conf +sed -i "/^\s*agentAddress/s/^/#/" $snmp_conf +sed -i '/agentAddress udp\:161\,udp6\:\[\:\:1\]\:161/s/^#//' $snmp_conf +sed -i "/rocommunity\s*public\s*default/s/^#//" $snmp_conf +sed -i "/rocommunity\s*public\s*default\s*-V\s*systemonly/s/^#//" $snmp_conf +sed -i "/#\s*createUser\s*authPrivUser\s*SHA/{n;s/^.*$/createUser $snmp_user SHA $snmp_passwd/}" $snmp_conf +sed -i "/#rwuser\s*authPrivUser\s*priv/{n;s/^.*$/rwuser $snmp_user/}" $snmp_conf +sed -i "/view\s*systemonly\s*included\s*.1.3.6.1.2.1.17/s/^#//" $snmp_conf +sed -i "/pass_persist\s*.1.3.6.1.2.1.17\s*\/usr\/share\/snmp\/bridge_pp.py/s/^#//" $snmp_conf + +#create snmpd restart conf file +mkdir -p /etc/systemd/system/snmpd.service.d +restart_conf="/etc/systemd/system/snmpd.service.d/restart.conf" +echo "[Service]" > $restart_conf +echo "Restart=always" >> $restart_conf +echo "RestartSec=60" >> $restart_conf + +systemctl enable snmpd +systemctl restart snmpd + diff --git a/xCAT/postscripts/hardeths b/xCAT/postscripts/hardeths index be1411ede..cde4cc211 100755 --- a/xCAT/postscripts/hardeths +++ b/xCAT/postscripts/hardeths @@ -46,8 +46,12 @@ network_ipv4calc () echo $NETWORK } +if (cat /etc/os-release |grep -i '^NAME=[ "]*Cumulus Linux[ "]*$' >/dev/null 2>&1); then + osver="cumulus" +fi + defgw=`ip route | grep default | awk '{print $3}'` -if ( pmatch $OSVER "ubuntu*" ) +if ( pmatch $OSVER "ubuntu*" ) || (pmatch $osver "cumulus") then echo `hostname` >/etc/hostname mv /etc/network/interfaces /etc/network/interfaces.old # this file will be filled up next @@ -72,6 +76,17 @@ else echo "GATEWAY=$defgw" >> /etc/sysconfig/network fi fi + +HOSTNAMECTL=`which hostnamectl 2>&1 | grep -v "/usr/bin/which: no"` +if [ ! -z $HOSTNAMECTL ] && [ ! -z $NODE ]; then + SET_HOSTNAME=$NODE + if [ ! -z $DOMAIN ]; then + SET_HOSTNAME=$NODE.$DOMAIN + fi + echo "Setting hostname to: $SET_HOSTNAME" + hostnamectl set-hostname $SET_HOSTNAME +fi + for nic in `ip link |grep "BROADCAST" |awk '{print $2}' | sed s/://`; do IPADDRMASK=`ip addr show dev $nic | grep inet | grep -v inet6 | awk '{print $2}' | head -n 1` IPADDR=`echo $IPADDRMASK | awk -F'/' '{print $1}'` @@ -79,7 +94,7 @@ for nic in `ip link |grep "BROADCAST" |awk '{print $2}' | sed s/://`; do PREFIXMASK=`echo $IPADDRMASK | awk -F'/' '{print $2}'` # converts to x.x.x.x mask value maskfromprefix $PREFIXMASK - if ( pmatch $OSVER "ubuntu*" ) + if ( pmatch $OSVER "ubuntu*" ) || (pmatch $osver "cumulus") then NETWORK=`network_ipv4calc $IPADDR $NETMASK` #BROADCAST=`ifconfig $nic | grep Bcast | awk '{print $3}' | awk -F: '{print $2}'` @@ -91,7 +106,21 @@ for nic in `ip link |grep "BROADCAST" |awk '{print $2}' | sed s/://`; do gateway_line="" fi # add info to interfaces file on ubuntu, TBD does unbuntu change to systemd, this will not exist - cat >>/etc/network/interfaces <>/etc/network/interfaces <>/etc/network/interfaces <>/etc/network/interfaces </dev/null 2>&1 ; then + #TODO + echo "Cumulus OS is not supported yet, nothing to do..." + logger -t xcat -p local4.info "Cumulus OS is not supported yet, nothing to do..." + exit 0 +fi + # pmatch determines if 1st argument string is matched by 2nd argument pattern pmatch () diff --git a/xCAT/postscripts/remoteshell b/xCAT/postscripts/remoteshell index bf0be9dd0..c2023426a 100755 --- a/xCAT/postscripts/remoteshell +++ b/xCAT/postscripts/remoteshell @@ -12,6 +12,12 @@ # # if on the Management Node, exit +if cat /etc/os-release |grep -i -e "^NAME=[ \"']*Cumulus Linux[ \"']*$" >/dev/null 2>&1 ; then + #TODO + echo "Cumulus OS is not supported yet, nothing to do..." + logger -t xcat -p local4.info "Cumulus OS is not supported yet, nothing to do..." + exit 0 +fi if [ "$(uname -s|tr 'A-Z' 'a-z')" = "linux" ];then str_dir_name=`dirname $0` diff --git a/xCAT/postscripts/setupntp b/xCAT/postscripts/setupntp index b45372705..9fc3cff86 100755 --- a/xCAT/postscripts/setupntp +++ b/xCAT/postscripts/setupntp @@ -99,9 +99,13 @@ OS_TYPE=`uname` if [ $OS_TYPE = Linux ]; then mkdir -p /var/lib/ntp chown ntp /var/lib/ntp - echo "driftfile /var/lib/ntp/drift -disable auth -restrict 127.0.0.1" >>$conf_file + if ( pmatch $OSVER "sles*" ) || ( pmatch $OSVER "suse*" ) || [ -f /etc/SuSE-release ];then + echo "driftfile /var/lib/ntp/drift/ntp.drift" >>$conf_file + else + echo "driftfile /var/lib/ntp/drift" >>$conf_file + fi + echo "disable auth" >>$conf_file + echo "restrict 127.0.0.1" >>$conf_file #ntpdate/sntp conflict with ntpd, stop the service first checkservicestatus ntpserver @@ -122,9 +126,12 @@ restrict 127.0.0.1" >>$conf_file output=`eval $cmd 2>&1` rc=$? if [ "$rc" != "0" ] || (pmatch "$output" "*Time could not*");then - echo "$cmd failed, NTP maynot be synchronized, please wait for NTP synchronized then run updatenode nodename -P setupntp" + echo "WARNING: " + echo " $cmd failed, NTP may not be synchronized on NTP server " + echo " please wait for NTP synchronized, may take at least 15 mins" + echo " use 'ntpq -p' command (output has "*" or "+" sign) to validate the NTP server" + echo " run 'updatenode nodename -P setupntp' if NTP is synced on NTP server but nodename is not synced" logger -t xcat "$cmd failed" - exit 1 fi else logger -t xcat "ntpdate -t5 $master " @@ -140,16 +147,21 @@ restrict 127.0.0.1" >>$conf_file #setup the RTC is UTC format, which will be used by os if ( pmatch $OSVER "sles*" ) || ( pmatch $OSVER "suse*" ) || [ -f /etc/SuSE-release ];then - sed -i 's/.*HWCLOCK.*/HWCLOCK="-u"/' /etc/sysconfig/clock + grep -i -q "HWCLOCK" /etc/sysconfig/clock + if [ $? -eq 0 ];then + sed -i 's/.*HWCLOCK.*/HWCLOCK=\"-u\"/' /etc/sysconfig/clock + else + echo HWCLOCK=\"-u\" >> /etc/sysconfig/clock + fi elif [ -f "/etc/debian_version" ];then - sed -i 's/.*UTC.*/UTC=yes/' /etc/default/rcS + sed -i 's/.*UTC.*/UTC=\"yes\"/' /etc/default/rcS else if [ -f "/etc/sysconfig/clock" ];then - grep -i "utc" /etc/sysconfig/clock + grep -i -q "utc" /etc/sysconfig/clock if [ $? -eq 0 ];then - sed -i 's/.*UTC.*/UTC=yes/' /etc/sysconfig/clock + sed -i 's/.*UTC.*/UTC=\"yes\"/' /etc/sysconfig/clock else - echo "UTC=yes" >> /etc/sysconfig/clock + echo UTC=\"yes\" >> /etc/sysconfig/clock fi elif type -P timedatectl >/dev/null 2>&1 ;then timedatectl set-local-rtc 0 @@ -158,20 +170,20 @@ restrict 127.0.0.1" >>$conf_file #update the hardware clock automaticly if [ -f "/etc/sysconfig/ntpd" ];then - grep -i "SYNC_HWCLOCK" /etc/sysconfig/ntpd + grep -i -q "SYNC_HWCLOCK" /etc/sysconfig/ntpd if [ $? -eq 0 ];then - sed -i 's/.*SYNC_HWCLOCK.*/SYNC_HWCLOCK=yes/' /etc/sysconfig/ntpd + sed -i 's/.*SYNC_HWCLOCK.*/SYNC_HWCLOCK=\"yes\"/' /etc/sysconfig/ntpd else - echo "SYNC_HWCLOCK=yes" >> /etc/sysconfig/ntpd + echo "SYNC_HWCLOCK=\"yes\"" >> /etc/sysconfig/ntpd fi elif [ -f /etc/sysconfig/ntp ];then - grep -i "NTPD_FORCE_SYNC_ON_STARTUP" /etc/sysconfig/ntp + grep -i -q "NTPD_FORCE_SYNC_ON_STARTUP" /etc/sysconfig/ntp if [ $? -eq 0 ];then - sed -i 's/NTPD_FORCE_SYNC_ON_STARTUP="no"/NTPD_FORCE_SYNC_ON_STARTUP="yes"/' /etc/sysconfig/ntp + sed -i 's/NTPD_FORCE_SYNC_ON_STARTUP=\"no\"/NTPD_FORCE_SYNC_ON_STARTUP=\"yes\"/' /etc/sysconfig/ntp fi - grep -i "NTPD_FORCE_SYNC_HWCLOCK_ON_STARTUP" /etc/sysconfig/ntp + grep -i -q "NTPD_FORCE_SYNC_HWCLOCK_ON_STARTUP" /etc/sysconfig/ntp if [ $? -eq 0 ];then - sed -i 's/NTPD_FORCE_SYNC_HWCLOCK_ON_STARTUP="no"/NTPD_FORCE_SYNC_HWCLOCK_ON_STARTUP="yes"/' /etc/sysconfig/ntp + sed -i 's/NTPD_FORCE_SYNC_HWCLOCK_ON_STARTUP=\"no\"/NTPD_FORCE_SYNC_HWCLOCK_ON_STARTUP=\"yes\"/' /etc/sysconfig/ntp fi else cron_file="/etc/cron.daily/xcatsethwclock" diff --git a/xCAT/postscripts/syncfiles b/xCAT/postscripts/syncfiles index 488571e2a..0875a5388 100644 --- a/xCAT/postscripts/syncfiles +++ b/xCAT/postscripts/syncfiles @@ -7,6 +7,13 @@ # ##################################################### +if cat /etc/os-release |grep -i -e "^NAME=[ \"']*Cumulus Linux[ \"']*$" >/dev/null 2>&1 ; then + #TODO + echo "Cumulus OS is not supported yet, nothing to do..." + logger -t xcat -p local4.info "Cumulus OS is not supported yet, nothing to do..." + exit 0 +fi + # do nothing when UPDATENODE=1 because it is done from the top down if [ -n "$UPDATENODE" ] && [ $UPDATENODE -eq 1 ]; then #echo " Did not sync any files. Use updatenode -F to sync the files." diff --git a/xCAT/postscripts/syslog b/xCAT/postscripts/syslog index 4c4006ae7..d55364e00 100755 --- a/xCAT/postscripts/syslog +++ b/xCAT/postscripts/syslog @@ -148,6 +148,9 @@ config_rsyslog_V8() conf_file="/etc/rsyslog.conf" remoteconf="/etc/rsyslog.d/remote.conf" + #for Cumulus OS inside ONIE switches + cat /etc/os-release |grep -i -e "^NAME=[ \"']*Cumulus Linux[ \"']*$" >/dev/null 2>&1 && remoteconf="/etc/rsyslog.d/99-syslog.conf" + # If this is a Management Node or Service Node, then it will be receiving syslog entries from the # compute nodes. Management Node is receiving from Service Nodes and possibly compute nodes. # They will all be put in /var/log/messages diff --git a/xCAT/postscripts/updateflag.awk b/xCAT/postscripts/updateflag.awk index 8be4bfde7..c36ab7d89 100755 --- a/xCAT/postscripts/updateflag.awk +++ b/xCAT/postscripts/updateflag.awk @@ -8,7 +8,7 @@ BEGIN { if (!flag) flag = "next" - ns = "/inet/tcp/0/" ARGV[1] "/" xcatdport + ns = "/inet/tcp/0/" xcatdhost "/" xcatdport loop = 0 while(1) { diff --git a/xCAT/postscripts/xcatdsklspost b/xCAT/postscripts/xcatdsklspost index 28d9a3838..3e2c4ffb1 100755 --- a/xCAT/postscripts/xcatdsklspost +++ b/xCAT/postscripts/xcatdsklspost @@ -53,6 +53,15 @@ echolog() { local msgtype=$1 local msgstr=$2 + local ismsgutil_r=1 + + #if msgutil_r is not defined, when no /xcatpost directory exists on the node running this script + #write the message to local log file as a simplified function + type -t msgutil_r >/dev/null || ismsgutil_r=0 + [ "$ismsgutil_r" = "0" ] && msgutil_r () { + echo "$(date) [$2]: $3" >> $4 + } + if [ "$msgtype" = "debug" ];then if [ "$VERBOSE" = "1" ]; then @@ -66,6 +75,11 @@ echolog() msgutil_r "$MASTER_IP" "$msgtype" "$msgstr" "/var/log/xcat/xcat.log" fi + #reload the functions defined in./xcatlib.sh + if [ "$ismsgutil_r" = "0" ];then + unset msgutil_r + [ -f ./xcatlib.sh ] && source ./xcatlib.sh + fi } diff --git a/xCAT/templates/objects/node/cumulusswitch.stanza b/xCAT/templates/objects/node/onieswitch.stanza similarity index 56% rename from xCAT/templates/objects/node/cumulusswitch.stanza rename to xCAT/templates/objects/node/onieswitch.stanza index 48575c911..cd48eadd7 100644 --- a/xCAT/templates/objects/node/cumulusswitch.stanza +++ b/xCAT/templates/objects/node/onieswitch.stanza @@ -1,14 +1,14 @@ -# +# -cumulusswitch: +onieswitch: objtype=node arch="OPTIONAL: the arch of the switch management service processor, such as armv71" groups=switch - ip="MANDATORY:the ip address of the management interface" - mac="MANDATORY:the mac of the management interface" + ip="OPTIONAL:the ip address of the management interface" + mac="OPTIONAL:the mac of the management interface" mgt=switch netboot=onie nodetype=switch - switchtype="OPTIONAL: the manufacturer of switch" + switchtype=onie provmethod="OPTIONAL: the full path of the cumulus installer" usercomment="the template for cumulus switch definition" diff --git a/xCAT/xCAT.spec b/xCAT/xCAT.spec index d1d935e3f..4572e89e6 100644 --- a/xCAT/xCAT.spec +++ b/xCAT/xCAT.spec @@ -1,19 +1,19 @@ Summary: Meta-package for a common, default xCAT setup Name: xCAT 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: https://xcat.org/ Vendor: IBM Corp. Packager: IBM Corp. Distribution: %{?_distribution:%{_distribution}}%{!?_distribution:%{_vendor}} Prefix: /opt/xcat BuildRoot: /var/tmp/%{name}-%{version}-%{release}-root -#BuildArch: noarch Source1: xcat.conf Source2: postscripts.tar.gz Source3: templates.tar.gz -Source5: xCATMN +Source5: xCATMN %ifos linux Source4: prescripts.tar.gz @@ -25,7 +25,12 @@ Source7: xcat.conf.apach24 Provides: xCAT = %{version} Conflicts: xCATsn -Requires: xCAT-server xCAT-client perl-DBD-SQLite xCAT-probe >= 2.12.1 xCAT-genesis-scripts-x86_64 xCAT-genesis-scripts-ppc64 +Requires: perl-DBD-SQLite +Requires: xCAT-client = 4:%{version}-%{release} +Requires: xCAT-server = 4:%{version}-%{release} +Requires: xCAT-probe = 4:%{version}-%{release} +Requires: xCAT-genesis-scripts-x86_64 = 1:%{version}-%{release} +Requires: xCAT-genesis-scripts-ppc64 = 1:%{version}-%{release} %define pcm %(if [ "$pcm" = "1" ];then echo 1; else echo 0; fi) %define notpcm %(if [ "$pcm" = "1" ];then echo 0; else echo 1; fi) @@ -34,7 +39,7 @@ Requires: xCAT-server xCAT-client perl-DBD-SQLite xCAT-probe >= 2.12.1 xCAT-gene Requires: httpd nfs-utils nmap bind perl(CGI) # on RHEL7, need to specify it explicitly Requires: net-tools -Requires: /usr/bin/killall +Requires: /usr/bin/killall # On RHEL this pulls in dhcp, on SLES it pulls in dhcp-server Requires: /usr/sbin/dhcpd # On RHEL this pulls in openssh-server, on SLES it pulls in openssh @@ -42,8 +47,6 @@ Requires: /usr/bin/ssh %ifnarch s390x Requires: /etc/xinetd.d/tftp Requires: xCAT-buildkit -# yaboot-xcat is pulled in so any MN can manage ppc nodes -#Requires: yaboot-xcat # Stty is only needed for rcons on ppc64 nodes, but for mixed clusters require it on both x and p Requires: perl-IO-Stty %endif @@ -101,7 +104,7 @@ tar -xf postscripts.tar # this is now handled by requiring /usr/sbin/dhcpd #if [ -e "/etc/SuSE-release" ]; then # In SuSE, dhcp-server provides the dhcp server, which is different from the RedHat. - # When building the package, we cannot add "dhcp-server" into the "Requires", because RedHat doesn't + # When building the package, we cannot add "dhcp-server" into the "Requires", because RedHat doesn't # have such one package. # so there's only one solution, Yes, it looks ugly. #rpm -q dhcp-server >/dev/null @@ -190,13 +193,13 @@ then fi if [ -n "$(apachectl -v 2>&1 |grep -e '^Server version\s*:.*\/2.4')" ] -then +then rm -rf /etc/apache2/conf.d/xcat.conf cp /etc/xcat/conf.orig/xcat.conf.apach24 /etc/apache2/conf.d/xcat.conf fi if [ -n "$(apache2ctl -v 2>&1 |grep -e '^Server version\s*:.*\/2.4')" ] -then +then rm -rf /etc/apache2/conf.d/xcat.conf cp /etc/xcat/conf.orig/xcat.conf.apach24 /etc/apache2/conf.d/xcat.conf fi @@ -237,7 +240,6 @@ exit 0 %clean - %files %{prefix} # one for sles, one for rhel. yes, it's ugly... @@ -259,10 +261,8 @@ exit 0 %postun - if [ "$1" = "0" ]; then - %ifnos linux if grep "^xcatd" /etc/inittab >/dev/null then @@ -271,4 +271,3 @@ fi %endif true # so on aix we do not end up with an empty if stmt fi - diff --git a/xCATsn/debian/compat b/xCATsn/debian/compat index 7ed6ff82d..ec635144f 100644 --- a/xCATsn/debian/compat +++ b/xCATsn/debian/compat @@ -1 +1 @@ -5 +9 diff --git a/xCATsn/debian/control b/xCATsn/debian/control index 7ed6120d9..250449a81 100644 --- a/xCATsn/debian/control +++ b/xCATsn/debian/control @@ -2,12 +2,15 @@ Source: xcatsn Section: admin Priority: extra Maintainer: xCAT -Build-Depends: debhelper (>= 5) -Standards-Version: 3.7.2 +Build-Depends: debhelper (>= 9) +Standards-Version: 3.9.4 +Homepage: https://xcat.org/ Package: xcatsn Architecture: all -Depends: ${perl:Depends}, xcat-server, perl-xcat, xcat-client, libdbd-sqlite3-perl, libxml-parser-perl, tftpd-hpa, tftp-hpa, conserver-xcat, libnet-telnet-perl, dhcp3-server, apache2, expect, nfs-kernel-server, nmap, bind9, ipmitool-xcat (>=1.8.17-1), syslinux-xcat, xnba-undi, xcat-genesis-scripts-ppc64, xcat-genesis-scripts-amd64, elilo-xcat,libsys-virt-perl, xcat-probe (>=2.12) -Recommends: yaboot-xcat +Depends: ${perl:Depends}, xcat-server (>= 2.13-snap000000000000), xcat-client (>= 2.13-snap000000000000), libdbd-sqlite3-perl, libxml-parser-perl, tftpd-hpa, conserver-xcat, libnet-telnet-perl, isc-dhcp-server, apache2, nfs-kernel-server, xcat-genesis-scripts-ppc64 (>= 2.13-snap000000000000), xcat-genesis-scripts-amd64 (>= 2.13-snap000000000000) +Recommends: bind9, nmap, tftp-hpa, ipmitool-xcat (>= 1.8.17-1), syslinux[any-amd64], libsys-virt-perl, syslinux-xcat, xnba-undi, elilo-xcat, xcat-buildkit (>= 2.13-snap000000000000), xcat-probe (>= 2.13-snap000000000000) +Suggests: yaboot-xcat Description: Metapackage for a common, default xCAT service node setup - xCATsn is a service node management package intended for at-scale management, including hardware management and software management. + xCATsn is a service node management package intended for at-scale + management, including hardware management and software management. diff --git a/xCATsn/debian/rules b/xCATsn/debian/rules index ce79be57f..38689173d 100755 --- a/xCATsn/debian/rules +++ b/xCATsn/debian/rules @@ -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. @@ -38,7 +34,7 @@ binary-arch: pwd dh_testdir dh_testroot - dh_installchangelogs + dh_installchangelogs dh_installdocs # dh_installexamples dh_install -X".svn" diff --git a/xCATsn/xCATsn.spec b/xCATsn/xCATsn.spec index ed793aee6..be4ebb3ac 100644 --- a/xCATsn/xCATsn.spec +++ b/xCATsn/xCATsn.spec @@ -1,7 +1,7 @@ Summary: Metapackage for a common, default xCAT service node setup Name: xCATsn 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 @@ -13,11 +13,15 @@ BuildRoot: /var/tmp/%{name}-%{version}-%{release}-root #BuildArch: noarch Source1: xcat.conf Source2: license.tar.gz -Source3: xCATSN +Source3: xCATSN Source5: templates.tar.gz Source6: xcat.conf.apach24 -Provides: xCATsn = %{version} -Requires: xCAT-server xCAT-client perl-DBD-SQLite xCAT-genesis-scripts-x86_64 xCAT-genesis-scripts-ppc64 xCAT-probe >= 2.12.2 +Requires: perl-DBD-SQLite +Requires: xCAT-client = 4:%{version}-%{release} +Requires: xCAT-server = 4:%{version}-%{release} +Requires: xCAT-probe = 4:%{version}-%{release} +Requires: xCAT-genesis-scripts-x86_64 = 1:%{version}-%{release} +Requires: xCAT-genesis-scripts-ppc64 = 1:%{version}-%{release} Conflicts: xCAT @@ -37,8 +41,6 @@ Requires: /usr/sbin/dhcpd Requires: /usr/bin/ssh %ifnarch s390x Requires: /etc/xinetd.d/tftp -# yaboot-xcat is pulled in so any MN can manage ppc nodes -#Requires: yaboot-xcat # Stty is only needed for rcons on ppc64 nodes, but for mixed clusters require it on both x and p Requires: perl-IO-Stty %endif @@ -74,7 +76,7 @@ Requires: syslinux-xcat %description xCATsn is a service node management package intended for at-scale management, -including hardware management and software management. +including hardware management and software management. %prep @@ -181,9 +183,9 @@ if [ "$1" = "1" ]; then #Only if installing for the first time.. # setup sqlite if no other database -%ifos linux -if [ -f "/proc/cmdline" ]; then #check to make sure this is not image install - if [ ! -s /etc/xcat/cfgloc ]; then # database is sqlite +%ifos linux +if [ -f "/proc/cmdline" ]; then #check to make sure this is not image install + if [ ! -s /etc/xcat/cfgloc ]; then # database is sqlite $RPM_INSTALL_PREFIX0/sbin/xcatconfig -d fi fi @@ -207,16 +209,16 @@ else # SuSE fi # start xcatd on linux [ -e "/etc/init.d/$apachedaemon" ] && chkconfig $apachedaemon on -[ -e "/usr/lib/systemd/system/$apacheserviceunit" ] && systemctl enable $apacheserviceunit +[ -e "/usr/lib/systemd/system/$apacheserviceunit" ] && systemctl enable $apacheserviceunit if [ -f "/proc/cmdline" ]; then # prevent running it during install into chroot image XCATROOT=$RPM_INSTALL_PREFIX0 /etc/init.d/xcatd restart - [ -e "/etc/init.d/$apachedaemon" ] && /etc/init.d/$apachedaemon reload - [ -e "/usr/lib/systemd/system/$apacheserviceunit" ] && systemctl reload $apacheserviceunit + [ -e "/etc/init.d/$apachedaemon" ] && /etc/init.d/$apachedaemon reload + [ -e "/usr/lib/systemd/system/$apacheserviceunit" ] && systemctl reload $apacheserviceunit fi echo "xCATsn is now installed" %else # start xcatd on AIX - XCATROOT=$RPM_INSTALL_PREFIX0 $RPM_INSTALL_PREFIX0/sbin/restartxcatd + XCATROOT=$RPM_INSTALL_PREFIX0 $RPM_INSTALL_PREFIX0/sbin/restartxcatd echo "xCATsn is now installed" %endif @@ -237,7 +239,6 @@ if [ -f "/proc/cmdline" -a -f "/etc/xcat/genesis-scripts-updated" ]; then fi %endif - %clean %files