diff --git a/README.md b/README.md new file mode 100644 index 000000000..099daf883 --- /dev/null +++ b/README.md @@ -0,0 +1,25 @@ +# xCAT + +xCAT is a toolkit for deployment and administration of clusters of all sizes. + +# Documentation + +xCAT Documentation is hosted on Read The Docs: https://xcat-docs.readthedocs.io + +## Status + +| xCAT Version | Build Status | +|---|---| +| Latest (master branch) | [![Documentation Status](https://readthedocs.org/projects/xcat-docs/badge/?version=latest)](https://xcat-docs.readthedocs.io/en/latest/) | +| Stable (latest release) | [![Documentation Status](https://readthedocs.org/projects/xcat-docs/badge/?version=stable)](https://xcat-docs.readthedocs.io/en/stable/) | + +Looking for [older versions](https://readthedocs.org/projects/xcat-docs/versions/)? + +# Open Source License + +xCAT is made available under the EPL license: https://opensource.org/licenses/eclipse-1.0.php + +# Developers + +Want to help? Check out the [developers guide](http://xcat-docs.readthedocs.io/en/latest/developers)! + diff --git a/README.rst b/README.rst deleted file mode 100644 index 36d9cfc0c..000000000 --- a/README.rst +++ /dev/null @@ -1,26 +0,0 @@ -xCAT ----- - -xCAT is a toolkit for the deployment and administration of clusters. - -Documentation -------------- - -`The stable documentation of xCAT `_ - -`The latest documentation of xCAT `_ - -`The documentation of xCAT each release `_ - - -Open Source License -------------------- - -xCAT is made available as open source software under the EPL license: -http://www.opensource.org/licenses/eclipse-1.0.php - -Developers ----------- - -Developers and prospective contributors are encouraged to read the `Developers Guide `_ -In particular the `GitHub `_ related subsection. diff --git a/Version b/Version index d7b0d017e..e3d069645 100644 --- a/Version +++ b/Version @@ -1 +1 @@ -2.14.6 +2.15 diff --git a/build-ubunturepo b/build-ubunturepo index 9b9cd07b7..a40bb7a18 100755 --- a/build-ubunturepo +++ b/build-ubunturepo @@ -24,6 +24,10 @@ # prep for a release. # GPGSIGN=0 - Do not sign the repo in the end of the build. The repo will be signed by default # +# LOCAL_KEY=1 Use local keys to sign repo instead of WGET from GSA. By default use GSA. +# +# SETUP=1 Setup environment for build. By default do not setup environment. +# # LOG= - provide an LOG file option to redirect some output into log file # # DEST= - provide a directory to contains the build result @@ -48,16 +52,8 @@ if [[ ! -f /etc/lsb-release ]]; then fi . /etc/lsb-release -# Check the necessary packages before starting the build -declare -a packages=( "reprepro" "devscripts" "debhelper" "libsoap-lite-perl" "libdbi-perl" "quilt" "git") +export HOME=/root -for package in ${packages[@]}; do - RC=`dpkg -l | grep $package >> /dev/null 2>&1; echo $?` - if [[ ${RC} != 0 ]]; then - echo "ERROR: Could not find $package, install using 'apt-get install $package' to continue" - exit 1 - fi -done # Process cmd line variable assignments, assigning each attr=val pair to a variable of same name for i in $*; do @@ -70,6 +66,44 @@ for i in $*; do export $varstring done +#Setup environment so the xcat-deps can be built on a FVT test machine +if [ "$SETUP" = "1" ];then + #Mount GSA + POKGSA="/gsa/pokgsa" + POKGSA2="/gsa/pokgsa-p2" + POKGSAIBM="pokgsa.ibm.com" + if [ ! -d $POKGSA ];then + mkdir -p $POKGSA + mount ${POKGSAIBM}:${POKGSA} ${POKGSA} + fi + if [ ! -d $POKGSA2 ];then + mkdir -p $POKGSA2 + mount ${POKGSAIBM}:${POKGSA2} ${POKGSA2} + fi + + # Verify needed packages installed + REPREPO="reprepro" + DEVSCRIPTS="devscripts" + DEBHELPER="debhelper" + QUILT="quilt" + + apt-get -y install $REPREPO $DEVSCRIPTS $DEBHELPER $QUILT + + echo "Finised setup for xcat-dep build. Rerun this script with SETUP=0 LOCAL_KEY=1 flags" + exit 1 +fi + +# Check the necessary packages before starting the build +declare -a packages=( "reprepro" "devscripts" "debhelper" "libsoap-lite-perl" "libdbi-perl" "quilt" "git") + +for package in ${packages[@]}; do + RC=`dpkg -l | grep $package >> /dev/null 2>&1; echo $?` + if [[ ${RC} != 0 ]]; then + echo "ERROR: Could not find $package, install using 'apt-get install $package' to continue" + exit 1 + fi +done + # Supported distributions dists="saucy trusty utopic xenial bionic" @@ -136,8 +170,6 @@ function setbranch { fi } -export HOME=/root - WGET_CMD="wget" if [ ! -z ${LOG} ]; then WGET_CMD="wget -o ${LOG}" @@ -150,10 +182,16 @@ else gsa_url=http://pokgsa.ibm.com/projects/x/xcat/build/linux mkdir -p $HOME/.gnupg for key_name in pubring.gpg secring.gpg trustdb.gpg; do - if [ ! -f $HOME/.gnupg/$key_name ] || [ `wc -c $HOME/.gnupg/$key_name|cut -f 1 -d' '` == 0 ]; then - rm -f $HOME/.gnupg/$key_name - ${WGET_CMD} -P $HOME/.gnupg $gsa_url/keys/$key_name + if [ "$LOCAL_KEY" = "1" ];then + # Keys are already in the local $HOME/.gnupg directory chmod 600 $HOME/.gnupg/$key_name + else + # Need to download keys from GSA + if [ ! -f $HOME/.gnupg/$key_name ] || [ `wc -c $HOME/.gnupg/$key_name|cut -f 1 -d' '` == 0 ]; then + rm -f $HOME/.gnupg/$key_name + ${WGET_CMD} -P $HOME/.gnupg $gsa_url/keys/$key_name + chmod 600 $HOME/.gnupg/$key_name + fi fi done fi @@ -427,9 +465,8 @@ 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." + echo "build-ubunturepo: It appears that you do not have GSA to access the xcat-dep pkgs." exit 1; fi diff --git a/builddep.sh b/builddep.sh index 8f66989c4..75235fa99 100755 --- a/builddep.sh +++ b/builddep.sh @@ -12,11 +12,16 @@ # - createrepo command needs to be present on the build machine # # Usage: builddep.sh [attr=value attr=value ...] -# DESTDIR= - the dir to place the dep tarball in. The default is ../../../xcat-dep, +# DESTDIR= - the dir to place the dep tarball in. The default is ../../xcat-dep-build, # relative to where this script is located. # UP=0 or UP=1 - override the default upload behavior # FRSYUM=0 - put the directory of individual rpms in the project web area instead # of the FRS area. +# CHECK=0 or 1 - verify proper file location and links. Default is to check. +# Verifies all noarch files in ..../// are links +# Verifies no broken link files in ..../// +# Verifies there are no multiple, real (non-link) files with the same name +# Verifies all real (non-link) files have a link to it # VERBOSE=1 - Set to 1 to see more VERBOSE output # This script should only be run on RPM based machines @@ -30,10 +35,14 @@ fi USER=xcat TARGET_MACHINE=xcat.org +BASE_GSA=/gsa/pokgsa/projects/x/xcat/build +GSA=$BASE_GSA/linux/xcat-dep + FRS=/var/www/xcat.org/files/xcat OSNAME=$(uname) UP=0 +CHECK=1 # Process cmd line variable assignments, assigning each attr=val pair to a variable of same name for i in $*; do # upper case the variable name @@ -41,14 +50,7 @@ for i in $*; do export $varstring done -if [ "$OSNAME" == "AIX" ]; then - DFNAME=dep-aix-`date +%Y%m%d%H%M`.tar.gz - GSA=/gsa/pokgsa/projects/x/xcat/build/aix/xcat-dep -else - DFNAME=xcat-dep-`date +%Y%m%d%H%M`.tar.bz2 - GSA=/gsa/pokgsa/projects/x/xcat/build/linux/xcat-dep - export HOME=/root # This is so rpm and gpg will know home, even in sudo -fi +DFNAME=xcat-dep-`date +%Y%m%d%H%M`.tar.bz2 if [ ! -d $GSA ]; then echo "ERROR: This script is intended to be used by xCAT development..." @@ -66,6 +68,14 @@ for pkg in ${REQPKG[*]}; do fi done +GNU_KEYDIR="$HOME/.gnupg" +MACROS=$HOME/.rpmmacros +if [[ -d ${GNU_KEYDIR} ]]; then + echo "ERROR: The gnupg key dir: $GNU_KEYDIR exists, it will be overwitten. Stop." + echo "ERROR: To continue, remove it and rerun the script." + exit 1 +fi + # set grep to quiet by default GREP="grep -q" if [ "$VERBOSE" = "1" -o "$VERBOSE" = "yes" ]; then @@ -81,164 +91,196 @@ else YUMDIR=htdocs fi -cd `dirname $0` -XCATCOREDIR=`/bin/pwd` +SCRIPT=$(readlink -f "$0") +XCATCOREDIR=$(dirname "$SCRIPT") +echo "INFO: Running script from here: $XCATCOREDIR ..." + +cd $XCATCOREDIR if [ -z "$DESTDIR" ]; then - # This is really a hack here because it depends on the build - # environment structure. However, it's not expected that - # users are building the xcat-dep packages - DESTDIR=../../xcat-dep + if [[ $XCATCOREDIR == *"xcat2_autobuild_daily_builds"* ]]; then + # This shows we are in the daily build environment path, create the + # deps package at the top level of the build directory + DESTDIR=../../xcat-dep-build + else + # This means we are building in some other clone of xcat-core, + # so just place the destination one level up. + DESTDIR=../xcat-dep-build + fi fi +echo "INFO: Target package name: $DFNAME" +echo "INFO: Target package will be created here: $XCATCOREDIR/$DESTDIR" + +# Create a function to check the return code, +# if non-zero, we should stop or unexpected things may happen +function checkrc { + if [[ $? != 0 ]]; then + echo "[checkrc] non-zero return code, exiting..." + exit 1 + fi +} + +# Verify files in $GSA +if [[ ${CHECK} -eq 1 ]]; then + ERROR=0 + LINKED_TO_FILES_ARRAY=[] + counter=0 + OSes=`find $GSA -maxdepth 1 -mindepth 1 -type d` + for os in $OSes; do + ARCHes=`find $os -maxdepth 1 -mindepth 1 -type d` + for arch in $ARCHes; do + + # Find regular noarch.rpm files in / directory + for file in `find $arch -type f -name "*noarch.rpm"`; do + ERROR=1 + echo -e "\nError: Regular 'noarch' file $file found in 'arch' directory. Expected a link." + done + + # Find broken links file + for file in `find $arch -xtype l -name "*noarch.rpm"`; do + ERROR=1 + echo -e "\nError: Broken link file $file" + done + + # Save a link of everything being linked to for later use + for link_file in `find $arch -type l -name "*.rpm"`; do + LINKED_TO_FILE=`realpath --relative-to=$GSA $link_file` + LINKED_TO_FILES_ARRAY[$counter]=$LINKED_TO_FILE + counter=$counter+1 + done + + + done + done + + # Find identical files in $GSA and $GSA/ directory + for short_file in $GSA/*.rpm; do + basename=$(basename -- "$short_file") + DUP_FILES=`find $GSA/*/ -type f -name $basename` + if [[ ! -z $DUP_FILES ]]; then + ERROR=1 + echo -e "\nError: Multiple real files with the same name found ($basename):" + for dup_file in `find $GSA -type f -name $basename`; do + ls -l $dup_file + done + fi + done + + if [ -n "$VERBOSEMODE" ]; then + # In verbose mode print contents of array containing all the files someone links to from / + for var in "${LINKED_TO_FILES_ARRAY[@]}"; do + echo "Symlink detected to file: ${var} " + done + fi + + echo " " + # Find all files no one links to + REAL_FILES=`find $GSA/* -maxdepth 1 -type f -name "*.rpm" | cut -d / -f 10,11 --output-delimiter="/"` + for file in $REAL_FILES; do + FOUND=0 + for used_link in "${LINKED_TO_FILES_ARRAY[@]}"; do + if [[ $file == $used_link ]]; then + FOUND=1 + break + fi + done + if [[ ${FOUND} -eq 0 ]]; then + echo "Warning: No symlinks to file: $GSA/$file" + fi + done + + if [[ ${ERROR} -eq 1 ]]; then + echo -e "\nErrors found verifying files. Rerun this script with CHECK=0 to skip file verification." + exit 1 + fi +fi + +WORKING_TARGET_DIR="${DESTDIR}/xcat-dep" # Sync from the GSA master copy of the dep rpms -mkdir -p $DESTDIR/xcat-dep -echo "Syncing RPMs from $GSA/ to $DESTDIR/xcat-dep ..." -rsync -ilrtpu --delete $GSA/ $DESTDIR/xcat-dep -cd $DESTDIR/xcat-dep +mkdir -p ${WORKING_TARGET_DIR} +checkrc + +# Copy over the xcat-dep from master staging area on GSA to the local directory here +echo "Syncing RPMs from $GSA/ to ${WORKING_TARGET_DIR} ..." +rsync -ilrtpu --delete $GSA/ ${WORKING_TARGET_DIR} +checkrc +ls ${WORKING_TARGET_DIR} +cd ${WORKING_TARGET_DIR} # add a comment to indicate the latest xcat-dep tar ball name sed -i -e "s#REPLACE_LATEST_SNAP_LINE#The latest xcat-dep tar ball is ${DFNAME}#g" README -if [ "$OSNAME" != "AIX" ]; then - # Get gpg keys in place - 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 - cp $GSA/../keys/$i $HOME/.gnupg - chmod 600 $HOME/.gnupg/$i - fi - done - - # Tell rpm to use gpg to sign - MACROS=$HOME/.rpmmacros - if ! $GREP -q '%_signature gpg' $MACROS 2>/dev/null; then - echo '%_signature gpg' >> $MACROS +# Get gpg keys in place +mkdir -p ${GNU_KEYDIR} +checkrc +for i in pubring.gpg secring.gpg trustdb.gpg; do + if [ ! -f ${GNU_KEYDIR}/$i ] || [ `wc -c ${GNU_KEYDIR}/$i|cut -f 1 -d' '` == 0 ]; then + rm -f ${GNU_KEYDIR}/$i + cp $GSA/../keys/$i ${GNU_KEYDIR} + chmod 600 ${GNU_KEYDIR}/$i fi - if ! $GREP -q '%_gpg_name' $MACROS 2>/dev/null; then - echo '%_gpg_name xCAT Security Key' >> $MACROS - fi - - # Sign the rpms that are not already signed. The "standard input reopened" warnings are normal. - echo "===> Signing RPMs..." - $XCATCOREDIR/build-utils/rpmsign.exp `find . -type f -name '*.rpm'` | grep -v -E '(already contains identical signature|was already signed|rpm --quiet --resign|WARNING: standard input reopened)' - - # Create the repodata dirs - echo "===> Creating repodata directories..." - for i in `find -mindepth 2 -maxdepth 2 -type d `; do - if [ -n "$VERBOSEMODE" ]; then - createrepo --checksum sha $i # specifying checksum so the repo will work on rhel5 - else - createrepo --checksum sha $i >/dev/null - fi - rm -f $i/repodata/repomd.xml.asc - gpg -a --detach-sign $i/repodata/repomd.xml - if [ ! -f $i/repodata/repomd.xml.key ]; then - cp $GSA/../keys/repomd.xml.key $i/repodata - fi - done - - # Modify xcat-dep.repo files to point to the correct place - echo "===> Modifying the xcat-dep.repo files to point to the correct location..." -fi - -if [ "$OSNAME" == "AIX" ]; then - # Build the instoss file ------------------------------------------ - - cat >instoss << 'EOF' -#!/bin/ksh -# IBM(c) 2007 EPL license http://www.eclipse.org/legal/epl-v10.html -# xCAT on AIX - prerequisite install script -cd `dirname $0` -PERLVER=`perl -v|grep 'This is perl'|cut -d' ' -f 4` -if [ "$PERLVER" == "v5.8.2" ]; then - OSVER='5.3' -elif [ "$PERLVER" == "v5.8.8" ]; then - OSVER='6.1' - aixver=`lslpp -lc|grep 'bos.rte:'|head -1|cut -d: -f3` - if [[ $aixver < '6.1.9.0' ]]; then - AIX61Y=0 - else - AIX61Y=1 - fi -elif [ "$PERLVER" == "v5.10.1" ]; then - OSVER='7.1' - aixver=`lslpp -lc|grep 'bos.rte:'|head -1|cut -d: -f3` - if [[ $aixver < '7.1.3.0' ]]; then - AIX71L=0 - else - AIX71L=1 - fi - -else - echo "Error: the perl version of '$PERLVER' is not one that instoss understands. Exiting..." - exit 2 -fi -cd $OSVER -# Have to install rpms 1 at a time, since some may be already installed. -# The only interdependency between the dep rpms so far is that net-snmp requires bash, and -# pyodbc requires unixODBC. (The bash dependency is taken care of automatically because it -# comes earlier in the alphabet.) - -# first run /usr/sbin/updtvpkg to make sure any installp software is -# registered with RPM. -echo "Running updtvpkg. This could take a few minutes." -/usr/sbin/updtvpkg -echo "updtvpkg has completed." - -# unixODBC is required by pyodbc, so install it first -rpm -Uvh unixODBC* -# Now install the bulk of the rpms, one at a time, in case some are already installed -for i in `ls *.rpm|grep -v -E '^tcl-|^tk-|^expect-|^unixODBC-|^xCAT-UI-deps|^perl-DBD-DB2Lite|^net-snmp'`; do - if [ "$i" == "perl-Net-DNS-0.66-1.aix5.3.ppc.rpm" ]; then - opts="--nodeps" - else - opts="" - fi - - # On 7.1L and 6.1Y we need a newer version of perl-Net_SSLeay.pm - if [[ $AIX71L -eq 1 || $AIX61Y -eq 1 ]]; then - if [[ $i == perl-Net_SSLeay.pm-1.30-* ]]; then continue; fi # skip the old rpm - else - if [[ $i == perl-Net_SSLeay.pm-1.55-* ]]; then continue; fi # skip the new rpm - fi - - echo rpm -Uvh $opts $i - rpm -Uvh $opts $i done -# Have to upgrade all of the net-snmp rpms together because they depend on each other. -# Also, they require bash, so do it after the loop, rather than before -rpm -Uvh net-snmp* -EOF -# end of instoss file content --------------------------------------------- +# Tell rpm to use gpg to sign +if ! $GREP -q '%_signature gpg' $MACROS 2>/dev/null; then + echo '%_signature gpg' >> $MACROS +fi +if ! $GREP -q '%_gpg_name' $MACROS 2>/dev/null; then + echo '%_gpg_name xCAT Automatic Signing Key' >> $MACROS +fi +# Sign the rpms that are not already signed. The "standard input reopened" warnings are normal. +echo "===> Signing RPMs..." +$XCATCOREDIR/build-utils/rpmsign.exp `find . -type f -name '*.rpm'` | grep -v -E '(already contains identical signature|was already signed|rpm --quiet --resign|WARNING: standard input reopened)' - chmod +x instoss +# Create the repodata dirs +echo "===> Creating repodata directories..." +for i in `find -mindepth 2 -maxdepth 2 -type d `; do + if [ -n "$VERBOSEMODE" ]; then + createrepo $i # specifying checksum so the repo will work on rhel5 + else + createrepo $i >/dev/null + fi + rm -f $i/repodata/repomd.xml.asc + gpg -a --detach-sign --default-key 5619700D $i/repodata/repomd.xml + if [ ! -f $i/repodata/repomd.xml.key ]; then + cp $GSA/../keys/repomd.xml.key $i/repodata + fi +done + +echo "===> Making sure that the mklocalrepo.sh file contains execute permission ..." +ls -ltr ${XCATCOREDIR}/${WORKING_TARGET_DIR}/mklocalrepo.sh +if [[ ! -x "${XCATCOREDIR}/${WORKING_TARGET_DIR}/mklocalrepo.sh" ]]; then + echo "===> --- found not execute, changing +x ..." + chmod +x ${XCATCOREDIR}/${WORKING_TARGET_DIR}/mklocalrepo.sh +fi + +echo "===> Checking if 'replacelinks' is in the xcat-deps, removing if there ..." +if [[ -f ${XCATCOREDIR}/${WORKING_TARGET_DIR}/replacelinks ]]; then + rm -f ${XCATCOREDIR}/${WORKING_TARGET_DIR}/replacelinks fi # Get the permissions and group correct -if [ "$OSNAME" == "AIX" ]; then - # AIX - SYSGRP=system - YUM=aix - FRSDIR='2.x_AIX' -else - # Linux - SYSGRP=root - YUM=yum/devel - FRSDIR='2.x_Linux' -fi +SYSGRP=root +YUM=yum/devel +FRSDIR='2.x_Linux' chgrp -R -h $SYSGRP * chmod -R g+w * -echo "===> Building the tarball..." +# Change permission on all repodata files to be readable by all +chmod a+r */*/repodata/*.gz +chmod a+r */*/repodata/*.bz2 + +TARBALL_WORKING_DIR="${XCATCOREDIR}/${DESTDIR}" +echo "===> Building the tarball at: ${TARBALL_WORKING_DIR} ..." +# +# Want to stay one level above xcat-dep so that the script +# can rsync the directory up to xcat.org. # -# Want to stay above xcat-dep so we can rsync the whole directory # DO NOT CHANGE DIRECTORY AFTER THIS POINT!! # -cd .. -pwd + +cd ${TARBALL_WORKING_DIR} verbosetar="" if [ -n "$VERBOSEMODE" ]; then @@ -246,14 +288,13 @@ if [ -n "$VERBOSEMODE" ]; then fi echo "===> Creating $DFNAME ..." -if [ "$OSNAME" == "AIX" ]; then - tar $verbosetar -cf ${DFNAME%.gz} xcat-dep - rm -f $DFNAME - gzip ${DFNAME%.gz} -else - # Linux - tar $verbosetar -jcf $DFNAME xcat-dep -fi +tar $verbosetar -jcf $DFNAME xcat-dep +chmod a+r $DFNAME + + +# Modify all xcat-dep.repo files to point to the correct place: $YUM +echo "===> Modifying the xcat-dep.repo files to point to the correct 'yum/devel' location..." +find ${WORKING_TARGET_DIR} -type f -name "xcat-dep.repo" -exec sed -i s#/yum/xcat-dep#/${YUM}/xcat-dep#g {} \; if [[ ${UP} -eq 0 ]]; then echo "Upload not being done, set UP=1 to upload to xcat.org" diff --git a/docs/README.md b/docs/README.md index 8b4779eaf..3c105885e 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,31 +1,29 @@ # Welcome to the xCAT documentation -The latest docs are here: http://xcat-docs.readthedocs.io/en/latest/ +The xCAT docs are hosted here: https://xcat-docs.readthedocs.io/ and are written in reStructuredText (`.rst`). -The documentation project is written in restructured text (.rst) using Sphinx and hosted on ReadTheDocs. +## Building Docs -## Building Documentation +* Clone this project -* Clone the project - -* Using pip, install or update sphinx (See: http://pip.readthedocs.org/) +* Install or update sphinx (See: https://pip.readthedocs.io/) ``` - pip install sphinx + pip install sphinx ``` or ``` - pip install sphinx --upgrade + pip install sphinx --upgrade ``` -* Using pip, install ReadTheDocs theme +* Install ReadTheDocs theme ``` pip install sphinx_rtd_theme ``` * Build the Docs ``` - cd xcat-core/docs - make html + cd xcat-core/docs + make html ``` -* View the docs by opening index.html from a web browser under xcat-core/docs/build/html/index.html +* View the documentation by pointing a browser to: `xcat-core/docs/build/html/index.html` diff --git a/docs/source/advanced/docker/docker_registry.rst b/docs/source/advanced/docker/docker_registry.rst deleted file mode 100644 index f088fbe57..000000000 --- a/docs/source/advanced/docker/docker_registry.rst +++ /dev/null @@ -1,171 +0,0 @@ -Docker Registry in xCAT -======================= - -Docker Registry is a stateless, highly scalable server side application that stores and lets you distribute Docker images. - -This document describes how to set up a local private docker registry on Ubuntu 15.04 on x86_64. - -.. note:: Ensure that docker registry is not already set up on this docker host. - -Setting Up Docker Host ----------------------- - -Install Docker version 1.6.0 or newer. - -Setting Up Docker Registry Manually ------------------------------------ - -Docker registry needed to be set up on xCAT's MN. - -This section describes two methods of setting up docker registry manually. - -First, create some folders where files for this tutorial will live. :: - - mkdir /docker-registry && cd $_ - mkdir certs - -Copy xCAT server certificate and key to certs folder. :: - - cp /etc/xcat/cert/server-cert.pem certs/domain.crt - cp /etc/xcat/cert/server-key.pem certs/domain.key - -Method 1: Start Docker Registry Directly -```````````````````````````````````````` - -Create Configuration File -''''''''''''''''''''''''' - -Define configuration file ``docker-registry`` under ``/docker-registry/`` folder as below. :: - - #!/bin/bash - - docker_command=$1 - if [ $docker_command = "start" ]; then - docker_ps_result=$(docker ps -a | grep "registry") - if [ -z $docker_ps_result ]; then - docker run -d -p 5000:5000 --restart=always --name registry \ - -v `pwd`/data:/data \ - -e REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY=/data \ - -v `pwd`/certs:/certs \ - -e REGISTRY_HTTP_TLS_CERTIFICATE=/certs/domain.crt \ - -e REGISTRY_HTTP_TLS_KEY=/certs/domain.key \ - registry:2 - else - docker start registry - fi - elif [ $docker_command = "stop" ]; then - docker stop registry - else - echo "The parameter is wrong." - fi - -Starting Docker Registry as a Service -''''''''''''''''''''''''''''''''''''' - -Create ``docker-registry.service`` file in ``/etc/systemd/system/``, add the following contents to it. :: - - [Unit] - Description=Docker Registry - - [Service] - Type=oneshot - RemainAfterExit=yes - WorkingDirectory=/docker-registry - ExecStart=/bin/bash docker-registry start - ExecStop=/bin/bash docker-registry stop - - [Install] - WantedBy=default.target - -Start registry service: :: - - service docker-registry start - -Method 2: Managing Docker Registry with Compose -``````````````````````````````````````````````` - -Docker Compose it is a tool for defining and running Docker applications. It could help setting up registry. - -Install Docker Compose -'''''''''''''''''''''' - -Compose can also be run inside a container, from a small bash script wrapper. To install compose as a container run: :: - - curl -L https://github.com/docker/compose/releases/download/1.5.2/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose - chmod +x /usr/local/bin/docker-compose - -Create Configuration File -''''''''''''''''''''''''' - -Define configuration file ``docker-compose.yml`` under ``/docker-registry/`` folder as below. :: - - registry: - restart: always - image: registry:2 - ports: - - 5000:5000 - environment: - REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY: /data - REGISTRY_HTTP_TLS_CERTIFICATE: /certs/domain.crt - REGISTRY_HTTP_TLS_KEY: /certs/domain.key - volumes: - - ./data:/data - - ./certs:/certs - -The environment section sets environment variables in the Docker registry container. The Docker registry app knows to check this environment variable when it starts up and to start saving its data to the ``/data`` folder as a result. - -Starting Docker Registry as a Service -''''''''''''''''''''''''''''''''''''' - -Create ``docker-registry.service`` file in ``/etc/systemd/system/``, add the following contents to it. :: - - [Uint] - Description=Docker Registry - - [Service] - Type=simple - Restart=on-failure - RestartSec=30s - WorkingDirectory=/docker-registry - ExecStart=/usr/local/bin/docker-compose up - - [Install] - WantedBy=default.target - -Start registry service: :: - - service docker-registry start - -Accessing Docker Registry from other docker host ------------------------------------------------- - -Copy ca.crt file from xCAT MN to a client machine. Client machine must be a docker host. :: - - scp username@xCAT_MN_ip:/etc/xcat/cert/ca.pem /etc/docker/certs.d/domainname:5000/ca.crt - -List Available Images in Registry -````````````````````````````````````` -:: - - curl -k https://domainname:5000/v2/_catalog - -Pull Images from Registry -````````````````````````` -Just use the "tag" image name, which includes the domain name, port, and image name. :: - - docker pull domainname:5000/imagename - -Push Images to Registry -``````````````````````` - -Before the image can be pushed to the registry, it must be tagged with the location of the private registry. :: - - docker tag imagename domainname:5000/imagename - -Now we can push that image to our registry. :: - - docker push domainname:5000/imagename - -**note:** If there is a problem with the CA certificate, edit the file ``/etc/default/docker`` so that there is a line that reads: ``DOCKER_OPTS="--insecure-registry domianname:5000"`` . Then restart Docker daemon ``service docker restart`` . - - diff --git a/docs/source/advanced/docker/dockerized_xcat/dockerized_xcat.rst b/docs/source/advanced/docker/dockerized_xcat/dockerized_xcat.rst deleted file mode 100644 index e6eb29fff..000000000 --- a/docs/source/advanced/docker/dockerized_xcat/dockerized_xcat.rst +++ /dev/null @@ -1,97 +0,0 @@ -Dockerized xCAT -================ - - -Overview --------- - -`Docker `_ is a popular containment environment making it easier to create, deploy, and run applications/services. With Docker, applications/services are shipped as **Docker images** and run in **Docker containers**. **Docker containers** include the application/services and all of its running environment, which have isolated namespace and network stack but share the kernel on the host operating system. The server on which **Docker containers** run is called **Docker host**. **Docker image** can only run on **Docker host** with the same architecture. - - -.. image:: ./imgs/xcatindocker4.jpg - :height: 500 px - :width: 600 px - :scale: 50 % - :alt: alternate text - :align: right - - -**Compose** is a native tool shipped by Docker to define and run applications in Docker containers. You use a Compose file to configure your applications/services. Then, using a single command, you create and start all the services from your configuration. - -By pulling xCAT Docker image and running xCAT Docker image in a container, you get a well-configured xCAT Management Node to start cluster management work, without worrying about the xCAT installation and configuration on different OS and various hardware platforms. - - -xCAT Docker images ------------------- - -xCAT ships 2 Docker images for Docker host with different architecture: - -* "xcat/xcat-ubuntu-x86_64": run on x86_64 Docker host -* "xcat/xcat-ubuntu-ppc64le": run on ppc64le Docker host - -Each of the xCAT Docker images above has 3 tags corresponding to different xCAT release inside Docker image: - -* "latest" : the latest xCAT release -* "2.11" : xCAT 2.11 release -* "dev" : the latest xCAT development snapshot build - -A Docker image with specified tag should be denoted in format "[docker image name]:[tag]", for example, "xcat/xcat-ubuntu-x86_64:2.11". If not specified, default tag is "latest". - - -Run xCAT in Docker ------------------- - -Each container with xCAT Docker image running inside is a xCAT management node, the container connects to the compute nodes and hardware control points in the cluster via "bridge" network on the Docker host. Generally, a xCAT container should connect to 2 types of networks( the 2 types of networks might be one network in some cluster): - -* "mgtnet": Management network, the network used by the Management Node to install operating systems and manage the nodes. The Management Node and in-band Network Interface Card (NIC) of the nodes are connected to this network. A bridge "mgtbr" will be created and attached to the network interface facing the compute nodes on Docker host -* "svcnet": Service network, the network used by the Management Node to control the nodes using out-of-band management using the Service Processor. A bridge "svcbr" will be created and attached to the network interface facing the hardware control points - -You are required to determine and specify some necessary information, so that xCAT is well configured and running when the container is started. This includes: - -* Docker container: xCAT Docker image with specified xCAT release; the data volumes with directories on Docker host including xCAT DB tables, the osimage resources and xCAT logs, which can be used to save and restore the data of xCAT service -* network information: the network configuration of the xCAT container -* cluster information: the domain of the cluster - -The information can be specified in 2 ways to run xCAT container: - -* in options and arguments of docker commands such as ``docker network create`` or ``docker run`` -* in the "docker-compose.yml", which contains all the configuration to start xCAT containers with Compose. This is the recommended way to start xCAT container. - -The 2 ways are described step-by-step in the following sections of this documentation. We recommend you start xCAT container with Compose. - -When xCAT Docker container is started, you can access it with ``sudo docker attach``, however, we recommend you to access it via "ssh". - - - -.. toctree:: - :maxdepth: 2 - - setup_docker_host.rst - run_xcat_in_docker_compose.rst - run_xcat_in_docker_native.rst - - - -Work with xCAT --------------- - -Once xCAT Docker container is running, you can use xCAT with the shell inside the container. Since the ssh service has been enabled on the Docker container startup, you can connect to the container via ssh. The default root password is "cluster". - -Once you attach or ssh to the container, you will find that xCAT is running and configured, you can play with xCAT and manage your cluster now. - -Currently, since xCAT can only generate the diskless osimages of Linux distributions with the same OS version and architecture with xCAT MN. If you need to provision diskless osimages besides ubuntu x86_64 with xCAT running in the Docker, you can use ``imgexport`` and ``imgimport`` to import the diskless osimages generated before. - -If you start up the xCAT Docker container by following the steps described in sections above strictly, without specifying "--dns=IP_ADDRESS...", "--dns-search=DOMAIN...", or "--dns-opt=OPTION..." options, Docker uses the /etc/resolv.conf of the host machine (where the docker daemon runs). Any DNS problem inside container, make sure the DNS server on the Docker host works well. - -Save and Restore xCAT data ----------------------------- - -According to the policy of Docker, Docker image should only be the service deployment unit, it is not recommended to save data in Docker image. Docker uses "Data Volume" to save persistent data inside container, which can be simply taken as a shared directory between Docker host and Docker container. - -For dockerized xCAT, there are 3 volumes recommended to save and restore xCAT user data. - -* "/install": save the osimage resources under "/install" directory -* "/var/log/xcat/": save xCAT logs -* "/.dbbackup": save and restore xCAT DB tables. You can save the xCAT DB tables with ``dumpxCATdb -p /.dbbackup/`` inside container and xCAT will restore the tables on the container start up. - - diff --git a/docs/source/advanced/docker/dockerized_xcat/run_xcat_in_docker_compose.rst b/docs/source/advanced/docker/dockerized_xcat/run_xcat_in_docker_compose.rst deleted file mode 100644 index c50d05e68..000000000 --- a/docs/source/advanced/docker/dockerized_xcat/run_xcat_in_docker_compose.rst +++ /dev/null @@ -1,156 +0,0 @@ -Run xCAT in Docker with Compose (Recommended) -============================================= - - -An example configuration in the documentation ---------------------------------------------- - -To demonstrate the steps to run xCAT in a Docker container, take a cluster with the following configuration as an example :: - - - The name of the docker container running xCAT: xcatmn - The hostname of container xcatmn: xcatmn - The dns domain of the cluster: clusters.com - - The management network object: mgtnet - The network bridge of management network on Docker host: mgtbr - The management network interface on the Docker host facing the compute nodes: eno1 - The IP address of eno1 on Docker host: 10.5.107.1/8 - The IP address of xCAT container in management network: 10.5.107.101 - - The service network object: svcnet - The network bridge of service network on Docker host: svcbr - The service network interface on the Docker host facing the hardware control points: eno2 - The IP address of eno2 on Docker host: 192.168.0.1/8 - The IP address of xCAT container in service network: 192.168.0.101 - - -Install Compose on Docker host ------------------------------- - -Compose v1.7.0 or above should be installed on Docker host: :: - - curl -L https://github.com/docker/compose/releases/download/1.7.0-rc1/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose - chmod +x /usr/local/bin/docker-compose - - -Customize docker-compose file ------------------------------ - -xCAT ships a docker-compose template `docker-compose.yml `_, which is a self-description file including all the configurations to run xCAT in container. You can make up your compose file based on it if you are familiar with `Compose file `_ , otherwise, you can simply customize it with the following steps: - -1. Specify the xCAT Docker image - -:: - - image: [xCAT Docker image name]:[tag] - -specify the name and tag of xCAT Docker image, for example "xcat/xcat-ubuntu-x86_64:2.11" - -2. Specify the cluster domain name - -:: - - extra_hosts: - - "xcatmn.[cluster domain name] xcatmn:[Container's IP address in management network]" - -specify the cluster domain name,i.e, "site.domain" on xCAT Management Node, for example "clusters.com", and the IP address of xCAT Docker container in the management network, such as "10.5.107.101" - -3. Specify the IP address of xCAT container in service network and management network - -:: - - networks: - - svcnet: - ipv4_address : [Container's IP address in service network] - - mgtnet: - ipv4_address : [Container's IP address in management network] - -specify the IP address of Docker container in service network and management network. If the "svcnet" is the same as "mgtnet", the 2 "svcnet" lines should be commented out. - -4. Specify the Docker network objects for management network and service network - -:: - - networks: - - #management network, attached to the network interface on Docker host - #facing the nodes to provision - mgtnet: - driver: "bridge" - driver_opts: - com.docker.network.bridge.name: "mgtbr" - ipam: - config: - - subnet: [subnet of mgtbr in CIDR] - gateway:[IP address of mgtbr] - - #service network, attached to the network interface on - #Docker host facing the bmc network - svcnet: - driver: "bridge" - driver_opts: - com.docker.network.bridge.name: "svcbr" - ipam: - config: - - subnet: [subnet of svcbr in CIDR] - gateway: [IP address of svcbr] - -specify the network configuration of bridge networks "mgtnet" and "svcnet", the network configuration of the bridge networks should be same as the network interfaces attached to the bridges. The "mgtnet" and "svcnet" might the same network in some cluster, in this case, you can ignore the lines for "svcnet". - -5. Specify the Data Volumes for xCAT Docker container - -:: - - volumes: - #the "/install" volume is used to keep user data in xCAT, - #such as osimage resources - #the user data can be accessible if specified - - [The directory on Docker host mounted to "/install" inside container]:/install - #the "/.dbbackup" volume is used to backup and restore xCAT DB tables - #Dockerized xCAT will restore xCAT DB tables if specified - #"dumpxCATdb -p /.dbbackup" should be run manually to save xCAT DB inside container - - [The directory on Docker host mounted to save xCAT DB inside container]:/.dbbackup - #the "/.logs" value is used to keep xCAT logs - #the xCAT logs will be kept if specified - - [The directory on Docker host to save xCAT logs inside container]:/var/log/xcat/ - -specify the volumes of the xCAT container used to save and restore xCAT data - - -Start xCAT Docker container with Compose ----------------------------------------- -After the "docker-compose.yml" is ready, the xCAT Docker container can be started with [1]_ :: - - docker-compose -f "docker-compose.yml" up -d; \ - ifconfig eno1 0.0.0.0; \ - brctl addif mgtbr eno1; \ - ip link set mgtbr up; \ - docker-compose logs -f - -This command starts up the Docker container and attaches the network interface "eno1" of Docker host to the bridge network "mgtbr". It is a little complex due to a Compose bug `#1003 `_ . The commands should be run successively in one line to avoid breaking the network connection of the network interface of Docker host. - -To remove the container, you can run :: - - docker-compose -f "docker-compose.yml" down; \ - ifdown eno1; \ - ifup eno1 - -To update the xCAT Docker image, you can run :: - - docker-compose -f "docker-compose.yml" pull - - -Known Issues ------------- - -.. [1] - -When you start up xCAT Docker container, you might see an error message at the end of the output like :: - - Couldn't connect to Docker daemon at http+unix://var/run/docker.sock - is it running? If it's at a non-standard location, specify the URL with the DOCKER_HOST environment variable. - -You can ignore it, the container has already been running. It is a Docker bug `#1214 `_ - diff --git a/docs/source/advanced/docker/dockerized_xcat/run_xcat_in_docker_host.rst b/docs/source/advanced/docker/dockerized_xcat/run_xcat_in_docker_host.rst new file mode 100644 index 000000000..726d9f333 --- /dev/null +++ b/docs/source/advanced/docker/dockerized_xcat/run_xcat_in_docker_host.rst @@ -0,0 +1,116 @@ +Quick Start to Use xCAT Docker Image +==================================== + +A new Docker image will be published for each new release of xCAT. Use ``docker search xcat2`` to list all Docker images xCAT has released. xCAT Docker image offical organization is ``xcat``, repository is ``xcat2``. :: + + [dockerhost]# sudo docker search xcat2 + NAME DESCRIPTION STARS OFFICIAL AUTOMATED + xcat/xcat2 ... ... ... ... + +The xCAT Docker images are tagged to match the xCAT releases, If you want to deploy the xCAT 2.14.6 version, pull down the ``xcat/xcat2:2.14.6`` image. xCAT Docker image also has a ``latest`` tag to point to the latest release. Currently xCAT Docker images are based on CentOS. + +.. Attention:: + To do discovery for POWER9 bare metal server, please refer to :doc:`xCAT Genesis Base ` + +Prerequisite for Docker Host +---------------------------- + +* To run xCAT under Docker, the services ``SELinux`` and ``AppArmor`` on Docker host must be disabled. + + SELinux can be disabled with: :: + + echo 0 > /selinux/enforce + sed -i 's/^SELINUX=.*$/SELINUX=disabled/' /etc/selinux/config + + AppArmor can be disabled with: :: + + /etc/init.d/apparmor teardown + + +* To run xCAT under Docker the ports described in :doc:`document ` should be available. + + For Linux user, use the following command to verify ports are not used :: + + netstat -nlp |grep -E ":(3001|3002|68|53|873|80|69|12429|12430|67) " + + +Pull the xCAT Docker Image from DockerHub +----------------------------------------- + +To pull the latest xCAT Docker image, run :: + + [dockerhost]# sudo docker pull xcat/xcat2:latest + + +Run xCAT in Docker Container +---------------------------- + +Run the xCAT Docker container with the Docker image ``xCAT/xCAT2:latest`` :: + + + [dockerhost]# sudo docker run -d \ + --name xcatmn \ + --network=host \ + --hostname xcatmn \ + --privileged \ + -v /sys/fs/cgroup:/sys/fs/cgroup:ro \ + -v /xcatdata:/xcatdata \ + -v /var/log/xcat:/var/log/xcat \ + -v /customer_data:/customer_data \ + xcat/xcat2:latest + + +The descriptions: + +:name: + Assign a name to the container, this name can be used to manipulate the container on docker host. + +:--network=host: + Use the host network driver for a container, that container network stack is not isolated from the docker host. + +:hostname: + Specify the hostname of container, which is available inside the container. + +:--privileged=true: + Give extended privileges to this container. + +:-v /sys/fs/cgroup\:/sys/fs/cgroup\:ro: + Is **mandatory** configuration to enable systemd in container. + +:-v /xcatdata\:/xcatdata: + xCAT container will create ``/xcatdata`` volume to store configuration and OS distro data. I.e. xCAT important directories ``/install``, ``/tftpboot`` and ``/etc`` will be saved under ``/xcatdata``. If user does not explicitly mount this directory to docker host, this directory will be mounted under ``/var/lib/docker/volumes/``. + +:-v /var/log/xcat\:/var/log/xcat: + All xCAT running logs are saved under ``/var/log/xcat``. Use this setting to export them to Docker host. + +:-v /customer_data\:/customer_data: + **Is optional**. Use this setting to transfer user data between Docker host and container. + +Run xCAT Command in Docker Container +------------------------------------ + +To enter xCAT Docker container :: + + [dockerhost]# sudo docker exec -it xcatmn bash + [xcatmn]# + +Also can enter xCAT Docker container through ``ssh`` :: + + [anynode]# ssh -p 2200 + +.. Attention:: + Need to set ``site`` table depending on your own environment. + +For example :: + + [xcatmn]# chtab key=master site.value= + + +Now container ``xcatmn`` will work as a normal xCAT management node, can run xCAT commands directly. +For example :: + + [xcatmn]# lsxcatd -a + +.. Attention:: + Use of NFS outside of xCAT Docker container is recommended. For NFS service set up inside of xCAT Docker container, mount the shared directory with ``-v`` option when starting xCAT container. + diff --git a/docs/source/advanced/docker/dockerized_xcat/run_xcat_in_docker_native.rst b/docs/source/advanced/docker/dockerized_xcat/run_xcat_in_docker_native.rst deleted file mode 100644 index 7fec49456..000000000 --- a/docs/source/advanced/docker/dockerized_xcat/run_xcat_in_docker_native.rst +++ /dev/null @@ -1,77 +0,0 @@ -Run xCAT in Docker with Docker native commands -============================================== - - -Pull the xCAT Docker image from DockerHub ------------------------------------------ - -Now xCAT ships xCAT Docker images(x86_64 and ppc64le) on the `DockerHub `_: - -To pull the latest xCAT Docker image for x86_64, run :: - - sudo docker pull xcat/xcat-ubuntu-x86_64 - -On success, you will see the pulled Docker image on Docker host :: - - [root@dockerhost1 ~]# sudo docker images - REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE - xcat/xcat-ubuntu-x86_64 latest 3a3631463e83 2 days ago 643 MB - - -An example configuration in the documentation ---------------------------------------------- - -To demonstrate the steps to run xCAT in a Docker container, take a cluster with the following configuration as an example :: - - Docker host: dockerhost1 - The name of the docker container running xCAT: xcatmn - The hostname of container xcatmn: xcatmn - - The management network object: mgtnet - The network bridge of management network on Docker host: mgtbr - The management network interface on the Docker host facing the compute nodes: eno1 - The IP address of eno1 on Docker host: 10.5.107.1/8 - The IP address of xCAT container in management network: 10.5.107.101 - - The dns domain of the cluster: clusters.com - - -Create a customized Docker network on the Docker host ------------------------------------------------------ - -**Docker Networks** provide complete isolation for containers, which gives you control over the networks your containers run on. To run xCAT in Docker, you should create a customized bridge network according to the cluster network plan, instead of using the default bridge network created on Docker installation. - -As an example, we create a customized bridge network "mgtbr" which is attached to the network interface "eno1" facing the compute nodes and inherits the network configuration of "eno1". Since the commands to create the network will break the network connection on "eno1", you'd better run the commands in one line instead of running them seperatly :: - - sudo docker network create --driver=bridge --gateway=10.5.107.1 --subnet=10.5.107.0/8 -o "com.docker.network.bridge.name"="mgtbr" mgtnet; \ - ifconfig eno1 0.0.0.0; \ - brctl addif mgtbr eno1; \ - ip link set mgtbr up - -* ``--driver=bridge`` specify the network driver to be "bridge" -* ``--gateway=10.5.107.1`` specify the network gateway to be the IP address of "eno1" on Docker host. which will also be the IP address of network bridge "mgtbr" -* ``--subnet=10.5.107.0/8`` speify the subnet in CIDR format to be the subnet of "eno1" -* ``com.docker.network.bridge.name"="mgtbr"`` specify the bridge name of management network -* ``ifconfig eno1 0.0.0.0`` delete the IP address of "eno1" -* ``brctl addif mgtbr eno1`` attach the bridge "br0" to network interface "eno1" -* ``ip link set mgtbr up`` change the state of "br0" to UP - -When the network is created, you can list it with ``sudo docker network ls`` and get the information of it with ``sudo docker inspect mgtnet``. - - -Run xCAT in Docker container ----------------------------- - -Now run the xCAT Docker container with the Docker image "xcat/xcat-ubuntu-x86_64" and connect it to the newly created customized Docker network "mgtnet" :: - - sudo docker run -it --privileged=true --hostname=xcatmn --name=xcatmn --add-host="xcatmn.clusers.com xcatmn:10.5.107.101" --volume /docker/xcatdata/:/install --net=mgtnet --ip=10.5.107.101 xcat/xcat-ubuntu-x86_64 - -* use ``--privileged=true`` to give extended privileges to this container -* use ``--hostname`` to specify the hostname of the container, which is available inside the container -* use ``--name`` to assign a name to the container, this name can be used to manipulate the container on Docker host -* use ``--add-host="xcatmn.clusers.com xcatmn:10.5.107.101"`` to write the ``/etc/hosts`` entries of Docker container inside container. Since xCAT use the FQDN(Fully Qualified Domain Name) to determine the cluster domain on startup, make sure the format to be " : ", otherwise, you need to set the cluster domain with ``chdef -t site -o clustersite domain="clusters.com"`` inside the container manually -* use ``--volume /docker/xcatdata/:/install`` to mount a pre-created "/docker/xcatdata" directory on Docker host to "/install" directory inside container as a data volume. This is optional, it is mandatory if you want to backup and restore xCAT data. -* use ``--net=mgtnet`` to connect the container to the Docker network "mgtnet" -* use ``--ip=10.5.107.101`` to specify the IP address of the xCAT Docker container - - diff --git a/docs/source/advanced/docker/dockerized_xcat/setup_docker_host.rst b/docs/source/advanced/docker/dockerized_xcat/setup_docker_host.rst deleted file mode 100644 index f0014130c..000000000 --- a/docs/source/advanced/docker/dockerized_xcat/setup_docker_host.rst +++ /dev/null @@ -1,25 +0,0 @@ -Setup Docker host -================= - -Install Docker Engine ---------------------- - -The Docker host to run xCAT Docker image should be a baremental or virtual server with Docker v1.10 or above installed. For the details on system requirements and Docker installation, refer to `Docker Installation Docs `_. - -.. note:: Docker images can only run on Docker hosts with the same architecture. Since xCAT only ships x86_64 and ppc64le Docker images, running xCAT in Docker requires x86_64 or ppc64 Docker Hosts. - -Shutdown the SELinux/Apparmor on Docker host --------------------------------------------- - -If the SELinux or Apparmor on Docker host is enabled, the services/applications inside Docker Container might be confined. To run xCAT in Docker container, SELinux and Apparmor on the Docker host must be disabled. - -SELinux can be disabled with: :: - - echo 0 > /selinux/enforce - sed -i 's/^SELINUX=.*$/SELINUX=disabled/' /etc/selinux/config - -AppArmor can be disabled with: :: - - /etc/init.d/apparmor teardown - - diff --git a/docs/source/advanced/docker/index.rst b/docs/source/advanced/docker/index.rst index 7d275a49f..923559796 100644 --- a/docs/source/advanced/docker/index.rst +++ b/docs/source/advanced/docker/index.rst @@ -4,6 +4,4 @@ Docker .. toctree:: :maxdepth: 2 - dockerized_xcat/dockerized_xcat.rst - lifecycle_management.rst - docker_registry.rst + dockerized_xcat/run_xcat_in_docker_host.rst diff --git a/docs/source/advanced/docker/lifecycle_management.rst b/docs/source/advanced/docker/lifecycle_management.rst deleted file mode 100644 index 3bc48a0c8..000000000 --- a/docs/source/advanced/docker/lifecycle_management.rst +++ /dev/null @@ -1,256 +0,0 @@ -Docker life-cycle management in xCAT -==================================== - -The Docker linux container technology is currently very popular. xCAT can help managing Docker containers. xCAT, as a system management tool has the natural advantage for supporting multiple operating systems, multiple architectures and large scale clusters. - -This document describes how to use xCAT for docker management, from Docker Host setup to docker container operations. - -.. note:: This document was verified with: - * Docker Version 1.10, 1.11 - * Docker API version 1.22 - - Docker Host has been verified on the following OS/ARCH combinations: - * Ubuntu 14.04.3,x86_64 - * Ubuntu 15.10,x86_64 - * Ubuntu 16.04,x86_64 - * Ubuntu 16.04,ppc64el - - -Setting up Docker Host ----------------------- - -The **Docker Host** is the bare metal server or virtual machine where Docker containers can run. It will be called *dockerhost* in the following sections. - -The *dockerhost* at a minimum must provide the following: - -* An Operating System for running docker daemon -* The certification related files to be used by Docker service for trusted connection. - -Preparing osimage for docker host -````````````````````````````````` -The osimage represents the image of the Operating System which will be deployed on the dockerhost. - -Copy files out from DVDs/ISOs and generate -"""""""""""""""""""""""""""""""""""""""""" -**[ubuntu x86_64]** :: - - copycds ubuntu-xxx-server-amd64.iso - -**[ubuntu16.04 ppc64el]** :: - - copycds ubuntu-16.04-server-ppc64el.iso - -Create pkglist and otherpkglist of osimage for dockerhost -""""""""""""""""""""""""""""""""""""""""""""""""""""""""" - -The pkglist file should contain the following: :: - - # cat /install/custom/ubuntu/ubuntu.pkglist - openssh-server - ntp - gawk - nfs-common - snmpd - bridge-utils - -The otherpkglist file should contain the following: - -**[ubuntu x86_64]** :: - - # cat /install/custom/ubuntu/ubuntu_docker.pkglist - docker-engine - -**[ubuntu16.04 ppc64el]** - -At the time of this writing (February 2016), docker package is not available for **ppc64el** architecture from docker.org. You can follow instructions below on how to manually download and install it. - -* Download docker engine for ppc64el: - -:: - - wget http://launchpadlibrarian.net/251622081/docker.io_1.10.3-0ubuntu4_ppc64el.deb -O /install/docker_ppc64el/docker.io_1.10.3-0ubuntu4_ppc64el.deb - -* Configure **otherpkgdir** like this: - -:: - - otherpkgdir=/install/docker_ppc64el - -* The **otherpkglist** file should be: - -:: - - # cat /install/custom/ubuntu/ubuntu_docker.pkglist - docker.io - -Create the osimage for dockerhost -""""""""""""""""""""""""""""""""" -The osimage for dockerhost will be like this: - -**[ubuntu x86_64]** :: - - # lsdef -t osimage ub14.04.03-x86_64-dockerhost - Object name: ub14.04.03-x86_64-dockerhost - imagetype=linux - osarch=x86_64 - osname=Linux - osvers=ubuntu14.04.3 - otherpkgdir=https://apt.dockerproject.org/repo ubuntu-trusty main,http://cz.archive.ubuntu.com/ubuntu trusty main - otherpkglist=/install/custom/ubuntu/ubuntu_docker.pkglist - pkgdir=/install/ubuntu14.04.3/x86_64 - pkglist=/install/custom/ubuntu/ubuntu.pkglist - profile=compute - provmethod=install - template=/opt/xcat/share/xcat/install/ubuntu/compute.tmpl - -**[ubuntu16.04 ppc64el]** :: - - # lsdef -t osimage ub16.04-ppc64el-dockerhost - Object name: ub16.04-ppc64el-dockerhost - imagetype=linux - osarch=ppc64el - osname=Linux - osvers=ubuntu16.04 - otherpkgdir=/install/docker_ppc64el - otherpkglist=/install/custom/ubuntu/ubuntu_docker.pkglist - pkgdir=/install/ubuntu16.04/ppc64el - pkglist=/install/custom/ubuntu/ubuntu.pkglist - profile=compute - provmethod=install - template=/opt/xcat/share/xcat/install/ubuntu/compute.tmpl - -Preparing setup trust connection for docker service and create docker network object -```````````````````````````````````````````````````````````````````````````````````` -Currently, a customer defined network object is needed when create a docker container with static IP address, it can be done with the command: :: - - chdef host01 -p postbootscripts="setupdockerhost =/@[:nicname]" - -* netobj_name: the network object to be created, it will be used in *dockernics* when creating docker container -* subnet/netmask@gateway: the network which the IP address of docker container running on the docker host must be located in. If *nicname* is specified, the *subnet/netmask* must be the subnet of the nic *nicname* located in. And *gateway* shall be the IP address of the nic *nicname*. -* nicname: the physical nic name which will be attached to the network object - -For example, a network object *mynet0* with subnet *10.0.0.0/16* and gateway *10.0.101.1* on nic *eth0* can be created with the command: :: - - chdef host01 -p postbootscripts="setupdockerhost mynet0=10.0.0.0/16@10.0.101.1:eth0" - -Start OS provisioning for dockerhost -```````````````````````````````````` - -Reference :ref:`Initialize the Compute for Deployment` for how to finish an OS deployment. - -Docker instance management --------------------------- - -After the dockerhost is ready, a docker instance can be managed through xCAT commands. In xCAT, a docker instance is represented by a node whose definition can be like this: :: - - # lsdef host01c01 - Object name: host01c01 - dockerhost=host01:2375 - dockernics=mynet0 - groups=docker,all - ip=10.0.120.1 - mac=02:42:0a:00:78:01 - mgt=docker - postbootscripts=otherpkgs - postscripts=syslog,remoteshell,syncfiles - -The command :doc:`mkdef ` or :doc:`chdef ` can be used to create a new docker instance node or change the node attributes. Specify any available unused ip address for *ip* attribute. *mac* attribute is optional and if left unset, will be filled in by *mkdocker* command. - -After docker instance node is defined, use command `makehosts host01c01` to add node *host01c01* and its IP address *10.0.120.1* into /etc/hosts. - -Create docker instance -`````````````````````` -:: - - mkdocker [image= [command=] [dockerflag=]] - -* node - The node object which represents the docker instance -* image - The image name that the docker instance will use -* command - The command that the docker will run -* dockerflag - A JSON string which will be used as parameters to create a docker. Reference `docker API v1.22 `_ for more information about which parameters can be specified for "dockerflag". - -To create the docker instance *host01c01* with image *ubuntu* and command */bin/bash*, use: :: - - mkdocker host01c01 image=ubuntu command=/bin/bash dockerflag="{\"AttachStdin\":true,\"AttachStdout\":true,\"AttachStderr\":true,\"OpenStdin\":true}" - -Remove docker instance -`````````````````````` -:: - - rmdocker - -The command **rmdocker host01c01** can be used to remove the docker instance *host01c01*. - -List docker information -``````````````````````` -:: - - lsdocker [-l|--logs] - -To list all the running docker instances on the dockerhost *host01*, use **lsdocker host01**. - -To list the info of docker instance *host01c01*, use **lsdocker host01c01**. - -To get log info of docker instance *host01c01*, use **lsdocker host01c01 --logs**. - -Start docker instance -````````````````````` -:: - - rpower start - -Stop docker instance -```````````````````` -:: - - rpower stop - -Restart docker instance -``````````````````````` -:: - - rpower restart - -Pause all processes within a docker instance -```````````````````````````````````````````` -:: - - rpower pause - -Unpause all processes within a docker instance -`````````````````````````````````````````````` -:: - - rpower unpause - -Check docker instance status -```````````````````````````` -:: - - rpower state - -Troubleshooting --------------------------- - -If things go wrong: - -* After dockerhost node boots, check contents of **/var/log/xcat/xcat.log** file on the dockerhost for errors. - -* Verify **nicname** specified in **Preparing setup trust connection for docker service and create docker network object** section exists on the docker host. Depending on the version of Ubuntu OS and host architecture, it could be **eth0**, or **em1**, or **eno1**, or **enp0s1**. Verify by running on the dockerhost - -:: - - ip addr show dev - -* Run **ps -ef | grep docker** to verify docker engine is running with configured options. It should look something like - -:: - - root 3703 1 0 Apr15 ? 00:12:28 /usr/bin/docker daemon -H unix:///var/run/docker.sock -H tcp://host01:2375 --tls --tlscacert=/root/.docker/ca-cert.pem --tlscert=/root/.docker/dockerhost-cert.pem --tlskey=/root/.docker/dockerhost-cert.pem --tlsverify=true --raw-logs - -If the output is missing some options, verify that file **/lib/systemd/system/docker.service** contains the following lines - -:: - - EnvironmentFile=-/etc/default/docker - ExecStart=/usr/bin/docker daemon $DOCKER_OPTS -H fd:// 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 b5ff7c3da..03eaeaad3 100644 --- a/docs/source/advanced/domain_name_resolution/domain_name_resolution.rst +++ b/docs/source/advanced/domain_name_resolution/domain_name_resolution.rst @@ -483,3 +483,20 @@ Limited support for user application networks In some cases you may have additional user application networks in your site that are not specifically used for cluster management. If desired you can create xCAT network definitions for these networks. This not only provides a convenient way to keep track of the network details but the information can also be used to help set up name resolution for these networks on the cluster nodes. When you add a network definition that includes a **"domain"** value then that domain is automatically included the xCAT name resolution set up. This will enable the nodes to be able to resolve hostnames from the other domains. For example, when you run ``makedhcp -n`` it will list all domains defined in the xCAT **"site"** definition and xCAT **"network"** definitions in the **"option domain-search"** entry of the shared-network stanza in the dhcp configuration file. This will cause dhcp to put these domains in the compute nodes' **/etc/resolv.conf** file every time it gets a dhcp lease. + +hostname setting on compute node +-------------------------------- + +After compute node is deployed, its ``hostname`` is coming from ``DHCP``, the default ``hostname`` is the same with the node name. If you want to have persistent ``hostname``, you can use ``confignetwork -s`` to configure the install NIC with static IP address, at the same time, it persists ``hostname`` on the compute node. + +Execute ``confignetwork -s`` to configure provision IP address as static IP address: + + a. Add ``confignetwork -s`` into postscript list to execute on reboot :: + + chdef cn1 -p postscripts="confignetwork -s" + + b. If the compute node is already running, use ``updatenode`` command to run ``confignetwork -s`` postscript without rebooting the node :: + + updatenode cn1 -P "confignetwork -s" + + diff --git a/docs/source/advanced/hierarchy/databases/mysql_install.rst b/docs/source/advanced/hierarchy/databases/mysql_install.rst index 366a083fc..67cb8c8c4 100644 --- a/docs/source/advanced/hierarchy/databases/mysql_install.rst +++ b/docs/source/advanced/hierarchy/databases/mysql_install.rst @@ -21,20 +21,27 @@ MySQL/MariaDB packages are shipped as part of most Linux Distributions. Red Hat Enterprise Linux ------------------------ -* MySQL - Using ``yum``, ensure that the following packages are installed on the management node: :: +* For RHEL 6 and prior, MySQL is shipped. Using ``yum``, ensure that the following packages are installed on the management node: :: perl-DBD-MySQL* mysql-server-5.* mysql-5.* mysql-connector-odbc-* -* MariaDB - Using ``yum``, ensure that the following packages are installed on the management node: :: +* For RHEL 7, MariaDB is shipped. Using ``yum``, ensure that the following packages are installed on the management node: :: mariadb-server-5.* mariadb-5.* perl-DBD-MySQL* mysql-connector-odbc-* +* For RHEL 8, MariaDB is shipped. Using ``dnf``, ensure that the following packages are installed on the management node: :: + + mariadb-server-5.* + mariadb-5.* + perl-DBD-MySQL* + mariadb-connector-odbc-* + Suse Linux Enterprise Server ---------------------------- diff --git a/docs/source/advanced/mixed_cluster/support_matrix.rst b/docs/source/advanced/mixed_cluster/support_matrix.rst index aa895ab0f..08f85eb75 100644 --- a/docs/source/advanced/mixed_cluster/support_matrix.rst +++ b/docs/source/advanced/mixed_cluster/support_matrix.rst @@ -1,46 +1,43 @@ Support Matrix ============== -+---------+---------+---------+---------+---------+---------+---------+---------+---------+------+ -| | RHEL | SLES | RHEL | SLES | Ubuntu | RHEL | SLES | Ubuntu | AIX | -| | ppc64 | ppc64 | x86_64 | x86_64 | x86_64 | ppc64le | ppc64le | ppc64el | CN | -| | CN | CN | CN | CN | CN | CN | CN | CN | | -+=========+=========+=========+=========+=========+=========+=========+=========+=========+======+ -| RHEL | | | | | | | | | | -| ppc64 | yes | yes | yes | yes | yes | yes | yes | yes | no | -| MN/SN | | | [1]_ | [1]_ | [1]_ | | | | | -+---------+---------+---------+---------+---------+---------+---------+---------+---------+------+ -| SLES | | | | | | | | | | -| ppc64 | yes | yes | yes | yes | yes | yes | yes | yes | no | -| MN/SN | | | [1]_ | [1]_ | [1]_ | | | | | -+---------+---------+---------+---------+---------+---------+---------+---------+---------+------+ -| RHEL | | | | | | | | | | -| x86_64 | yes | yes | yes | yes | yes | yes | yes | yes | no | -| MN/SN | [4]_ | [4]_ | | | | | | | | -+---------+---------+---------+---------+---------+---------+---------+---------+---------+------+ -| SLES | | | | | | | | | | -| x86_64 | yes | yes | yes | yes | yes | yes | yes | yes | no | -| MN/SN | [4]_ | [4]_ | | | | | | | | -+---------+---------+---------+---------+---------+---------+---------+---------+---------+------+ -| Ubuntu | | | | | | | | | | -| x86_64 | yes | yes | yes | yes | yes | yes | yes | yes | no | -| MN/SN | [5]_ | [5]_ | | | | | | | | -+---------+---------+---------+---------+---------+---------+---------+---------+---------+------+ -| RHEL | | | | | | | | | | -| ppc64le | yes | yes | yes | yes | yes | yes | yes | yes | no | -| MN/SN | [2]_ | [2]_ | | | | | | | | -+---------+---------+---------+---------+---------+---------+---------+---------+---------+------+ -| SLES | | | | | | | | | | -| ppc64le | no | no | yes | yes | yes | yes | yes | yes | no | -| MN/SN | | | | | | | | | | -+---------+---------+---------+---------+---------+---------+---------+---------+---------+------+ -| Ubuntu | | | | | | | | | | -| ppc64el | yes | yes | yes | yes | yes | yes | yes | yes | no | -| MN/SN | [3]_ | [3]_ | | | | | | | | -+---------+---------+---------+---------+---------+---------+---------+---------+---------+------+ -| AIX | no | no | no | no | no | no | no | no | yes | -| MN/SN | | | | | | | | | | -+---------+---------+---------+---------+---------+---------+---------+---------+---------+------+ ++---------+---------+---------+---------+---------+---------+---------+---------+---------+ +| | RHEL | SLES | RHEL | SLES | Ubuntu | RHEL | SLES | Ubuntu | +| | ppc64 | ppc64 | x86_64 | x86_64 | x86_64 | ppc64le | ppc64le | ppc64el | +| | CN | CN | CN | CN | CN | CN | CN | CN | ++=========+=========+=========+=========+=========+=========+=========+=========+=========+ +| RHEL | | | | | | | | | +| ppc64 | yes | yes | yes | yes | yes | yes | yes | yes | +| MN/SN | | | [1]_ | [1]_ | [1]_ | | | | ++---------+---------+---------+---------+---------+---------+---------+---------+---------+ +| SLES | | | | | | | | | +| ppc64 | yes | yes | yes | yes | yes | yes | yes | yes | +| MN/SN | | | [1]_ | [1]_ | [1]_ | | | | ++---------+---------+---------+---------+---------+---------+---------+---------+---------+ +| RHEL | | | | | | | | | +| x86_64 | yes | yes | yes | yes | yes | yes | yes | yes | +| MN/SN | [4]_ | [4]_ | | | | | | | ++---------+---------+---------+---------+---------+---------+---------+---------+---------+ +| SLES | | | | | | | | | +| x86_64 | yes | yes | yes | yes | yes | yes | yes | yes | +| MN/SN | [4]_ | [4]_ | | | | | | | ++---------+---------+---------+---------+---------+---------+---------+---------+---------+ +| Ubuntu | | | | | | | | | +| x86_64 | yes | yes | yes | yes | yes | yes | yes | yes | +| MN/SN | [5]_ | [5]_ | | | | | | | ++---------+---------+---------+---------+---------+---------+---------+---------+---------+ +| RHEL | | | | | | | | | +| ppc64le | yes | yes | yes | yes | yes | yes | yes | yes | +| MN/SN | [2]_ | [2]_ | | | | | | | ++---------+---------+---------+---------+---------+---------+---------+---------+---------+ +| SLES | | | | | | | | | +| ppc64le | no | no | yes | yes | yes | yes | yes | yes | +| MN/SN | | | | | | | | | ++---------+---------+---------+---------+---------+---------+---------+---------+---------+ +| Ubuntu | | | | | | | | | +| ppc64el | yes | yes | yes | yes | yes | yes | yes | yes | +| MN/SN | [3]_ | [3]_ | | | | | | | ++---------+---------+---------+---------+---------+---------+---------+---------+---------+ Notes: diff --git a/docs/source/advanced/networks/infiniband/index.rst b/docs/source/advanced/networks/infiniband/index.rst index cb92a7045..8bda17a81 100644 --- a/docs/source/advanced/networks/infiniband/index.rst +++ b/docs/source/advanced/networks/infiniband/index.rst @@ -7,7 +7,7 @@ xCAT has the ability to help with Mellanox InfiniBand (IB) adapter installation .. toctree:: :maxdepth: 2 - mlnxofed_ib_install_v2.rst + mlnxofed_ib_install.rst network_configuration.rst switch_configuration.rst ufm_configuration.rst diff --git a/docs/source/advanced/networks/infiniband/mlnxofed_configuration.rst b/docs/source/advanced/networks/infiniband/mlnxofed_configuration.rst index 046e0a0a7..d7c113849 100644 --- a/docs/source/advanced/networks/infiniband/mlnxofed_configuration.rst +++ b/docs/source/advanced/networks/infiniband/mlnxofed_configuration.rst @@ -6,6 +6,6 @@ The process to configure the osimage to install the Mellanox OFED Drivers for Di .. toctree:: :maxdepth: 2 - mlnxofed_ib_install_v2_diskful.rst - mlnxofed_ib_install_v2_diskless.rst + mlnxofed_ib_install_diskful.rst + mlnxofed_ib_install_diskless.rst diff --git a/docs/source/advanced/networks/infiniband/mlnxofed_ib_install_v2.rst b/docs/source/advanced/networks/infiniband/mlnxofed_ib_install.rst similarity index 78% rename from docs/source/advanced/networks/infiniband/mlnxofed_ib_install_v2.rst rename to docs/source/advanced/networks/infiniband/mlnxofed_ib_install.rst index 25f856007..ea8e63916 100644 --- a/docs/source/advanced/networks/infiniband/mlnxofed_ib_install_v2.rst +++ b/docs/source/advanced/networks/infiniband/mlnxofed_ib_install.rst @@ -1,12 +1,12 @@ Mellanox OFED Installation Script ================================= -Mellanox provides a tested and packaged version of the OpenFabrics Enterprise Distribution (OFED) driver, named Mellanox OFED (MLNX_OFED). To assist with the installation of the MLNX_OFED driver, xCAT provides a sample postscript: ``mlnxofed_ib_install.v2``. +Mellanox provides a tested and packaged version of the OpenFabrics Enterprise Distribution (OFED) driver, named Mellanox OFED (MLNX_OFED). To assist with the installation of the MLNX_OFED driver, xCAT provides a sample postscript: ``mlnxofed_ib_install``. .. toctree:: :maxdepth: 2 - mlnxofed_ib_install_v2_preparation.rst + mlnxofed_ib_install_preparation.rst mlnxofed_configuration.rst mlnxofed_ib_verified_scenario_matrix.rst mlnxofed_ib_known_issue.rst diff --git a/docs/source/advanced/networks/infiniband/mlnxofed_ib_install_v2_diskful.rst b/docs/source/advanced/networks/infiniband/mlnxofed_ib_install_diskful.rst similarity index 100% rename from docs/source/advanced/networks/infiniband/mlnxofed_ib_install_v2_diskful.rst rename to docs/source/advanced/networks/infiniband/mlnxofed_ib_install_diskful.rst diff --git a/docs/source/advanced/networks/infiniband/mlnxofed_ib_install_v2_diskless.rst b/docs/source/advanced/networks/infiniband/mlnxofed_ib_install_diskless.rst similarity index 100% rename from docs/source/advanced/networks/infiniband/mlnxofed_ib_install_v2_diskless.rst rename to docs/source/advanced/networks/infiniband/mlnxofed_ib_install_diskless.rst diff --git a/docs/source/advanced/networks/infiniband/mlnxofed_ib_install_v2_preparation.rst b/docs/source/advanced/networks/infiniband/mlnxofed_ib_install_preparation.rst similarity index 87% rename from docs/source/advanced/networks/infiniband/mlnxofed_ib_install_v2_preparation.rst rename to docs/source/advanced/networks/infiniband/mlnxofed_ib_install_preparation.rst index b4a646868..12fdcd6cf 100644 --- a/docs/source/advanced/networks/infiniband/mlnxofed_ib_install_v2_preparation.rst +++ b/docs/source/advanced/networks/infiniband/mlnxofed_ib_install_preparation.rst @@ -12,11 +12,11 @@ Download the Mellanox OFED ISO file `here (MLNX_OFED) `. +The ``mlnxofed_ib_install`` is a sample script intended to assist with the installation of the Mellanox OFED drivers. The following support matrix documents the limited number of scenarios that have been verified: :doc:`support matrix `. -#. Copy the ``mlnxofed_ib_install.v2`` to ``/install/postscripts``, renaming to ``mlnxofed_ib_install``. :: +#. Copy the ``mlnxofed_ib_install`` to ``/install/postscripts``, renaming to ``mlnxofed_ib_install``. :: - cp /opt/xcat/share/xcat/ib/scripts/Mellanox/mlnxofed_ib_install.v2 \ + cp /opt/xcat/share/xcat/ib/scripts/Mellanox/mlnxofed_ib_install \ /install/postscripts/mlnxofed_ib_install # ensure the script has execute permission diff --git a/docs/source/conf.py b/docs/source/conf.py index 6891ac194..715fa4035 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -59,7 +59,7 @@ author = u'IBM Corporation' # The short X.Y version. version = '2' # The full version, including alpha/beta/rc tags. -release = '2.14.6' +release = '2.15.0' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/docs/source/guides/admin-guides/manage_clusters/common/deployment/acc_initrd_rootimg_gen.rst b/docs/source/guides/admin-guides/manage_clusters/common/deployment/acc_initrd_rootimg_gen.rst index 635905e82..f0056b03a 100644 --- a/docs/source/guides/admin-guides/manage_clusters/common/deployment/acc_initrd_rootimg_gen.rst +++ b/docs/source/guides/admin-guides/manage_clusters/common/deployment/acc_initrd_rootimg_gen.rst @@ -20,7 +20,7 @@ The parallel compression tool ``pigz`` can be enabled by installing ``pigz`` pac Refer to the http://fedoraproject.org/wiki/EPEL for more details on EPEL - 1) Enabling the ``pigz`` in ``genimage`` (only supported in RHELS6 or above) + 1) Enabling the ``pigz`` in ``genimage`` (only supported in RHEL 7 or above) ``pigz`` should be installed in the diskless rootimg. Download ``pigz`` package from https://dl.fedoraproject.org/pub/epel/ , then customize the diskless osimage to install ``pigz`` as the additional packages, see :doc:`Install Additional Other Packages` for more details. diff --git a/docs/source/guides/admin-guides/manage_clusters/common/deployment/cfg_partition.rst b/docs/source/guides/admin-guides/manage_clusters/common/deployment/cfg_partition.rst index 1748b8675..9f3ad3ec8 100644 --- a/docs/source/guides/admin-guides/manage_clusters/common/deployment/cfg_partition.rst +++ b/docs/source/guides/admin-guides/manage_clusters/common/deployment/cfg_partition.rst @@ -1,38 +1,48 @@ .. BEGIN_Overview -By default, xCAT will install the operating system on the first disk and with default partitions layout in the node. However, you may choose to customize the disk partitioning during the install process and define a specific disk layout. You can do this in one of two ways: '**partition definition file**' or '**partition definition script**'. +By default, xCAT will attempt to determine the first physical disk and use a generic default partition scheme for the operating system. You may require a more customized disk partitioning scheme and can accomplish this in one of the following methods: -.. note:: ``partition definition file`` can be used for RedHat, SLES, and Ubuntu. Because disk configuraiton for Ubuntu is different from RedHat, there may be some special sections required for Ubuntu. + * partition definition file + * partition definition script -.. warning:: ``partition definition script`` has only been tested on RedHat and Ubuntu, use at your own risk for SLES. +.. note:: **partition definition file** can be used for RedHat, SLES, and Ubuntu. However, disk configuration for Ubuntu is different from RedHat/SLES, there may be some special sections required for Ubuntu. + +.. warning:: **partition definition script** has only been verified on RedHat and Ubuntu, use at your own risk for SLES. .. END_Overview .. BEGIN_partition_definition_file_Overview -You could create a customized osimage partition file, say /install/custom/my-partitions, that contains the disk partitioning definition, then associate the partition file with osimage, the nodeset command will insert the contents of this file directly into the generated autoinst configuration file that will be used by the OS installer. +The following steps are required for this method: + + #. Create a partition file + #. Associate the partition file with an xCAT osimage + +The ``nodeset`` command will then insert the contents of this partition file into the generated autoinst config file that will be used by the operation system installer. .. END_partition_definition_file_Overview .. BEGIN_partition_definition_file_content -The partition file must follow the partitioning syntax of the installer(e.g. kickstart for RedHat, AutoYaST for SLES, Preseed for Ubuntu). you could refer to the `Kickstart documentation `_ or `Autoyast documentation `_ or `Preseed documentation `_ write your own partitions layout. Meanwhile, RedHat and SuSE provides some tools that could help generate kickstart/autoyast templates, in which you could refer to the partition section for the partitions layout information: +The partition file must follow the partitioning syntax of the respective installer -* **[RedHat]** + * Redhat: `Kickstart documentation `_ - - The file /root/anaconda-ks.cfg is a sample kickstart file created by RedHat installer during the installation process based on the options that you selected. - - system-config-kickstart is a tool with graphical interface for creating kickstart files + * The file ``/root/anaconda-ks.cfg`` is a sample kickstart file created by RedHat installing during the installation process based on the options that you selected. + * system-config-kickstart is a tool with graphical interface for creating kickstart files -* **[SLES]** + * SLES: `Autoyast documentation `_ - - Use yast2 autoyast in GUI or CLI mode to customize the installation options and create autoyast file - - Use yast2 clone_system to create autoyast configuration file /root/autoinst.xml to clone an existing system + * Use yast2 autoyast in GUI or CLI mode to customize the installation options and create autoyast file + * Use yast2 clone_system to create autoyast configuration file /root/autoinst.xml to clone an existing system -* **[Ubuntu]** + * Ubuntu: `Preseed documentation `_ - - For detailed information see the files partman-auto-recipe.txt and partman-auto-raid-recipe.txt included in the debian-installer package. Both files are also available from the debian-installer source repository. Note that the supported functionality may change between releases. + * For detailed information see the files ``partman-auto-recipe.txt`` and ``partman-auto-raid-recipe.txt`` included in the debian-installer package. Both files are also available from the debian-installer source repository. + +.. note:: Supported functionality may change between releases of the Operating System, always refer to the latest documentation provided by the operating system. .. END_partition_definition_file_content @@ -349,14 +359,17 @@ Here is partition definition file example for Ubuntu standard partition in x86_6 .. BEGIN_partition_definition_file_Associate_partition_file_with_osimage_common -Run the following commands to associate the partition with the osimage: :: +If your custom partition file is located at: ``/install/custom/my-partitions``, run the following command to associate the partition file with an osimage: :: chdef -t osimage partitionfile=/install/custom/my-partitions - nodeset osimage= -- For RedHat, when nodeset runs and generates the /install/autoinst file for a node, it will replace the #XCAT_PARTITION_START#...#XCAT_PARTITION_END# directives from your osimage template with the contents of your custom partitionfile. +To generate the configuration, run the ``nodeset`` command: :: -- For Ubuntu, when nodeset runs and generates the /install/autoinst file for a node, it will generate a script to write the partition configuration to /tmp/partitionfile, this script will replace the #XCA_PARTMAN_RECIPE_SCRIPT# directive in /install/autoinst/.pre. + nodeset osimage= + +.. note:: **RedHat:** Running ``nodeset`` will generate the ``/install/autoinst`` file for the node. It will replace the ``#XCAT_PARTITION_START#`` and ``#XCAT_PARTITION_END#`` directives with the contents of your custom partition file. + +.. note:: **Ubuntu:** Running ``nodeset`` will generate the ``/install/autoinst`` file for the node. It will write the partition file to ``/tmp/partitionfile`` and replace the ``#XCA_PARTMAN_RECIPE_SCRIPT#`` directive in ``/install/autoinst/.pre`` with the contents of your custom partition file. .. END_partition_definition_file_Associate_partition_file_with_osimage_common diff --git a/docs/source/guides/admin-guides/manage_clusters/common/deployment/create_img.rst b/docs/source/guides/admin-guides/manage_clusters/common/deployment/create_img.rst index cb60aa607..fcf2cafb4 100644 --- a/docs/source/guides/admin-guides/manage_clusters/common/deployment/create_img.rst +++ b/docs/source/guides/admin-guides/manage_clusters/common/deployment/create_img.rst @@ -1,15 +1,15 @@ Select or Create an osimage Definition ====================================== -Before creating an image on xCAT, the distro media should be prepared ahead. That can be ISOs or DVDs. +Before creating an image on xCAT, the distro media should be prepared. That can be ISOs or DVDs. -XCAT use 'copycds' command to create an image which will be available to install nodes. ``copycds`` will copy all contents of Distribution DVDs/ISOs or Service Pack DVDs/ISOs to a destination directory, and create several relevant osimage definitions by default. +XCAT uses ``copycds`` command to create an image which will be available to install nodes. ``copycds`` will copy all contents of Distribution DVDs/ISOs or Service Pack DVDs/ISOs to a destination directory, and create several relevant osimage definitions by default. If using an ISO, copy it to (or NFS mount it on) the management node, and then run: :: copycds /.iso -**Note**: while sle15 contains installer medium and packages medium, need ``copycds`` copy all contents of DVD1 of the installer medium and DVD1 of the packages medium, for example: :: +.. note:: While sle15 contains installer medium and packages medium, need ``copycds`` copy all contents of DVD1 of the installer medium and DVD1 of the packages medium, for example: :: copycds SLE-15-Installer-DVD-ppc64le-GM-DVD1.iso SLE-15-Packages-ppc64le-GM-DVD1.iso @@ -41,11 +41,11 @@ In these osimage definitions shown above * **--netboot-compute** is the default osimage definition used for diskless installation * **--install-service** is the default osimage definition used for service node deployment which shall be used in hierarchical environment -**Note**: There are more things needed for **ubuntu ppc64le** osimages: +.. note:: Additional steps are needed for **ubuntu ppc64le** osimages: -For pre-18.04 version of Ubuntu for ppc64el, the initrd.gz shipped with the ISO does not support network booting. In order to install ubuntu with xCAT, you need to follow the steps below to complete the osimage definition. +For pre-16.04.02 version of Ubuntu for ppc64el, the ``initrd.gz`` shipped with the ISO does not support network booting. In order to install Ubuntu with xCAT, you need to follow the steps to complete the osimage definition. -* Download mini.iso from +* Download ``mini.iso`` from [ubuntu 14.04.1]: http://xcat.org/files/netboot/ubuntu14.04.1/ppc64el/mini.iso @@ -59,7 +59,7 @@ For pre-18.04 version of Ubuntu for ppc64el, the initrd.gz shipped with the ISO [ubuntu 16.04.1]: http://xcat.org/files/netboot/ubuntu16.04.1/ppc64el/mini.iso -* Mount mini.iso :: +* Mount ``mini.iso`` :: mkdir /tmp/iso mount -o loop mini.iso /tmp/iso @@ -69,11 +69,9 @@ For pre-18.04 version of Ubuntu for ppc64el, the initrd.gz shipped with the ISO mkdir -p /install//ppc64el/install/netboot cp /tmp/iso/install/initrd.gz /install//ppc64el/install/netboot -**[Below tips maybe helpful for you]** - **[Tips 1]** -If this is the same distro version as what your management node uses, create a .repo file in /etc/yum.repos.d with contents similar to: :: +If this is the same distro version as what your management node uses, create a ``.repo`` file in ``/etc/yum.repos.d`` with contents similar to: :: [local--] name=xCAT local @@ -81,7 +79,7 @@ If this is the same distro version as what your management node uses, create a . enabled=1 gpgcheck=0 -In this way, if you need to install some additional RPMs into your MN later, you can simply install them with ``yum``. Or if you are installing a software on your MN that depends some RPMs from this disto, those RPMs will be found and installed automatically. +This way, if you need to install some additional RPMs into your MN later, you can simply install them with ``yum``. Or if you are installing a software on your MN that depends some RPMs from this disto, those RPMs will be found and installed automatically. **[Tips 2]** @@ -91,7 +89,7 @@ You can create/modify an osimage definition easily with any existing osimage def Except the specified attributes **, the attributes of ** will inherit the values of template osimage **. -As an example, the following command creates a new osimage "myosimage.rh7.compute.netboot" based on the existing osimage "rhels7.4-ppc64le-netboot-compute" with some customized attributes :: +As an example, the following command creates a new osimage ``myosimage.rh7.compute.netboot`` based on the existing osimage ``rhels7.4-ppc64le-netboot-compute`` with some customized attributes :: mkdef -t osimage -o myosimage.rh7.compute.netboot --template rhels7.4-ppc64le-netboot-compute synclists=/tmp/synclist otherpkgdir=/install/custom/osimage/myosimage.rh7.compute.netboot/3rdpkgs/ otherpkglist=/install/custom/osimage/myosimage.rh7.compute.netboot/3rd.pkglist diff --git a/docs/source/guides/admin-guides/manage_clusters/common/deployment/prepostscripts/post_script.rst b/docs/source/guides/admin-guides/manage_clusters/common/deployment/prepostscripts/post_script.rst index f976329ec..277c96346 100644 --- a/docs/source/guides/admin-guides/manage_clusters/common/deployment/prepostscripts/post_script.rst +++ b/docs/source/guides/admin-guides/manage_clusters/common/deployment/prepostscripts/post_script.rst @@ -3,14 +3,14 @@ Using Postscript ---------------- -xCAT automatically runs a few postscripts and postbootscripts that are delivered with xCAT to set up the nodes. You can also add your own scripts to further customize the nodes. This explains the xCAT support to do this. +xCAT automatically runs a few postscripts and postbootscripts that are delivered with xCAT to set up the nodes. You can also add your own scripts to further customize the nodes. Types of scripts ~~~~~~~~~~~~~~~~ -There are two types of scripts in the postscripts table ( postscripts and postbootscripts). The types are based on when in the install process they will be executed. Run the following for more information: +There are two types of scripts in the postscripts table ( postscripts and postbootscripts). The types are based on when in the install process they will be executed. Run the following for more information:: - ``man postscripts`` + man postscripts * **postscripts attribute** - List of scripts that should be run on this node after diskful installation or diskless boot. @@ -20,17 +20,17 @@ There are two types of scripts in the postscripts table ( postscripts and postbo * **[SLES]** - Postscripts will be run after the reboot but before the init.d process. For Linux diskless deployment, the postscripts will be run at the init.d time, and xCAT will automatically add the list of postscripts from the postbootscripts attribute to run after postscripts list. + Postscripts will be run after the reboot but before the ``init.d`` process. For Linux diskless deployment, the postscripts will be run at the ``init.d`` time, and xCAT will automatically add the list of postscripts from the postbootscripts attribute to run after postscripts list. -* **postbootscripts attribute** - list of postbootscripts that should be run on this Linux node at the init.d time after diskful installation reboot or diskless boot -* **xCAT**, by default, for diskful installs only runs the postbootscripts on the install and not on reboot. In xCAT a site table attribute runbootscripts is available to change this default behavior. If set to yes, then the postbootscripts will be run on install and on reboot. +* **postbootscripts attribute** - list of postbootscripts that should be run on this Linux node at the ``init.d`` time after diskful installation reboot or diskless boot +* **xCAT**, by default, for diskful installs only runs the postbootscripts on the install and not on reboot. In xCAT a ``site`` table attribute ``runbootscripts`` is available to change this default behavior. If set to ``yes``, then the postbootscripts will be run on install and on reboot. -**xCAT automatically adds the postscripts from the xcatdefaults.postscripts attribute of the table to run first on the nodes after install or diskless boot.** +.. note:: xCAT automatically adds the postscripts from the xcatdefaults.postscripts attribute of the table to run first on the nodes after install or diskless boot. Adding your own postscripts ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -To add your own script, place it in /install/postscripts on the management node. Make sure it is executable and world readable. Then add it to the postscripts table for the group of nodes you want it to be run on (or the "all" group if you want it run on all nodes in the appropriate attribute, according to when you want it to run). +To add your own script, place it in ``/install/postscripts`` on the management node. Make sure it is executable and world readable. Then add it to the ``postscripts`` table for the group of nodes you want it to be run on (or the ``all`` group if you want it run on all nodes). To check what scripts will be run on your node during installation: :: @@ -42,11 +42,9 @@ You can pass parameters to the postscripts. For example: :: script1 p1 p2,script2,.... +``p1 p2`` are the parameters to ``script1``. - -p1 p2 are the parameters to script1. - -Postscripts could be placed in the subdirectories in /install/postscripts on management node, and specify "subdir/postscriptname" in the postscripts table to run the postscripts in the subdirectories. This feature could be used to categorize the postscripts for different purposes. Here is an example: :: +Postscripts could be placed in the subdirectories in ``/install/postscripts`` on management node, and specify ``subdir/postscriptname`` in the ``postscripts`` table to run the postscripts in the subdirectories. This feature could be used to categorize the postscripts for different purposes. For example: :: mkdir -p /install/postscripts/subdir1 mkdir -p /install/postscripts/subdir2 @@ -55,18 +53,15 @@ Postscripts could be placed in the subdirectories in /install/postscripts on man chdef node1 -p postscripts=subdir1/postscript1,subdir2/postscript2 updatenode node1 -P -If some of your postscripts will affect the network communication between the management node and compute node, like restarting network or configuring bond, the postscripts execution might not be able to be finished successfully because of the network connection problems, even if we put this postscript be the last postscript in the list, xCAT still may not be able to update the node status to be "booted". The recommendation is to use the Linux "at" mechanism to schedule this network-killing postscript to be run at a later time. Here is an example: +If some of your postscripts will affect the network communication between the management node and compute node, like restarting network or configuring bond, the postscripts execution might not be able to be finished successfully because of the network connection problems. Even if we put this postscript be the last postscript in the list, xCAT still may not be able to update the node status to be ``booted``. The recommendation is to use the Linux ``at`` mechanism to schedule this network-killing postscript to be run at a later time. For example: -The user needs to add a postscript to customize the nics bonding setup, the nics bonding setup will break the network between the management node and compute node, then we could use "at" to run this nic bonding postscripts after all the postscripts processes have been finished. +The user needs to add a postscript to customize the nics bonding setup, the nics bonding setup will break the network between the management node and compute node. User could use ``at`` to run this nic bonding postscripts after all the postscripts processes have been finished. -We could write a script, say, /install/postscripts/nicbondscript, the nicbondscript simply calls the confignicsbond using **"at"**: :: +Write a script, ``/install/postscripts/nicbondscript``, the ``nicbondscript`` simply calls the ``confignicsbond`` using ``at``: :: [root@xcatmn ~]#cat /install/postscripts/nicbondscript - #!/bin/bash - at -f ./confignicsbond now + 1 minute - [root@xcatmn ~]# Then :: @@ -77,23 +72,23 @@ Recommended Postscript design ''''''''''''''''''''''''''''' -* Postscripts that you want to run anywhere, Linux, should be written in shell. This should be available on all OS's. If only on the service nodes, you can use Perl . -* Postscripts should log errors using the following command **local4** is the default xCAT syslog class. **logger -t xCAT -p local4.info "your info message**". +* Postscripts that you want to run anywhere on Linux, should be written in shell. This should be available on all OS's. If only on the service nodes, you can use Perl . +* Postscripts should log errors using the following command (``local4`` is the default xCAT syslog class). ``logger -t xCAT -p local4.info "your info message"``. * Postscripts should have good and error exit codes (i.e 0 and 1). -* Postscripts should be well documented. At the top of the script, the first few lines should describe the function and inputs and output. You should have comments throughout the script. This is especially important if using regx. +* Postscripts should be well documented. At the top of the script, the first few lines should describe the function and inputs and output. You should have comments throughout the script. This is especially important if using ``regx``. PostScript/PostbootScript execution ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -When your script is executed on the node, all the attributes in the site table are exported as variables for your scripts to use. You can add extra attributes for yourself. See the sample mypostscript file below. +When your script is executed on the node, all the attributes in the ``site`` table are exported as variables for your scripts to use. You can add extra attributes for yourself. See the sample ``mypostscript`` file below. -To run the postscripts, a script is built, so the above exported variables can be input. You can usually find that script in /xcatpost on the node and for example in the Linux case it is call mypostscript. A good way to debug problems is to go to the node and just run mypostscript and see errors. You can also check the syslog on the Management Node for errors. +To run the postscripts, a script is built, so the above exported variables can be input. You can usually find that script in ``/xcatpost`` on the node and in the Linux case it is call ``mypostscript``. A good way to debug problems is to go to the node and just run ``mypostscript`` and see errors. You can also check the ``syslog`` on the Management Node for errors. -When writing you postscripts, it is good to follow the example of the current postscripts and write errors to syslog and in shell. See Suggestions for writing scripts. +When writing you postscripts, it is good to follow the example of the current postscripts and write errors to ``syslog`` and in shell. See Suggestions for writing scripts. -All attributes in the site table are exported and available to the postscript/postbootscript during execution. See the mypostscript file, which is generated and executed on the nodes to run the postscripts. +All attributes in the ``site`` table are exported and available to the postscript/postbootscript during execution. See the ``mypostscript`` file, which is generated and executed on the nodes to run the postscripts. -Example of mypostscript :: +Example of ``mypostscript`` :: #subroutine used to run postscripts run_ps () { @@ -216,7 +211,7 @@ Example of mypostscript :: run_ps script2 # postscripts-end-here\n -The mypostscript file is generated according to the mypostscript.tmpl file. +The ``mypostscript`` file is generated according to the ``mypostscript.tmpl`` file. .. _Using-the-mypostscript-template-label: @@ -226,38 +221,40 @@ Using the mypostscript template Using the mypostscript template ''''''''''''''''''''''''''''''' -xCAT provides a way for the admin to customize the information that will be provided to the postscripts/postbootscripts when they run on the node. This is done by editing the mypostscript.tmpl file. The attributes that are provided in the shipped mypostscript.tmpl file should not be removed. They are needed by the default xCAT postscripts. +xCAT provides a way for the admin to customize the information that will be provided to the postscripts/postbootscripts when they run on the node. This is done by editing the ``mypostscript.tmpl`` file. The attributes that are provided in the shipped ``mypostscript.tmpl`` file should not be removed. They are needed by the default xCAT postscripts. -The mypostscript.tmpl, is shipped in the /opt/xcat/share/xcat/mypostscript directory. +The ``mypostscript.tmpl``, is shipped in the ``/opt/xcat/share/xcat/mypostscript`` directory. -If the admin customizes the mypostscript.tmpl, they should copy the mypostscript.tmpl to /install/postscripts/mypostscript.tmpl, and then edit it. The mypostscript for each node will be named mypostscript.. The generated mypostscript.. will be put in the /tftpboot/mypostscripts directory. +If the admin customizes the ``mypostscript.tmpl``, they should copy the ``mypostscript.tmpl`` to ``/install/postscripts/mypostscript.tmpl``, and then edit it. The ``mypostscript`` for each node will be named ``mypostscript.``. The generated ``mypostscript.``. will be put in the ``/tftpboot/mypostscripts directory``. site table precreatemypostscripts attribute ''''''''''''''''''''''''''''''''''''''''''' -If the site table precreatemypostscripts attribute is set to 1 or yes, it will instruct xCAT at nodeset and updatenode time to query the db once for all of the nodes passed into the command and create the mypostscript file for each node and put them in a directory in $TFTPDIR(for example /tftpboot). The created mypostscript.. file in the /tftpboot/mypostscripts directory will not be regenerated unless another nodeset or updatenode command is run to that node. This should be used when the system definition has stabilized. It saves time on the updatenode or reboot by not regenerating the mypostscript file. +If the site table ``precreatemypostscripts`` attribute is set to ``1`` or ``yes``, it will instruct xCAT at ``nodeset`` and ``updatenode`` time to query the db once for all of the nodes passed into the command and create the ``mypostscript`` file for each node and put them in a directory in ``$TFTPDIR`` (for example ``/tftpboot``). The created ``mypostscript.``. file in the ``/tftpboot/mypostscripts`` directory will not be regenerated unless another ``nodeset`` or ``updatenode`` command is run to that node. This should be used when the system definition has stabilized. It saves time on the ``updatenode`` or reboot by not regenerating the ``mypostscript`` file. -If the precreatemyposcripts attribute is yes, and a database change is made or xCAT code is upgraded, then you should run a new nodeset or updatenode to regenerate the /tftpboot/mypostscript/mypostscript.. file to pick up the latest database setting. The default for precreatemypostscripts is no/0. +If the ``precreatemyposcripts`` attribute is ``yes``, and a database change is made or xCAT code is upgraded, then you should run a new ``nodeset`` or ``updatenode`` to regenerate the ``/tftpboot/mypostscript/mypostscript.`` file to pick up the latest database setting. The default for ``precreatemypostscripts`` is ``no/0``. -When you run nodeset or updatenode, it will search the **/install/postscripts/mypostscript.tmpl** first. If the **/install/postscripts/mypostscript.tmpl** exists, it will use that template to generate the mypostscript for each node. Otherwise, it will use **/opt/xcat/share/xcat/mypostscript/mypostscript.tmpl**. +When you run ``nodeset`` or ``updatenode``, it will search the ``/install/postscripts/mypostscript.tmpl`` first. If the ``/install/postscripts/mypostscript.tmpl`` exists, it will use that template to generate the ``mypostscript`` for each node. Otherwise, it will use ``/opt/xcat/share/xcat/mypostscript/mypostscript.tmpl``. Content of the template for mypostscript '''''''''''''''''''''''''''''''''''''''' -**The attributes that are defined in the shipped mypostscript.tmpl file** should not be removed. The xCAT default postscripts rely on that information to run successfully. **The following will explain the entries in the mypostscript.tmpl file**. +.. note:: The attributes that are defined in the shipped mypostscript.tmpl file should not be removed. The xCAT default postscripts rely on that information to run successfully. -The SITE_TABLE_ALL_ATTRIBS_EXPORT line in the file directs the code to export all attributes defined in the site table. -Note: the attributes are not always defined exactly as in the site table to avoid conflict with other table attributes of the same name. For example, the site table master attribute is named SITEMASTER in the generated mypostscript file. :: +The following will explain the entries in the ``mypostscript.tmpl`` file. + +The ``SITE_TABLE_ALL_ATTRIBS_EXPORT`` line in the file directs the code to export all attributes defined in the ``site`` table. +The attributes are not always defined exactly as in the ``site`` table to avoid conflict with other table attributes of the same name. For example, the site table master attribute is named SITEMASTER in the generated mypostscript file. :: #SITE_TABLE_ALL_ATTRIBS_EXPORT# -The following line exports ENABLESSHBETWEENNODES by running the internal xCAT routine (enablesshbetweennodes). :: +The following line exports ``ENABLESSHBETWEENNODES`` by running the internal xCAT routine (``enablesshbetweennodes``). :: ENABLESSHBETWEENNODES=#Subroutine:xCAT::Template::enablesshbetweennodes:$NODE# export ENABLESSHBETWEENNODES -**tabdump()** is used to get all the information in the **** table :: +``tabdump()`` is used to get all the information in the ```` table :: tabdump(networks) @@ -271,7 +268,7 @@ These lines get a comma separated list of the groups to which the node belongs. GROUP=#TABLE:nodelist:$NODE:groups# export GROUP -These lines reads the nodesres table, the given attributes (nfsserver,installnic,primarynic,xcatmaster,routenames) for the node **($NODE)**, and exports it. :: +These lines reads the ``nodesres`` table, the given attributes (``nfsserver``, ``installnic``, ``primarynic``, ``xcatmaster``, ``routenames``) for the node ``($NODE)``, and exports it. :: NFSSERVER=#TABLE:noderes:$NODE:nfsserver# export NFSSERVER @@ -284,11 +281,11 @@ These lines reads the nodesres table, the given attributes (nfsserver,installnic NODEROUTENAMES=#TABLE:noderes:$NODE:routenames# export NODEROUTENAMES -The following entry exports multiple variables from the routes table. Not always set. :: +The following entry exports multiple variables from the ``routes`` table. Not always set. :: #ROUTES_VARS_EXPORT# -The following lines export nodetype table attributes. :: +The following lines export ``nodetype`` table attributes. :: OSVER=#TABLE:nodetype:$NODE:os# export OSVER @@ -304,17 +301,17 @@ The following adds the current directory to the path for the postscripts. :: PATH=`dirname $0`:$PATH export PATH -The following sets the NODESETSTATE by running the internal xCAT getnodesetstate script. :: +The following sets the ``NODESETSTATE`` by running the internal xCAT ``getnodesetstate`` script. :: NODESETSTATE=#Subroutine:xCAT::Postage::getnodesetstate:$NODE# export NODESETSTATE -The following says the postscripts are not being run as a result of updatenode.(This is changed =1, when updatenode runs). :: +The following says the postscripts are not being run as a result of ``updatenode``. (This is changed ``=1``, when ``updatenode`` runs). :: UPDATENODE=0 export UPDATENODE -The following sets the NTYPE to compute,service or MN. :: +The following sets the ``NTYPE`` to compute, service or MN. :: NTYPE=$NTYPE export NTYPE @@ -324,7 +321,7 @@ The following sets the mac address. :: MACADDRESS=#TABLE:mac:$NODE:mac# export MACADDRESS -If vlan is setup, then the #VLAN_VARS_EXPORT# line will provide the following exports: :: +If vlan is setup, then the ``#VLAN_VARS_EXPORT#`` line will provide the following exports: :: VMNODE='YES' export VMNODE @@ -334,7 +331,7 @@ If vlan is setup, then the #VLAN_VARS_EXPORT# line will provide the following ex .. #VLAN_VARS_EXPORT# -If monitoring is setup, then the #MONITORING_VARS_EXPORT# line will provide: :: +If monitoring is setup, then the ``#MONITORING_VARS_EXPORT#`` line will provide: :: MONSERVER=11.10.34.108 export MONSERVER @@ -342,7 +339,7 @@ If monitoring is setup, then the #MONITORING_VARS_EXPORT# line will provide: :: export MONMASTER #MONITORING_VARS_EXPORT# -The OSIMAGE_VARS_EXPORT# line will provide, for example: :: +The ``#OSIMAGE_VARS_EXPORT#`` line will provide, for example: :: OSPKGDIR=/install// export OSPKGDIR @@ -352,7 +349,7 @@ The OSIMAGE_VARS_EXPORT# line will provide, for example: :: #OSIMAGE_VARS_EXPORT# -THE NETWORK_FOR_DISKLESS_EXPORT# line will provide diskless networks information, if defined. :: +THE ``#NETWORK_FOR_DISKLESS_EXPORT#`` line will provide diskless networks information, if defined. :: NETMASK=255.255.255.0 export NETMASK @@ -361,9 +358,9 @@ THE NETWORK_FOR_DISKLESS_EXPORT# line will provide diskless networks information .. #NETWORK_FOR_DISKLESS_EXPORT# -Note: the **#INCLUDE_POSTSCRIPTS_LIST#** and the **#INCLUDE_POSTBOOTSCRIPTS_LIST#** sections in **/tftpboot/mypostscript(mypostbootscripts)** on the Management Node will contain all the postscripts and postbootscripts defined for the node. When running an **updatenode** command for only some of the scripts , you will see in the **/xcatpost/mypostscript** file on the node, the list has been redefined during the execution of updatenode to only run the requested scripts. For example, if you run **updatenode -P** syslog. +Note: the ``#INCLUDE_POSTSCRIPTS_LIST#`` and the ``#INCLUDE_POSTBOOTSCRIPTS_LIST#`` sections in ``/tftpboot/mypostscript(mypostbootscripts)`` on the Management Node will contain all the postscripts and postbootscripts defined for the node. When running an ``updatenode`` command for only some of the scripts , you will see in the ``/xcatpost/mypostscript`` file on the node, the list has been redefined during the execution of ``updatenode`` to only run the requested scripts. For example, if you run ``updatenode -P syslog``. -The **#INCLUDE_POSTSCRIPTS_LIST#** flag provides a list of postscripts defined for this **$NODE**. :: +The ``#INCLUDE_POSTSCRIPTS_LIST#`` flag provides a list of postscripts defined for this ``$NODE``. :: #INCLUDE_POSTSCRIPTS_LIST# @@ -378,7 +375,7 @@ For example, you will see in the generated file the following stanzas: :: syncfiles # node-postscripts-end-here -The **#INCLUDE_POSTBOOTSCRIPTS_LIST#** provides a list of postbootscripts defined for this **$NODE**. :: +The ``#INCLUDE_POSTBOOTSCRIPTS_LIST#`` provides a list of postbootscripts defined for this ``$NODE``. :: #INCLUDE_POSTBOOTSCRIPTS_LIST# @@ -394,7 +391,7 @@ For example, you will see in the generated file the following stanzas: :: Kinds of variables in the template ''''''''''''''''''''''''''''''''''' -**Type 1:** For the simple variable, the syntax is as follows. The mypostscript.tmpl has several examples of this. **$NODE** is filled in by the code. **UPDATENODE** is changed to 1, when the postscripts are run by ``updatenode``. **$NTYPE** is filled in as either compute,service or MN. :: +**Type 1:** For the simple variable, the syntax is as follows. The ``mypostscript.tmpl`` has several examples of this. ``$NODE`` is filled in by the code. ``UPDATENODE`` is changed to 1, when the postscripts are run by ``updatenode``. ``$NTYPE`` is filled in as either ``compute``, ``service`` or ``MN``. :: NODE=$NODE export NODE @@ -403,11 +400,11 @@ Kinds of variables in the template NTYPE=$NTYPE export NTYPE -**Type 2:** This is the syntax to get the value of one attribute from the **** and its key is **$NODE**. It does not support tables with two keys. Some of the tables with two keys are **(litefile,prodkey,deps,monsetting,mpa,networks)**. :: +**Type 2:** This is the syntax to get the value of one attribute from the ```` and its key is ``$NODE``. It does not support tables with two keys. Some of the tables with two keys are ``litefile``, ``prodkey``, ``deps``, ``monsetting``, ``mpa``, ``networks``. :: VARNAME=#TABLE:tablename:$NODE:attribute# -For example, to get the new updatestatus attribute from the nodelist table: :: +For example, to get the new ``updatestatus`` attribute from the ``nodelist`` table: :: UPDATESTATUS=#TABLE:nodelist:$NODE:updatestatus# export UPDATESTATUS @@ -418,20 +415,20 @@ For example, to get the new updatestatus attribute from the nodelist table: :: or VARNAME=#Subroutine:modulename::subroutinename# -Examples in the mypostscript.tmpl are the following: :: +Examples in the ``mypostscript.tmpl`` are the following: :: NODESETSTATE=#Subroutine:xCAT::Postage::getnodesetstate:$NODE# export NODESETSTATE ENABLESSHBETWEENNODES=#Subroutine:xCAT::Template::enablesshbetweennodes:$NODE# export ENABLESSHBETWEENNODES -Note: Type 3 is not an open interface to add extensions to the template. +.. note:: Type 3 is not an open interface to add extensions to the template. -**Type 4:** The syntax is #FLAG#. When parsing the template, the code generates all entries defined by **#FLAG#**, if they are defined in the database. For example: To export all values of all attributes from the site table. The tag is :: +**Type 4:** The syntax is ``#FLAG#``. When parsing the template, the code generates all entries defined by ``#FLAG#``, if they are defined in the database. For example: To export all values of all attributes from the ``site`` table. The tag is :: #SITE_TABLE_ALL_ATTRIBS_EXPORT# -For the **#SITE_TABLE_ALL_ATTRIBS_EXPORT#** flag, the related subroutine will get the attributes' values and deal with the special case. such as : the site.master should be exported as **"SITEMASTER"**. And if the noderes.xcatmaster exists, the noderes.xcatmaster should be exported as **"MASTER"**, otherwise, we also should export site.master as the **"MASTER"**. +For the ``#SITE_TABLE_ALL_ATTRIBS_EXPORT#`` flag, the related subroutine will get the attributes' values and deal with the special case. such as : the ``site.master`` should be exported as ``"SITEMASTER"``. And if the ``noderes.xcatmaster`` exists, the ``noderes.xcatmaster`` should be exported as ``"MASTER"``, otherwise, we also should export ``site.master`` as the ``"MASTER"``. Other examples are: :: @@ -442,11 +439,9 @@ Other examples are: :: #INCLUDE_POSTSCRIPTS_LIST# - includes the list of all postscripts for the node #INCLUDE_POSTBOOTSCRIPTS_LIST# - includes the list of all postbootscripts for the node -Note: Type4 is not an open interface to add extensions to the templatel. +.. note:: Type4 is not an open interface to add extensions to the template. -**Type 5:** Get all the data from the specified table. The **** should not be a node table, like nodelist. This should be handles with TYPE 2 syntax to get specific attributes for the **$NODE**. tabdump would result in too much data for a nodetype table. Also the auditlog, eventlog should not be in tabdump for the same reason. site table should not be specified, it is already provided with the **#SITE_TABLE_ALL_ATTRIBS_EXPORT#** flag. It can be used to get the data from the two key tables (like switch). :: - - The syntax is: +**Type 5:** Get all the data from the specified table. The ```` should not be a node table, like ``nodelist``. This should be handles with TYPE 2 syntax to get specific attributes for the ``$NODE``. ``tabdump`` would result in too much data for a ``nodetype`` table. Also the ``auditlog``, ``eventlog`` should not be in ``tabdump`` for the same reason. ``site`` table should not be specified, it is already provided with the ``#SITE_TABLE_ALL_ATTRIBS_EXPORT#`` flag. It can be used to get the data from the two key tables (like ``switch``). The syntax is: :: tabdump() @@ -455,7 +450,7 @@ Edit mypostscript.tmpl **Add new attributes into mypostscript.tmpl** -When you add new attributes into the template, you should edit the **/install/postscripts/mypostscript.tmpl** which you created by copying **/opt/xcat/share/xcat/mypostscript/mypostscript.tmpl**. Make all additions before the **# postscripts-start-here** section. xCAT will first look in **/install/postscripts/mypostscript.tmpl** for a file and then if not found will use the one in **/opt/xcat/share/xcat/mypostcript/mypostscript.tmpl**. +When you add new attributes into the template, you should edit the ``/install/postscripts/mypostscript.tmpl`` which you created by copying ``/opt/xcat/share/xcat/mypostscript/mypostscript.tmpl``. Make all additions before the ``# postscripts-start-here`` section. xCAT will first look in ``/install/postscripts/mypostscript.tmpl`` for a file and then, if not found, will use the one in ``/opt/xcat/share/xcat/mypostcript/mypostscript.tmpl``. For example: :: @@ -467,11 +462,11 @@ For example: :: ## The following flag postscripts-end-here must not be deleted. # postscripts-end-here -Note: If you have a hierarchical cluster, you must copy your new mypostscript.tmpl to **/install/postscripts/mypostscript.tmpl** on the service nodes, unless **/install/postscripts** directory is mounted from the MN to the service node. +.. note:: If you have a hierarchical cluster, you must copy your new ``mypostscript.tmpl`` to ``/install/postscripts/mypostscript.tmpl`` on the service nodes, unless ``/install/postscripts`` directory is mounted from the MN to the service node. **Remove attribute from mypostscript.tmpl** -If you want to remove an attribute that you have added, you should remove all the related lines or comment them out with ##. For example, comment out the added lines. :: +If you want to remove an attribute that you have added, you should remove all the related lines or comment them out with ``##``. For example, comment out the added lines. :: ##UPDATESTATUS=#TABLE:nodelist:$NODE:updatestatus# ##export UPDATESTATUS @@ -481,32 +476,30 @@ Test the new template There are two quick ways to test the template. -#. -If the node is up: :: +1. If the node is up :: - updatenode -P syslog + updatenode -P syslog -Check your generated template : :: + Check your generated ``mypostscript`` on the compute node: :: - Check the generated mypostscript file on compute node /xcatpost. + vi /xcatpost/mypostscript -#. -Another way, is set the precreate option :: +2. Set the ``precreatemypostscripts`` option :: chdef -t site -o clustersite precreatemypostscripts=1 -Then run :: + Then run :: nodeset .... -Check your generated template :: + Check your generated ``mypostscript`` :: vi /tftpboot/mypostscripts/mypostscript. Sample /xcatpost/mypostscript ''''''''''''''''''''''''''''''' -This is an example of the generated postscript for a servicenode install. It is found in /xcatpost/mypostscript on the node. :: +This is an example of the generated postscript for a servicenode install. It is found in ``/xcatpost/mypostscript`` on the node. :: # global value to store the running status of the postbootscripts,the value #is non-zero if one postbootscript failed diff --git a/docs/source/guides/admin-guides/manage_clusters/common/kvm/manage_vm.rst b/docs/source/guides/admin-guides/manage_clusters/common/kvm/manage_vm.rst index a40b77e1f..69a8a5ee6 100644 --- a/docs/source/guides/admin-guides/manage_clusters/common/kvm/manage_vm.rst +++ b/docs/source/guides/admin-guides/manage_clusters/common/kvm/manage_vm.rst @@ -1,5 +1,5 @@ Manage Virtual Machine (VM) -============================ +=========================== Now the PowerKVM hypervisor "kvmhost1" is ready, this section introduces the VM management in xCAT, including examples on how to create, remove and clone VMs. @@ -37,11 +37,9 @@ After the VM object is created, several key attributes need to be specified with chdef vm1 vmhost=kvmhost1 -4. the virtual memory size, with the unit "Megabit". Specify 1GB memory to "vm1" here: :: +4. the virtual memory size (in Megabytes): :: - chdef vm1 vmmemory=1024 - -**Note**: For diskless node, the **vmmemory** should be at least 2048 MB, otherwise the node cannot boot up. + chdef vm1 vmmemory=2048 5. Define the virtual network card, it should be set to the bridge "br0" which has been created in the hypervisor. If no bridge is specified, no network device will be created for the VM node "vm1": :: @@ -62,27 +60,27 @@ After the VM object is created, several key attributes need to be specified with B. Create storage on a device of hypervisor - The format is 'phy:/dev/sdb1': :: + The format is ``phy:/dev/sdb1``: :: chdef vm1 vmstorage=phy:/dev/sdb1 C. Create storage on a directory of hypervisor - The format is 'dir:///var/lib/libvirt/images': :: + The format is ``dir:///var/lib/libvirt/images``: :: chdef vm1 vmstorage=dir:///var/lib/libvirt/images - **Note**: The attribute **vmstorage** is only valid for diskful VM node. +.. note:: The attribute **vmstorage** is only valid for diskful VM node. 8. Define the **console** attributes for VM: :: chdef vm1 serialport=0 serialspeed=115200 -9. (optional)For monitoring and access the VM with vnc client, set **vidpassword** value: :: +9. (Optional) For monitoring and access the VM with vnc client, set **vidpassword** value: :: chtab node=vm1 vm.vidpassword=abc123 -10. (optional)For assigning PCI devices to the VM, set **othersettings** value: :: +10. (Optional) For assigning PCI devices to the VM, set **othersettings** value: :: chtab node=vm1 vm.othersettings="devpassthrough:0000:01:00.2" @@ -133,7 +131,7 @@ When "vm1" is created successfully, a VM hard disk file with a name like "vm1.sd lsdef vm1 -i mac -Now a VM "vm1" is created, it can be provisioned like any other nodes in xCAT. The VM node can be powered on by: :: +Once a VM "vm1" is created, it can be provisioned like any other node in xCAT. The VM node can be powered on by: :: rpower vm1 on @@ -164,9 +162,9 @@ When the VM has been created and powered on, choose one of the following methods makegocons vm1 rcons vm1 -* Connect to virtual machine through vnc console +* Connect to virtual machine through ``vnc`` console - In order to connect the virtual machine's vnc server, a new set of credentials need to be generated by running: :: + In order to connect the virtual machine's ``vnc`` server, a new set of credentials need to be generated by running: :: xcatclient getrvidparms vm1 vm1: method: kvm @@ -176,10 +174,10 @@ When the VM has been created and powered on, choose one of the following methods vm1: server: kvmhost1 vm1: vidport: 5900 - **Note**: Now just pick a favorite vnc client to connect the hypervisor, with the password generated by ``getrvidparms``. If the vnc client complains "the password is not valid", the reason might be that the hypervisor and headnode clocks are out of sync! Please try to sync them by running ``ntpdate `` on both the hypervisor and the headnode. +.. note:: Now just pick a favorite ``vnc`` client to connect the hypervisor, with the password generated by ``getrvidparms``. If the ``vnc`` client complains "the password is not valid", the reason might be that the hypervisor and headnode clocks are out of sync! Please try to sync them by running ``ntpdate `` on both the hypervisor and the headnode. -* Use wvid on management node +* Use ``wvid`` on management node Make sure **firewalld** service is stopped, disable it if not: :: @@ -214,7 +212,7 @@ Clone the virtual machine **Clone** is an operation that creating a VM from an existed one by inheriting most of its attributes and data. -The general step of **clone** a VM is like this: first creating a **VM master** , then creating a VM with the newly created **VM master** in **attaching** or **detaching** mode. +Steps to **clone** a VM: first create a **VM master** , then create a VM with the newly created **VM master** in **attaching** or **detaching** mode. **In attaching mode** diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/manually_define.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/manually_define.rst index c0e7a156c..1e7ba95f0 100644 --- a/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/manually_define.rst +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/manually_define.rst @@ -14,7 +14,6 @@ Execute ``mkdef`` command to define the node: :: The manually defined node will be like this:: - # lsdef cn1 Object name: cn1 bmc=50.0.101.1 bmcpassword=admin @@ -33,28 +32,26 @@ The manually defined node will be like this:: ``mkdef --template`` can be used to create node definitions easily from the typical node definition templates or existing node definitions, some examples: -* creating node definition "cn2" with an existing node definition "cn1" :: +* creating node definition "cn2" from an existing node definition "cn1" :: - # mkdef -t node -o cn2 --template cn1 mac=66:55:44:33:22:11 ip=172.12.139.2 bmc=172.11.139.2 - 1 object definitions have been created or modified. + mkdef -t node -o cn2 --template cn1 mac=66:55:44:33:22:11 ip=172.12.139.2 bmc=172.11.139.2 - except the attributes specified(``mac``, ``ip`` and ``bmc`` attribute here), other attibutes of the newly created node "cn2" inherit the values of template node "cn1" + except for the attributes specified (``mac``, ``ip`` and ``bmc``), other attributes of the newly created node "cn2" inherit the values of template node "cn1" -* creating a node definition "cn2" with the template "ppc64le-openbmc-template"(openbmc controlled ppc64le node) shipped by xCAT :: +* creating a node definition "cn2" with the template "ppc64le-openbmc-template" (openbmc controlled ppc64le node) shipped by xCAT :: - # mkdef -t node -o cn2 --template ppc64le-openbmc-template mac=66:55:44:33:22:11 ip=172.12.139.2 bmc=172.11.139.2 bmcpassword=USERID bmcusername=PASSW0RD - 1 object definitions have been created or modified. + mkdef -t node -o cn2 --template ppc64le-openbmc-template mac=66:55:44:33:22:11 ip=172.12.139.2 bmc=172.11.139.2 bmcusername=root bmcpassword=0penBmc the unspecified attributes of newly created node "cn2" will be assigned with the default values in the template to list all the node definition templates available in xCAT, run :: - # lsdef -t node --template + lsdef -t node --template to display the full definition of template "ppc64le-openbmc-template", run :: - # lsdef -t node --template ppc64le-openbmc-template + lsdef -t node --template ppc64le-openbmc-template - the mandatory attributes, which must be specified while creating definitions with templates, are denoted with the value ``MANDATORY:`` in template definition. + the mandatory attributes, which must be specified while creating definitions with templates, are denoted with the value ``MANDATORY:`` in template definition. the optional attributes, which can be specified optionally, are denoted with the value ``OPTIONAL:`` in template definition diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/schedule_environment.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/schedule_environment.rst index a1a0eb8f6..a556870b1 100644 --- a/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/schedule_environment.rst +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/schedule_environment.rst @@ -5,7 +5,7 @@ Management Node info:: MN Hostname: xcat1 MN NIC info for Management Network(Host network): eth1, 10.0.1.1/16 - MN NIC info for Service Network(FSP/BMC nework): eth2, 50.0.1.1/16 + MN NIC info for Service Network(FSP/BMC network): eth2, 50.0.1.1/16 Dynamic IP range for Hosts: 10.0.100.1-10.0.100.100 Dynamic IP range for FSP/BMC: 50.0.100.1-50.0.100.100 diff --git a/docs/source/guides/admin-guides/references/man1/lsdocker.1.rst b/docs/source/guides/admin-guides/references/man1/lsdocker.1.rst deleted file mode 100644 index 67b5fd0fa..000000000 --- a/docs/source/guides/admin-guides/references/man1/lsdocker.1.rst +++ /dev/null @@ -1,102 +0,0 @@ - -########## -lsdocker.1 -########## - -.. highlight:: perl - - -**** -NAME -**** - - -\ **lsdocker**\ - List docker instance. - - -******** -SYNOPSIS -******** - - -\ **lsdocker**\ \ *noderange*\ [\ **-l | -**\ **-logs**\ ] - -\ **lsdocker**\ \ *dockerhost*\ - -\ **lsdocker**\ [\ **-h | -**\ **-help**\ ] - -\ **lsdocker**\ {\ **-v | -**\ **-version**\ } - - -*********** -DESCRIPTION -*********** - - -\ **lsdocker**\ To list docker instance info or all the running docker instance info if dockerhost is specified. - - -******* -OPTIONS -******* - - - -\ **-l|-**\ **-logs**\ - - - -To return the logs of docker instance. Only works for docker instance. - - -******** -EXAMPLES -******** - - - -1. To get info for docker instance "host01c01" - - - .. code-block:: perl - - lsdocker host01c01 - - - Output is similar to: - - - .. code-block:: perl - - host01c01: 50800dfd8b5f ubuntu /bin/bash 2016-01-13T06:32:59 running /host01c01 - - - - -2. To get info for running docker instance on dockerhost "host01" - - - .. code-block:: perl - - lsdocker host01 - - - Output is similar to: - - - .. code-block:: perl - - host01: 50800dfd8b5f ubuntu /bin/bash 2016-1-13 - 1:32:59 Up 12 minutes /host01c01 - host01: 875ce11d5987 ubuntu /bin/bash 2016-1-21 - 1:12:37 Up 5 seconds /host01c02 - - - - - -******** -SEE ALSO -******** - - -mkdocker(1)|mkdocker.1, rmdocker(1)|rmdocker.1 - diff --git a/docs/source/guides/admin-guides/references/man1/mkdocker.1.rst b/docs/source/guides/admin-guides/references/man1/mkdocker.1.rst deleted file mode 100644 index f1e2d2e47..000000000 --- a/docs/source/guides/admin-guides/references/man1/mkdocker.1.rst +++ /dev/null @@ -1,169 +0,0 @@ - -########## -mkdocker.1 -########## - -.. highlight:: perl - - -**** -NAME -**** - - -\ **mkdocker**\ - Create docker instance. - - -******** -SYNOPSIS -******** - - -\ **mkdocker**\ \ *noderange*\ [\ **image**\ =\ *image_name*\ [\ **command**\ =\ *command*\ ]] [\ **dockerflag**\ =\ *flags_to_create_instance*\ ] - -\ **mkdocker**\ [\ **-h | -**\ **-help**\ ] - -\ **mkdocker**\ {\ **-v | -**\ **-version**\ } - - -*********** -DESCRIPTION -*********** - - -\ **mkdocker**\ To create docker instances with the specified image, command and/or dockerflags. - - -******* -OPTIONS -******* - - - -\ **image**\ - - The docker image name that the instance will use. - - - -\ **command**\ - - The command that the instance will run based on the \ **image**\ specified. The \ **image**\ option must be specified in order to use this option. - - - -\ **dockerflag**\ - - A JSON string which will be used as parameters to create a docker. Reference https://docs.docker.com/engine/reference/api/docker_remote_api_v1.22/ for more information about which parameters can be specified. - - Some useful flags are: - - - \ **AttachStdin**\ =\ **true | false**\ - - Whether attaches to stdin. - - - - \ **AttachStdout**\ =\ **true | false**\ - - Whether attaches to stdout. - - - - \ **AttachStderr**\ =\ **true | false**\ - - Whether attaches to stderr. - - - - \ **OpenStdin**\ =\ **true | false**\ - - Whether opens stdin. - - - - \ **Tty**\ =\ **true | false**\ - - Attach standard streams to a tty, including stdin if it is not closed. - - - - \ **ExposedPorts**\ - - An object mapping ports to an empty object in the form of: - - - .. code-block:: perl - - "ExposedPorts": { "/\: {}" } - - - - - \ **HostConfig: {"Binds"}**\ - - A list of volume bindings for this docker instance, the form will be: - - - .. code-block:: perl - - "HostConfig": {"Binds":[":"]} - - - - - - - -******** -EXAMPLES -******** - - -1. To create a basic docker instance with stdin opened - - -.. code-block:: perl - - mkdocker host01c01 image=ubuntu command=/bin/bash dockerflag="{\"AttachStdin\":true,\"AttachStdout\":true,\"AttachStderr\":true,\"OpenStdin\":true}" - - -Output is similar to: - - -.. code-block:: perl - - host01c01: Pull image ubuntu start - host01c01: Pull image ubuntu done - host01c01: Remove default network connection - host01c01: Connecting customized network 'mynet0' - host01c01: success - - -2. To create a docker instance which have dir "destdir" in docker instance bind from "srcdir" on dockerhost, and have "Tty" opened with which the docker instance can be attached after started to check the files under "destdir". - - -.. code-block:: perl - - mkdocker host01c01 image=ubuntu command=/bin/bash dockerflag="{\"AttachStdin\":true,\"AttachStdout\":true,\"AttachStderr\":true,\"OpenStdin\":true,\"Tty\":true,\"HostConfig\":{\"Binds\":[\"/srcdir:/destdir\"]}}" - - -Output is similar to: - - -.. code-block:: perl - - host01c01: Remove default network connection - host01c01: Connecting customized network 'mynet0' - host01c01: success - - - -******** -SEE ALSO -******** - - -rmdocker(1)|rmdocker.1, lsdocker(1)|lsdocker.1 - diff --git a/docs/source/guides/admin-guides/references/man1/restartxcatd.1.rst b/docs/source/guides/admin-guides/references/man1/restartxcatd.1.rst index a4348f73f..544df2cdf 100644 --- a/docs/source/guides/admin-guides/references/man1/restartxcatd.1.rst +++ b/docs/source/guides/admin-guides/references/man1/restartxcatd.1.rst @@ -29,21 +29,28 @@ DESCRIPTION The \ **restartxcatd**\ command restarts the xCAT daemon (xcatd). -\ **Linux Specific**\ +\ **Linux Specific**\ : It will perform the xcatd \ *fast restart*\ . The xcatd \ *fast restart*\ is a specific restart which has two advantages compares to the \ *stop*\ and then \ *start*\ . - 1. The interval of xcatd out of service is very short. - 2. The in processing request which initiated by old xcatd will not be stopped by force. The old xcatd will hand over the sockets to new xcatd, but old xcat will still be waiting for the in processing request to finish before the exit. - -It does the same thing as 'service xcatd restart' on NON-systemd enabled Operating System like rh6.x and sles11.x. But for the systemd enabled Operating System like rh7 and sles12, the 'service xcatd restart' just do the \ *stop*\ and \ *start*\ instead of xcatd \ *fast restart*\ . - -It's recommended to use \ **restartxcatd**\ command to restart xcatd on systemd enable system like rh7 and sles12 instead of 'service xcatd restart' or 'systemctl restart xcatd'. - -\ **AIX Specific**\ -It runs 'stopsrc -s xcatd' to stop xcatd first if xcatd is active, then runs 'startsrc -s xcatd' to start xcatd. +1. The interval of xcatd out of service is very short. + + + +2. The in processing request which initiated by old xcatd will not be stopped by force. The old xcatd will hand over the sockets to new xcatd, but old xcat will still be waiting for the in processing request to finish before the exit. + + + +It does the same thing as \ **service xcatd restart**\ on NON-systemd enabled Operating System like rh6.x and sles11.x. But for the systemd enabled Operating System like rh7 and sles12, the \ **service xcatd restart**\ will just do the \ *stop*\ and \ *start*\ instead of xcatd \ *fast restart*\ . + +It's recommended to use \ **restartxcatd**\ command to restart xcatd on systemd enabled system like rh7 and sles12 instead of \ **service xcatd restart**\ or \ **systemctl restart xcatd**\ . + +\ **AIX Specific**\ : + + +It runs \ **stopsrc -s xcatd**\ to stop xcatd first if xcatd is active, then runs \ **startsrc -s xcatd**\ to start xcatd. If the xcatd subsystem was not created, \ **restartxcatd**\ will create it automatically. diff --git a/docs/source/guides/admin-guides/references/man1/rflash.1.rst b/docs/source/guides/admin-guides/references/man1/rflash.1.rst index 90c3ed721..0bad888ca 100644 --- a/docs/source/guides/admin-guides/references/man1/rflash.1.rst +++ b/docs/source/guides/admin-guides/references/man1/rflash.1.rst @@ -63,7 +63,7 @@ OpenPOWER OpenBMC specific : \ **rflash**\ \ *noderange*\ \ *tar_file_path*\ {[\ **-c | -**\ **-check**\ ] | [\ **-a | -**\ **-activate**\ ] | [\ **-u | -**\ **-upload**\ ]} -\ **rflash**\ \ *noderange*\ \ *tar_file_directory*\ [\ **-d**\ ] [\ **-**\ **-no-host-reboot**\ ] +\ **rflash**\ \ *noderange*\ \ *tar_file_directory*\ [\ **-d**\ ] \ **rflash**\ \ *noderange*\ \ *image_id*\ {[\ **-a | -**\ **-activate**\ ] | [\ **-**\ **-delete**\ ]} @@ -172,8 +172,6 @@ To apply the firmware level, a reboot is required to BMC and HOST. This option steamlines the update, activate, reboot BMC and reboot HOST procedure. It expects a directory containing both BMC and Host .tar files. When BMC and Host tar files are provided, the command will upload and activate firmware. After BMC becomes activate, it will reboot BMC. If BMC state is Ready, the command will reboot the HOST. If BMC state is NotReady, the command will exit. -\ **Note:**\ When using \ **-**\ **-no-host-reboot**\ , it will not reboot the host after BMC is reboot. - \ **-**\ **-delete**\ : This delete option will delete update image from BMC. It expects an ID as the input. diff --git a/docs/source/guides/admin-guides/references/man1/rmdocker.1.rst b/docs/source/guides/admin-guides/references/man1/rmdocker.1.rst deleted file mode 100644 index db021f2a9..000000000 --- a/docs/source/guides/admin-guides/references/man1/rmdocker.1.rst +++ /dev/null @@ -1,62 +0,0 @@ - -########## -rmdocker.1 -########## - -.. highlight:: perl - - -******** -SYNOPSIS -******** - - -\ **rmdocker**\ \ *noderange*\ [\ **-f | -**\ **-force**\ ] - -\ **rmdocker**\ [\ **-h | -**\ **-help**\ ] - -\ **rmdocker**\ {\ **-v | -**\ **-version**\ } - - -*********** -DESCRIPTION -*********** - - -\ **rmdocker**\ To remove docker instances with the specified node name - - -******* -OPTIONS -******* - - - -\ **-f|-**\ **-force**\ - - - -Force to removal of a running container or failed to disconnect customized network - - -******** -EXAMPLES -******** - - - -.. code-block:: perl - - rmdocker host01c01 - host01c01: Disconnect customized network 'mynet0' done - host01c01: success - - - -******** -SEE ALSO -******** - - -mkdocker(1)|mkdocker.1, lsdocker(1)|lsdocker.1 - 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 71bdc73a8..a00ece1d9 100644 --- a/docs/source/guides/admin-guides/references/man1/rpower.1.rst +++ b/docs/source/guides/admin-guides/references/man1/rpower.1.rst @@ -120,13 +120,6 @@ zVM specific: \ **rpower**\ \ *noderange*\ [\ **on | off | reset | stat | softoff**\ ] -docker specific: -================ - - -\ **rpower**\ \ *noderange*\ [\ **start | stop | restart | pause | unpause | state**\ ] - - pdu specific: ============= @@ -350,24 +343,6 @@ OPTIONS -\ **start**\ - - To start a created docker instance. - - - -\ **stop**\ - - To stop a created docker instance. - - - -\ **restart**\ - - To restart a created docker instance. - - - \ **pause**\ To pause all processes in the instance. diff --git a/docs/source/guides/admin-guides/references/man5/site.5.rst b/docs/source/guides/admin-guides/references/man5/site.5.rst index 2855062a2..a8920d5e5 100644 --- a/docs/source/guides/admin-guides/references/man5/site.5.rst +++ b/docs/source/guides/admin-guides/references/man5/site.5.rst @@ -465,10 +465,9 @@ site Attributes: xcatlport: The port used by xcatd command log writer process to collect command output. - xcatsslversion: The SSL_version option xcatd used and passed to - IO::Socket::SSL->start_SSL(). By default, this value is - set to empty. In this case, xcatd will use - 'SSLv23:!SSLv2:!SSLv3:!TLSv1' internally. + xcatsslversion: This is the SSL_version option xcatd used and passed to + IO::Socket::SSL->start_SSL(). By default, this value is set to empty. + In this case, xcatd will use SSLv23:!SSLv2:!SSLv3:!TLSv1 internally. For more detail, see https://metacpan.org/pod/IO::Socket::SSL xcatsslciphers: The ssl cipher by xcatd. Default is 3DES. diff --git a/docs/source/guides/get-started/workflow_guide.rst b/docs/source/guides/get-started/workflow_guide.rst index 49bedef5b..0cb1f594b 100644 --- a/docs/source/guides/get-started/workflow_guide.rst +++ b/docs/source/guides/get-started/workflow_guide.rst @@ -1,71 +1,69 @@ Workflow Guide ============== -If xCAT looks suitable for your requirement, following steps are recommended procedure to set up an xCAT cluster. +If xCAT looks suitable for your requirement, following steps are recommended to set up an xCAT cluster. -#. Find a server as your xCAT management node +#. Find a server for xCAT management node - The server can be a bare-metal server or a virtual machine. The major factor for selecting a server is the number of machines in your cluster. The bigger the cluster is, the performance of server need to be better. + The server can be a bare-metal server or a virtual machine. The major factor for selecting a server is the number of machines in your cluster. The bigger the cluster is, the performance of server need to be better. - ``NOTE``: The architecture of xCAT management node is recommended to be same as the target compute node in the cluster. + The architecture of xCAT management node is recommended to be same as the target compute node in the cluster. #. Install xCAT on your selected server - The server which installed xCAT will be the **xCAT Management Node**. + The server where xCAT is installed will be the **xCAT Management Node**. - Refer to the doc: :doc:`xCAT Install Guide <../guides/install-guides/index>` to learn how to install xCAT on a server. + Refer to the doc: :doc:`xCAT Install Guide ` to learn how to install xCAT on a server. -#. Start to use xCAT management node + Refer to the doc: :doc:`xCAT Admin Guide ` to learn how to manage xCAT Management server. - Refer to the doc: :doc:`xCAT Admin Guide <../guides/admin-guides/index>`. +#. Discover target compute nodes in the cluster -#. Discover target nodes in the cluster + Define the target nodes in the xCAT database before managing them. - You have to define the target nodes in the xCAT database before managing them. + For a small cluster (less than 5), you can collect the information of target nodes one by one and then define them manually through ``mkdef`` command. - For a small cluster (less than 5), you can collect the information of target nodes one by one and then define them manually through ``mkdef`` command. + For a bigger cluster, you can use the automatic method to discover the target nodes. The discovered nodes will be defined to xCAT database. You can use ``lsdef`` to display them. - For a bigger cluster, you can use the automatic method to discover the target nodes. The discovered nodes will be defined to xCAT database. You can use ``lsdef`` to display them. + Refer to the doc: :doc:`xCAT discovery Guide ` to learn how to discover and define compute nodes. - Refer to the doc: :doc:`xCAT discovery Guide <../guides/admin-guides/manage_clusters/ppc64le/discovery/index>` to learn how to discover and define compute nodes. +#. Perform hardware control operations against the target compute nodes -#. Try to perform the hardware control against the target nodes + Verify the hardware control for defined nodes. e.g. ``rpower stat``. - Now you have the node definition. Verify the hardware control for defined nodes is working. e.g. ``rpower stat``. - - Refer to the doc: :doc:`Hardware Management <../guides/admin-guides/manage_clusters/ppc64le/management/index>` to learn how to perform the remote hardware control. + Refer to the doc: :doc:`Hardware Management ` to learn how to perform the remote hardware control. #. Deploy OS on the target nodes - * Prepare the OS images - * Customize the OS images (Optional) - * Perform the OS deployment + * Prepare the OS images + * Customize the OS images (Optional) + * Perform the OS deployment - Refer to the doc: :doc:`Diskful Install <../guides/admin-guides/manage_clusters/ppc64le/diskful/index>`, :doc:`Diskless Install <../guides/admin-guides/manage_clusters/ppc64le/diskless/index>` to learn how to deploy OS for a target node. + Refer to the doc: :doc:`Diskful Install `, :doc:`Diskless Install ` to learn how to deploy OS for a target node. #. Update the OS after the deployment - You may require to update the OS of certain target nodes after the OS deployment, try the ``updatenode`` command. ``updatenode`` command can execute the following tasks for target nodes: + You may require to update the OS of certain target nodes after the OS deployment, try the ``updatenode`` command. ``updatenode`` command can execute the following tasks for target nodes: * Install additional software/application for the target nodes * Sync some files to the target nodes * Run some postscript for the target nodes - Refer to the doc: :doc:`Updatenode <../guides/admin-guides/manage_clusters/ppc64le/updatenode>` to learn how to use ``updatenode`` command. + Refer to the doc: :doc:`Updatenode ` to learn how to use ``updatenode`` command. #. Run parallel commands -When managing a cluster with hundreds or thousands of nodes, operating on many nodes in parallel might be necessary. xCAT has some parallel commands for that. + When managing a cluster with hundreds or thousands of nodes, operating on many nodes in parallel might be necessary. xCAT has some parallel commands for that. * Parallel shell * Parallel copy * Parallel ping - Refer to the :doc:`/guides/admin-guides/manage_clusters/ppc64le/parallel_cmd` to learn how to use parallel commands. + Refer to the :doc:`/guides/admin-guides/manage_clusters/ppc64le/parallel_cmd` to learn how to use parallel commands. #. Contribute to xCAT (Optional) -While using xCAT, if you find something (code, documentation, ...) that can be improved and you want to contribute that to xCAT, do that for your and other xCAT users benefit. And welcome to xCAT community! + While using xCAT, if you find something (code, documentation, ...) that can be improved and you want to contribute that to xCAT, do that for your and other xCAT users benefit. And welcome to xCAT community! Refer to the :doc:`/developers/index` to learn how to contribute to xCAT community. diff --git a/docs/source/guides/install-guides/common_sections.rst b/docs/source/guides/install-guides/common_sections.rst index f803deea1..4341f22f4 100644 --- a/docs/source/guides/install-guides/common_sections.rst +++ b/docs/source/guides/install-guides/common_sections.rst @@ -39,10 +39,6 @@ xCAT consists of two software packages: ``xcat-core`` and ``xcat-dep`` *This is the latest GA (Generally Availability) build that has been tested thoroughly* - * **Latest Snapshot Builds** - - *This is the latest snapshot of the GA version build that may contain bug fixes but has not yet been tested thoroughly* - * **Development Builds** *This is the snapshot builds of the new version of xCAT in development. This version has not been released yet, use as your own risk* diff --git a/docs/source/overview/_files/2.12.x.csv b/docs/source/overview/_files/2.12.x.csv new file mode 100644 index 000000000..5974c01cc --- /dev/null +++ b/docs/source/overview/_files/2.12.x.csv @@ -0,0 +1,6 @@ +Version,Release Date,New OS Supported,Release Notes +2.12.4,2016-11-11,"RHEL 7.3 LE, RHEV 4.0",`2.12.4 Release Notes `_ +2.12.3,2016-09-30,,`2.12.3 Release Notes `_ +2.12.2,2016-08-19,Ubuntu 16.04.1,`2.12.2 Release Notes `_ +2.12.1,2016-07-08,,`2.12.1 Release Notes `_ +2.12.0,2016-05-20,"RHEL 6.8, Ubuntu 14.4.4 LE, Ubuntu 16.04",`2.12.0 Release Notes `_ diff --git a/docs/source/overview/_files/2.13.x.csv b/docs/source/overview/_files/2.13.x.csv new file mode 100644 index 000000000..677c15905 --- /dev/null +++ b/docs/source/overview/_files/2.13.x.csv @@ -0,0 +1,13 @@ +Version,Release Date,New OS Supported,Release Notes +2.13.11,2018-03-09,,`2.13.11 Release Notes `_ +2.13.10,2018-01-26,,`2.13.10 Release Notes `_ +2.13.9,2017-12-18,,`2.13.9 Release Notes `_ +2.13.8,2017-11-03,,`2.13.8 Release Notes `_ +2.13.7,2017-09-22,,`2.13.7 Release Notes `_ +2.13.6,2017-08-10,"RHEL 7.4",`2.13.6 Release Notes `_ +2.13.5,2017-06-30,,`2.13.5 Release Notes `_ +2.13.4,2017-05-09,"RHV 4.1",`2.13.4 Release Notes `_ +2.13.3,2017-04-14,"RHEL 6.9",`2.13.3 Release Notes `_ +2.13.2,2017-02-24,,`2.13.2 Release Notes `_ +2.13.1,2017-01-13,,`2.13.1 Release Notes `_ +2.13.0,2016-12-09,"SLES 12.2",`2.13.0 Release Notes `_ diff --git a/docs/source/overview/_files/2.14.x.csv b/docs/source/overview/_files/2.14.x.csv new file mode 100644 index 000000000..3e338e359 --- /dev/null +++ b/docs/source/overview/_files/2.14.x.csv @@ -0,0 +1,8 @@ +Version,Release Date,New OS Supported,Release Notes +2.14.6,2019-03-29,,`2.14.6 Release Notes `_ +2.14.5,2018-12-07,"RHEL 7.6",`2.14.5 Release Notes `_ +2.14.4,2018-10-19,"Ubuntu 18.04.1",`2.14.4 Release Notes `_ +2.14.3,2018-08-24,"SLES 12.3",`2.14.3 Release Notes `_ +2.14.2,2018-07-13,"RHEL 6.10, Ubuntu 18.04",`2.14.2 Release Notes `_ +2.14.1,2018-06-01,"RHV 4.2, RHEL 7.5 (Power8)",`2.14.1 Release Notes `_ +2.14.0,2018-04-20,"RHEL 7.5",`2.14.0 Release Notes `_ diff --git a/docs/source/overview/_files/2.15.x.csv b/docs/source/overview/_files/2.15.x.csv new file mode 100644 index 000000000..a2b0eba0f --- /dev/null +++ b/docs/source/overview/_files/2.15.x.csv @@ -0,0 +1,2 @@ +Version,Release Date,New OS Supported,Release Notes +2.15.0,2019-07-31,,`2.15.0 Release Notes `_ diff --git a/docs/source/overview/features.rst b/docs/source/overview/features.rst index d29c0d3d0..5b3eb17e8 100644 --- a/docs/source/overview/features.rst +++ b/docs/source/overview/features.rst @@ -29,7 +29,6 @@ Features * Esxi * RHEV * Windows - * AIX #. Provision machines in diff --git a/docs/source/overview/support_matrix.rst b/docs/source/overview/support_matrix.rst index 11b6c2743..7e526c614 100644 --- a/docs/source/overview/support_matrix.rst +++ b/docs/source/overview/support_matrix.rst @@ -17,9 +17,6 @@ Operating System & Hardware Support Matrix |CentOS | no | no | no | no | yes | yes | yes | | | | | | | | | | +-------+-------+-------+-----+-------+--------+--------+--------+ -|AIX | yes | no | no | no | no | no | no | -| | | | | | | | | -+-------+-------+-------+-----+-------+--------+--------+--------+ |Windows| no | no | no | no | yes | yes | yes | | | | | | | | | | +-------+-------+-------+-----+-------+--------+--------+--------+ diff --git a/docs/source/overview/xcat2_release.rst b/docs/source/overview/xcat2_release.rst index 158eda50c..5857e17ce 100644 --- a/docs/source/overview/xcat2_release.rst +++ b/docs/source/overview/xcat2_release.rst @@ -1,296 +1,46 @@ xCAT2 Release Information ========================= -The following table is a summary of the new operating system (OS), hardware, and features that are added to each xCAT release. The OS and hardware listed in the table have been fully tested with xCAT. For a more detailed list of new function, bug fixes, restrictions and known problems, refer to the individual release notes for a specific release. +The following tables documents the xCAT release versions and release dates. For more detailed information regarding new functions, supported OSs, bug fixes, and download links, refer to the specific release notes. -* **RHEL** - Red Hat Enterprise Linux -* **SLES** - Suse Linux Enterprise Server -* **UBT** - Ubuntu + +.. tabularcolumns:: |p{1cm}|p{4cm}|p{7cm}|p{7cm} + +xCAT 2.15.x +----------- + +.. csv-table:: 2.15.x Release Information + :file: _files/2.15.x.csv + :header-rows: 1 + :class: longtable + :widths: 1 1 1 1 xCAT 2.14.x ----------- -+---------------------------------+---------------+-------------+----------------------------------+ -|xCAT |New OS |New |New Feature | -|Version | |Hardware | | -+=================================+===============+=============+==================================+ -|| xCAT 2.14.6 2019/03/29 | | | | -|| | | | | -| `2.14.6 Release Notes `_ | | | | -+---------------------------------+---------------+-------------+----------------------------------+ -|| xCAT 2.14.5 2018/12/07 |- RHEL7.6 | |- syslog tag refine | -|| | | | | -| `2.14.5 Release Notes `_ | | |- localdisk GPT partition support | -| | | | | -| | | |- goconserver v0.3.2 | -| | | | | -| | | |- xcat-inventory 0.1.6 | -+---------------------------------+---------------+-------------+----------------------------------+ -|| xCAT 2.14.4 2018/10/19 |- UBT18.04.1 | | | -|| | | | | -| `2.14.4 Release Notes `_ | | | | -+---------------------------------+---------------+-------------+----------------------------------+ -|| xCAT 2.14.3 2018/8/24 |- SLES12.3 | |- OpenBMC rflash enhancement | -|| | | | | -| `2.14.3 Release Notes `_ | | |- goconserver v0.3.1 | -+---------------------------------+---------------+-------------+----------------------------------+ -|| xCAT 2.14.2 2018/7/13 |- UBT 18.04 | | | -|| |- RHEL6.10 | | | -| `2.14.2 Release Notes `_ | | | | -+---------------------------------+---------------+-------------+----------------------------------+ -|| xCAT 2.14.1 |- RHV 4.2 + | |- OpenBMC in python enhancement: | -|| 2018/6/1 | RHEL7.5 + p8 | | | -|| | | | rinv enhance, issue #5176 | -| `2.14.1 Release Notes `_ | | | | -| | | |- Discover process enhancement | -| | | | | -| | | |- xcatprobe `xcatmn` enhancement | -| | | | | -| | | |- xcat-inventory enhancement(beta)| -| | | | | -| | | |- goconserver v0.2.2 | -+---------------------------------+---------------+-------------+----------------------------------+ -|| xCAT 2.14 |- RHEL 7.5 | |- OpenBMC support in python: | -|| 2018/4/20 | | | | -|| | | | rspconfig,reventlog | -| `2.14 Release Notes `_ | | | | -+---------------------------------+---------------+-------------+----------------------------------+ - +.. csv-table:: 2.14.x Release Information + :file: _files/2.14.x.csv + :header-rows: 1 + :class: longtable + :widths: 1 1 1 1 xCAT 2.13.x ----------- -+---------------------------------+---------------+-------------+----------------------------------+ -|xCAT |New OS |New |New Feature | -|Version | |Hardware | | -+=================================+===============+=============+==================================+ -|| xCAT 2.13.11 | | |- OpenBMC support in python: | -|| 2018/3/9 | | | | -|| | | | rpower,rbeacon,rsetboot | -| `2.13.11 Release Notes `_ | | |- goconserver enhancement | -| | | | | -| | | | makegocons -q, -C\|--cleanup | -| | | | | -+---------------------------------+---------------+-------------+----------------------------------+ -|| xCAT 2.13.10 | | |- OpenBMC support: | -|| 2018/1/26 | | | | -|| | | | rspconfig powersupplyredundancy,| -| `2.13.10 Release Notes `_ | | | | -| | | |- goconserver enhancement | -| | | | | -| | | | run goconserver on SN | -| | | | | -| | | | redirect console log | -+---------------------------------+---------------+-------------+----------------------------------+ -|| xCAT 2.13.9 | | |- OpenBMC support: | -|| 2017/12/18 | | | | -|| | | | rflash -a/-u enhancement, add -d| -| `2.13.9 Release Notes `_ | | | | -| | | | rspconfig dump,hostname, | -| | | | ntpserver,admin_passwd | -| | | | | -| | | |- goconserver for OpenBMC | -+---------------------------------+---------------+-------------+----------------------------------+ -|| xCAT 2.13.8 | | |- OpenBMC support: | -|| 2017/11/3 | | | | -|| | | | rflash/rpower run parallelly | -| `2.13.8 Release Notes `_ | | | | -| | | |- The document of MN HA | -| | | | | -| | | |- nodeset enhancement for | -| | | | multi-nodes | -+---------------------------------+---------------+-------------+----------------------------------+ -|| xCAT 2.13.7 | | |- OpenBMC support: | -|| 2017/9/22 | | | | -|| | | | rflash for OpenBMC and Host | -| `2.13.7 Release Notes `_ | | | | -| | | |- xcatprobe clusterstatus | -| | | | enhancement | -| | | | | -| | | |- PDU support: discover, config | -| | | | | -| | | |- SRIOV support for VMs | -+---------------------------------+---------------+-------------+----------------------------------+ -|| xCAT 2.13.6 |- RHEL 7.4 |- Boston |- OpenBMC support | -|| 2017/8/10 | | server | | -|| | | | rsetboot net/hd/def | -| `2.13.6 Release Notes `_ | | | /delete/check | -| | | | | -| | | | rspconfig retrieve OpenBMC ip/ | -| | | | netmask/gateway information | -| | | |- nodeset performance enhancement | -| | | | (Phase 3) | -| | | | | -| | | | Dispatch request to the | -| | | | specified service nodes with | -| | | | 'disjointdhcps' | -| | | | | -| | | | Enhance the output of nodeset | -| | | | in hierarchical cluster | -| | | | | -| | | |- network configuration interface:| -| | | | | -| | | | confignetwork is the only | -| | | | interface to configure network | -| | | | on SN/CN | -| | | | | -| | | |- For hardware discovery | -| | | | | -| | | | enhance bmcdiscover to use BMC | -| | | | MAC address to identify BMC with| -| | | | its host | -| | | | | -| | | | enhance "xcatprobe discovery" | -| | | | tool to do configuration check | -| | | | before starting hardware | -| | | | discovery | -| | | | | -| | | |- [xcat-deps] xcat-genesis-base | -| | | | package based on Fedora 26 ppc64| -+---------------------------------+---------------+-------------+----------------------------------+ -|| xCAT 2.13.5 | | |- OpenBMC support | -|| 2017/6/30 | | | | -|| | | | rinv | -| `2.13.5 Release Notes `_ | | |- Enhancements to self testing | -| | | | tool xcat-test | -| | | |- Service node pool support for | -| | | | rhels7 ppc64le diskless | -| | | |- Mellanox cumulus switch ZTP | -| | | | based discovery and | -| | | | auto-configuration | -| | | |- Performance enhancements | -| | | | | -| | | | makedhcp, makedns | -| | | | nodeset | -| | | |- [xcat-deps] ipmitool-xcat | -| | | | package updated to version | -| | | | 1.8.18 for | -| | | | | -| | | | RHEL7.x | -| | | | SLES12.x | -| | | | Ubuntu14.04.x | -| | | |- [xcat-deps] conserver-xcat | -| | | | package updated to version 8.2.1| -| | | | | -+---------------------------------+---------------+-------------+----------------------------------+ -|| xCAT 2.13.4 |- RHV 4.1 | |- OpenBMC support(experimental): | -|| 2017/5/19 | | | | -|| | | | rinv | -| `2.13.4 Release Notes `_ | | | | -| | | | | -+---------------------------------+---------------+-------------+----------------------------------+ -|| xCAT 2.13.3 |- RHEL 6.9 | |- OpenBMC support(experimental): | -|| 2017/4/14 | | | | -|| | | | rpower rcons | -| `2.13.3 Release Notes `_ | | | | -| | | | | -+---------------------------------+---------------+-------------+----------------------------------+ -|| 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| -| | | | | -+---------------------------------+---------------+-------------+----------------------------------+ +.. csv-table:: 2.13.x Release Information + :file: _files/2.13.x.csv + :header-rows: 1 + :class: longtable + :widths: 1 1 1 1 xCAT 2.12.x ----------- -+---------------------------------+---------------+-------------+----------------------------------+ -|xCAT |New OS |New |New Feature | -|Version | |Hardware | | -+=================================+===============+=============+==================================+ -|| xCAT 2.12.4 |- RHEL 7.3 LE | |- `noboot` added to dhcpinterface | -|| 2016/11/11 |- RHEV 4.0 | |- new xcatprobe subcommand: | -|| | | | xcatmn, deploy and discover | -| `2.12.4 Release Notes `_ | | | | -| | | | | -+---------------------------------+---------------+-------------+----------------------------------+ -|| xCAT 2.12.3 | | |- GitHub Issues resolved | -|| 2016/09/30 | | |- rinv options for OpenPOWER | -|| | | |- switch based switch discovery | -| `2.12.3 Release Notes `_ | | |- mkdef takes file redirection | -| | | | | -+---------------------------------+---------------+-------------+----------------------------------+ -|| xCAT 2.12.2 |- UBT 16.04.1 | |- nodeset offline | -|| 2016/08/19 | | |- Enhance: node status update | -|| | | |- Support Bond for install nics | -| `2.12.2 Release Notes `_ | | | | -| | | | | -+---------------------------------+---------------+-------------+----------------------------------+ -|| xCAT 2.12.1 | | |- New xCAT install tool: go-xcat | -|| 2016/07/08 | | |- New opt: mkdef/lsdef --template | -|| | | |- Support rinstall for all OS/ARCH| -| `2.12.1 Release Notes `_ | | |- rscan | -| | | |- New: xcatprobe (experimental) | -+---------------------------------+---------------+-------------+----------------------------------+ -|| xCAT 2.12 |- RHEL 6.8 | |- Docker: xCAT in Docker | -|| 2016/5/20 |- UBT 14.4.4 LE| |- Docker: container life cycle mgt| -|| |- UBT 16.04 | |- Docker: Set up Docker Registry | -| `2.12 Release Notes `_ | | |- Add site.xcatdebugmode | -| | | |- Add switchdiscover -s snmp | -| | | |- Disable auditlog by default | -| | | |- Add site.hierarchicalattrs | -+---------------------------------+---------------+-------------+----------------------------------+ +.. csv-table:: 2.12.x Release Information + :file: _files/2.12.x.csv + :header-rows: 1 + :class: longtable + :widths: 1 1 1 1 xCAT 2.11.x diff --git a/docs/source/references/coral/known_issues/genesis_base.rst b/docs/source/references/coral/known_issues/genesis_base.rst index 3df864a89..19cec3574 100644 --- a/docs/source/references/coral/known_issues/genesis_base.rst +++ b/docs/source/references/coral/known_issues/genesis_base.rst @@ -1,7 +1,7 @@ xCAT Genesis Base ================= -*Note*: Please rebuild ``xCAT-genesis-base`` with ``xCAT-genesis-builder`` version equal and newer than *2.13.10* before updating xCAT *2.13.10* and higher. +.. note:: Ensure that you rebuild ``xCAT-genesis-base`` with ``xCAT-genesis-builder`` version >= to *2.13.10* before updating xCAT to *2.13.10* or higher. xCAT ships a ``xCAT-genesis-base`` package as part of xcat-deps. This is a light-weight diskless linux image based on Fedora (Fedora26, currently) that is used by xCAT to do hardware discovery. @@ -10,6 +10,8 @@ To support the Power9 hardware, changes are made to the kernel in the Red Hat En Work-around ----------- +.. note:: The genesis-base must be compiled on the Power9 hardware. If the management node is not Power9 hardware, manually provision a compute node, build the genesis-base RPM, then install it on the management node. + xCAT cannot ship a kernel based on RHEL distribution, so the customer needs to build a version of the ``xCAT-genesis-base`` on-site using a server running Red Hat Enterprise Linux. 1. Download the latest timestamp version of the ``xCAT-genesis-builder`` RPM provided here: http://xcat.org/files/xcat/xcat-dep/2.x_Linux/beta/ diff --git a/perl-xCAT/xCAT/PPCrflash.pm b/perl-xCAT/xCAT/PPCrflash.pm index 4e080174b..178817bbb 100644 --- a/perl-xCAT/xCAT/PPCrflash.pm +++ b/perl-xCAT/xCAT/PPCrflash.pm @@ -225,7 +225,7 @@ sub parse_args { return (usage()); } - $request->{callback}->({ data => ["It may take considerable time to complete, depending on the number of systems being updated. In particular, power subsystem updates may take an hour or more if there are many attached managed systems. Please waiting. "] }); + $request->{callback}->({ data => ["It may take considerable time to complete, depending on the number of systems being updated. In particular, power subsystem updates may take an hour or more if there are many attached managed systems. Please wait. "] }); if ($request->{hwtype} =~ /^(fsp|bpa)$/ && $opt{activate} =~ /^disruptive$/) { $request->{callback}->({ data => ["You can find the log files in the /var/log/xcatd/dfm/rflash/."] }); @@ -376,8 +376,7 @@ sub preprocess_for_rflash { my @xmllist = grep /\.xml$/, @dirlist; if (@rpmlist == 0 | @xmllist == 0) { - #send_msg($request, 1, "There isn't any rpm and xml files in the directory $packages_d!"); - $callback->({ data => ["There isn't any rpm and xml files in the directory $packages_d!"] }); + $callback->({ data => ["There are no rpm and xml files in the directory $packages_d!"] }); $request = (); return -1; } @@ -528,7 +527,8 @@ sub get_lic_filenames { @dirlist = grep /\.rpm$/, @dirlist; @dirlist = grep /$1/, @dirlist; if (!scalar(@dirlist)) { - $msg = "There isn't a package suitable for $mtms"; + # the last grep above is using $1, which is $pns, the output message should help figure out what is wrong + $msg = "Existing firmware type is: $pns, no matching firmware package found in directory"; return ("", "", "", $msg, -1); } if (scalar(@dirlist) > 1) { @@ -844,7 +844,7 @@ sub rflash { } - push(@value, [ $hmc, "copy files to $hmc completely" ]); + push(@value, [ $hmc, "copying of files to $hmc completed" ]); ############################################### # Now that all the stanzas files have been built and copied to the HMCs, @@ -886,7 +886,7 @@ sub rflash { my $rsp = {}; $rsp->{data}->[0] = "Error from xdsh. Return Code = $::RUNCMD_RC"; xCAT::MsgUtils->message("S", $rsp, $::CALLBACK, 1); - dpush(\@value, [ $hmc, "failed to run xdsh" ]); + dpush(\@value, [ $hmc, "failed to run xdsh command - $cmd_hmc" ]); push(@value, [ $hmc, $rsp->{data}->[0] ]); push(@value, [ $hmc, "Failed to upgrade the firmware of $mtms_t on $hmc" ]); return (\@value); diff --git a/perl-xCAT/xCAT/SLP.pm b/perl-xCAT/xCAT/SLP.pm index 446844071..698bc571c 100755 --- a/perl-xCAT/xCAT/SLP.pm +++ b/perl-xCAT/xCAT/SLP.pm @@ -64,6 +64,11 @@ sub dodiscover { my $sysctl; open($sysctl, "<", "/proc/sys/net/core/rmem_max"); my $maxrcvbuf = <$sysctl>; + # select() on a socket will never succeed if the buffer is too large (i.e. near INT_MAX) + my $cap_maxrcvbuf = 2047*1024*1024; + if ($maxrcvbuf > $cap_maxrcvbuf) { + $maxrcvbuf = $cap_maxrcvbuf; + } my $rcvbuf = $args{'socket'}->sockopt(SO_RCVBUF); if ($maxrcvbuf > $rcvbuf) { $args{'socket'}->sockopt(SO_RCVBUF, $maxrcvbuf / 2); diff --git a/perl-xCAT/xCAT/data/switchinfo.pm b/perl-xCAT/xCAT/data/switchinfo.pm index 6fab0f150..7cf372ac9 100644 --- a/perl-xCAT/xCAT/data/switchinfo.pm +++ b/perl-xCAT/xCAT/data/switchinfo.pm @@ -22,6 +22,8 @@ our %global_mac_identity = ( "a8:2b:b5" => "Edgecore Networks Switch", "3c:2c:99" => "Edgecore Networks Switch", "70:72:cf" => "Edgecore Networks Switch", + "80:a2:35" => "Edgecore Networks Switch", + "b8:6a:97" => "Edgecore Networks Switch", "6c:64:1a" => "Penguin Computing switch" ); diff --git a/travis.pl b/travis.pl index 11119f160..abcf39047 100644 --- a/travis.pl +++ b/travis.pl @@ -150,6 +150,7 @@ sub check_pr_format{ $check_result_str .= "> **PR FORMAT CORRECT**"; send_back_comment("$check_result_str"); }else{ + # Warning if missing milestone or labels, others are errors if($checkrst =~ /milestone/ || $checkrst =~ /labels/){ $check_result_str .= "> **PR FORMAT WARNING** : $checkrst"; send_back_comment("$check_result_str"); @@ -259,8 +260,13 @@ sub send_back_comment{ } } - print "[send_back_comment] method = $post_method to $post_url\n"; - `curl -u "$ENV{'xcatbotuser'}:$ENV{'xcatbotpw'}" -X $post_method -d '{"body":"$message"}' $post_url`; + print "[send_back_comment] method = $post_method to $post_url. Message = $message\n"; + if ( $ENV{'xcatbotuser'} and $ENV{'xcatbotpw'}) { + `curl -u "$ENV{'xcatbotuser'}:$ENV{'xcatbotpw'}" -X $post_method -d '{"body":"$message"}' $post_url`; + } + else { + print "Not able to update pull request with message: $message\n"; + } } #-------------------------------------------------------- @@ -376,11 +382,22 @@ sub install_xcat{ print "[install_xcat] $cmd....[Pass]\n"; } } + $cmd = "sudo apt-get install xcat-probe --allow-remove-essential --allow-unauthenticated"; + @output = runcmd("$cmd"); + if($::RUNCMD_RC){ + print RED "[install_xcat] $cmd ....[Failed]\n"; + print Dumper \@output; + $ret = 1; + }else{ + print "[install_xcat] $cmd ....[Pass]:\n"; + } + if($ret){ $check_result_str .= "> **INSTALL XCAT ERROR** : Please click ``Details`` label in ``Merge pull request`` box for detailed information"; send_back_comment("$check_result_str"); return 1; } + $check_result_str .= "> **INSTALL XCAT SUCCESSFUL**"; send_back_comment("$check_result_str"); } diff --git a/xCAT-buildkit/bin/buildkit b/xCAT-buildkit/bin/buildkit index eb119cde1..4842e47ed 100755 --- a/xCAT-buildkit/bin/buildkit +++ b/xCAT-buildkit/bin/buildkit @@ -344,6 +344,13 @@ if ($tempstring =~ /debian/ || $tempstring =~ /ubuntu/) { $debianflag = 1; } +my ($sysos, $sysver) = split /,/, $tempstring; +if ( ($sysos =~ /rh/) && ($sysver ge 8) ) { + print "ERROR: KITs are not supported on rhel8 or above\n"; + exit(1); +} + + # This is an undocumented flag to support our local build team # to allow building Ubuntu kits on our RH build machines. # It requires RH rpms such as dep, fakeroot, perl-File-DesktopEntry, diff --git a/xCAT-client/pods/man1/lsdocker.1.pod b/xCAT-client/pods/man1/lsdocker.1.pod deleted file mode 100644 index 9448f87f8..000000000 --- a/xCAT-client/pods/man1/lsdocker.1.pod +++ /dev/null @@ -1,57 +0,0 @@ -=head1 NAME - -B - List docker instance. - -=head1 SYNOPSIS - -B I [B<-l>|B<--logs>] - -B I - -B [B<-h>|B<--help>] - -B {B<-v>|B<--version>} - - -=head1 DESCRIPTION - -B To list docker instance info or all the running docker instance info if dockerhost is specified. - -=head1 OPTIONS - -=over 3 - -=item B<-l|--logs> - -=back - -To return the logs of docker instance. Only works for docker instance. - -=head1 EXAMPLES - -=over 3 - -=item 1. -To get info for docker instance "host01c01" - - lsdocker host01c01 - -Output is similar to: - - host01c01: 50800dfd8b5f ubuntu /bin/bash 2016-01-13T06:32:59 running /host01c01 - -=item 2. -To get info for running docker instance on dockerhost "host01" - - lsdocker host01 - -Output is similar to: - - host01: 50800dfd8b5f ubuntu /bin/bash 2016-1-13 - 1:32:59 Up 12 minutes /host01c01 - host01: 875ce11d5987 ubuntu /bin/bash 2016-1-21 - 1:12:37 Up 5 seconds /host01c02 - -=back - -=head1 SEE ALSO - -L, L diff --git a/xCAT-client/pods/man1/mkdocker.1.pod b/xCAT-client/pods/man1/mkdocker.1.pod deleted file mode 100644 index 0ac21f038..000000000 --- a/xCAT-client/pods/man1/mkdocker.1.pod +++ /dev/null @@ -1,100 +0,0 @@ -=head1 NAME - -B - Create docker instance. - -=head1 SYNOPSIS - -B I [B=I [B=I]] [B=I] - -B [B<-h>|B<--help>] - -B {B<-v>|B<--version>} - - -=head1 DESCRIPTION - -B To create docker instances with the specified image, command and/or dockerflags. - -=head1 OPTIONS - -=over 3 - -=item B - -The docker image name that the instance will use. - -=item B - -The command that the instance will run based on the B specified. The B option must be specified in order to use this option. - -=item B - -A JSON string which will be used as parameters to create a docker. Reference https://docs.docker.com/engine/reference/api/docker_remote_api_v1.22/ for more information about which parameters can be specified. - -Some useful flags are: - -=over 3 - -=item B=B|B - -Whether attaches to stdin. - -=item B=B|B - -Whether attaches to stdout. - -=item B=B|B - -Whether attaches to stderr. - -=item B=B|B - -Whether opens stdin. - -=item B=B|B - -Attach standard streams to a tty, including stdin if it is not closed. - -=item B - -An object mapping ports to an empty object in the form of: - - "ExposedPorts": { "/\: {}" } - -=item B - -A list of volume bindings for this docker instance, the form will be: - - "HostConfig": {"Binds":[":"]} - -=back - -=back - -=head1 EXAMPLES - -1. To create a basic docker instance with stdin opened - - mkdocker host01c01 image=ubuntu command=/bin/bash dockerflag="{\"AttachStdin\":true,\"AttachStdout\":true,\"AttachStderr\":true,\"OpenStdin\":true}" - -Output is similar to: - - host01c01: Pull image ubuntu start - host01c01: Pull image ubuntu done - host01c01: Remove default network connection - host01c01: Connecting customized network 'mynet0' - host01c01: success - -2. To create a docker instance which have dir "destdir" in docker instance bind from "srcdir" on dockerhost, and have "Tty" opened with which the docker instance can be attached after started to check the files under "destdir". - - mkdocker host01c01 image=ubuntu command=/bin/bash dockerflag="{\"AttachStdin\":true,\"AttachStdout\":true,\"AttachStderr\":true,\"OpenStdin\":true,\"Tty\":true,\"HostConfig\":{\"Binds\":[\"/srcdir:/destdir\"]}}" - -Output is similar to: - - host01c01: Remove default network connection - host01c01: Connecting customized network 'mynet0' - host01c01: success - -=head1 SEE ALSO - -L, L diff --git a/xCAT-client/pods/man1/restartxcatd.1.pod b/xCAT-client/pods/man1/restartxcatd.1.pod index a85a93ac4..c0e1c7cf3 100644 --- a/xCAT-client/pods/man1/restartxcatd.1.pod +++ b/xCAT-client/pods/man1/restartxcatd.1.pod @@ -11,25 +11,31 @@ B [[B<-h>|B<--help>] | [B<-v>|B<--version>] | [B<-r>|B<--reload>]] The B command restarts the xCAT daemon (xcatd). -B +B: + +=over 4 + +It will perform the xcatd I. The xcatd I is a specific restart which has two advantages compares to the I and then I. =over 2 -It will perform the xcatd I. The xcatd I is a specific restart which has two advantages compares to the I and then I. - 1. The interval of xcatd out of service is very short. - 2. The in processing request which initiated by old xcatd will not be stopped by force. The old xcatd will hand over the sockets to new xcatd, but old xcat will still be waiting for the in processing request to finish before the exit. +=item 1. The interval of xcatd out of service is very short. -It does the same thing as 'service xcatd restart' on NON-systemd enabled Operating System like rh6.x and sles11.x. But for the systemd enabled Operating System like rh7 and sles12, the 'service xcatd restart' just do the I and I instead of xcatd I. - -It's recommended to use B command to restart xcatd on systemd enable system like rh7 and sles12 instead of 'service xcatd restart' or 'systemctl restart xcatd'. +=item 2. The in processing request which initiated by old xcatd will not be stopped by force. The old xcatd will hand over the sockets to new xcatd, but old xcat will still be waiting for the in processing request to finish before the exit. =back -B +It does the same thing as B on NON-systemd enabled Operating System like rh6.x and sles11.x. But for the systemd enabled Operating System like rh7 and sles12, the B will just do the I and I instead of xcatd I. -=over 2 +It's recommended to use B command to restart xcatd on systemd enabled system like rh7 and sles12 instead of B or B. -It runs 'stopsrc -s xcatd' to stop xcatd first if xcatd is active, then runs 'startsrc -s xcatd' to start xcatd. +=back + +B: + +=over 4 + +It runs B to stop xcatd first if xcatd is active, then runs B to start xcatd. If the xcatd subsystem was not created, B will create it automatically. diff --git a/xCAT-client/pods/man1/rmdocker.1.pod b/xCAT-client/pods/man1/rmdocker.1.pod deleted file mode 100644 index d02992870..000000000 --- a/xCAT-client/pods/man1/rmdocker.1.pod +++ /dev/null @@ -1,37 +0,0 @@ - -=head1 NAME - -B - Remove docker instance. - -=head1 SYNOPSIS - -B I [B<-f>|B<--force>] - -B [B<-h>|B<--help>] - -B {B<-v>|B<--version>} - - -=head1 DESCRIPTION - -B To remove docker instances with the specified node name - -=head1 OPTIONS - -=over 3 - -=item B<-f|--force> - -=back - -Force to removal of a running container or failed to disconnect customized network - -=head1 EXAMPLES - - rmdocker host01c01 - host01c01: Disconnect customized network 'mynet0' done - host01c01: success - -=head1 SEE ALSO - -L, L diff --git a/xCAT-client/pods/man1/rpower.1.pod b/xCAT-client/pods/man1/rpower.1.pod index cadf6cf85..8a2e97f58 100644 --- a/xCAT-client/pods/man1/rpower.1.pod +++ b/xCAT-client/pods/man1/rpower.1.pod @@ -66,10 +66,6 @@ B I [B|B|B|B|B] B I [B|B|B|B|B] -=head2 docker specific: - -B I [B|B|B|B|B|B] - =head2 pdu specific: B I [B|B|B|B] @@ -227,18 +223,6 @@ To specify that the target node will be power down if B action failed. To specify that the target node will be reset if B action failed. -=item B - -To start a created docker instance. - -=item B - -To stop a created docker instance. - -=item B - -To restart a created docker instance. - =item B To pause all processes in the instance. diff --git a/xCAT-genesis-scripts/usr/bin/bmcsetup b/xCAT-genesis-scripts/usr/bin/bmcsetup index 3e45a1f8f..96d995c4e 100755 --- a/xCAT-genesis-scripts/usr/bin/bmcsetup +++ b/xCAT-genesis-scripts/usr/bin/bmcsetup @@ -297,15 +297,16 @@ fi LAN_MED_TYPE="802.3" if [ ! -z "$ISOPENBMC" ]; then - # Overvide the default value for OpenBMC - LAN_MED_TYPE="Other LAN" + # For OpenBMC, the value of "Channel Medium Type" attribute could be "Other LAN" for FW drivers prior to OP940.01 + # and "802.3" for FW drivers OP940.01 and later + LAN_MED_TYPE="802.3|Other LAN" fi - +# Loop through channels and pick the one to communicate on while [ -z "$LANCHAN" ]; do logger -s -t $log_label -p local4.info "Auto detecting LAN channel..." for TLANCHAN in {1..16}; do # Try to get the channel information; then get the MAC which is used for the channel - if ipmitool channel info $TLANCHAN 2> /dev/null | grep "$LAN_MED_TYPE" > /dev/null 2>&1 && ipmitool raw 0xc 2 $TLANCHAN 5 0 0 > /dev/null 2>&1; then + if ipmitool channel info $TLANCHAN 2> /dev/null | grep -E "$LAN_MED_TYPE" > /dev/null 2>&1 && ipmitool raw 0xc 2 $TLANCHAN 5 0 0 > /dev/null 2>&1; then LANCHAN=$TLANCHAN break; fi; diff --git a/xCAT-openbmc-py/lib/python/agent/common/rest.py b/xCAT-openbmc-py/lib/python/agent/common/rest.py index e82485c6d..54fb5b4eb 100644 --- a/xCAT-openbmc-py/lib/python/agent/common/rest.py +++ b/xCAT-openbmc-py/lib/python/agent/common/rest.py @@ -15,10 +15,12 @@ from . import exceptions as xcat_exception class RestSession(object): - def __init__(self): + def __init__(self, auth=None): self.session = requests.Session() self.cookies = None - self.auth = None + # If userid and password were passed in, use them for basic authorization + # This is required to connect to BMC with OP940 level, ignored for lower OP levels + self.auth = auth def request(self, method, url, headers, data=None, timeout=30): diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc/openbmc_bmcconfig.py b/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc/openbmc_bmcconfig.py index b7398d87c..902858229 100644 --- a/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc/openbmc_bmcconfig.py +++ b/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc/openbmc_bmcconfig.py @@ -49,8 +49,9 @@ class OpenBMCBmcConfigTask(ParallelNodesCommand): formatted_time = time.strftime("%Y%m%d-%H%M", time.localtime(time.time())) dump_log_file = '%s%s_%s_dump_%s.tar.xz' % (XCAT_LOG_DUMP_DIR, formatted_time, node, download_id) + host_name = os.uname()[1].split('.', 1)[0] if flag_dump_process: - self.callback.info('%s: Downloading dump %s to %s' % (node, download_id, dump_log_file)) + self.callback.info('%s: Downloading dump %s to %s:%s' % (node, download_id, host_name, dump_log_file)) obmc.download_dump(download_id, dump_log_file) if os.path.exists(dump_log_file): @@ -61,7 +62,7 @@ class OpenBMCBmcConfigTask(ParallelNodesCommand): if grep_string: self.callback.error('Invalid dump %s was specified. Use -l option to list.' % download_id, node) else: - self.callback.info('%s: Downloaded dump %s to %s.' % (node, download_id, dump_log_file)) + self.callback.info('%s: Downloaded dump %s to %s:%s.' % (node, download_id, host_name, dump_log_file)) else: self.callback.error('Failed to download dump %s to %s.' % (download_id, dump_log_file), node) return @@ -403,6 +404,25 @@ rmdir \"/tmp/$userid\" \n") self.callback.info("%s: BMC Setting %s..." % (node, openbmc.RSPCONFIG_APIS[key]['display_name'])) + def _get_powersupplyredundancy_value(self, node, obmc): + try: + psr_info = obmc.get_powersupplyredundancy() + for key, value in psr_info.items(): + if key == 'PowerSupplyRedundancyEnabled': + result = '%s: %s: %s' % (node, openbmc.RSPCONFIG_APIS['powersupplyredundancy']['display_name'], + openbmc.RSPCONFIG_APIS['powersupplyredundancy']['attr_values'][str(value)][0]) + return self.callback.info(result) + except SelfServerException as e: + return self.callback.error(e.message, node) + except SelfClientException as e: + if e.code == 404: + return self.callback.error('404 Not Found - Requested endpoint does not exist or may ' \ + 'indicate function is not supported on this OpenBMC firmware.', node) + if e.code == 403: + return self.callback.error('403 Forbidden - Requested endpoint does not exist or may ' \ + 'indicate function is not yet supported by OpenBMC firmware.', node) + return self.callback.error(e.message, node) + def _get_apis_values(self, key, **kw): node = kw['node'] obmc = openbmc.OpenBMCRest(name=node, nodeinfo=kw['nodeinfo'], messager=self.callback, @@ -415,6 +435,9 @@ rmdir \"/tmp/$userid\" \n") return self.callback.error(e.message, node) except SelfClientException as e: if e.code == 404: + if key == 'powersupplyredundancy': + return self._get_powersupplyredundancy_value(node, obmc) + return self.callback.error('404 Not Found - Requested endpoint does not exist or may ' \ 'indicate function is not supported on this OpenBMC firmware.', node) if e.code == 403: @@ -555,12 +578,12 @@ rmdir \"/tmp/$userid\" \n") addon_string = '' if dic_length > 1: addon_string = " for %s" % nic - netinfodict['ip'].append("BMC IP"+addon_string+": %s" % attrs["ip"]) - netinfodict['netmask'].append("BMC Netmask"+addon_string+": %s" % utils.mask_int2str(attrs["netmask"])) - netinfodict['gateway'].append("BMC Gateway"+addon_string+": %s (default: %s)" % (attrs["gateway"], defaultgateway)) - netinfodict['vlan'].append("BMC VLAN ID"+addon_string+": %s" % attrs["vlanid"]) - netinfodict['ipsrc'].append("BMC IP Source"+addon_string+": %s" % attrs["ipsrc"]) - netinfodict['ntpservers'].append("BMC NTP Servers"+addon_string+": %s" % attrs["ntpservers"]) + netinfodict['ip'].append("BMC IP"+addon_string+": %s" % attrs.get("ip", None)) + netinfodict['netmask'].append("BMC Netmask"+addon_string+": %s" % utils.mask_int2str(attrs.get("netmask", 24))) + netinfodict['gateway'].append("BMC Gateway"+addon_string+": %s (default: %s)" % (attrs.get("gateway", None), defaultgateway)) + netinfodict['vlan'].append("BMC VLAN ID"+addon_string+": %s" % attrs.get("vlanid", None)) + netinfodict['ipsrc'].append("BMC IP Source"+addon_string+": %s" % attrs.get("ipsrc", None)) + netinfodict['ntpservers'].append("BMC NTP Servers"+addon_string+": %s" % attrs.get("ntpservers", None)) if ip: for i in netinfodict['ip']: self.callback.info("%s: %s" % (node, i)) diff --git a/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc_client.py b/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc_client.py index 3b1fffee4..2ce1a547e 100644 --- a/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc_client.py +++ b/xCAT-openbmc-py/lib/python/agent/hwctl/openbmc_client.py @@ -200,12 +200,16 @@ RSPCONFIG_APIS = { 'baseurl': "/sensors/chassis/PowerSupplyRedundancy/", 'set_url': "action/setValue", 'get_url': "action/getValue", + 'get_url_new': '/control/power_supply_redundancy', 'get_method': 'POST', + 'get_method_new': 'GET', 'get_data': [], 'display_name': "BMC PowerSupplyRedundancy", 'attr_values': { 'disabled': ["Disabled"], 'enabled': ["Enabled"], + 'False': ['Disabled'], + 'True': ["Enabled"], }, }, 'powerrestorepolicy': { @@ -244,12 +248,12 @@ RSPCONFIG_APIS = { EVENTLOG_URLS = { "list": "/logging/enumerate", - "clear_all": "/logging/action/deleteAll", + "clear_all": "/logging/action/DeleteAll", "resolve": "/logging/entry/{}/attr/Resolved", } RAS_POLICY_TABLE = "/opt/ibm/ras/lib/policyTable.json" -RAS_POLICY_MSG = "Install the OpenBMC RAS package to obtain more details logging messages." +RAS_POLICY_MSG = "Install the OpenBMC RAS package to obtain more detailed logging messages." RAS_NOT_FOUND_MSG = " Not found in policy table: " RESULT_OK = 'ok' @@ -275,7 +279,7 @@ class OpenBMCRest(object): # print back to xcatd or just stdout self.messager = kwargs.get('messager') - self.session = rest.RestSession() + self.session = rest.RestSession((self.username,self.password)) self.root_url = HTTP_PROTOCOL + self.bmcip + PROJECT_URL self.download_root_url = HTTP_PROTOCOL + self.bmcip + '/' @@ -314,8 +318,12 @@ class OpenBMCRest(object): def handle_response (self, resp, cmd=''): - data = resp.json() # it will raise ValueError code = resp.status_code + if code == requests.codes.bad_gateway: + error = "(Verify REST server is running on the BMC)" + self._print_error_log(error, cmd) + raise SelfServerException(code, error, host_and_port=self.bmcip) + data = resp.json() # it will raise ValueError if code != requests.codes.ok: description = ''.join(data['data']['description']) error = '[%d] %s' % (code, description) @@ -657,7 +665,7 @@ class OpenBMCRest(object): # Check if policy table file is there ras_event_mapping = {} if os.path.isfile(RAS_POLICY_TABLE): - with open(RAS_POLICY_TABLE, encoding="utf8", errors='ignore') as data_file: + with open(RAS_POLICY_TABLE) as data_file: policy_hash = json.load(data_file) if policy_hash: ras_event_mapping = policy_hash['events'] @@ -786,6 +794,10 @@ class OpenBMCRest(object): data={"data": attr_info['get_data']} return self.request(method, get_url, payload=data, cmd="get_%s" % key) + def get_powersupplyredundancy(self): + attr_info = RSPCONFIG_APIS['powersupplyredundancy'] + return self.request(attr_info['get_method_new'], attr_info['get_url_new'], cmd='get_powersupplyredundancy') + def set_admin_passwd(self, passwd): payload = { "data": [passwd] } @@ -793,7 +805,7 @@ class OpenBMCRest(object): def set_ntp_servers(self, nic, servers): - payload = { "data": [servers] } + payload = { "data": servers.split(',') } url = RSPCONFIG_NETINFO_URL['ntpservers'].replace('#NIC#', nic) self.request('PUT', url, payload=payload, cmd='set_ntp_servers') @@ -911,7 +923,7 @@ class OpenBMCRest(object): netinfo[nicid]["zeroconf"] = v["Address"] continue if 'ip' in netinfo[nicid]: - msg = "%s: Another valid ip %s found." % (node, v["Address"]) + msg = "Another valid ip %s found." % (v["Address"]) self._print_record_log(msg, 'get_netinfo') del netinfo[nicid] netinfo['error'] = 'Interfaces with multiple IP addresses are not supported' @@ -926,7 +938,7 @@ class OpenBMCRest(object): utils.update2Ddict(netinfo, nicid, "vlanid", info.get("Id", "Disable")) utils.update2Ddict(netinfo, nicid, "mac", info["MACAddress"]) ntpservers = None - tmp_ntpservers = ''.join(info["NTPServers"]) + tmp_ntpservers = ','.join(info["NTPServers"]) if tmp_ntpservers: ntpservers = tmp_ntpservers utils.update2Ddict(netinfo, nicid, "ntpservers", ntpservers) diff --git a/xCAT-probe/debian/dirs b/xCAT-probe/debian/dirs index 728459eec..dcc64ee60 100644 --- a/xCAT-probe/debian/dirs +++ b/xCAT-probe/debian/dirs @@ -1,2 +1,4 @@ opt/xcat/bin opt/xcat/probe +opt/xcat/probe/subcmds +opt/xcat/probe/subcmds/bin diff --git a/xCAT-probe/debian/xcat-probe.links b/xCAT-probe/debian/xcat-probe.links new file mode 100644 index 000000000..8737b5e45 --- /dev/null +++ b/xCAT-probe/debian/xcat-probe.links @@ -0,0 +1 @@ +/opt/xcat/bin/xcatclient /opt/xcat/probe/subcmds/bin/switchprobe diff --git a/xCAT-probe/lib/perl/probe_utils.pm b/xCAT-probe/lib/perl/probe_utils.pm index 115814943..71e3ae8d6 100644 --- a/xCAT-probe/lib/perl/probe_utils.pm +++ b/xCAT-probe/lib/perl/probe_utils.pm @@ -240,6 +240,31 @@ sub is_selinux_enable { #------------------------------------------ +=head3 + Description: + Test if SELinux is enforcing in current operating system + Arguments: + None + Returns: + 1 : yes + 0 : no +=cut + +#------------------------------------------ +sub is_selinux_enforcing { + my $retval = 0; + if (-e "/usr/sbin/getenforce") { + my $enforce_mode = `/usr/sbin/getenforce`; + chomp $enforce_mode; + if ($enforce_mode eq "Enforcing") { + $retval = 1; + } + } + return $retval; +} + +#------------------------------------------ + =head3 Description: Test if firewall is opened in current operating system diff --git a/xCAT-probe/subcmds/xcatmn b/xCAT-probe/subcmds/xcatmn index 612e95620..262a2c86e 100755 --- a/xCAT-probe/subcmds/xcatmn +++ b/xCAT-probe/subcmds/xcatmn @@ -93,8 +93,9 @@ sub do_main_job { $rc |= $rst; #check if SElinux is disabled - $rst = check_selinux(\$checkpoint, \@error); - print_check_result($checkpoint, "f", $rst, \@error); + ($rst, $flag) = check_selinux(\$checkpoint, \@error); + print_check_result($checkpoint, $flag, $rst, \@error); + $rst = 0 if ($flag == "w"); $rc |= $rst; #check http service @@ -172,6 +173,10 @@ sub do_main_job { $rst = check_dhcp_leases(\$checkpoint, \@error); print_check_result($checkpoint, "w", $rst, \@error); $rc |= $rst; + } else { + $rst = check_db_pkgs(\$checkpoint, \@error); + print_check_result($checkpoint, "f", $rst, \@error); + $rc |= $rst; } cleanup(); @@ -673,16 +678,26 @@ sub check_selinux { my $checkpoint_ref = shift; my $error_ref = shift; my $rst = 0; + my $flag = "w"; + my $msg = ""; $$checkpoint_ref = "Checking SELinux is disabled..."; @$error_ref = (); if (probe_utils->is_selinux_enable()) { - push @$error_ref, "SELinux is enabled on current server"; + $msg = "SELinux is enabled on current server"; $rst = 1; + $flag = "w"; } - - return $rst; + if (probe_utils->is_selinux_enforcing()) { + $msg = "SELinux is enforcing on current server"; + $rst = 1; + $flag = "f"; + } + if ($rst) { + push @error_ref, "$msg"; + } + return ($rst, $flag); } sub check_firewall { @@ -942,13 +957,24 @@ sub check_dns_service { my $nodename = `hostname -s 2>&1`; chomp($nodename); + # For mn, 'externaldns' attribute could be set to '0' or '1' or not defined. + # if '1', mn does not need to provide DNS service, so will not check it. + # if '0' or undefined, proceed with check. # 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 + # if '0', sn does not need to provide DNS service, will not check it my $checkdns = 1; if ($is_sn) { $checkdns = `lsdef $nodename -i setupnameserver -c 2>&1| awk -F'=' '{print \$2}'`; chomp($checkdns); - } + } else { # management node + my $dns_is_external = `lsdef -t site -i externaldns -c 2>&1 | awk -F'=' {print \$2}'`; + chomp($dns_is_external); + if ($dns_is_external eq "1") { + $checkdns = 0; + } else { + $checkdns = 1; + } + } if ($checkdns) { `which nslookup > /dev/null 2>&1`; @@ -1253,6 +1279,37 @@ sub check_daemon_attributes { return ($rst, $rst_type); } +sub check_db_pkgs { + my $checkpoint_ref = shift; + my $error_ref = shift; + my $rst = 0; + + $$checkpoint_ref = "Checking DB packages installatio..."; + @$error_ref = (); + + my $cfgloc_file = "/etc/xcat/cfgloc"; + if (! -e $cfgloc_file) { + push @$error_ref, "$cfgloc_file does not exist, please check xcat installation."; + return 1; + } + my $db_type = `cat $cfgloc_file | awk -F ':' '{print \$1}'`; + chomp($db_type); + my $db_pkg; + my $db_name; + if ($db_type eq "mysql") { + $db_name = "perl-DBD-MySQL or perl-DBD-mysql"; + $db_pkg = `rpm qa | grep -e perl-DBD-MySQL -e perl-DBD-mysql`; + } elsif ($db_type eq "Pg") { + $db_name = "perl-DBD-Pg"; + $db_pkg = `rpm -qa | grep $db_name`; + } + if (!$db_pkg) { + push @$error_ref, "$db_name is not installed, please install it."; + $rst = 1; + } + return $rst; +} + sub returncmdoutput { my $rst = shift; my $error_ref = shift; diff --git a/xCAT-server/debian/control b/xCAT-server/debian/control index 2fd09f2bd..9e8998bcb 100644 --- a/xCAT-server/debian/control +++ b/xCAT-server/debian/control @@ -8,7 +8,7 @@ Homepage: https://xcat.org/ Package: xcat-server Architecture: all -Depends: ${perl:Depends}, 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 +Depends: ${perl:Depends}, grub2-xcat (>= 2.02-0.76.el7.1.snap201905160255), 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. diff --git a/xCAT-server/lib/perl/xCAT/IPMI.pm b/xCAT-server/lib/perl/xCAT/IPMI.pm index 30f369dab..331bc0887 100644 --- a/xCAT-server/lib/perl/xCAT/IPMI.pm +++ b/xCAT-server/lib/perl/xCAT/IPMI.pm @@ -209,6 +209,11 @@ sub new { my $sysctl; open($sysctl, "<", "/proc/sys/net/core/rmem_max"); my $maxrcvbuf = <$sysctl>; + # select() on a socket will never succeed if the buffer is too large (i.e. near INT_MAX) + my $cap_maxrcvbuf = 2047*1024*1024; + if ($maxrcvbuf > $cap_maxrcvbuf) { + $maxrcvbuf = $cap_maxrcvbuf; + } my $rcvbuf = $socket->sockopt(SO_RCVBUF); if ($maxrcvbuf > $rcvbuf) { $socket->sockopt(SO_RCVBUF, $maxrcvbuf / 2); diff --git a/xCAT-server/lib/perl/xCAT/OPENBMC.pm b/xCAT-server/lib/perl/xCAT/OPENBMC.pm index 9a4ab02ec..85188c14b 100644 --- a/xCAT-server/lib/perl/xCAT/OPENBMC.pm +++ b/xCAT-server/lib/perl/xCAT/OPENBMC.pm @@ -25,6 +25,8 @@ use xCAT::TableUtils; my $PYTHON_AGENT_FILE = "/opt/xcat/lib/python/agent/agent.py"; my $header = HTTP::Headers->new('Content-Type' => 'application/json'); +# Currently not used, example of header to use for authorization +#my $header = HTTP::Headers->new('X-Auth-Token' => 'xfMHrrxdMgbiITnX0TlN'); sub new { my $async = shift; @@ -44,8 +46,16 @@ sub send_request { my $method = shift; my $url = shift; my $content = shift; + my $username = shift; + my $password = shift; my $request = HTTP::Request->new( $method, $url, $header, $content ); + if (defined $username and defined $password) { + # If username and password were passed in use authorization_basic() + # This is required to connect to BMC with OP940 level, ignored for + # lower OP levels + $request->authorization_basic($username, $password); + } my $id = $async->add_with_opts($request, {}); return $id; } diff --git a/xCAT-server/lib/perl/xCAT/SvrUtils.pm b/xCAT-server/lib/perl/xCAT/SvrUtils.pm index 9cde6c855..4248cede5 100755 --- a/xCAT-server/lib/perl/xCAT/SvrUtils.pm +++ b/xCAT-server/lib/perl/xCAT/SvrUtils.pm @@ -446,13 +446,68 @@ sub getsynclistfile() } +=head3 get_os_search_list + Get the list of os names based on specified os name. + This function is used to create a proper file search list for osimage + template or pkglist + + Arguments: + $os + Returns: + An array of the names of os + Globals: + none + Error: + Example: + xCAT::SvrUtils->get_os_search_list("ubuntu18.04.2"); + Will returns + # ubuntu18.04.2 + # ubuntu18.04.1 + # ubuntu18.04.0 + # ubuntu18.04 + # ubuntu18.4 + # ubuntu18.03 + # ubuntu18.3 + # ubuntu18.02 + # ubuntu18.2 + # ubuntu18.01 + # ubuntu18.1 + # ubuntu18.00 + # ubuntu18.0 + # ubuntu18 + Comments: + none + +=cut + +sub get_os_search_list { + my $os = shift; + #example: for os=rhels7.6-alternate + my ($baseos, $alter) = split(/\-/, $os); + my @word = split(/\./, $baseos); + my @list = (); + + while ($word[-1] =~ /^[0-9]+$/) { + my $last = pop(@word); + while ($last >= 0) { + push(@list, join('.', @word, $last)); + if ($last =~ /^0[0-9]/) { + push(@list, join('.', @word, 0 + $last)); + } + $last = sprintf("%0" . length($last) . "d", $last - 1); + } + } + push(@list, join('.', @word)); + + return @list; +} + sub get_file_name { my ($searchpath, $extension, $profile, $os, $arch, $genos) = @_; #usally there're only 4 arguments passed for this function #the $genos is only used for the Redhat family - #handle the following ostypes: sles10.2, sles11.1, rhels5.3, rhels5.4, etc if (-r "$searchpath/$profile.$os.$arch.$extension") { @@ -468,38 +523,7 @@ sub get_file_name { return "$searchpath/$profile.$genos.$extension"; } - my $dotpos = rindex($os, "."); - my $osbase = substr($os, 0, $dotpos); - # If the osimge name was specified with -n, the name might contain multiple "." - # Chop them off one at a time until filename match is found - while ($dotpos > 0) { - if (-r "$searchpath/$profile.$osbase.$arch.$extension") { - return "$searchpath/$profile.$osbase.$arch.$extension"; - } - if (-r "$searchpath/$profile.$osbase.$extension") { - return "$searchpath/$profile.$osbase.$extension"; - } - # Chop off "." from the end and try again - $dotpos = rindex($osbase, "."); - $osbase = substr($osbase, 0, $dotpos); - } - - #if there are no '.', pick the two numbers follow by leading string, like sles11 - #then pick one number follow by leading string, like centos7, rhels7 - if ($os =~ m/([a-zA-Z]+\d\d)/) - { - $osbase=$1; - if (-r "$searchpath/$profile.$osbase.$arch.$extension") { - return "$searchpath/$profile.$osbase.$arch.$extension"; - } - if (-r "$searchpath/$profile.$osbase.$extension") { - return "$searchpath/$profile.$osbase.$extension"; - } - } - - if ($os =~ m/([a-zA-Z]+\d)/) - { - $osbase = $1; + foreach my $osbase (xCAT::SvrUtils::get_os_search_list($os)) { if (-r "$searchpath/$profile.$osbase.$arch.$extension") { return "$searchpath/$profile.$osbase.$arch.$extension"; } @@ -691,7 +715,7 @@ sub update_tables_with_templates my $genos = $osver; $genos =~ s/\..*//; if ($genos =~ /rh.*s(\d*)/) { - $genos = "rhel$1"; + $genos = "rhels$1"; } @@ -913,7 +937,7 @@ sub update_tables_with_mgt_image my $genos = $osver; $genos =~ s/\..*//; if ($genos =~ /rh.*s(\d*)/) { - $genos = "rhel$1"; + $genos = "rhels$1"; } #if the osver does not match the osver of MN, return @@ -1119,7 +1143,7 @@ sub update_tables_with_diskless_image my $genos = $osver; $genos =~ s/\..*//; if ($genos =~ /rh.*s(\d*)/) { - $genos = "rhel$1"; + $genos = "rhels$1"; } #print "osver=$osver, arch=$arch, osname=$osname, genos=$genos, profile=$profile\n"; diff --git a/xCAT-server/lib/xcat/monitoring/gangliamon.pm b/xCAT-server/lib/xcat/monitoring/gangliamon.pm index fef33ff13..dd350d794 100755 --- a/xCAT-server/lib/xcat/monitoring/gangliamon.pm +++ b/xCAT-server/lib/xcat/monitoring/gangliamon.pm @@ -65,7 +65,7 @@ sub start { if ($OS =~ /AIX/) { $res_gmond = `/etc/rc.d/init.d/gmond restart 2>&1`; } else { - $res_gmond = `/etc/init.d/gmond restart 2>&1`; + $res_gmond = `systemctl restart gmond 2>&1`; } my $tmp; @@ -90,9 +90,9 @@ sub start { $res_gmetad = `/etc/rc.d/init.d/gmetad restart 2>&1`; } } else { - $tmp = `/etc/init.d/gmetad status | grep running`; + $tmp = `systemctl status gmetad| grep running`; if (!$tmp) { - $res_gmetad = `/etc/init.d/gmetad restart 2>&1`; + $res_gmetad = `systemctl restart gmetad 2>&1`; } } @@ -166,7 +166,7 @@ sub start { $result = `XCATBYPASS=Y $::XCATROOT/bin/xdsh $rec /etc/rc.d/init.d/gmond restart 2>&1`; } else { - $result = `XCATBYPASS=Y $::XCATROOT/bin/xdsh $rec /etc/init.d/gmond restart 2>&1`; + $result = `XCATBYPASS=Y $::XCATROOT/bin/xdsh $rec systemctl restart gmond 2>&1`; } } @@ -787,7 +787,7 @@ sub stop { if ($OS =~ /AIX/) { $res_gmond = `/etc/rc.d/init.d/gmond stop 2>&1`; } else { - $res_gmond = `/etc/init.d/gmond stop 2>&1`; + $res_gmond = `systemctl stop gmond 2>&1`; } if ($?) { if ($callback) { @@ -805,7 +805,7 @@ sub stop { if ($OS =~ /AIX/) { $res_gmetad = `/etc/rc.d/init.d/gmetad stop 2>&1`; } else { - $res_gmetad = `/etc/init.d/gmetad stop 2>&1`; + $res_gmetad = `systemctl stop gmetad 2>&1`; } if ($?) { @@ -867,7 +867,7 @@ sub stop { if ($OS =~ /AIX/) { $result = `XCATBYPASS=Y $::XCATROOT/bin/xdsh $rec /etc/rc.d/init.d/gmond stop 2>&1`; } else { - $result = `XCATBYPASS=Y $::XCATROOT/bin/xdsh $rec /etc/init.d/gmond stop 2>&1`; + $result = `XCATBYPASS=Y $::XCATROOT/bin/xdsh $rec systemctl stop gmond 2>&1`; } } diff --git a/xCAT-server/lib/xcat/plugins/anaconda.pm b/xCAT-server/lib/xcat/plugins/anaconda.pm index 7f50010e9..76744f719 100644 --- a/xCAT-server/lib/xcat/plugins/anaconda.pm +++ b/xCAT-server/lib/xcat/plugins/anaconda.pm @@ -2026,14 +2026,18 @@ sub copycd { #If they say to call it something unidentifiable, give up? + print "DEBUG - [anaconda.pm] The name specified ($distname) is not supported for anaconda images, continue to another plugin...\n"; return; } - my $darch; my $dinfo; my $did; my $desc; + my $darch; my $dno; - if (-r $mntpath . "/.discinfo") { + + if (-r $mntpath . "/.discinfo") + { + print "DEBUG - [anaconda.pm] Attempt to detemine OS information from the .discinfo file ...\n"; open($dinfo, $mntpath . "/.discinfo"); $did = <$dinfo>; chomp($did); @@ -2043,22 +2047,30 @@ sub copycd chomp($darch); $dno = <$dinfo>; chomp($dno); - - if ($darch and $darch =~ /i.86/) - { - $darch = "x86"; - } + close($dinfo); - if ($desc and $desc =~ /CentOS Linux (.*)/) { - $distname = "centos" . $1; - } - if ($xCAT::data::discinfo::distnames{$did}) + } + else + { + print "DEBUG - [anaconda.pm] No .discinfo file found on media, will continue ...\n"; + } + + if ($darch and $darch =~ /i.86/) + { + $darch = "x86"; + } + + if ($xCAT::data::discinfo::distnames{$did}) + { + unless ($distname) { unless ($distname) { $distname = $xCAT::data::discinfo::distnames{$did}; } } + } elsif ($desc and $desc =~ /CentOS Linux (.*)/) { + $distname = "centos" . $1; } elsif (-r $mntpath . "/isolinux/isolinux.cfg") { my $icfg; @@ -2080,10 +2092,18 @@ sub copycd return; } + unless ($dno) { + if ($distname =~ /((?:\d+\.)+\d+)/) { + # Attempt to detemine the number of the OS from distname passed in + $dno = $1; + } + } + print "DEBUG - [anaconda.pm] Distname=$distname, OS=$desc, ARCH=$arch, Version=$dno\n"; + unless ($distname) { - print "INFO - Could not find ID=$did in the discinfo database for OS=$desc ARCH=$darch NUM=$dno\n"; - print "INFO - Attempting to auto-detect...\n"; + print "DEBUG - [anaconda.pm] Could not find ID=$did in the discinfo database for OS=$desc ARCH=$darch NUM=$dno\n"; + print "DEBUG - [anaconda.pm] Attempting to auto-detect...\n"; if ($desc =~ /IBM_PowerKVM/) { # check for PowerKVM support @@ -2130,8 +2150,9 @@ sub copycd } else { - print "INFO - Could not auto-detect operating system.\n"; - return; #Do nothing, not ours.. + # Cannot continue with what was detected, or attributes provided + print "DEBUG - [anaconda.pm] Could not auto-detect operating system. Maybe some other plugin can, return.\n"; + return; } } if ($darch) @@ -2144,7 +2165,7 @@ sub copycd { $callback->( { - error => "Requested distribution architecture $arch, but media is $darch" + error => "Requested distribution architecture $arch, but media is $darch", errorcode => [1] } ); return; @@ -2152,6 +2173,17 @@ sub copycd if ($arch eq "ppc") { $arch = "ppc64" } } + # At this point, if arch is not provided and we cannot determine it, inform the user + unless ($arch) + { + $callback->( + { + error => "copycds could not identify the ARCH, you may wish to try -a .", errorcode => [1] + } + ); + return; + } + if ($inspection) { my $retinfo = "DISTNAME:$distname\n" . "ARCH:$arch\n"; @@ -2165,13 +2197,13 @@ sub copycd ); return; } - print "INFO - detected distname=$distname, arch=$arch\n"; %{$request} = (); #clear request we've got it. my $disccopiedin = 0; my $osdistroname = $distname . "-" . $arch; my $defaultpath = "$installroot/$distname/$arch"; + print "DEBUG - [anaconda.pm] Detected distname=$distname, arch=$arch defaultpath=$defaultpath osdistroname=$osdistroname\n"; unless ($path) { $path = $defaultpath; diff --git a/xCAT-server/lib/xcat/plugins/bmcdiscover.pm b/xCAT-server/lib/xcat/plugins/bmcdiscover.pm index a16765531..8c979363b 100644 --- a/xCAT-server/lib/xcat/plugins/bmcdiscover.pm +++ b/xCAT-server/lib/xcat/plugins/bmcdiscover.pm @@ -1160,8 +1160,10 @@ sub bmcdiscovery_ipmi { $mtm = '' if ($mtm =~ /^0+$/); $serial = '' if ($serial =~ /^0+$/); - unless (($mtm or $serial) or $ipmac{$ip}) { - xCAT::MsgUtils->message("W", { data => ["BMC Type/Model and/or Serial and MAC Address is unavailable for $ip"] }, $::CALLBACK); + # To constract a node name need either mac or both mtm and serial + # Exit if mac AND one of mtm or serial is missing + if (!($mtm and $serial) and !$ipmac{$ip}) { + xCAT::MsgUtils->message("W", { data => ["BMC Type/Model and Serial or MAC Address is unavailable for $ip"] }, $::CALLBACK); return; } @@ -1292,8 +1294,10 @@ sub bmcdiscovery_openbmc{ $mtm = '' if ($mtm =~ /^0+$/); $serial = '' if ($serial =~ /^0+$/); - unless (($mtm or $serial) or $ipmac{$ip}) { - xCAT::MsgUtils->message("W", { data => ["Could not obtain Valid Model Type and/or Serial Number and MAC Address for BMC at $ip"] }, $::CALLBACK); + # To constract a node name need either mac or both mtm and serial + # Exit if mac AND one of mtm or serial is missing + if (!($mtm and $serial) and !$ipmac{$ip}) { + xCAT::MsgUtils->message("W", { data => ["BMC Type/Model and Serial or MAC Address is unavailable for $ip"] }, $::CALLBACK); return; } diff --git a/xCAT-server/lib/xcat/plugins/ddns.pm b/xCAT-server/lib/xcat/plugins/ddns.pm index 556a217b8..0b7b272b5 100644 --- a/xCAT-server/lib/xcat/plugins/ddns.pm +++ b/xCAT-server/lib/xcat/plugins/ddns.pm @@ -206,6 +206,7 @@ sub process_request { $callback = shift; my $oldmask = umask(0007); my $ctx = {}; + my $permissionmode; my @nodes = (); my $hadargs = 0; my $allnodes; @@ -777,6 +778,8 @@ sub process_request { #We manipulate local namedconf $ctx->{dbdir} = get_dbdir(); $ctx->{zonesdir} = get_zonesdir(); + #backup named directory permission + $permissionmode = (stat($ctx->{dbdir}))[2] & 07777; chmod 0775, $ctx->{dbdir}; # assure dynamic dns can actually execute against the directory if ($::VERBOSE) { @@ -918,7 +921,10 @@ sub process_request { unless ($ret) { xCAT::SvrUtils::sendmsg("DNS setup is completed", $callback); } - + #restore named directory permission + if (defined($permissionmode)) { + chmod $permissionmode, $ctx->{dbdir}; + } umask($oldmask); } diff --git a/xCAT-server/lib/xcat/plugins/dhcp.pm b/xCAT-server/lib/xcat/plugins/dhcp.pm index 8b4777c33..b294fb309 100644 --- a/xCAT-server/lib/xcat/plugins/dhcp.pm +++ b/xCAT-server/lib/xcat/plugins/dhcp.pm @@ -719,7 +719,7 @@ sub addnode } } elsif ($nrent and $nrent->{netboot} and $nrent->{netboot} eq 'yaboot') { $lstatements = 'filename = \"/yb/node/yaboot-' . $node . '\";' . $lstatements; - } elsif ($nrent and $nrent->{netboot} and $nrent->{netboot} eq 'grub2') { + } elsif ($nrent and $nrent->{netboot} and $nrent->{netboot} =~ /^grub2[-]?.*$/) { $lstatements = 'filename = \"/boot/grub2/grub2-' . $node . '\";' . $lstatements; } elsif ($nrent and $nrent->{netboot} and $nrent->{netboot} eq 'petitboot') { $lstatements = 'option conf-file \"http://' . $nxtsrv . $httpport . '/tftpboot/petitboot/' . $node . '\";' . $lstatements; diff --git a/xCAT-server/lib/xcat/plugins/grub2.pm b/xCAT-server/lib/xcat/plugins/grub2.pm index 12048e0d1..f9c133acd 100644 --- a/xCAT-server/lib/xcat/plugins/grub2.pm +++ b/xCAT-server/lib/xcat/plugins/grub2.pm @@ -230,11 +230,21 @@ sub setstate { # write entries to boot config file, but only if not offline directive if ($cref and $cref->{currstate} ne "offline") { + my $httpport = "80"; + my @hports = xCAT::TableUtils->get_site_attribute("httpport"); + if ($hports[0]) { + $httpport = $hports[0]; + } + print $pcfg "set default=\"xCAT OS Deployment\"\n"; print $pcfg "menuentry \"xCAT OS Deployment\" {\n"; print $pcfg " insmod http\n"; print $pcfg " insmod tftp\n"; - print $pcfg " set root=$grub2protocol,$serverip\n"; + if ($grub2protocol eq "http" && $httpport ne "80") { + print $pcfg " set root=http,$serverip:$httpport\n"; + } else { + print $pcfg " set root=$grub2protocol,$serverip\n"; + } print $pcfg " echo Loading Install kernel ...\n"; my $protocolrootdir = ""; diff --git a/xCAT-server/lib/xcat/plugins/ipmi.pm b/xCAT-server/lib/xcat/plugins/ipmi.pm index a6f53b0da..dc17f5b9e 100644 --- a/xCAT-server/lib/xcat/plugins/ipmi.pm +++ b/xCAT-server/lib/xcat/plugins/ipmi.pm @@ -2469,9 +2469,8 @@ sub rflash { my $c_id = ${ $sessdata->{component_ids} }[$i]; my $version = $firmware_version{$c_id}; my $format_string = $comp_string{$c_id}; - my $format_ver = sprintf("%3d.%02x.%d", - $version->[0], $version->[1], - $version->[5]*0x1000000 +$version->[4]*0x10000+ $version->[3]*0x100+$version->[2]); + my $format_ver = sprintf("%3d.%02x %02X%02X%02X%02X", + $version->[0], $version->[1], $version->[2], $version->[3], $version->[4], $version->[5]); $msg = $msg . $sessdata->{node} . ": " . "Node firmware version for $format_string component: $format_ver"; if ($i != scalar(@{ $sessdata->{component_ids} }) - 1) { @@ -8842,16 +8841,16 @@ sub hpm_action_version { return -1; } my $version = $hpm_data_hash{1}{action_version}; - my $ver = sprintf("%3d.%02x.%d", $version->[0], $version->[1], - $version->[5]*0x1000000+$version->[4]*0x10000+$version->[3]*0x100+$version->[2]); + my $ver = sprintf("%3d.%02x %02X%02X%02X%02X", $version->[0], $version->[1], + $version->[2], $version->[3], $version->[4], $version->[5]); $callback->({ data => "HPM firmware version for BOOT component:$ver" }); $version = $hpm_data_hash{2}{action_version}; - $ver = sprintf("%3d.%02x.%d", $version->[0], $version->[1], - $version->[5]*0x1000000+$version->[4]*0x10000+$version->[3]*0x100+$version->[2]); + $ver = sprintf("%3d.%02x %02X%02X%02X%02X", $version->[0], $version->[1], + $version->[2], $version->[3], $version->[4], $version->[5]); $callback->({ data => "HPM firmware version for APP component:$ver" }); $version = $hpm_data_hash{4}{action_version}; - $ver = sprintf("%3d.%02x.%d", $version->[0], $version->[1], - $version->[5]*0x1000000+$version->[4]*0x10000+$version->[3]*0x100+$version->[2]); + $ver = sprintf("%3d.%02x %02X%02X%02X%02X", $version->[0], $version->[1], + $version->[2], $version->[3], $version->[4], $version->[5]); $callback->({ data => "HPM firmware version for BIOS component:$ver" }); } diff --git a/xCAT-server/lib/xcat/plugins/kit.pm b/xCAT-server/lib/xcat/plugins/kit.pm index 2b1a0d6c4..d61cebbde 100644 --- a/xCAT-server/lib/xcat/plugins/kit.pm +++ b/xCAT-server/lib/xcat/plugins/kit.pm @@ -33,7 +33,7 @@ $::KITFRAMEWORK = "2"; $::COMPATIBLE_KITFRAMEWORKS = "0,1,2"; my $debianflag = 0; -my $tempstring = xCAT::Utils->osver(); +my $tempstring = xCAT::Utils->osver(all); if ($tempstring =~ /debian/ || $tempstring =~ /ubuntu/) { $debianflag = 1; @@ -99,6 +99,12 @@ sub process_request $::PID = $$; } + my ($sysos, $sysver) = split /,/, $tempstring; + if ( ($sysos =~ /rh/) && ($sysver ge 8) ) { + $callback->({ error => ["KITs are not supported on rhel8 or above"], errorcode => [1] }); + return 1; + } + my $command = $request->{command}->[0]; my $rc; diff --git a/xCAT-server/lib/xcat/plugins/kvm.pm b/xCAT-server/lib/xcat/plugins/kvm.pm index c46d0553a..02fb6e385 100755 --- a/xCAT-server/lib/xcat/plugins/kvm.pm +++ b/xCAT-server/lib/xcat/plugins/kvm.pm @@ -49,7 +49,6 @@ if (Sys::Virt->VERSION =~ /^0\.[10]\./) { use XML::Simple; $XML::Simple::PREFERRED_PARSER = 'XML::Parser'; -use Data::Dumper; use POSIX "WNOHANG"; use Storable qw(freeze thaw store_fd fd_retrieve); use IO::Select; @@ -3887,20 +3886,12 @@ sub process_request { $confdata = {}; unless ($command eq 'rscan') { xCAT::VMCommon::grab_table_data($noderange, $confdata, $callback); - # Add debug info for issue 1958, the rmvm issue - my $test_file_fd; - open($test_file_fd, ">> $::XCATROOT//share/xcat/tools/autotest/result/$command.$$.rec"); - print $test_file_fd "====================start==========================\n"; my $kvmdatatab = xCAT::Table->new("kvm_nodedata", -create => 0); #grab any pertinent pre-existing xml if ($kvmdatatab) { $confdata->{kvmnodedata} = $kvmdatatab->getNodesAttribs($noderange, [qw/xml/]); - print $test_file_fd Dumper($confdata->{kvmnodedata}); } else { $confdata->{kvmnodedata} = {}; - print $test_file_fd "***Error: Can not open kvm_nodedata table==\n"; } - print $test_file_fd "====================end==========================\n"; - close $test_file_fd; } if ($command eq 'mkvm' or ($command eq 'clonevm' and (grep { "$_" eq '-b' } @exargs)) or ($command eq 'rpower' and (grep { "$_" eq "on" or $_ eq "boot" or $_ eq "reset" } @exargs))) { xCAT::VMCommon::requestMacAddresses($confdata, $noderange); diff --git a/xCAT-server/lib/xcat/plugins/makentp.pm b/xCAT-server/lib/xcat/plugins/makentp.pm index 35d20ee84..47aeca6cc 100755 --- a/xCAT-server/lib/xcat/plugins/makentp.pm +++ b/xCAT-server/lib/xcat/plugins/makentp.pm @@ -253,7 +253,8 @@ sub process_request { } # Handle chronyd here, - if (-f "/usr/sbin/chronyd") { + if (-x "/usr/sbin/chronyd" && + (-x "/usr/bin/systemctl" || -x "/bin/systemctl")) { send_msg(\%request, 0, "Will configure chronyd instead."); my $cmd = "/install/postscripts/setupntp " . diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index f8f74dc46..d406cbed9 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -19,6 +19,7 @@ use JSON; use HTTP::Async; use HTTP::Cookies; use LWP::UserAgent; +use Sys::Hostname; use File::Basename; use File::Spec; use File::Copy qw/copy cp mv move/; @@ -77,6 +78,7 @@ $::RPOWER_RESET_SLEEP_INTERVAL = 13; $::BMC_MAX_RETRY = 20; $::BMC_CHECK_INTERVAL = 15; +$::BMC_REBOOT_DELAY = 180; $::RSPCONFIG_DUMP_INTERVAL = 15; $::RSPCONFIG_DUMP_MAX_RETRY = 20; @@ -203,7 +205,7 @@ my %status_info = ( }, REVENTLOG_CLEAR_REQUEST => { method => "POST", - init_url => "$openbmc_project_url/logging/action/deleteAll", + init_url => "$openbmc_project_url/logging/action/DeleteAll", data => "[]", }, REVENTLOG_CLEAR_RESPONSE => { @@ -267,7 +269,7 @@ my %status_info = ( RFLASH_SET_PRIORITY_REQUEST => { method => "PUT", init_url => "$openbmc_project_url/software", - data => "false", # Priority state of 0 sets image to active + data => "0", # Priority state of 0 sets image to active }, RFLASH_SET_PRIORITY_RESPONSE => { process => \&rflash_response, @@ -400,6 +402,13 @@ my %status_info = ( RSPCONFIG_GET_RESPONSE => { process => \&rspconfig_response, }, + RSPCONFIG_GET_PSR_REQUEST => { + method => "GET", + init_url => "$openbmc_project_url/control/power_supply_redundancy", + }, + RSPCONFIG_GET_PSR_RESPONSE => { + process => \&rspconfig_response, + }, RSPCONFIG_GET_NIC_REQUEST => { method => "GET", init_url => "$openbmc_project_url/network/enumerate", @@ -2443,7 +2452,7 @@ sub gen_send_request { } process_debug_info($node, $debug_info); } - my $handle_id = xCAT::OPENBMC->send_request($async, $method, $request_url, $content); + my $handle_id = xCAT::OPENBMC->send_request($async, $method, $request_url, $content, $node_info{$node}{username}, $node_info{$node}{password}); $handle_id_node{$handle_id} = $node; $node_info{$node}{cur_status} = $next_status{ $node_info{$node}{cur_status} }; @@ -2508,6 +2517,9 @@ sub deal_with_response { return; } } elsif ($response->status_line eq $::RESPONSE_SERVICE_TIMEOUT) { + # Normally we would not wind up here when processing a response from bmcreboot and instead + # handle it in rpower_response() which will be called when 200 OK is returned. But sometimes + # we get 504 Timeout and wind up here. The steps are the same. if ($node_info{$node}{cur_status} eq "RPOWER_RESET_RESPONSE" and defined $status_info{RPOWER_RESET_RESPONSE}{argv} and $status_info{RPOWER_RESET_RESPONSE}{argv} =~ /bmcreboot$/) { my $infomsg = "BMC $::POWER_STATE_REBOOT"; xCAT::SvrUtils::sendmsg($infomsg, $callback, $node); @@ -2515,8 +2527,9 @@ sub deal_with_response { my $timestamp = localtime(); print RFLASH_LOG_FILE_HANDLE "$timestamp ===================Rebooting BMC to apply new BMC firmware===================\n"; print RFLASH_LOG_FILE_HANDLE "BMC $::POWER_STATE_REBOOT\n"; + print RFLASH_LOG_FILE_HANDLE "Waiting for $::BMC_REBOOT_DELAY seconds to give BMC a chance to reboot\n"; close (RFLASH_LOG_FILE_HANDLE); - retry_after($node, "RPOWER_BMC_CHECK_REQUEST", 15); + retry_after($node, "RPOWER_BMC_CHECK_REQUEST", $::BMC_REBOOT_DELAY); return; }else{ $wait_node_num--; @@ -2559,8 +2572,20 @@ sub deal_with_response { # if ($node_info{$node}{cur_status} eq "RFLASH_DELETE_IMAGE_RESPONSE") { $error = "Invalid ID provided to delete. Use the -l option to view valid firmware IDs."; - } elsif (($node_info{$node}{cur_status} eq "RSPCONFIG_API_CONFIG_QUERY_RESPONSE") || - ($node_info{$node}{cur_status} eq "RSPCONFIG_API_CONFIG_ATTR_RESPONSE")) { + } elsif ($node_info{$node}{cur_status} eq "RSPCONFIG_API_CONFIG_ATTR_RESPONSE") { + # Set attribute call returned with 404, display an error + $error = "$::RESPONSE_NOT_FOUND - Requested endpoint does not exist or may indicate function is not supported on this OpenBMC firmware."; + } elsif ($node_info{$node}{cur_status} eq "RSPCONFIG_API_CONFIG_QUERY_RESPONSE") { + # Query attribute call came back with 404. If this is for PowerSupplyRedundancy, + # send request with a new path RSPCONFIG_GET_PSR_REQUEST, response processing will print the value + if ($::RSPCONFIG_CONFIGURED_API_KEY eq "RSPCONFIG_POWERSUPPLY_REDUNDANCY") { + $node_info{$node}{cur_status} = "RSPCONFIG_GET_PSR_REQUEST"; + $next_status{RSPCONFIG_GET_PSR_REQUEST} = "RSPCONFIG_GET_PSR_RESPONSE"; + gen_send_request($node); + + return; + } + # Query atribute call came back with 404, not for Power Supply Redundency. Display an error $error = "$::RESPONSE_NOT_FOUND - Requested endpoint does not exist or may indicate function is not supported on this OpenBMC firmware."; } else { $error = "[" . $response->code . "] " . $response_info->{'data'}->{'description'}; @@ -2596,6 +2621,66 @@ sub deal_with_response { #------------------------------------------------------- +=head3 mask_password2 + + return a string with masked password + + This function is usefull when password is easily known + and can be passed into this function + Input: + $string: string containing password the needs masking + $password: password to mask + +=cut + +#------------------------------------------------------- +sub mask_password2 { + + my $string = shift; + my $password = shift; + + # Replace all occurences of password string with "xxxxxx" + $string =~ s/$password/xxxxxx/g; + + return $string; +} + +#------------------------------------------------------- + +=head3 mask_password + + return a string with masked password + + This function is usefull when password is not easily known + and is only expected to be part of URL like "https://:@...." + Input: + $string: string containing password the needs masking + +=cut + +#------------------------------------------------------- +sub mask_password { + + my $string = shift; + # Replace password string with "xxxxxx", if part of URL + # Password is between ":" and "@" found in the string after "https://" + # + my $url_start = index($string,"https://"); + if ($url_start > 0) { + my $colon_index = index($string, ":", $url_start+length("https://")); + if ($colon_index > 0) { + my $at_index = index($string, "@", $colon_index); + if ($at_index > 0) { + # Replace string beteen ":" and "@" with "xxxxxx" to mask password + substr($string, $colon_index+1, $at_index-$colon_index-1) = "xxxxxx"; + } + } + } + return $string; +} + +#------------------------------------------------------- + =head3 process_debug_info print debug info and add to log @@ -2614,6 +2699,7 @@ sub process_debug_info { $debug_msg = ""; } + $debug_msg = mask_password($debug_msg); xCAT::SvrUtils::sendmsg("$flag_debug $debug_msg", $callback, $ts_node); xCAT::MsgUtils->trace(0, "D", "$flag_debug $node $debug_msg"); } @@ -2649,6 +2735,11 @@ sub login_request { xCAT::SvrUtils::sendmsg([1 ,"[" . $login_response->code . "] Login to BMC failed: " . $login_response->status_line . "."], $callback, $node); return 1; } + if ($login_response->code eq 502) { + # Possible reason for 502 code is the REST server not running + xCAT::SvrUtils::sendmsg([1 ,"[" . $login_response->code . "] Login to BMC failed: " . $login_response->status_line . ". Verify REST server is running on the BMC."], $callback, $node); + return 1; + } return 0; } @@ -2751,7 +2842,8 @@ sub rpower_response { print RFLASH_LOG_FILE_HANDLE "BMC $::POWER_STATE_REBOOT\n"; my $timestamp = localtime(); print RFLASH_LOG_FILE_HANDLE "$timestamp ===================Reboot BMC to apply new BMC===================\n"; - retry_after($node, "RPOWER_BMC_CHECK_REQUEST", 15); + print RFLASH_LOG_FILE_HANDLE "Waiting for $::BMC_REBOOT_DELAY seconds to give BMC a chance to reboot\n"; + retry_after($node, "RPOWER_BMC_CHECK_REQUEST", $::BMC_REBOOT_DELAY); return; } } @@ -2950,9 +3042,10 @@ sub rpower_response { retry_after($node, $next_status{ $node_info{$node}{cur_status} }{OFF}, $::RPOWER_CHECK_ON_INTERVAL); return; } else { - #after retry 5 times, the host is still off, print error and return + # if after 5 retries, the host is still off, print error and return my $wait_time_X = $node_info{$node}{wait_on_end} - $node_info{$node}{wait_on_start}; xCAT::SvrUtils::sendmsg([1, "Sent power-on command but state did not change to $::POWER_STATE_ON after waiting $wait_time_X seconds. (State=$all_status)."], $callback, $node); + xCAT::SvrUtils::sendmsg([1, "Run 'reventlog' command to see possible reasons for failure."], $callback, $node); $node_info{$node}{cur_status} = ""; $wait_node_num--; return; @@ -3753,7 +3846,7 @@ sub rspconfig_response { if ($node_info{$node}{cur_status} eq "RSPCONFIG_PASSWD_VERIFY") { if ($status_info{RSPCONFIG_PASSWD_VERIFY}{argv} ne $node_info{$node}{password}) { - xCAT::SvrUtils::sendmsg("Current BMC password is incorrect, cannot set the new password.", $callback, $node); + xCAT::SvrUtils::sendmsg([1, "Current BMC password is incorrect, cannot set the new password."], $callback, $node); $wait_node_num--; return; } @@ -3801,6 +3894,22 @@ sub rspconfig_response { } } + if ($node_info{$node}{cur_status} eq "RSPCONFIG_GET_PSR_RESPONSE") { + # Processing response from Power Supply Redundency + if ($response_info->{'message'} eq $::RESPONSE_OK) { + foreach my $key_url (keys %{$response_info->{data}}) { + # We only care about this one key_url + if ($key_url eq "PowerSupplyRedundancyEnabled") { + my $display_value = $api_config_info{"RSPCONFIG_POWERSUPPLY_REDUNDANCY"}{"attr_value"}{"disabled"}; + my $display_name = $api_config_info{"RSPCONFIG_POWERSUPPLY_REDUNDANCY"}{"display_name"}; + if ($response_info->{data}{$key_url} eq "true") { + $display_value = $api_config_info{"RSPCONFIG_POWERSUPPLY_REDUNDANCY"}{"attr_value"}{"enabled"}; + } + xCAT::SvrUtils::sendmsg($display_name . ": " . $display_value, $callback, $node); + } + } + } + } if ($next_status{ $node_info{$node}{cur_status} }) { if ($node_info{$node}{cur_status} eq "RSPCONFIG_CHECK_RESPONSE") { $node_info{$node}{cur_status} = $next_status{ $node_info{$node}{cur_status} }{$origin_type}; @@ -4164,7 +4273,7 @@ sub rspconfig_dump_response { sub dump_download_process { my $node = shift; - my $request_url = "$http_protocol://" . $node_info{$node}{bmc}; + my $request_url = "$http_protocol://" . $node_info{$node}{username} . ":" . $node_info{$node}{password} . "@" . $node_info{$node}{bmc}; my $content_login = '{ "data": [ "' . $node_info{$node}{username} .'", "' . $node_info{$node}{password} . '" ] }'; my $content_logout = '{ "data": [ ] }'; my $cjar_id = "/tmp/_xcat_cjar.$node"; @@ -4187,16 +4296,17 @@ sub dump_download_process { my $curl_login_result = `$curl_login_cmd -s`; my $h; if (!$curl_login_result) { - xCAT::SvrUtils::sendmsg([1, "Did not receive response from OpenBMC after running command '$curl_login_cmd'"], $callback, $node); + xCAT::SvrUtils::sendmsg([1, "Did not receive response from OpenBMC after running command '" . mask_password2($curl_login_cmd, $node_info{$node}{password}) . "'"], $callback, $node); return 1; } eval { $h = from_json($curl_login_result) }; if ($@) { - xCAT::SvrUtils::sendmsg([1, "Received wrong format response for command '$curl_login_cmd': $curl_login_result)"], $callback, $node); + xCAT::SvrUtils::sendmsg([1, "Received wrong format response for command '" . mask_password2($curl_login_cmd, $node_info{$node}{password}) . "': $curl_login_result)"], $callback, $node); return 1; } if ($h->{message} eq $::RESPONSE_OK) { - xCAT::SvrUtils::sendmsg("Downloading dump $dump_id to $file_name", $callback, $node); + my @host_name = split(/\./, hostname()); + xCAT::MsgUtils->message("I", { data => ["$node: Downloading dump $dump_id to $host_name[0]:$file_name"] }, $callback); my $curl_dwld_result = `$curl_dwld_cmd -s`; if (!$curl_dwld_result) { if ($xcatdebugmode) { @@ -4215,7 +4325,7 @@ sub dump_download_process { # Remove downloaded file, nothing useful inside of it unlink $file_name; } else { - xCAT::SvrUtils::sendmsg("Downloaded dump $dump_id to $file_name", $callback, $node) if ($::VERBOSE); + xCAT::MsgUtils->message("I", { data => ["$node: Downloaded dump $dump_id to $host_name[0]:$file_name"] }, $callback) if ($::VERBOSE); } } else { @@ -4827,7 +4937,7 @@ sub rflash_response { sub rflash_upload { my ($node, $callback) = @_; - my $request_url = "$http_protocol://" . $node_info{$node}{bmc}; + my $request_url = "$http_protocol://" . $node_info{$node}{username} . ":" . $node_info{$node}{password} . "@" . $node_info{$node}{bmc}; my $content_login = '{ "data": [ "' . $node_info{$node}{username} .'", "' . $node_info{$node}{password} . '" ] }'; my $content_logout = '{ "data": [ ] }'; my $cjar_id = "/tmp/_xcat_cjar.$node"; @@ -4851,7 +4961,7 @@ sub rflash_upload { my $curl_login_result = `$curl_login_cmd -s`; my $h; if (!$curl_login_result) { - my $curl_error = "$::FAILED_UPLOAD_MSG. Did not receive response from OpenBMC after running command '$curl_login_cmd'"; + my $curl_error = "$::FAILED_UPLOAD_MSG. Did not receive response from OpenBMC after running command '" . mask_password2($curl_login_cmd, $node_info{$node}{password}) . "'"; xCAT::SvrUtils::sendmsg([1, "$curl_error"], $callback, $node); print RFLASH_LOG_FILE_HANDLE "$curl_error\n"; $node_info{$node}{rst} = "$curl_error"; @@ -4859,7 +4969,7 @@ sub rflash_upload { } eval { $h = from_json($curl_login_result) }; # convert command output to hash if ($@) { - my $curl_error = "$::FAILED_UPLOAD_MSG. Received wrong format response for command '$curl_login_cmd': $curl_login_result"; + my $curl_error = "$::FAILED_UPLOAD_MSG. Received wrong format response for command '" . mask_password2($curl_login_cmd, $node_info{$node}{password}) . "': $curl_login_result"; xCAT::SvrUtils::sendmsg([1, "$curl_error"], $callback, $node); # Before writing error to log, make it a single line $curl_error =~ tr{\n}{ }; @@ -4895,7 +5005,7 @@ sub rflash_upload { } my $curl_upload_result = `$upload_cmd`; if (!$curl_upload_result) { - my $curl_error = "$::FAILED_UPLOAD_MSG. Did not receive response from OpenBMC after running command '$upload_cmd'"; + my $curl_error = "$::FAILED_UPLOAD_MSG. Did not receive response from OpenBMC after running command '" . mask_password($upload_cmd) . "'"; xCAT::SvrUtils::sendmsg([1, "$curl_error"], $callback, $node); print RFLASH_LOG_FILE_HANDLE "$curl_error\n"; $node_info{$node}{rst} = "$curl_error"; @@ -4903,7 +5013,7 @@ sub rflash_upload { } eval { $h = from_json($curl_upload_result) }; # convert command output to hash if ($@) { - my $curl_error = "$::FAILED_UPLOAD_MSG. Received wrong format response from command '$upload_cmd': $curl_upload_result"; + my $curl_error = "$::FAILED_UPLOAD_MSG. Received wrong format response from command '" . mask_password($upload_cmd) ."': $curl_upload_result"; xCAT::SvrUtils::sendmsg([1, "$curl_error"], $callback, $node); # Before writing error to log, make it a single line $curl_error =~ tr{\n}{ }; diff --git a/xCAT-server/lib/xcat/plugins/rinstall.pm b/xCAT-server/lib/xcat/plugins/rinstall.pm index 52fcc4e27..cc40b7b29 100644 --- a/xCAT-server/lib/xcat/plugins/rinstall.pm +++ b/xCAT-server/lib/xcat/plugins/rinstall.pm @@ -362,6 +362,8 @@ sub rinstall { # We got an error with the nodeset my @successnodes; my @failurenodes; + my @failuresns; + my $snfailure; # copy into a temporary variable to avoid of circular reference my @lines = @$res; foreach my $line (@lines) { @@ -384,9 +386,39 @@ sub rinstall { } return 1; } + + if ($line =~ /Unable to dispatch hierarchical sub-command to (\S+):3001/) { + $snfailure=1; + push @failuresns,$1; + } xCAT::MsgUtils->message("I", $rsp, $callback); } + # if only provision one node and failed nodeset, will exit the command + # instead of continue with rnetboot/rsetboot, rpower. + if ( (scalar(@nodes) == 1) ) { + #exit the command if it's service node failure + if ($snfailure) { + my $node = $nodes[0]; + my $nrtab = xCAT::Table->new('noderes'); + my $nrents = $nrtab->getNodeAttribs($node, [qw(servicenode)]); + my $nodesn = $nrents->{servicenode}; + foreach my $tmpsn (@failuresns) { + if ($nodesn eq $tmpsn) { + $rsp->{error}->[0] = "Unable connect to Service node $nodesn, failed to run 'nodeset' against the node: @nodes"; + $rsp->{errorcode}->[0] = 1; + xCAT::MsgUtils->message("E", $rsp, $callback); + return 1; + } + } + } else { + $rsp->{error}->[0] = "Failed to run 'nodeset' against the node: @nodes"; + $rsp->{errorcode}->[0] = 1; + xCAT::MsgUtils->message("E", $rsp, $callback); + return 1; + } + } + foreach my $node (@failurenodes) { delete $nodes{$node}; } diff --git a/xCAT-server/sbin/restartxcatd b/xCAT-server/sbin/restartxcatd index 4df45b3a9..852c04e55 100755 --- a/xCAT-server/sbin/restartxcatd +++ b/xCAT-server/sbin/restartxcatd @@ -70,7 +70,7 @@ if (xCAT::Utils->isLinux()) { print "Restarting xCATd "; if (-r "/etc/profile.d/xcat.sh") { - $cmd = "source /etc/profile.d/xcat.sh;"; + $cmd = ". /etc/profile.d/xcat.sh;"; } $cmd .= "xcatd -p /var/run/xcatd.pid"; diff --git a/xCAT-server/share/xcat/ib/scripts/Mellanox/mlnxofed_ib_install b/xCAT-server/share/xcat/ib/scripts/Mellanox/mlnxofed_ib_install index d0f63e5a4..58a2a4ac6 100755 --- a/xCAT-server/share/xcat/ib/scripts/Mellanox/mlnxofed_ib_install +++ b/xCAT-server/share/xcat/ib/scripts/Mellanox/mlnxofed_ib_install @@ -1,289 +1,427 @@ -#!/bin/sh +#!/bin/bash +# +# This is the sample Mellanox IB driver installation script # -# Sample script to customize options for Mellonax OFED IB support # For AIX: # TBD # For Linux: # - For full-disk installs: -# - Copy rpms to node +# - Copy Mellanox OFED ISO to node # - Install IB rpms # - For diskless images: # - Copy the packages to the images. # - Install IB rpms # +#usage: # -# Usage: -# Copy the xCAT mlnxofed_ib_install script file to postscripts directory: +# Copy the xCAT mlnxofed_ib_install script file to postscripts directory: # cp /opt/xcat/share/xcat/ib/scripts/Mellanox/mlnxofed_ib_install /install/postscripts/mlnxofed_ib_install # -# 1. Install the ofed driver for diskful node -# 1.1 Set the postscript as one postbootscripts for the node -# chdef xcat01 -p postbootscripts=mlnxofed_ib_install,configiba -# 1.2 Copy the pkglist to the custom directory: -# cp /opt/xcat/share/xcat/install//compute...pkglist /install/custom/install//compute...pkglist -# Edit your /install/custom/install//compute...pkglist and add: -# #INCLUDE:/opt/xcat/share/xcat/ib/netboot//ib...pkglist# -# 1.3 Make sure the related osimage use the customized pkglist. -# lsdef -t osimage -o --install-compute -# if not, change it: -# chdef -t osimage -o --install-compute pkglist=/install/custom/install//compute...pkglist -# 1.4 Do the diskful installation +# Prepare Mellanox OFED ISO file and save it into any subdirectory under /install. +# +# 1. install the ofed driver for diskfull node +# [NOTE] step 1.1-1.2 are only needed by redhat and sles +# 1.1 copy the pkglist to the custom directory: +# cp /opt/xcat/share/xcat/install//compute...pkglist /install/custom/install//compute...pkglist +# Edit your /install/custom/install//compute...pkglist and add: +# #INCLUDE:/opt/xcat/share/xcat/ib/netboot//ib...pkglist# +# 1.2 Make the related osimage use the customized pkglist. +# chdef -t osimage -o --install-compute pkglist=/install/custom/install//compute...pkglist +# 1.3 set mlnxofed_ib_install as postbootscripts for the target node. assign necessary attribute for mlnxofed_ib_install at same time. +# chdef -p postbootscripts="mlnxofed_ib_install -p /install//" +# [NOTE] The default options input into Mellanox are '--without-32bit --without-fw-update --force' +# you can appoint the options by yourslef with '-m' option of mlnxofed_ib_install +# In order to distinguish which options are tranfered to Mellanox and which options are belong to mlnxofed_ib_install, any options wanted to transfered to Mellanox must follow behind -m and end with "-end-", for example: +# chdef -p postbootscripts="mlnxofed_ib_install -p /install// -m --without-32bit --add-kernel-support --force -end-" +# 1.4 do the diskfull installation +# nodeset osimage= ...... +# # 2. install the ofed driver for diskless images: -# 2.1 Copy the pkglist to the custom directory: -# cp /opt/xcat/share/xcat/netboot//compute...pkglist /install/custom/netboot//compute...pkglist -# Edit your /install/custom/netboot//.pkglist and add: -# #INCLUDE:/opt/xcat/share/xcat/ib/netboot//ib...pkglist# -# 2.2 Add to postinstall scripts -# Edit your /install/custom/netboot//.postinstall and add: -# installroot=$1 ofeddir=/install/post/otherpkgs///ofed/ NODESETSTATE=genimage /install/postscripts/mlnxofed_ib_install -# 2.3 Make sure the related osimage use the customized pkglist and customized compute.postinsall -# lsdef -t osimage -o --netboot-compute -# if not, change it: -# chdef -t osimage -o --netboot-compute pkglist=/install/custom/netboot//compute...pkglist postinstall=/install/custom/netboot//.postinstall -# 2.4 Run genimage -# genimage --netboot-compute -# -# You can obtain more information at: http://xcat-docs.readthedocs.org/ +# [NOTE] step 2.1 is only needed by redhat and sles +# 2.1 copy the pkglist to the custom directory: +# cp /opt/xcat/share/xcat/netboot//compute...pkglist /install/custom/netboot//compute...pkglist +# Edit your /install/custom/netboot//.pkglist and add: +# #INCLUDE:/opt/xcat/share/xcat/ib/netboot//ib...pkglist# +# 2.2 Add to postinstall scripts +# Edit your /install/custom/netboot//.postinstall and add: +# /install/postscripts/mlnxofed_ib_install -p /install// -n genimage -i $1 +# 2.3 Make sure the related osimage use the customized pkglist and customized compute.postinsall +# lsdef -t osimage -o --netboot-compute +# if not, change it: +# chdef -t osimage -o --netboot-compute pkglist=/install/custom/netboot//compute...pkglist postinstall=/install/custom/netboot//.postinstall +# 2.4 run genimage +# genimage --netboot-compute # -OS=`uname` -#installroot='/install/netboot/sles11.1/x86_64/compute/rootimg' -INSTALL_DIR='/install' +#set -x -#echo "------------------------------------------" -#echo "OFED_DIR=$ofeddir" -#echo "OSVER=$OSVER" -#echo "arch=$ARCH" -#echo "NODESETSTATE=$NODESETSTATE" -#echo "mlnxofed_options=$mlnxofed_options" -#echo "installroot=$installroot" -#echo "------------------------------------------" - -if [ "$(uname -s|tr 'A-Z' 'a-z')" = "linux" ];then - str_dir_name=`dirname $0` - . $str_dir_name/xcatlib.sh +OS="$(uname)" +if [ "$OS" = "Linux" ]; then + str_dir_name="${0%/*}" + . "$str_dir_name/xcatlib.sh" 2>/dev/null fi -#use arg for the OFED_DIR if defined, -ARGNUM=$# -if [ $ARGNUM -gt 1 ]; then - if [ $1 = "-s" ]; then - OFED_DIR=$2 - fi +#-------------------------------------------------------- +declare -a MLNXOFED_OPTS + +function usage() { + echo "Usage: mlnxofed_ib_install [-attribute]" + echo " attribute include:" + echo " -h: print this help message" + echo " -p: the path where OFED file is saved. this is necessary attribute" + echo " -m: the options inputted into mlnxofedinstall script, defualt value are --without-32bit --without-fw-update --force" + echo " -i: the image root path. this is necessary attribute in diskless scenario" + echo " -n: nodeset status, the value are one of install, boot or genimage" +} + +while [ "$#" -gt "0" ] +do + case "$1" in + "-p") + shift + OFED_PATH="$1" + ;; + "-m") + shift + while [ "$#" -gt "0" -a "-end-" != "$1" ] + do + MLNXOFED_OPTS=("${MLNXOFED_OPTS[@]}" "$1") + shift + done + ;; + "-i") + shift + IMGROOTPATH="$1" + ;; + "-n") + shift + NODESETSTATE="$1" + ;; + "-h") + usage + exit 0 + ;; + *) + echo "unsupport attribute $1" + exit 0 + ;; + esac + shift +done + +if [ -z "$OFED_PATH" ]; then + echo "[Error] Without Mellanox OFED file path, please assign correct path" >&2 + exit 1 fi -#if arg is not defined, check ofeddir environment variable, -if [ -z "$OFED_DIR" ]; then - OFED_DIR=$ofeddir - #if ofeddir is not defined, use default. - if [ -z "$OFED_DIR" ]; then - # try to default - OFED_DIR=$INSTALL_DIR/post/otherpkgs/$OSVER/$ARCH/ofed - fi +if [ "$NODESETSTATE" = "genimage" -a ! -d "$IMGROOTPATH" ]; then + echo "[Error] this is for diskless installation, please assign correct diskless image root path" >&2 + exit 1 fi -# $mlnxofed_options is an environment variable passed to the mlnxofed_ib_install script. By default mlnxofed_option is '--without-32bit --force' -if [ -z "$mlnxofed_options" ]; then - mlnxofed_options="--without-32bit --force" -fi +[ "${#MLNXOFED_OPTS[@]}" = 0 ] && MLNXOFED_OPTS=(--without-32bit --without-fw-update --force) -if [[ $NODESETSTATE != "genimage" ]]; then - # running as a postscript in a full-disk install or AIX diskless install - installroot="" -fi +OFED_DIR=${OFED_PATH%/*} +OFED_NAME=${OFED_PATH##*/} -if [ $OS != "AIX" ]; then - if [[ $NODESETSTATE == "install" ]] || [[ $NODESETSTATE == "boot" ]]; then - # Being run from a stateful install postscript - # Copy rpms directly from the xCAT management node and install - mkdir -p /tmp/ofed - rm -f -R /tmp/ofed/* - cd /tmp/ofed - #download_dir=`echo $OFED_DIR | cut -d '/' -f3-` - #wget -l inf -N -r --waitretry=10 --random-wait --retry-connrefused -t 10 -T 60 -nH --cut-dirs=5 ftp://$SITEMASTER/$download_dir/ 2> /tmp/wget.log - download_dir=$OFED_DIR - num=`echo $download_dir | awk -F"/" '{if($NF==""){print NF-2}else{print NF-1}}'` - wget -l inf -N -r --waitretry=10 --random-wait --retry-connrefused -t 10 -T 60 -nH --cut-dirs=$num --reject "index.html*" --no-parent http://$MASTER$download_dir/ 2> /tmp/wget.log - wget -l inf -N -r --waitretry=10 --random-wait --retry-connrefused -t 10 -T 60 -nH --cut-dirs=$num --reject "index.html*" --no-parent http://$MASTER$download_dir/.mlnx 2>> /tmp/wget.log - wget -l inf -N -r --waitretry=10 --random-wait --retry-connrefused -t 10 -T 60 -nH --cut-dirs=$num --reject "index.html*" --no-parent http://$MASTER$download_dir/.supported_kernels 2>> /tmp/wget.log +echo "Mellanox OFED file path is $OFED_DIR" +echo "Mellanox OFED file is $OFED_NAME" +echo "Mellanox OFED options are ${MLNXOFED_OPTS[@]}" +echo "image root path is $IMGROOTPATH" +echo "NODESETSTATE is $NODESETSTATE" +function hack_uname() +{ + BEFORE_UNAME_R="$($1/bin/uname -r)" + BEFORE_UNAME_M="$($1/bin/uname -m)" + echo "Before hack_uname(), -r=>'${BEFORE_UNAME_R}' -m=>'${BEFORE_UNAME_M}'" + BEFORE_UNAME_R_NEW="$(chroot $1 /bin/uname -r)" + BEFORE_UNAME_M_NEW="$(chroot $1 /bin/uname -m)" + echo "Before hack_uname(), chroot -r=>'${BEFORE_UNAME_R_NEW}' -m=>'${BEFORE_UNAME_M_NEW}'" - if [ -f /etc/os-release ] && - cat /etc/os-release |grep NAME|grep Ubuntu>/dev/null - then - nodename=`hostname` - echo "$nodename 's operating system is Ubuntu." - echo "If you want to install Mellanox_OFED in $nodename, $nodename must have ability to access www.ports.ubuntu.com" - echo -n "checking $nodename 's ability to access www.ports.ubuntu.com ..........." - if ping -c 3 www.ports.ubuntu.com > /dev/null;then - echo "[OK]" - else - echo "[Failed]" - echo "please make your $nodename have ability to access www.ports.ubuntu.com" - exit 1 - fi - - cp /etc/apt/sources.list /etc/apt/sources.list.bak - sed -i "/deb http:\\/\\/ports.ubuntu.com\\/ubuntu-ports\\/ trusty main/d" /etc/apt/sources.list - sed -i "/deb http:\\/\\/ports.ubuntu.com\\/ubuntu-ports\\/ trusty-updates main/d" /etc/apt/sources.list - sed -i "/deb http:\\/\\/ports.ubuntu.com\\/ubuntu-ports\\/ trusty universe/d" /etc/apt/sources.list - sed -i "/deb http:\\/\\/ports.ubuntu.com\\/ubuntu-ports\\/ trusty-updates universe/d" /etc/apt/sources.list - - echo "deb http://ports.ubuntu.com/ubuntu-ports/ trusty main -deb http://ports.ubuntu.com/ubuntu-ports/ trusty-updates main -deb http://ports.ubuntu.com/ubuntu-ports/ trusty universe -deb http://ports.ubuntu.com/ubuntu-ports/ trusty-updates universe" >> /etc/apt/sources.list - - apt-get clean all - sleep 1 - apt-get update - fi - - #rpm -Uvh --force libibverbs-devel*.rpm - #perl -x mlnxofedinstall --without-32bit --force - - if [ -f /etc/os-release ] && - cat /etc/os-release|grep NAME|grep Ubuntu>/dev/null && - uname -m |grep ppc64 >/dev/null - then - echo "perl -x mlnxofedinstall --without-fw-update $mlnxofed_options" - { - unset ARCH - perl -x mlnxofedinstall --without-fw-update $mlnxofed_options - } - sleep 1 - service openibd restart - else - echo "perl -x mlnxofedinstall --without-fw-update $mlnxofed_options" - perl -x mlnxofedinstall --without-fw-update $mlnxofed_options - fi - rm -Rf /tmp/ofed - #force openibd load all modules in need, restart again - restartservice openibd - fi - - if [[ $NODESETSTATE == "genimage" ]]; then - # Being called from .postinstall script - # Assume we are on the same machine - if [[ $OS == sles* ]] || [[ $OS == suse* ]] || [[ -f /etc/SuSE-release ]]; then - #mkdir $installroot/tmp/ofed_install - #cp -r $OFED_DIR/ $installroot/tmp/ofed_install/ - mkdir -p $installroot/tmp/ofed_install/ofed - ( cd "$OFED_DIR" && tar cf - . ) | ( cd "$installroot/tmp/ofed_install/ofed" && tar xf - ) - #mount -t devtmpfs /dev $installroot/dev/ - #mount -t sysfs /sys $installroot/sys - #mount -t proc /proc $installroot/proc - mount --bind /dev $installroot/dev/ - mount --bind /sys $installroot/sys - mount --bind /proc $installroot/proc - chroot $installroot rpm -e --noscripts --allmatches mlnx-ofa_kernel-kmp-default 2>/dev/null - chroot $installroot rpm -e --nodeps --allmatches libibverbs 2>/dev/null - #chroot $installroot perl -x /tmp/ofed_install/ofed/mlnxofedinstall --without-32bit --force - chroot $installroot perl -x /tmp/ofed_install/ofed/mlnxofedinstall $mlnxofed_options - rm -rf $installroot/tmp/ofed_install - umount $installroot/dev/ - umount $installroot/sys - umount $installroot/proc - elif [ -f /etc/os-release ] && - cat /etc/os-release |grep NAME|grep Ubuntu>/dev/null; then - - #mkdir $installroot/tmp/ofed_install - #cp -r $OFED_DIR/ $installroot/tmp/ofed_install/ - mkdir -p $installroot/tmp/ofed_install/ofed - ( cd "$OFED_DIR" && tar cf - . ) | ( cd "$installroot/tmp/ofed_install/ofed" && tar xf - ) - - nodename=`hostname` - echo "$nodename 's operating system is Ubuntu." - echo "If you want to install Mellanox_OFED in $nodename, $nodename must have ability to access public network." - echo -n "checking $nodename 's ability to access public network..........." - if ping -c 3 www.ports.ubuntu.com > /dev/null;then - echo "[OK]" - else - echo "[Failed]" - echo "please make your $nodename have ability to access public network" - exit 1 - fi - - sourceslist="$installroot/etc/apt/sources.list" - cp $sourceslist $sourceslist.bak - - sed -i "/deb http:\\/\\/ports.ubuntu.com\\/ubuntu-ports\\/ trusty main/d" $sourceslist - sed -i "/deb http:\\/\\/ports.ubuntu.com\\/ubuntu-ports\\/ trusty-updates main/d" $sourceslist - sed -i "/deb http:\\/\\/ports.ubuntu.com\\/ubuntu-ports\\/ trusty universe/d" $sourceslist - sed -i "/deb http:\\/\\/ports.ubuntu.com\\/ubuntu-ports\\/ trusty-updates universe/d" $sourceslist - - echo "deb http://ports.ubuntu.com/ubuntu-ports/ trusty main -deb http://ports.ubuntu.com/ubuntu-ports/ trusty-updates main -deb http://ports.ubuntu.com/ubuntu-ports/ trusty universe -deb http://ports.ubuntu.com/ubuntu-ports/ trusty-updates universe" >> $sourceslist - - chroot $installroot apt-get clean all - sleep 1 - chroot $installroot apt-get update - mount --bind /dev $installroot/dev/ - mount --bind /proc $installroot/proc/ - mount --bind /sys $installroot/sys/ - - mv "${installroot}/bin/uname" "${installroot}/bin/uname.nouse" -# cat <<-EOF >"${installroot}/bin/uname" -# #!/bin/sh -# [ "\$1" = "-r" ] && cd /lib/modules && for d in *; do :; done && echo \$d -# [ "\$1" = "-m" ] && if [ -d "/proc/powerpc" ];then echo ppc64le;else echo x86_64;fi -# [ "\$1" = "-s" ] && echo Linux -# exit 0 -# EOF - - cat <<-EOF >"${installroot}/bin/uname" + mv "$1/bin/uname" "$1/bin/uname.save" + cat <<-EOF >"$1/bin/uname" #!/bin/sh case "\$1" in "-m") - ARCH="\$(dpkg --print-architecture || rpm -q kernel-\$("\$0" -r) --qf '%{arch}')" + ARCH="\$(dpkg --print-architecture 2>/dev/null || rpm -q kernel-\$("\$0" -r) --qf '%{arch}' 2>/dev/null)" case "\$ARCH" in - "amd64") + "amd64") ARCH="x86_64" ;; "ppc64el") - ARCH="ppc64le" - ;; + ARCH="ppc64le" + ;; esac - echo "\$ARCH" + echo "\$ARCH" ;; - "-r") - cd /lib/modules && for d in * ; do : ; done && echo \$d + "-r") + if [ -n "\$KERNELVERSION" ]; then + echo \$KERNELVERSION + else + for d in \$(ls /lib/modules | sort -V) + do + rpm -q kernel-\$d >/dev/null 2>&1 + if [ "\$?" == "0" ] ; then + echo \$d + break + fi + done + fi ;; "-s"|"") - echo "Linux" + echo "Linux" ;; esac exit 0 EOF -# head -n 999 "${installroot}/bin/uname" - chmod 0755 "${installroot}/bin/uname" + chmod 0755 "$1/bin/uname" + AFTER_UNAME_R="$($1/bin/uname -r)" + AFTER_UNAME_M="$($1/bin/uname -m)" + echo "After hack_uname(), -r=>'${AFTER_UNAME_R}', -m=>'${AFTER_UNAME_M}'" + AFTER_UNAME_R_NEW="$(chroot $1 /bin/uname -r)" + AFTER_UNAME_M_NEW="$(chroot $1 /bin/uname -m)" + echo "After hack_uname(), chroot -r=>'${AFTER_UNAME_R_NEW}' -m=>'${AFTER_UNAME_M_NEW}'" +} - chroot $installroot sh -c 'apt-get install -y linux-headers-$(uname -r)' - - echo "perl -x /tmp/ofed_install/ofed/mlnxofedinstall --without-fw-update $mlnxofed_options" - chroot $installroot perl -x /tmp/ofed_install/ofed/mlnxofedinstall --without-fw-update $mlnxofed_options - mv "${installroot}/bin/uname.nouse" "${installroot}/bin/uname" - - rm -rf $installroot/tmp/ofed_install - umount $installroot/dev/ - umount $installroot/proc/ - umount $installroot/sys/ - - else - #mkdir $installroot/tmp/ofed_install - #cp -r $OFED_DIR/ $installroot/tmp/ofed_install/ - mkdir -p $installroot/tmp/ofed_install/ofed - ( cd "$OFED_DIR" && tar cf - . ) | ( cd "$installroot/tmp/ofed_install/ofed" && tar xf - ) - chroot $installroot rpm -e --nodeps --allmatches libibverbs 2>/dev/null - #chroot $installroot perl -x /tmp/ofed_install/ofed/mlnxofedinstall --without-32bit --force - chroot $installroot perl -x /tmp/ofed_install/ofed/mlnxofedinstall --without-fw-update $mlnxofed_options - rm -rf $installroot/tmp/ofed_install +function cleanup() +{ + local -i i=0 + local -i max_retry=99 + + if [ "$NODESETSTATE" != "genimage" ]; then + # Clean up the uname hacking + if [ -f "/bin/uname.save" ]; then + mv -f "/bin/uname.save" "/bin/uname" fi + if mount | grep -q "/tmp/ofed/mountpoint"; then + while ! umount "/tmp/ofed/mountpoint" + do + (( ++i > max_retry )) && echo "Umount /tmp/ofed/mountpoint failed" >&2 && break + sleep 1 + done + fi + if [ -d "/tmp/ofed" ]; then + rm -rf -- /tmp/ofed + fi + else + # Clean up the uname hacking + if [ -f "$IMGROOTPATH/bin/uname.save" ]; then + mv -f "$IMGROOTPATH/bin/uname.save" "$IMGROOTPATH/bin/uname" + fi + # Clean up the ofed iso + tmp_imgpath=$IMGROOTPATH + while (echo $tmp_imgpath | grep "/$") + do + tmp_imgpath=${tmp_imgpath%/*} + done + if mount | grep -q "$tmp_imgpath/tmp/ofed/mountpoint"; then + while ! umount "$IMGROOTPATH/tmp/ofed/mountpoint" + do + (( ++i > max_retry )) && echo "Umount $IMGROOTPATH/tmp/ofed/mountpoint failed" >&2 && break + sleep 1 + done + fi + if [ -d "$IMGROOTPATH/tmp/ofed" ]; then + rm -rf -- "$IMGROOTPATH/tmp/ofed" + fi + + i=0 + if mount | grep -q "$IMGROOTPATH/sys"; then + while ! umount "$IMGROOTPATH/sys" + do + (( ++i > max_retry )) && echo "Umount $IMGROOTPATH/sys failed" >&2 && break + sleep 1 + done + fi + i=0 + if mount | grep -q "$IMGROOTPATH/proc"; then + while ! umount "$IMGROOTPATH/proc" + do + (( ++i > max_retry )) && echo "Umount $IMGROOTPATH/proc failed" >&2 && break + sleep 1 + done + fi + i=0 + if mount | grep -q "$IMGROOTPATH/dev"; then + while ! umount "$IMGROOTPATH/dev" + do + (( ++i > max_retry )) && echo "Umount $IMGROOTPATH/dev failed" >&2 && break + sleep 1 + done + fi + fi +} +trap 'cleanup' 0 + + +if [ "$OS" = "Linux" ]; then + if [ "$NODESETSTATE" = "install" -o "$NODESETSTATE" = "boot" ]; then + + #if the host is ubuntn, need to do some network check and configuration + if grep -q Ubuntu /etc/os-release 2>/dev/null + then + echo "$HOSTNAME 's operating system is Ubuntu." + echo "If you want to install Mellanox_OFED in $HOSTNAME, $HOSTNAME must have ability to access ports.ubuntu.com" + echo -n "checking $HOSTNAME 's ability to access ports.ubuntu.com..........." + if ping -c 3 ports.ubuntu.com > /dev/null;then + echo "[OK]" + else + echo "[Failed]" >&2 + echo "[Error] please make your $HOSTNAME has ability to access ports.ubuntu.com" >&2 + exit 1 + fi + + + echo "get distro name form /etc/lsb-release ......" + source /etc/lsb-release >/dev/null 2>&1 + if [ -z "$DISTRIB_CODENAME" ]; then + echo "[Error] can't get DISTRIB_CODENAME " >&2 + exit 1 + fi + echo "DISTRIB_CODENAME=$DISTRIB_CODENAME ...[OK]" + + cp /etc/apt/sources.list /etc/apt/sources.list.bak + sed -i "/deb http:\\/\\/ports.ubuntu.com\\/ubuntu-ports\\/ $DISTRIB_CODENAME main/d" /etc/apt/sources.list + sed -i "/deb http:\\/\\/ports.ubuntu.com\\/ubuntu-ports\\/ $DISTRIB_CODENAME-updates main/d" /etc/apt/sources.list + sed -i "/deb http:\\/\\/ports.ubuntu.com\\/ubuntu-ports\\/ $DISTRIB_CODENAME universe/d" /etc/apt/sources.list + sed -i "/deb http:\\/\\/ports.ubuntu.com\\/ubuntu-ports\\/ $DISTRIB_CODENAME-updates universe/d" /etc/apt/sources.list + + cat <<-EOF >>/etc/apt/sources.list +deb http://ports.ubuntu.com/ubuntu-ports/ $DISTRIB_CODENAME main +deb http://ports.ubuntu.com/ubuntu-ports/ $DISTRIB_CODENAME-updates main +deb http://ports.ubuntu.com/ubuntu-ports/ $DISTRIB_CODENAME universe +deb http://ports.ubuntu.com/ubuntu-ports/ $DISTRIB_CODENAME-updates universe +EOF + + apt-get clean all + sleep 1 + apt-get update + fi + + # Being run from a stateful install postscript + # Copy ISO directly from the xCAT management node and install + rm -rf -- /tmp/ofed + mkdir -p /tmp/ofed/mountpoint + if [ "$?" != "0" ] ;then + echo "[Error] We are in trouble to mkdir /tmp/ofed/mountpoint, please check your node" >&2 + exit 1 + fi + + cd /tmp/ofed/ + echo "Downloading Mellanox OFED file $OFED_NAME form http://$MASTER/$OFED_DIR .........." + wget -l inf -N --waitretry=10 --random-wait --retry-connrefused -t 10 -T 60 -nH --no-parent "http://$MASTER/$OFED_DIR/$OFED_NAME" 2> /tmp/wget.log + if [ "$?" != "0" ]; then + echo "[Error] Downloading Mellanox OFED file $OFED_NAME failed" >&2 + exit 1 + fi + if [ ! -f "/tmp/ofed/$OFED_NAME" ]; then + echo "[Failed]" >&2 + exit 1 + fi + echo "[OK]" + + echo "Mounting Mellanox OFED file $OFED_NAME ........." + mount -o loop "/tmp/ofed/$OFED_NAME" /tmp/ofed/mountpoint + if [ ! -f "/tmp/ofed/mountpoint/mlnxofedinstall" -o ! -x "/tmp/ofed/mountpoint/mlnxofedinstall" ]; then + echo "[Failed]" >&2 + exit 1 + fi + echo "[OK]" + + if [ "$NODESETSTATE" = "install" ]; then + hack_uname + fi + + echo "Start Mellanox OFED installation ........." + env -i "PATH=${PATH}" /tmp/ofed/mountpoint/mlnxofedinstall "${MLNXOFED_OPTS[@]}" + + #force openibd load all modules in need, restart again + if [ "$NODESETSTATE" = "boot" ]; then + sleep 1 + service openibd restart + if [ "$?" != "0" ]; then + echo "[Error] service openibd restart failed." + exit 1 + fi + fi + fi + + if [[ "$NODESETSTATE" == "genimage" ]]; then + rm -rf -- "$IMGROOTPATH/tmp/ofed" + mkdir -p "$IMGROOTPATH/tmp/ofed/mountpoint" + if [ "$?" != "0" ] ;then + echo "[Error] We are in trouble to mkdir $IMGROOTPATH/tmp/ofed/mountpoint, please check your node" >&2 + exit 1 + fi + + echo "Mounting Mellanox OFED file $OFED_DIR/$OFED_NAME ........." + mount -o loop "$OFED_DIR/$OFED_NAME" "$IMGROOTPATH/tmp/ofed/mountpoint" + if [ ! -f "$IMGROOTPATH/tmp/ofed/mountpoint/mlnxofedinstall" -o ! -x "$IMGROOTPATH/tmp/ofed/mountpoint/mlnxofedinstall" ]; then + echo "[Failed]" >&2 + exit 1 + fi + echo "[OK]" + + echo "Start Mellanox OFED installation ........." + + mount --bind /dev "$IMGROOTPATH/dev/" + mount --bind /proc "$IMGROOTPATH/proc/" + mount --bind /sys "$IMGROOTPATH/sys/" + + hack_uname "${IMGROOTPATH}" + + # Being called from .postinstall script + # Assume we are on the same machine + if [ -f /etc/SuSE-release ]; then + chroot "$IMGROOTPATH" rpm -e --noscripts --allmatches mlnx-ofa_kernel-kmp-default 2>/dev/null + chroot "$IMGROOTPATH" rpm -e --nodeps --allmatches libibverbs 2>/dev/null + elif grep -q Ubuntu /etc/os-release 2>/dev/null; then + echo "$HOSTNAME 's operating system is Ubuntu." + echo "If you want to install Mellanox_OFED in $HOSTNAME, $HOSTNAME must have ability to access ports.ubuntu.com" + echo -n "checking $HOSTNAME 's ability to access ports.ubuntu.com..........." + if ping -c 3 ports.ubuntu.com > /dev/null; then + echo "[OK]" + else + echo "[Failed]" >&2 + echo "please make your $HOSTNAME has ability to access ports.ubuntu.com" >&2 + exit 1 + fi + + sourceslist="$IMGROOTPATH/etc/apt/sources.list" + cp "$sourceslist" "${sourceslist}.bak" + + echo "get distro name form $IMGROOTPATH/etc/lsb-release ......" + source $IMGROOTPATH/etc/lsb-release >/dev/null 2>&1 + if [ -z "$DISTRIB_CODENAME" ]; then + echo "[Error] can't get DISTRIB_CODENAME " >&2 + exit 1 + fi + echo "DISTRIB_CODENAME=$DISTRIB_CODENAME ...[OK]" + + sed -i "/deb http:\\/\\/ports.ubuntu.com\\/ubuntu-ports\\/ $DISTRIB_CODENAME main/d" $sourceslist + sed -i "/deb http:\\/\\/ports.ubuntu.com\\/ubuntu-ports\\/ $DISTRIB_CODENAME-updates main/d" $sourceslist + sed -i "/deb http:\\/\\/ports.ubuntu.com\\/ubuntu-ports\\/ $DISTRIB_CODENAME universe/d" $sourceslist + sed -i "/deb http:\\/\\/ports.ubuntu.com\\/ubuntu-ports\\/ $DISTRIB_CODENAME-updates universe/d" $sourceslist + + cat <<-EOF >>"$sourceslist" +deb http://ports.ubuntu.com/ubuntu-ports/ $DISTRIB_CODENAME main +deb http://ports.ubuntu.com/ubuntu-ports/ $DISTRIB_CODENAME-updates main +deb http://ports.ubuntu.com/ubuntu-ports/ $DISTRIB_CODENAME universe +deb http://ports.ubuntu.com/ubuntu-ports/ $DISTRIB_CODENAME-updates universe +EOF + + chroot "$IMGROOTPATH" apt-get clean all + sleep 1 + chroot "$IMGROOTPATH" apt-get update + + chroot "$IMGROOTPATH" sh -c 'apt-get install -y linux-headers-$(uname -r)' + else #for rhels + chroot "$IMGROOTPATH" rpm -e --nodeps --allmatches libibverbs 2>/dev/null + fi + chroot "$IMGROOTPATH" env -i "PATH=${PATH}" /tmp/ofed/mountpoint/mlnxofedinstall "${MLNXOFED_OPTS[@]}" fi fi - diff --git a/xCAT-server/share/xcat/ib/scripts/Mellanox/mlnxofed_ib_install.v2 b/xCAT-server/share/xcat/ib/scripts/Mellanox/mlnxofed_ib_install.v2 deleted file mode 100755 index e16445aac..000000000 --- a/xCAT-server/share/xcat/ib/scripts/Mellanox/mlnxofed_ib_install.v2 +++ /dev/null @@ -1,418 +0,0 @@ -#!/bin/bash -# -# This is the second version of Mellanox IB driver installation sample script -# This is also the version we recommend to use right now. -# What are changed in this version -# 1. The usage interface is changed, using command line arguments instead of using environment attribute -# 2. The way of downloading Mellanox OFED files. -# 3. Some structure of code -# -# For AIX: -# TBD -# For Linux: -# - For full-disk installs: -# - Copy Mellanox OFED ISO to node -# - Install IB rpms -# - For diskless images: -# - Copy the packages to the images. -# - Install IB rpms -# -#usage: -# -# Copy the xCAT mlnxofed_ib_install.v2 script file to postscripts directory and rename to mlnxofed_ib_install: -# cp /opt/xcat/share/xcat/ib/scripts/Mellanox/mlnxofed_ib_install.v2 /install/postscripts/mlnxofed_ib_install -# -# Prepare Mellanox OFED ISO file and save it into any subdirectory under /install. -# -# 1. install the ofed driver for diskfull node -# [NOTE] step 1.1-1.2 are only needed by redhat and sles -# 1.1 copy the pkglist to the custom directory: -# cp /opt/xcat/share/xcat/install//compute...pkglist /install/custom/install//compute...pkglist -# Edit your /install/custom/install//compute...pkglist and add: -# #INCLUDE:/opt/xcat/share/xcat/ib/netboot//ib...pkglist# -# 1.2 Make the related osimage use the customized pkglist. -# chdef -t osimage -o --install-compute pkglist=/install/custom/install//compute...pkglist -# 1.3 set mlnxofed_ib_install as postbootscripts for the target node. assign necessary attribute for mlnxofed_ib_install at same time. -# chdef -p postbootscripts="mlnxofed_ib_install -p /install//" -# [NOTE] The default options input into Mellanox are '--without-32bit --without-fw-update --force' -# you can appoint the options by yourslef with '-m' option of mlnxofed_ib_install -# In order to distinguish which options are tranfered to Mellanox and which options are belong to mlnxofed_ib_install, any options wanted to transfered to Mellanox must follow behind -m and end with "-end-", for example: -# chdef -p postbootscripts="mlnxofed_ib_install -p /install// -m --without-32bit --add-kernel-support --force -end-" -# 1.4 do the diskfull installation -# nodeset osimage= ...... -# -# 2. install the ofed driver for diskless images: -# [NOTE] step 2.1 is only needed by redhat and sles -# 2.1 copy the pkglist to the custom directory: -# cp /opt/xcat/share/xcat/netboot//compute...pkglist /install/custom/netboot//compute...pkglist -# Edit your /install/custom/netboot//.pkglist and add: -# #INCLUDE:/opt/xcat/share/xcat/ib/netboot//ib...pkglist# -# 2.2 Add to postinstall scripts -# Edit your /install/custom/netboot//.postinstall and add: -# /install/postscripts/mlnxofed_ib_install -p /install// -n genimage -i $1 -# 2.3 Make sure the related osimage use the customized pkglist and customized compute.postinsall -# lsdef -t osimage -o --netboot-compute -# if not, change it: -# chdef -t osimage -o --netboot-compute pkglist=/install/custom/netboot//compute...pkglist postinstall=/install/custom/netboot//.postinstall -# 2.4 run genimage -# genimage --netboot-compute -# - -#set -x - -OS="$(uname)" -if [ "$OS" = "Linux" ]; then - str_dir_name="${0%/*}" - . "$str_dir_name/xcatlib.sh" 2>/dev/null -fi - -#-------------------------------------------------------- -declare -a MLNXOFED_OPTS - -function usage() { - echo "Usage: mlnxofed_ib_install [-attribute]" - echo " attribute include:" - echo " -h: print this help message" - echo " -p: the path where OFED file is saved. this is necessary attribute" - echo " -m: the options inputted into mlnxofedinstall script, defualt value are --without-32bit --without-fw-update --force" - echo " -i: the image root path. this is necessary attribute in diskless scenario" - echo " -n: nodeset status, the value are one of install, boot or genimage" -} - -while [ "$#" -gt "0" ] -do - case "$1" in - "-p") - shift - OFED_PATH="$1" - ;; - "-m") - shift - while [ "$#" -gt "0" -a "-end-" != "$1" ] - do - MLNXOFED_OPTS=("${MLNXOFED_OPTS[@]}" "$1") - shift - done - ;; - "-i") - shift - IMGROOTPATH="$1" - ;; - "-n") - shift - NODESETSTATE="$1" - ;; - "-h") - usage - exit 0 - ;; - *) - echo "unsupport attribute $1" - exit 0 - ;; - esac - shift -done - -if [ -z "$OFED_PATH" ]; then - echo "[Error] Without Mellanox OFED file path, please assign correct path" >&2 - exit 1 -fi - -if [ "$NODESETSTATE" = "genimage" -a ! -d "$IMGROOTPATH" ]; then - echo "[Error] this is for diskless installation, please assign correct diskless image root path" >&2 - exit 1 -fi - -[ "${#MLNXOFED_OPTS[@]}" = 0 ] && MLNXOFED_OPTS=(--without-32bit --without-fw-update --force) - -OFED_DIR=${OFED_PATH%/*} -OFED_NAME=${OFED_PATH##*/} - -echo "Mellanox OFED file path is $OFED_DIR" -echo "Mellanox OFED file is $OFED_NAME" -echo "Mellanox OFED options are ${MLNXOFED_OPTS[@]}" -echo "image root path is $IMGROOTPATH" -echo "NODESETSTATE is $NODESETSTATE" - -function hack_uname() -{ - BEFORE_UNAME_R="$($1/bin/uname -r)" - BEFORE_UNAME_M="$($1/bin/uname -m)" - echo "Before hack_uname(), -r=>'${BEFORE_UNAME_R}' -m=>'${BEFORE_UNAME_M}'" - mv "$1/bin/uname" "$1/bin/uname.save" - cat <<-EOF >"$1/bin/uname" - #!/bin/sh - case "\$1" in - "-m") - ARCH="\$(dpkg --print-architecture 2>/dev/null || rpm -q kernel-\$("\$0" -r) --qf '%{arch}' 2>/dev/null)" - case "\$ARCH" in - "amd64") - ARCH="x86_64" - ;; - "ppc64el") - ARCH="ppc64le" - ;; - esac - echo "\$ARCH" - ;; - "-r") - if [ -n "\$KERNELVERSION" ]; then - echo \$KERNELVERSION - else - for d in \$(ls /lib/modules | sort -V) ; do : ; done && echo \$d - fi - ;; - "-s"|"") - echo "Linux" - ;; - esac - exit 0 - EOF - - chmod 0755 "$1/bin/uname" - AFTER_UNAME_R="$($1/bin/uname -r)" - AFTER_UNAME_M="$($1/bin/uname -m)" - echo "After hack_uname(), -r=>'${AFTER_UNAME_R}', -m=>'${AFTER_UNAME_M}'" -} - -function cleanup() -{ - local -i i=0 - local -i max_retry=99 - - if [ "$NODESETSTATE" != "genimage" ]; then - # Clean up the uname hacking - if [ -f "/bin/uname.save" ]; then - mv -f "/bin/uname.save" "/bin/uname" - fi - - if mount | grep -q "/tmp/ofed/mountpoint"; then - while ! umount "/tmp/ofed/mountpoint" - do - (( ++i > max_retry )) && echo "Umount /tmp/ofed/mountpoint failed" >&2 && break - sleep 1 - done - fi - if [ -d "/tmp/ofed" ]; then - rm -rf -- /tmp/ofed - fi - else - # Clean up the uname hacking - if [ -f "$IMGROOTPATH/bin/uname.save" ]; then - mv -f "$IMGROOTPATH/bin/uname.save" "$IMGROOTPATH/bin/uname" - fi - - # Clean up the ofed iso - tmp_imgpath=$IMGROOTPATH - while (echo $tmp_imgpath | grep "/$") - do - tmp_imgpath=${tmp_imgpath%/*} - done - if mount | grep -q "$tmp_imgpath/tmp/ofed/mountpoint"; then - while ! umount "$IMGROOTPATH/tmp/ofed/mountpoint" - do - (( ++i > max_retry )) && echo "Umount $IMGROOTPATH/tmp/ofed/mountpoint failed" >&2 && break - sleep 1 - done - fi - if [ -d "$IMGROOTPATH/tmp/ofed" ]; then - rm -rf -- "$IMGROOTPATH/tmp/ofed" - fi - - i=0 - if mount | grep -q "$IMGROOTPATH/sys"; then - while ! umount "$IMGROOTPATH/sys" - do - (( ++i > max_retry )) && echo "Umount $IMGROOTPATH/sys failed" >&2 && break - sleep 1 - done - fi - i=0 - if mount | grep -q "$IMGROOTPATH/proc"; then - while ! umount "$IMGROOTPATH/proc" - do - (( ++i > max_retry )) && echo "Umount $IMGROOTPATH/proc failed" >&2 && break - sleep 1 - done - fi - i=0 - if mount | grep -q "$IMGROOTPATH/dev"; then - while ! umount "$IMGROOTPATH/dev" - do - (( ++i > max_retry )) && echo "Umount $IMGROOTPATH/dev failed" >&2 && break - sleep 1 - done - fi - fi -} -trap 'cleanup' 0 - - -if [ "$OS" = "Linux" ]; then - if [ "$NODESETSTATE" = "install" -o "$NODESETSTATE" = "boot" ]; then - - #if the host is ubuntn, need to do some network check and configuration - if grep -q Ubuntu /etc/os-release 2>/dev/null - then - echo "$HOSTNAME 's operating system is Ubuntu." - echo "If you want to install Mellanox_OFED in $HOSTNAME, $HOSTNAME must have ability to access ports.ubuntu.com" - echo -n "checking $HOSTNAME 's ability to access ports.ubuntu.com..........." - if ping -c 3 ports.ubuntu.com > /dev/null;then - echo "[OK]" - else - echo "[Failed]" >&2 - echo "[Error] please make your $HOSTNAME has ability to access ports.ubuntu.com" >&2 - exit 1 - fi - - - echo "get distro name form /etc/lsb-release ......" - source /etc/lsb-release >/dev/null 2>&1 - if [ -z "$DISTRIB_CODENAME" ]; then - echo "[Error] can't get DISTRIB_CODENAME " >&2 - exit 1 - fi - echo "DISTRIB_CODENAME=$DISTRIB_CODENAME ...[OK]" - - cp /etc/apt/sources.list /etc/apt/sources.list.bak - sed -i "/deb http:\\/\\/ports.ubuntu.com\\/ubuntu-ports\\/ $DISTRIB_CODENAME main/d" /etc/apt/sources.list - sed -i "/deb http:\\/\\/ports.ubuntu.com\\/ubuntu-ports\\/ $DISTRIB_CODENAME-updates main/d" /etc/apt/sources.list - sed -i "/deb http:\\/\\/ports.ubuntu.com\\/ubuntu-ports\\/ $DISTRIB_CODENAME universe/d" /etc/apt/sources.list - sed -i "/deb http:\\/\\/ports.ubuntu.com\\/ubuntu-ports\\/ $DISTRIB_CODENAME-updates universe/d" /etc/apt/sources.list - - cat <<-EOF >>/etc/apt/sources.list -deb http://ports.ubuntu.com/ubuntu-ports/ $DISTRIB_CODENAME main -deb http://ports.ubuntu.com/ubuntu-ports/ $DISTRIB_CODENAME-updates main -deb http://ports.ubuntu.com/ubuntu-ports/ $DISTRIB_CODENAME universe -deb http://ports.ubuntu.com/ubuntu-ports/ $DISTRIB_CODENAME-updates universe -EOF - - apt-get clean all - sleep 1 - apt-get update - fi - - # Being run from a stateful install postscript - # Copy ISO directly from the xCAT management node and install - rm -rf -- /tmp/ofed - mkdir -p /tmp/ofed/mountpoint - if [ "$?" != "0" ] ;then - echo "[Error] We are in trouble to mkdir /tmp/ofed/mountpoint, please check your node" >&2 - exit 1 - fi - - cd /tmp/ofed/ - echo "Downloading Mellanox OFED file $OFED_NAME form http://$MASTER/$OFED_DIR .........." - wget -l inf -N --waitretry=10 --random-wait --retry-connrefused -t 10 -T 60 -nH --no-parent "http://$MASTER/$OFED_DIR/$OFED_NAME" 2> /tmp/wget.log - if [ "$?" != "0" ]; then - echo "[Error] Downloading Mellanox OFED file $OFED_NAME failed" >&2 - exit 1 - fi - if [ ! -f "/tmp/ofed/$OFED_NAME" ]; then - echo "[Failed]" >&2 - exit 1 - fi - echo "[OK]" - - echo "Mounting Mellanox OFED file $OFED_NAME ........." - mount -o loop "/tmp/ofed/$OFED_NAME" /tmp/ofed/mountpoint - if [ ! -f "/tmp/ofed/mountpoint/mlnxofedinstall" -o ! -x "/tmp/ofed/mountpoint/mlnxofedinstall" ]; then - echo "[Failed]" >&2 - exit 1 - fi - echo "[OK]" - - if [ "$NODESETSTATE" = "install" ]; then - hack_uname - fi - - echo "Start Mellanox OFED installation ........." - env -i "PATH=${PATH}" /tmp/ofed/mountpoint/mlnxofedinstall "${MLNXOFED_OPTS[@]}" - - #force openibd load all modules in need, restart again - if [ "$NODESETSTATE" = "boot" ]; then - sleep 1 - service openibd restart - if [ "$?" != "0" ]; then - echo "[Error] service openibd restart failed." - exit 1 - fi - fi - fi - - if [[ "$NODESETSTATE" == "genimage" ]]; then - rm -rf -- "$IMGROOTPATH/tmp/ofed" - mkdir -p "$IMGROOTPATH/tmp/ofed/mountpoint" - if [ "$?" != "0" ] ;then - echo "[Error] We are in trouble to mkdir $IMGROOTPATH/tmp/ofed/mountpoint, please check your node" >&2 - exit 1 - fi - - echo "Mounting Mellanox OFED file $OFED_DIR/$OFED_NAME ........." - mount -o loop "$OFED_DIR/$OFED_NAME" "$IMGROOTPATH/tmp/ofed/mountpoint" - if [ ! -f "$IMGROOTPATH/tmp/ofed/mountpoint/mlnxofedinstall" -o ! -x "$IMGROOTPATH/tmp/ofed/mountpoint/mlnxofedinstall" ]; then - echo "[Failed]" >&2 - exit 1 - fi - echo "[OK]" - - echo "Start Mellanox OFED installation ........." - - mount --bind /dev "$IMGROOTPATH/dev/" - mount --bind /proc "$IMGROOTPATH/proc/" - mount --bind /sys "$IMGROOTPATH/sys/" - - hack_uname "${IMGROOTPATH}" - - # Being called from .postinstall script - # Assume we are on the same machine - if [ -f /etc/SuSE-release ]; then - chroot "$IMGROOTPATH" rpm -e --noscripts --allmatches mlnx-ofa_kernel-kmp-default 2>/dev/null - chroot "$IMGROOTPATH" rpm -e --nodeps --allmatches libibverbs 2>/dev/null - elif grep -q Ubuntu /etc/os-release 2>/dev/null; then - echo "$HOSTNAME 's operating system is Ubuntu." - echo "If you want to install Mellanox_OFED in $HOSTNAME, $HOSTNAME must have ability to access ports.ubuntu.com" - echo -n "checking $HOSTNAME 's ability to access ports.ubuntu.com..........." - if ping -c 3 ports.ubuntu.com > /dev/null; then - echo "[OK]" - else - echo "[Failed]" >&2 - echo "please make your $HOSTNAME has ability to access ports.ubuntu.com" >&2 - exit 1 - fi - - sourceslist="$IMGROOTPATH/etc/apt/sources.list" - cp "$sourceslist" "${sourceslist}.bak" - - echo "get distro name form $IMGROOTPATH/etc/lsb-release ......" - source $IMGROOTPATH/etc/lsb-release >/dev/null 2>&1 - if [ -z "$DISTRIB_CODENAME" ]; then - echo "[Error] can't get DISTRIB_CODENAME " >&2 - exit 1 - fi - echo "DISTRIB_CODENAME=$DISTRIB_CODENAME ...[OK]" - - sed -i "/deb http:\\/\\/ports.ubuntu.com\\/ubuntu-ports\\/ $DISTRIB_CODENAME main/d" $sourceslist - sed -i "/deb http:\\/\\/ports.ubuntu.com\\/ubuntu-ports\\/ $DISTRIB_CODENAME-updates main/d" $sourceslist - sed -i "/deb http:\\/\\/ports.ubuntu.com\\/ubuntu-ports\\/ $DISTRIB_CODENAME universe/d" $sourceslist - sed -i "/deb http:\\/\\/ports.ubuntu.com\\/ubuntu-ports\\/ $DISTRIB_CODENAME-updates universe/d" $sourceslist - - cat <<-EOF >>"$sourceslist" -deb http://ports.ubuntu.com/ubuntu-ports/ $DISTRIB_CODENAME main -deb http://ports.ubuntu.com/ubuntu-ports/ $DISTRIB_CODENAME-updates main -deb http://ports.ubuntu.com/ubuntu-ports/ $DISTRIB_CODENAME universe -deb http://ports.ubuntu.com/ubuntu-ports/ $DISTRIB_CODENAME-updates universe -EOF - - chroot "$IMGROOTPATH" apt-get clean all - sleep 1 - chroot "$IMGROOTPATH" apt-get update - - chroot "$IMGROOTPATH" sh -c 'apt-get install -y linux-headers-$(uname -r)' - else #for rhels - chroot "$IMGROOTPATH" rpm -e --nodeps --allmatches libibverbs 2>/dev/null - fi - chroot "$IMGROOTPATH" env -i "PATH=${PATH}" /tmp/ofed/mountpoint/mlnxofedinstall "${MLNXOFED_OPTS[@]}" - fi -fi diff --git a/xCAT-server/share/xcat/install/centos/compute.centos8.pkglist b/xCAT-server/share/xcat/install/centos/compute.centos8.pkglist deleted file mode 120000 index ccb1fe4ef..000000000 --- a/xCAT-server/share/xcat/install/centos/compute.centos8.pkglist +++ /dev/null @@ -1 +0,0 @@ -../rh/compute.rhels8.pkglist \ No newline at end of file diff --git a/xCAT-server/share/xcat/install/centos/compute.centos8.pkglist b/xCAT-server/share/xcat/install/centos/compute.centos8.pkglist new file mode 100644 index 000000000..0feb58550 --- /dev/null +++ b/xCAT-server/share/xcat/install/centos/compute.centos8.pkglist @@ -0,0 +1,11 @@ +@^minimal-environment +chrony +net-tools +nfs-utils +openssh-server +rsync +util-linux +wget +python3 +tar +bzip2 diff --git a/xCAT-server/share/xcat/install/centos/compute.centos8.tmpl b/xCAT-server/share/xcat/install/centos/compute.centos8.tmpl deleted file mode 120000 index 50866c82a..000000000 --- a/xCAT-server/share/xcat/install/centos/compute.centos8.tmpl +++ /dev/null @@ -1 +0,0 @@ -../rh/compute.rhels8.tmpl \ No newline at end of file diff --git a/xCAT-server/share/xcat/install/centos/compute.centos8.tmpl b/xCAT-server/share/xcat/install/centos/compute.centos8.tmpl new file mode 100644 index 000000000..3719fd0c6 --- /dev/null +++ b/xCAT-server/share/xcat/install/centos/compute.centos8.tmpl @@ -0,0 +1,59 @@ +#version=CentOS8 +# Use text install +text +# Use network installation +%include /tmp/repos +# Keyboard layouts +keyboard --vckeymap=us --xlayouts='us' +# System language +lang en_US.UTF-8 + +# Network information +#KICKSTARTNET# +# Root password +rootpw --iscrypted #CRYPT:passwd:key=system,username=root:password# +# Not run the Setup Agent on first boot +firstboot --disable +# Do not configure the X Window System +skipx +# System services +#services --enabled="chronyd" +# System timezone +timezone #TABLE:site:key=timezone:value# --isUtc +# Partition clearing information +zerombr +clearpart --all --initlabel +#XCAT_PARTITION_START# +%include /tmp/partitionfile +#XCAT_PARTITION_END# + +# Do not configure any iptables rules +firewall --disable +selinux --disable +reboot + +%packages +#INCLUDE_DEFAULT_PKGLIST# + +%end + +%anaconda +pwpolicy root --minlen=6 --minquality=1 --notstrict --nochanges --emptyok +pwpolicy user --minlen=6 --minquality=1 --notstrict --nochanges --emptyok +pwpolicy luks --minlen=6 --minquality=1 --notstrict --nochanges --emptyok +%end +%pre +{ +echo "Running Kickstart Pre-installation script..." +#INCLUDE:#ENV:XCATROOT#/share/xcat/install/scripts/pre.rhels8# +} &>>/tmp/pre-install.log +%end +%post --interpreter=/bin/bash +mkdir -p /var/log/xcat/ +cat /tmp/pre-install.log >>/var/log/xcat/xcat.log +{ +echo "Running Kickstart Post-installation script..." +#INCLUDE:#ENV:XCATROOT#/share/xcat/install/scripts/post.xcat.ng# +#INCLUDE:#ENV:XCATROOT#/share/xcat/install/scripts/post.rhels8# +} &>>/var/log/xcat/xcat.log +%end diff --git a/xCAT-server/share/xcat/install/rh/compute.rhels8.pkglist b/xCAT-server/share/xcat/install/rh/compute.rhels8.pkglist index 3c2a86882..0feb58550 100644 --- a/xCAT-server/share/xcat/install/rh/compute.rhels8.pkglist +++ b/xCAT-server/share/xcat/install/rh/compute.rhels8.pkglist @@ -7,3 +7,5 @@ rsync util-linux wget python3 +tar +bzip2 diff --git a/xCAT-server/share/xcat/install/rh/service.rhels7.ppc64.otherpkgs.pkglist b/xCAT-server/share/xcat/install/rh/service.rhels7.ppc64.otherpkgs.pkglist index 29fefdb45..05e14fa53 100644 --- a/xCAT-server/share/xcat/install/rh/service.rhels7.ppc64.otherpkgs.pkglist +++ b/xCAT-server/share/xcat/install/rh/service.rhels7.ppc64.otherpkgs.pkglist @@ -1,4 +1,3 @@ xcat/xcat-core/xCATsn -xcat/xcat-dep/rh7/ppc64/conserver-xcat xcat/xcat-dep/rh7/ppc64/perl-Net-Telnet xcat/xcat-dep/rh7/ppc64/perl-Expect diff --git a/xCAT-server/share/xcat/install/rh/service.rhels7.ppc64le.otherpkgs.pkglist b/xCAT-server/share/xcat/install/rh/service.rhels7.ppc64le.otherpkgs.pkglist index 66c23dbd6..f987967b0 100644 --- a/xCAT-server/share/xcat/install/rh/service.rhels7.ppc64le.otherpkgs.pkglist +++ b/xCAT-server/share/xcat/install/rh/service.rhels7.ppc64le.otherpkgs.pkglist @@ -1,4 +1,3 @@ xcat/xcat-core/xCATsn -xcat/xcat-dep/rh7/ppc64le/conserver-xcat xcat/xcat-dep/rh7/ppc64le/perl-Net-Telnet xcat/xcat-dep/rh7/ppc64le/perl-Expect diff --git a/xCAT-server/share/xcat/install/rh/service.rhels7.x86_64.otherpkgs.pkglist b/xCAT-server/share/xcat/install/rh/service.rhels7.x86_64.otherpkgs.pkglist index 26339bcdb..08dec8c94 100644 --- a/xCAT-server/share/xcat/install/rh/service.rhels7.x86_64.otherpkgs.pkglist +++ b/xCAT-server/share/xcat/install/rh/service.rhels7.x86_64.otherpkgs.pkglist @@ -1,4 +1,3 @@ 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 diff --git a/xCAT-server/share/xcat/install/rh/service.rhels8.pkglist b/xCAT-server/share/xcat/install/rh/service.rhels8.pkglist index f5e1af162..1cc601f9e 100644 --- a/xCAT-server/share/xcat/install/rh/service.rhels8.pkglist +++ b/xCAT-server/share/xcat/install/rh/service.rhels8.pkglist @@ -11,3 +11,5 @@ perl-DBD-MySQL perl-DBD-Pg unixODBC python3 +tar +bzip2 diff --git a/xCAT-server/share/xcat/install/scripts/pre.pkvm3 b/xCAT-server/share/xcat/install/scripts/pre.pkvm3 index 66ae40551..30c620266 100755 --- a/xCAT-server/share/xcat/install/scripts/pre.pkvm3 +++ b/xCAT-server/share/xcat/install/scripts/pre.pkvm3 @@ -7,6 +7,64 @@ if [ "$XCATDEBUGMODE" = "2" ]; then echo 'root:cluster' | chpasswd fi +base64decode() +{ + h0="0"; h1="1"; h2="2"; h3="3"; h4="4"; h5="5"; h6="6"; h7="7"; + h8="8"; h9="9"; h10="A"; h11="B"; h12="C"; h13="D"; h14="E"; h15="F"; + + while : + do + i=0 + while [ "$i" -lt 4 ] + do + read -n 1 c || return + + case "${c}" in + "A") d=0 ;; "B") d=1 ;; "C") d=2 ;; "D") d=3 ;; + "E") d=4 ;; "F") d=5 ;; "G") d=6 ;; "H") d=7 ;; + "I") d=8 ;; "J") d=9 ;; "K") d=10 ;; "L") d=11 ;; + "M") d=12 ;; "N") d=13 ;; "O") d=14 ;; "P") d=15 ;; + "Q") d=16 ;; "R") d=17 ;; "S") d=18 ;; "T") d=19 ;; + "U") d=20 ;; "V") d=21 ;; "W") d=22 ;; "X") d=23 ;; + "Y") d=24 ;; "Z") d=25 ;; "a") d=26 ;; "b") d=27 ;; + "c") d=28 ;; "d") d=29 ;; "e") d=30 ;; "f") d=31 ;; + "g") d=32 ;; "h") d=33 ;; "i") d=34 ;; "j") d=35 ;; + "k") d=36 ;; "l") d=37 ;; "m") d=38 ;; "n") d=39 ;; + "o") d=40 ;; "p") d=41 ;; "q") d=42 ;; "r") d=43 ;; + "s") d=44 ;; "t") d=45 ;; "u") d=46 ;; "v") d=47 ;; + "w") d=48 ;; "x") d=49 ;; "y") d=50 ;; "z") d=51 ;; + "0") d=52 ;; "1") d=53 ;; "2") d=54 ;; "3") d=55 ;; + "4") d=56 ;; "5") d=57 ;; "6") d=58 ;; "7") d=59 ;; + "8") d=60 ;; "9") d=61 ;; "+") d=62 ;; "/") d=63 ;; + "=") d=0 ;; + *) continue ;; + esac + + eval "a${i}=${c}" + eval "b${i}=${d}" + + i=$(( i + 1 )) + done + + o0=$(( ((b0 << 2) | (b1 >> 4)) & 0xff )) + o1=$(( ((b1 << 4) | (b2 >> 2)) & 0xff )) + o2=$(( ((b2 << 6) | b3) & 0xff )) + + [ "${a2}" == "=" ] && + eval "printf \"\\x\${h$(( o0 / 16 ))}\${h$(( o0 % 16 + ))}\"" && + return + [ "${a3}" == "=" ] && + eval "printf \"\\x\${h$(( o0 / 16 ))}\${h$(( o0 % 16 + ))}\\x\${h$(( o1 / 16 ))}\${h$(( o1 % 16 + ))}\"" && + return + eval "printf \"\\x\${h$(( o0 / 16 ))}\${h$(( o0 % 16 + ))}\\x\${h$(( o1 / 16 ))}\${h$(( o1 % 16 + ))}\\x\${h$(( o2 / 16 ))}\${h$(( o2 % 16 ))}\"" + done +} + #find first available block device (sda or vda likely) #TODO: pick a likely non-SAN target if possible diff --git a/xCAT-server/share/xcat/install/scripts/pre.rh b/xCAT-server/share/xcat/install/scripts/pre.rh index fd84bb2b8..99eeaacee 100644 --- a/xCAT-server/share/xcat/install/scripts/pre.rh +++ b/xCAT-server/share/xcat/install/scripts/pre.rh @@ -177,11 +177,65 @@ if [ -z "$NODESTATUS" ] || [ "$NODESTATUS" != "0" -a "$NODESTATUS" != "N" -a /tmp/baz.py "installstatus installing" & fi - - /tmp/foo.py >/foo.log 2>&1 & +base64decode() +{ + h0="0"; h1="1"; h2="2"; h3="3"; h4="4"; h5="5"; h6="6"; h7="7"; + h8="8"; h9="9"; h10="A"; h11="B"; h12="C"; h13="D"; h14="E"; h15="F"; + while : + do + i=0 + while [ "$i" -lt 4 ] + do + read -n 1 c || return + + case "${c}" in + "A") d=0 ;; "B") d=1 ;; "C") d=2 ;; "D") d=3 ;; + "E") d=4 ;; "F") d=5 ;; "G") d=6 ;; "H") d=7 ;; + "I") d=8 ;; "J") d=9 ;; "K") d=10 ;; "L") d=11 ;; + "M") d=12 ;; "N") d=13 ;; "O") d=14 ;; "P") d=15 ;; + "Q") d=16 ;; "R") d=17 ;; "S") d=18 ;; "T") d=19 ;; + "U") d=20 ;; "V") d=21 ;; "W") d=22 ;; "X") d=23 ;; + "Y") d=24 ;; "Z") d=25 ;; "a") d=26 ;; "b") d=27 ;; + "c") d=28 ;; "d") d=29 ;; "e") d=30 ;; "f") d=31 ;; + "g") d=32 ;; "h") d=33 ;; "i") d=34 ;; "j") d=35 ;; + "k") d=36 ;; "l") d=37 ;; "m") d=38 ;; "n") d=39 ;; + "o") d=40 ;; "p") d=41 ;; "q") d=42 ;; "r") d=43 ;; + "s") d=44 ;; "t") d=45 ;; "u") d=46 ;; "v") d=47 ;; + "w") d=48 ;; "x") d=49 ;; "y") d=50 ;; "z") d=51 ;; + "0") d=52 ;; "1") d=53 ;; "2") d=54 ;; "3") d=55 ;; + "4") d=56 ;; "5") d=57 ;; "6") d=58 ;; "7") d=59 ;; + "8") d=60 ;; "9") d=61 ;; "+") d=62 ;; "/") d=63 ;; + "=") d=0 ;; + *) continue ;; + esac + + eval "a${i}=${c}" + eval "b${i}=${d}" + + i=$(( i + 1 )) + done + + o0=$(( ((b0 << 2) | (b1 >> 4)) & 0xff )) + o1=$(( ((b1 << 4) | (b2 >> 2)) & 0xff )) + o2=$(( ((b2 << 6) | b3) & 0xff )) + + [ "${a2}" == "=" ] && + eval "printf \"\\x\${h$(( o0 / 16 ))}\${h$(( o0 % 16 + ))}\"" && + return + [ "${a3}" == "=" ] && + eval "printf \"\\x\${h$(( o0 / 16 ))}\${h$(( o0 % 16 + ))}\\x\${h$(( o1 / 16 ))}\${h$(( o1 % 16 + ))}\"" && + return + eval "printf \"\\x\${h$(( o0 / 16 ))}\${h$(( o0 % 16 + ))}\\x\${h$(( o1 / 16 ))}\${h$(( o1 % 16 + ))}\\x\${h$(( o2 / 16 ))}\${h$(( o2 % 16 ))}\"" + done +} #time to ascertain fstype and PReP/UEFI/legacy #also, find first available block device (sda or vda likely) diff --git a/xCAT-server/share/xcat/install/scripts/pre.rhels8 b/xCAT-server/share/xcat/install/scripts/pre.rhels8 index 66abd34db..c98667d42 100644 --- a/xCAT-server/share/xcat/install/scripts/pre.rhels8 +++ b/xCAT-server/share/xcat/install/scripts/pre.rhels8 @@ -206,6 +206,33 @@ base64decode() done } +# $1 - The device name, eg., sda +# Returns the device size, unit is KB. +getdisksize() +{ + local disk="$1" + + disk="${disk#/dev/}" + + [ -z "${disk}" ] && echo "0" && return + + local blah + local blocks + local name + + while read -r blah blah blocks name + do + if [ "${name}" = "${disk}" ] + then + echo "${blocks}" + return + fi + done >/tmp/partitionfile fi +DISKSIZE="$(getdisksize "${instdisk}")" + # TODO: Ondisk detection, /dev/disk/by-id/edd-int13_dev80 for legacy maybe, and no idea about efi. At least maybe blacklist SAN if mptsas/mpt2sas/megaraid_sas seen... -echo "part /boot --fstype=$BOOTFSTYPE --asprimary --ondisk=$instdisk --size=512" >>/tmp/partitionfile +echo "part /boot --fstype=$BOOTFSTYPE --asprimary --ondisk=$instdisk --size=1024" >>/tmp/partitionfile echo "part pv.000997 --grow --asprimary --ondisk=$instdisk --size=18432" >>/tmp/partitionfile echo "volgroup xcatvg --pesize=4096 pv.000997" >>/tmp/partitionfile -echo "logvol / --fstype=$FSTYPE --name=root --vgname=xcatvg --grow --size=4096 --maxsize=20480" >>/tmp/partitionfile -echo "logvol /var --fstype=$FSTYPE --name=var --vgname=xcatvg --grow --size=2048 --maxsize=8192" >>/tmp/partitionfile -echo "logvol /tmp --fstype=$FSTYPE --name=tmp --vgname=xcatvg --grow --size=1024 --maxsize=4096" >>/tmp/partitionfile -echo "logvol /home --fstype=$FSTYPE --name=home --vgname=xcatvg --grow --percent=10 --maxsize=10240" >>/tmp/partitionfile echo "logvol swap --name=swap --vgname=xcatvg --recommended" >>/tmp/partitionfile +if [ "${DISKSIZE}" -lt "62914560" ] +then + echo "logvol / --fstype=$FSTYPE --name=root --vgname=xcatvg --grow --percent=86" >>/tmp/partitionfile +else + echo "logvol / --fstype=$FSTYPE --name=root --vgname=xcatvg --grow --size=10240 --maxsize=20480" >>/tmp/partitionfile + echo "logvol /var --fstype=$FSTYPE --name=var --vgname=xcatvg --grow --size=4096 --maxsize=8192" >>/tmp/partitionfile + echo "logvol /tmp --fstype=$FSTYPE --name=tmp --vgname=xcatvg --grow --size=4096 --maxsize=8192" >>/tmp/partitionfile + echo "logvol /home --fstype=$FSTYPE --name=home --vgname=xcatvg --grow --percent=10 --maxsize=10240" >>/tmp/partitionfile +fi + # Specify "bootloader" configuration in "/tmp/partitionfile" if there is no user customized partition file BOOTLOADER="bootloader" diff --git a/xCAT-server/share/xcat/install/scripts/pre.sle15 b/xCAT-server/share/xcat/install/scripts/pre.sle15 index 733fbe66b..712a69ba3 100644 --- a/xCAT-server/share/xcat/install/scripts/pre.sle15 +++ b/xCAT-server/share/xcat/install/scripts/pre.sle15 @@ -112,7 +112,6 @@ EOF chmod 755 /tmp/foo.awk chmod 755 /tmp/updateflag - /tmp/updateflag $XCATDHOST $XCATDPORT "installmonitor" & NODESTATUS=#TABLEBLANKOKAY:site:key=nodestatus:value# @@ -123,6 +122,64 @@ fi /tmp/foo.awk >/tmp/foo.log 2>&1 & +base64decode() +{ + h0="0"; h1="1"; h2="2"; h3="3"; h4="4"; h5="5"; h6="6"; h7="7"; + h8="8"; h9="9"; h10="A"; h11="B"; h12="C"; h13="D"; h14="E"; h15="F"; + + while : + do + i=0 + while [ "$i" -lt 4 ] + do + read -n 1 c || return + + case "${c}" in + "A") d=0 ;; "B") d=1 ;; "C") d=2 ;; "D") d=3 ;; + "E") d=4 ;; "F") d=5 ;; "G") d=6 ;; "H") d=7 ;; + "I") d=8 ;; "J") d=9 ;; "K") d=10 ;; "L") d=11 ;; + "M") d=12 ;; "N") d=13 ;; "O") d=14 ;; "P") d=15 ;; + "Q") d=16 ;; "R") d=17 ;; "S") d=18 ;; "T") d=19 ;; + "U") d=20 ;; "V") d=21 ;; "W") d=22 ;; "X") d=23 ;; + "Y") d=24 ;; "Z") d=25 ;; "a") d=26 ;; "b") d=27 ;; + "c") d=28 ;; "d") d=29 ;; "e") d=30 ;; "f") d=31 ;; + "g") d=32 ;; "h") d=33 ;; "i") d=34 ;; "j") d=35 ;; + "k") d=36 ;; "l") d=37 ;; "m") d=38 ;; "n") d=39 ;; + "o") d=40 ;; "p") d=41 ;; "q") d=42 ;; "r") d=43 ;; + "s") d=44 ;; "t") d=45 ;; "u") d=46 ;; "v") d=47 ;; + "w") d=48 ;; "x") d=49 ;; "y") d=50 ;; "z") d=51 ;; + "0") d=52 ;; "1") d=53 ;; "2") d=54 ;; "3") d=55 ;; + "4") d=56 ;; "5") d=57 ;; "6") d=58 ;; "7") d=59 ;; + "8") d=60 ;; "9") d=61 ;; "+") d=62 ;; "/") d=63 ;; + "=") d=0 ;; + *) continue ;; + esac + + eval "a${i}=${c}" + eval "b${i}=${d}" + + i=$(( i + 1 )) + done + + o0=$(( ((b0 << 2) | (b1 >> 4)) & 0xff )) + o1=$(( ((b1 << 4) | (b2 >> 2)) & 0xff )) + o2=$(( ((b2 << 6) | b3) & 0xff )) + + [ "${a2}" == "=" ] && + eval "printf \"\\x\${h$(( o0 / 16 ))}\${h$(( o0 % 16 + ))}\"" && + return + [ "${a3}" == "=" ] && + eval "printf \"\\x\${h$(( o0 / 16 ))}\${h$(( o0 % 16 + ))}\\x\${h$(( o1 / 16 ))}\${h$(( o1 % 16 + ))}\"" && + return + eval "printf \"\\x\${h$(( o0 / 16 ))}\${h$(( o0 % 16 + ))}\\x\${h$(( o1 / 16 ))}\${h$(( o1 % 16 + ))}\\x\${h$(( o2 / 16 ))}\${h$(( o2 % 16 ))}\"" + done +} + shopt -s nullglob msgutil_r "$MASTER_IP" "info" "Detecting install disk..." "/var/log/xcat/xcat.log" "$log_label" # diff --git a/xCAT-server/share/xcat/install/scripts/pre.sles b/xCAT-server/share/xcat/install/scripts/pre.sles index 5ddc37786..e1ec0409e 100644 --- a/xCAT-server/share/xcat/install/scripts/pre.sles +++ b/xCAT-server/share/xcat/install/scripts/pre.sles @@ -36,7 +36,6 @@ cat << 'EOF' EOF ) > /tmp/updateflag - if [ ! -c /dev/vcs ]; then mknod /dev/vcs c 7 0 fi @@ -112,7 +111,6 @@ EOF chmod 755 /tmp/foo.awk chmod 755 /tmp/updateflag - /tmp/updateflag $XCATDHOST $XCATDPORT "installmonitor" & NODESTATUS=#TABLEBLANKOKAY:site:key=nodestatus:value# @@ -123,6 +121,64 @@ fi /tmp/foo.awk >/tmp/foo.log 2>&1 & +base64decode() +{ + h0="0"; h1="1"; h2="2"; h3="3"; h4="4"; h5="5"; h6="6"; h7="7"; + h8="8"; h9="9"; h10="A"; h11="B"; h12="C"; h13="D"; h14="E"; h15="F"; + + while : + do + i=0 + while [ "$i" -lt 4 ] + do + read -n 1 c || return + + case "${c}" in + "A") d=0 ;; "B") d=1 ;; "C") d=2 ;; "D") d=3 ;; + "E") d=4 ;; "F") d=5 ;; "G") d=6 ;; "H") d=7 ;; + "I") d=8 ;; "J") d=9 ;; "K") d=10 ;; "L") d=11 ;; + "M") d=12 ;; "N") d=13 ;; "O") d=14 ;; "P") d=15 ;; + "Q") d=16 ;; "R") d=17 ;; "S") d=18 ;; "T") d=19 ;; + "U") d=20 ;; "V") d=21 ;; "W") d=22 ;; "X") d=23 ;; + "Y") d=24 ;; "Z") d=25 ;; "a") d=26 ;; "b") d=27 ;; + "c") d=28 ;; "d") d=29 ;; "e") d=30 ;; "f") d=31 ;; + "g") d=32 ;; "h") d=33 ;; "i") d=34 ;; "j") d=35 ;; + "k") d=36 ;; "l") d=37 ;; "m") d=38 ;; "n") d=39 ;; + "o") d=40 ;; "p") d=41 ;; "q") d=42 ;; "r") d=43 ;; + "s") d=44 ;; "t") d=45 ;; "u") d=46 ;; "v") d=47 ;; + "w") d=48 ;; "x") d=49 ;; "y") d=50 ;; "z") d=51 ;; + "0") d=52 ;; "1") d=53 ;; "2") d=54 ;; "3") d=55 ;; + "4") d=56 ;; "5") d=57 ;; "6") d=58 ;; "7") d=59 ;; + "8") d=60 ;; "9") d=61 ;; "+") d=62 ;; "/") d=63 ;; + "=") d=0 ;; + *) continue ;; + esac + + eval "a${i}=${c}" + eval "b${i}=${d}" + + i=$(( i + 1 )) + done + + o0=$(( ((b0 << 2) | (b1 >> 4)) & 0xff )) + o1=$(( ((b1 << 4) | (b2 >> 2)) & 0xff )) + o2=$(( ((b2 << 6) | b3) & 0xff )) + + [ "${a2}" == "=" ] && + eval "printf \"\\x\${h$(( o0 / 16 ))}\${h$(( o0 % 16 + ))}\"" && + return + [ "${a3}" == "=" ] && + eval "printf \"\\x\${h$(( o0 / 16 ))}\${h$(( o0 % 16 + ))}\\x\${h$(( o1 / 16 ))}\${h$(( o1 % 16 + ))}\"" && + return + eval "printf \"\\x\${h$(( o0 / 16 ))}\${h$(( o0 % 16 + ))}\\x\${h$(( o1 / 16 ))}\${h$(( o1 % 16 + ))}\\x\${h$(( o2 / 16 ))}\${h$(( o2 % 16 ))}\"" + done +} + shopt -s nullglob msgutil_r "$MASTER_IP" "info" "Detecting install disk..." "/var/log/xcat/xcat.log" "$log_label" # diff --git a/xCAT-server/share/xcat/install/sles/compute.sles12.ppc64le.tmpl b/xCAT-server/share/xcat/install/sles/compute.sles12.ppc64le.tmpl index f7cc1ecff..f3f8be272 100644 --- a/xCAT-server/share/xcat/install/sles/compute.sles12.ppc64le.tmpl +++ b/xCAT-server/share/xcat/install/sles/compute.sles12.ppc64le.tmpl @@ -112,6 +112,7 @@ onboot + true false diff --git a/xCAT-server/share/xcat/install/sles/service.sles12.ppc64le.otherpkgs.pkglist b/xCAT-server/share/xcat/install/sles/service.sles12.ppc64le.otherpkgs.pkglist index 6d403afb2..096209962 100644 --- a/xCAT-server/share/xcat/install/sles/service.sles12.ppc64le.otherpkgs.pkglist +++ b/xCAT-server/share/xcat/install/sles/service.sles12.ppc64le.otherpkgs.pkglist @@ -1,2 +1,2 @@ xcat/xcat-core/xCATsn -xcat/xcat-dep/sles12/ppc64le/conserver-xcat +xcat/xcat-dep/sles12/ppc64le/goconserver diff --git a/xCAT-server/share/xcat/install/sles/service.sles12.x86_64.otherpkgs.pkglist b/xCAT-server/share/xcat/install/sles/service.sles12.x86_64.otherpkgs.pkglist index 8c4f4de49..a9d86fded 100644 --- a/xCAT-server/share/xcat/install/sles/service.sles12.x86_64.otherpkgs.pkglist +++ b/xCAT-server/share/xcat/install/sles/service.sles12.x86_64.otherpkgs.pkglist @@ -1,2 +1,2 @@ xcat/xcat-core/xCATsn -xcat/xcat-dep/sles12/x86_64/conserver-xcat +xcat/xcat-dep/sles12/x86_64/goconserver diff --git a/xCAT-server/share/xcat/netboot/centos/compute.centos8.ppc64le.exlist b/xCAT-server/share/xcat/netboot/centos/compute.centos8.ppc64le.exlist new file mode 120000 index 000000000..f468ba7e1 --- /dev/null +++ b/xCAT-server/share/xcat/netboot/centos/compute.centos8.ppc64le.exlist @@ -0,0 +1 @@ +../rh/compute.rhels8.ppc64le.exlist \ No newline at end of file diff --git a/xCAT-server/share/xcat/netboot/centos/compute.centos8.ppc64le.pkglist b/xCAT-server/share/xcat/netboot/centos/compute.centos8.ppc64le.pkglist new file mode 120000 index 000000000..38195cc33 --- /dev/null +++ b/xCAT-server/share/xcat/netboot/centos/compute.centos8.ppc64le.pkglist @@ -0,0 +1 @@ +../rh/compute.rhels8.ppc64le.pkglist \ No newline at end of file diff --git a/xCAT-server/share/xcat/netboot/centos/compute.centos8.ppc64le.postinstall b/xCAT-server/share/xcat/netboot/centos/compute.centos8.ppc64le.postinstall new file mode 120000 index 000000000..011158f7b --- /dev/null +++ b/xCAT-server/share/xcat/netboot/centos/compute.centos8.ppc64le.postinstall @@ -0,0 +1 @@ +../rh/compute.rhels8.ppc64le.postinstall \ No newline at end of file diff --git a/xCAT-server/share/xcat/netboot/centos/compute.centos8.x86_64.exlist b/xCAT-server/share/xcat/netboot/centos/compute.centos8.x86_64.exlist new file mode 120000 index 000000000..a6d9c0135 --- /dev/null +++ b/xCAT-server/share/xcat/netboot/centos/compute.centos8.x86_64.exlist @@ -0,0 +1 @@ +../rh/compute.rhels8.x86_64.exlist \ No newline at end of file diff --git a/xCAT-server/share/xcat/netboot/centos/compute.centos8.x86_64.pkglist b/xCAT-server/share/xcat/netboot/centos/compute.centos8.x86_64.pkglist new file mode 120000 index 000000000..5ecd4c4d1 --- /dev/null +++ b/xCAT-server/share/xcat/netboot/centos/compute.centos8.x86_64.pkglist @@ -0,0 +1 @@ +../rh/compute.rhels8.x86_64.pkglist \ No newline at end of file diff --git a/xCAT-server/share/xcat/netboot/centos/compute.centos8.x86_64.postinstall b/xCAT-server/share/xcat/netboot/centos/compute.centos8.x86_64.postinstall new file mode 120000 index 000000000..3e16d254e --- /dev/null +++ b/xCAT-server/share/xcat/netboot/centos/compute.centos8.x86_64.postinstall @@ -0,0 +1 @@ +../rh/compute.rhels8.x86_64.postinstall \ No newline at end of file diff --git a/xCAT-server/share/xcat/netboot/rh/compute.rhels8.ppc64le.pkglist b/xCAT-server/share/xcat/netboot/rh/compute.rhels8.ppc64le.pkglist index 4405d533e..7c33f0d7b 100644 --- a/xCAT-server/share/xcat/netboot/rh/compute.rhels8.ppc64le.pkglist +++ b/xCAT-server/share/xcat/netboot/rh/compute.rhels8.ppc64le.pkglist @@ -1,36 +1,13 @@ -bash -bc -bzip2 +@minimal-environment chrony -coreutils -curl -dhcp-client -dracut -dracut-network -e2fsprogs -ethtool -file -gzip -hostname -initscripts -iputils -irqbalance kernel -lsvpd net-tools nfs-utils -openssh-clients openssh-server -openssl -parted -procps-ng -rpm rsync -rsyslog tar util-linux -vim-minimal -xz wget python3 -NetworkManager +tar +bzip2 diff --git a/xCAT-server/share/xcat/netboot/rh/compute.rhels8.x86_64.pkglist b/xCAT-server/share/xcat/netboot/rh/compute.rhels8.x86_64.pkglist index 3591e44d0..7c33f0d7b 100644 --- a/xCAT-server/share/xcat/netboot/rh/compute.rhels8.x86_64.pkglist +++ b/xCAT-server/share/xcat/netboot/rh/compute.rhels8.x86_64.pkglist @@ -1,35 +1,13 @@ -bash -bc -bzip2 +@minimal-environment chrony -coreutils -curl -dhcp-client -dracut -dracut-network -e2fsprogs -ethtool -file -gzip -hostname -initscripts -iputils -irqbalance kernel net-tools nfs-utils -openssh-clients openssh-server -openssl -parted -procps-ng -rpm rsync -rsyslog tar util-linux -vim-minimal -xz wget python3 -NetworkManager +tar +bzip2 diff --git a/xCAT-server/share/xcat/netboot/rh/genimage b/xCAT-server/share/xcat/netboot/rh/genimage index d414b996a..608c3e4a5 100755 --- a/xCAT-server/share/xcat/netboot/rh/genimage +++ b/xCAT-server/share/xcat/netboot/rh/genimage @@ -302,7 +302,7 @@ if($onlyinitrd){ my @pkgdir_internet; #Put all of the http mirrors in this array my $dir; foreach $dir (@pkgdirs) { - if ($dir =~ /^http.*/) { + if ($dir =~ /^http[s]?:|^ftp:/) { push @pkgdir_internet, $dir; } else { find(\&isyumdir, <$dir/>); @@ -336,11 +336,11 @@ if($onlyinitrd){ my $repnum = 0; foreach $srcdir (@yumdirs) { - print $yumconfig "[$osver-$arch-$repnum]\nname=$osver-$arch-$repnum\nbaseurl=file://$srcdir\ngpgpcheck=0\n\n"; + print $yumconfig "[$osver-$arch-$repnum]\nname=$osver-$arch-$repnum\nbaseurl=file://$srcdir\ngpgpcheck=0\nskip_if_unavailable=True\n\n"; $repnum += 1; } foreach $srcdir (@pkgdir_internet) { - print $yumconfig "[$osver-$arch-$repnum]\nname=$osver-$arch-$repnum\nbaseurl=$srcdir\ngpgpcheck=0\n\n"; + print $yumconfig "[$osver-$arch-$repnum]\nname=$osver-$arch-$repnum\nbaseurl=$srcdir\ngpgpcheck=0\nskip_if_unavailable=True\n\n"; $repnum += 1; } $repnum -= 1; @@ -486,7 +486,7 @@ if($onlyinitrd){ my @otherpkgdir_url; my @otherpkgdir_local; foreach my $tmpdir (split ',', $srcdir_otherpkgs){ - if($tmpdir =~ /^http:.*/){ + if($tmpdir =~ /^http[s]?:|^ftp:/){ push @otherpkgdir_url, $tmpdir; }else{ push @otherpkgdir_local,$tmpdir; @@ -516,12 +516,12 @@ if($onlyinitrd){ if (($_ eq "PRE_REMOVE") || ($_ eq "POST_REMOVE") || ($_ eq "ENVLIST")) { next; } foreach(@otherpkgdir_url){ - print $yumconfig "[otherpkgs$index]\nname=otherpkgs$index\nbaseurl=$_\ngpgpcheck=0\n\n"; + print $yumconfig "[otherpkgs$index]\nname=otherpkgs$index\nbaseurl=$_\ngpgpcheck=0\nskip_if_unavailable=True\n\n"; $repohash{$pass}{$index} = 1; $index++; } - print $yumconfig "[otherpkgs$index]\nname=otherpkgs$index\nbaseurl=file://$srcdir_otherpkgs_local/$_\ngpgpcheck=0\n\n"; + print $yumconfig "[otherpkgs$index]\nname=otherpkgs$index\nbaseurl=file://$srcdir_otherpkgs_local/$_\ngpgpcheck=0\nskip_if_unavailable=True\n\n"; $repohash{$pass}{$index} = 1; $index++; my $pa = $extra_hash{$pass}{$_}; @@ -1150,16 +1150,17 @@ sub mkinitrd_dracut { # force the dracut run in non-hostonly mode for dracut higher than version 033 if ($dracutver > "033") { $additional_options .= " -N"; + + #if "pigz" is available in the rootimg, use "pigz" instead of "gzip" + my $compress = qx(chroot $rootimg_dir bash -c "type -p pigz"|tr -d "\n"); + if ($compress) { + + #take the online cpu numerber as the pigz processes number + my $processnum = qx(lscpu -p=cpu --online|grep -v '#'|wc -l|tr -d "\n"); + $additional_options .= " --compress \"$compress -p $processnum \""; + } } - #if "pigz" is available in the rootimg, use "pigz" instead of "gzip" - my $compress = qx(chroot $rootimg_dir bash -c "type -p pigz"|tr -d "\n"); - if ($compress) { - - #take the online cpu numerber as the pigz processes number - my $processnum = qx(lscpu -p=cpu --online|grep -v '#'|wc -l|tr -d "\n"); - $additional_options .= " --compress \"$compress -p $processnum \""; - } print "\nchroot $rootimg_dir dracut $additional_options -f /tmp/initrd.$$.gz $kernelver\n"; !system("chroot $rootimg_dir dracut $additional_options -f /tmp/initrd.$$.gz $kernelver") diff --git a/xCAT-server/share/xcat/netboot/rh/service.rhels7.ppc64le.otherpkgs.pkglist b/xCAT-server/share/xcat/netboot/rh/service.rhels7.ppc64le.otherpkgs.pkglist index 66c23dbd6..f987967b0 100644 --- a/xCAT-server/share/xcat/netboot/rh/service.rhels7.ppc64le.otherpkgs.pkglist +++ b/xCAT-server/share/xcat/netboot/rh/service.rhels7.ppc64le.otherpkgs.pkglist @@ -1,4 +1,3 @@ xcat/xcat-core/xCATsn -xcat/xcat-dep/rh7/ppc64le/conserver-xcat xcat/xcat-dep/rh7/ppc64le/perl-Net-Telnet xcat/xcat-dep/rh7/ppc64le/perl-Expect diff --git a/xCAT-server/share/xcat/netboot/rh/service.rhels7.x86_64.otherpkgs.pkglist b/xCAT-server/share/xcat/netboot/rh/service.rhels7.x86_64.otherpkgs.pkglist index 26339bcdb..08dec8c94 100644 --- a/xCAT-server/share/xcat/netboot/rh/service.rhels7.x86_64.otherpkgs.pkglist +++ b/xCAT-server/share/xcat/netboot/rh/service.rhels7.x86_64.otherpkgs.pkglist @@ -1,4 +1,3 @@ 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 diff --git a/xCAT-server/share/xcat/netboot/rh/service.rhels8.ppc64le.pkglist b/xCAT-server/share/xcat/netboot/rh/service.rhels8.ppc64le.pkglist index de6892304..e15993e89 100644 --- a/xCAT-server/share/xcat/netboot/rh/service.rhels8.ppc64le.pkglist +++ b/xCAT-server/share/xcat/netboot/rh/service.rhels8.ppc64le.pkglist @@ -1,38 +1,15 @@ -bash -bc -bzip2 +@minimal-environment chrony -coreutils -curl -dhcp-client -dracut -dracut-network -e2fsprogs -ethtool -file -gzip -hostname -initscripts -iputils -irqbalance kernel -lsvpd net-tools nfs-utils -openssh-clients openssh-server -openssl -parted -procps-ng -rpm rsync -rsyslog tar util-linux -vim-minimal -xz wget perl-DBD-MySQL perl-DBD-Pg python3 -NetworkManager +tar +bzip2 diff --git a/xCAT-server/share/xcat/netboot/rh/service.rhels8.x86_64.pkglist b/xCAT-server/share/xcat/netboot/rh/service.rhels8.x86_64.pkglist index 52da27a2e..e15993e89 100644 --- a/xCAT-server/share/xcat/netboot/rh/service.rhels8.x86_64.pkglist +++ b/xCAT-server/share/xcat/netboot/rh/service.rhels8.x86_64.pkglist @@ -1,37 +1,15 @@ -bash -bc -bzip2 +@minimal-environment chrony -coreutils -curl -dhcp-client -dracut -dracut-network -e2fsprogs -ethtool -file -gzip -hostname -initscripts -iputils -irqbalance kernel net-tools nfs-utils -openssh-clients openssh-server -openssl -parted -procps-ng -rpm rsync -rsyslog tar util-linux -vim-minimal -xz wget perl-DBD-MySQL perl-DBD-Pg python3 -NetworkManager +tar +bzip2 diff --git a/xCAT-server/share/xcat/netboot/sles/service.sles12.ppc64le.otherpkgs.pkglist b/xCAT-server/share/xcat/netboot/sles/service.sles12.ppc64le.otherpkgs.pkglist index 6d403afb2..096209962 100644 --- a/xCAT-server/share/xcat/netboot/sles/service.sles12.ppc64le.otherpkgs.pkglist +++ b/xCAT-server/share/xcat/netboot/sles/service.sles12.ppc64le.otherpkgs.pkglist @@ -1,2 +1,2 @@ xcat/xcat-core/xCATsn -xcat/xcat-dep/sles12/ppc64le/conserver-xcat +xcat/xcat-dep/sles12/ppc64le/goconserver diff --git a/xCAT-server/share/xcat/netboot/sles/service.sles12.x86_64.otherpkgs.pkglist b/xCAT-server/share/xcat/netboot/sles/service.sles12.x86_64.otherpkgs.pkglist index 7fe170d23..1e7889a64 100644 --- a/xCAT-server/share/xcat/netboot/sles/service.sles12.x86_64.otherpkgs.pkglist +++ b/xCAT-server/share/xcat/netboot/sles/service.sles12.x86_64.otherpkgs.pkglist @@ -1,3 +1,3 @@ -perl-doc xcat/xcat-core/xCATsn -xcat/xcat-dep/sles12/x86_64/conserver-xcat +xcat/xcat-dep/sles12/x86_64/goconserver diff --git a/xCAT-server/share/xcat/netboot/ubuntu/compute.ubuntu16.04.pkglist b/xCAT-server/share/xcat/netboot/ubuntu/compute.ubuntu16.04.5.pkglist similarity index 68% rename from xCAT-server/share/xcat/netboot/ubuntu/compute.ubuntu16.04.pkglist rename to xCAT-server/share/xcat/netboot/ubuntu/compute.ubuntu16.04.5.pkglist index 194157acc..d5c414531 100644 --- a/xCAT-server/share/xcat/netboot/ubuntu/compute.ubuntu16.04.pkglist +++ b/xCAT-server/share/xcat/netboot/ubuntu/compute.ubuntu16.04.5.pkglist @@ -2,15 +2,17 @@ bash nfs-common openssl isc-dhcp-client -linux-image-generic-lts-xenial +libc-bin +linux-image-generic-hwe-16.04 openssh-server openssh-client wget ntp -rsyslog +ntpdate rsync busybox-static gawk +dnsutils tar gzip xz-utils diff --git a/xCAT-server/share/xcat/netboot/ubuntu/compute.ubuntu18.04.2.ppc64el.pkglist b/xCAT-server/share/xcat/netboot/ubuntu/compute.ubuntu18.04.2.ppc64el.pkglist new file mode 100644 index 000000000..f9cd24b54 --- /dev/null +++ b/xCAT-server/share/xcat/netboot/ubuntu/compute.ubuntu18.04.2.ppc64el.pkglist @@ -0,0 +1,19 @@ +bash +ifupdown +nfs-common +openssl +isc-dhcp-client +libc-bin +linux-image-generic-hwe-18.04 +openssh-server +openssh-client +wget +rsync +busybox-static +gawk +dnsutils +tar +gzip +xz-utils +cpio +chrony diff --git a/xCAT-server/share/xcat/netboot/ubuntu/compute.ubuntu18.04.2.ppc64le.pkglist b/xCAT-server/share/xcat/netboot/ubuntu/compute.ubuntu18.04.2.ppc64le.pkglist new file mode 120000 index 000000000..390b76eff --- /dev/null +++ b/xCAT-server/share/xcat/netboot/ubuntu/compute.ubuntu18.04.2.ppc64le.pkglist @@ -0,0 +1 @@ +compute.ubuntu18.04.2.ppc64el.pkglist \ No newline at end of file diff --git a/xCAT-server/share/xcat/netboot/ubuntu/compute.ubuntu18.04.2.x86_64.pkglist b/xCAT-server/share/xcat/netboot/ubuntu/compute.ubuntu18.04.2.x86_64.pkglist new file mode 100644 index 000000000..f9cd24b54 --- /dev/null +++ b/xCAT-server/share/xcat/netboot/ubuntu/compute.ubuntu18.04.2.x86_64.pkglist @@ -0,0 +1,19 @@ +bash +ifupdown +nfs-common +openssl +isc-dhcp-client +libc-bin +linux-image-generic-hwe-18.04 +openssh-server +openssh-client +wget +rsync +busybox-static +gawk +dnsutils +tar +gzip +xz-utils +cpio +chrony diff --git a/xCAT-server/share/xcat/netboot/ubuntu/genimage b/xCAT-server/share/xcat/netboot/ubuntu/genimage index f6086b7a5..c2108a204 100755 --- a/xCAT-server/share/xcat/netboot/ubuntu/genimage +++ b/xCAT-server/share/xcat/netboot/ubuntu/genimage @@ -201,7 +201,7 @@ if ($netdriver) { if ($arch eq 'x86' or $arch eq 'x86_64') { @ndrivers = qw/tg3 bnx2 bnx2x e1000 e1000e igb mlx4_en virtio_net/; } elsif ($arch eq 'ppc64el') { - @ndrivers = qw/bnx2 bnx2x e1000 e1000e igb ibmveth ehea mlx_en mlx4_en virtio_net/; + @ndrivers = qw/tg3 bnx2 bnx2x e1000 e1000e igb ibmveth ehea mlx_en mlx4_en virtio_net/; } elsif ($arch eq 'ppc64') { @ndrivers = qw/e1000 e1000e igb ibmveth ehea/; } elsif ($arch eq 's390x') { @@ -336,7 +336,7 @@ unless ($onlyinitrd) { print "Run cmd [$aptcmd1 $aptcmd2] to create rootimage bootstraps\n"; my $rc = system("$aptcmd1 $aptcmd2"); if ($rc) { - print "Error: cannnot create bootstraps for rootimage. Make sure you specified full http mirror path.\n"; + print "Error: Can not create bootstraps for rootimage. Make sure you specified full http mirror path.\n"; exit 1; } diff --git a/xCAT-server/share/xcat/tools/go-xcat b/xCAT-server/share/xcat/tools/go-xcat index 139d945fd..ce35926e1 100755 --- a/xCAT-server/share/xcat/tools/go-xcat +++ b/xCAT-server/share/xcat/tools/go-xcat @@ -2,9 +2,9 @@ # # go-xcat - Install xCAT automatically. # -# Version 1.0.36 +# Version 1.0.44 # -# Copyright (C) 2016, 2017, 2018 International Business Machines +# Copyright (C) 2016 - 2019 International Business Machines # Eclipse Public License, Version 1.0 (EPL-1.0) # # @@ -23,6 +23,10 @@ # - xCAT uninstallation # 2019-03-22 GONG Jie # - Better debug log when reading repository failed +# 2019-08-15 Mark Gurevich +# - Added conserver-xcat to uninstall list +# 2019-10-23 Mark Gurevich +# - Display a list of packages that could not be uninstalled # function usage() @@ -163,22 +167,24 @@ GO_XCAT_DEP_PACKAGE_LIST=() # The package list of all the packages should be installed GO_XCAT_INSTALL_LIST=(perl-xCAT xCAT xCAT-buildkit xCAT-client xCAT-genesis-scripts-ppc64 xCAT-genesis-scripts-x86_64 xCAT-server - conserver-xcat elilo-xcat grub2-xcat ipmitool-xcat syslinux-xcat + elilo-xcat grub2-xcat ipmitool-xcat syslinux-xcat xCAT-genesis-base-ppc64 xCAT-genesis-base-x86_64 xnba-undi yaboot-xcat) # For Debian/Ubuntu, it will need a sight different package list type dpkg >/dev/null 2>&1 && GO_XCAT_INSTALL_LIST=(perl-xcat xcat xcat-buildkit xcat-client xcat-genesis-scripts-amd64 xcat-genesis-scripts-ppc64 xcat-server - conserver-xcat elilo-xcat grub2-xcat ipmitool-xcat syslinux-xcat + elilo-xcat grub2-xcat ipmitool-xcat syslinux-xcat xcat-genesis-base-amd64 xcat-genesis-base-ppc64 xnba-undi) -# The package list of all the packages should be installed +# The package list of all the packages should be uninstalled GO_XCAT_UNINSTALL_LIST=("${GO_XCAT_INSTALL_LIST[@]}" goconserver xCAT-SoftLayer xCAT-confluent xCAT-csm xCAT-genesis-builder - xCAT-openbmc-py xCAT-probe xCAT-test xCAT-vlan xCATsn xCAT-UI-deps) + xCAT-openbmc-py xCAT-probe xCAT-test xCAT-vlan xCATsn xCAT-UI-deps + xCAT-buildkit conserver-xcat) # For Debian/Ubuntu, it will need a sight different package list type dpkg >/dev/null 2>&1 && GO_XCAT_UNINSTALL_LIST=("${GO_XCAT_INSTALL_LIST[@]}" - goconserver xcat-confluent xcat-probe xcat-test xcat-vlan xcatsn) + goconserver xcat-confluent xcat-probe xcat-test xcat-vlan xcatsn + xcat-buildkit conserver-xcat) PATH="/usr/sbin:/usr/bin:/sbin:/bin" export PATH @@ -748,19 +754,36 @@ function get_package_list_apt() 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. + local -a lists=() + local -a packages=() + local p + local q + + for p in \ + "/var/lib/apt/lists/"*"_${repo_id}_dists"*"_main_binary-"*"_Packages" + do + [[ -f "${p}" && -r "${p}" ]] && lists+=("${p}") + done # For the `devel' branch of the online repo for apt, it has the # subdirectory name of `core-snap' instead of `xcat-core'. - rc="$?" - if [[ "${rc}" -ne "0" && "${repo_id}" = "xcat-core" ]] - then - "${FUNCNAME}" "core-snap" - rc="$?" - fi - return "${rc}" + [[ "${repo_id}" == "xcat-core" ]] && + for p in \ + "/var/lib/apt/lists/"*"_core-snap_dists"*"_main_binary-"*"_Packages" + do + [[ -f "${p}" && -r "${p}" ]] && lists+=("${p}") + done + [[ "${#lists[@]}" -eq "0" ]] && return 1 + + while read -r q + do + for p in "${packages[@]}" + do + [[ "${q}" == "${p}" ]] && continue 2 + done + packages+=("${q}") + done < <(awk '/^Package: / { print $2 }' "${lists[@]}" 2>/dev/null) + + echo "${packages[@]}" } # $1 repo id @@ -866,6 +889,8 @@ function download_file_curl() 88) echo -n "FTP chunk callback reported error" ;; 89) echo -n "no connection available, the session will be queued" ;; 90) echo -n "SSL public key does not matched pinned public key" ;; + 91) echo -n "invalid SSL certificate status" ;; + 92) echo -n "stream error in HTTP/2 framing layer" ;; *) echo -n "unknown error" ;; esac echo ")" @@ -1553,6 +1578,7 @@ function remove_package_apt() local -a yes=() [[ "$1" = "-y" ]] && yes=("-y") && shift apt-get --allow-unauthenticated remove "${yes[@]}" "$@" + warn_if_bad "$?" "Unable to remove xCAT packages: "`apt --installed list 2>&1 | grep xcat | cut -d '/' -f 1` } function remove_package() @@ -1567,6 +1593,7 @@ function purge_package_apt() local -a yes=() [[ "$1" = "-y" ]] && yes=("-y") && shift apt-get --allow-unauthenticated purge "${yes[@]}" "$@" + warn_if_bad "$?" "Unable to purge xCAT packages: "`apt --installed list 2>&1 | grep xcat | cut -d '/' -f 1` } function purge_package_others() @@ -1979,8 +2006,8 @@ do GO_XCAT_ACTION="$1" case "$1 $2" in "completely uninstall"|"smoke test") - shift GO_XCAT_ACTION="$1 $2" + shift ;; esac ;; @@ -2069,22 +2096,17 @@ case "${GO_XCAT_ACTION}" in debug_logger <<-EOF - xCAT has been completely uninstalled! + xCAT has been uninstalled. + To install again - https://xcat.org/download.html EOF ;; "uninstall") debug_trace uninstall_xcat -y - boo_boo_if_bad "$?" debug_logger <<-EOF - xCAT has been uninstalled! - ========================== - - If you intend to install xCAT again, please follow the guideline on the - xcat.org website. - - https://xcat.org/download.html + xCAT has been uninstalled. + To install again - https://xcat.org/download.html EOF ;; esac diff --git a/xCAT-server/xCAT-server.spec b/xCAT-server/xCAT-server.spec index 4633bb9bc..3446db8c8 100644 --- a/xCAT-server/xCAT-server.spec +++ b/xCAT-server/xCAT-server.spec @@ -57,7 +57,7 @@ Requires: perl-Time-HiRes perl-Sys-Syslog perl-Text-Balanced perl-DB_File perl-X # # PCM does not use or ship grub2-xcat %if %nots390x -Requires: grub2-xcat perl-Net-HTTPS-NB perl-HTTP-Async +Requires: grub2-xcat >= 2.02-0.76.el7.1.snap201905160255 perl-Net-HTTPS-NB perl-HTTP-Async %endif %endif %endif diff --git a/xCAT-test/autotest/bundle/rhels_ppc_daily.bundle b/xCAT-test/autotest/bundle/rhels_ppc_daily.bundle index 863a65c2d..39cd43183 100644 --- a/xCAT-test/autotest/bundle/rhels_ppc_daily.bundle +++ b/xCAT-test/autotest/bundle/rhels_ppc_daily.bundle @@ -1,6 +1,9 @@ SN_setup_case +tabdump_servicenode reg_linux_diskless_installation_hierarchy +tabdump_servicenode reg_linux_diskfull_installation_hierarchy +tabdump_servicenode updatenode_P_script1 updatenode_P_script1_script2 updatenode_P_script2 @@ -22,6 +25,7 @@ updatenode_syncfile_MERGE updatenode_v updatenode_without_flag updatenode_without_options +tabdump_servicenode xdcp_nonroot_user xdcp_src_dst xdsh_E @@ -37,6 +41,7 @@ xdsh_permission_denied xdsh_q xdsh_regular_command xdsh_t +tabdump_servicenode assign_certain_command_permission chdef_dynamic_group chdef_group @@ -52,21 +57,25 @@ chdef_t_network chdef_t_node chdef_t_o_error chdef_z +tabdump_servicenode chtab_d chtab_h chtab_modify_key chtab_modify_node chtab_null chtab_v +tabdump_servicenode confignetwork_secondarynic_nicips_updatenode_false confignetwork_secondarynic_nicnetworks_updatenode_false confignetwork_secondarynic_nictype_updatenode_false +tabdump_servicenode copycds_a copycds_a_err copycds_iso copycds_n copycds_n_a copycds_n_err +tabdump_servicenode disable_root_permission_in_policy_table dumpxCATdb_a_p_nullskiptables dumpxCATdb_a_p_nullskiptables_V @@ -77,10 +86,12 @@ dumpxCATdb_p_nullskiptables dumpxCATdb_p_nullskiptables_V dumpxCATdb_p_skiptables dumpxCATdb_v +tabdump_servicenode encrypted_passwd_md5_diskfull encrypted_passwd_openssl_diskfull encrypted_passwd_sha256_diskfull encrypted_passwd_sha512_diskfull +tabdump_servicenode gettab_H gettab_err gettab_h @@ -88,6 +99,7 @@ gettab_key_table getmacs_d getmacs_f_D getmacs_noderange +tabdump_servicenode lsdef_a lsdef_null lsdef_t @@ -99,6 +111,7 @@ lsdef_t_w lslite_h lslite_i lslite_noderange +tabdump_servicenode lsxcatd_a lsxcatd_d lsxcatd_h @@ -108,11 +121,13 @@ makedhcp_a_d makedhcp_d makedhcp_n makedhcp_remote_network +tabdump_servicenode makedns makedns_d_node makedns_h makedns_n makedns_n_noderange +tabdump_servicenode makehost_n_r makehosts_d makehosts_h @@ -122,6 +137,7 @@ makehosts_n makehosts_n_noderange makehosts_null makeknownhosts_node_d +tabdump_servicenode makentp_h makentp_v mkdef_null @@ -132,12 +148,14 @@ mkdef_regex_nicsip mkdef_rhels73 mkdef_t_o_error mkdef_z +tabdump_servicenode nodeadd_err_symbol nodeadd_h nodeadd_noderange nodeadd_noderange_nodetype nodeadd_null nodeadd_v +tabdump_servicenode nodech_delete nodech_error_node nodech_error_table @@ -154,10 +172,12 @@ nodech_noderange_table_include nodech_noderange_table_unequal nodech_noderange_table_uninclude nodech_v +tabdump_servicenode nodegrpch_err nodegrpch_groups nodegrpch_h nodegrpch_v +tabdump_servicenode nodels_H nodels_S nodels_b @@ -178,6 +198,7 @@ nodels_table_include nodels_tablevalue nodels_tablevalue_tablecolumn nodels_v +tabdump_servicenode noderange_10-20 noderange_XCAT_NODE_PREFIX noderange_XCAT_NODE_SUFFIX @@ -191,6 +212,7 @@ noderm_err_node noderm_h noderm_noderange noderm_null +tabdump_servicenode nodeset_check_warninginfo nodeset_errorcommand nodeset_grub2 @@ -199,6 +221,7 @@ nodeset_yaboot nodeset_stat nodestat_err_node nodestat_usage +tabdump_servicenode packimage_h packimage_v pping_h @@ -219,11 +242,13 @@ regnotif_h regnotif_null regnotif_o regnotif_v +tabdump_servicenode restorexCAT_h restorexCATdb_a_p_V restorexCATdb_p_V restorexCATdb_v restorexCATdb_wrongpath +tabdump_servicenode rinv_all rinv_bus rinv_config @@ -233,6 +258,7 @@ rinv_serial rinv_noderange_err rmdef_null rmdef_t_err +tabdump_servicenode rpower_boot rpower_err_noderange rpower_noderange @@ -240,17 +266,24 @@ rpower_noderange_nodeps rpower_off rpower_on rpower_stat +tabdump_servicenode rscan_noderange +tabdump_servicenode rscan_w +tabdump_servicenode rscan_x rscan_x_w +tabdump_servicenode rscan_z rscan_z_w +tabdump_servicenode run_command_with_XCATBYPASS runcmdinstaller_h +tabdump_servicenode rvitals_all rvitals_lcds rvitals_noderange_err +tabdump_servicenode tabdump_d tabdump_d_nodehm tabdump_f_d @@ -266,6 +299,7 @@ tabdump_w_lt tabdump_w_match tabdump_w_ne tabdump_w_notmatch +tabdump_servicenode tabgrep_err tabgrep_h tabgrep_node @@ -281,6 +315,7 @@ tabrestore_err tabrestore_h tabrestore_null tabrestore_table +tabdump_servicenode unregnotif_f unregnotif_h unregnotif_null @@ -290,6 +325,7 @@ xcatconfig_u_check_xcatsslversion_rhels_sles xcatd_restart xcatd_start xcatd_stop +tabdump_servicenode xcatstanzafile_attribute xcatstanzafile_colon xcatstanzafile_defaultvalue @@ -298,3 +334,4 @@ xcatstanzafile_normal xcatstanzafile_objtype xcatstanzafile_specificvalue xcatstanzafile_tab +tabdump_servicenode diff --git a/xCAT-test/autotest/bundle/rhels_ppc_weekly.bundle b/xCAT-test/autotest/bundle/rhels_ppc_weekly.bundle index f523dfe2f..a10b9a6fe 100644 --- a/xCAT-test/autotest/bundle/rhels_ppc_weekly.bundle +++ b/xCAT-test/autotest/bundle/rhels_ppc_weekly.bundle @@ -9,48 +9,6 @@ packimage_m_tar_c_xz packimage_o_p_a_m reg_linux_statelite_installation_hierarchy_by_nfs reg_linux_statelite_installation_hierarchy_by_ramdisk -addkit_v -addkit_h -addkit_kit -addkit_i -addkit_multikit -addkit_p -addkitcomp_v -addkitcomp_h -addkitcomp_i -addkitcomp_f -buildkit_v -buildkit_h -buildkit_create -buildkit_create_l -buildkit_cleanrepo_all -buildkit_buildtar -chkkitcomp_v -chkkitcomp_h -chkkitcomp_V -lskit_v -lskit_h -lskit_F -lskit_K -lskit_R -lskit_C -lskitcomp_v -lskitcomp_h -lskitcomp_C -lskitcomp_S -lskitdeployparam_v -lskitdeployparam_h -lskitdeployparam_no_param -lskitdeployparam_k_1 -lskitdeployparam_c_1 -rmkit_v -rmkit_h -rmkit_t_no -rmkit_t_yes -rmkit_f -rmkit_V -rmkitcomp_v -rmkitcomp_h bmcdiscover_h bmcdiscover_nmap_range bmcdiscover_v @@ -67,5 +25,3 @@ reg_linux_statelite_installation_flat rmimage_diskless rpower_reset runcmdinstaller_command -redhat_migration1 -redhat_migration2 diff --git a/xCAT-test/autotest/bundle/rhels_ppcle_weekly.bundle b/xCAT-test/autotest/bundle/rhels_ppcle_weekly.bundle index f4f1f4460..f6c619655 100644 --- a/xCAT-test/autotest/bundle/rhels_ppcle_weekly.bundle +++ b/xCAT-test/autotest/bundle/rhels_ppcle_weekly.bundle @@ -9,48 +9,6 @@ packimage_m_tar_c_xz packimage_o_p_a_m reg_linux_statelite_installation_hierarchy_by_nfs reg_linux_statelite_installation_hierarchy_by_ramdisk -addkit_v -addkit_h -addkit_kit -addkit_i -addkit_multikit -addkit_p -addkitcomp_v -addkitcomp_h -addkitcomp_i -addkitcomp_f -buildkit_v -buildkit_h -buildkit_create -buildkit_create_l -buildkit_cleanrepo_all -buildkit_buildtar -chkkitcomp_v -chkkitcomp_h -chkkitcomp_V -lskit_v -lskit_h -lskit_F -lskit_K -lskit_R -lskit_C -lskitcomp_v -lskitcomp_h -lskitcomp_C -lskitcomp_S -lskitdeployparam_v -lskitdeployparam_h -lskitdeployparam_no_param -lskitdeployparam_k_1 -lskitdeployparam_c_1 -rmkit_v -rmkit_h -rmkit_t_no -rmkit_t_yes -rmkit_f -rmkit_V -rmkitcomp_v -rmkitcomp_h bmcdiscover_h bmcdiscover_nmap_range bmcdiscover_v @@ -70,6 +28,4 @@ reg_linux_statelite_installation_flat rmimage_diskless rpower_reset runcmdinstaller_command -redhat_migration1 -redhat_migration2 linux_diskless_kdump diff --git a/xCAT-test/autotest/bundle/rhels_x86_weekly.bundle b/xCAT-test/autotest/bundle/rhels_x86_weekly.bundle index a06f89c06..b33107385 100644 --- a/xCAT-test/autotest/bundle/rhels_x86_weekly.bundle +++ b/xCAT-test/autotest/bundle/rhels_x86_weekly.bundle @@ -9,48 +9,6 @@ packimage_m_tar_c_xz packimage_o_p_a_m reg_linux_statelite_installation_hierarchy_by_nfs reg_linux_statelite_installation_hierarchy_by_ramdisk -addkit_v -addkit_h -addkit_kit -addkit_i -addkit_multikit -addkit_p -addkitcomp_v -addkitcomp_h -addkitcomp_i -addkitcomp_f -buildkit_v -buildkit_h -buildkit_create -buildkit_create_l -buildkit_cleanrepo_all -buildkit_buildtar -chkkitcomp_v -chkkitcomp_h -chkkitcomp_V -lskit_v -lskit_h -lskit_F -lskit_K -lskit_R -lskit_C -lskitcomp_v -lskitcomp_h -lskitcomp_C -lskitcomp_S -lskitdeployparam_v -lskitdeployparam_h -lskitdeployparam_no_param -lskitdeployparam_k_1 -lskitdeployparam_c_1 -rmkit_v -rmkit_h -rmkit_t_no -rmkit_t_yes -rmkit_f -rmkit_V -rmkitcomp_v -rmkitcomp_h bmcdiscover_h bmcdiscover_nmap_range bmcdiscover_v @@ -70,5 +28,3 @@ reg_linux_statelite_installation_flat rmimage_diskless rpower_reset runcmdinstaller_command -redhat_migration1 -redhat_migration2 diff --git a/xCAT-test/autotest/testcase/UT_openbmc/rspconfig_cases0 b/xCAT-test/autotest/testcase/UT_openbmc/rspconfig_cases0 index d6cac63f8..9f7fc6ef1 100644 --- a/xCAT-test/autotest/testcase/UT_openbmc/rspconfig_cases0 +++ b/xCAT-test/autotest/testcase/UT_openbmc/rspconfig_cases0 @@ -1,13 +1,13 @@ start:rspconfig_record_firmware_level -description: Record the firmware level for the start of each testcase +description: Record the firmware level for the start of each testcase to display in the output hcp:openbmc label:cn_bmc_ready,hctrl_openbmc cmd: rinv $$CN firm check:rc==0 end -start:rspconfig_get_all -description: Check that we can get all the attributes from the BMC +start:rspconfig_get_all_network +description: Check that we can get all the network related attributes from the BMC os:Linux hcp:openbmc label:cn_bmc_ready,hctrl_openbmc @@ -70,7 +70,168 @@ check:output=~$$CN: BMC Setting BMC Hostname... cmd:rspconfig $$CN hostname check:rc==0 check:output=~$$CN: BMC Hostname: -cmd:rm /tmp/xcattest.rspconfig.hostname + AutoReboot check:rc==0 end +start:rspconfig_admin_passwd_error +description: Check the error handling for changing of BMC password +hcp: openbmc +label:cn_bmc_ready,hctrl_openbmc +cmd: rspconfig $$CN admin_passwd=abc +check:rc==1 +check:output=~$$CN: Error: Invalid parameter for option admin_passwd: abc +cmd: rspconfig $$CN admin_passwd=abc,xyz +check:rc==1 +check:output=~Current BMC password is incorrect, cannot set the new password. +end + +start:rspconfig_admin_passwd +description: Check the setting of BMC password to the same value +hcp: openbmc +label:cn_bmc_ready,hctrl_openbmc +cmd: rspconfig $$CN admin_passwd=0penBmc,0penBmc +check:rc==0 +check:output=~$$CN: BMC Setting Password +end + +start:rspconfig_autoreboot +description: Check the getting and setting of autoreboot attribute +hcp: openbmc +label:cn_bmc_ready,hctrl_openbmc +cmd: rspconfig $$CN autoreboot +check:rc==0 +check:output=~$$CN: BMC AutoReboot +cmd: rspconfig $$CN autoreboot=0 +check:rc==0 +check:output=~$$CN: BMC Setting BMC AutoReboot +cmd: rspconfig $$CN autoreboot=1 +check:rc==0 +check:output=~$$CN: BMC Setting BMC AutoReboot +cmd: rspconfig $$CN autoreboot= +check:rc==1 +check:output=~$$CN: Error: Invalid value '' for 'autoreboot', Valid values: 0,1 +cmd: rspconfig $$CN autoreboot=2 +check:rc==1 +check:output=~$$CN: Error: Invalid value '2' for 'autoreboot', Valid values: 0,1 +end + +start:rspconfig_bootmode +description: Check the getting and setting of bootmode attribute +hcp: openbmc +label:cn_bmc_ready,hctrl_openbmc +cmd: rspconfig $$CN bootmode=safe +check:rc==0 +check:output=~$$CN: BMC Setting BMC BootMode +cmd: rspconfig $$CN bootmode +check:rc==0 +check:output=~$$CN: BMC BootMode: Safe +cmd: rspconfig $$CN bootmode=regular +check:rc==0 +check:output=~$$CN: BMC Setting BMC BootMode +cmd: rspconfig $$CN bootmode=abc +check:rc==1 +check:output=~$$CN: Error: Invalid value 'abc' for 'bootmode', Valid values: regular,safe,setup +end + +start:rspconfig_dump +description: Check dump generation, download and removal +hcp: openbmc +label:cn_bmc_ready,hctrl_openbmc +#Clear old dumps for this node +cmd: rm -f /var/log/xcat/dump/*$$CN* +#Generate new dump +cmd: rspconfig $$CN dump +check:rc==0 +check:output=~Capturing BMC Diagnostic information, this will take some time +check:output=~$$CN: Dump requested. Target ID is +check:output=~Downloading dump +#Verify dump was downloaded to proper directory +cmd: ls -l /var/log/xcat/dump/*$$CN* +check:rc==0 +#Remove last generated dump +cmd: rspconfig mid05tor12cn03 dump -l | tail -1 | cut -d ' ' -f2 | tr -d "[]" | xargs -i{} rspconfig $$CN dump -c {} +check:rc==0 +check:output=clear +end + +start:rspconfig_ntpservers +description: Check the getting and setting of ntpservers attribute +hcp: openbmc +label:cn_bmc_ready,hctrl_openbmc +cmd: rspconfig $$CN ntpservers +check:rc==0 +check:output=~$$CN: BMC NTP Servers +cmd: rspconfig $$CN ntpservers=1.1.1.1 +check:rc==0 +check:output=~$$CN: BMC NTP Servers: 1.1.1.1 +cmd: rspconfig $$CN ntpservers= +check:rc==0 +check:output=~$$CN: BMC NTP Servers: None +end + +start:rspconfig_powerrestorepolicy +description: Check the getting and setting of powerrestorepolicy attribute +hcp: openbmc +label:cn_bmc_ready,hctrl_openbmc +cmd: rspconfig $$CN powerrestorepolicy +check:rc==0 +check:output=~$$CN: BMC PowerRestorePolicy +cmd: rspconfig $$CN powerrestorepolicy=always_on +check:rc==0 +check:output=~$$CN: BMC Setting BMC PowerRestorePolicy +cmd: rspconfig $$CN powerrestorepolicy=always_off +check:rc==0 +check:output=~$$CN: BMC Setting BMC PowerRestorePolicy +cmd: rspconfig $$CN powerrestorepolicy=restore +check:rc==0 +check:output=~$$CN: BMC Setting BMC PowerRestorePolicy +cmd: rspconfig $$CN powerrestorepolicy +check:rc==0 +check:output=~$$CN: BMC PowerRestorePolicy: Restore +cmd: rspconfig $$CN powerrestorepolicy= +check:rc==1 +check:output=~$$CN: Error: Invalid value '' for 'powerrestorepolicy', Valid values: always_off,always_on,restore +cmd: rspconfig $$CN powerrestorepolicy=abc +check:rc==1 +check:output=~$$CN: Error: Invalid value 'abc' for 'powerrestorepolicy', Valid values: always_off,always_on,restore +end + +start:rspconfig_powersupplyredundancy +description: Check the getting and setting of powersupplyredundancy attribute +hcp: openbmc +label:cn_bmc_ready,hctrl_openbmc +cmd: rspconfig $$CN powersupplyredundancy=disabled +check:rc==1 +check:output=~Error: 404 Not Found - Requested endpoint does not exist or may indicate function is not supported on this OpenBMC firmware. +cmd: rspconfig $$CN powersupplyredundancy +check:rc==0 +check:output=~$$CN: BMC PowerSupplyRedundancy: Disabled +end + +start:rspconfig_sshcfg +description: Check the copying of ssh keys to the BMC +hcp: openbmc +label:cn_bmc_ready,hctrl_openbmc +cmd: rspconfig $$CN sshcfg +check:rc==0 +check:output=~$$CN: ssh keys copied to +end + +start:rspconfig_timesyncmethod +description: Check the getting and setting of timesyncmethod attribute +hcp: openbmc +label:cn_bmc_ready,hctrl_openbmc +cmd: rspconfig $$CN timesyncmethod=manual +check:rc==0 +check:output=~$$CN: BMC Setting BMC TimeSyncMethod +cmd: rspconfig $$CN timesyncmethod +check:rc==0 +check:output=~$$CN: BMC TimeSyncMethod: Manual +cmd: rspconfig $$CN timesyncmethod=ntp +check:rc==0 +check:output=~$$CN: BMC Setting BMC TimeSyncMethod +cmd: rspconfig $$CN timesyncmethod=abc +check:rc==1 +check:output=~$$CN: Error: Invalid value 'abc' for 'timesyncmethod', Valid values: manual,ntp +end diff --git a/xCAT-test/autotest/testcase/addkitcomp/case0 b/xCAT-test/autotest/testcase/addkitcomp/case0 index 1265e1d4d..49dd8b561 100644 --- a/xCAT-test/autotest/testcase/addkitcomp/case0 +++ b/xCAT-test/autotest/testcase/addkitcomp/case0 @@ -39,7 +39,7 @@ check:rc==0 cmd:addkit /opt/xcat/share/xcat/tools/autotest/testcase/addkitcomp/mykits/mykits-1.0-1.tar.bz2 check:rc==0 check:output=~Kit mykits-1.0-1 was successfully added -cmd:mkdef testimage -u profile=compute provmethod=install osarch=__GETNODEATTR($$CN,arch)__ +cmd:if grep "CentOS Linux" /etc/*release;then osbasename=`lskit mykits-1.0-1 |grep -w osbasename|awk -F= '{print $2}'`;osmajorversion=`lskit mykits-1.0-1 |grep osmajorversion|awk -F= '{print $2}'`;osminorversion=`lskit mykits-1.0-1 |grep osminorversion|awk -F= '{print $2}'`;mkdef testimage -u profile=compute provmethod=install osarch=__GETNODEATTR($$CN,arch)__ osvers=$osbasename-$osmajorversion.$osminorversion;mkdef -t osdistro $osbasename-$osmajorversion.$osminorversion-__GETNODEATTR($$CN,arch)__ basename=$osbasename majorversion=$osmajorversion minorversion=$osminorversion arch=__GETNODEATTR($$CN,arch)__ type=Linux dirpaths=/install/$osbasename-$osmajorversion.$osminorversion/__GETNODEATTR($$CN,arch)__;else mkdef testimage -u profile=compute provmethod=install osarch=__GETNODEATTR($$CN,arch)__;fi check:rc==0 cmd:kitcompname=`lskit mykits-1.0-1 |grep kitcompname|awk -F= '{print $2}'`;addkitcomp -i testimage $kitcompname check:rc==0 @@ -48,6 +48,7 @@ cmd:kitcompname=`lskit mykits-1.0-1 |grep kitcompname|awk -F= '{print $2}'`;rmki check:rc==0 check:output=~Removing kitcomponent check:output=~were removed from osimage testimage successfully +cmd:if grep "CentOS Linux" /etc/*release;then osbasename=`lskit mykits-1.0-1 |grep -w osbasename|awk -F= '{print $2}'`;osmajorversion=`lskit mykits-1.0-1 |grep osmajorversion|awk -F= '{print $2}'`;osminorversion=`lskit mykits-1.0-1 |grep osminorversion|awk -F= '{print $2}'`;rmdef -t osdistro -o $osbasename-$osmajorversion.$osminorversion-__GETNODEATTR($$CN,arch)__;fi cmd:rmkit mykits-1.0-1 check:rc==0 cmd:rm -f /opt/xcat/share/xcat/tools/autotest/testcase/addkitcomp/mykits/mykits-1.0-1.tar.bz2 @@ -70,7 +71,7 @@ check:rc==0 cmd:addkit /opt/xcat/share/xcat/tools/autotest/testcase/addkitcomp/mykits/mykits-1.0-1.tar.bz2 check:rc==0 check:output=~Kit mykits-1.0-1 was successfully added -cmd:mkdef testimage -u profile=compute provmethod=install osarch=__GETNODEATTR($$CN,arch)__ +cmd:if grep "CentOS Linux" /etc/*release;then osbasename=`lskit mykits-1.0-1 |grep -w osbasename|awk -F= '{print $2}'`;osmajorversion=`lskit mykits-1.0-1 |grep osmajorversion|awk -F= '{print $2}'`;osminorversion=`lskit mykits-1.0-1 |grep osminorversion|awk -F= '{print $2}'`;mkdef testimage -u profile=compute provmethod=install osarch=__GETNODEATTR($$CN,arch)__ osvers=$osbasename-$osmajorversion.$osminorversion;mkdef -t osdistro $osbasename-$osmajorversion.$osminorversion-__GETNODEATTR($$CN,arch)__ basename=$osbasename majorversion=$osmajorversion minorversion=$osminorversion arch=__GETNODEATTR($$CN,arch)__ type=Linux dirpaths=/install/$osbasename-$osmajorversion.$osminorversion/__GETNODEATTR($$CN,arch)__;else mkdef testimage -u profile=compute provmethod=install osarch=__GETNODEATTR($$CN,arch)__;fi check:rc==0 cmd:kitcompname=`lskit mykits-1.0-1 |grep kitcompname|awk -F= '{print $2}'`;addkitcomp -f -i testimage $kitcompname check:rc==0 @@ -79,6 +80,7 @@ cmd:kitcompname=`lskit mykits-1.0-1 |grep kitcompname|awk -F= '{print $2}'`;rmki check:rc==0 check:output=~Removing kitcomponent check:output=~were removed from osimage testimage successfully +cmd:if grep "CentOS Linux" /etc/*release;then osbasename=`lskit mykits-1.0-1 |grep -w osbasename|awk -F= '{print $2}'`;osmajorversion=`lskit mykits-1.0-1 |grep osmajorversion|awk -F= '{print $2}'`;osminorversion=`lskit mykits-1.0-1 |grep osminorversion|awk -F= '{print $2}'`;rmdef -t osdistro -o $osbasename-$osmajorversion.$osminorversion-__GETNODEATTR($$CN,arch)__;fi cmd:rmkit mykits-1.0-1 check:rc==0 cmd:rm -f /opt/xcat/share/xcat/tools/autotest/testcase/addkitcomp/mykits/mykits-1.0-1.tar.bz2 diff --git a/xCAT-test/autotest/testcase/bmcdiscover/cases0 b/xCAT-test/autotest/testcase/bmcdiscover/cases0 index 5cc7fc0d7..169986750 100644 --- a/xCAT-test/autotest/testcase/bmcdiscover/cases0 +++ b/xCAT-test/autotest/testcase/bmcdiscover/cases0 @@ -73,7 +73,7 @@ label:others,discovery cmd:bmcdiscover --range $$bmcrange -u $$bmcusername -p $$bmcpasswd -w check:rc==0 check:output=~Writing node -check:output=~$$bmcrange,.+,.+,$$bmcusername,$$bmcpasswd +check:output=~$$bmcrange end diff --git a/xCAT-test/autotest/testcase/chdef/cases0 b/xCAT-test/autotest/testcase/chdef/cases0 index dc3c0ab03..dc84f1e40 100644 --- a/xCAT-test/autotest/testcase/chdef/cases0 +++ b/xCAT-test/autotest/testcase/chdef/cases0 @@ -153,12 +153,17 @@ end start:chdef_dynamic_group description:chdef with dynamic node group label:mn_only,ci_test,db +cmd:tabdump nodegroup +cmd:tabdump nodelist cmd:mkdef -t node -o testnode1-testnode2 mgt=hmc cons=hmc groups=all,systemp check:rc==0 +cmd:tabdump nodelist|grep testnode cmd:mkdef -t node -o testnode3-testnode4 mgt=hmc cons=ipmi groups=all,systemx check:rc==0 +cmd:tabdump nodelist|grep testnode cmd:mkdef -t group -o dyngrp -d -w cons==hmc check:rc==0 +cmd:tabdump nodegroup cmd:lsdef -s dyngrp check:rc==0 check:output=~testnode1 @@ -167,6 +172,7 @@ check:output!~testnode3 check:output!~testnode4 cmd:chdef -t group -o dyngrp -d -w mgt==hmc check:rc==0 +cmd:tabdump nodegroup cmd:lsdef -s dyngrp check:rc==0 check:output=~testnode1 @@ -175,6 +181,7 @@ check:output=~testnode3 check:output=~testnode4 cmd:chdef -t group -o dyngrp -d -p -w cons==hmc -w groups=~systemp check:rc==0 +cmd:tabdump nodegroup cmd:lsdef -s dyngrp check:rc==0 check:output=~testnode1 @@ -186,6 +193,7 @@ check:rc==0 check:output=~wherevals=mgt==hmc::cons==hmc::groups=~systemp cmd:chdef -t group -o dyngrp -d -m -w cons==hmc -w groups=~systemp check:rc==0 +cmd:tabdump nodegroup cmd:lsdef -s dyngrp check:output=~testnode1 check:output=~testnode2 @@ -193,6 +201,7 @@ check:output=~testnode3 check:output=~testnode4 cmd:rmdef -t group -o dyngrp check:rc==0 +cmd:tabdump nodegroup cmd:rmdef -t node -o testnode1-testnode4 check:rc==0 end diff --git a/xCAT-test/autotest/testcase/chkkitcomp/cases0 b/xCAT-test/autotest/testcase/chkkitcomp/cases0 index 2a8ea8935..0e46d2b1f 100644 --- a/xCAT-test/autotest/testcase/chkkitcomp/cases0 +++ b/xCAT-test/autotest/testcase/chkkitcomp/cases0 @@ -29,7 +29,7 @@ check:rc==0 cmd:addkit /opt/xcat/share/xcat/tools/autotest/testcase/chkkitcomp/mykits/mykits-1.0-1.tar.bz2 check:rc==0 check:output=~Kit mykits-1.0-1 was successfully added -cmd:mkdef testimage -u profile=compute provmethod=install osarch=__GETNODEATTR($$CN,arch)__ +cmd:if grep "CentOS Linux" /etc/*release;then osbasename=`lskit mykits-1.0-1 |grep -w osbasename|awk -F= '{print $2}'`;osmajorversion=`lskit mykits-1.0-1 |grep osmajorversion|awk -F= '{print $2}'`;osminorversion=`lskit mykits-1.0-1 |grep osminorversion|awk -F= '{print $2}'`;mkdef testimage -u profile=compute provmethod=install osarch=__GETNODEATTR($$CN,arch)__ osvers=$osbasename-$osmajorversion.$osminorversion;mkdef -t osdistro $osbasename-$osmajorversion.$osminorversion-__GETNODEATTR($$CN,arch)__ basename=$osbasename majorversion=$osmajorversion minorversion=$osminorversion arch=__GETNODEATTR($$CN,arch)__ type=Linux dirpaths=/install/$osbasename-$osmajorversion.$osminorversion/__GETNODEATTR($$CN,arch)__;else mkdef testimage -u profile=compute provmethod=install osarch=__GETNODEATTR($$CN,arch)__;fi check:rc==0 cmd:kitcompname=`lskit mykits-1.0-1 |grep kitcompname|awk -F= '{print $2}'`;addkitcomp -i testimage $kitcompname check:rc==0 @@ -42,6 +42,7 @@ check:rc==0 check:output=~compatible with osimage testimage cmd:kitcompname=`lskit mykits-1.0-1 |grep kitcompname|awk -F= '{print $2}'`;rmkitcomp -i testimage $kitcompname check:rc==0 +cmd:if grep "CentOS Linux" /etc/*release;then osbasename=`lskit mykits-1.0-1 |grep -w osbasename|awk -F= '{print $2}'`;osmajorversion=`lskit mykits-1.0-1 |grep osmajorversion|awk -F= '{print $2}'`;osminorversion=`lskit mykits-1.0-1 |grep osminorversion|awk -F= '{print $2}'`;rmdef -t osdistro -o $osbasename-$osmajorversion.$osminorversion-__GETNODEATTR($$CN,arch)__;fi cmd:rmkit mykits-1.0-1 check:rc==0 cmd:rm -f /opt/xcat/share/xcat/tools/autotest/testcase/chkkitcomp/mykits/mykits-1.0-1.tar.bz2 diff --git a/xCAT-test/autotest/testcase/confignetwork/cases0 b/xCAT-test/autotest/testcase/confignetwork/cases0 index 34bcc43b2..68ba386c5 100644 --- a/xCAT-test/autotest/testcase/confignetwork/cases0 +++ b/xCAT-test/autotest/testcase/confignetwork/cases0 @@ -226,7 +226,7 @@ check:rc==0 cmd:xdsh $$CN "rm -rf /tmp/backupnet/" cmd:xdsh $$CN "mkdir -p /tmp/backupnet/" check:rc==0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network-scripts/ifcfg-* /tmp/backupnet/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /etc/network/interfaces.d/* /tmp/backupnet/";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -rf /etc/sysconfig/network-scripts /tmp/backupnet/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /etc/network/interfaces.d/* /tmp/backupnet/;cp -f /etc/network/interfaces /tmp";else echo "Sorry,this is not supported os"; fi check:rc==0 cmd:cp -f /etc/hosts /etc/hosts.bak cmd:mkdef -t network -o 11_1_0_0-255_255_0_0 net=11.1.0.0 mask=255.255.0.0 mgtifname=$$SECONDNIC @@ -242,22 +242,24 @@ check:output=~aliases1-1 aliases1-1-1 check:output=~aliases1-2 cmd:updatenode $$CN -P confignetwork check:rc==0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cat /etc/network/interfaces.d/*";else echo "Sorry,this is not supported os"; fi +cmd:xdsh $$CN date +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network-scripts/ifcfg-*$$SECONDNIC*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cat /etc/network/interfaces.d/*";else echo "Sorry,this is not supported os"; fi check:output=~11.1.0.100 check:output=~BOOTPROTO=none|static -cmd:if grep SUSE /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC:1"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cat /etc/network/interfaces.d/*";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network-scripts/ifcfg-*$$SECONDNIC*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cat /etc/network/interfaces.d/*";else echo "Sorry,this is not supported os"; fi check:output=~12.1.0.100 check:output=~BOOTPROTO=none|static cmd:rmdef -t network -o 11_1_0_0-255_255_0_0 cmd:rmdef -t network -o 12_1_0_0-255_255_0_0 cmd:xdsh $$CN "ip addr del 11.1.0.100/16 dev $$SECONDNIC" cmd:xdsh $$CN "ip addr del 12.1.0.100/16 dev $$SECONDNIC" -cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC:1"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -f /etc/network/interfaces.d/$$SECONDNIC /etc/network/interfaces.d/$$SECONDNIC:1";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -f /etc/network/interfaces.d/$$SECONDNIC /etc/network/interfaces.d/$$SECONDNIC:1";else echo "Sorry,this is not supported os"; fi check:rc==0 +cmd:xdsh $$CN "systemctl status NetworkManager >/dev/null 2>/dev/null && which nmcli >/dev/null 2>/dev/null && nmcli con reload" cmd:if [ -e /tmp/CN.standa ]; then rmdef $$CN; cat /tmp/CN.standa | mkdef -z; rm -rf /tmp/CN.standa; fi check:rc==0 cmd:mv -f /etc/hosts.bak /etc/hosts -cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network-scripts/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/network/interfaces.d/";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -rf /tmp/backupnet/network-scripts /etc/sysconfig/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/network/interfaces.d/;cp -f /tmp/interfaces /etc/network/";else echo "Sorry,this is not supported os"; fi cmd:xdsh $$CN "rm -rf /tmp/backupnet/" end @@ -269,7 +271,7 @@ check:rc==0 cmd:xdsh $$CN "rm -rf /tmp/backupnet/" cmd:xdsh $$CN "mkdir -p /tmp/backupnet/" check:rc==0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network-scripts/ifcfg-* /tmp/backupnet/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /etc/network/interfaces.d/* /tmp/backupnet/";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -rf /etc/sysconfig/network-scripts /tmp/backupnet/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /etc/network/interfaces.d/* /tmp/backupnet/;cp -f /etc/network/interfaces /tmp";else echo "Sorry,this is not supported os"; fi check:rc==0 cmd:cp -f /etc/hosts /etc/hosts.bak cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var3=100.;var4=`echo $cnip |awk -F. '{print $2}'`;var5=.0.0;secondnet=$var3$var4$var5;mkdef -t network -o confignetworks_test1 net=$secondnet mask=255.255.0.0 mgtifname=$$SECONDNIC @@ -285,26 +287,28 @@ check:output=~$$CN-$$SECONDNIC-1 check:output=~$$CN-$$SECONDNIC-2 cmd:updatenode $$CN -P confignetwork check:rc==0 -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var3=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;second1ip=$var1$var3;if grep SUSE /etc/*release;then xdsh $$CN "grep $second1ip /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep $second1ip /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep $second1ip /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var3=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;second1ip=$var1$var3;if grep SUSE /etc/*release;then xdsh $$CN "grep $second1ip /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep $second1ip /etc/sysconfig/network-scripts/ifcfg-*$$SECONDNIC*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep $second1ip /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi check:rc==0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cat /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network-scripts/ifcfg-*$$SECONDNIC*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cat /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi check:output=~BOOTPROTO=none|static check:output=~CONNECTED_MODE=yes|CONNECTED_MODE yes -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=101;var3=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;second1ip=$var1$var3;if grep SUSE /etc/*release;then xdsh $$CN "grep $second1ip /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep $second1ip /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC:1"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep $second1ip /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=101;var3=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;second1ip=$var1$var3;if grep SUSE /etc/*release;then xdsh $$CN "grep $second1ip /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep $second1ip /etc/sysconfig/network-scripts/ifcfg-*$$SECONDNIC*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep $second1ip /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi check:rc==0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC:1"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cat /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network-scripts/ifcfg-*$$SECONDNIC*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cat /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi check:output=~CONNECTED_MODE=yes|CONNECTED_MODE yes check:output=~BOOTPROTO=none|static cmd:rmdef -t network -o confignetworks_test1 cmd:rmdef -t network -o confignetworks_test2 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC:1"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -f /etc/network/interfaces.d/$$SECONDNIC /etc/network/interfaces.d/$$SECONDNIC:1";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -f /etc/network/interfaces.d/$$SECONDNIC /etc/network/interfaces.d/$$SECONDNIC:1";else echo "Sorry,this is not supported os"; fi check:rc==0 cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;second1ip=$var1$var2;xdsh $$CN "ip addr del $second1ip/16 dev $$SECONDNIC" cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=101;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;second1ip=$var1$var2;xdsh $$CN "ip addr del $second1ip/16 dev $$SECONDNIC" cmd:if [ -e /tmp/CN.standa ]; then rmdef $$CN; cat /tmp/CN.standa | mkdef -z; rm -rf /tmp/CN.standa; fi check:rc==0 cmd:mv -f /etc/hosts.bak /etc/hosts -cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network-scripts/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/network/interfaces.d/";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -rf /tmp/backupnet/network-scripts /etc/sysconfig/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/network/interfaces.d/;cp -f /tmp/interfaces /etc/network/";else echo "Sorry,this is not supported os"; fi +check:rc==0 +cmd:xdsh $$CN "systemctl status NetworkManager >/dev/null 2>/dev/null && which nmcli >/dev/null 2>/dev/null && nmcli con reload" cmd:xdsh $$CN "rm -rf /tmp/backupnet/" end @@ -379,6 +383,7 @@ cmd:rmdef -t network -o 11_1_0_0-255_255_0_0 check:rc==0 cmd:if [ -e /tmp/CN.standa ]; then rmdef $$CN; cat /tmp/CN.standa | mkdef -z; rm -rf /tmp/CN.standa; fi check:rc==0 +cmd:chtab -d node=$$CN nics end start:confignetwork_disable_set_to_1 @@ -400,6 +405,7 @@ cmd:rmdef -t network -o 11_1_0_0-255_255_0_0 check:rc==0 cmd:if [ -e /tmp/CN.standa ]; then rmdef $$CN; cat /tmp/CN.standa | mkdef -z; rm -rf /tmp/CN.standa; fi check:rc==0 +cmd:chtab -d node=$$CN nics end start:confignetwork_niccustomscripts @@ -428,6 +434,7 @@ cmd:rmdef -t network -o 11_1_0_0-255_255_0_0 cmd:if [ -e /tmp/CN.standa ]; then rmdef $$CN; cat /tmp/CN.standa | mkdef -z; rm -rf /tmp/CN.standa; fi check:rc==0 cmd:rm -rf /tmp/script1 /install/postscripts/script1 +cmd:chtab -d node=$$CN nics end start:confignetwork_secondarynic_thirdnic_multiplevalue_updatenode @@ -438,7 +445,7 @@ check:rc==0 cmd:xdsh $$CN "rm -rf /tmp/backupnet/" cmd:xdsh $$CN "mkdir -p /tmp/backupnet/" check:rc==0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network-scripts/ifcfg-* /tmp/backupnet/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /etc/network/interfaces.d/* /tmp/backupnet/";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -rf /etc/sysconfig/network-scripts /tmp/backupnet/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /etc/network/interfaces.d/* /tmp/backupnet/;cp -f /etc/network/interfaces /tmp";else echo "Sorry,this is not supported os"; fi check:rc==0 cmd:mkdef -t network -o 11_1_0_0-255_255_0_0 net=11.1.0.0 mask=255.255.0.0 mgtifname=$$SECONDNIC check:rc==0 @@ -463,21 +470,22 @@ check:output=~$$CN-$$THIRDNIC-1 check:output=~$$CN-$$THIRDNIC-2 cmd:updatenode $$CN -P confignetwork check:rc==0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi +cmd:xdsh $$CN date +cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/sysconfig/network-scripts/ifcfg-*$$SECONDNIC*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 11.1.0.100 /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi check:output=~11.1.0.100 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 12.1.0.100 /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep 12.1.0.100 /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC:1"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 12.1.0.100 /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 12.1.0.100 /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep 12.1.0.100 /etc/sysconfig/network-scripts/ifcfg-*$$SECONDNIC*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 12.1.0.100 /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi check:output=~12.1.0.100 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 13.1.0.200 /etc/sysconfig/network/ifcfg-$$THIRDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep 13.1.0.200 /etc/sysconfig/network-scripts/ifcfg-$$THIRDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 13.1.0.200 /etc/network/interfaces.d/$$THIRDNIC";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 13.1.0.200 /etc/sysconfig/network/ifcfg-$$THIRDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep 13.1.0.200 /etc/sysconfig/network-scripts/ifcfg-*$$THIRDNIC*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 13.1.0.200 /etc/network/interfaces.d/$$THIRDNIC";else echo "Sorry,this is not supported os"; fi check:output=~13.1.0.200 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 14.1.0.100 /etc/sysconfig/network/ifcfg-$$THIRDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep 14.1.0.100 /etc/sysconfig/network-scripts/ifcfg-$$THIRDNIC:1"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 14.1.0.100 /etc/network/interfaces.d/$$THIRDNIC";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 14.1.0.100 /etc/sysconfig/network/ifcfg-$$THIRDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep 14.1.0.100 /etc/sysconfig/network-scripts/ifcfg-*$$THIRDNIC*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 14.1.0.100 /etc/network/interfaces.d/$$THIRDNIC";else echo "Sorry,this is not supported os"; fi check:output=~14.1.0.100 cmd:rmdef -t network -o 11_1_0_0-255_255_0_0 cmd:rmdef -t network -o 12_1_0_0-255_255_0_0 cmd:rmdef -t network -o 13_1_0_0-255_255_0_0 cmd:rmdef -t network -o 14_1_0_0-255_255_0_0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC:1"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$SECONDNIC /etc/network/interfaces.d/$$SECONDNIC:1";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$SECONDNIC /etc/network/interfaces.d/$$SECONDNIC:1";else echo "Sorry,this is not supported os"; fi check:rc==0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$THIRDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts/ifcfg-$$THIRDNIC /etc/sysconfig/network-scripts/ifcfg-$$THIRDNIC:1"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$THIRDNIC /etc/network/interfaces.d/$$THIRDNIC:1";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$THIRDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$THIRDNIC /etc/network/interfaces.d/$$THIRDNIC:1";else echo "Sorry,this is not supported os"; fi check:rc==0 cmd:xdsh $$CN "ip addr del 11.1.0.100/16 dev $$SECONDNIC" cmd:xdsh $$CN "ip addr del 12.1.0.100/16 dev $$SECONDNIC" @@ -486,8 +494,11 @@ cmd:xdsh $$CN "ip addr del 14.1.0.100/16 dev $$THIRDNIC" cmd:if [ -e /tmp/CN.standa ]; then rmdef $$CN; cat /tmp/CN.standa | mkdef -z; rm -rf /tmp/CN.standa; fi check:rc==0 cmd:mv -f /etc/hosts.bak /etc/hosts -cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network-scripts/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/network/interfaces.d/";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -rf /tmp/backupnet/network-scripts /etc/sysconfig/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/network/interfaces.d/;cp -f /tmp/interfaces /etc/network/";else echo "Sorry,this is not supported os"; fi +check:rc==0 +cmd:xdsh $$CN "systemctl status NetworkManager >/dev/null 2>/dev/null && which nmcli >/dev/null 2>/dev/null && nmcli con reload" cmd:xdsh $$CN "rm -rf /tmp/backupnet/" +cmd:chtab -d node=$$CN nics end start:confignetwork_vlan_eth0 @@ -539,6 +550,7 @@ cmd:xdsh $$CN "if grep SUSE /etc/*release;then cp -f /tmp/backupnet/* /etc/sysco check:rc==0 cmd:xdsh $$CN "rm -rf /tmp/backupnet/ /tmp/interfaces" check:rc==0 +cmd:chtab -d node=$$CN nics end start:confignetwork_vlan_false @@ -556,7 +568,7 @@ cmd:chdef $$CN nicips.$$SECONDNIC=11.1.0.100 nictypes.$$SECONDNIC=Ethernet nicne check:rc==0 cmd:updatenode $$CN -P confignetwork check:rc==0 -cmd:xdsh $$CN "if grep SUSE /etc/*release;then grep 11.1.0.100 /etc/sysconfig/network/ifcfg-$$SECONDNIC; elif grep -E \"Red Hat|CentOS\" /etc/*release;then grep 11.1.0.100 /etc/sysconfig/network-scripts/ifcfg-*$$SECONDNIC; elif grep Ubuntu /etc/*release;then grep 11.1.0.100 /etc/network/interfaces.d/$$SECONDNIC;else echo \"Sorry,this is not supported os\"; fi" +cmd:xdsh $$CN "if grep SUSE /etc/*release;then grep 11.1.0.100 /etc/sysconfig/network/ifcfg-$$SECONDNIC; elif grep -E \"Red Hat|CentOS\" /etc/*release;then grep 11.1.0.100 /etc/sysconfig/network-scripts/ifcfg-*$$SECONDNIC*; elif grep Ubuntu /etc/*release;then grep 11.1.0.100 /etc/network/interfaces.d/$$SECONDNIC;else echo \"Sorry,this is not supported os\"; fi" check:output=~11.1.0.100 cmd:chdef $$CN nicips.$$SECONDNIC= nictypes.$$SECONDNIC= nicnetworks.$$SECONDNIC= check:rc==0 @@ -583,6 +595,7 @@ cmd:xdsh $$CN "if grep SUSE /etc/*release;then cp -f /tmp/backupnet/* /etc/sysco check:rc==0 cmd:xdsh $$CN "rm -rf /tmp/backupnet/ /tmp/interfaces" check:rc==0 +cmd:chtab -d node=$$CN nics end start:confignetwork_bond_eth2_eth3 @@ -638,6 +651,7 @@ check:rc==0 cmd:xdsh $$CN "systemctl status NetworkManager >/dev/null 2>/dev/null && which nmcli >/dev/null 2>/dev/null && nmcli con reload" cmd:xdsh $$CN "rm -rf /tmp/backupnet/ /tmp/interfaces" check:rc==0 +cmd:chtab -d node=$$CN nics end start:confignetwork_bond_false @@ -686,6 +700,7 @@ cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysco check:rc==0 cmd:xdsh $$CN "rm -rf /tmp/backupnet/ /tmp/interfaces" check:rc==0 +cmd:chtab -d node=$$CN nics end start:confignetwork_vlan_bond @@ -696,7 +711,7 @@ check:rc==0 cmd:xdsh $$CN "rm -rf /tmp/backupnet/" cmd:xdsh $$CN "mkdir -p /tmp/backupnet/" check:rc==0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network-scripts/ifcfg-* /tmp/backupnet/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /etc/network/interfaces.d/* /tmp/backupnet/";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -rf /etc/sysconfig/network-scripts /tmp/backupnet/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /etc/network/interfaces.d/* /tmp/backupnet/;cp -f /etc/network/interfaces /tmp";else echo "Sorry,this is not supported os"; fi cmd:if grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "yum -y install bridge-utils";fi cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var3=100.;var4=`echo $cnip |awk -F. '{print $2}'`;var5=.0.0;secondnet=$var3$var4$var5;mkdef -t network -o confignetworks_test1 net=$secondnet mask=255.255.0.0 mgtifname=$$SECONDNIC mtu=1500 check:rc==0 @@ -718,9 +733,9 @@ cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=102;var2=103;var3=`echo $cnip check:rc==0 cmd:updatenode $$CN -P confignetwork check:rc==0 -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=102;var3=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;bond2ip=$var1$var3;if grep SUSE /etc/*release;then xdsh $$CN "grep $bond2ip /etc/sysconfig/network/ifcfg-bond0.2"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep $bond2ip /etc/sysconfig/network-scripts/ifcfg-bond0.2"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep $bond2ip /etc/network/interfaces.d/bond0.2";else echo "Sorry,this is not supported os"; fi +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=102;var3=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;bond2ip=$var1$var3;if grep SUSE /etc/*release;then xdsh $$CN "grep $bond2ip /etc/sysconfig/network/ifcfg-bond0.2"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep $bond2ip /etc/sysconfig/network-scripts/ifcfg-*bond0.2*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep $bond2ip /etc/network/interfaces.d/bond0.2";else echo "Sorry,this is not supported os"; fi check:rc==0 -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var2=103;var3=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;bond3ip=$var2$var3;if grep SUSE /etc/*release;then xdsh $$CN "grep $bond3ip /etc/sysconfig/network/ifcfg-bond0.3"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep $bond3ip /etc/sysconfig/network-scripts/ifcfg-bond0.3"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep $bond3ip /etc/network/interfaces.d/bond0.3";else echo "Sorry,this is not supported os"; fi +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var2=103;var3=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;bond3ip=$var2$var3;if grep SUSE /etc/*release;then xdsh $$CN "grep $bond3ip /etc/sysconfig/network/ifcfg-bond0.3"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep $bond3ip /etc/sysconfig/network-scripts/ifcfg-*bond0.3*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep $bond3ip /etc/network/interfaces.d/bond0.3";else echo "Sorry,this is not supported os"; fi check:rc==0 cmd:xdsh $$CN "ls /sys/class/net" check:output=~bond0 @@ -729,10 +744,10 @@ check:output=~bond0.3 cmd:xdsh $$CN "cat /sys/class/net/bonding_masters" check:output=~bond0 cmd:rmdef -t network -o confignetworks_test1 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi check:rc==0 cmd:rmdef -t network -o confignetworks_test2 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$THIRDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts/ifcfg-$$THIRDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$THIRDNIC";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$THIRDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$THIRDNIC";else echo "Sorry,this is not supported os"; fi check:rc==0 cmd:rmdef -t network -o confignetworks_test3 cmd:rmdef -t network -o confignetworks_test4 @@ -744,14 +759,16 @@ cmd:xdsh $$CN "ip link del dev bond0" cmd:xdsh $$CN "ip link del dev bond0.2" cmd:xdsh $$CN "ip link del dev bond0.3" cmd:xdsh $$CN "echo -bond0 > /sys/class/net/bonding_masters" -cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-bond0 /etc/sysconfig/network/ifcfg-bond0.2 /etc/sysconfig/network/ifcfg-bond0.3"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts/ifcfg-bond0 /etc/sysconfig/network/ifcfg-bond0.2 /etc/sysconfig/network/ifcfg-bond0.3"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/bond0 /etc/sysconfig/network/ifcfg-bond0.2 /etc/sysconfig/network/ifcfg-bond0.3";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-bond0 /etc/sysconfig/network/ifcfg-bond0.2 /etc/sysconfig/network/ifcfg-bond0.3"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/bond0 /etc/sysconfig/network/ifcfg-bond0.2 /etc/sysconfig/network/ifcfg-bond0.3";else echo "Sorry,this is not supported os"; fi check:rc==0 cmd:if [ -e /tmp/CN.standa ]; then rmdef $$CN; cat /tmp/CN.standa | mkdef -z; rm -rf /tmp/CN.standa; fi check:rc==0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network-scripts/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/network/interfaces.d/;cp -f /tmp/interfaces /etc/network/";else echo "Sorry,this is not supported os"; fi -check:rc==0 +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -rf /tmp/backupnet/network-scripts /etc/sysconfig/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/network/interfaces.d/;cp -f /tmp/interfaces /etc/network/";else echo "Sorry,this is not supported os"; fi +check:rc==0 +cmd:xdsh $$CN "systemctl status NetworkManager >/dev/null 2>/dev/null && which nmcli >/dev/null 2>/dev/null && nmcli con reload" cmd:xdsh $$CN "rm -rf /tmp/backupnet/ /tmp/interfaces" check:rc==0 +cmd:chtab -d node=$$CN nics end start:confignetwork_2eth_bridge_br0 @@ -806,6 +823,7 @@ check:rc==0 cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -rf /tmp/backupnet/network-scripts /etc/sysconfig/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/network/interfaces.d/;cp -f /tmp/interfaces /etc/network/";else echo "Sorry,this is not supported os"; fi cmd:xdsh $$CN "systemctl status NetworkManager >/dev/null 2>/dev/null && which nmcli >/dev/null 2>/dev/null && nmcli con reload" cmd:xdsh $$CN "rm -rf /tmp/backupnet/ /tmp/interfaces" +cmd:chtab -d node=$$CN nics end start:confignetwork_2eth_bridge_br22_br33 @@ -816,7 +834,7 @@ check:rc==0 cmd:xdsh $$CN "rm -rf /tmp/backupnet/" cmd:xdsh $$CN "mkdir -p /tmp/backupnet/" check:rc==0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network-scripts/ifcfg-* /tmp/backupnet/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /etc/network/interfaces.d/* /tmp/backupnet/";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -rf /etc/sysconfig/network-scripts /tmp/backupnet/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /etc/network/interfaces.d/* /tmp/backupnet/;cp -f /etc/network/interfaces /tmp";else echo "Sorry,this is not supported os"; fi cmd:if grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "yum -y install bridge-utils";fi cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var3=100.;var4=`echo $cnip |awk -F. '{print $2}'`;var5=.0.0;secondnet=$var3$var4$var5;mkdef -t network -o confignetworks_test1 net=$secondnet mask=255.255.0.0 mgtifname=$$SECONDNIC check:rc==0 @@ -824,9 +842,6 @@ cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var2=`echo $cnip |sed -r ' check:rc==0 cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var3=101.;var4=`echo $cnip |awk -F. '{print $2}'`;var5=.0.0;secondnet=$var3$var4$var5;mkdef -t network -o confignetworks_test2 net=$secondnet mask=255.255.0.0 mgtifname=$$THIRDNIC check:rc==0 -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=101;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;second1ip=$var1$var2;chdef $$CN nicips.$$THIRDNIC=$second1ip nictypes.$$THIRDNIC=Ethernet nicnetworks.$$THIRDNIC=confignetworks_test2 -cmd:updatenode $$CN -P confignetwork -check:rc==0 cmd:chdef $$CN nicips.$$SECONDNIC= nictypes.$$SECONDNIC= nicnetworks.$$SECONDNIC= nicips.$$THIRDNIC= nictypes.$$THIRDNIC= nicnetworks.$$THIRDNIC= check:rc==0 cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var3=102.;var4=`echo $cnip |awk -F. '{print $2}'`;var5=.0.0;secondnet=$var3$var4$var5;mkdef -t network -o confignetworks_test3 net=$secondnet mask=255.255.0.0 @@ -836,9 +851,9 @@ cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=102;var2=103;var3=`echo $cnip check:rc==0 cmd:updatenode $$CN -P confignetwork check:rc==0 -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=102;var3=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;br22ip=$var1$var3;if grep SUSE /etc/*release;then xdsh $$CN "grep $br22ip /etc/sysconfig/network/ifcfg-br22"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep $br22ip /etc/sysconfig/network-scripts/ifcfg-br22"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep $br22ip /etc/network/interfaces.d/br22";else echo "Sorry,this is not supported os"; fi +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=102;var3=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;br22ip=$var1$var3;if grep SUSE /etc/*release;then xdsh $$CN "grep $br22ip /etc/sysconfig/network/ifcfg-br22"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep $br22ip /etc/sysconfig/network-scripts/ifcfg-*br22*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep $br22ip /etc/network/interfaces.d/br22";else echo "Sorry,this is not supported os"; fi check:rc==0 -cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=103;var3=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;br33ip=$var1$var3;if grep SUSE /etc/*release;then xdsh $$CN "grep $br33ip /etc/sysconfig/network/ifcfg-br33"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep $br33ip /etc/sysconfig/network-scripts/ifcfg-br33"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep $br33ip /etc/network/interfaces.d/br33";else echo "Sorry,this is not supported os"; fi +cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=103;var3=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;br33ip=$var1$var3;if grep SUSE /etc/*release;then xdsh $$CN "grep $br33ip /etc/sysconfig/network/ifcfg-br33"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep $br33ip /etc/sysconfig/network-scripts/ifcfg-*br33*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep $br33ip /etc/network/interfaces.d/br33";else echo "Sorry,this is not supported os"; fi check:rc==0 cmd:xdsh $$CN "ls /sys/class/net" check:output=~br22 @@ -846,10 +861,8 @@ check:output=~br33 cmd:xdsh $$CN "cat /sys/class/net/bonding_masters" check:output=~bond0 cmd:rmdef -t network -o confignetworks_test1 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi -check:rc==0 cmd:rmdef -t network -o confignetworks_test2 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$THIRDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts/ifcfg-$$THIRDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$THIRDNIC";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi check:rc==0 cmd:rmdef -t network -o confignetworks_test3 cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=102;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;br22ip=$var1$var2;xdsh $$CN "ip addr del $br22ip/16 dev br22" @@ -863,12 +876,15 @@ cmd:xdsh $$CN "ip link del dev bond0" cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=100;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;secondip=$var1$var2;xdsh $$CN "ip addr del $secondip/16 dev $$SECONDNIC" cmd:cnip=__GETNODEATTR($$CN,ip)__;echo $cnip;var1=101;var2=`echo $cnip |sed -r 's/[^\.]*(..\..*)/\1/'`;secondip=$var1$var2;xdsh $$CN "ip addr del $secondip/16 dev $$THIRDNIC" cmd:xdsh $$CN "echo -bond0 > /sys/class/net/bonding_masters" -cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-bond0 /etc/sysconfig/network/ifcfg-bond0.2 /etc/sysconfig/network/ifcfg-bond0.3 /etc/sysconfig/network/ifcfg-br22 /etc/sysconfig/network/ifcfg-br33"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts/ifcfg-bond0 /etc/sysconfig/network-scripts/ifcfg-bond0.2 /etc/sysconfig/network-scripts/ifcfg-bond0.3 /etc/sysconfig/network-scripts/ifcfg-br22 /etc/sysconfig/network-scripts/ifcfg-br33"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/bond0 /etc/network/interfaces.d/bond0.2 /etc/network/interfaces.d/bond0.3 /etc/network/interfaces.d/br22 /etc/network/interfaces.d/br33";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-bond0 /etc/sysconfig/network/ifcfg-bond0.2 /etc/sysconfig/network/ifcfg-bond0.3 /etc/sysconfig/network/ifcfg-br22 /etc/sysconfig/network/ifcfg-br33"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/bond0 /etc/network/interfaces.d/bond0.2 /etc/network/interfaces.d/bond0.3 /etc/network/interfaces.d/br22 /etc/network/interfaces.d/br33";else echo "Sorry,this is not supported os"; fi check:rc==0 cmd:if [ -e /tmp/CN.standa ]; then rmdef $$CN; cat /tmp/CN.standa | mkdef -z; rm -rf /tmp/CN.standa; fi check:rc==0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network-scripts/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/network/interfaces.d/;cp -f /tmp/interfaces /etc/network/";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -rf /tmp/backupnet/network-scripts /etc/sysconfig/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/network/interfaces.d/;cp -f /tmp/interfaces /etc/network/";else echo "Sorry,this is not supported os"; fi +check:rc==0 +cmd:xdsh $$CN "systemctl status NetworkManager >/dev/null 2>/dev/null && which nmcli >/dev/null 2>/dev/null && nmcli con reload" cmd:xdsh $$CN "rm -rf /tmp/backupnet/ /tmp/interfaces" +cmd:chtab -d node=$$CN nics end start:confignetwork_installnic_2eth_bridge_br22_br33 @@ -879,7 +895,7 @@ check:rc==0 cmd:xdsh $$CN "rm -rf /tmp/backupnet/" cmd:xdsh $$CN "mkdir -p /tmp/backupnet/" check:rc==0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network-scripts/ifcfg-* /tmp/backupnet/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /etc/network/interfaces.d/* /tmp/backupnet/";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /etc/sysconfig/network/ifcfg-* /tmp/backupnet/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -rf /etc/sysconfig/network-scripts /tmp/backupnet/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /etc/network/interfaces.d/* /tmp/backupnet/;cp -f /etc/network/interfaces /tmp";else echo "Sorry,this is not supported os"; fi cmd:if grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "yum -y install bridge-utils";fi cmd:mkdef -t network -o 11_1_0_0-255_255_0_0 net=11.1.0.0 mask=255.255.0.0 mgtifname=$$SECONDNIC check:rc==0 @@ -887,10 +903,6 @@ cmd:chdef $$CN nicips.$$SECONDNIC=11.1.0.100 nictypes.$$SECONDNIC=Ethernet nicne check:rc==0 cmd:mkdef -t network -o 12_1_0_0-255_255_0_0 net=12.1.0.0 mask=255.255.0.0 mgtifname=$$THIRDNIC check:rc==0 -cmd:chdef $$CN nicips.$$THIRDNIC=12.1.0.100 nictypes.$$THIRDNIC=Ethernet nicnetworks.$$THIRDNIC=12_1_0_0-255_255_0_0 -check:rc==0 -cmd:updatenode $$CN -P confignetwork -check:rc==0 cmd:chdef $$CN nicips.$$SECONDNIC= nictypes.$$SECONDNIC= nicnetworks.$$SECONDNIC= nicips.$$THIRDNIC= nictypes.$$THIRDNIC= nicnetworks.$$THIRDNIC= check:rc==0 cmd:mkdef -t network -o 30_5_0_0-255_255_0_0 net=30.5.0.0 mask=255.255.0.0 @@ -901,27 +913,25 @@ cmd:chdef $$CN nicdevices.br22=bond0.2 nicdevices.br33=bond0.3 nictypes.br22=bri check:rc==0 cmd:updatenode $$CN -P "confignetwork -s" check:rc==0 -cmd:installnic=`xdsh $$CN ip addr |grep __GETNODEATTR($$CN,ip)__|awk -F " " '{print $NF}'`; if grep SUSE /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network/ifcfg-$installnic"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network-scripts/ifcfg-$installnic"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cat /etc/network/interfaces.d/*";else echo "Sorry,this is not supported os"; fi +cmd:installnic=`xdsh $$CN ip addr |grep __GETNODEATTR($$CN,ip)__|awk -F " " '{print $NF}'`; if grep SUSE /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network/ifcfg-$installnic"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cat /etc/sysconfig/network-scripts/ifcfg-*$installnic*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cat /etc/network/interfaces.d/*";else echo "Sorry,this is not supported os"; fi check:rc==0 check:output=~__GETNODEATTR($$CN,ip)__ check:output=~BOOTPROTO=none|static -cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 30.5.106.8 /etc/sysconfig/network/ifcfg-br22"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep 30.5.106.8 /etc/sysconfig/network-scripts/ifcfg-br22"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 30.5.106.8 /etc/network/interfaces.d/br22";else echo "Sorry,this is not supported os"; fi +cmd:xdsh $$CN "cat /sys/class/net/bonding_masters" +check:output=~bond0 +cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 30.5.106.8 /etc/sysconfig/network/ifcfg-br22"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep 30.5.106.8 /etc/sysconfig/network-scripts/ifcfg-*br22*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 30.5.106.8 /etc/network/interfaces.d/br22";else echo "Sorry,this is not supported os"; fi check:output=~30.5.106.8 check:rc==0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 40.5.106.8 /etc/sysconfig/network/ifcfg-br33"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep 40.5.106.8 /etc/sysconfig/network-scripts/ifcfg-br33"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 40.5.106.8 /etc/network/interfaces.d/br33";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "grep 40.5.106.8 /etc/sysconfig/network/ifcfg-br33"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "grep 40.5.106.8 /etc/sysconfig/network-scripts/ifcfg-*br33*"; elif grep Ubuntu /etc/*release;then xdsh $$CN "grep 40.5.106.8 /etc/network/interfaces.d/br33";else echo "Sorry,this is not supported os"; fi check:output=~40.5.106.8 check:rc==0 cmd:xdsh $$CN "ls /sys/class/net" check:output=~br22 check:output=~br33 -cmd:xdsh $$CN "cat /sys/class/net/bonding_masters" -check:output=~bond0 cmd:rmdef -t network -o 11_1_0_0-255_255_0_0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts/ifcfg-$$SECONDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi -check:rc==0 +cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$SECONDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$SECONDNIC";else echo "Sorry,this is not supported os"; fi cmd:rmdef -t network -o 12_1_0_0-255_255_0_0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$THIRDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts/ifcfg-$$THIRDNIC"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$THIRDNIC";else echo "Sorry,this is not supported os"; fi -check:rc==0 +cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-$$THIRDNIC"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/$$THIRDNIC";else echo "Sorry,this is not supported os"; fi cmd:rmdef -t network -o 30_5_0_0-255_255_0_0 cmd:xdsh $$CN "ip addr del 30.5.106.8/16 dev br22" cmd:xdsh $$CN "ip link del dev br22" @@ -933,12 +943,14 @@ cmd:xdsh $$CN "ip link del dev bond0.3" cmd:xdsh $$CN "ip link del dev bond0" cmd:xdsh $$CN "ip addr del 11.1.0.100/16 dev $$SECONDNIC" cmd:xdsh $$CN "ip addr del 12.1.0.100/16 dev $$THIRDNIC" -cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-bond0 /etc/sysconfig/network/ifcfg-bond0.2 /etc/sysconfig/network/ifcfg-bond0.3 /etc/sysconfig/network/ifcfg-br22 /etc/sysconfig/network/ifcfg-br33"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts/ifcfg-bond0 /etc/sysconfig/network-scripts/ifcfg-bond0.2 /etc/sysconfig/network-scripts/ifcfg-bond0.3 /etc/sysconfig/network-scripts/ifcfg-br22 /etc/sysconfig/network-scripts/ifcfg-br33"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/bond0 /etc/network/interfaces.d/bond0.2 /etc/network/interfaces.d/bond0.3 /etc/network/interfaces.d/br22 /etc/network/interfaces.d/br33";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network/ifcfg-bond0 /etc/sysconfig/network/ifcfg-bond0.2 /etc/sysconfig/network/ifcfg-bond0.3 /etc/sysconfig/network/ifcfg-br22 /etc/sysconfig/network/ifcfg-br33"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "rm -rf /etc/sysconfig/network-scripts"; elif grep Ubuntu /etc/*release;then xdsh $$CN "rm -rf /etc/network/interfaces.d/bond0 /etc/network/interfaces.d/bond0.2 /etc/network/interfaces.d/bond0.3 /etc/network/interfaces.d/br22 /etc/network/interfaces.d/br33";else echo "Sorry,this is not supported os"; fi check:rc==0 +cmd:xdsh $$CN "systemctl status NetworkManager >/dev/null 2>/dev/null && which nmcli >/dev/null 2>/dev/null && nmcli con reload" cmd:if [ -e /tmp/CN.standa ]; then rmdef $$CN; cat /tmp/CN.standa | mkdef -z; rm -rf /tmp/CN.standa; fi check:rc==0 -cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network-scripts/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/network/interfaces.d/;cp -f /tmp/interfaces /etc/network/";else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -rf /tmp/backupnet/network-scripts /etc/sysconfig"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/network/interfaces.d/;cp -f /tmp/interfaces /etc/network/";else echo "Sorry,this is not supported os"; fi cmd:xdsh $$CN "rm -rf /tmp/backupnet/ /tmp/interfaces" +cmd:chtab -d node=$$CN nics end start:confignetwork__bridge_false @@ -972,6 +984,7 @@ cmd:if [ -e /tmp/CN.standa ]; then rmdef $$CN; cat /tmp/CN.standa | mkdef -z; rm check:rc==0 cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network/"; elif grep -E "Red Hat|CentOS" /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysconfig/network-scripts/"; elif grep Ubuntu /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/network/interfaces.d/;cp -f /tmp/interfaces /etc/network/";else echo "Sorry,this is not supported os"; fi cmd:xdsh $$CN "rm -rf /tmp/backupnet/ /tmp/interfaces" +cmd:chtab -d node=$$CN nics end start:confignetwork_static_installnic @@ -997,4 +1010,5 @@ cmd:if grep SUSE /etc/*release;then xdsh $$CN "cp -f /tmp/backupnet/* /etc/sysco cmd:xdsh $$CN "rm -rf /tmp/backupnet/ /tmp/interfaces" cmd:xdsh $$CN "if [ -f /etc/init.d/network ] ; then /etc/init.d/network restart ; elif [ -f /etc/init.d/networking ] ; then /etc/init.d/networking restart ; fi" cmd:xdsh $$CN "systemctl status NetworkManager >/dev/null 2>/dev/null && which nmcli >/dev/null 2>/dev/null && nmcli con reload" +cmd:chtab -d node=$$CN nics end diff --git a/xCAT-test/autotest/testcase/copycds/cases0 b/xCAT-test/autotest/testcase/copycds/cases0 index b1d796fd5..02e88d4df 100644 --- a/xCAT-test/autotest/testcase/copycds/cases0 +++ b/xCAT-test/autotest/testcase/copycds/cases0 @@ -9,6 +9,8 @@ check:output=~Copying media to /install/__GETNODEATTR($$CN,os)__/__GETNODEATTR($ check:output=~Media copy operation successful cmd:ls /install/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__ check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/copycds/copycds.sh __GETNODEATTR($$CN,os)__ +check:rc==0 end start:lskmodules_o diff --git a/xCAT-test/autotest/testcase/copycds/copycds.sh b/xCAT-test/autotest/testcase/copycds/copycds.sh new file mode 100755 index 000000000..6945d5492 --- /dev/null +++ b/xCAT-test/autotest/testcase/copycds/copycds.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +if [[ -z ${1} ]]; then + echo "ERROR, pass in the '\$OS' variable as the second argument" + exit 1 +fi +OS=${1} + +if [[ $OS != *"rhels"* ]]; then + echo "INFO: will not run this test for $OS" + exit 0 +fi + +MAJOR_OS_VER=`echo $OS | cut -d'.' -f1` +if [[ $OS == *"$MAJOR_OS_VER"* ]]; then + IFS=' +' + for image in `lsdef -t osimage -i template -c | grep $OS | grep "install"`; do + THE_NAME=`echo $image | cut -d' ' -f1` + THE_TEMPLATE=`echo $image | cut -d' ' -f2` + TEMPLATE_FILE=`echo $THE_TEMPLATE | cut -d= -f2` + + if [[ $TEMPLATE_FILE != *"$MAJOR_OS_VER"* ]]; then + echo "ERROR - template attribute not set correctly when copycds for $THE_NAME" + echo -e "ERROR - $TEMPLATE_FILE" + exit 1 + else + echo "Template file looks good for $THE_NAME" + echo -e "\t$THE_TEMPLATE" + fi + done +fi + +exit 0 diff --git a/xCAT-test/autotest/testcase/genesis/cases0 b/xCAT-test/autotest/testcase/genesis/cases0 index 5ebe97e30..ed1b4ee59 100644 --- a/xCAT-test/autotest/testcase/genesis/cases0 +++ b/xCAT-test/autotest/testcase/genesis/cases0 @@ -38,8 +38,12 @@ label:others,genesis description:very if computenode need to do nodeset shell in different net with master will success cmd:/opt/xcat/share/xcat/tools/autotest/testcase/genesis/test.sh --check xnba check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/genesis/test.sh -c +check:rc==0 cmd:/opt/xcat/share/xcat/tools/autotest/testcase/genesis/test.sh --check grub2 check:rc==0 +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/genesis/test.sh -c +check:rc==0 cmd:/opt/xcat/share/xcat/tools/autotest/testcase/genesis/test.sh --check petitboot check:rc==0 cmd:/opt/xcat/share/xcat/tools/autotest/testcase/genesis/test.sh -c diff --git a/xCAT-test/autotest/testcase/genesis/genesistest.pl b/xCAT-test/autotest/testcase/genesis/genesistest.pl index 8f4b9405f..3efbdc71a 100755 --- a/xCAT-test/autotest/testcase/genesis/genesistest.pl +++ b/xCAT-test/autotest/testcase/genesis/genesistest.pl @@ -68,18 +68,18 @@ if (!defined($noderange)) { } my $os = &get_os; if ($check_genesis_file) { - send_msg(2, "[$$]:Check genesis file..............."); + send_msg(2, "[$$]:Check if genesis packages are installed on mn..............."); &check_genesis_file(&get_arch); if ($?) { - send_msg(0, "genesis file not available"); + send_msg(0, "genesis packages are not installed"); } else { - send_msg(2, "genesis file available"); + send_msg(2, "genesis packages are installed"); } } my $master=`lsdef -t site -i master -c 2>&1 | awk -F'=' '{print \$2}'`; if (!$master) { $master=hostname(); } chomp($master); -print "master is $master\n"; +print "xcat management node is $master\n"; $nodestanza="/tmp/$noderange.stanza"; if (!(-e $nodestanza)) { `lsdef $noderange -z > $nodestanza`; @@ -89,15 +89,15 @@ if (!(-e $nodestanza)) { ####nodesetshell test for genesis #################################### if ($genesis_nodesetshell_test) { - send_msg(2, "[$$]:Running nodesetshell test..............."); + send_msg(2, "[$$]:Running nodeset NODE shell test..............."); `nodeset $noderange shell`; if ($?) { - send_msg(0, "[$$]:nodeset shell failed..............."); + send_msg(0, "[$$]:nodeset $noderange shell failed..............."); exit 1; } `rpower $noderange boot`; if ($?) { - send_msg(0, "[$$]:rpower node failed..............."); + send_msg(0, "[$$]:rpower $noderange failed..............."); exit 1; } #run nodeshell test @@ -112,7 +112,7 @@ if ($genesis_nodesetshell_test) { ####runcmd test for genesis #################################### if ($genesis_runcmd_test) { - send_msg(2, "[$$]:Running runcmd test..............."); + send_msg(2, "[$$]:Running nodeset NODE runcmd test..............."); if (&testxdsh(&rungenesiscmd(&get_arch))) { send_msg(0, "[$$]:Could not verify test results using xdsh..............."); exit 1; @@ -123,7 +123,7 @@ if ($genesis_runcmd_test) { ####runimg test for genesis ################################## if ($genesis_runimg_test) { - send_msg(2, "[$$]:Run runimg test..............."); + send_msg(2, "[$$]:Run nodeset NODE runimage test..............."); if (&testxdsh(&rungenesisimg)) { send_msg(0, "[$$]:Could not verify test results using xdsh ..............."); exit 1; @@ -135,12 +135,12 @@ if ($genesis_runimg_test) { ####clear test environment ################################### if ($clear_env) { - send_msg(2, "[$$]:clear genesis test enviroment..............."); + send_msg(2, "[$$]:Clear genesis test enviroment..............."); if (&clearenv(&get_arch)) { - send_msg(0, "[$$]:clear environment failed..............."); + send_msg(0, "[$$]:Clear environment failed..............."); exit 1; } - send_msg(2, "[$$]:clear genesis test enviroment success..............."); + send_msg(2, "[$$]:Clear genesis test enviroment success..............."); } ################################## #check_genesis_file @@ -160,7 +160,7 @@ sub check_genesis_file { $genesis_scripts = `rpm -qa | grep -i "xcat-genesis-scripts" | grep -i "$arch"`; } unless ($genesis_base and $genesis_scripts) { - send_msg(0, "xCAT-genesis for $arch did not be installed."); + send_msg(0, "xCAT-genesis for $arch is not installed."); return 1; } return 0; @@ -190,7 +190,7 @@ sub rungenesiscmd { $value = 3; #means runcmd test using test scripts user writes - send_msg(2, "runcmd scripts for test ready."); + send_msg(2, "runcmd scripts for test are ready."); } $genesis_bin_dir = "$genesis_base_dir/$arch/fs/bin"; copy("$runcmd_script", "$genesis_bin_dir"); @@ -219,19 +219,18 @@ sub rungenesisimg { $value = 2; #means runimg test using test scripts genesistest.pl writes - send_msg(2, "no runimg scripts for test prepared."); + send_msg(2, "no runimg scripts for test are prepared."); open(TESTIMG, ">$runimg_script") - or die "Can't open testscripts for writing: $!"; + or die "Can't open test scripts for writing: $!"; print TESTIMG join("\n", "#!/bin/bash"), "\n"; print TESTIMG join("\n", "#This is test for genesis scripts"), "\n"; print TESTIMG join("\n", "echo \"testimg\" >> $result"), "\n"; close(TESTIMG); - print "value is $value \n"; } else { $value = 3; #means runimg test using test scripts user writes - send_msg(2, "runimg scripts for test ready."); + send_msg(2, "runimg scripts for test are ready."); } copy("$runimg_script", "/install/my_image/runme.sh") or die "Copy failed: $!"; chmod 0755, "/install/my_image/runme.sh"; @@ -239,7 +238,7 @@ sub rungenesisimg { copy("/tmp/my_image.tgz", "/install/my_image") or die "Copy failed: $!"; `rinstall $noderange "runimage=http://$master/install/my_image/my_image.tgz",shell`; if ($?) { - send_msg(0, "rinstall noderange failed for runimg"); + send_msg(0, "rinstall noderange runimage=* failed\n"); } return $value; } @@ -248,7 +247,7 @@ sub rungenesisimg { ######################################### sub testxdsh { my $value = shift; - print "value is $value \n"; + print "The input parameter is $value \n"; my $checkstring; my $checkfile; if ($value == 1) { @@ -267,7 +266,7 @@ sub testxdsh { if ($?) { foreach (1 .. 10) { sleep 300; - send_msg(1,"try to run xdsh to check the results again"); + send_msg(1,"try to run xdsh $noderange to check the results again"); `xdsh $noderange -t 2 cat $checkfile 2>&1| grep $checkstring `; last if ($? == 0); } @@ -293,7 +292,7 @@ sub clearenv { unlink("$runmetar"); unlink("$runimg_script"); rmdir("$runmedir"); - send_msg(2, "clear runimage test environment"); + send_msg(2, "clear nodeset NODE runimage test environment"); } if (-e "$runcmd_script") { my $genesis_bin_dir = "$genesis_base_dir/$arch/fs/bin"; @@ -308,7 +307,7 @@ sub clearenv { } `rinstall $noderange boot`; if ($?) { - send_msg(0, "rinstall node failed"); + send_msg(0, "rinstall $noderange boot failed"); exit 1; } if (-e "$nodestanza") { @@ -374,6 +373,8 @@ sub send_msg { if (!open(LOGFILE, ">> $logfiledir/$logfile")) { return 1; } + + print "$date $$ $content $msg\n"; print LOGFILE "$date $$ $content $msg\n"; close LOGFILE; diff --git a/xCAT-test/autotest/testcase/genesis/test.sh b/xCAT-test/autotest/testcase/genesis/test.sh index 2509ed9de..bdd174318 100755 --- a/xCAT-test/autotest/testcase/genesis/test.sh +++ b/xCAT-test/autotest/testcase/genesis/test.sh @@ -1,79 +1,113 @@ #!/bin/bash -function check_destiny(){ -chdef testnode arch=ppc64le cons=ipmi groups=all ip=60.1.1.1 netboot=$NETBOOT; -masterip=`lsdef -t site -i master -c 2>&1 | awk -F'=' '{print $2}'`; -masternet=`ifconfig | awk "BEGIN{RS=\"\"}/\<$masterip\>/{print \$1}"|head -n 1 | awk -F ' ' '{print $1}'|awk -F ":" '{print \$1}' 2>&1`; -net2=`netstat -i -a|grep -v Kernel|grep -v Iface |grep -v lo|grep -v $masternet|head -n 1|awk '{print $1}'`;echo net2 is $net2; -net2ip=""; - if [[ -z $net2 ]];then - echo "could not verify the test" - return 1; +PATH="/opt/xcat/bin:/opt/xcat/sbin:/opt/xcat/share/xcat/tools:/usr/sbin:/usr/bin:/sbin:/bin:/root/bin" +export PATH +function runcmd(){ + echo "Run command $* ..." + result=`$*` + if [[ $? -eq 0 ]];then + echo -e "Run command $*... [Succeed]\n"; + return 0; else - net2ipstring=`ifconfig $net2 |grep inet|grep -v inet6`; - if [[ $? -eq 0 ]];then - net2ip=`ifconfig $net2 |grep inet|grep -v inet6|awk -F ' ' '{print $2}'|awk -F ":" '{print $2}'`; - if [[ -z $net2ip ]];then - net2ip=`ifconfig $net2 |grep inet|grep -v inet6|awk -F ' ' '{print $2}'`; - fi - else - net2ip=0.0.0.0; - fi - ifconfig $net2 60.3.3.3 ; - makehosts testnode; - nodeset testnode shell; - ifconfig $net2 "$net2ip"; - cat "$SHELLFOLDER"testnode |grep "xcatd=60.3.3.3:3001 destiny=shell"; - if [[ $? -eq 0 ]] ;then - return 0; - else - echo wrong; - return 1; - fi + echo -e "Run command $*... [Failed]\n"; + return 1; fi } -function clear_env(){ -makehosts -d testnode -rmdef testnode + +# We should be using private networks +TESTNODE=testnode +TESTNODE_IP="192.168.3.1" + +MASTER_PRIVATE_IP="192.168.1.1" +MASTER_PRIVATE_NETMASK="255.255.0.0" +MASTER_PRIVATE_NETWORK="192_168_0_0-255_255_0_0" + + +function check_destiny() { + cmd="chdef ${TESTNODE} arch=ppc64le cons=ipmi groups=all ip=${TESTNODE_IP} mac=4e:ee:ee:ee:ee:0e netboot=$NETBOOT"; + runcmd $cmd; + lsdef ${TESTNODE} + + MASTERIP=`lsdef -t site -i master -c 2>&1 | awk -F'=' '{print $2}'`; + MASTERNET=`ifconfig | awk "BEGIN{RS=\"\"}/\<$MASTERIP\>/{print \$1}"|head -n 1 | awk -F ' ' '{print $1}'|awk -F ":" '{print \$1}' 2>&1`; + NET2=`netstat -i -a|grep -v Kernel|grep -v Iface |grep -v lo|grep -v $MASTERNET|head -n 1|awk '{print $1}'`; + + echo "MASTERIP=$MASTERIP" + echo "MASTERNET=$MASTERNET" + echo "NET2=$NET2" + + if [[ -z $NET2 ]];then + echo "There is no second network, could not verify the test" + return 1; + else + cmd="ip addr add $MASTER_PRIVATE_IP/$MASTER_PRIVATE_NETMASK dev $NET2"; + runcmd $cmd; + cmd="makenetworks"; + runcmd $cmd; + ip addr show + makehosts ${TESTNODE} + grep ${TESTNODE} /etc/hosts + cmd="nodeset ${TESTNODE} shell"; + runcmd $cmd; + cmd="ip addr del $MASTER_PRIVATE_IP/$MASTER_PRIVATE_NETMASK dev $NET2"; + runcmd $cmd; + echo "Check if 'nodeset ${TESTNODE} shell' is added to ${SHELLFOLDER}/${TESTNODE}" + echo "===============================================" + cat "${SHELLFOLDER}/${TESTNODE}" + echo "===============================================" + cat "${SHELLFOLDER}/${TESTNODE}" |grep "xcatd=${MASTER_PRIVATE_IP}:3001 destiny=shell"; + if [[ $? -eq 0 ]] ;then + return 0; + else + echo "'nodeset ${TESTNODE} shell' FAILED"; + return 1; + fi + fi +} + +function clear_env() { + rmdef -t network -o ${MASTER_PRIVATE_NETWORK} + makehosts -d ${TESTNODE} + rmdef ${TESTNODE} if [[ $? -eq 0 ]];then return 0; else return 1; fi } + NETBOOT="" SHELLFOLDER="" -while [ "$#" -gt "0" ] -do - case $1 in - "--check" ) - NETBOOT=$2; - if [[ $NETBOOT =~ petitboot ]];then - SHELLFOLDER="/tftpboot/petitboot/"; - elif [[ $NETBOOT =~ xnba ]];then - SHELLFOLDER="/tftpboot/xcat/xnba/nodes/" - else - SHELLFOLDER="/tftpboot/boot/grub2/"; - fi - check_destiny ; - if [[ $? -eq 1 ]];then - exit 1 - else - exit 0 - fi - ;; - "-c"|"--clear" ) - clear_env; - if [[ $? -eq 1 ]];then - exit 1 - else - exit 0 - fi - ;; - *) - echo - echo "Please Insert $0: -cd|-c" - echo - exit 1; - ;; - esac +while [ "$#" -ge "0" ]; do + case $1 in + "--check" ) + NETBOOT=$2; + if [[ $NETBOOT =~ petitboot ]];then + SHELLFOLDER="/tftpboot/petitboot"; + elif [[ $NETBOOT =~ xnba ]];then + SHELLFOLDER="/tftpboot/xcat/xnba/nodes" + else + SHELLFOLDER="/tftpboot/boot/grub2"; + fi + check_destiny ; + if [[ $? -eq 1 ]];then + exit 1 + else + exit 0 + fi + ;; + "-c"|"--clear" ) + clear_env; + if [[ $? -eq 1 ]];then + exit 1 + else + exit 0 + fi + ;; + *) + echo + echo "Error: Usage: $0: -cd|-c" + echo + exit 1; + ;; + esac done diff --git a/xCAT-test/autotest/testcase/go_xcat/case0 b/xCAT-test/autotest/testcase/go_xcat/case0 index 5578faac9..dd9de6743 100644 --- a/xCAT-test/autotest/testcase/go_xcat/case0 +++ b/xCAT-test/autotest/testcase/go_xcat/case0 @@ -255,6 +255,7 @@ cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "dpkg -l |grep -i perl-xcat";els check:rc!=0 cmd:if xdsh $$CN "grep \"Red Hat\" /etc/*release >/dev/null"; then xdsh $$CN "yum install -y yum-utils bzip2"; fi check:rc==0 +cmd:if xdsh $$CN "grep Ubuntu /etc/*release >/dev/null"; then xdsh $$CN "apt-get install -y gnupg"; fi cmd:xdsh $$CN "cd /; scp -r $$MN:/opt/xcat/share/xcat/tools/go-xcat ./" check:rc==0 cmd:xdsh $$CN "cd /; scp -r $$MN:/core-*-snap.tar.bz2 /xcat-core.tar.bz2" diff --git a/xCAT-test/autotest/testcase/go_xcat/case1 b/xCAT-test/autotest/testcase/go_xcat/case1 index 134f0a843..007e083bb 100644 --- a/xCAT-test/autotest/testcase/go_xcat/case1 +++ b/xCAT-test/autotest/testcase/go_xcat/case1 @@ -43,6 +43,7 @@ cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "dpkg -l |grep -i perl-xcat";els check:rc!=0 cmd:if xdsh $$CN "grep \"Red Hat\" /etc/*release >/dev/null"; then xdsh $$CN "yum install -y yum-utils bzip2"; fi check:rc==0 +cmd:if xdsh $$CN "grep Ubuntu /etc/*release >/dev/null"; then xdsh $$CN "apt-get install -y gnupg"; fi cmd:xdsh $$CN "cd /; rm -rf /go-xcat" check:rc==0 cmd:xdsh $$CN "cd /; scp -r $$MN:/opt/xcat/share/xcat/tools/go-xcat ./" @@ -85,6 +86,7 @@ cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "dpkg -l |grep -i perl-xcat";els check:rc!=0 cmd:if xdsh $$CN "grep \"Red Hat\" /etc/*release >/dev/null"; then xdsh $$CN "yum install -y yum-utils bzip2"; fi check:rc==0 +cmd:if xdsh $$CN "grep Ubuntu /etc/*release >/dev/null"; then xdsh $$CN "apt-get install -y gnupg"; fi cmd:xdsh $$CN "cd /; rm -rf /go-xcat" check:rc==0 cmd:xdsh $$CN "cd /; scp -r $$MN:/opt/xcat/share/xcat/tools/go-xcat ./" diff --git a/xCAT-test/autotest/testcase/go_xcat/case2 b/xCAT-test/autotest/testcase/go_xcat/case2 index 98bdef85b..e8d8fd693 100644 --- a/xCAT-test/autotest/testcase/go_xcat/case2 +++ b/xCAT-test/autotest/testcase/go_xcat/case2 @@ -176,6 +176,7 @@ cmd:if grep Ubuntu /etc/*release;then xdsh $$CN "dpkg -l |grep -i perl-xcat";els check:rc!=0 cmd:if xdsh $$CN "grep \"Red Hat\" /etc/*release >/dev/null"; then xdsh $$CN "yum install -y yum-utils bzip2"; fi check:rc==0 +cmd:if xdsh $$CN "grep Ubuntu /etc/*release >/dev/null"; then xdsh $$CN "apt-get install -y gnupg"; fi cmd:xdsh $$CN "cd /; rm -rf /go-xcat" check:rc==0 cmd:xdsh $$CN "cd /; scp -r $$MN:/opt/xcat/share/xcat/tools/go-xcat ./" diff --git a/xCAT-test/autotest/testcase/infiniband/rhel-infiniband-diskfull-install.sh b/xCAT-test/autotest/testcase/infiniband/rhel-infiniband-diskfull-install.sh index 5729e2f56..332a863b7 100755 --- a/xCAT-test/autotest/testcase/infiniband/rhel-infiniband-diskfull-install.sh +++ b/xCAT-test/autotest/testcase/infiniband/rhel-infiniband-diskfull-install.sh @@ -135,10 +135,10 @@ mkdir -p /install/custom/install/rh : ) >"/install/custom/install/rh/mlnx.${LINUX_DISTRO%%.*}.${LINUX_ARCH}.otherpkgs.pkglist" -cp /opt/xcat/share/xcat/ib/scripts/Mellanox/mlnxofed_ib_install.v2 \ - /install/postscripts/mlnxofed_ib_install.v2 +cp /opt/xcat/share/xcat/ib/scripts/Mellanox/mlnxofed_ib_install \ + /install/postscripts/mlnxofed_ib_install -chdef "${COMPUTE_NODE}" "postscripts=syslog,remoteshell,syncfiles,mlnxofed_ib_install.v2 -p /install/mlnx/${MLNX_ISO##*/} -m --add-kernel-support" +chdef "${COMPUTE_NODE}" "postscripts=syslog,remoteshell,syncfiles,mlnxofed_ib_install -p /install/mlnx/${MLNX_ISO##*/} -m --add-kernel-support" rm -rf "${OSIMAGE_OTHERPKGDIR}" mkdir -p "${OSIMAGE_OTHERPKGDIR}" diff --git a/xCAT-test/autotest/testcase/infiniband/rhel-infiniband-diskless-install.sh b/xCAT-test/autotest/testcase/infiniband/rhel-infiniband-diskless-install.sh index b0c646118..494b16cfb 100755 --- a/xCAT-test/autotest/testcase/infiniband/rhel-infiniband-diskless-install.sh +++ b/xCAT-test/autotest/testcase/infiniband/rhel-infiniband-diskless-install.sh @@ -138,13 +138,13 @@ mkdir -p /install/custom/netboot/rh : ) >"/install/custom/netboot/rh/mlnx.${LINUX_DISTRO%%.*}.${LINUX_ARCH}.otherpkgs.pkglist" -cp /opt/xcat/share/xcat/ib/scripts/Mellanox/mlnxofed_ib_install.v2 \ - /install/postscripts/mlnxofed_ib_install.v2 +cp /opt/xcat/share/xcat/ib/scripts/Mellanox/mlnxofed_ib_install \ + /install/postscripts/mlnxofed_ib_install ( cat "/opt/xcat/share/xcat/netboot/rh/compute.${LINUX_DISTRO%%.*}.${LINUX_ARCH}.postinstall" cat <<-EOF - NODESETSTATE=genimage IMGROOTPATH=${OSIMAGE_ROOTIMGDIR}/rootimg bash -x /install/postscripts/mlnxofed_ib_install.v2 -p /install/mlnx/${MLNX_ISO##*/} -m --add-kernel-support + NODESETSTATE=genimage IMGROOTPATH=${OSIMAGE_ROOTIMGDIR}/rootimg bash -x /install/postscripts/mlnxofed_ib_install -p /install/mlnx/${MLNX_ISO##*/} -m --add-kernel-support EOF ) >"/install/custom/netboot/rh/mlnx.${LINUX_DISTRO%%.*}.${LINUX_ARCH}.postinstall" chmod 0755 "/install/custom/netboot/rh/mlnx.${LINUX_DISTRO%%.*}.${LINUX_ARCH}.postinstall" diff --git a/xCAT-test/autotest/testcase/install_xCAT/case0 b/xCAT-test/autotest/testcase/install_xCAT/case0 index 80d030fa9..35183600a 100644 --- a/xCAT-test/autotest/testcase/install_xCAT/case0 +++ b/xCAT-test/autotest/testcase/install_xCAT/case0 @@ -31,21 +31,32 @@ stop:yes cmd:arc_all=`uname -a`; code=`lsb_release -sc`;if [[ $arc_all =~ "ppc64le" ]]; then arch="ppc64el";else arch="x86_64";fi; cp "/opt/xcat/share/xcat/tools/autotest/testcase/go_xcat/$code-$arch.sources.list" "/etc/apt/sources.list" cmd:apt-get clean;apt-get update check:rc==0 +cmd:arc_all=`uname -a`; if [[ $arc_all =~ "x86_64" ]]; then echo '* libraries/restart-without-asking boolean true' | debconf-set-selections; fi +cmd:debconf-show libssl1.1 cmd:cp /core-*-snap.tar.bz2 /install_xCAT_xcat-core.tar.bz2 check:rc==0 cmd:cp /xcat-dep*.tar.bz2 /install_xCAT_xcat-dep.tar.bz2 check:rc==0 cmd:ls /go-xcat check:rc==0 +cmd:service goconserver status +cmd:service conserver status cmd:chmod 777 /go-xcat; /go-xcat --xcat-core=/install_xCAT_xcat-core.tar.bz2 --xcat-dep=/install_xCAT_xcat-dep.tar.bz2 -y install; check:rc==0 cmd:source "/etc/profile.d/xcat.sh";env;lsxcatd -v check:rc==0 check:output=~Version +cmd:service goconserver status +cmd:service conserver status cmd:service xcatd status check:rc==0 check:output=~running cmd:rm -rf /install_xCAT_xcat-core.tar.bz2 /install_xCAT_xcat-dep.tar.bz2 +cmd:service goconserver stop +cmd:service conserver stop +cmd:sleep 5 +cmd:service goconserver status +cmd:service conserver status end 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 c1bfd7c5c..b048d547a 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat @@ -33,6 +33,9 @@ check:rc==0 cmd:if [ ! -d /tmp/mountoutput ]; then mkdir -p /tmp/mountoutput; fi cmd:mount |sort > /tmp/mountoutput/file.org cmd:cat /tmp/mountoutput/file.org +cmd:if [[ "__GETNODEATTR($$CN,os)__" =~ "ubuntu18.04.2" ]] && [[ "__GETNODEATTR($$CN,arch)__" =~ ppc64(el|le) ]] && [[ "__GETNODEATTR($$CN,mgt)__" =~ "kvm" ]] ; then mkdir -p /install/custom/netboot/ubuntu; sed -e 's@linux-image-generic-hwe-18.04@linux-image-generic@g' /install/custom/netboot/ubuntu/compute.ubuntu18.04.2.ppc64el.pkglist; chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute pkglist=/install/custom/netboot/ubuntu/compute.ubuntu18.04.2.ppc64el.pkglist; fi +cmd:if [[ "__GETNODEATTR($$CN,os)__" =~ "ubuntu16.04.5" ]] && [[ "__GETNODEATTR($$CN,arch)__" =~ "x86" ]]; then chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute -p pkgdir="http://archive.ubuntu.com/ubuntu xenial universe main,http://archive.ubuntu.com/ubuntu xenial-updates universe main,http://security.ubuntu.com/ubuntu xenial-security main restricted";fi +cmd:lsdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute cmd:genimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute check:rc==0 cmd:mount |sort > /tmp/mountoutput/file.new diff --git a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat_postscripts_failed b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat_postscripts_failed index 1b0d15691..41391a68f 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat_postscripts_failed +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_flat_postscripts_failed @@ -37,6 +37,8 @@ check:rc==0 cmd:if [ ! -d /tmp/mountoutput ]; then mkdir -p /tmp/mountoutput; fi cmd:mount |sort > /tmp/mountoutput/file.org cmd:cat /tmp/mountoutput/file.org +cmd:if [[ "__GETNODEATTR($$CN,os)__" =~ "ubuntu16.04.5" ]] && [[ "__GETNODEATTR($$CN,arch)__" =~ "x86" ]]; then chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute -p pkgdir="http://archive.ubuntu.com/ubuntu xenial universe main,http://archive.ubuntu.com/ubuntu xenial-updates universe main,http://security.ubuntu.com/ubuntu xenial-security main restricted";fi +cmd:lsdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute cmd:genimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute check:rc==0 cmd:mount |sort > /tmp/mountoutput/file.new 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 b24aafdd1..bd8fe4876 100644 --- a/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy +++ b/xCAT-test/autotest/testcase/installation/reg_linux_diskless_installation_hierarchy @@ -37,6 +37,8 @@ check:rc==0 cmd:if [[ -f /test.synclist ]] ;then mv -f /test.synclist /test.synclist.bak;fi; cmd:echo "/test.synclist -> /test.synclist" > /test.synclist;chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute synclists=/test.synclist check:rc==0 +cmd:if [[ "__GETNODEATTR($$CN,os)__" =~ "ubuntu16.04.5" ]] && [[ "__GETNODEATTR($$CN,arch)__" =~ "x86" ]]; then chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute -p pkgdir="http://archive.ubuntu.com/ubuntu xenial universe main,http://archive.ubuntu.com/ubuntu xenial-updates universe main,http://security.ubuntu.com/ubuntu xenial-security main restricted";fi +cmd:lsdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute cmd:genimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute check:rc==0 cmd:packimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute diff --git a/xCAT-test/autotest/testcase/kdump/linux_diskless_kdump b/xCAT-test/autotest/testcase/kdump/linux_diskless_kdump index b357a0ba2..3ef555b2d 100644 --- a/xCAT-test/autotest/testcase/kdump/linux_diskless_kdump +++ b/xCAT-test/autotest/testcase/kdump/linux_diskless_kdump @@ -23,7 +23,7 @@ cmd:rootimgdir=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arc check:rc==0 cmd:pkglistfile=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute|grep pkglist|awk -F'=' '{print $2}'`;cp $pkglistfile $pkglistfile.bak -cmd:pkglistfile=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute|grep pkglist|awk -F'=' '{print $2}'`; if grep SUSE /etc/*release;then echo -e "kdump\nkexec-tools\nmakedumpfile\nat\n" >> $pkglistfile; elif grep "Red Hat" /etc/*release;then echo -e "kexec-tools\ncrash\nat\n" >> $pkglistfile;fi +cmd:pkglistfile=$(lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute|grep pkglist|awk -F'=' '{print $2}'); if grep SUSE /etc/*release;then echo -e "kdump\nkexec-tools\nmakedumpfile\nat\n" >> $pkglistfile; elif grep "Red Hat" /etc/*release;then echo -e "kexec-tools\ncrash\nat\n" >> $pkglistfile; elif grep "CentOS Linux" /etc/*release;then echo -e "kexec-tools\ncrash\nat\n" >> $pkglistfile;fi check:rc==0 cmd:exlistfile=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute|grep exlist|awk -F'=' '{print $2}'`;cp $exlistfile $exlistfile.bak @@ -31,14 +31,14 @@ cmd:exlistfile=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arc check:rc==0 cmd:postinstallfile=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute|grep postinstall|awk -F'=' '{print $2}'`;cp $postinstallfile $postinstallfile.bak -cmd:postinstallfile=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute|grep postinstall|awk -F'=' '{print $2}'`; if grep SUSE /etc/*release;then sed -i "/\/tmp/ s/10/500/g" $postinstallfile; elif grep "Red Hat" /etc/*release;then sed -i /devpts/a"tmpfs /var/tmp tmpfs defaults,size=500m 0 2" $postinstallfile;fi +cmd:postinstallfile=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute|grep postinstall|awk -F'=' '{print $2}'`; if grep SUSE /etc/*release;then sed -i "/\/tmp/ s/10/500/g" $postinstallfile; elif grep "Red Hat" /etc/*release;then sed -i /devpts/a"tmpfs /var/tmp tmpfs defaults,size=500m 0 2" $postinstallfile;elif grep "CentOS Linux" /etc/*release;then sed -i /devpts/a"tmpfs /var/tmp tmpfs defaults,size=500m 0 2" $postinstallfile;fi check:rc==0 -cmd:if [ ! -d /kdumpdir ]; then mkdir -p /kdumpdir && chmod 777 /kdumpdir; fi +cmd:if [ ! -d /opt/xcat/share/xcat/tools/autotest/kdumpdir ]; then mkdir -p /opt/xcat/share/xcat/tools/autotest/kdumpdir && chmod 777 /opt/xcat/share/xcat/tools/autotest/kdumpdir; fi cmd:if [ ! -f /etc/exports ] ;then touch /etc/exports;else cp /etc/exports /etc/exports.bak;fi -cmd:cat /etc/exports|grep kdumpdir; if [ "$?" -ne "0" ]; then echo "/kdumpdir *(rw,no_root_squash,sync,no_subtree_check)" >> /etc/exports; fi +cmd:cat /etc/exports|grep kdumpdir; if [ "$?" -ne "0" ]; then echo "/opt/xcat/share/xcat/tools/autotest/kdumpdir *(rw,no_root_squash,sync,no_subtree_check)" >> /etc/exports; fi cmd:cd /etc; export exports;cd -;service nfs-server restart -cmd:chdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute dump=nfs://$$MN/kdumpdir +cmd:chdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute dump=nfs://$$MN/opt/xcat/share/xcat/tools/autotest/kdumpdir check:rc==0 cmd:chdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute crashkernelsize=auto @@ -47,6 +47,7 @@ check:rc==0 cmd:chdef -t node $$CN -p postscripts=enablekdump check:rc==0 +cmd:rmimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute cmd:genimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute check:rc==0 cmd:packimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute @@ -68,14 +69,17 @@ check:output=~booted cmd:xdsh $$CN date check:rc==0 check:output=~\d\d:\d\d:\d\d - cmd:xdsh $$CN "echo 'echo 1 > /proc/sys/kernel/sysrq; echo c > /proc/sysrq-trigger' > /tmp/kdump.trigger" cmd:xdsh $$CN "chmod 755 /tmp/kdump.trigger" + +cmd:xdsh $$CN "rpm -q at" cmd:xdsh $$CN "service atd start" +check:rc==0 + cmd:xdsh $$CN "at now +1 minutes <<< /tmp/kdump.trigger" cmd:sleep 300 -cmd:vmcorefile=`find /kdumpdir/ -name vmcore`;if [[ -s $vmcorefile ]]; then echo "this file is not empty";else echo "this file is empty"; fi +cmd:vmcorefile=`find /opt/xcat/share/xcat/tools/autotest/kdumpdir/ -name vmcore`;if [[ -s $vmcorefile ]]; then echo "this file is not empty";else echo "this file is empty"; fi check:output=~not empty cmd:pkglistfile=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute|grep pkglist|awk -F'=' '{print $2}'`;mv -f $pkglistfile.bak $pkglistfile @@ -83,7 +87,7 @@ cmd:exlistfile=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arc cmd:postinstallfile=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute|grep postinstall|awk -F'=' '{print $2}'`;mv -f $postinstallfile.bak $postinstallfile cmd:if [ -f /etc/exports.bak ] ;then mv -f /etc/exports.bak /etc/exports; fi -cmd:rm -rf /kdumpdir +cmd:rm -rf /opt/xcat/share/xcat/tools/autotest/kdumpdir cmd:cat /tmp/node.stanza | chdef -z;rm -rf /tmp/node.stanza cmd:cat /tmp/osimage.stanza | chdef -z;rm -rf /tmp/osimage.stanza cmd:rootimgdir=`lsdef -t osimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute|grep rootimgdir|awk -F'=' '{print $2}'`; if [ -d $rootimgdir.regbak ]; then mv $rootimgdir.regbak $rootimgdir -f;fi diff --git a/xCAT-test/autotest/testcase/lsvm/cases0 b/xCAT-test/autotest/testcase/lsvm/cases0 index b29b2fc7b..f4dbb48a5 100644 --- a/xCAT-test/autotest/testcase/lsvm/cases0 +++ b/xCAT-test/autotest/testcase/lsvm/cases0 @@ -96,7 +96,7 @@ start:lsvm_kvmhost description:lsvm could give out the kvm host information. This case should be run on a mn which has kvm host defined.In this case, $$CN should be a kvm host. label:others,hctrl_kvm cmd:lsvm $$CN -check:output=~$$CN +check:output=~$$CN:\s*\b\w+\b(\r\n|\n|\r) end start:lsvm_mixed_vm_defined_and_not diff --git a/xCAT-test/autotest/testcase/makedns/cases0 b/xCAT-test/autotest/testcase/makedns/cases0 index 117e86d83..c5c3e8bfd 100644 --- a/xCAT-test/autotest/testcase/makedns/cases0 +++ b/xCAT-test/autotest/testcase/makedns/cases0 @@ -123,10 +123,9 @@ check:output~=zone "100.100.100.IN-ADDR.ARPA." cmd:nslookup dnstestnode $$MN check:output~=Server: $$MN check:output!~(server can't find dnstestnode) -cmd:rm -f /etc/hosts -check:rc==0 -cmd:mv /etc/hosts.testbak /etc/hosts +cmd:yes|cp -rf /etc/hosts.testbak /etc/hosts check:rc==0 +cmd:rm -rf /etc/hosts.testbak cmd:chtab -d netname=testnetwork networks check:rc==0 cmd:makedns -n @@ -169,10 +168,9 @@ check:rc==0 check:output~= cmd:rm -f /tmp/makedns_named_conf.org /tmp/makedns_named_conf.new check:rc==0 -cmd:rm -f /etc/hosts -check:rc==0 -cmd:mv /etc/hosts.testbak /etc/hosts +cmd:yes|cp -rf /etc/hosts.testbak /etc/hosts check:rc==0 +cmd:rm -rf /etc/hosts.testbak cmd:chtab -d netname=testnetwork networks check:rc==0 cmd:makedns -n diff --git a/xCAT-test/autotest/testcase/makehosts/cases0 b/xCAT-test/autotest/testcase/makehosts/cases0 index 4f5050142..acdc1a4b6 100644 --- a/xCAT-test/autotest/testcase/makehosts/cases0 +++ b/xCAT-test/autotest/testcase/makehosts/cases0 @@ -141,7 +141,10 @@ start:makehost_n_r label:mn_only,dns,wait_fix descriptions:modify makehosts testcases according to special node name eg:s01 and s01r* . for issue #2717 and #2683 cmd:cp -f /etc/hosts /etc/hosts.xcatbakautotest -cmd:sed -i '/s01/d' /etc/hosts +cmd:cp -f /etc/hosts /etc/hosts.bak +cmd:sed -i '/s01/d' /etc/hosts.xcatbakautotest +cmd:sed -i '/s01r1b01/d' /etc/hosts.xcatbakautotest +cmd:yes|cp -rf /etc/hosts.xcatbakautotest /etc/hosts cmd:cat /etc/hosts cmd:lsdef s01;if [ $? -eq 0 ]; then lsdef -l s01 -z >/tmp/s01.standa ;rmdef s01;fi check:rc==0 @@ -168,7 +171,7 @@ else exit 1 fi check:rc==0 -cmd:sed -i '/s01/d' /etc/hosts +cmd:yes|cp -rf /etc/hosts.xcatbakautotest /etc/hosts cmd:makehosts s01 check:rc==0 cmd:#!/bin/bash @@ -187,7 +190,8 @@ else exit 1 fi check:rc==0 -cmd:sed -i '/s01/d' /etc/hosts +cmd:cat /etc/hosts +cmd:yes|cp -rf /etc/hosts.xcatbakautotest /etc/hosts cmd:makehosts service check:rc==0 cmd:#!/bin/bash @@ -221,7 +225,7 @@ for i in {1..5}; do done exit 1 check:rc==0 -cmd:sed -i '/s01/d' /etc/hosts +cmd:yes|cp -rf /etc/hosts.xcatbakautotest /etc/hosts cmd:domain=$(lsdef -t site -i domain -c |awk -F'=' '{print $2}'); echo "70.2.0.254 s01 s01.$domain" >> /etc/hosts; echo "80.2.0.254 s01r1b01 s01r1b01.$domain" >> /etc/hosts check:rc==0 cmd:grep "s01" /etc/hosts @@ -241,7 +245,7 @@ for i in {1..5}; do done exit 1 check:rc==0 -cmd:sed -i '/s01/d' /etc/hosts +cmd:yes|cp -rf /etc/hosts.xcatbakautotest /etc/hosts cmd:domain=$(lsdef -t site -i domain -c |awk -F'=' '{print $2}'); echo "70.2.0.254 s01 s01.$domain" >> /etc/hosts; echo "80.2.0.254 s01r1b01 s01r1b01.$domain" >> /etc/hosts check:rc==0 cmd:grep "s01" /etc/hosts @@ -265,7 +269,8 @@ cmd:if [ -e /tmp/s01.standa ]; then rmdef s01; cat /tmp/s01.standa | mkdef -z; r check:rc==0 cmd:if [ -e /tmp/s01r1b01.standa ]; then rmdef s01r1b01; cat /tmp/s01r1b01.standa | mkdef -z; rm -rf /tmp/s01r1b01.standa;else rmdef s01r1b01; fi check:rc==0 -cmd:mv -f /etc/hosts.xcatbakautotest /etc/hosts +cmd:yes|cp -rf /etc/hosts.bak /etc/hosts +cmd:rm -rf /etc/hosts.bak /etc/hosts.xcatbakautotest end start:makehosts_regex diff --git a/xCAT-test/autotest/testcase/migration/sles_migration b/xCAT-test/autotest/testcase/migration/sles_migration index 2e429094e..80561503f 100644 --- a/xCAT-test/autotest/testcase/migration/sles_migration +++ b/xCAT-test/autotest/testcase/migration/sles_migration @@ -14,11 +14,9 @@ cmd:makedns -n check:rc==0 cmd:service named restart check:rc==0 -cmd:makeconservercf $$CN +cmd:if [ -x /usr/bin/goconserver ]; then makegocons $$CN; else makeconservercf $$CN; fi check:rc==0 -cmd:cat /etc/conserver.cf | grep $$CN -check:output=~$$CN -cmd:sleep 60 +cmd:sleep 20 cmd:if [ "__GETNODEATTR($$CN,arch)__" = "ppc64" -a "__GETNODEATTR($$CN,mgt)__" != "ipmi" ]; then getmacs -D $$CN; fi check:rc==0 cmd:makedhcp -n @@ -112,6 +110,7 @@ cmd:xdsh $$CN "noderm node0001" check:rc==0 cmd:latest_version_info=`lsxcatd -v`;xdsh $$CN "lsxcatd -v" | grep "$latest_version_info" check:rc==0 +cmd:if [ -x /usr/bin/goconserver ]; then makegocons -d $$CN; else makeconservercf -d $$CN; fi cmd:if [[ -f /tmp/servicelabel ]];then chdef $$SN -p groups=service;rm -rf /tmp/servicelabel;fi check:rc==0 cmd:if [[ -f /tmp/poweroffsn ]];then rpower $$SN on > /dev/null;rm -rf /tmp/poweroffsn;fi @@ -122,7 +121,6 @@ start:sles_migration2 os:Linux description:update xCAT from $$MIGRATION22VERSION to latest version, these two global parameter defined in config file label:others,migration,invoke_provision - cmd:if ping -c 1 $$SN > /dev/null;then rpower $$SN off > /dev/null;echo "poweroffsn">/tmp/poweroffsn;fi check:rc==0 cmd:if [[ "__GETNODEATTR($$SN,groups)__" =~ "service" ]];then chdef $$SN -m groups=service;echo "servicelabel" >/tmp/servicelabel;fi @@ -135,11 +133,9 @@ cmd:makedns -n check:rc==0 cmd:service named restart check:rc==0 -cmd:makeconservercf $$CN +cmd:if [ -x /usr/bin/goconserver ]; then makegocons $$CN; else makeconservercf $$CN; fi check:rc==0 -cmd:cat /etc/conserver.cf | grep $$CN -check:output=~$$CN -cmd:sleep 60 +cmd:sleep 20 cmd:if [ "__GETNODEATTR($$CN,arch)__" = "ppc64" -a "__GETNODEATTR($$CN,mgt)__" != "ipmi" ]; then getmacs -D $$CN; fi check:rc==0 cmd:makedhcp -n @@ -233,6 +229,7 @@ cmd:xdsh $$CN "noderm node0001" check:rc==0 cmd:latest_version_info=`lsxcatd -v`;xdsh $$CN "lsxcatd -v" | grep "$latest_version_info" check:rc==0 +cmd:if [ -x /usr/bin/goconserver ]; then makegocons -d $$CN; else makeconservercf -d $$CN; fi cmd:if [[ -f /tmp/servicelabel ]];then chdef $$SN -p groups=service;rm -rf /tmp/servicelabel;fi check:rc==0 cmd:if [[ -f /tmp/poweroffsn ]];then rpower $$SN on > /dev/null;rm -rf /tmp/poweroffsn;fi diff --git a/xCAT-test/autotest/testcase/migration/ubuntu_migration1_p8le b/xCAT-test/autotest/testcase/migration/ubuntu_migration1_p8le index 5bd7ce898..355ffb9d4 100644 --- a/xCAT-test/autotest/testcase/migration/ubuntu_migration1_p8le +++ b/xCAT-test/autotest/testcase/migration/ubuntu_migration1_p8le @@ -2,7 +2,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 label:others,migration,invoke_provision - cmd:copycds $$ISO check:rc==0 cmd:if [[ "__GETNODEATTR($$CN,os)__" =~ "ubuntu" ]];then mkdir /tmp/iso; mount -o loop $$MINIISO /tmp/iso ; mkdir -p /install/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/install/netboot; cp /tmp/iso/install/initrd.gz /install/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/install/netboot;umount /tmp/iso; rmdir /tmp/iso; fi @@ -13,10 +12,8 @@ cmd:makedhcp -a check:rc==0 cmd:makedns -n check:rc==0 -cmd:makeconservercf $$CN +cmd:if [ -x /usr/bin/goconserver ]; then makegocons $$CN; else makeconservercf $$CN; fi check:rc==0 -cmd:cat /etc/conserver.cf | grep $$CN -check:output=~$$CN cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute check:rc==0 check:output=~Provision node\(s\)\: $$CN @@ -117,6 +114,6 @@ cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsdef" check:output!~node0001 cmd:xdsh $$CN "diff /oldxcat/old_version /newxcat/new_version" check:rc!=0 - +cmd:if [ -x /usr/bin/goconserver ]; then makegocons -d $$CN; else makeconservercf -d $$CN; fi end diff --git a/xCAT-test/autotest/testcase/migration/ubuntu_migration1_vm b/xCAT-test/autotest/testcase/migration/ubuntu_migration1_vm index 9171b01e6..9e6bdeb2e 100644 --- a/xCAT-test/autotest/testcase/migration/ubuntu_migration1_vm +++ b/xCAT-test/autotest/testcase/migration/ubuntu_migration1_vm @@ -2,7 +2,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 label:others,migration,invoke_provision - cmd:copycds $$ISO check:rc==0 cmd:makedns -n @@ -12,10 +11,8 @@ cmd:makedhcp -n check:rc==0 cmd:makedhcp -a check:rc==0 -cmd:makeconservercf $$CN +cmd:if [ -x /usr/bin/goconserver ]; then makegocons $$CN; else makeconservercf $$CN; fi check:rc==0 -cmd:cat /etc/conserver.cf | grep $$CN -check:output=~$$CN cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute check:rc==0 check:output=~Provision node\(s\)\: $$CN @@ -116,4 +113,5 @@ cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsdef" check:output!~node0001 cmd:xdsh $$CN "diff /oldxcat/old_version /newxcat/new_version" check:rc!=0 +cmd:if [ -x /usr/bin/goconserver ]; then makegocons -d $$CN; else makeconservercf -d $$CN; fi end diff --git a/xCAT-test/autotest/testcase/migration/ubuntu_migration2_p8le b/xCAT-test/autotest/testcase/migration/ubuntu_migration2_p8le index 301d31f22..9587ebb69 100644 --- a/xCAT-test/autotest/testcase/migration/ubuntu_migration2_p8le +++ b/xCAT-test/autotest/testcase/migration/ubuntu_migration2_p8le @@ -2,7 +2,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 label:others,migration,invoke_provision - cmd:copycds $$ISO check:rc==0 cmd:if [[ "__GETNODEATTR($$CN,os)__" =~ "ubuntu" ]];then mkdir /tmp/iso; mount -o loop $$MINIISO /tmp/iso ; mkdir -p /install/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/install/netboot; cp /tmp/iso/install/initrd.gz /install/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/install/netboot;umount /tmp/iso; rmdir /tmp/iso; fi @@ -13,10 +12,8 @@ cmd:makedhcp -a check:rc==0 cmd:makedns -n check:rc==0 -cmd:makeconservercf $$CN +cmd:if [ -x /usr/bin/goconserver ]; then makegocons $$CN; else makeconservercf $$CN; fi check:rc==0 -cmd:cat /etc/conserver.cf | grep $$CN -check:output=~$$CN cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute check:rc==0 check:output=~Provision node\(s\)\: $$CN @@ -117,6 +114,6 @@ cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsdef" check:output!~node0001 cmd:xdsh $$CN "diff /oldxcat/old_version /newxcat/new_version" check:rc!=0 - +cmd:if [ -x /usr/bin/goconserver ]; then makegocons -d $$CN; else makeconservercf -d $$CN; fi end diff --git a/xCAT-test/autotest/testcase/migration/ubuntu_migration2_vm b/xCAT-test/autotest/testcase/migration/ubuntu_migration2_vm index bd98c5e63..f272d7354 100644 --- a/xCAT-test/autotest/testcase/migration/ubuntu_migration2_vm +++ b/xCAT-test/autotest/testcase/migration/ubuntu_migration2_vm @@ -2,7 +2,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 label:others,migration,invoke_provision - cmd:copycds $$ISO check:rc==0 cmd:makedns -n @@ -12,10 +11,8 @@ cmd:makedhcp -n check:rc==0 cmd:makedhcp -a check:rc==0 -cmd:makeconservercf $$CN +cmd:if [ -x /usr/bin/goconserver ]; then makegocons $$CN; else makeconservercf $$CN; fi check:rc==0 -cmd:cat /etc/conserver.cf | grep $$CN -check:output=~$$CN cmd:/opt/xcat/share/xcat/tools/autotest/testcase/commoncmd/retry_install.sh $$CN __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute check:rc==0 check:output=~Provision node\(s\)\: $$CN @@ -46,6 +43,7 @@ cmd:xdsh $$CN "apt-get clean all" check:rc==0 cmd:xdsh $$CN "apt-get update" check:rc==0 +cmd:arc_all=`uname -a`; if [[ $arc_all =~ "x86_64" ]]; then xdsh $$CN "echo '* libraries/restart-without-asking boolean true' | debconf-set-selections"; fi cmd:xdsh $$CN "apt-get -y install build-essential dpkg-dev dh-make debhelper fakeroot gnupg lintian pbuilder quilt reprepro libsoap-lite-perl libdbi-perl" check:rc==0 cmd:xdsh $$CN "rm -rf /oldxcat" @@ -116,4 +114,5 @@ cmd:xdsh $$CN "source /etc/profile.d/xcat.sh;lsdef" check:output!~node0001 cmd:xdsh $$CN "diff /oldxcat/old_version /newxcat/new_version" check:rc!=0 +cmd:if [ -x /usr/bin/goconserver ]; then makegocons -d $$CN; else makeconservercf -d $$CN; fi end diff --git a/xCAT-test/autotest/testcase/mkdef/cases0 b/xCAT-test/autotest/testcase/mkdef/cases0 index b360587d6..a9adc70cf 100644 --- a/xCAT-test/autotest/testcase/mkdef/cases0 +++ b/xCAT-test/autotest/testcase/mkdef/cases0 @@ -95,12 +95,17 @@ end start:mkdef_dynamic_group description:mkdef with dynamic node group label:mn_only,ci_test,db +cmd:tabdump nodegroup +cmd:tabdump nodelist cmd:mkdef -t node -o testnode1-testnode2 mgt=hmc cons=hmc groups=all,systemp check:rc==0 +cmd:tabdump nodelist|grep testnode cmd:mkdef -t node -o testnode3-testnode4 mgt=ipmi cons=ipmi groups=all,systemx check:rc==0 +cmd:tabdump nodelist|grep testnode cmd:mkdef -t group -o dyngrp1 -d -w mgt==hmc check:rc==0 +cmd:tabdump nodegroup cmd:lsdef -s dyngrp1 check:rc==0 check:output=~testnode1 @@ -109,6 +114,7 @@ check:output!~testnode3 check:output!~testnode4 cmd:mkdef -t group -o dyngrp2 -d -w mgt==hmc -w cons==hmc check:rc==0 +cmd:tabdump nodegroup cmd:lsdef -s dyngrp2 check:rc==0 check:output=~testnode1 @@ -117,6 +123,7 @@ check:output!~testnode3 check:output!~testnode4 cmd:mkdef -t group -o dyngrp3 -d -w mgt==hmc -w cons==ipmi check:rc==0 +cmd:tabdump nodegroup cmd:lsdef -s dyngrp3 check:rc!=0 check:output!~testnode1 @@ -125,6 +132,7 @@ check:output!~testnode3 check:output!~testnode4 cmd:rmdef -t group -o dyngrp1,dyngrp2,dyngrp3 check:rc==0 +cmd:tabdump nodegroup cmd:rmdef -t node -o testnode1-testnode4 check:rc==0 end diff --git a/xCAT-test/autotest/testcase/nodeset/cases0 b/xCAT-test/autotest/testcase/nodeset/cases0 index de7aa775e..2e807673c 100644 --- a/xCAT-test/autotest/testcase/nodeset/cases0 +++ b/xCAT-test/autotest/testcase/nodeset/cases0 @@ -223,6 +223,7 @@ check:rc!=0 cmd:chdef -t node -o testnode1 ip= check:rc==0 cmd:cp -f /etc/hosts.xcattestbak /etc/hosts +cmd:sleep 2 cmd:getent hosts testnode1 | grep testnode1 check:rc!=0 cmd:nodeset testnode1 osimage=rhels6.99-x86_64-install-compute @@ -286,6 +287,7 @@ cmd:lsdef testnode1 > /dev/null 2>&1;if [[ $? -eq 0 ]]; then lsdef testnode1 -z cmd:rm -f /tftpboot/petitboot/testnode1 cmd:mkdef -t node -o testnode1 arch=ppc64le cons=bmc groups=ipmi ip=10.1.1.200 mac=e6:d4:d2:3a:ad:06 mgt=ipmi profile=compute os=rhels7.99 check:rc==0 +cmd:cp -f /etc/hosts /etc/hosts.bak cmd:cp -f /etc/hosts /etc/hosts.xcattestbak cmd:echo "10.1.1.200 testnode1" >> /etc/hosts cmd:makedns -n @@ -311,7 +313,8 @@ check:rc!=0 #check:rc!=0 cmd:chdef -t node -o testnode1 ip= check:rc==0 -cmd:sed -i /testnode1/d /etc/hosts +cmd:sed -i /testnode1/d /etc/hosts.xcattestbak +cmd:yes|cp -rf /etc/hosts.xcattestbak /etc/hosts cmd:getent hosts testnode1 | grep testnode1 check:rc!=0 cmd:nodeset testnode1 osimage=rhels7.99-ppc64le-install-compute @@ -319,8 +322,9 @@ check:rc!=0 cmd:noderm testnode1 cmd:rmdef -t osimage -o "rhels7.99-ppc64le-install-compute" cmd:rm -rf /install/rhels7.99 -cmd:cp -f /etc/hosts.xcattestbak /etc/hosts +cmd:yes|cp -f /etc/hosts.bak /etc/hosts cmd:if [[ -e /tmp/testnode1.stanza ]]; then cat /tmp/testnode1.stanza |mkdef -z -f;rm -rf /tmp/testnode1.stanza;fi +cmd:rm -rf /etc/hosts.xcattestbak /etc/hosts.bak end start:nodeset_yaboot diff --git a/xCAT-test/autotest/testcase/packimg/cases0 b/xCAT-test/autotest/testcase/packimg/cases0 index 11d136998..d04d92940 100644 --- a/xCAT-test/autotest/testcase/packimg/cases0 +++ b/xCAT-test/autotest/testcase/packimg/cases0 @@ -64,6 +64,8 @@ cmd:if [ -x /usr/bin/goconserver ]; then makegocons $$CN; else makeconservercf $ check:rc==0 cmd:ls /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg;if [ $? -eq 0 ];then mv -f /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg /rootimg.bak;fi cmd:ls /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg.cpio.gz;if [ $? -eq 0 ];then mv -f /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg.cpio.gz /rootimg.cpio.gz.bak;fi +cmd:if [[ "__GETNODEATTR($$CN,os)__" =~ "ubuntu16.04.5" ]] && [[ "__GETNODEATTR($$CN,arch)__" =~ "x86" ]]; then chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute -p pkgdir="http://archive.ubuntu.com/ubuntu xenial universe main,http://archive.ubuntu.com/ubuntu xenial-updates universe main,http://security.ubuntu.com/ubuntu xenial-security main restricted";fi +cmd:lsdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute cmd:genimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute check:rc==0 cmd:ls -l /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg @@ -102,11 +104,13 @@ start:packimage_m_cpio_c_pigz os:Linux description:test packimage -m cpio -c pigz label:others,packaging,invoke_provision -#cmd:copycds $$ISO +cmd:copycds $$ISO cmd:if [ -x /usr/bin/goconserver ]; then makegocons $$CN; else makeconservercf $$CN; fi check:rc==0 cmd:ls /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg;if [ $? -eq 0 ];then mv -f /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg /rootimg.bak;fi cmd:ls /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg.cpio.gz;if [ $? -eq 0 ];then mv -f /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg.cpio.gz /rootimg.cpio.gz.bak;fi +cmd:if [[ "__GETNODEATTR($$CN,os)__" =~ "ubuntu16.04.5" ]] && [[ "__GETNODEATTR($$CN,arch)__" =~ "x86" ]]; then chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute -p pkgdir="http://archive.ubuntu.com/ubuntu xenial universe main,http://archive.ubuntu.com/ubuntu xenial-updates universe main,http://security.ubuntu.com/ubuntu xenial-security main restricted";fi +cmd:lsdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute cmd:genimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute check:rc==0 cmd:ls -l /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg @@ -149,11 +153,13 @@ start:packimage_m_cpio_c_xz os:Linux description:test packimage -m cpio -c xz label:others,packaging,invoke_provision -#cmd:copycds $$ISO +cmd:copycds $$ISO cmd:if [ -x /usr/bin/goconserver ]; then makegocons $$CN; else makeconservercf $$CN; fi check:rc==0 cmd:ls /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg;if [ $? -eq 0 ];then mv -f /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg /rootimg.bak;fi cmd:ls /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg.cpio.xz;if [ $? -eq 0 ];then mv -f /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg.cpio.xz /rootimg.cpio.xz.bak;fi +cmd:if [[ "__GETNODEATTR($$CN,os)__" =~ "ubuntu16.04.5" ]] && [[ "__GETNODEATTR($$CN,arch)__" =~ "x86" ]]; then chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute -p pkgdir="http://archive.ubuntu.com/ubuntu xenial universe main,http://archive.ubuntu.com/ubuntu xenial-updates universe main,http://security.ubuntu.com/ubuntu xenial-security main restricted";fi +cmd:lsdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute cmd:genimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute check:rc==0 cmd:ls -l /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg @@ -192,11 +198,13 @@ start:packimage_m_tar_c_pigz os:Linux description:test packimage -m tar -c pigz label:others,packaging,invoke_provision -#cmd:copycds $$ISO +cmd:copycds $$ISO cmd:if [ -x /usr/bin/goconserver ]; then makegocons $$CN; else makeconservercf $$CN; fi check:rc==0 cmd:ls /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg;if [ $? -eq 0 ];then mv -f /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg /rootimg.bak;fi cmd:ls /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg.tar.gz;if [ $? -eq 0 ];then mv -f /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg.tar.gz /rootimg.tar.gz.bak;fi +cmd:if [[ "__GETNODEATTR($$CN,os)__" =~ "ubuntu16.04.5" ]] && [[ "__GETNODEATTR($$CN,arch)__" =~ "x86" ]]; then chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute -p pkgdir="http://archive.ubuntu.com/ubuntu xenial universe main,http://archive.ubuntu.com/ubuntu xenial-updates universe main,http://security.ubuntu.com/ubuntu xenial-security main restricted";fi +cmd:lsdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute cmd:genimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute check:rc==0 cmd:ls -l /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg @@ -250,11 +258,13 @@ start:packimage_m_tar_c_gzip os:Linux description:test packimage -m tar -c gzip label:others,packaging,invoke_provision -#cmd:copycds $$ISO +cmd:copycds $$ISO cmd:if [ -x /usr/bin/goconserver ]; then makegocons $$CN; else makeconservercf $$CN; fi check:rc==0 cmd:ls /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg;if [ $? -eq 0 ];then mv -f /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg /rootimg.bak;fi cmd:ls /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg.tar.gz;if [ $? -eq 0 ];then mv -f /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg.tar.gz /rootimg.tar.gz.bak;fi +cmd:if [[ "__GETNODEATTR($$CN,os)__" =~ "ubuntu16.04.5" ]] && [[ "__GETNODEATTR($$CN,arch)__" =~ "x86" ]]; then chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute -p pkgdir="http://archive.ubuntu.com/ubuntu xenial universe main,http://archive.ubuntu.com/ubuntu xenial-updates universe main,http://security.ubuntu.com/ubuntu xenial-security main restricted";fi +cmd:lsdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute cmd:genimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute check:rc==0 cmd:ls -l /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg @@ -304,11 +314,13 @@ start:packimage_m_tar_c_xz os:Linux description:test packimage -m tar -c xz label:others,packaging,invoke_provision -#cmd:copycds $$ISO +cmd:copycds $$ISO cmd:if [ -x /usr/bin/goconserver ]; then makegocons $$CN; else makeconservercf $$CN; fi check:rc==0 cmd:ls /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg;if [ $? -eq 0 ];then mv -f /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg /rootimg.bak;fi cmd:ls /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg.tar.xz;if [ $? -eq 0 ];then mv -f /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg.tar.xz /rootimg.tar.xz.bak;fi +cmd:if [[ "__GETNODEATTR($$CN,os)__" =~ "ubuntu16.04.5" ]] && [[ "__GETNODEATTR($$CN,arch)__" =~ "x86" ]]; then chdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute -p pkgdir="http://archive.ubuntu.com/ubuntu xenial universe main,http://archive.ubuntu.com/ubuntu xenial-updates universe main,http://security.ubuntu.com/ubuntu xenial-security main restricted";fi +cmd:lsdef -t osimage -o __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute cmd:genimage __GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-netboot-compute check:rc==0 cmd:ls -l /install/netboot/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/compute/rootimg diff --git a/xCAT-test/autotest/testcase/passwd/case0 b/xCAT-test/autotest/testcase/passwd/case0 index 2b36461f2..1c26e5133 100644 --- a/xCAT-test/autotest/testcase/passwd/case0 +++ b/xCAT-test/autotest/testcase/passwd/case0 @@ -235,7 +235,7 @@ check:rc==0 cmd:if grep Ubuntu /etc/*release;then if [ ! -e /install/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/install/netboot/initrd.gz ]; then copycds $$ISO;mkdir -p /install/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/install/netboot/;touch /install/__GETNODEATTR($$CN,os)__/__GETNODEATTR($$CN,arch)__/install/netboot/initrd.gz;fi;fi cmd:nodeset $$CN osimage=__GETNODEATTR($$CN,os)__-__GETNODEATTR($$CN,arch)__-install-compute check:rc==0 -cmd:if grep SUSE /etc/*release;then grep '\$1\$' /install/autoinst/$$CN | awk 'gsub(/^ *| *$/,"")'| awk -v head="" -v tail="" '{print substr($0, index($0,head)+length(head),index($0,tail)-index($0,head)-length(head))}' > /tmp/instcryptedpasswd; elif grep "Red Hat" /etc/*release;then grep '\$1\$' /install/autoinst/$$CN |awk -F " " '{print $3}' > /tmp/instcryptedpasswd; elif grep Ubuntu /etc/*release;then grep '\$1\$' /install/autoinst/$$CN |awk -F " " '{print $4}' > /tmp/instcryptedpasswd;else echo "Sorry,this is not supported os"; fi +cmd:if grep SUSE /etc/*release;then grep '\$1\$' /install/autoinst/$$CN | awk 'gsub(/^ *| *$/,"")'| awk -v head="" -v tail="" '{print substr($0, index($0,head)+length(head),index($0,tail)-index($0,head)-length(head))}' > /tmp/instcryptedpasswd; elif grep "Red Hat" /etc/*release;then grep '\$1\$' /install/autoinst/$$CN |awk -F " " '{print $3}' > /tmp/instcryptedpasswd; elif grep Ubuntu /etc/*release;then grep '\$1\$' /install/autoinst/$$CN |awk -F " " '{print $4}' > /tmp/instcryptedpasswd;elif grep "CentOS Linux" /etc/*release;then grep '\$1\$' /install/autoinst/$$CN |awk -F " " '{print $3}' > /tmp/instcryptedpasswd;else echo "Sorry,this is not supported os"; fi #cmd:grep '\$1\$' /install/autoinst/$$CN |awk -F " " '{print $3}' > /tmp/instcryptedpasswd check:rc==0 cmd:diff /tmp/tmpcryptedpasswd /tmp/instcryptedpasswd diff --git a/xCAT-test/autotest/testcase/performance/case0 b/xCAT-test/autotest/testcase/performance/case0 index 647c7f9bb..01cf61124 100644 --- a/xCAT-test/autotest/testcase/performance/case0 +++ b/xCAT-test/autotest/testcase/performance/case0 @@ -33,13 +33,6 @@ cmd:chdef -t node -o $$CN servicenode= monserver= nfsserver= tftpserver= xcatma check:rc==0 cmd:chdef -t node -o $$SN servicenode= monserver= nfsserver= tftpserver= xcatmaster= status= check:rc==0 -cmd:makeconservercf -check:rc==0 -cmd:cat /etc/conserver.cf | grep $$CN -check:output=~$$CN -cmd:cat /etc/conserver.cf | grep $$SN -check:output=~$$SN -cmd:sleep 20 cmd:makedhcp -n check:rc==0 cmd:makedhcp -a diff --git a/xCAT-test/autotest/testcase/probe/xcatproble_list b/xCAT-test/autotest/testcase/probe/xcatproble_list new file mode 100644 index 000000000..214711885 --- /dev/null +++ b/xCAT-test/autotest/testcase/probe/xcatproble_list @@ -0,0 +1,13 @@ +start:xcatprobe_work +description:To test if xcatprobe list works. This case must run in xcat mn +label:mn_only,ci_test +cmd:mkdir -p /tmp/xcatprobe_l +cmd:xcatprobe -l +check:rc==0 +check:output=~Supported sub commands are: +cmd:xcatprobe -l|grep -v "Supported sub commands are" |awk '/^[[:graph:]]/ {print $1}'|sort > /tmp/xcatprobe_l/subcmd_from_xcatprobe_l +cmd:ls -l /opt/xcat/probe/subcmds/ |awk '/^-/ {print $9}'|sort > /tmp/xcatprobe_l/subcmd_under_subcmds_dir +cmd:diff -y /tmp/xcatprobe_l/subcmd_from_xcatprobe_l /tmp/xcatprobe_l/subcmd_under_subcmds_dir +check:rc==0 +cmd:rm -rf /tmp/xcatprobe_l +end diff --git a/xCAT-test/autotest/testcase/psh/cases0 b/xCAT-test/autotest/testcase/psh/cases0 index a015f6333..a998cbfeb 100644 --- a/xCAT-test/autotest/testcase/psh/cases0 +++ b/xCAT-test/autotest/testcase/psh/cases0 @@ -54,14 +54,15 @@ description: psh -i interface CN 'uptime' in linux label:others,parallel_cmds os:Linux cmd:cp /etc/hosts /etc/hostsBK +cmd:cp /etc/hosts /etc/hosts.bak check:rc==0 cmd:grep $$CN /etc/hosts -cmd:interface=`xdsh $$CN 'ip route' | awk '/default/ { for (i = 1; i <= NF; ++i) if ("dev" == $i) { print $(i + 1) ; exit } }'`; echo "interface=$interface"; sed -i "/$$CN/s/$/ $$CN-$interface/g" '/etc/hosts';psh -i $interface $$CN 'uptime' +cmd:interface=`xdsh $$CN 'ip route' | awk '/default/ { for (i = 1; i <= NF; ++i) if ("dev" == $i) { print $(i + 1) ; exit } }'`; echo "interface=$interface"; sed -i "/$$CN/s/$/ $$CN-$interface/g" '/etc/hostsBK';yes|cp -rf /etc/hostsBK /etc/hosts;psh -i $interface $$CN 'uptime' check:output=~$$CN check:rc==0 cmd:grep $$CN /etc/hosts -cmd:rm -rf /etc/hosts -cmd:cp /etc/hostsBK /etc/hosts +cmd:yes|cp -rf /etc/hosts.bak /etc/hosts check:rc==0 +cmd:rm -rf /etc/hostsBK /etc/hosts.bak end diff --git a/xCAT-test/autotest/testcase/rmdef/cases0 b/xCAT-test/autotest/testcase/rmdef/cases0 index e5bea9ce4..c4e746e4d 100644 --- a/xCAT-test/autotest/testcase/rmdef/cases0 +++ b/xCAT-test/autotest/testcase/rmdef/cases0 @@ -90,21 +90,27 @@ description:rmdef to remove dynamic node group label:mn_only,ci_test,db cmd:lsdef testnode1;if [ $? -eq 0 ]; then lsdef -l testnode1 -z >/tmp/testnode1.standa ; rmdef testnode1;fi cmd:lsdef testnode2;if [ $? -eq 0 ]; then lsdef -l testnode2 -z >/tmp/testnode2.standa ; rmdef testnode2;fi +cmd:tabdump nodegroup +cmd:tabdump nodelist cmd:mkdef -t node -o testnode1-testnode2 mgt=hmc cons=hmc groups=all,systemp check:rc==0 +cmd:tabdump nodelist|grep testnode cmd:mkdef -t group -o dyngrp -d -w mgt==hmc -w cons==hmc -w groups==all,systemp check:rc==0 +cmd:tabdump nodegroup cmd:lsdef -s dyngrp check:rc==0 check:output=~testnode1 check:output=~testnode2 cmd:rmdef -t node -o dyngrp check:rc=0 +cmd:tabdump nodegroup cmd:lsdef -t node testnode1,testnode2 check:output=~Could not find an object named 'testnode1' of type 'node'. check:output=~Could not find an object named 'testnode2' of type 'node'. cmd:rmdef -t group -o dyngrp check:rc==0 +cmd:tabdump nodegroup cmd:lsdef -t group -o dyngrp check:output=~Could not find an object named 'dyngrp' of type 'group'. cmd:if [ -e /tmp/testnode1.standa ]; then cat /tmp/testnode1.standa | mkdef -z; rm -rf /tmp/testnode1.standa; fi diff --git a/xCAT-test/autotest/testcase/rmkit/case0 b/xCAT-test/autotest/testcase/rmkit/case0 index 9cbad4994..b005c9752 100644 --- a/xCAT-test/autotest/testcase/rmkit/case0 +++ b/xCAT-test/autotest/testcase/rmkit/case0 @@ -64,7 +64,7 @@ check:rc==0 cmd:addkit /opt/xcat/share/xcat/tools/autotest/testcase/rmkit/mykits/mykits-1.0-1.tar.bz2 check:rc==0 check:output=~Kit mykits-1.0-1 was successfully added -cmd:mkdef testimage -u profile=compute provmethod=install osarch=__GETNODEATTR($$CN,arch)__ +cmd:if grep "CentOS Linux" /etc/*release;then osbasename=`lskit mykits-1.0-1 |grep -w osbasename|awk -F= '{print $2}'`;osmajorversion=`lskit mykits-1.0-1 |grep osmajorversion|awk -F= '{print $2}'`;osminorversion=`lskit mykits-1.0-1 |grep osminorversion|awk -F= '{print $2}'`;mkdef testimage -u profile=compute provmethod=install osarch=__GETNODEATTR($$CN,arch)__ osvers=$osbasename-$osmajorversion.$osminorversion;mkdef -t osdistro $osbasename-$osmajorversion.$osminorversion-__GETNODEATTR($$CN,arch)__ basename=$osbasename majorversion=$osmajorversion minorversion=$osminorversion arch=__GETNODEATTR($$CN,arch)__ type=Linux dirpaths=/install/$osbasename-$osmajorversion.$osminorversion/__GETNODEATTR($$CN,arch)__;else mkdef testimage -u profile=compute provmethod=install osarch=__GETNODEATTR($$CN,arch)__;fi check:rc==0 cmd:kitcompname=`lskit mykits-1.0-1 |grep kitcompname|awk -F= '{print $2}'`;addkitcomp -i testimage $kitcompname check:rc==0 @@ -79,6 +79,7 @@ cmd:kitcompname=`lskit mykits-1.0-1 |grep kitcompname|awk -F= '{print $2}'`;rmki check:rc==0 check:output=~Removing kitcomponent check:output=~were removed from osimage testimage successfully +cmd:if grep "CentOS Linux" /etc/*release;then osbasename=`lskit mykits-1.0-1 |grep -w osbasename|awk -F= '{print $2}'`;osmajorversion=`lskit mykits-1.0-1 |grep osmajorversion|awk -F= '{print $2}'`;osminorversion=`lskit mykits-1.0-1 |grep osminorversion|awk -F= '{print $2}'`;rmdef -t osdistro -o $osbasename-$osmajorversion.$osminorversion-__GETNODEATTR($$CN,arch)__;fi cmd:rmkit mykits-1.0-1 check:rc==0 cmd:rm -f /opt/xcat/share/xcat/tools/autotest/testcase/rmkit/mykits/mykits-1.0-1.tar.bz2 @@ -101,11 +102,12 @@ check:rc==0 cmd:addkit /opt/xcat/share/xcat/tools/autotest/testcase/rmkit/mykits/mykits-1.0-1.tar.bz2 check:rc==0 check:output=~Kit mykits-1.0-1 was successfully added -cmd:mkdef testimage -u profile=compute provmethod=install osarch=__GETNODEATTR($$CN,arch)__ +cmd:if grep "CentOS Linux" /etc/*release;then osbasename=`lskit mykits-1.0-1 |grep -w osbasename|awk -F= '{print $2}'`;osmajorversion=`lskit mykits-1.0-1 |grep osmajorversion|awk -F= '{print $2}'`;osminorversion=`lskit mykits-1.0-1 |grep osminorversion|awk -F= '{print $2}'`;mkdef testimage -u profile=compute provmethod=install osarch=__GETNODEATTR($$CN,arch)__ osvers=$osbasename-$osmajorversion.$osminorversion;mkdef -t osdistro $osbasename-$osmajorversion.$osminorversion-__GETNODEATTR($$CN,arch)__ basename=$osbasename majorversion=$osmajorversion minorversion=$osminorversion arch=__GETNODEATTR($$CN,arch)__ type=Linux dirpaths=/install/$osbasename-$osmajorversion.$osminorversion/__GETNODEATTR($$CN,arch)__;else mkdef testimage -u profile=compute provmethod=install osarch=__GETNODEATTR($$CN,arch)__;fi check:rc==0 cmd:kitcompname=`lskit mykits-1.0-1 |grep kitcompname|awk -F= '{print $2}'`;addkitcomp -i testimage $kitcompname check:rc==0 check:output=~Assigning kit component +cmd:if grep "CentOS Linux" /etc/*release;then osbasename=`lskit mykits-1.0-1 |grep -w osbasename|awk -F= '{print $2}'`;osmajorversion=`lskit mykits-1.0-1 |grep osmajorversion|awk -F= '{print $2}'`;osminorversion=`lskit mykits-1.0-1 |grep osminorversion|awk -F= '{print $2}'`;rmdef -t osdistro -o $osbasename-$osmajorversion.$osminorversion-__GETNODEATTR($$CN,arch)__;fi cmd:rmkit -f mykits-1.0-1 check:rc==0 check:output=~Removing kit mykits-1.0-1 @@ -131,11 +133,12 @@ check:rc==0 cmd:addkit /opt/xcat/share/xcat/tools/autotest/testcase/rmkit/mykits/mykits-1.0-1.tar.bz2 check:rc==0 check:output=~Kit mykits-1.0-1 was successfully added -cmd:mkdef testimage -u profile=compute provmethod=install osarch=__GETNODEATTR($$CN,arch)__ +cmd:if grep "CentOS Linux" /etc/*release;then osbasename=`lskit mykits-1.0-1 |grep -w osbasename|awk -F= '{print $2}'`;osmajorversion=`lskit mykits-1.0-1 |grep osmajorversion|awk -F= '{print $2}'`;osminorversion=`lskit mykits-1.0-1 |grep osminorversion|awk -F= '{print $2}'`;mkdef testimage -u profile=compute provmethod=install osarch=__GETNODEATTR($$CN,arch)__ osvers=$osbasename-$osmajorversion.$osminorversion;mkdef -t osdistro $osbasename-$osmajorversion.$osminorversion-__GETNODEATTR($$CN,arch)__ basename=$osbasename majorversion=$osmajorversion minorversion=$osminorversion arch=__GETNODEATTR($$CN,arch)__ type=Linux dirpaths=/install/$osbasename-$osmajorversion.$osminorversion/__GETNODEATTR($$CN,arch)__;else mkdef testimage -u profile=compute provmethod=install osarch=__GETNODEATTR($$CN,arch)__;fi check:rc==0 cmd:kitcompname=`lskit mykits-1.0-1 |grep kitcompname|awk -F= '{print $2}'`;addkitcomp -i testimage $kitcompname check:rc==0 check:output=~Assigning kit component +cmd:if grep "CentOS Linux" /etc/*release;then osbasename=`lskit mykits-1.0-1 |grep -w osbasename|awk -F= '{print $2}'`;osmajorversion=`lskit mykits-1.0-1 |grep osmajorversion|awk -F= '{print $2}'`;osminorversion=`lskit mykits-1.0-1 |grep osminorversion|awk -F= '{print $2}'`;rmdef -t osdistro -o $osbasename-$osmajorversion.$osminorversion-__GETNODEATTR($$CN,arch)__;fi cmd:rmkit -f mykits-1.0-1 -V check:rc==0 check:output=~Removing kit mykits-1.0-1 diff --git a/xCAT-test/autotest/testcase/rpower/rpower_wrongpasswd_test.sh b/xCAT-test/autotest/testcase/rpower/rpower_wrongpasswd_test.sh index 45b1b1891..a20d53dcb 100755 --- a/xCAT-test/autotest/testcase/rpower/rpower_wrongpasswd_test.sh +++ b/xCAT-test/autotest/testcase/rpower/rpower_wrongpasswd_test.sh @@ -1,55 +1,88 @@ #!/bin/bash +PATH="/opt/xcat/bin:/opt/xcat/sbin:/opt/xcat/share/xcat/tools:/usr/sbin:/usr/bin:/sbin:/bin:/root/bin" +export PATH + +function runcmd(){ + echo "Run command $*" + result=`$*` + if [[ $? -eq 0 ]];then + echo $result; + echo "Run command $*....[Succeed]\n"; + return 0; + else + echo $result; + echo "Run command $*... [Failed]\n"; + return 1; + fi +} + function check_passwd_table(){ +echo "Run tabdump passwd to check if password with $MGT exists" tabdump passwd |grep $MGT if [ $? -eq 0 ];then `tabdump passwd |grep $MGT>$TMPFILE` else + echo "There is no password in passwd table associated with $MGT" return 1; fi } function modify_passwd_table(){ Username=`cat $TMPFILE |awk -F "\"" '{print $4}'`; Passwd=`cat $TMPFILE |awk -F "\"" '{print $6}'`; -`chtab key=$MGT passwd.password=$Passwd.wrong passwd.username=$Username`; -tabdump passwd; +cmd="chtab key=$MGT passwd.password=$Passwd.wrong passwd.username=$Username"; +runcmd $cmd; +cmd="tabdump passwd"; +runcmd $cmd; } function add_passwd_table() { -`chtab key=$MGT passwd.password=$2 passwd.username=$3`; -rpower $1 stat +cmd="chtab key=$MGT passwd.password=$2 passwd.username=$3"; +runcmd $cmd; +cmd="rpower $1 stat"; +runcmd $cmd; if [ $? -eq 0 ];then - `chtab key=$MGT passwd.password=$2.wrong passwd.username=$3`; - tabdump passwd; + cmd="chtab key=$MGT passwd.password=$2.wrong passwd.username=$3"; + runcmd $cmd; + cmd="tabdump passwd"; + runcmd $cmd; else - echo "wrong password"; + echo "rpower $1 stat failed.Wrong password is provided, please check bmc username and password"; fi } function modify_node_definition() { -chdef $1 bmcpassword=$2 bmcusername=$3 -rpower $1 stat +cmd="chdef $1 bmcpassword=$2 bmcusername=$3"; +runcmd $cmd; +cmd="rpower $1 stat"; +runcmd $cmd; if [ $? -eq 0 ];then - chdef $1 bmcpassword=$2.wrong bmcusername=$3; - tabdump passwd; + runcmd "chdef $1 bmcpassword=$2.wrong bmcusername=$3"; + runcmd "tabdump passwd"; else - echo "wrong password"; + echo "rpower $1 stat failed.Wrong password is provided, please check bmc username and password"; fi } function clear_env(){ if [ -f $TMPFILE ];then Username=`cat $TMPFILE |awk -F "\"" '{print $4}'`; Passwd=`cat $TMPFILE |awk -F "\"" '{print $6}'`; - chtab key=$MGT passwd.password=$Passwd passwd.username=$Username;tabdump passwd; - chdef $1 bmcpassword= bmcusername=; + cmd="chtab key=$MGT passwd.password=$Passwd passwd.username=$Username"; + runcmd $cmd; + cmd="tabdump passwd"; + runcmd $cmd; + cmd="chdef $1 bmcpassword= bmcusername="; + runcmd $cmd; rm -rf $TMPFILE; else - `chtab -d key=$MGT passwd`; - chdef $1 bmcpassword= bmcusername=; + cmd="chtab -d key=$MGT passwd"; + runcmd $cmd; + cmd="chdef $1 bmcpassword= bmcusername="; + runcmd $cmd; fi } function check_result(){ output=$(rpower $1 stat 2>&1) -echo output is $output +echo "rpower $1 stat output is $output" value=""; if [[ `lsdef $1 |grep mgt ` =~ "ipmi" ]];then value="Incorrect password provided"; @@ -59,23 +92,21 @@ value=""; if [[ $output =~ $value ]];then return 0; else + echo "The expected output is \"$value\" since there password is wrong, but the real output is $output" return 1; fi } -echo "0 ARG: $0" SCRIPT=$(readlink -f $0) -echo "SCRIPT=$SCRIPT" TMPFILE="/tmp/xcat-test-`basename $SCRIPT`.tmp" -echo "TMPFILE=$TMPFILE" MGT="" if [[ `lsdef $2 |grep mgt` =~ "ipmi" ]];then MGT="ipmi"; else MGT="openbmc"; fi -echo mgt is $MGT +echo "The node $2's mgt is defined as $MGT" while [ "$#" -gt "0" ] do case $1 in @@ -103,7 +134,8 @@ do "-apt"|"--addpasswdtable" ) check_passwd_table if [[ $? -eq 0 ]];then - `chtab -d key=ipmi passwd`; + cmd="chtab -d key=ipmi passwd"; + runcmd $cmd; if [[ $? -eq 1 ]];then exit 1 fi diff --git a/xCAT-test/autotest/testcase/rscan/cases0 b/xCAT-test/autotest/testcase/rscan/cases0 index 636920a00..98f09ae30 100644 --- a/xCAT-test/autotest/testcase/rscan/cases0 +++ b/xCAT-test/autotest/testcase/rscan/cases0 @@ -24,6 +24,7 @@ end start:rscan_w label:others,hctrl_hmc hcp:hmc +cmd:lsdef -t node all -z > /tmp/all.stanza cmd:lsdef -t node -l $$CN -z > /tmp/$$CN.stanza check:rc==0 cmd:perl -pi -e 's/$$CN/testnode/g' /tmp/$$CN.stanza @@ -37,14 +38,16 @@ check:output=~hmc\s+__GETNODEATTR($$CN,hcp)__+\s+\w{4}-\w{3}\s+\w{7} cmd:lsdef -l $$CN check:rc==0 check:output=~hcp=__GETNODEATTR($$CN,hcp)__ -cmd:rmdef $$CN,testnode -cmd:perl -pi -e 's/testnode/$$CN/g' /tmp/$$CN.stanza -cmd:cat /tmp/$$CN.stanza | mkdef -z +cmd:rmdef all +cmd:cat /tmp/all.stanza | mkdef -z +cmd:chtab -d node=$$SN servicenode +cmd:rm -f /tmp/all.stanza cmd:rm -f /tmp/$$CN.stanza end start:rscan_x_w label:others,hctrl_hmc hcp:hmc +cmd:lsdef -t node all -z > /tmp/all.stanza cmd:lsdef -t node -l $$CN -z > /tmp/$$CN.stanza check:rc==0 cmd:perl -pi -e 's/$$CN/testnode/g' /tmp/$$CN.stanza @@ -56,14 +59,16 @@ check:output=~[\w-]+ cmd:lsdef -l $$CN check:rc==0 check:output=~hcp=__GETNODEATTR($$CN,hcp)__ -cmd:rmdef $$CN,testnode -cmd:perl -pi -e 's/testnode/$$CN/g' /tmp/$$CN.stanza -cmd:cat /tmp/$$CN.stanza | mkdef -z +cmd:rmdef all +cmd:cat /tmp/all.stanza | mkdef -z +cmd:chtab -d node=$$SN servicenode +cmd:rm -f /tmp/all.stanza cmd:rm -f /tmp/$$CN.stanza end start:rscan_z_w label:others,hctrl_hmc hcp:hmc +cmd:lsdef -t node all -z > /tmp/all.stanza cmd:lsdef -t node -l $$CN -z > /tmp/$$CN.stanza check:rc==0 cmd:perl -pi -e 's/$$CN/testnode/g' /tmp/$$CN.stanza @@ -75,9 +80,9 @@ check:output=~parent=[\w-]+ check:lsdef -l $$CN check:rc==0 check:output=~parent=[\w-]+ -cmd:rmdef $$CN,testnode -cmd:perl -pi -e 's/testnode/$$CN/g' /tmp/$$CN.stanza -cmd:cat /tmp/$$CN.stanza | mkdef -z +cmd:rmdef all +cmd:cat /tmp/all.stanza | mkdef -z +cmd:chtab -d node=$$SN servicenode +cmd:rm -f /tmp/all.stanza cmd:rm -f /tmp/$$CN.stanza end - diff --git a/xCAT-test/autotest/testcase/rspconfig/cases0 b/xCAT-test/autotest/testcase/rspconfig/cases0 index 8bc7f1bc2..7dfede674 100644 --- a/xCAT-test/autotest/testcase/rspconfig/cases0 +++ b/xCAT-test/autotest/testcase/rspconfig/cases0 @@ -311,6 +311,7 @@ cmd:lsdef bogus-bmc-hostname check:rc == 0 cmd:makehosts bogus-bmc-hostname check:rc == 0 +cmd:makedns -n cmd:makedns bogus-bmc-hostname check:rc == 0 cmd:chdef $$CN bmc=bogus-bmc-hostname diff --git a/xCAT-test/autotest/testcase/rspconfig/cases1 b/xCAT-test/autotest/testcase/rspconfig/cases1 index deff88bb1..f4155714d 100644 --- a/xCAT-test/autotest/testcase/rspconfig/cases1 +++ b/xCAT-test/autotest/testcase/rspconfig/cases1 @@ -111,9 +111,9 @@ check:output =~$$CN:\s*\[\d+\]\s* success cmd:sleep 300 cmd:dumpnumber=`sed -r 's/.+\[(.+)\].+/\1/g' /tmp/dumpgenerate`;rspconfig $$CN dump -d $dumpnumber |tee /tmp/dumpdown check:rc == 0 -cmd:dumpnumber=`sed -r 's/.+\[(.+)\].+/\1/g' /tmp/dumpgenerate`;grep "Downloaded dump $dumpnumber to /var/log/xcat/dump/" /tmp/dumpdown +cmd:dumpnumber=`sed -r 's/.+\[(.+)\].+/\1/g' /tmp/dumpgenerate`;grep "Downloading dump $dumpnumber to /var/log/xcat/dump/" /tmp/dumpdown check:rc == 0 -cmd:dumpnumber=`sed -r 's/.+\[(.+)\].+/\1/g' /tmp/dumpgenerate`;dumpsize=`rspconfig $$CN dump -l |grep "\[$dumpnumber\] Generated" |cut -d : -f 6`;ls -l /var/log/xcat/dump/*_$$CN_dump_$dumpnumber.tar.xz|grep $dumpsize +cmd:dumpnumber=`sed -r 's/.+\[(.+)\].+/\1/g' /tmp/dumpgenerate`;dumpsize=`rspconfig $$CN dump -l |grep "\[$dumpnumber\] Generated" |cut -d : -f 6`;sn=`lsdef $$CN -i servicenode -c | awk -F '=' '{print $2}'`;if [[ -z "$sn" ]]; then ls -l /var/log/xcat/dump/*_$$CN_dump_$dumpnumber.tar.xz|grep $dumpsize;else xdsh $sn ls -l /var/log/xcat/dump/*_$$CN_dump_$dumpnumber.tar.xz|grep $dumpsize;fi check:rc == 0 cmd:rspconfig $$CN dump -g |tee /tmp/dumpgenerate check:rc == 0 @@ -121,9 +121,9 @@ check:output =~$$CN:\s*\[\d+\]\s* success cmd:sleep 300 cmd:dumpnumber=`sed -r 's/.+\[(.+)\].+/\1/g' /tmp/dumpgenerate`;rspconfig $$CN dump --download $dumpnumber |tee /tmp/dumpdown check:rc == 0 -cmd:dumpnumber=`sed -r 's/.+\[(.+)\].+/\1/g' /tmp/dumpgenerate`;grep "Downloaded dump $dumpnumber to /var/log/xcat/dump/" /tmp/dumpdown +cmd:dumpnumber=`sed -r 's/.+\[(.+)\].+/\1/g' /tmp/dumpgenerate`;grep "Downloading dump $dumpnumber to /var/log/xcat/dump/" /tmp/dumpdown check:rc == 0 -cmd:dumpnumber=`sed -r 's/.+\[(.+)\].+/\1/g' /tmp/dumpgenerate`;dumpsize=`rspconfig $$CN dump -l |grep "\[$dumpnumber\] Generated" |cut -d : -f 6`;ls -l /var/log/xcat/dump/*_$$CN_dump_$dumpnumber.tar.xz|grep $dumpsize +cmd:dumpnumber=`sed -r 's/.+\[(.+)\].+/\1/g' /tmp/dumpgenerate`;dumpsize=`rspconfig $$CN dump -l |grep "\[$dumpnumber\] Generated" |cut -d : -f 6`;sn=`lsdef $$CN -i servicenode -c | awk -F '=' '{print $2}'`;if [[ -z "$sn" ]]; then ls -l /var/log/xcat/dump/*_$$CN_dump_$dumpnumber.tar.xz|grep $dumpsize;else xdsh $sn ls -l /var/log/xcat/dump/*_$$CN_dump_$dumpnumber.tar.xz|grep $dumpsize;fi check:rc == 0 cmd:rspconfig $$CN dump -d all check:rc == 0 @@ -145,7 +145,7 @@ check:output =~$$CN:\s*Dump requested check:output =~$$CN:\s*Downloading dump cmd:rspconfig $$CN dump -l |tail -n 1 |tee /tmp/dumpgenerate check:rc == 0 -cmd:dumpnumber=`sed -r 's/.+\[(.+)\].+/\1/g' /tmp/dumpgenerate`;dumpsize=`grep "\[$dumpnumber\] Generated" /tmp/dumpgenerate |cut -d : -f 6`;ls -l /var/log/xcat/dump/*_dump_$dumpnumber.tar.xz|grep $dumpsize|grep $$CN +cmd:dumpnumber=`sed -r 's/.+\[(.+)\].+/\1/g' /tmp/dumpgenerate`;dumpsize=`grep "\[$dumpnumber\] Generated" /tmp/dumpgenerate |cut -d : -f 6`;sn=`lsdef $$CN -i servicenode -c | awk -F '=' '{print $2}'`;if [[ -z "$sn" ]]; then ls -l /var/log/xcat/dump/*_$$CN_dump_$dumpnumber.tar.xz|grep $dumpsize|grep $$CN;else xdsh $sn ls -l /var/log/xcat/dump/*_$$CN_dump_$dumpnumber.tar.xz|grep $dumpsize|grep $$CN;fi check:rc == 0 cmd:rm -rf /tmp/dumpgenerate end diff --git a/xCAT-test/autotest/testcase/tabdump/cases0 b/xCAT-test/autotest/testcase/tabdump/cases0 index a1f1a1127..33bfb8b1e 100644 --- a/xCAT-test/autotest/testcase/tabdump/cases0 +++ b/xCAT-test/autotest/testcase/tabdump/cases0 @@ -177,3 +177,9 @@ cmd:tabdump -d site | grep xcatiport check:rc==0 check:output=~xcatiport end + +start:tabdump_servicenode +label:mn_only,ci_test,db +cmd:tabdump servicenode +check:rc==0 +end diff --git a/xCAT-test/autotest/testcase/xcatconfig/case0 b/xCAT-test/autotest/testcase/xcatconfig/case0 index 038d238fc..05f888c72 100644 --- a/xCAT-test/autotest/testcase/xcatconfig/case0 +++ b/xCAT-test/autotest/testcase/xcatconfig/case0 @@ -99,6 +99,8 @@ description:To regenerate cretials label:mn_only #step1:backup: /etc/xcat/ca /etc/xcat/cert cmd:cp -r /etc/xcat/ca /etc/xcat/cabak;cp -r /etc/xcat/cert /etc/xcat/certbak +cmd: service goconserver status +cmd:service conserver status #step2:run command and check the output cmd:xcatconfig -c 2>&1 | tee /tmp/xcatconfig.test check:rc==0 @@ -118,8 +120,32 @@ cmd:rm -rf /tmp/xcatconfig.test check:rc==0 cmd:rm -rf /etc/xcat/cabak /etc/xcat/certbak check:rc==0 -cmd:if service goconserver status > /dev/null 2>&1; then service goconserver restart; fi -cmd:if service conserver status > /dev/null 2>&1; then service conserver restart ; fi +cmd:#!/bin/bash +rc=0 +if service goconserver status;then + echo "----->goconserver is working, to restart goconserver and enforce conserver stop" + service goconserver restart + service conserver stop + sleep 5 + echo "----->To check the status of goconserver" + if ! service goconserver status; then + rc=1 + fi + echo "----->To check the status of conserver" + if service conserver status; then + rc=1 + fi +elif service conserver status;then + echo "----->conserver is working, to restart conserver" + service conserver restart + sleep 5 + echo "----->To check the status of conserver" + if ! service conserver status; then + rc=1 + fi +fi +exit $rc +check:rc==0 cmd:if lsdef service > /dev/null 2>&1; then updatenode service -P servicenode;fi check:rc==0 cmd:if lsdef service > /dev/null 2>&1; then rpower $$CN stat;fi diff --git a/xCAT-test/autotest/testcase/xdsh/cases0 b/xCAT-test/autotest/testcase/xdsh/cases0 index 3166cbc8d..744385b1b 100644 --- a/xCAT-test/autotest/testcase/xdsh/cases0 +++ b/xCAT-test/autotest/testcase/xdsh/cases0 @@ -31,7 +31,7 @@ cmd:xdsh $$SN "ls -l /var/xcat/syncfiles" > /dev/null 2>&1; if [ "$?" -ne "0" ]; check:rc==0 cmd: xdsh $$SN "echo 'test' > /var/xcat/syncfiles/xdsh_c.tmp" check:rc==0 -cmd: xdsh $$SN -c +cmd: echo Y | xdsh $$SN -c 2>/dev/null check:rc==0 cmd:xdsh $$SN "ls -l /var/xcat/syncfiles" check:rc==0 @@ -44,7 +44,7 @@ cmd:xdsh $$CN "ls -l /var/xcat/node/syncfiles" > /dev/null 2>&1; if [ "$?" -ne " check:rc==0 cmd: xdsh $$CN "echo 'test' > /var/xcat/node/syncfiles/xdsh_c.tmp" check:rc==0 -cmd: xdsh $$CN -c +cmd: echo Y | xdsh $$CN -c 2>/dev/null check:rc==0 cmd:xdsh $$CN "ls -l /var/xcat/node" check:rc==0 diff --git a/xCAT/debian/control b/xCAT/debian/control index b393fdea2..0b962b497 100644 --- a/xCAT/debian/control +++ b/xCAT/debian/control @@ -9,8 +9,8 @@ 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, libxml-parser-perl, xinetd, rsync, tftpd-hpa, libnet-telnet-perl, xcat-genesis-scripts-ppc64, xcat-genesis-scripts-amd64 -Recommends: bind9, nmap, tftp-hpa, ipmitool-xcat (>= 1.8.17-1), syslinux[any-amd64], libsys-virt-perl, syslinux-xcat, xnba-undi, elilo-xcat, +Depends: ${perl:Depends}, xcat-server, xcat-client, libdbd-sqlite3-perl, isc-dhcp-server, apache2, nfs-kernel-server, libxml-parser-perl, xinetd, rsync, tftpd-hpa, libnet-telnet-perl, xcat-genesis-scripts-amd64 +Recommends: bind9, nmap, tftp-hpa, syslinux[any-amd64], libsys-virt-perl, syslinux-xcat, xnba-undi 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 diff --git a/xCAT/postscripts/confGang b/xCAT/postscripts/confGang index 13ce7cfe4..5be4e780f 100755 --- a/xCAT/postscripts/confGang +++ b/xCAT/postscripts/confGang @@ -1,24 +1,24 @@ #!/bin/sh #get IP address of MS -OS=`uname` +OS=$(uname) echo "the OS is $OS" logger -t xcat -p local4.info "the OS is $OS" ms_ip=$MONMASTER echo "MS IP is $ms_ip" logger -t xcat -p local4.info "the MS is $ms_ip" -result=`ping -c1 $MONMASTER 2>&1` - if [ $? -eq 0 ]; then - index1=`expr index "$result" "\("` - index2=`expr index "$result" "\)"` - #ms_ip=${result:$index1+1:$index2-$index1-2} - pos=`expr $index1 + 1` - length=`expr $index2 - $index1` - length=`expr $length - 1` - ms_ip=`expr substr "$result" $pos $length` - echo final is $ms_ip - else - logger -t xcat -p local4.info "Gangliamon setup" - fi +result=$(ping -c1 $MONMASTER 2>&1) +if [ $? -eq 0 ]; then + index1=$(expr index "$result" "\(") + index2=$(expr index "$result" "\)") + #ms_ip=${result:$index1+1:$index2-$index1-2} + pos=$(expr $index1 + 1) + length=$(expr $index2 - $index1) + length=$(expr $length - 1) + ms_ip=$(expr substr "$result" $pos $length) + echo final is $ms_ip +else + logger -t xcat -p local4.info "Gangliamon setup" +fi CLUSTER=\"$MONSERVER\" echo "cluster is $CLUSTER" @@ -26,102 +26,26 @@ logger -t xcat -p local4.info "cluster is $CLUSTER" MASTER=$ms_ip #echo "The new IP is: $NEW_IP" #echo "I will replace now.... -gmond_conf="/etc/ganglia/gmond.conf" -gmond_conf_old="/etc/gmond.conf" +gmond_conf=$(gmond --help|grep -Eo "[a-z/]+/gmond.conf") +gmond_version=$(gmond -V|cut -d" " -f2) - if [ $OS == "AIX" ]; then - echo "into AIX loop" - logger -t xcat -p local4.info "into AIX loop" - if [ -f $gmond_conf_old ]; then - echo "ganglia version 3.0.7" - logger -t xcat -p local4.info "ganglia version 3.0.7" - grep "xCAT gmond settings done" $gmond_conf_old - if [ $? -gt 0 ]; then - /bin/cp -f $gmond_conf_old /etc/gmond.conf.orig - sed -e "s/setuid = yes/setuid = no/1" $gmond_conf_old > /etc/gmond.conf1 - sed -e 's/name = "unspecified"/name='$CLUSTER'/1' /etc/gmond.conf1 > /etc/gmond.conf2 - sed -e "1,40s/mcast_join = .*/host = $MASTER/" /etc/gmond.conf2 > /etc/gmond.conf3 - sed -e 's/mcast_join/#/g' /etc/gmond.conf3 > /etc/gmond.conf4 - sed -e "s/bind/#/g" /etc/gmond.conf4 > /etc/gmond.conf5 - /bin/cp -f /etc/gmond.conf5 $gmond_conf_old - rm -f /etc/gmond.conf1 /etc/gmond.conf2 /etc/gmond.conf3 /etc/gmond.conf4 /etc/gmond.conf5 - echo "# xCAT gmond settings done sh" >> $gmond_conf_old - fi - fi - fi - - - if [ $OS == "AIX" ]; then - echo "into AIX new loop" - logger -t xcat -p local4.info "into AIX new loop" - if [ -f $gmond_conf ]; then - echo "ganglia version v3.10" - logger -t xcat -p local4.info "ganglia version v3.10" - grep "xCAT gmond settings done" $gmond_conf - if [ $? -gt 0 ]; then - /bin/cp -f $gmond_conf /etc/ganglia/gmond.conf.orig - sed -e "s/setuid = yes/setuid = no/1" $gmond_conf > /etc/ganglia/gmond.conf1 - sed -e 's/name = "unspecified"/name='$CLUSTER'/1' /etc/ganglia/gmond.conf1 > /etc/ganglia/gmond.conf2 - sed -e "1,40s/mcast_join = .*/host = $MASTER/" /etc/ganglia/gmond.conf2 > /etc/ganglia/gmond.conf3 - sed -e 's/mcast_join/#/g' /etc/ganglia/gmond.conf3 > /etc/ganglia/gmond.conf4 - sed -e "s/bind/#/g" /etc/ganglia/gmond.conf4 > /etc/ganglia/gmond.conf5 - /bin/cp -f /etc/ganglia/gmond.conf5 $gmond_conf - rm -f /etc/ganglia/gmond.conf1 /etc/ganglia/gmond.conf2 /etc/ganglia/gmond.conf3 /etc/ganglia/gmond.conf4 /etc/ganglia/gmond.conf5 - echo "# xCAT gmond settings done sh" >> $gmond_conf - fi - fi - fi - - - - - - if [ $OS != "AIX" ]; then - echo "not AIX" - logger -t xcat -p local4.info "not AIX" - if [ -f $gmond_conf ]; then - grep "xCAT gmond settings done" $gmond_conf - if [ $? -gt 0 ]; then - /bin/cp -f $gmond_conf /etc/ganglia/gmond.conf.orig - sed -i 's/setuid = yes/setuid = no/1' $gmond_conf - sed -i 's/name = "unspecified"/name='$CLUSTER'/1' $gmond_conf - sed -e "1,50s/^ *mcast_join = .*/host = $MASTER/" $gmond_conf > /etc/temp.conf - /bin/cp -f /etc/temp.conf $gmond_conf - sed -i 's/^ *mcast_join/#mcast_join/g' $gmond_conf - sed -i 's/^ *bind/#bind/g' $gmond_conf - echo "# xCAT gmond settings done sh" >> $gmond_conf - fi - fi - fi - - - if [ $OS != "AIX" ]; then - echo "not AIX" - logger -t xcat -p local4.info "not AIX" - - if [ -f $gmond_conf_old ]; then - grep "xCAT gmond settings done" $gmond_conf_old - if [ $? -gt 0 ]; then - /bin/cp -f $gmond_conf_old /etc/gmond.conf.orig - sed -i 's/setuid = yes/setuid = no/1' $gmond_conf_old - sed -i 's/name = "unspecified"/name='$CLUSTER'/1' $gmond_conf_old - sed -e "1,40s/mcast_join = .*/host = $MASTER/" $gmond_conf_old > /etc/temp.conf - /bin/cp -f /etc/temp.conf $gmond_conf_old - sed -i 's/mcast_join/#/g' $gmond_conf_old - sed -i 's/bind/#/g' $gmond_conf_old - echo "# xCAT gmond settings done sh_old" >> $gmond_conf_old - fi - fi +if [ ! -f $gmond_conf ]; then + # echo "file not found" + logger -t xcat -p local4.warning "gmond configuration file not found. Generating a default one" + gmond -t > ${gmond_conf} fi - if [ ! -f $gmond_conf ]; then - # echo "file not found" - logger -t xcat -p local4.warning "gmond configuration file not found" - fi - - if [ ! -f $gmond_conf_old ]; then - # echo "file not found" - logger -t xcat -p local4.warning "gmond configuration file not found" - fi +echo "ganglia version ${gmond_version}" +logger -t xcat -p local4.info "ganglia version ${gmond_version}" +grep "xCAT gmond settings done" $gmond_conf +if [ $? -gt 0 ]; then + /bin/cp -f $gmond_conf /etc/ganglia/gmond.conf.orig + sed -i -e "s/setuid = yes/setuid = no/1" ${gmond_conf} + sed -i -e 's/name = "unspecified"/name='$CLUSTER'/1' ${gmond_conf} + sed -i -e "1,40s/mcast_join = .*/host = $MASTER/" ${gmond_conf} + sed -i -e '/mcast_join/d' ${gmond_conf} + sed -i -e "/\s\+bind/d" ${gmond_conf} + echo "# xCAT gmond settings done sh" >> $gmond_conf +fi exit 0 diff --git a/xCAT/postscripts/configeth b/xCAT/postscripts/configeth index 80e2e5d56..b2ca8a318 100755 --- a/xCAT/postscripts/configeth +++ b/xCAT/postscripts/configeth @@ -26,12 +26,17 @@ fi ######################################################################## # networkmanager_active=0: use network.service # networkmanager_active=1: use NetworkManager +# networkmanager_active=2: RH8 postscripts stage, NetworkManager is active but nmcli cannot modify NIC configure file ######################################################################## networkmanager_active=0 -checkservicestatus NetworkManager > /dev/null -if [ $? -eq 0 ]; then - networkmanager_active=1 +if [ -n "$NMCLI_USED" ] ; then + if [ "$NMCLI_USED" = "1" ]; then + networkmanager_active=1 + elif [ "$NMCLI_USED" = "2" ]; then + networkmanager_active=2 + fi fi + str_conf_file="" str_conf_file_xcatbak="" tmp_con_name="" @@ -40,7 +45,7 @@ function configipv4(){ str_v4ip=$2 str_v4net=$3 str_v4mask=$4 - num_v4num=$5 + num_v4num=$5 #If NIC has multiple IPs, the ordinal number of IP is num_v4num str_extra_params=$6 str_nic_mtu=$7 @@ -131,18 +136,45 @@ function configipv4(){ # Write the info to the ifcfg file for redhat con_name="xcat-"${str_if_name} str_conf_file="" - if [ $num_v4num -ne 0 ]; then - str_if_name=${str_if_name}:${num_v4num} - fi - str_conf_file="/etc/sysconfig/network-scripts/ifcfg-${str_if_name}" if [ $networkmanager_active -eq 1 ]; then - is_nmcli_connection_exist $con_name - if [ $? -eq 0 ]; then - tmp_con_name=$con_name"-tmp" - nmcli con modify $con_name connection.id $tmp_con_name + if [ $num_v4num -eq 0 ]; then + is_nmcli_connection_exist $con_name + if [ $? -eq 0 ]; then + tmp_con_name=$con_name"-tmp" + nmcli con modify $con_name connection.id $tmp_con_name + fi + nmcli con add type ethernet con-name $con_name ifname ${str_if_name} ipv4.method manual ipv4.addresses ${str_v4ip}/${str_prefix} connection.autoconnect-priority 9 + else + nmcli con modify $con_name +ipv4.addresses ${str_v4ip}/${str_prefix} fi - nmcli con add type ethernet con-name $con_name ifname ${str_if_name} ipv4.method manual ipv4.addresses ${str_v4ip}/${str_prefix} connection.autoconnect-priority 9 + str_conf_file="/etc/sysconfig/network-scripts/ifcfg-xcat-${str_if_name}" + str_conf_file_1="/etc/sysconfig/network-scripts/ifcfg-xcat-${str_if_name}-1" + if [ -f $str_conf_file_1 ]; then + grep -x "NAME=$con_name" $str_conf_file_1 >/dev/null 2>/dev/null + if [ $? -eq 0 ]; then + str_conf_file=$str_conf_file_1 + fi + fi + elif [ $networkmanager_active -eq 2 ]; then + str_conf_file="/etc/sysconfig/network-scripts/ifcfg-xcat-${str_if_name}" + if [ $num_v4num -eq 0 ]; then + echo "DEVICE=${str_if_name}" > $str_conf_file + echo "BOOTPROTO=none" >> $str_conf_file + echo "IPADDR=${str_v4ip}" >> $str_conf_file + echo "NETMASK=${str_v4mask}" >> $str_conf_file + echo "NAME=xcat-${str_if_name}" >> $str_conf_file + echo "ONBOOT=yes" >> $str_conf_file + echo "AUTOCONNECT_PRIORITY=9" >> $str_conf_file + else + echo "IPADDR$num_v4num=${str_v4ip}" >> $str_conf_file + echo "NETMASK$num_v4num=${str_v4mask}" >> $str_conf_file + fi else + #If using network service, the NIC alias device format is : like eth0:1 + if [ $num_v4num -ne 0 ]; then + str_if_name=${str_if_name}:${num_v4num} + fi + str_conf_file="/etc/sysconfig/network-scripts/ifcfg-${str_if_name}" echo "DEVICE=${str_if_name}" > $str_conf_file echo "BOOTPROTO=none" >> $str_conf_file echo "NM_CONTROLLED=no" >> $str_conf_file @@ -152,26 +184,23 @@ function configipv4(){ fi if [ "$str_nic_mtu" != "$str_default_token" ]; then if [ $networkmanager_active -eq 1 ]; then - nmcli con modify $con_name mtu $str_nic_mtu + nmcli con modify $con_name mtu $str_nic_mtu else echo "MTU=${str_nic_mtu}" >> $str_conf_file - fi + fi fi - if [[ ${str_if_name} == [a-zA-Z0-9]*.[0-9]* ]]; then echo "VLAN=yes" >> $str_conf_file fi - - #add extra params - i=0 - while [ $i -lt ${#array_extra_param_names[@]} ] - do - name="${array_extra_param_names[$i]}" - value="${array_extra_param_values[$i]}" - echo " $i: name=$name value=$value" - echo "${name}=${value}" >> $str_conf_file - i=$((i+1)) - done + #add extra params + i=0 + while [ $i -lt ${#array_extra_param_names[@]} ] + do + name="${array_extra_param_names[$i]}" + value="${array_extra_param_values[$i]}" + echo "${name}=${value}" >> $str_conf_file + i=$((i+1)) + done fi } @@ -341,7 +370,7 @@ function add_ip_temporary(){ else str_label='' ip addr show dev $str_temp_name | grep inet | grep "global" | grep -v ':' | grep "${str_temp_name}" - if [ $? -eq 0 ];then + if [ $? -eq 0 ] && [ $networkmanager_active -eq 0 ]; then for num_i in {1..1000} do ip addr show dev $str_temp_name | grep inet | grep "global" | grep ":${num_i}" @@ -627,9 +656,12 @@ elif [ "$1" = "-s" ];then echo $NODE > /etc/HOSTNAME else #write ifcfg-* file for redhat - con_name="xcat-install-"${str_inst_nic} + con_name="xcat-"${str_inst_nic} str_inst_prefix=$(v4mask2prefix ${str_inst_mask}) str_conf_file="/etc/sysconfig/network-scripts/ifcfg-${str_inst_nic}" + if [ $networkmanager_active -eq 2 ]; then + str_conf_file="/etc/sysconfig/network-scripts/ifcfg-$con_name" + fi if [ $networkmanager_active -eq 1 ]; then is_nmcli_connection_exist "$con_name" if [ $? -eq 0 ]; then @@ -637,20 +669,31 @@ elif [ "$1" = "-s" ];then nmcli con modify $con_name connection.id $tmp_con_name fi nmcli con add type ethernet con-name $con_name ifname ${str_inst_nic} ipv4.method manual ipv4.addresses ${str_inst_ip}/${str_inst_prefix} connection.autoconnect-priority 9 + str_conf_file_1="/etc/sysconfig/network-scripts/ifcfg-xcat-${str_if_name}-1" + if [ -f $str_conf_file_1 ]; then + grep $con_name $str_conf_file_1 >/dev/null 2>/dev/null + if [ $? -eq 0 ]; then + $str_conf_file=$str_conf_file_1 + fi + fi else echo "DEVICE=${str_inst_nic}" > $str_conf_file echo "IPADDR=${str_inst_ip}" >> $str_conf_file echo "NETMASK=${str_inst_mask}" >> $str_conf_file echo "BOOTPROTO=none" >> $str_conf_file echo "ONBOOT=yes" >> $str_conf_file + echo "NAME=${con_name}" >> $str_conf_file echo "HWADDR=${str_inst_mac}" >> $str_conf_file fi + if [ $networkmanager_active -eq 2 ]; then + echo "AUTOCONNECT_PRIORITY=9" >> $str_conf_file + fi if [ -n "${str_inst_mtu}" ];then - if [ $networkmanager_active -eq 1 ]; then - nmcli con modify $con_name mtu ${str_inst_mtu} + if [ $networkmanager_active -eq 1 ]; then + nmcli con modify $con_name mtu ${str_inst_mtu} else echo "MTU=${str_inst_mtu}" >> $str_conf_file - fi + fi fi if [ -n "$str_inst_gateway" ];then grep -i "GATEWAY" /etc/sysconfig/network @@ -660,17 +703,16 @@ elif [ "$1" = "-s" ];then echo "GATEWAY=${str_inst_gateway}" >> /etc/sysconfig/network fi fi - - #add extra params - i=0 - while [ $i -lt ${#array_extra_param_names[@]} ] - do - name="${array_extra_param_names[$i]}" - value="${array_extra_param_values[$i]}" - echo " $i: name=$name value=$value" - echo "${name}=${value}" >> $str_conf_file - i=$((i+1)) - done + #add extra params + i=0 + while [ $i -lt ${#array_extra_param_names[@]} ] + do + name="${array_extra_param_names[$i]}" + value="${array_extra_param_values[$i]}" + echo "$i: name=$name value=$value" + echo "${name}=${value}" >> $str_conf_file + i=$((i+1)) + done hostname $NODE if [ -f "/etc/hostname" ]; then @@ -692,9 +734,10 @@ elif [ "$1" = "-s" ];then else ip link set dev $str_inst_nic down fi - if [ $networkmanager_active -eq 1 ]; then + if [ $networkmanager_active -eq 1 ]; then + nmcli con reload nmcli con up $con_name - else + else ifup $str_inst_nic fi if [ $? -ne 0 ]; then @@ -1111,11 +1154,12 @@ else if [ $reboot_nic_bool -eq 1 ]; then if_state=0 echo "bring up ip" - if [ $networkmanager_active -eq 1 ]; then + if [ $networkmanager_active -eq 1 ]; then + nmcli con reload nmcli con up $con_name - else + else ifup $str_nic_name - fi + fi if [ $? -ne 0 ]; then if_state=$(wait_for_ifstate $str_nic_name UP 20 5) fi diff --git a/xCAT/postscripts/configib b/xCAT/postscripts/configib index eb3d56f1b..552a35454 100755 --- a/xCAT/postscripts/configib +++ b/xCAT/postscripts/configib @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash # IBM(c) 2013 EPL license http://www.eclipse.org/legal/epl-v10.html # Internal script used by confignics only # xCAT post script for configuring ib adapters. @@ -29,6 +29,16 @@ else log_label="xcat" fi +######################################################################## +# nmcli_used=0: use network.service +# nmcli_used=1: use NetworkManager +######################################################################## +nmcli_used=0 +ps -ef|grep -v grep|grep NetworkManager >/dev/null 2>/dev/null +if [ $? -eq 0 ]; then + nmcli_used=1 +fi + #This is the number of ports for each ib adpator. portnum=1 if [ -n "$NIC_IBAPORTS" ]; then @@ -461,11 +471,20 @@ IPADDR_$ipindex=$nicip" >> $dir/ifcfg-$nic # First ip address if [ $ipindex -eq 1 ] then + nmcontrol="" + devtype="" + if [ $nmcli_used -eq 0 ]; then + nmcontrol="NM_CONTROLLED=no" + else + devtype="TYPE=InfiniBand" + fi # Write the info to the ifcfg file echo "DEVICE=$nic -NM_CONTROLLED=no +$nmcontrol +$devtype BOOTPROTO=none ONBOOT=yes +NAME=$nic IPADDR=$nicip" > $dir/ifcfg-$nic # ipv6 if echo $nicip | grep : 2>&1 1>/dev/null @@ -514,23 +533,37 @@ IPV6ADDR=$nicip/$netmask" >> $dir/ifcfg-$nic echo "IPV6_DEFAULTGW=$gateway" >> $dir/ifcfg-$nic fi else # ipv4 address - echo "DEVICE=$nic:$ipindex + if [ $nmcli_used -eq 0 ]; then + cfgfile=$dir"/ifcfg-"$nic":"$ipindex + cfgcontent= "DEVICE=$nic:$ipindex NM_CONTROLLED=no BOOTPROTO=none ONBOOT=yes -IPADDR=$nicip" > $dir/ifcfg-$nic:$ipindex +NETMASK=$netmask +IPADDR=$nicip" + echo "$cfgcontent" > $cfgfile + else + cfgfile=$dir"/ifcfg-"$nic + cfgcontent="NETMASK$ipindex=$netmask +IPADDR$ipindex=$nicip" + echo "$cfgcontent" >> $cfgfile + fi if [[ "$OSVER" == rhels6* ]] then #get prefix from netmask, this is for IPv4 only prefix=24 prefix=$(convert_netmask_to_cidr $netmask) - echo "PREFIX=$prefix" >> $dir/ifcfg-$nic:$ipindex + echo "PREFIX=$prefix" >> $cfgfile else - echo "NETMASK=$netmask" >> $dir/ifcfg-$nic:$ipindex + echo "$nicnetmask" >> $cfgfile fi if [ -n "$gateway" ]; then - echo "GATEWAY=$gateway" >> $dir/ifcfg-$nic:$ipindex + if [ $nmcli_used -eq 0 ]; then + echo "GATEWAY=$gateway" >> $cfgfile + else + echo "GATEWAY$ipindex=$gateway" >> $cfgfile + fi fi #add extra params @@ -540,12 +573,14 @@ IPADDR=$nicip" > $dir/ifcfg-$nic:$ipindex name="${array_extra_param_names[$i]}" value="${array_extra_param_values[$i]}" echo " $i: name=$name value=$value" - echo "${name}=${value}" >> $dir/ifcfg-$nic:$ipindex + echo "${name}=${value}" >> $cfgfile i=$((i+1)) done # need to run ifup eth1:1 for RedHat - goodnics="$goodnics,$nic:$ipindex" + if [ $nmcli_used -eq 0 ]; then + goodnics="$goodnics,$nic:$ipindex" + fi fi fi # end not the first ip address elif [ $OS_name == 'ubuntu' ] @@ -705,8 +740,13 @@ then sleep 2 ifup $tmp > /dev/null 2>&1 done - else - ifup $nic > /dev/null 2>&1 + else + if [ $nmcli_used -eq 1 ]; then + nmcli con reload $dir/ifcfg-$nic + nmcli con up $nic 2>&1 + else + ifup $nic > /dev/null 2>&1 + fi fi fi done diff --git a/xCAT/postscripts/configinterface b/xCAT/postscripts/configinterface index 1ec8d0d8b..f21d0d8cd 100755 --- a/xCAT/postscripts/configinterface +++ b/xCAT/postscripts/configinterface @@ -15,6 +15,7 @@ fi if [ -z "$MASTER" ]; then MASTER=$(cat /var/lib/dhcp/dhclient.eth0.leases|sed -n 's/.*cumulus-provision-url.*http:\/\+\([^\/]\+\)\/.*/\1/p'|tail -1) + MASTER=$(echo $MASTER | awk -F: '{print $1}') if [ -z "$MASTER" ]; then echo "xCAT Master unset! Cannot download interface description" exit 2 diff --git a/xCAT/postscripts/confignetwork b/xCAT/postscripts/confignetwork index 40f4d4ace..07e98aa7c 100755 --- a/xCAT/postscripts/confignetwork +++ b/xCAT/postscripts/confignetwork @@ -63,7 +63,7 @@ function get_nic_cfg_file_content { elif [ $is_debian -eq 1 ]; then cfg_file="$nwdir/${cfg_dev}" fi - if [ "$networkmanager_active" = "1" ]; then + if [ "$networkmanager_active" != "0" ]; then $ip address show dev ${cfg_dev}| $sed -e 's/^/[Ethernet] >> /g' | log_lines info else if [ -f $cfg_file ]; then @@ -472,9 +472,11 @@ function configure_nicdevice { while [ $num -lt $max ]; do nic_dev=`echo "$nics_pair" |sed -n "${num}p"|awk '{print $1}'` + ipaddrs=$(find_nic_ips $nic_dev) + multiple_ips=$(echo $ipaddrs|grep "|") #If install nic is configured, skip to reconfigure it - if [ x"$nic_dev" = x"$installnic" -a $instnic_conf -eq 1 ]; then - log_warn "install nic $nic_dev has been configured, skip to reconfigure it." + if [ x"$nic_dev" = x"$installnic" -a $instnic_conf -eq 1 -a x"$multiple_ips" = x ]; then + log_warn "install nic $nic_dev has been configured, continue." ((num+=1)) continue fi @@ -526,7 +528,6 @@ function configure_nicdevice { echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" nic_pair=`echo "$nics_pair" |sed -n "${num}p"` echo "configure nic and its device : $nic_pair" - ipaddrs=$(find_nic_ips $nic_dev) # if a device is middle device, it may have no IP, for example, configure eth0->vlan.1->br0, vlan1.1 is middle device # is_mid_device is to label if ${nic_dev} is middle device # if $is_mid_device has value, the ${nic_dev} is middle device, or else, it is not middle device @@ -541,8 +542,8 @@ function configure_nicdevice { xcatnet=`query_nicnetworks_net $nic_dev` if [ -n "$ipaddrs" ]; then log_info "configure $nic_dev" - log_info "call: configeth $nic_dev $ipaddrs $xcatnet" - configeth $nic_dev $ipaddrs $xcatnet + log_info "call: NMCLI_USED=$networkmanager_active configeth $nic_dev $ipaddrs $xcatnet" + NMCLI_USED=$networkmanager_active configeth $nic_dev $ipaddrs $xcatnet if [ $? -ne 0 ]; then errorcode=1 fi @@ -568,7 +569,9 @@ function configure_nicdevice { else create_bridge_interface ifname=$nic_dev _brtype=$nic_dev_type _port=$base_nic_dev _pretype=$base_nic_type fi - elif [ "$networkmanager_active" = "1" ]; then + elif [ "$networkmanager_active" = "2" ]; then + create_bridge_interface ifname=$nic_dev _brtype=$nic_dev_type _port=$base_nic_dev _pretype=$base_nic_type + else create_bridge_interface_nmcli ifname=$nic_dev _brtype=$nic_dev_type _port=$base_nic_dev _pretype=$base_nic_type _ipaddr=$ipaddrs fi if [ $? -ne 0 ]; then @@ -585,9 +588,9 @@ function configure_nicdevice { vlanname=`echo "$nic_dev" | $sed -e 's/^\(.*\)vla\?n\?\([0-9]\+\)$/\1/'` fi ipaddrs=$(find_nic_ips $nic_dev) - if [ "$networkmanager_active" = "0" ]; then + if [ "$networkmanager_active" != "1" ]; then create_vlan_interface ifname=$vlanname vlanid=$vlanid - elif [ "$networkmanager_active" = "1" ]; then + else create_vlan_interface_nmcli ifname=$vlanname vlanid=$vlanid ipaddrs=$ipaddrs next_nic=$is_mid_device fi if [ $? -ne 0 ]; then @@ -596,9 +599,9 @@ function configure_nicdevice { fi #configure bond elif [ x"$nic_dev_type" = "xbond" ]; then - if [ "$networkmanager_active" = "0" ]; then + if [ "$networkmanager_active" != "1" ]; then create_bond_interface ifname=$nic_dev slave_ports=$base_nic_for_bond slave_type=$base_nic_type - elif [ "$networkmanager_active" = "1" ]; then + else create_bond_interface_nmcli bondname=$nic_dev slave_ports=$base_nic_for_bond slave_type=$base_nic_type _ipaddr=$ipaddrs next_nic=$is_mid_device fi if [ $? -ne 0 ]; then @@ -633,6 +636,20 @@ errorcode=0 #nictypes should support capital letters, for example, Ethernet and ethernet utolcmd="sed -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/" +#check if using NetworkManager or network service +networkmanager_active=3 +check_NetworkManager_or_network_service +is_active=$? +if [ $is_active -eq 0 ]; then + networkmanager_active=0 +elif [ $is_active -eq 1 ]; then + networkmanager_active=1 +elif [ $is_active -eq 2 ]; then + networkmanager_active=2 +else + exit 1 +fi + #get for installnic installnic='' installnic=`get_installnic` @@ -640,9 +657,10 @@ instnic_conf=0 if [ $boot_install_nic -eq 1 ];then if [ -n "$installnic" ]; then echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" - log_info "configure the install nic $installnic. " + log_info "configure the install nic $installnic." + log_info "NMCLI_USED=$networkmanager_active configeth -s $installnic" instnic_conf=1 - configeth -s $installnic + NMCLI_USED=$networkmanager_active configeth -s $installnic if [ $? -ne 0 ]; then errorcode=1 fi @@ -654,18 +672,6 @@ if [ $boot_install_nic -eq 1 ];then fi fi -#check if using NetworkManager or network service -networkmanager_active=2 -check_NetworkManager_or_network_service -is_active=$? -if [ $is_active -eq 0 ]; then - networkmanager_active=0 -elif [ $is_active -eq 1 ]; then - networkmanager_active=1 -else - exit 1 -fi - #back up all network interface configure files nwdirbak=$nwdir".xcatbak" ls $nwdirbak > /dev/null 2>/dev/null diff --git a/xCAT/postscripts/cuda_power9_setup b/xCAT/postscripts/cuda_power9_setup index 23a9f8aa7..d3e5b33dc 100755 --- a/xCAT/postscripts/cuda_power9_setup +++ b/xCAT/postscripts/cuda_power9_setup @@ -15,19 +15,50 @@ umask 0022 -mkdir ${IMG_ROOTIMGDIR}/etc/systemd/system/nvidia-persistenced.service.d +echo "==> Override settings in /etc/systemd/system/nvidia-persistenced.service.d..." +mkdir -p ${IMG_ROOTIMGDIR}/etc/systemd/system/nvidia-persistenced.service.d printf '[Service]\nPIDFile=/var/run/nvidia-persistenced/nvidia-persistenced.pid\n' > ${IMG_ROOTIMGDIR}/etc/systemd/system/nvidia-persistenced.service.d/pidfile.conf printf '[Service]\nRestart=always\n' > ${IMG_ROOTIMGDIR}/etc/systemd/system/nvidia-persistenced.service.d/restartalways.conf [ ! -z "${IMG_ROOTIMGDIR}" ] && CHROOTCMD="chroot ${IMG_ROOTIMGDIR}" $CHROOTCMD /bin/bash -c "systemctl enable nvidia-persistenced" -if [ -f ${IMG_ROOTIMGDIR}/lib/udev/rules.d/40-redhat.rules ] -then - sed -i /SUBSYSTEM==\"memory\"/d ${IMG_ROOTIMGDIR}/lib/udev/rules.d/40-redhat.rules +# Disable a udev rule installed by default in some Linux distributions that cause hot-pluggable +# memory to be automatically onlined when it is physically probed. +# +# The overrides for /lib/udev rules should be done in /etc/udev +# +UDEV_REDHAT_SOURCE=${IMG_ROOTIMGDIR}/lib/udev/rules.d/40-redhat.rules +UDEV_REDHAT_TARGET=${IMG_ROOTIMGDIR}/etc/udev/rules.d/40-redhat.rules + +# If the file does not exist in /etc/udev, copy it from /lib/udev +if [ ! -e ${UDEV_REDHAT_TARGET} ]; then + cp -n ${UDEV_REDHAT_SOURCE} ${UDEV_REDHAT_TARGET} fi +# Disable udev memory auto-onlining Rule for cuda10.x +# +# For RHELS 7.5 ALT +# +sed -i "s/^\(SUBSYSTEM==\"memory\".*\)/#\1/" ${UDEV_REDHAT_TARGET} +# +# For RHELS 7.6 ALT +# +if [[ `grep 'Memory hotadd request' ${UDEV_REDHAT_TARGET} 2>&1 >> /dev/null && grep 'LABEL="memory_hotplug_end' ${UDEV_REDHAT_TARGET} 2>&1 >> /dev/null; echo $?` == 0 ]]; then + echo "Detected RHELS 7.6 ALT, modifying ${UDEV_REDHAT_TARGET}..." + # Comment out the memory hotadd request (for reference) + if [[ `grep "## Memory hotadd request" ${UDEV_REDHAT_TARGET} 2>&1 >> /dev/null; echo $?` != 0 ]]; then + # but only run one time, not if it's already commented out. (to handle multiple genimage calls) + sed -i '/Memory hotadd request/,+8 s/^/#/' ${UDEV_REDHAT_TARGET} + fi +fi + +echo "Comparing ${UDEV_REDHAT_SOURCE} and ${UDEV_REDHAT_TARGET}" +diff ${UDEV_REDHAT_SOURCE} ${UDEV_REDHAT_TARGET} + +echo "==> Setting NVIDIA options in /usr/lib/modprobe.d/nvidia.conf..." echo 'options nvidia NVreg_EnableStreamMemOPs=1 NVreg_RegistryDwords="PeerMappingOverride=1"' >${IMG_ROOTIMGDIR}/usr/lib/modprobe.d/nvidia.conf +echo 'blacklist nouveau' >> ${IMG_ROOTIMGDIR}/usr/lib/modprobe.d/nvidia.conf if [ -z "${IMG_ROOTIMGDIR}" ] then diff --git a/xCAT/postscripts/cumulusztp b/xCAT/postscripts/cumulusztp index e9f7a8e6c..38f5ddad9 100755 --- a/xCAT/postscripts/cumulusztp +++ b/xCAT/postscripts/cumulusztp @@ -35,6 +35,7 @@ function get_last_lease() #get ip address for server node server_ip="$(grep 'cumulus-provision-url' < <(get_last_lease eth0) | awk -F/ '{print $3}')" +server_ip="$(echo $server_ip | awk -F: '{print $1}')" hashostname="$(grep 'host-name' < <(get_last_lease eth0))" #download /install/postscripts from MN diff --git a/xCAT/postscripts/documulusdiscovery b/xCAT/postscripts/documulusdiscovery index c3e9d8db7..0d69111a5 100755 --- a/xCAT/postscripts/documulusdiscovery +++ b/xCAT/postscripts/documulusdiscovery @@ -4,6 +4,7 @@ # TODO: Figure out the master based on the DHCP packet XCATMASTER=$(cat /var/lib/dhcp/dhclient.eth0.leases |grep cumulus-provision-url|tail -1|awk -F/ '{print $3}') +XCATMASTER=$(echo $XCATMASTER | awk -F: '{print $1}') XCATPORT=3001 log_label="xcat.documulusdiscovery" diff --git a/xCAT/postscripts/nicutils.sh b/xCAT/postscripts/nicutils.sh index 22f499f92..905b6f52c 100755 --- a/xCAT/postscripts/nicutils.sh +++ b/xCAT/postscripts/nicutils.sh @@ -27,6 +27,7 @@ brctl="brctl" uniq="uniq" xargs="xargs" modprobe="modprobe" +xcatcreatedcon='' if [ -n "$LOGLABEL" ]; then log_label=$LOGLABEL else @@ -1580,12 +1581,24 @@ function decode_arguments { ############################################################################### # # check NetworkManager -# output: 2 error +# output: 3 error +# 2 using NetworkManager but service(systemctl) can not used, this happens in RH8 postscripts # 1 using NetworkManager # 0 using network # ############################################################################## function check_NetworkManager_or_network_service() { + #In RH7.6 postscripts stage, network service is active, but xCAT uses NetworkManager to configure IP, + #after that, xCAT disable NetworkManager, when CN is booted, CN use network service. + #In RH8, there is only NetworkManager + #So check network service should before check NetworkManager. + checkservicestatus network > /dev/null 2>/dev/null || checkservicestatus wicked > /dev/null 2>/dev/null + if [ $? -eq 0 ]; then + stopservice NetworkManager | log_lines info + disableservice NetworkManager | log_lines info + log_info "network service is active" + return 0 + fi #check NetworkManager is active checkservicestatus NetworkManager > /dev/null 2>/dev/null if [ $? -eq 0 ]; then @@ -1595,19 +1608,13 @@ function check_NetworkManager_or_network_service() { if [ $? -ne 0 ]; then log_error "There is no nmcli" else - stopservice network | log_lines info - disableservice network | log_lines info - stopservice networking | log_lines info - disableservice networking | log_lines info return 1 fi fi - checkservicestatus network > /dev/null 2>/dev/null || checkservicestatus wicked > /dev/null 2>/dev/null + #In RH8 postscripts stage, nmcli can not modify persistent configure file + ps -ef|grep -v grep|grep NetworkManager >/dev/null 2>/dev/null if [ $? -eq 0 ]; then - stopservice NetworkManager | log_lines info - disableservice NetworkManager | log_lines info - log_info "network service is active" - return 0 + return 2 fi checkservicestatus networking > /dev/null 2>/dev/null if [ $? -eq 0 ]; then @@ -1691,6 +1698,7 @@ function create_vlan_interface_nmcli { local _netmask="" local _mtu="" local next_nic="" + rc=0 # in case it's on top of bond, we need to migrate ip from its # member vlan ports. # parser input arguments @@ -1731,7 +1739,7 @@ function create_vlan_interface_nmcli { return 1 fi _netmask=$(v4mask2prefix $_netmask_long) - _ipaddrs="method none ip4 $ipaddr/$_netmask" + _ipaddrs="ip4 $ipaddr/$_netmask" fi fi fi @@ -1750,9 +1758,14 @@ function create_vlan_interface_nmcli { tmp_con_name=$con_name"-tmp" $nmcli con modify $con_name connection.id $tmp_con_name fi - - $nmcli con add type vlan con-name $con_name dev $ifname id $(( 10#$vlanid )) $_ipaddrs $_mtu connection.autoconnect-priority 9 + #create VLAN connetion + $nmcli con add type vlan con-name $con_name dev $ifname id $(( 10#$vlanid )) method none $_ipaddrs $_mtu connection.autoconnect-priority 9 autoconnect yes connection.autoconnect-slaves 1 connection.autoconnect-retries 0 log_info "create NetworkManager connection for $ifname.$vlanid" + + #add extra params + add_extra_params_nmcli $ifname.$vlanid $con_name + [ $? -ne 0 ] && rc=1 + if [ -z "$next_nic" ]; then $nmcli con up $con_name is_connection_activate_intime $con_name @@ -1770,7 +1783,48 @@ function create_vlan_interface_nmcli { $nmcli con delete $tmp_con_name fi $ip address show dev $ifname.$vlanid | $sed -e 's/^/[vlan] >> /g' | log_lines info - return 0 + return $rc +} +############################################################################### +# +# add extra params for nmcli connection +# +# input : $1 nic device +# $2 nmcli connection name +# return : 1 error +# 0 successful +# +############################################################################### +function add_extra_params_nmcli { + + nicdev=$1 + con_name=$2 + rc=0 + str_conf_file="/etc/sysconfig/network-scripts/ifcfg-${con_name}" + str_conf_file_1="/etc/sysconfig/network-scripts/ifcfg-${con_name}-1" + if [ -f $str_conf_file_1 ]; then + grep -x "NAME=$con_name" $str_conf_file_1 >/dev/null 2>/dev/null + if [ $? -eq 0 ]; then + str_conf_file=$str_conf_file_1 + fi + fi + #query extra params + query_extra_params $nicdev + i=0 + while [ $i -lt ${#array_extra_param_names[@]} ] + do + name="${array_extra_param_names[$i]}" + value="${array_extra_param_values[$i]}" + if [ -n "$name" -a -n "$value" ]; then + echo "$name=$value" >> $str_conf_file + else + log_error "invalid extra params $name $value, please check nics.nicextraparams" + rc=1 + fi + i=$((i+1)) + done + $nmcli con reload $str_conf_file + return $rc } ############################################################################### @@ -1806,6 +1860,35 @@ function is_connection_activate_intime { fi } +############################################################################### +# +# wait_nic_connect_intime +# +# input : nic name +# time_out (optional, 40 seconds by default) +# return : connection name +# +############################################################################### + +function wait_nic_connect_intime { + nic_name=$1 + time_out=40 + con_name='' + if [ ! -z "$2" ]; then + time_out=$2 + fi + i=0 + while [ $i -lt "$time_out" ]; do + con_name=$(nmcli dev show $nic_name|grep GENERAL.CONNECTION|awk -F: '{print $2}'|sed 's/^[ \t]*//g') + if [ ! -z "$con_name" -a "$con_name" != "--" ]; then + break + fi + sleep 1 + i=$((i+1)) + done + echo $con_name +} + ############################################################################### # # create bridge @@ -1888,7 +1971,7 @@ function create_bridge_interface_nmcli { fi fi log_info "create bridge connection $xcat_con_name" - cmd="$nmcli con add type bridge con-name $xcat_con_name ifname $ifname $_mtu connection.autoconnect-priority 9" + cmd="$nmcli con add type bridge con-name $xcat_con_name ifname $ifname $_mtu connection.autoconnect-priority 9 autoconnect yes connection.autoconnect-retries 0 connection.autoconnect-slaves 1" log_info $cmd $cmd if [ $? -ne 0 ]; then @@ -1922,12 +2005,12 @@ function create_bridge_interface_nmcli { return 1 fi fi - con_use_same_dev=$(nmcli dev show $_port|grep GENERAL.CONNECTION|awk -F: '{print $2}'|sed 's/^[ \t]*//g') + con_use_same_dev=$(wait_nic_connect_intime $_port) if [ "$con_use_same_dev" != "--" -a -n "$con_use_same_dev" ]; then - cmd="$nmcli con mod "$con_use_same_dev" master $ifname $_mtu connection.autoconnect-priority 9" + cmd="$nmcli con mod "$con_use_same_dev" master $ifname $_mtu connection.autoconnect-priority 9 autoconnect yes connection.autoconnect-slaves 1 connection.autoconnect-retries 0" xcat_slave_con=$con_use_same_dev else - cmd="$nmcli con add type $_pretype con-name $xcat_slave_con ifname $_port master $ifname $_mtu connection.autoconnect-priority 9" + cmd="$nmcli con add type $_pretype con-name $xcat_slave_con ifname $_port master $ifname $_mtu connection.autoconnect-priority 9 autoconnect yes connection.autoconnect-slaves 1 connection.autoconnect-retries 0" fi log_info "create $_pretype slaves connetcion $xcat_slave_con for bridge" log_info "$cmd" @@ -1951,10 +2034,13 @@ function create_bridge_interface_nmcli { $nmcli con mod $xcat_con_name ipv4.method manual ipv4.addresses $ipv4_addr/$str_prefix; fi + # add extra params + add_extra_params_nmcli $ifname $xcat_con_name + [ $? -ne 0 ] && rc=1 # bring up interface formally log_info "$nmcli con up $xcat_con_name" $nmcli con up $xcat_con_name - rc=$? + [ $? -ne 0 ] && rc=1 log_info "$nmcli con up $xcat_slave_con" $nmcli con up $xcat_slave_con # If bridge interface is active, delete tmp old connection @@ -1982,8 +2068,12 @@ function create_bridge_interface_nmcli { if [ $? -eq 0 ]; then $nmcli con delete $tmp_slave_con_name fi - wait_for_ifstate $ifname UP 20 40 - rc=$? + if [ -n "$xcatcreatedcon" ]; then + $nmcli con up $xcatcreatedcon + log_info "$nmcli con up $xcatcreatedcon" + fi + wait_for_ifstate $ifname UP 40 40 + [ $? -ne 0 ] && rc=1 $ip address show dev $ifname| $sed -e 's/^/[bridge] >> /g' | log_lines info fi @@ -2098,10 +2188,11 @@ function create_bond_interface_nmcli { log_info "create bond connection $xcat_con_name" cmd="" if [ -n "$next_nic" ]; then - cmd="$nmcli con add type bond con-name $xcat_con_name ifname $bondname bond.options $_bonding_opts autoconnect yes connection.autoconnect-priority 9" + cmd="$nmcli con add type bond con-name $xcat_con_name ifname $bondname bond.options $_bonding_opts autoconnect yes connection.autoconnect-priority 9 connection.autoconnect-slaves 1 connection.autoconnect-retries 0" else - cmd="$nmcli con add type bond con-name $xcat_con_name ifname $bondname bond.options $_bonding_opts method none ipv4.method manual ipv4.addresses $ipv4_addr/$str_prefix $_mtu connection.autoconnect-priority 9" + cmd="$nmcli con add type bond con-name $xcat_con_name ifname $bondname bond.options $_bonding_opts method none ipv4.method manual ipv4.addresses $ipv4_addr/$str_prefix $_mtu connection.autoconnect-priority 9 connection.autoconnect-slaves 1 connection.autoconnect-retries 0" fi + xcatcreatedcon=$xcat_con_name log_info $cmd $cmd if [ $? -ne 0 ]; then @@ -2144,7 +2235,7 @@ function create_bond_interface_nmcli { $ip link set dev $ifslave down wait_for_ifstate $ifslave DOWN 20 2 fi - cmd="$nmcli con add type $slave_type con-name $xcat_slave_con $_mtu method none ifname $ifslave master $xcat_con_name autoconnect yes connection.autoconnect-priority 9" + cmd="$nmcli con add type $slave_type con-name $xcat_slave_con $_mtu method none ifname $ifslave master $xcat_con_name autoconnect yes connection.autoconnect-priority 9 connection.autoconnect-retries 0" log_info $cmd $cmd if [ $? -ne 0 ]; then @@ -2176,8 +2267,12 @@ function create_bond_interface_nmcli { break fi done - # bring up interface formally + invalid_extra_params=0 if [ $rc -ne 1 ]; then + # add extra params + add_extra_params_nmcli $bondname $xcat_con_name + [ $? -ne 0 ] && invalid_extra_params=1 + # bring up interface formally log_info "$nmcli con up $xcat_con_name" $nmcli con up $xcat_con_name if [ -z "$next_nic" ]; then @@ -2194,8 +2289,6 @@ function create_bond_interface_nmcli { $ip address show dev $bondname| $sed -e 's/^/[bond] >> /g' | log_lines info fi fi - else - rc=0 fi fi @@ -2231,6 +2324,7 @@ function create_bond_interface_nmcli { delete_bond_slaves_con "$tmp_slave_con_names" fi fi + [ $invalid_extra_params -eq 1 ] && rc=$invalid_extra_params return $rc } ###################################################################### diff --git a/xCAT/postscripts/setupntp b/xCAT/postscripts/setupntp index 75809581a..a95c621da 100755 --- a/xCAT/postscripts/setupntp +++ b/xCAT/postscripts/setupntp @@ -130,6 +130,7 @@ then fi check_executes chronyd >/dev/null 2>&1 || USE_NTPD="yes" +check_executes systemctl >/dev/null 2>&1 || USE_NTPD="yes" if [ -n "${USE_NTPD}" ] then diff --git a/xCAT/postscripts/xcatdsklspost b/xCAT/postscripts/xcatdsklspost index 057f25ccf..3440250cd 100755 --- a/xCAT/postscripts/xcatdsklspost +++ b/xCAT/postscripts/xcatdsklspost @@ -285,6 +285,41 @@ else esac fi +# The cheat sheet for ${MODE} +# Empty +# node deployment +# 1 - updatenode -P +# Execute postscripts listed in the postscripts table or parameters +# 2 - updatenode -S +# Perform Software Maintenanc - updatenode -S +# 3 - moncfg rmcmon +# Obsoleted +# 4 +# Statelite mode +# 5 +# Update security +# 6 - xcatpostinit1 +# During node reboot +case "${MODE}" in +"1"|"2"|"5") + # The cheat sheet for checkservicestatus + # Return code + # 0 - active + # 1 - inactive + # 2 - failed + # 3 - others + # 17 - activating + # 127 - error + checkservicestatus xcatpostinit1 >/dev/null 2>&1 + case "$?" in + "17") + echolog "warning" "xCAT post-booting process is not completed yet. Abort. Please try later." + exit 255 + ;; + esac + ;; +esac + update_VPD() { if [ -f /usr/sbin/vpdupdate ]; then diff --git a/xCAT/postscripts/xcatlib.sh b/xCAT/postscripts/xcatlib.sh index e7b059494..4c3cf0210 100755 --- a/xCAT/postscripts/xcatlib.sh +++ b/xCAT/postscripts/xcatlib.sh @@ -317,7 +317,7 @@ function servicemap { #all the service unit files are placed under /lib/systemd/system/ on ubuntu #all the service unit files are placed under /usr/lib/systemd/system/ on redhat and sles #path should be delimited with space - path="/usr/lib/systemd/system/ /lib/systemd/system/" + path="/usr/lib/systemd/system/ /lib/systemd/system/ /etc/systemd/system/" postfix=".service" svcmgrcmd="systemctl" elif [ "$svcmgrtype" = "2" ];then @@ -549,6 +549,8 @@ function checkservicestatus { retcode=1 elif echo $output|grep -E -i "^failed$";then retcode=2 + elif echo $output|grep -E -i "^activating$";then + retcode=17 fi elif [ -n "$svcjob" ];then output=$(initctl status $svcjob) diff --git a/xCAT/templates/objects/node/ppc64le-ipmi.stanza b/xCAT/templates/objects/node/ppc64le-ipmi.stanza index 3b134926d..476b45dd8 100644 --- a/xCAT/templates/objects/node/ppc64le-ipmi.stanza +++ b/xCAT/templates/objects/node/ppc64le-ipmi.stanza @@ -4,12 +4,12 @@ ppc64le-template: objtype=node arch=ppc64le bmc="MANDATORY:The hostname or ip address of the BMC adapater" - bmcpassword="MANDATORY:the password of the BMC" - bmcusername="MANDATORY:the username of the BMC" + bmcpassword="OPTIONAL:the password of the BMC" + bmcusername="OPTIONAL:the username of the BMC" cons=ipmi groups=all - ip=OPTIONAL:the ip address of the node - mac=OPTIONAL:the mac of the node + ip="MANDATORY:the ip address of the node" + mac="OPTIONAL:the mac of the node" mgt=ipmi netboot=petitboot nodetype=mp diff --git a/xCAT/templates/objects/node/ppc64le-openbmc.stanza b/xCAT/templates/objects/node/ppc64le-openbmc.stanza index 43af130a9..927331c0c 100644 --- a/xCAT/templates/objects/node/ppc64le-openbmc.stanza +++ b/xCAT/templates/objects/node/ppc64le-openbmc.stanza @@ -4,12 +4,12 @@ ppc64le-openbmc-template: objtype=node arch=ppc64le bmc="MANDATORY:The hostname or ip address of the BMC adapater" - bmcpassword="MANDATORY:the password of the BMC" - bmcusername="MANDATORY:the username of the BMC" + bmcpassword="OPTIONAL:the password of the BMC" + bmcusername="OPTIONAL:the username of the BMC" cons=openbmc groups=all - ip=OPTIONAL:the ip address of the node - mac=OPTIONAL:the mac of the node + ip="MANDATORY:the ip address of the node" + mac="OPTIONAL:the mac of the node" mgt=openbmc netboot=petitboot nodetype=mp diff --git a/xCAT/templates/objects/node/ppc64lekvmguest.stanza b/xCAT/templates/objects/node/ppc64lekvmguest.stanza index b6e28d1f2..2610d38b3 100644 --- a/xCAT/templates/objects/node/ppc64lekvmguest.stanza +++ b/xCAT/templates/objects/node/ppc64lekvmguest.stanza @@ -4,7 +4,7 @@ ppc64lekvmguest-template: objtype=node arch=ppc64le groups=all - ip="OPTIONAL:the ip address of the kvm guest" + ip="MANDATORY:the ip address of the kvm guest" mac="OPTIONAL:the mac of the kvm guest" mgt=kvm netboot=grub2 diff --git a/xCAT/templates/objects/node/x86_64.stanza b/xCAT/templates/objects/node/x86_64.stanza index b59a46066..085ccc17e 100644 --- a/xCAT/templates/objects/node/x86_64.stanza +++ b/xCAT/templates/objects/node/x86_64.stanza @@ -4,13 +4,13 @@ x86_64-template: objtype=node arch=x86_64 bmc="MANDATORY:The hostname or ip address of the BMC adapater" - bmcpassword="MANDATORY:the password of the BMC" - bmcusername="MANDATORY:the username of the BMC" + bmcpassword="OPTIONAL:the password of the BMC" + bmcusername="OPTIONAL:the username of the BMC" cons=ipmi getmac=ipmi groups=all hcp= - ip="OPTIONAL:the ip address of the node" + ip="MANDATORY:the ip address of the node" mac="OPTIONAL:the mac of the node" mgt=ipmi netboot=xnba diff --git a/xCAT/templates/objects/node/x86_64kvmguest.stanza b/xCAT/templates/objects/node/x86_64kvmguest.stanza index 52d8efb5c..16494de27 100644 --- a/xCAT/templates/objects/node/x86_64kvmguest.stanza +++ b/xCAT/templates/objects/node/x86_64kvmguest.stanza @@ -4,7 +4,7 @@ x86_64kvmguest-template: objtype=node arch=x86_64 groups=all - ip="OPTIONAL:the ip address of the kvm guest" + ip="MANDATORY:the ip address of the kvm guest" mac="OPTIONAL:the mac of the kvm guest" mgt=kvm netboot=xnba diff --git a/xCAT/xCAT.spec b/xCAT/xCAT.spec index e801317b5..5dc7aa97c 100644 --- a/xCAT/xCAT.spec +++ b/xCAT/xCAT.spec @@ -55,8 +55,6 @@ Requires: /usr/sbin/dhcpd Requires: /usr/bin/ssh Requires: /usr/sbin/in.tftpd - - #support mixed cluster %if %nots390x Requires: xnba-undi diff --git a/xCATsn/debian/control b/xCATsn/debian/control index abe5fecb3..0bc1750ea 100644 --- a/xCATsn/debian/control +++ b/xCATsn/debian/control @@ -9,7 +9,7 @@ Homepage: https://xcat.org/ Package: xcatsn Architecture: amd64 ppc64el Depends: ${perl:Depends}, xcat-server (>= 2.13-snap000000000000), xcat-client (>= 2.13-snap000000000000), libdbd-sqlite3-perl, libxml-parser-perl, tftpd-hpa, 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), goconserver +Recommends: bind9, nmap, tftp-hpa, ipmitool-xcat (>= 1.8.17-1), syslinux[any-amd64], libsys-virt-perl, xnba-undi, 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. diff --git a/xCATsn/xCATsn.spec b/xCATsn/xCATsn.spec index ef0976c20..0e3832f78 100644 --- a/xCATsn/xCATsn.spec +++ b/xCATsn/xCATsn.spec @@ -42,20 +42,6 @@ Requires: /usr/sbin/in.tftpd %endif %endif -# The aix rpm cmd forces us to do this outside of ifos type stmts -%if %notpcm -%ifos linux -%ifnarch s390x -# PCM does not use or ship conserver -#Requires: conserver-xcat -%endif -%endif -%endif - -%ifos linux -#Requires: goconserver -%endif - #support mixed cluster %ifnarch s390x Requires: xnba-undi