mirror of
https://github.com/xcat2/xcat-core.git
synced 2026-05-24 09:42:46 +00:00
Merge tag '2.15.0' into lenovobuild
This commit is contained in:
@@ -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) | [](https://xcat-docs.readthedocs.io/en/latest/) |
|
||||
| Stable (latest release) | [](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)!
|
||||
|
||||
-26
@@ -1,26 +0,0 @@
|
||||
xCAT
|
||||
----
|
||||
|
||||
xCAT is a toolkit for the deployment and administration of clusters.
|
||||
|
||||
Documentation
|
||||
-------------
|
||||
|
||||
`The stable documentation of xCAT <https://xcat-docs.readthedocs.io/en/stable/>`_
|
||||
|
||||
`The latest documentation of xCAT <http://xcat-docs.readthedocs.io/en/latest/index.html>`_
|
||||
|
||||
`The documentation of xCAT each release <http://readthedocs.org/projects/xcat-docs/versions/>`_
|
||||
|
||||
|
||||
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 <http://xcat-docs.readthedocs.io/en/latest/developers/>`_
|
||||
In particular the `GitHub <http://xcat-docs.readthedocs.io/en/latest/developers/github/>`_ related subsection.
|
||||
+53
-16
@@ -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=<filename> - provide an LOG file option to redirect some output into log file
|
||||
#
|
||||
# DEST=<directory> - 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
|
||||
|
||||
|
||||
+194
-153
@@ -12,11 +12,16 @@
|
||||
# - createrepo command needs to be present on the build machine
|
||||
#
|
||||
# Usage: builddep.sh [attr=value attr=value ...]
|
||||
# DESTDIR=<dir> - the dir to place the dep tarball in. The default is ../../../xcat-dep,
|
||||
# DESTDIR=<dir> - 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 ..../<OS>/<ARCH>/ are links
|
||||
# Verifies no broken link files in ..../<OS>/<ARCH>/
|
||||
# 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 <OS>/<ARCH> 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/<OS> 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 <OS>/<ARCH>
|
||||
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"
|
||||
|
||||
+10
-12
@@ -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`
|
||||
|
||||
@@ -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`` .
|
||||
|
||||
|
||||
@@ -1,97 +0,0 @@
|
||||
Dockerized xCAT
|
||||
================
|
||||
|
||||
|
||||
Overview
|
||||
--------
|
||||
|
||||
`Docker <https://www.docker.com/>`_ 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.
|
||||
|
||||
|
||||
@@ -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 <https://github.com/immarvin/xcat-docker/blob/master/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 <https://docs.docker.com/compose/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 <https://github.com/docker/libnetwork/issues/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 <https://github.com/docker/compose/issues/1214>`_
|
||||
|
||||
@@ -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 </references/coral/known_issues/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 </advanced/ports/xcat_ports>` 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 <docker_container_ip> -p 2200
|
||||
|
||||
.. Attention::
|
||||
Need to set ``site`` table depending on your own environment.
|
||||
|
||||
For example ::
|
||||
|
||||
[xcatmn]# chtab key=master site.value=<docker_host_ip>
|
||||
|
||||
|
||||
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.
|
||||
|
||||
@@ -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 <https://hub.docker.com/u/xcat/>`_:
|
||||
|
||||
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 "<FQDN> <hostname>: <IP Address>", 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
|
||||
|
||||
|
||||
@@ -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 <https://docs.docker.com/engine/installation/>`_.
|
||||
|
||||
.. 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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 <netobj_name>=<subnet>/<netmask>@<gateway>[: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<deploy_os>` 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 </guides/admin-guides/references/man1/mkdef.1>` or :doc:`chdef </guides/admin-guides/references/man1/chdef.1>` 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 <node> [image=<image_name> [command=<command>] [dockerflag=<docker_flags>]]
|
||||
|
||||
* 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 <https://docs.docker.com/engine/reference/api/docker_remote_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 <node>
|
||||
|
||||
The command **rmdocker host01c01** can be used to remove the docker instance *host01c01*.
|
||||
|
||||
List docker information
|
||||
```````````````````````
|
||||
::
|
||||
|
||||
lsdocker <dockerhost|node> [-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 <node> start
|
||||
|
||||
Stop docker instance
|
||||
````````````````````
|
||||
::
|
||||
|
||||
rpower <node> stop
|
||||
|
||||
Restart docker instance
|
||||
```````````````````````
|
||||
::
|
||||
|
||||
rpower <node> restart
|
||||
|
||||
Pause all processes within a docker instance
|
||||
````````````````````````````````````````````
|
||||
::
|
||||
|
||||
rpower <node> pause
|
||||
|
||||
Unpause all processes within a docker instance
|
||||
``````````````````````````````````````````````
|
||||
::
|
||||
|
||||
rpower <node> unpause
|
||||
|
||||
Check docker instance status
|
||||
````````````````````````````
|
||||
::
|
||||
|
||||
rpower <node> 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 <nicname>
|
||||
|
||||
* 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://
|
||||
@@ -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"
|
||||
|
||||
|
||||
|
||||
@@ -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
|
||||
----------------------------
|
||||
|
||||
|
||||
@@ -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:
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
+2
-2
@@ -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
|
||||
+3
-3
@@ -12,11 +12,11 @@ Download the Mellanox OFED ISO file `here (MLNX_OFED) <http://www.mellanox.com/p
|
||||
Prepare Installation Script
|
||||
---------------------------
|
||||
|
||||
The ``mlnxofed_ib_install.v2`` 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 </advanced/networks/infiniband/mlnxofed_ib_verified_scenario_matrix>`.
|
||||
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 </advanced/networks/infiniband/mlnxofed_ib_verified_scenario_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
|
||||
+1
-1
@@ -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.
|
||||
|
||||
+1
-1
@@ -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</guides/admin-guides/manage_clusters/ppc64le/diskless/customize_image/additional_pkg>` for more details.
|
||||
|
||||
|
||||
+30
-17
@@ -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 <http://fedoraproject.org/wiki/Anaconda/Kickstart#part_or_partition>`_ or `Autoyast documentation <https://doc.opensuse.org/projects/autoyast/configuration.html#CreateProfile.Partitioning>`_ or `Preseed documentation <https://www.debian.org/releases/stable/i386/apbs04.html.en#preseed-partman>`_ 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 <http://fedoraproject.org/wiki/Anaconda/Kickstart#part_or_partition>`_
|
||||
|
||||
- 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 <https://doc.opensuse.org/projects/autoyast/configuration.html#CreateProfile.Partitioning>`_
|
||||
|
||||
- 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 <https://www.debian.org/releases/stable/i386/apbs04.html.en#preseed-partman>`_
|
||||
|
||||
- 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 <osimagename> partitionfile=/install/custom/my-partitions
|
||||
nodeset <nodename> osimage=<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/<node>.pre.
|
||||
nodeset <nodename> osimage=<osimagename>
|
||||
|
||||
.. 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/<node>.pre`` with the contents of your custom partition file.
|
||||
|
||||
.. END_partition_definition_file_Associate_partition_file_with_osimage_common
|
||||
|
||||
|
||||
@@ -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 <path>/<specific-distro>.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
|
||||
* **<os>-<arch>-netboot-compute** is the default osimage definition used for diskless installation
|
||||
* **<os>-<arch>-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/<ubuntu-version>/ppc64el/install/netboot
|
||||
cp /tmp/iso/install/initrd.gz /install/<ubuntu-version>/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-<os>-<arch>]
|
||||
name=xCAT local <os> <version>
|
||||
@@ -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 *<attribute>*, the attributes of *<new osimage>* will inherit the values of template osimage *<existing 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
|
||||
|
||||
|
||||
+68
-75
@@ -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.<nodename>. The generated mypostscript.<nodename>. 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.<nodename>``. The generated ``mypostscript.<nodename>``. 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.<nodename>. 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.<nodename>``. 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.<nodename>. 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.<nodename>`` 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(<TABLENAME>)** is used to get all the information in the **<TABLENAME>** table ::
|
||||
``tabdump(<TABLENAME>)`` is used to get all the information in the ``<TABLENAME>`` 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/<os>/<arch>
|
||||
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 <nodename> -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 <nodename> -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 **<tablename>** 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 ``<tablename>`` 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 **<TABLENAME>** 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 ``<TABLENAME>`` 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(<TABLENAME>)
|
||||
|
||||
@@ -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 <nodename> -P syslog
|
||||
updatenode <nodename> -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 <nodename> ....
|
||||
|
||||
Check your generated template ::
|
||||
Check your generated ``mypostscript`` ::
|
||||
|
||||
vi /tftpboot/mypostscripts/mypostscript.<nodename>
|
||||
|
||||
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
|
||||
|
||||
@@ -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 <ntp server>`` 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 <ntp server>`` 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**
|
||||
|
||||
+8
-11
@@ -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:<attribute description>`` in template definition.
|
||||
the mandatory attributes, which must be specified while creating definitions with templates, are denoted with the value ``MANDATORY:<attribute description>`` in template definition.
|
||||
|
||||
the optional attributes, which can be specified optionally, are denoted with the value ``OPTIONAL:<attribute description>`` in template definition
|
||||
|
||||
+1
-1
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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": { "<port>/\<tcp|udp>: {}" }
|
||||
|
||||
|
||||
|
||||
|
||||
\ **HostConfig: {"Binds"}**\
|
||||
|
||||
A list of volume bindings for this docker instance, the form will be:
|
||||
|
||||
|
||||
.. code-block:: perl
|
||||
|
||||
"HostConfig": {"Binds":["<dir_on_dockerhost>:<dir_in_instance>"]}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
********
|
||||
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
|
||||
|
||||
@@ -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.
|
||||
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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 </guides/install-guides/index>` to learn how to install xCAT on a server.
|
||||
|
||||
#. Start to use xCAT management node
|
||||
Refer to the doc: :doc:`xCAT Admin Guide </guides/admin-guides/index>` 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 </guides/admin-guides/manage_clusters/ppc64le/discovery/index>` 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 <node> stat``.
|
||||
|
||||
Now you have the node definition. Verify the hardware control for defined nodes is working. e.g. ``rpower <node> 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 </guides/admin-guides/manage_clusters/ppc64le/management/index>` 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 </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.
|
||||
|
||||
#. 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 </guides/admin-guides/manage_clusters/ppc64le/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.
|
||||
|
||||
|
||||
@@ -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*
|
||||
|
||||
@@ -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 <https://github.com/xcat2/xcat-core/wiki/XCAT_2.12.4_Release_Notes>`_
|
||||
2.12.3,2016-09-30,,`2.12.3 Release Notes <https://github.com/xcat2/xcat-core/wiki/XCAT_2.12.3_Release_Notes>`_
|
||||
2.12.2,2016-08-19,Ubuntu 16.04.1,`2.12.2 Release Notes <https://github.com/xcat2/xcat-core/wiki/XCAT_2.12.2_Release_Notes>`_
|
||||
2.12.1,2016-07-08,,`2.12.1 Release Notes <https://github.com/xcat2/xcat-core/wiki/XCAT_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 <https://github.com/xcat2/xcat-core/wiki/XCAT_2.12_Release_Notes>`_
|
||||
|
@@ -0,0 +1,13 @@
|
||||
Version,Release Date,New OS Supported,Release Notes
|
||||
2.13.11,2018-03-09,,`2.13.11 Release Notes <https://github.com/xcat2/xcat-core/wiki/XCAT_2.13.11_Release_Notes>`_
|
||||
2.13.10,2018-01-26,,`2.13.10 Release Notes <https://github.com/xcat2/xcat-core/wiki/XCAT_2.13.10_Release_Notes>`_
|
||||
2.13.9,2017-12-18,,`2.13.9 Release Notes <https://github.com/xcat2/xcat-core/wiki/XCAT_2.13.9_Release_Notes>`_
|
||||
2.13.8,2017-11-03,,`2.13.8 Release Notes <https://github.com/xcat2/xcat-core/wiki/XCAT_2.13.8_Release_Notes>`_
|
||||
2.13.7,2017-09-22,,`2.13.7 Release Notes <https://github.com/xcat2/xcat-core/wiki/XCAT_2.13.7_Release_Notes>`_
|
||||
2.13.6,2017-08-10,"RHEL 7.4",`2.13.6 Release Notes <https://github.com/xcat2/xcat-core/wiki/XCAT_2.13.6_Release_Notes>`_
|
||||
2.13.5,2017-06-30,,`2.13.5 Release Notes <https://github.com/xcat2/xcat-core/wiki/XCAT_2.13.5_Release_Notes>`_
|
||||
2.13.4,2017-05-09,"RHV 4.1",`2.13.4 Release Notes <https://github.com/xcat2/xcat-core/wiki/XCAT_2.13.4_Release_Notes>`_
|
||||
2.13.3,2017-04-14,"RHEL 6.9",`2.13.3 Release Notes <https://github.com/xcat2/xcat-core/wiki/XCAT_2.13.3_Release_Notes>`_
|
||||
2.13.2,2017-02-24,,`2.13.2 Release Notes <https://github.com/xcat2/xcat-core/wiki/XCAT_2.13.2_Release_Notes>`_
|
||||
2.13.1,2017-01-13,,`2.13.1 Release Notes <https://github.com/xcat2/xcat-core/wiki/XCAT_2.13.1_Release_Notes>`_
|
||||
2.13.0,2016-12-09,"SLES 12.2",`2.13.0 Release Notes <https://github.com/xcat2/xcat-core/wiki/XCAT_2.13_Release_Notes>`_
|
||||
|
@@ -0,0 +1,8 @@
|
||||
Version,Release Date,New OS Supported,Release Notes
|
||||
2.14.6,2019-03-29,,`2.14.6 Release Notes <https://github.com/xcat2/xcat-core/wiki/XCAT_2.14.6_Release_Notes>`_
|
||||
2.14.5,2018-12-07,"RHEL 7.6",`2.14.5 Release Notes <https://github.com/xcat2/xcat-core/wiki/XCAT_2.14.5_Release_Notes>`_
|
||||
2.14.4,2018-10-19,"Ubuntu 18.04.1",`2.14.4 Release Notes <https://github.com/xcat2/xcat-core/wiki/XCAT_2.14.4_Release_Notes>`_
|
||||
2.14.3,2018-08-24,"SLES 12.3",`2.14.3 Release Notes <https://github.com/xcat2/xcat-core/wiki/XCAT_2.14.3_Release_Notes>`_
|
||||
2.14.2,2018-07-13,"RHEL 6.10, Ubuntu 18.04",`2.14.2 Release Notes <https://github.com/xcat2/xcat-core/wiki/XCAT_2.14.2_Release_Notes>`_
|
||||
2.14.1,2018-06-01,"RHV 4.2, RHEL 7.5 (Power8)",`2.14.1 Release Notes <https://github.com/xcat2/xcat-core/wiki/XCAT_2.14.1_Release_Notes>`_
|
||||
2.14.0,2018-04-20,"RHEL 7.5",`2.14.0 Release Notes <https://github.com/xcat2/xcat-core/wiki/XCAT_2.14_Release_Notes>`_
|
||||
|
@@ -0,0 +1,2 @@
|
||||
Version,Release Date,New OS Supported,Release Notes
|
||||
2.15.0,2019-07-31,,`2.15.0 Release Notes <https://github.com/xcat2/xcat-core/wiki/XCAT_2.15_Release_Notes>`_
|
||||
|
@@ -29,7 +29,6 @@ Features
|
||||
* Esxi
|
||||
* RHEV
|
||||
* Windows
|
||||
* AIX
|
||||
|
||||
#. Provision machines in
|
||||
|
||||
|
||||
@@ -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 |
|
||||
| | | | | | | | |
|
||||
+-------+-------+-------+-----+-------+--------+--------+--------+
|
||||
|
||||
@@ -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 <https:// | | | |
|
||||
| github.com/xcat2/xcat-core/wiki | | | |
|
||||
| /XCAT_2.14.6_Release_Notes>`_ | | | |
|
||||
+---------------------------------+---------------+-------------+----------------------------------+
|
||||
|| xCAT 2.14.5 2018/12/07 |- RHEL7.6 | |- syslog tag refine |
|
||||
|| | | | |
|
||||
| `2.14.5 Release Notes <https:// | | |- site:httpport support |
|
||||
| github.com/xcat2/xcat-core/wiki | | | |
|
||||
| /XCAT_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 <https:// | | | |
|
||||
| github.com/xcat2/xcat-core/wiki | | | |
|
||||
| /XCAT_2.14.4_Release_Notes>`_ | | | |
|
||||
+---------------------------------+---------------+-------------+----------------------------------+
|
||||
|| xCAT 2.14.3 2018/8/24 |- SLES12.3 | |- OpenBMC rflash enhancement |
|
||||
|| | | | |
|
||||
| `2.14.3 Release Notes <https:// | | |- xcat-inventory 0.1.5 |
|
||||
| github.com/xcat2/xcat-core/wiki | | | |
|
||||
| /XCAT_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 <https:// | | | |
|
||||
| github.com/xcat2/xcat-core/wiki | | | |
|
||||
| /XCAT_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 <https:// | | | |
|
||||
| github.com/xcat2/xcat-core/wiki | | |- Cumulus Switch OS - syncfile |
|
||||
| /XCAT_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 <https:// | | | |
|
||||
| github.com/xcat2/xcat-core/wiki | | |- Performance Tuning doc update |
|
||||
| /XCAT_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 <https://| | | rinv,rvitals |
|
||||
| github.com/xcat2/xcat-core/wiki | | | |
|
||||
| /XCAT_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 <https://| | | powerrestorepolicy,bootmode |
|
||||
| github.com/xcat2/xcat-core/wiki | | | reventlog implementation |
|
||||
| /XCAT_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 <https:// | | | |
|
||||
| github.com/xcat2/xcat-core/wiki | | | reventlog implementation |
|
||||
| /XCAT_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 <https:// | | | |
|
||||
| github.com/xcat2/xcat-core/wiki | | | rspconfig sshcfg run parallelly |
|
||||
| /XCAT_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 <https:// | | | |
|
||||
| github.com/xcat2/xcat-core/wiki | | | reventlog to get/clear event log|
|
||||
| /XCAT_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 <https:// | | | |
|
||||
| github.com/xcat2/xcat-core/wiki | | | rflash list/upload/activate |
|
||||
| /XCAT_2.13.6_Release_Notes>`_ | | | /delete/check |
|
||||
| | | | |
|
||||
| | | | rspconfig retrieve OpenBMC ip/ |
|
||||
| | | | netmask/gateway information |
|
||||
| | | |- nodeset performance enhancement |
|
||||
| | | | (Phase 3) |
|
||||
| | | | |
|
||||
| | | | Dispatch request to the |
|
||||
| | | | specified service nodes with |
|
||||
| | | | 'disjointdhcps' |
|
||||
| | | | |
|
||||
| | | | Enhance the output of nodeset |
|
||||
| | | | in hierarchical cluster |
|
||||
| | | | |
|
||||
| | | |- network configuration interface:|
|
||||
| | | | |
|
||||
| | | | confignetwork is the only |
|
||||
| | | | interface to configure network |
|
||||
| | | | on SN/CN |
|
||||
| | | | |
|
||||
| | | |- For hardware discovery |
|
||||
| | | | |
|
||||
| | | | enhance bmcdiscover to use BMC |
|
||||
| | | | MAC address to identify BMC with|
|
||||
| | | | its host |
|
||||
| | | | |
|
||||
| | | | enhance "xcatprobe discovery" |
|
||||
| | | | tool to do configuration check |
|
||||
| | | | before starting hardware |
|
||||
| | | | discovery |
|
||||
| | | | |
|
||||
| | | |- [xcat-deps] xcat-genesis-base |
|
||||
| | | | package based on Fedora 26 ppc64|
|
||||
+---------------------------------+---------------+-------------+----------------------------------+
|
||||
|| xCAT 2.13.5 | | |- OpenBMC support |
|
||||
|| 2017/6/30 | | | |
|
||||
|| | | | rinv |
|
||||
| `2.13.5 Release Notes <https:// | | | rinstall |
|
||||
| github.com/xcat2/xcat-core/wiki | | | bmcdiscover |
|
||||
| /XCAT_2.13.5_Release_Notes>`_ | | |- Enhancements to self testing |
|
||||
| | | | tool xcat-test |
|
||||
| | | |- Service node pool support for |
|
||||
| | | | rhels7 ppc64le diskless |
|
||||
| | | |- Mellanox cumulus switch ZTP |
|
||||
| | | | based discovery and |
|
||||
| | | | auto-configuration |
|
||||
| | | |- Performance enhancements |
|
||||
| | | | |
|
||||
| | | | makedhcp, makedns |
|
||||
| | | | nodeset |
|
||||
| | | |- [xcat-deps] ipmitool-xcat |
|
||||
| | | | package updated to version |
|
||||
| | | | 1.8.18 for |
|
||||
| | | | |
|
||||
| | | | RHEL7.x |
|
||||
| | | | SLES12.x |
|
||||
| | | | Ubuntu14.04.x |
|
||||
| | | |- [xcat-deps] conserver-xcat |
|
||||
| | | | package updated to version 8.2.1|
|
||||
| | | | |
|
||||
+---------------------------------+---------------+-------------+----------------------------------+
|
||||
|| xCAT 2.13.4 |- RHV 4.1 | |- OpenBMC support(experimental): |
|
||||
|| 2017/5/19 | | | |
|
||||
|| | | | rinv |
|
||||
| `2.13.4 Release Notes <https:// | | | rinstall |
|
||||
| github.com/xcat2/xcat-core/wiki | | | bmcdiscover |
|
||||
| /XCAT_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 <https:// | | |- Add -C for rmdef to run |
|
||||
| github.com/xcat2/xcat-core/wiki | | | `nodeset offline` |
|
||||
| /XCAT_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 <https:// | | |- To support PDU |
|
||||
| github.com/xcat2/xcat-core/wiki | | | |
|
||||
| /XCAT_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 <https:// | | |- add ntp-wait for genesis-base |
|
||||
| github.com/xcat2/xcat-core/wiki | | | |
|
||||
| /XCAT_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 <https:// | | |- rflash saving flashing progress |
|
||||
| github.com/xcat2/xcat-core/wiki | | |- Update configureRAID document |
|
||||
| /XCAT_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 <https:// | | | |
|
||||
| github.com/xcat2/xcat-core/wiki | | | |
|
||||
| /XCAT_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 <https:// | | |- additional options added to |
|
||||
| github.com/xcat2/xcat-core/wiki | | | xcatprobe command |
|
||||
| /XCAT_2.12.3_Release_Notes>`_ | | |- mkdef takes file redirection |
|
||||
| | | | |
|
||||
+---------------------------------+---------------+-------------+----------------------------------+
|
||||
|| xCAT 2.12.2 |- UBT 16.04.1 | |- nodeset <noderange> offline |
|
||||
|| 2016/08/19 | | |- Enhance: node status update |
|
||||
|| | | |- Support Bond for install nics |
|
||||
| `2.12.2 Release Notes <https:// | | |- xcatprobe osdeploy -r (BETA) |
|
||||
| github.com/xcat2/xcat-core/wiki | | |- New opt: packimage -m -c |
|
||||
| /XCAT_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 <https:// | | |- site.xcatdebugmode for diskless |
|
||||
| github.com/xcat2/xcat-core/wiki | | |- Refine discovery framework |
|
||||
| /XCAT_2.12.1_Release_Notes>`_ | | |- rscan <kvmhost> |
|
||||
| | | |- 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 <https:// | | |- New command: getadapter |
|
||||
| github.com/xcat2/xcat-core/ | | |- Add get_install_disk (diskful) |
|
||||
| wiki/XCAT_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
|
||||
|
||||
@@ -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/
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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"
|
||||
);
|
||||
|
||||
|
||||
@@ -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");
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -1,57 +0,0 @@
|
||||
=head1 NAME
|
||||
|
||||
B<lsdocker> - List docker instance.
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
B<lsdocker> I<noderange> [B<-l>|B<--logs>]
|
||||
|
||||
B<lsdocker> I<dockerhost>
|
||||
|
||||
B<lsdocker> [B<-h>|B<--help>]
|
||||
|
||||
B<lsdocker> {B<-v>|B<--version>}
|
||||
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
B<lsdocker> 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<mkdocker(1)|mkdocker.1>, L<rmdocker(1)|rmdocker.1>
|
||||
@@ -1,100 +0,0 @@
|
||||
=head1 NAME
|
||||
|
||||
B<mkdocker> - Create docker instance.
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
B<mkdocker> I<noderange> [B<image>=I<image_name> [B<command>=I<command>]] [B<dockerflag>=I<flags_to_create_instance>]
|
||||
|
||||
B<mkdocker> [B<-h>|B<--help>]
|
||||
|
||||
B<mkdocker> {B<-v>|B<--version>}
|
||||
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
B<mkdocker> To create docker instances with the specified image, command and/or dockerflags.
|
||||
|
||||
=head1 OPTIONS
|
||||
|
||||
=over 3
|
||||
|
||||
=item B<image>
|
||||
|
||||
The docker image name that the instance will use.
|
||||
|
||||
=item B<command>
|
||||
|
||||
The command that the instance will run based on the B<image> specified. The B<image> option must be specified in order to use this option.
|
||||
|
||||
=item B<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:
|
||||
|
||||
=over 3
|
||||
|
||||
=item B<AttachStdin>=B<true>|B<false>
|
||||
|
||||
Whether attaches to stdin.
|
||||
|
||||
=item B<AttachStdout>=B<true>|B<false>
|
||||
|
||||
Whether attaches to stdout.
|
||||
|
||||
=item B<AttachStderr>=B<true>|B<false>
|
||||
|
||||
Whether attaches to stderr.
|
||||
|
||||
=item B<OpenStdin>=B<true>|B<false>
|
||||
|
||||
Whether opens stdin.
|
||||
|
||||
=item B<Tty>=B<true>|B<false>
|
||||
|
||||
Attach standard streams to a tty, including stdin if it is not closed.
|
||||
|
||||
=item B<ExposedPorts>
|
||||
|
||||
An object mapping ports to an empty object in the form of:
|
||||
|
||||
"ExposedPorts": { "<port>/\<tcp|udp>: {}" }
|
||||
|
||||
=item B<HostConfig: {"Binds"}>
|
||||
|
||||
A list of volume bindings for this docker instance, the form will be:
|
||||
|
||||
"HostConfig": {"Binds":["<dir_on_dockerhost>:<dir_in_instance>"]}
|
||||
|
||||
=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<rmdocker(1)|rmdocker.1>, L<lsdocker(1)|lsdocker.1>
|
||||
@@ -11,25 +11,31 @@ B<restartxcatd> [[B<-h>|B<--help>] | [B<-v>|B<--version>] | [B<-r>|B<--reload>]]
|
||||
|
||||
The B<restartxcatd> command restarts the xCAT daemon (xcatd).
|
||||
|
||||
B<Linux Specific>
|
||||
B<Linux Specific>:
|
||||
|
||||
=over 4
|
||||
|
||||
It will perform the xcatd I<fast restart>. The xcatd I<fast restart> is a specific restart which has two advantages compares to the I<stop> and then I<start>.
|
||||
|
||||
=over 2
|
||||
|
||||
It will perform the xcatd I<fast restart>. The xcatd I<fast restart> is a specific restart which has two advantages compares to the I<stop> and then I<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.
|
||||
=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<stop> and I<start> instead of xcatd I<fast restart>.
|
||||
|
||||
It's recommended to use B<restartxcatd> 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<AIX Specific>
|
||||
It does the same thing as B<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 B<service xcatd restart> will just do the I<stop> and I<start> instead of xcatd I<fast restart>.
|
||||
|
||||
=over 2
|
||||
It's recommended to use B<restartxcatd> command to restart xcatd on systemd enabled system like rh7 and sles12 instead of B<service xcatd restart> or B<systemctl restart xcatd>.
|
||||
|
||||
It runs 'stopsrc -s xcatd' to stop xcatd first if xcatd is active, then runs 'startsrc -s xcatd' to start xcatd.
|
||||
=back
|
||||
|
||||
B<AIX Specific>:
|
||||
|
||||
=over 4
|
||||
|
||||
It runs B<stopsrc -s xcatd> to stop xcatd first if xcatd is active, then runs B<startsrc -s xcatd> to start xcatd.
|
||||
|
||||
If the xcatd subsystem was not created, B<restartxcatd> will create it automatically.
|
||||
|
||||
|
||||
@@ -1,37 +0,0 @@
|
||||
|
||||
=head1 NAME
|
||||
|
||||
B<rmdocker> - Remove docker instance.
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
B<rmdocker> I<noderange> [B<-f>|B<--force>]
|
||||
|
||||
B<rmdocker> [B<-h>|B<--help>]
|
||||
|
||||
B<rmdocker> {B<-v>|B<--version>}
|
||||
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
B<rmdocker> 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<mkdocker(1)|mkdocker.1>, L<lsdocker(1)|lsdocker.1>
|
||||
@@ -66,10 +66,6 @@ B<rpower> I<noderange> [B<on>|B<off>|B<reset>|B<boot>|B<reseat>]
|
||||
|
||||
B<rpower> I<noderange> [B<on>|B<off>|B<reset>|B<stat>|B<softoff>]
|
||||
|
||||
=head2 docker specific:
|
||||
|
||||
B<rpower> I<noderange> [B<start>|B<stop>|B<restart>|B<pause>|B<unpause>|B<state>]
|
||||
|
||||
=head2 pdu specific:
|
||||
|
||||
B<rpower> I<noderange> [B<stat>|B<off>|B<on>|B<reset>]
|
||||
@@ -227,18 +223,6 @@ To specify that the target node will be power down if B<suspend> action failed.
|
||||
|
||||
To specify that the target node will be reset if B<suspend> action failed.
|
||||
|
||||
=item B<start>
|
||||
|
||||
To start a created docker instance.
|
||||
|
||||
=item B<stop>
|
||||
|
||||
To stop a created docker instance.
|
||||
|
||||
=item B<restart>
|
||||
|
||||
To restart a created docker instance.
|
||||
|
||||
=item B<pause>
|
||||
|
||||
To pause all processes in the instance.
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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):
|
||||
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -1,2 +1,4 @@
|
||||
opt/xcat/bin
|
||||
opt/xcat/probe
|
||||
opt/xcat/probe/subcmds
|
||||
opt/xcat/probe/subcmds/bin
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
/opt/xcat/bin/xcatclient /opt/xcat/probe/subcmds/bin/switchprobe
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -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`;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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 <arch>.", 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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 = "";
|
||||
|
||||
@@ -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" });
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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 " .
|
||||
|
||||
@@ -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://<user>:<pw>@...."
|
||||
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}{ };
|
||||
|
||||
@@ -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};
|
||||
}
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -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/<ostype>/compute.<osver>.<arch>.pkglist /install/custom/install/<ostype>/compute.<osver>.<arch>.pkglist
|
||||
# Edit your /install/custom/install/<ostype>/compute.<osver>.<arch>.pkglist and add:
|
||||
# #INCLUDE:/opt/xcat/share/xcat/ib/netboot/<ostype>/ib.<osver>.<arch>.pkglist#
|
||||
# 1.3 Make sure the related osimage use the customized pkglist.
|
||||
# lsdef -t osimage -o <osver>-<arch>-install-compute
|
||||
# if not, change it:
|
||||
# chdef -t osimage -o <osver>-<arch>-install-compute pkglist=/install/custom/install/<ostype>/compute.<osver>.<arch>.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/<ostype>/compute.<osver>.<arch>.pkglist /install/custom/install/<ostype>/compute.<osver>.<arch>.pkglist
|
||||
# Edit your /install/custom/install/<ostype>/compute.<osver>.<arch>.pkglist and add:
|
||||
# #INCLUDE:/opt/xcat/share/xcat/ib/netboot/<ostype>/ib.<osver>.<arch>.pkglist#
|
||||
# 1.2 Make the related osimage use the customized pkglist.
|
||||
# chdef -t osimage -o <osver>-<arch>-install-compute pkglist=/install/custom/install/<ostype>/compute.<osver>.<arch>.pkglist
|
||||
# 1.3 set mlnxofed_ib_install as postbootscripts for the target node. assign necessary attribute for mlnxofed_ib_install at same time.
|
||||
# chdef <node> -p postbootscripts="mlnxofed_ib_install -p /install/<path>/<OFED.ISO>"
|
||||
# [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 <node> -p postbootscripts="mlnxofed_ib_install -p /install/<path>/<OFED.ISO> -m --without-32bit --add-kernel-support --force -end-"
|
||||
# 1.4 do the diskfull installation
|
||||
# nodeset <node> osimage=<osimage> ......
|
||||
#
|
||||
# 2. install the ofed driver for diskless images:
|
||||
# 2.1 Copy the pkglist to the custom directory:
|
||||
# cp /opt/xcat/share/xcat/netboot/<ostype>/compute.<osver>.<arch>.pkglist /install/custom/netboot/<ostype>/compute.<osver>.<arch>.pkglist
|
||||
# Edit your /install/custom/netboot/<ostype>/<profile>.pkglist and add:
|
||||
# #INCLUDE:/opt/xcat/share/xcat/ib/netboot/<ostype>/ib.<osver>.<arch>.pkglist#
|
||||
# 2.2 Add to postinstall scripts
|
||||
# Edit your /install/custom/netboot/<ostype>/<profile>.postinstall and add:
|
||||
# installroot=$1 ofeddir=/install/post/otherpkgs/<osver>/<arch>/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 <osver>-<arch>-netboot-compute
|
||||
# if not, change it:
|
||||
# chdef -t osimage -o <osver>-<arch>-netboot-compute pkglist=/install/custom/netboot/<ostype>/compute.<osver>.<arch>.pkglist postinstall=/install/custom/netboot/<ostype>/<profile>.postinstall
|
||||
# 2.4 Run genimage
|
||||
# genimage <osver>-<arch>-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/<ostype>/compute.<osver>.<arch>.pkglist /install/custom/netboot/<ostype>/compute.<osver>.<arch>.pkglist
|
||||
# Edit your /install/custom/netboot/<ostype>/<profile>.pkglist and add:
|
||||
# #INCLUDE:/opt/xcat/share/xcat/ib/netboot/<ostype>/ib.<osver>.<arch>.pkglist#
|
||||
# 2.2 Add to postinstall scripts
|
||||
# Edit your /install/custom/netboot/<ostype>/<profile>.postinstall and add:
|
||||
# /install/postscripts/mlnxofed_ib_install -p /install/<path>/<OFED.ISO> -n genimage -i $1
|
||||
# 2.3 Make sure the related osimage use the customized pkglist and customized compute.postinsall
|
||||
# lsdef -t osimage -o <osver>-<arch>-netboot-compute
|
||||
# if not, change it:
|
||||
# chdef -t osimage -o <osver>-<arch>-netboot-compute pkglist=/install/custom/netboot/<ostype>/compute.<osver>.<arch>.pkglist postinstall=/install/custom/netboot/<ostype>/<profile>.postinstall
|
||||
# 2.4 run genimage
|
||||
# genimage <osver>-<arch>-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 <image>.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 <image>.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
|
||||
|
||||
|
||||
@@ -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/<ostype>/compute.<osver>.<arch>.pkglist /install/custom/install/<ostype>/compute.<osver>.<arch>.pkglist
|
||||
# Edit your /install/custom/install/<ostype>/compute.<osver>.<arch>.pkglist and add:
|
||||
# #INCLUDE:/opt/xcat/share/xcat/ib/netboot/<ostype>/ib.<osver>.<arch>.pkglist#
|
||||
# 1.2 Make the related osimage use the customized pkglist.
|
||||
# chdef -t osimage -o <osver>-<arch>-install-compute pkglist=/install/custom/install/<ostype>/compute.<osver>.<arch>.pkglist
|
||||
# 1.3 set mlnxofed_ib_install as postbootscripts for the target node. assign necessary attribute for mlnxofed_ib_install at same time.
|
||||
# chdef <node> -p postbootscripts="mlnxofed_ib_install -p /install/<path>/<OFED.ISO>"
|
||||
# [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 <node> -p postbootscripts="mlnxofed_ib_install -p /install/<path>/<OFED.ISO> -m --without-32bit --add-kernel-support --force -end-"
|
||||
# 1.4 do the diskfull installation
|
||||
# nodeset <node> osimage=<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/<ostype>/compute.<osver>.<arch>.pkglist /install/custom/netboot/<ostype>/compute.<osver>.<arch>.pkglist
|
||||
# Edit your /install/custom/netboot/<ostype>/<profile>.pkglist and add:
|
||||
# #INCLUDE:/opt/xcat/share/xcat/ib/netboot/<ostype>/ib.<osver>.<arch>.pkglist#
|
||||
# 2.2 Add to postinstall scripts
|
||||
# Edit your /install/custom/netboot/<ostype>/<profile>.postinstall and add:
|
||||
# /install/postscripts/mlnxofed_ib_install -p /install/<path>/<OFED.ISO> -n genimage -i $1
|
||||
# 2.3 Make sure the related osimage use the customized pkglist and customized compute.postinsall
|
||||
# lsdef -t osimage -o <osver>-<arch>-netboot-compute
|
||||
# if not, change it:
|
||||
# chdef -t osimage -o <osver>-<arch>-netboot-compute pkglist=/install/custom/netboot/<ostype>/compute.<osver>.<arch>.pkglist postinstall=/install/custom/netboot/<ostype>/<profile>.postinstall
|
||||
# 2.4 run genimage
|
||||
# genimage <osver>-<arch>-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 <image>.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
|
||||
@@ -1 +0,0 @@
|
||||
../rh/compute.rhels8.pkglist
|
||||
@@ -0,0 +1,11 @@
|
||||
@^minimal-environment
|
||||
chrony
|
||||
net-tools
|
||||
nfs-utils
|
||||
openssh-server
|
||||
rsync
|
||||
util-linux
|
||||
wget
|
||||
python3
|
||||
tar
|
||||
bzip2
|
||||
@@ -1 +0,0 @@
|
||||
../rh/compute.rhels8.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
|
||||
@@ -7,3 +7,5 @@ rsync
|
||||
util-linux
|
||||
wget
|
||||
python3
|
||||
tar
|
||||
bzip2
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -11,3 +11,5 @@ perl-DBD-MySQL
|
||||
perl-DBD-Pg
|
||||
unixODBC
|
||||
python3
|
||||
tar
|
||||
bzip2
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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 </proc/partitions
|
||||
|
||||
echo "0"
|
||||
return
|
||||
}
|
||||
|
||||
# time to ascertain fstype and PReP/UEFI/legacy
|
||||
# also, find first available block device (sda or vda likely)
|
||||
# TODO: pick a likely non-SAN target if possible
|
||||
@@ -242,16 +269,24 @@ then
|
||||
echo "part /boot/efi --fstype=$EFIFSTYPE --ondisk=$instdisk --size=256" >>/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"
|
||||
|
||||
|
||||
@@ -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"
|
||||
#
|
||||
|
||||
@@ -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"
|
||||
#
|
||||
|
||||
@@ -112,6 +112,7 @@
|
||||
<startmode>onboot</startmode>
|
||||
</interface>
|
||||
</interfaces>
|
||||
<keep_install_network config:type="boolean">true</keep_install_network>
|
||||
<routing>
|
||||
<ip_forward config:type="boolean">false</ip_forward>
|
||||
<routes config:type="list"/>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user