Compare commits
447 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 3d51e0acfe | |||
| 37d53860a9 | |||
| fba0dc5518 | |||
| 26544fac91 | |||
| fa6f82b45e | |||
| 2754de946a | |||
| 1a02dbaa18 | |||
| a86152d7a3 | |||
| 5f8f907ead | |||
| 599fecd530 | |||
| 891478c649 | |||
| 797506ec8b | |||
| 16c7d16609 | |||
| e50d066c0b | |||
| c683aac291 | |||
| ea2730d251 | |||
| c9a613b258 | |||
| 4b10a30ae7 | |||
| 5fc5a13dad | |||
| 5663321c9e | |||
| 458932d0cf | |||
| abeffffccf | |||
| cc332eaa90 | |||
| d8495d188f | |||
| 727fdd1355 | |||
| 9083c12dfd | |||
| 770c42c5eb | |||
| f9dc643d03 | |||
| c8e52db261 | |||
| 1e32434db2 | |||
| 768595be98 | |||
| d83bf2204d | |||
| 23f608aa6a | |||
| dd74ef9864 | |||
| c75d5faa69 | |||
| d8dc3d2d30 | |||
| ac02f48b02 | |||
| 29dbe12954 | |||
| b77cdef661 | |||
| 39fa86cb28 | |||
| d55b923701 | |||
| 78fbcca2da | |||
| cfe62b8164 | |||
| 8392a75e94 | |||
| 4e957afe1b | |||
| 3e6f294d0f | |||
| f2b43dc313 | |||
| 7e3ccd6a52 | |||
| 55a4562ab9 | |||
| 08d8fd84d7 | |||
| 345ab8eea2 | |||
| d465521d80 | |||
| b3122827ad | |||
| 6c42d488fc | |||
| 5e482788b8 | |||
| e0bc7d22b4 | |||
| 22dc829935 | |||
| a3ebc13326 | |||
| 607364ef5d | |||
| 40d212ba32 | |||
| ede853a539 | |||
| 78028fe71d | |||
| 833b460f10 | |||
| ec93453019 | |||
| de33d65c07 | |||
| e70138abfd | |||
| b7e5ba9099 | |||
| 467b5a4177 | |||
| e7263f60a8 | |||
| f1a69b02c8 | |||
| dce9d70b14 | |||
| 4830f1704f | |||
| c12b3fee86 | |||
| 55e0df750d | |||
| 4e2919cbab | |||
| b5780548f0 | |||
| 9f8293200e | |||
| 99886eb792 | |||
| c2621cd941 | |||
| 4174cbdd65 | |||
| cc2c6a2d80 | |||
| cdb0d7a683 | |||
| 3482e6ca92 | |||
| 7f0303661f | |||
| 4156f7e7de | |||
| a0e0692fa5 | |||
| 8061e280dc | |||
| 2dcf6750fc | |||
| b1d4dc5613 | |||
| 1bf336a3f8 | |||
| 4364be67fc | |||
| 32e831629c | |||
| 9714883f52 | |||
| e74f245b7b | |||
| 800fd64640 | |||
| 0a774aea20 | |||
| 09a3a51b06 | |||
| 04fd13af5b | |||
| 41b6208cdf | |||
| 22238d9d84 | |||
| 81bd2a5861 | |||
| 5a8216703b | |||
| 957bc41fb3 | |||
| 812051a434 | |||
| b6abb7075a | |||
| 6eedeebc77 | |||
| bb31105e70 | |||
| f33baa6aba | |||
| 488140a428 | |||
| 999ffe2823 | |||
| f7e3cff5f0 | |||
| 988e00d1d6 | |||
| 0f0723592d | |||
| fd18ee0166 | |||
| 9fe321a9ba | |||
| 39e1cd10e2 | |||
| 953a306215 | |||
| 658c4af9fe | |||
| e3145dcb40 | |||
| e2adff9290 | |||
| a7ab35be04 | |||
| 2b938be82e | |||
| d14e8a3422 | |||
| 02aad8040b | |||
| 2e68e00d73 | |||
| 1048917a8b | |||
| 27359e6c08 | |||
| cba5bd906f | |||
| 6af4dc1f7d | |||
| 06618ddd32 | |||
| 03e45369f3 | |||
| b491d913c1 | |||
| 97a17e00d3 | |||
| 2d1ce8d415 | |||
| 4eb1d5571d | |||
| 7f92ce0444 | |||
| 3435d76f5e | |||
| 4be064b4cf | |||
| 127d916d34 | |||
| de6647147c | |||
| 1c1618d2fc | |||
| 8e34820345 | |||
| 8e81adb305 | |||
| 047e57f0c3 | |||
| 76223558ac | |||
| f7daa1c360 | |||
| db165108ea | |||
| 7609407917 | |||
| 8d565d3918 | |||
| 688e64e722 | |||
| 505a0aae73 | |||
| b1946e3f5c | |||
| 236b498fff | |||
| a9a7703ed5 | |||
| 3fcd955af8 | |||
| 5862e96f9d | |||
| 5c1f289122 | |||
| 7481889d00 | |||
| 2ae9e0c922 | |||
| 2fa947cd0c | |||
| 03db3ab47f | |||
| 7c5c6e163c | |||
| a176c60048 | |||
| ccc22e145b | |||
| 6bd1af764b | |||
| 0f84dd880a | |||
| 8f48a9539c | |||
| 3ffc0b2437 | |||
| db4d3824ed | |||
| d47cca6d30 | |||
| fc5c20ae0d | |||
| 708e5f143e | |||
| ec81ac9aa0 | |||
| 3b0783e351 | |||
| 82cce879ce | |||
| 3b6e0db8f4 | |||
| b963bc7ec4 | |||
| 8a7458234d | |||
| 0b7ea33179 | |||
| d76099720d | |||
| b37de511a8 | |||
| 1ed591ef0c | |||
| eadb53665c | |||
| 25d5e487ec | |||
| fd454d7ff2 | |||
| d7ae87e7ba | |||
| 4a42452208 | |||
| a40afdef5e | |||
| ae63258e0f | |||
| 687f289b78 | |||
| d097aa1deb | |||
| 15f85d6303 | |||
| 985f747691 | |||
| c1ec0439b8 | |||
| 8d6a163f5a | |||
| 5f8243a389 | |||
| 3cc995c63b | |||
| b8b5793bf4 | |||
| c947fa575f | |||
| ac6b203ea8 | |||
| 2c912a6efa | |||
| 2a295edea8 | |||
| 429a5b9076 | |||
| 571497b51c | |||
| 56ef49030a | |||
| 73c38b5152 | |||
| 3295f11ac4 | |||
| 5cb12eb3e7 | |||
| 19b42174bf | |||
| f25f6022fb | |||
| a5fa89aef2 | |||
| 640a5b5575 | |||
| d03e51ed9e | |||
| 6c6e4bd724 | |||
| 5949528172 | |||
| 9770e640d3 | |||
| e9cc31faae | |||
| 280eae743e | |||
| fbfac9405b | |||
| 9d413508e6 | |||
| b2b48b7678 | |||
| 4d5d0964d7 | |||
| eafd4a7eff | |||
| 987ca7033a | |||
| ee9e20cf9f | |||
| 93b9be9b49 | |||
| d3d9348e74 | |||
| eec0b38a2d | |||
| 4d944e385a | |||
| 1d20428352 | |||
| 6ae6ff3ec4 | |||
| ade3d19a46 | |||
| a3d37933ea | |||
| 3e6626f22d | |||
| 1eaef84651 | |||
| ffe63be973 | |||
| 5b1f6fd4da | |||
| 41860799c5 | |||
| 7ca22d39ac | |||
| 8ac9b36562 | |||
| 949b4cb086 | |||
| b1c534716b | |||
| ba190e0d9d | |||
| 7e2ff0f420 | |||
| 122240358e | |||
| d828446fd0 | |||
| 2dafc29fa5 | |||
| 9579b25806 | |||
| 24b7e62a4b | |||
| 5a0835c89e | |||
| 96fa0f6471 | |||
| 3270774658 | |||
| 3c8ad67b4a | |||
| 690b79a46e | |||
| 2048d4cbd2 | |||
| 63c23b6d20 | |||
| 7031fa292b | |||
| 5ff6f58072 | |||
| ab282e95dc | |||
| 78d63831b1 | |||
| c2642732c6 | |||
| 5fd64b4e8a | |||
| 158a08f288 | |||
| e2a44d1668 | |||
| f6295148e3 | |||
| 7d850a4889 | |||
| eae067c880 | |||
| 323fba6ed3 | |||
| 3576b6edc5 | |||
| 2911e9cb3a | |||
| 4838a4201d | |||
| 230ce41127 | |||
| e677086adc | |||
| 96d7905028 | |||
| 1a8c473ea4 | |||
| c900ba7990 | |||
| 05d60f28d3 | |||
| 5b95434d07 | |||
| 14a851b129 | |||
| 85a375d689 | |||
| b592346b68 | |||
| 29da171a6e | |||
| d73267e16b | |||
| 8034d25628 | |||
| 2d6e10f185 | |||
| 776a4347c2 | |||
| 9e5ed72181 | |||
| 6fa8c670cc | |||
| 13f7057ab8 | |||
| 545586453e | |||
| 52c78e8ef0 | |||
| f508e8d4a7 | |||
| 80a4209a56 | |||
| e140c6ecea | |||
| 185799c4af | |||
| 3d34490024 | |||
| 46719cea07 | |||
| a08819d0d1 | |||
| f0ed81dd29 | |||
| 2645befb3a | |||
| 24e52f96fe | |||
| 878cd33a3b | |||
| 1eef8bfb09 | |||
| 41e579fcd1 | |||
| b4d4194323 | |||
| ffef2c42d0 | |||
| 38cc43836c | |||
| 5236326c33 | |||
| cad30f609e | |||
| b1d341a332 | |||
| deae2fdf1e | |||
| 862fd2d095 | |||
| 3e77b5f7c1 | |||
| e3bde1a271 | |||
| a23a2096a5 | |||
| adcde47e22 | |||
| 2bd5a23a20 | |||
| 765c20d6de | |||
| 112ac2b7cc | |||
| 443115c63c | |||
| 4e5b13bbea | |||
| 83815d4147 | |||
| cf08fd0f66 | |||
| ff0a87d351 | |||
| 5610770c7e | |||
| 1687f84f1a | |||
| 7594e9d636 | |||
| ffc13f8709 | |||
| 19fd5997b2 | |||
| 43f8d9907a | |||
| f01980896c | |||
| 0e6c65680e | |||
| 0c5df40c81 | |||
| cea06ec458 | |||
| 7f109189f7 | |||
| 08d6ccb1e4 | |||
| ccf2f55f83 | |||
| 0072906ad2 | |||
| 59702b7ed8 | |||
| 9e58da04bb | |||
| 1b9d15b143 | |||
| 66edd2ec5a | |||
| 173f8ce7e2 | |||
| 4ef818ba79 | |||
| dde8390522 | |||
| ea2c6f1303 | |||
| b12793213e | |||
| e1fc3ca4cd | |||
| 65e8976a73 | |||
| 6d113545a2 | |||
| d4f4a6a5b5 | |||
| 531a326e7c | |||
| 3f452f17b7 | |||
| d719b98879 | |||
| 789dbbe9f4 | |||
| 60eba22531 | |||
| e1857b577f | |||
| 2a4aa6a4b7 | |||
| f40ed8bd74 | |||
| 206c2b4a30 | |||
| dc088cf05b | |||
| 81de935353 | |||
| 4f38ce60a7 | |||
| 209b47fe3e | |||
| 7184c5f1d1 | |||
| bf6fcac20b | |||
| 011fe6608a | |||
| 4c2b78a22d | |||
| ba1a1670ec | |||
| 4f91584ed9 | |||
| 55c4f81af6 | |||
| d653f89e87 | |||
| b269c14828 | |||
| 51ec31d4d9 | |||
| 8216370a21 | |||
| a534181da3 | |||
| 31122369a7 | |||
| a707c8a9b9 | |||
| 404f554a99 | |||
| fa0992ea09 | |||
| 6e601374b6 | |||
| c1483cc7db | |||
| 7df4643089 | |||
| e0dad7b643 | |||
| 9e96941ca3 | |||
| b303b5d01a | |||
| a3d8e0d6c4 | |||
| a1793645fe | |||
| 74f377d956 | |||
| 7a34476de2 | |||
| b197c84c81 | |||
| 9dd8c297d9 | |||
| 236d5e236a | |||
| 813ca61a72 | |||
| 32baaa1256 | |||
| feec1700ff | |||
| 0c026583a4 | |||
| cec3852ace | |||
| 940d40dc20 | |||
| 7bf773153c | |||
| 02a3edbc58 | |||
| 45ed594a42 | |||
| ec371ffc98 | |||
| 6e235884d9 | |||
| 7bdd6e6368 | |||
| 743056043d | |||
| 56e4338410 | |||
| dd46b00066 | |||
| 7b4d83793a | |||
| 428e30f98f | |||
| ce3fcef399 | |||
| bc4ff1b05f | |||
| 9570d8f83b | |||
| c56696aff3 | |||
| db8cdd11d0 | |||
| 0254709d2e | |||
| a0c6ac79c1 | |||
| fe3cc45a62 | |||
| 1a2abfc32f | |||
| c80d89c661 | |||
| b7194852a4 | |||
| 27242db435 | |||
| 29f32d3b04 | |||
| 6c6d66efe4 | |||
| 7d564cd088 | |||
| 9835df7b64 | |||
| e236c61cda | |||
| ef6b1738bc | |||
| d4de05052a | |||
| 037585d6c7 | |||
| 790199e176 | |||
| 74b07bf416 | |||
| cd882bff45 | |||
| 51e861fedc | |||
| 0ac03023e8 | |||
| fae8bdaf07 | |||
| 9a1c7d166f | |||
| f39c58662d | |||
| 053fd1611f | |||
| 6153c74606 | |||
| be78497238 | |||
| 16ac237f18 | |||
| 58a20e2b54 | |||
| ea94719691 | |||
| 3be19b1039 | |||
| 67bc1e0666 | |||
| 45712b109d |
+158
-175
@@ -11,10 +11,10 @@
|
||||
# the upload user listed below, so you don't have to keep entering pw's. You can do this
|
||||
# at https://sourceforge.net/account/ssh
|
||||
# - On Linux: make sure createrepo is installed on the build machine
|
||||
# - On AIX: Install openssl and openssh installp pkgs and run updtvpkg. Install from http://www.perzl.org/aix/
|
||||
# - On AIX: Install openssl and openssh installp pkgs and run updtvpkg. Install from http://www.perzl.org/aix/ :
|
||||
# apr, apr-util, bash, bzip2, db4, expat, gdbm, gettext, glib2, gmp, info, libidn, neon, openssl (won't
|
||||
# conflict with the installp version), pcre, perl-DBD-SQLite, perl-DBI, popt, python, readline, rsynce, sqlite,
|
||||
# subversion, unixODBC, wget, zlib.
|
||||
# conflict with the installp version - but i don't think you need this), pcre, perl-DBD-SQLite, perl-DBI,
|
||||
# popt, python, readline, rsynce, sqlite, subversion, unixODBC, zlib. Install wget from http://www-03.ibm.com/systems/power/software/aix/linux/toolbox/alpha.html
|
||||
# - Run this script from the local svn repository you just created. It will create the other
|
||||
# directories that are needed.
|
||||
|
||||
@@ -25,18 +25,33 @@
|
||||
# xcat-core tarball to the SF web site instead of the FRS area.
|
||||
# UP=0 or UP=1 - override the default upload behavior
|
||||
# SVNUP=<filename> - control which rpms get built by specifying a coresvnup file
|
||||
# FRSYUM=0 - put the yum repo and snap builds in the old project web area instead of the FRS area.
|
||||
# VERBOSE=1 - to see lots of verbose output
|
||||
|
||||
# you can change this if you need to
|
||||
UPLOADUSER=bp-sawyers
|
||||
FRS=/home/frs/project/x/xc/xcat
|
||||
|
||||
OSNAME=$(uname)
|
||||
# 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
|
||||
varstring=`echo "$i"|cut -d '=' -f 1|tr '[a-z]' '[A-Z]'`=`echo "$i"|cut -d '=' -f 2`
|
||||
export $varstring
|
||||
done
|
||||
if [ "$VERBOSE" = "1" -o "$VERBOSE" = "yes" ]; then
|
||||
set -x
|
||||
VERBOSEMODE=1
|
||||
fi
|
||||
|
||||
# Find where this script is located to set some build variables
|
||||
cd `dirname $0`
|
||||
# Strip the /src/xcat-core from the end of the dir to get the next dir up and use as the release
|
||||
CURDIR=`pwd`
|
||||
#D=${CURDIR/\/src\/xcat-core/}
|
||||
D=${CURDIR%/src/xcat-core}
|
||||
REL=`basename $D`
|
||||
# strip the /src/xcat-core from the end of the dir to get the next dir up and use as the release
|
||||
if [ -z "$REL" ]; then
|
||||
curdir=`pwd`
|
||||
D=${curdir%/src/xcat-core}
|
||||
REL=`basename $D`
|
||||
fi
|
||||
OSNAME=$(uname)
|
||||
|
||||
if [ "$OSNAME" != "AIX" ]; then
|
||||
GSA=http://pokgsa.ibm.com/projects/x/xcat/build/linux
|
||||
@@ -47,22 +62,23 @@ if [ "$OSNAME" != "AIX" ]; then
|
||||
echo "Can't get lock /var/lock/xcatbld-$REL.lock. Someone else must be doing a build right now. Exiting...."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
set -x
|
||||
|
||||
# Process cmd line variable assignments, assigning each attr=val pair to a variable of same name
|
||||
for i in $*; do
|
||||
#declare `echo $i|cut -d '=' -f 1`=`echo $i|cut -d '=' -f 2`
|
||||
export $i
|
||||
done
|
||||
|
||||
if [ "$OSNAME" != "AIX" ]; then
|
||||
|
||||
export HOME=/root # This is so rpm and gpg will know home, even in sudo
|
||||
fi
|
||||
|
||||
XCATCORE="xcat-core"
|
||||
svn up Version
|
||||
# this is needed only when we are transitioning the yum over to frs
|
||||
if [ "$FRSYUM" != 0 ]; then
|
||||
YUMDIR=$FRS
|
||||
YUMREPOURL="https://sourceforge.net/projects/xcat/files/yum"
|
||||
else
|
||||
YUMDIR=htdocs
|
||||
YUMREPOURL="http://xcat.sourceforge.net/yum"
|
||||
fi
|
||||
|
||||
# Set variables based on which type of build we are doing
|
||||
XCATCORE="xcat-core" # core-snap is a sym link to xcat-core
|
||||
echo "svn --quiet up Version"
|
||||
svn --quiet up Version
|
||||
VER=`cat Version`
|
||||
SHORTVER=`cat Version|cut -d. -f 1,2`
|
||||
SHORTSHORTVER=`cat Version|cut -d. -f 1`
|
||||
@@ -89,8 +105,12 @@ if [ "$PROMOTE" != 1 ]; then # very long if statement to not do builds if w
|
||||
mkdir -p $DESTDIR
|
||||
SRCDIR=../../$SRCD
|
||||
mkdir -p $SRCDIR
|
||||
GREP=grep
|
||||
# currently aix builds ppc rpms, but it should build noarch
|
||||
if [ -n "$VERBOSEMODE" ]; then
|
||||
GREP=grep
|
||||
else
|
||||
GREP="grep -q"
|
||||
fi
|
||||
# currently aix builds ppc rpms, but someday it should build noarch
|
||||
if [ "$OSNAME" = "AIX" ]; then
|
||||
NOARCH=ppc
|
||||
else
|
||||
@@ -100,172 +120,113 @@ UPLOAD=0
|
||||
if [ "$OSNAME" = "AIX" ]; then
|
||||
source=/opt/freeware/src/packages
|
||||
else
|
||||
if [ -f /etc/redhat-release ]; then
|
||||
source="/usr/src/redhat"
|
||||
else
|
||||
source="/usr/src/packages"
|
||||
source=`rpmbuild --eval '%_topdir' xCATsn/xCATsn.spec`
|
||||
if [ $? -gt 0 ]; then
|
||||
echo "Error: Could not determine rpmbuild's root directory."
|
||||
exit 2
|
||||
fi
|
||||
#echo "source=$source"
|
||||
fi
|
||||
|
||||
# If they have not given us a premade update file, do an svn update and capture the results
|
||||
if [ -z "$SVNUP" ]; then
|
||||
SVNUP=../coresvnup
|
||||
echo "svn up > $SVNUP"
|
||||
svn up > $SVNUP
|
||||
fi
|
||||
|
||||
# If anything has changed, we should always rebuild perl-xCAT
|
||||
if ! $GREP 'At revision' $SVNUP; then # Use to be: $GREP perl-xCAT $SVNUP; then
|
||||
UPLOAD=1
|
||||
./makeperlxcatrpm
|
||||
rm -f $DESTDIR/perl-xCAT*rpm
|
||||
rm -f $SRCDIR/perl-xCAT*rpm
|
||||
mv $source/RPMS/$NOARCH/perl-xCAT-$VER*rpm $DESTDIR/
|
||||
mv $source/SRPMS/perl-xCAT-$VER*rpm $SRCDIR/
|
||||
UPLOAD=1
|
||||
./makerpm perl-xCAT
|
||||
if [ $? -ne 0 ]; then
|
||||
FAILEDRPMS="perl-xCAT"
|
||||
else
|
||||
rm -f $DESTDIR/perl-xCAT*rpm
|
||||
rm -f $SRCDIR/perl-xCAT*rpm
|
||||
mv $source/RPMS/$NOARCH/perl-xCAT-$VER*rpm $DESTDIR/
|
||||
mv $source/SRPMS/perl-xCAT-$VER*rpm $SRCDIR/
|
||||
fi
|
||||
fi
|
||||
if [ "$OSNAME" = "AIX" ]; then
|
||||
# For the 1st one we overwrite, not append
|
||||
echo "rpm -Uvh perl-xCAT-$SHORTSHORTVER*rpm" > $DESTDIR/instxcat
|
||||
fi
|
||||
|
||||
if $GREP xCAT-client $SVNUP; then
|
||||
UPLOAD=1
|
||||
./makeclientrpm
|
||||
rm -f $DESTDIR/xCAT-client*rpm
|
||||
rm -f $SRCDIR/xCAT-client*rpm
|
||||
mv $source/RPMS/$NOARCH/xCAT-client-$VER*rpm $DESTDIR/
|
||||
mv $source/SRPMS/xCAT-client-$VER*rpm $SRCDIR/
|
||||
fi
|
||||
if [ "$OSNAME" = "AIX" ]; then
|
||||
echo "rpm -Uvh xCAT-client-$SHORTSHORTVER*rpm" >> $DESTDIR/instxcat
|
||||
fi
|
||||
|
||||
if $GREP xCAT-UI $SVNUP; then
|
||||
UPLOAD=1
|
||||
rm -f $DESTDIR/xCAT-UI*rpm
|
||||
rm -f $SRCDIR/xCAT-UI*rpm
|
||||
./makeuirpm
|
||||
mv $source/RPMS/noarch/xCAT-UI-$VER*rpm $DESTDIR
|
||||
mv $source/SRPMS/xCAT-UI-$VER*rpm $SRCDIR
|
||||
fi
|
||||
# Do not automatically install xCAT-UI on AIX
|
||||
#if [ "$OSNAME" = "AIX" ]; then
|
||||
# echo "rpm -Uvh xCAT-UI-$SHORTSHORTVER*rpm" >> $DESTDIR/instxcat
|
||||
#fi
|
||||
|
||||
if $GREP xCAT-IBMhpc $SVNUP; then
|
||||
UPLOAD=1
|
||||
rm -f $DESTDIR/xCAT-IBMhpc*rpm
|
||||
rm -f $SRCDIR/xCAT-IBMhpc*rpm
|
||||
./makehpcrpm
|
||||
mv $source/RPMS/$NOARCH/xCAT-IBMhpc-$VER*rpm $DESTDIR
|
||||
mv $source/SRPMS/xCAT-IBMhpc-$VER*rpm $SRCDIR
|
||||
fi
|
||||
# Do not automatically install xCAT-IBMhpc on AIX
|
||||
#if [ "$OSNAME" = "AIX" ]; then
|
||||
# echo "rpm -Uvh xCAT-IBMhpc-$SHORTSHORTVER*rpm" >> $DESTDIR/instxcat
|
||||
#fi
|
||||
|
||||
if $GREP xCAT-server $SVNUP; then
|
||||
UPLOAD=1
|
||||
./makeserverrpm
|
||||
rm -f $DESTDIR/xCAT-server*rpm
|
||||
rm -f $SRCDIR/xCAT-server*rpm
|
||||
mv $source/RPMS/$NOARCH/xCAT-server-$VER*rpm $DESTDIR
|
||||
mv $source/SRPMS/xCAT-server-$VER*rpm $SRCDIR
|
||||
fi
|
||||
if [ "$OSNAME" = "AIX" ]; then
|
||||
echo "rpm -Uvh xCAT-server-$SHORTSHORTVER*rpm" >> $DESTDIR/instxcat
|
||||
fi
|
||||
|
||||
if $GREP xCAT-rmc $SVNUP; then
|
||||
UPLOAD=1
|
||||
./makermcrpm
|
||||
rm -f $DESTDIR/xCAT-rmc*rpm
|
||||
rm -f $SRCDIR/xCAT-rmc*rpm
|
||||
mv $source/RPMS/$NOARCH/xCAT-rmc-$VER*rpm $DESTDIR
|
||||
mv $source/SRPMS/xCAT-rmc-$VER*rpm $SRCDIR
|
||||
fi
|
||||
# Note: not putting xCAT-rmc into instxcat for aix here, because it has to be installed
|
||||
# after xCAT.
|
||||
|
||||
if $GREP xCAT-test $SVNUP; then
|
||||
UPLOAD=1
|
||||
./maketestrpm
|
||||
rm -f $DESTDIR/xCAT-test*rpm
|
||||
rm -f $SRCDIR/xCAT-test*rpm
|
||||
mv $source/RPMS/$NOARCH/xCAT-test-$VER*rpm $DESTDIR
|
||||
mv $source/SRPMS/xCAT-test-$VER*rpm $SRCDIR
|
||||
fi
|
||||
# Note: not putting xCAT-test into instxcat for aix, because it is optional
|
||||
# Build the rest of the noarch rpms
|
||||
for rpmname in xCAT-client xCAT-server xCAT-IBMhpc xCAT-rmc xCAT-UI xCAT-test; do
|
||||
if $GREP $rpmname $SVNUP; then
|
||||
UPLOAD=1
|
||||
./makerpm $rpmname
|
||||
if [ $? -ne 0 ]; then
|
||||
FAILEDRPMS="$FAILEDRPMS $rpmname"
|
||||
else
|
||||
rm -f $DESTDIR/$rpmname*rpm
|
||||
rm -f $SRCDIR/$rpmname*rpm
|
||||
mv $source/RPMS/$NOARCH/$rpmname-$VER*rpm $DESTDIR/
|
||||
mv $source/SRPMS/$rpmname-$VER*rpm $SRCDIR/
|
||||
fi
|
||||
fi
|
||||
if [ "$OSNAME" = "AIX" ]; then
|
||||
if [ "$rpmname" = "xCAT-client" -o "$rpmname" = "xCAT-server" ]; then # we do not automatically install the rest of the rpms on AIX
|
||||
echo "rpm -Uvh $rpmname-$SHORTSHORTVER*rpm" >> $DESTDIR/instxcat
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
if [ "$OSNAME" != "AIX" ]; then
|
||||
if $GREP xCAT-nbroot $SVNUP; then
|
||||
UPLOAD=1
|
||||
./makenbrootrpm x86_64
|
||||
./makenbrootrpm ppc64
|
||||
./makenbrootrpm x86
|
||||
rm -f $DESTDIR/xCAT-nbroot-core*rpm
|
||||
rm -f $SRCDIR/xCAT-nbroot-core*rpm
|
||||
mv $source/RPMS/noarch/xCAT-nbroot-core-*rpm $DESTDIR
|
||||
mv $source/SRPMS/xCAT-nbroot-core-*rpm $SRCDIR
|
||||
UPLOAD=1
|
||||
ORIGFAILEDRPMS="$FAILEDRPMS"
|
||||
for arch in x86_64 x86 ppc64; do
|
||||
./makerpm xCAT-nbroot-core $arch
|
||||
if [ $? -ne 0 ]; then FAILEDRPMS="$FAILEDRPMS xCAT-nbroot-core-$arch"; fi
|
||||
done
|
||||
if [ "$FAILEDRPMS" = "$ORIGFAILEDRPMS" ]; then # all succeeded
|
||||
rm -f $DESTDIR/xCAT-nbroot-core*rpm
|
||||
rm -f $SRCDIR/xCAT-nbroot-core*rpm
|
||||
mv $source/RPMS/noarch/xCAT-nbroot-core-*rpm $DESTDIR
|
||||
mv $source/SRPMS/xCAT-nbroot-core-*rpm $SRCDIR
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if $GREP -E '^[UAD] +xCATsn/' $SVNUP; then
|
||||
UPLOAD=1
|
||||
rm -f $DESTDIR/xCATsn-*rpm
|
||||
rm -f $SRCDIR/xCATsn-*rpm
|
||||
if [ "$OSNAME" = "AIX" ]; then
|
||||
./makexcatsnrpm
|
||||
mv $source/RPMS/*/xCATsn-$VER*rpm $DESTDIR
|
||||
mv $source/SRPMS/xCATsn-$VER*rpm $SRCDIR
|
||||
else
|
||||
./makexcatsnrpm x86_64
|
||||
mv $source/RPMS/*/xCATsn-$VER*rpm $DESTDIR
|
||||
mv $source/SRPMS/xCATsn-$VER*rpm $SRCDIR
|
||||
./makexcatsnrpm i386
|
||||
mv $source/RPMS/*/xCATsn-$VER*rpm $DESTDIR
|
||||
./makexcatsnrpm ppc64
|
||||
mv $source/RPMS/*/xCATsn-$VER*rpm $DESTDIR
|
||||
./makexcatsnrpm s390x
|
||||
mv $source/RPMS/*/xCATsn-$VER*rpm $DESTDIR
|
||||
# Build the xCAT and xCATsn rpms for all platforms
|
||||
for rpmname in xCAT xCATsn; do
|
||||
if $GREP -E "^[UAD] +$rpmname/" $SVNUP; then
|
||||
UPLOAD=1
|
||||
ORIGFAILEDRPMS="$FAILEDRPMS"
|
||||
if [ "$OSNAME" = "AIX" ]; then
|
||||
./makerpm $rpmname
|
||||
if [ $? -ne 0 ]; then FAILEDRPMS="$FAILEDRPMS $rpmname"; fi
|
||||
else
|
||||
for arch in x86_64 i386 ppc64 s390x; do
|
||||
./makerpm $rpmname $arch
|
||||
if [ $? -ne 0 ]; then FAILEDRPMS="$FAILEDRPMS $rpmname-$arch"; fi
|
||||
done
|
||||
fi
|
||||
if [ "$FAILEDRPMS" = "$ORIGFAILEDRPMS" ]; then # all succeeded
|
||||
rm -f $DESTDIR/$rpmname-$SHORTSHORTVER*rpm
|
||||
rm -f $SRCDIR/$rpmname-$SHORTSHORTVER*rpm
|
||||
mv $source/RPMS/*/$rpmname-$VER*rpm $DESTDIR
|
||||
mv $source/SRPMS/$rpmname-$VER*rpm $SRCDIR
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if $GREP -E '^[UAD] +xCAT/' $SVNUP; then
|
||||
UPLOAD=1
|
||||
rm -f $DESTDIR/xCAT-$SHORTSHORTVER*rpm
|
||||
rm -f $SRCDIR/xCAT-$SHORTSHORTVER*rpm
|
||||
if [ "$OSNAME" = "AIX" ]; then
|
||||
./makexcatrpm
|
||||
mv $source/RPMS/*/xCAT-$VER*rpm $DESTDIR
|
||||
mv $source/SRPMS/xCAT-$VER*rpm $SRCDIR
|
||||
else
|
||||
./makexcatrpm x86_64
|
||||
mv $source/RPMS/*/xCAT-$VER*rpm $DESTDIR
|
||||
mv $source/SRPMS/xCAT-$VER*rpm $SRCDIR
|
||||
./makexcatrpm i386
|
||||
mv $source/RPMS/*/xCAT-$VER*rpm $DESTDIR
|
||||
./makexcatrpm ppc64
|
||||
mv $source/RPMS/*/xCAT-$VER*rpm $DESTDIR
|
||||
./makexcatrpm s390x
|
||||
mv $source/RPMS/*/xCAT-$VER*rpm $DESTDIR
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
if [ "$OSNAME" = "AIX" ]; then
|
||||
echo "rpm -Uvh xCAT-$SHORTSHORTVER*rpm" >> $DESTDIR/instxcat
|
||||
echo "rpm -Uvh xCAT-rmc-$SHORTSHORTVER*rpm" >> $DESTDIR/instxcat
|
||||
# add the service node bundle files
|
||||
# these are now shipped as part of xCAT-server !!!!
|
||||
# - installed in /opt/xcat/share/xcat/installp_bundles
|
||||
# cp xCATaixSN.bnd xCATaixSN2.bnd xCATaixSSH.bnd xCATaixSSL.bnd $DESTDIR/
|
||||
fi
|
||||
|
||||
# Decide if anything was built or not
|
||||
if [ -n "$FAILEDRPMS" ]; then
|
||||
echo "Error: build of the following RPMs failed: $FAILEDRPMS"
|
||||
exit 2
|
||||
fi
|
||||
if [ $UPLOAD == 0 -a "$UP" != 1 ]; then
|
||||
echo "Nothing new detected"
|
||||
exit 0;
|
||||
exit 0
|
||||
fi
|
||||
#else we will continue
|
||||
|
||||
@@ -283,14 +244,15 @@ if [ "$OSNAME" != "AIX" ]; then
|
||||
done
|
||||
# tell rpm to use gpg to sign
|
||||
MACROS=$HOME/.rpmmacros
|
||||
if ! $GREP -q '%_signature gpg' $MACROS 2>/dev/null; then
|
||||
if ! $GREP '%_signature gpg' $MACROS 2>/dev/null; then
|
||||
echo '%_signature gpg' >> $MACROS
|
||||
fi
|
||||
if ! $GREP -q '%_gpg_name' $MACROS 2>/dev/null; then
|
||||
if ! $GREP '%_gpg_name' $MACROS 2>/dev/null; then
|
||||
echo '%_gpg_name Jarrod Johnson' >> $MACROS
|
||||
fi
|
||||
build-utils/rpmsign.exp $DESTDIR/*rpm
|
||||
build-utils/rpmsign.exp $SRCDIR/*rpm
|
||||
echo "Signing RPMs..."
|
||||
build-utils/rpmsign.exp $DESTDIR/*rpm | grep -v -E '(was already signed|rpm --quiet --resign|WARNING: standard input reopened)'
|
||||
build-utils/rpmsign.exp $SRCDIR/*rpm | grep -v -E '(was already signed|rpm --quiet --resign|WARNING: standard input reopened)'
|
||||
createrepo $DESTDIR
|
||||
createrepo $SRCDIR
|
||||
rm -f $SRCDIR/repodata/repomd.xml.asc
|
||||
@@ -307,10 +269,14 @@ fi
|
||||
|
||||
# make everything have a group of xcat, so anyone can manage them once they get on SF
|
||||
if [ "$OSNAME" = "AIX" ]; then
|
||||
mkgroup xcat 2>/dev/null
|
||||
if ! lsgroup xcat >/dev/null 2>&1; then
|
||||
mkgroup xcat
|
||||
fi
|
||||
chmod +x $DESTDIR/instxcat
|
||||
else
|
||||
groupadd -f xcat
|
||||
else # linux
|
||||
if ! $GREP xcat /etc/group; then
|
||||
groupadd xcat
|
||||
fi
|
||||
fi
|
||||
chgrp -R xcat $DESTDIR
|
||||
chmod -R g+w $DESTDIR
|
||||
@@ -328,10 +294,10 @@ if [ "$OSNAME" != "AIX" ]; then
|
||||
cat >xCAT-core.repo << EOF
|
||||
[xcat-2-core]
|
||||
name=xCAT 2 Core packages
|
||||
baseurl=http://xcat.sourceforge.net/yum/$REL/$CORE
|
||||
baseurl=$YUMREPOURL/$REL/$CORE
|
||||
enabled=1
|
||||
gpgcheck=1
|
||||
gpgkey=http://xcat.sourceforge.net/yum/$REL/$CORE/repodata/repomd.xml.key
|
||||
gpgkey=$YUMREPOURL/$REL/$CORE/repodata/repomd.xml.key
|
||||
EOF
|
||||
|
||||
# Create the mklocalrepo script
|
||||
@@ -348,12 +314,18 @@ fi # not AIX
|
||||
|
||||
# Build the tarball
|
||||
cd ..
|
||||
if [ -n "$VERBOSEMODE" ]; then
|
||||
verboseflag="-v"
|
||||
else
|
||||
verboseflag=""
|
||||
fi
|
||||
echo "Creating $TARNAME ..."
|
||||
if [ "$OSNAME" = "AIX" ]; then
|
||||
tar -hcvf ${TARNAME%.gz} $XCATCORE
|
||||
tar $verboseflag -hcf ${TARNAME%.gz} $XCATCORE
|
||||
rm -f $TARNAME
|
||||
gzip ${TARNAME%.gz}
|
||||
else
|
||||
tar -hjcvf $TARNAME $XCATCORE
|
||||
tar $verboseflag -hjcf $TARNAME $XCATCORE
|
||||
fi
|
||||
chgrp xcat $TARNAME
|
||||
chmod g+w $TARNAME
|
||||
@@ -373,33 +345,44 @@ fi
|
||||
if [ ! -e core-snap ]; then
|
||||
ln -s xcat-core core-snap
|
||||
fi
|
||||
while ! rsync -urLv --delete $CORE $UPLOADUSER,xcat@web.sourceforge.net:htdocs/$YUM/$REL/
|
||||
do : ; done
|
||||
if [ "$REL" = "devel" -o "$PREGA" != 1 ]; then
|
||||
i=0
|
||||
echo "Uploading RPMs from $CORE to $YUMDIR/$YUM/$REL/ ..."
|
||||
while [ $((i+=1)) -le 5 ] && ! rsync -urLv --delete $CORE $UPLOADUSER,xcat@web.sourceforge.net:$YUMDIR/$YUM/$REL/
|
||||
do : ; done
|
||||
fi
|
||||
|
||||
# Upload the individual source RPMs to sourceforge
|
||||
while ! rsync -urLv --delete $SRCD $UPLOADUSER,xcat@web.sourceforge.net:htdocs/$YUM/$REL/
|
||||
i=0
|
||||
echo "Uploading src RPMs from $SRCD to $YUMDIR/$YUM/$REL/ ..."
|
||||
while [ $((i+=1)) -le 5 ] && ! rsync -urLv --delete $SRCD $UPLOADUSER,xcat@web.sourceforge.net:$YUMDIR/$YUM/$REL/
|
||||
do : ; done
|
||||
|
||||
# Upload the tarball to sourceforge
|
||||
if [ "$PROMOTE" = 1 -a "$REL" != "devel" -a "$PREGA" != 1 ]; then
|
||||
# upload tarball to FRS area
|
||||
#scp $TARNAME $UPLOADUSER@web.sourceforge.net:uploads/
|
||||
while ! rsync -v $TARNAME $UPLOADUSER,xcat@web.sourceforge.net:/home/frs/project/x/xc/xcat/xcat/$REL.x_$OSNAME/
|
||||
i=0
|
||||
echo "Uploading $TARNAME to $FRS/xcat/$REL.x_$OSNAME/ ..."
|
||||
while [ $((i+=1)) -le 5 ] && ! rsync -v $TARNAME $UPLOADUSER,xcat@web.sourceforge.net:$FRS/xcat/$REL.x_$OSNAME/
|
||||
do : ; done
|
||||
else
|
||||
while ! rsync -v $TARNAME $UPLOADUSER,xcat@web.sourceforge.net:htdocs/$YUM/$REL/
|
||||
i=0
|
||||
echo "Uploading $TARNAME to $YUMDIR/$YUM/$REL/ ..."
|
||||
while [ $((i+=1)) -le 5 ] && ! rsync -v $TARNAME $UPLOADUSER,xcat@web.sourceforge.net:$YUMDIR/$YUM/$REL/
|
||||
do : ; done
|
||||
fi
|
||||
|
||||
# Extract and upload the man pages in html format
|
||||
if [ "$OSNAME" != "AIX" -a "$REL" = "devel" -a "$PROMOTE" != 1 ]; then
|
||||
echo "Extracting and uploading man pages to htdocs/ ..."
|
||||
mkdir -p man
|
||||
cd man
|
||||
rm -rf opt
|
||||
rpm2cpio ../$XCATCORE/xCAT-client-*.$NOARCH.rpm | cpio -id '*.html'
|
||||
rpm2cpio ../$XCATCORE/perl-xCAT-*.$NOARCH.rpm | cpio -id '*.html'
|
||||
rpm2cpio ../$XCATCORE/xCAT-test-*.$NOARCH.rpm | cpio -id '*.html'
|
||||
while ! rsync -rv opt/xcat/share/doc/man1 opt/xcat/share/doc/man3 opt/xcat/share/doc/man5 opt/xcat/share/doc/man7 opt/xcat/share/doc/man8 $UPLOADUSER,xcat@web.sourceforge.net:htdocs/
|
||||
i=0
|
||||
while [ $((i+=1)) -le 5 ] && ! rsync $verboseflag -r opt/xcat/share/doc/man1 opt/xcat/share/doc/man3 opt/xcat/share/doc/man5 opt/xcat/share/doc/man7 opt/xcat/share/doc/man8 $UPLOADUSER,xcat@web.sourceforge.net:htdocs/
|
||||
do : ; done
|
||||
cd ..
|
||||
fi
|
||||
|
||||
@@ -0,0 +1,172 @@
|
||||
# The shell is commented out so that it will run in bash on linux and ksh on aix
|
||||
# !/bin/bash
|
||||
|
||||
# Common script to make any one the xcat rpms. To build locally, run in the top dir of local svn repository, for example:
|
||||
# ./makerpm xCAT-server
|
||||
# ./makerpm xCAT x86_64
|
||||
|
||||
# set -x
|
||||
|
||||
# Make one of the following rpms: perl-xCAT, xCAT-server, xCAT-client, xCAT-IBMhpc, xCAT-rmc, xCAT-UI, xCAT-test
|
||||
function makenoarch {
|
||||
RPMNAME=$1
|
||||
if [ "$OSNAME" = "AIX" ]; then
|
||||
echo '.svn' > /tmp/xcat-excludes
|
||||
tar -X /tmp/xcat-excludes -cf $RPMROOT/SOURCES/$RPMNAME-$VER.tar $RPMNAME
|
||||
gzip -f $RPMROOT/SOURCES/$RPMNAME-$VER.tar
|
||||
rm -f $RPMROOT/SRPMS/$RPMNAME-$VER*rpm $RPMROOT/RPMS/ppc/$RPMNAME-$VER*rpm
|
||||
echo "Building $RPMROOT/RPMS/ppc/$RPMNAME-$VER-snap*.ppc.rpm ..."
|
||||
rpm $QUIET -ba $RPMNAME/$RPMNAME.spec
|
||||
RC=$?
|
||||
else # linux
|
||||
echo "Building $RPMROOT/RPMS/noarch/$RPMNAME-$VER-snap*.noarch.rpm ..."
|
||||
tar --exclude .svn -czf $RPMROOT/SOURCES/$RPMNAME-$VER.tar.gz $RPMNAME
|
||||
rm -f $RPMROOT/SRPMS/xCAT-server-$VER*rpm $RPMROOT/RPMS/noarch/$RPMNAME-$VER*rpm
|
||||
rpmbuild $QUIET -ta $RPMROOT/SOURCES/$RPMNAME-$VER.tar.gz
|
||||
RC=$?
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
|
||||
# Make one of the following rpms: xCAT, xCATsn
|
||||
function makexcat {
|
||||
if [ "$OSNAME" != "AIX" -a -z "$2" ]; then
|
||||
echo 'Usage: makerpm <RPMname> <arch>'
|
||||
exit 1
|
||||
fi
|
||||
|
||||
RPMNAME="$1"
|
||||
|
||||
if [ "$OSNAME" = "AIX" ]; then
|
||||
source=/opt/freeware/src/packages
|
||||
cd `dirname $0`/$RPMNAME
|
||||
echo '.svn' > /tmp/xcat-excludes
|
||||
echo 'upflag' >> /tmp/xcat-excludes
|
||||
|
||||
if [ "$RPMNAME" = "xCAT" ]; then
|
||||
tar -X /tmp/xcat-excludes -cf $RPMROOT/SOURCES/postscripts.tar postscripts LICENSE.html
|
||||
gzip -f $RPMROOT/SOURCES/postscripts.tar
|
||||
tar -X /tmp/xcat-excludes -cf $RPMROOT/SOURCES/templates.tar templates
|
||||
gzip -f $RPMROOT/SOURCES/templates.tar
|
||||
cp xcat.conf $RPMROOT/SOURCES
|
||||
cp xCATMN $RPMROOT/SOURCES
|
||||
else # xCATsn
|
||||
tar -X /tmp/xcat-excludes -cf $RPMROOT/SOURCES/license.tar LICENSE.html
|
||||
gzip -f $RPMROOT/SOURCES/license.tar
|
||||
cp xCATSN $RPMROOT/SOURCES
|
||||
fi
|
||||
|
||||
rm -f $RPMROOT/SRPMS/$RPMNAME-$VER*rpm $RPMROOT/RPMS/ppc/$RPMNAME-$VER*rpm
|
||||
cd - >/dev/null
|
||||
|
||||
echo "Building $RPMROOT/RPMS/ppc/$RPMNAME-$VER-snap*.ppc.rpm ..."
|
||||
rpm $QUIET -ba $RPMNAME/$RPMNAME.spec
|
||||
RC=$?
|
||||
else # linux
|
||||
ARCH="$2"
|
||||
cd `dirname $0`/$RPMNAME
|
||||
|
||||
if [ "$RPMNAME" = "xCAT" ]; then
|
||||
tar --exclude .svn -czf $RPMROOT/SOURCES/postscripts.tar.gz postscripts LICENSE.html
|
||||
tar --exclude .svn -czf $RPMROOT/SOURCES/prescripts.tar.gz prescripts
|
||||
tar --exclude .svn -czf $RPMROOT/SOURCES/templates.tar.gz templates
|
||||
cp xcat.conf $RPMROOT/SOURCES
|
||||
cp xCATMN $RPMROOT/SOURCES
|
||||
else # xCATsn
|
||||
tar --exclude .svn -czf $RPMROOT/SOURCES/license.tar.gz LICENSE.html
|
||||
cp xcat.conf $RPMROOT/SOURCES
|
||||
cp xCATSN $RPMROOT/SOURCES
|
||||
fi
|
||||
|
||||
cd - >/dev/null
|
||||
rm -f $RPMROOT/SRPMS/$RPMNAME-$VER*rpm $RPMROOT/RPMS/$ARCH/$RPMNAME-$VER*rpm
|
||||
echo "Building $RPMROOT/RPMS/$ARCH/$RPMNAME-$VER-snap*.$ARCH.rpm ..."
|
||||
rpmbuild $QUIET -ba $RPMNAME/$RPMNAME.spec --target $ARCH
|
||||
RC=$?
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
|
||||
# Make the xCAT-nbroot-core rpm
|
||||
function makenbroot {
|
||||
if [ -z "$2" ]; then
|
||||
echo 'Usage: makerpm xCAT-nbroot-core <arch>'
|
||||
exit 1
|
||||
fi
|
||||
|
||||
DIR="xCAT-nbroot"
|
||||
ARCH="$2"
|
||||
RPMNAME="xCAT-nbroot-core-$ARCH"
|
||||
SPEC="xcat-core-nbroot"
|
||||
cd `dirname $0`/$DIR
|
||||
tar --exclude .svn -czf $RPMROOT/SOURCES/xcat-nbrootoverlay.tar.gz -C overlay/ .
|
||||
cp LICENSE.html $RPMROOT/BUILD
|
||||
cp $SPEC.spec $RPMROOT/SOURCES
|
||||
cd - >/dev/null
|
||||
rm -f $RPMROOT/SRPMS/$RPMNAME-$VER*rpm $RPMROOT/RPMS/noarch/$RPMNAME-$VER*rpm
|
||||
echo "Building $RPMROOT/RPMS/noarch/$RPMNAME-$VER-snap*.noarch.rpm ..."
|
||||
rpmbuild $QUIET -ba $DIR/$SPEC.spec --target $ARCH
|
||||
}
|
||||
|
||||
|
||||
|
||||
# Make the xCAT-nbroot-core rpm
|
||||
function makegenesis {
|
||||
DIR="xCAT-nbroot2"
|
||||
RPMNAME="$1"
|
||||
cd `dirname $0`/$DIR
|
||||
tar --exclude .svn -cjf $RPMROOT/SOURCES/$RPMNAME.tar.bz2 .
|
||||
cp LICENSE.html $RPMROOT/BUILD
|
||||
cp $RPMNAME.spec $RPMROOT/SOURCES
|
||||
cd - >/dev/null
|
||||
rm -f $RPMROOT/SRPMS/$RPMNAME-$VER*rpm $RPMROOT/RPMS/noarch/$RPMNAME-$VER*rpm
|
||||
echo "Building $RPMROOT/RPMS/noarch/$RPMNAME-$VER-snap*.noarch.rpm ..."
|
||||
rpmbuild $QUIET -ba $DIR/$RPMNAME.spec
|
||||
}
|
||||
|
||||
|
||||
|
||||
# Main code....
|
||||
|
||||
if [ -z "$1" ]; then
|
||||
echo 'Usage: makerpm <RPMname> [<arch>]'
|
||||
exit 1
|
||||
fi
|
||||
|
||||
OSNAME=$(uname)
|
||||
VER=`cat Version`
|
||||
if [ "$VERBOSE" = "1" -o "$VERBOSE" = "yes" ];then
|
||||
QUIET=""
|
||||
else
|
||||
QUIET="--quiet"
|
||||
fi
|
||||
|
||||
if [ "$OSNAME" = "AIX" ]; then
|
||||
RPMROOT=/opt/freeware/src/packages
|
||||
else # linux
|
||||
rpmbuild --version > /dev/null
|
||||
if [ $? -gt 0 ]; then
|
||||
echo "Error: rpmbuild does not appear to be installed or working."
|
||||
exit 2
|
||||
fi
|
||||
RPMROOT=`rpmbuild --eval '%_topdir' xCATsn/xCATsn.spec`
|
||||
if [ $? -gt 0 ]; then
|
||||
echo "Error: Could not determine rpmbuild's root directory."
|
||||
exit 2
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
if [ "$1" = "xCAT" -o "$1" = "xCATsn" ]; then
|
||||
makexcat $*
|
||||
elif [ "$1" = "xCAT-nbroot" -o "$1" = "xCAT-nbroot-core" ]; then
|
||||
makenbroot xCAT-nbroot-core $2
|
||||
elif [ "$1" = "xCAT-genesis-builder" ]; then
|
||||
makegenesis $*
|
||||
else # must be one of the noarch rpms
|
||||
makenoarch $*
|
||||
fi
|
||||
|
||||
exit $RC
|
||||
+18
-15
@@ -1,24 +1,27 @@
|
||||
#!/bin/sh
|
||||
# Put the version, svn revision #, and build date into the Version function in Version.pm
|
||||
|
||||
if [ -z "$1" ]
|
||||
if [ -z "$2" ]
|
||||
then
|
||||
echo "modifyVersion: Error: must specify the xCAT version as an argument!"
|
||||
echo "modifyUtils: Error: must specify the xCAT version and svn revision number as arguments" >&2
|
||||
exit
|
||||
fi
|
||||
VER=$1
|
||||
|
||||
SVNINFO=`svn info 2>/dev/null|grep Revision`
|
||||
#/bin/echo -e $SVNINFO
|
||||
if [ $? -ne 0 -a -f .svninfo ]; then
|
||||
SVNINFO=`cat .svninfo 2>/dev/null|grep Revision`
|
||||
fi
|
||||
if [ $? -eq 0 ]
|
||||
then
|
||||
SVNREF="svn r"`echo $SVNINFO|awk '{print $2}'`", "
|
||||
else
|
||||
SVNREF=""
|
||||
fi
|
||||
|
||||
VER=$1
|
||||
SVNREF="svn r$2, "
|
||||
|
||||
#SVNINFO=`svn info 2>/dev/null|grep Revision`
|
||||
#/bin/echo -e $SVNINFO
|
||||
#if [ $? -ne 0 -a -f .svninfo ]; then
|
||||
# SVNINFO=`cat .svninfo 2>/dev/null|grep Revision`
|
||||
#fi
|
||||
#if [ $? -eq 0 ]
|
||||
# then
|
||||
# SVNREF="svn r"`echo $SVNINFO|awk '{print $2}'`", "
|
||||
# else
|
||||
# SVNREF=""
|
||||
# fi
|
||||
|
||||
BUILDDATE=`date`
|
||||
#echo ". '(${SVNREF}built $BUILDDATE)'"
|
||||
|
||||
|
||||
@@ -22,6 +22,8 @@ Provides: perl-xCAT = %{epoch}:%{version}
|
||||
Provides perl xCAT libraries for core functionality. Required for all xCAT installations.
|
||||
Includes xCAT::Table, xCAT::NodeRange, among others.
|
||||
|
||||
%define svninfo %(svn info | grep Revision | awk '{print $2}')
|
||||
|
||||
%prep
|
||||
%setup -q -n perl-xCAT
|
||||
%build
|
||||
@@ -30,7 +32,7 @@ Includes xCAT::Table, xCAT::NodeRange, among others.
|
||||
# as it is in svn.
|
||||
|
||||
# Modify the Version() function in xCAT/Utils.pm to automatically have the correct version
|
||||
./modifyUtils %{version}
|
||||
./modifyUtils %{version} %{svninfo}
|
||||
|
||||
# Build the pod version of the man pages for each DB table. It puts them in the man5 and man7 subdirs.
|
||||
# Then convert the pods to man pages and html pages.
|
||||
@@ -92,6 +94,18 @@ rm -rf $RPM_BUILD_ROOT
|
||||
# Just package everything that has been copied into RPM_BUILD_ROOT
|
||||
%{prefix}
|
||||
|
||||
%pre
|
||||
# only need to check on AIX
|
||||
%ifnos linux
|
||||
if [ -x /usr/sbin/emgr ]; then # Check for emgr cmd
|
||||
/usr/sbin/emgr -l 2>&1 | grep -i xCAT # Test for any xcat ifixes - msg and exit if found
|
||||
if [ $? = 0 ]; then
|
||||
echo "Error: One or more xCAT emgr ifixes are installed. You must use the /usr/sbin/emgr command to uninstall each xCAT emgr ifix prior to RPM installation."
|
||||
exit 2
|
||||
fi
|
||||
fi
|
||||
%endif
|
||||
|
||||
%post
|
||||
%ifos linux
|
||||
if [ "$1" -gt 1 ]; then #Ugrade only, restart daemon and migrate settings
|
||||
|
||||
@@ -319,6 +319,11 @@ sub plugin_command {
|
||||
unless (@nodes) {
|
||||
$req->{emptynoderange} = [1];
|
||||
}
|
||||
|
||||
if(@nodes == 0 ) {
|
||||
print "No nodes or noderanges specified\n";
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
if (@nodes) { $req->{node} = \@nodes; }
|
||||
my %unhandled_nodes;
|
||||
@@ -947,9 +952,12 @@ sub handle_response {
|
||||
|
||||
# Handle {node} structure
|
||||
my $errflg=0;
|
||||
if (scalar @{$rsp->{node}}) {
|
||||
#print "printing node\n";
|
||||
my $nodes=($rsp->{node});
|
||||
unless (ref $nodes eq 'ARRAY') {
|
||||
$nodes = [$nodes];
|
||||
}
|
||||
if (scalar @{$nodes}) {
|
||||
#print "printing node\n";
|
||||
my $node;
|
||||
foreach $node (@$nodes) {
|
||||
my $desc=$node->{name}->[0];
|
||||
|
||||
+156
-111
@@ -10,17 +10,16 @@
|
||||
#####################################################
|
||||
package xCAT::DBobjUtils;
|
||||
|
||||
use xCAT::NodeRange;
|
||||
use xCAT::Schema;
|
||||
use xCAT::Table;
|
||||
use xCAT::Utils;
|
||||
use xCAT::MsgUtils;
|
||||
use xCAT::NetworkUtils;
|
||||
require xCAT::NodeRange;
|
||||
require xCAT::Schema;
|
||||
require xCAT::Table;
|
||||
require xCAT::Utils;
|
||||
require xCAT::MsgUtils;
|
||||
require xCAT::NetworkUtils;
|
||||
use strict;
|
||||
|
||||
# IPv6 not yet implemented - need Socket6
|
||||
use Socket;
|
||||
my @tabletype = qw(ppc zvm);
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
@@ -1039,7 +1038,8 @@ sub setobjdefs
|
||||
#
|
||||
# get the actual attr name to use in the table
|
||||
# - may be different then the attr name used for the object.
|
||||
($::tab, $::tabattr) = split('\.', $this_attr->{tabentry});
|
||||
my $ntab;
|
||||
($ntab, $::tabattr) = split('\.', $this_attr->{tabentry});
|
||||
|
||||
my $rc = xCAT::DBobjUtils->parse_access_tabentry($objname,
|
||||
$this_attr->{access_tabentry}, \%tabentry);
|
||||
@@ -2073,23 +2073,28 @@ sub parse_access_tabentry()
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
=head3 getchildren
|
||||
returns fsp(or bpa) of the specified cec(or frame),
|
||||
if specified port, it will just return nodes within the port.
|
||||
Arguments:
|
||||
none
|
||||
single hostname
|
||||
optional port number
|
||||
Returns:
|
||||
refrence of fsp/bpa hostnames (IPs)
|
||||
array of fsp/bpa hostnames (IPs)
|
||||
if specified port, it will just return nodes within the port.
|
||||
Globals:
|
||||
%PARENT_CHILDREN
|
||||
%PPCHASH - HASH of nodename -> array of ip addresses
|
||||
where the nodetype is fsp or bpa
|
||||
Error:
|
||||
none
|
||||
$::RUNCMD_RC = 1;
|
||||
Writes error to syslog
|
||||
Example:
|
||||
$c1 = getchildren($nodetocheck);
|
||||
$c1 = getchildren($nodetocheck,$port);
|
||||
Comments:
|
||||
none
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
my %PPCHASH;
|
||||
sub getchildren
|
||||
{
|
||||
my $parent = shift;
|
||||
@@ -2097,73 +2102,94 @@ sub getchildren
|
||||
{
|
||||
$parent = shift;
|
||||
}
|
||||
$::RUNCMD_RC = 0;
|
||||
my $port = shift;
|
||||
my @tabletype = qw(ppc zvm);
|
||||
my @children = ();
|
||||
my @children_prot = ();
|
||||
if (!%::PARENT_CHILDREN) {
|
||||
my @children_port = ();
|
||||
if (!%PPCHASH) {
|
||||
my $ppctab = xCAT::Table->new( 'ppc' );
|
||||
my @ps = $ppctab->getAllNodeAttribs(['node','parent']);
|
||||
for my $entry ( @ps ) {
|
||||
unless ($ppctab) { # cannot open the table return with error
|
||||
xCAT::MsgUtils->message('S', "getchildren:Unable to open ppc table.\n");
|
||||
$::RUNCMD_RC = 1;
|
||||
return undef;
|
||||
}
|
||||
my @ps = $ppctab->getAllNodeAttribs(['node','parent','nodetype']);
|
||||
foreach my $entry ( @ps ) {
|
||||
my $p = $entry->{parent};
|
||||
my $c = $entry->{node};
|
||||
my $t = $entry->{nodetype};
|
||||
if ( $p and $c) {
|
||||
#my $type = $ppctab->getNodeAttribs($c, ["nodetype"]);
|
||||
my $type = getnodetype($c);
|
||||
#if ( $type and ($type->{nodetype} eq 'fsp') or ($type->{nodetype} eq 'bpa'))
|
||||
if ( $type eq 'fsp' or $type eq 'bpa')
|
||||
{
|
||||
push @{$::PARENT_CHILDREN{$p}}, $c;
|
||||
}
|
||||
}
|
||||
if ($t) { # the nodetype exists in the ppc table, use it
|
||||
if ( $t eq 'fsp' or $t eq 'bpa') {
|
||||
# build hash of ppc.parent -> ppc.node
|
||||
push @{$PPCHASH{$p}}, $c;
|
||||
}
|
||||
} else { # go look in the nodetype table to find nodetype
|
||||
my $type = getnodetype($c);
|
||||
if ( $type eq 'fsp' or $type eq 'bpa')
|
||||
{
|
||||
# build hash of ppc.parent -> ppc.node
|
||||
push @{$PPCHASH{$p}}, $c;
|
||||
}
|
||||
}
|
||||
} # not $p and $c
|
||||
}
|
||||
foreach (@{$::PARENT_CHILDREN{$parent}}) {
|
||||
# Find parent in the hash and build return values
|
||||
foreach (@{$PPCHASH{$parent}}) {
|
||||
push @children, $_;
|
||||
}
|
||||
} else {
|
||||
if (exists($::PARENT_CHILDREN{$parent})) {
|
||||
foreach (@{$::PARENT_CHILDREN{$parent}}) {
|
||||
if (exists($PPCHASH{$parent})) {
|
||||
foreach (@{$PPCHASH{$parent}}) {
|
||||
push @children, $_;
|
||||
}
|
||||
}
|
||||
}
|
||||
# if port not input
|
||||
if ( !defined($port ))
|
||||
{
|
||||
return \@children;
|
||||
} else
|
||||
{
|
||||
my $vpdtab = xCAT::Table->new( 'vpd' );
|
||||
my $sides = $vpdtab->getNodesAttribs(\@children, ['side']);
|
||||
if(!$sides)
|
||||
{
|
||||
} else {
|
||||
if (@children) {
|
||||
my $vpdtab = xCAT::Table->new( 'vpd' );
|
||||
unless ($vpdtab) { # cannot open the table return with error
|
||||
xCAT::MsgUtils->message('S', "getchildren:Unable to open vpd table.\n");
|
||||
$::RUNCMD_RC = 1;
|
||||
return undef;
|
||||
}
|
||||
my $sides = $vpdtab->getNodesAttribs(\@children, ['side']);
|
||||
if(!$sides)
|
||||
{
|
||||
return undef;
|
||||
}
|
||||
for my $n (@children)
|
||||
{
|
||||
}
|
||||
foreach my $n (@children)
|
||||
{
|
||||
my $nside = $sides->{$n}->[0];
|
||||
if ($nside->{side} =~ /$port/)
|
||||
{
|
||||
push @children_prot, $n;
|
||||
push @children_port, $n;
|
||||
}
|
||||
}
|
||||
return \@children_prot;
|
||||
return \@children_port;
|
||||
} else { # no children
|
||||
return undef;
|
||||
}
|
||||
}
|
||||
}
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
=head3 getnodetype
|
||||
returns nodetype,
|
||||
first requery ppc table, if not exist, requery nodetypetable
|
||||
if the input is a array it will return a refrence,
|
||||
if the input is a simple node,it will return its type value
|
||||
if the value in the talbe is null, it will be undef but not ''
|
||||
Query ppc table, if no type found query nodetype table
|
||||
Arguments:
|
||||
none
|
||||
An array of nodenames or 1 nodename
|
||||
Returns:
|
||||
type of node
|
||||
Globals:
|
||||
%::GLOBLE_NODE_TYPE
|
||||
%NODETYPEHASH
|
||||
Error:
|
||||
none
|
||||
$::RUNCMD_RC = 1;
|
||||
Errors written to syslog
|
||||
Example:
|
||||
$type = getnodetype($node);
|
||||
$typerefer = getnodetype(\@nodes);
|
||||
@@ -2172,6 +2198,7 @@ sub getchildren
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
my %NODETYPEHASH;
|
||||
sub getnodetype
|
||||
{
|
||||
my $nodes = shift;
|
||||
@@ -2180,60 +2207,64 @@ sub getnodetype
|
||||
$nodes = shift;
|
||||
}
|
||||
my $rsp;
|
||||
my @tabletype = qw(ppc zvm);
|
||||
$::RUNCMD_RC = 0;
|
||||
|
||||
my $nodetypetab = xCAT::Table->new( 'nodetype' );
|
||||
if ( !$nodetypetab )
|
||||
{
|
||||
$rsp->{data}->[0] = "Could not open the nodetype table.";
|
||||
xCAT::MsgUtils->message("E", $rsp, $::callback);
|
||||
|
||||
unless ($nodetypetab) { # cannot open the table return with error
|
||||
xCAT::MsgUtils->
|
||||
message('S', "getnodetype:Unable to open nodetype table.\n");
|
||||
$::RUNCMD_RC = 1;
|
||||
return undef;
|
||||
}
|
||||
|
||||
my @types = ();
|
||||
my $typep;
|
||||
my $type;
|
||||
my %typehash;
|
||||
if ( $nodes =~ /^ARRAY/) {
|
||||
my @nodetypes = $nodetypetab->getAllAttribs('node','nodetype');
|
||||
for my $tn( @nodetypes ) {
|
||||
$typehash{ $tn->{'node'} } = $tn->{'nodetype'};
|
||||
}
|
||||
for my $nn (@$nodes) {
|
||||
$type = $typehash{$nn};
|
||||
if ($type) {
|
||||
my $flag = 0;
|
||||
my @tablename;
|
||||
for my $tt ( split /,/, $type ) {
|
||||
if ( grep(/$tt/, @tabletype)) {
|
||||
@tablename = grep(/$tt/, @tabletype);
|
||||
$flag = 1;
|
||||
next;
|
||||
}
|
||||
if (!%NODETYPEHASH) {
|
||||
my @nodetypes = $nodetypetab->getAllNodeAttribs(['node','nodetype']);
|
||||
foreach my $tn (@nodetypes) {
|
||||
$NODETYPEHASH{ $tn->{'node'} } = $tn->{'nodetype'};
|
||||
}
|
||||
}
|
||||
foreach my $nn (@$nodes) {
|
||||
$type = $NODETYPEHASH{$nn};
|
||||
if ($type) {
|
||||
my $flag = 0;
|
||||
my @tablename;
|
||||
foreach my $tt (split /,/, $type) {
|
||||
if (grep(/$tt/, @tabletype)) {
|
||||
@tablename = grep(/$tt/, @tabletype);
|
||||
$flag = 1;
|
||||
next;
|
||||
}
|
||||
}
|
||||
unless ($flag) { # find type in nodetype table
|
||||
push (@types, $type);
|
||||
} else { # use table (ppc or zvm) from attribute
|
||||
my $tablehandler = xCAT::Table->new( $tablename[0] );
|
||||
unless ($tablehandler) { # cannot open
|
||||
xCAT::MsgUtils->
|
||||
message('S', "getnodetype:Unable to open $tablename[0] table.\n");
|
||||
$::RUNCMD_RC = 1;
|
||||
return undef;
|
||||
}
|
||||
unless ($flag) { # find type in nodetype table
|
||||
push (@types, $type);
|
||||
# read the table
|
||||
$typep = $tablehandler->getNodeAttribs($nn, ["nodetype"]);
|
||||
if ($typep and $typep->{nodetype}) {
|
||||
$type = $typep->{nodetype};
|
||||
push (@types, $type);
|
||||
} else {
|
||||
my $tablehandler = xCAT::Table->new( $tablename[0] );
|
||||
if ( !$tablehandler ) {
|
||||
$rsp->{data}->[0] = "Could not open the $tablename[0] table.";
|
||||
xCAT::MsgUtils->message("E", $rsp, $::callback);
|
||||
push (@types, undef);
|
||||
next;
|
||||
}
|
||||
$typep = $tablehandler->getNodeAttribs($nn, ["nodetype"]); # find type in ppc table
|
||||
if ($typep and $typep->{nodetype}) {
|
||||
$type = $typep->{nodetype};
|
||||
push (@types, $type);
|
||||
} else {
|
||||
push (@types, undef);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
push (@types, undef);
|
||||
}
|
||||
push (@types, undef);
|
||||
}
|
||||
} # end of processing PPC
|
||||
} else {
|
||||
push (@types, undef);
|
||||
}
|
||||
}
|
||||
return \@types;
|
||||
} else {
|
||||
} else { # for one node
|
||||
$typep = $nodetypetab->getNodeAttribs($nodes, ["nodetype"]);
|
||||
if ( $typep and $typep->{nodetype} ) {
|
||||
$type = $typep->{nodetype};
|
||||
@@ -2251,9 +2282,9 @@ sub getnodetype
|
||||
} else { # find type in ppc table
|
||||
my $tablehandler = xCAT::Table->new( $tablename[0] );
|
||||
if ( !$tablehandler ) {
|
||||
$rsp->{data}->[0] = "Could not open the $tablename[0] table.";
|
||||
xCAT::MsgUtils->message("E", $rsp, $::callback);
|
||||
return undef;
|
||||
xCAT::MsgUtils->message('S', "getnodetype:Unable to open $tablename[0] table.\n");
|
||||
$::RUNCMD_RC = 1;
|
||||
return undef;
|
||||
}
|
||||
$typep = $tablehandler->getNodeAttribs($nodes, ["nodetype"]);
|
||||
if ( $typep and $typep->{nodetype} ) {
|
||||
@@ -2275,18 +2306,19 @@ sub getnodetype
|
||||
Arguments:
|
||||
frame name
|
||||
Returns:
|
||||
refrence of cec hostnames
|
||||
Array of cec hostnames
|
||||
Globals:
|
||||
$::PARENT_CHILDREN_CEC
|
||||
%PARENT_CHILDREN_CEC
|
||||
Error:
|
||||
none
|
||||
Example:
|
||||
$c1 = getcecchildren($nodetocheck);
|
||||
@frame_members = getcecchildren($frame);
|
||||
Comments:
|
||||
none
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
my %PARENT_CHILDREN_CEC;
|
||||
sub getcecchildren
|
||||
{
|
||||
my $parent = shift;
|
||||
@@ -2295,33 +2327,46 @@ sub getcecchildren
|
||||
$parent = shift;
|
||||
}
|
||||
my @children = ();
|
||||
if (!%::PARENT_CHILDREN_CEC) {
|
||||
if (!%PARENT_CHILDREN_CEC) {
|
||||
my $ppctab = xCAT::Table->new( 'ppc' );
|
||||
unless ($ppctab) { # cannot open the table return with error
|
||||
xCAT::MsgUtils->message('S', "getcecchildren:Unable to open ppc table.\n");
|
||||
$::RUNCMD_RC = 1;
|
||||
return undef;
|
||||
}
|
||||
if ($ppctab)
|
||||
{
|
||||
my @ps = $ppctab->getAllNodeAttribs(['node','parent']);
|
||||
for my $entry ( @ps ) {
|
||||
my @ps = $ppctab->getAllNodeAttribs(['node','parent','nodetype']);
|
||||
foreach my $entry ( @ps ) {
|
||||
my $p = $entry->{parent};
|
||||
my $c = $entry->{node};
|
||||
my $t = $entry->{nodetype};
|
||||
if ( $p and $c) {
|
||||
#my $type = $ppctab->getNodeAttribs($c, ["nodetype"]);
|
||||
my $type = getnodetype($c);
|
||||
if ( $type eq 'cec') {
|
||||
push @{$::PARENT_CHILDREN_CEC{$p}}, $c;
|
||||
}
|
||||
if ($t) { # the nodetype exists in the ppc table, use it
|
||||
if ( $t eq 'cec') {
|
||||
# build hash of ppc.parent -> ppc.node
|
||||
push @{$PARENT_CHILDREN_CEC{$p}}, $c;
|
||||
}
|
||||
} else { # go look in the nodetype table to find nodetype
|
||||
my $type = getnodetype($c);
|
||||
if ( $type eq 'cec') {
|
||||
push @{$PARENT_CHILDREN_CEC{$p}}, $c;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
foreach (@{$::PARENT_CHILDREN_CEC{$parent}}) {
|
||||
}
|
||||
# find a match for the parent and build the return array
|
||||
foreach (@{$PARENT_CHILDREN_CEC{$parent}}) {
|
||||
push @children, $_;
|
||||
}
|
||||
return \@children;
|
||||
return \@children;
|
||||
}
|
||||
} else {
|
||||
if (exists($::PARENT_CHILDREN_CEC{$parent})) {
|
||||
foreach (@{$::PARENT_CHILDREN_CEC{$parent}}) {
|
||||
} else { # already built the HASH
|
||||
if (exists($PARENT_CHILDREN_CEC{$parent})) {
|
||||
foreach (@{$PARENT_CHILDREN_CEC{$parent}}) {
|
||||
push @children, $_;
|
||||
}
|
||||
return \@children;
|
||||
return \@children;
|
||||
}
|
||||
}
|
||||
return undef;
|
||||
|
||||
@@ -4257,8 +4257,8 @@ sub parse_and_run_dcp
|
||||
/.../file1 /..../filex -> /...../dir1
|
||||
|
||||
rsync command format
|
||||
/usr/bin/rsync -Lpotz /etc/services $pathtoimage/etc/services
|
||||
/usr/bin/rsync -Lpotz /tmp/lissa/file1 /tmp/lissa/file $pathtoimage/tmp/lissa
|
||||
/usr/bin/rsync -Lprgotz /etc/services $pathtoimage/etc/services
|
||||
/usr/bin/rsync -Lprgotz /tmp/lissa/file1 /tmp/lissa/file $pathtoimage/tmp/lissa
|
||||
|
||||
Arguments:
|
||||
Input:
|
||||
@@ -4344,16 +4344,16 @@ sub rsync_to_image
|
||||
{
|
||||
if (-e ("/usr/bin/rsync"))
|
||||
{
|
||||
$synccmd = "/usr/bin/rsync -Lpotz ";
|
||||
$synccmd = "/usr/bin/rsync -Lprogtz ";
|
||||
}
|
||||
else
|
||||
{
|
||||
$synccmd = "/usr/local/bin/rsync -Lpotz ";
|
||||
$synccmd = "/usr/local/bin/rsync -Lprogtz ";
|
||||
}
|
||||
}
|
||||
else # linux
|
||||
{
|
||||
$synccmd = "/usr/bin/rsync -Lpotz ";
|
||||
$synccmd = "/usr/bin/rsync -Lprogtz ";
|
||||
}
|
||||
my $syncopt = "";
|
||||
foreach my $srcfile (@srcfiles)
|
||||
|
||||
+17
-10
@@ -98,10 +98,12 @@ sub fsp_api_action {
|
||||
############################
|
||||
# Get IP address
|
||||
############################
|
||||
$fsp_ip = xCAT::Utils::getNodeIPaddress( $fsp_name, $parameter );
|
||||
#$fsp_ip = xCAT::Utils::getNodeIPaddress( $fsp_name, $parameter );
|
||||
$fsp_ip = xCAT::Utils::getIPaddress( $fsp_name, $parameter );
|
||||
undef($parameter);
|
||||
} else {
|
||||
$fsp_ip = xCAT::Utils::getNodeIPaddress( $fsp_name );
|
||||
#$fsp_ip = xCAT::Utils::getNodeIPaddress( $fsp_name );
|
||||
$fsp_ip = xCAT::Utils::getIPaddress( $fsp_name );
|
||||
}
|
||||
|
||||
if(!defined($fsp_ip)) {
|
||||
@@ -144,8 +146,8 @@ sub fsp_api_action {
|
||||
|
||||
my $cmd;
|
||||
my $install_dir = xCAT::Utils->getInstallDir();
|
||||
if( $action =~ /^code_update$/) {
|
||||
$cmd = "$fsp_api -a $action -T $tooltype -t $type:$fsp_ip:$id:$node_name: -d $install_dir/packages_fw/";
|
||||
if( $action =~ /^(code_update|get_compatible_version_from_rpm)$/) {
|
||||
$cmd = "$fsp_api -a $action -T $tooltype -t $type:$fsp_ip:$id:$node_name:$parameter -d $install_dir/packages_fw/";
|
||||
} elsif($action =~ /^add_connection$/) {
|
||||
$cmd = "$fsp_api -a $action -u $user -p $password -T $tooltype -t $type:$fsp_ip:$id:$node_name:";
|
||||
} elsif ($action =~ /^set_frame_number$/) {
|
||||
@@ -154,6 +156,9 @@ sub fsp_api_action {
|
||||
if( defined($parameter) ) {
|
||||
if ($action =~ /^set_(frame|cec|lpar)_name$/) {
|
||||
$cmd = "$fsp_api -a $action -n $parameter -T $tooltype -t $type:$fsp_ip:$id:$node_name:";
|
||||
} elsif( $parameter !=0 && $action =~ /^(on|reset)$/ ) {
|
||||
#powerinterval for lpars power on
|
||||
$cmd = "$fsp_api -a $action -i $parameter -T $tooltype -t $type:$fsp_ip:$id:$node_name:";
|
||||
} else {
|
||||
$cmd = "$fsp_api -a $action -T $tooltype -t $type:$fsp_ip:$id:$node_name:$parameter";
|
||||
}
|
||||
@@ -173,7 +178,7 @@ sub fsp_api_action {
|
||||
#################
|
||||
#$outhash{ $node_name } = $res;
|
||||
if(defined($res)) {
|
||||
$res =~ s/$node_name: //;
|
||||
$res =~ s/$node_name: //g;
|
||||
}
|
||||
return( [$node_name,$res, $Rc] );
|
||||
}
|
||||
@@ -234,8 +239,9 @@ sub fsp_state_action {
|
||||
############################
|
||||
# Get IP address
|
||||
############################
|
||||
$fsp_ip = xCAT::Utils::getNodeIPaddress( $fsp_name );
|
||||
if(!defined($fsp_ip)) {
|
||||
#$fsp_ip = xCAT::Utils::getNodeIPaddress( $fsp_name );
|
||||
$fsp_ip = xCAT::Utils::getIPaddress( $fsp_name );
|
||||
if(!defined($fsp_ip) or ($fsp_ip == -3)) {
|
||||
$res[0] = ["Failed to get the $fsp_name\'s ip"];
|
||||
return ([-1, @res]);
|
||||
}
|
||||
@@ -256,7 +262,7 @@ sub fsp_state_action {
|
||||
#################
|
||||
#$outhash{ $node_name } = $res;
|
||||
if( @res ) {
|
||||
$res[0] =~ s/$node_name: //;
|
||||
$res[0] =~ s/$node_name: //g;
|
||||
}
|
||||
return( [$Rc,@res] );
|
||||
}
|
||||
@@ -351,8 +357,9 @@ sub fsp_api_create_parttion {
|
||||
############################
|
||||
# Get IP address
|
||||
############################
|
||||
$fsp_ip = xCAT::Utils::getNodeIPaddress( $fsp_name );
|
||||
if(!defined($fsp_ip)) {
|
||||
#$fsp_ip = xCAT::Utils::getNodeIPaddress( $fsp_name );
|
||||
$fsp_ip = xCAT::Utils::getIPaddress( $fsp_name );
|
||||
if(!defined($fsp_ip) or ($fsp_ip == -3)) {
|
||||
$res = "Failed to get the $fsp_name\'s ip";
|
||||
return ([$fsp_name, $res, -1]);
|
||||
}
|
||||
|
||||
+62
-53
@@ -31,8 +31,9 @@ sub do_rnetboot {
|
||||
my $ssh = @$exp[0];
|
||||
my $userid = @$exp[4];
|
||||
my $pw = @$exp[5];
|
||||
my $result = "";
|
||||
my $Rc = SUCCESS;
|
||||
my $cmd;
|
||||
my $result;
|
||||
|
||||
#######################################
|
||||
# Disconnect Expect session
|
||||
@@ -97,68 +98,76 @@ sub do_rnetboot {
|
||||
}
|
||||
}
|
||||
|
||||
my $mac = lc($opt->{m});
|
||||
#######################################
|
||||
# Network specified
|
||||
#######################################
|
||||
$cmd.= " -s auto -d auto -m \"$mac\" -S $opt->{S} -G $opt->{G} -C $opt->{C}";
|
||||
if ( exists( $opt->{o} )) {
|
||||
$cmd.= " -o";
|
||||
}
|
||||
my @macs = split /\|/, $opt->{m};
|
||||
foreach my $mac ( @macs ) {
|
||||
$mac = lc($mac);
|
||||
#######################################
|
||||
# Network specified
|
||||
#######################################
|
||||
$cmd.= " -s auto -d auto -m \"$mac\" -S $opt->{S} -G $opt->{G} -C $opt->{C}";
|
||||
if ( exists( $opt->{o} )) {
|
||||
$cmd.= " -o";
|
||||
}
|
||||
|
||||
my %client_nethash = xCAT::DBobjUtils->getNetwkInfo( [$node] );
|
||||
if ( grep /hf/, $client_nethash{$node}{mgtifname} ) {
|
||||
$cmd.= " -t hfi-ent";
|
||||
} else {
|
||||
$cmd.= " -t ent";
|
||||
}
|
||||
my %client_nethash = xCAT::DBobjUtils->getNetwkInfo( [$node] );
|
||||
if ( grep /hf/, $client_nethash{$node}{mgtifname} ) {
|
||||
$cmd.= " -t hfi-ent";
|
||||
} else {
|
||||
$cmd.= " -t ent";
|
||||
}
|
||||
|
||||
$pprofile = "not_use"; #lpar_netboot.expect need pprofile for p5 & p6, but for p7 ih, we don't use this attribute.
|
||||
|
||||
#######################################
|
||||
# Add command options
|
||||
#######################################
|
||||
$cmd.= " -f \"$name\" \"$pprofile\" \"$fsp\" $id $hcp \"$node\"";
|
||||
print "cmd: $cmd\n";
|
||||
my $done = 0;
|
||||
my $Rc = SUCCESS;
|
||||
while ( $done < 2 ) {
|
||||
#######################################
|
||||
# Execute command
|
||||
#######################################
|
||||
print "cmd:$cmd\n";
|
||||
my $pid = open( OUTPUT, "$cmd 2>&1 |");
|
||||
$SIG{INT} = $SIG{TERM} = sub { #prepare to process job termination and propogate it down
|
||||
kill 9, $pid;
|
||||
return( [RC_ERROR,"Received INT or TERM signal"] );
|
||||
};
|
||||
if ( !$pid ) {
|
||||
return( [RC_ERROR,"$cmd fork error: $!"] );
|
||||
}
|
||||
#######################################
|
||||
# Get command output
|
||||
#######################################
|
||||
while ( <OUTPUT> ) {
|
||||
$result.=$_;
|
||||
}
|
||||
close OUTPUT;
|
||||
$pprofile = "not_use"; #lpar_netboot.expect need pprofile for p5 & p6, but for p7 ih, we don't use this attribute.
|
||||
|
||||
#######################################
|
||||
# Get command exit code
|
||||
# Add command options
|
||||
#######################################
|
||||
$cmd.= " -f \"$name\" \"$pprofile\" \"$fsp\" $id $hcp \"$node\"";
|
||||
print "cmd: $cmd\n";
|
||||
my $done = 0;
|
||||
while ( $done < 2 ) {
|
||||
$result = "";
|
||||
$Rc = SUCCESS;
|
||||
#######################################
|
||||
# Execute command
|
||||
#######################################
|
||||
print "cmd:$cmd\n";
|
||||
my $pid = open( OUTPUT, "$cmd 2>&1 |");
|
||||
$SIG{INT} = $SIG{TERM} = sub { #prepare to process job termination and propogate it down
|
||||
kill 9, $pid;
|
||||
return( [RC_ERROR,"Received INT or TERM signal"] );
|
||||
};
|
||||
if ( !$pid ) {
|
||||
return( [RC_ERROR,"$cmd fork error: $!"] );
|
||||
}
|
||||
#######################################
|
||||
# Get command output
|
||||
#######################################
|
||||
while ( <OUTPUT> ) {
|
||||
$result.=$_;
|
||||
}
|
||||
close OUTPUT;
|
||||
|
||||
#######################################
|
||||
# Get command exit code
|
||||
#######################################
|
||||
|
||||
foreach ( split /\n/, $result ) {
|
||||
if ( /^lpar_netboot / ) {
|
||||
$Rc = RC_ERROR;
|
||||
last;
|
||||
foreach ( split /\n/, $result ) {
|
||||
if ( /^lpar_netboot / ) {
|
||||
$Rc = RC_ERROR;
|
||||
last;
|
||||
}
|
||||
}
|
||||
|
||||
if ( $Rc == SUCCESS ) {
|
||||
$done = 2;
|
||||
} else {
|
||||
$done = $done + 1;
|
||||
sleep 1;
|
||||
}
|
||||
}
|
||||
|
||||
if ( $Rc == SUCCESS ) {
|
||||
$done = 2;
|
||||
} else {
|
||||
$done = $done + 1;
|
||||
sleep 1;
|
||||
last;
|
||||
}
|
||||
}
|
||||
return( [$Rc,$result] );
|
||||
|
||||
@@ -34,9 +34,9 @@ sub parse_args {
|
||||
# Process command-line arguments
|
||||
#############################################
|
||||
if ( !defined( $args )) {
|
||||
$request->{method} = $cmd;
|
||||
return( \%opt );
|
||||
return(usage( "Missing command with rbootseq in DFM, net or hfi ?" ));
|
||||
}
|
||||
|
||||
#############################################
|
||||
# Checks case in GetOptions, allows opts
|
||||
# to be grouped (e.g. -vx), and terminates
|
||||
@@ -156,11 +156,12 @@ sub rbootseq {
|
||||
my $m;
|
||||
my $m_t;
|
||||
foreach $m (@mac_t) {
|
||||
if($m =~ /([\w:]{14})!$node_name/) {
|
||||
if(($m =~ /([\w:]{12})!$node_name/) || ($m =~ /([\w:]{17})!$node_name/)) {
|
||||
$m_t = $1;
|
||||
last;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if( !defined($m_t)) {
|
||||
$mac = $mac_t[0];
|
||||
@@ -168,12 +169,18 @@ sub rbootseq {
|
||||
$mac = $m_t;
|
||||
}
|
||||
}
|
||||
|
||||
if( $mac =~ /\:/) {
|
||||
$mac =~ s/\://g;
|
||||
}
|
||||
|
||||
if( $mac =~ /\:/) {
|
||||
$mac =~ s/\://g;
|
||||
}
|
||||
$parameter = "mac=$mac:speed=auto,duplex=auto,$o->{server},,$o->{client},$o->{gateway},$bootp_retries,$tftp_retries,$o->{netmask},$blksize";
|
||||
|
||||
if($mac =~/^(\w{12})$/) {
|
||||
|
||||
$parameter = "mac=$mac:speed=auto,duplex=auto,$o->{server},,$o->{client},$o->{gateway},$bootp_retries,$tftp_retries,$o->{netmask},$blksize";
|
||||
} else {
|
||||
push @output, [$node_name, "The mac address in mac table could NOT be used for rbootseq with -net. HFI mac , or other wrong format?", -1 ];
|
||||
return( \@output );
|
||||
}
|
||||
}
|
||||
|
||||
if( $opt->{hfi}) {
|
||||
@@ -193,9 +200,9 @@ sub rbootseq {
|
||||
##################################
|
||||
if ( $Rc != SUCCESS ) {
|
||||
push @output, [$node_name,$data,$Rc];
|
||||
next;
|
||||
}
|
||||
} else {
|
||||
push @output,[$node_name, "Success", 0];
|
||||
}
|
||||
|
||||
return( \@output );
|
||||
|
||||
|
||||
+177
-62
@@ -27,6 +27,40 @@ my %default_passwd = (
|
||||
##########################################################################
|
||||
# Parse the command line for options and operands
|
||||
##########################################################################
|
||||
sub array_to_string {
|
||||
my $array = shift;
|
||||
my $string = "";
|
||||
my $i = 0;
|
||||
if (!scalar(@$array)) {
|
||||
return undef;
|
||||
}
|
||||
$string .= "\'$array->[0]\'";
|
||||
for ($i = 1; $i < scalar(@$array) - 1; $i++) {
|
||||
$string .= ", ";
|
||||
$string .= "\'$array->[$i]\'";
|
||||
}
|
||||
if ($i < scalar(@$array)) {
|
||||
$string .= " or \'$array->[$i]\'";
|
||||
}
|
||||
return $string;
|
||||
}
|
||||
|
||||
sub check_command {
|
||||
my $cmd = shift;
|
||||
my $rsp = shift;
|
||||
my @type = ();
|
||||
foreach my $tmp_type (keys %$rsp) {
|
||||
if (grep (/^$cmd$/, @{$rsp->{$tmp_type}})) {
|
||||
push @type, $tmp_type;
|
||||
}
|
||||
}
|
||||
if (!scalar(@type)) {
|
||||
return undef;
|
||||
} else {
|
||||
return &array_to_string(\@type);
|
||||
}
|
||||
}
|
||||
|
||||
sub parse_args {
|
||||
|
||||
my $request = shift;
|
||||
@@ -57,7 +91,11 @@ sub parse_args {
|
||||
"cec_off_policy",
|
||||
"resetnet",
|
||||
"sysname",
|
||||
"pending_power_on_side"
|
||||
"pending_power_on_side",
|
||||
"BSR",
|
||||
"setup_failover",
|
||||
"force_failover",
|
||||
"huge_page"
|
||||
);
|
||||
my @frame = (
|
||||
"frame",
|
||||
@@ -143,26 +181,49 @@ sub parse_args {
|
||||
####################################
|
||||
# Check for unsupported commands
|
||||
####################################
|
||||
foreach my $arg ( @ARGV ) {
|
||||
my @arg_array = @ARGV;
|
||||
my @fsp_cmds = ();
|
||||
my @ppc_cmds = ();
|
||||
foreach my $arg ( @arg_array ) {
|
||||
my ($command,$value) = split( /=/, $arg );
|
||||
if ( !grep( /^$command$/, @$supported) and !$opt{resetnet}) {
|
||||
my @enableASMI = xCAT::Utils->get_site_attribute("enableASMI");
|
||||
if (defined($enableASMI[0])) {
|
||||
$enableASMI[0] =~ tr/a-z/A-Z/; # convert to upper
|
||||
if (($enableASMI[0] eq "1") || ($enableASMI[0] eq "YES"))
|
||||
{
|
||||
$request->{enableASMI} = 1;
|
||||
return xCAT::PPCcfg::parse_args($request, @_);
|
||||
}
|
||||
}
|
||||
return(usage( "Invalid command for $request->{hwtype} : $arg" ));
|
||||
}
|
||||
$request->{arg} = [$arg];
|
||||
my $res = xCAT::PPCcfg::parse_args($request, @_);
|
||||
if (ref($res) eq 'ARRAY') {
|
||||
my $check_cmd = &check_command($command, \%rsp);
|
||||
if (!defined($check_cmd)) {
|
||||
return $res;
|
||||
} else {
|
||||
return ([$_[0], "'$command' is only supported by type $check_cmd."]);
|
||||
}
|
||||
} else {
|
||||
push @ppc_cmds, $command;
|
||||
}
|
||||
} else {
|
||||
push @fsp_cmds, $command;
|
||||
}
|
||||
if ( exists( $cmds{$command} )) {
|
||||
return(usage( "Command multiple times: $command" ));
|
||||
}
|
||||
$cmds{$command} = $value;
|
||||
}
|
||||
|
||||
$request->{arg} = \@arg_array;
|
||||
if (scalar(@fsp_cmds) && scalar(@ppc_cmds)) {
|
||||
my $fsp_cmds_string = &array_to_string(\@fsp_cmds);
|
||||
my $ppc_cmds_string = &array_to_string(\@ppc_cmds);
|
||||
return (usage("Invalid command array: $fsp_cmds_string can not execute with $ppc_cmds_string."));
|
||||
} elsif(scalar(@ppc_cmds)) {
|
||||
my @enableASMI = xCAT::Utils->get_site_attribute("enableASMI");
|
||||
if (defined($enableASMI[0])) {
|
||||
$enableASMI[0] =~ tr/a-z/A-Z/; # convert to upper
|
||||
if (($enableASMI[0] eq "1") || ($enableASMI[0] eq "YES")) {
|
||||
$request->{enableASMI} = 1;
|
||||
}
|
||||
}
|
||||
if ($request->{enableASMI} ne '1') {
|
||||
return (usage( "You should enable \"ASMI\" first for \'$command\'."));
|
||||
}
|
||||
}
|
||||
####################################
|
||||
# Check command arguments
|
||||
####################################
|
||||
@@ -172,6 +233,8 @@ sub parse_args {
|
||||
if ( $result ) {
|
||||
return( usage($result) );
|
||||
}
|
||||
} elsif ($_ =~ /_passwd$/) {
|
||||
return( usage("No argument specified for '$_'"));
|
||||
}
|
||||
}
|
||||
####################################
|
||||
@@ -198,7 +261,8 @@ sub parse_args {
|
||||
$request->{method} = "resetnet";
|
||||
return( \%opt );
|
||||
}
|
||||
if(exists($cmds{sysname}) or exists($cmds{pending_power_on_side})) {
|
||||
if(exists($cmds{sysname}) or exists($cmds{pending_power_on_side}) or exists($cmds{BSR})
|
||||
or exists($cmds{setup_failover}) or exists($cmds{force_failover}) or exists ($cmds{huge_page})) {
|
||||
$request->{hcp} = $request->{hwtype} eq 'frame' ? "bpa":"fsp";
|
||||
$request->{method} = "do_fspapi_function";
|
||||
return (\%opt);
|
||||
@@ -273,6 +337,19 @@ sub parse_option {
|
||||
return ("Invalid pending_power_on_side param '$value'");
|
||||
}
|
||||
}
|
||||
if ($command eq 'setup_failover') {
|
||||
if ($value !~ /^(enable|disable)$/) {
|
||||
return ("Invalid setup_failover param '$value'");
|
||||
}
|
||||
}
|
||||
if ($command =~ /^(BSR|force_failover)$/ ) {
|
||||
return ("BSR value can not be set");
|
||||
}
|
||||
if ($command =~ /^huge_page$/) {
|
||||
if ($value !~ /^[0-9]+$/) {
|
||||
return ("Invalid huge page param '$value'");
|
||||
}
|
||||
}
|
||||
return undef;
|
||||
}
|
||||
sub check_node_info {
|
||||
@@ -291,24 +368,50 @@ sub check_node_info {
|
||||
|
||||
my %fspapi_action = (
|
||||
sysname => {
|
||||
query => {
|
||||
cec => "get_cec_name",
|
||||
frame => "get_frame_name"
|
||||
},
|
||||
set => {
|
||||
cec => "set_cec_name",
|
||||
frame => "set_frame_name"
|
||||
}
|
||||
query => {
|
||||
cec => "get_cec_name",
|
||||
frame => "get_frame_name"
|
||||
},
|
||||
set => {
|
||||
cec => "set_cec_name",
|
||||
frame => "set_frame_name"
|
||||
}
|
||||
},
|
||||
pending_power_on_side => {
|
||||
query => {
|
||||
cec => "list_firmware_level",
|
||||
frame => "list_firmware_level"
|
||||
query => {
|
||||
cec => "list_firmware_level",
|
||||
frame => "list_firmware_level"
|
||||
},
|
||||
set => {
|
||||
cec => "set_ipl_param",
|
||||
frame => "set_ipl_param"
|
||||
}
|
||||
},
|
||||
set => {
|
||||
cec => "set_ipl_param",
|
||||
frame => "set_ipl_param"
|
||||
}
|
||||
BSR => {
|
||||
query => {
|
||||
cec => "get_cec_bsr"
|
||||
}
|
||||
},
|
||||
setup_failover => {
|
||||
query => {
|
||||
cec => "cec_setup_failover"
|
||||
},
|
||||
set => {
|
||||
cec => "cec_setup_failover"
|
||||
}
|
||||
},
|
||||
force_failover => {
|
||||
query => {
|
||||
cec => "cec_force_failover"
|
||||
}
|
||||
},
|
||||
huge_page => {
|
||||
query => {
|
||||
cec => "get_huge_page"
|
||||
},
|
||||
set => {
|
||||
cec => "set_huge_page"
|
||||
}
|
||||
}
|
||||
);
|
||||
sub do_process_query_res {
|
||||
@@ -316,26 +419,29 @@ sub do_process_query_res {
|
||||
my $cmd = shift;
|
||||
my $result = shift;
|
||||
my $res = shift;
|
||||
if (@$res[2] != 0) {
|
||||
push @$result, $res;
|
||||
return "Error";
|
||||
}
|
||||
if ($cmd =~ /^sysname$/) {
|
||||
push @$result, $res;
|
||||
if (@$res[2] != 0) {
|
||||
return "Error";
|
||||
}
|
||||
} elsif($cmd =~ /^pending_power_on_side$/) {
|
||||
if (@$res[2] != 0) {
|
||||
push @$result, $res;
|
||||
return "Error";
|
||||
} else {
|
||||
my @values = split(/\n/, @$res[1]);
|
||||
foreach my $v (@values) {
|
||||
if ($v =~ /pend_power_on_side_(\w+)=(temp|perm),/) {
|
||||
push @$result, [$name, "Pending Power On Side \L\u$1: $2", '0'];
|
||||
} else {
|
||||
push @$result, [$name, $v, '1'];
|
||||
return "Error";
|
||||
}
|
||||
} elsif ($cmd =~ /^pending_power_on_side$/) {
|
||||
my @values = split(/\n/, @$res[1]);
|
||||
foreach my $v (@values) {
|
||||
if ($v =~ /pend_power_on_side_(\w+)=(temp|perm),/) {
|
||||
push @$result, [$name, "Pending Power On Side \L\u$1: $2", '0'];
|
||||
} else {
|
||||
push @$result, [$name, $v, '1'];
|
||||
return "Error";
|
||||
}
|
||||
}
|
||||
} elsif ($cmd =~ /^(BSR|huge_page)$/) {
|
||||
my @values = split(/\n/, @$res[1]);
|
||||
foreach my $v (@values) {
|
||||
push @$result, [$name, $v, '0'];
|
||||
}
|
||||
} else {
|
||||
push @$result, $res;
|
||||
}
|
||||
return undef;
|
||||
}
|
||||
@@ -348,10 +454,11 @@ sub do_query {
|
||||
while (my($name, $d) = each(%$h)) {
|
||||
my $action = $fspapi_action{$cmd}{query}{@$d[4]};
|
||||
my $values = xCAT::FSPUtils::fsp_api_action($name, $d, $action);
|
||||
my $res = &do_process_query_res($name, $cmd, \@result, $values);
|
||||
if (defined($res)) {
|
||||
last;
|
||||
}
|
||||
&do_process_query_res($name, $cmd, \@result, $values);
|
||||
#my $res = &do_process_query_res($name, $cmd, \@result, $values);
|
||||
#if (defined($res)) {
|
||||
# last;
|
||||
#}
|
||||
}
|
||||
}
|
||||
return (\@result);
|
||||
@@ -364,6 +471,10 @@ sub do_set_get_para {
|
||||
return (($value eq '*') ? $node_name : $value);
|
||||
} elsif ($cmd =~ /^pending_power_on_side$/){
|
||||
return ($value =~ /^perm$/) ? '0' : '1';
|
||||
} elsif ($cmd =~ /^setup_failover$/) {
|
||||
return ($value =~ /^enable$/) ? '1' : '0';
|
||||
} else {
|
||||
return $value;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -391,10 +502,11 @@ sub do_set {
|
||||
my $para = &do_set_get_para($name, $cmd, $value);
|
||||
my $values = xCAT::FSPUtils::fsp_api_action($name, $d, $action, 0, $para);
|
||||
# print Dumper($values);
|
||||
my $res = &do_process_set_res($name, $cmd, \@result, $values);
|
||||
if (defined($res)) {
|
||||
last;
|
||||
}
|
||||
&do_process_set_res($name, $cmd, \@result, $values);
|
||||
#my $res = &do_process_set_res($name, $cmd, \@result, $values);
|
||||
#if (defined($res)) {
|
||||
# last;
|
||||
#}
|
||||
}
|
||||
}
|
||||
return (\@result);
|
||||
@@ -406,14 +518,16 @@ sub do_fspapi_function {
|
||||
my @ret = ();
|
||||
my $res;
|
||||
my $args = $request->{arg};
|
||||
my @fspapi_array = qw/sysname pending_power_on_side BSR setup_failover force_failover huge_page/;
|
||||
my $invalid_node = &check_node_info($hash);
|
||||
if (defined($invalid_node)) {
|
||||
return ([[$invalid_node, "Node must be CEC or Frame", '1']]);
|
||||
}
|
||||
foreach my $arg (@$args) {
|
||||
my ($cmd, $value) = split /=/, $arg;
|
||||
if ($cmd !~ /^(sysname|pending_power_on_side)$/) {
|
||||
return ([["Error", "'$cmd' can not execute with 'sysname' or 'pending_power_on_side'", '1']]);
|
||||
if (!grep(/^$cmd$/, @fspapi_array)) {
|
||||
my $fspapi_array_string = &array_to_string(\@fspapi_array);
|
||||
return ([["Error", "'$cmd' can not execute with $fspapi_array_string", '1']]);
|
||||
}
|
||||
if ($value) {
|
||||
$res = &do_set($request, $hash, $cmd, $value)
|
||||
@@ -556,8 +670,8 @@ sub frame {
|
||||
#################################
|
||||
# Return error
|
||||
#################################
|
||||
if ( $Rc != 0 ) {
|
||||
return( [[$node,@$data[1],$Rc]] );
|
||||
if ( $Rc != 0 || @$data[1] =~ /Error/ ) {
|
||||
return( [[$node,"@$data[1]. If just set the frame number, please wait for 5-10 minutes. Otherwise, maybe other problems cause this failure.",$Rc]] );
|
||||
}
|
||||
|
||||
push @$result, [$node,@$data[1], 0];
|
||||
@@ -592,7 +706,7 @@ sub frame {
|
||||
}
|
||||
|
||||
push @$result, [$node,@$data[1], 0];
|
||||
push @$result, [$node,"It will take several minutes to complete. So please wait for several minutes, then the other operations could be done. Otherwise, the other operation will fail.", 0];
|
||||
push @$result, [$node,"It will take several minutes to complete. So please wait for 5-10 minutes, then the other operations could be done. Otherwise, the other operation will fail.", 0];
|
||||
|
||||
} else {
|
||||
#################################
|
||||
@@ -735,9 +849,10 @@ sub fsp_api_passwd {
|
||||
# Get IP address
|
||||
############################
|
||||
#$fsp_ip = xCAT::Utils::get_hdwr_ip($fsp_name);
|
||||
$fsp_ip = xCAT::Utils::getNodeIPaddress($fsp_name);
|
||||
if($fsp_ip == -1) {
|
||||
$res = "Failed to get the $fsp_name\'s ip";
|
||||
#$fsp_ip = xCAT::Utils::getNodeIPaddress($fsp_name);
|
||||
$fsp_ip = xCAT::Utils::getIPaddress($fsp_name);
|
||||
if(!defined($fsp_ip) or ($fsp_ip == -3)) {
|
||||
$res = "Failed to get IP address for $fsp_name.";
|
||||
return ([$node_name, $res, -1]);
|
||||
}
|
||||
|
||||
|
||||
@@ -221,10 +221,8 @@ sub mkhwconn_parse_args
|
||||
|
||||
if( ! exists $opt{port} )
|
||||
{
|
||||
$opt{port} = "0";
|
||||
}
|
||||
|
||||
if( $opt{port} ne "0" and $opt{port} ne "1")
|
||||
$opt{port} = "[0|1]";
|
||||
} elsif( $opt{port} ne "0" and $opt{port} ne "1")
|
||||
{
|
||||
return( usage('Wrong value of --port option. The value can be 0 or 1, and the default value is 0.'));
|
||||
}
|
||||
@@ -232,7 +230,11 @@ sub mkhwconn_parse_args
|
||||
$ppctab->close();
|
||||
#$nodetypetab->close();
|
||||
$vpdtab->close();
|
||||
|
||||
|
||||
if ( scalar( @ARGV)) {
|
||||
return(usage( "No additional flag is support by this command" ));
|
||||
}
|
||||
|
||||
$request->{method} = 'mkhwconn';
|
||||
return( \%opt);
|
||||
}
|
||||
@@ -608,11 +610,11 @@ sub lshwconn
|
||||
# push @value, [$node_name, $values, $Rc];
|
||||
# next;
|
||||
# }
|
||||
|
||||
my %rec = ();
|
||||
my @data_a = split("\n", $values);
|
||||
foreach my $data(@data_a) {
|
||||
if( $data =~ /state/) {
|
||||
$data =~ /state=([\w\s\,]+), type=([\w-]+), MTMS=([\w-\*]+), ([\w=]+), slot=([\w]+), ipadd=([\w.]+), alt_ipadd=([\w.]+)/ ;
|
||||
$data =~ /state=([\w\s\,]+), type=([\w-]+), MTMS=([\w-\*\#]+), ([\w=]+), slot=([\w]+), ipadd=([\w.]+), alt_ipadd=([\w.]+)/ ;
|
||||
#$data =~ /state=([\w\s]+),\(type=([\w-]+)\),\(serial-number=([\w]+)\),\(machinetype-model=([\w-]+)\),sp=([\w]+),\(ip-address=([\w.]+),([\w.]+)\)/ ;
|
||||
print "parsing: $1,$2,$3,$4,$5,$6,$7\n";
|
||||
my $state = $1;
|
||||
@@ -622,7 +624,11 @@ sub lshwconn
|
||||
my $slot = $5;
|
||||
my $ipadd = $6;
|
||||
my $alt_ipaddr = $7;
|
||||
$data = "$ipadd: $sp,ipadd=$ipadd,alt_ipadd=$alt_ipaddr,state=$state";
|
||||
if (exists($rec{$slot})) {
|
||||
next;
|
||||
}
|
||||
$rec{$slot} = 1;
|
||||
$data = "$sp,ipadd=$ipadd,alt_ipadd=$alt_ipaddr,state=$state";
|
||||
}
|
||||
push @value, [$node_name, $data, $Rc];
|
||||
}
|
||||
|
||||
+98
-310
@@ -2,6 +2,7 @@
|
||||
|
||||
package xCAT::FSPflash;
|
||||
use strict;
|
||||
use lib "/opt/xcat/lib/perl";
|
||||
use Getopt::Long;
|
||||
use xCAT::PPCcli qw(SUCCESS EXPECT_ERROR RC_ERROR NR_ERROR);
|
||||
use xCAT::Usage;
|
||||
@@ -13,15 +14,10 @@ use File::Spec;
|
||||
use xCAT::PPCrflash;
|
||||
#use Data::Dumper;
|
||||
use xCAT::FSPUtils;
|
||||
use xCAT::FSPinv;
|
||||
use POSIX "WNOHANG";
|
||||
use Storable qw(freeze thaw);
|
||||
use Thread qw(yield);
|
||||
|
||||
my $packages_dir= ();
|
||||
my $activate = ();
|
||||
my $verbose = 0;
|
||||
$::POWER_DEST_DIR = "/tmp";
|
||||
my $release_level;
|
||||
my $active_level;
|
||||
my @dirlist;
|
||||
@@ -172,180 +168,6 @@ sub get_lic_filenames {
|
||||
}
|
||||
|
||||
|
||||
sub get_one_mtms {
|
||||
my $exp = shift;
|
||||
my $bpa = shift;
|
||||
my $cmd = "lssyscfg -r cage -e $bpa";
|
||||
my $mtms;
|
||||
my $msg;
|
||||
|
||||
my $values = xCAT::PPCcli::send_cmd( $exp, $cmd );
|
||||
my $Rc = shift(@$values);
|
||||
|
||||
#####################################
|
||||
# Return error
|
||||
#####################################
|
||||
if ( $Rc != SUCCESS ) {
|
||||
$msg = "ERROR: Failed to find a CEC managed by $bpa on the HMC";
|
||||
return ("", $msg);
|
||||
}
|
||||
|
||||
foreach (@$values) {
|
||||
if( $_ =~ /cage_num=(\w*),contents=sys,type_model_serial_num=(\w+)-(\w+)\*(\w+),loc_code=(\w+).(\w+).(\w+)/) {
|
||||
$mtms = "$2-$3*$4";
|
||||
last;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#print "the managed system is $mtms!\n";
|
||||
return ($mtms, $msg);
|
||||
}
|
||||
|
||||
sub process_node {
|
||||
my $req = shift;
|
||||
my $node = shift;
|
||||
|
||||
my $tab = xCAT::Table->new("vpd");
|
||||
my $msg;
|
||||
unless ($tab) {
|
||||
$msg = "ERROR: Unable to open basic ppc table for configuration";
|
||||
return ("", $msg);
|
||||
}
|
||||
|
||||
print "in process_node1, node $node\n";
|
||||
#print Dumper($node);
|
||||
my $ent = $tab->getNodeAttribs($node, ['serial', 'mtm']);
|
||||
#print "in process_node\n";
|
||||
#print Dumper($ent);
|
||||
|
||||
my $serial = $ent->{'serial'};
|
||||
my $mtm = $ent->{'mtm'};
|
||||
#################################
|
||||
#Get node
|
||||
#################################
|
||||
#print "in get_related_fsp_bpa(), serial = $serial, mtm= $mtm\n";
|
||||
my @ents = $tab->getAllAttribsWhere("serial=\"$serial\" and mtm=\"$mtm\"", 'node');
|
||||
if (@ents < 0) {
|
||||
$msg = "failed to get the FSPs or BPAs whose mtm is $mtm, serial is $serial!";
|
||||
return ("", $msg);
|
||||
}
|
||||
my $e;
|
||||
#print Dumper(@ents);
|
||||
foreach $e (@ents) {
|
||||
if($e->{node} ne $node) {
|
||||
# push @{$req->{node}},$e->{node};
|
||||
push @{$req->{noderange}},$e->{node};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sub get_related_fsp_bpa {
|
||||
my $mtm = shift;
|
||||
my $serial = shift;
|
||||
my $tab = xCAT::Table->new("vpd");
|
||||
my $msg;
|
||||
unless ($tab) {
|
||||
$msg = "ERROR: Unable to open basic ppc table for configuration";
|
||||
return ("", $msg);
|
||||
}
|
||||
#################################
|
||||
#Get node
|
||||
#################################
|
||||
print "in get_related_fsp_bpa(), serial = $serial, mtm= $mtm\n";
|
||||
my @ent = $tab->getAllAttribsWhere("\"serial\" like '%".$serial."%' and \"mtm\" like '%".$mtm."%'", 'node');
|
||||
if (@ent < 0) {
|
||||
$msg = "failed to get the FSPs or BPAs whose mtm is $mtm, serial is $serial!";
|
||||
return ("", $msg);
|
||||
}
|
||||
return(\@ent);
|
||||
|
||||
}
|
||||
|
||||
sub get_hcp_id {
|
||||
my $node = shift;
|
||||
|
||||
my $tab = xCAT::Table->new("ppc");
|
||||
my $msg;
|
||||
unless ($tab) {
|
||||
$msg = "ERROR: Unable to open basic ppc table for configuration";
|
||||
return ("", $msg);
|
||||
}
|
||||
#################################
|
||||
#Get node
|
||||
#################################
|
||||
my @ent = $tab->getNodeAttribs($node, ['hcp', 'id']);
|
||||
if (@ent < 0) {
|
||||
$msg = "failed to get the hcp and id of $node!";
|
||||
return ("", $msg);
|
||||
}
|
||||
return($ent[0]->{hcp}, $ent[0]->{id});
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
##########################################################################
|
||||
# Forks a process to run the action command
|
||||
##########################################################################
|
||||
sub fork_cmd {
|
||||
|
||||
my $node_name = shift;
|
||||
my $attrs = shift;
|
||||
my $action = shift;
|
||||
my $pipe ;
|
||||
|
||||
#######################################
|
||||
# Pipe childs output back to parent
|
||||
#######################################
|
||||
my $parent;
|
||||
my $child;
|
||||
pipe $parent, $child;
|
||||
my $pid = xCAT::Utils->xfork;
|
||||
my $res;
|
||||
|
||||
if ( !defined($pid) ) {
|
||||
###################################
|
||||
# Fork error
|
||||
###################################
|
||||
print "Fork error:!";
|
||||
return undef;
|
||||
}
|
||||
elsif ( $pid == 0 ) {
|
||||
###################################
|
||||
# Child process
|
||||
###################################
|
||||
close( $parent );
|
||||
$pipe = $child;
|
||||
|
||||
$res = xCAT::FSPUtils::fsp_api_action( $node_name, $attrs, $action );
|
||||
#print "res\n";
|
||||
#print Dumper($res);
|
||||
my %output;
|
||||
$output{node} = $node_name;
|
||||
$output{ret} = @$res[2];
|
||||
$output{contents} = @$res[1];
|
||||
# print $pipe %output;
|
||||
# print $pipe freeze(\%output);
|
||||
my @outhash;
|
||||
push @outhash,\%output;
|
||||
print $pipe freeze([@outhash]);
|
||||
# print $pipe "good";
|
||||
print $pipe "\nENDOFFREEZE6sK4ci\n";
|
||||
exit(0);
|
||||
}
|
||||
else {
|
||||
###################################
|
||||
# Parent process
|
||||
###################################
|
||||
close( $child );
|
||||
return( $parent, $pid );
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
##########################
|
||||
#Performs Licensed Internal Code (LIC) update support for HMC-attached POWER5 and POWER6 Systems
|
||||
@@ -423,144 +245,111 @@ sub rflash {
|
||||
if($flag2 > 1) {
|
||||
last;
|
||||
}
|
||||
my $values = xCAT::FSPUtils::fsp_api_action( $name, $d, "list_firmware_level");
|
||||
# my $level = xCAT::PPCcli::lslic( $exp, $d, $timeout );
|
||||
my $Rc = @$values[2];
|
||||
my $level = @$values[1];
|
||||
#####################################
|
||||
# Return error
|
||||
#####################################
|
||||
if ( $Rc != SUCCESS ) {
|
||||
push @value, [$name,$level,$Rc];
|
||||
next;
|
||||
}
|
||||
|
||||
if( !defined($housekeeping) && ($$d[4] =~ /^fsp$/ || $$d[4] =~ /^lpar$/ || $$d[4] =~ /^cec$/)) {
|
||||
$action = "get_compatible_version_from_rpm";
|
||||
my $values = xCAT::FSPUtils::fsp_api_action( $name, $d, $action, 0, $request->{opt}->{d} );
|
||||
my $Rc = @$values[2];
|
||||
my $v = @$values[1];
|
||||
if ($Rc != 0) {
|
||||
push @value, [$name, $v, -1];
|
||||
return (\@value);
|
||||
}
|
||||
|
||||
#if( $v !~ "nocheckversion") {
|
||||
my @levels = split(/,/, $v);
|
||||
|
||||
my $frame = $$d[5];
|
||||
if ( $frame ne $name ) {
|
||||
|
||||
my @frame_d = (0, 0, 0, $frame, "frame", 0);
|
||||
$action = "list_firmware_level";
|
||||
$values = xCAT::FSPUtils::fsp_api_action( $frame, \@frame_d, $action );
|
||||
$Rc = @$values[2];
|
||||
my $frame_firmware_level = @$values[1];
|
||||
if ($Rc != 0) {
|
||||
push @value, [$frame, $frame_firmware_level, -1];
|
||||
return (\@value);
|
||||
}
|
||||
|
||||
my $level_a;
|
||||
my $level_b;
|
||||
if( $frame_firmware_level =~ /curr_level_a=(\d{3}),curr_ecnumber_a=02(\w{5})/) {
|
||||
$level_a = "$2_$1";
|
||||
}
|
||||
|
||||
if( $frame_firmware_level =~ /curr_level_b=(\d{3}),curr_ecnumber_b=02(\w{5})/) {
|
||||
$level_b = "$2_$1";
|
||||
}
|
||||
|
||||
#print "frame_firmware_level=$frame_firmware_level,level_a=$level_a,level_b=$level_b\n";
|
||||
foreach my $l (@levels) {
|
||||
#print "rpm requires: $l\n" ;
|
||||
if( (defined($level_a) && ( $l gt $level_a )) || (defined($level_b) && ( $l gt $level_b )) ) {
|
||||
my $res = "New Managed System level for $name is not compatible with current Power Subsystem level 02$level_a on $frame.\nPower Subsystem level 02$l or later is required.";
|
||||
|
||||
push @value, [$name, $res, -1];
|
||||
return (\@value);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
#}
|
||||
|
||||
}
|
||||
|
||||
if(!defined($housekeeping)) {
|
||||
my $values = xCAT::FSPUtils::fsp_api_action( $name, $d, "list_firmware_level");
|
||||
my $Rc = @$values[2];
|
||||
my $level = @$values[1];
|
||||
#####################################
|
||||
# Return error
|
||||
#####################################
|
||||
if ( $Rc != SUCCESS ) {
|
||||
push @value, [$name,$level,$Rc];
|
||||
next;
|
||||
}
|
||||
|
||||
if (( $level =~ /curr_level_primary/ ) || ( $level =~ /curr_level_a/ )) {
|
||||
$role = 0x01;
|
||||
} else {
|
||||
$role = 0x02;
|
||||
}
|
||||
|
||||
if ( $level =~ /ecnumber=(\w+)/ ) {
|
||||
$release_level = $1;
|
||||
&dpush( \@value, [$name,"$mtms :release level:$1"]);
|
||||
}
|
||||
if ( $level =~ /ecnumber=(\w+)/ ) {
|
||||
$release_level = $1;
|
||||
&dpush( \@value, [$name,"$mtms :release level:$1"]);
|
||||
}
|
||||
|
||||
if ( $level =~ /activated_level=(\w+)/ ) {
|
||||
$active_level = $1;
|
||||
&dpush( \@value, [$name,"$mtms :activated level:$1"]);
|
||||
}
|
||||
|
||||
if($housekeeping =~ /^commit$/) { $action = "code_commit"}
|
||||
if($housekeeping =~ /^recover$/) { $action = "code_reject"}
|
||||
if($activate =~ /^disruptive$/) { $action = "code_update"}
|
||||
if($activate =~ /^concurrent$/) {
|
||||
my $res = "\'concurrent\' option not supported in FSPflash.Please use disruptive mode";
|
||||
push @value, [$name, $res, -1];
|
||||
if ( $level =~ /activated_level=(\w+)/ ) {
|
||||
$active_level = $1;
|
||||
&dpush( \@value, [$name,"$mtms :activated level:$1"]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
if($housekeeping =~ /^commit$/) { $action = "code_commit"}
|
||||
if($housekeeping =~ /^recover$/) { $action = "code_reject"}
|
||||
if($activate =~ /^disruptive$/) {
|
||||
$action = "code_update";
|
||||
}
|
||||
if($activate =~ /^concurrent$/) {
|
||||
my $res = "\'concurrent\' option not supported in FSPflash.Please use disruptive mode";
|
||||
push @value, [$name, $res, -1];
|
||||
next;
|
||||
}
|
||||
}
|
||||
|
||||
my $msg;
|
||||
if(!defined($housekeeping)) {
|
||||
my $flag = 0;
|
||||
($rpm_file, $xml_file, $upgrade_required,$msg, $flag) = &get_lic_filenames($mtms);
|
||||
if( $flag == -1) {
|
||||
push (@value, [$name,"$mtms: $msg"]);
|
||||
push (@value, [$name,"Failed to upgrade the firmware of $name"]);
|
||||
return (\@value);
|
||||
}
|
||||
dpush ( \@value, [$name, $msg]);
|
||||
}
|
||||
|
||||
my $res = xCAT::FSPUtils::fsp_api_action( $name, $d, $action );
|
||||
push(@value,[$name, @$res[1], @$res[2]]);
|
||||
return (\@value);
|
||||
|
||||
my $nodes = get_related_fsp_bpa( $mtm, $serial);
|
||||
#print Dumper($nodes);
|
||||
my $i = 0;
|
||||
my $flag = 0;
|
||||
my $c = @$nodes;
|
||||
my $name2 = undef;
|
||||
my @dt;
|
||||
if ($c == 1 && $role == 0x01 ) {
|
||||
|
||||
}
|
||||
if ($c == 1 && $role == 0x02 ) {
|
||||
|
||||
push(@result,[$name, "$name\'s role is Backup FSP or BPC side B). Please configure the Primary FSP or BPC side A.", -1]);
|
||||
}
|
||||
if($c == 2 && $role == 0x01 ) {
|
||||
if($$nodes[0]->{node} eq $name) {
|
||||
$i = 0;
|
||||
$name2 = $$nodes[1]->{node}; #Secondary FSP or BPC side B.
|
||||
} else {
|
||||
#$name2 = $name; #Secondary FSP or BPC side B.
|
||||
$name2 = $$nodes[0]->{node}; #the Primary FSP or BPC side A.
|
||||
}
|
||||
my($hcp, $id) = get_hcp_id($name2);
|
||||
@dt = ($id, @$d[1], $mtms, $hcp, @$d[4], 0);
|
||||
}
|
||||
|
||||
if($c ==2 && $role == 0x02) {
|
||||
if($$nodes[0]->{node} eq $name) {
|
||||
$name2 = $name; # Secondary FSP or BPC side B.
|
||||
$name = $$nodes[1]->{node};#the Primary FSP or BPC side A.
|
||||
} else {
|
||||
$name2 = $name; # Secondary FSP or BPC side B.
|
||||
$name = $$nodes[0]->{node}; #primary FSP or BPC side B.
|
||||
}
|
||||
@dt = (@$d[0], @$d[1], @$d[2], @$d[3], @$d[4], @$d[5]);
|
||||
my($hcp, $id) = get_hcp_id($name);
|
||||
@$d = ($id, $dt[1], $mtms, $hcp, $dt[4], 0);
|
||||
}
|
||||
print "name: $name, name2: $name2\n";
|
||||
|
||||
my $children = 0;
|
||||
$SIG{CHLD} = sub { while (waitpid(-1, WNOHANG) > 0) {print "child exit\n";$children--;} };
|
||||
my $fds = new IO::Select;
|
||||
my $pipe;
|
||||
if(defined($name2) ) {
|
||||
#my($hcp, $id) = get_hcp_id($name2);
|
||||
#my @dt = ($id, @$d[1], $mtms, $hcp, @$d[4], 0);
|
||||
|
||||
($pipe) = fork_cmd( $name2, \@dt, $action );
|
||||
|
||||
if ( $pipe ) {
|
||||
$fds->add( $pipe );
|
||||
$children++;
|
||||
my $flag = 0;
|
||||
($rpm_file, $xml_file, $upgrade_required,$msg, $flag) = &get_lic_filenames($mtms);
|
||||
if( $flag == -1) {
|
||||
push (@value, [$name,"$mtms: $msg"]);
|
||||
push (@value, [$name,"Failed to upgrade the firmware of $name"]);
|
||||
return (\@value);
|
||||
}
|
||||
sleep(5);
|
||||
}
|
||||
$pipe = undef;
|
||||
($pipe) = fork_cmd( $name, $d, $action );
|
||||
|
||||
if ( $pipe ) {
|
||||
$fds->add( $pipe );
|
||||
$children++;
|
||||
dpush ( \@value, [$name, $msg]);
|
||||
}
|
||||
print "count:\n";
|
||||
print $fds->count;
|
||||
print "children:$children\n";
|
||||
while ( $fds->count > 0 or $children > 0 ) {
|
||||
my @ready_fds = $fds->can_read(1);
|
||||
foreach my $rfh (@ready_fds) {
|
||||
my $val = <$rfh>;
|
||||
if( defined($val)) {
|
||||
while($val !~ /ENDOFFREEZE6sK4ci/) {
|
||||
$val .= <$rfh>;
|
||||
}
|
||||
my $resp = thaw($val);
|
||||
foreach my $t( @$resp ) {
|
||||
#print Dumper($t);
|
||||
push @result, [$t->{node}, $t->{contents}, $t->{ret}];
|
||||
}
|
||||
next;
|
||||
}
|
||||
$fds->remove($rfh);
|
||||
close($rfh);
|
||||
}
|
||||
}
|
||||
|
||||
my $res = xCAT::FSPUtils::fsp_api_action( $name, $d, $action, 0, $request->{opt}->{d} );
|
||||
push(@value,[$name, @$res[1], @$res[2]]);
|
||||
return (\@value);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -568,7 +357,6 @@ sub rflash {
|
||||
return (\@value);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
+57
-19
@@ -66,7 +66,7 @@ sub parse_args {
|
||||
$Getopt::Long::ignorecase = 0;
|
||||
Getopt::Long::Configure( "bundling" );
|
||||
|
||||
if ( !GetOptions( \%opt, qw(V|Verbose) )) {
|
||||
if ( !GetOptions( \%opt, qw(V|Verbose x) )) {
|
||||
return( usage() );
|
||||
}
|
||||
####################################
|
||||
@@ -89,6 +89,9 @@ sub parse_args {
|
||||
if ( defined( $ARGV[0] )) {
|
||||
return(usage( "Invalid Argument: $ARGV[0]" ));
|
||||
}
|
||||
if (exists($opt{x}) and $cmd !~ /^deconfig$/) {
|
||||
return (usage("Option '-x' can't work with '$cmd'"));
|
||||
}
|
||||
####################################
|
||||
# Set method to invoke
|
||||
####################################
|
||||
@@ -268,28 +271,63 @@ sub deconfig {
|
||||
$decfg = XMLin($data);
|
||||
};
|
||||
if( $@ ) {
|
||||
push @result,[$name, "Error: there are some unreadable XML data from the firmware. Please check with the data provider.", -1];
|
||||
push @result,[$name, "Error: there are some unreadable XML data from the firmware. It can't be parsed by 'xcatd'.", -1];
|
||||
return (\@result);
|
||||
}
|
||||
if( exists($request->{opt}->{x})) {
|
||||
push @result, [$name, "\n".$data, -1];
|
||||
next;
|
||||
}
|
||||
#print "decfg";
|
||||
#print Dumper($decfg);
|
||||
my $node = $decfg->{NODE};
|
||||
if( defined($node) && exists($node->{Location_code}) ) {
|
||||
my $Call_Out_Hardware_State ;
|
||||
my $Call_Out_Method;
|
||||
my $Location_code;
|
||||
my $RID;
|
||||
my $TYPE;
|
||||
if(ref($node->{GARDRECORD}) ne "ARRAY") {
|
||||
push @result,[$name,"NO Deconfigured resources", 0];
|
||||
return( \@result );
|
||||
}
|
||||
push @result,[$name,"Deconfigured resources", 0];
|
||||
push @result,[$name,"Location_code RID Call_Out_Method Call_Out_Hardware_State TYPE", 0];
|
||||
push @result,[$name,"$node->{Location_code} $node->{RID}", 0];
|
||||
foreach my $unit(@{$node->{GARDRECORD}}) {
|
||||
|
||||
my $node = $decfg->{NODE};
|
||||
if( defined($node) && exists($node->{Location_code}) ) {
|
||||
push @result,[$name,"Deconfigured resources", 0];
|
||||
push @result,[$name,"Location_code RID Call_Out_Method Call_Out_Hardware_State TYPE", 0];
|
||||
push @result,[$name,"$node->{Location_code} $node->{RID}", 0];
|
||||
foreach my $unit(@{$node->{GARDRECORD}}) {
|
||||
my $Call_Out_Hardware_State = $unit->{GARDUNIT}->{Call_Out_Hardware_State};
|
||||
my $Call_Out_Method = $unit->{GARDUNIT}->{Call_Out_Method};
|
||||
my $Location_code = $unit->{GARDUNIT}->{Location_code};
|
||||
my $RID = $unit->{GARDUNIT}->{RID};
|
||||
my $TYPE = $unit->{GARDUNIT}->{TYPE};
|
||||
while (my ($key, $unit3) = each(%$unit) ) {
|
||||
|
||||
if($key eq "GARDUNIT") {
|
||||
if (ref($unit3) eq "HASH") {
|
||||
$Call_Out_Hardware_State = $unit3->{Call_Out_Hardware_State};
|
||||
$Call_Out_Method = $unit3->{Call_Out_Method};
|
||||
$Location_code = $unit3->{Location_code};
|
||||
$RID = $unit3->{RID};
|
||||
$TYPE = $unit3->{TYPE};
|
||||
|
||||
push @result,[$name,"$Location_code $RID $Call_Out_Method $Call_Out_Hardware_State $TYPE",0];
|
||||
} elsif(ref($unit3) eq "ARRAY") {
|
||||
|
||||
foreach my $unit4(@$unit3) {
|
||||
$Call_Out_Hardware_State = $unit4->{Call_Out_Hardware_State};
|
||||
$Call_Out_Method = $unit4->{Call_Out_Method};
|
||||
$Location_code = $unit4->{Location_code};
|
||||
$RID = $unit4->{RID};
|
||||
$TYPE = $unit4->{TYPE};
|
||||
push @result,[$name,"$Location_code $RID $Call_Out_Method $Call_Out_Hardware_State $TYPE",0];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
push @result,[$name,"NO Deconfigured resources", 0];
|
||||
}
|
||||
|
||||
push @result,[$name,"$Location_code $RID $Call_Out_Method $Call_Out_Hardware_State $TYPE",0];
|
||||
}
|
||||
|
||||
} else {
|
||||
push @result,[$name,"NO Deconfigured resources", 0];
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+96
-25
@@ -7,6 +7,7 @@ use xCAT::PPCcli qw(SUCCESS EXPECT_ERROR RC_ERROR NR_ERROR);
|
||||
use xCAT::PPCpower;
|
||||
use xCAT::FSPUtils;
|
||||
#use Data::Dumper;
|
||||
|
||||
##########################################################################
|
||||
# Parse the command line for options and operands
|
||||
##########################################################################
|
||||
@@ -132,6 +133,14 @@ sub powercmd_boot {
|
||||
my $state = power_status($data);
|
||||
#print "boot:state:$state\n";
|
||||
my $op = ($state =~ /^off$/) ? "on" : "reset";
|
||||
|
||||
# Attribute powerinterval in site table,
|
||||
# to control the rpower speed
|
||||
if( defined($request->{'powerinterval'}) ) {
|
||||
Time::HiRes::sleep($request->{'powerinterval'});
|
||||
}
|
||||
|
||||
|
||||
$res = xCAT::FSPUtils::fsp_api_action ($node_name, $d, $op);
|
||||
|
||||
# @output ...
|
||||
@@ -158,8 +167,15 @@ sub powercmd {
|
||||
my $hash = shift;
|
||||
my @result = ();
|
||||
my @output;
|
||||
my $action = $request->{'op'};
|
||||
|
||||
my $action;
|
||||
my $node_name;
|
||||
my $newids;
|
||||
my $newnames;
|
||||
my $newd;
|
||||
my $lpar_flag = 0;
|
||||
my $cec_flag = 0;
|
||||
my $frame_flag = 0;
|
||||
|
||||
#print "++++in powercmd++++\n";
|
||||
#print Dumper($hash);
|
||||
|
||||
@@ -180,14 +196,19 @@ sub powercmd {
|
||||
# ]
|
||||
# };
|
||||
|
||||
foreach my $node_name ( keys %$hash)
|
||||
foreach $node_name ( keys %$hash)
|
||||
{
|
||||
$action = $request->{'op'};
|
||||
my $d = $hash->{$node_name};
|
||||
if ($$d[4] =~ /^lpar$/) {
|
||||
if( !($action =~ /^(on|off|of|reset|sms)$/)) {
|
||||
push @output, [$node_name, "\'$action\' command not supported for LPAR", -1 ];
|
||||
return (\@output);
|
||||
}
|
||||
$newids .= "$$d[0],";
|
||||
$newnames .="$node_name,";
|
||||
$newd = $d;
|
||||
$lpar_flag = 1;
|
||||
} elsif ($$d[4] =~ /^(fsp|cec)$/) {
|
||||
if($action =~ /^on$/) { $action = "cec_on_autostart"; }
|
||||
if($action =~ /^off$/) { $action = "cec_off"; }
|
||||
@@ -195,39 +216,77 @@ sub powercmd {
|
||||
if($action =~ /^lowpower$/) { $action = "cec_on_low_power"; }
|
||||
if($action !~ /^cec_on_autostart$/ && $action !~ /^cec_off$/ && $action !~ /^cec_on_low_power$/ && $action !~ /^onstandby$/ && $action !~ /^reboot_service_processor$/ ) {
|
||||
push @output, [$node_name, "\'$action\' command not supported for CEC", -1 ];
|
||||
#return (\@output);
|
||||
next;
|
||||
}
|
||||
next;
|
||||
}
|
||||
$newids = $$d[0];
|
||||
$newnames = $node_name;
|
||||
$newd = $d;
|
||||
$cec_flag = 1;
|
||||
} else {
|
||||
if ( $action =~ /^rackstandby$/) {
|
||||
$action = "enter_rack_standby";
|
||||
} elsif ( $action=~/^exit_rackstandby$/) {
|
||||
$action = "exit_rack_standby";
|
||||
} else {
|
||||
} elsif ($action =~ /^resetsp$/) {
|
||||
$action = "reboot_service_processor";
|
||||
} else {
|
||||
push @output, [$node_name, "$node_name\'s type isn't fsp or lpar. Not allow doing this operation", -1 ];
|
||||
#return (\@output);
|
||||
next;
|
||||
}
|
||||
$newids = $$d[0];
|
||||
$newnames = $node_name;
|
||||
$newd = $d;
|
||||
$frame_flag = 1;
|
||||
}
|
||||
my $res = xCAT::FSPUtils::fsp_api_action($node_name, $d, $action );
|
||||
# print "In boot, state\n";
|
||||
# print Dumper($res);
|
||||
my $Rc = @$res[2];
|
||||
my $data = @$res[1];
|
||||
#my $type = @$d[4];
|
||||
#my $id = ($type=~/^(fsp|bpa)$/) ? $type : @$d[0];
|
||||
|
||||
##################################
|
||||
# Output error
|
||||
##################################
|
||||
if ( $Rc != SUCCESS ) {
|
||||
push @output, [$node_name,$data,$Rc];
|
||||
# next;
|
||||
} else {
|
||||
push @output, [$node_name,"Success",$Rc];
|
||||
|
||||
if( $lpar_flag && $cec_flag) {
|
||||
push @output, [$node_name," $node_name\'s type is different from the last node. The noderange of power control operation could NOT be lpar/cec mixed" , -1 ];
|
||||
return (\@output);
|
||||
|
||||
}
|
||||
|
||||
if( $lpar_flag && $frame_flag) {
|
||||
push @output, [$node_name," $node_name\'s type is different from the last node. The noderange of power control operation could NOT be lpar/frame mixed" , -1 ];
|
||||
return (\@output);
|
||||
|
||||
}
|
||||
|
||||
if( $cec_flag && $frame_flag) {
|
||||
push @output, [$node_name," $node_name\'s type is different from the last node. The noderange of power control operation could NOT be cec/frame mixed" , -1 ];
|
||||
return (\@output);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$$newd[0] = $newids;
|
||||
|
||||
#print Dumper($newd);
|
||||
|
||||
my $res = xCAT::FSPUtils::fsp_api_action($newnames, $newd, $action, 0, $request->{'powerinterval'} );
|
||||
# print "In boot, state\n";
|
||||
# print Dumper($res);
|
||||
my $Rc = @$res[2];
|
||||
my $data = @$res[1];
|
||||
|
||||
foreach $node_name ( keys %$hash)
|
||||
{
|
||||
my $d = $hash->{$node_name};
|
||||
|
||||
if( $data =~ /Error/) {
|
||||
if( $data =~ /Power interval/) {
|
||||
$data = "Error: Invalid powerinterval value in the site table. The valid powerinerval value could be 0 to 300 .";
|
||||
push @output, [$node_name, $data, -1];
|
||||
next;
|
||||
} elsif ( $data =~ /$node_name/) {
|
||||
push @output, [$node_name, $data, -1];
|
||||
next;
|
||||
}
|
||||
}
|
||||
push @output, [$node_name,"Success", 0];
|
||||
}
|
||||
|
||||
return( \@output );
|
||||
|
||||
}
|
||||
@@ -327,8 +386,20 @@ sub state {
|
||||
# Node not found
|
||||
##################################
|
||||
if ( !exists( $data->{$id} )) {
|
||||
push @result, [$name, $prefix."Node not found",1];
|
||||
next;
|
||||
my $res = xCAT::FSPUtils::fsp_api_action($name, $d, "state");
|
||||
my $rc = @$res[2];
|
||||
my $val = @$res[1];
|
||||
if( $rc != 0) {
|
||||
push @result, [$name, $prefix.$val,1];
|
||||
}
|
||||
|
||||
if( !defined($val) || $val =~ /^error$/ ) {
|
||||
push @result, [$name, $prefix."Node not found",1];
|
||||
next;
|
||||
} else {
|
||||
$data->{$id} = $val;
|
||||
}
|
||||
|
||||
}
|
||||
##################################
|
||||
# Output value
|
||||
|
||||
+14
-11
@@ -23,9 +23,10 @@ my @header = (
|
||||
["name", "placeholder" ],
|
||||
["id", "%-8s" ],
|
||||
["type-model", "%-12s" ],
|
||||
["serial-number", "%-15s" ],
|
||||
["side", "%-8s" ],
|
||||
["address", "%-20s\n" ]);
|
||||
["serial-number", "%-15s\n" ]);
|
||||
#,
|
||||
# ["side", "%-8s" ],
|
||||
# ["address", "%-20s\n" ]);
|
||||
|
||||
my @attribs = qw(nodetype node id mtm serial side hcp pprofile parent groups mgt cons hwtype);
|
||||
my %globalnodetype = (
|
||||
@@ -152,15 +153,15 @@ sub enumerate {
|
||||
my $ip_s = $8;
|
||||
if(! defined( $ips)) {
|
||||
if( $ip_s =~ /unavailable/ ) {
|
||||
$ips ="$ip;";
|
||||
$ips ="$ip";
|
||||
} else {
|
||||
$ips ="$ip;$ip_s;";
|
||||
$ips ="$ip;$ip_s";
|
||||
}
|
||||
} else {
|
||||
if( $ip_s =~ /unavailable/ ) {
|
||||
$ips .="$ip";
|
||||
$ips .=";$ip";
|
||||
} else {
|
||||
$ips .="$ip;$ip_s";
|
||||
$ips .=";$ip;$ip_s";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -173,7 +174,8 @@ sub enumerate {
|
||||
$side="";
|
||||
}
|
||||
push @values, join( ",",
|
||||
$$d[4],$node_name,$cageid,$model,$serial,$side, $server,$prof,$fname, $ips, $$d[4]);
|
||||
$$d[4],$node_name,$cageid,$model,$serial,$side, $server,$prof,$fname);
|
||||
#$$d[4],$node_name,$cageid,$model,$serial,$side, $server,$prof,$fname, $ips, $$d[4]);
|
||||
# $$d[4],$node_name,$cageid,$model,$serial,$side, $server,$prof,$fname, $7);
|
||||
# "fsp",$node_name,$cageid,$model,$serial,$side, $server,$prof,$fname, $7);
|
||||
#"fsp",$fsp,$cageid,$model,$serial,$side,$server,$prof,$fname,$ips );
|
||||
@@ -204,14 +206,15 @@ sub enumerate {
|
||||
my $server = $fsp;
|
||||
my $ips = "";
|
||||
my $port = "";
|
||||
$name =~ s/\-//g;
|
||||
$name =~ tr/A-Z/a-z/;
|
||||
# $name =~ s/\-//g;
|
||||
# $name =~ tr/A-Z/a-z/;
|
||||
|
||||
#####################################
|
||||
# Save LPAR information
|
||||
#####################################
|
||||
push @values, join( ",",
|
||||
"lpar",$name,$lparid,$model,$serial,$port,$server,$prof,$fsp,$ips,"lpar" );
|
||||
"lpar",$name,$lparid,$model,$serial,$port,$server,$prof,$fsp );
|
||||
#"lpar",$name,$lparid,$model,$serial,$port,$server,$prof,$fsp,$ips,"lpar" );
|
||||
|
||||
}
|
||||
|
||||
|
||||
+230
-92
@@ -4,7 +4,7 @@ BEGIN
|
||||
{
|
||||
$::XCATROOT = $ENV{'XCATROOT'} ? $ENV{'XCATROOT'} : '/opt/xcat';
|
||||
}
|
||||
|
||||
|
||||
|
||||
package xCAT::FSPvm;
|
||||
use lib "$::XCATROOT/lib/perl";
|
||||
@@ -47,26 +47,38 @@ sub parse_args {
|
||||
##########################################################################
|
||||
# Parse the chvm command line for options and operands
|
||||
##########################################################################
|
||||
sub chvm_parse_lparname {
|
||||
my $args = shift;
|
||||
my $opt = shift;
|
||||
if ((ref($args) ne 'ARRAY') ||
|
||||
(scalar(@$args) > '1')){
|
||||
return "@$args";
|
||||
}
|
||||
my ($cmd, $value) = split(/\=/, $args->[0]);
|
||||
if ($cmd !~ /^lparname$/) {
|
||||
return "'$cmd' not support";
|
||||
}
|
||||
if (!defined($value)) {
|
||||
return "value not specified";
|
||||
}
|
||||
$opt->{$cmd} = $value;
|
||||
if ($value && $value ne '*' && $value !~ /^[a-zA-Z0-9-_]+$/) {
|
||||
return "'$value' invalid";
|
||||
}
|
||||
return undef;
|
||||
|
||||
sub chvm_parse_extra_options {
|
||||
my $args = shift;
|
||||
my $opt = shift;
|
||||
if (ref($args) ne 'ARRAY') {
|
||||
return "$args";
|
||||
}
|
||||
foreach (@$args) {
|
||||
my ($cmd, $value) = split (/\=/, $_);
|
||||
if (!defined($value)) {
|
||||
return "no value specified";
|
||||
}
|
||||
if ($cmd =~ /^lparname$/) {
|
||||
if ($value ne '*' && $value !~ /^[a-zA-Z0-9-_]$/) {
|
||||
return "'$value' invalid";
|
||||
}
|
||||
my $len = rindex $value."\$", "\$";
|
||||
if ($len > '47') {
|
||||
return "'$value' is too long, max 47 characters";
|
||||
}
|
||||
# } elsif ($cmd =~ /^huge_page$/) {
|
||||
# if ($value !~ /^\d+\/\d+\/\d+$/) {
|
||||
# return "'$value' invalid";
|
||||
# }
|
||||
} else {
|
||||
return "'$cmd' not support";
|
||||
}
|
||||
$opt->{$cmd} = $value;
|
||||
}
|
||||
return undef;
|
||||
}
|
||||
|
||||
sub chvm_parse_args {
|
||||
|
||||
my $request = shift;
|
||||
@@ -201,7 +213,7 @@ sub chvm_parse_args {
|
||||
return(usage( "Invalid entry: $opt{m}.\n For Power 775, the pending memory interleaving mode only could be interleaved(or 1), or non-interleaved(or 2)." ));
|
||||
}
|
||||
} else {
|
||||
$opt{m} = 2 ;# non-interleaved, which is the default
|
||||
$opt{m} = 1 ;# interleaved, which is the default
|
||||
}
|
||||
|
||||
my @ratio = (1, 2, 3, 4, 5);
|
||||
@@ -294,20 +306,15 @@ sub chvm_parse_args {
|
||||
# Check for an extra argument
|
||||
####################################
|
||||
if ( defined( $ARGV[0] )) {
|
||||
my $check_chvm_lpar_arg = chvm_parse_lparname(\@ARGV, \%opt);
|
||||
if (defined($check_chvm_lpar_arg)) {
|
||||
return (usage("Invalid argument: $check_chvm_lpar_arg"));
|
||||
my $check_chvm_arg = chvm_parse_extra_options(\@ARGV, \%opt);
|
||||
if (defined($check_chvm_arg)) {
|
||||
return (usage("Invalid argument: $check_chvm_arg"));
|
||||
} elsif (($opt{lparname} ne '*') && (scalar(@{$request->{node}}) > '1')){
|
||||
return(usage( "Invalid argument: must specify '*' for more than one node" ));
|
||||
} else {
|
||||
my $len = rindex $opt{lparname}."\$", "\$";
|
||||
if ($len > '47') {
|
||||
return (usage("Invalid lparname '$opt{lparname}', name is too long, max 47 characters"));
|
||||
}
|
||||
}
|
||||
if (exists($opt{lparname}) &&
|
||||
(exists($opt{p}) || exists($opt{i}) || exists($opt{m}) || exists($opt{r}))) {
|
||||
return (usage("lparname should NOT be used with -p, -i, -m or -r."));
|
||||
if ((exists($opt{lparname}) ||exists($opt{huge_page})) &&
|
||||
(exists($opt{p}) || exists($opt{i}) || exists($opt{r}))) {
|
||||
return (usage("lparname should NOT be used with -p, -i or -r."));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -617,20 +624,29 @@ sub modify {
|
||||
my $usage_string = xCAT::Usage->getUsage($request->{command});
|
||||
return modify_by_prof( $request, $hash) if ( $request->{opt}->{p} || $request->{stdin});
|
||||
return create( $request, $hash) if ( $request->{opt}->{i});
|
||||
return op_lparname ($request, $hash) if ($request->{opt}->{lparname});
|
||||
return op_extra_cmds ($request, $hash) if ($request->{opt}->{lparname} || $request->{opt}->{huge_page});
|
||||
return ([["Error", "Miss argument\n".$usage_string, 1]]);
|
||||
}
|
||||
sub do_set_lparname {
|
||||
sub do_op_extra_cmds {
|
||||
my $request = shift;
|
||||
my $hash = shift;
|
||||
my @values = ();
|
||||
my $action;
|
||||
my $param;
|
||||
if (exists($request->{opt}->{lparname})) {
|
||||
$action = "set_lpar_name";
|
||||
$param = $request->{opt}->{lparname};
|
||||
} elsif (exists($request->{opt}->{huge_page})) {
|
||||
$action = "set_huge_page";
|
||||
$param = $request->{opt}->{huge_page};
|
||||
}
|
||||
my $lparname_para = $request->{opt}->{lparname};
|
||||
while (my ($mtms, $h) = each(%$hash)) {
|
||||
while (my($name, $d) = each(%$h)) {
|
||||
my $lparname = ($lparname_para eq '*') ? $name : $lparname_para;
|
||||
my $values = xCAT::FSPUtils::fsp_api_action($name, $d, "set_lpar_name", 0, $lparname);
|
||||
if (@$values[1] && ((@$values[1] =~ /Error/i) && (@$values[2] ne '0'))) {
|
||||
return ([[$name, @$values[1], '1']]) ;
|
||||
my $tmp_value = ($param eq '*') ? $name : $param;
|
||||
my $value = xCAT::FSPUtils::fsp_api_action($name, $d, $action, 0, $tmp_value);
|
||||
if (@$value[1] && ((@$value[1] =~ /Error/i) && (@$value[2] ne '0'))) {
|
||||
return ([[$name, @$value[1], '1']]) ;
|
||||
} else {
|
||||
push @values, [$name, "Success", '0'];
|
||||
}
|
||||
@@ -653,7 +669,7 @@ sub check_node_info {
|
||||
return $not_lpar;
|
||||
}
|
||||
|
||||
sub op_lparname {
|
||||
sub op_extra_cmds {
|
||||
my $request = shift;
|
||||
my $hash = shift;
|
||||
my $node = $request->{node};
|
||||
@@ -661,7 +677,7 @@ sub op_lparname {
|
||||
if (defined($lpar_flag)) {
|
||||
return ([[$lpar_flag,"Node must be LPAR", 1]]);
|
||||
}
|
||||
return &do_set_lparname($request, $hash);
|
||||
return &do_op_extra_cmds($request, $hash);
|
||||
}
|
||||
|
||||
|
||||
@@ -824,16 +840,42 @@ sub enumerate {
|
||||
return( [0,\%outhash] );
|
||||
}
|
||||
|
||||
sub get_cec_lpar_info {
|
||||
my $name = shift;
|
||||
my $attr = shift;
|
||||
my $lparid = shift;
|
||||
my $values = xCAT::FSPUtils::fsp_api_action($name, $attr, "get_lpar_info");
|
||||
sub get_cec_attr_info {
|
||||
my $name = shift;
|
||||
my $attr = shift;
|
||||
my $op = shift;
|
||||
my %op_hash = (
|
||||
lpar_info => "get_lpar_info",
|
||||
bsr => "get_cec_bsr",
|
||||
huge_page => "get_huge_page"
|
||||
);
|
||||
my $action = $op_hash{$op};
|
||||
my $values = xCAT::FSPUtils::fsp_api_action($name, $attr, $action);
|
||||
if (@$values[1] && ((@$values[1] =~ /Error/i) && @$values[2] ne '0')) {
|
||||
return ([[$name, @$values[1], '1']]);
|
||||
}
|
||||
return @$values[1];
|
||||
}
|
||||
|
||||
sub get_cec_lpar_hugepage {
|
||||
my $name = shift;
|
||||
my $huge_info = shift;
|
||||
my $lparid = shift;
|
||||
my $lparname = shift;
|
||||
my @value = split(/\n/, $huge_info);
|
||||
foreach my $v (@value) {
|
||||
if($v =~ /\s*([^\s]+)\s*:\s*([\d|\/]+)/) {
|
||||
my $tmp_name = $1;
|
||||
my $tmp_num = $2;
|
||||
if($tmp_name =~ /^$lparname$/) {
|
||||
return $tmp_num;
|
||||
}
|
||||
}
|
||||
}
|
||||
return ([[$name, "can not get huge page info for lpar id $lparid", '1']]);
|
||||
|
||||
}
|
||||
|
||||
sub get_cec_lpar_name {
|
||||
my $name = shift;
|
||||
my $lpar_info = shift;
|
||||
@@ -847,25 +889,87 @@ sub get_cec_lpar_name {
|
||||
}
|
||||
}
|
||||
return ([[$name, "can not get lparname for lpar id $lparid", '1']]);
|
||||
|
||||
}
|
||||
sub get_lpar_lpar_name {
|
||||
sub get_cec_lpar_bsr {
|
||||
my $name = shift;
|
||||
my $attr = shift;
|
||||
my $values = xCAT::FSPUtils::fsp_api_action($name, $attr, "get_lpar_name");
|
||||
if (@$values[1] && ((@$values[1] =~ /Error/i) && (@$values[2] ne '0'))) {
|
||||
my @result = ();
|
||||
push @result, $values;
|
||||
return \@result;
|
||||
my $lpar_info = shift;
|
||||
my $lparid = shift;
|
||||
my $lparname = shift;
|
||||
my @value = split(/\n/, $lpar_info);
|
||||
foreach my $v (@value) {
|
||||
if($v =~ /\s*([^\s]+)\s*:\s*([\d]+)/) {
|
||||
my $tmp_name = $1;
|
||||
my $tmp_num = $2;
|
||||
if($tmp_name =~ /^$lparname$/) {
|
||||
return $tmp_num;
|
||||
}
|
||||
}
|
||||
}
|
||||
return @$values[1];
|
||||
return ([[$name, "can not get BSR info for lpar id $lparid", '1']]);
|
||||
}
|
||||
sub get_cec_cec_bsr {
|
||||
my $name = shift;
|
||||
my $lpar_info = shift;
|
||||
my $index = 0;
|
||||
my @value = split(/\n/, $lpar_info);
|
||||
my $cec_bsr = "";
|
||||
foreach my $v (@value) {
|
||||
if ($v =~ /(Number of BSR arrays:)\s*(\d+)/i) {
|
||||
$cec_bsr .= "$1 $2,";
|
||||
$index++;
|
||||
} elsif ($v =~ /(Bytes per BSR array:)\s*(\d+)/i) {
|
||||
$cec_bsr .= "$1 $2,";
|
||||
$index++;
|
||||
} elsif ($v =~ /(Available BSR array:)\s*(\d+)/i) {
|
||||
$cec_bsr .= "$1 $2;\n";
|
||||
$index++;
|
||||
}
|
||||
}
|
||||
if ($index != 3) {
|
||||
return undef;
|
||||
} else {
|
||||
return $cec_bsr;
|
||||
}
|
||||
}
|
||||
sub get_cec_cec_hugepage {
|
||||
my $name = shift;
|
||||
my $huge_info = shift;
|
||||
my $index = 0;
|
||||
my @value = split (/\n/, $huge_info);
|
||||
my $cec_hugepage = "";
|
||||
foreach my $v (@value) {
|
||||
if ($v =~ /(Available huge page memory\(in pages\):)\s*(\d+)/i) {
|
||||
my $tmp = sprintf "%-40s %s;\n", $1, $2;
|
||||
$cec_hugepage .= $tmp;
|
||||
$index++;
|
||||
} elsif($v =~ /(Configurable huge page memory\(in pages\):)\s*(\d+)/i){
|
||||
my $tmp = sprintf "%-40s %s;\n", $1, $2;
|
||||
$cec_hugepage .= $tmp;
|
||||
$index++;
|
||||
} elsif($v =~ /(Page Size\(in GB\):)\s*(\d+)/i) {
|
||||
my $tmp = sprintf "%-40s %s;\n", $1, $2;
|
||||
$cec_hugepage .= $tmp;
|
||||
$index++;
|
||||
} elsif($v =~ /(Maximum huge page memory\(in pages\):)\s*(\d+)/i) {
|
||||
my $tmp = sprintf "%-40s %s;\n", $1, $2;
|
||||
$cec_hugepage .= $tmp;
|
||||
$index++;
|
||||
} elsif($v =~ /(Requested huge page memory\(in pages\):)\s*(\d+)/i) {
|
||||
my $tmp = sprintf "%-40s %s;\n", $1, $2;
|
||||
$cec_hugepage .= $tmp;
|
||||
$index++;
|
||||
}
|
||||
}
|
||||
if ($index != 5) {
|
||||
return undef;
|
||||
}
|
||||
return $cec_hugepage;
|
||||
}
|
||||
|
||||
##########################################################################
|
||||
# Lists logical partitions
|
||||
##########################################################################
|
||||
sub list {
|
||||
|
||||
my $request = shift;
|
||||
my $hash = shift;
|
||||
my $args = $request->{opt};
|
||||
@@ -875,11 +979,15 @@ sub list {
|
||||
my $d;
|
||||
my @result;
|
||||
my $lpar_infos;
|
||||
my $bsr_infos;
|
||||
my $huge_infos;
|
||||
my %lpar_huges = ();
|
||||
my $l_string = "\n";
|
||||
#print Dumper($hash);
|
||||
while (my ($mtms,$h) = each(%$hash) ) {
|
||||
my $info = enumerate( $h, $mtms );
|
||||
my $Rc = shift(@$info);
|
||||
my $data = @$info[0];
|
||||
my $info = enumerate( $h, $mtms );
|
||||
my $Rc = shift(@$info);
|
||||
my $data = @$info[0];
|
||||
|
||||
while (($node_name,$d) = each(%$h) ) {
|
||||
my $cec = @$d[3];
|
||||
@@ -887,10 +995,10 @@ sub list {
|
||||
|
||||
my $id = @$d[0];
|
||||
|
||||
if ( $Rc != SUCCESS ) {
|
||||
push @result, [$node_name, $data,$Rc];
|
||||
next;
|
||||
}
|
||||
if ( $Rc != SUCCESS ) {
|
||||
push @result, [$node_name, $data,$Rc];
|
||||
next;
|
||||
}
|
||||
my $values = $data->{0};
|
||||
my $msg = $data->{1};
|
||||
|
||||
@@ -903,37 +1011,69 @@ sub list {
|
||||
push @result,[$node_name, $msg, 0];
|
||||
} else {
|
||||
# get the I/O slot information
|
||||
if($request->{opt}->{l} and $type =~ /^(fsp|cec)$/) {
|
||||
$lpar_infos = get_cec_lpar_info($node_name, $d);
|
||||
if($request->{opt}->{l}) {
|
||||
if ($type =~ /^(fsp|cec)$/) {
|
||||
$bsr_infos = get_cec_attr_info($node_name, $d, "bsr");
|
||||
if (ref($bsr_infos) eq 'ARRAY') {
|
||||
return $bsr_infos;
|
||||
}
|
||||
$huge_infos = get_cec_attr_info($node_name, $d, "huge_page");
|
||||
if (ref($huge_infos) eq 'ARRAY') {
|
||||
return $huge_infos;
|
||||
}
|
||||
}
|
||||
$lpar_infos = get_cec_attr_info($node_name, $d, "lpar_info");
|
||||
if (ref($lpar_infos) eq 'ARRAY') {
|
||||
return $lpar_infos;
|
||||
}
|
||||
}
|
||||
}
|
||||
my $v;
|
||||
my @t;
|
||||
my @value = split(/\n/, $values);
|
||||
foreach my $v (@value) {
|
||||
my ($lparid, @t ) = split (/,/, $v);
|
||||
my $lparname = undef;
|
||||
my $ios = join('/', @t);
|
||||
if ($request->{opt}->{l}) {
|
||||
my $lparname = get_cec_lpar_name($node_name, $lpar_infos, $lparid);
|
||||
my $hugepage;
|
||||
if ($type =~ /^(fsp|cec)$/) {
|
||||
$lparname = get_cec_lpar_name($node_name, $lpar_infos, $lparid);
|
||||
my $lpar_bsr = get_cec_lpar_bsr($node_name, $bsr_infos, $lparid, $lparname);
|
||||
if (ref($lpar_bsr) eq 'ARRAY') {
|
||||
return $lpar_bsr;
|
||||
}
|
||||
$ios .= ": ".$lpar_bsr;
|
||||
$hugepage = get_cec_lpar_hugepage($node_name, $huge_infos, $lparid, $lparname);
|
||||
if (ref($hugepage) eq 'ARRAY') {
|
||||
return $hugepage;
|
||||
}
|
||||
} else {
|
||||
$lparname = get_lpar_lpar_name($node_name, $d);
|
||||
}
|
||||
if ($lparid ne $id) {
|
||||
next;
|
||||
}
|
||||
if (defined($lpar_huges{$lparid})) {
|
||||
$hugepage = $lpar_huges{$lparid};
|
||||
} else {
|
||||
$hugepage = get_cec_attr_info($node_name, $d, "huge_page");
|
||||
if (ref($hugepage) eq 'ARRAY') {
|
||||
return $hugepage;
|
||||
}
|
||||
$lpar_huges{$lparid} = $hugepage;
|
||||
}
|
||||
}
|
||||
$ios .= ": ".$hugepage;
|
||||
if (ref($lparname) eq 'ARRAY') {
|
||||
return $lparname;
|
||||
} else {
|
||||
$lparname = "$lparname: $lparid";
|
||||
}
|
||||
$l_string .= "$lparname: ".$ios."\n";
|
||||
} else {
|
||||
$lparname = $lparid;
|
||||
}
|
||||
if ($type=~/^(fsp|cec)$/) {
|
||||
push @result,[$lparname, join('/', @t), $Rc];
|
||||
} else {
|
||||
if( $lparid eq $id) {
|
||||
push @result,[$lparname, join('/', @t), $Rc];
|
||||
if ($type=~/^(fsp|cec)$/) {
|
||||
push @result,[$lparid, $ios, $Rc];
|
||||
} else {
|
||||
if( $lparid eq $id) {
|
||||
push @result,[$lparid, $ios, $Rc];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -942,11 +1082,21 @@ sub list {
|
||||
# get the octant configuration value
|
||||
if ($type=~/^(fsp|cec)$/) {
|
||||
my $value = $data->{$cec};
|
||||
push @result,[$node_name, $value, $Rc];
|
||||
if ($request->{opt}->{l}) {
|
||||
my $cec_bsr = get_cec_cec_bsr($node_name, $bsr_infos);
|
||||
my $cec_hugepage = get_cec_cec_hugepage($node_name, $huge_infos);
|
||||
$l_string .= $value.$cec_bsr;
|
||||
$l_string .= $cec_hugepage;
|
||||
} else {
|
||||
$l_string = $value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
} # end of while
|
||||
if ($l_string =~ /^\n$/) {
|
||||
next;
|
||||
}
|
||||
push @result, [$node_name, $l_string, $Rc];
|
||||
$l_string = "\n";
|
||||
} # end of while
|
||||
}# end of while
|
||||
return( \@result );
|
||||
}
|
||||
@@ -1297,16 +1447,4 @@ sub lsvm {
|
||||
return( list(@_) );
|
||||
}
|
||||
|
||||
|
||||
|
||||
1;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -73,7 +73,7 @@ sub getnimprime
|
||||
|
||||
my $nimprime = xCAT::Utils->get_site_Master();
|
||||
my $sitetab = xCAT::Table->new('site');
|
||||
(my $et) = $sitetab->getAttribs({key => "NIMprime"}, 'value');
|
||||
(my $et) = $sitetab->getAttribs({key => "nimprime"}, 'value');
|
||||
if ($et and $et->{value})
|
||||
{
|
||||
$nimprime = $et->{value};
|
||||
@@ -909,33 +909,6 @@ sub dolitesetup
|
||||
return 1;
|
||||
}
|
||||
|
||||
#
|
||||
# Check the statelite table for duplicate node entries
|
||||
#
|
||||
my $recs=$statelitetab->getAllEntries();
|
||||
my @SLnodes;
|
||||
foreach my $entry (@$recs) {
|
||||
|
||||
# get the "node" value
|
||||
my $node = $entry->{node};
|
||||
|
||||
# run it through noderange
|
||||
my @newnodes = xCAT::NodeRange::noderange($node);
|
||||
|
||||
# for each node - see if it's already in the list
|
||||
foreach my $n (@newnodes) {
|
||||
if (!grep (/^$n$/, @SLnodes) ) {
|
||||
push(@SLnodes, $n);
|
||||
} else {
|
||||
# if it's already in the list then this is an error
|
||||
my $rsp;
|
||||
push @{$rsp->{data}}, "The node \'$n\' is included in multiple statelite entries.\n";
|
||||
xCAT::MsgUtils->message("E", $rsp, $callback);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# create the statelite table file
|
||||
my $foundentry=0;
|
||||
my $stateHash = $statelitetab->getNodesAttribs(\@nodelist, ['statemnt', 'mntopts']);
|
||||
|
||||
@@ -261,7 +261,8 @@ sub getipaddr
|
||||
#return inet_ntoa(inet_aton($iporhost))
|
||||
#TODO, what if no scoket6 support, but passing in a IPv6 hostname?
|
||||
if ($iporhost =~ /:/) { #ipv6
|
||||
die "Attempt to process IPv6 address, but system does not have requisite IPv6 perl support";
|
||||
return undef;
|
||||
#die "Attempt to process IPv6 address, but system does not have requisite IPv6 perl support";
|
||||
}
|
||||
my $packed_ip;
|
||||
$iporhost and $packed_ip = inet_aton($iporhost);
|
||||
@@ -521,5 +522,103 @@ sub ip_forwarding_enabled
|
||||
}
|
||||
return $enabled;
|
||||
}
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
=head3 get_nic_ip
|
||||
Get the ip address for the node nics
|
||||
|
||||
Arguments:
|
||||
Returns:
|
||||
Hash of the mapping of the nic and the ip addresses
|
||||
Globals:
|
||||
Error:
|
||||
none
|
||||
Example:
|
||||
xCAT::NetworkUtils->get_nic_ip()
|
||||
Comments:
|
||||
none
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
sub get_nic_ip
|
||||
{
|
||||
my $nic;
|
||||
my %iphash;
|
||||
my $cmd = "ifconfig -a";
|
||||
my $result = `$cmd`;
|
||||
my $mode = "MULTICAST";
|
||||
|
||||
#############################################
|
||||
# Error running command
|
||||
#############################################
|
||||
if ( !$result ) {
|
||||
return undef;
|
||||
}
|
||||
|
||||
if (xCAT::Utils->isAIX()) {
|
||||
##############################################################
|
||||
# Should look like this for AIX:
|
||||
# en0: flags=4e080863,80<UP,BROADCAST,NOTRAILERS,RUNNING,
|
||||
# SIMPLEX,MULTICAST,GROUPRT,64BIT,PSEG,CHAIN>
|
||||
# inet 30.0.0.1 netmask 0xffffff00 broadcast 30.0.0.255
|
||||
# inet 192.168.2.1 netmask 0xffffff00 broadcast 192.168.2.255
|
||||
# en1: ...
|
||||
#
|
||||
##############################################################
|
||||
my @adapter = split /(\w+\d+):\s+flags=/, $result;
|
||||
foreach ( @adapter ) {
|
||||
if ($_ =~ /^(en\d)/) {
|
||||
$nic = $1;
|
||||
next;
|
||||
}
|
||||
if ( !($_ =~ /LOOPBACK/ ) and
|
||||
$_ =~ /UP(,|>)/ and
|
||||
$_ =~ /$mode/ ) {
|
||||
my @ip = split /\n/;
|
||||
for my $ent ( @ip ) {
|
||||
if ( $ent =~ /^\s*inet\s+(\d+\.\d+\.\d+\.\d+)/ ) {
|
||||
$iphash{$nic} = $1;
|
||||
next;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
##############################################################
|
||||
# Should look like this for Linux:
|
||||
# eth0 Link encap:Ethernet HWaddr 00:02:55:7B:06:30
|
||||
# inet addr:9.114.154.193 Bcast:9.114.154.223
|
||||
# inet6 addr: fe80::202:55ff:fe7b:630/64 Scope:Link
|
||||
# UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
|
||||
# RX packets:1280982 errors:0 dropped:0 overruns:0 frame:0
|
||||
# TX packets:3535776 errors:0 dropped:0 overruns:0 carrier:0
|
||||
# collisions:0 txqueuelen:1000
|
||||
# RX bytes:343489371 (327.5 MiB) TX bytes:870969610 (830.6 MiB)
|
||||
# Base address:0x2600 Memory:fbfe0000-fc0000080
|
||||
#
|
||||
# eth1 ...
|
||||
#
|
||||
##############################################################
|
||||
my @adapter= split /\n{2,}/, $result;
|
||||
foreach ( @adapter ) {
|
||||
if ( !($_ =~ /LOOPBACK / ) and
|
||||
$_ =~ /UP / and
|
||||
$_ =~ /$mode / ) {
|
||||
my @ip = split /\n/;
|
||||
for my $ent ( @ip ) {
|
||||
if ($ent =~ /^(eth\d|ib\d|hf\d)\s+/) {
|
||||
$nic = $1;
|
||||
}
|
||||
if ( $ent =~ /^\s*inet addr:\s*(\d+\.\d+\.\d+\.\d+)/ ) {
|
||||
$iphash{$nic} = $1;
|
||||
next;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return \%iphash;
|
||||
}
|
||||
1;
|
||||
|
||||
@@ -107,9 +107,10 @@ sub do_rnetboot {
|
||||
my $ssh = @$exp[0];
|
||||
my $userid = @$exp[4];
|
||||
my $pw = @$exp[5];
|
||||
my $subreq = $request->{subreq};
|
||||
my $subreq = $request->{subreq};
|
||||
my $Rc = SUCCESS;
|
||||
my $result = "";
|
||||
my $cmd;
|
||||
my $result;
|
||||
|
||||
#######################################
|
||||
# Disconnect Expect session
|
||||
@@ -181,8 +182,7 @@ sub do_rnetboot {
|
||||
$cmd.= " -o";
|
||||
}
|
||||
|
||||
my $Rc = SUCCESS;
|
||||
my @macs = split /,/, $opt->{m};
|
||||
my @macs = split /\|/, $opt->{m};
|
||||
foreach my $mac ( @macs ) {
|
||||
#######################################
|
||||
# Network specified
|
||||
@@ -259,6 +259,8 @@ sub do_rnetboot {
|
||||
|
||||
my $done = 0;
|
||||
while ( $done < 2 ) {
|
||||
$result = "";
|
||||
$Rc = SUCCESS;
|
||||
#######################################
|
||||
# Execute command
|
||||
#######################################
|
||||
|
||||
@@ -158,13 +158,18 @@ sub parse_args {
|
||||
if ( $result ) {
|
||||
return( usage($result) );
|
||||
}
|
||||
} elsif ($_ =~ /_passwd$/) {
|
||||
return( usage("No argument specified for '$_'"));
|
||||
}
|
||||
}
|
||||
{
|
||||
my $result = parse_dev_option( $request, \%cmds);
|
||||
if ($result) {
|
||||
return ( usage($result));
|
||||
}
|
||||
if ($request->{dev} eq '1' && $request->{other} eq '1') {
|
||||
return ( usage("Invalid command arrays"));
|
||||
}
|
||||
# my $result = parse_dev_option( $request, \%cmds);
|
||||
# if ($result) {
|
||||
# return ( usage($result));
|
||||
# }
|
||||
}
|
||||
####################################
|
||||
# Return method to invoke
|
||||
@@ -310,7 +315,15 @@ sub parse_option {
|
||||
return( "New password couldn't be empty for user 'HMC'" );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ( $command eq 'dev' or $command eq 'celogin1' ) {
|
||||
if ($value !~ /^(enable|disable)$/i ) {
|
||||
return( "Invalid argument '$value'" );
|
||||
}
|
||||
$request->{dev} = 1;
|
||||
} else {
|
||||
$request->{other} = 1;
|
||||
}
|
||||
return undef;
|
||||
}
|
||||
|
||||
|
||||
+18
-13
@@ -152,7 +152,7 @@ sub add_ppc {
|
||||
###############################
|
||||
# Update ppc table
|
||||
###############################
|
||||
if ( $type =~ /^(fsp|bpa|lpar|frame|cec)$/ ) {
|
||||
if ( $type =~ /^(fsp|bpa|lpar|frame|cec|hmc)$/ ) {
|
||||
$db{ppc}->setNodeAttribs( $name,
|
||||
{ hcp=>$server,
|
||||
id=>$id,
|
||||
@@ -437,7 +437,7 @@ sub update_node_attribs
|
||||
###########################
|
||||
my @users = qw(HMC admin general);
|
||||
foreach my $user ( @users ) {
|
||||
my $pwhash = $db->{ppcdirect}->getAttribs( {hcp=>$predefined_node,username=>$user}, qw(password comments disable));
|
||||
my $pwhash = $db->{ppcdirect}->getAttribs( {hcp=>$predefined_node,username=>$user}, qw(password comments disable)); # need regx
|
||||
if ( $pwhash )
|
||||
{
|
||||
if ( $namediff )
|
||||
@@ -602,10 +602,10 @@ sub add_ppchcp {
|
||||
|
||||
my $hwtype = shift;
|
||||
my $values = shift;
|
||||
my @tabs = qw(ppchcp nodehm nodelist nodetype mac ppc);
|
||||
my @tabs = qw(ppchcp nodehm nodelist nodetype mac ppc vpd);
|
||||
my %db = ();
|
||||
|
||||
my ($name, $mac) = split ',', $values;
|
||||
my ($name, $mac, $mtm, $sn, $ip) = split ',', $values;
|
||||
|
||||
###################################
|
||||
# Open database needed
|
||||
@@ -619,7 +619,7 @@ sub add_ppchcp {
|
||||
###################################
|
||||
# Update ppchcp table
|
||||
###################################
|
||||
my ($ent) = $db{ppchcp}->getAttribs({ hcp=>$name},'hcp');
|
||||
my ($ent) = $db{ppchcp}->getNodeAttribs( $name,'hcp');
|
||||
if ( !defined($ent) ) {
|
||||
$db{ppchcp}->setAttribs( {hcp=>$name},
|
||||
{ username=>"",
|
||||
@@ -641,6 +641,11 @@ sub add_ppchcp {
|
||||
# Update mac table
|
||||
###################################
|
||||
$db{mac}->setNodeAttribs( $name, {mac=>$mac});
|
||||
###################################
|
||||
# Update vpd table
|
||||
###################################
|
||||
$db{vpd}->setNodeAttribs( $name, {mtm=>$mtm});
|
||||
$db{vpd}->setNodeAttribs( $name, {serial=>$sn});
|
||||
|
||||
###################################
|
||||
# Update nodelist table
|
||||
@@ -699,7 +704,7 @@ sub add_systemX {
|
||||
###################################
|
||||
# Update mpa table
|
||||
###################################
|
||||
my ($ent) = $db{mpa}->getAttribs({ mpa=>$name},'mpa');
|
||||
my ($ent) = $db{mpa}->getNodeAttribs( $name,'mpa');
|
||||
if ( !defined($ent) ) {
|
||||
$db{mpa}->setAttribs( {mpa=>$name},
|
||||
{ username=>"",
|
||||
@@ -786,13 +791,13 @@ sub credentials {
|
||||
$tab = xCAT::Table->new( $hcptab{$hwtype} );
|
||||
if ( $tab ) {
|
||||
my $ent;
|
||||
if ( $user_specified)
|
||||
{
|
||||
if ( $user_specified)
|
||||
{ # need regx
|
||||
($ent) = $tab->getAttribs( {hcp=>$server,username=>$user},qw(password));
|
||||
}
|
||||
else
|
||||
{
|
||||
($ent) = $tab->getAttribs( {hcp=>$server}, qw(username password));
|
||||
($ent) = $tab->getNodeAttribs( $server, qw(username password));
|
||||
}
|
||||
if ( $ent){
|
||||
if (defined($ent->{password})) { $pass = $ent->{password}; }
|
||||
@@ -801,15 +806,15 @@ sub credentials {
|
||||
##############################################################
|
||||
# If no user/passwd found, check if there is a default group
|
||||
##############################################################
|
||||
elsif( ($ent) = $tab->getAttribs( {hcp=>$defaultgrp{$hwtype}}, qw(username password)))
|
||||
else
|
||||
{
|
||||
if ( $user_specified)
|
||||
{
|
||||
($ent) = $tab->getAttribs( {hcp=>$defaultgrp{$hwtype},username=>$user},qw(password));
|
||||
{ # need regx
|
||||
($ent) = $tab->getAllAttribs( {hcp=>$defaultgrp{$hwtype},username=>$user},qw(password));
|
||||
}
|
||||
else
|
||||
{
|
||||
($ent) = $tab->getAttribs( {hcp=>$defaultgrp{$hwtype}}, qw(username password));
|
||||
($ent) = $tab->getNodeAttribs( $defaultgrp{$hwtype}, qw(username password));
|
||||
}
|
||||
if ( $ent){
|
||||
if (defined($ent->{password})) { $pass = $ent->{password}; }
|
||||
|
||||
@@ -12,7 +12,6 @@ use Getopt::Long;
|
||||
use File::Spec;
|
||||
use POSIX qw(tmpnam);
|
||||
|
||||
|
||||
my $packages_dir= ();
|
||||
my $activate = ();
|
||||
my $verbose = 0;
|
||||
@@ -51,7 +50,6 @@ sub parse_args {
|
||||
my $cmd = $request->{command};
|
||||
my $args = $request->{arg};
|
||||
|
||||
|
||||
#############################################
|
||||
# Change CEC/Frame node into FSPs/BPAs
|
||||
#############################################
|
||||
@@ -96,7 +94,7 @@ sub parse_args {
|
||||
$Getopt::Long::ignorecase = 0;
|
||||
Getopt::Long::Configure( "bundling" );
|
||||
|
||||
if ( !GetOptions( \%opt, qw(h|help v|version V|verbose p=s activate=s commit recover) )) {
|
||||
if ( !GetOptions( \%opt, qw(h|help v|version V|verbose p=s d=s activate=s commit recover) )) {
|
||||
return( usage() );
|
||||
}
|
||||
|
||||
@@ -136,6 +134,17 @@ sub parse_args {
|
||||
if ( exists( $opt{p} ) && ($opt{p} !~ /^\//) ) {#relative path
|
||||
$opt{p} = xCAT::Utils->full_path($opt{p}, $request->{cwd}->[0]);
|
||||
}
|
||||
|
||||
if( exists( $opt{d} ) ) {
|
||||
if(!exists( $opt{activate}) ) {
|
||||
return( usage("Option -d must be used with --activate ") );
|
||||
}
|
||||
}
|
||||
|
||||
if ( exists( $opt{d} ) && ($opt{d} !~ /^\//) ) {#relative path
|
||||
$opt{d} = xCAT::Utils->full_path($opt{d}, $request->{cwd}->[0]);
|
||||
}
|
||||
|
||||
###############################
|
||||
#--activate's value only can be concurrent and disruptive
|
||||
################################
|
||||
@@ -143,8 +152,12 @@ sub parse_args {
|
||||
if( ($opt{activate} ne "concurrent") && ($opt{activate} ne "disruptive")) {
|
||||
return (usage("--activate's value can only be concurrent or disruptive"));
|
||||
}
|
||||
|
||||
if(!exists( $opt{d} )) {
|
||||
$opt{d} = "/tmp";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
####################################
|
||||
# Check for "-" with no option
|
||||
####################################
|
||||
@@ -194,8 +207,12 @@ sub parse_args {
|
||||
if(noderange_validate($request) == -1) {
|
||||
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 waiting. "]});
|
||||
|
||||
if( $request->{hwtype} =~ /^(fsp|bpa)$/ && $opt{activate} =~ /^disruptive$/ ) {
|
||||
$request->{callback}->({data =>[ "You can find the log files in the /var/log/xcatd/dfm/rflash/."]});
|
||||
}
|
||||
|
||||
####################################
|
||||
# No operands - add command name
|
||||
@@ -343,7 +360,7 @@ sub preprocess_for_rflash {
|
||||
|
||||
my $cmd;
|
||||
if( -d $packages_fw) {
|
||||
$cmd = "rm -rf $packages_fw";
|
||||
$cmd = "rm -rf $packages_fw/*";
|
||||
xCAT::Utils->runcmd($cmd, 0);
|
||||
if ($::RUNCMD_RC != 0)
|
||||
{
|
||||
@@ -354,7 +371,7 @@ sub preprocess_for_rflash {
|
||||
}
|
||||
}
|
||||
|
||||
$cmd = "mkdir $packages_fw";
|
||||
$cmd = "mkdir -p $packages_fw";
|
||||
xCAT::Utils->runcmd("$cmd", 0);
|
||||
if ($::RUNCMD_RC != 0)
|
||||
{
|
||||
|
||||
@@ -267,7 +267,7 @@ sub mkvm_parse_args {
|
||||
my $lparparent;
|
||||
my $ppctab = xCAT::Table->new('ppc');
|
||||
foreach my $vnode (@{$opt{target}}) {
|
||||
my $vcon = $ppctab->getAttribs({node => $vnode}, ('node','parent'));
|
||||
my $vcon = $ppctab->getNodeAttribs( $vnode, ('node','parent'));
|
||||
if ($vcon and $vcon->{"node"} and $vcon->{"parent"}) {
|
||||
my $lparent = $vcon->{"parent"};
|
||||
$lparparent->{$lparent}->{$vnode} = $vnode;
|
||||
@@ -1966,7 +1966,7 @@ sub mkfulllpar {
|
||||
# Create the new full LPAR's configure data
|
||||
#################################
|
||||
my ($lpar_id, $profname);
|
||||
my $vcon = $ppctab->getAttribs({node => $name}, ('id','pprofile'));
|
||||
my $vcon = $ppctab->getAttribs($name, ('id','pprofile'));
|
||||
if ($vcon) {
|
||||
if ($vcon->{"id"}) {
|
||||
$lpar_id = $vcon->{"id"};
|
||||
|
||||
@@ -116,9 +116,9 @@ sub remote_copy_command
|
||||
# if only syncing the service node or no postscripts then do not
|
||||
# get update file notification
|
||||
if (($::SYNCSN == 1) || (!(defined @::postscripts))) {
|
||||
$sync_opt .= '-Lprotz ';
|
||||
$sync_opt .= '-Lprogtz ';
|
||||
} else {
|
||||
$sync_opt .= '-Liprotz --out-format=%f%L '; # add notify of update
|
||||
$sync_opt .= '-Liprogtz --out-format=%f%L '; # add notify of update
|
||||
}
|
||||
$sync_opt .= $$config{'options'};
|
||||
if ($::SYNCSN == 1)
|
||||
|
||||
@@ -532,7 +532,7 @@ noderes => {
|
||||
servicenode => 'A comma separated list of node names (as known by the management node) that provides most services for this node. The first service node on the list that is accessible will be used. The 2nd node on the list is generally considered to be the backup service node for this node when running commands like snmove.',
|
||||
netboot => 'The type of network booting to use for this node. Valid values: pxe or xnba for x86* architecture, yaboot for POWER architecture.',
|
||||
tftpserver => 'The TFTP server for this node (as known by this node).',
|
||||
nfsserver => 'The NFS server for this node (as known by this node).',
|
||||
nfsserver => 'The NFS or HTTP server for this node (as known by this node).',
|
||||
monserver => 'The monitoring aggregation point for this node. The format is "x,y" where x is the ip address as known by the management node and y is the ip address as known by the node.',
|
||||
nfsdir => 'The path that should be mounted from the NFS server.',
|
||||
installnic => 'The network adapter on the node that will be used for OS deployment, the installnic can be set to the network adapter name or the mac address or the keyword "mac" which means that the network interface specified by the mac address in the mac table will be used. If not set, primarynic will be used.',
|
||||
@@ -784,8 +784,8 @@ site => {
|
||||
" mn|eth1,eth2;service|bond0.\n\n".
|
||||
" dhcpsetup: If set to 'n', it will skip the dhcp setup process in the nodeset cmd.\n\n".
|
||||
" disjointdhcps: If set to '1', the .leases file on a service node only contains\n".
|
||||
" dnshandler: Name of plugin that handles DNS setup for makedns.\n".
|
||||
" the nodes it manages. The default value is '0'.\n\n".
|
||||
" dnshandler: Name of plugin that handles DNS setup for makedns.\n".
|
||||
" domain: The DNS domain name used for the cluster.\n\n".
|
||||
" ea_primary_hmc: The hostname of the HMC that the Integrated Switch Network\n".
|
||||
" Management Event Analysis should send hardware serviceable\n".
|
||||
@@ -821,7 +821,10 @@ site => {
|
||||
" ipmitimeout: The timeout to use when communicating with BMCs.\n\n".
|
||||
" iscsidir: The path to put the iscsi disks in on the mgmt node.\n\n".
|
||||
" master: The hostname of the xCAT management node, as known by the nodes.\n\n".
|
||||
" maxssh: The max # of SSH connections at any one time to the hw ctrl point for PPC\n\n".
|
||||
" maxssh: The max # of SSH connections at any one time to the hw ctrl point for PPC.\n".
|
||||
" This parameter doesn't take effect on the rpower command.\n".
|
||||
" It takes effects on other PPC hardware control command getmacs/rnetboot/rbootseq and so on.\n".
|
||||
" Default is 8.\n\n".
|
||||
" mnroutenames: The name of the routes to be setup on the management node.\n\n".
|
||||
" It is a comma separated list of route names that are defined in the routes table.\n\n".
|
||||
" nameservers: A comma delimited list of DNS servers that each node in the cluster\n".
|
||||
@@ -836,11 +839,17 @@ site => {
|
||||
" the node deployment, node discovery and power operations.\n\n".
|
||||
" ntpservers: A comma delimited list of NTP servers for the cluster - often the\n".
|
||||
" xCAT management node.\n\n".
|
||||
" syspowerinterval: The time of seconds that rpower command on CECs will wait between.\n".
|
||||
" The CECs should be in the same frame. It is used for controlling the\n".
|
||||
" CECs boot up speed. Default is 0.\n\n".
|
||||
" powerinterval: The time of seconds that rpower command will wait between\n".
|
||||
" performing action on each target object.\n".
|
||||
" It is used for controlling the cluster boot up speed\n".
|
||||
" in large clusters. Default is 0.\n\n".
|
||||
" ppcmaxp: The max # of processes for PPC hw ctrl.\n\n".
|
||||
" in large clusters. Default is 0.\n".
|
||||
" And it's used to control the time for the power command on each lpar by each hcp.\n\n".
|
||||
" ppcmaxp: The max # of processes for PPC hw ctrl. If there are more than ppcmaxp hcps,\n".
|
||||
" this parameter will take effect. It will control the max number of processes \n".
|
||||
" for PPC hardware control commands. Default is 64.\n\n".
|
||||
" ppcretry: The max # of PPC hw connection attempts before failing.\n\n".
|
||||
" ppctimeout: The timeout, in milliseconds, to use when communicating with PPC hw.\n\n".
|
||||
" pruneservices: Whether to enable service pruning when noderm is run (i.e.\n".
|
||||
|
||||
+10
-2
@@ -274,6 +274,14 @@ sub handle_dbc_request {
|
||||
}
|
||||
my $oldhandle = $::XCAT_DBHS->{$dbindex}; #store old handle off
|
||||
$::XCAT_DBHS->{$dbindex} = $::XCAT_DBHS->{$dbindex}->clone(); #replace broken db handle with nice, new, working one
|
||||
unless ($::XCAT_DBHS->{$dbindex}) { #this means the clone failed
|
||||
#most likely result is the DB is down
|
||||
#restore the old broken handle
|
||||
#so that future recovery attempts have a shot
|
||||
#a broken db handle we can recover, no db handle we cannot
|
||||
$::XCAT_DBHS->{$dbindex} = $oldhandle;
|
||||
return undef;
|
||||
}
|
||||
$dbobjsforhandle->{$::XCAT_DBHS->{$dbindex}} = $dbobjsforhandle->{$oldhandle}; #Move the map of depenednt objects to the new handle
|
||||
foreach (@afflictedobjs) { #migrate afflicted objects to the new DB handle
|
||||
$$_->{dbh} = $::XCAT_DBHS->{$dbindex};
|
||||
@@ -3806,7 +3814,7 @@ sub writeAllEntries
|
||||
$rc=output_table($self->{tabname},$fh,$self,$data);
|
||||
}
|
||||
$query->finish();
|
||||
close $fh;
|
||||
CORE::close($fh);
|
||||
return $rc;
|
||||
}
|
||||
|
||||
@@ -3892,7 +3900,7 @@ sub writeAllAttribsWhere
|
||||
$rc=output_table($self->{tabname},$fh,$self,$data);
|
||||
}
|
||||
$query->finish();
|
||||
close $fh;
|
||||
CORE::close($fh);
|
||||
return $rc ;
|
||||
}
|
||||
#--------------------------------------------------------------------------
|
||||
|
||||
+20
-11
@@ -69,7 +69,8 @@ my %usage = (
|
||||
PPC specific(with HMC):
|
||||
rinv <noderange> [bus|config|serial|model|firm|all]
|
||||
PPC specific(using Direct FSP Management):
|
||||
rinv <noderange> [firm|deconfig]
|
||||
rinv <noderange> [firm]
|
||||
rinv <noderange> [deconfig [-x]]
|
||||
Blade specific:
|
||||
rinv <noderange> [mtm|serial|mac|bios|diag|mprom|mparom|firm|all]
|
||||
VMware specific:
|
||||
@@ -130,27 +131,35 @@ my %usage = (
|
||||
*_passwd=<currentpasswd,newpasswd>|
|
||||
hostname=<*|hostname>
|
||||
FSP/CEC (using Direct FSP Management) Specific:
|
||||
rspconfig noderange HMC_passwd={currentpasswd,newpasswd}
|
||||
rspconfig noderange admin_passwd={currentpasswd,newpasswd}
|
||||
rspconfig noderange general_passwd={currentpasswd,newpasswd}
|
||||
rspconfig noderange *_passwd={currentpasswd,newpasswd}
|
||||
rspconfig <noderange> HMC_passwd=<currentpasswd,newpasswd>
|
||||
rspconfig <noderange> admin_passwd=<currentpasswd,newpasswd>
|
||||
rspconfig <noderange> general_passwd=<currentpasswd,newpasswd>
|
||||
rspconfig <noderange> *_passwd=<currentpasswd,newpasswd>
|
||||
rspconfig <noderange> [sysname]
|
||||
rspconfig <noderange> [sysname=<*|name>]
|
||||
rspconfig <noderange> [pending_power_on_side]
|
||||
rspconfig <noderange> [pending_power_on_side=<temp|perm>]
|
||||
rspconfig <noderange> [cec_off_policy]
|
||||
rspconfig <noderange> [cec_off_policy=<poweroff|stayon>]
|
||||
rspconfig <noderange> [huge_page]
|
||||
rspconfig <noderange> [huge_page=<NUM>]
|
||||
rspconfig <noderange> [BSR]
|
||||
rspconfig <noderange> [setup_failover]
|
||||
rspconfig <noderange> [setup_failover=<enable|disable>]
|
||||
rspconfig <noderange> [force_failover]
|
||||
rspconfig <noderange> --resetnet
|
||||
BPA/Frame (using Direct FSP Management)specific:
|
||||
rspconfig noderange HMC_passwd={currentpasswd,newpasswd}
|
||||
rspconfig noderange admin_passwd={currentpasswd,newpasswd}
|
||||
rspconfig noderange general_passwd={currentpasswd,newpasswd}
|
||||
rspconfig noderange *_passwd={currentpasswd,newpasswd}
|
||||
rspconfig <noderange> HMC_passwd=<currentpasswd,newpasswd>
|
||||
rspconfig <noderange> admin_passwd=<currentpasswd,newpasswd>
|
||||
rspconfig <noderange> general_passwd=<currentpasswd,newpasswd>
|
||||
rspconfig <noderange> *_passwd=<currentpasswd,newpasswd>
|
||||
rspconfig <noderange> [frame]
|
||||
rspconfig <noderange> frame=<*|frame>
|
||||
rspconfig <noderange> [sysname]
|
||||
rspconfig <noderange> [sysname=<*|name>]
|
||||
rspconfig <noderange> [pending_power_on_side]
|
||||
rspconfig <noderange> [pending_power_on_side=<temp|perm>]
|
||||
rspconfig <noderange> --resetnet
|
||||
HMC specific:
|
||||
rspconfig <noderange> [sshcfg]
|
||||
rspconfig <noderange> [sshcfg=<enable|disable>]
|
||||
@@ -214,10 +223,10 @@ my %usage = (
|
||||
"Usage:
|
||||
rflash [ -h|--help|-v|--version]
|
||||
PPC (with HMC) specific:
|
||||
rflash <noderange> -p directory [--activate concurrent | disruptive][-V|--verbose]
|
||||
rflash <noderange> -p <rpm_directory> [--activate concurrent | disruptive][-V|--verbose]
|
||||
rflash <noderange> [--commit | --recover] [-V|--verbose]
|
||||
PPC (using Direct FSP Management) specific:
|
||||
rflash <noderange> -p directory --activate disruptive
|
||||
rflash <noderange> -p <rpm_directory> --activate disruptive [-d <data_directory>]
|
||||
rflash <noderange> [--commit | --recover] [-V|--verbose]",
|
||||
"mkhwconn" =>
|
||||
"Usage:
|
||||
|
||||
+252
-228
@@ -26,6 +26,7 @@ use strict;
|
||||
use Symbol;
|
||||
use Digest::SHA1 qw/sha1/;
|
||||
use IPC::Open3;
|
||||
use IO::Select;
|
||||
use warnings "all";
|
||||
require xCAT::InstUtils;
|
||||
require xCAT::NetworkUtils;
|
||||
@@ -997,7 +998,7 @@ sub runcmd3 { #a proper runcmd that indpendently returns stdout, stderr, pid and
|
||||
is joined into a single string with the newlines separating the lines.
|
||||
|
||||
Arguments:
|
||||
command, exitcode and reference to output
|
||||
command, exitcode, reference to output, streaming mode
|
||||
Returns:
|
||||
see below
|
||||
Globals:
|
||||
@@ -1016,6 +1017,8 @@ sub runcmd3 { #a proper runcmd that indpendently returns stdout, stderr, pid and
|
||||
|
||||
Example:
|
||||
my $outref = xCAT::Utils->runcmd($cmd, -2, 1);
|
||||
$::CALLBACK= your callback (required for streaming from plugins)
|
||||
my $outref = xCAT::Utils->runcmd($cmd,-2, 1, 1); streaming
|
||||
|
||||
Comments:
|
||||
If refoutput is true, then the output will be returned as a
|
||||
@@ -1029,7 +1032,7 @@ sub runcmd
|
||||
|
||||
{
|
||||
|
||||
my ($class, $cmd, $exitcode, $refoutput) = @_;
|
||||
my ($class, $cmd, $exitcode, $refoutput, $stream) = @_;
|
||||
$::RUNCMD_RC = 0;
|
||||
# redirect stderr to stdout
|
||||
if (!($cmd =~ /2>&1$/)) { $cmd .= ' 2>&1'; }
|
||||
@@ -1055,8 +1058,30 @@ sub runcmd
|
||||
}
|
||||
|
||||
my $outref = [];
|
||||
@$outref = `$cmd`;
|
||||
if ($?)
|
||||
if (!defined($stream) || (length($stream) == 0)) { # do not stream
|
||||
@$outref = `$cmd`;
|
||||
} else { # streaming mode
|
||||
my @cmd;
|
||||
push @cmd,$cmd;
|
||||
my $rsp = {};
|
||||
my $output;
|
||||
my $errout;
|
||||
open (PIPE, "$cmd |");
|
||||
while (<PIPE>) {
|
||||
if ($::CALLBACK){
|
||||
$rsp->{data}->[0] = $_;
|
||||
$::CALLBACK->($rsp);
|
||||
} else {
|
||||
xCAT::MsgUtils->message("D", "$_");
|
||||
}
|
||||
$output .= $_;
|
||||
}
|
||||
# store the return string
|
||||
push @$outref,$output;
|
||||
}
|
||||
|
||||
# now if not streaming process errors
|
||||
if (($?) && (!defined($stream)))
|
||||
{
|
||||
$::RUNCMD_RC = $? >> 8;
|
||||
my $displayerror = 1;
|
||||
@@ -1470,7 +1495,8 @@ sub getTftpDir
|
||||
=head3 getHomeDir
|
||||
|
||||
Get the path the user home directory from /etc/passwd.
|
||||
|
||||
If /etc/passwd returns nothing ( id maybe in LDAP) then
|
||||
su - userid -c pwd to figure out where home is
|
||||
Arguments:
|
||||
none
|
||||
Returns:
|
||||
@@ -1481,6 +1507,7 @@ sub getTftpDir
|
||||
none
|
||||
Example:
|
||||
$myHome = xCAT::Utils->getHomeDir();
|
||||
$myHome = xCAT::Utils->getHomeDir($userid);
|
||||
Comments:
|
||||
none
|
||||
|
||||
@@ -1492,6 +1519,7 @@ sub getHomeDir
|
||||
{
|
||||
my ($class, $username) = @_;
|
||||
my @user;
|
||||
my $homedir;
|
||||
if ($username)
|
||||
{
|
||||
@user = getpwnam($username);
|
||||
@@ -1499,8 +1527,16 @@ sub getHomeDir
|
||||
else
|
||||
{
|
||||
@user = getpwuid($>);
|
||||
$username=$user[0];
|
||||
}
|
||||
return $user[7];
|
||||
|
||||
if ($user[7]) { # if homedir
|
||||
$homedir= $user[7];
|
||||
} else { # no home
|
||||
$homedir=`su - $username -c pwd`;
|
||||
chop $homedir;
|
||||
}
|
||||
return $homedir;
|
||||
}
|
||||
|
||||
#--------------------------------------------------------------------------------
|
||||
@@ -1628,7 +1664,12 @@ sub setupSSH
|
||||
print FILE "#!/bin/sh
|
||||
umask 0077
|
||||
home=`egrep \"^$to_userid:\" /etc/passwd | cut -f6 -d :`
|
||||
dest_dir=\"\$home/.ssh\"
|
||||
if [ $home ]; then
|
||||
dest_dir=\"\$home/.ssh\"
|
||||
else
|
||||
home=`su - root -c pwd`
|
||||
dest_dir=\"\$home/.ssh\"
|
||||
fi
|
||||
mkdir -p \$dest_dir
|
||||
cat /tmp/$to_userid/.ssh/authorized_keys >> \$home/.ssh/authorized_keys 2>&1
|
||||
cp /tmp/$to_userid/.ssh/id_rsa \$home/.ssh/id_rsa 2>&1
|
||||
@@ -1910,6 +1951,11 @@ sub bldnonrootSSHFiles
|
||||
xCAT::MsgUtils->message("I", $rsp, $::CALLBACK);
|
||||
}
|
||||
my $home = xCAT::Utils->getHomeDir($from_userid);
|
||||
# Handle non-root userid may not be in /etc/passwd maybe LDAP
|
||||
if (!$home) {
|
||||
$home=`su - $from_userid -c pwd`;
|
||||
chop $home;
|
||||
}
|
||||
my $roothome = xCAT::Utils->getHomeDir("root");
|
||||
if (xCAT::Utils->isMN()) { # if on Management Node
|
||||
if (!(-e "$home/.ssh/id_rsa.pub"))
|
||||
@@ -2429,6 +2475,8 @@ sub my_ip_facing
|
||||
$peer = shift;
|
||||
}
|
||||
return my_ip_facing_aix( $peer) if ( $^O eq 'aix');
|
||||
my $peernumber = inet_aton($peer); #TODO: IPv6 support
|
||||
unless ($peernumber) { return undef; }
|
||||
my $noden = unpack("N", inet_aton($peer));
|
||||
my @nets = split /\n/, `/sbin/ip addr`;
|
||||
foreach (@nets)
|
||||
@@ -2806,6 +2854,15 @@ sub nodeonmynet
|
||||
|
||||
=head3 getNodeIPaddress
|
||||
|
||||
Arguments:
|
||||
Node name only one at a time
|
||||
Returns: ip address(s)
|
||||
Globals:
|
||||
none
|
||||
Error:
|
||||
none
|
||||
Example: my $c1 = xCAT::Utils::getNodeIPaddress($nodetocheck);
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
@@ -2836,8 +2893,25 @@ sub getNodeIPaddress
|
||||
my $type = xCAT::DBobjUtils->getnodetype($nodetocheck);
|
||||
if ($type) {
|
||||
if ($type eq "frame" or $type eq "cec") {
|
||||
$c1 = xCAT::DBobjUtils->getchildren($nodetocheck);
|
||||
|
||||
# Read the ppc table for any entry that
|
||||
# has parent=nodename and nodetype fsp or bpa
|
||||
my $ppctab = xCAT::Table->new( 'ppc' );
|
||||
my @ps = $ppctab->getAllNodeAttribs(['node','parent','nodetype']);
|
||||
my $parent;
|
||||
my $node;
|
||||
my $type;
|
||||
#search for addresses
|
||||
for my $entry ( @ps ) {
|
||||
$parent = $entry->{parent};
|
||||
$node = $entry->{node};
|
||||
$type = $entry->{nodetype};
|
||||
if (defined($parent) and $parent eq $nodetocheck ) {
|
||||
if ( defined($type) and $type eq 'fsp' or $type eq 'bpa'){
|
||||
push @$c1,$node;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#if $port exists, only for mkhwconn ... CEC/Frame
|
||||
if ( defined($port) ) {
|
||||
my @fsp_bpa = @$c1;
|
||||
@@ -2932,8 +3006,124 @@ sub getNodeIPaddress
|
||||
return undef;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
=head3 getIPaddress - Used by DFM related functions to support service vlan redundancy.
|
||||
|
||||
Arguments:
|
||||
Node name only one at a time
|
||||
Returns: ip address(s)
|
||||
Globals:
|
||||
none
|
||||
Error:
|
||||
none
|
||||
Example: my $c1 = xCAT::Utils::getIPaddress($nodetocheck);
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
sub getIPaddress
|
||||
{
|
||||
require xCAT::Table;
|
||||
my $nodetocheck = shift;
|
||||
my $port = shift;
|
||||
my $side = "[A|B]";
|
||||
if (!defined($port)) {
|
||||
$port = "[0|1]";
|
||||
}
|
||||
|
||||
# only need to parse IP addresses for Frame/CEC/BPA/FSP
|
||||
|
||||
my $type = xCAT::DBobjUtils->getnodetype($nodetocheck);
|
||||
if ($type) {
|
||||
my @children;
|
||||
my %node_side_pairs = ();
|
||||
my $children_num = 0;
|
||||
my $parent;
|
||||
my $ppctab = xCAT::Table->new( 'ppc' );
|
||||
my $vpdtab = xCAT::Table->new( 'vpd' );
|
||||
if ($type eq "bpa" or $type eq "fsp") {
|
||||
my $tmp_p = $ppctab->getNodeAttribs($nodetocheck, ['parent']);
|
||||
if ($tmp_p and $tmp_p->{parent}) {
|
||||
$parent = $tmp_p->{parent};
|
||||
} else {
|
||||
return undef;
|
||||
}
|
||||
my $tmp_s = $vpdtab->getNodeAttribs($nodetocheck, ['side']);
|
||||
if ($tmp_s->{side} and ($tmp_s->{side} =~ /(A|B)-\d/i)) {
|
||||
$side = $1; # get side for the fsp, in order to get its brothers
|
||||
} else {
|
||||
return -3;
|
||||
}
|
||||
} elsif ($type eq "frame" or $type eq "cec") {
|
||||
$parent = $nodetocheck;
|
||||
} else {
|
||||
return undef;
|
||||
}
|
||||
my @ps = $ppctab->getAllNodeAttribs(['node','parent','nodetype']);
|
||||
my $tmp_parent;
|
||||
my $tmp_node;
|
||||
my $tmp_type;
|
||||
#search for $nodetocheck's children or brothers
|
||||
for my $entry ( @ps ) {
|
||||
$tmp_parent = $entry->{parent};
|
||||
$tmp_node = $entry->{node};
|
||||
$tmp_type = $entry->{nodetype};
|
||||
if ($tmp_parent and ($tmp_parent eq $parent) ) {
|
||||
if (!defined($tmp_type)) {
|
||||
$tmp_type = xCAT::DBobjUtils->getnodetype($tmp_node);
|
||||
}
|
||||
if ($tmp_type and ($tmp_type eq 'fsp' or $tmp_type eq 'bpa')) {
|
||||
push @children, $tmp_node;
|
||||
}
|
||||
}
|
||||
}
|
||||
foreach my $tmp_n( @children) {
|
||||
my $ent = $vpdtab->getNodeAttribs($tmp_n, ['side']);
|
||||
if ($ent->{side} and $ent->{side} =~ /^$side-$port$/i) {
|
||||
my $tmp_s = $ent->{side};
|
||||
$tmp_s =~ s/a/A/;
|
||||
$tmp_s =~ s/b/B/;
|
||||
if (isIpaddr($tmp_n)) {
|
||||
$node_side_pairs{$tmp_s} = $tmp_n;
|
||||
$children_num++;
|
||||
} else {
|
||||
my $tmpip = xCAT::NetworkUtils->getipaddr($tmp_n);
|
||||
if (!$tmpip) {
|
||||
my $hoststab = xCAT::Table->new( 'hosts' );
|
||||
my $tmp = $hoststab->getNodeAttribs($tmp_n, ['ip']);
|
||||
if ($tmp->{ip}) {
|
||||
$tmpip = $tmp->{ip};
|
||||
}
|
||||
}
|
||||
if ($tmpip) {
|
||||
$node_side_pairs{$tmp_s} = $tmpip;
|
||||
$children_num++;
|
||||
}
|
||||
} # end of parse IP address for a fsp/bpa
|
||||
} # end of parse a child's side
|
||||
} #end of loop for children
|
||||
if ($children_num == 0) {
|
||||
return undef; #no children or brothers for this node.
|
||||
}
|
||||
my @keys = qw(A-0 A-1 B-0 B-1);
|
||||
my $out_strings = undef;
|
||||
foreach my $tmp (@keys) {
|
||||
if (!$node_side_pairs{$tmp}) {
|
||||
$node_side_pairs{$tmp} = '';
|
||||
}
|
||||
}
|
||||
|
||||
$out_strings = $node_side_pairs{"A-0"}.','.$node_side_pairs{"A-1"}.','.$node_side_pairs{"B-0"}.','.$node_side_pairs{"B-1"};
|
||||
|
||||
return $out_strings;
|
||||
} else {
|
||||
return undef;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
@@ -3534,7 +3724,10 @@ sub get_site_Master
|
||||
=head3 get_ServiceNode
|
||||
|
||||
Will get the Service node ( name or ipaddress) as known by the Management
|
||||
Server or Node for the input nodename or ipadress of the node
|
||||
Node or Node for the input nodename or ipadress of the node
|
||||
which can be a Service Node.
|
||||
If the input node is a Service Node then it's Service node
|
||||
is always the Management Node.
|
||||
|
||||
input: list of nodenames and/or node ipaddresses (array ref)
|
||||
service name
|
||||
@@ -3568,6 +3761,7 @@ sub get_ServiceNode
|
||||
{
|
||||
require xCAT::Table;
|
||||
my ($class, $node, $service, $request) = @_;
|
||||
|
||||
my @node_list = @$node;
|
||||
my $cmd;
|
||||
my %snhash;
|
||||
@@ -3576,8 +3770,8 @@ sub get_ServiceNode
|
||||
my $nodehmtab;
|
||||
my $noderestab;
|
||||
my $snattribute;
|
||||
my $oshash;
|
||||
my $nodetab;
|
||||
my $oshash;
|
||||
my $nodetab;
|
||||
$::ERROR_RC = 0;
|
||||
|
||||
# determine if the request is for the service node as known by the MN
|
||||
@@ -3586,33 +3780,15 @@ sub get_ServiceNode
|
||||
if ($request eq "MN")
|
||||
{
|
||||
$snattribute = "servicenode";
|
||||
|
||||
}
|
||||
else # Node
|
||||
{
|
||||
$snattribute = "xcatmaster";
|
||||
}
|
||||
|
||||
my $master =
|
||||
xCAT::Utils->get_site_Master(); # read the site table, master attrib
|
||||
|
||||
my $nimprime;
|
||||
if (xCAT::Utils->isAIX()) {
|
||||
# for AIX nodes the NIM primary will be either the site.NIMprime attr
|
||||
# or, if not set, the site.master attr
|
||||
$nimprime = xCAT::InstUtils->getnimprime();
|
||||
chomp $nimprime;
|
||||
}
|
||||
|
||||
# $master and $nimprime is possible to be the same (MN)
|
||||
# but $master is IP addr, $nimprime is short hostname
|
||||
# this results in %snhash may have two keys duplicated.
|
||||
# so use ip for nimprime.
|
||||
|
||||
my $nimprimeip = xCAT::NetworkUtils->getipaddr($nimprime);
|
||||
$nimprime = $nimprimeip;
|
||||
|
||||
# get site.master this will be the default
|
||||
my $master = xCAT::Utils->get_site_Master();
|
||||
$noderestab = xCAT::Table->new('noderes');
|
||||
$nodetab = xCAT::Table->new('nodetype');
|
||||
|
||||
unless ($noderestab) # no noderes table, use default site.master
|
||||
{
|
||||
@@ -3621,17 +3797,10 @@ sub get_ServiceNode
|
||||
|
||||
if ($master) # use site Master value
|
||||
{
|
||||
if ($nodetab) {
|
||||
$oshash = $nodetab->getNodesAttribs(\@node_list, ["os"]);
|
||||
}
|
||||
|
||||
foreach my $node (@node_list)
|
||||
{
|
||||
if ( ($oshash->{$node}->[0]->{os}) && ($oshash->{$node}->[0]->{os} eq "AIX")) {
|
||||
push @{$snhash{$nimprime}}, $node;
|
||||
} else {
|
||||
push @{$snhash{$master}}, $node;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -3640,9 +3809,6 @@ sub get_ServiceNode
|
||||
$::ERROR_RC = 1;
|
||||
}
|
||||
|
||||
if ($nodetab) {
|
||||
$nodetab->close;
|
||||
}
|
||||
return \%snhash;
|
||||
}
|
||||
|
||||
@@ -3651,30 +3817,24 @@ sub get_ServiceNode
|
||||
|
||||
$nodehash = $noderestab->getNodesAttribs(\@node_list, [$snattribute]);
|
||||
|
||||
$oshash = $nodetab->getNodesAttribs(\@node_list, ["os"]);
|
||||
|
||||
foreach my $node (@node_list)
|
||||
{
|
||||
foreach my $rec (@{$nodehash->{$node}})
|
||||
{
|
||||
if ($rec and $rec->{$snattribute})
|
||||
if ($rec and $rec->{$snattribute}) # use noderes.servicenode
|
||||
{
|
||||
my $key = $rec->{$snattribute};
|
||||
push @{$snhash{$key}}, $node;
|
||||
}
|
||||
else
|
||||
else # use site.master
|
||||
{
|
||||
if ( ($oshash->{$node}->[0]->{os}) && ($oshash->{$node}->[0]->{os} eq "AIX")) {
|
||||
push @{$snhash{$nimprime}}, $node;
|
||||
} else {
|
||||
push @{$snhash{$master}}, $node;
|
||||
}
|
||||
push @{$snhash{$master}}, $node;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$noderestab->close;
|
||||
$nodetab->close;
|
||||
return \%snhash;
|
||||
|
||||
}
|
||||
@@ -4909,6 +5069,19 @@ sub osver
|
||||
$ver =~ tr/\.//;
|
||||
$ver =~ s/[^0-9]*([0-9]+).*/$1/;
|
||||
}
|
||||
elsif (-f "/etc/lsb-release")#ubuntu
|
||||
{
|
||||
|
||||
$os = "ubuntu";
|
||||
open($relfile,"<","/etc/lsb-release");
|
||||
my @text = <$relfile>;
|
||||
close($relfile);
|
||||
foreach (@text){
|
||||
if ( $_ =~ /DISTRIB_RELEASE=(\S+)/ ) {
|
||||
$ver = $1;
|
||||
}
|
||||
}
|
||||
}
|
||||
$os = "$os" . "$ver";
|
||||
return ($os);
|
||||
}
|
||||
@@ -6233,6 +6406,7 @@ sub setAppStatus
|
||||
|
||||
my %new_nodeappstat;
|
||||
foreach my $node (keys %$nodeappstat) {
|
||||
if ( $node =~ /^\s*$/ ) { next; } # Skip blank node names
|
||||
my $new_appstat = "";
|
||||
my $changed = 0;
|
||||
|
||||
@@ -6408,188 +6582,38 @@ sub enablessh
|
||||
return $enablessh;
|
||||
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
=head3 runcmd_S
|
||||
Note this routine is being used solely by genimage to steam output. It
|
||||
will be merged with runcmd in a later release. Not all paths have been
|
||||
tested.
|
||||
Right now requires $cmd and $::CALLBACK set
|
||||
Run the given cmd and return the output in an array (already chopped).
|
||||
This routine in addition streams the output to the $::CALLBACK which is
|
||||
required input.
|
||||
Alternately, if this function is used in a scalar context, the output
|
||||
is joined into a single string with the newlines separating the lines.
|
||||
|
||||
Arguments:
|
||||
command, exitcode and reference to output
|
||||
Returns:
|
||||
see below
|
||||
Globals:
|
||||
$::RUNCMD_RC , $::CALLBACK
|
||||
Error:
|
||||
Normally, if there is an error running the cmd,it will display the
|
||||
error and exit with the cmds exit code, unless exitcode
|
||||
is given one of the following values:
|
||||
0: display error msg, DO NOT exit on error, but set
|
||||
$::RUNCMD_RC to the exit code.
|
||||
-1: DO NOT display error msg and DO NOT exit on error, but set
|
||||
$::RUNCMD_RC to the exit code.
|
||||
-2: DO the default behavior (display error msg and exit with cmds
|
||||
exit code.
|
||||
number > 0: Display error msg and exit with the given code
|
||||
|
||||
Example:
|
||||
my $outref = xCAT::Utils->runcmd($cmd, -2, 1);
|
||||
|
||||
Comments:
|
||||
If refoutput is true, then the output will be returned as a
|
||||
reference to an array for efficiency.
|
||||
|
||||
|
||||
=head3 isSELINUX
|
||||
Returns:
|
||||
returns 0 if SELINUX is enabled
|
||||
returns 1 if SELINUX is not enabled
|
||||
Globals:
|
||||
none
|
||||
Error:
|
||||
none
|
||||
Example:
|
||||
if (xCAT::Utils->isSELINUX()) { blah; }
|
||||
Comments:
|
||||
This is tested on Redhat, may need more for SLES
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
sub runcmd_S
|
||||
|
||||
sub isSELINUX
|
||||
{
|
||||
|
||||
my ($class, $cmd, $exitcode, $refoutput) = @_;
|
||||
$::RUNCMD_RC = 0;
|
||||
# redirect stderr to stdout
|
||||
if (!($cmd =~ /2>&1$/)) { $cmd .= ' 2>&1'; }
|
||||
|
||||
if ($::VERBOSE)
|
||||
{
|
||||
# get this systems name as known by xCAT management node
|
||||
my $Sname = xCAT::InstUtils->myxCATname();
|
||||
my $msg;
|
||||
if ($Sname) {
|
||||
$msg = "Running command on $Sname: $cmd";
|
||||
} else {
|
||||
$msg="Running command: $cmd";
|
||||
}
|
||||
|
||||
if ($::CALLBACK){
|
||||
my $rsp = {};
|
||||
$rsp->{data}->[0] = "$msg\n";
|
||||
xCAT::MsgUtils->message("I", $rsp, $::CALLBACK);
|
||||
} else {
|
||||
xCAT::MsgUtils->message("I", "$msg\n");
|
||||
}
|
||||
}
|
||||
# steam output to $::CALLBACK and return the buffer
|
||||
my @cmd;
|
||||
push @cmd,$cmd;
|
||||
my $outref = [];
|
||||
my $outreferr = [];
|
||||
my $cmdin;
|
||||
my $cmdout;
|
||||
my $cmderr = gensym;
|
||||
my $cmdpid = open3($cmdin,$cmdout,$cmderr,@cmd);
|
||||
my $cmdsel = IO::Select->new($cmdout,$cmderr);
|
||||
#foreach (@indata) {
|
||||
# print $cmdin $_;
|
||||
#}
|
||||
close($cmdin);
|
||||
my @handles;
|
||||
my $rsp = {};
|
||||
my $output;
|
||||
my $errout;
|
||||
while ($cmdsel->count()) {
|
||||
@handles = $cmdsel->can_read();
|
||||
foreach (@handles) {
|
||||
my $line;
|
||||
my $done = sysread $_,$line,180;
|
||||
if ($done) {
|
||||
if ($_ eq $cmdout) {
|
||||
$rsp->{data}->[0] = $line;
|
||||
xCAT::MsgUtils->message("I", $rsp, $::CALLBACK, 0);
|
||||
#push @$outref,$line;
|
||||
$output .= $line;
|
||||
} else {
|
||||
$rsp->{data}->[0] = $line;
|
||||
xCAT::MsgUtils->message("I", $rsp, $::CALLBACK, 0);
|
||||
#push @$outreferr,$line;
|
||||
$errout .= $line;
|
||||
}
|
||||
} else {
|
||||
$cmdsel->remove($_);
|
||||
close($_);
|
||||
}
|
||||
}
|
||||
if (-e "/usr/sbin/selinuxenabled") {
|
||||
`/usr/sbin/selinuxenabled`;
|
||||
if ($? == 0) {
|
||||
return 0;
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
waitpid($cmdpid,0);
|
||||
# store the return string
|
||||
push @$outref,$output;
|
||||
if ($?)
|
||||
{
|
||||
$::RUNCMD_RC = $? >> 8;
|
||||
my $displayerror = 1;
|
||||
my $rc;
|
||||
if (defined($exitcode) && length($exitcode) && $exitcode != -2)
|
||||
{
|
||||
if ($exitcode > 0)
|
||||
{
|
||||
$rc = $exitcode;
|
||||
} # if not zero, exit with specified code
|
||||
elsif ($exitcode <= 0)
|
||||
{
|
||||
$rc = ''; # if zero or negative, do not exit
|
||||
if ($exitcode < 0) { $displayerror = 0; }
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$rc = $::RUNCMD_RC;
|
||||
} # if exitcode not specified, use cmd exit code
|
||||
if ($displayerror)
|
||||
{
|
||||
my $rsp = {};
|
||||
my $errmsg = '';
|
||||
if (xCAT::Utils->isLinux() && $::RUNCMD_RC == 139)
|
||||
{
|
||||
$errmsg = "Segmentation fault $errmsg";
|
||||
}
|
||||
else
|
||||
{
|
||||
$errmsg = join('', @$outref);
|
||||
chomp $errmsg;
|
||||
|
||||
}
|
||||
if ($::CALLBACK)
|
||||
{
|
||||
$rsp->{data}->[0] =
|
||||
"Command failed: $cmd. Error message: $errmsg.\n";
|
||||
xCAT::MsgUtils->message("E", $rsp, $::CALLBACK);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
xCAT::MsgUtils->message("E",
|
||||
"Command failed: $cmd. Error message: $errmsg.\n");
|
||||
}
|
||||
$xCAT::Utils::errno = 29;
|
||||
}
|
||||
}
|
||||
if ($refoutput)
|
||||
{
|
||||
chomp(@$outref);
|
||||
return $outref;
|
||||
}
|
||||
elsif (wantarray)
|
||||
{
|
||||
chomp(@$outref);
|
||||
return @$outref;
|
||||
}
|
||||
else
|
||||
{
|
||||
my $line = join('', @$outref);
|
||||
chomp $line;
|
||||
return $line;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
1;
|
||||
|
||||
Executable
+155
@@ -0,0 +1,155 @@
|
||||
#!/bin/ksh
|
||||
trap "chmod 774 /etc/rc.tcpip" INT QUIT TERM EXIT
|
||||
|
||||
#NB: WANT TO ADD THIS BACK IN AT SOME POINT - SYSTEM HANG DETECTION DEAMON
|
||||
#shdaemon:2:off:/usr/sbin/shdaemon >/dev/console 2>&1 # High availability daemon
|
||||
rmitab shdaemon > /dev/null 2>&1
|
||||
|
||||
#to disable topasrec, which runs as a cron job, need remove the following entry from /etc/inittab:
|
||||
#xmdaily:2:once:/usr/bin/topasrec -L -s 300 -R 1 -r 6 -o /etc/perf/daily/ -ypersistent=1 2>&1 >/dev/null #Start local binary recording
|
||||
rmitab xmdaily > /dev/null 2>&1
|
||||
|
||||
#to disable PM data collection, which is really topasout, run:
|
||||
#55 23 * * * /var/perf/pm/bin/pmcfg >/dev/null 2>&1 #Enable PM Data Collection
|
||||
rmitab pmcfg > /dev/null 2>&1
|
||||
|
||||
#to disable USB audio device overhead
|
||||
#naudio2::boot:/usr/sbin/naudio2 > /dev/null
|
||||
#naudio::boot:/usr/sbin/naudio > /dev/null
|
||||
rmitab naudio > /dev/null 2>&1
|
||||
rmitab naudio2 > /dev/null 2>&1
|
||||
|
||||
#not planning on printing from P7IH:
|
||||
#piobe:2:wait:/usr/lib/lpd/pioinit_cp >/dev/null 2>&1 # pb cleanup
|
||||
rmitab piobe > /dev/null 2>&1
|
||||
|
||||
#qdaemon:23456789:wait:/usr/bin/startsrc -sqdaemon
|
||||
rmitab qdaemon > /dev/null 2>&1
|
||||
|
||||
#do we really need wpar support now?
|
||||
rcwpars:2:once:/etc/rc.wpars > /dev/console 2>&1 # Corrals autostart
|
||||
rmitab rcwpars > /dev/null 2>&1
|
||||
|
||||
#have always seen this disabled in the past
|
||||
#perfstat:2:once:/usr/lib/perf/libperfstat_updt_dictionary >/dev/console 2>&1
|
||||
rmitab perfstat > /dev/null 2>&1
|
||||
|
||||
#we aren't running GSA on PERCS machines. . .
|
||||
#gsa_updmn:2:wait:startsrc -s gsa_updmn > /dev/console 2>&1
|
||||
rmitab gsa_updmn > /dev/null 2>&1
|
||||
|
||||
#unless we really are using this we should disable for perf testing
|
||||
#artex:2:wait:/usr/sbin/artexset -c -R /etc/security/artex/config/master_profile.xml > /dev/console 2>&1
|
||||
rmitab artex > /dev/null 2>&1
|
||||
|
||||
#this is HACMP function . . .
|
||||
#clcomd:23456789:once:/usr/bin/startsrc -s clcomd
|
||||
rmitab clcomd > /dev/null 2>&1
|
||||
|
||||
#rpvserver:2:once:/etc/rc.rpvserver > /dev/console 2>&1
|
||||
rmitab rpvserver > /dev/null 2>&1
|
||||
|
||||
#ha_star:h2:once:/etc/rc.ha_star >/dev/console 2>&1
|
||||
rmitab ha_star > /dev/null 2>&1
|
||||
|
||||
#clusterconf:23456789:once:/usr/sbin/clusterconf
|
||||
rmitab clusterconf > /dev/null 2>&1
|
||||
|
||||
#this is for http://<hostname>:5335/ibm/console access, which we don't want for PERCS
|
||||
#pconsole:2:once:/usr/bin/startsrc -s pconsole > /dev/null 2>&1
|
||||
rmitab pconsole > /dev/null 2>&1
|
||||
|
||||
#contains Network load balancing kernel extensions . . . not clear for HPC yet
|
||||
#rcnetwlm:23456789:wait:/etc/rc.netwlm start> /dev/console 2>&1 # Start netwlm
|
||||
rmitab rcnetwlm > /dev/null 2>&1
|
||||
|
||||
#to disable cimservices, need to comment cimservices and platform agent:
|
||||
#cimservices:2:once:/usr/bin/startsrc -s cimsys >/dev/null 2>&1
|
||||
#platform_agent:2:once:/usr/bin/startsrc -s platform_agent >/dev/null 2>&1
|
||||
rmitab cimservices > /dev/null 2>&1
|
||||
rmitab platform_agent > /dev/null 2>&1
|
||||
|
||||
#we WILL want to add in RMC (RSCT) monitoring at some point
|
||||
#ctrmc:2:once:/usr/bin/startsrc -s ctrmc > /dev/console 2>&1
|
||||
rmitab ctrmc > /dev/null 2>&1
|
||||
|
||||
#Jugement call . . . leave in for now
|
||||
#diagd:2:once:/usr/lpp/diagnostics/bin/diagd >/dev/console 2>&1
|
||||
|
||||
#for NIM so keep for now
|
||||
#mount_tools:2:once:/usr/bin/mount_tools iofnim.austin.ibm.com > /dev/console 2>&1
|
||||
|
||||
#following are needed for HPC so leave:
|
||||
#rcsciv1:23456789:wait:/usr/bin/startsrc -s scidv1 > /dev/console 2>&1
|
||||
#pnsd:2345:once:/opt/rsct/lapi/pnsd/startpnsdAIX 1>/dev/null 2>&1
|
||||
#dscrset:2:once:/usr/sbin/dscrctl -n -s 30 >/dev/null 2>/dev/console
|
||||
|
||||
#to disable sendmail daemon, need to comment the line in /etc/rc.tcpip that begins: start /usr/lib/sendmail
|
||||
#As of 11/16/10 John L. re-enable sendmail as some subsystems want to use this for PERCS
|
||||
#Unless someone says we need it, it's back off - 4/18/11 John L.
|
||||
grep -q "^start /usr/lib/sendmail" /etc/rc.tcpip
|
||||
if [[ $? -eq 0 ]] then
|
||||
cat /etc/rc.tcpip | sed 's/^start \/usr\/lib\/sendmail/#start \/usr\/lib\/sendmail/' > /tmp/rc.tcpip.tmpfile.$$
|
||||
cp -p /etc/rc.tcpip /etc/rc.tcpip.prev
|
||||
mv /tmp/rc.tcpip.tmpfile.$$ /etc/rc.tcpip
|
||||
fi
|
||||
stopsrc -s sendmail > /dev/null 2>&1
|
||||
|
||||
|
||||
#to disable aixmibd daemon, need to comment the line in /etc/rc.tcpip that begins: start /usr/sbin/aixmibd
|
||||
grep -q "^start /usr/sbin/aixmibd" /etc/rc.tcpip
|
||||
if [[ $? -eq 0 ]] then
|
||||
cat /etc/rc.tcpip | sed 's/^start \/usr\/sbin\/aixmibd/#start \/usr\/sbin\/aixmibd/' > /tmp/rc.tcpip.tmpfile.$$
|
||||
cp -p /etc/rc.tcpip /etc/rc.tcpip.prev2
|
||||
mv /tmp/rc.tcpip.tmpfile.$$ /etc/rc.tcpip
|
||||
fi
|
||||
stopsrc -s aixmibd > /dev/null 2>&1
|
||||
|
||||
#to disable hostmibd daemon, need to comment the line in /etc/rc.tcpip that begins: start /usr/sbin/hostmibd
|
||||
grep -q "^start /usr/sbin/hostmibd" /etc/rc.tcpip
|
||||
if [[ $? -eq 0 ]] then
|
||||
cat /etc/rc.tcpip | sed 's/^start \/usr\/sbin\/hostmibd/#start \/usr\/sbin\/hostmibd/' > /tmp/rc.tcpip.tmpfile.$$
|
||||
cp -p /etc/rc.tcpip /etc/rc.tcpip.prev2
|
||||
mv /tmp/rc.tcpip.tmpfile.$$ /etc/rc.tcpip
|
||||
fi
|
||||
stopsrc -s hostmibd > /dev/null 2>&1
|
||||
|
||||
#to disable snmpmibd daemon, need to comment the line in /etc/rc.tcpip that begins: start /usr/sbin/snmpmibd
|
||||
grep -q "^start /usr/sbin/snmpmibd" /etc/rc.tcpip
|
||||
if [[ $? -eq 0 ]] then
|
||||
cat /etc/rc.tcpip | sed 's/^start \/usr\/sbin\/snmpmibd/#start \/usr\/sbin\/snmpmibd/' > /tmp/rc.tcpip.tmpfile.$$
|
||||
cp -p /etc/rc.tcpip /etc/rc.tcpip.prev2
|
||||
mv /tmp/rc.tcpip.tmpfile.$$ /etc/rc.tcpip
|
||||
fi
|
||||
stopsrc -s snmpmibd > /dev/null 2>&1
|
||||
|
||||
chmod 774 /etc/rc.tcpip
|
||||
|
||||
#try to clean up some cron junk - we only touch the crontab file once (and save a backup)
|
||||
if [[ ! -f /var/spool/cron/crontabs/root.before.clean_jitter ]] then
|
||||
cp -p /var/spool/cron/crontabs/root /var/spool/cron/crontabs/root.before.clean_jitter
|
||||
|
||||
grep -v "bin\/pmcfg" /var/spool/cron/crontabs/root | grep -v "bin\/stcron" | grep -v "bin\/dumpctr" | \
|
||||
grep -v "ras\/dumpcheck" > /var/spool/cron/crontabs/root.after.clean_jitter
|
||||
cp /var/spool/cron/crontabs/root.after.clean_jitter /var/spool/cron/crontabs/root
|
||||
fi
|
||||
|
||||
for i in $(ps -efk | grep "topasrec" | grep -v killproc | grep -v grep | awk ' {print $2} ') ; do
|
||||
kill $i
|
||||
done
|
||||
|
||||
ls -l /etc/rc.tcpip
|
||||
telinit q
|
||||
sleep 1
|
||||
|
||||
/usr/sbin/schedo -F -o tick_sync=1
|
||||
/usr/sbin/schedo -F -o big_tick_size=1
|
||||
|
||||
grep -q cosched3 /etc/poe.priority 2> /dev/null
|
||||
if [[ $? -ne 0 ]] then
|
||||
echo '* cosched1 18 100 97 10' >> /etc/poe.priority
|
||||
echo '* cosched2 13 100 99.5 10' >> /etc/poe.priority
|
||||
echo '* cosched3 13 100 99 3' >> /etc/poe.priority
|
||||
chmod 644 /etc/poe.priority
|
||||
fi
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
compilers/vac.upc.cmp
|
||||
compilers/vac.upc.help
|
||||
compilers/vac.upc.lib
|
||||
compilers/vac.upc.man
|
||||
compilers/vac.upc.rte
|
||||
compilers/vac.upc.rte.lnk
|
||||
@@ -0,0 +1,32 @@
|
||||
#!/bin/sh
|
||||
|
||||
#
|
||||
# Sample script to accept licenses for the IBM upc compilers
|
||||
# For AIX:
|
||||
# do nothing, license accepted with installp -Y flag
|
||||
# For Linux:
|
||||
# Assumes all compiler software has been installed
|
||||
|
||||
|
||||
OS=`uname`
|
||||
if [ $OS != "AIX" ]; then
|
||||
cd $installroot/
|
||||
upc_script=`find opt/ibmcmp/upc -name new_install -print`
|
||||
|
||||
if [ $NODESETSTATE == "install" ] || [ $NODESETSTATE == "boot" ]; then
|
||||
# Being run from a stateful install postscript
|
||||
if [ -n "$upc_script" ] ; then
|
||||
echo 1 | $upc_script
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ $NODESETSTATE == "genimage" ]; then
|
||||
# Being called from <image>.postinstall script
|
||||
# Assume we are on the same machine
|
||||
if [ -n "$upc_script" ] ; then
|
||||
echo 1 | chroot $installroot /$upc_script
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
@@ -60,7 +60,7 @@ if [ $OS != "AIX" ]; then
|
||||
zypper -R $installroot rr gpfs_updates
|
||||
else
|
||||
# For Redhat, etc., assume yum is available on the system running genimage
|
||||
yum --installroot $installroot --nogpgcheck localupdate $INSTALL_DIR/$UPDATES_DIR/*.rpm
|
||||
yum -y --installroot $installroot --nogpgcheck localupdate $INSTALL_DIR/$UPDATES_DIR/*.rpm
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -70,6 +70,18 @@ rm -rf $RPM_BUILD_ROOT
|
||||
|
||||
%changelog
|
||||
|
||||
%pre
|
||||
# only need to check on AIX
|
||||
%ifnos linux
|
||||
if [ -x /usr/sbin/emgr ]; then # Check for emgr cmd
|
||||
/usr/sbin/emgr -l 2>&1 | grep -i xCAT # Test for any xcat ifixes - msg and exit if found
|
||||
if [ $? = 0 ]; then
|
||||
echo "Error: One or more xCAT emgr ifixes are installed. You must use the /usr/sbin/emgr command to uninstall each xCAT emgr ifix prior to RPM installation."
|
||||
exit 2
|
||||
fi
|
||||
fi
|
||||
%endif
|
||||
|
||||
%post
|
||||
|
||||
%preun
|
||||
|
||||
+64
-48
@@ -246,6 +246,35 @@ if ($ENV{'DATABASELOC'}) # input where xcatdb is located
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
# check that they have not defined the databaseloc under the site.installoc
|
||||
# directory, default /install. This is invalid because this directory
|
||||
# is usually mounted on the Service Nodes. Error out if they do
|
||||
# this is really the attribute in installdir which I will check.
|
||||
my @installlocdir;
|
||||
my $cmd = " XCATBYPASS=1 tabdump site | grep installdir";
|
||||
my @installlocation = xCAT::Utils->runcmd($cmd, -1);
|
||||
if ($::RUNCMD_RC == 0)
|
||||
{
|
||||
(my $attr, my $installoc) = split(",", $installlocation[0]);
|
||||
(my $q,my $installpt) = split("\"", $installoc); # remove quotes
|
||||
@installlocdir = split '/', $installpt; # get the base directory
|
||||
|
||||
} else {
|
||||
$installlocdir[1] = "install"; # default
|
||||
}
|
||||
|
||||
# is it the same as the first directory in databaseloc
|
||||
my @dblocdir = split '/', $::databaselocdir; # get the base directory
|
||||
$installlocdir[1] =~ s/\s*//g; #remove blanks
|
||||
$dblocdir[1] =~ s/\s*//g; #remove blanks
|
||||
if ($installlocdir[1] eq $dblocdir[1] ) { # if they match,error
|
||||
xCAT::MsgUtils->message("E", "The site databaseloc attribute is set to the directory or a sub-directory of the site table installloc or installdir attribute or the default of /install. This is not a supported configuration.");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (!(-e $::databaselocdir)){ # if it does not exist, create it
|
||||
my $cmd = "mkdir -p $::databaselocdir";
|
||||
xCAT::Utils->runcmd($cmd, 0);
|
||||
@@ -968,46 +997,6 @@ sub setupinstance
|
||||
{
|
||||
xCAT::MsgUtils->message("SI", " $cmd warning.");
|
||||
}
|
||||
# add export of EXTSHM to /etc/rc.db2 on AIX, so env variable will
|
||||
# be exported when db2fmcd starts the database on reboot
|
||||
my $message;
|
||||
if ($::osname eq 'AIX') {
|
||||
my $rcdb2file="/etc/rc.db2";
|
||||
my $entry="EXTSHM=ON\nexport EXTSHM";
|
||||
my $entry2="#!/usr/bin/ksh \nEXTSHM=ON\nexport EXTSHM";
|
||||
if (-e($rcdb2file)) { # add to file
|
||||
$cmd = "fgrep EXTSHM $rcdb2file"; # check to see if there
|
||||
xCAT::Utils->runcmd($cmd, -1);
|
||||
if ($::RUNCMD_RC != 0) # if not there
|
||||
{
|
||||
$cmd = "echo \"$entry\" >> $rcdb2file";
|
||||
xCAT::Utils->runcmd($cmd, 0);
|
||||
if ($::RUNCMD_RC != 0)
|
||||
{
|
||||
$message = "$cmd failed. Could not setup $rcdb2file. This will affect running ISNM on the system.";
|
||||
xCAT::MsgUtils->message("E", "$message");
|
||||
}
|
||||
}
|
||||
} else{ # create the file
|
||||
$cmd = "echo \"$entry2\" >> $rcdb2file";
|
||||
xCAT::Utils->runcmd($cmd, 0);
|
||||
if ($::RUNCMD_RC != 0)
|
||||
{
|
||||
$message = "$cmd failed. Could not setup $rcdb2file. This will affect running ISNM on the system. Please check documentation for manual setup. ";
|
||||
xCAT::MsgUtils->message("E", "$message");
|
||||
} else {
|
||||
$cmd = "chmod 554 $rcdb2file";
|
||||
xCAT::Utils->runcmd($cmd, 0);
|
||||
if ($::RUNCMD_RC != 0)
|
||||
{
|
||||
xCAT::MsgUtils->message("E", " $cmd failed.");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1067,27 +1056,39 @@ sub setupdb2env
|
||||
}
|
||||
else
|
||||
{ # LInux
|
||||
my $cmd = "egrep -i \"DB2INSTANCE\" /etc/profile.d/xcat.sh";
|
||||
my $cmd = "egrep -i \"DB2INSTANCE\" /etc/profile.d/xcatdb2.sh";
|
||||
xCAT::Utils->runcmd($cmd, -1);
|
||||
if ($::RUNCMD_RC != 0)
|
||||
{ # if not already there
|
||||
open(FILE, ">>/etc/profile.d/xcat.sh")
|
||||
or die "cannot open file /etc/profile.d/xcat.sh\n";
|
||||
open(FILE, ">>/etc/profile.d/xcatdb2.sh")
|
||||
or die "cannot open file /etc/profile.d/xcatdb2.sh\n";
|
||||
print FILE "export DB2INSTANCE=xcatdb \n";
|
||||
print FILE "export EXTSHM=ON \n";
|
||||
close FILE;
|
||||
}
|
||||
my $cmd = "egrep -i \"DB2INSTANCE\" /etc/profile.d/xcat.csh";
|
||||
my $cmd = "egrep -i \"DB2INSTANCE\" /etc/profile.d/xcatdb2.csh";
|
||||
xCAT::Utils->runcmd($cmd, -1);
|
||||
if ($::RUNCMD_RC != 0)
|
||||
{ # if not already there
|
||||
open(FILE, ">>/etc/profile.d/xcat.csh")
|
||||
or die "cannot open file /etc/profile.d/xcat.csh\n";
|
||||
open(FILE, ">>/etc/profile.d/xcatdb2.csh")
|
||||
or die "cannot open file /etc/profile.d/xcatdb2.csh\n";
|
||||
print FILE "setenv DB2INSTANCE \"xcatdb\" \n";
|
||||
print FILE "setenv EXTSHM \"ON\" \n";
|
||||
close FILE;
|
||||
|
||||
}
|
||||
$cmd = "chmod 755 /etc/profile.d/xcatdb2.sh";
|
||||
xCAT::Utils->runcmd($cmd, 0);
|
||||
if ($::RUNCMD_RC != 0)
|
||||
{
|
||||
xCAT::MsgUtils->message("SE", " $cmd failed.");
|
||||
}
|
||||
$cmd = "chmod 755 /etc/profile.d/xcatdb2.csh";
|
||||
xCAT::Utils->runcmd($cmd, 0);
|
||||
if ($::RUNCMD_RC != 0)
|
||||
{
|
||||
xCAT::MsgUtils->message("SE", " $cmd failed.");
|
||||
}
|
||||
my $path = $::installdb2dir;
|
||||
$path .="\/lib64";
|
||||
# add path of db2 libraries to ld.so.conf
|
||||
@@ -1955,7 +1956,7 @@ sub adddb2paths
|
||||
}
|
||||
else #Linux
|
||||
{
|
||||
my $profname = "/etc/profile.d/xcat.sh";
|
||||
my $profname = "/etc/profile.d/xcatdb2.sh";
|
||||
my $cmd = qq~cat $profname | grep "db2"~;
|
||||
my $outref = xCAT::Utils->runcmd("$cmd", -1);
|
||||
if ($::RUNCMD_RC != 0)
|
||||
@@ -1980,7 +1981,7 @@ sub adddb2paths
|
||||
xCAT::MsgUtils->message('E', "Could not update $profname.");
|
||||
}
|
||||
}
|
||||
my $profname = "/etc/profile.d/xcat.csh";
|
||||
my $profname = "/etc/profile.d/xcatdb2.csh";
|
||||
my $cmd = qq~cat $profname | grep "db2"~;
|
||||
my $outref = xCAT::Utils->runcmd("$cmd", -1);
|
||||
if ($::RUNCMD_RC != 0)
|
||||
@@ -2004,6 +2005,19 @@ sub adddb2paths
|
||||
{
|
||||
xCAT::MsgUtils->message('E', "Could not update $profname.");
|
||||
}
|
||||
# set correct permissions
|
||||
$cmd = "chmod 755 /etc/profile.d/xcatdb2.sh";
|
||||
xCAT::Utils->runcmd($cmd, 0);
|
||||
if ($::RUNCMD_RC != 0)
|
||||
{
|
||||
xCAT::MsgUtils->message("SE", " $cmd failed.");
|
||||
}
|
||||
$cmd = "chmod 755 /etc/profile.d/xcatdb2.csh";
|
||||
xCAT::Utils->runcmd($cmd, 0);
|
||||
if ($::RUNCMD_RC != 0)
|
||||
{
|
||||
xCAT::MsgUtils->message("SE", " $cmd failed.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2013,6 +2027,8 @@ sub adddb2paths
|
||||
|
||||
remove DB2 on management node or service node. if you want to remove it
|
||||
from service node, you should use -s and -r flag together.
|
||||
Note this function is not supported and the code has not been
|
||||
kept up to date
|
||||
|
||||
=cut
|
||||
|
||||
|
||||
@@ -49,12 +49,14 @@ my $mode;
|
||||
sub print_usage
|
||||
{
|
||||
print "Usage:\n";
|
||||
print " genimage\n\n";
|
||||
print ' genimage -o <osver> [-a <arch>] -p <profile> -i <nodebootif> -n <nodenetdrivers> [-r <otherifaces>] [-k <kernelver>] [-g <krpmver>] [-m statelite] [-l rootlimitsize] [-t tmplimitsize] [--permission <permission>]'."\n\n";
|
||||
print ' genimage [-o <osver>] [-a <arch>] [-p <profile>] [-i <nodebootif>] [-n <nodenetdrivers>] [-r <otherifaces>] [-k <kernelver>] [-g <krpmver>] [-m statelite] [-l rootlimitsize] [-t tmplimitsize] [--permission <permission>] <imagename>'."\n\n";
|
||||
print " --permission is used for statelite only\n";
|
||||
print " -g is used for SLES only\n\n";
|
||||
print " -m is used for urbuntu, debian and fedora12 only\n\n";
|
||||
print "Examples:\n";
|
||||
print " genimage\n";
|
||||
print " genimage -i eth0 -n tg3 -o sles11 -p compute\n";
|
||||
print " genimage -i eth0 -r eth1,eth2 -n tg3,bnx2 -o centos5.1 -p compute\n";
|
||||
print " genimage -i eth0 -n tg3,bnx2 -o sles11 -p compute\n";
|
||||
|
||||
@@ -186,7 +186,7 @@ if (-e ("/etc/xcat/cfgloc")) # check to see if xcat is using mysql
|
||||
if ($::INIT)
|
||||
{
|
||||
my $message =
|
||||
"The /opt/xcat/cfgloc file is already configured for MySQL. xcat database initialization will not take place.";
|
||||
"The /etc/xcat/cfgloc file is already configured for MySQL. xcat database initialization will not take place.";
|
||||
xCAT::MsgUtils->message("I", "$message");
|
||||
}
|
||||
$::xcatrunningmysql = 1;
|
||||
@@ -475,7 +475,7 @@ sub setulimits
|
||||
print LIMITSTMP " data= -1\n";
|
||||
print LIMITSTMP " rss= -1\n";
|
||||
print LIMITSTMP " stack= -1\n";
|
||||
print LIMITSTMP " nofiles= -1\n";
|
||||
print LIMITSTMP " nofiles= 102400\n";
|
||||
print LIMITSTMP "\n";
|
||||
$rootstanza = 1;
|
||||
}
|
||||
|
||||
@@ -118,7 +118,10 @@ foreach my $interf (@interfaces) {
|
||||
if ($interf) {
|
||||
# make a copy of the node list and add the interface on
|
||||
$noderef = [ @nodes ];
|
||||
foreach (@$noderef) { s/$/-$interf/; }
|
||||
foreach (@$noderef) {
|
||||
s/-hf\d$//;
|
||||
s/$/-$interf/;
|
||||
}
|
||||
}
|
||||
else {
|
||||
$noderef = \@nodes; # use the original node list
|
||||
|
||||
@@ -10,7 +10,7 @@ use Cwd;
|
||||
use File::Basename;
|
||||
use xCAT::MsgUtils;
|
||||
use xCAT::Client;
|
||||
|
||||
use strict;
|
||||
use Getopt::Std;
|
||||
|
||||
my $bname = basename($0);
|
||||
@@ -54,8 +54,9 @@ else
|
||||
$cmdref->{cwd}->[0] = cwd();
|
||||
# get info from files piped in as stdin
|
||||
my $data;
|
||||
if (($^O =~ /^linux/i) && ($ENV{'SHELL'} =~ /\/ksh$/))
|
||||
if ( (($^O =~ /^linux/i) && ($ENV{'SHELL'} =~ /\/ksh$/)) || !defined($ENV{'TERM'}) )
|
||||
{
|
||||
my $rout;
|
||||
my $rin="";
|
||||
vec($rin,fileno(STDIN),1)=1;
|
||||
my $nfound=select($rout=$rin,"","",1);
|
||||
@@ -112,7 +113,7 @@ my @checkcmds = ("nimnodeset", "mkdsklsnode", "rmdsklsnode", "xcat2nim", "nimnod
|
||||
if (grep(/^$bname$/, @checkcmds) ) {
|
||||
# strip off all options
|
||||
# use getopt instead of getopts to let long options pass through
|
||||
getopt('bdismotp');
|
||||
getopt('dismot');
|
||||
# check the operands for a noderange
|
||||
while (my $a = shift(@ARGV)) {
|
||||
if (!($a =~ /=/) && !($a =~ /^-/)) {
|
||||
|
||||
@@ -70,6 +70,7 @@ location=""
|
||||
osimage=""
|
||||
cmd_string=""
|
||||
verbose=0
|
||||
error=0
|
||||
|
||||
usage="Usage:\n\txcatchroot -h\n\txcatchroot [-V] -i osimage cmd_string"
|
||||
|
||||
@@ -254,7 +255,19 @@ else
|
||||
then
|
||||
echo "Running command: ${chroot} /usr/xcatchrootscript\n"
|
||||
fi
|
||||
${chroot} /usr/xcatchrootscript
|
||||
msg=`${chroot} /usr/xcatchrootscript`
|
||||
|
||||
rc=$?
|
||||
|
||||
echo "\n\n$msg\n\n"
|
||||
|
||||
if [ ${rc} -ne 0 ]
|
||||
then
|
||||
error=1
|
||||
echo "\nError: The chroot command failed for '$cmd_string'."
|
||||
echo "Error: The return code from chroot was '${rc}'\n"
|
||||
fi
|
||||
|
||||
|
||||
# sensitive process has completed
|
||||
${M_CHATTR} -a Rstate=available $spotObj
|
||||
@@ -268,13 +281,11 @@ else
|
||||
fi
|
||||
|
||||
# remove the tmp script
|
||||
if [ $verbose -eq 1 ]
|
||||
then
|
||||
echo "Running command: 'rm $location/xcatchrootscript'\n"
|
||||
fi
|
||||
`rm $location/xcatchrootscript`
|
||||
|
||||
# echo "\nNote: Be sure to perform the NIM check operation after completing NIM spot\nupdates. (ex. 'nim -o check <spot_name>')"
|
||||
/usr/bin/rm $location/xcatchrootscript
|
||||
|
||||
# all done
|
||||
if [ $error -eq 1 ]
|
||||
then
|
||||
exit 1
|
||||
fi
|
||||
exit 0
|
||||
|
||||
@@ -16,18 +16,35 @@ use Cwd;
|
||||
use File::Basename;
|
||||
#use Data::Dumper;
|
||||
use xCAT::Client;
|
||||
|
||||
use strict;
|
||||
my $bname = basename($0);
|
||||
my $cmdref;
|
||||
if ($bname =~ /xcatclient/) { $cmdref->{command}->[0]=shift @ARGV; } # xcatclient was invoked directly and the 1st arg is cmd name that is used to locate the plugin
|
||||
else { $cmdref->{command}->[0] = $bname; } # the cmd was sym linked to xcatclient
|
||||
$cmdref->{cwd}->[0] = cwd();
|
||||
|
||||
if (-p STDIN) {
|
||||
my $data;
|
||||
while ( <STDIN> ) { $data.=$_; }
|
||||
$cmdref->{stdin}->[0]=$data;
|
||||
my $data;
|
||||
# allows our plugins to get the stdin of the cmd that invoked the plugin
|
||||
if ( (($^O =~ /^linux/i) && ($ENV{'SHELL'} =~ /\/ksh$/)) || !defined($ENV{'TERM'}) )
|
||||
{
|
||||
my $rin="";
|
||||
my $rout;
|
||||
vec($rin,fileno(STDIN),1)=1;
|
||||
my $nfound=select($rout=$rin,"","",1);
|
||||
if ($nfound)
|
||||
{
|
||||
while ( <STDIN> ) { $data.=$_; }
|
||||
$cmdref->{stdin}->[0]=$data;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (-p STDIN) {
|
||||
while ( <STDIN> ) { $data.=$_; }
|
||||
$cmdref->{stdin}->[0]=$data;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
my $arg;
|
||||
my @tmpargv = @ARGV;
|
||||
|
||||
@@ -11,18 +11,35 @@ use lib "$::XCATROOT/lib/perl";
|
||||
use Cwd;
|
||||
use File::Basename;
|
||||
use xCAT::Client;
|
||||
use strict;
|
||||
|
||||
my $bname = basename($0);
|
||||
my $cmdref;
|
||||
if ($bname =~ /xcatclientnnr/) { $cmdref->{command}->[0]=shift @ARGV; } # xcatclientnnr was invoked directly and the 1st arg is cmd name that is used to locate the plugin
|
||||
else { $cmdref->{command}->[0] = $bname; } # the cmd was sym linked to xcatclientnnr
|
||||
$cmdref->{cwd}->[0] = cwd();
|
||||
|
||||
if (-p STDIN) {
|
||||
my $data;
|
||||
while ( <STDIN> ) { $data.=$_; }
|
||||
$cmdref->{stdin}->[0]=$data;
|
||||
my $data;
|
||||
# allows our plugins to get the stdin of the cmd that invoked the plugin
|
||||
if ( (($^O =~ /^linux/i) && ($ENV{'SHELL'} =~ /\/ksh$/)) || !defined($ENV{'TERM'}) )
|
||||
{
|
||||
my $rout;
|
||||
my $rin="";
|
||||
vec($rin,fileno(STDIN),1)=1;
|
||||
my $nfound=select($rout=$rin,"","",1);
|
||||
if ($nfound)
|
||||
{
|
||||
while ( <STDIN> ) { $data.=$_; }
|
||||
$cmdref->{stdin}->[0]=$data;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (-p STDIN) {
|
||||
while ( <STDIN> ) { $data.=$_; }
|
||||
$cmdref->{stdin}->[0]=$data;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
push (@{$cmdref->{arg}}, @ARGV);
|
||||
foreach (keys %ENV) {
|
||||
|
||||
@@ -12,8 +12,8 @@ B<cfm2xcat> [B<-h>]
|
||||
=head1 B<DESCRIPTION>
|
||||
|
||||
Copy the cfm2xcat command to the CSM Management Server. Run the command, indicating where you want your files saved with the -i and -o flags. They can be in the same directory.
|
||||
The cfm2xcat command will run cfmupdatenode -a, saving the generated CFM distribution files. From those distribution files, it will generate xdcp rsync input files (-F option on xdcp).
|
||||
Check the rsync files generated. There will be a file generated from the input -o option on the command, and the same file with a (.nr) extension generated for each different noderange that will used to sync files based on your CFM setup in CSM. The file will contain the rsync file list. The file.nr will contain the noderange. If multiple noderanges then the input name will be appended with a number.
|
||||
The cfm2xcat command will run cfmupdatenode -a, saving the generated CFM distribution files in the directory indicates with (-i). From those distribution files, it will generate xdcp rsync input files (-F option on xdcp) in the directory indicated by ( -o).
|
||||
Check the rsync files generated. There will be a file generated (rsyncfiles) from the input -o option on the command, and the same file with a (.nr) extension generated for each different noderange that will used to sync files based on your CFM setup in CSM. The rsyncfiles will contain the rsync file list. The rsyncfiles.nr will contain the noderange. If multiple noderanges then the file name (rsyncfiles) will be appended with a number.
|
||||
|
||||
=head1 OPTIONS
|
||||
|
||||
@@ -37,10 +37,11 @@ B<-o> Path of the xdcp rsync input file generated from the CFM distribu
|
||||
B<cfm2xcat -i /tmp/cfm/cfmdistfiles -o /tmp/cfm/rsyncfiles>
|
||||
|
||||
|
||||
2. To use the file on the xCAT Management Node, after copying to /tmp/cfm:
|
||||
2. To use the file on the xCAT Management Node copy to /tmp/cfm on the xCAT MN:
|
||||
|
||||
B<xdcp ^/tmp/cfm/rsyncfiles.nr -F /tmp/cfm/rsyncfiles>
|
||||
|
||||
B<xdcp ^/tmp/cfm/rsyncfiles.nr1 -F /tmp/cfm/rsyncfiles1>
|
||||
B<xdcp ^/tmp/cfm/rsyncfiles.nr2 -F /tmp/cfm/rsyncfiles2>
|
||||
|
||||
|
||||
=head1 FILES
|
||||
|
||||
@@ -96,7 +96,7 @@ Indicates that the file being piped to the command is in stanza format. See the
|
||||
|
||||
To change a site definition.
|
||||
|
||||
chdef -t site -o clustersite rsh=/bin/rsh rcp=/bin/rcp installdir=/xcatinstall
|
||||
chdef -t site -o clustersite installdir=/xcatinstall
|
||||
|
||||
=item 2.
|
||||
|
||||
@@ -154,6 +154,12 @@ To change the node hwtype, this command will change the value of ppc.nodetype.
|
||||
|
||||
chdef -t node -o node1 hwtype=lpar
|
||||
|
||||
=item 11.
|
||||
|
||||
To change the policy table for policy number 7.0 for admin1
|
||||
|
||||
chdef -t policy -o 7.0 name=admin1 rule=allow
|
||||
|
||||
=back
|
||||
|
||||
|
||||
|
||||
@@ -21,6 +21,11 @@ The command gets the name of the lpp_source resource from the xCAT osimage
|
||||
definition and the location of the lpp_source directory from the NIM resource
|
||||
definition.
|
||||
|
||||
It will check for installp, rpm and emgr type packages.
|
||||
|
||||
Note: Remember to use the prefixes, "I:", "R:", and "E:", respectively,
|
||||
when specifying package names in an installp_bundle file or an otherpkgs list.
|
||||
|
||||
In addition to checking for missing software the chkosimage command will
|
||||
also check to see if there are multiple matches. This could happen
|
||||
when you use wildcards in the software file names. For example, if you
|
||||
|
||||
@@ -90,7 +90,7 @@ Starting numeric id of the newly created partitions. For Power 775 using Direct
|
||||
|
||||
=item B<-m>
|
||||
|
||||
memory interleaving. The value only could be B<interleaved> or B<non-interleaved>. B<non-interleaved> mode means the memory cannot be shared across the processors in an octant. B<interleaved> means the memory can be shared. The default value is B<non-interleaved> .
|
||||
memory interleaving. The setting value only could be B<1> or B<2>. B<2> means B<non-interleaved> mode (also 2MC mode), the memory cannot be shared across the processors in an octant. B<1> means B<interleaved> mode (also 8MC mode) , the memory can be shared. The default value is B<1> .
|
||||
|
||||
=item B<-r>
|
||||
|
||||
@@ -190,7 +190,7 @@ Output is similar to:
|
||||
|
||||
then:
|
||||
|
||||
chvm lpar1 -i 1 -m non-interleaved -r 0:1
|
||||
chvm lpar1 -i 1 -m 1 -r 0:1
|
||||
|
||||
Output is similar to:
|
||||
|
||||
@@ -203,7 +203,7 @@ Output is similar to:
|
||||
|
||||
then:
|
||||
|
||||
chvm lpar1-lpar8 -i 1 -m non-interleaved -r 0-7:1
|
||||
chvm lpar1-lpar8 -i 1 -m 1 -r 0-7:1
|
||||
|
||||
Output is similar to:
|
||||
|
||||
@@ -223,7 +223,7 @@ Output is similar to:
|
||||
|
||||
then:
|
||||
|
||||
chvm lpar1-lpar9 -i 1 -m non-interleaved -r 0:5,1-7:1
|
||||
chvm lpar1-lpar9 -i 1 -m 1 -r 0:5,1-7:1
|
||||
|
||||
Output is similar to:
|
||||
|
||||
|
||||
@@ -6,12 +6,18 @@ B<dumpxCATdb> - dumps the xCAT db tables .
|
||||
|
||||
B<dumpxCATdb> [B<-a>] [B<-V>] [{B<-p>|B<--path>} I<path>]
|
||||
|
||||
B<dumpxCATdb> [B<-b>] [B<-V>] [{B<-p>|B<--path>} I<path>]
|
||||
|
||||
B<dumpxCATdb> [B<-h>|B<--help>] [B<-v>|B<--version>]
|
||||
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
The dumpxCATdb command creates .csv files for xCAT database tables and puts them in the directory given by the -p flag. These files can be used by the restorexCATdb command to restore the database. The command will read the list of tables in the site.skiptables attribute and not backup those tables.
|
||||
If not using the binary dump option (-b), then the dumpxCATdb command creates .csv files for xCAT database tables and puts them in the directory given by the -p flag. These files can be used by the restorexCATdb command to restore the database. The command will read the list of tables in the site.skiptables attribute and not backup those tables.
|
||||
Supports using XCAT_SKIPTABLES env variable to provide a list of skip tables.
|
||||
The command will never backup TEAL or ISNM tables, except isnm_config. To dump TEAL tables use the documented process for TEAL. For ISNM use tabdump, after using tabprune to get to prune unnecessary records.
|
||||
|
||||
If using the binary dump option for the DB2 database, then the routine will use the Database provide utilites for backup of the entire DB2 database.
|
||||
|
||||
=head1 OPTIONS
|
||||
|
||||
@@ -24,6 +30,8 @@ B<-V> Verbose.
|
||||
|
||||
B<-a> All,without this flag the eventlog and auditlog will be skipped.
|
||||
|
||||
B<-b> This flag is only used for the DB2 database. The routine will use the DB2 backup utilities to create a binary backup of the entire DB2 database. Note to use this backup, you will have first had to modify the logging of the database and have taken an offline initial backup. Refer to the xCAT DB2 documentation for more instructions.
|
||||
|
||||
B<-p> Path to the directory to dump the tables. It will be created, if it does not exist.
|
||||
|
||||
|
||||
@@ -43,10 +51,23 @@ B<dumpxCATdb -p /tmp/db>
|
||||
|
||||
B<dumpxCATdb -a -p /tmp/db>
|
||||
|
||||
2. To have dumpxCATdb not backup the hosts or passwd table:
|
||||
3. To have dumpxCATdb not backup the hosts or passwd table:
|
||||
|
||||
B<chtab key=skiptables site.value="hosts,passwd">
|
||||
|
||||
B<dumpxCATdb -p /tmp/db>
|
||||
|
||||
4. To have dumpxCATdb not backup the hosts or passwd table:
|
||||
|
||||
B<export XCAT_SKIPTABLES="hosts,passwd">
|
||||
|
||||
B<dumpxCATdb -p /tmp/db>
|
||||
|
||||
5. To have dumpxCATdb use DB2 utilities to backup the DB2 database:
|
||||
|
||||
B<dumpxCATdb -b -p /install/db2backup>
|
||||
|
||||
|
||||
=head1 FILES
|
||||
|
||||
/opt/xcat/sbin/dumpxCATdb
|
||||
|
||||
@@ -4,38 +4,61 @@ B<genimage> - Generates a stateless image to be used for a diskless install.
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
B<genimage> B<-o> I<OS> B<-p> I<profile> [B<-i> I<nodebootif>] [B<-n> I<nodenetdrivers>] [B<-l> I<rootlimit>] [B<-r> I<additional_nics>] [B<-k> I<kernel_version>] [B<-g> I<krpm_version>] [B<-m> statelite] [B<--permission> I<permission>]
|
||||
B<genimage>
|
||||
|
||||
B<genimage> B<-o> I<osver> [B<-a> I<arch>] B<-p> I<profile> B<-i> I<nodebootif> B<-n> I<nodenetdrivers> [B<-r> I<otherifaces>] [B<-k> I<kernelver>] [B<-g> I<krpmver>] [B<-m> I<statelite>] [B<-l> I<rootlimitsize>] [B<-t> I<tmplimitsize>] [B<--permission> I<permission>]
|
||||
|
||||
B<genimage> [B<-o> I<osver>] [B<-a> I<arch>] [B<-p> I<profile>] [B<-i> I<nodebootif>] [B<-n> I<nodenetdrivers>] [B<-r> I<otherifaces>] [B<-k> I<kernelver>] [B<-g> I<krpmver>] [B<-m> I<statelite>] [B<-l> I<rootlimitsize>] [B<-t> I<tmplimitsize>] [B<--permission> I<permission>] I<imagename>
|
||||
|
||||
B<genimage> [B<-o> I<OS>] [B<-l> I<rootlimit>] [B<-i> I<nodebootif>] [B<-n> I<nodenetdrivers>] [B<-r> I<additional_nics>] [B<-k> I<kernel_version>] [B<-g> I<krpm_version>] [B<-m> statelite] imagename
|
||||
|
||||
B<genimage> [B<-h> | B<--help> | B<-v> | B<--version>]
|
||||
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
Generates a stateless image that can be used to boot xCAT nodes in a diskless mode.
|
||||
Generates a stateless and a statelite image that can be used to boot xCAT nodes in a diskless mode.
|
||||
If I<imagename> is not specified, the default packages included
|
||||
(and excluded) in the image are specified by /opt/xcat/share/xcat/netboot/<OS>/<profile>.<OS>.<arch>.pkglist and
|
||||
/opt/xcat/share/xcat/netboot/<OS>/<profile>.exlist.
|
||||
Additional packages that are not from the os distro can be specified in a <profile><OS>.<arch>.otherpkgs.pkglist file.
|
||||
Customized package list files can be specified under /install/custom/netboot/<OS> directory. The generated image will be put in /install/netboot/<OS>/<arch>/<profile>.
|
||||
(and excluded) in the image are specified by
|
||||
|
||||
If I<imagename> is specified, the package list files are specified in the I<osimage> table and I<linuximage> table.
|
||||
If B<genimage> runs on the Management node, both the I<osimage> table and I<linuximage> table will be updated following the B<genimage> options. And, if there is no I<imagename> called <OS>-<arch>-netboot-<profile> or <OS>-<arch>-statelite-<profile>, the B<genimage> command will create them into I<linuximage> and I<osimage> tables.
|
||||
/opt/xcat/share/xcat/netboot/<os>/<profile>[.<osver>][.<arch>].pkglist and
|
||||
|
||||
/opt/xcat/share/xcat/netboot/<os>/<profile>[.<osver>][.<arch>].exlist.
|
||||
|
||||
Additional packages that are not from the os distro can be specified in a
|
||||
|
||||
/opt/xcat/share/xcat/netboot/<os>/<profile>[.<osver>][.<arch>].otherpkgs.pkglist file.
|
||||
|
||||
Customized package list files can be specified under /install/custom/netboot/<os> directory. The generated image will be put in /install/netboot/<osver>/<arch>/<profile> directory.
|
||||
|
||||
The newly generated image names will have the following format:
|
||||
|
||||
for stateless: <osver>-<arch>-netboot-<profile>
|
||||
|
||||
for statelite: <osver>-<arch>-statelite-<profile>
|
||||
|
||||
B<genimage> command will create them into I<linuximage> and I<osimage> tables.
|
||||
|
||||
If I<imagename> is specified, the package list file names are read from the I<osimage> table and I<linuximage> tables.
|
||||
|
||||
If B<genimage> runs on the management node, both the I<osimage> table and I<linuximage> table will be updated with the given values from the options.
|
||||
|
||||
The B<genimage> command will generate two initial ramdisks for B<stateless> and B<statelite>, one is B<initrd-stateless.gz>, the other one is B<initrd-statelite.gz>.
|
||||
|
||||
After your image is created, you can chroot to the
|
||||
image, install any additional software you would like, or make modifications to files, and then run the following command to prepare the image for deployment.
|
||||
|
||||
for stateless: B<packimage>
|
||||
|
||||
for statelite: B<liteimg>
|
||||
|
||||
Becides prompting for the input for some flags, the B<genimage> command can not be used in interactive mode. If any of the rpms or other scripts prompt, such as to accept a license agreement, you must use the genimage script specific to your OS from the /opt/xcat/share/xcat/netboot/<os> directory.
|
||||
|
||||
The B<genimage> command must be run on a system that is the same architecture as the nodes it will be
|
||||
used on. If the management node is not the same architecture, copy the contents of
|
||||
/opt/xcat/share/xcat/netboot/<OS> to a system that is the proper architecture, and mount /install from
|
||||
the management node to that system.
|
||||
/opt/xcat/share/xcat/netboot/<os> to a system that is the proper architecture, and mount /install from
|
||||
the management node to that system. Then change directory to /opt/xcat/share/xcat/netboot/<os> and run ./genimage.
|
||||
|
||||
The B<genimage> command will run geninitrd automatically. (You can run geninitrd yourself at a later time, if
|
||||
you want to rebuild the initrd.) After your image is created, you can chroot to the
|
||||
image, install any additional software you would like, or make modifications to files, and then run
|
||||
B<packimage> to prepare the image for deployment.
|
||||
|
||||
The B<genimage> and B<geninitrd> commands will generate two initial ramdisks for B<statelite> and B<stateless>, one is B<initrd-statelite.gz>, the other one is B<initrd-stateless.gz>.
|
||||
|
||||
The B<genimage> command can not be used in interactive mode. If any of the rpms or other scripts prompt, such as to accept a license agreement, you must use the genimage script specific to your OS from the /opt/xcat/share/xcat/netboot/<os> directory.
|
||||
|
||||
=head1 Parameters
|
||||
|
||||
@@ -46,25 +69,25 @@ I<imagename> specifies the name of a os image definition to be used. The specifi
|
||||
|
||||
=over 12
|
||||
|
||||
=item B<-o> I<OS>
|
||||
=item B<-a> I<arch>
|
||||
|
||||
The hardware architecture of this node: x86_64, ppc64, x86, ia64, etc. If omitted, the current hardware architecture will be used.
|
||||
|
||||
=item B<-o> I<osver>
|
||||
|
||||
The operating system for the image: fedora8, rhel5, sles10, etc. The OS packages must be in
|
||||
/install/<OS>/<arch> (use L<copycds(8)|copycds.8>).
|
||||
/install/<osver>/<arch> (use L<copycds(8)|copycds.8>).
|
||||
|
||||
=item B<-p> I<profile>
|
||||
|
||||
The profile (e.g. compute, service) to use to create the image. This determines what package lists are
|
||||
used from /opt/xcat/share/xcat/netboot/<OS> to create the image with. When deploying nodes with this image,
|
||||
used from /opt/xcat/share/xcat/netboot/<os> to create the image with. When deploying nodes with this image,
|
||||
the nodes' nodetype.profile attribute must be set to this same value.
|
||||
|
||||
=item B<-i> I<nodebootif>
|
||||
|
||||
The network interface the diskless node will boot over (e.g. eth0).
|
||||
|
||||
=item B<--permission> I<permission>
|
||||
|
||||
The mount permission of B</.statelite> directory for B<statelite> mode, which is only used for B<statelite> mode, and the default permission is 755.
|
||||
|
||||
=item B<-n> I<nodenetdrivers>
|
||||
|
||||
This argument is now optional, and allows you to specify the driver
|
||||
@@ -81,16 +104,20 @@ which may prove important in some cases.
|
||||
|
||||
The maximum size allowed for the root file system in the image. Specify in bytes, or can append k, m, or g.
|
||||
|
||||
=item B<-r> I<additional_nics>
|
||||
=item B<--permission> I<permission>
|
||||
|
||||
The mount permission of B</.statelite> directory for B<statelite> mode, which is only used for B<statelite> mode, and the default permission is 755.
|
||||
|
||||
=item B<-r> I<otherifaces>
|
||||
|
||||
Other network interfaces (e.g. eth1) in the image that should be configured via DHCP.
|
||||
|
||||
=item B<-k> I<kernel_version>
|
||||
=item B<-k> I<kernelver>
|
||||
|
||||
Use this flag if you want to use a specific version of the kernel in the image. Defaults to the first kernel found
|
||||
in the install image.
|
||||
|
||||
=item B<-g> I<krpm_version>
|
||||
=item B<-g> I<krpmver>
|
||||
|
||||
This flag is for SLES only. Use this flag to specify the rpm version for kernel packages in the image. It must be present if -k flag is specified in the command for SLES.
|
||||
|
||||
@@ -121,16 +148,39 @@ Display usage message.
|
||||
|
||||
=over 3
|
||||
|
||||
=item 1.
|
||||
=item 1
|
||||
To prompt the user for inputs:
|
||||
|
||||
For example, to generate a fedora8 image for a compute node architecture
|
||||
genimage
|
||||
|
||||
=item 2
|
||||
|
||||
To generate a fedora8 image for a compute node architecture
|
||||
x86_64 and place it in the
|
||||
/install/netboot/fedora8/x86_64/compute/rootimg directory:
|
||||
|
||||
cd /opt/xcat/share/xcat/netboot/fedora/
|
||||
genimage -i eth0 -o fedora8 -p compute
|
||||
genimage -i eth0 -o fedora8 -p compute
|
||||
|
||||
=item 3
|
||||
|
||||
genimage -i eth0 -r eth1,eth2 -n tg3,bnx2 -o centos5.1 -p compute
|
||||
|
||||
=item 4
|
||||
|
||||
genimage -i eth0 -n tg3,bnx2 -o sles11 -p compute
|
||||
|
||||
=item 5
|
||||
|
||||
genimage -i eth0 -n igb,e1000e,e1000,bnx2,tg3 -o centos5.4 -p nfsroot --permission 777
|
||||
|
||||
=item 6
|
||||
|
||||
genimage -i eth0 -n tg3 myimagename
|
||||
|
||||
=item 7
|
||||
|
||||
genimage myimagename
|
||||
|
||||
This would use the profile information from the /opt/xcat/share/xcat/netboot/fedora/compute* files.
|
||||
|
||||
=back
|
||||
|
||||
@@ -144,4 +194,4 @@ This would use the profile information from the /opt/xcat/share/xcat/netboot/fed
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
L<geninitrd(1)|geninitrd.1>, L<packimage(1)|packimage.1>
|
||||
L<geninitrd(1)|geninitrd.1>, L<packimage(1)|packimage.1>, L<liteimg(1)|liteimg.1>
|
||||
|
||||
@@ -57,8 +57,11 @@ To display connection status for all CEC nodes in node group CEC:
|
||||
|
||||
Output is similar to:
|
||||
|
||||
cec1: ipaddr=192.168.200.245,alt_ipaddr=unavailable,state=Connected
|
||||
cec2: Connection not found
|
||||
cec1: sp=primary,ipadd=40.17.1.1,alt_ipadd=41.17.1.1,state=LINE UP
|
||||
cec1: sp=secondary,ipadd=40.17.1.2,alt_ipadd=41.17.1.2,state=LINE UP
|
||||
cec2: sp=primary,ipadd=40.17.2.1,alt_ipadd=41.17.2.1,state=LINE UP
|
||||
cec2: 40.17.2.2: No connection information found for hardware control point "40.17.2.2", please create the connection for this hardware control point firstly.
|
||||
cec2: 41.17.2.2: No connection information found for hardware control point "41.17.2.2", please create the connection for this hardware control point firstly.
|
||||
|
||||
=item 2.
|
||||
|
||||
@@ -68,8 +71,8 @@ To display connection status for Frame node frame1:
|
||||
|
||||
Output is similar to:
|
||||
|
||||
frame1: side=a,ipaddr=192.168.200.247,alt_ipaddr=unavailable,state=Connected
|
||||
frame1: side=b,ipaddr=192.168.200.248,alt_ipaddr=unavailable,state=Connected
|
||||
frame1: sp=primary,ipadd=192.168.200.1,alt_ipadd=192.168.201.1,state=LINE UP
|
||||
frame1: sp=secondary,ipadd=192.168.200.2,alt_ipadd=192.168.201.2,state=LINE UP
|
||||
|
||||
=item 3.
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ B<-m> Multicast mode (defaults to broadcast).
|
||||
B<--makedhcp> Issue xCAT command makedhcp internally.
|
||||
|
||||
B<-M> Matching mode, match the pre-defined node names from vpd table or switch table.
|
||||
Default is using factory name if no -M specified.
|
||||
Matching vpd table is the default setting whether the flag is specified. And matching switch table is not yet supported.
|
||||
|
||||
B<-n> Only display and write the newly discovered hardwares.
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
=head1 NAME
|
||||
|
||||
B<lsvm> - Lists partition profile information for HMC- and IVM-managed nodes. For Power 775, it lists the LPARs' I/O slots information and CEC configuration.
|
||||
B<lsvm> - Lists partition profile information for HMC-, KVM-, Vmware- and IVM-managed nodes. For Power 775, it lists the LPARs' I/O slots information and CEC configuration.
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
@@ -18,11 +18,29 @@ B<lsvm> [B<-l>| B<--long>] I<noderange>
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
The lsvm command lists all partition profiles defined for the partitions specified in noderange. If noderange is a CEC, all the partitions associated with that CEC are displayed.
|
||||
The lsvm command lists all partition profiles defined for the partitions specified in noderange. If noderange is a CEC, all the partitions associated with that CEC are displayed.
|
||||
|
||||
=head2 For PPC (using Direct FSP Management):
|
||||
|
||||
For Power 775, lsvm lists all partition I/O slots information for the partitions specified in noderange. If noderange is a CEC, it gets the CEC's pump mode value, octant's memory interleaving value, the all the octants configure value, and all the I/O slots information
|
||||
For Power 775, lsvm lists all partition I/O slots information for the partitions specified in noderange. If noderange is a CEC, it gets the CEC's pump mode value, octant's memory interleaving value, the all the octants configure value, and all the I/O slots information.
|
||||
|
||||
The pump mode value has the valid options:
|
||||
1 - Node Pump Mode
|
||||
2 - Chip Pump Mode
|
||||
|
||||
The Memory Interleaving Mode has 3 valid options:
|
||||
0 - not Applicable
|
||||
1 - interleaved
|
||||
2 - non-interleaved
|
||||
|
||||
More information about this part, refer to the section Using the *vm commands to define partitions in xCAT DFM in the link below.
|
||||
https://sourceforge.net/apps/mediawiki/xcat/index.php?title=XCAT_Power_775_Hardware_Management
|
||||
|
||||
=head2 For KVM and Vmware
|
||||
|
||||
The virtual machines that defined in the hypervisor I<noderange> will be displayed. I<noderange> only can be hypervisor. The type of the hypervisor should be set: hypervisor.type before running the lsvm.
|
||||
|
||||
Note: Only the virtual machine which is in power on state can be listed by lsvm command.
|
||||
|
||||
=head1 OPTIONS
|
||||
|
||||
@@ -115,7 +133,15 @@ Output is similar to:
|
||||
5: 520/U78A9.001.0123456-P1-C14/0x21010208/2/5
|
||||
9: 529/U78A9.001.0123456-P1-C11/0x21010211/2/9
|
||||
9: 528/U78A9.001.0123456-P1-C12/0x21010210/2/9
|
||||
cec1: PendingPumpMode=1,CurrentPumpMode=1,OctantCount=8:OctantID=0,PendingOctCfg=5,CurrentOctCfg=1,PendingMemoryInterleaveMode=2,CurrentMemoryInterleaveMode=2;OctantID=1,PendingOctCfg=1,CurrentOctCfg=1,PendingMemoryInterleaveMode=2,CurrentMemoryInterleaveMode=2;OctantID=2,PendingOctCfg=1,CurrentOctCfg=1,PendingMemoryInterleaveMode=2,CurrentMemoryInterleaveMode=2;OctantID=3,PendingOctCfg=1,CurrentOctCfg=1,PendingMemoryInterleaveMode=2,CurrentMemoryInterleaveMode=2;OctantID=4,PendingOctCfg=1,CurrentOctCfg=1,PendingMemoryInterleaveMode=2,CurrentMemoryInterleaveMode=2;OctantID=5,PendingOctCfg=1,CurrentOctCfg=1,PendingMemoryInterleaveMode=2,CurrentMemoryInterleaveMode=2;OctantID=6,PendingOctCfg=1,CurrentOctCfg=1,PendingMemoryInterleaveMode=2,CurrentMemoryInterleaveMode=2;OctantID=7,PendingOctCfg=1,CurrentOctCfg=1,PendingMemoryInterleaveMode=2,CurrentMemoryInterleaveMode=2;
|
||||
cec1: PendingPumpMode=1,CurrentPumpMode=1,OctantCount=8:
|
||||
OctantID=0,PendingOctCfg=5,CurrentOctCfg=1,PendingMemoryInterleaveMode=2,CurrentMemoryInterleaveMode=2;
|
||||
OctantID=1,PendingOctCfg=1,CurrentOctCfg=1,PendingMemoryInterleaveMode=2,CurrentMemoryInterleaveMode=2;
|
||||
OctantID=2,PendingOctCfg=1,CurrentOctCfg=1,PendingMemoryInterleaveMode=2,CurrentMemoryInterleaveMode=2;
|
||||
OctantID=3,PendingOctCfg=1,CurrentOctCfg=1,PendingMemoryInterleaveMode=2,CurrentMemoryInterleaveMode=2;
|
||||
OctantID=4,PendingOctCfg=1,CurrentOctCfg=1,PendingMemoryInterleaveMode=2,CurrentMemoryInterleaveMode=2;
|
||||
OctantID=5,PendingOctCfg=1,CurrentOctCfg=1,PendingMemoryInterleaveMode=2,CurrentMemoryInterleaveMode=2;
|
||||
OctantID=6,PendingOctCfg=1,CurrentOctCfg=1,PendingMemoryInterleaveMode=2,CurrentMemoryInterleaveMode=2;
|
||||
OctantID=7,PendingOctCfg=1,CurrentOctCfg=1,PendingMemoryInterleaveMode=2,CurrentMemoryInterleaveMode=2;
|
||||
|
||||
To list the lparname of lpars, enter:
|
||||
|
||||
@@ -123,24 +149,38 @@ To list the lparname of lpars, enter:
|
||||
|
||||
Output is similar to:
|
||||
|
||||
lpar1: 1: 514/U78A9.001.0123456-P1-C17/0x21010202/2/1
|
||||
lpar1: 1: 513/U78A9.001.0123456-P1-C15/0x21010201/2/1
|
||||
lpar1: 1: 512/U78A9.001.0123456-P1-C16/0x21010200/2/1
|
||||
lpar13: 13: 537/U78A9.001.0123456-P1-C9/0x21010219/2/13
|
||||
lpar13: 13: 536/U78A9.001.0123456-P1-C10/0x21010218/2/13
|
||||
lpar17: 17: 545/U78A9.001.0123456-P1-C7/0x21010221/2/17
|
||||
lpar17: 17: 544/U78A9.001.0123456-P1-C8/0x21010220/2/17
|
||||
lpar21: 21: 553/U78A9.001.0123456-P1-C5/0x21010229/2/21
|
||||
lpar21: 21: 552/U78A9.001.0123456-P1-C6/0x21010228/2/21
|
||||
lpar24: 25: 569/U78A9.001.0123456-P1-C1/0x21010239/2/25
|
||||
lpar25: 25: 561/U78A9.001.0123456-P1-C3/0x21010231/2/25
|
||||
lpar25: 25: 560/U78A9.001.0123456-P1-C4/0x21010230/2/25
|
||||
lpar29: 29: 568/U78A9.001.0123456-P1-C2/0x21010238/2/29
|
||||
lpar5: 5: 521/U78A9.001.0123456-P1-C13/0x21010209/2/5
|
||||
lpar5: 5: 520/U78A9.001.0123456-P1-C14/0x21010208/2/5
|
||||
lpar9: 9: 529/U78A9.001.0123456-P1-C11/0x21010211/2/9
|
||||
lpar9: 9: 528/U78A9.001.0123456-P1-C12/0x21010210/2/9
|
||||
cec1: PendingPumpMode=1,CurrentPumpMode=1,OctantCount=8:OctantID=0,PendingOctCfg=5,CurrentOctCfg=1,PendingMemoryInterleaveMode=2,CurrentMemoryInterleaveMode=2;OctantID=1,PendingOctCfg=1,CurrentOctCfg=1,PendingMemoryInterleaveMode=2,CurrentMemoryInterleaveMode=2;OctantID=2,PendingOctCfg=1,CurrentOctCfg=1,PendingMemoryInterleaveMode=2,CurrentMemoryInterleaveMode=2;OctantID=3,PendingOctCfg=1,CurrentOctCfg=1,PendingMemoryInterleaveMode=2,CurrentMemoryInterleaveMode=2;OctantID=4,PendingOctCfg=1,CurrentOctCfg=1,PendingMemoryInterleaveMode=2,CurrentMemoryInterleaveMode=2;OctantID=5,PendingOctCfg=1,CurrentOctCfg=1,PendingMemoryInterleaveMode=2,CurrentMemoryInterleaveMode=2;OctantID=6,PendingOctCfg=1,CurrentOctCfg=1,PendingMemoryInterleaveMode=2,CurrentMemoryInterleaveMode=2;OctantID=7,PendingOctCfg=1,CurrentOctCfg=1,PendingMemoryInterleaveMode=2,CurrentMemoryInterleaveMode=2;
|
||||
lpar1: 1: 514/U78A9.001.0123456-P1-C17/0x21010202/2/1: 32: 0/3/3
|
||||
lpar1: 1: 513/U78A9.001.0123456-P1-C15/0x21010201/2/1: 32: 0/3/3
|
||||
lpar1: 1: 512/U78A9.001.0123456-P1-C16/0x21010200/2/1: 32: 0/3/3
|
||||
lpar13: 13: 537/U78A9.001.0123456-P1-C9/0x21010219/2/13: 32: 0/3/3
|
||||
lpar13: 13: 536/U78A9.001.0123456-P1-C10/0x21010218/2/13: 32: 0/3/3
|
||||
lpar17: 17: 545/U78A9.001.0123456-P1-C7/0x21010221/2/17: 32: 0/0/0
|
||||
lpar17: 17: 544/U78A9.001.0123456-P1-C8/0x21010220/2/17: 32: 0/0/0
|
||||
lpar21: 21: 553/U78A9.001.0123456-P1-C5/0x21010229/2/21: 32: 0/0/0
|
||||
lpar21: 21: 552/U78A9.001.0123456-P1-C6/0x21010228/2/21: 32: 0/0/0
|
||||
lpar24: 25: 569/U78A9.001.0123456-P1-C1/0x21010239/2/25: 32: 0/0/0
|
||||
lpar25: 25: 561/U78A9.001.0123456-P1-C3/0x21010231/2/25: 32: 0/0/0
|
||||
lpar25: 25: 560/U78A9.001.0123456-P1-C4/0x21010230/2/25: 32: 0/0/0
|
||||
lpar29: 29: 568/U78A9.001.0123456-P1-C2/0x21010238/2/29: 32: 0/0/0
|
||||
lpar5: 5: 521/U78A9.001.0123456-P1-C13/0x21010209/2/5: 32: 0/3/3
|
||||
lpar5: 5: 520/U78A9.001.0123456-P1-C14/0x21010208/2/5: 32: 0/3/3
|
||||
lpar9: 9: 529/U78A9.001.0123456-P1-C11/0x21010211/2/9: 32: 0/3/3
|
||||
lpar9: 9: 528/U78A9.001.0123456-P1-C12/0x21010210/2/9: 32: 0/3/3
|
||||
cec1: PendingPumpMode=1,CurrentPumpMode=1,OctantCount=8:
|
||||
OctantID=0,PendingOctCfg=5,CurrentOctCfg=1,PendingMemoryInterleaveMode=2,CurrentMemoryInterleaveMode=2;
|
||||
OctantID=1,PendingOctCfg=1,CurrentOctCfg=1,PendingMemoryInterleaveMode=2,CurrentMemoryInterleaveMode=2;
|
||||
OctantID=2,PendingOctCfg=1,CurrentOctCfg=1,PendingMemoryInterleaveMode=2,CurrentMemoryInterleaveMode=2;
|
||||
OctantID=3,PendingOctCfg=1,CurrentOctCfg=1,PendingMemoryInterleaveMode=2,CurrentMemoryInterleaveMode=2;
|
||||
OctantID=4,PendingOctCfg=1,CurrentOctCfg=1,PendingMemoryInterleaveMode=2,CurrentMemoryInterleaveMode=2;
|
||||
OctantID=5,PendingOctCfg=1,CurrentOctCfg=1,PendingMemoryInterleaveMode=2,CurrentMemoryInterleaveMode=2;
|
||||
OctantID=6,PendingOctCfg=1,CurrentOctCfg=1,PendingMemoryInterleaveMode=2,CurrentMemoryInterleaveMode=2;
|
||||
OctantID=7,PendingOctCfg=1,CurrentOctCfg=1,PendingMemoryInterleaveMode=2,CurrentMemoryInterleaveMode=2;
|
||||
Number of BSR arrays: 256,Bytes per BSR array: 4096,Available BSR array: 0;
|
||||
Available huge page memory(in pages): 0
|
||||
Configurable huge page memory(in pages): 12
|
||||
Page Size(in GB): 16
|
||||
Maximum huge page memory(in pages): 24
|
||||
Requested huge page memory(in pages): 15
|
||||
|
||||
=head1 FILES
|
||||
|
||||
|
||||
@@ -88,7 +88,7 @@ Indicates that the file being piped to the command is in stanza format. See the
|
||||
|
||||
To create a site definition.
|
||||
|
||||
mkdef -t site -o clustersite rsh=/bin/rsh rcp=/bin/rcp installdir=/xcatinstall
|
||||
mkdef -t site -o clustersite installdir=/xcatinstall
|
||||
|
||||
=item 2.
|
||||
|
||||
@@ -140,6 +140,12 @@ To create a dynamic node group definition called SLESNodes containing all the SL
|
||||
|
||||
mkdef -t group -o SLESNodes -d -w "os=~^sles[0-9]+$"
|
||||
|
||||
=item 10.
|
||||
|
||||
To create a entry (7.0) in the policy table for user admin1
|
||||
|
||||
mkdef -t policy -o 7.0 name=admin1 rule=allow
|
||||
|
||||
=back
|
||||
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ Note: If a CEC belongs to a frame, which has a BPA installed, this CEC should no
|
||||
|
||||
For PPC (using Direct FSP Management) specific:
|
||||
|
||||
It is used to set up connections for CEC and Frame node to Hardware Server on management node (or service node ). It only could be done according to the node definition in xCAT DB. And this command will try to read the user/password from the ppcdirect table firstly. If fails, then read them from passwd table. Commonly , the username is B<HMC>. If using the B<ppcdirect> table, each CEC/Frame and user/password should be stored in B<ppcdirect> table. If using the B<passwd> table, the key should be "B<cec>" or "B<frame>", and the related user/password are stored in B<passwd> table.
|
||||
It is used to set up connections for CEC and Frame node to Hardware Server on management node (or service node ). It only could be done according to the node definition in xCAT DB. And this command will try to read the user/password from the ppcdirect table first. If fails, then read them from passwd table. Commonly , the username is B<HMC>. If using the B<ppcdirect> table, each CEC/Frame and user/password should be stored in B<ppcdirect> table. If using the B<passwd> table, the key should be "B<cec>" or "B<frame>", and the related user/password are stored in B<passwd> table.
|
||||
|
||||
When B<--port> is specified, this command will create the connections for CECs/Frames whose side in B<vpd> table is equal to port value.
|
||||
|
||||
@@ -72,7 +72,7 @@ The tooltype is used to communicate to the CEC/Frame. The value could be B<lpar>
|
||||
|
||||
=item B<--port>
|
||||
|
||||
The port value specify which side will be used to create the connection to the CEC/Frame. The value could be "B<0>" or "B<1>". If this port value is not specfied in the command, it will use the default value "B<0>". If the port value is "B<0>", in the vpd table, the side column should be B<A-0> and B<B-0>; If the port value is "B<1>", the side column should be B<A-1> and B<B-1>. When making hardware connection between CEC/Frame and HMC, the port is used to specify the fsp/bpa port of the cec/frame.
|
||||
The port value specifies which special side will be used to create the connection to the CEC/Frame. The value could only be specified as "B<0>" or "B<1>" and the default value is "B<0,1>". If the user wants to use all ports to create the connection, he should not specify this value. If the port value is specified as "B<0>", in the vpd table, the side column should be B<A-0> and B<B-0>; If the port value is specified as "B<1>", the side column should be B<A-1> and B<B-1>. When making hardware connection between CEC/Frame and HMC, the value is used to specify the fsp/bpa port of the cec/frame and will be organized in order of "B<A-0,A-1,B-0,B-1>". If any side does not exist, the side would simply be ignored. Generally, only one port of a fsp/bap can be connected while another port be used as backup.
|
||||
|
||||
=item B<-s>
|
||||
|
||||
|
||||
@@ -109,7 +109,7 @@ The name of a NIM mksysb resource.
|
||||
|
||||
=item B<otherpkgs>
|
||||
|
||||
One or more comma separated installp or rpm packages. The rpm packages must have a prefix of 'R:', (ex. R:foo.rpm)
|
||||
One or more comma separated installp, emgr, or rpm packages. The packages must have prefixes of 'I:', 'E:', or 'R:', respectively. (ex. R:foo.rpm)
|
||||
|
||||
=item B<paging>
|
||||
|
||||
@@ -153,7 +153,10 @@ The alternate flags to be passed along to the AIX installp command. (The default
|
||||
|
||||
=item B<rpm_flags>
|
||||
|
||||
The alternate flags to be passed along to the AIX rpm command. (The default for rpm_flags is "-Uvh --replacepkgs".)
|
||||
The alternate flags to be passed along to the AIX rpm command. (The default for
|
||||
rpm_flags is "-Uvh ".) The mknimimage command will check each rpm to see if
|
||||
it is installed. It will not be reinstalled unless you specify the appropriate
|
||||
rpm option, such as '--replacepkgs'.
|
||||
|
||||
=item B<emgr_flags>
|
||||
|
||||
@@ -167,10 +170,6 @@ The maximum size for a single dump image the dump resource will accept. Space is
|
||||
|
||||
The maximum number of archived dumps for an individual client. The default is one.
|
||||
|
||||
=item B<notify>
|
||||
|
||||
An administrator supplied script that will be invoked when a new dump is captured, or when a dump error occurs on the client.
|
||||
|
||||
=item B<snapcollect>
|
||||
|
||||
Indicates that after a dump is collected then snap data should be collected. The snap data will be collected in the clients dump resource directory. Values are "yes" or "no". The default is "no".
|
||||
@@ -185,7 +184,7 @@ Value Specifies the security method required for NFS access.
|
||||
|
||||
=back
|
||||
|
||||
Note that you may specify multiple "script", "otherpkgs", and "installp_bundle" resources by using a comma seperated list. (ex. "script=ascript,bscript"). RPM names may be included in the "otherpkgs" list by using a "R:" prefix(ex. "R:whatever.rpm"). epkg (AIX interim fix package) file names may be included in the "otherpkgs" too(ex. "otherpkgs=IZ38930TL0.120304.epkg.Z").
|
||||
Note that you may specify multiple "script", "otherpkgs", and "installp_bundle" resources by using a comma seperated list. (ex. "script=ascript,bscript"). RPM names may be included in the "otherpkgs" list by using a "R:" prefix(ex. "R:whatever.rpm"). epkg (AIX interim fix package) file names may be included in the "otherpkgs" using the 'E:' prefix. (ex. "otherpkgs=E:IZ38930TL0.120304.epkg.Z").
|
||||
|
||||
=item B<-b mksysbfile>
|
||||
|
||||
@@ -317,7 +316,7 @@ B<mknimimage -t diskless -s 61cosi_lpp_source 611cosi tmp=mytmp home=myhome>
|
||||
|
||||
10) Create a diskless image and update it with additional software using rpm flags and configuration files.
|
||||
|
||||
B<mknimimage -t diskless -s 61cosi_lpp_source 61dskls otherpkgs=fset1,R:foo.rpm,IZ38930TL0.120304.epkg.Z synclists=/install/mysyncfile rpm_flags="-i --nodeps">
|
||||
B<mknimimage -t diskless -s 61cosi_lpp_source 61dskls otherpkgs=I:fset1,R:foo.rpm,E:IZ38930TL0.120304.epkg.Z synclists=/install/mysyncfile rpm_flags="-i --nodeps">
|
||||
|
||||
The xCAT osimage definition created by this command will include the "otherpkgs" and "synclists" values. The NIM SPOT resource associated with this osimage will be updated with the additional software using rpm flags "-i --nodeps" and configuration files.
|
||||
|
||||
|
||||
@@ -20,7 +20,11 @@ B<mkvm> [B<-V>| B<--verbose>] I<noderange> B<--full>
|
||||
|
||||
=head2 For KVM:
|
||||
|
||||
B<mkvm> I<noderange> B<-m>|B<--master> I<mastername> B<-s>|B<--size> I<disksize> B<-f>|B<--force>
|
||||
B<mkvm> I<noderange> [B<-m|--master> I<mastername>] [B<-s|--size> I<disksize>] [B<--mem> I<memsize>] [B<--cpus> I<cpucount>] [B<-f|--force>]
|
||||
|
||||
=head2 For Vmware:
|
||||
|
||||
B<mkvm> I<noderange> [B<-s>|B<--size> I<disksize>] [B<--mem> I<memsize>] [B<--cpus> I<cpucount>]
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
@@ -36,9 +40,12 @@ Please make sure the nodes in the I<noderange> is defined in the I<nodelist> tab
|
||||
|
||||
Please note that the mkvm command currently only supports creating standard LPARs, not virtual LPARs working with VIOS server.
|
||||
|
||||
=head2 For KVM:
|
||||
=head2 For KVM and Vmware:
|
||||
|
||||
The mkvm command creates new virtual machine(s) with the I<disksize> size of hard disk, I<memsize> size of memory and I<cpucount> number of cpu.
|
||||
|
||||
For KVM: If B<-f>|B<--force> is specified, the storage will be destroyed first if it existed.
|
||||
|
||||
mkvm ....
|
||||
|
||||
=head1 OPTIONS
|
||||
|
||||
@@ -52,6 +59,18 @@ Display usage message.
|
||||
|
||||
The cec (fsp) name for the destination.
|
||||
|
||||
=item B<--cpus>
|
||||
|
||||
The cpu count which will be created for the kvm/vmware virtual machine.
|
||||
|
||||
=item B<--full>
|
||||
|
||||
Request to create a new full system partition for each CEC.
|
||||
|
||||
=item B<-f|--force>
|
||||
|
||||
If B<-f|--force> is specified, the storage will be destroyed first if it existed.
|
||||
|
||||
=item B<-i>
|
||||
|
||||
Starting numeric id of the newly created partitions.
|
||||
@@ -60,13 +79,17 @@ Starting numeric id of the newly created partitions.
|
||||
|
||||
The partition name of the source.
|
||||
|
||||
=item B<--mem>
|
||||
|
||||
The memory size which will be used for the new created kvm/vmware virtual machine. Unit is Megabyte.
|
||||
|
||||
=item B<-p>
|
||||
|
||||
The file that contains the profiles for the source partitions.
|
||||
|
||||
=item B<--full>
|
||||
=item B<-s|--size>
|
||||
|
||||
Request to create a new full system partition for each CEC.
|
||||
The size of storage which will be created for the kvm/vmware virtual machine.
|
||||
|
||||
=item B<-v|--version>
|
||||
|
||||
@@ -146,6 +169,10 @@ Output is similar to:
|
||||
lpar5: Success
|
||||
lpar6: Success
|
||||
|
||||
5. To create a new kvm/vmware virtual machine with 10G storage, 2048M memory and 2 cpus.
|
||||
|
||||
mkvm vm1 -s 10G --mem 2048 --cpus 2
|
||||
|
||||
=head1 FILES
|
||||
|
||||
/opt/xcat/bin/mkvm
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
|
||||
=head1 NAME
|
||||
|
||||
B<rbootseq> - Persistently sets the order of boot devices for BladeCenter blades or PPC LPARs.
|
||||
B<rbootseq> - Persistently sets the order of boot devices for BladeCenter blades or PPC LPARs using Direct FSP Management (DFM).
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
@@ -17,7 +17,7 @@ B<rbootseq> I<noderange> B<[hfi|net]>
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
For PPC (with HMC) specific:
|
||||
For Blade specific:
|
||||
|
||||
B<rbootseq> sets the boot sequence (the order in which boot devices should be tried) for the specified blades.
|
||||
Up to four different medium/devices can be listed, separated by commas. The boot sequence will remain
|
||||
@@ -25,7 +25,7 @@ in effect for these blades until set differently.
|
||||
|
||||
For PPC (using Direct FSP Management) specific:
|
||||
|
||||
B<rbootseq> sets the net or hfi device as the first boot device for the specified PPC LPARs. The net or hfi mac address is store in the mac table. And B<rbootseq> requires that the network information is correct in networks table as for getmacs/rnetboot.
|
||||
B<rbootseq> sets the net or hfi device as the first boot device for the specified PPC LPARs. The net or hfi mac address is stored in the mac table. And B<rbootseq> requires that the network information is correct in networks table as for getmacs/rnetboot.
|
||||
|
||||
=head1 OPTIONS
|
||||
|
||||
|
||||
@@ -185,12 +185,12 @@ will get response immediately.
|
||||
=head1 B<PREREQUISITES>
|
||||
|
||||
For the system p nodes, the B<renergy> command depends
|
||||
on the Energy Management Plugin B<xCAT-energy> to
|
||||
communicate with server. B<xCAT-energy> can be downloaded from the IBM web site:
|
||||
http://www14.software.ibm.com/webapp/set2/sas/f/xcat/energy.html
|
||||
on the Energy Management Plugin B<xCAT-pEnergy> to
|
||||
communicate with server. B<xCAT-pEnergy> can be downloaded from the IBM web site:
|
||||
http://www.ibm.com/support/fixcentral/. (Other Software -> EM)
|
||||
|
||||
For iDataPlex nodes, the B<renergy> command depends
|
||||
on the Energy Management Plugin B<perl-IBM-EnergyManager> to
|
||||
on the Energy Management Plugin B<xCAT-xEnergy> to
|
||||
communicate with server. This plugin must be requested from IBM.
|
||||
|
||||
(The support for BladeCenter energy management is built into base xCAT,
|
||||
|
||||
@@ -6,12 +6,19 @@ B<restorexCATdb> - restores the xCAT db tables .
|
||||
|
||||
B<restorexCATdb> [B<-a>] [B<-V>] [{B<-p>|B<--path>} I<path>]
|
||||
|
||||
B<restorexCATdb> [B<-b>] [B<-V>] [{B<-t>|B<--timestamp>} I<timestamp>] [{B<-p>|B<--path>} I<path>]
|
||||
|
||||
B<restorexCATdb> [B<-h>|B<--help>] [B<-v>|B<--version>]
|
||||
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
The restorexCATdb command restores the xCAT database tables from the directory given by the -p flag. The site table skiptables attribute can be set to a list of tables not to restore. See man dumpxCATdb.
|
||||
|
||||
If not using binary restore(-b), the restorexCATdb command restores the xCAT database tables from the *.csv files in directory given by the -p flag. The site table skiptables attribute can be set to a list of tables not to restore. It will not restore isnm_perf* tables. See man dumpxCATdb.
|
||||
|
||||
If using the binary restore option for DB2, the entire database is restored from the binary backup made with dumpxCATdb. The database will be restored using DB2 Utilities. The timestamp of the correct DB2 backup file (-t) must be provided.
|
||||
All applications accessing the DB2 database must be stopped before you can use the binary restore options. See the xCAT DB2 document for more information.
|
||||
|
||||
|
||||
=head1 OPTIONS
|
||||
|
||||
@@ -23,10 +30,13 @@ B<-v> Command Version.
|
||||
B<-V> Verbose.
|
||||
|
||||
B<-a> All,without this flag the eventlog and auditlog will be skipped.
|
||||
These tables are skipped by default because restoring will generate new indexes.
|
||||
These tables are skipped by default because restoring will generate new indexes
|
||||
|
||||
B<-b> Restore from the binary image.
|
||||
|
||||
B<-p> Path to the directory containing the database restore files.
|
||||
|
||||
|
||||
B<-t> Use with the -b flag to designate the timestamp of the binary image to use to restore.
|
||||
|
||||
=head1 RETURN VALUE
|
||||
|
||||
@@ -36,13 +46,17 @@ B<-p> Path to the directory containing the database restore files.
|
||||
|
||||
=head1 EXAMPLES
|
||||
|
||||
1. To restore the xCAT database from the /tmp/db directory, enter:
|
||||
1. To restore the xCAT database from the /dbbackup/db directory, enter:
|
||||
|
||||
B<restorexCATdb -p /tmp/db>
|
||||
B<restorexCATdb -p /dbbackup/db>
|
||||
|
||||
2. To restore the xCAT database including auditlog and eventlog from the /tmp/db directory, enter:
|
||||
2. To restore the xCAT database including auditlog and eventlog from the /dbbackup/db directory, enter:
|
||||
|
||||
B<restorexCATdb -a -p /tmp/db>
|
||||
B<restorexCATdb -a -p /dbbackup/db>
|
||||
|
||||
3. To restore the xCAT database from the binary image with timestamp 20111130130239 enter:
|
||||
|
||||
B<restorexCATdb -b -t 20111130130239 -p /dbbackup/db>
|
||||
|
||||
|
||||
=head1 FILES
|
||||
|
||||
@@ -14,7 +14,7 @@ B<rflash> I<noderange> [B<--commit>|B<--recover>] [B<-V>|B<--verbose>]
|
||||
|
||||
=head2 PPC (without HMC, using Direct FSP Management) specific:
|
||||
|
||||
B<rflash> I<noderange> B<-p> I<directory> B<--activate> B<disruptive>
|
||||
B<rflash> I<noderange> B<-p> I<directory> B<--activate> B<disruptive> [B<-d> I<data_directory>]
|
||||
|
||||
B<rflash> I<noderange> [B<--commit>|B<--recover>]
|
||||
|
||||
@@ -54,6 +54,19 @@ If it outputs B<"Timeout waiting for prompt"> during the upgrade, please set the
|
||||
|
||||
In currently Direct FSP/BPA Management, our B<rflash> doesn't support B<concurrent> value of B<--activate> flag, and only support B<disruptive>. The B<disruptive> option will cause any affected systems that are powered on to be powered down before installing and activating the update. So we require that the systems should be powered off before do the firmware update.
|
||||
|
||||
In Direct FSP/BPA Management, there is -d <data_directory> option. The default value is /tmp. When do firmware update, rflash will put some related data from rpm packages in <data_directory> directory, so the execution of rflash will require available disk space in <data_directory> for the command to properly execute:
|
||||
|
||||
(1) For one CEC/Frame, if the rpm package size is rpmsize, it requires that the available disk space should be more than:
|
||||
3 * rpmsize
|
||||
(2) For 12 CECs and 1 Frame in a building block, the rpm packages of the CECs are the same one, it require that the available disk space should be more than:
|
||||
3 * rpmsize + 11 * 1.5 * rpmsize = 19.5 * rpmsize
|
||||
(3)For n CECs/Frames, all the rpm packages are different, it require that the available disk space should be more than:
|
||||
3 * rpmsize * n
|
||||
(4)For 2 building block, each building block including 12 CECs and 1 Frame, and the rpm packages of the CECs in two building block are the same one. it require that the available disk space should be more than:
|
||||
3 * rpmsize + 11 * 1.5 * rpmsize + 12 * 1.5 * rpmsize = 37.5 * rpmsize
|
||||
(5) For 2 building block, each building block including 12 CECs and 1 Frame, and the rpm packages of the CECs in the same building block are the same one, but in different building block are different. it require that the available disk space should be more than:
|
||||
(3 * rpmsize + 11 * 1.5 * rpmsize) * 2 = 39 * rpmsize
|
||||
|
||||
For Power 775, the rflash command takes effect on the primary and secondary FSPs or BPAs almost in parallel.
|
||||
|
||||
=head1 B<Options>
|
||||
@@ -68,9 +81,13 @@ Writes the command’s usage statement to standard output.
|
||||
|
||||
Specifies the directory where the packages are located.
|
||||
|
||||
=item B<-d data_directory>
|
||||
|
||||
Specifies the directory where the raw data from rpm packages for each CEC/Frame are located. The default directory is /tmp. The option is only used in Direct FSP/BPA Management.
|
||||
|
||||
=item B<--activate> B<concurrent> | B<disruptive>
|
||||
|
||||
Must be specified to activate the new Licensed Internal Code. The “disruptive” option will cause the target systems to be recycled. Without this flag, LIC updates will be installed only, not activated.
|
||||
Must be specified to activate the new Licensed Internal Code. The "disruptive" option will cause the target systems to be recycled. Without this flag, LIC updates will be installed only, not activated.
|
||||
|
||||
=item B<--commit>
|
||||
|
||||
|
||||
@@ -16,7 +16,9 @@ B<rinv> I<noderange> {B<bus>|B<config>|B<serial>|B<model>|B<firm>|B<all>}
|
||||
|
||||
=head2 PPC (using Direct FSP Management) specific:
|
||||
|
||||
B<rinv> I<noderange> {B<firm>|B<deconfig>}
|
||||
B<rinv> I<noderange> {B<firm>}
|
||||
|
||||
B<rinv> I<noderange> {B<deconfig> [B<-x>]}
|
||||
|
||||
=head2 Blade specific:
|
||||
|
||||
@@ -64,7 +66,11 @@ Retrieves firmware versions.
|
||||
|
||||
=item B<deconfig>
|
||||
|
||||
Retrieves deconfigured resources. Deconfigured resources are hw components (cpus, memory, etc.) that have failed so the firmware has automatically turned those components off.
|
||||
Retrieves deconfigured resources. Deconfigured resources are hw components (cpus, memory, etc.) that have failed so the firmware has automatically turned those components off. This option is only capable of listing some of the deconfigured resources and should not be the only method used to check the hardware status.
|
||||
|
||||
=item B<-x>
|
||||
|
||||
To output the information of deconfigured resources in XML format.
|
||||
|
||||
=item B<asset>
|
||||
|
||||
@@ -141,6 +147,21 @@ To retrieve all information available from blade node4, enter:
|
||||
|
||||
=item *
|
||||
|
||||
To output the information of deconfigured resources in XML format for CEC cec01, enter:
|
||||
|
||||
rinv cec01 deconfig -x
|
||||
|
||||
cec01:
|
||||
<SYSTEM>
|
||||
<System_type>IH</System_type>
|
||||
<NODE>
|
||||
<Location_code>U78A9.001.0123456-P1</Location_code>
|
||||
<RID>800</RID>
|
||||
</NODE>
|
||||
</SYSTEM>
|
||||
|
||||
=item *
|
||||
|
||||
To retrieve 'config' information from the HMC-managed LPAR node3, enter:
|
||||
|
||||
rinv node3 config
|
||||
|
||||
@@ -16,6 +16,10 @@ B<rmhwconn> [B<-V>| B<--verbose>] I<noderange>
|
||||
|
||||
B<rmhwconn> I<noderange> B<-T> I<tooltype>
|
||||
|
||||
=head2 PPC (use HMC as SFP) specific:
|
||||
|
||||
B<rmhwconn> B<-s>
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
For PPC (with HMC) specific:
|
||||
@@ -28,6 +32,10 @@ For PPC (without HMC, using FSPAPI) specific:
|
||||
|
||||
It's used to disconnection CEC and Frame nodes from hardware server.
|
||||
|
||||
For PPC (use HMC as SFP) specific:
|
||||
|
||||
It is used to disconnect Frame nodes from HMC nodes.
|
||||
|
||||
=head1 OPTIONS
|
||||
|
||||
=over 5
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
=head1 NAME
|
||||
|
||||
B<rmvm> - Removes HMC- and IVM-managed partitions.
|
||||
B<rmvm> - Removes HMC-, KVM-, Vmware- and IVM-managed partitions.
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
@@ -11,6 +11,8 @@ I<rmvm [-v| --version]>
|
||||
|
||||
I<rmvm [-V| --verbose] noderange [-r] [--service]>
|
||||
|
||||
=head2 For KVM and Vmware:
|
||||
|
||||
I<rmvm [-p] [-f]>
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
@@ -138,6 +138,18 @@ B<rspconfig> I<noderange> {B<cec_off_policy>}
|
||||
|
||||
B<rspconfig> I<noderange> B<cec_off_policy>={B<poweroff>|B<stayon>}
|
||||
|
||||
B<rspconfig> I<noderange> {B<BSR>}
|
||||
|
||||
B<rspconfig> I<noderange> {B<huge_page>}
|
||||
|
||||
B<rspconfig> I<noderange> B<huge_page>={B<NUM>}
|
||||
|
||||
B<rspconfig> I<noderange> {B<setup_failover>}
|
||||
|
||||
B<rspconfig> I<noderange> B<setup_failover>={B<enable>|B<disable>}
|
||||
|
||||
B<rspconfig> I<noderange> {B<force_failover>}
|
||||
|
||||
B<rspconfig> I<noderange> B<--resetnet>
|
||||
|
||||
=head2 BPA/Frame (using Direct FSP Management) Specific:
|
||||
@@ -246,7 +258,23 @@ The gateway ip address.
|
||||
|
||||
=item B<hostname>
|
||||
|
||||
Display the CEC/BPA system names
|
||||
Display the CEC/BPA system names.
|
||||
|
||||
=item B<BSR>
|
||||
|
||||
Get Barrier Synchronization Register (BSR) allocation for a CEC.
|
||||
|
||||
=item B<huge_page>
|
||||
|
||||
Query huge page information or request NUM of huge pages for CEC. If no value specified, it means query huge page information for the specified CECs, if a CEC is specified, the specified huge_page value NUM will be used as the requested number of huge pages for the CEC, if CECs are specified, it means to request the same NUM huge pages for all the specified CECs.
|
||||
|
||||
=item B<setup_failover>={I<enable>|I<disable>}
|
||||
|
||||
Enable or disable the service processor failover function of a CEC or display status of this function.
|
||||
|
||||
=item B<force_failover>
|
||||
|
||||
Force a service processor failover from the primary service processor to the secondary service processor.
|
||||
|
||||
=item B<hostname>={I<*|name>}
|
||||
|
||||
@@ -587,6 +615,96 @@ B<rspconfig> I<cec01 pending_power_on_side>
|
||||
cec01: Pending Power On Side Primary: perm
|
||||
cec01: Pending Power On Side Secondary: perm
|
||||
|
||||
=item *
|
||||
|
||||
To show the BSR allocation for cec01:
|
||||
|
||||
B<rspconfig> I<cec01 BSR>
|
||||
|
||||
cec01: Barrier Synchronization Register (BSR)
|
||||
cec01: Number of BSR arrays: 256
|
||||
cec01: Bytes per BSR array : 4096
|
||||
cec01: Available BSR array : 0
|
||||
cec01: Partition name: BSR arrays
|
||||
cec01: lpar01 : 32
|
||||
cec01: lpar02 : 32
|
||||
cec01: lpar03 : 32
|
||||
cec01: lpar04 : 32
|
||||
cec01: lpar05 : 32
|
||||
cec01: lpar06 : 32
|
||||
cec01: lpar07 : 32
|
||||
cec01: lpar08 : 32
|
||||
|
||||
=item *
|
||||
|
||||
To query the huge page information for CEC1, enter:
|
||||
|
||||
B<rspconfig> I<CEC1 huge_page>
|
||||
|
||||
CEC1: Huge Page Memory
|
||||
CEC1: Available huge page memory(in pages): 0
|
||||
CEC1: Configurable huge page memory(in pages): 12
|
||||
CEC1: Page Size (in GB): 16
|
||||
CEC1: Maximum huge page memory(in pages): 24
|
||||
CEC1: Requested huge page memory(in pages): 15
|
||||
CEC1: Partition name: Huge pages
|
||||
CEC1: lpar1 : 3
|
||||
CEC1: lpar5 : 3
|
||||
CEC1: lpar9 : 3
|
||||
CEC1: lpar13 : 3
|
||||
CEC1: lpar17 : 0
|
||||
CEC1: lpar21 : 0
|
||||
CEC1: lpar25 : 0
|
||||
CEC1: lpar29 : 0
|
||||
|
||||
=item *
|
||||
|
||||
To request 10 huge pages for CEC1, enter:
|
||||
|
||||
B<rspconfig> I<CEC1 huge_page=10>
|
||||
|
||||
CEC1: Success
|
||||
|
||||
=item *
|
||||
|
||||
To disable service processor failover for cec01, in order to complete this command, the user should power off cec01 first:
|
||||
|
||||
B<rspconfig> I<cec01 setup_failover>
|
||||
|
||||
cec01: Failover status: Enabled
|
||||
|
||||
B<rpower> I<cec01 off>
|
||||
|
||||
B<rspconfig> I<cec01 setup_failover=disable>
|
||||
|
||||
cec01: Success
|
||||
|
||||
B<rspconfig> I<cec01 setup_failover>
|
||||
|
||||
cec01: Failover status: Disabled
|
||||
|
||||
=item *
|
||||
|
||||
To force service processor failover for cec01:
|
||||
|
||||
B<lshwconn> I<cec01>
|
||||
|
||||
cec01: 192.168.1.1: LINE DOWN
|
||||
cec01: 192.168.2.1: sp=primary,ipadd=192.168.2.1,alt_ipadd=unavailable,state=LINE UP
|
||||
cec01: 192.168.1.2: sp=secondary,ipadd=192.168.1.2,alt_ipadd=unavailable,state=LINE UP
|
||||
cec01: 192.168.2.2: LINE DOWN
|
||||
|
||||
B<rspconfig> I<cec01 force_failover>
|
||||
|
||||
cec01: Success.
|
||||
|
||||
B<lshwconn> I<cec01>
|
||||
|
||||
cec01: 192.168.1.1: sp=secondary,ipadd=192.168.1.1,alt_ipadd=unavailable,state=LINE UP
|
||||
cec01: 192.168.2.1: LINE DOWN
|
||||
cec01: 192.168.1.2: LINE DOWN
|
||||
cec01: 192.168.2.2: sp=primary,ipadd=192.168.2.2,alt_ipadd=unavailable,state=LINE UP
|
||||
|
||||
=item *
|
||||
|
||||
To deconfigure memory bank 9 and 10 of Processing Unit 0 on mm01:
|
||||
|
||||
@@ -234,7 +234,6 @@ To execute B<sinv> on noderange, node1-node4, using node1 as
|
||||
the seed node, to generate the sinv.template from the xdsh command (-c),
|
||||
using the exact match option, generating no additional templates, enter:
|
||||
|
||||
|
||||
B<sinv> I<-c "xdsh node1-node4 lslpp -l | grep bos.adt" -s node1 -e -p /tmp/sinv.template -o /tmp/sinv.output>
|
||||
|
||||
Note: the /tmp/sinv.template file must be empty, otherwise it will be used
|
||||
|
||||
@@ -4,11 +4,11 @@ B<snmove> - Change xCAT compute nodes to use a different xCAT service node.
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
B<snmove> I<noderange> [B<-d>|B<--dest> I<sn2>] [B<-D>|B<--destn> I<sn2n>] [B<-i>|B<--ignorenodes>] [B<-P>|B<--postscripts> I<script1,script2...>|I<all>]
|
||||
B<snmove> [B<-h>|B<--help>]
|
||||
|
||||
B<snmove> B<-s>|B<--source> I<sn1> [B<-S>|B<--sourcen> I<sn1n>] [B<-d>|B<--dest> I<sn2>] [B<-D>|B<--destn> I<sn2n>] [B<-i>|B<--ignorenodes>] [B<-P>|B<--postscripts> I<script1,script2...>|I<all>]
|
||||
B<snmove> I<noderange> [B<-V>] [B<-l>|B<--liteonly>] [[B<-d>|B<--dest>] I<sn2> ] [[B<-D>|B<--destn>] I<sn2n>] [B<-i>|B<--ignorenodes>] [[B<-P>|B<--postscripts>] I<script1,script2...>|I<all> ]
|
||||
|
||||
B<snmove> [B<-h>|B<--help>|B<-v>|B<--version>]
|
||||
B<snmove> [B<-V>] [B<-l>|B<--liteonly>] B<-s>|B<--source> I<sn1> [[B<-S>|B<--sourcen>] I<sn1n>] [[B<-d>|B<--dest>] I<sn2>] [[B<-D>|B<--destn>] I<sn2n>] [B<-i>|B<--ignorenodes>] [B<-P>|B<--postscripts> I<script1,script2...>|I<all>]
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
@@ -48,9 +48,17 @@ node (tftpserver, monserver, nfsserver, conserver), and if they were set
|
||||
to the original service node they will be changed to point to the backup
|
||||
service node.
|
||||
|
||||
In some cases, if you are using the xCAT B<AIX> statelite support, the
|
||||
B<snmove> command will synchronize the persistent statelite directories
|
||||
from the nodes primary service node to it's backup service node.
|
||||
This will only be done if the server specified in the B<statelite> table
|
||||
is the primary service node. You can also use the B<snmove> command to do
|
||||
only the synchronization by using the B<-l> option. This support
|
||||
applies to AIX systems only.
|
||||
|
||||
If the -i option is specified, the nodes themselves will not be modified.
|
||||
|
||||
If the -i option is NOT specified then the nodes will e modified as follows:
|
||||
If the -i option is NOT specified then the nodes will be modified as follows:
|
||||
|
||||
=over 3
|
||||
|
||||
@@ -68,6 +76,10 @@ The B<mkresolvconf> script will be run IF it was included in the nodes postscrip
|
||||
|
||||
=item 4.
|
||||
|
||||
The default gateway will be switched to the backup service node if B<networks.gateway=<xcatmaster>>.
|
||||
|
||||
=item 5.
|
||||
|
||||
If it is an AIX diskful node then the B<niminit> command will be run so that it will recognize the new service node as it's NIM master.
|
||||
|
||||
=back
|
||||
@@ -103,9 +115,13 @@ Specifies the hostname of the destination service node as known by (facing) the
|
||||
|
||||
No modifications will be made on the nodes. If not specified, several xCAT postscripts will be run on the nodes to complete the switch to the new service node.
|
||||
|
||||
=item B<-l|--liteonly>
|
||||
|
||||
Used to synchronize the xCAT B<AIX> statelite persistent files to the backup service node. This option will only attempt to synchronize statelite files that are served by the primary service node for the compute node. When you use this option the B<snmove> command will not actually move the nodes to the backup service node.
|
||||
|
||||
=item B<-P|--postscripts>
|
||||
|
||||
Specifies a list of extra postscripts to be run on the nodes after the nodes are moved over to the new serive node. If 'all' is specified, all the postscripts defined in the postscripts table will be run for the nodes. The specified postscripts must be stored under /install/postscripts directory.
|
||||
Specifies a list of extra postscripts to be run on the nodes after the nodes are moved over to the new service node. If 'all' is specified, all the postscripts defined in the postscripts table will be run for the nodes. The specified postscripts must be stored under /install/postscripts directory.
|
||||
|
||||
=item B<-h|--help>
|
||||
|
||||
@@ -163,6 +179,12 @@ Move all the nodes in xCAT group "sngroup1" to the SN named "xcatsn2" and do not
|
||||
|
||||
B<snmove sngroup1 -d xcatsn2 -i>
|
||||
|
||||
=item 8.
|
||||
|
||||
Synchronize any B<AIX> statelite files from the primary server for compute03 to the backup server. Do not move the node to the backup server at this time.
|
||||
|
||||
B<snmove compute03 -V -l>
|
||||
|
||||
=back
|
||||
|
||||
=head1 FILES
|
||||
|
||||
@@ -156,9 +156,11 @@ To run the "syslog" script for the nodes, type:
|
||||
|
||||
updatenode <noderange> -P syslog
|
||||
|
||||
To run a list of scripts, type:
|
||||
To run a list of scripts, type:
|
||||
|
||||
updatenode <noderange> -P script1,script2
|
||||
updatenode <noderange> -P "script1 p1 p2,script2"
|
||||
|
||||
where p1 p2 are the parameters for script1.
|
||||
|
||||
The flag '-P' can be omitted when only postscripts parameters are
|
||||
specified.
|
||||
@@ -250,6 +252,11 @@ formats.
|
||||
A comma-separated list of script names.
|
||||
The scripts must be executable and copied
|
||||
to the /install/postscripts directory.
|
||||
Each script can take zero or more parameters.
|
||||
If parameters are spcified, the whole list needs to be quoted by double quotes.
|
||||
For example:
|
||||
|
||||
B<"script1 p1 p2,script2">
|
||||
|
||||
=item [B<attr=val> [B<attr=val...>]]
|
||||
|
||||
@@ -381,7 +388,7 @@ the synclist files specified in the osimage "synclists" attribute.
|
||||
|
||||
=item 2
|
||||
|
||||
To perform a software update and file synchronization only on the node
|
||||
To run postscripts and file synchronization only on the node
|
||||
"clstrn01":
|
||||
|
||||
B<updatenode clstrn01 -F -P>
|
||||
@@ -398,27 +405,29 @@ Run:
|
||||
|
||||
B<updatenode clstrn01 -F>
|
||||
|
||||
=item 3
|
||||
=item 4
|
||||
|
||||
To run the postscripts which indicated in the postscripts attribute on
|
||||
the node "clstrn01":
|
||||
|
||||
B<updatenode clstrn01 -P>
|
||||
|
||||
=item 4
|
||||
=item 5
|
||||
|
||||
To run the postscripts script1 and script2 on the node "clstrn01":
|
||||
|
||||
B<cp script1,script2 /install/postscripts>
|
||||
|
||||
B<updatenode clstrn01 -P script1,script2>
|
||||
B<updatenode clstrn01 -P "script1 p1 p2,script2">
|
||||
|
||||
Since flag '-P' can be omitted when only postscripts parameters are specified,
|
||||
the following command is equivalent:
|
||||
|
||||
B<updatenode clstrn01 script1,script2>
|
||||
B<updatenode clstrn01 "script1 p1 p2,script2">
|
||||
|
||||
=item 5
|
||||
p1 p2 are parameters for script1.
|
||||
|
||||
=item 6
|
||||
|
||||
To synchronize the files on the node "clstrn01": Prepare the synclist file.
|
||||
For AIX, set the full path of synclist in the osimage table synclists
|
||||
@@ -428,7 +437,7 @@ Then:
|
||||
|
||||
B<updatenode clstrn01 -F>
|
||||
|
||||
=item 6
|
||||
=item 7
|
||||
|
||||
To perform the software update on the Linux node "clstrn01": Copy the extra
|
||||
rpm into the /install/post/otherpkgs/<os>/<arch>/* and add the rpm names into
|
||||
@@ -436,7 +445,7 @@ the /install/custom/install/<ostype>/profile.otherpkgs.pkglist . Then:
|
||||
|
||||
B<updatenode clstrn01 -S>
|
||||
|
||||
=item 7
|
||||
=item 8
|
||||
|
||||
To update the AIX node named "xcatn11" using the "installp_bundle" and/or
|
||||
"otherpkgs" attribute values stored in the xCAT database. Use the default installp, rpm and emgr flags.
|
||||
@@ -447,53 +456,55 @@ Note: The xCAT "xcatn11" node definition points to an xCAT osimage definition
|
||||
which contains the "installp_bundle" and "otherpkgs" attributes as well as
|
||||
the name of the NIM lpp_source resource.
|
||||
|
||||
=item 8
|
||||
=item 9
|
||||
|
||||
To update the AIX node "xcatn11" by installing the "bos.cpr" fileset using
|
||||
the "-agQXY" installp flags. Also display the output of the installp command.
|
||||
|
||||
B<updatenode xcatn11 -V -S otherpkgs="bos.cpr" installp_flags="-agQXY">
|
||||
B<updatenode xcatn11 -V -S otherpkgs="I:bos.cpr" installp_flags="-agQXY">
|
||||
|
||||
=item 9
|
||||
Note: The 'I:' prefix is optional but recommended for installp packages.
|
||||
|
||||
=item 10
|
||||
|
||||
To uninstall the "bos.cpr" fileset that was installed in the previous example.
|
||||
|
||||
B<updatenode xcatn11 -V -S otherpkgs="bos.cpr" installp_flags="-u">
|
||||
B<updatenode xcatn11 -V -S otherpkgs="I:bos.cpr" installp_flags="-u">
|
||||
|
||||
=item 10
|
||||
=item 11
|
||||
|
||||
To update the AIX nodes "xcatn11" and "xcatn12" with the "gpfs.base" fileset
|
||||
and the "rsync" rpm using the installp flags "-agQXY" and the rpm flags "-i --nodeps".
|
||||
|
||||
B<updatenode xcatn11,xcatn12 -V -S otherpkgs="gpfs.base,R:rsync-2.6.2-1.aix5.1.ppc.rpm" installp_flags="-agQXY" rpm_flags="-i --nodeps">
|
||||
B<updatenode xcatn11,xcatn12 -V -S otherpkgs="I:gpfs.base,R:rsync-2.6.2-1.aix5.1.ppc.rpm" installp_flags="-agQXY" rpm_flags="-i --nodeps">
|
||||
|
||||
Note: Using the "-V" flag with multiple nodes may result in a large amount of output.
|
||||
|
||||
=item 11
|
||||
=item 12
|
||||
|
||||
To uninstall the rsync rpm that was installed in the previous example.
|
||||
|
||||
B<updatenode xcatn11 -V -S otherpkgs="R:rsync-2.6.2-1" rpm_flags="-e">
|
||||
|
||||
=item 12
|
||||
=item 13
|
||||
|
||||
Update the AIX node "node01" using the software specified in the NIM "sslbnd" and "sshbnd" installp_bundle resources and the "-agQXY" installp flags.
|
||||
|
||||
B<updatenode node01 -V -S installp_bundle="sslbnd,sshbnd" installp_flags="-agQXY">
|
||||
|
||||
=item 13
|
||||
=item 14
|
||||
|
||||
To get a preview of what would happen if you tried to install the "rsct.base" fileset on AIX node "node42". (You must use the "-V" option to get the full output from the installp command.)
|
||||
|
||||
B<updatenode node42 -V -S otherpkgs="rsct.base" installp_flags="-apXY">
|
||||
B<updatenode node42 -V -S otherpkgs="I:rsct.base" installp_flags="-apXY">
|
||||
|
||||
=item 14
|
||||
=item 15
|
||||
|
||||
To check what rpm packages are installed on the AIX node "node09". (You must use the "-c" flag so updatenode does not get a list of packages from the database.)
|
||||
|
||||
B<updatenode node09 -V -c -S rpm_flags="-qa">
|
||||
|
||||
=item 15
|
||||
=item 16
|
||||
|
||||
To install all software updates contained in the /images directory.
|
||||
|
||||
@@ -503,25 +514,25 @@ Note: Make sure the directory is exportable and that the permissions are set
|
||||
correctly for all the files. (Including the .toc file in the case of
|
||||
installp filesets.)
|
||||
|
||||
=item 16
|
||||
=item 17
|
||||
|
||||
Install the interim fix package located in the /efixes directory.
|
||||
|
||||
B<updatenode node29 -V -S -d /efixes otherpkgs=IZ38930TL0.120304.epkg.Z>
|
||||
B<updatenode node29 -V -S -d /efixes otherpkgs=E:IZ38930TL0.120304.epkg.Z>
|
||||
|
||||
=item 17
|
||||
=item 18
|
||||
|
||||
To uninstall the interim fix that was installed in the previous example.
|
||||
|
||||
B<updatenode xcatsn11 -V -S -c emgr_flags="-r -L IZ38930TL0">
|
||||
|
||||
=item 18
|
||||
=item 19
|
||||
|
||||
To update the security keys for the node "node01"
|
||||
|
||||
B<updatenode node01 -k>
|
||||
|
||||
=item 19
|
||||
=item 20
|
||||
|
||||
To update the service nodes with the files to be synchronized to node group compute:
|
||||
|
||||
|
||||
@@ -0,0 +1,75 @@
|
||||
=head1 NAME
|
||||
|
||||
B<tabch> - Add, delete or update rows in the database tables.
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
I<tabch [-h| --help]>
|
||||
|
||||
I<tabch [-v| --version]>
|
||||
|
||||
I<tabch [keycolname=keyvalue] [tablename.colname=newvalue] >
|
||||
|
||||
I<tabch [keycolname=keyvalue] [tablename.colname+=newvalue] >
|
||||
|
||||
I<tabch -d [keycolname=keyvalue] [tablename.colname=newvalue] >
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
The tabch command adds, deletes or updates the attribute value in the specified table.column for the specified keyvalue. The difference between tabch and chtab is tabch runs as a plugin under the xcatd daemon. This give the additional security of being authorized by the daemon. Normally, the given value will completely replace the current attribute value. But if "+=" is used instead of "=", the specified value will be appended to the coma separated list of the attribute, if it is not already there.
|
||||
|
||||
|
||||
=head1 OPTIONS
|
||||
|
||||
|
||||
B<-h> Display usage message.
|
||||
|
||||
B<-v> Command Version.
|
||||
|
||||
B<-d> Delete option.
|
||||
|
||||
|
||||
|
||||
=head1 RETURN VALUE
|
||||
|
||||
0 The command completed successfully.
|
||||
|
||||
1 An error has occurred.
|
||||
|
||||
=head1 EXAMPLES
|
||||
|
||||
1. To add a node=node1 to the nodelist table with groups=all:
|
||||
|
||||
I<tabch node=node1 nodelist.groups=all >
|
||||
|
||||
2. To add a keyword (tftpdir) and value (/tftpboot) to the site table:
|
||||
|
||||
I<tabch key=tftpdir site.value=/tftpboot >
|
||||
|
||||
|
||||
3. To add node1 to the nodetype table with os=rhel5:
|
||||
|
||||
I<tabch node=node1 nodetype.os=rhel5>
|
||||
|
||||
|
||||
4. To change node1 in nodetype table setting os=sles:
|
||||
|
||||
I<tabch node=node1 nodetype.os=sles>
|
||||
|
||||
5. To change node1 by appending otherpkgs to the postbootscripts field in the postscripts table:
|
||||
|
||||
I<tabch node=node1 postscripts.postbootscripts+=otherpkgs>
|
||||
|
||||
6. To delete node1 from nodetype table:
|
||||
|
||||
I<tabch -d node=node1 nodetype>
|
||||
|
||||
|
||||
=head1 FILES
|
||||
|
||||
/opt/xcat/sbin/tabch
|
||||
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
L<tabdump(8)|tabdump.8>, L<tabedit(8)|tabedit.8>
|
||||
@@ -4,7 +4,7 @@ B<tabprune> - Deletes records from the eventlog,auditlog,isnm_perf,isnm_perf_sum
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
B<tabprune> B<eventlog | auditlog> [B<-V>] B<-i> I<recid> |B<-n> I<number of records> | B<-p> I<percentage> | B<-a>
|
||||
B<tabprune> B<eventlog | auditlog> [B<-V>] B<-i> I<recid> |B<-n> I<number of records> | B<-p> I<percentage> | B<-d> I<number of days> | B<-a>
|
||||
|
||||
B<tabprune> [B<-h>|B<--help>] [B<-v>|B<--version>]
|
||||
|
||||
@@ -36,6 +36,10 @@ Remove the number of records input.
|
||||
|
||||
Remove the percentage of records input.
|
||||
|
||||
=item B<-d> I<number of days>
|
||||
|
||||
Remove all records that occurred >= than number of days ago.
|
||||
|
||||
=back
|
||||
|
||||
=head1 RETURN VALUE
|
||||
@@ -86,6 +90,12 @@ To remove 50% of the eventlog table:
|
||||
|
||||
B<tabprune> I<eventlog> -p 50
|
||||
|
||||
=item *
|
||||
|
||||
To remove all records that occurred >= 5 days ago in the eventlog:
|
||||
|
||||
B<tabprune> I<eventlog> -d 5
|
||||
|
||||
|
||||
|
||||
=back
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
=head1 NAME
|
||||
|
||||
B<xcatdebug> - Starts the xCAT daemon (xcatd) in trace mode.
|
||||
|
||||
B<xcatdebug> {B<levelnumber>}
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
The xcatdebug command starts the xcatd daemon in Perl Debug Trace mode. It is to be used for diagnosing xCAT problems. The trace outputs the paramters passed into the xcatd subroutines, listed in the tracefiles. The tracefiles are located in /opt/xcat/share/xcat/tools/tracelevel<levelnumber>. The amount of trace data collected varies with the levelnumber. levelnumber 0 being the least amount of trace and increasing with the number. Additional tracelevel files can be created to suit the problem being debugged.
|
||||
|
||||
You must have perl-Debug-Trace installed.
|
||||
|
||||
Before running this command, you should stop xcatd on your system.
|
||||
After running the command, you will have to kill all the xcatd processes and possibly the xcatdebug process.
|
||||
Run ps -ef | grep xcatd and kill any processes
|
||||
Run ps -ef | grep xcatdebug
|
||||
|
||||
|
||||
=head1 OPTIONS
|
||||
|
||||
=over 6
|
||||
|
||||
=item B<levelnumber>
|
||||
|
||||
The levelnumber that will be run. This determines the filename of trace input
|
||||
from /opt/xcat/share/xcat/tools/tracelevel<levelnumber>
|
||||
|
||||
=back
|
||||
|
||||
=head1 ENVIRONMENT VARIABLES
|
||||
|
||||
=head1 EXAMPLES
|
||||
|
||||
=over 2
|
||||
|
||||
=item *
|
||||
|
||||
Run the xcatdebug routine with /opt/xcat/share/xcat/tools/tracelevel0 and output to the screen:
|
||||
|
||||
B<xcatdebug> I<0>
|
||||
|
||||
=item *
|
||||
|
||||
Run the xcatdebug routine with /opt/xcat/share/xcat/tools/tracelevel1 and output to /tmp/traceoutput:
|
||||
|
||||
B<xcatdebug> I<1> > /tmp/traceoutput 2>&1
|
||||
|
||||
=back
|
||||
@@ -101,7 +101,7 @@ This sample configuration file is for a 2 building block cluster.
|
||||
# The nameservers in site table will be set with the value of master automatically.
|
||||
|
||||
xcat-service-lan:
|
||||
# IP range used for DHCP. If you set the entry, the networks table will be filled
|
||||
# IP range used for DHCP. If you set the entry, the networks table will be filled
|
||||
# automatically with this range and the dhcp interface will be set in the site table.
|
||||
dhcp-dynamic-range = 50.0.0.0-50.0.0.200
|
||||
|
||||
@@ -115,13 +115,22 @@ This sample configuration file is for a 2 building block cluster.
|
||||
num-frames-per-hmc = 3
|
||||
# this lists which serial numbers go with which frame numbers
|
||||
vpd-file = vpd2bb.stanza
|
||||
# There are two rules of defining FSP/BPAs. The first defining the node's host name by increasing the last bit
|
||||
# of IP address, while the second defining the node's name by varying the second bit and the third bit of IP.
|
||||
# This assumes you have 2 service LANs: a primary service LAN 10.230.0.0/255.255.0.0 that all of the port 0's
|
||||
# are connected to, and a backup service LAN 10.231.0.0/255.255.0.0 that all of the port 1's are connected to.
|
||||
bpa-a-0-starting-ip = 10.230.1.1
|
||||
bpa-b-0-starting-ip = 10.230.2.1
|
||||
bpa-a-1-starting-ip = 10.231.1.1
|
||||
bpa-b-1-starting-ip = 10.231.2.1
|
||||
|
||||
# bpa-a-0-starting-ip = 10.230.1.1
|
||||
# bpa-b-0-starting-ip = 10.230.2.1
|
||||
# bpa-a-1-starting-ip = 10.231.1.1
|
||||
# bpa-b-1-starting-ip = 10.231.2.1
|
||||
# This assumes you have 2 service LANs: a primary service LAN 40.x.y.z/255.0.0.0 that all of the port 0's
|
||||
# are connected to, and a backup service LAN 41.x.y.z/255.0.0.0 that all of the port 1's are connected to.
|
||||
# "x" is the frame number and "z" is the bpa/fsp id (1 for the first BPA/FSP in the Frame/CEC, 2 for the
|
||||
# second BPA/FSP in the Frame/CEC). For BPAs "y" is always be 0 and for FSPs "y" is the cec id.
|
||||
vlan-1 = 40
|
||||
vlan-2 = 41
|
||||
|
||||
|
||||
xcat-cecs:
|
||||
# These are the connections to the CECs. Either form of hostname is supported.
|
||||
#hostname-range = cec01-cec64
|
||||
@@ -134,13 +143,13 @@ This sample configuration file is for a 2 building block cluster.
|
||||
supernode-list = supernodelist2bb.txt
|
||||
# If you do not want to specify the supernode-list at this time and you have a consistent
|
||||
# number of cecs in each frame, you can instead just use this setting:
|
||||
#num-cecs-per-frame = 12
|
||||
fsp-a-0-starting-ip = 10.230.3.1
|
||||
fsp-b-0-starting-ip = 10.230.4.1
|
||||
fsp-a-1-starting-ip = 10.231.3.1
|
||||
fsp-b-1-starting-ip = 10.231.4.1
|
||||
|
||||
|
||||
num-cecs-per-frame = 12
|
||||
#fsp-a-0-starting-ip = 10.230.3.1
|
||||
#fsp-b-0-starting-ip = 10.230.4.1
|
||||
#fsp-a-1-starting-ip = 10.231.3.1
|
||||
#fsp-b-1-starting-ip = 10.231.4.1
|
||||
|
||||
|
||||
xcat-building-blocks:
|
||||
num-frames-per-bb = 3
|
||||
num-cecs-per-bb = 32
|
||||
@@ -149,7 +158,8 @@ This sample configuration file is for a 2 building block cluster.
|
||||
num-lpars-per-cec = 8
|
||||
# If you set these, then do not set the corresponding attributes in the other node stanzas below.
|
||||
# Except you still need to set xcat-service-nodes:starting-ip (which is the ethernet adapter)
|
||||
hostname-range = f[1-6]c[01-12]p[1-8]
|
||||
#hostname-range = f[1-6]c[01-12]p[1-8]
|
||||
hostname-range = f[1-6]c[01-12]p[01,05,09,13,17,21,25,29]
|
||||
starting-ip = 10.1.1.1
|
||||
aliases = -hf0
|
||||
# ml0 is for aix. For linux, use bond0 instead.
|
||||
@@ -162,7 +172,7 @@ This sample configuration file is for a 2 building block cluster.
|
||||
# this is for the ethernet NIC on each SN
|
||||
#hostname-range = sn1-sn4
|
||||
starting-ip = 10.10.1.1
|
||||
# this value is the same format as the hosts.otherinterfaces attribute except
|
||||
# this value is the same format as the hosts.otherinterfaces attribute except
|
||||
# the IP addresses are starting IP addresses
|
||||
#otherinterfaces = -hf0:10.10.1.1,-hf1:10.11.1.1,-hf2:10.12.1.1,-hf3:10.13.1.1,-ml0:10.14.1.1
|
||||
|
||||
@@ -247,9 +257,14 @@ VPD data or supernode numbers at this time.
|
||||
hostname-range = frame[1-2]
|
||||
|
||||
xcat-cecs:
|
||||
hostname-range = cec[01-24]
|
||||
#hostname-range = cec[01-24]
|
||||
hostname-range = f[1-2]c[01-12]
|
||||
num-cecs-per-frame = 12
|
||||
|
||||
|
||||
xcat-lpars:
|
||||
hostname-range = f[1-2]c[01-12]p[01,05,09,13,17,21,25,29]
|
||||
|
||||
=head2 Database Attributes Written
|
||||
|
||||
The following lists which database attributes are filled in as a result of each stanza. Note that depending on the values
|
||||
@@ -265,7 +280,7 @@ site table: domain, nameservers, topology
|
||||
|
||||
site table: ea_primary_hmc, ea_backup_hmc
|
||||
|
||||
nodelist table: node, groups (all HMCs (hmc) )
|
||||
nodelist table: node, groups (all HMCs (hmc) ), hidden
|
||||
|
||||
hosts table: node, ip
|
||||
|
||||
@@ -275,11 +290,21 @@ nodetype table: node, nodetype
|
||||
|
||||
=item B<xcat-frames>
|
||||
|
||||
nodelist table: node, groups (all frames (frame) )
|
||||
nodelist table: node, groups (all frames (frame) ), hidden
|
||||
|
||||
hosts table: node, ip
|
||||
ppc table: node, id, hcp, nodetype, sfp
|
||||
|
||||
ppc table: node, id, hcp
|
||||
nodetype table: node, nodetype
|
||||
|
||||
nodehm table: node, mgt
|
||||
|
||||
vpd table: node, serial, mtm, side
|
||||
|
||||
=item B<xcat-bpas>
|
||||
|
||||
nodelist table: node, groups (bpa,all) , hidden
|
||||
|
||||
ppc table: node, id, hcp, nodetype, parent
|
||||
|
||||
nodetype table: node, nodetype
|
||||
|
||||
@@ -289,9 +314,8 @@ vpd table: node, serial, mtm, side
|
||||
|
||||
=item B<xcat-cecs>
|
||||
|
||||
nodelist table: node, groups (all CECs (cec), all CECs in a frame (<frame>cec) )
|
||||
nodelist table: node, groups (all CECs (cec), all CECs in a frame (<frame>cec) ), hidden
|
||||
|
||||
hosts table: node, ip
|
||||
|
||||
ppc table: node, supernode, hcp, id, parent
|
||||
|
||||
@@ -303,9 +327,21 @@ nodegroup table: groupname, grouptype, members, wherevals (all nodes in a CEC (
|
||||
|
||||
nodepos: rack, u
|
||||
|
||||
=item B<xcat-fsps>
|
||||
|
||||
nodelist table: node, groups (fsp,all), hidden
|
||||
|
||||
ppc table: node, id, hcp, nodetype, parent
|
||||
|
||||
nodetype table: node, nodetype
|
||||
|
||||
nodehm table: node, mgt
|
||||
|
||||
vpd table: node, serial, mtm, side
|
||||
|
||||
=item B<xcat-building-blocks>
|
||||
|
||||
site table: sharedtftp
|
||||
site table: sharedtftp, sshbetweennodes(service)
|
||||
|
||||
ppc table: node, parent (for frame)
|
||||
|
||||
|
||||
+137
-6
@@ -24,7 +24,7 @@ use strict;
|
||||
|
||||
|
||||
dumpxCATdb -p <directory to place database dump>
|
||||
|
||||
See man page.
|
||||
|
||||
=cut
|
||||
|
||||
@@ -33,6 +33,25 @@ use strict;
|
||||
my $rc = 0;
|
||||
my $cmd;
|
||||
&parse_args;
|
||||
if ($::BINARY) { # not using xCAT to dump, using the database utility
|
||||
my $DBname = xCAT::Utils->get_DBName;
|
||||
if ($DBname eq "DB2") {
|
||||
$rc=&DB2_bindump;
|
||||
if ($rc == 0) {
|
||||
xCAT::MsgUtils->message("I", "Backup Complete.");
|
||||
} else {
|
||||
xCAT::MsgUtils->message("I", "Backup Failed.");
|
||||
}
|
||||
exit $rc;
|
||||
} else {
|
||||
xCAT::MsgUtils->message("E",
|
||||
"Binary dump (-b) is only supported for DB2");
|
||||
exit 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
# Dump using xCAT utilities
|
||||
my @output = xCAT::Utils->runcmd("tabdump", 0);
|
||||
if ($::RUNCMD_RC != 0)
|
||||
{ # error
|
||||
@@ -40,11 +59,17 @@ if ($::RUNCMD_RC != 0)
|
||||
"Error running tabdump to get list of tables");
|
||||
exit 1;
|
||||
}
|
||||
# read tables to skip during dump from site.skiptables attribute
|
||||
my @output2=xCAT::Utils->get_site_attribute('skiptables');
|
||||
# Determine which table to skip
|
||||
my @output2;
|
||||
if ($ENV{'XCAT_SKIPTABLES'}) {
|
||||
@output2=$ENV{'XCAT_SKIPTABLES'};
|
||||
} else {
|
||||
# read tables to skip from site.skiptables attribute
|
||||
@output2=xCAT::Utils->get_site_attribute('skiptables');
|
||||
}
|
||||
my @skiptbls;
|
||||
if (@output2) {
|
||||
@skiptbls = split (/\,/,$output2[0]);
|
||||
@skiptbls = split (/\,/,$output2[0]);
|
||||
}
|
||||
foreach my $table (@output)
|
||||
{
|
||||
@@ -62,7 +87,14 @@ foreach my $table (@output)
|
||||
}
|
||||
next;
|
||||
}
|
||||
# skip and table in the site.skiptables attribute
|
||||
# skip ISNM tables except isnm_config
|
||||
if ( $table =~ /^isnm_perf/ ) {
|
||||
if ($::DUMPVERBOSE) {
|
||||
xCAT::MsgUtils->message("I", "Skipping $table\n");
|
||||
}
|
||||
next;
|
||||
}
|
||||
# skip any table in the site.skiptables attribute
|
||||
if (grep(/^$table$/, @skiptbls)) {
|
||||
if ($::DUMPVERBOSE) {
|
||||
xCAT::MsgUtils->message("I", "Skipping $table\n");
|
||||
@@ -98,13 +130,14 @@ sub parse_args
|
||||
{
|
||||
my $msg;
|
||||
my $usagemsg =
|
||||
" dumpxCATdb -h \n dumpxCATdb -v \n dumpxCATdb [-a] [-V] <-p> [path to dump directory]";
|
||||
" dumpxCATdb -h \n dumpxCATdb -v \n dumpxCATdb [-a] [-V] <-p> [path to backup directory] \n dumpxCATdb -b [-V] <-p> [path to backup directory]";
|
||||
Getopt::Long::Configure("posix_default");
|
||||
Getopt::Long::Configure("no_gnu_compat");
|
||||
Getopt::Long::Configure("bundling");
|
||||
if (
|
||||
!GetOptions(
|
||||
'a|all' => \$::ALL,
|
||||
'b|bin' => \$::BINARY,
|
||||
'p|path=s' => \$::PATH,
|
||||
'h|help' => \$::HELP,
|
||||
'V|verbose' => \$::DUMPVERBOSE,
|
||||
@@ -147,3 +180,101 @@ sub parse_args
|
||||
|
||||
}
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
=head3 DB2_bindump
|
||||
|
||||
Uses the DB2 Database supplied backup utility to backup the database
|
||||
|
||||
=cut
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
sub DB2_bindump
|
||||
{
|
||||
my $msg;
|
||||
my $rc=0;
|
||||
# check to see if they are setup to do an online dump
|
||||
# Database has to have defined logretain RECOVERY and there
|
||||
# must already been taken an offline backup.
|
||||
my $cmd="db2 get database configuration for xcatdb > /tmp/db2output";
|
||||
$rc = &rundb2cmd($cmd); # must su to xcatdb
|
||||
if ($rc != 0)
|
||||
{
|
||||
xCAT::MsgUtils->message("E", " $cmd error.");
|
||||
return 1;
|
||||
}
|
||||
|
||||
# check to see if they setup log recover
|
||||
$cmd = " egrep -i \"Log retain for recovery enabled\" /tmp/db2output";
|
||||
my @output=xCAT::Utils->runcmd($cmd, -1);
|
||||
if ($::RUNCMD_RC != 0) {
|
||||
xCAT::MsgUtils->message("E", "Log retain for recovery enabled (LOGRETAIN) = RECOVERY must be set to perform ONLINE Backups and one ONLINE backup must have been taken. See xCAT DB2 documentation. The section - Backup/Restore the database with DB2 Commands.");
|
||||
return 1;
|
||||
} else { # check to see if LOGRETAIN is ON
|
||||
if (!grep(/ = RECOVERY/, @output)) {
|
||||
xCAT::MsgUtils->message("E", "Log retain for recovery enabled (LOGRETAIN) = RECOVERY must be set to perform ONLINE Backups and one ONLINE backup must have been taken. See xCAT DB2 documentation. The section - Backup/Restore the database with DB2 Commands.");
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
# check to see if they have one backup
|
||||
$cmd = " ls $::PATH";
|
||||
@output=xCAT::Utils->runcmd($cmd, -1);
|
||||
if ($::RUNCMD_RC != 0) {
|
||||
xCAT::MsgUtils->message("E", "One ONLINE backup must have been taken and exist in $::PATH. See xCAT DB2 documentation. The section - Backup/Restore the database with DB2 Commands.");
|
||||
return 1;
|
||||
} else { # check to see if LOGRETAIN is ON
|
||||
if (!grep(/XCATDB/, @output)) {
|
||||
xCAT::MsgUtils->message("E", "One ONLINE backup must have been taken and exist in $::PATH. See xCAT DB2 documentation. The section - Backup/Restore the database with DB2 Commands.");
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
# finally all checks ok, can take an ONLINE backup
|
||||
# get password from cfgloc
|
||||
|
||||
my $cmd="cat /etc/xcat/cfgloc";
|
||||
my $info=xCAT::Utils->runcmd($cmd, -1);
|
||||
if ($::RUNCMD_RC != 0) {
|
||||
xCAT::MsgUtils->message("E", "Cannot read /etc/xcat/cfgloc.");
|
||||
return 1;
|
||||
}
|
||||
chomp($info);
|
||||
my ($db,$inst,$pw) = split(/\|/, $info);
|
||||
|
||||
my $cmd=" db2 backup db xcatdb user xcatdb using $pw ONLINE to $::PATH";
|
||||
$rc = &rundb2cmd($cmd); # must su to xcatdb
|
||||
if ($rc != 0)
|
||||
{
|
||||
xCAT::MsgUtils->message("E", " $cmd error.");
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
|
||||
}
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
=head3 rundb2cmd
|
||||
|
||||
|
||||
Run a commmand as the xcatdb instance id
|
||||
Input: command
|
||||
|
||||
=cut
|
||||
#-----------------------------------------------------------------------------
|
||||
sub rundb2cmd
|
||||
{
|
||||
my $orgcmd = shift;
|
||||
my $rc = 0;
|
||||
my $cmd = "\'";
|
||||
$cmd .= $orgcmd;
|
||||
$cmd .= ' 2>&1';
|
||||
$cmd .= "\'";
|
||||
system("su - xcatdb -c $cmd");
|
||||
if ($? > 0) # error
|
||||
{
|
||||
$rc = $? >> 8;
|
||||
}
|
||||
return ($rc);
|
||||
}
|
||||
|
||||
|
||||
@@ -35,8 +35,9 @@ then
|
||||
fi
|
||||
|
||||
nodes=`echo $1 |sed "s/,/ /g"`
|
||||
if [ -n "$ETH" ]; then
|
||||
nodes=`echo $nodes |sed "s/ /-$ETH /g"`
|
||||
if [ -n "$ETH" ]; then
|
||||
nodes=`echo $nodes |sed "s/-hf[0-9]//g"`
|
||||
nodes=`echo $nodes |sed "s/ /-$ETH /g"`
|
||||
nodes="$nodes-$ETH"
|
||||
fi
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@ use strict;
|
||||
|
||||
|
||||
restorexCATdb -p <directory containing db restore .csv files>
|
||||
restorexCATdb -b -p <directory binary database backup>
|
||||
|
||||
|
||||
=cut
|
||||
@@ -33,7 +34,22 @@ use strict;
|
||||
my $rc = 0;
|
||||
|
||||
&parse_args;
|
||||
|
||||
if ($::BINARY) { # not using xCAT to dump, using the database utility
|
||||
my $DBname = xCAT::Utils->get_DBName;
|
||||
if ($DBname eq "DB2") {
|
||||
$rc=&DB2_binrestore;
|
||||
if ($rc == 0) {
|
||||
xCAT::MsgUtils->message("I", "Restore Complete. You can now restart the daemons.");
|
||||
} else {
|
||||
xCAT::MsgUtils->message("E", "Restore Failed.");
|
||||
}
|
||||
exit $rc;
|
||||
} else {
|
||||
xCAT::MsgUtils->message("E",
|
||||
"Binary restore (-b) is only supported for DB2");
|
||||
exit 1;
|
||||
}
|
||||
}
|
||||
# read all the *.csv files from the input directory and restore the database
|
||||
opendir DIRPATH, $::PATH;
|
||||
if ($? != 0)
|
||||
@@ -71,6 +87,14 @@ foreach my $table (@files)
|
||||
}
|
||||
next;
|
||||
}
|
||||
# skip ISNM tables except isnm_config
|
||||
if ( $table =~ /^isnm_perf/ ) {
|
||||
if ($::DUMPVERBOSE) {
|
||||
xCAT::MsgUtils->message("I", "Skipping $table\n");
|
||||
}
|
||||
next;
|
||||
}
|
||||
|
||||
# skip and table in the site.skiptables attribute
|
||||
if (@skiptbls) {
|
||||
my ($tmptable,$suffix) = split(/\./,$table);
|
||||
@@ -112,14 +136,16 @@ sub parse_args
|
||||
{
|
||||
my $msg;
|
||||
my $usagemsg =
|
||||
" restorexCATdb -h \n restorexCATdb -v \n restorexCATdb [-a] [-V] <-p> [path to restore .csv files]\n";
|
||||
" restorexCATdb -h \n restorexCATdb -v \n restorexCATdb [-a] [-V] <-p> [path to restore .csv files]\n restorexCATdb -b [-V] <-t> [timestamp on restore backup file] <-p> [path to restore backup file]";
|
||||
Getopt::Long::Configure("posix_default");
|
||||
Getopt::Long::Configure("no_gnu_compat");
|
||||
Getopt::Long::Configure("bundling");
|
||||
if (
|
||||
!GetOptions(
|
||||
'a|all' => \$::ALL,
|
||||
'b|binary' => \$::BINARY,
|
||||
'p|path=s' => \$::PATH,
|
||||
't|timestamp=s' => \$::TIMESTAMP,
|
||||
'h|help' => \$::HELP,
|
||||
'V|verbose' => \$::VERBOSEREST,
|
||||
'v|version' => \$::VERSION
|
||||
@@ -156,4 +182,85 @@ sub parse_args
|
||||
}
|
||||
|
||||
}
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
=head3 DB2_binrestore
|
||||
|
||||
Uses the DB2 Database supplied restore utility to restore the database
|
||||
|
||||
=cut
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
sub DB2_binrestore
|
||||
{
|
||||
my $msg;
|
||||
my $rc=0;
|
||||
if (!($::TIMESTAMP)){
|
||||
xCAT::MsgUtils->message("E", "To restore from a binary backup, the timestamp of the backup must be provided with the -t option.");
|
||||
return 1;
|
||||
}
|
||||
# check to see if xcatd running. Cannot restore if it is
|
||||
my $cmd = "ps -ef | grep xcatd";
|
||||
my @output=xCAT::Utils->runcmd($cmd, -1);
|
||||
if ($::RUNCMD_RC == 0) { # found something
|
||||
if (grep(/xcatd: SSL listener/, @output)) { # xcatd running
|
||||
xCAT::MsgUtils->message("E", "xcatd is still accessing the database. All applications accessing the DB2 database must be stopped before you can restore.");
|
||||
return 1;
|
||||
|
||||
}
|
||||
}
|
||||
# get password from cfgloc
|
||||
|
||||
my $cmd="cat /etc/xcat/cfgloc";
|
||||
my $info=xCAT::Utils->runcmd($cmd, -1);
|
||||
if ($::RUNCMD_RC != 0) {
|
||||
xCAT::MsgUtils->message("E", "Cannot read /etc/xcat/cfgloc.");
|
||||
return 1;
|
||||
}
|
||||
chomp($info);
|
||||
my ($db,$inst,$pw) = split(/\|/, $info);
|
||||
|
||||
# Hopefully nothing else is accessing the database, so try restore
|
||||
$cmd="db2 restore db xcatdb user xcatdb using $pw from $::PATH taken at $::TIMESTAMP";
|
||||
$rc = &rundb2cmd($cmd); # must su to xcatdb
|
||||
if ($rc != 0)
|
||||
{
|
||||
xCAT::MsgUtils->message("E", " $cmd error.");
|
||||
return 1;
|
||||
}
|
||||
# Now roll forward any tranactions since the backup
|
||||
$cmd="db2 rollforward database xcatdb to end of logs and complete";
|
||||
$rc = &rundb2cmd($cmd); # must su to xcatdb
|
||||
if ($rc != 0)
|
||||
{
|
||||
xCAT::MsgUtils->message("E", " $cmd error.");
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
=head3 rundb2cmd
|
||||
|
||||
|
||||
Run a commmand as the xcatdb instance id
|
||||
Input: command
|
||||
|
||||
=cut
|
||||
#-----------------------------------------------------------------------------
|
||||
sub rundb2cmd
|
||||
{
|
||||
my $orgcmd = shift;
|
||||
my $rc = 0;
|
||||
my $cmd = "\'";
|
||||
$cmd .= $orgcmd;
|
||||
$cmd .= ' 2>&1';
|
||||
$cmd .= "\'";
|
||||
system("su - xcatdb -c $cmd");
|
||||
if ($? > 0) # error
|
||||
{
|
||||
$rc = $? >> 8;
|
||||
}
|
||||
return ($rc);
|
||||
}
|
||||
|
||||
|
||||
@@ -30,6 +30,7 @@ Requires: expat
|
||||
xCAT-client provides the xCAT commands (chtab, chnode, rpower, etc) helpful in administrating systems at scale, with particular attention paid to large HPC clusters.
|
||||
|
||||
%prep
|
||||
|
||||
%setup -q -n xCAT-client
|
||||
%build
|
||||
# This phase is done in (for RH): /usr/src/redhat/BUILD/xCAT-client-2.0
|
||||
@@ -148,6 +149,7 @@ ln -sf ../bin/xcatclientnnr $RPM_BUILD_ROOT/%{prefix}/bin/swapnodes
|
||||
ln -sf ../bin/xcatclientnnr $RPM_BUILD_ROOT/%{prefix}/bin/nodegrpch
|
||||
ln -sf ../bin/xcatclientnnr $RPM_BUILD_ROOT/%{prefix}/sbin/tabdump
|
||||
ln -sf ../bin/xcatclientnnr $RPM_BUILD_ROOT/%{prefix}/sbin/tabprune
|
||||
ln -sf ../bin/xcatclientnnr $RPM_BUILD_ROOT/%{prefix}/sbin/tabch
|
||||
ln -sf ../bin/xcatclientnnr $RPM_BUILD_ROOT/%{prefix}/sbin/packimage
|
||||
ln -sf ../bin/xcatclientnnr $RPM_BUILD_ROOT/%{prefix}/sbin/rmimage
|
||||
ln -sf ../bin/xcatclient $RPM_BUILD_ROOT/%{prefix}/sbin/makedns
|
||||
@@ -216,23 +218,35 @@ rm -rf $RPM_BUILD_ROOT
|
||||
* Tue Feb 20 2007 Jarrod Johnson <jbjohnso@us.ibm.com>
|
||||
- Start core rpm for 1.3 work
|
||||
|
||||
%pre
|
||||
# only need to check on AIX
|
||||
%ifnos linux
|
||||
if [ -x /usr/sbin/emgr ]; then # Check for emgr cmd
|
||||
/usr/sbin/emgr -l 2>&1 | grep -i xCAT # Test for any xcat ifixes - msg and exit if found
|
||||
if [ $? = 0 ]; then
|
||||
echo "Error: One or more xCAT emgr ifixes are installed. You must use the /usr/sbin/emgr command to uninstall each xCAT emgr ifix prior to RPM installation."
|
||||
exit 2
|
||||
fi
|
||||
fi
|
||||
%endif
|
||||
|
||||
%post
|
||||
%ifos linux
|
||||
cat << EOF > /etc/profile.d/xcat.sh
|
||||
XCATROOT=$RPM_INSTALL_PREFIX0
|
||||
PATH=\$PATH:\$XCATROOT/bin:\$XCATROOT/sbin
|
||||
MANPATH=\$MANPATH:\$XCATROOT/share/man:
|
||||
PATH=\$XCATROOT/bin:\$XCATROOT/sbin:\$PATH
|
||||
MANPATH=\$XCATROOT/share/man:\$MANPATH
|
||||
export XCATROOT PATH MANPATH
|
||||
export PERL_BADLANG=0
|
||||
EOF
|
||||
|
||||
cat << EOF > /etc/profile.d/xcat.csh
|
||||
setenv XCATROOT "$RPM_INSTALL_PREFIX0"
|
||||
setenv PATH \${PATH}:\${XCATROOT}/bin:\${XCATROOT}/sbin
|
||||
setenv PATH \${XCATROOT}/bin:\${XCATROOT}/sbin:\${PATH}
|
||||
if !(\$?MANPATH) then
|
||||
setenv MANPATH \${XCATROOT}/share/man:
|
||||
else
|
||||
setenv MANPATH \${MANPATH}:\${XCATROOT}/share/man:
|
||||
setenv MANPATH \${XCATROOT}/share/man:\${MANPATH}
|
||||
endif
|
||||
setenv PERL_BADLANG 0
|
||||
EOF
|
||||
@@ -249,8 +263,8 @@ if ! egrep XCATROOT /etc/profile > /dev/null 2>&1 ; then
|
||||
echo "
|
||||
# xCAT setup
|
||||
XCATROOT=$RPM_INSTALL_PREFIX0
|
||||
PATH=\$PATH:\$XCATROOT/bin:\$XCATROOT/sbin
|
||||
MANPATH=\$MANPATH:\$XCATROOT/share/man:
|
||||
PATH=\$XCATROOT/bin:\$XCATROOT/sbin:$PATH
|
||||
MANPATH=\$XCATROOT/share/man:\$MANPATH
|
||||
export XCATROOT PATH MANPATH
|
||||
" >>/etc/profile
|
||||
fi
|
||||
|
||||
@@ -146,6 +146,7 @@ sub parse_lsrsrc_output
|
||||
my %count = {};
|
||||
|
||||
foreach $line (@$output){
|
||||
if ($line =~ /^ERROR/) { next;} #skip the lines with error
|
||||
@value = split /::/, $line;
|
||||
$name = $value[0];
|
||||
$name =~ s/[^A-Za-z0-9]+/'.'/;
|
||||
@@ -211,7 +212,7 @@ sub getmetrix
|
||||
my @output = ();
|
||||
my $rrd = undef;
|
||||
my $line = undef;
|
||||
my $ret = undef;
|
||||
my $ret = 0;
|
||||
my $msg = undef;
|
||||
my $cmd = undef;
|
||||
|
||||
@@ -243,25 +244,26 @@ sub getmetrix
|
||||
|
||||
if($rname eq "__ALL__"){
|
||||
$cmd = "CT_MANAGEMENT_SCOPE=3 lsrsrc-api -i -s $rsrc"."::::Name::NodeNameList::$attr";
|
||||
@output = xCAT::Utils->runcmd($cmd, 0);
|
||||
if($::RUNCMD_RC != 0){
|
||||
$line = join '', @output;
|
||||
return ($::RUNCMD_RC, $line);
|
||||
}
|
||||
@output = xCAT::Utils->runcmd($cmd, -1);
|
||||
#if($::RUNCMD_RC != 0){
|
||||
# $line = join '', @output;
|
||||
# return ($::RUNCMD_RC, $line);
|
||||
#}
|
||||
#print "+++++ rsrc=$rsrc\nattrs=@attrs\noutput=@output\n";
|
||||
&parse_lsrsrc_output($rsrc, \@attrs, \@output);
|
||||
} else {
|
||||
@names = split /,/, $rname;
|
||||
foreach $name (@names){
|
||||
$cmd = "CT_MANAGEMENT_SCOPE=3 lsrsrc-api -i -s $rsrc"."::\'Name==\"$name\"\'::Name::NodeNameList::$attr";
|
||||
@output = xCAT::Utils->runcmd($cmd, 0);
|
||||
if($::RUNCMD_RC){
|
||||
$line = join '', @output;
|
||||
return ($::RUNCMD_RC, $line);
|
||||
}
|
||||
@output = xCAT::Utils->runcmd($cmd, -1);
|
||||
#if($::RUNCMD_RC){
|
||||
# $line = join '', @output;
|
||||
# return ($::RUNCMD_RC, $line);
|
||||
#}
|
||||
#print "--- rsrc=$rsrc\nattrs=@attrs\noutput=@output\n";
|
||||
&parse_lsrsrc_output($rsrc, \@attrs, \@output);
|
||||
}
|
||||
}
|
||||
|
||||
foreach $attr (keys %metrix){
|
||||
foreach $nnlist (keys %{$metrix{$attr}}){
|
||||
if(($nnlist ne 'summary') && ($nnlist ne 'number')){
|
||||
|
||||
@@ -890,7 +890,9 @@ sub getNodeID {
|
||||
my $tmp=$tab->getNodeAttribs($node, ['mac']);
|
||||
if (defined($tmp) && ($tmp)) {
|
||||
my $mac=$tmp->{mac};
|
||||
$mac =~ s/://g;
|
||||
$mac =~ s/\|.*//g; #use the first mac
|
||||
$mac =~ s/\!.*//g; #remove the hostname
|
||||
$mac =~ s/://g; #remove :
|
||||
$mac = "EA" . $mac . "EA";
|
||||
$tab->close();
|
||||
return $mac;
|
||||
@@ -1148,6 +1150,18 @@ sub addNodes {
|
||||
}
|
||||
}
|
||||
|
||||
#check if hmc node added to management domain successfully
|
||||
my $n = 6;
|
||||
while($n > 0){
|
||||
$result = `/usr/sbin/rsct/bin/rmcdomainstatus -s ctrmc | grep $node`;
|
||||
if ($result =~ /\s$node\s/){
|
||||
last;
|
||||
} else {
|
||||
sleep 10;
|
||||
$n = $n - 1;
|
||||
}
|
||||
}
|
||||
|
||||
#define AllServiceableEvents_B condition on the HMC
|
||||
$result=`CT_MANAGEMENT_SCOPE=3 /usr/bin/mkrsrc-api IBM.Condition::Name::"AllServiceableEvents_B"::ResourceClass::"IBM.Sensor"::EventExpression::"String=?\\\"LSSVCEVENTS_ALL%\\\""::SelectionString::"Name=\\\"CSMServiceableEventSensor\\\""::NodeNameList::{\\\"$node\\\"}::EventBatchingInterval::1::BatchedEventRetentionPeriod::72 2>&1`;
|
||||
if (($?) && ($result !~ /2618-201|2618-008|2636-050/)){
|
||||
|
||||
+13
-5
@@ -24,6 +24,7 @@ Provides: xCAT-rmc = %{version}
|
||||
Provides RMC monitoring plug-in module for xCAT, configuration scripts, predefined conditions, responses and sensors.
|
||||
|
||||
%prep
|
||||
|
||||
%setup -q -n xCAT-rmc
|
||||
%build
|
||||
%install
|
||||
@@ -75,6 +76,18 @@ rm -rf $RPM_BUILD_ROOT
|
||||
|
||||
%changelog
|
||||
|
||||
%pre
|
||||
# only need to check on AIX
|
||||
%ifnos linux
|
||||
if [ -x /usr/sbin/emgr ]; then # Check for emgr cmd
|
||||
/usr/sbin/emgr -l 2>&1 | grep -i xCAT # Test for any xcat ifixes - msg and exit if found
|
||||
if [ $? = 0 ]; then
|
||||
echo "Error: One or more xCAT emgr ifixes are installed. You must use the /usr/sbin/emgr command to uninstall each xCAT emgr ifix prior to RPM installation."
|
||||
exit 2
|
||||
fi
|
||||
fi
|
||||
%endif
|
||||
|
||||
%post
|
||||
%ifos linux
|
||||
if [ -f "/proc/cmdline" ]; then # prevent running it during install into chroot image
|
||||
@@ -95,8 +108,3 @@ rm -rf $RPM_BUILD_ROOT
|
||||
%endif
|
||||
exit 0
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -48,6 +48,7 @@ my %modules = (
|
||||
rscan => { hmc => "xCAT::PPCscan",
|
||||
fsp => "xCAT::FSPscan",
|
||||
cec => "xCAT::FSPscan",
|
||||
ivm => "xCAT::PPCscan",
|
||||
},
|
||||
mkvm => { hmc => "xCAT::PPCvm",
|
||||
fsp => "xCAT::FSPvm",
|
||||
@@ -170,7 +171,7 @@ sub process_command {
|
||||
my %nodes = ();
|
||||
my $callback = $request->{callback};
|
||||
my $sitetab = xCAT::Table->new( 'site' );
|
||||
my @site = qw(ppcmaxp ppctimeout maxssh ppcretry fsptimeout powerinterval);
|
||||
my @site = qw(ppcmaxp ppctimeout maxssh ppcretry fsptimeout powerinterval syspowerinterval);
|
||||
my $start;
|
||||
my $verbose = $request->{verbose};
|
||||
|
||||
@@ -182,6 +183,8 @@ sub process_command {
|
||||
$request->{fsptimeout} = 0;
|
||||
$request->{ppcretry} = 3;
|
||||
$request->{maxssh} = 8;
|
||||
$request->{powerinterval} = 0;
|
||||
$request->{syspowerinterval} = 0;
|
||||
|
||||
#######################################
|
||||
# Get site table attributes
|
||||
@@ -404,11 +407,18 @@ sub process_command {
|
||||
my $sessions;
|
||||
my $pid_owner;
|
||||
my $remain_node = $nodes;
|
||||
my $num = 0;
|
||||
|
||||
while ( scalar($remain_node) ) {
|
||||
$remain_node = ();
|
||||
foreach my $hash ( @$nodes ) {
|
||||
$SIG{CHLD} = sub { my $pid = 0; while (($pid = waitpid(-1, WNOHANG)) > 0) { $hw->{$pid_owner->{$pid}}--; $children--; } };
|
||||
$SIG{INT} = $SIG{TERM} = $SIG{KILL} = sub { #prepare to process job termination and propogate it down
|
||||
foreach my $pid (keys %{$pid_owner}) {
|
||||
&kill_children_by_pid($pid);
|
||||
}
|
||||
exit 0;
|
||||
};
|
||||
|
||||
while ( $children >= $request->{ppcmaxp} ) {
|
||||
my $handlednodes={};
|
||||
@@ -434,9 +444,23 @@ sub process_command {
|
||||
push( @$remain_node, [@$hash[0], @$hash[1]] );
|
||||
next;
|
||||
}
|
||||
|
||||
if( $num > 0 && $request->{op} =~ /^on/ && $request->{fsp_api} == 1) {
|
||||
my $t_hash = @$hash[1];
|
||||
my $one_key_in_thash = (keys %$t_hash)[0];
|
||||
my $one_d = $t_hash->{$one_key_in_thash};
|
||||
#print Dumper($one_d);
|
||||
if($$one_d[4] =~ /^fsp$/ || $$one_d[4] =~ /^cec$/) {
|
||||
if( $request->{syspowerinterval} > 0) {
|
||||
no_interrupt_sleep($request->{syspowerinterval});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
my ($pipe,$pid) = fork_cmd( @$hash[0], @$hash[1], $request );
|
||||
|
||||
$num++;
|
||||
|
||||
if ($pid) {
|
||||
$pid_owner->{$pid} = @$hash[0];
|
||||
$hw->{@$hash[0]}++;
|
||||
@@ -453,7 +477,14 @@ sub process_command {
|
||||
} elsif ( $request->{command} =~ /^rspconfig$/&& exists( $request->{opt}->{resetnet} ) ) {
|
||||
runcmd( $request );
|
||||
} else {
|
||||
my %pid_owner = ();
|
||||
$SIG{CHLD} = sub { while (waitpid(-1, WNOHANG) > 0) { $children--; } };
|
||||
$SIG{INT} = $SIG{TERM} = $SIG{KILL} = sub { #prepare to process job termination and propogate it down
|
||||
foreach my $pid (keys %pid_owner) {
|
||||
&kill_children_by_pid($pid);
|
||||
}
|
||||
exit 0;
|
||||
};
|
||||
my $hw;
|
||||
my $sessions;
|
||||
|
||||
@@ -481,8 +512,9 @@ sub process_command {
|
||||
}
|
||||
$hw = @$_[0];
|
||||
|
||||
my ($pipe) = fork_cmd( @$_[0], @$_[1], $request );
|
||||
my ($pipe,$pid) = fork_cmd( @$_[0], @$_[1], $request );
|
||||
if ( $pipe ) {
|
||||
$pid_owner{$pid} = $pid;
|
||||
$fds->add( $pipe );
|
||||
$children++;
|
||||
}
|
||||
@@ -543,6 +575,30 @@ ENDOFFORK:
|
||||
return(0);
|
||||
}
|
||||
|
||||
sub no_interrupt_sleep {
|
||||
my $sleep_time = shift;
|
||||
my $sleep_end = time + $sleep_time;
|
||||
while (1) {
|
||||
my $sleep_duration = $sleep_end - time;
|
||||
last if $sleep_duration <= 0;
|
||||
Time::HiRes::sleep($sleep_duration);
|
||||
}
|
||||
}
|
||||
|
||||
sub kill_children_by_pid {
|
||||
my $pid = shift;
|
||||
my @pids = `ps -o pid,ppid -e`;
|
||||
for my $a_pid (@pids) {
|
||||
if( $a_pid =~ /\s*(\d*)\s*(\d*)/ ) {
|
||||
my $tmp_pid = $1;
|
||||
my $tmp_ppid = $2;
|
||||
if($tmp_ppid == $pid) {
|
||||
kill 9, $tmp_pid;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
##########################################################################
|
||||
# updateNodeStatus
|
||||
##########################################################################
|
||||
@@ -1297,11 +1353,11 @@ sub handle_find_hw_children {
|
||||
if (!defined($vpdtab) or !defined($child_type)) {
|
||||
return undef;
|
||||
}
|
||||
my $mtms = $vpdtab->getAttribs({node=>$host}, qw(serial mtm));
|
||||
my $mtms = $vpdtab->getNodeAttribs($host, qw(serial mtm));
|
||||
if (!defined($mtms)) {
|
||||
return undef;
|
||||
}
|
||||
my @nodearray = $vpdtab->getAttribs({serial=>$mtms->{serial}, mtm=>$mtms->{mtm}}, qw(node side));
|
||||
my @nodearray = $vpdtab->getAttribs({serial=>$mtms->{serial}, mtm=>$mtms->{mtm}}, qw(node side)); # need regx
|
||||
if (!defined(@nodearray)) {
|
||||
return undef;
|
||||
}
|
||||
@@ -1398,6 +1454,7 @@ sub process_children {
|
||||
if (defined($conn_flag{$dir})) {
|
||||
next;
|
||||
}
|
||||
$request->{$index->{node}}{cred} = $request->{$host}{cred};
|
||||
my $res = &handle_cmd($index->{node}, $host, $request);
|
||||
$output{$side} = \$res;
|
||||
if ($res->[0]->{errorcode} ne '128') {
|
||||
@@ -1768,25 +1825,44 @@ sub preprocess_request {
|
||||
# get the HCPs for the LPARs in order to figure out which service
|
||||
# nodes to send the requests to
|
||||
###################################################################
|
||||
my $hcptab_name = ($package eq "fsp" or $package eq "bpa") ? "ppcdirect" : "ppchcp";
|
||||
my $hcptab = xCAT::Table->new( $hcptab_name );
|
||||
unless ($hcptab ) {
|
||||
$callback->({data=>["Cannot open $hcptab_name table"]});
|
||||
$req = {};
|
||||
return;
|
||||
}
|
||||
#my $hcptab_name = ($package eq "fsp" or $package eq "bpa") ? "ppcdirect" : "ppchcp";
|
||||
#my $hcptab = xCAT::Table->new( $hcptab_name );
|
||||
#unless ($hcptab ) {
|
||||
# $callback->({data=>["Cannot open $hcptab_name table"]});
|
||||
# $req = {};
|
||||
# return;
|
||||
#}
|
||||
# Check if each node is hcp
|
||||
my %hcp_hash=();
|
||||
my @missednodes=();
|
||||
foreach ( @$noderange ) {
|
||||
my ($ent) = $hcptab->getAttribs( {hcp=>$_},"hcp" );
|
||||
if ( !defined( $ent )) {
|
||||
push @missednodes, $_;
|
||||
next;
|
||||
}
|
||||
push @{$hcp_hash{$_}{nodes}}, $_;
|
||||
my $support_hcp_type;
|
||||
# in the DFM model, cec/fsp/Frame/bpa can be hcp.
|
||||
if ($package eq "fsp" or $package eq "bpa") {
|
||||
$support_hcp_type = "(fsp|cec|bpa|frame)";
|
||||
# in the HMC model, only hmc can be hcp.
|
||||
} elsif ($package eq "hmc") {
|
||||
$support_hcp_type = "hmc";
|
||||
# package equal 'ivm', only ivm can be hcp.
|
||||
} else {
|
||||
$support_hcp_type = "ivm";
|
||||
}
|
||||
|
||||
foreach ( @$noderange ) {
|
||||
my $nodetype = xCAT::DBobjUtils->getnodetype($_);
|
||||
if ($nodetype and $nodetype =~ /$support_hcp_type/) {
|
||||
push @{$hcp_hash{$_}{nodes}}, $_;
|
||||
} else {
|
||||
push @missednodes, $_;
|
||||
}
|
||||
}
|
||||
#foreach ( @$noderange ) {
|
||||
# my ($ent) = $hcptab->getNodeAttribs( $_,"hcp" );
|
||||
# if ( !defined( $ent )) {
|
||||
# push @missednodes, $_;
|
||||
# next;
|
||||
# }
|
||||
# push @{$hcp_hash{$_}{nodes}}, $_;
|
||||
#}
|
||||
|
||||
#check if the left-over nodes are lpars
|
||||
if (@missednodes > 0) {
|
||||
my $ppctab = xCAT::Table->new("ppc");
|
||||
@@ -1796,11 +1872,6 @@ sub preprocess_request {
|
||||
return;
|
||||
}
|
||||
foreach my $node (@missednodes) {
|
||||
my ($ent) = $ppctab->getAttribs({hcp=>$node}, "hcp");
|
||||
if (defined($ent)) {
|
||||
push @{$hcp_hash{$node}{nodes}}, $node;
|
||||
next;
|
||||
}
|
||||
|
||||
my $ent=$ppctab->getNodeAttribs($node,['hcp']);
|
||||
#if (defined($ent->{hcp})) { push @{$hcp_hash{$ent->{hcp}}{nodes}}, $node;}
|
||||
@@ -1818,15 +1889,33 @@ sub preprocess_request {
|
||||
}
|
||||
}
|
||||
|
||||
# find service nodes for the HCPs
|
||||
my @masters = xCAT::Utils->get_site_attribute("master");
|
||||
#When run mkhwconn/lshwconn/rmhwconn with -T fnm for CNM, it will send the command to CEC/Frame direclty,
|
||||
#not through the service node if specified.
|
||||
if ((($req->{command}->[0] eq "mkhwconn") || ($req->{command}->[0] eq "lshwconn" ) || ($req->{command}->[0] eq "rmhwconn" ))
|
||||
&& ( $req->{opt}->{T} == 1) ) {
|
||||
#for fnm
|
||||
my $reqcopy = {%$req};
|
||||
#my @masters = xCAT::Utils->get_site_attribute("master");
|
||||
if( $masters[0] ) {
|
||||
$reqcopy->{'_xcatdest'} = $masters[0];
|
||||
push @requests,$reqcopy;
|
||||
} else {
|
||||
$callback->({data=>["The value of the attribute master in the site table is NOT set"]});
|
||||
$req = {};
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
|
||||
# find service nodes for the HCPs
|
||||
# build an individual request for each service node
|
||||
my $service = "xcat";
|
||||
my @hcps=keys(%hcp_hash);
|
||||
my $sn = xCAT::Utils->get_ServiceNode(\@hcps, $service, "MN");
|
||||
|
||||
|
||||
# build each request for each service node
|
||||
foreach my $snkey (keys %$sn)
|
||||
{
|
||||
foreach my $snkey (keys %$sn)
|
||||
{
|
||||
#$callback->({data=>["The service node $snkey "]});
|
||||
my $reqcopy = {%$req};
|
||||
$reqcopy->{'_xcatdest'} = $snkey;
|
||||
@@ -1842,8 +1931,30 @@ sub preprocess_request {
|
||||
$reqcopy->{node} = \@nodes;
|
||||
#print "nodes=@nodes\n";
|
||||
push @requests, $reqcopy;
|
||||
|
||||
if(($req->{command}->[0] eq "rflash") && ( exists( $req->{opt}->{activate} ) ) ) {
|
||||
my $linuxrequired = 0;
|
||||
if ( xCAT::Utils->isLinux() ) {
|
||||
my @installloc = xCAT::Utils->get_site_attribute("installloc");
|
||||
if (! ($installloc[0])) {
|
||||
$linuxrequired = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if ( ($linuxrequired || xCAT::Utils->isAIX()) && ( $masters[0] ne $snkey )) {
|
||||
my $install_dir = xCAT::Utils->getInstallDir();
|
||||
my $cmd = "$::XCATROOT/bin/xdcp $snkey -R $install_dir/packages_fw $install_dir/";
|
||||
my $result = xCAT::Utils->runcmd("$cmd", -1);
|
||||
if ($::RUNCMD_RC != 0) {
|
||||
$callback->({data=>["$result. Could not copy rpms in the $install_dir/packages_fw to $snkey.\n"]});
|
||||
$req = {};
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# No dependency, use the original logic
|
||||
if (scalar(@{$nodeseq}) == 1) {
|
||||
return \@requests;
|
||||
@@ -2064,7 +2175,11 @@ sub process_request {
|
||||
#my $thishcp_type = xCAT::FSPUtils->getTypeOfNode($thishcp,$callback);
|
||||
my $thishcp_type = xCAT::DBobjUtils->getnodetype($thishcp);
|
||||
if(!defined($thishcp_type)) {
|
||||
$request = {};
|
||||
my %output = ();
|
||||
$output{node}->[0]->{name} = [$node];
|
||||
$output{node}->[0]->{data} = ["the type of $node\'s hcp is not defined in the 'ppc' table."];
|
||||
$output{errorcode} = '1';
|
||||
$callback-> (\%output);
|
||||
next;
|
||||
}
|
||||
#print "lasthcp_type:$lasthcp_type ;thishcp_type:$thishcp_type\n";
|
||||
@@ -2114,22 +2229,24 @@ sub process_request {
|
||||
if ($request_new->{command} =~ /^(rspconfig|rpower|reventlog)$/){
|
||||
my @enableASMI = xCAT::Utils->get_site_attribute("enableASMI");
|
||||
if (defined($enableASMI[0])) {
|
||||
$enableASMI[0] =~ tr/a-z/A-Z/; # convert to upper
|
||||
if (($enableASMI[0] eq "1") || ($enableASMI[0] eq "YES")) {
|
||||
#through asmi ......
|
||||
$request_new->{fsp_api} = 0;
|
||||
if(@failed_nodes != 0) {
|
||||
my @temp = @failed_nodes;
|
||||
@failed_nodes = ();
|
||||
$request_new->{node} = \@temp;
|
||||
process_command( $request_new , \%hcps_will, \@failed_nodes, \%failed_msg);
|
||||
} #end of if
|
||||
} #end of if
|
||||
} # end of if
|
||||
} #end of if
|
||||
if (($request_new->{command} !~ /^rspconfig$/) ||
|
||||
(ref($request_new->{method} eq 'HASH'))) {
|
||||
$enableASMI[0] =~ tr/a-z/A-Z/; # convert to upper
|
||||
if (($enableASMI[0] eq "1") || ($enableASMI[0] eq "YES")) {
|
||||
#through asmi ......
|
||||
$request_new->{fsp_api} = 0;
|
||||
if(@failed_nodes != 0) {
|
||||
my @temp = @failed_nodes;
|
||||
@failed_nodes = ();
|
||||
$request_new->{node} = \@temp;
|
||||
process_command( $request_new , \%hcps_will, \@failed_nodes, \%failed_msg);
|
||||
} #end of if
|
||||
} #end of if
|
||||
} # end of if
|
||||
} #end of if
|
||||
}
|
||||
} #end of if
|
||||
} #end of while(1)
|
||||
|
||||
}
|
||||
|
||||
##########################################################################
|
||||
|
||||
@@ -538,6 +538,11 @@ sub makescript
|
||||
if ($ospkglist)
|
||||
{
|
||||
my $pkgtext = get_pkglist_tex($ospkglist);
|
||||
my ($envlist,$pkgtext) = get_envlist($pkgtext);
|
||||
if ($envlist) {
|
||||
push @scriptd, "ENVLIST='".$envlist."'\n";
|
||||
push @scriptd, "export ENVLIST\n";
|
||||
}
|
||||
if ($pkgtext)
|
||||
{
|
||||
push @scriptd, "OSPKGS='".$pkgtext."'\n";
|
||||
@@ -555,7 +560,13 @@ sub makescript
|
||||
foreach (@sublists)
|
||||
{
|
||||
$sl_index++;
|
||||
push @scriptd, "OTHERPKGS$sl_index='".$_."'\n";
|
||||
my $tmp = $_;
|
||||
my ($envlist, $tmp) = get_envlist($tmp);
|
||||
if ($envlist) {
|
||||
push @scriptd, "ENVLIST$sl_index='".$envlist."'\n";
|
||||
push @scriptd, "export ENVLIST$sl_index\n";
|
||||
}
|
||||
push @scriptd, "OTHERPKGS$sl_index='".$tmp."'\n";
|
||||
push @scriptd, "export OTHERPKGS$sl_index\n";
|
||||
}
|
||||
if ($sl_index > 0)
|
||||
@@ -788,6 +799,22 @@ sub makescript
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
=head3 get_envlist
|
||||
|
||||
extract environment variables list from pkglist text.
|
||||
=cut
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
sub get_envlist
|
||||
{
|
||||
my $envlist;
|
||||
my $pkgtext = shift;
|
||||
$envlist = join ' ', ($pkgtext =~ /#ENV:([^#^\n]+)#/g);
|
||||
$pkgtext =~ s/#ENV:[^#^\n]+#,?//g;
|
||||
return ($envlist, $pkgtext);
|
||||
}
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
=head3 get_pkglist_text
|
||||
|
||||
read the pkglist file, expand it and return the content.
|
||||
@@ -810,7 +837,8 @@ sub get_pkglist_tex
|
||||
next
|
||||
if ( /^\s*#/
|
||||
&& !/^\s*#INCLUDE:[^#^\n]+#/
|
||||
&& !/^\s*#NEW_INSTALL_LIST#/); #-- skip comments
|
||||
&& !/^\s*#NEW_INSTALL_LIST#/
|
||||
&& !/^\s*#ENV:[^#^\n]+#/); #-- skip comments
|
||||
if (/^@(.*)/)
|
||||
{ #for groups that has space in name
|
||||
my $save = $1;
|
||||
|
||||
@@ -252,6 +252,7 @@ sub getsynclistfile()
|
||||
my %osimage_syncfile = ();
|
||||
my @profiles = ();
|
||||
|
||||
if ($nodes) {
|
||||
# get the profile attributes for the nodes
|
||||
my $nodetype_t = xCAT::Table->new('nodetype');
|
||||
unless ($nodetype_t) {
|
||||
@@ -273,6 +274,7 @@ sub getsynclistfile()
|
||||
push @profiles, $profile;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# get the syncfiles base on the osimage
|
||||
my $osimage_t = xCAT::Table->new('osimage');
|
||||
|
||||
@@ -625,6 +625,18 @@ sub setup_DHCP
|
||||
my ($nodename) = @_;
|
||||
my $rc = 0;
|
||||
my $cmd;
|
||||
my $snonly = 0;
|
||||
# read the disjointdhcps attribute to determine if we will setup
|
||||
# dhcp for all nodes or just for the nodes service by this service node
|
||||
my $sitetab = xCAT::Table->new('site');
|
||||
if ($sitetab)
|
||||
{
|
||||
my $href;
|
||||
($href) = $sitetab->getAttribs({key => 'disjointdhcps'}, 'value');
|
||||
if ($href and $href->{value}) {
|
||||
$snonly=$href->{value};
|
||||
}
|
||||
}
|
||||
|
||||
# run makedhcp
|
||||
my $XCATROOT = "/opt/xcat"; # default
|
||||
@@ -635,29 +647,66 @@ sub setup_DHCP
|
||||
}
|
||||
my $cmdref;
|
||||
$cmdref->{command}->[0] = "makedhcp";
|
||||
$cmdref->{arg}->[0] = "-l";
|
||||
$cmdref->{arg}->[0] = "-n";
|
||||
$cmdref->{cwd}->[0] = "/opt/xcat/sbin";
|
||||
$cmdref->{arg}->[1] = "-n";
|
||||
no strict "refs";
|
||||
my $modname = "dhcp";
|
||||
${"xCAT_plugin::" . $modname . "::"}{process_request}
|
||||
->($cmdref, \&xCAT::Client::handle_response);
|
||||
|
||||
my $rc = xCAT::Utils->startService("dhcpd");
|
||||
|
||||
my $distro = xCAT::Utils->osver();
|
||||
my $serv = "dhcpd";
|
||||
if ( $distro =~ /ubuntu*/ ){
|
||||
$serv = "dhcp3-server";
|
||||
}
|
||||
my $rc = xCAT::Utils->startService($serv);
|
||||
if ($rc != 0)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
$cmdref;
|
||||
$cmdref->{command}->[0] = "makedhcp";
|
||||
$cmdref->{arg}->[0] = "-l";
|
||||
$cmdref->{cwd}->[0] = "/opt/xcat/sbin";
|
||||
$cmdref->{arg}->[1] = "-a";
|
||||
|
||||
|
||||
# setup DHCP
|
||||
#
|
||||
my $modname = "dhcp";
|
||||
${"xCAT_plugin::" . $modname . "::"}{process_request}
|
||||
->($cmdref, \&xCAT::Client::handle_response);
|
||||
if ($snonly != 1) { # setup dhcp for all nodes
|
||||
$cmdref;
|
||||
$cmdref->{command}->[0] = "makedhcp";
|
||||
$cmdref->{arg}->[0] = "-a";
|
||||
$cmdref->{cwd}->[0] = "/opt/xcat/sbin";
|
||||
|
||||
} else { # setup dhcp just for the nodes owned by the SN
|
||||
# determine my name
|
||||
# get servicenodes and their nodes
|
||||
# find the list of nodes serviced
|
||||
my @hostinfo=xCAT::Utils->determinehostname();
|
||||
my $sn_hash =xCAT::Utils->getSNandNodes();
|
||||
my @nodes;
|
||||
my %iphash=();
|
||||
my $snkey;
|
||||
$cmdref;
|
||||
foreach $snkey (keys %$sn_hash) { # find the service node
|
||||
if (grep(/$snkey/, @hostinfo)) {
|
||||
push @nodes, @{$sn_hash->{$snkey}};
|
||||
$cmdref->{node} = $sn_hash->{$snkey};
|
||||
$cmdref->{'_xcatdest'} = $snkey;
|
||||
}
|
||||
}
|
||||
if (@nodes) {
|
||||
my $nodelist;
|
||||
foreach my $n (@nodes) {
|
||||
$nodelist .= $n;
|
||||
$nodelist .= ",";
|
||||
}
|
||||
chop $nodelist;
|
||||
$cmdref->{arg}->[0] = ();
|
||||
$cmdref->{command}->[0] = "makedhcp";
|
||||
$cmdref->{noderange}->[0] = "$nodelist";
|
||||
$cmdref->{cwd}->[0] = "/opt/xcat/sbin";
|
||||
}
|
||||
}
|
||||
${"xCAT_plugin::" . $modname . "::"}{process_request}
|
||||
->($cmdref, \&xCAT::Client::handle_response);
|
||||
return $rc;
|
||||
}
|
||||
|
||||
@@ -732,8 +781,14 @@ sub setup_DNS
|
||||
system("$XCATROOT/sbin/makenamed.conf");
|
||||
|
||||
# turn DNS on
|
||||
|
||||
my $rc = xCAT::Utils->startService("named");
|
||||
|
||||
my $distro = xCAT::Utils->osver();
|
||||
my $serv = "named";
|
||||
if ( $distro =~ /ubuntu*/ ){
|
||||
$serv = "bind9";
|
||||
}
|
||||
|
||||
my $rc = xCAT::Utils->startService($serv);
|
||||
if ($rc != 0)
|
||||
{
|
||||
return 1;
|
||||
|
||||
@@ -1472,8 +1472,9 @@ sub defmk
|
||||
else
|
||||
{
|
||||
my $rsp;
|
||||
my $nodenum = scalar(keys %::FINALATTRS);
|
||||
$rsp->{data}->[0] =
|
||||
"Object definitions have been created or modified.";
|
||||
"$nodenum object definitions have been created or modified.";
|
||||
xCAT::MsgUtils->message("I", $rsp, $::callback);
|
||||
}
|
||||
return 0;
|
||||
@@ -2260,8 +2261,9 @@ sub defch
|
||||
else
|
||||
{
|
||||
my $rsp;
|
||||
my $nodenum = scalar(keys %::FINALATTRS);
|
||||
$rsp->{data}->[0] =
|
||||
"Object definitions have been created or modified.";
|
||||
"$nodenum object definitions have been created or modified.";
|
||||
xCAT::MsgUtils->message("I", $rsp, $::callback);
|
||||
if (scalar(keys %newobjects) > 0)
|
||||
{
|
||||
@@ -3448,7 +3450,8 @@ sub defrm
|
||||
else
|
||||
{
|
||||
my $rsp;
|
||||
$rsp->{data}->[0] = "Object definitions have been removed.";
|
||||
my $nodenum = scalar(keys %objhash);
|
||||
$rsp->{data}->[0] = "$nodenum object definitions have been removed.";
|
||||
xCAT::MsgUtils->message("I", $rsp, $::callback);
|
||||
}
|
||||
# Give a warning message to the user to remove the children of the node.
|
||||
|
||||
@@ -89,8 +89,8 @@ sub preprocess_request {
|
||||
}
|
||||
|
||||
|
||||
my ($current_ppc_ent) = $ppctab->getAttribs({ node=>$current_node},@ppcattribs);
|
||||
my ($fip_ppc_ent) = $ppctab->getAttribs({ node=>$fip_node},@ppcattribs);
|
||||
my ($current_ppc_ent) = $ppctab->getNodeAttribs($current_node,@ppcattribs);
|
||||
my ($fip_ppc_ent) = $ppctab->getNodeAttribs($fip_node,@ppcattribs);
|
||||
my @current_attrs;
|
||||
my @fip_attrs;
|
||||
if( $current_ppc_ent->{'parent'} ne $fip_ppc_ent->{'parent'} ) {
|
||||
@@ -321,8 +321,8 @@ sub swapnodes
|
||||
return 1;
|
||||
}
|
||||
|
||||
my ($current_ppc_ent) = $ppctab->getAttribs({ node=>$current_node},@ppcattribs);
|
||||
my ($fip_ppc_ent) = $ppctab->getAttribs({ node=>$fip_node},@ppcattribs);
|
||||
my ($current_ppc_ent) = $ppctab->getNodeAttribs( $current_node,@ppcattribs);
|
||||
my ($fip_ppc_ent) = $ppctab->getNodeAttribs( $fip_node,@ppcattribs);
|
||||
my @current_attrs;
|
||||
my @fip_attrs;
|
||||
my $cec;
|
||||
@@ -407,8 +407,8 @@ sub swapnodes
|
||||
return 1;
|
||||
}
|
||||
|
||||
my $current_ent = $nodepostab->getAttribs({ node=>$current_node},@nodeposattribs);
|
||||
my $fip_ent = $nodepostab->getAttribs({ node=>$fip_node},@nodeposattribs);
|
||||
my $current_ent = $nodepostab->getNodeAttribs( $current_node,@nodeposattribs);
|
||||
my $fip_ent = $nodepostab->getNodeAttribs( $fip_node,@nodeposattribs);
|
||||
|
||||
# swap the current ent and the fip ent
|
||||
$keyhash{'node'} = $current_node;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -60,6 +60,8 @@ my %distnames = (
|
||||
"1285192093.430930" => "rhels6", #ppc64
|
||||
"1305068199.328169" => "rhels6.1", #x86_64
|
||||
"1305067911.467189" => "rhels6.1", #ppc64
|
||||
"1321546114.510099" => "rhels6.2", #x86_64
|
||||
"1321546739.676170" => "rhels6.2", #ppc64
|
||||
"1285193176.593806" => "rhelhpc6",
|
||||
"1194015916.783841" => "fedora8",
|
||||
"1194015385.299901" => "fedora8",
|
||||
@@ -71,6 +73,7 @@ my %distnames = (
|
||||
"1257725234.740991" => "fedora12", #x86_64 DVD ISO
|
||||
"1273712675.937554" => "fedora13", #x86_64 DVD ISO
|
||||
"1287685820.403779" => "fedora14", #x86_64 DVD ISO
|
||||
"1305315870.828212" => "fedora15", #x86_64 DVD ISO
|
||||
|
||||
"1194512200.047708" => "rhas4.6",
|
||||
"1194512327.501046" => "rhas4.6",
|
||||
@@ -179,6 +182,27 @@ sub process_request
|
||||
}
|
||||
}
|
||||
|
||||
# Check whether the dracut is supported by this os
|
||||
sub using_dracut
|
||||
{
|
||||
my $os = shift;
|
||||
if ($os =~ /(rhels|rhel)(\d+)/) {
|
||||
if ($2 >= 6) {
|
||||
return 1;
|
||||
}
|
||||
} elsif ($os =~ /fedora(\d+)/) {
|
||||
if ($1 >= 12) {
|
||||
return 1;
|
||||
}
|
||||
} elsif ($os =~ /SL(\d+)/) {
|
||||
if ($1 >= 6) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
sub mknetboot
|
||||
{
|
||||
my $xenstyle=0;
|
||||
@@ -341,7 +365,6 @@ sub mknetboot
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
if ( ! $linuximagetab ) {
|
||||
$linuximagetab = xCAT::Table->new('linuximage');
|
||||
}
|
||||
@@ -360,7 +383,6 @@ sub mknetboot
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
#print"osvr=$osver, arch=$arch, profile=$profile, imgdir=$rootimgdir\n";
|
||||
unless ($osver and $arch and $profile)
|
||||
{
|
||||
@@ -457,7 +479,6 @@ sub mknetboot
|
||||
$donetftp{$osver,$arch,$profile} = 1;
|
||||
}
|
||||
|
||||
|
||||
if ($statelite) {
|
||||
my $initrdloc = "/$tftpdir/xcat/netboot/$osver/$arch/$profile/";
|
||||
if ($rootfstype eq "ramdisk") {
|
||||
@@ -566,9 +587,7 @@ sub mknetboot
|
||||
}
|
||||
|
||||
# special case for redhat6, fedora12/13/14
|
||||
if ($osver =~ m/rhel6/ || $osver =~ m/rhels6/
|
||||
|| $osver =~ m/fedora12/ || $osver =~ m/fedora13/
|
||||
|| $osver =~ m/fedora14/ || $osver =~ m/SL6/) {
|
||||
if (&using_dracut($osver)) {
|
||||
$kcmdline = "root=nfs:$nfssrv:$nfsdir/rootimg:ro STATEMNT=";
|
||||
} else {
|
||||
$kcmdline = "NFSROOT=$nfssrv:$nfsdir STATEMNT=";
|
||||
@@ -742,9 +761,7 @@ sub mknetboot
|
||||
my $initrdstr = "xcat/netboot/$osver/$arch/$profile/initrd-stateless.gz";
|
||||
$initrdstr = "xcat/netboot/$osver/$arch/$profile/initrd-statelite.gz" if ($statelite);
|
||||
# special case for the dracut-enabled OSes
|
||||
if ($osver =~ m/rhels6/ || $osver =~ m/rhel6/
|
||||
|| $osver =~ m/fedora12/ || $osver =~ m/fedora13/
|
||||
|| $osver =~ m/fedora14/ || $osver =~ m/SL6/) {
|
||||
if (&using_dracut($osver)) {
|
||||
if($statelite and $rootfstype eq "ramdisk") {
|
||||
$initrdstr = "xcat/netboot/$osver/$arch/$profile/initrd-stateless.gz";
|
||||
}
|
||||
@@ -753,7 +770,7 @@ sub mknetboot
|
||||
if($statelite)
|
||||
{
|
||||
my $statelitetb = xCAT::Table->new('statelite');
|
||||
my $mntopts = $statelitetb->getAttribs({node => $node}, 'mntopts');
|
||||
my $mntopts = $statelitetb->getNodeAttribs($node, ['mntopts']);
|
||||
|
||||
my $mntoptions = $mntopts->{'mntopts'};
|
||||
unless (defined($mntoptions))
|
||||
@@ -1053,8 +1070,10 @@ sub mkinstall
|
||||
) or ( $arch =~ /ppc/
|
||||
and -r "$pkgdir/ppc/ppc64/vmlinuz"
|
||||
and $kernpath = "$pkgdir/ppc/ppc64/vmlinuz"
|
||||
and -r "$pkgdir/ppc/ppc64/ramdisk.image.gz"
|
||||
and ((-r "$pkgdir/ppc/ppc64/ramdisk.image.gz"
|
||||
and $initrdpath = "$pkgdir/ppc/ppc64/ramdisk.image.gz")
|
||||
or (-r "$pkgdir/ppc/ppc64/initrd.img"
|
||||
and $initrdpath = "$pkgdir/ppc/ppc64/initrd.img")))
|
||||
)
|
||||
{
|
||||
|
||||
|
||||
@@ -213,6 +213,8 @@ my $activemm;
|
||||
my %mpahash;
|
||||
my $currnode;
|
||||
my $mpa;
|
||||
my $mpauser;
|
||||
my $mpapass;
|
||||
my $allinchassis=0;
|
||||
my $curn;
|
||||
my @cfgtext;
|
||||
@@ -940,6 +942,18 @@ sub vitals {
|
||||
my %ledresults=();
|
||||
my $ledstring="";
|
||||
if (grep /led/,@vitems) {
|
||||
$session = new SNMP::Session(
|
||||
DestHost => $mpa,
|
||||
Version => '3',
|
||||
SecName => $mpauser,
|
||||
AuthProto => 'SHA',
|
||||
AuthPass => $mpapass,
|
||||
PrivProto => 'DES',
|
||||
SecLevel => 'authPriv',
|
||||
UseNumeric => 1,
|
||||
Retries => 1, # Give up sooner to make commands go smoother
|
||||
Timeout=>300000000, #Beacon, for one, takes a bit over a second to return
|
||||
PrivPass => $mpapass);
|
||||
my @bindset = (
|
||||
[$erroroid,$slot],
|
||||
[$beaconoid,$slot],
|
||||
@@ -1796,6 +1810,18 @@ sub beacon {
|
||||
} else {
|
||||
return (1,"$subcommand unsupported");
|
||||
}
|
||||
$session = new SNMP::Session(
|
||||
DestHost => $mpa,
|
||||
Version => '3',
|
||||
SecName => $mpauser,
|
||||
AuthProto => 'SHA',
|
||||
AuthPass => $mpapass,
|
||||
PrivProto => 'DES',
|
||||
SecLevel => 'authPriv',
|
||||
UseNumeric => 1,
|
||||
Retries => 1, # Give up sooner to make commands go smoother
|
||||
Timeout=>300000000, #Beacon, for one, takes a bit over a second to return
|
||||
PrivPass => $mpapass);
|
||||
my $stat = $session->get([$beaconoid.".".$slot]);
|
||||
if ($session->{ErrorStr}) { return (1,$session->{ErrorStr}); }
|
||||
if ($stat==0) {
|
||||
@@ -3177,15 +3203,15 @@ sub getbladecons {
|
||||
my $ent=$mptabhash->{$node}->[0]; #$mptab->getNodeAttribs($node,['mpa', 'id']);
|
||||
if (defined($ent->{mpa})) {
|
||||
$rsp->{node}->[0]->{mm}->[0]=$ent->{mpa};
|
||||
if (defined($checkedmpas{$ent->{$mpa}}) or not defined $mpatab) {
|
||||
if (defined($checkedmpas{$ent->{mpa}}) or not defined $mpatab) {
|
||||
if (defined($mpausers{$ent->{mpa}})) {
|
||||
$rsp->{node}->[0]->{username}=[$mpausers{$ent->{mpa}}];
|
||||
} else {
|
||||
$rsp->{node}->[0]->{username}=[$user];
|
||||
}
|
||||
} else {
|
||||
$checkedmpas{$ent->{$mpa}}=1;
|
||||
($tmp)=$mpatab->getAttribs({'mpa'=>$mpa},'username');
|
||||
$checkedmpas{$ent->{mpa}}=1;
|
||||
($tmp)=$mpatab->getNodeAttribs($ent->{mpa}, ['username']);
|
||||
if (defined($tmp) and defined $tmp->{username}) {
|
||||
$mpausers{$ent->{mpa}}=$tmp->{username};
|
||||
$rsp->{node}->[0]->{username}=[$tmp->{username}];
|
||||
@@ -3517,7 +3543,7 @@ sub process_request {
|
||||
my $pass=$bladepass;
|
||||
my $ent;
|
||||
if (defined($mpatab)) {
|
||||
($ent)=$mpatab->getAttribs({'mpa'=>$mpa},'username','password');
|
||||
($ent)=$mpatab->getNodeAttribs($mpa, ['username','password']);
|
||||
if (defined($ent->{password})) { $pass = $ent->{password}; }
|
||||
if (defined($ent->{username})) { $user = $ent->{username}; }
|
||||
}
|
||||
@@ -3716,7 +3742,7 @@ sub network {
|
||||
|
||||
my $hosttab = xCAT::Table->new( 'hosts' );
|
||||
if ($hosttab) {
|
||||
my ($ent) = $hosttab->getAttribs({node=>$mpa},'ip');
|
||||
my ($ent) = $hosttab->getNodeAttribs($mpa,['ip']);
|
||||
if (defined($ent)) {
|
||||
$ip = $ent->{ip};
|
||||
}
|
||||
@@ -4166,18 +4192,20 @@ sub dompa {
|
||||
}
|
||||
}
|
||||
|
||||
$mpauser= $mpahash->{$mpa}->{username};
|
||||
$mpapass = $mpahash->{$mpa}->{password};
|
||||
$session = new SNMP::Session(
|
||||
DestHost => $mpa,
|
||||
Version => '3',
|
||||
SecName => $mpahash->{$mpa}->{username},
|
||||
SecName => $mpauser,
|
||||
AuthProto => 'SHA',
|
||||
AuthPass => $mpahash->{$mpa}->{password},
|
||||
AuthPass => $mpapass,
|
||||
PrivProto => 'DES',
|
||||
SecLevel => 'authPriv',
|
||||
UseNumeric => 1,
|
||||
Retries => 4, # Give up sooner to make commands go smoother
|
||||
Timeout=>1500000, #Beacon, for one, takes a bit over a second to return
|
||||
PrivPass => $mpahash->{$mpa}->{password});
|
||||
Retries => 1, # Give up sooner to make commands go smoother
|
||||
Timeout=>3000000, #Beacon, for one, takes a bit over a second to return
|
||||
PrivPass => $mpapass);
|
||||
if ($session->{ErrorStr}) {return 1,$session->{ErrorStr}; }
|
||||
unless ($session and keys %$session) {
|
||||
my %err=(node=>[]);
|
||||
|
||||
@@ -229,6 +229,23 @@ sub docfheaders {
|
||||
push @newheaders," trusted 127.0.0.1;\n";
|
||||
my $master=xCAT::Utils->get_site_Master();
|
||||
push @newheaders, " trusted $master;\n";
|
||||
# trust all the ip addresses configured on this node
|
||||
my @allips = xCAT::Utils->gethost_ips();
|
||||
my @ips = ();
|
||||
#remove $xcatmaster and duplicate entries
|
||||
foreach my $ip (@allips) {
|
||||
if (($ip eq "127.0.0.1") || ($ip eq $master)) {
|
||||
next;
|
||||
}
|
||||
if(!grep(/^$ip$/, @ips)) {
|
||||
push @ips,$ip;
|
||||
}
|
||||
}
|
||||
if(scalar(@ips) > 0) {
|
||||
my $ipstr = join(',', @ips);
|
||||
push @newheaders, " trusted $ipstr;\n";
|
||||
}
|
||||
|
||||
push @newheaders,"}\n";
|
||||
#push @$content,"#xCAT END ACCESS\n";
|
||||
|
||||
|
||||
@@ -14,9 +14,15 @@ use Fcntl qw/:flock/;
|
||||
#This is a rewrite of DNS management using nsupdate rather than direct zone mangling
|
||||
|
||||
my $callback;
|
||||
my $service="named";
|
||||
my $distro = xCAT::Utils->osver();
|
||||
|
||||
|
||||
my $service="named";
|
||||
# is this ubuntu ?
|
||||
if ( $distro =~ /ubuntu*/ ){
|
||||
$service = "bind9";
|
||||
}
|
||||
|
||||
sub handled_commands
|
||||
{
|
||||
return {"makedns" => "site:dnshandler"};
|
||||
@@ -241,6 +247,7 @@ sub process_request {
|
||||
}
|
||||
my $resolv="/etc/resolv.conf";
|
||||
my $found=0;
|
||||
# check if nameserver site.master in /etc/resolv.conf
|
||||
my $nameserver=$master->{value};
|
||||
my $cmd="grep $nameserver $resolv";
|
||||
my @output=xCAT::Utils->runcmd($cmd, 0);
|
||||
@@ -258,7 +265,42 @@ sub process_request {
|
||||
if ($found == 0) { # not nameserver master found
|
||||
xCAT::SvrUtils::sendmsg([0,"Warning:The management node is not defined as a nameserver in /etc/resolv.conf. Add \"nameserver $nameserver\" to /etc/resolv.conf and run makedns again."], $callback);
|
||||
}
|
||||
|
||||
|
||||
# chk if search site.domain or domain site.domain on AIX in /etc/resolv.conf
|
||||
$found=0;
|
||||
my $domain=$ctx->{domain};
|
||||
my $cmd="grep $domain $resolv";
|
||||
my @output=xCAT::Utils->runcmd($cmd, 0);
|
||||
if ($::RUNCMD_RC != 0)
|
||||
{
|
||||
$found=0;
|
||||
} else { # if it is there check it is a search clause
|
||||
foreach my $line (@output) {
|
||||
if ($line =~ /^search/) { # line is a search line
|
||||
$found=1;
|
||||
last;
|
||||
}
|
||||
# if AIX could be a domain line
|
||||
if (xCAT::Utils->isAIX()) {
|
||||
if ($line =~ /^domain/) {
|
||||
$found=1;
|
||||
last;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($found == 0) { # no search site.domain found
|
||||
xCAT::SvrUtils::sendmsg([0,"Warning:The domain is not defined in a search path or domain path for AIX (in /etc/resolv.conf. Add \"search $domain\" to /etc/resolv.conf and run makedns again."], $callback);
|
||||
}
|
||||
# check for selinux disabled
|
||||
my $rc=xCAT::Utils->isSELINUX();
|
||||
if ($rc == 0)
|
||||
{
|
||||
xCAT::SvrUtils::sendmsg([0,"Warning:SELINUX is not disabled. The makedns command will not be able to generate a complete DNS setup. Disable SELINUX and run the command again."], $callback);
|
||||
|
||||
}
|
||||
|
||||
|
||||
my $networkstab = xCAT::Table->new('networks',-create=>0);
|
||||
unless ($networkstab) { xCAT::SvrUtils::sendmsg([1,'Unable to enumerate networks, try to run makenetworks'], $callback); }
|
||||
my @networks = $networkstab->getAllAttribs('net','mask','ddnsdomain');
|
||||
@@ -440,7 +482,7 @@ sub process_request {
|
||||
}
|
||||
else
|
||||
{
|
||||
system("/sbin/service $service stop"); #named may otherwise hold on to stale journal filehandles
|
||||
system("service $service stop"); #named may otherwise hold on to stale journal filehandles
|
||||
}
|
||||
my $conf = get_conf();
|
||||
unlink $conf;
|
||||
@@ -465,8 +507,8 @@ sub process_request {
|
||||
}
|
||||
else
|
||||
{
|
||||
system("/sbin/service $service stop");
|
||||
system("/sbin/service $service start");
|
||||
system("service $service stop");
|
||||
system("service $service start");
|
||||
}
|
||||
xCAT::SvrUtils::sendmsg("Restarting named complete", $callback);
|
||||
}
|
||||
@@ -505,7 +547,11 @@ sub get_zonesdir {
|
||||
|
||||
sub get_conf {
|
||||
my $conf="/etc/named.conf";
|
||||
|
||||
# is this ubuntu ?
|
||||
if ( $distro =~ /ubuntu*/ ){
|
||||
$conf="/etc/bind/named.conf";
|
||||
}
|
||||
|
||||
my $sitetab = xCAT::Table->new('site');
|
||||
|
||||
unless ($sitetab)
|
||||
@@ -550,7 +596,11 @@ sub get_dbdir {
|
||||
# Temp fix for bugzilla 73119
|
||||
chown(scalar(getpwnam('root')),scalar(getgrnam('named')),"/var/lib/named");
|
||||
return "/var/lib/named/";
|
||||
} else {
|
||||
}
|
||||
elsif (-d "/var/lib/bind") {
|
||||
return "/var/lib/bind/";
|
||||
}
|
||||
else {
|
||||
mkpath "/var/named/";
|
||||
chown(scalar(getpwnam('named')),scalar(getgrnam('named')),"/var/named");
|
||||
return "/var/named/";
|
||||
@@ -827,6 +877,18 @@ sub update_namedconf {
|
||||
# Toutch the stub zone file
|
||||
system("/usr/bin/touch $ctx->{dbdir}.'/db.cache'");
|
||||
$ctx->{restartneeded}=1;
|
||||
if($ctx->{forwarders})
|
||||
{
|
||||
my $dbcachefile = $ctx->{dbdir}.'/db.cache';
|
||||
my $cmd = qq~dig @"$ctx->{forwarders}[0]" . ns >> $dbcachefile~;
|
||||
my $outref = xCAT::Utils->runcmd("$cmd", 0);
|
||||
if ($::RUNCMD_RC != 0)
|
||||
{
|
||||
my $rsp = {};
|
||||
$rsp->{data}->[0] = "Failed to run command: $cmd.\n";
|
||||
xCAT::MsgUtils->message("W", $rsp, $callback, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -876,7 +938,7 @@ sub add_or_delete_records {
|
||||
@ips = ($ctx->{hoststab}->{$node}->[0]->{ip});
|
||||
} else {
|
||||
@ips = getipaddr($node,GetAllAddresses=>1);
|
||||
unless (@ips) {
|
||||
if (!defined($ips[0])) {
|
||||
xCAT::SvrUtils::sendmsg([1,"Unable to find an IP for $node in hosts table or via system lookup (i.e. /etc/hosts"], $callback);
|
||||
next;
|
||||
}
|
||||
@@ -901,8 +963,10 @@ sub add_or_delete_records {
|
||||
$ctx->{currnode}=$node;
|
||||
$ctx->{currname}=$name;
|
||||
$ctx->{currrevname}=$ip;
|
||||
my $tmpdm;
|
||||
unless ($domain =~ /\.$/) { $tmpdm = $domain.'.'; } #example.com becomes example.com.
|
||||
find_nameserver_for_dns($ctx,$revzone);
|
||||
find_nameserver_for_dns($ctx,$domain);
|
||||
find_nameserver_for_dns($ctx,$tmpdm);
|
||||
}
|
||||
}
|
||||
my $zone;
|
||||
@@ -931,6 +995,10 @@ sub add_or_delete_records {
|
||||
if ($numreqs != 300) { #either no entries at all to begin with or a perfect multiple of 300
|
||||
$update->sign_tsig("xcat_key",$ctx->{privkey});
|
||||
my $reply = $resolver->send($update);
|
||||
if ($reply->header->rcode ne 'NOERROR') {
|
||||
xCAT::SvrUtils::sendmsg([1,"Failure encountered updating $zone, error was ".$reply->header->rcode], $callback);
|
||||
}
|
||||
|
||||
# sometimes resolver does not work if the update zone request sent so quick
|
||||
sleep 1;
|
||||
}
|
||||
@@ -960,6 +1028,12 @@ sub find_nameserver_for_dns {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (defined $ctx->{aliases}->{$node}) {
|
||||
foreach (keys %{$ctx->{aliases}->{$node}}) {
|
||||
push @rrcontent, "$_ IN CNAME $name";
|
||||
}
|
||||
}
|
||||
if ($ctx->{deletemode}) {
|
||||
push @rrcontent,"$name TXT";
|
||||
push @rrcontent,"$name A";
|
||||
@@ -976,6 +1050,9 @@ sub find_nameserver_for_dns {
|
||||
} else {
|
||||
my $reply = $ctx->{resolver}->query($zone,'NS');
|
||||
if ($reply) {
|
||||
if ($reply->header->rcode ne 'NOERROR') {
|
||||
xCAT::SvrUtils::sendmsg([1,"Failure encountered querying $zone, error was ".$reply->header->rcode], $callback);
|
||||
}
|
||||
foreach my $record ($reply->answer) {
|
||||
if ( $record->nsdname =~ /blackhole.*\.iana\.org/) {
|
||||
$ctx->{nsmap}->{$zone} = 0;
|
||||
|
||||
@@ -92,15 +92,41 @@ sub delnode
|
||||
{
|
||||
my @macs = split(/\|/, $ent->{mac});
|
||||
my $mace;
|
||||
my $count = 0;
|
||||
foreach $mace (@macs)
|
||||
{
|
||||
my $mac;
|
||||
my $hname;
|
||||
($mac, $hname) = split(/!/, $mace);
|
||||
unless ($hname) { $hname = $node; }
|
||||
|
||||
unless ($hname)
|
||||
{
|
||||
$hname = $node;
|
||||
} #Default to hostname equal to nodename
|
||||
unless ($mac) { next; } #Skip corrupt format
|
||||
|
||||
if ( !grep /:/,$mac ) {
|
||||
$mac = lc($mac);
|
||||
$mac =~ s/(\w{2})/$1:/g;
|
||||
$mac =~ s/:$//;
|
||||
}
|
||||
my $hostname = $hname;
|
||||
my %client_nethash = xCAT::DBobjUtils->getNetwkInfo( [$node] );
|
||||
if ( $client_nethash{$node}{mgtifname} =~ /hf/ )
|
||||
{
|
||||
if ( scalar(@macs) > 1 ) {
|
||||
if ( $hname !~ /^(.*)-hf(.*)$/ ) {
|
||||
$hostname = $hname . "-hf" . $count;
|
||||
} else {
|
||||
$hostname = $1 . "-hf" . $count;
|
||||
}
|
||||
}
|
||||
}
|
||||
$count = $count + 2;
|
||||
unless ($hostname) { $hostname = $node; }
|
||||
print $omshell "new host\n";
|
||||
print $omshell
|
||||
"set name = \"$hname\"\n"; #Find and destroy conflict name
|
||||
"set name = \"$hostname\"\n"; #Find and destroy conflict name
|
||||
print $omshell "open\n";
|
||||
print $omshell "remove\n";
|
||||
print $omshell "close\n";
|
||||
@@ -117,9 +143,9 @@ sub delnode
|
||||
if ($inetn)
|
||||
{
|
||||
my $ip;
|
||||
if (inet_aton($hname))
|
||||
if (inet_aton($hostname))
|
||||
{
|
||||
$ip = inet_ntoa(inet_aton($hname));
|
||||
$ip = inet_ntoa(inet_aton($hostname));
|
||||
}
|
||||
if ($ip)
|
||||
{
|
||||
@@ -883,6 +909,7 @@ sub process_request
|
||||
}
|
||||
|
||||
@dhcpconf = ();
|
||||
@dhcp6conf = ();
|
||||
|
||||
my $dhcplockfd;
|
||||
open($dhcplockfd,">","/tmp/xcat/dhcplock");
|
||||
@@ -1052,7 +1079,7 @@ sub process_request
|
||||
print DBG_FD $syscfg_dhcpd;
|
||||
close DBG_FD;
|
||||
} elsif ($_ eq "dhcpd" or $usingipv6) {
|
||||
$callback->({error=>"The file /etc/sysconfig/$_ doesn't exist, check the dhcp server"});
|
||||
$callback->({error=>["The file /etc/sysconfig/$_ doesn't exist, check the dhcp server"]});
|
||||
# return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ use POSIX qw(WNOHANG nice);
|
||||
use File::Path qw/mkpath rmtree/;
|
||||
use File::Temp qw/tempdir/;
|
||||
use File::Copy;
|
||||
use Fcntl qw/:flock/;
|
||||
use IO::Socket; #Need name resolution
|
||||
#use Data::Dumper;
|
||||
Getopt::Long::Configure("bundling");
|
||||
@@ -46,6 +47,7 @@ my $requester;
|
||||
my $viavcenter;
|
||||
my $viavcenterbyhyp;
|
||||
my $vcenterautojoin=1;
|
||||
my $datastoreautomount=1;
|
||||
my $vcenterforceremove=0; #used in rmhypervisor
|
||||
my $reconfigreset=1;
|
||||
my $vmwaresdkdetect = eval {
|
||||
@@ -53,7 +55,21 @@ my $vmwaresdkdetect = eval {
|
||||
VMware::VIRuntime->import();
|
||||
1;
|
||||
};
|
||||
my %lockhandles;
|
||||
|
||||
sub lockbyname {
|
||||
my $name = shift;
|
||||
my $lckh;
|
||||
mkpath("/tmp/xcat/locks/");
|
||||
while (-e "/tmp/xcat/locks/$name") { sleep 1; }
|
||||
open($lockhandles{$name},">>","/tmp/xcat/locks/$name");
|
||||
flock($lockhandles{$name},LOCK_EX);
|
||||
}
|
||||
sub unlockbyname {
|
||||
my $name = shift;
|
||||
unlink("/tmp/xcat/locks/$name");
|
||||
close($lockhandles{$name});
|
||||
}
|
||||
|
||||
my %guestidmap = (
|
||||
"rhel.6.*" => "rhel6_",
|
||||
@@ -312,6 +328,13 @@ sub process_request {
|
||||
$vcenterautojoin=0;
|
||||
}
|
||||
}
|
||||
($ref) = $sitetab->getAttribs({key => 'vmwaredatastoreautomount'}, 'value');
|
||||
if ($ref and defined $ref->{value}) {
|
||||
$datastoreautomount = $ref->{value};
|
||||
if ($datastoreautomount =~ /^n/ or $datastoreautomount =~ /^dis/) {
|
||||
$datastoreautomount=0;
|
||||
}
|
||||
}
|
||||
($ref) = $sitetab->getAttribs({key => 'vmwarereconfigonpower'},'value');
|
||||
if ($ref and defined $ref->{value}) {
|
||||
$reconfigreset=$ref->{value};
|
||||
@@ -2114,7 +2137,7 @@ sub clonevms {
|
||||
my $masterref;
|
||||
if ($base) { #if base, we need to pull in the target datastores
|
||||
my $mastertab=xCAT::Table->new('vmmaster');
|
||||
$masterref=$mastertab->getAttribs({name=>$base},[qw/storage os arch profile storagemodel nics/]);
|
||||
$masterref=$mastertab->getNodeAttribs( $base,[qw/storage os arch profile storagemodel nics/]);
|
||||
unless ($masterref) {
|
||||
foreach my $node (@$nodes) {
|
||||
xCAT::SvrUtils::sendmsg([1,"Cannot find master $base in vmmaster table"], $output_handler,$node);
|
||||
@@ -3553,6 +3576,16 @@ sub refreshclusterdatastoremap {
|
||||
#a whole cluster instead of chasing one host, a whole lot slower. One would hope vmware would've done this, but they don't
|
||||
}
|
||||
sub validate_datastore_prereqs {
|
||||
my $hyp = $_[1];
|
||||
lockbyname($hyp.".datastores");
|
||||
$@="";
|
||||
my $rc;
|
||||
eval { $rc=validate_datastore_prereqs_inlock(@_); };
|
||||
unlockbyname($hyp.".datastores");
|
||||
if ($@) { die $@; }
|
||||
return $rc;
|
||||
}
|
||||
sub validate_datastore_prereqs_inlock {
|
||||
my $nodes = shift;
|
||||
my $hyp = shift;
|
||||
my $newdatastores = shift; # a hash reference of URLs to afflicted nodes outside of table space
|
||||
@@ -3618,6 +3651,10 @@ sub validate_datastore_prereqs {
|
||||
$server = inet_ntoa($servern);
|
||||
my $uri = "nfs://$server/$path";
|
||||
unless ($hyphash{$hyp}->{datastoremap}->{$uri}) { #If not already there, must mount it
|
||||
unless ($datastoreautomount) {
|
||||
xCAT::SvrUtils::sendmsg([1,": $uri is not currently accessible at the given location and automount is disabled in site table"], $output_handler,$node);
|
||||
return 0;
|
||||
}
|
||||
$refresh_names=1;
|
||||
($hyphash{$hyp}->{datastoremap}->{$uri},$hyphash{$hyp}->{datastorerefmap}->{$uri})=mount_nfs_datastore($hostview,$location);
|
||||
$hyphash{$hyp}->{datastoreurlmap}->{$hyphash{$hyp}->{datastoremap}->{$uri}} = $uri;
|
||||
@@ -3668,6 +3705,10 @@ sub validate_datastore_prereqs {
|
||||
return 0;
|
||||
}
|
||||
unless ($hyphash{$hyp}->{datastoremap}->{$uri}) { #If not already there, must mount it
|
||||
unless ($datastoreautomount) {
|
||||
xCAT::SvrUtils::sendmsg([1,":) $uri is not currently accessible at the given location and automount is disabled in site table"], $output_handler,$node);
|
||||
return 0;
|
||||
}
|
||||
$refresh_names=1;
|
||||
($hyphash{$hyp}->{datastoremap}->{$uri},$hyphash{$hyp}->{datastorerefmap}->{$uri})=mount_nfs_datastore($hostview,$location);
|
||||
}
|
||||
@@ -3751,6 +3792,9 @@ sub mount_nfs_datastore {
|
||||
my $location = shift;
|
||||
my $server;
|
||||
my $path;
|
||||
unless ($datastoreautomount) {
|
||||
die "automount of VMware datastores is disabled in site configuration, not continuing";
|
||||
}
|
||||
($server,$path) = split /\//,$location,2;
|
||||
$location = getlabel_for_datastore('nfs',$location);
|
||||
|
||||
@@ -4214,12 +4258,16 @@ sub mknetboot {
|
||||
}
|
||||
unless(
|
||||
-r "$custprofpath/vmkboot.gz"
|
||||
or -r "$custprofpath/b.z"
|
||||
or -r "$installroot/$osver/$arch/mboot.c32"
|
||||
or -r "$installroot/$osver/$arch/install.tgz" ){
|
||||
xCAT::SvrUtils::sendmsg([1,"Please run copycds first for $osver or create custom image in $custprofpath/"], $output_handler);
|
||||
}
|
||||
|
||||
my @reqmods = qw/vmkboot.gz vmk.gz sys.vgz cim.vgz/; #Required modules for an image to be considered complete
|
||||
if ( -r "$custprofpath/b.z" ) { #if someone hand extracts from imagedd, a different name scheme is used
|
||||
@reqmods = qw/b.z k.z s.z c.z/;
|
||||
}
|
||||
my %mods;
|
||||
foreach (@reqmods) {
|
||||
$mods{$_} = 1;
|
||||
@@ -4260,14 +4308,27 @@ sub mknetboot {
|
||||
}
|
||||
# now make <HEX> file entry stuff
|
||||
$kernel = "$tp/mboot.c32";
|
||||
my $prepend = "$tp/vmkboot.gz";
|
||||
delete $mods{"vmkboot.gz"};
|
||||
$append = " --- $tp/vmk.gz";
|
||||
delete $mods{"vmk.gz"};
|
||||
$append .= " --- $tp/sys.vgz";
|
||||
delete $mods{"sys.vgz"};
|
||||
$append .= " --- $tp/cim.vgz";
|
||||
delete $mods{"cim.vgz"};
|
||||
my $prepend;
|
||||
if ($reqmods[0] eq "vmkboot.gz") {
|
||||
$prepend = "$tp/vmkboot.gz";
|
||||
delete $mods{"vmkboot.gz"};
|
||||
$append = " --- $tp/vmk.gz";
|
||||
delete $mods{"vmk.gz"};
|
||||
$append .= " --- $tp/sys.vgz";
|
||||
delete $mods{"sys.vgz"};
|
||||
$append .= " --- $tp/cim.vgz";
|
||||
delete $mods{"cim.vgz"};
|
||||
} else { #the single letter style
|
||||
$prepend = "$tp/b.z";
|
||||
delete $mods{"b.z"};
|
||||
$append = " --- $tp/k.z";
|
||||
delete $mods{"k.z"};
|
||||
$append .= " --- $tp/s.z";
|
||||
delete $mods{"s.z"};
|
||||
$append .= " --- $tp/c.z";
|
||||
delete $mods{"c.z"};
|
||||
}
|
||||
|
||||
if ($mods{"mod.tgz"}) {
|
||||
$append .= " --- $tp/mod.tgz";
|
||||
delete $mods{"mod.tgz"};
|
||||
|
||||
@@ -125,7 +125,7 @@ sub getfspcon {
|
||||
#################################
|
||||
# Get attributes
|
||||
#################################
|
||||
my ($att) = $tabs{ppc}->getAttribs({'node'=>$node}, @attribs );
|
||||
my ($att) = $tabs{ppc}->getNodeAttribs($node, @attribs );
|
||||
|
||||
if ( !defined( $att )) {
|
||||
#return( sprintf( $errmsg{NODE_UNDEF}, "ppc" ));
|
||||
@@ -206,7 +206,7 @@ sub getmulcon {
|
||||
#################################
|
||||
# Get attributes
|
||||
#################################
|
||||
my ($att) = $tabs{ppc}->getAttribs({'node'=>$node}, @attribs );
|
||||
my ($att) = $tabs{ppc}->getNodeAttribs($node, @attribs );
|
||||
|
||||
if ( !defined( $att )) {
|
||||
$rsp->{node}->[0]->{error}=["Node is not defined in ppc table"];
|
||||
|
||||
@@ -292,8 +292,8 @@ sub process_request {
|
||||
# now run the specific genimage command
|
||||
$callback->({info=>["$cmd"]});
|
||||
$::CALLBACK=$callback;
|
||||
#my $output = xCAT::Utils->runcmd("$cmd", 0, 1);
|
||||
my $output = xCAT::Utils->runcmd_S("$cmd", 0, 1); # stream output
|
||||
#my $output = xCAT::Utils->runcmd("$cmd", 0, 1); # non-stream
|
||||
my $output = xCAT::Utils->runcmd("$cmd", 0, 1, 1); # stream output
|
||||
open(FILE, ">/tmp/genimageoutput");
|
||||
foreach my $entry (@$output) {
|
||||
print FILE $entry;
|
||||
|
||||
@@ -95,7 +95,7 @@ sub gethmccon {
|
||||
#################################
|
||||
# Get attributes
|
||||
#################################
|
||||
my ($att) = $tabs{ppc}->getAttribs({'node'=>$node}, @attribs );
|
||||
my ($att) = $tabs{ppc}->getNodeAttribs( $node, @attribs );
|
||||
|
||||
if ( !defined( $att )) {
|
||||
#return( sprintf( $errmsg{NODE_UNDEF}, "ppc" ));
|
||||
|
||||
@@ -590,7 +590,7 @@ sub make_bundle {
|
||||
if ($rootimgdir) {
|
||||
$callback->({data=>["Packing root image. It will take a while"]});
|
||||
system("cd $rootimgdir; find rootimg |cpio -H newc -o | gzip -c - > $tpath/rootimgtree.gz");
|
||||
$attribs->{'rootimgtree'} = "$rootimgdir/rootimg/rootimgtree.gz";
|
||||
$attribs->{'rootimgtree'} = "$rootimgdir/rootimgtree.gz";
|
||||
} else {
|
||||
$callback->({error=>["Couldn't locate the root image directory. "],errorcode=>[1]});
|
||||
return 0;
|
||||
@@ -744,7 +744,6 @@ sub extract_bundle {
|
||||
# go through each image directory. Find the XML and put it into the array. If there are any
|
||||
# errors then the whole thing is over and we error and leave.
|
||||
foreach my $imgdir (@files){
|
||||
#print "$imgdir \n";
|
||||
unless(-r "$imgdir/manifest.xml"){
|
||||
$callback->({error=>["Failed to find manifest.xml file in image bundle"],errorcode=>[1]});
|
||||
return;
|
||||
|
||||
@@ -83,9 +83,6 @@ sub process_request {
|
||||
$noderange = \@nodenames;
|
||||
$request->{node} = $noderange;
|
||||
}
|
||||
}else{
|
||||
$callback->({error=>["No node names are given, I cannot figure out who you are."],errorcode=>[1]});
|
||||
return;
|
||||
}
|
||||
|
||||
my $command = $request->{command}->[0];
|
||||
@@ -319,33 +316,7 @@ sub getNodeData {
|
||||
if ($type eq "location")
|
||||
{
|
||||
# get locations with specific nodes
|
||||
push @imageInfo, $tab->getAttribs({node => $node}, @attrs);
|
||||
|
||||
if (!defined $imageInfo[0])
|
||||
{
|
||||
# maybe node belongs to nodegroup
|
||||
# try to find it in groups
|
||||
my @tmpnodes = join(',', $node);
|
||||
|
||||
# group info in nodelist tab
|
||||
my $nltab = xCAT::Table->new('nodelist');
|
||||
my $nltabdata = $nltab->getNodesAttribs(\@tmpnodes, ['node', 'groups']);
|
||||
|
||||
my $data = $nltabdata->{$node}->[0];
|
||||
my @grps = split(',', $data->{groups});
|
||||
foreach my $g (@grps)
|
||||
{
|
||||
chomp $g;
|
||||
my $info = $tab->getAttribs({node => $g}, @attrs);
|
||||
if(defined $info)
|
||||
{
|
||||
push @imageInfo, $info;
|
||||
}
|
||||
|
||||
# return once get one record
|
||||
last if (defined $imageInfo[1]);
|
||||
}
|
||||
}
|
||||
push @imageInfo, $tab->getNodeAttribs($node, @attrs);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -13,6 +13,7 @@ use XML::Simple;
|
||||
$XML::Simple::PREFERRED_PARSER='XML::Parser';
|
||||
use xCAT::PPCdb;
|
||||
use xCAT::NodeRange;
|
||||
use xCAT::Utils;
|
||||
|
||||
require xCAT::MacMap;
|
||||
require xCAT_plugin::blade;
|
||||
@@ -144,6 +145,7 @@ my $enter_time = 0;
|
||||
my @filternodes;
|
||||
my %otherinterfacehash;
|
||||
my $TRACE = 0;
|
||||
my $DEBUG_MATCH = 0;
|
||||
my %globlehwtype = (
|
||||
fsp => $::NODETYPE_FSP,
|
||||
bpa => $::NODETYPE_BPA,
|
||||
@@ -1392,7 +1394,90 @@ sub getip_from_url {
|
||||
return( $1 );
|
||||
}
|
||||
|
||||
sub read_from_table {
|
||||
my %idhash;
|
||||
my %typehash;
|
||||
my %iphash;
|
||||
my %vpdhash;
|
||||
if ( !defined(%::OLD_DATA_CACHE))
|
||||
{
|
||||
# find out all the existed nodes' ipaddresses
|
||||
my $hoststab = xCAT::Table->new('hosts');
|
||||
if ( $hoststab ) {
|
||||
my @ipentries = $hoststab->getAllNodeAttribs( ['node','ip'] );
|
||||
for my $ipentry ( @ipentries ) {
|
||||
$iphash{$ipentry->{node}} = $ipentry->{ip};
|
||||
}
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
|
||||
#find out all the existed nodes' type
|
||||
my $nodetypetab = xCAT::Table->new('nodetype');
|
||||
if ( $nodetypetab ) {
|
||||
my @typeentries = $nodetypetab->getAllNodeAttribs( ['node','nodetype'] );
|
||||
for my $typeentry ( @typeentries) {
|
||||
$typehash{$typeentry->{node}} = $typeentry->{nodetype};
|
||||
}
|
||||
} else {
|
||||
return 2;
|
||||
}
|
||||
|
||||
# find out all the existed nodes' mtms and side
|
||||
my $vpdtab = xCAT::Table->new( 'vpd' );
|
||||
if ( $vpdtab ) {
|
||||
my @vpdentries = $vpdtab->getAllNodeAttribs(['node','mtm','serial','side']);
|
||||
for my $entry ( @vpdentries ) {
|
||||
@{$vpdhash{$entry->{node}}}[0] = $entry->{mtm};
|
||||
@{$vpdhash{$entry->{node}}}[1] = $entry->{serial};
|
||||
@{$vpdhash{$entry->{node}}}[2] = $entry->{side};
|
||||
}
|
||||
} else {
|
||||
return 3;
|
||||
}
|
||||
# find out all the existed nodes' attributes
|
||||
my $ppctab = xCAT::Table->new('ppc');
|
||||
if ( $ppctab ) {
|
||||
my @identries = $ppctab->getAllNodeAttribs( ['node','id','parent','nodetype'] );
|
||||
for my $entry ( @identries ) {
|
||||
next if ($entry->{nodetype} =~ /lpar/);
|
||||
@{$::OLD_DATA_CACHE{$entry->{node}}}[0] = @{$vpdhash{$entry->{node}}}[0];#mtm
|
||||
@{$::OLD_DATA_CACHE{$entry->{node}}}[1] = @{$vpdhash{$entry->{node}}}[1];#sn
|
||||
@{$::OLD_DATA_CACHE{$entry->{node}}}[2] = @{$vpdhash{$entry->{node}}}[2];#side
|
||||
# find node ip address, check node name first, then check hosts table
|
||||
my $ifip = xCAT::Utils->isIpaddr($entry->{node});
|
||||
if ( $ifip )
|
||||
{
|
||||
@{$::OLD_DATA_CACHE{$entry->{node}}}[3] = $entry->{node};#ip
|
||||
} else
|
||||
{
|
||||
if ( exists ($iphash{$entry->{node}}) ) {
|
||||
@{$::OLD_DATA_CACHE{$entry->{node}}}[3] = $iphash{$entry->{node}};#ip
|
||||
}
|
||||
else {
|
||||
@{$::OLD_DATA_CACHE{$entry->{node}}}[3] = "";#ip
|
||||
}
|
||||
}
|
||||
@{$::OLD_DATA_CACHE{$entry->{node}}}[4] = $entry->{id};#id
|
||||
@{$::OLD_DATA_CACHE{$entry->{node}}}[5] = $entry->{parent};#parent
|
||||
if ( exists $entry->{nodetype}) {
|
||||
@{$::OLD_DATA_CACHE{$entry->{node}}}[6] = $entry->{nodetype};#nodetype
|
||||
} else {
|
||||
if ( exists ($typehash{$entry->{node}}) ) {
|
||||
@{$::OLD_DATA_CACHE{$entry->{node}}}[6] = $typehash{$entry->{node}};
|
||||
} else {
|
||||
@{$::OLD_DATA_CACHE{$entry->{node}}}[6] = "";
|
||||
}
|
||||
}
|
||||
@{$::OLD_DATA_CACHE{$entry->{node}}}[7] = 1;
|
||||
}
|
||||
} else
|
||||
{
|
||||
return 4;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
#############################################################################
|
||||
# Get hostname from SLP URL response and match databse meanwhile
|
||||
@@ -1414,9 +1499,7 @@ sub gethost_from_url_or_old {
|
||||
my $parmtm = shift;
|
||||
my $parsn = shift;
|
||||
my $pname = shift;
|
||||
my %idhash = ();
|
||||
my %iphash = ();
|
||||
my %typehash = ();
|
||||
my $flagref = shift;
|
||||
|
||||
#######################################
|
||||
# Extract IP from URL
|
||||
@@ -1430,113 +1513,14 @@ sub gethost_from_url_or_old {
|
||||
#}
|
||||
}
|
||||
# get the information of existed nodes to do the migration
|
||||
if ( !defined(%::OLD_DATA_CACHE))
|
||||
{
|
||||
# find out all the existed nodes' ipaddresses
|
||||
my $hoststab = xCAT::Table->new('hosts');
|
||||
if ( $hoststab )
|
||||
{
|
||||
my @ipentries = $hoststab->getAllNodeAttribs( ['node','ip'] );
|
||||
for my $ipentry ( @ipentries )
|
||||
{
|
||||
$iphash{$ipentry->{node}} = $ipentry->{ip};
|
||||
}
|
||||
} else
|
||||
{
|
||||
# need to do something here
|
||||
}
|
||||
|
||||
# find out all the existed nodes' type
|
||||
my $nodetypetab = xCAT::Table->new('nodetype');
|
||||
if ( $nodetypetab )
|
||||
{
|
||||
my @typeentries = $nodetypetab->getAllNodeAttribs( ['node','nodetype'] );
|
||||
for my $typeentry ( @typeentries)
|
||||
{
|
||||
$typehash{$typeentry->{node}} = $typeentry->{nodetype};
|
||||
}
|
||||
} else
|
||||
{
|
||||
# need to do something here
|
||||
}
|
||||
|
||||
# find out all the existed nodes' attributes
|
||||
my $ppctab = xCAT::Table->new('ppc');
|
||||
if ( $ppctab )
|
||||
{
|
||||
my @identries = $ppctab->getAllNodeAttribs( ['node','id','parent','nodetype'] );
|
||||
for my $identry ( @identries )
|
||||
{
|
||||
if ( $identry->{id} )
|
||||
{
|
||||
@{$idhash{$identry->{node}}}[0] = $identry->{id};
|
||||
}
|
||||
if ($identry->{parent} )
|
||||
{
|
||||
@{$idhash{$identry->{node}}}[1] = $identry->{parent};
|
||||
}
|
||||
if ($identry->{nodetype} )
|
||||
{
|
||||
@{$idhash{$identry->{node}}}[2] = $identry->{nodetype};
|
||||
} else
|
||||
{
|
||||
@{$idhash{$identry->{node}}}[2] = $typehash{$identry->{node}};
|
||||
}
|
||||
}
|
||||
} else
|
||||
{
|
||||
# need to do something here
|
||||
}
|
||||
|
||||
# find out all the existed nodes' mtms and side
|
||||
my $vpdtab = xCAT::Table->new( 'vpd' );
|
||||
if ( $vpdtab )
|
||||
{
|
||||
my @entries = $vpdtab->getAllNodeAttribs(['node','mtm','serial','side']);
|
||||
for my $entry ( @entries ) {
|
||||
if ( $entry->{mtm} and $entry->{serial})
|
||||
{
|
||||
@{$::OLD_DATA_CACHE{$entry->{node}}}[0] = $entry->{mtm};
|
||||
@{$::OLD_DATA_CACHE{$entry->{node}}}[1] = $entry->{serial};
|
||||
} else {
|
||||
@{$::OLD_DATA_CACHE{$entry->{node}}}[0] = undef;
|
||||
@{$::OLD_DATA_CACHE{$entry->{node}}}[1] = undef;
|
||||
}
|
||||
@{$::OLD_DATA_CACHE{$entry->{node}}}[2] = $entry->{side};
|
||||
# find node ip address, check node name first, then check hosts table
|
||||
my $ifip = xCAT::Utils->isIpaddr($entry->{node});
|
||||
if ( $ifip )
|
||||
{
|
||||
@{$::OLD_DATA_CACHE{$entry->{node}}}[3] = $entry->{node};
|
||||
} else
|
||||
{
|
||||
if ( exists ($iphash{$entry->{node}}) )
|
||||
{
|
||||
@{$::OLD_DATA_CACHE{$entry->{node}}}[3] = $iphash{$entry->{node}};
|
||||
}
|
||||
else
|
||||
{
|
||||
@{$::OLD_DATA_CACHE{$entry->{node}}}[3] = "";
|
||||
}
|
||||
}
|
||||
@{$::OLD_DATA_CACHE{$entry->{node}}}[4] = @{$idhash{$entry->{node}}}[0];
|
||||
@{$::OLD_DATA_CACHE{$entry->{node}}}[5] = @{$idhash{$entry->{node}}}[1];
|
||||
@{$::OLD_DATA_CACHE{$entry->{node}}}[6] = @{$idhash{$entry->{node}}}[2];
|
||||
@{$::OLD_DATA_CACHE{$entry->{node}}}[7] = 1;
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
# need to do something here
|
||||
}
|
||||
}
|
||||
|
||||
if (($type eq TYPE_BPA or $type eq TYPE_FSP) and $pname)
|
||||
{
|
||||
$enter_time = ($enter_time + 1) % 2;
|
||||
}
|
||||
|
||||
read_from_table() unless (%::OLD_DATA_CACHE);
|
||||
|
||||
foreach my $oldnode ( keys %::OLD_DATA_CACHE )
|
||||
{
|
||||
@@ -1553,6 +1537,8 @@ sub gethost_from_url_or_old {
|
||||
# should return fast to save time
|
||||
if (($type eq TYPE_BPA or $type eq TYPE_FSP) and ($tmptype eq $type) and $pname and $side) {
|
||||
if ($pname eq $tmpparent and $side eq $tmpside) {
|
||||
$$flagref = 1;
|
||||
print "1 got old name $oldnode \n" if($DEBUG_MATCH eq 1);
|
||||
return $oldnode;
|
||||
}
|
||||
}
|
||||
@@ -1569,6 +1555,8 @@ sub gethost_from_url_or_old {
|
||||
if ( $tmpside eq $side ) {# match! which means that node is the same as the new one
|
||||
if ( $ip eq $tmpip ) { #which means that the ip is not changed
|
||||
# maybe we should check if the ip is invalid and send a warning
|
||||
$$flagref = 1;
|
||||
print "2 got old name $ip\n" if($DEBUG_MATCH eq 1);
|
||||
return $ip;
|
||||
} else { #which means that the ip is changed
|
||||
my $vip = check_ip($ip);
|
||||
@@ -1576,6 +1564,8 @@ sub gethost_from_url_or_old {
|
||||
# maybe we should check if the old ip is invalid and send a warning
|
||||
# even so we should keep the definition as before
|
||||
# because this case, we can't put check_ip in the end
|
||||
$$flagref = 1;
|
||||
print "3 got old name $oldnode\n" if($DEBUG_MATCH eq 1);
|
||||
return $oldnode;
|
||||
} else {
|
||||
return $ip;
|
||||
@@ -1592,24 +1582,34 @@ sub gethost_from_url_or_old {
|
||||
if ( $ip eq $tmpip ) {
|
||||
if ( $oldnode =~ /\-(A|B)$/) {
|
||||
@{$::OLD_DATA_CACHE{$oldnode}}[7] = 0;
|
||||
$$flagref = 1;
|
||||
print "4 got old name $oldnode\n" if($DEBUG_MATCH eq 1);
|
||||
return $oldnode;
|
||||
} else {
|
||||
@{$::OLD_DATA_CACHE{$oldnode}}[7] = 0;
|
||||
#change node name, need to record the node here
|
||||
$::UPDATE_CACHE{$mtm.'-'.$sn} = $oldnode;
|
||||
$$flagref = 1;
|
||||
print "5 got old name $oldnode\n" if($DEBUG_MATCH eq 1);
|
||||
return $oldnode.'-'.$slot;
|
||||
}
|
||||
} else {# not find a matched definition, but need to use the old node name
|
||||
if ( $enter_time eq 0 and $unmatched){
|
||||
$$flagref = 1;
|
||||
print "6 got old name $oldnode\n" if($DEBUG_MATCH eq 1);
|
||||
return $oldnode;
|
||||
}
|
||||
}
|
||||
} elsif ( $tmpside =~ /\-/ ) {# end of if ( $oldnode =~ /^Server\-/)
|
||||
if ( $ip eq $tmpip ) {
|
||||
@{$::OLD_DATA_CACHE{$oldnode}}[7] = 0;
|
||||
$$flagref = 1;
|
||||
print "7 got old name $oldnode\n" if($DEBUG_MATCH eq 1);
|
||||
return $oldnode;
|
||||
} else{
|
||||
if ( $enter_time eq 0 and $unmatched){
|
||||
$$flagref = 1;
|
||||
print "8 got old name $oldnode\n" if($DEBUG_MATCH eq 1);
|
||||
return $oldnode;
|
||||
}
|
||||
}
|
||||
@@ -1617,25 +1617,32 @@ sub gethost_from_url_or_old {
|
||||
}
|
||||
} elsif ( $tmpside =~ /\-/ ){
|
||||
if ( $side eq $tmpside ) {
|
||||
$$flagref = 1;
|
||||
print "9 got old name $oldnode\n" if($DEBUG_MATCH eq 1);
|
||||
return $oldnode;
|
||||
}
|
||||
} elsif ( !$tmpside ) {
|
||||
if ( $oldnode =~ /^Server\-/) {#judge if need to change node's name
|
||||
if ( $oldnode !~ /\-(A|B)$/ ) {
|
||||
delete $::OLD_DATA_CACHE{$oldnode};
|
||||
$$flagref = 1;
|
||||
print "10 got old name $oldnode\n" if($DEBUG_MATCH eq 1);
|
||||
return $oldnode."-".$slot;
|
||||
}
|
||||
}
|
||||
# if mtms could match but side not defined, we will trate
|
||||
# it as the result by rscan. And alway use its name.
|
||||
delete $::OLD_DATA_CACHE{$oldnode};
|
||||
$$flagref = 1;
|
||||
print "11 got old name $oldnode\n" if($DEBUG_MATCH eq 1);
|
||||
return $oldnode;
|
||||
}
|
||||
}
|
||||
}# end of if ($tmpmtm eq $mtm and $tmpsn eq $sn)
|
||||
|
||||
|
||||
} elsif ( ($type eq TYPE_FRAME or $type eq TYPE_CEC) and ($type eq $tmptype)){
|
||||
}
|
||||
if ( ($type eq TYPE_FRAME or $type eq TYPE_CEC) and ($type eq $tmptype)){
|
||||
if ( !$tmpmtm and !$tmpid) {
|
||||
next;
|
||||
}
|
||||
@@ -1645,6 +1652,8 @@ sub gethost_from_url_or_old {
|
||||
my $tpparmtm = @{$::OLD_DATA_CACHE{$tmpparent}}[0];
|
||||
my $tpparsn = @{$::OLD_DATA_CACHE{$tmpparent}}[1];
|
||||
if ( ($tpparmtm eq $parmtm) and ($tpparsn eq $parsn) and ($cage_number eq $tmpid) and ($type eq $tmptype) ) {
|
||||
$$flagref = 1;
|
||||
print "12 got old name $oldnode\n" if($DEBUG_MATCH eq 1);
|
||||
return $oldnode;
|
||||
}
|
||||
}
|
||||
@@ -1656,12 +1665,18 @@ sub gethost_from_url_or_old {
|
||||
if ( $oldnode =~ /(\-A)$/) {
|
||||
$nodename = s/(\-A)$//;
|
||||
# should send a warning here
|
||||
$$flagref = 1;
|
||||
print "13 got old name $oldnode\n" if($DEBUG_MATCH eq 1);
|
||||
return $nodename;
|
||||
}
|
||||
else {
|
||||
$$flagref = 1;
|
||||
print "14 got old name $oldnode\n" if($DEBUG_MATCH eq 1);
|
||||
return $oldnode;
|
||||
}
|
||||
} else {
|
||||
$$flagref = 1;
|
||||
print "15 got old name $oldnode\n" if($DEBUG_MATCH eq 1);
|
||||
return $oldnode;
|
||||
}
|
||||
}
|
||||
@@ -1922,7 +1937,7 @@ sub getip_from_iplist
|
||||
{
|
||||
my $flag = 1;
|
||||
for my $einc (@ips2) {
|
||||
if ( $nets->{$net} eq $einc) {
|
||||
if ( $nets->{$net} eq $einc) {
|
||||
$flag = 0;
|
||||
}
|
||||
}
|
||||
@@ -2075,8 +2090,26 @@ sub parse_responses {
|
||||
my $request = shift;
|
||||
my $values = shift;
|
||||
my $length = shift;
|
||||
|
||||
my %outhash = ();
|
||||
my $matchflag = 0;
|
||||
my %outhash;
|
||||
my %net;
|
||||
my %addr;
|
||||
my $nettab = xCAT::Table->new('networks');
|
||||
my @nets = $nettab->getAllAttribs('netname', 'net','mask','mgtifname');
|
||||
if (scalar(@nets) == 0) {
|
||||
trace( $request, "Can't get networks information from networks table" , 1);
|
||||
} else {
|
||||
foreach my $enet (@nets) {
|
||||
next if ($enet->{'net'} =~ /:/);
|
||||
$net{$enet->{'mgtifname'}}{subnet} = $enet->{'net'};
|
||||
$net{$enet->{'mgtifname'}}{netmask} = $enet->{'mask'};
|
||||
}
|
||||
}
|
||||
my $netref = xCAT::NetworkUtils->get_nic_ip();
|
||||
for my $entry (keys %$netref) {
|
||||
$addr{$netref->{$entry}}{subnet} = $net{$entry}{subnet};
|
||||
$addr{$netref->{$entry}}{netmask} = $net{$entry}{netmask};
|
||||
}
|
||||
my @attrs = (
|
||||
"type",
|
||||
"machinetype-model",
|
||||
@@ -2101,7 +2134,9 @@ sub parse_responses {
|
||||
my %fid1;
|
||||
my %fid2;
|
||||
my %cid;
|
||||
|
||||
my %pmtm;
|
||||
my %psn;
|
||||
my @matchnodes;
|
||||
trace( $request, "Now I will explain how the lsslp parse its response: " , 1);
|
||||
foreach my $rsp ( @$values ) {
|
||||
###########################################
|
||||
@@ -2171,7 +2206,7 @@ sub parse_responses {
|
||||
# $hostip{$entry->{node}} = $entry->{ip};
|
||||
#}
|
||||
|
||||
trace( $request, "The type is $result[0], mtm is $result[1], sn is $result[2], side is $result[3], ip is $result[4], parent mtm is $result[5], parent sn is $result[6], frame num is $result[7], cage num is $result[8].", 1 );
|
||||
trace( $request, ">>>>>>>>The type is $result[0], mtm is $result[1], sn is $result[2], side is $result[3], ip is $result[4], parent mtm is $result[5], parent sn is $result[6], frame num is $result[7], cage num is $result[8].", 1 );
|
||||
|
||||
# begin to define FSP/BPA/FRAME/CEC
|
||||
my $typetp;
|
||||
@@ -2185,9 +2220,7 @@ sub parse_responses {
|
||||
}
|
||||
my $hostname = undef;
|
||||
if ( $type eq SERVICE_BPA or $type eq SERVICE_FSP ) {
|
||||
|
||||
trace( $request, "........First begin to define FSP/BPA nodes", 1 );
|
||||
trace( $request, " we will keep the datas here first", 1);
|
||||
trace( $request, "........First define FSP/BPA nodes", 1 );
|
||||
###########################################
|
||||
# begin to define fsp/bpa, use ip as the hostname of the fsp/bpa
|
||||
# for there are redundancy of fsp/bpa,
|
||||
@@ -2199,36 +2232,46 @@ sub parse_responses {
|
||||
my (@severnode1, @severnode2);
|
||||
my @ips = split/,/, $result[4];
|
||||
|
||||
#keep cage id for the secondary fsp definition
|
||||
#the cash hash is like $fid{mtm*sn}=cageid
|
||||
#if ($type eq SERVICE_FSP and $severnode1[3] eq "A")
|
||||
#{
|
||||
# $fid1{$severnode1[1]."*".$severnode1[2]} = $severnode1[8];
|
||||
#}
|
||||
#if ($type eq SERVICE_FSP and $severnode1[3] eq "B")
|
||||
#{
|
||||
# $fid2{$severnode1[1]."*".$severnode1[2]} = $severnode1[8];
|
||||
#}
|
||||
if (!exists($cid{$result[1]."*".$result[2]} ) || ($result[8] > 0)) {
|
||||
$cid{$result[1]."*".$result[2]} = $result[8];
|
||||
}
|
||||
if (!exists($pmtm{$result[1]."*".$result[2]}) || ($result[5] > 0)) {
|
||||
$pmtm{$result[1]."*".$result[2]} = $result[5];
|
||||
$psn{$result[1]."*".$result[2]} = $result[6];
|
||||
}
|
||||
|
||||
foreach (@result) {
|
||||
push @severnode1, $_;
|
||||
}
|
||||
|
||||
#keep cage id for the secondary fsp definition
|
||||
#the cash hash is like $fid{mtm*sn}=cageid
|
||||
if ($type eq SERVICE_FSP and $severnode1[3] eq "A")
|
||||
{
|
||||
$fid1{$severnode1[1]."*".$severnode1[2]} = $severnode1[8];
|
||||
}
|
||||
if ($type eq SERVICE_FSP and $severnode1[3] eq "B")
|
||||
{
|
||||
$fid2{$severnode1[1]."*".$severnode1[2]} = $severnode1[8];
|
||||
}
|
||||
|
||||
|
||||
$severnode1[3] = $severnode1[3].'-0';
|
||||
$severnode1[4] = $ips[0];
|
||||
$severnode1[0] = $typetp;
|
||||
push @severnode1, $rsp;
|
||||
$matchflag = 0;
|
||||
$hostname = gethost_from_url_or_old($ips[0], $severnode1[0], $severnode1[1], $severnode1[2],
|
||||
$severnode1[3], $ips[0], $severnode1[8], $severnode1[5],$severnode1[6]);
|
||||
if ( $hostname )
|
||||
{
|
||||
$severnode1[3], $ips[0], $severnode1[8], $severnode1[5],$severnode1[6], undef, \$matchflag);
|
||||
trace( $request, " The node $ips[0] match the old data and got the new name $hostname, $matchflag" , 1);
|
||||
if ( $hostname ) {
|
||||
$outhash{$hostname} = \@severnode1;
|
||||
}
|
||||
push @matchnodes, $hostname if ($matchflag eq 1) ;
|
||||
if ( length( $severnode1[4] ) > $$length ) {
|
||||
$$length = length( $severnode1[4] );
|
||||
}
|
||||
}
|
||||
|
||||
trace( $request, " The node $ips[0] match the old data and got the new name $hostname" , 1);
|
||||
#begin to define another fsp/bpa
|
||||
$hostname = undef;
|
||||
foreach (@result) {
|
||||
@@ -2238,24 +2281,24 @@ sub parse_responses {
|
||||
$severnode2[4] = $ips[1];
|
||||
$severnode2[0] = $typetp;
|
||||
push @severnode2, $rsp;
|
||||
$matchflag = 0;
|
||||
$hostname = gethost_from_url_or_old($ips[1], $severnode2[0], $severnode2[1], $severnode2[2],
|
||||
$severnode2[3], $ips[1], $severnode2[8], $severnode2[5],$severnode2[6]);
|
||||
if ( $hostname )
|
||||
{
|
||||
$severnode2[3], $ips[1], $severnode2[8], $severnode2[5],$severnode2[6], undef, \$matchflag);
|
||||
trace( $request, " The node $ips[1] match the old data and got the new name $hostname, $matchflag" , 1);
|
||||
if ( $hostname ) {
|
||||
$outhash{$hostname} = \@severnode2;
|
||||
}
|
||||
push @matchnodes, $hostname if ($matchflag eq 1) ;
|
||||
if ( length( $severnode2[4] ) > $$length ) {
|
||||
$$length = length( $severnode2[4] );
|
||||
}
|
||||
trace( $request, " The node $ips[1] match the old data and got the new name $hostname" , 1);
|
||||
|
||||
}
|
||||
###########################################
|
||||
# begin to define frame and cec
|
||||
# As default, use Server-$result[1]-SN$result[2] as hostname
|
||||
# put the definitions into %outhash
|
||||
###########################################
|
||||
|
||||
trace( $request, "........second begin to define frame and cec " , 1);
|
||||
trace( $request, "......Second define frame and cec " , 1);
|
||||
$hostname = undef;
|
||||
$host = "Server-$result[1]-SN$result[2]";
|
||||
unless ( exists( $outhash{$host} ))
|
||||
@@ -2273,13 +2316,15 @@ sub parse_responses {
|
||||
# side of frame and cec should be null
|
||||
$result[4] = "";
|
||||
push @result, $rsp;
|
||||
$matchflag = 0;
|
||||
$hostname = gethost_from_url_or_old($host, $result[0], $result[1], $result[2],
|
||||
$result[3],$result[4], $result[8],$result[5],$result[6]);
|
||||
if ( $hostname )
|
||||
{
|
||||
$result[3],$result[4], $result[8],$result[5],$result[6], undef, \$matchflag);
|
||||
trace( $request, " The node $host match the old data and got the new name $hostname, $matchflag" , 1);
|
||||
if ( $hostname ) {
|
||||
$outhash{$hostname} = \@result;
|
||||
push @matchnodes, $hostname if ($matchflag eq 1);
|
||||
}
|
||||
trace( $request, " the node $host match the old data and got the new name $hostname " , 1);
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
@@ -2287,25 +2332,55 @@ sub parse_responses {
|
||||
###########################################
|
||||
# for HMC
|
||||
###########################################
|
||||
trace( $request, "........begin to define hmc ", 1);
|
||||
$host = gethost_from_url( $request, $rsp, @result);
|
||||
trace( $request, "......Begin to define hmc ", 1);
|
||||
$matchflag = 0;
|
||||
$host = gethost_from_url( $request, $rsp, @result, \$matchflag);
|
||||
trace( $request, " The node $host match the old data and got the new name $host, $matchflag" , 1);
|
||||
if ( !defined( $host )) {
|
||||
next;
|
||||
}
|
||||
|
||||
push @matchnodes, $host if ($matchflag eq 1) ;
|
||||
###########################################
|
||||
# Strip commas from IP list
|
||||
# Find IP for HMC
|
||||
# 1. If it can match the definintion made by
|
||||
# xcatsetup, just return the ip matched
|
||||
# 2. If there is -i flag, return the ip that
|
||||
# within the same subnet with opt{i}
|
||||
# 3. If no match and no flag -i, return first
|
||||
###########################################
|
||||
|
||||
# we need to hide ipv6 ip address temporarily
|
||||
my @iptmp = split /,/, $result[4];
|
||||
my @iptmp2;
|
||||
foreach (@iptmp){
|
||||
if ($_ =~ /\d+\.\d+\.\d+\.\d+/) {
|
||||
push @iptmp2,$_;
|
||||
my $matchhmc = 0;
|
||||
foreach my $ii (@iptmp){
|
||||
if ($ii =~ /\d+\.\d+\.\d+\.\d+/) {
|
||||
$matchflag = 1;
|
||||
my $newhost = match_ip_defined_by_xcatsetup($ii, \$matchflag);
|
||||
push @matchnodes, $host if ($matchflag eq 1) ;
|
||||
if ($newhost) {
|
||||
$host = $newhost;
|
||||
$matchhmc = 1;
|
||||
$result[4] = $ii;
|
||||
} elsif (exists($opt{i})){
|
||||
my @userip = split /,/, $opt{i};
|
||||
foreach my $uip (@userip) {
|
||||
my $subnet = $addr{$uip}{subnet};
|
||||
my $netmask = $addr{$uip}{netmask};
|
||||
if(xCAT::NetworkUtils->ishostinsubnet($ii, $netmask, $subnet)) {
|
||||
$matchhmc = 1;
|
||||
$result[4] = $ii;
|
||||
next;
|
||||
}
|
||||
}
|
||||
}
|
||||
push @iptmp2,$ii;
|
||||
}
|
||||
}
|
||||
$result[4] = join( ",", @iptmp2);
|
||||
unless($matchhmc) {
|
||||
#$result[4] = join( ",", @iptmp2);
|
||||
$result[4] = $iptmp2[0];
|
||||
}
|
||||
# end of hidden ipv6 ip address
|
||||
|
||||
|
||||
@@ -2330,31 +2405,30 @@ sub parse_responses {
|
||||
############################################################
|
||||
# find out the cageid for the cec
|
||||
############################################################
|
||||
trace( $request, "\n\n.......the cageid need to be adjust,because some secondary fsp return wrong side value ( always 0)", 1);
|
||||
foreach my $idtmp( keys(%fid1) )
|
||||
{
|
||||
if ($fid1{$idtmp} > 0)
|
||||
{
|
||||
$cid{$idtmp} = $fid1{$idtmp};
|
||||
} elsif ($fid2{$idtmp} > 0)
|
||||
{
|
||||
$cid{$idtmp} = $fid2{$idtmp};
|
||||
} else {
|
||||
$cid{$idtmp} = 0;
|
||||
}
|
||||
}
|
||||
foreach ( keys(%fid2) )
|
||||
{
|
||||
if (!defined($cid{$_}))
|
||||
{
|
||||
$cid{$_} = $fid2{$_};
|
||||
}
|
||||
}
|
||||
#trace( $request, "\n\nThe cageid need to be adjust,because some secondary fsp return wrong side value ( always 0)", 1);
|
||||
#foreach my $idtmp( keys(%fid1) )
|
||||
#{
|
||||
# if ($fid1{$idtmp} > 0)
|
||||
# {
|
||||
# $cid{$idtmp} = $fid1{$idtmp};
|
||||
# } elsif ($fid2{$idtmp} > 0)
|
||||
# {
|
||||
# $cid{$idtmp} = $fid2{$idtmp};
|
||||
# } else {
|
||||
# $cid{$idtmp} = 0;
|
||||
# }
|
||||
#}
|
||||
#foreach ( keys(%fid2) )
|
||||
#{
|
||||
# if (!defined($cid{$_}))
|
||||
# {
|
||||
# $cid{$_} = $fid2{$_};
|
||||
# }
|
||||
#}
|
||||
|
||||
############################################################
|
||||
# -n flag to skip the existing node
|
||||
############################################################
|
||||
trace( $request, "\n\ncheck if there is -n, and skip the existing nodes ", 1);
|
||||
my %vpd_table_hash;
|
||||
my $vpdtab = xCAT::Table->new( 'vpd' );
|
||||
my @entries = $vpdtab->getAllNodeAttribs(['node','mtm','serial','side']);
|
||||
@@ -2364,23 +2438,16 @@ sub parse_responses {
|
||||
}
|
||||
}
|
||||
|
||||
my %nodehm_table_hash;
|
||||
my $nodehm_tab = xCAT::Table->new('nodehm');
|
||||
my @nodehm_entries = $nodehm_tab->getAllNodeAttribs(['node','mgt']);
|
||||
for my $entry ( @nodehm_entries ) {
|
||||
if ( $entry->{'mgt'} ) {
|
||||
$nodehm_table_hash{$entry->{'node'}} = $entry->{ 'mgt'};
|
||||
}
|
||||
}
|
||||
|
||||
##########################################################
|
||||
# Find the parent and mac and set them as the 10th and 11th
|
||||
# of the attribute of the server nodes
|
||||
##########################################################
|
||||
my %hash = ();
|
||||
my %hash;
|
||||
my $mac;
|
||||
my $parent;
|
||||
trace( $request, "\n\n\n Begin to parse these datas second time: ", 1);
|
||||
my $newhostname;
|
||||
trace( $request, "\n\n\nBegin to find cec's id, parent and hostname, find frame's hostname", 1);
|
||||
foreach my $h ( keys %outhash ) {
|
||||
my $data = $outhash{$h};
|
||||
my $type = @$data[0];
|
||||
@@ -2396,34 +2463,42 @@ sub parse_responses {
|
||||
my $bpamtm = @$data[5];
|
||||
my $bpasn = @$data[6];
|
||||
my $cagenum = @$data[8];
|
||||
trace( $request, ">>>>>>>>The node is $h, type is $type, mtm is $mtm, sn is $sn, side is $side, ip is $ip0, bpamtm is $bpamtm, bpasn is $bpasn, cagenum is $cagenum", 1);
|
||||
trace( $request, "......The node is $h, type is $type, mtm is $mtm, sn is $sn, side is $side, ip is $ip0, bpamtm is $bpamtm, bpasn is $bpasn, cagenum is $cagenum", 1);
|
||||
# find cageid for the secondary fsp node
|
||||
if ( $type =~ /^FSP$/ || $type =~ /^CEC$/) {
|
||||
@$data[8] = $cid{$mtm."*".$sn};
|
||||
@$data[5] = $pmtm{$mtm."*".$sn};
|
||||
@$data[6] = $psn{$mtm."*".$sn};
|
||||
$bpamtm = @$data[5];
|
||||
$bpasn = @$data[6];
|
||||
$cagenum = @$data[8];
|
||||
|
||||
trace ( $request, " Adjust cageid to @$data[8], bpamtm to @$data[5], bpasn to @$data[6]", 1);
|
||||
}
|
||||
|
||||
# if there is a -n flag, skip the existed nodes
|
||||
if ( exists( $opt{n} ) ) {
|
||||
if ( exists $vpd_table_hash{$mtm . '*' . $sn . '-' . $side} ) {
|
||||
my $existing_node = $vpd_table_hash{$mtm . '*' . $sn . '-' . $side};
|
||||
if ( exists $nodehm_table_hash{$existing_node} ) {
|
||||
trace ( $request, " This node is exites, so skipped. ", 1);
|
||||
next;
|
||||
if ($type =~ /^HMC$/) {
|
||||
$matchflag = 0;
|
||||
$newhostname = match_hosts_defined_by_xcatsetup($h, $type, $mtm, $sn, $side, $ip0, $cagenum, $bpamtm, $bpasn, $parent, \$matchflag);
|
||||
if ($newhostname) {
|
||||
$hash{$newhostname} = $data;
|
||||
push @matchnodes, $newhostname;
|
||||
} else {
|
||||
$hash{$h} = $data;
|
||||
}
|
||||
trace ( $request, " HMC $h macth the data defined by xcatsetup and got name $newhostname", 1);
|
||||
}
|
||||
}
|
||||
|
||||
# begin to find parent
|
||||
next unless( $type eq TYPE_CEC or $type eq TYPE_FRAME );
|
||||
my $newname;
|
||||
foreach my $h1 ( keys %outhash ) {
|
||||
my $data1 = $outhash{$h1};
|
||||
my $type1 = @$data1[0];
|
||||
my $mtm1 = @$data1[1];
|
||||
my $sn1 = @$data1[2];
|
||||
if ( $type1 eq TYPE_FRAME and ($type eq TYPE_BPA or $type eq TYPE_CEC) and $mtm1 eq $bpamtm and $sn1 eq $bpasn ) {
|
||||
$parent = $h1; # BPA and CEC's parent is Frame
|
||||
last;
|
||||
} elsif ( $type1 eq TYPE_CEC and $type eq TYPE_FSP and $mtm1 eq $mtm and $sn1 eq $sn ) {
|
||||
$parent = $h1; # FSP's parent is CEC
|
||||
if ($mtm1 eq $bpamtm and $sn1 eq $bpasn and $type1 eq "frame") {
|
||||
$parent = $h1; # CEC's parent is Frame
|
||||
last;
|
||||
} else {
|
||||
$parent = undef; # Frame and HMC have no parent
|
||||
@@ -2443,41 +2518,108 @@ sub parse_responses {
|
||||
}
|
||||
|
||||
push @$data, $parent;
|
||||
trace ( $request, " Then find the node's parent $parent.", 1);
|
||||
push @$data, undef; #This is for $data[9], which is mac address;
|
||||
trace ( $request, " $h find the parent $parent.", 1);
|
||||
|
||||
##########################################################
|
||||
#find the mac address
|
||||
if ( $type ne TYPE_FRAME and $type ne TYPE_CEC ) {# the ips of frame and cec are null
|
||||
$mac = match_ip_mac( $ip0 );
|
||||
##########################################################
|
||||
$newhostname = match_hosts_defined_by_xcatsetup($h, $type, $mtm, $sn, $side, $ip0, $cagenum, $bpamtm, $bpasn, $parent, \$matchflag);
|
||||
if ($newhostname) {
|
||||
$hash{$newhostname} = $data;
|
||||
push @matchnodes, $newhostname;
|
||||
} else {
|
||||
$mac = undef;
|
||||
}
|
||||
# This is originally used to check the invalid mac address in AIX, but failed to do it.
|
||||
#unless ( $mac =~ /\w+\:\w+\:\w+\:\w+\:\w+\:\w+/ ) { $mac = undef;}
|
||||
push @$data, $mac;
|
||||
trace ( $request, " Then find the node's mac $mac.", 1);
|
||||
|
||||
|
||||
|
||||
# have got node's parent and id, need to match fsp here
|
||||
trace ( $request, " Need to find new name for the fsp/bpa with parent $parent and id @$data[8].", 1);
|
||||
if (($type eq TYPE_FSP or $type eq TYPE_BPA) and $parent)
|
||||
{
|
||||
$newname = gethost_from_url_or_old($h, $type, undef, undef, $side, undef, undef, undef, undef, $parent);
|
||||
}
|
||||
|
||||
if ($newname)
|
||||
{
|
||||
trace ( $request, " The new name is $newname.", 1);
|
||||
$hash{$newname} = $data;
|
||||
$otherinterfacehash{$newname}{otherinterfaces} = $ip0;
|
||||
trace( $request, " Keep the node ip $ip0 in its otherinterfaces" , 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
trace ( $request, " The new name is $h.", 1);
|
||||
$hash{$h} = $data;
|
||||
$otherinterfacehash{$h}{otherinterfaces} = $ip0;
|
||||
trace( $request, " Keep the node ip $ip0 in its otherinterfaces" , 1);
|
||||
}
|
||||
trace ( $request, " CEC $h macth the data defined by xcatsetup and got name $newhostname", 1);
|
||||
}
|
||||
|
||||
##########################################################
|
||||
# Find the parent,hostname and mac address for fsp/bpa
|
||||
# Find mac address for HMC
|
||||
##########################################################
|
||||
trace( $request, "\n\n\nBegin to find parent and hostname for fsp/bpa: ", 1);
|
||||
foreach my $h ( keys %outhash ) {
|
||||
my $data = $outhash{$h};
|
||||
my $type = @$data[0];
|
||||
my $mtm = @$data[1];
|
||||
my $sn = @$data[2];
|
||||
my $side = @$data[3];
|
||||
my $ip0;
|
||||
if ( $h =~ /^([^\(]+)\(([^\)]+)\)$/ ) {
|
||||
$ip0 = $2;
|
||||
} else {
|
||||
$ip0 = @$data[4];
|
||||
}
|
||||
my $bpamtm = @$data[5];
|
||||
my $bpasn = @$data[6];
|
||||
my $cagenum = @$data[8];
|
||||
|
||||
trace( $request, "......The node is $h", 1);
|
||||
|
||||
##########################################################
|
||||
# begin to find fsp/bpa's parent
|
||||
##########################################################
|
||||
if ( $type eq TYPE_BPA or $type eq TYPE_FSP) {
|
||||
foreach my $h1 ( keys %hash ) {
|
||||
my $data1 = $hash{$h1};
|
||||
my $type1 = @$data1[0];
|
||||
my $mtm1 = @$data1[1];
|
||||
my $sn1 = @$data1[2];
|
||||
if ((( $type1 eq TYPE_FRAME and $type eq TYPE_BPA) or ($type1 eq TYPE_CEC and $type eq TYPE_FSP)) and ($mtm1 eq $mtm and $sn1 eq $sn) ) {
|
||||
$parent = $h1; # FSP's parent is CEC
|
||||
last;
|
||||
} else {
|
||||
$parent = undef; # HMC have no parent
|
||||
}
|
||||
}
|
||||
push @$data, $parent; #This is for $data[8];
|
||||
trace ( $request, " Find the $h parent $parent.", 1);
|
||||
} else {
|
||||
push @$data, undef;
|
||||
}
|
||||
##########################################################
|
||||
# match fsp/bpa nodes with the definition made by xcatsetup
|
||||
# keep the otherinterfaces for the nodes.
|
||||
##########################################################
|
||||
if ( $type eq TYPE_BPA or $type eq TYPE_FSP) {
|
||||
$newhostname = match_hosts_defined_by_xcatsetup($h, $type, $mtm, $sn, $side, $ip0, $cagenum, $bpamtm, $bpasn, $parent);
|
||||
if ($newhostname) {
|
||||
trace ( $request, " Find the new hostname $newhostname.", 1);
|
||||
$hash{$newhostname} = $data;
|
||||
push @matchnodes, $newhostname;
|
||||
$otherinterfacehash{$newhostname}{otherinterfaces} = $ip0;
|
||||
trace( $request, " Keep the node ip $ip0 in $newhostname otherinterfaces" , 1);
|
||||
} else {
|
||||
$hash{$h} = $data;
|
||||
$otherinterfacehash{$h}{otherinterfaces} = $ip0;
|
||||
trace( $request, " Keep the node ip $ip0 in $h otherinterfaces" , 1);
|
||||
}
|
||||
}
|
||||
|
||||
##########################################################
|
||||
# find the mac address for the fsp/bpa/hmc nodes.
|
||||
##########################################################
|
||||
if ( $type eq TYPE_BPA or $type eq TYPE_FSP or $type eq TYPE_HMC) {
|
||||
$mac = match_ip_mac( $ip0 );
|
||||
# This is originally used to check the invalid mac address in AIX, but failed to do it.
|
||||
#unless ( $mac =~ /\w+\:\w+\:\w+\:\w+\:\w+\:\w+/ ) { $mac = undef;}
|
||||
push @$data, $mac; #This is for $data[9], which is mac address;
|
||||
trace ( $request, " Find the $h mac $mac.", 1);
|
||||
} else {
|
||||
push @$data, undef;
|
||||
}
|
||||
}
|
||||
##########################################################
|
||||
# If there is -n flag, skip the matched nodes
|
||||
##########################################################
|
||||
if (exists($opt{n})) {
|
||||
trace( $request, "\n\n\nThere is -n flag, skip these nodes:\n", 1);
|
||||
for my $matchednode (@matchnodes) {
|
||||
if ($hash{$matchednode}) {
|
||||
trace( $request, "$matchednode,", 1);
|
||||
delete $hash{$matchednode};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2579,7 +2721,7 @@ sub xCATdB {
|
||||
########################################
|
||||
# HMC: name=hostname, ip=ip, mac=mac
|
||||
########################################
|
||||
xCAT::PPCdb::add_ppchcp( lc($type), "$name,$mac,$ip",1 );
|
||||
xCAT::PPCdb::add_ppchcp( lc($type), "$name,$mac,$model,$serial,$ip",1 );
|
||||
}
|
||||
elsif ( $type =~ /^FSP$/ ) {
|
||||
########################################
|
||||
@@ -3711,7 +3853,8 @@ sub get_rsp_dev
|
||||
#############################################
|
||||
my $passtab = xCAT::Table->new('passwd');
|
||||
if ( $passtab ) {
|
||||
my ($ent) = $passtab->getAttribs({key=>'blade'},'username','password');
|
||||
#my ($ent) = $passtab->getAttribs({key=>'blade'},'username','password');
|
||||
my $ent = $passtab->getNodeAttribs('blade', ['username','password']);
|
||||
if ( defined( $ent )) {
|
||||
$bladeuser = $ent->{username};
|
||||
$bladepass = $ent->{password};
|
||||
@@ -3721,17 +3864,18 @@ sub get_rsp_dev
|
||||
# Get MM userid/password
|
||||
#############################################
|
||||
my $mpatab = xCAT::Table->new('mpa');
|
||||
foreach ( keys %$mm ) {
|
||||
for my $nd ( keys %$mm ) {
|
||||
my $user = $bladeuser;
|
||||
my $pass = $bladepass;
|
||||
|
||||
if ( defined( $mpatab )) {
|
||||
my ($ent) = $mpatab->getAttribs({mpa=>$_},'username','password');
|
||||
#my ($ent) = $mpatab->getAttribs({mpa=>$_},'username','password');
|
||||
my $ent = $mpatab->getNodeAttribs($nd, ['username','password']);
|
||||
if ( defined( $ent->{password} )) { $pass = $ent->{password}; }
|
||||
if ( defined( $ent->{username} )) { $user = $ent->{username}; }
|
||||
}
|
||||
$mm->{$_}->{username} = $user;
|
||||
$mm->{$_}->{password} = $pass;
|
||||
$mm->{$nd}->{username} = $user;
|
||||
$mm->{$nd}->{password} = $pass;
|
||||
}
|
||||
}
|
||||
if (%$hmc )
|
||||
@@ -3909,7 +4053,7 @@ sub filtersamevlan {
|
||||
$validnets->{$net} = $nic;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
foreach my $name ( keys %$oldhash ) {
|
||||
my @data = @{ $oldhash->{$name}};
|
||||
my $type = lc($data[0]);
|
||||
@@ -3927,6 +4071,85 @@ sub filtersamevlan {
|
||||
}
|
||||
return $newhash;
|
||||
}
|
||||
##########################################################################
|
||||
# Match the nodes defined by xcatsetup
|
||||
# The match rules are:
|
||||
# match Frame nodes with mtms
|
||||
# match CEC nodes with parent name and id
|
||||
# match FSP/BPA nodes with parent name and side
|
||||
##########################################################################
|
||||
sub match_hosts_defined_by_xcatsetup {
|
||||
my $nodename = shift;
|
||||
my $type = shift;
|
||||
my $mtm = shift;
|
||||
my $sn = shift;
|
||||
my $side = shift;
|
||||
my $ip = shift;
|
||||
my $cage_number = shift;
|
||||
my $parmtm = shift;
|
||||
my $parsn = shift;
|
||||
my $pname = shift;
|
||||
my $flagref = shift;
|
||||
|
||||
read_from_table() unless (%::OLD_DATA_CACHE);
|
||||
foreach my $oldnode ( keys %::OLD_DATA_CACHE )
|
||||
{
|
||||
my $tmpmtm = @{$::OLD_DATA_CACHE{$oldnode}}[0];
|
||||
my $tmpsn = @{$::OLD_DATA_CACHE{$oldnode}}[1];
|
||||
my $tmpside = @{$::OLD_DATA_CACHE{$oldnode}}[2];
|
||||
my $tmpip = @{$::OLD_DATA_CACHE{$oldnode}}[3];
|
||||
my $tmpid = @{$::OLD_DATA_CACHE{$oldnode}}[4];
|
||||
my $tmpparent = @{$::OLD_DATA_CACHE{$oldnode}}[5];
|
||||
my $tmptype = uc(@{$::OLD_DATA_CACHE{$oldnode}}[6]);
|
||||
my $unmatched = @{$::OLD_DATA_CACHE{$oldnode}}[7];
|
||||
if ($type eq TYPE_FRAME)
|
||||
{
|
||||
if ($tmpmtm eq $mtm and $tmpsn eq $sn and $type eq $tmptype) {
|
||||
$$flagref = 1;
|
||||
print "20 got old name $oldnode\n" if($DEBUG_MATCH eq 1);
|
||||
return $oldnode;
|
||||
}
|
||||
}
|
||||
if ($type eq TYPE_CEC)
|
||||
{
|
||||
if ($pname eq $tmpparent and $cage_number eq $tmpid and $type eq $tmptype) {
|
||||
$$flagref = 1;
|
||||
print "21 got old name $oldnode\n" if($DEBUG_MATCH eq 1);
|
||||
return $oldnode;
|
||||
}
|
||||
}
|
||||
if ($type eq TYPE_BPA or $type eq TYPE_FSP)
|
||||
{
|
||||
if ($pname eq $tmpparent and $side eq $tmpside and $type eq $tmptype) {
|
||||
$$flagref = 1;
|
||||
print "22 got old name $oldnode\n" if($DEBUG_MATCH eq 1);
|
||||
return $oldnode;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return undef;
|
||||
}
|
||||
##########################################################################
|
||||
# Match the nodes defined by xcatsetup
|
||||
# Use ip to find HMC defined by the user
|
||||
##########################################################################
|
||||
sub match_ip_defined_by_xcatsetup {
|
||||
my $ip = shift;
|
||||
my $matchflag = shift;
|
||||
|
||||
read_from_table() unless (%::OLD_DATA_CACHE);
|
||||
foreach my $oldnode ( keys %::OLD_DATA_CACHE ) {
|
||||
my $tmpip = @{$::OLD_DATA_CACHE{$oldnode}}[3];
|
||||
my $tmptype = uc(@{$::OLD_DATA_CACHE{$oldnode}}[6]);
|
||||
next unless($tmptype eq TYPE_HMC);
|
||||
if ($ip eq $tmpip) {
|
||||
$$matchflag = 1;
|
||||
return $oldnode;
|
||||
}
|
||||
}
|
||||
return undef;
|
||||
}
|
||||
1;
|
||||
|
||||
|
||||
|
||||
@@ -248,7 +248,7 @@ sub add_known_host
|
||||
xCAT::MsgUtils->message("E", $rsp, $callback, 1);
|
||||
return 1;
|
||||
}
|
||||
chop($ip_address);
|
||||
chomp($ip_address);
|
||||
|
||||
if (defined $hostname)
|
||||
{
|
||||
|
||||
@@ -1111,12 +1111,16 @@ sub process_request {
|
||||
while ($newappstatus =~ /(\w+)\=(\w+)/) {
|
||||
my $tmp1=$1;
|
||||
my $tmp2=$2;
|
||||
if($oldappstatus =~ /$tmp1\=/){
|
||||
$oldappstatus =~ s/$tmp1\=\w+/$tmp1\=$tmp2/g;
|
||||
}else{
|
||||
$oldappstatus = $oldappstatus."\,$tmp1\=$tmp2";
|
||||
}
|
||||
$newappstatus =~ s/(\w+)\=(\w+)//g;
|
||||
if ($oldappstatus) {
|
||||
if($oldappstatus =~ /$tmp1\=/){
|
||||
$oldappstatus =~ s/$tmp1\=\w+/$tmp1\=$tmp2/g;
|
||||
}else{
|
||||
$oldappstatus = $oldappstatus."\,$tmp1\=$tmp2";
|
||||
}
|
||||
} else {
|
||||
$oldappstatus = "$tmp1\=$tmp2";
|
||||
}
|
||||
$newappstatus =~ s/(\w+)\=(\w+)//;
|
||||
}
|
||||
$status1->{$node1}->{appstatus}= $oldappstatus;
|
||||
$status1->{$node1}->{appstatustime}= $currtime;
|
||||
|
||||
@@ -107,9 +107,14 @@ sub preprocess_request {
|
||||
# get sent up to the MN
|
||||
|
||||
my $req = shift;
|
||||
unless ( defined( $req->{_xcatdest} ) ) {
|
||||
$req->{_xcatdest} = xCAT::Utils->get_site_Master();
|
||||
#if already preprocessed, go straight to request
|
||||
if ( (defined($req->{_xcatpreprocessed}))
|
||||
&& ($req->{_xcatpreprocessed}->[0] == 1))
|
||||
{
|
||||
return [$req];
|
||||
}
|
||||
|
||||
$req->{_xcatdest} = xCAT::Utils->get_site_Master();
|
||||
return [$req];
|
||||
}
|
||||
|
||||
@@ -842,6 +847,9 @@ sub ll_jobs {
|
||||
if (defined($::FILEATTRS{newfeature}[0])){
|
||||
push (@ugdflines, "newfeature=$::FILEATTRS{newfeature}[0]\n");
|
||||
}
|
||||
if (defined($::FILEATTRS{reconfiglist}[0])){
|
||||
push (@ugdflines, "reconfiglist=$::FILEATTRS{reconfiglist}[0]\n");
|
||||
}
|
||||
push (@ugdflines, "\n");
|
||||
push (@ugdflines, &get_prescripts($nodelist));
|
||||
if (defined($::FILEATTRS{shutdowntimeout}[0])){
|
||||
@@ -1856,6 +1864,11 @@ mxnode_loop: foreach my $mxnode ( xCAT::NodeRange::noderange($mxnodegroup) ) {
|
||||
sub runrollupdate {
|
||||
|
||||
my $reboot_request = shift;
|
||||
if ( ! $reboot_request->{arg} ) {
|
||||
&runrollupdate_usage;
|
||||
return;
|
||||
}
|
||||
|
||||
my @reboot_args = @{$reboot_request->{arg}};
|
||||
my $internal = 0;
|
||||
if ( $reboot_args[0] eq "internal" ) { $internal = 1; }
|
||||
@@ -1965,6 +1978,11 @@ sub runrollupdate {
|
||||
"S",
|
||||
"ROLLUPDATE failure: $::ug_name: Node $node appstatus not in valid state for rolling update "
|
||||
);
|
||||
if ($::ll_reservation_id){
|
||||
my @remove_res;
|
||||
$remove_res[0]='CANCEL_DUE_TO_ERROR';
|
||||
&remove_LL_reservations(\@remove_res);
|
||||
}
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
@@ -2511,16 +2529,16 @@ sub remove_LL_reservations {
|
||||
}
|
||||
my @llnodes_removed;
|
||||
foreach my $n (@{$nodes}) {
|
||||
# change features for this node
|
||||
if ($CANCEL_DUE_TO_ERROR) {
|
||||
&remove_LL_updatefeature_only($n);
|
||||
} else {
|
||||
&change_LL_feature($n);
|
||||
}
|
||||
my @lln;
|
||||
if ( (@lln=grep(/^$n$/,@llnodes)) | (@lln=grep(/^$n\./,@llnodes)) ) {
|
||||
$remove_count++;
|
||||
push (@llnodes_removed,$lln[0]);
|
||||
# change features for this node
|
||||
if ($CANCEL_DUE_TO_ERROR) {
|
||||
&remove_LL_updatefeature_only($lln[0]);
|
||||
} else {
|
||||
&change_LL_feature($lln[0]);
|
||||
}
|
||||
if ( $remove_count < $llnode_count ) {
|
||||
$remove_cmd .= " $lln[0]";
|
||||
} else {
|
||||
@@ -2529,6 +2547,8 @@ sub remove_LL_reservations {
|
||||
}
|
||||
}
|
||||
}
|
||||
# Send LL reconfig to all central mgrs and resource mgrs
|
||||
llreconfig();
|
||||
# Verify that the config change has been registered and that updatefeature
|
||||
# has been removed according to what the LL daemons report
|
||||
if (defined($::DATAATTRS{updatefeature}[0])) {
|
||||
@@ -2684,7 +2704,7 @@ sub change_LL_feature {
|
||||
}
|
||||
|
||||
# Send LL reconfig to all central mgrs and resource mgrs
|
||||
llreconfig();
|
||||
# llreconfig();
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -2764,7 +2784,7 @@ sub remove_LL_updatefeature_only {
|
||||
}
|
||||
|
||||
# Send LL reconfig to all central mgrs and resource mgrs
|
||||
llreconfig();
|
||||
# llreconfig();
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -2811,7 +2831,7 @@ sub llreconfig {
|
||||
my @llms = split(/\s+/,$llcms." ".$llrms);
|
||||
my %have = ();
|
||||
my @llnodes;
|
||||
my $runlocal=0;
|
||||
my $runlocal=1; # need to always run reconfig at least on local MN
|
||||
foreach my $m (@llms) {
|
||||
my ($sm,$rest) = split(/\./,$m);
|
||||
my $xlated_sm = $sm;
|
||||
@@ -2822,6 +2842,11 @@ sub llreconfig {
|
||||
$runlocal=1;
|
||||
}
|
||||
}
|
||||
if ( defined($::FILEATTRS{reconfiglist}[0]) ) {
|
||||
push (@llnodes, split( /,/,$::FILEATTRS{reconfiglist}[0]) );
|
||||
} elsif ( defined($::DATAATTRS{reconfiglist}[0]) ) {
|
||||
push (@llnodes, split( /,/,$::DATAATTRS{reconfiglist}[0]) );
|
||||
}
|
||||
if ($runlocal) {
|
||||
if ($::VERBOSE) {
|
||||
open (RULOG, ">>$::LOGDIR/$::LOGFILE");
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user