Compare commits
400 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 6c6b43f60f | |||
| d569677196 | |||
| f17024abe5 | |||
| ec114e2fde | |||
| 7a33da03de | |||
| 1138ab87d4 | |||
| 0a226feef7 | |||
| efa051a181 | |||
| d5ef187fe1 | |||
| bfee3cf96a | |||
| 6801e064cf | |||
| db6fc2c563 | |||
| 89f238f5cd | |||
| cdb7aa0ab6 | |||
| 91a1736e61 | |||
| 3e02ce0e4f | |||
| e2e7c0b35c | |||
| beadfcd627 | |||
| dfd91e4d4a | |||
| 64af7cbc19 | |||
| 2d555c821a | |||
| 786cfde0a8 | |||
| e1c60cb830 | |||
| b7daccfe36 | |||
| 571487bf46 | |||
| 85b4be21c5 | |||
| aca5b290c2 | |||
| 97e50a2aae | |||
| 4a30157492 | |||
| c72f824670 | |||
| e30d85bf2d | |||
| 1d37352e85 | |||
| c0e81dc8ad | |||
| bd67c19612 | |||
| 0768e46b91 | |||
| c1a25ac668 | |||
| 3995fae3b6 | |||
| 2d0f36801a | |||
| 66e30f3a17 | |||
| cb415007ba | |||
| 0a89522d18 | |||
| 8990dc25ff | |||
| c256f1c0fe | |||
| c5e3b1a06d | |||
| acbcc58858 | |||
| be6a71e607 | |||
| f69b6ac018 | |||
| 7ace2412fe | |||
| ea3431f5a7 | |||
| 8360cddd12 | |||
| d3043285f2 | |||
| 28d75b347f | |||
| 9a639e015e | |||
| ce4e807a04 | |||
| e05b6c62b2 | |||
| e705fc08e9 | |||
| 8f37638f66 | |||
| e0b1400489 | |||
| fb0028623a | |||
| 528ecb3e56 | |||
| b5afe5e3b9 | |||
| 525d1dcb63 | |||
| e01282f5eb | |||
| a1fdfce779 | |||
| 85e66bdcfc | |||
| 2d9139705f | |||
| e927682f24 | |||
| 69812d996a | |||
| ff67a1d864 | |||
| a9e5f73abd | |||
| 9e26b11fe2 | |||
| ef9db848fd | |||
| a2c0e85f08 | |||
| 265cbde35b | |||
| 9eda055ddd | |||
| ce3ea63680 | |||
| 83e983106c | |||
| 30d3984998 | |||
| 1e1b6417d7 | |||
| d8824a068f | |||
| 70414d2b08 | |||
| 236a415bf7 | |||
| 4c82d3101f | |||
| 4c2f0c2ceb | |||
| 6b9baa15e5 | |||
| f93460d4f6 | |||
| b5f73f7a23 | |||
| 43c44ee347 | |||
| 25eb443587 | |||
| e899e3d62b | |||
| 52620d3edd | |||
| d7987c5e46 | |||
| e9441739a0 | |||
| abf400572b | |||
| 5cabc2b9ef | |||
| 1d11ddb65f | |||
| 03eb28bb46 | |||
| 430d5c0c09 | |||
| ea966447d6 | |||
| 1533cf185c | |||
| 749cf2f240 | |||
| c06c616558 | |||
| 7dbd6aaf3e | |||
| 51fe0df1c4 | |||
| 045b83d76d | |||
| 3d8c237a01 | |||
| 5ac785b6f6 | |||
| 4768f5adba | |||
| 18193f31a4 | |||
| aad6c3c311 | |||
| 42ae915878 | |||
| e5755dbc64 | |||
| 4b2e5beb12 | |||
| ee48169642 | |||
| f20e77dd93 | |||
| cdf3b7aeb2 | |||
| 1a2383d9f8 | |||
| 037f32bd54 | |||
| 61158bbfcf | |||
| 6a8534a0f6 | |||
| f19761ef71 | |||
| a4187efcb2 | |||
| 922921a739 | |||
| cee8a7a73b | |||
| 474c298630 | |||
| 0575001ef2 | |||
| 3ceb5fe7e4 | |||
| d00ded29a2 | |||
| 4312042e2a | |||
| d129856a4f | |||
| 5c1c601119 | |||
| a2a91cdd21 | |||
| 4940906c05 | |||
| b857a25081 | |||
| 83bed2cb04 | |||
| 079665a651 | |||
| bd38609ba1 | |||
| 5777cd4dd7 | |||
| bab48dbc50 | |||
| 6c1a840369 | |||
| 2830bab937 | |||
| eda584a0f5 | |||
| 67787dad86 | |||
| 4c6b234e13 | |||
| d095c0fc5f | |||
| cab8191379 | |||
| 586c212d93 | |||
| 8d8c38d3b4 | |||
| c9778bf3f7 | |||
| 029df230d6 | |||
| 1eb4411009 | |||
| d4e79d7a95 | |||
| 3bcdc5e371 | |||
| cfed625f4c | |||
| c6672270ea | |||
| f0161a5c45 | |||
| 2d6b18cfc9 | |||
| eb3ccaa773 | |||
| de9fbe4f82 | |||
| 0a4d227a2d | |||
| 9d374c1421 | |||
| ef8f762590 | |||
| 95c6a3d93d | |||
| c519c111ec | |||
| 717cd66082 | |||
| 4a572f5015 | |||
| 0344b08ba1 | |||
| 4bde0a0ded | |||
| c602006c04 | |||
| 7eaed897e8 | |||
| 16642a0810 | |||
| 4337554e71 | |||
| 1dc28f2540 | |||
| 43826a511a | |||
| 57707391b4 | |||
| f211c92b82 | |||
| 17abb515db | |||
| 3c81f67a62 | |||
| 221a44d1bd | |||
| 45fb564db6 | |||
| 5a4e5a3559 | |||
| 2fbdba3fe3 | |||
| c4e7fe9f02 | |||
| df466fe7b6 | |||
| 8df12f9219 | |||
| bc44b57b73 | |||
| dea73cdb01 | |||
| 621ad77911 | |||
| 29945eb0d1 | |||
| 111782a728 | |||
| 4b09b8f926 | |||
| d07d624b01 | |||
| 10ad3b6945 | |||
| 46ad21d88c | |||
| 2de350cf80 | |||
| 2ce147d84b | |||
| e05797bb60 | |||
| 774c178272 | |||
| 5f8ed93998 | |||
| 50445cdc26 | |||
| 4de0a47920 | |||
| c4c942fbab | |||
| 5d3e1f3d53 | |||
| fbfe3777b4 | |||
| 907b14ba9d | |||
| ede3d3ced7 | |||
| e59dc8a9ce | |||
| f5ed6658ec | |||
| 2abdf800d9 | |||
| 180eb62560 | |||
| e6a50b4215 | |||
| e2aa75569f | |||
| a0d1d5b41a | |||
| 80b20c444f | |||
| 15447d0398 | |||
| 51d4c30e4a | |||
| 7ab0cf1ffd | |||
| 20ff90225a | |||
| 04e63c307e | |||
| 6d6ab9b951 | |||
| 9765d32dc6 | |||
| 86b29b0edb | |||
| 4613a85c23 | |||
| f2eb32b3c9 | |||
| 93bcbc5e71 | |||
| 361cd8c42b | |||
| 6ae785af6e | |||
| a288b88bd9 | |||
| 1e797ed26b | |||
| 89dba8092d | |||
| 2195f9261e | |||
| 87a957642f | |||
| a5fd918ba7 | |||
| 7f90243337 | |||
| 11ecff91d4 | |||
| d342bab175 | |||
| 9c367350c9 | |||
| 002b2ec9df | |||
| 59e4b3df05 | |||
| 2bdbf688ab | |||
| 845774a571 | |||
| 8612355df9 | |||
| 002d093a37 | |||
| b787fc643b | |||
| 0073bfd6b3 | |||
| 09d423997e | |||
| 9a7dba6d86 | |||
| 7d2ad45443 | |||
| 1c2f665993 | |||
| 706eca1ef7 | |||
| 0d195918e3 | |||
| dc488dfc08 | |||
| 2a5ae3d1b4 | |||
| acd8d676c1 | |||
| 01f1a52525 | |||
| 46a89fa1c6 | |||
| d53284d914 | |||
| e36f3e5684 | |||
| 17ae3213cd | |||
| 111793e3a6 | |||
| f9069a18e0 | |||
| a0bb9e1665 | |||
| 92ecdf8b0b | |||
| 2c8c8257a8 | |||
| e706f5cbd4 | |||
| 37c015a7ca | |||
| 200e369d5d | |||
| a9829ab17b | |||
| b6ff220b06 | |||
| 6b2012900a | |||
| e5011c3919 | |||
| 72cf13e8e3 | |||
| 2c6158570b | |||
| 5be856cddc | |||
| cbf108f8b8 | |||
| 6e9b41d4bc | |||
| 0f17710b39 | |||
| 0308e63ef4 | |||
| 6a8f62a2ac | |||
| 05bc99e483 | |||
| d9725518d8 | |||
| 6116ea5bd7 | |||
| 9aacc4d203 | |||
| b79f6bb7ee | |||
| 651e259871 | |||
| 889ef5508e | |||
| dee47b2c55 | |||
| 39230d1672 | |||
| a5a4feb798 | |||
| 5a21746fe8 | |||
| b22f425c3e | |||
| 56684fb6da | |||
| d49c882778 | |||
| e166962d49 | |||
| a19b640ba4 | |||
| 9581e25412 | |||
| a035d397ce | |||
| 6208b57203 | |||
| 05687101ee | |||
| 9d01a63782 | |||
| 73eae21f3c | |||
| dabd5d5f09 | |||
| bcfacb1dbf | |||
| bbd1498272 | |||
| 311a25a05a | |||
| cece5458f9 | |||
| 816d98fb73 | |||
| 2192c8e148 | |||
| 2e9d460772 | |||
| 3c4b71e06a | |||
| adfb223fd4 | |||
| 38b5874b32 | |||
| 2142411c43 | |||
| b9034410a9 | |||
| a840161de9 | |||
| 3d98c4fe6e | |||
| 2b61bf2c91 | |||
| 200373f48d | |||
| 6bbbfeff81 | |||
| ba1cadb6e9 | |||
| 68f86b703b | |||
| 413f6c0010 | |||
| a3caf9e5aa | |||
| b5d6951f62 | |||
| 1c1e78bf89 | |||
| 116e770bfb | |||
| bf2aa12fd3 | |||
| afe5dd5024 | |||
| dbdd43de8d | |||
| cfcca53716 | |||
| 85828d24aa | |||
| bd812ab851 | |||
| daf319a402 | |||
| 9154b2edc9 | |||
| e69cdc2d5f | |||
| d5c6ad426c | |||
| 4650f29bb7 | |||
| 6329990417 | |||
| 1acb9398d6 | |||
| fa89345a5c | |||
| bb1f68f440 | |||
| b4ad09c0ce | |||
| 3535bd753d | |||
| b6e467acff | |||
| a838da18d7 | |||
| 40dc51dd1b | |||
| 8bc4dd7476 | |||
| 04268e1f5d | |||
| f942046a68 | |||
| 24003e0910 | |||
| 1e2c70f859 | |||
| 1f69def767 | |||
| a60ce4d483 | |||
| 4b7181dfee | |||
| f9f370cd5f | |||
| 8b1334a3d6 | |||
| 23f7cd6d36 | |||
| 3f986ecf29 | |||
| 2a55eb6ee5 | |||
| 6f0b9a6eec | |||
| 0835970d7f | |||
| d2e361331a | |||
| 52db6d0e9a | |||
| 204d1a8df5 | |||
| cad9eca293 | |||
| 612b2d8098 | |||
| efed7f2b66 | |||
| 5f6ccbff86 | |||
| 12bf36dfc0 | |||
| ab2cfba24a | |||
| c4dc675a87 | |||
| fde574046e | |||
| 8fbae2dfa7 | |||
| 48872e61fd | |||
| a215989fb3 | |||
| 11c5f32f0e | |||
| 15616a151e | |||
| fa783ea9b7 | |||
| 8066ec5c07 | |||
| e665d1dad8 | |||
| 318d33b9b1 | |||
| eda83f4580 | |||
| 23625b7a48 | |||
| af9c8731ee | |||
| ae99ef1a30 | |||
| 5b29162989 | |||
| a6eea2c977 | |||
| 9c69cb198a | |||
| 8efa7cdd67 | |||
| f6c999796f | |||
| 3f6d09e554 | |||
| 615363b332 | |||
| c2238857f4 | |||
| 602854999a | |||
| 72f1715eb0 | |||
| 2af0eff7ed | |||
| 4a241ef34e | |||
| 8c58adf552 | |||
| 6baabbe7bc | |||
| 4c5f1d54d6 |
+1
-1
@@ -197,7 +197,7 @@ then
|
||||
Origin: xCAT internal repository
|
||||
Label: xcat-dep bazaar repository
|
||||
Codename: $dist
|
||||
Architectures: amd64
|
||||
Architectures: i386 amd64
|
||||
Components: main
|
||||
Description: Repository automatically genereted conf
|
||||
|
||||
|
||||
+70
-79
@@ -91,6 +91,14 @@ local_dep_repo_path="$curdir/../../../xcat-dep/xcat-dep"
|
||||
sf_repo_url="https://sourceforge.net/projects/xcat/files/ubuntu"
|
||||
sf_dir="/home/frs/project/x/xc/xcat"
|
||||
|
||||
if [ "$PROMOTE" = 1 ]; then
|
||||
upload_dir="xcat-core"
|
||||
tar_name="xcat-core-$ver.tar.bz2"
|
||||
else
|
||||
upload_dir="core-snap"
|
||||
tar_name="core-debs-snap.tar.bz2"
|
||||
fi
|
||||
|
||||
#use flock to only one person build at the same time
|
||||
# Get a lock, so can not do 2 builds at once
|
||||
exec 8>/var/lock/xcatbld.lock
|
||||
@@ -120,81 +128,69 @@ then
|
||||
REL=`basename $t`
|
||||
fi
|
||||
|
||||
#get the version
|
||||
echo "svn --quiet update Version"
|
||||
svn --quiet up Version
|
||||
ver=`cat Version`
|
||||
if [ "$PROMOTE" != 1 ]; then
|
||||
#get the version
|
||||
echo "svn --quiet update Version"
|
||||
svn --quiet up Version
|
||||
ver=`cat Version`
|
||||
short_ver=`cat Version|cut -d. -f 1,2`
|
||||
short_short_ver=`cat Version|cut -d. -f 1`
|
||||
short_ver=`cat Version|cut -d. -f 1,2`
|
||||
short_short_ver=`cat Version|cut -d. -f 1`
|
||||
|
||||
#TODO: define the core path and tarball name
|
||||
tarball_name="core-debs-snap.tar.bz2"
|
||||
#TODO: define the core path and tarball name
|
||||
tarball_name="core-debs-snap.tar.bz2"
|
||||
|
||||
#update the code from svn
|
||||
svn_up_log="../coresvnup"
|
||||
echo "svn update > $svn_up_log"
|
||||
svn update > $svn_up_log
|
||||
#update the code from svn
|
||||
svn_up_log="../coresvnup"
|
||||
echo "svn update > $svn_up_log"
|
||||
svn update > $svn_up_log
|
||||
|
||||
#makesure the code change status
|
||||
code_change=0
|
||||
if ! grep -q 'At revision' $svn_up_log;then
|
||||
code_change=1
|
||||
fi
|
||||
#makesure the code change status
|
||||
code_change=0
|
||||
if ! grep -q 'At revision' $svn_up_log;then
|
||||
code_change=1
|
||||
fi
|
||||
|
||||
if [ $code_change == 0 -a "$UP" != 1 -a "$BUILDALL" != 1 ]; then
|
||||
echo "Nothing new detected"
|
||||
exit 0
|
||||
fi
|
||||
if [ $code_change == 0 -a "$UP" != 1 -a "$BUILDALL" != 1 ]; then
|
||||
echo "Nothing new detected"
|
||||
exit 0
|
||||
fi
|
||||
echo "###############################"
|
||||
echo "# Building xcat-core packages #"
|
||||
echo "###############################"
|
||||
|
||||
echo "###############################"
|
||||
echo "# Building xcat-core packages #"
|
||||
echo "###############################"
|
||||
|
||||
#the package type: local | snap | alpha
|
||||
#the build introduce stirng
|
||||
pkg_type="snap"
|
||||
build_string="Snap_Build"
|
||||
cur_date=`date +%Y%m%d`
|
||||
pkg_version="${short_ver}-${pkg_type}${cur_date}"
|
||||
#the package type: local | snap | alpha
|
||||
#the build introduce stirng
|
||||
pkg_type="snap"
|
||||
build_string="Snap_Build"
|
||||
cur_date=`date +%Y%m%d`
|
||||
pkg_version="${short_ver}-${pkg_type}${cur_date}"
|
||||
|
||||
if [ ! -d ../../debs ];then
|
||||
mkdir -p "../../debs"
|
||||
fi
|
||||
packages="xCAT-client xCAT-genesis-scripts perl-xCAT xCAT-server xCAT-UI xCAT xCATsn xCAT-test xCAT-OpenStack"
|
||||
if [ ! -d ../../debs ];then
|
||||
mkdir -p "../../debs"
|
||||
fi
|
||||
packages="xCAT-client xCAT-genesis-scripts perl-xCAT xCAT-server xCAT-UI xCAT xCATsn xCAT-test"
|
||||
|
||||
for file in `echo $packages`
|
||||
do
|
||||
file_low=`echo $file | tr '[A-Z]' '[a-z]'`
|
||||
if grep -q $file $svn_up_log || [ "$BUILDALL" == 1 -o "$file" = "perl-xCAT" ]; then
|
||||
rm -f ../../debs/${file_low}_*.deb
|
||||
#only for genesis package
|
||||
rm -f ../../debs/${file_low}-amd64_*.deb
|
||||
cd $file
|
||||
dch -v $pkg_version -b -c debian/changelog $build_string
|
||||
dpkg-buildpackage -uc -us
|
||||
rc=$?
|
||||
if [ $rc -gt 0 ]; then
|
||||
echo "Error: $file build package failed exit code $rc"
|
||||
fi
|
||||
cd -
|
||||
find $file -maxdepth 3 -type d -name "${file_low}*" | grep debian | xargs rm -rf
|
||||
find $file -maxdepth 3 -type f -name "files" | grep debian | xargs rm -rf
|
||||
mv ${file_low}* ../../debs/
|
||||
for file in `echo $packages`
|
||||
do
|
||||
file_low=`echo $file | tr '[A-Z]' '[a-z]'`
|
||||
if grep -q $file $svn_up_log || [ "$BUILDALL" == 1 ]; then
|
||||
rm -f ../../debs/${file_low}_*.deb
|
||||
#only for genesis package
|
||||
rm -f ../../debs/${file_low}-amd64_*.deb
|
||||
cd $file
|
||||
dch -v $pkg_version -b -c debian/changelog $build_string
|
||||
dpkg-buildpackage -uc -us
|
||||
rc=$?
|
||||
if [ $rc -gt 0 ]; then
|
||||
echo "Error: $file build package failed exit code $rc"
|
||||
fi
|
||||
done
|
||||
cd -
|
||||
find $file -maxdepth 3 -type d -name "${file_low}*" | grep debian | xargs rm -rf
|
||||
find $file -maxdepth 3 -type f -name "files" | grep debian | xargs rm -rf
|
||||
mv ${file_low}* ../../debs/
|
||||
fi
|
||||
done
|
||||
|
||||
find ../../debs/* ! -name *.deb | xargs rm -f
|
||||
fi
|
||||
|
||||
if [ "$PROMOTE" = 1 ]; then
|
||||
upload_dir="xcat-core"
|
||||
tar_name="xcat-core-$ver.tar.bz2"
|
||||
else
|
||||
upload_dir="core-snap"
|
||||
tar_name="core-debs-snap.tar.bz2"
|
||||
fi
|
||||
find ../../debs/* ! -name *.deb | xargs rm -f
|
||||
|
||||
echo "#################################"
|
||||
echo "# Creating xcat-core repository #"
|
||||
@@ -213,7 +209,7 @@ then
|
||||
Origin: xCAT internal repository
|
||||
Label: xcat-core bazaar repository
|
||||
Codename: $dist
|
||||
Architectures: amd64
|
||||
Architectures: amd64 i386
|
||||
Components: main
|
||||
Description: Repository automatically genereted conf
|
||||
SignWith: yes
|
||||
@@ -251,12 +247,12 @@ __EOF__
|
||||
groupadd xcat
|
||||
fi
|
||||
|
||||
chgrp -R root xcat-core
|
||||
chgrp -R xcat xcat-core
|
||||
chmod -R g+w xcat-core
|
||||
|
||||
#build the tar ball
|
||||
tar -hjcf $tar_name xcat-core
|
||||
chgrp root $tar_name
|
||||
chgrp xcat $tar_name
|
||||
chmod g+w $tar_name
|
||||
|
||||
if [ ! -e core-snap ]; then
|
||||
@@ -264,7 +260,7 @@ __EOF__
|
||||
fi
|
||||
|
||||
# Decide whether to upload or not
|
||||
if [ -n "$UP" ] && [ "$UP" == 0 ]; then
|
||||
if [ "$UP" != 1 ]; then
|
||||
echo "No need to upload"
|
||||
cd $old_pwd
|
||||
exit 0
|
||||
@@ -279,13 +275,8 @@ __EOF__
|
||||
fi
|
||||
|
||||
#upload the tar ball
|
||||
#for the GA build, upload to https://sourceforge.net/projects/xcat/files/xcat/<version>.x_Ubuntu/
|
||||
#for other scenario, upload to https://sourceforge.net/projects/xcat/files/ubuntu/<version>
|
||||
if [ "$PROMOTE" = 1 -a "$REL" != "devel" -a "$PREGA" != 1 ]; then
|
||||
i=0
|
||||
echo "Uploading $tar_name to ${sf_dir}/xcat/${REL}.x_Ubuntu/ ..."
|
||||
while [ $((i+=1)) -le 5 ] && ! rsync -v $tar_name ${uploader},xcat@web.sourceforge.net:${sf_dir}/xcat/${REL}.x_Ubuntu/
|
||||
do : ; done
|
||||
echo "";
|
||||
else
|
||||
i=0
|
||||
echo "Uploading $tar_name to ${sf_dir}/ubuntu/${REL}/ ..."
|
||||
@@ -316,7 +307,7 @@ then
|
||||
Origin: xCAT internal repository
|
||||
Label: xcat-dep bazaar repository
|
||||
Codename: $dist
|
||||
Architectures: amd64
|
||||
Architectures: i386 amd64
|
||||
Components: main
|
||||
Description: Repository automatically genereted conf
|
||||
SignWith: yes
|
||||
@@ -351,16 +342,16 @@ __EOF__
|
||||
groupadd xcat
|
||||
fi
|
||||
|
||||
chgrp -R root xcat-dep
|
||||
chgrp -R xcat xcat-dep
|
||||
chmod -R g+w xcat-dep
|
||||
|
||||
#create the tar ball
|
||||
dep_tar_name=xcat-dep-ubuntu.tar.bz
|
||||
tar -hjcf $dep_tar_name xcat-dep
|
||||
chgrp root $dep_tar_name
|
||||
chgrp xcat $dep_tar_name
|
||||
chmod g+w $dep_tar_name
|
||||
|
||||
if [ -n "$UP" ] && [ "$UP" == 0 ];then
|
||||
if [ "$UP" != 1 ];then
|
||||
echo "No need to upload the dep packages"
|
||||
cd $old_pwd
|
||||
exit 0
|
||||
|
||||
+62
-101
@@ -19,7 +19,6 @@
|
||||
# directories that are needed.
|
||||
|
||||
# Usage: buildcore.sh [attr=value attr=value ...]
|
||||
# Before running buildcore.sh, you must change the local git repo to the branch you want built, using: git checkout <branch>
|
||||
# PROMOTE=1 - if the attribute "PROMOTE" is specified, means an official dot release. This does not
|
||||
# actually build xcat, just uploads the most recent snap build to https://sourceforge.net/projects/xcat/files/xcat/ .
|
||||
# If not specified, a snap build is assumed, which uploads to https://sourceforge.net/projects/xcat/files/yum/
|
||||
@@ -32,7 +31,7 @@
|
||||
# BUILDALL=1 - build all rpms, whether they changed or not. Should be used for snap builds that are in prep for a release.
|
||||
# UP=0 or UP=1 - override the default upload behavior
|
||||
# SVNUP=<filename> - control which rpms get built by specifying a coresvnup file
|
||||
# GITUP=<filename> - control which rpms get built by specifying a coregitup file
|
||||
# FRSYUM=0 - put the yum repo and snap builds in the old project web area instead of the FRS area.
|
||||
# EMBED=<embedded-environment> - the environment for which a minimal version of xcat should be built, e.g. zvm or flex
|
||||
# VERBOSE=1 - to see lots of verbose output
|
||||
|
||||
@@ -41,7 +40,7 @@ UPLOADUSER=bp-sawyers
|
||||
FRS=/home/frs/project/x/xc/xcat
|
||||
|
||||
# These are the rpms that should be built for each kind of xcat build
|
||||
ALLBUILD="perl-xCAT xCAT-client xCAT-server xCAT-IBMhpc xCAT-rmc xCAT-UI xCAT-test xCAT-buildkit xCAT xCATsn xCAT-genesis-scripts xCAT-OpenStack"
|
||||
ALLBUILD="perl-xCAT xCAT-client xCAT-server xCAT-IBMhpc xCAT-rmc xCAT-UI xCAT-test xCAT-buildkit xCAT xCATsn xCAT-genesis-scripts"
|
||||
ZVMBUILD="perl-xCAT xCAT-server xCAT-UI"
|
||||
ZVMLINK="xCAT-client xCAT xCATsn"
|
||||
PCMBUILD="xCAT"
|
||||
@@ -85,24 +84,15 @@ if [ "$OSNAME" != "AIX" ]; then
|
||||
export HOME=/root # This is so rpm and gpg will know home, even in sudo
|
||||
fi
|
||||
|
||||
# for the git case, query the current branch and set REL (changing master to devel if necessary)
|
||||
function setbranch {
|
||||
#git checkout $BRANCH
|
||||
#REL=`git rev-parse --abbrev-ref HEAD`
|
||||
REL=`git name-rev --name-only HEAD`
|
||||
if [ "$REL" = "master" ]; then
|
||||
REL="devel"
|
||||
fi
|
||||
}
|
||||
|
||||
if [ "$REL" = "xcat-core" ]; then # using git
|
||||
GIT=1
|
||||
setbranch # this changes the REL variable
|
||||
# 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
|
||||
|
||||
YUMDIR=$FRS
|
||||
YUMREPOURL="https://sourceforge.net/projects/xcat/files/yum"
|
||||
|
||||
# Set variables based on which type of build we are doing
|
||||
if [ -n "$EMBED" ]; then
|
||||
EMBEDDIR="/$EMBED"
|
||||
@@ -126,38 +116,38 @@ else
|
||||
fi
|
||||
|
||||
XCATCORE="xcat-core" # core-snap is a sym link to xcat-core
|
||||
|
||||
if [ "$GIT" = "1" ]; then # using git - need to include REL in the path where we put the built rpms
|
||||
DESTDIR=../../$REL$EMBEDDIR/$XCATCORE
|
||||
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`
|
||||
if [ "$PROMOTE" = 1 ]; then
|
||||
CORE="xcat-core"
|
||||
if [ "$OSNAME" = "AIX" ]; then
|
||||
TARNAME=core-aix-$VER.tar.gz
|
||||
else
|
||||
TARNAME=xcat-core-$VER.tar.bz2
|
||||
fi
|
||||
else
|
||||
DESTDIR=../..$EMBEDDIR/$XCATCORE
|
||||
CORE="core-snap"
|
||||
if [ "$OSNAME" = "AIX" ]; then
|
||||
TARNAME=core-aix-snap.tar.gz
|
||||
else
|
||||
TARNAME=core-rpms-snap.tar.bz2
|
||||
fi
|
||||
fi
|
||||
DESTDIR=../..$EMBEDDIR/$XCATCORE
|
||||
SRCD=core-snap-srpms
|
||||
|
||||
# currently aix builds ppc rpms, but someday it should build noarch
|
||||
if [ "$OSNAME" = "AIX" ]; then
|
||||
NOARCH=ppc
|
||||
SYSGRP=system
|
||||
else
|
||||
NOARCH=noarch
|
||||
SYSGRP=root
|
||||
fi
|
||||
|
||||
function setversionvars {
|
||||
VER=`cat Version`
|
||||
SHORTVER=`cat Version|cut -d. -f 1,2`
|
||||
SHORTSHORTVER=`cat Version|cut -d. -f 1`
|
||||
}
|
||||
|
||||
|
||||
if [ "$PROMOTE" != 1 ]; then # very long if statement to not do builds if we are promoting
|
||||
# we are doing a snap build
|
||||
CORE="core-snap"
|
||||
if [ "$OSNAME" = "AIX" ]; then
|
||||
TARNAME=core-aix-snap.tar.gz
|
||||
else
|
||||
TARNAME=core-rpms-snap.tar.bz2
|
||||
fi
|
||||
mkdir -p $DESTDIR
|
||||
SRCDIR=$DESTDIR/../$SRCD
|
||||
mkdir -p $SRCDIR
|
||||
@@ -178,37 +168,16 @@ else
|
||||
#echo "source=$source"
|
||||
fi
|
||||
|
||||
# If they have not given us a premade update file, do an svn update or git pull and capture the results
|
||||
SOMETHINGCHANGED=0
|
||||
if [ "$GIT" = "1" ]; then # using git
|
||||
if [ -z "$GITUP" ]; then
|
||||
GITUP=../coregitup
|
||||
echo "git pull > $GITUP"
|
||||
git pull > $GITUP
|
||||
if [[ $? != 0 ]]; then
|
||||
# do not continue so we do not build with old files
|
||||
echo "The 'git pull' command failed. Exiting the build."
|
||||
exit 3
|
||||
fi
|
||||
fi
|
||||
if ! $GREP 'Already up-to-date' $GITUP; then
|
||||
SOMETHINGCHANGED=1
|
||||
fi
|
||||
else # using svn
|
||||
GIT=0
|
||||
if [ -z "$SVNUP" ]; then
|
||||
SVNUP=../coresvnup
|
||||
echo "svn up > $SVNUP"
|
||||
svn up > $SVNUP
|
||||
fi
|
||||
if ! $GREP 'At revision' $SVNUP; then
|
||||
SOMETHINGCHANGED=1
|
||||
fi
|
||||
# copy the SVNUP variable to GITUP so the rest of the script doesnt have to worry whether we did svn or git
|
||||
GITUP=$SVNUP
|
||||
# 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
|
||||
SOMETHINGCHANGED=0
|
||||
if ! $GREP 'At revision' $SVNUP; then
|
||||
SOMETHINGCHANGED=1
|
||||
fi
|
||||
|
||||
setversionvars
|
||||
|
||||
# Function for making the noarch rpms
|
||||
function maker {
|
||||
@@ -225,7 +194,7 @@ function maker {
|
||||
}
|
||||
|
||||
# If anything has changed, we should always rebuild perl-xCAT
|
||||
if [ $SOMETHINGCHANGED == 1 -o "$BUILDALL" == 1 ]; then # Use to be: $GREP perl-xCAT $GITUP; then
|
||||
if [ $SOMETHINGCHANGED == 1 -o "$BUILDALL" == 1 ]; then # Use to be: $GREP perl-xCAT $SVNUP; then
|
||||
if [[ " $EMBEDBUILD " = *\ perl-xCAT\ * ]]; then
|
||||
UPLOAD=1
|
||||
maker perl-xCAT
|
||||
@@ -241,7 +210,7 @@ for rpmname in xCAT-client xCAT-server xCAT-IBMhpc xCAT-rmc xCAT-UI xCAT-test xC
|
||||
#if [ "$EMBED" = "zvm" -a "$rpmname" != "xCAT-server" -a "$rpmname" != "xCAT-UI" ]; then continue; fi # for zvm embedded env only need to build server and UI
|
||||
if [[ " $EMBEDBUILD " != *\ $rpmname\ * ]]; then continue; fi
|
||||
if [ "$OSNAME" = "AIX" -a "$rpmname" = "xCAT-buildkit" ]; then continue; fi # do not build xCAT-buildkit on aix
|
||||
if $GREP $rpmname $GITUP || [ "$BUILDALL" == 1 ]; then
|
||||
if $GREP $rpmname $SVNUP || [ "$BUILDALL" == 1 ]; then
|
||||
UPLOAD=1
|
||||
maker $rpmname
|
||||
fi
|
||||
@@ -256,7 +225,7 @@ done
|
||||
# The mknb cmd combines them at install time.
|
||||
if [ "$OSNAME" != "AIX" ]; then
|
||||
if [[ " $EMBEDBUILD " = *\ xCAT-genesis-scripts\ * ]]; then
|
||||
if $GREP xCAT-genesis-scripts $GITUP || [ "$BUILDALL" == 1 ]; then
|
||||
if $GREP xCAT-genesis-scripts $SVNUP || [ "$BUILDALL" == 1 ]; then
|
||||
UPLOAD=1
|
||||
ORIGFAILEDRPMS="$FAILEDRPMS"
|
||||
./makerpm xCAT-genesis-scripts x86_64 "$EMBED"
|
||||
@@ -272,19 +241,17 @@ if [ "$OSNAME" != "AIX" ]; then
|
||||
fi
|
||||
|
||||
# Build the xCAT and xCATsn rpms for all platforms
|
||||
for rpmname in xCAT xCATsn xCAT-OpenStack; do
|
||||
for rpmname in xCAT xCATsn; do
|
||||
#if [ "$EMBED" = "zvm" ]; then break; fi
|
||||
if [[ " $EMBEDBUILD " != *\ $rpmname\ * ]]; then continue; fi
|
||||
if [ $SOMETHINGCHANGED == 1 -o "$BUILDALL" == 1 ]; then # used to be: if $GREP -E "^[UAD] +$rpmname/" $GITUP; then
|
||||
if [ $SOMETHINGCHANGED == 1 -o "$BUILDALL" == 1 ]; then # used to be: if $GREP -E "^[UAD] +$rpmname/" $SVNUP; then
|
||||
UPLOAD=1
|
||||
ORIGFAILEDRPMS="$FAILEDRPMS"
|
||||
if [ "$OSNAME" = "AIX" ]; then
|
||||
if [ "$rpmname" = "xCAT-OpenStack" ]; then continue; fi # do not bld openstack on aix
|
||||
./makerpm $rpmname "$EMBED"
|
||||
if [ $? -ne 0 ]; then FAILEDRPMS="$FAILEDRPMS $rpmname"; fi
|
||||
else
|
||||
for arch in x86_64 ppc64 s390x; do
|
||||
if [ "$rpmname" = "xCAT-OpenStack" -a "$arch" != "x86_64" ]; then continue; fi # only bld openstack for x86_64 for now
|
||||
for arch in x86_64 i386 ppc64 s390x; do
|
||||
./makerpm $rpmname $arch "$EMBED"
|
||||
if [ $? -ne 0 ]; then FAILEDRPMS="$FAILEDRPMS $rpmname-$arch"; fi
|
||||
done
|
||||
@@ -355,10 +322,10 @@ if [ "$OSNAME" != "AIX" ]; then
|
||||
echo '%_gpg_name Jarrod Johnson' >> $MACROS
|
||||
fi
|
||||
echo "Signing RPMs..."
|
||||
build-utils/rpmsign.exp `find $DESTDIR -type f -name '*.rpm'` | grep -v -E '(already contains identical signature|was already signed|rpm --quiet --resign|WARNING: standard input reopened)'
|
||||
build-utils/rpmsign.exp $SRCDIR/*rpm | grep -v -E '(already contains identical signature|was already signed|rpm --quiet --resign|WARNING: standard input reopened)'
|
||||
createrepo --checksum sha $DESTDIR # specifying checksum so the repo will work on rhel5
|
||||
createrepo --checksum sha $SRCDIR
|
||||
build-utils/rpmsign.exp `find $DESTDIR -type f -name '*.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
|
||||
rm -f $DESTDIR/repodata/repomd.xml.asc
|
||||
gpg -a --detach-sign $DESTDIR/repodata/repomd.xml
|
||||
@@ -371,26 +338,23 @@ if [ "$OSNAME" != "AIX" ]; then
|
||||
fi
|
||||
fi
|
||||
|
||||
# set group and permissions correctly on the built rpms
|
||||
# make everything have a group of xcat, so anyone can manage them once they get on SF
|
||||
if [ "$OSNAME" = "AIX" ]; then
|
||||
if ! lsgroup xcat >/dev/null 2>&1; then
|
||||
mkgroup xcat
|
||||
fi
|
||||
chmod +x $DESTDIR/instxcat
|
||||
fi
|
||||
chgrp -R $SYSGRP $DESTDIR
|
||||
chmod -R g+w $DESTDIR
|
||||
chgrp -R $SYSGRP $SRCDIR
|
||||
chmod -R g+w $SRCDIR
|
||||
|
||||
else # end of very long if-not-promote
|
||||
# we are only promoting (not building)
|
||||
setversionvars
|
||||
setbranch
|
||||
CORE="xcat-core"
|
||||
if [ "$OSNAME" = "AIX" ]; then
|
||||
TARNAME=core-aix-$VER.tar.gz
|
||||
else
|
||||
TARNAME=xcat-core-$VER.tar.bz2
|
||||
else # linux
|
||||
if ! $GREP xcat /etc/group; then
|
||||
groupadd xcat
|
||||
fi
|
||||
fi
|
||||
chgrp -R xcat $DESTDIR
|
||||
chmod -R g+w $DESTDIR
|
||||
chgrp -R xcat $SRCDIR
|
||||
chmod -R g+w $SRCDIR
|
||||
|
||||
fi # end of very long if-not-promote
|
||||
|
||||
cd $DESTDIR
|
||||
|
||||
@@ -430,17 +394,14 @@ else
|
||||
verboseflag=""
|
||||
fi
|
||||
echo "Creating $TARNAME ..."
|
||||
if [[ -e $TARNAME ]]; then
|
||||
mkdir -p previous
|
||||
mv -f $TARNAME previous
|
||||
fi
|
||||
if [ "$OSNAME" = "AIX" ]; then
|
||||
tar $verboseflag -hcf ${TARNAME%.gz} $XCATCORE
|
||||
rm -f $TARNAME
|
||||
gzip ${TARNAME%.gz}
|
||||
else
|
||||
tar $verboseflag -hjcf $TARNAME $XCATCORE
|
||||
fi
|
||||
chgrp $SYSGRP $TARNAME
|
||||
chgrp xcat $TARNAME
|
||||
chmod g+w $TARNAME
|
||||
|
||||
# Decide whether to upload or not
|
||||
|
||||
+12
-14
@@ -97,15 +97,15 @@ if [ "$OSNAME" != "AIX" ]; then
|
||||
|
||||
# Sign the rpms that are not already signed. The "standard input reopened" warnings are normal.
|
||||
echo "Signing RPMs..."
|
||||
$XCATCOREDIR/build-utils/rpmsign.exp `find . -type f -name '*.rpm'` | grep -v -E '(already contains identical signature|was already signed|rpm --quiet --resign|WARNING: standard input reopened)'
|
||||
$XCATCOREDIR/build-utils/rpmsign.exp `find . -type f -name '*.rpm'` | grep -v -E '(was already signed|rpm --quiet --resign|WARNING: standard input reopened)'
|
||||
|
||||
# Create the repodata dirs
|
||||
echo "Creating repodata directories..."
|
||||
for i in `find -mindepth 2 -maxdepth 2 -type d `; do
|
||||
if [ -n "$VERBOSEMODE" ]; then
|
||||
createrepo --checksum sha $i # specifying checksum so the repo will work on rhel5
|
||||
createrepo $i
|
||||
else
|
||||
createrepo --checksum sha $i >/dev/null
|
||||
createrepo $i >/dev/null
|
||||
fi
|
||||
rm -f $i/repodata/repomd.xml.asc
|
||||
gpg -a --detach-sign $i/repodata/repomd.xml
|
||||
@@ -149,13 +149,6 @@ cd $OSVER
|
||||
# The only interdependency between the dep rpms so far is that net-snmp requires bash, and
|
||||
# pyodbc requires unixODBC. (The bash dependency is taken care of automatically because it
|
||||
# comes earlier in the alphabet.)
|
||||
|
||||
# first run /usr/sbin/updtvpkg to make sure any installp software is
|
||||
# registered with RPM.
|
||||
echo "Running updtvpkg. This could take a few minutes."
|
||||
/usr/sbin/updtvpkg
|
||||
echo "updtvpkg has completed."
|
||||
|
||||
rpm -Uvh unixODBC*
|
||||
for i in `ls *.rpm|grep -v -E '^tcl-|^tk-|^expect-|^unixODBC-|^xCAT-UI-deps|^perl-DBD-DB2Lite'`; do
|
||||
if [ "$i" == "perl-Net-DNS-0.66-1.aix5.3.ppc.rpm" ]; then
|
||||
@@ -190,13 +183,18 @@ EOF
|
||||
chmod +x instoss
|
||||
fi
|
||||
|
||||
# Get the permissions and group correct
|
||||
# Get the permissions correct. Have to have all dirs/files with a group of xcat
|
||||
# and have them writeable by group, so any member of the xcat can build.
|
||||
if [ "$OSNAME" == "AIX" ]; then
|
||||
SYSGRP=system
|
||||
if ! lsgroup xcat >/dev/null 2>&1; then
|
||||
mkgroup xcat
|
||||
fi
|
||||
else
|
||||
SYSGRP=root
|
||||
if ! $GREP xcat /etc/group; then
|
||||
groupadd xcat
|
||||
fi
|
||||
fi
|
||||
chgrp -R $SYSGRP *
|
||||
chgrp -R xcat *
|
||||
chmod -R g+w *
|
||||
|
||||
# Build the tarball
|
||||
|
||||
@@ -32,7 +32,7 @@ function makenoarch {
|
||||
|
||||
|
||||
|
||||
# Make one of the following rpms: xCAT, xCATsn, xCAT-buildkit, xCAT-OpenStack
|
||||
# Make one of the following rpms: xCAT, xCATsn, xCAT-buildkit
|
||||
function makexcat {
|
||||
if [ "$OSNAME" != "AIX" -a "$1" != "xCAT-buildkit" -a -z "$2" ]; then
|
||||
echo 'Usage: makerpm <RPMname> <arch> [<embedded-system>]'
|
||||
@@ -88,8 +88,6 @@ function makexcat {
|
||||
ARCH="noarch"
|
||||
TARGET=""
|
||||
tar --exclude .svn --exclude xCAT-buildkit.spec -czf $RPMROOT/SOURCES/$RPMNAME-$VER.tar.gz $RPMNAME
|
||||
elif [ "$RPMNAME" = "xCAT-OpenStack" ]; then
|
||||
tar --exclude .svn --exclude xCAT-OpenStack.spec -czf $RPMROOT/SOURCES/$RPMNAME-$VER.tar.gz $RPMNAME
|
||||
else # do not recognize rpm
|
||||
echo "Unrecognized rpm: $RPMNAME"
|
||||
exit 2
|
||||
@@ -203,7 +201,7 @@ else # linux
|
||||
fi
|
||||
|
||||
|
||||
if [ "$1" = "xCAT" -o "$1" = "xCATsn" -o "$1" = "xCAT-buildkit" -o "$1" = "xCAT-OpenStack" ]; then
|
||||
if [ "$1" = "xCAT" -o "$1" = "xCATsn" -o "$1" = "xCAT-buildkit" ]; then
|
||||
exportEmbed $3
|
||||
makexcat $1 $2
|
||||
elif [ "$1" = "xCAT-nbroot" -o "$1" = "xCAT-nbroot-core" ]; then
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
Source: perl-xcat
|
||||
Section: libs
|
||||
Priority: extra
|
||||
Maintainer: xCAT <xcat-user@lists.sourceforge.net>
|
||||
Maintainer: Arif Ali <aali@ocf.co.uk>
|
||||
Build-Depends: debhelper (>= 5), libsoap-lite-perl, libdbi-perl
|
||||
Standards-Version: 3.7.2
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@ export DH_COMPAT=5
|
||||
|
||||
build:
|
||||
dh_testdir
|
||||
./modifyUtils `cat ../Version` `svn info | grep Revision | cut -d" " -f 2`
|
||||
./db2man
|
||||
|
||||
clean:
|
||||
@@ -48,7 +49,6 @@ binary-arch: build install
|
||||
chmod 644 `pwd`/debian/perl-xcat/opt/xcat/share/doc/man5/*
|
||||
chmod 644 `pwd`/debian/perl-xcat/opt/xcat/share/man/man7/*
|
||||
chmod 644 `pwd`/debian/perl-xcat/opt/xcat/share/doc/man7/*
|
||||
./modifyUtils `cat ../Version` `svn info | grep Revision | cut -d" " -f 2`
|
||||
# dh_installmenu
|
||||
# dh_installdebconf
|
||||
# dh_installlogrotate
|
||||
|
||||
+18
-10
@@ -1,26 +1,34 @@
|
||||
#!/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 "modifyUtils: Error: must specify the xCAT version as an argument" >&2
|
||||
echo "modifyUtils: Error: must specify the xCAT version and svn revision number as arguments" >&2
|
||||
exit
|
||||
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 ". '(built $BUILDDATE)'"
|
||||
#echo ". '(${SVNREF}built $BUILDDATE)'"
|
||||
|
||||
if [ "$(uname)" = "AIX" ]
|
||||
then
|
||||
sed -e s/"#XCATVERSIONSUBHERE"/". '$VER'"/ -e s/"#XCATSVNBUILDSUBHERE"/". ' (built $BUILDDATE)'"/ xCAT/Version.pm >xCAT/Version.pm.new
|
||||
sed -e s/"#XCATVERSIONSUBHERE"/". '$VER'"/ -e s/"#XCATSVNBUILDSUBHERE"/". ' (${SVNREF}built $BUILDDATE)'"/ xCAT/Version.pm >xCAT/Version.pm.new
|
||||
mv xCAT/Version.pm.new xCAT/Version.pm
|
||||
else
|
||||
if [ -f "/etc/debian_version" ];then
|
||||
FILENAME="debian/perl-xcat/opt/xcat/lib/perl/xCAT/Version.pm"
|
||||
else
|
||||
FILENAME="xCAT/Version.pm"
|
||||
fi
|
||||
sed -i -e s/"#XCATVERSIONSUBHERE"/". '$VER'"/ -e s/"#XCATSVNBUILDSUBHERE"/". ' (built $BUILDDATE)'"/ $FILENAME
|
||||
sed -i -e s/"#XCATVERSIONSUBHERE"/". '$VER'"/ -e s/"#XCATSVNBUILDSUBHERE"/". ' (${SVNREF}built $BUILDDATE)'"/ xCAT/Version.pm
|
||||
fi
|
||||
|
||||
@@ -25,6 +25,7 @@ Includes xCAT::Table, xCAT::NodeRange, among others.
|
||||
|
||||
%define zvm %(if [ "$zvm" = "1" ];then echo 1; else echo 0; fi)
|
||||
%define fsm %(if [ "$fsm" = "1" ];then echo 1; else echo 0; fi)
|
||||
%define svninfo %(svn info | grep Revision | awk '{print $2}')
|
||||
|
||||
%prep
|
||||
%setup -q -n perl-xCAT
|
||||
@@ -36,7 +37,7 @@ Includes xCAT::Table, xCAT::NodeRange, among others.
|
||||
%if %fsm
|
||||
%else
|
||||
# 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.
|
||||
|
||||
+18
-13
@@ -191,12 +191,7 @@ sub updateUserInfo {
|
||||
{
|
||||
for my $record (@diff)
|
||||
{
|
||||
# skip to add ROOT relative records into MERGE file
|
||||
if ($record =~ /^root/)
|
||||
{
|
||||
next;
|
||||
}
|
||||
print $fp "$record\n";
|
||||
print $fp "$record\n";
|
||||
}
|
||||
}
|
||||
close ($fp);
|
||||
@@ -235,13 +230,24 @@ sub setCFMSynclistFile {
|
||||
# get the cfmdir and synclists attributes
|
||||
my $osimage_t = xCAT::Table->new('osimage');
|
||||
my $records = $osimage_t->getAttribs({imagename=>$img}, 'cfmdir', 'synclists');
|
||||
if (defined ($records->{'cfmdir'}))
|
||||
if ($records)
|
||||
{
|
||||
$cfmdir = $records->{'cfmdir'};
|
||||
if (defined ($records->{'synclists'})) {$synclists = $records->{'synclists'}}
|
||||
if ($records->{'cfmdir'}) {$cfmdir = $records->{'cfmdir'}}
|
||||
if ($records->{'synclists'}) {$synclists = $records->{'synclists'}}
|
||||
} else {
|
||||
# no cfmdir defined, return directly
|
||||
return 0;
|
||||
if ($::VERBOSE)
|
||||
{
|
||||
my $rsp = {};
|
||||
$rsp->{data}->[0] = "There are no records for cfmdir and synclists attribute in the osimage:$img. There is nothing to process.";
|
||||
xCAT::MsgUtils->message("I", $rsp, $::CALLBACK);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
# no cfmdir defined, return directly
|
||||
if (!$cfmdir)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
my $found = 0;
|
||||
@@ -363,8 +369,7 @@ sub updateCFMSynclistFile {
|
||||
|
||||
# recursively list the files under cfm directory
|
||||
my @files = ();
|
||||
|
||||
find ( { wanted => sub { push @files, $File::Find::name if -f }, follow => 1 }, $cfmdir);
|
||||
find ( sub { push @files, $File::Find::name if (! -d) }, $cfmdir);
|
||||
if (!@files) # not files under cfm directory, skip to next loop
|
||||
{
|
||||
next;
|
||||
|
||||
@@ -179,28 +179,11 @@ if (ref($request) eq 'HASH') { # the request is an array, not pure XML
|
||||
if ($ENV{XCATHOST}) {
|
||||
$xcathost=$ENV{XCATHOST};
|
||||
}
|
||||
my %connargs=();
|
||||
if ($xcathost =~ s/%([^\]|:]*)//) {
|
||||
$connargs{PeerScope} = $1;
|
||||
}
|
||||
$connargs{PeerAddr} = $xcathost;
|
||||
$connargs{Timeout} = 15;
|
||||
if ($connargs{PeerScope} and $connargs{PeerScope} =~ /[a-zA-Z]/) { #non-numeric, need to translate...
|
||||
my @ipdata = `ip link`;
|
||||
@ipdata = grep(/[^@]$connargs{PeerScope}(:|@)/,@ipdata);
|
||||
if (scalar(@ipdata) != 1) {
|
||||
print STDERR "Unable to identify scope ".$connargs{PeerScope}."\n";
|
||||
exit(1);
|
||||
}
|
||||
$connargs{PeerScope} = $ipdata[0];
|
||||
$connargs{PeerScope} =~ s/:.*//;
|
||||
}
|
||||
|
||||
|
||||
my $pclient;
|
||||
if ($inet6support) {
|
||||
$pclient = IO::Socket::INET6->new(
|
||||
%connargs,
|
||||
PeerAddr => $xcathost,
|
||||
Timeout => 15,
|
||||
);
|
||||
} else {
|
||||
$pclient = IO::Socket::INET->new(
|
||||
@@ -302,7 +285,6 @@ if (ref($request) eq 'HASH') { # the request is an array, not pure XML
|
||||
$massresponse="";
|
||||
unless ($cleanexit) {
|
||||
print STDERR "ERROR/WARNING: communication with the xCAT server seems to have been ended prematurely\n";
|
||||
$xCAT::Client::EXITCODE = 1;
|
||||
}
|
||||
|
||||
sub validateXML {
|
||||
@@ -615,10 +597,7 @@ sub plugin_command {
|
||||
no strict "refs";
|
||||
# eval { #REMOVEEVALFORDEBUG
|
||||
# if ($dispatch_requests) {
|
||||
# backup the original req and recover it after the a run
|
||||
my $org_req = {%$req};
|
||||
dispatch_request($req,$callback,$modname);
|
||||
$req = {%$org_req};
|
||||
dispatch_request($req,$callback,$modname);
|
||||
# } else {
|
||||
# $SIG{CHLD}='DEFAULT';
|
||||
# ${"xCAT_plugin::".$modname."::"}{process_request}->($req,$callback,\&do_request);
|
||||
|
||||
@@ -57,7 +57,7 @@ sub getObjectsOfType
|
||||
|
||||
# The database may be changed between getObjectsOfType calls
|
||||
# do not use cache %::saveObjList if --nocache is specified
|
||||
if ($::saveObjList{$type} && !$::opt_nc)
|
||||
if ($::saveObjList{$type} && !$::opt_c)
|
||||
{
|
||||
@objlist = @{$::saveObjList{$type}};
|
||||
}
|
||||
@@ -200,8 +200,7 @@ sub getobjattrs
|
||||
# list of object names
|
||||
foreach my $table (keys %tableattrs) {
|
||||
# open the table
|
||||
# with autocommit => 0, it does not work on Ubuntu running mysql
|
||||
my $thistable = xCAT::Table->new($table, -create => 1, -autocommit => 1);
|
||||
my $thistable = xCAT::Table->new($table, -create => 1, -autocommit => 0);
|
||||
if (!$thistable) {
|
||||
my $rsp;
|
||||
$rsp->{data}->[0] = "Could not open the \'$table\' table.";
|
||||
@@ -607,7 +606,7 @@ sub getDBtable
|
||||
|
||||
# save this table info - in case this subr gets called multiple times
|
||||
# --nocache flag specifies not to use cahe
|
||||
if (grep(/^$table$/, @::foundTableList) && !$::opt_nc)
|
||||
if (grep(/^$table$/, @::foundTableList) && !$::opt_c)
|
||||
{
|
||||
|
||||
# already have this
|
||||
@@ -1680,14 +1679,7 @@ sub readFileInput
|
||||
|
||||
$look_for_colon = 0; # ok - we have a colon
|
||||
|
||||
# Remove any trailing whitespace
|
||||
$l =~ s/\s*$//;
|
||||
|
||||
# IPv6 network names could be something like fd59::/64
|
||||
# Use all the characters before the last ":" as the object name
|
||||
# .* means greedy regular expression
|
||||
$l =~ /^(.*):(.*?)$/;
|
||||
($objectname, $junk2) = ($1, $2);
|
||||
($objectname, $junk2) = split(/:/, $l);
|
||||
|
||||
# if $junk2 is defined or there's an =
|
||||
if ($junk2 || grep(/=/, $objectname))
|
||||
|
||||
+66
-116
@@ -1019,18 +1019,11 @@ sub fork_fanout_dsh
|
||||
}
|
||||
}
|
||||
}
|
||||
# save the original exports, we are going to add the unique node name below
|
||||
|
||||
while (@$targets_waiting
|
||||
&& (keys(%$targets_active) < $$options{'fanout'}))
|
||||
{
|
||||
my $user_target = shift @$targets_waiting;
|
||||
# now add export NODE=nodename to the pre-command, if not a device;
|
||||
my $exportnode;
|
||||
if (($$options{'devicetype'})) {
|
||||
$exportnode="";
|
||||
} else{
|
||||
$exportnode="export NODE=$user_target; ";
|
||||
}
|
||||
my $target_properties = $$resolved_targets{$user_target};
|
||||
my @commands;
|
||||
my $localShell =
|
||||
@@ -1044,6 +1037,7 @@ sub fork_fanout_dsh
|
||||
$$options{'post-command'} = "";
|
||||
$dsh_cmd_background = 1;
|
||||
}
|
||||
|
||||
if ($$options{'environment'})
|
||||
{
|
||||
# if we are on a servicenode need to get the environment file
|
||||
@@ -1068,15 +1062,14 @@ sub fork_fanout_dsh
|
||||
$rsp->{error}->[0] = "File $$options{'environment'} does not exist";
|
||||
xCAT::MsgUtils->message("E", $rsp, $::CALLBACK);
|
||||
}
|
||||
# build the xdsh command
|
||||
push @dsh_command,
|
||||
"$exportnode$$options{'pre-command'} . $$options{'environment'} ; $$options{'command'}$$options{'post-command'}";
|
||||
"$$options{'pre-command'} . $$options{'environment'} ; $$options{'command'}$$options{'post-command'}";
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
push @dsh_command,
|
||||
"$exportnode$$options{'pre-command'}$$options{'command'}$$options{'post-command'}";
|
||||
"$$options{'pre-command'}$$options{'command'}$$options{'post-command'}";
|
||||
}
|
||||
|
||||
if ($$target_properties{'localhost'})
|
||||
@@ -1144,7 +1137,7 @@ sub fork_fanout_dsh
|
||||
#eval "require RemoteShell::$rsh_extension";
|
||||
eval "require xCAT::$rsh_extension";
|
||||
|
||||
$rsh_config{'command'} = "$exportnode$$options{'pre-command'}";
|
||||
$rsh_config{'command'} = "$$options{'pre-command'}";
|
||||
my $tmp_env_file;
|
||||
# for the -E flag here we build and copy the -E env variable
|
||||
# file to the nodes
|
||||
@@ -2345,14 +2338,10 @@ sub config_dsh
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
{
|
||||
# if not Mellanox, it does not need a config file
|
||||
if (!($$options{'devicetype'} =~ /Mellanox/i)) {
|
||||
my $rsp = {};
|
||||
$rsp->{error}->[0] = "The config file: $devicepath is missing";
|
||||
xCAT::MsgUtils->message('E', $rsp, $::CALLBACK);
|
||||
}
|
||||
$rsp->{error}->[0] = "EMsgMISSING_DEV_CFG";
|
||||
xCAT::MsgUtils->message('E', $rsp, $::CALLBACK);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3237,18 +3226,7 @@ sub bld_resolve_nodes_hash
|
||||
|
||||
# find out if we have an MN in the list, local cp and sh will be used
|
||||
# not remote shell
|
||||
my @MNnodeinfo = xCAT::NetworkUtils->determinehostname;
|
||||
my $mname = pop @MNnodeinfo; # hostname
|
||||
my $cmd="hostname";
|
||||
my $localhostname = xCAT::Utils->runcmd($cmd,0);
|
||||
if ($::RUNCMD_RC != 0)
|
||||
{
|
||||
my $rsp = {};
|
||||
$rsp->{info}->[0] = "Command: $cmd failed. Continuing...";
|
||||
xCAT::MsgUtils->message("I", $rsp, $::CALLBACK);
|
||||
}
|
||||
|
||||
|
||||
my $mname = xCAT::Utils->noderangecontainsMn(@target_list);
|
||||
foreach my $target (@target_list)
|
||||
{
|
||||
|
||||
@@ -3257,9 +3235,11 @@ sub bld_resolve_nodes_hash
|
||||
my $localhost;
|
||||
my $user;
|
||||
my $context = "XCAT";
|
||||
# check to see if this node is the Management Node we are on, can run local commands (sh,cp)
|
||||
if (($mname eq $target) || ($localhostname eq $target)){
|
||||
# check to see if this node is the Management Node
|
||||
if ($mname) {
|
||||
if ($mname eq $target) {
|
||||
$localhost=$target;
|
||||
}
|
||||
}
|
||||
my %properties = (
|
||||
'hostname' => $hostname,
|
||||
@@ -4088,15 +4068,14 @@ sub parse_and_run_dsh
|
||||
# check if any node in the noderange is the Management Node and exit
|
||||
# with error, if the Management Node is in the Database and in the
|
||||
# noderange
|
||||
my @mname = xCAT::Utils->noderangecontainsMn(@nodelist);
|
||||
if (@mname) { # MN in the nodelist
|
||||
my $nodes=join(',', @mname);
|
||||
my $mname = xCAT::Utils->noderangecontainsMn(@nodelist);
|
||||
if ($mname) { # MN in the nodelist
|
||||
my $rsp = {};
|
||||
$rsp->{error}->[0] =
|
||||
"You must not run -K option against the Management Node:$nodes.";
|
||||
"You must not run -K option against the Management Node:$mname.";
|
||||
xCAT::MsgUtils->message("E", $rsp, $::CALLBACK, 1);
|
||||
return;
|
||||
}
|
||||
}
|
||||
# if devicetype=Mellanox, xdsh does not setup ssh, rspconfig does
|
||||
if ($switchtype =~ /Mellanox/i) {
|
||||
my $rsp = {};
|
||||
@@ -4707,42 +4686,21 @@ sub parse_and_run_dcp
|
||||
my $ranpostscripts;
|
||||
my $ranappendscripts;
|
||||
my $ranmergescripts;
|
||||
|
||||
# if we were called with runxcmd, like by updatenode
|
||||
# need to save the runxcmd buffer
|
||||
# $::xcmd_outref
|
||||
my $save_xcmd_outref;
|
||||
if ($::xcmd_outref) { # this means we were called with runxcmd
|
||||
$save_xcmd_outref = $::xcmd_outref;
|
||||
}
|
||||
|
||||
if ((@::postscripts) && ($::SYNCSN == 0)) {
|
||||
@results2 = &run_rsync_postscripts(\@results,$synfiledir,\%options);
|
||||
@results2 = &run_rsync_postscripts(\@results,$synfiledir);
|
||||
$ranpostscripts=1;
|
||||
}
|
||||
if ((@::alwayspostscripts) && ($::SYNCSN == 0)) {
|
||||
@results3 = &run_always_rsync_postscripts(\@nodelist,$synfiledir,\%options);
|
||||
@results3 = &run_always_rsync_postscripts(\@nodelist,$synfiledir);
|
||||
}
|
||||
if (($::appendscript) && ($::SYNCSN == 0)) {
|
||||
@results4 = &bld_and_run_append(\@nodelist,\@results,$synfiledir,$nodesyncfiledir,\%options);
|
||||
@results4 = &bld_and_run_append(\@nodelist,\@results,$synfiledir,$nodesyncfiledir);
|
||||
$ranappendscripts=1;
|
||||
}
|
||||
if (($::mergescript) && ($::SYNCSN == 0)) {
|
||||
@results5 = &bld_and_run_merge(\@nodelist,\@results,$synfiledir,$nodesyncfiledir,\%options);
|
||||
@results5 = &bld_and_run_merge(\@nodelist,\@results,$synfiledir,$nodesyncfiledir);
|
||||
$ranmergescripts=1;
|
||||
}
|
||||
# restore the runxcmd buffer
|
||||
if ($save_xcmd_outref) { # this means we were called with runxcmd
|
||||
$::xcmd_outref = $save_xcmd_outref;
|
||||
}
|
||||
# TODO, will we ever need to merge
|
||||
# if we ran a postscript and we were run
|
||||
# using runxcmd, and there was previous output in the
|
||||
# runxcmd buffer and we have output from the postscript
|
||||
# then we have to merge the outputs
|
||||
#if (($ranaps == 1) && ($save_xcmd_outref) && ($::xcmd_outref) ) {
|
||||
# &mergeoutput($save_xcmd_outref);
|
||||
#}
|
||||
my @newresults;
|
||||
if (@results2) {
|
||||
@newresults = (@results2);
|
||||
@@ -4757,14 +4715,9 @@ sub parse_and_run_dcp
|
||||
@newresults = (@newresults,@results3,@results4,@results5);
|
||||
}
|
||||
if (@newresults) {
|
||||
if ($save_xcmd_outref) { # this means we were called with runxcmd
|
||||
foreach my $line (@newresults) {
|
||||
push @$::xcmd_outref,$line;
|
||||
}
|
||||
}
|
||||
return (@newresults);
|
||||
} else {
|
||||
# don't report other results for postscripts,appendscripts,mergescripts because
|
||||
# don't report results for postscripts,appendscripts,mergescripts because
|
||||
# you get all the rsync returned lines
|
||||
if (($ranpostscripts == 0 ) && ($ranappendscripts == 0)
|
||||
&& ($ranmergescripts == 0)) {
|
||||
@@ -5639,7 +5592,7 @@ sub parse_rsync_input_file_on_SN
|
||||
|
||||
sub run_rsync_postscripts
|
||||
{
|
||||
my ($rsyncoutput,$syncdir,$options) = @_;
|
||||
my ($rsyncoutput,$syncdir) = @_;
|
||||
my @rsync_output = @$rsyncoutput;
|
||||
my @newoutput= ();
|
||||
my $dshparms;
|
||||
@@ -5682,26 +5635,27 @@ sub run_rsync_postscripts
|
||||
# now if we have postscripts to run, run xdsh
|
||||
my $out;
|
||||
|
||||
# if we were called with runxcmd, like by updatenode
|
||||
# need to save the runxcmd buffer
|
||||
# $::xcmd_outref
|
||||
my $save_xcmd_outref;
|
||||
if ($::xcmd_outref) { # this means we were called with runxcmd
|
||||
$save_xcmd_outref = $::xcmd_outref;
|
||||
}
|
||||
# my $ranaps=0; # did we run a postscript
|
||||
|
||||
foreach my $ps ( keys %{$$dshparms{'postscripts'}}) {
|
||||
my @nodes;
|
||||
push (@nodes, @{$$dshparms{'postscripts'}{$ps}});
|
||||
my @args=();
|
||||
if ($$options{'nodestatus'}) {
|
||||
push @args,"--nodestatus" ;
|
||||
}
|
||||
push @args,"-e";
|
||||
# if on the service node need to add the $syncdir directory
|
||||
# to the path
|
||||
if (xCAT::Utils->isServiceNode()) {
|
||||
my $tmpp=$syncdir . $ps;
|
||||
$ps=$tmpp;
|
||||
}
|
||||
push @args,$ps;
|
||||
$out=xCAT::Utils->runxcmd( { command => ['xdsh'],
|
||||
$out=xCAT::Utils->runxcmd( { command => ['xdsh'],
|
||||
node => \@nodes,
|
||||
arg => \@args,
|
||||
arg => [ "-e", $ps ]
|
||||
}, $::SUBREQ, 0,1);
|
||||
foreach my $r (@$out){
|
||||
push(@newoutput, $r);
|
||||
@@ -5709,6 +5663,18 @@ sub run_rsync_postscripts
|
||||
}
|
||||
# $ranaps=1;
|
||||
}
|
||||
# restore the runxcmd buffer
|
||||
if ($save_xcmd_outref) { # this means we were called with runxcmd
|
||||
$::xcmd_outref = $save_xcmd_outref;
|
||||
}
|
||||
# TODO, will we ever need to merge
|
||||
# if we ran a postscript and we were run
|
||||
# using runxcmd, and there was previous output in the
|
||||
# runxcmd buffer and we have output from the postscript
|
||||
# then we have to merge the outputs
|
||||
#if (($ranaps == 1) && ($save_xcmd_outref) && ($::xcmd_outref) ) {
|
||||
# &mergeoutput($save_xcmd_outref);
|
||||
#}
|
||||
return @newoutput;
|
||||
}
|
||||
#-------------------------------------------------------------------------------
|
||||
@@ -5746,7 +5712,7 @@ sub run_rsync_postscripts
|
||||
|
||||
sub bld_and_run_append
|
||||
{
|
||||
my ($hostnames,$rsyncoutput,$syncdir,$nodesyncfiledir,$options) = @_;
|
||||
my ($hostnames,$rsyncoutput,$syncdir,$nodesyncfiledir) = @_;
|
||||
my @hosts = @$hostnames;
|
||||
my @rsync_output = @$rsyncoutput;
|
||||
my @newoutput= ();
|
||||
@@ -5796,10 +5762,8 @@ sub bld_and_run_append
|
||||
# that were rsyn'd to at least one node
|
||||
if ($tmpappendfile eq $ps) {
|
||||
my $parm="$appendfile:$filetoappend ";
|
||||
# check to see if the parameter is already in the list
|
||||
if (!($::xdcpappendparms =~ /$parm/)) {
|
||||
$::xdcpappendparms .= $parm;
|
||||
}
|
||||
|
||||
$::xdcpappendparms .= $parm;
|
||||
$processappend=1;
|
||||
|
||||
}
|
||||
@@ -5820,16 +5784,10 @@ sub bld_and_run_append
|
||||
foreach my $ps ( keys %{$$dshparms{'appendscripts'}}) {
|
||||
my @nodes;
|
||||
push (@nodes, @{$$dshparms{'appendscripts'}{$ps}});
|
||||
my @args=();
|
||||
if ($$options{'nodestatus'}) {
|
||||
push @args,"--nodestatus" ;
|
||||
}
|
||||
push @args,$ps;
|
||||
push @args,$::xdcpappendparms;
|
||||
|
||||
$out=xCAT::Utils->runxcmd( { command => ['xdsh'],
|
||||
node => \@nodes,
|
||||
arg => \@args,
|
||||
arg => [ $ps , $::xdcpappendparms ]
|
||||
}, $::SUBREQ, 0,1);
|
||||
foreach my $r (@$out){
|
||||
push(@newoutput, $r);
|
||||
@@ -5876,7 +5834,7 @@ sub bld_and_run_append
|
||||
|
||||
sub bld_and_run_merge
|
||||
{
|
||||
my ($hostnames,$rsyncoutput,$syncdir,$nodesyncfiledir,$options) = @_;
|
||||
my ($hostnames,$rsyncoutput,$syncdir,$nodesyncfiledir) = @_;
|
||||
my @hosts = @$hostnames;
|
||||
my @rsync_output = @$rsyncoutput;
|
||||
my @newoutput= ();
|
||||
@@ -5935,10 +5893,8 @@ sub bld_and_run_merge
|
||||
# that were rsyn'd to at least one node
|
||||
if ($tmpmergefile eq $ps) {
|
||||
my $parm="$mergefile:$filetomerge ";
|
||||
# check to see if the parameter is already in the list
|
||||
if (!($::xdcpmergeparms =~ /$parm/)) {
|
||||
$::xdcpmergeparms .= $parm;
|
||||
}
|
||||
|
||||
$::xdcpmergeparms .= $parm;
|
||||
$processmerge=1;
|
||||
|
||||
}
|
||||
@@ -5960,17 +5916,9 @@ sub bld_and_run_merge
|
||||
my @nodes;
|
||||
push (@nodes, @{$$dshparms{'mergescripts'}{$ps}});
|
||||
|
||||
# build the argument list
|
||||
my @args=();
|
||||
|
||||
if ($$options{'nodestatus'}) {
|
||||
push @args,"--nodestatus" ;
|
||||
}
|
||||
push @args, $ps;
|
||||
push @args, $::xdcpmergeparms;
|
||||
$out=xCAT::Utils->runxcmd( { command => ['xdsh'],
|
||||
node => \@nodes,
|
||||
arg => \@args,
|
||||
arg => [ $ps , $::xdcpmergeparms ]
|
||||
}, $::SUBREQ, 0,1);
|
||||
foreach my $r (@$out){
|
||||
push(@newoutput, $r);
|
||||
@@ -5996,7 +5944,7 @@ sub bld_and_run_merge
|
||||
|
||||
sub run_always_rsync_postscripts
|
||||
{
|
||||
my ($hostnames,$syncdir,$options) = @_;
|
||||
my ($hostnames,$syncdir) = @_;
|
||||
my @hosts = @$hostnames;
|
||||
my @newoutput= ();
|
||||
my $dshparms;
|
||||
@@ -6018,28 +5966,26 @@ sub run_always_rsync_postscripts
|
||||
# now if we have postscripts to run, run xdsh
|
||||
my $out;
|
||||
|
||||
|
||||
# if we were called with runxcmd, like by updatenode
|
||||
# need to save the runxcmd buffer
|
||||
# $::xcmd_outref
|
||||
my $save_xcmd_outref;
|
||||
if ($::xcmd_outref) { # this means we were called with runxcmd
|
||||
$save_xcmd_outref = $::xcmd_outref;
|
||||
}
|
||||
foreach my $ps ( keys %{$$dshparms{'postscripts'}}) {
|
||||
my @nodes;
|
||||
# build the argument list
|
||||
my @args=();
|
||||
if ($$options{'nodestatus'}) {
|
||||
push @args,"--nodestatus" ;
|
||||
}
|
||||
push @args,"-e";
|
||||
push (@nodes, @{$$dshparms{'postscripts'}{$ps}});
|
||||
# if on the service node need to add the $syncdir directory
|
||||
# to the path
|
||||
if (xCAT::Utils->isServiceNode()) {
|
||||
my $tmpp=$syncdir . $ps;
|
||||
$ps=$tmpp;
|
||||
}
|
||||
push @args, $ps;
|
||||
|
||||
push (@nodes, @{$$dshparms{'postscripts'}{$ps}});
|
||||
|
||||
$out=xCAT::Utils->runxcmd( { command => ['xdsh'],
|
||||
$out=xCAT::Utils->runxcmd( { command => ['xdsh'],
|
||||
node => \@nodes,
|
||||
arg => \@args,
|
||||
arg => [ "-e", $ps ]
|
||||
}, $::SUBREQ, 0,1);
|
||||
foreach my $r (@$out){
|
||||
push(@newoutput, $r);
|
||||
@@ -6047,6 +5993,10 @@ sub run_always_rsync_postscripts
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
# restore the runxcmd buffer
|
||||
if ($save_xcmd_outref) { # this means we were called with runxcmd
|
||||
$::xcmd_outref = $save_xcmd_outref;
|
||||
}
|
||||
return @newoutput;
|
||||
}
|
||||
|
||||
@@ -754,20 +754,8 @@ sub pping_hostnames
|
||||
my ($class, @hostnames) = @_;
|
||||
|
||||
my $hostname_list = join ",", @hostnames;
|
||||
# read site table, usefping attribute
|
||||
# if set then run pping -f to use fping
|
||||
# this fixes a broken nmap in Redhat 6.2 with ip alias (3512)
|
||||
my $cmd="$::XCATROOT/bin/pping $hostname_list"; # default
|
||||
my @usefping=xCAT::TableUtils->get_site_attribute("usefping");
|
||||
if ((defined($usefping[0])) && ($usefping[0] eq "1")) {
|
||||
$cmd = "$::XCATROOT/bin/pping -f $hostname_list";
|
||||
}
|
||||
#my $rsp={};
|
||||
#$rsp->{data}->[0] = "running command $cmd";
|
||||
#xCAT::MsgUtils->message("I", $rsp, $::CALLBACK);
|
||||
|
||||
my @output =
|
||||
xCAT::Utils->runcmd($cmd, -1);
|
||||
xCAT::Utils->runcmd("$::XCATROOT/bin/pping $hostname_list", -1);
|
||||
if ($::RUNCMD_RC !=0) {
|
||||
my $rsp={};
|
||||
$rsp->{error}->[0] = "Error from pping";
|
||||
|
||||
@@ -39,7 +39,7 @@ sub update_discovery_data {
|
||||
$disdata{'discoverytime'} = $currtime;
|
||||
|
||||
foreach my $attr (keys %$request) {
|
||||
if ($attr =~ /^(command|discoverymethod|_xcat|cacheonly|noderange|environment|method|discoverytime|updateswitch)/) {
|
||||
if ($attr =~ /^(command|discoverymethod|_xcat|cacheonly|noderange|environment)/) {
|
||||
next;
|
||||
} elsif ($attr =~ /^(node|uuid|arch|cpucount|cputype|memory|mtm|serial)$/) {
|
||||
$disdata{$attr} = $request->{$attr}->[0];
|
||||
|
||||
@@ -435,7 +435,7 @@ sub lcds {
|
||||
if( $type eq "lpar" ) {
|
||||
$action = "query_lcds";
|
||||
} elsif ($type eq "blade") {
|
||||
$action = "pblade_query_lcds";
|
||||
$action = "pblade_query_lcds";
|
||||
} else {
|
||||
$action = "cec_query_lcds";
|
||||
}
|
||||
|
||||
@@ -37,7 +37,6 @@ $::NODETYPE_MP="mp";
|
||||
$::STATUS_SYNCING="syncing";
|
||||
$::STATUS_OUT_OF_SYNC="out-of-sync";
|
||||
$::STATUS_SYNCED="synced";
|
||||
$::STATUS_FAILED="failed";
|
||||
|
||||
|
||||
# valid values for nodelist.status columns or other status
|
||||
|
||||
@@ -893,12 +893,12 @@ sub dolitesetup
|
||||
}
|
||||
}
|
||||
|
||||
if (-e $litetreetable) {
|
||||
my $rc = xCAT::Utils->runcmd("rm $litetreetable", -1);
|
||||
if (-e $litetreetab) {
|
||||
my $rc = xCAT::Utils->runcmd("rm $litetreetab", -1);
|
||||
if ($::RUNCMD_RC != 0)
|
||||
{
|
||||
my $rsp;
|
||||
push @{$rsp->{data}}, "Could not remove existing $litetreetable file.";
|
||||
push @{$rsp->{data}}, "Could not remove existing $litetreetab file.";
|
||||
xCAT::MsgUtils->message("E", $rsp, $callback);
|
||||
return 1;
|
||||
}
|
||||
@@ -1132,11 +1132,7 @@ sub dolitesetup
|
||||
# $file could be full path file name or dir name
|
||||
# ex. /foo/bar/ or /etc/lppcfg
|
||||
my ($node, $option, $file) = split (/\|/, $line);
|
||||
|
||||
if (!$file) {
|
||||
next;
|
||||
}
|
||||
|
||||
|
||||
# ex. .../inst_root/foo/bar/ or .../inst_root/etc/lppcfg
|
||||
my $instrootfile = $instrootloc . $file;
|
||||
|
||||
|
||||
@@ -1849,14 +1849,6 @@ sub boot_network {
|
||||
$state = $newstate[$state];
|
||||
}
|
||||
],
|
||||
# For some old firmware, does not output "----"
|
||||
[qr/BOOTP/=>
|
||||
sub {
|
||||
nc_msg ($verbose, $msg[$state]);
|
||||
$rconsole->clear_accum();
|
||||
$state = $newstate[$state];
|
||||
}
|
||||
],
|
||||
[qr/]/=>
|
||||
sub {
|
||||
nc_msg($verbose, "Unexpected prompt\n");
|
||||
@@ -1925,28 +1917,7 @@ sub Boot {
|
||||
#],
|
||||
[qr/BOOTP/=> #-ex
|
||||
sub {
|
||||
nc_msg($verbose, "# Network boot proceeding - matched BOOTP, exiting.\n");
|
||||
$rconsole->clear_accum();
|
||||
}
|
||||
],
|
||||
# Welcome to AIX - some old firmware does not output BOOTP or ----
|
||||
[qr/Welcome/=> #-ex
|
||||
sub {
|
||||
nc_msg($verbose, "# Network boot proceeding - matched Welcome, exiting.\n");
|
||||
$rconsole->clear_accum();
|
||||
}
|
||||
],
|
||||
# tftp file download - some old firmware does not output BOOTP or ----
|
||||
[qr/FILE/=> #-ex
|
||||
sub {
|
||||
nc_msg($verbose, "# Network boot proceeding - matched FILE.\n");
|
||||
$rconsole->clear_accum();
|
||||
}
|
||||
],
|
||||
# some old firmware does not output BOOTP or ----
|
||||
[qr/Elapsed/=> #-ex
|
||||
sub {
|
||||
nc_msg($verbose, "# Network boot proceeding - matched Elapsed, exiting.\n");
|
||||
nc_msg($verbose, "# Network boot proceeding, exiting.\n");
|
||||
$rconsole->clear_accum();
|
||||
}
|
||||
],
|
||||
@@ -3177,12 +3148,12 @@ sub lparnetbootexp
|
||||
}
|
||||
],
|
||||
);
|
||||
return [1] if ($rc eq 1);
|
||||
nc_msg($verbose, "# bootp sent over network.\n");
|
||||
$rc = Boot($rconsole, $node, $verbose);#, @expect_out);
|
||||
unless ($rc eq 0) {
|
||||
nc_msg($verbose, "Can't boot here. \n");
|
||||
}
|
||||
return [1] if ($rc eq 1);
|
||||
}
|
||||
nc_msg($verbose, "# bootp sent over network.\n");
|
||||
$rc = Boot($rconsole, $node, $verbose);#, @expect_out);
|
||||
unless ($rc eq 0) {
|
||||
nc_msg($verbose, "Can't boot here. \n");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,271 @@
|
||||
# IBM(c) 2007 EPL license http://www.eclipse.org/legal/epl-v10.html
|
||||
package xCAT::NameRange;
|
||||
require xCAT::Table;
|
||||
require Exporter;
|
||||
use strict;
|
||||
|
||||
#Perl implementation of namerange
|
||||
# NOTE: This is identical to xCAT::NodeRange except that no
|
||||
# database access occurs, no nodes are verified, and
|
||||
# no nodegroups are expanded.
|
||||
# Made a new utility since NodeRange is used EVERYWHERE in
|
||||
# xCAT code and did not want to risk de-stabilizing existing code.
|
||||
our @ISA = qw(Exporter);
|
||||
our @EXPORT = qw(namerange);
|
||||
|
||||
my $recurselevel=0;
|
||||
|
||||
|
||||
sub subnodes (\@@) {
|
||||
#Subtract set of nodes from the first list
|
||||
my $nodes = shift;
|
||||
my $node;
|
||||
foreach $node (@_) {
|
||||
@$nodes = (grep(!/^$node$/,@$nodes));
|
||||
}
|
||||
}
|
||||
|
||||
sub expandatom {
|
||||
my $atom = shift;
|
||||
my @nodes= ();
|
||||
if ($atom =~ /^\(.*\)$/) { # handle parentheses by recursively calling namerange()
|
||||
$atom =~ s/^\((.*)\)$/$1/;
|
||||
$recurselevel++;
|
||||
return namerange($atom);
|
||||
}
|
||||
if ($atom =~ /@/) {
|
||||
$recurselevel++;
|
||||
return namerange($atom);
|
||||
}
|
||||
|
||||
if ($atom =~ m/^\//) { # A regular expression - not supported in namerange
|
||||
return ($atom);
|
||||
}
|
||||
|
||||
if ($atom =~ m/(.*)\[(.*)\](.*)/) { # square bracket range
|
||||
#for the time being, we are only going to consider one [] per atom
|
||||
#xcat 1.2 does no better
|
||||
my @subelems = split(/([\,\-\:])/,$2);
|
||||
my $subrange="";
|
||||
while (my $subelem = shift @subelems) {
|
||||
my $subop=shift @subelems;
|
||||
$subrange=$subrange."$1$subelem$3$subop";
|
||||
}
|
||||
foreach (split /,/,$subrange) {
|
||||
my @newnodes=expandatom($_);
|
||||
@nodes=(@nodes,@newnodes);
|
||||
}
|
||||
return @nodes;
|
||||
}
|
||||
|
||||
if ($atom =~ m/\+/) { # process the + operator
|
||||
$atom =~ m/^([^0-9]*)([0-9]+)([^\+]*)\+([0-9]+)/;
|
||||
my $pref=$1;
|
||||
my $startnum=$2;
|
||||
my $suf=$3;
|
||||
my $end=$4+$startnum;
|
||||
my $endnum = sprintf("%d",$end);
|
||||
if (length ($startnum) > length ($endnum)) {
|
||||
$endnum = sprintf("%0".length($startnum)."d",$end);
|
||||
}
|
||||
foreach ("$startnum".."$endnum") {
|
||||
my @addnodes=expandatom($pref.$_.$suf);
|
||||
@nodes=(@nodes,@addnodes);
|
||||
}
|
||||
return (@nodes);
|
||||
}
|
||||
|
||||
if ($atom =~ m/[-:]/) { # process the minus range operator
|
||||
my $left;
|
||||
my $right;
|
||||
if ($atom =~ m/:/) {
|
||||
($left,$right)=split /:/,$atom;
|
||||
} else {
|
||||
my $count= ($atom =~ tr/-//);
|
||||
if (($count % 2)==0) { #can't understand even numbers of - in range context
|
||||
# we might not really be in range context
|
||||
return ($atom);
|
||||
}
|
||||
my $expr="([^-]+?".("-[^-]*"x($count/2)).")-(.*)";
|
||||
$atom =~ m/$expr/;
|
||||
$left=$1;
|
||||
$right=$2;
|
||||
}
|
||||
if ($left eq $right) { #if they said node1-node1 for some strange reason
|
||||
return expandatom($left);
|
||||
}
|
||||
my @leftarr=split(/(\d+)/,$left);
|
||||
my @rightarr=split(/(\d+)/,$right);
|
||||
if (scalar(@leftarr) != scalar(@rightarr)) { #Mismatch formatting..
|
||||
# guess it's meant to be a nodename
|
||||
return ($atom);
|
||||
}
|
||||
my $prefix = "";
|
||||
my $suffix = "";
|
||||
foreach (0..$#leftarr) {
|
||||
my $idx = $_;
|
||||
if ($leftarr[$idx] =~ /^\d+$/ and $rightarr[$idx] =~ /^\d+$/) { #pure numeric component
|
||||
if ($leftarr[$idx] ne $rightarr[$idx]) { #We have found the iterator (only supporting one for now)
|
||||
my $prefix = join('',@leftarr[0..($idx-1)]); #Make a prefix of the pre-validated parts
|
||||
my $luffix; #However, the remainder must still be validated to be the same
|
||||
my $ruffix;
|
||||
if ($idx eq $#leftarr) {
|
||||
$luffix="";
|
||||
$ruffix="";
|
||||
} else {
|
||||
$ruffix = join('',@rightarr[($idx+1)..$#rightarr]);
|
||||
$luffix = join('',@leftarr[($idx+1)..$#leftarr]);
|
||||
}
|
||||
if ($luffix ne $ruffix) { #the suffixes mismatched..
|
||||
return ($atom);
|
||||
}
|
||||
foreach ($leftarr[$idx]..$rightarr[$idx]) {
|
||||
my @addnodes=expandatom($prefix.$_.$luffix);
|
||||
@nodes=(@nodes,@addnodes);
|
||||
}
|
||||
return (@nodes); #the return has been built, return, exiting loop and all
|
||||
}
|
||||
} elsif ($leftarr[$idx] ne $rightarr[$idx]) {
|
||||
return ($atom);
|
||||
}
|
||||
$prefix .= $leftarr[$idx]; #If here, it means that the pieces were the same, but more to come
|
||||
}
|
||||
#I cannot conceive how the code could possibly be here, but whatever it is, it must be questionable
|
||||
return ($atom);
|
||||
}
|
||||
|
||||
return ($atom);
|
||||
}
|
||||
|
||||
sub namerange {
|
||||
#We for now just do left to right operations
|
||||
my $range=shift;
|
||||
my %nodes = ();
|
||||
my %delnodes = ();
|
||||
my $op = ",";
|
||||
my @elems = split(/(,(?![^[]*?])(?![^\(]*?\)))/,$range); # commas outside of [] or ()
|
||||
if (scalar(@elems)==1) {
|
||||
@elems = split(/(@(?![^\(]*?\)))/,$range); # only split on @ when no , are present (inner recursion)
|
||||
}
|
||||
|
||||
while (my $atom = shift @elems) {
|
||||
if ($atom =~ /^-/) { # if this is an exclusion, strip off the minus, but remember it
|
||||
$atom = substr($atom,1);
|
||||
$op = $op."-";
|
||||
}
|
||||
|
||||
if ($atom =~ /^\^(.*)$/) { # get a list of nodes from a file
|
||||
open(NRF,$1);
|
||||
while (<NRF>) {
|
||||
my $line=$_;
|
||||
unless ($line =~ m/^[\^#]/) {
|
||||
$line =~ m/^([^: ]*)/;
|
||||
my $newrange = $1;
|
||||
chomp($newrange);
|
||||
$recurselevel++;
|
||||
my @filenodes = namerange($newrange);
|
||||
foreach (@filenodes) {
|
||||
$nodes{$_}=1;
|
||||
}
|
||||
}
|
||||
}
|
||||
close(NRF);
|
||||
next;
|
||||
}
|
||||
|
||||
my %newset = map { $_ =>1 } expandatom($atom); # expand the atom and make each entry in the resulting array a key in newset
|
||||
|
||||
if ($op =~ /@/) { # compute the intersection of the current atom and the node list we have received before this
|
||||
foreach (keys %nodes) {
|
||||
unless ($newset{$_}) {
|
||||
delete $nodes{$_};
|
||||
}
|
||||
}
|
||||
} elsif ($op =~ /,-/) { # add the nodes from this atom to the exclude list
|
||||
foreach (keys %newset) {
|
||||
$delnodes{$_}=1; #delay removal to end
|
||||
}
|
||||
} else { # add the nodes from this atom to the total node list
|
||||
foreach (keys %newset) {
|
||||
$nodes{$_}=1;
|
||||
}
|
||||
}
|
||||
$op = shift @elems;
|
||||
|
||||
} # end of main while loop
|
||||
|
||||
# Now remove all the exclusion nodes
|
||||
foreach (keys %nodes) {
|
||||
if ($delnodes{$_}) {
|
||||
delete $nodes{$_};
|
||||
}
|
||||
}
|
||||
if ($recurselevel) {
|
||||
$recurselevel--;
|
||||
}
|
||||
return sort (keys %nodes);
|
||||
|
||||
}
|
||||
|
||||
|
||||
1;
|
||||
|
||||
=head1 NAME
|
||||
|
||||
xCAT::NameRange - Perl module for xCAT namerange expansion
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
use xCAT::NameRange;
|
||||
my @nodes=namerange("storage@rack1,node[1-200],^/tmp/nodelist,node300-node400,node401+10,500-550");
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
namerange interprets xCAT noderange formatted strings and returns a list of
|
||||
names. The following two operations are supported on elements, and interpreted
|
||||
left to right:
|
||||
|
||||
, union next element with everything to the left.
|
||||
|
||||
@ take intersection of element to the right with everything on the left
|
||||
(i.e. mask out anything to the left not belonging to what is described to
|
||||
the right)
|
||||
|
||||
Each element can be a number of things:
|
||||
|
||||
A node name, i.e.:
|
||||
|
||||
=item * node1
|
||||
|
||||
A hyphenated node range (only one group of numbers may differ between the left and right hand side, and those numbers will increment in a base 10 fashion):
|
||||
|
||||
node1-node200 node1-compute-node200-compute
|
||||
node1:node200 node1-compute:node200-compute
|
||||
|
||||
A namerange denoted by brackets:
|
||||
|
||||
node[1-200] node[001-200]
|
||||
|
||||
A regular expression describing the namerange:
|
||||
|
||||
/d(1.?.?|200)
|
||||
|
||||
A node plus offset (this increments the first number found in nodename):
|
||||
|
||||
node1+199
|
||||
|
||||
And most of the above substituting groupnames.
|
||||
3C
|
||||
3C
|
||||
|
||||
NameRange tries to be intelligent about detecting padding, so you can:
|
||||
node001-node200
|
||||
And it will increment according to the pattern.
|
||||
|
||||
|
||||
=head1 COPYRIGHT
|
||||
|
||||
Copyright 2007 IBM Corp. All rights reserved.
|
||||
|
||||
|
||||
=cut
|
||||
@@ -422,6 +422,11 @@ sub ishostinsubnet {
|
||||
if ($ip =~ /:/) {#ipv6
|
||||
$numbits=128;
|
||||
}
|
||||
# IPv6 subnet with netmask postfix like /64
|
||||
if ($subnet && ($subnet =~ /\//))
|
||||
{
|
||||
$subnet =~ s/\/.*$//;
|
||||
}
|
||||
if ($mask) {
|
||||
if ($mask =~ /\//) {
|
||||
$mask =~ s/^\///;
|
||||
@@ -437,10 +442,6 @@ sub ishostinsubnet {
|
||||
die "ishostinsubnet must either be called with a netmask or CIDR /bits notation";
|
||||
}
|
||||
}
|
||||
if ($subnet && ($subnet =~ /\//)) #remove CIDR suffix from subnet
|
||||
{
|
||||
$subnet =~ s/\/.*$//;
|
||||
}
|
||||
$ip = getipaddr($ip,GetNumber=>1);
|
||||
$subnet = getipaddr($subnet,GetNumber=>1);
|
||||
$ip &= $mask;
|
||||
@@ -2195,7 +2196,6 @@ sub isValidHostname
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
=head3 isValidFQDN
|
||||
@@ -2254,26 +2254,6 @@ sub int_to_ip
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
=head3 getBroadcast
|
||||
Description : Get the broadcast ips
|
||||
Arguments : ipstr - the IPv4 string ip.
|
||||
netmask - the subnet mask of network
|
||||
Returns : bcipint - the IPv4 string of broadcast ip.
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
sub getBroadcast
|
||||
{
|
||||
my ($class, $ipstr, $netmask) = @_;
|
||||
my $ipint = xCAT::NetworkUtils->ip_to_int($ipstr);
|
||||
my $maskint = xCAT::NetworkUtils->ip_to_int($netmask);
|
||||
my $tmp = sprintf("%d", ~$maskint);
|
||||
my $bcnum = sprintf("%d", ($ipint | $tmp) & hex('0x00000000FFFFFFFF'));
|
||||
return xCAT::NetworkUtils->int_to_ip($bcnum);
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
=head3 get_allips_in_range
|
||||
Description : Get all IPs in a IP range, return in a list.
|
||||
Arguments : $startip - start IP address
|
||||
|
||||
+31
-51
@@ -180,14 +180,7 @@ sub nodesbycriteria {
|
||||
return \%critnodes;
|
||||
}
|
||||
|
||||
# Expand one part of the noderange from the noderange() function. Initially, one part means the
|
||||
# substring between commas in the noderange. But expandatom also calls itself recursively to
|
||||
# further expand some parts.
|
||||
# Input args:
|
||||
# - atom to expand
|
||||
# - verify: whether or not to require that the resulting nodenames exist in the nodelist table
|
||||
# - options: genericrange - a purely syntactical expansion of the range, not using the db at all, e.g not expanding group names
|
||||
sub expandatom {
|
||||
sub expandatom { #TODO: implement table selection as an atom (nodetype.os==rhels5.3)
|
||||
my $atom = shift;
|
||||
if ($recurselevel > 4096) { die "NodeRange seems to be hung on evaluating $atom, recursion limit hit"; }
|
||||
unless (scalar(@allnodeset) and (($allnodesetstamp+5) > time())) { #Build a cache of all nodes, some corner cases will perform worse, but by and large it will do better. We could do tests to see where the breaking points are, and predict how many atoms we have to evaluate to mitigate, for now, implement the strategy that keeps performance from going completely off the rails
|
||||
@@ -196,28 +189,25 @@ sub expandatom {
|
||||
@allnodeset = $nodelist->getAllAttribs('node','groups');
|
||||
%allnodehash = map { $_->{node} => 1 } @allnodeset;
|
||||
}
|
||||
my $verify = (scalar(@_) >= 1 ? shift : 1);
|
||||
my %options = @_; # additional options
|
||||
my $verify = (scalar(@_) == 1 ? shift : 1);
|
||||
my @nodes= ();
|
||||
#TODO: these env vars need to get passed by the client to xcatd
|
||||
my $nprefix=(defined ($ENV{'XCAT_NODE_PREFIX'}) ? $ENV{'XCAT_NODE_PREFIX'} : 'node');
|
||||
my $nsuffix=(defined ($ENV{'XCAT_NODE_SUFFIX'}) ? $ENV{'XCAT_NODE_SUFFIX'} : '');
|
||||
|
||||
if (not $options{genericrange} and $allnodehash{$atom}) { #The atom is a plain old nodename
|
||||
if ($allnodehash{$atom}) { #The atom is a plain old nodename
|
||||
return ($atom);
|
||||
}
|
||||
if ($atom =~ /^\(.*\)$/) { # handle parentheses by recursively calling noderange()
|
||||
$atom =~ s/^\((.*)\)$/$1/;
|
||||
$recurselevel++;
|
||||
return noderange($atom,$verify,1,%options);
|
||||
return noderange($atom);
|
||||
}
|
||||
if ($atom =~ /@/) {
|
||||
$recurselevel++;
|
||||
return noderange($atom,$verify,1,%options);
|
||||
return noderange($atom);
|
||||
}
|
||||
|
||||
# Try to match groups?
|
||||
unless ($options{genericrange}) {
|
||||
unless ($grptab) {
|
||||
$grptab = xCAT::Table->new('nodegroup');
|
||||
}
|
||||
@@ -279,9 +269,7 @@ sub expandatom {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# node selection based on db attribute values (nodetype.os==rhels5.3)
|
||||
if ($atom =~ m/[=~]/) { #TODO: this is the clunky, slow code path to acheive the goal. It also is the easiest to write, strange coincidence. Aggregating multiples would be nice
|
||||
my @nodes;
|
||||
foreach (@allnodeset) {
|
||||
@@ -299,7 +287,7 @@ sub expandatom {
|
||||
}
|
||||
if ($atom =~ m/^[0-9]+\z/) { # if only numbers, then add the prefix
|
||||
my $nodename=$nprefix.$atom.$nsuffix;
|
||||
return expandatom($nodename,$verify,%options);
|
||||
return expandatom($nodename,$verify);
|
||||
}
|
||||
my $nodelen=@nodes;
|
||||
if ($nodelen > 0) {
|
||||
@@ -307,7 +295,7 @@ sub expandatom {
|
||||
}
|
||||
|
||||
if ($atom =~ m/^\//) { # A regular expression
|
||||
if ($verify==0 or $options{genericrange}) { # If not in verify mode, regex makes zero possible sense
|
||||
unless ($verify) { # If not in verify mode, regex makes zero possible sense
|
||||
return ($atom);
|
||||
}
|
||||
#TODO: check against all groups
|
||||
@@ -321,29 +309,25 @@ sub expandatom {
|
||||
}
|
||||
|
||||
if ($atom =~ m/(.+?)\[(.+?)\](.*)/) { # square bracket range
|
||||
# if there is more than 1 set of [], we picked off just the 1st. If there more sets of [], we will expand
|
||||
# the 1st set and create a new set of atom by concatenating each result in the 1st expandsion with the rest
|
||||
# of the brackets. Then call expandatom() recursively on each new atom.
|
||||
my @subelems = split(/([\,\-\:])/,$2); # $2 is the range inside the 1st set of brackets
|
||||
# if there are more than 1 [], we picked off just the 1st. if there is another, we will process it later
|
||||
my @subelems = split(/([\,\-\:])/,$2);
|
||||
my $subrange="";
|
||||
my $subelem;
|
||||
my $start = $1; # the text before the 1st set of brackets
|
||||
my $ending = $3; # the text after the 1st set of brackets (could contain more brackets)
|
||||
my $morebrackets = $ending =~ /\[.+?\]/; # if there are more brackets, we have to expand just the 1st part, then add the 2nd part later
|
||||
while (scalar @subelems) { # this while loop turns something like a[1-3] into a1-a3 because another section of expand atom knows how to expand that
|
||||
my $subelem = shift @subelems;
|
||||
my $subelem;
|
||||
my $start = $1;
|
||||
my $ending = $3;
|
||||
my $morebrackets = $ending =~ /\[.+?\]/; # if there are more brackets, we have to expand just the 1st part, then add the 2nd part later
|
||||
while (scalar @subelems) {
|
||||
my $subelem = shift @subelems;
|
||||
my $subop=shift @subelems;
|
||||
$subrange=$subrange."$start$subelem" . ($morebrackets?'':$ending) . "$subop";
|
||||
}
|
||||
foreach (split /,/,$subrange) { # this foreach is in case there were commas inside the brackets originally, e.g.: a[1,3,5]b[1-2]
|
||||
# this expandatom just expands the part of the noderange that contains the 1st set of brackets
|
||||
# e.g. if noderange is a[1-2]b[1-2] it will create newnodes of a1 and a2
|
||||
my @newnodes=expandatom($_, ($morebrackets?0:$verify), genericrange=>($morebrackets||$options{genericrange}));
|
||||
foreach (split /,/,$subrange) {
|
||||
my @newnodes=expandatom($_, ($morebrackets?0:$verify));
|
||||
if (!$morebrackets) { push @nodes,@newnodes; }
|
||||
else {
|
||||
# for each of the new nodes (prefixes), add the rest of the brackets and then expand recursively
|
||||
# for each of the new nodes, add the 2nd brackets and then expand
|
||||
foreach my $n (@newnodes) {
|
||||
push @nodes, expandatom("$n$ending", $verify, %options);
|
||||
push @nodes, expandatom("$n$ending", $verify);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -365,7 +349,7 @@ sub expandatom {
|
||||
$suf=$nsuffix;
|
||||
}
|
||||
foreach ("$startnum".."$endnum") {
|
||||
my @addnodes=expandatom($pref.$_.$suf,$verify,%options);
|
||||
my @addnodes=expandatom($pref.$_.$suf,$verify);
|
||||
@nodes=(@nodes,@addnodes);
|
||||
}
|
||||
return (@nodes);
|
||||
@@ -392,7 +376,7 @@ sub expandatom {
|
||||
$right=$2;
|
||||
}
|
||||
if ($left eq $right) { #if they said node1-node1 for some strange reason
|
||||
return expandatom($left,$verify,%options);
|
||||
return expandatom($left,$verify);
|
||||
}
|
||||
my @leftarr=split(/(\d+)/,$left);
|
||||
my @rightarr=split(/(\d+)/,$right);
|
||||
@@ -429,7 +413,7 @@ sub expandatom {
|
||||
}
|
||||
}
|
||||
foreach ($leftarr[$idx]..$rightarr[$idx]) {
|
||||
my @addnodes=expandatom($prefix.$_.$luffix,$verify,%options);
|
||||
my @addnodes=expandatom($prefix.$_.$luffix,$verify);
|
||||
push @nodes,@addnodes;
|
||||
}
|
||||
return (@nodes); #the return has been built, return, exiting loop and all
|
||||
@@ -477,7 +461,7 @@ sub retain_cache { #A semi private operation to be used *ONLY* in the interestin
|
||||
%allgrphash=();
|
||||
}
|
||||
}
|
||||
sub extnoderange { #An extended noderange function. Needed by the GUI as the more straightforward function return format too simple for this.
|
||||
sub extnoderange { #An extended noderange function. Needed as the more straightforward function return format too simple for this.
|
||||
my $range = shift;
|
||||
my $namedopts = shift;
|
||||
my $verify=1;
|
||||
@@ -503,7 +487,7 @@ sub extnoderange { #An extended noderange function. Needed by the GUI as the mo
|
||||
return $return;
|
||||
}
|
||||
sub abbreviate_noderange {
|
||||
#takes a list of nodes or a string and reduces it by replacing a list of nodes that make up a group with the group name itself
|
||||
#takes a list of nodes or a string and abbreviates
|
||||
my $nodes=shift;
|
||||
my %grouphash;
|
||||
my %sizedgroups;
|
||||
@@ -549,20 +533,16 @@ sub abbreviate_noderange {
|
||||
return (join ',',keys %targetelems,keys %nodesleft);
|
||||
}
|
||||
|
||||
# Expand the given noderange
|
||||
# Input args:
|
||||
# - noderange to expand
|
||||
# - verify: whether or not to require that the resulting nodenames exist in the nodelist table
|
||||
# - exsitenode: whether or not to honor site.excludenodes to automatically exclude those nodes from all noderanges
|
||||
# - options: genericrange - a purely syntactical expansion of the range, not using the db at all, e.g not expanding group names
|
||||
sub noderange {
|
||||
$missingnodes=[];
|
||||
#We for now just do left to right operations
|
||||
my $range=shift;
|
||||
$range =~ s/['"]//g;
|
||||
my $verify = (scalar(@_) >= 1 ? shift : 1);
|
||||
my $exsitenode = (scalar(@_) >= 1 ? shift : 1); # if 1, honor site.excludenodes
|
||||
my %options = @_; # additional options
|
||||
|
||||
#excludenodes attribute in site table,
|
||||
#these nodes should be excluded for any xCAT commands
|
||||
my $exsitenode = (scalar(@_) >= 1 ? shift : 1);
|
||||
|
||||
unless ($nodelist) {
|
||||
$nodelist =xCAT::Table->new('nodelist',-create =>1);
|
||||
@@ -597,7 +577,7 @@ sub noderange {
|
||||
my $newrange = $1;
|
||||
chomp($newrange);
|
||||
$recurselevel++;
|
||||
my @filenodes = noderange($newrange,$verify,$exsitenode,%options);
|
||||
my @filenodes = noderange($newrange);
|
||||
foreach (@filenodes) {
|
||||
$nodes{$_}=1;
|
||||
}
|
||||
@@ -607,7 +587,7 @@ sub noderange {
|
||||
next;
|
||||
}
|
||||
|
||||
my %newset = map { $_ =>1 } expandatom($atom,$verify,%options); # expand the atom and make each entry in the resulting array a key in newset
|
||||
my %newset = map { $_ =>1 } expandatom($atom,$verify); # expand the atom and make each entry in the resulting array a key in newset
|
||||
|
||||
if ($op =~ /@/) { # compute the intersection of the current atom and the node list we have received before this
|
||||
foreach (keys %nodes) {
|
||||
@@ -634,7 +614,7 @@ sub noderange {
|
||||
my $badnoderange = 0;
|
||||
my @badnodes = ();
|
||||
if ($::XCATSITEVALS{excludenodes}) {
|
||||
@badnodes = noderange($::XCATSITEVALS{excludenodes}, 1, 0, %options);
|
||||
@badnodes = noderange($::XCATSITEVALS{excludenodes}, 1, 0);
|
||||
foreach my $bnode (@badnodes) {
|
||||
if (!$delnodes{$bnode}) {
|
||||
$delnodes{$bnode} = 1;
|
||||
|
||||
@@ -490,9 +490,6 @@ sub mkhwconn
|
||||
my $ntype = $$d[4];
|
||||
if ($ntype =~ /^(cec|frame|blade)$/)
|
||||
{
|
||||
if ($ntype eq "blade") {
|
||||
delete $opt->{port};
|
||||
}
|
||||
$cnode = xCAT::DBobjUtils::getchildren($node_name, $opt->{port});
|
||||
} else {
|
||||
$cnode = $node_name;
|
||||
|
||||
@@ -52,21 +52,14 @@ sub get_allocable_staticips_innet
|
||||
my $netentry = ($networkstab->getAllAttribsWhere("netname = '$netname'", 'ALL'))[0];
|
||||
my ($startip, $endip) = split('-', $netentry->{'staticrange'});
|
||||
my $incremental = $netentry->{'staticrangeincrement'};
|
||||
my $netmask = $netentry->{'mask'};
|
||||
my $gateway = $netentry->{'gateway'};
|
||||
my $validipsref;
|
||||
if ($incremental and $startip and $endip){
|
||||
$validipsref = xCAT::NetworkUtils->get_allips_in_range($startip, $endip, $incremental);
|
||||
}
|
||||
|
||||
my $broadcastip = xCAT::NetworkUtils->getBroadcast($startip, $netmask);
|
||||
foreach (@$validipsref){
|
||||
#Remove ip which is broadcast ip, exclude ip, ips ended with 0, gateway ip
|
||||
if (exists($iphash{$_}) or $_ eq $broadcastip or $_ eq $gateway
|
||||
or $_ =~ /^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(0)$/){
|
||||
next;
|
||||
if (! exists($iphash{$_})){
|
||||
push @allocableips, $_;
|
||||
}
|
||||
push @allocableips, $_;
|
||||
}
|
||||
return \@allocableips;
|
||||
}
|
||||
@@ -550,96 +543,6 @@ sub get_allnode_singleattrib_hash
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
=head3 get_db_swtiches
|
||||
Description : Get all records of switch config from a table, then return a string list.
|
||||
Arguments : $tabname - the table name.
|
||||
Returns : Reference of the records hash.
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
sub get_db_switches
|
||||
{
|
||||
my $class = shift;
|
||||
my $table = xCAT::Table->new("switches");
|
||||
my @attribs = ("switch");
|
||||
my @entries = $table->getAllAttribs(@attribs);
|
||||
$table->close();
|
||||
my %allrecords;
|
||||
foreach (@entries)
|
||||
{
|
||||
if ($_->{'switch'}){
|
||||
$allrecords{$_->{'switch'}} = 0;
|
||||
}
|
||||
}
|
||||
return \%allrecords;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
=head3 get_db_swtichports
|
||||
Description : Get all records of switch config from a table, then return a string list.
|
||||
Arguments : $tabname - the table name.
|
||||
Returns : Reference of the records hash.
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
sub get_db_switchports
|
||||
{
|
||||
my $class = shift;
|
||||
my $table = xCAT::Table->new("switch");
|
||||
my @attribs = ("switch", "port");
|
||||
my @entries = $table->getAllAttribs(@attribs);
|
||||
$table->close();
|
||||
my %allrecords;
|
||||
foreach (@entries)
|
||||
{
|
||||
$allrecords{$_->{'switch'} . "_" . $_->{'port'}} = 0;
|
||||
}
|
||||
return \%allrecords;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
=head3 get_all_cecs
|
||||
Description : Get all CEC objects name in system.
|
||||
Arguments : hashref: if not set, return a array ref.
|
||||
if set, return a hash ref.
|
||||
Returns : ref for CECs list.
|
||||
Example :
|
||||
my $arrayref = xCAT::ProfiledNodeUtils->get_all_cecs();
|
||||
my $hashref = xCAT::ProfiledNodeUtils->get_all_cecs(1);
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
sub get_all_cecs
|
||||
{
|
||||
my $hashref = shift;
|
||||
my %cecshash;
|
||||
my @cecslist;
|
||||
|
||||
my $ppctab = xCAT::Table->new('ppc');
|
||||
my @cecs = $ppctab->getAllAttribsWhere("nodetype = 'cec'", 'node');
|
||||
foreach (@cecs) {
|
||||
if($_->{'node'}) {
|
||||
if ($hashref) {
|
||||
$cecshash{$_->{'node'}} = 1;
|
||||
} else {
|
||||
push @cecslist, $_->{'node'};
|
||||
}
|
||||
}
|
||||
}
|
||||
$ppctab->close();
|
||||
|
||||
# Return the ref accordingly
|
||||
if ($hashref) {
|
||||
return \%cecshash;
|
||||
} else {
|
||||
return \@cecslist;
|
||||
}
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
=head3 is_discover_started
|
||||
Description : Judge whether profiled nodes discovering is running or not.
|
||||
Arguments : NA
|
||||
@@ -798,14 +701,7 @@ sub check_profile_consistent{
|
||||
my $mgt = undef;
|
||||
$mgt = $mgtentry->{'mgt'} if ($mgtentry->{'mgt'});
|
||||
$nodehmtab->close();
|
||||
|
||||
#Get hardwareprofile nodetype
|
||||
my $ppctab = xCAT::Table->new('ppc');
|
||||
my $ntentry = $ppctab->getNodeAttribs($hardwareprofile, ['nodetype']);
|
||||
my $nodetype = undef;
|
||||
$nodetype = $ntentry->{'nodetype'} if ($ntentry->{'nodetype'});
|
||||
$ppctab->close();
|
||||
|
||||
|
||||
# Check if exists provision network
|
||||
if (not ($installnic and exists $netprofile_nicshash{$installnic}{"network"})){
|
||||
return 0, "Provisioning network not defined for network profile."
|
||||
@@ -824,24 +720,17 @@ sub check_profile_consistent{
|
||||
return 0, "$nictype networkprofile must use with hardwareprofile.";
|
||||
}
|
||||
}
|
||||
|
||||
# For nodetype is lpar node, not need to check the nictype as it is not required for lpar node
|
||||
if (not $nictype and $mgt and $nodetype ne 'lpar' ) {
|
||||
# define hardwareprofile, not define fsp or bmc networkprofile, and the node type is not lpar
|
||||
|
||||
if (not $nictype and $mgt) {
|
||||
# define hardwareprofile, not define fsp or bmc networkprofile
|
||||
return 0, "$profile_dict{$mgt} hardwareprofile must use with $profile_dict{$mgt} networkprofile.";
|
||||
}
|
||||
|
||||
if ($profile_dict{$mgt} ne $nictype and $nodetype ne 'lpar') {
|
||||
# Networkprofile's nictype is not consistent with hadrwareprofile's mgt, and the node type is not lpar
|
||||
if ($profile_dict{$mgt} ne $nictype) {
|
||||
# Networkprofile's nictype is not consistent with hadrwareprofile's mgt
|
||||
return 0, "Networkprofile's nictype is not consistent with hardwareprofile's mgt.";
|
||||
}
|
||||
|
||||
if ($nodetype eq 'lpar' and $nictype eq 'FSP')
|
||||
{
|
||||
# can not associate FSP network if the node type is lpar
|
||||
return 0, "The node with hardware type $nodetype can not use with $nictype networkprofile.";
|
||||
}
|
||||
|
||||
|
||||
return 1, "";
|
||||
}
|
||||
|
||||
|
||||
+12
-130
@@ -264,7 +264,7 @@ virtsd => {
|
||||
},
|
||||
|
||||
storage => {
|
||||
cols => [qw(node osvolume size state storagepool hypervisor fcprange volumetag comments disable)],
|
||||
cols => [qw(node osvolume size state storagepool fcprange volumetag comments disable)],
|
||||
keys => [qw(node)],
|
||||
table_descr => 'Node storage resources',
|
||||
descriptions => {
|
||||
@@ -276,7 +276,6 @@ storage => {
|
||||
size => 'Size of the volume. Examples include: 10G, 1024M.',
|
||||
state => 'State of the volume. The valid values are: free, used, and allocated',
|
||||
storagepool => 'Name of storage pool where the volume is assigned.',
|
||||
hypervisor => 'Name of the hypervisor where the volume is configured.',
|
||||
fcprange => 'A range of acceptable fibre channels that the volume can use. Examples include: 3B00-3C00;4B00-4C00.',
|
||||
volumetag => 'A specific tag used to identify the volume in the autoyast or kickstart template.',
|
||||
comments => 'Any user-written notes.',
|
||||
@@ -564,7 +563,7 @@ nodelist => {
|
||||
appstatustime =>'The date and time when appstatus was updated.',
|
||||
primarysn => 'Not used currently. The primary servicenode, used by this node.',
|
||||
hidden => "Used to hide fsp and bpa definitions, 1 means not show them when running lsdef and nodels",
|
||||
updatestatus => "The current node update status. Valid states are synced out-of-sync,syncing,failed.",
|
||||
updatestatus => "The current node update status. Valid states are synced and out-of-sync.",
|
||||
updatestatustime => "The date and time when the updatestatus was updated.",
|
||||
comments => 'Any user-written notes.',
|
||||
disable => "Set to 'yes' or '1' to comment out this row.",
|
||||
@@ -677,7 +676,7 @@ osimage => {
|
||||
groups => 'A comma-delimited list of image groups of which this image is a member. Image groups can be used in the litefile and litetree table instead of a single image name. Group names are arbitrary.',
|
||||
imagetype => 'The type of operating system image this definition represents (linux,AIX).',
|
||||
description => 'OS Image Description',
|
||||
provmethod => 'The provisioning method for node deployment. The valid values are install, netboot,statelite,boottarget,dualboot,sysclone. If boottarget is set, you must set linuximage.boottarget to the name of the boottarget definition. It is not used by AIX.',
|
||||
provmethod => 'The provisioning method for node deployment. The valid values are install, netboot,statelite,boottarget,dualboot. If boottarget is set, you must set linuximage.boottarget to the name of the boottarget definition. It is not used by AIX.',
|
||||
rootfstype => 'The filesystem type for the rootfs is used when the provmethod is statelite. The valid values are nfs or ramdisk. The default value is nfs',
|
||||
osdistroname => 'The name of the OS distro definition. This attribute can be used to specify which OS distro to use, instead of using the osname,osvers,and osarch attributes.',
|
||||
osupdatename => 'A comma-separated list of OS distro updates to apply to this osimage.',
|
||||
@@ -749,10 +748,10 @@ policy => {
|
||||
descriptions => {
|
||||
priority => 'The priority value for this rule. This value is used to identify this policy data object (i.e. this rule).',
|
||||
name => 'The username that is allowed to perform the commands specified by this rule. Default is "*" (all users).',
|
||||
host => 'The host from which users may issue the commands specified by this rule. Default is "*" (all hosts). Only all or one host supported. ',
|
||||
host => 'The host from which users may issue the commands specified by this rule. Default is "*" (all hosts).',
|
||||
commands => 'The list of commands that this rule applies to. Default is "*" (all commands).',
|
||||
noderange => 'The Noderange that this rule applies to. Default is "*" (all nodes). Not supported with the *def commands.',
|
||||
parameters => 'A regular expression that matches the command parameters (everything except the noderange) that this rule applies to. Default is "*" (all parameters). Not supported with the *def commands.',
|
||||
noderange => 'The Noderange that this rule applies to. Default is "*" (all nodes).',
|
||||
parameters => 'A regular expression that matches the command parameters (everything except the noderange) that this rule applies to. Default is "*" (all parameters).',
|
||||
time => 'Time ranges that this command may be executed in. This is not supported.',
|
||||
rule => 'Specifies how this rule should be applied. Valid values are: allow, accept, trusted. Allow or accept will allow the user to run the commands. Any other value will deny the user access to the commands. Trusted means that once this client has been authenticated via the certificate, all other information that is sent (e.g. the username) is believed without question. This authorization should only be given to the xcatd on the management node at this time.',
|
||||
comments => 'Any user-written notes.',
|
||||
@@ -819,7 +818,6 @@ ppchcp => {
|
||||
servicenode => {
|
||||
cols => [qw(node nameserver dhcpserver tftpserver nfsserver conserver monserver ldapserver ntpserver ftpserver nimserver ipforward dhcpinterfaces comments disable)],
|
||||
keys => [qw(node)],
|
||||
tablespace =>'XCATTBS16K',
|
||||
table_desc => 'List of all Service Nodes and services that will be set up on the Service Node.',
|
||||
descriptions => {
|
||||
node => 'The hostname of the service node as known by the Management Node.',
|
||||
@@ -984,7 +982,7 @@ site => {
|
||||
" ppctimeout: The timeout, in milliseconds, to use when communicating with PPC hw\n".
|
||||
" through HMC. It only takes effect on the hardware control commands\n".
|
||||
" through HMC. Default is 0.\n\n".
|
||||
" precreatemypostscripts: (yes/1 or no/0). Default is no. If yes, it will \n".
|
||||
" precreatemypostscripts: (yes/1 or no/0, only for Linux).Default is no. If yes, it will \n".
|
||||
" instruct xCAT at nodeset and updatenode time to query the db once for\n".
|
||||
" all of the nodes passed into the cmd and create the mypostscript file\n".
|
||||
" for each node, and put them in a directory of tftpdir(such as: /tftpboot)\n".
|
||||
@@ -1024,7 +1022,7 @@ site => {
|
||||
" useNmapfromMN: When set to yes, nodestat command should obtain the node status\n".
|
||||
" using nmap (if available) from the management node instead of the\n".
|
||||
" service node. This will improve the performance in a flat network.\n\n".
|
||||
" useSSHonAIX: (yes/1 or no/0). If yes, ssh/scp will be setup and used. If no, rsh/rcp. The support for rsh/rcp is deprecated.\n".
|
||||
" useSSHonAIX: (yes/1 or no/0). If yes, ssh/scp will be setup and used. If no,\n".
|
||||
" usexhrm: Have xCAT run its xHRM script when booting up KVM guests to set the\n".
|
||||
" virtual network bridge up correctly. See\n".
|
||||
" https://sourceforge.net/apps/mediawiki/xcat/index.php?title=XCAT_Virtualization_with_KVM#Setting_up_a_network_bridge\n\n".
|
||||
@@ -1377,7 +1375,7 @@ kitrepo => {
|
||||
},
|
||||
},
|
||||
kitcomponent => {
|
||||
cols => [qw(kitcompname description kitname kitreponame basename version release serverroles kitpkgdeps prerequisite driverpacks kitcompdeps postbootscripts genimage_postinstall exlist comments disable)],
|
||||
cols => [qw(kitcompname description kitname kitreponame basename version release serverroles kitpkgdeps driverpacks kitcompdeps postbootscripts genimage_postinstall exlist comments disable)],
|
||||
keys => [qw(kitcompname)],
|
||||
tablespace =>'XCATTBS16K',
|
||||
table_desc => 'This table stores all kit components added to the xCAT cluster.',
|
||||
@@ -1391,7 +1389,6 @@ kitcomponent => {
|
||||
release => 'Kit Component release.',
|
||||
serverroles => 'The types of servers that this Kit Component can install on. Valid types are: mgtnode, servicenode, compute',
|
||||
kitpkgdeps => 'Comma-separated list of packages that this kit component depends on.',
|
||||
prerequisite => 'Prerequisite for this kit component, the prerequisite includes ospkgdeps,preinstall,preupgrade,preuninstall scripts',
|
||||
driverpacks => 'Comma-separated List of driver package names. These must be full names like: pkg1-1.0-1.x86_64.rpm.',
|
||||
kitcompdeps => 'Comma-separated list of kit components that this kit component depends on.',
|
||||
postbootscripts => 'Comma-separated list of postbootscripts that will run during the node boot.',
|
||||
@@ -1436,36 +1433,6 @@ discoverydata => {
|
||||
disable => "Set to 'yes' or '1' to comment out this row.",
|
||||
},
|
||||
},
|
||||
cfgmgt => {
|
||||
cols => [qw(node cfgmgr cfgserver roles comments disable)],
|
||||
keys => [qw(node)],
|
||||
table_desc => 'Configuration management data for nodes used by non-xCAT osimage management services to install and configure software on a node. ',
|
||||
descriptions => {
|
||||
node => 'The node being managed by the cfgmgr service',
|
||||
cfgmgr => 'The name of the configuration manager service. Currently \'chef\' and \'puppet\' are supported services.',
|
||||
cfgserver => 'The xCAT node name of the chef server or puppet master',
|
||||
roles => 'The roles associated with this node as recognized by the cfgmgr for the software that is to be installed and configured. These role names map to chef recipes or puppet manifest classes that should be used for this node. For example, chef OpenStack cookbooks have roles such as mysql-master,keystone, glance, nova-controller, nova-conductor, cinder-all. ',
|
||||
comments => 'Any user-written notes.',
|
||||
disable => "Set to 'yes' or '1' to comment out this row.",
|
||||
},
|
||||
},
|
||||
mic => {
|
||||
cols => [qw(node host id nodetype bridge onboot vlog comments disable)],
|
||||
keys => [qw(node)],
|
||||
table_desc => 'The host, slot id and configuraton of the mic (Many Integrated Core).',
|
||||
descriptions => {
|
||||
node => 'The node name or group name.',
|
||||
host => 'The host node which the mic card installed on.',
|
||||
id => 'The device id of the mic node.',
|
||||
nodetype => 'The hardware type of the mic node. Generally, it is mic.',
|
||||
bridge => 'The virtual bridge on the host node which the mic connected to.',
|
||||
onboot => 'Set mic to autoboot when mpss start. Valid values: yes|no. Default is yes.',
|
||||
vlog => 'Set the Verbose Log to console. Valid values: yes|no. Default is no.',
|
||||
comments => 'Any user-provided notes.',
|
||||
disable => "Do not use. tabprune will not work if set to yes or 1",
|
||||
},
|
||||
},
|
||||
|
||||
|
||||
); # end of tabspec definition
|
||||
|
||||
@@ -1543,8 +1510,6 @@ foreach my $tabname (keys(%xCAT::ExtTab::ext_tabspec)) {
|
||||
kitcomponent => { attrs => [], attrhash => {}, objkey => 'kitcompname' },
|
||||
rack => { attrs => [], attrhash => {}, objkey => 'rackname' },
|
||||
osdistro=> { attrs => [], attrhash => {}, objkey => 'osdistroname' },
|
||||
osdistroupdate=> { attrs => [], attrhash => {}, objkey => 'osupdatename' },
|
||||
|
||||
);
|
||||
|
||||
|
||||
@@ -1965,11 +1930,6 @@ my @nodeattrs = (
|
||||
tabentry => 'mp.nodetype',
|
||||
access_tabentry => 'mp.node=attr:node',
|
||||
},
|
||||
{attr_name => 'hwtype',
|
||||
only_if => 'mgt=ipmi',
|
||||
tabentry => 'mp.nodetype',
|
||||
access_tabentry => 'mp.node=attr:node',
|
||||
},
|
||||
{attr_name => 'supernode',
|
||||
tabentry => 'ppc.supernode',
|
||||
access_tabentry => 'ppc.node=attr:node',
|
||||
@@ -2088,7 +2048,7 @@ my @nodeattrs = (
|
||||
tabentry => 'mp.id',
|
||||
access_tabentry => 'mp.node=attr:node',
|
||||
},
|
||||
{attr_name => 'slotid',
|
||||
{attr_name => 'id',
|
||||
only_if => 'mgt=ipmi',
|
||||
tabentry => 'mp.id',
|
||||
access_tabentry => 'mp.node=attr:node',
|
||||
@@ -2367,55 +2327,6 @@ my @nodeattrs = (
|
||||
tabentry => 'prescripts.end',
|
||||
access_tabentry => 'prescripts.node=attr:node',
|
||||
},
|
||||
#################
|
||||
# cfgmgt table #
|
||||
#################
|
||||
{attr_name => 'cfgmgr',
|
||||
tabentry => 'cfgmgt.cfgmgr',
|
||||
access_tabentry => 'cfgmgt.node=attr:node',
|
||||
},
|
||||
{attr_name => 'cfgserver',
|
||||
tabentry => 'cfgmgt.cfgserver',
|
||||
access_tabentry => 'cfgmgt.node=attr:node',
|
||||
},
|
||||
{attr_name => 'cfgmgtroles',
|
||||
tabentry => 'cfgmgt.roles',
|
||||
access_tabentry => 'cfgmgt.node=attr:node',
|
||||
},
|
||||
#####################
|
||||
## mic table #
|
||||
#####################
|
||||
{attr_name => 'michost',
|
||||
only_if => 'mgt=mic',
|
||||
tabentry => 'mic.host',
|
||||
access_tabentry => 'mic.node=attr:node',
|
||||
},
|
||||
{attr_name => 'micid',
|
||||
only_if => 'mgt=mic',
|
||||
tabentry => 'mic.id',
|
||||
access_tabentry => 'mic.node=attr:node',
|
||||
},
|
||||
{attr_name => 'hwtype',
|
||||
only_if => 'mgt=mic',
|
||||
tabentry => 'mic.nodetype',
|
||||
access_tabentry => 'mic.node=attr:node',
|
||||
},
|
||||
{attr_name => 'micbridge',
|
||||
only_if => 'mgt=mic',
|
||||
tabentry => 'mic.bridge',
|
||||
access_tabentry => 'mic.node=attr:node',
|
||||
},
|
||||
{attr_name => 'miconboot',
|
||||
only_if => 'mgt=mic',
|
||||
tabentry => 'mic.onboot',
|
||||
access_tabentry => 'mic.node=attr:node',
|
||||
},
|
||||
{attr_name => 'micvlog',
|
||||
only_if => 'mgt=mic',
|
||||
tabentry => 'mic.vlog',
|
||||
access_tabentry => 'mic.node=attr:node',
|
||||
},
|
||||
|
||||
); # end of @nodeattrs that applies to both nodes and groups
|
||||
|
||||
|
||||
@@ -3261,35 +3172,6 @@ push(@{$defspec{group}->{'attrs'}}, @nodeattrs);
|
||||
},
|
||||
);
|
||||
|
||||
#############################
|
||||
# osdistroupdate object #
|
||||
#############################
|
||||
@{$defspec{osdistroupdate}->{'attrs'}} = (
|
||||
{attr_name => 'osupdatename',
|
||||
tabentry => 'osdistroupdate.osupdatename',
|
||||
access_tabentry => 'osdistroupdate.osupdatename=attr:osupdatename',
|
||||
},
|
||||
{attr_name => 'osdistroname',
|
||||
tabentry => 'osdistroupdate.osdistroname',
|
||||
access_tabentry => 'osdistroupdate.osupdatename=attr:osupdatename',
|
||||
},
|
||||
{attr_name => 'dirpath',
|
||||
tabentry => 'osdistroupdate.dirpath',
|
||||
access_tabentry => 'osdistroupdate.osupdatename=attr:osupdatename',
|
||||
},
|
||||
{attr_name => 'downloadtime',
|
||||
tabentry => 'osdistroupdate.downloadtime',
|
||||
access_tabentry => 'osdistroupdate.osupdatename=attr:osupdatename',
|
||||
},
|
||||
{attr_name => 'usercomment',
|
||||
tabentry => 'osdistroupdate.comments',
|
||||
access_tabentry => 'osdistroupdate.osupdatename=attr:osupdatename',
|
||||
},
|
||||
);
|
||||
|
||||
#############################
|
||||
# kit object #
|
||||
#############################
|
||||
#############################
|
||||
# kit object #
|
||||
#############################
|
||||
@@ -3300,8 +3182,8 @@ push(@{$defspec{group}->{'attrs'}}, @nodeattrs);
|
||||
tabentry => 'kit.kitname',
|
||||
access_tabentry => 'kit.kitname=attr:kitname',
|
||||
},
|
||||
{attr_name => 'basename',
|
||||
tabentry => 'kit.basename',
|
||||
{attr_name => 'name',
|
||||
tabentry => 'kit.name',
|
||||
access_tabentry => 'kit.kitname=attr:kitname',
|
||||
},
|
||||
{attr_name => 'description',
|
||||
|
||||
@@ -238,13 +238,12 @@ sub getAllSN
|
||||
# if did not input "ALL" and there is a MN, remove it
|
||||
my @newservicenodes;
|
||||
if ((!defined($options)) || ($options ne "ALL")) {
|
||||
my @mname = xCAT::Utils->noderangecontainsMn(@servicenodes);
|
||||
if (@mname) { # if there is a MN
|
||||
foreach my $node (@servicenodes) {
|
||||
# check to see if node in MN list
|
||||
if (!(grep(/^$node$/, @mname))) { # if node not in the MN array
|
||||
push @newservicenodes, $node;
|
||||
}
|
||||
my $mname = xCAT::Utils->noderangecontainsMn(@servicenodes);
|
||||
if ($mname) { # if there is a MN
|
||||
foreach my $nodes (@servicenodes) {
|
||||
if ($mname ne ($nodes)){
|
||||
push @newservicenodes, $nodes;
|
||||
}
|
||||
}
|
||||
$servicenodetab->close;
|
||||
return @newservicenodes; # return without the MN in the array
|
||||
|
||||
+72
-11
@@ -70,7 +70,7 @@ require xCAT::NotifHandler;
|
||||
|
||||
my $dbworkerpid; #The process id of the database worker
|
||||
my $dbworkersocket;
|
||||
my $dbsockpath = "/var/run/xcat/dbworker.sock.".$$;
|
||||
my $dbsockpath = "/tmp/xcat/dbworker.sock.".$$;
|
||||
my $exitdbthread;
|
||||
my $dbobjsforhandle;
|
||||
my $intendedpid;
|
||||
@@ -159,7 +159,7 @@ sub init_dbworker {
|
||||
#This process is the database worker, it's job is to manage database queries to reduce required handles and to permit cross-process caching
|
||||
$0 = "xcatd: DB Access";
|
||||
use File::Path;
|
||||
mkpath('/var/run/xcat/');
|
||||
mkpath('/tmp/xcat/');
|
||||
use IO::Socket;
|
||||
$SIG{TERM} = $SIG{INT} = sub {
|
||||
$exitdbthread=1;
|
||||
@@ -1603,7 +1603,7 @@ sub setAttribs
|
||||
# delimit the columns of the table
|
||||
my $delimitedcol = &delimitcol($col);
|
||||
$cols = $cols . $delimitedcol . " = ?,";
|
||||
push @bind, (($$elems{$col} eq "NULL") ? undef: $$elems{$col});
|
||||
push @bind, (($$elems{$col} =~ /NULL/) ? undef: $$elems{$col});
|
||||
}
|
||||
chop($cols);
|
||||
my $cmd ;
|
||||
@@ -1786,7 +1786,7 @@ sub setAttribsWhere
|
||||
# delimit the columns of the table
|
||||
my $delimitedcol = &delimitcol($col);
|
||||
$cols = $cols . $delimitedcol . " = ?,";
|
||||
push @bind, (($$elems{$col} eq "NULL") ? undef: $$elems{$col});
|
||||
push @bind, (($$elems{$col} =~ /NULL/) ? undef: $$elems{$col});
|
||||
}
|
||||
chop($cols);
|
||||
my $cmd = "UPDATE " . $self->{tabname} . " set $cols where " . $where_clause;
|
||||
@@ -2349,6 +2349,71 @@ sub getNodeAttribs
|
||||
|
||||
#--------------------------------------------------------------------------
|
||||
|
||||
=head3 getNodeSpecAttribs
|
||||
Description: Retrieves the requested attributes which matching the specified options for a node
|
||||
Arguments:
|
||||
Noderange
|
||||
The specified options
|
||||
List of attributes
|
||||
Return:
|
||||
Attribute hash
|
||||
Example:
|
||||
my $tab = xCAT::Table->new('ppcdirect');
|
||||
my $ent = $tab->getNodeSpecAttribs($node, {username=>'HMC'}, qw/password/);
|
||||
Comments:
|
||||
The keys of the specified options can be given in the list of attributes or not,
|
||||
this routine will deal with them.
|
||||
=cut
|
||||
|
||||
#--------------------------------------------------------------------------
|
||||
|
||||
#sub getNodeSpecAttribs {
|
||||
# my $self = shift;
|
||||
# my $node = shift;
|
||||
# my %options = ();
|
||||
# my @attribs = ();
|
||||
# my @keys = ();
|
||||
# if (ref $_[0] eq 'HASH') {
|
||||
# %options = %{shift()};
|
||||
# @attribs = @_;
|
||||
# foreach my $key (keys %options) {
|
||||
# if (!grep(/^$key$/, @attribs)) {
|
||||
# push @attribs, $key;
|
||||
# }
|
||||
# }
|
||||
# } else {
|
||||
# @attribs = @_;
|
||||
# }
|
||||
# if ((keys (%options)) == 0) {
|
||||
# my $ent = $self->getNodeAttribs($node, \@attribs);
|
||||
# return $ent;
|
||||
# } else {
|
||||
# my $nodekey = "node";
|
||||
# if (defined $xCAT::Schema::tabspec{$self->{tabname}}->{nodecol}) {
|
||||
# $nodekey = $xCAT::Schema::tabspec{$self->{tabname}}->{nodecol};
|
||||
# }
|
||||
# $options{$nodekey} = $node;
|
||||
# my $ent = $self->getAttribs(\%options, \@attribs);
|
||||
# if ($ent) {
|
||||
# return $ent;
|
||||
# }
|
||||
# my ($nodeghash) = $self->{nodelist}->getAttribs({node=>$node}, "groups");
|
||||
# unless(defined($nodeghash) && defined($nodeghash->{groups})) {
|
||||
# return undef;
|
||||
# }
|
||||
# my @nodegroups = split(/,/, $nodeghash->{groups});
|
||||
# foreach my $group (@nodegroups) {
|
||||
# $options{$nodekey} = $group;
|
||||
# my $g_ret = $self->getAttribs(\%options, \@attribs);
|
||||
# if ($g_ret) {
|
||||
# return $g_ret;
|
||||
# }
|
||||
# }
|
||||
# }
|
||||
# return undef;
|
||||
#}
|
||||
#--------------------------------------------------------------------------
|
||||
|
||||
=head3 getNodeAttribs_nosub
|
||||
|
||||
Description:
|
||||
@@ -2902,14 +2967,10 @@ sub getAllNodeAttribs
|
||||
$self->{nrcache}->{$data->{$nodekey}}->{tstamp} = time();
|
||||
}
|
||||
@nodes = @{$self->{nrcache}->{$data->{$nodekey}}->{value}}; #expand node entry, to make groups expand
|
||||
|
||||
#If node not in nodelist do not add to the hash (SF 3580)
|
||||
#unless (@nodes) { #in the event of an entry not in nodelist, use entry value verbatim
|
||||
# @nodes = ($data->{$nodekey});
|
||||
#} end SF 3580
|
||||
|
||||
unless (@nodes) { #in the event of an entry not in nodelist, use entry value verbatim
|
||||
@nodes = ($data->{$nodekey});
|
||||
}
|
||||
#my $localhash = $self->getNodesAttribs(\@nodes,$attribq); #NOTE: This is stupid, rebuilds the cache for every entry, FIXME
|
||||
|
||||
foreach (@nodes)
|
||||
{
|
||||
if ($donenodes{$_}) { next; }
|
||||
|
||||
@@ -1498,10 +1498,19 @@ sub enablessh
|
||||
my ($class, $node) = @_;
|
||||
my $enablessh=1;
|
||||
|
||||
if( xCAT::Utils->isSN($node) ) {
|
||||
if( %::GLOBAL_SN_HASH ) {
|
||||
if ($::GLOBAL_SN_HASH{$node} == 1) {
|
||||
$enablessh=1; # service nodes always enabled
|
||||
|
||||
|
||||
}
|
||||
} else {
|
||||
if (xCAT::Utils->isSN($node))
|
||||
{
|
||||
$enablessh=1; # service nodes always enabled
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
# if not a service node we need to check, before enabling
|
||||
my $values;
|
||||
my @vals = xCAT::TableUtils->get_site_attribute("sshbetweennodes");
|
||||
@@ -1545,93 +1554,12 @@ sub enablessh
|
||||
$enablessh=1;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
return $enablessh;
|
||||
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
=head3 enableSSH
|
||||
Description:
|
||||
The function is same as enablessh() above. Before using this function,
|
||||
the $sn_hash for noderange, and $groups_hash for site.sshbetweennodes should be
|
||||
got. This is performance improvement.
|
||||
Arguments:
|
||||
$node -- node name
|
||||
$sn_hash -- if the node is one sn, key is the node name, and value is 1.
|
||||
if the node is not a sn, the key isn't in this hash
|
||||
$groups_hash -- there are two keys:
|
||||
1. Each group in the value of site.sshbetweennodes could be the key
|
||||
2. Each node in the groups from the value of site.sshbetweennodes , if the
|
||||
value isn't ALLGROUPS or NOGROUPS.
|
||||
|
||||
Returns:
|
||||
1 = enable ssh
|
||||
0 = do not enable ssh
|
||||
Globals:
|
||||
none
|
||||
Error:
|
||||
none
|
||||
Example:
|
||||
my $enable = xCAT::TableUtils->enableSSH($node);
|
||||
Comments:
|
||||
|
||||
=cut
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
sub enableSSH
|
||||
{
|
||||
|
||||
my ($class, $node, $sn_hash, $groups_hash) = @_;
|
||||
my $enablessh=1;
|
||||
|
||||
if( defined($sn_hash) && defined($sn_hash->{node}) && $sn_hash->{$node} == 1 ) {
|
||||
$enablessh=1; # service nodes always enabled
|
||||
|
||||
} else {
|
||||
# if not a service node we need to check, before enabling
|
||||
if (defined($groups_hash)) {
|
||||
if ($groups_hash->{ALLGROUPS} == 1)
|
||||
{
|
||||
$enablessh=1;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($groups_hash->{NOGROUPS} == 1)
|
||||
{
|
||||
$enablessh=0;
|
||||
}
|
||||
else
|
||||
{ # check to see if the node is a member of a group
|
||||
my $ismember = 0;
|
||||
$ismember = $groups_hash->{$node};
|
||||
|
||||
if ($ismember == 1)
|
||||
{
|
||||
$enablessh=1;
|
||||
}
|
||||
else
|
||||
{
|
||||
$enablessh=0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{ # does not exist, set default
|
||||
$enablessh=1;
|
||||
|
||||
}
|
||||
}
|
||||
return $enablessh;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
|
||||
+8
-28
@@ -36,13 +36,11 @@ my %usage = (
|
||||
LPAR(using Direct FSP Management) specific:
|
||||
rpower <noderange> [on|off|reset|stat|state|boot|of|sms]
|
||||
Blade(using Direct FSP Management) specific:
|
||||
rpower <noderange> [on|onstandby|off|cycle|state|sms]
|
||||
rpower <noderange> [on|off|cycle|state]
|
||||
Blade(using AMM) specific:
|
||||
rpower <noderange> [cycle|softoff] [-V|--verbose]
|
||||
zVM specific:
|
||||
rpower noderange [on|off|reset|stat|softoff]
|
||||
MIC specific:
|
||||
rpower noderange [stat|state|on|off|reset|boot]
|
||||
",
|
||||
"rbeacon" =>
|
||||
"Usage: rbeacon <noderange> [on|off|stat] [-V|--verbose]
|
||||
@@ -60,9 +58,7 @@ my %usage = (
|
||||
Blade specific:
|
||||
rvitals noderange {temp|wattage|fanspeed|leds|summary|all}
|
||||
BMC specific:
|
||||
rvitals noderange {temp|voltage|wattage|fanspeed|power|leds|lcds|summary|all}
|
||||
MIC specific:
|
||||
rvitals noderange {thermal|all}",
|
||||
rvitals noderange {temp|voltage|wattage|fanspeed|power|leds|lcds|summary|all}",
|
||||
"reventlog" =>
|
||||
"Usage: reventlog <noderange> [all [-s]|clear|<number of entries to retrieve> [-s]] [-V|--verbose]
|
||||
reventlog [-h|--help|-v|--version]",
|
||||
@@ -87,9 +83,7 @@ my %usage = (
|
||||
VMware specific:
|
||||
rinv <noderange>
|
||||
zVM specific:
|
||||
rinv noderange [all|config]
|
||||
MIC specific:
|
||||
rinv noderange [system|ver|board|core|gddr|all]",
|
||||
rinv noderange [all|config]",
|
||||
"rsetboot" =>
|
||||
"Usage: rsetboot <noderange> [net|hd|cd|floppy|def|stat] [-V|--verbose]
|
||||
rsetboot [-h|--help|-v|--version]",
|
||||
@@ -268,7 +262,7 @@ my %usage = (
|
||||
"lsslp" =>
|
||||
"Usage: lsslp [-h|--help|-v|--version]
|
||||
lsslp [<noderange>][-V|--verbose][-i ip[,ip..]][-w][-r|-x|-z][-n][-I][-s FRAME|CEC|MM|IVM|RSA|HMC|CMM|IMM2|FSP]
|
||||
[-t tries][--vpdtable][-C counts][-T timeout]",
|
||||
[-t tries][--vpdtable][-C counts][-T timeout][--flexdiscover]",
|
||||
"rflash" =>
|
||||
"Usage:
|
||||
rflash [ -h|--help|-v|--version]
|
||||
@@ -323,24 +317,10 @@ my %usage = (
|
||||
renergy noderange [-V] { all | { [savingstatus] [dsavingstatus] [cappingstatus] [cappingmaxmin] [cappingvalue] [cappingsoftmin] [averageAC] [averageDC] [ambienttemp] [exhausttemp] [CPUspeed] [syssbpower] [sysIPLtime] [fsavingstatus] [ffoMin] [ffoVmin] [ffoTurbo] [ffoNorm] [ffovalue] } }
|
||||
renergy noderange [-V] { {savingstatus}={on | off} | {dsavingstatus}={on-norm | on-maxp | off} | {fsavingstatus}={on | off} | {ffovalue}=MHZ | {cappingstatus}={on | off} | {cappingwatt}=watt | {cappingperc}=percentage }
|
||||
|
||||
BladeCenter specific :
|
||||
For Management Modules:
|
||||
renergy noderange [-V] { all | pd1all | pd2all | [pd1status] [pd2status] [pd1policy] [pd2policy] [pd1powermodule1] [pd1powermodule2] [pd2powermodule1] [pd2powermodule2] [pd1avaiablepower] [pd2avaiablepower] [pd1reservedpower] [pd2reservedpower] [pd1remainpower] [pd2remainpower] [pd1inusedpower] [pd2inusedpower] [availableDC] [averageAC] [thermaloutput] [ambienttemp] [mmtemp] }
|
||||
For a blade server nodes:
|
||||
renergy noderange [-V] { all | [averageDC] [capability] [cappingvalue] [CPUspeed] [maxCPUspeed] [savingstatus] [dsavingstatus] }
|
||||
renergy noderange [-V] { savingstatus={on | off} | dsavingstatus={on-norm | on-maxp | off} }
|
||||
|
||||
Flex specific :
|
||||
For Flex Management Modules:
|
||||
renergy noderange [-V] { all | [powerstatus] [powerpolicy] [powermodule] [avaiablepower] [reservedpower] [remainpower] [inusedpower] [availableDC] [averageAC] [thermaloutput] [ambienttemp] [mmtemp] }
|
||||
|
||||
For Flex node (power and x86):
|
||||
renergy noderange [-V] { all | [averageDC] [capability] [cappingvalue] [cappingmaxmin] [cappingmax] [cappingmin] [cappingGmin] [CPUspeed] [maxCPUspeed] [savingstatus] [dsavingstatus] }
|
||||
renergy noderange [-V] { cappingstatus={on | off} | cappingwatt=watt | cappingperc=percentage | savingstatus={on | off} | dsavingstatus={on-norm | on-maxp | off} }
|
||||
|
||||
iDataPlex specific :
|
||||
renergy noderange [-V] [ { cappingmaxmin | cappingmax | cappingmin } ] [cappingstatus] [cappingvalue] [relhistogram]
|
||||
renergy noderange [-V] { cappingstatus={on | enable | off | disable} | {cappingwatt|cappingvalue}=watt }",
|
||||
Blade specific :
|
||||
renergy noderange [-V] { all | pd1all | pd2all | { [pd1status] [pd2status] [pd1policy] [pd2policy] [pd1powermodule1] [pd1powermodule2] [pd2powermodule1] [pd2powermodule2] [pd1avaiablepower] [pd2avaiablepower] [pd1reservedpower] [pd2reservedpower] [pd1remainpower] [pd2remainpower] [pd1inusedpower] [pd2inusedpower] [availableDC] [averageAC] [thermaloutput] [ambienttemp] [mmtemp] } }
|
||||
renergy noderange [-V] { all | { [averageDC] [capability] [cappingvalue] [CPUspeed] [maxCPUspeed] [savingstatus] [dsavingstatus] } }
|
||||
renergy noderange [-V] { {savingstatus}={on | off} | {dsavingstatus}={on-norm | on-maxp | off} }",
|
||||
"updatenode" =>
|
||||
"Usage:
|
||||
updatenode [-h|--help|-v|--version]
|
||||
|
||||
+15
-90
@@ -1307,10 +1307,6 @@ sub runxcmd_output
|
||||
{
|
||||
push @$::xcmd_outref, @{$resp->{data}};
|
||||
}
|
||||
if (defined($resp->{status}))
|
||||
{
|
||||
push @$::xcmd_outref, @{$resp->{status}};
|
||||
}
|
||||
if (defined($resp->{node}))
|
||||
{
|
||||
my $node = $resp->{node}->[0];
|
||||
@@ -1382,10 +1378,6 @@ sub runxcmd_output2
|
||||
{
|
||||
push @{$::xcmd_outref_hash->{data}}, @{$resp->{data}};
|
||||
}
|
||||
if (defined($resp->{status}))
|
||||
{
|
||||
push @{$::xcmd_outref_hash->{status}}, @{$resp->{status}};
|
||||
}
|
||||
if (defined($resp->{node}))
|
||||
{
|
||||
push @{$::xcmd_outref_hash->{node}}, @{$resp->{node}};
|
||||
@@ -3125,7 +3117,7 @@ sub isSELINUX
|
||||
=head3 noderangecontainsMN
|
||||
Returns:
|
||||
returns nothing, if ManagementNode is not the input noderange
|
||||
returns array of MN, if Management Node(s) is in the input noderange
|
||||
returns name of MN, if Management Node is in the input noderange
|
||||
Globals:
|
||||
none
|
||||
Error:
|
||||
@@ -3133,7 +3125,7 @@ sub isSELINUX
|
||||
Input:
|
||||
array of nodes in the noderange
|
||||
Example:
|
||||
my @mn=xCAT::Utils->noderangecontainsMN($noderange);
|
||||
my $mn=xCAT::Utils->noderangecontainsMN($noderange);
|
||||
Comments:
|
||||
=cut
|
||||
|
||||
@@ -3142,30 +3134,26 @@ sub noderangecontainsMn
|
||||
{
|
||||
my ($class, @noderange)=@_;
|
||||
# check if any node in the noderange is the Management Node return the
|
||||
# name
|
||||
my @mnames; # management node names in the database, members of __mgmtnode
|
||||
# name
|
||||
my $mname;
|
||||
my $tab = xCAT::Table->new('nodelist');
|
||||
my @nodelist=$tab->getAllNodeAttribs(['node','groups']);
|
||||
foreach my $n (@nodelist) {
|
||||
if (defined($n->{'groups'})) {
|
||||
my @groups=split(",",$n->{'groups'});
|
||||
if ((grep (/__mgmtnode/,@groups))) { # this is the MN
|
||||
push @mnames,$n->{'node'};
|
||||
$mname=$n->{'node'};
|
||||
last;
|
||||
}
|
||||
}
|
||||
}
|
||||
my @MNs; # management node names found the noderange
|
||||
if (@mnames) { # if any Management Node defined in the database
|
||||
foreach my $mn (@mnames) {
|
||||
if (grep(/^$mn$/, @noderange)) { # if MN in the noderange
|
||||
push @MNs, $mn;
|
||||
}
|
||||
}
|
||||
if (@MNs) { # management nodes in the noderange
|
||||
return @MNs;
|
||||
if ($mname) { # if Management Node defined in the database
|
||||
if (grep(/$mname/, @noderange)) { # if MN in the noderange
|
||||
return $mname;
|
||||
} else {
|
||||
return ;
|
||||
}
|
||||
}
|
||||
return; # if no MN in the noderange, return nothing
|
||||
}
|
||||
|
||||
=head3 filter_nodes
|
||||
@@ -3256,14 +3244,12 @@ sub filter_nodes{
|
||||
if (@args && ($cmd eq "rspconfig")) {
|
||||
if (!(grep /^(cec_off_policy|pending_power_on_side)/, @args)) {
|
||||
push @{$mpnodes}, @ngpfsp;
|
||||
if (grep /^(network=)/, @args) {
|
||||
push @{$mpnodes}, @ngpbmc;
|
||||
}
|
||||
} else {
|
||||
push @{$fspnodes}, @ngpfsp;
|
||||
}
|
||||
if (grep /^(network|textid)/, @args) {
|
||||
push @{$mpnodes}, @ngpbmc;
|
||||
} else {
|
||||
push @{$bmcnodes}, @ngpbmc;
|
||||
}
|
||||
} elsif($cmd eq "getmacs") {
|
||||
if (@args && (grep /^-D$/,@args)) {
|
||||
push @{$fspnodes}, @ngpfsp;
|
||||
@@ -3277,11 +3263,7 @@ sub filter_nodes{
|
||||
push @{$mpnodes}, @ngpfsp;
|
||||
}
|
||||
} elsif ($cmd eq "renergy") {
|
||||
if (grep /^(relhistogram)/, @args) {
|
||||
push @{$bmcnodes}, @ngpbmc;
|
||||
} else {
|
||||
push @{$mpnodes}, @ngpbmc;
|
||||
}
|
||||
push @{$mpnodes}, @ngpbmc;
|
||||
push @{$mpnodes}, @ngpfsp;
|
||||
} else {
|
||||
push @{$fspnodes}, @ngpfsp;
|
||||
@@ -3293,61 +3275,4 @@ sub filter_nodes{
|
||||
return 0;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
=head3 filter_nostatusupdate()
|
||||
|
||||
filter out the nodes which support provision status feedback from the status-nodes hash
|
||||
Returns:
|
||||
returns the filtered status-nodes hash
|
||||
Globals:
|
||||
none
|
||||
Error:
|
||||
none
|
||||
Input:
|
||||
the ref of status-nodes hash to filter
|
||||
Example:
|
||||
my $mn=xCAT::Utils->filter_nostatusupdate(\%statusnodehash);
|
||||
Comments:
|
||||
=cut
|
||||
#-------------------------------------------------------------------------------
|
||||
sub filter_nostatusupdate{
|
||||
|
||||
my ($class,$inref)=@_;
|
||||
my $nttabdata;
|
||||
my @allnodes=();
|
||||
#read "nodetype" table to get the "os" attribs for all the nodes with status "installing" or "netbooting"
|
||||
if(exists $inref->{$::STATUS_INSTALLING}){
|
||||
push @allnodes, @{$inref->{$::STATUS_INSTALLING}};
|
||||
}
|
||||
if(exists $inref->{$::STATUS_NETBOOTING}){
|
||||
push @allnodes, @{$inref->{$::STATUS_NETBOOTING}};
|
||||
}
|
||||
|
||||
my $nodetypetab = xCAT::Table->new('nodetype');
|
||||
if ($nodetypetab) {
|
||||
$nttabdata = $nodetypetab->getNodesAttribs(\@allnodes, ['node', 'os']);
|
||||
$nodetypetab->close();
|
||||
}
|
||||
|
||||
#filter out the nodes which support the node provision status feedback
|
||||
my @nodesfiltered=();
|
||||
if(exists $inref->{$::STATUS_INSTALLING}){
|
||||
map{ if($nttabdata->{$_}->[0]->{os} !~ /(fedora|rh|centos|sles|ubuntu)/) {push @nodesfiltered,$_;} } @{$inref->{$::STATUS_INSTALLING}};
|
||||
delete $inref->{$::STATUS_INSTALLING};
|
||||
if(@nodesfiltered){
|
||||
@{$inref->{$::STATUS_INSTALLING}}=@nodesfiltered;
|
||||
}
|
||||
}
|
||||
|
||||
@nodesfiltered=();
|
||||
if(exists $inref->{$::STATUS_NETBOOTING}){
|
||||
map{ if($nttabdata->{$_}->[0]->{os} !~ /(fedora|rh|centos|sles|ubuntu)/) {push @nodesfiltered,$_;} } @{$inref->{$::STATUS_NETBOOTING}};
|
||||
delete $inref->{$::STATUS_NETBOOTING};
|
||||
if(@nodesfiltered){
|
||||
@{$inref->{$::STATUS_NETBOOTING}}=@nodesfiltered;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
Executable → Regular
-2
@@ -27,7 +27,6 @@ require Exporter;
|
||||
"1237641529.260981" => "centos5.3",
|
||||
"1272326751.405938" => "centos5.5",
|
||||
"1330913492.861127" => "centos5.8",#x86_64
|
||||
"1357930415.252042" => "centos5.9",#x86_64
|
||||
"1195488871.805863" => "centos4.6",
|
||||
"1195487524.127458" => "centos4.6",
|
||||
"1301444731.448392" => "centos5.6",
|
||||
@@ -64,7 +63,6 @@ require Exporter;
|
||||
"1305067719.718814" => "rhelhpc6.1",#x86_64
|
||||
"1321545261.599847" => "rhelhpc6.2",#x86_64
|
||||
"1339640148.070971" => "rhelhpc6.3",#x86_64
|
||||
"1359576195.413831" => "rhelhpc6.4",#x86_64, RHEL ComputeNode
|
||||
"1194015916.783841" => "fedora8",
|
||||
"1194015385.299901" => "fedora8",
|
||||
"1210112435.291709" => "fedora9",
|
||||
|
||||
@@ -208,7 +208,7 @@ sub getNic {
|
||||
Arguments : User (root or non-root)
|
||||
Node
|
||||
Returns : Network names
|
||||
Example : my $lans = xCAT::zvmCPUtils->getNetworkNames($user, $node);
|
||||
Example : my $lans = xCAT::zvmCPUtils->getNetworkNames($node);
|
||||
|
||||
=cut
|
||||
|
||||
@@ -260,7 +260,7 @@ sub getNetworkNames {
|
||||
Arguments : User (root or non-root)
|
||||
Node
|
||||
Returns : Array of networks names
|
||||
Example : my @networks = xCAT::zvmCPUtils->getNetworkNamesArray($user, $node);
|
||||
Example : my @networks = xCAT::zvmCPUtils->getNetworkNamesArray($node);
|
||||
|
||||
=cut
|
||||
|
||||
|
||||
+42
-793
@@ -12,8 +12,6 @@ package xCAT::zvmUtils;
|
||||
use xCAT::MsgUtils;
|
||||
use xCAT::Utils;
|
||||
use xCAT::Table;
|
||||
use xCAT::NetworkUtils;
|
||||
use File::Basename;
|
||||
use strict;
|
||||
use warnings;
|
||||
1;
|
||||
@@ -290,7 +288,7 @@ sub printLn {
|
||||
my $rsp;
|
||||
my $type = "I";
|
||||
if ($str =~ m/error/i) { # Set to print error if the string contains error
|
||||
$type = "E";
|
||||
$type = "E";
|
||||
}
|
||||
|
||||
$rsp->{data}->[0] = "$str";
|
||||
@@ -872,36 +870,6 @@ sub checkOutput {
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head3 checkOutputExtractReason
|
||||
|
||||
Description : Check the return of given output. If bad, extract the reason.
|
||||
Arguments : Output string
|
||||
Reason (passed as a reference)
|
||||
Returns : 0 Good output
|
||||
-1 Bad output
|
||||
Example : my $rtn = xCAT::zvmUtils->checkOutput($callback, $out, \$reason);
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
sub checkOutputExtractReason {
|
||||
my ( $class, $callback, $out, $reason ) = @_;
|
||||
|
||||
# Check output string
|
||||
my @outLn = split("\n", $out);
|
||||
foreach (@outLn) {
|
||||
# If output contains 'ERROR: ', return -1 and pass back the reason.
|
||||
if ($_ =~ /(.*?ERROR: )/) {
|
||||
$$reason = substr($_, index($_, "ERROR: ") + length("ERROR: "));
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head3 getDeviceNode
|
||||
|
||||
Description : Get the device node for a given address
|
||||
@@ -924,14 +892,14 @@ sub getDeviceNode {
|
||||
|
||||
# Determine device node
|
||||
my $out = `ssh $user\@$node "$sudo cat /proc/dasd/devices" | grep ".$tgtAddr("`;
|
||||
my @words = split(' ', $out);
|
||||
my @words = split( ' ', $out );
|
||||
my $tgtDevNode;
|
||||
|
||||
# /proc/dasd/devices look similar to this:
|
||||
# 0.0.0100(ECKD) at ( 94: 0) is dasda : active at blocksize: 4096, 1802880 blocks, 7042 MB
|
||||
# Look for the string 'is'
|
||||
my $i = 0;
|
||||
while ($tgtDevNode ne 'is') {
|
||||
while ( $tgtDevNode ne 'is' ) {
|
||||
$tgtDevNode = $words[$i];
|
||||
$i++;
|
||||
}
|
||||
@@ -941,39 +909,6 @@ sub getDeviceNode {
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head3 getDeviceNodeAddr
|
||||
|
||||
Description : Get the virtual device address for a given device node
|
||||
Arguments : User (root or non-root)
|
||||
Node
|
||||
Device node
|
||||
Returns : Virtual device address
|
||||
Example : my $addr = xCAT::zvmUtils->getDeviceNodeAddr($user, $node, $deviceNode);
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
sub getDeviceNodeAddr {
|
||||
my ( $class, $user, $node, $deviceNode ) = @_;
|
||||
|
||||
my $sudo = "sudo";
|
||||
if ($user eq "root") {
|
||||
$sudo = "";
|
||||
}
|
||||
|
||||
# Find device node and determine virtual address
|
||||
# /proc/dasd/devices look similar to this:
|
||||
# 0.0.0100(ECKD) at ( 94: 0) is dasda : active at blocksize: 4096, 1802880 blocks, 7042 MB
|
||||
my $addr = `ssh $user\@$node "$sudo cat /proc/dasd/devices" | grep -i "is $deviceNode"`;
|
||||
$addr =~ s/ +/ /g;
|
||||
$addr =~ s/^0.0.([0-9a-f]*).*/$1/;
|
||||
chomp($addr);
|
||||
|
||||
return $addr;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head3 isAddressUsed
|
||||
|
||||
Description : Check if a given address is used
|
||||
@@ -1155,23 +1090,16 @@ sub createMacAddr {
|
||||
return -1;
|
||||
}
|
||||
|
||||
# Get USER Prefix
|
||||
my $prefix = `ssh -o ConnectTimeout=5 $user\@$hcp "$sudo /sbin/vmcp q vmlan" | egrep -i "USER Prefix:"`;
|
||||
$prefix =~ s/(.*?)USER Prefix:(.*)/$2/;
|
||||
$prefix =~ s/^\s+//;
|
||||
$prefix =~ s/\s+$//;
|
||||
|
||||
# Get MACADDR Prefix instead if USER Prefix is not defined
|
||||
if (!$prefix) {
|
||||
$prefix = `ssh -o ConnectTimeout=5 $user\@$hcp "$sudo /sbin/vmcp q vmlan" | egrep -i "MACADDR Prefix:"`;
|
||||
$prefix =~ s/(.*?)MACADDR Prefix:(.*)/$2/;
|
||||
$prefix =~ s/^\s+//;
|
||||
$prefix =~ s/\s+$//;
|
||||
|
||||
if (!$prefix) {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
# Get HCP MAC address
|
||||
# Get the first MAC address found
|
||||
my $out = `ssh -o ConnectTimeout=5 $user\@$hcp "$sudo /sbin/vmcp q v nic" | grep "MAC:"`;
|
||||
my @lines = split( "\n", $out );
|
||||
my @vars = split( " ", $lines[0] );
|
||||
|
||||
# Extract MAC prefix
|
||||
my $prefix = $vars[1];
|
||||
$prefix = xCAT::zvmUtils->replaceStr( $prefix, "-", "" );
|
||||
$prefix = substr( $prefix, 0, 6 );
|
||||
|
||||
# Generate MAC address of source node
|
||||
my $mac = $prefix . $suffix;
|
||||
@@ -1572,7 +1500,7 @@ sub getFreeAddress {
|
||||
} else {
|
||||
# When the node is down, use zHCP to get its user directory entry
|
||||
# Get HCP
|
||||
my @propNames = ('hcp', 'userid');
|
||||
my @propNames = ( 'hcp', 'userid' );
|
||||
my $propVals = xCAT::zvmUtils->getNodeProps( 'zvm', $node, @propNames );
|
||||
my $hcp = $propVals->{'hcp'};
|
||||
|
||||
@@ -1590,9 +1518,9 @@ sub getFreeAddress {
|
||||
}
|
||||
|
||||
# Get all defined device address
|
||||
$allUsedAddr = `cat $userDirEntry | awk '$1 ~/^($deviceTypesUserDir)/ {print $2}' | sort`;
|
||||
$allUsedAddr = `cat $allUsedAddr | awk '$1 ~/^($deviceTypesUserDir)/ {print $2}' | sort`;
|
||||
# Get all linked device address
|
||||
$allUsedAddr .= `cat $userDirEntry | awk '$1 ~/^(LINK)/ {print $4}' | sort`;
|
||||
$allUsedAddr .= `cat $allUsedAddr | awk '$1 ~/^(LINK)/ {print $4}' | sort`;
|
||||
}
|
||||
|
||||
# Loop to get the lowest free address
|
||||
@@ -1642,7 +1570,7 @@ sub getUsedCpuTime {
|
||||
$time =~ s/^\s+//;
|
||||
$time =~ s/\s+$//;
|
||||
if (!$time) {
|
||||
$time = 0;
|
||||
$time = 0;
|
||||
}
|
||||
|
||||
# Not found, return 0
|
||||
@@ -2136,7 +2064,7 @@ sub smapi4xcat {
|
||||
my $out = `ssh $user\@$hcp "$sudo $dir/smcli Query_API_Functional_Level -T $hcpUserId"`;
|
||||
$out = xCAT::zvmUtils->trimStr($out);
|
||||
if ( !($out =~ m/V6.2/i || $out =~ m/V6.1/i || $out =~ m/V5.4/i) ) {
|
||||
return 1;
|
||||
return 1;
|
||||
}
|
||||
|
||||
# Check if SMAPI EXEC exists
|
||||
@@ -2237,20 +2165,20 @@ sub querySSI {
|
||||
|
||||
#-------------------------------------------------------
|
||||
sub rExecute {
|
||||
my ( $class, $user, $node, $cmd ) = @_;
|
||||
|
||||
my $out;
|
||||
my $sudo = "sudo";
|
||||
my ( $class, $user, $node, $cmd ) = @_;
|
||||
|
||||
my $out;
|
||||
my $sudo = "sudo";
|
||||
if ($user eq "root") {
|
||||
# Just execute the command if root
|
||||
# Just execute the command if root
|
||||
$out = `ssh $user\@$node "$cmd"`;
|
||||
return $out;
|
||||
}
|
||||
|
||||
# Encapsulate command in single quotes
|
||||
$cmd = "'" . $cmd . "'";
|
||||
$out = `ssh $user\@$node "$sudo sh -c $cmd"`;
|
||||
return $out;
|
||||
# Encapsulate command in single quotes
|
||||
$cmd = "'" . $cmd . "'";
|
||||
$out = `ssh $user\@$node "$sudo sh -c $cmd"`;
|
||||
return $out;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------
|
||||
@@ -2267,8 +2195,8 @@ sub rExecute {
|
||||
|
||||
#-------------------------------------------------------
|
||||
sub getUsedFcpDevices {
|
||||
my ( $class, $user, $hcp ) = @_;
|
||||
|
||||
my ( $class, $user, $hcp ) = @_;
|
||||
|
||||
# Directory where zFCP pools are
|
||||
my $pool = "/var/opt/zhcp/zfcp";
|
||||
|
||||
@@ -2276,15 +2204,15 @@ sub getUsedFcpDevices {
|
||||
if ($user eq "root") {
|
||||
$sudo = "";
|
||||
}
|
||||
|
||||
# Grep the pools for used or allocated zFCP devices
|
||||
my %usedDevices;
|
||||
my @args;
|
||||
my @devices = split("\n", `ssh $user\@$hcp "$sudo cat $pool/*.conf" | egrep -i "used|allocated"`);
|
||||
foreach (@devices) {
|
||||
@args = split(",", $_);
|
||||
|
||||
# Sample pool configuration file:
|
||||
|
||||
# Grep the pools for used or allocated zFCP devices
|
||||
my %usedDevices;
|
||||
my @args;
|
||||
my @devices = split("\n", `ssh $user\@$hcp "$sudo cat $pool/*.conf" | egrep -i "used|allocated"`);
|
||||
foreach (@devices) {
|
||||
@args = split(",", $_);
|
||||
|
||||
# Sample pool configuration file:
|
||||
# #status,wwpn,lun,size,range,owner,channel,tag
|
||||
# used,1000000000000000,2000000000000110,8g,3B00-3B3F,ihost1,1a23,$root_device$
|
||||
# free,1000000000000000,2000000000000111,,3B00-3B3F,,,
|
||||
@@ -2293,688 +2221,9 @@ sub getUsedFcpDevices {
|
||||
|
||||
# Push used or allocated devices into hash
|
||||
if ($args[6]) {
|
||||
$usedDevices{uc($args[6])} = 1;
|
||||
$usedDevices{uc($args[6])} = 1;
|
||||
}
|
||||
}
|
||||
|
||||
return %usedDevices;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head3 establishMount
|
||||
|
||||
Description : Establish an NFS mount point on a zHCP system.
|
||||
Arguments : Sudoer user name
|
||||
Sudo keyword
|
||||
zHCP hostname
|
||||
Local directory to remotely mount
|
||||
Mount access ('ro' for read only, 'rw' for read write)
|
||||
Directory as known to zHCP (out)
|
||||
Returns : 0 - Mounted, or zHCP and MN are on the same system
|
||||
1 - Mount failed
|
||||
Example : establishMount( $callback, $::SUDOER, $::SUDO, $hcp, "$installRoot/$provMethod", "ro", \$remoteDeployDir );
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
sub establishMount {
|
||||
# Get inputs
|
||||
my ($class, $callback, $sudoer, $sudo, $hcp, $localDir, $access, $mountedPt) = @_;
|
||||
my $out;
|
||||
|
||||
# If the target system is not on this system then establish the NFS mount point.
|
||||
my $hcpIP = xCAT::NetworkUtils->getipaddr( $hcp );
|
||||
if (! defined $hcpIP) {
|
||||
xCAT::zvmUtils->printLn( $callback, "(Error) Unable to obtain the IP address of the hcp node" );
|
||||
return 1;
|
||||
}
|
||||
|
||||
my $masterIp = xCAT::TableUtils->get_site_Master();
|
||||
if (! defined $masterIp) {
|
||||
xCAT::zvmUtils->printLn( $callback, "$hcp: (Error) Unable to obtain the management node IP address from the site table" );
|
||||
return 1;
|
||||
}
|
||||
|
||||
if ($masterIp eq $hcpIP) {
|
||||
# xCAT MN and zHCP are on the same box and will use the same directory without the need for an NFS mount.
|
||||
$$mountedPt = $localDir;
|
||||
} else {
|
||||
# Determine the hostname for this management node
|
||||
my $masterHostname = Sys::Hostname::hostname();
|
||||
if (! defined $masterHostname) {
|
||||
# For some reason, the xCAT MN's hostname is not known. We pass along the IP address instead.
|
||||
$masterHostname = $masterIp;
|
||||
}
|
||||
|
||||
xCAT::zvmUtils->printSyslog( "establishMount() Preparing the NFS mount point on zHCP ($hcpIP) to xCAT MN $masterHostname($masterIp) for $localDir" );
|
||||
|
||||
# Prepare the staging mount point on zHCP, if they need to be established
|
||||
$$mountedPt = "/mnt/$masterHostname$localDir";
|
||||
my $rc = `ssh $sudoer\@$hcp "$sudo mkdir -p $$mountedPt && mount -t nfs -o $access $masterIp:$localDir $$mountedPt; echo \\\$?"`;
|
||||
|
||||
# Return code = 0 (mount succeeded) or 32 (mount already exists)
|
||||
if ($rc != '0' && $rc != '32') {
|
||||
xCAT::zvmUtils->printLn( $callback, "$hcp: (Error) Unable to establish zHCP mount point: $$mountedPt" );
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head3 getFreeRepoSpace
|
||||
|
||||
Description : Get the free space of image repository under /install
|
||||
Arguments : Node
|
||||
Returns : The available space for /install
|
||||
Example : my $free = getFreeRepoSpace($callback, $node);
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
sub getFreeRepoSpace {
|
||||
# Get inputs
|
||||
my ($class, $user, $node) = @_;
|
||||
|
||||
my $sudo = "sudo";
|
||||
if ($user eq "root") {
|
||||
$sudo = "";
|
||||
}
|
||||
|
||||
# Check if node is the management node
|
||||
my @entries = xCAT::TableUtils->get_site_attribute("master");
|
||||
my $master = xCAT::zvmUtils->trimStr($entries[0]);
|
||||
my $ip = xCAT::NetworkUtils->getipaddr($node);
|
||||
$ip = xCAT::zvmUtils->trimStr($ip);
|
||||
my $mn = 0;
|
||||
if ($master eq $ip) {
|
||||
# If the master IP and node IP match, then it is the management node
|
||||
my $out = `$sudo /bin/df -h /install | sed 1d`;
|
||||
$out =~ s/\h+/ /g;
|
||||
my @results = split(' ', $out);
|
||||
return ($results[3]);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head3 findAndUpdatezFcpPool
|
||||
|
||||
Description : Find and update a SCSI/FCP device in a given storage pool.
|
||||
xCAT will find and update the SCSI/FCP device in all known pools based on the unique WWPN/LUN combo.
|
||||
Arguments : Message header
|
||||
User (root or non-root)
|
||||
zHCP
|
||||
Storage pool
|
||||
Criteria hash including:
|
||||
- Status (free, reserved, or used)
|
||||
- zFCP channel
|
||||
- WWPN
|
||||
- LUN
|
||||
- Size requested
|
||||
- Owner
|
||||
- Tag
|
||||
Returns : Results hash including:
|
||||
- Return code (0 = Success, -1 = Failure)
|
||||
- zFCP device (if one is requested)
|
||||
- WWPN
|
||||
- LUN
|
||||
Example : my $resultsRef = xCAT::zvmUtils->findAndUpdatezFcpPool($callback, $header, $user, $hcp, $pool, $criteriaRef);
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
sub findAndUpdatezFcpPool {
|
||||
# Get inputs
|
||||
my ($class, $callback, $header, $user, $hcp, $pool, $criteriaRef) = @_;
|
||||
|
||||
# Determine if sudo is used
|
||||
my $sudo = "sudo";
|
||||
if ($user eq "root") {
|
||||
$sudo = "";
|
||||
}
|
||||
|
||||
# Directory where executables are on zHCP
|
||||
my $dir = "/opt/zhcp/bin";
|
||||
|
||||
# Directory where FCP disk pools are on zHCP
|
||||
my $zfcpDir = "/var/opt/zhcp/zfcp";
|
||||
|
||||
my %results = ('rc' => -1); # Default to error
|
||||
|
||||
# Extract criteria
|
||||
my %criteria = %$criteriaRef;
|
||||
my $status = defined($criteria{status}) ? $criteria{status} : "";
|
||||
my $fcpDevice = defined($criteria{fcp}) ? $criteria{fcp} : "";
|
||||
my $wwpn = defined($criteria{wwpn}) ? $criteria{wwpn} : "";
|
||||
my $lun = defined($criteria{lun}) ? $criteria{lun} : "";
|
||||
my $size = defined($criteria{size}) ? $criteria{size} : "";
|
||||
my $owner = defined($criteria{owner}) ? $criteria{owner} : "";
|
||||
my $tag = defined($criteria{tag}) ? $criteria{tag} : "";
|
||||
|
||||
# Check required arguments: pool, status
|
||||
# If you do not know what to update, why update!
|
||||
if (!$pool && !$status) {
|
||||
return \%results;
|
||||
}
|
||||
|
||||
# Check status
|
||||
if ($status !~ m/^(free|used|reserved)$/i) {
|
||||
xCAT::zvmUtils->printLn($callback, "$header: (Error) Status not recognized. Status can be free, used, or reserved.");
|
||||
return \%results;
|
||||
}
|
||||
|
||||
# Check FCP device syntax
|
||||
if ($fcpDevice && ($fcpDevice !~ /^auto/i) && ($fcpDevice =~ /[^0-9a-f]/i)) {
|
||||
xCAT::zvmUtils->printLn($callback, "$header: (Error) Invalid FCP channel address $fcpDevice.");
|
||||
return \%results;
|
||||
}
|
||||
|
||||
# Check WWPN and LUN syntax
|
||||
if ( $wwpn && ($wwpn =~ /[^0-9a-f;"]/i) ) {
|
||||
xCAT::zvmUtils->printLn( $callback, "$header: (Error) Invalid world wide portname $wwpn." );
|
||||
return \%results;
|
||||
} if ( $lun && ($lun =~ /[^0-9a-f]/i) ) {
|
||||
xCAT::zvmUtils->printLn( $callback, "$header: (Error) Invalid logical unit number $lun." );
|
||||
return \%results;
|
||||
}
|
||||
|
||||
# Size can be M(egabytes) or G(igabytes). Convert size into MB.
|
||||
my $originSize = $size;
|
||||
if ($size) {
|
||||
if ($size =~ m/G/i) {
|
||||
# Convert to MegaBytes
|
||||
$size =~ s/\D//g;
|
||||
$size = int($size) * 1024
|
||||
} elsif ($size =~ m/M/i || !$size) {
|
||||
# Do nothing
|
||||
} else {
|
||||
xCAT::zvmUtils->printLn( $callback, "$header: (Error) Size not recognized. Size can be M(egabytes) or G(igabytes)." );
|
||||
return \%results;
|
||||
}
|
||||
}
|
||||
|
||||
# Check if WWPN and LUN are given
|
||||
# WWPN can be given as a semi-colon separated list (multipathing)
|
||||
my $useWwpnLun = 0;
|
||||
if ($wwpn && $lun) {
|
||||
xCAT::zvmUtils->printLn($callback, "$header: Using given WWPN and LUN");
|
||||
$useWwpnLun = 1;
|
||||
|
||||
# Make sure WWPN and LUN do not have 0x prefix
|
||||
$wwpn = xCAT::zvmUtils->replaceStr($wwpn, "0x", "");
|
||||
$lun = xCAT::zvmUtils->replaceStr($lun, "0x", "");
|
||||
}
|
||||
|
||||
# Find disk pool (create one if non-existent)
|
||||
my $out;
|
||||
if (!(`ssh $user\@$hcp "$sudo test -d $zfcpDir && echo Exists"`)) {
|
||||
# Create pool directory
|
||||
$out = `ssh $user\@$hcp "$sudo mkdir -p $zfcpDir"`;
|
||||
}
|
||||
|
||||
# Find if disk pool exists
|
||||
if (!(`ssh $user\@$hcp "$sudo test -e $zfcpDir/$pool.conf && echo Exists"`)) {
|
||||
# Return if xCAT is expected to find a FCP device, but no disk pool exists.
|
||||
xCAT::zvmUtils->printLn($callback, "$header: (Error) FCP storage pool does not exist");
|
||||
return \%results;
|
||||
}
|
||||
|
||||
# Find a free disk in the pool
|
||||
# FCP devices are contained in /var/opt/zhcp/zfcp/<pool-name>.conf
|
||||
my $range = "";
|
||||
my $sizeFound = "*";
|
||||
my @info;
|
||||
if (!$useWwpnLun) {
|
||||
# Find a suitable pair of WWPN and LUN in device pool based on requested size
|
||||
# Sample pool configuration file:
|
||||
# #status,wwpn,lun,size,range,owner,channel,tag
|
||||
# used,1000000000000000,2000000000000110,8g,3B00-3B3F,ihost1,1a23,$root_device$
|
||||
# free,1000000000000000,2000000000000111,,3B00-3B3F,,,
|
||||
# free,1230000000000000;4560000000000000,2000000000000112,,3B00-3B3F,,,
|
||||
my @devices = split("\n", `ssh $user\@$hcp "$sudo cat $zfcpDir/$pool.conf" | egrep -i ^free`);
|
||||
$sizeFound = 0;
|
||||
foreach (@devices) {
|
||||
@info = split(',', $_);
|
||||
|
||||
# Check if the size is sufficient. Convert size into MB.
|
||||
if ($info[3] =~ m/G/i) {
|
||||
# Convert to MegaBytes
|
||||
$info[3] =~ s/\D//g;
|
||||
$info[3] = int($info[3]) * 1024
|
||||
} elsif ($info[3] =~ m/M/i) {
|
||||
# Do nothing
|
||||
$info[3] =~ s/\D//g;
|
||||
} else {
|
||||
next;
|
||||
}
|
||||
|
||||
# Find optimal disk based on requested size
|
||||
if ($sizeFound && $info[3] >= $size && $info[3] < $sizeFound) {
|
||||
$sizeFound = $info[3];
|
||||
$wwpn = $info[1];
|
||||
$lun = $info[2];
|
||||
$range = $info[4];
|
||||
} elsif (!$sizeFound && $info[3] >= $size) {
|
||||
$sizeFound = $info[3];
|
||||
$wwpn = $info[1];
|
||||
$lun = $info[2];
|
||||
$range = $info[4];
|
||||
}
|
||||
}
|
||||
|
||||
# Do not continue if no devices can be found
|
||||
if (!$wwpn && !$lun) {
|
||||
xCAT::zvmUtils->printLn($callback, "$header: (Error) A suitable device of $size" . "M or larger could not be found");
|
||||
return \%results;
|
||||
}
|
||||
} else {
|
||||
# Find given WWPN and LUN. Do not continue if device is used
|
||||
my $select = `ssh $user\@$hcp "$sudo cat $zfcpDir/$pool.conf" | grep -i "$wwpn,$lun"`;
|
||||
chomp($select);
|
||||
|
||||
@info = split(',', $select);
|
||||
|
||||
if ($size) {
|
||||
if ($info[3] =~ m/G/i) {
|
||||
# Convert to MegaBytes
|
||||
$info[3] =~ s/\D//g;
|
||||
$info[3] = int($info[3]) * 1024
|
||||
} elsif ($info[3] =~ m/M/i) {
|
||||
# Do nothing
|
||||
$info[3] =~ s/\D//g;
|
||||
} else {
|
||||
next;
|
||||
}
|
||||
|
||||
# Do not continue if specified device does not have enough capacity
|
||||
if ($info[3] < $size) {
|
||||
xCAT::zvmUtils->printLn($callback, "$header: (Error) FCP device $wwpn/$lun is not large enough");
|
||||
return \%results;
|
||||
}
|
||||
}
|
||||
|
||||
# Find range of the specified disk
|
||||
$range = $info[4];
|
||||
}
|
||||
|
||||
# If there are multiple paths, take the 1st one
|
||||
# Handle multi-pathing in postscript because autoyast/kickstart does not support it.
|
||||
my $origWwpn = $wwpn;
|
||||
if ($wwpn =~ m/;/i) {
|
||||
@info = split(';', $wwpn);
|
||||
$wwpn = xCAT::zvmUtils->trimStr($info[0]);
|
||||
}
|
||||
|
||||
xCAT::zvmUtils->printLn($callback, "$header: Found FCP device 0x$wwpn/0x$lun");
|
||||
|
||||
# Find a free FCP device based on the given range
|
||||
if ($fcpDevice =~ m/^auto/i) {
|
||||
my @ranges;
|
||||
my $min;
|
||||
my $max;
|
||||
my $found = 0;
|
||||
|
||||
if ($range =~ m/;/i) {
|
||||
@ranges = split(';', $range);
|
||||
} else {
|
||||
push(@ranges, $range);
|
||||
}
|
||||
|
||||
if (!$found) {
|
||||
# If the node has an eligible FCP device, use it
|
||||
my @deviceList = xCAT::zvmUtils->getDedicates($callback, $user, $owner);
|
||||
foreach (@deviceList) {
|
||||
# Check if this devide is eligible (among the range specified for disk $lun)
|
||||
@info = split(' ', $_);
|
||||
my $candidate = $info[2];
|
||||
foreach (@ranges) {
|
||||
($min, $max) = split('-', $_);
|
||||
if (hex($candidate) >= hex($min) && hex($candidate) <= hex($max)) {
|
||||
$found = 1;
|
||||
$fcpDevice = uc($candidate);
|
||||
|
||||
last;
|
||||
}
|
||||
}
|
||||
|
||||
if ($found) {
|
||||
xCAT::zvmUtils->printLn($callback, "$header: Found eligible FCP channel $fcpDevice");
|
||||
last;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!$found) {
|
||||
# If the node has no eligible FCP device, find a free one for it.
|
||||
my %usedDevices = xCAT::zvmUtils->getUsedFcpDevices($user, $hcp);
|
||||
|
||||
my $hcpUserId = xCAT::zvmCPUtils->getUserId($user, $hcp);
|
||||
$hcpUserId =~ tr/a-z/A-Z/;
|
||||
|
||||
# Find a free FCP channel
|
||||
$out = `ssh $user\@$hcp "$sudo $dir/smcli System_WWPN_Query -T $hcpUserId" | egrep -i "FCP device number|Status"`;
|
||||
my @devices = split( "\n", $out );
|
||||
for (my $i = 0; $i < @devices; $i++) {
|
||||
# Extract the device number and status
|
||||
$fcpDevice = $devices[$i];
|
||||
$fcpDevice =~ s/^FCP device number:(.*)/$1/;
|
||||
$fcpDevice =~ s/^\s+//;
|
||||
$fcpDevice =~ s/\s+$//;
|
||||
|
||||
$i++;
|
||||
my $fcpStatus = $devices[$i];
|
||||
$fcpStatus =~ s/^Status:(.*)/$1/;
|
||||
$fcpStatus =~ s/^\s+//;
|
||||
$fcpStatus =~ s/\s+$//;
|
||||
|
||||
# Only look at free FCP devices
|
||||
if ($fcpStatus =~ m/free/i) {
|
||||
# If the device number is within the specified range, exit out of loop
|
||||
# Range: 3B00-3C00;4B00-4C00;5E12-5E12
|
||||
foreach (@ranges) {
|
||||
($min, $max) = split('-', $_);
|
||||
if (hex($fcpDevice) >= hex($min) && hex($fcpDevice) <= hex($max)) {
|
||||
$fcpDevice = uc($fcpDevice);
|
||||
|
||||
# Used found FCP channel if not in use or allocated
|
||||
if (!$usedDevices{$fcpDevice}) {
|
||||
$found = 1;
|
||||
last;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# Break out of loop if FCP channel is found
|
||||
if ($found) {
|
||||
xCAT::zvmUtils->printLn($callback, "$header: Found FCP channel within acceptable range $fcpDevice");
|
||||
last;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# Do not continue if no FCP channel is found
|
||||
if (!$found) {
|
||||
xCAT::zvmUtils->printLn($callback, "$header: (Error) A suitable FCP channel could not be found");
|
||||
return \%results;
|
||||
}
|
||||
}
|
||||
|
||||
# If there are multiple devices (multipathing), take the 1st one
|
||||
if ($fcpDevice) {
|
||||
if ($fcpDevice =~ m/;/i) {
|
||||
@info = split(';', $fcpDevice);
|
||||
$fcpDevice = xCAT::zvmUtils->trimStr($info[0]);
|
||||
}
|
||||
|
||||
# Make sure channel has a length of 4
|
||||
while (length($fcpDevice) < 4) {
|
||||
$fcpDevice = "0" . $fcpDevice;
|
||||
}
|
||||
}
|
||||
|
||||
# Mark WWPN and LUN as used, free, or reserved and set the owner/channel appropriately
|
||||
# This config file keeps track of the owner of each device, which is useful in nodeset
|
||||
$size = $size . "M";
|
||||
my $select = `ssh $user\@$hcp "$sudo cat $zfcpDir/$pool.conf" | grep -i "$lun" | grep -i "$wwpn"`;
|
||||
chomp($select);
|
||||
if ($select) {
|
||||
@info = split(',', $select);
|
||||
|
||||
if (!$info[3]) {
|
||||
$info[3] = $size;
|
||||
}
|
||||
|
||||
# Do not update if WWPN/LUN pair is specified but the pair does not exist
|
||||
if (!($info[1] =~ m/$wwpn/i)) {
|
||||
xCAT::zvmUtils->printLn($callback, "$header: (Error) FCP device $wwpn/$lun does not exists");
|
||||
return \%results;
|
||||
}
|
||||
|
||||
# Entry order: status,wwpn,lun,size,range,owner,channel,tag
|
||||
# The following are never updated: wwpn, lun, size, and range
|
||||
my $update = "$status,$info[1],$info[2],$info[3],$info[4],$owner,$fcpDevice,$tag";
|
||||
my $expression = "'s#" . $select . "#" .$update . "#i'";
|
||||
$out = `ssh $user\@$hcp "$sudo sed --in-place -e $expression $zfcpDir/$pool.conf"`;
|
||||
} else {
|
||||
# Insert device entry into file
|
||||
$out = `ssh $user\@$hcp "$sudo echo \"$status,$origWwpn,$lun,$size,,$owner,$fcpDevice,$tag\" >> $zfcpDir/$pool.conf"`;
|
||||
}
|
||||
|
||||
# Generate results hash
|
||||
%results = (
|
||||
'rc' => 0,
|
||||
'fcp' => $fcpDevice,
|
||||
'wwpn' => $wwpn,
|
||||
'lun' => $lun
|
||||
);
|
||||
return \%results;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head3 findzFcpDevicePool
|
||||
|
||||
Description : Find the zFCP storage pool that contains the given zFCP device
|
||||
Arguments : User (root or non-root)
|
||||
zHCP
|
||||
WWPN
|
||||
LUN
|
||||
Returns : Storage pool where zFCP device resides
|
||||
Example : my $pool = xCAT::zvmUtils->findzFcpDevicePool($user, $hcp, $wwpn, $lun);
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
sub findzFcpDevicePool {
|
||||
|
||||
# Get inputs
|
||||
my ( $class, $user, $hcp, $wwpn, $lun ) = @_;
|
||||
|
||||
my $sudo = "sudo";
|
||||
if ($user eq "root") {
|
||||
$sudo = "";
|
||||
}
|
||||
|
||||
# Directory where FCP disk pools are on zHCP
|
||||
my $zfcpDir = "/var/opt/zhcp/zfcp";
|
||||
|
||||
# Find the pool that contains the SCSI/FCP device
|
||||
my @pools = split("\n", `ssh $user\@$hcp "$sudo grep -i -l \"$wwpn,$lun\" $zfcpDir/*.conf"`);
|
||||
my $pool = "";
|
||||
if (scalar(@pools)) {
|
||||
$pool = basename($pools[0]);
|
||||
$pool =~ s/\.[^.]+$//; # Do not use extension
|
||||
}
|
||||
|
||||
return $pool;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head3 findzFcpDeviceAttr
|
||||
|
||||
Description : Find the zFCP device attributes
|
||||
Arguments : User (root or non-root)
|
||||
zHCP
|
||||
Storage pool
|
||||
WWPN
|
||||
LUN
|
||||
Returns : Architecture of node
|
||||
Example : my $deviceRef = xCAT::zvmUtils->findzFcpDeviceAttr($user, $hcp, $wwpn, $lun);
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
sub findzFcpDeviceAttr {
|
||||
|
||||
# Get inputs
|
||||
my ( $class, $user, $hcp, $pool, $wwpn, $lun ) = @_;
|
||||
|
||||
my $sudo = "sudo";
|
||||
if ($user eq "root") {
|
||||
$sudo = "";
|
||||
}
|
||||
|
||||
# Directory where FCP disk pools are on zHCP
|
||||
my $zfcpDir = "/var/opt/zhcp/zfcp";
|
||||
|
||||
# Find the SCSI/FCP device
|
||||
# Entry order: status,wwpn,lun,size,range,owner,channel,tag
|
||||
my @info = split("\n", `ssh $user\@$hcp "$sudo grep \"$wwpn,$lun\" $zfcpDir/$pool.conf"`);
|
||||
my $entry = $info[0];
|
||||
chomp($entry);
|
||||
|
||||
# Do not continue if no device is found
|
||||
my %attrs = ();
|
||||
if (!$entry) {
|
||||
return \%attrs;
|
||||
}
|
||||
|
||||
@info = split(',', $entry);
|
||||
%attrs = (
|
||||
'status' => $info[0],
|
||||
'wwpn' => $info[1],
|
||||
'lun' => $info[2],
|
||||
'size' => $info[3],
|
||||
'range' => $info[4],
|
||||
'owner' => $info[5],
|
||||
'fcp' => $info[6],
|
||||
'tag' => $info[7]
|
||||
);
|
||||
|
||||
return \%attrs;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head3 findUsablezHcpNetwork
|
||||
|
||||
Description : Find a useable NIC shared with the zHCP for a given user Id
|
||||
Arguments : User (root or non-root)
|
||||
zHCP
|
||||
User Id to find a useable NIC on
|
||||
DHCP is used or not (0 or 1)
|
||||
Returns : NIC, device channel, and layer (2 or 3)
|
||||
Example : my ($nic, $channel, $layer) = xCAT::zvmUtils->findUsablezHcpNetwork($user, $hcp, $userId, $dhcp);
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
sub findUsablezHcpNetwork {
|
||||
# Get inputs
|
||||
my ( $class, $user, $hcp, $userId, $dhcp ) = @_;
|
||||
|
||||
my $sudo = "sudo";
|
||||
if ($user eq "root") {
|
||||
$sudo = "";
|
||||
}
|
||||
|
||||
my $nic = ''; # Usuable NIC on zHCP
|
||||
my $channel = ''; # Device channel where NIC is attached
|
||||
my $layer;
|
||||
my $i;
|
||||
my @words;
|
||||
|
||||
# Get the networks used by the zHCP
|
||||
my @hcpNetworks = xCAT::zvmCPUtils->getNetworkNamesArray($user, $hcp);
|
||||
|
||||
# Search directory entry for network name
|
||||
my $userEntry = `ssh $user\@$hcp "$sudo $::DIR/smcli Image_Query_DM -T $userId" | sed '\$d'`;
|
||||
xCAT::zvmUtils->printSyslog("findUsablezHcpNetwork() smcli Image_Query_DM -T $userId");
|
||||
xCAT::zvmUtils->printSyslog("findUsablezHcpNetwork() $userEntry");
|
||||
|
||||
my $out = `echo "$userEntry" | grep "NICDEF"`;
|
||||
my @lines = split('\n', $out);
|
||||
|
||||
# Go through each line
|
||||
for ($i = 0; $i < @lines; $i++) {
|
||||
# Go through each network device attached to zHCP
|
||||
foreach (@hcpNetworks) {
|
||||
|
||||
# If network device is found
|
||||
if ($lines[$i] =~ m/ $_/i) {
|
||||
# Get network layer
|
||||
$layer = xCAT::zvmCPUtils->getNetworkLayer($user, $hcp, $_);
|
||||
xCAT::zvmUtils->printSyslog("findUsablezHcpNetwork() NIC:$_ layer:$layer");
|
||||
|
||||
# If template using DHCP, layer must be 2
|
||||
if ((!$dhcp && $layer != 2) || (!$dhcp && $layer == 2) || ($dhcp && $layer == 2)) {
|
||||
# Save network name
|
||||
$nic = $_;
|
||||
|
||||
# Get network virtual address
|
||||
@words = split(' ', $lines[$i]);
|
||||
|
||||
# Get virtual address (channel)
|
||||
# Convert subchannel to decimal
|
||||
$channel = sprintf('%d', hex($words[1]));
|
||||
|
||||
xCAT::zvmUtils->printSyslog("findUsablezHcpNetwork() Candidate found NIC:$nic channel:$channel layer:$layer");
|
||||
return ($nic, $channel, $layer);
|
||||
} else {
|
||||
# Go to next network available
|
||||
$nic = '';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# If network device is not found
|
||||
if (!$nic) {
|
||||
# Check for user profile
|
||||
my $profileName = `echo "$userEntry" | grep "INCLUDE"`;
|
||||
if ($profileName) {
|
||||
@words = split(' ', xCAT::zvmUtils->trimStr($profileName));
|
||||
|
||||
# Get user profile
|
||||
my $userProfile = xCAT::zvmUtils->getUserProfile($user, $hcp, $words[1]);
|
||||
xCAT::zvmUtils->printSyslog("findUsablezHcpNetwork() $userProfile");
|
||||
|
||||
# Get the NICDEF statement containing the HCP network
|
||||
$out = `echo "$userProfile" | grep "NICDEF"`;
|
||||
@lines = split('\n', $out);
|
||||
|
||||
# Go through each line
|
||||
for ($i = 0; $i < @lines; $i++) {
|
||||
# Go through each network device attached to zHCP
|
||||
foreach (@hcpNetworks) {
|
||||
|
||||
# If network device is found
|
||||
if ($lines[$i] =~ m/ $_/i) {
|
||||
# Get network layer
|
||||
$layer = xCAT::zvmCPUtils->getNetworkLayer($user, $hcp, $_);
|
||||
xCAT::zvmUtils->printSyslog("findUsablezHcpNetwork() NIC:$_ layer:$layer");
|
||||
|
||||
# If template using DHCP, layer must be 2
|
||||
if ((!$dhcp && $layer != 2) || (!$dhcp && $layer == 2) || ($dhcp && $layer == 2)) {
|
||||
# Save network name
|
||||
$nic = $_;
|
||||
|
||||
# Get network virtual address
|
||||
@words = split(' ', $lines[$i]);
|
||||
|
||||
# Get virtual address (channel)
|
||||
# Convert subchannel to decimal
|
||||
$channel = sprintf('%d', hex($words[1]));
|
||||
|
||||
xCAT::zvmUtils->printSyslog("findUsablezHcpNetwork() Candidate found NIC:$nic channel:$channel layer:$layer");
|
||||
return ($nic, $channel, $layer);
|
||||
} else {
|
||||
# Go to next network available
|
||||
$nic = '';
|
||||
}
|
||||
}
|
||||
} # End of foreach
|
||||
} # End of for
|
||||
} # End of if
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
return %usedDevices;
|
||||
}
|
||||
@@ -1,326 +0,0 @@
|
||||
<html xmlns:o="urn:schemas-microsoft-com:office:office"
|
||||
xmlns:w="urn:schemas-microsoft-com:office:word"
|
||||
xmlns="http://www.w3.org/TR/REC-html40">
|
||||
|
||||
<head>
|
||||
<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
|
||||
<meta name=ProgId content=Word.Document>
|
||||
<meta name=Generator content="Microsoft Word 9">
|
||||
<meta name=Originator content="Microsoft Word 9">
|
||||
<title>Eclipse Public License - Version 1.0</title>
|
||||
<!--[if gte mso 9]><xml>
|
||||
<o:DocumentProperties>
|
||||
<o:Revision>2</o:Revision>
|
||||
<o:TotalTime>3</o:TotalTime>
|
||||
<o:Created>2004-03-05T23:03:00Z</o:Created>
|
||||
<o:LastSaved>2004-03-05T23:03:00Z</o:LastSaved>
|
||||
<o:Pages>4</o:Pages>
|
||||
<o:Words>1626</o:Words>
|
||||
<o:Characters>9270</o:Characters>
|
||||
<o:Lines>77</o:Lines>
|
||||
<o:Paragraphs>18</o:Paragraphs>
|
||||
<o:CharactersWithSpaces>11384</o:CharactersWithSpaces>
|
||||
<o:Version>9.4402</o:Version>
|
||||
</o:DocumentProperties>
|
||||
</xml><![endif]--><!--[if gte mso 9]><xml>
|
||||
<w:WordDocument>
|
||||
<w:TrackRevisions/>
|
||||
</w:WordDocument>
|
||||
</xml><![endif]-->
|
||||
<style>
|
||||
<!--
|
||||
/* Font Definitions */
|
||||
@font-face
|
||||
{font-family:Tahoma;
|
||||
panose-1:2 11 6 4 3 5 4 4 2 4;
|
||||
mso-font-charset:0;
|
||||
mso-generic-font-family:swiss;
|
||||
mso-font-pitch:variable;
|
||||
mso-font-signature:553679495 -2147483648 8 0 66047 0;}
|
||||
/* Style Definitions */
|
||||
p.MsoNormal, li.MsoNormal, div.MsoNormal
|
||||
{mso-style-parent:"";
|
||||
margin:0in;
|
||||
margin-bottom:.0001pt;
|
||||
mso-pagination:widow-orphan;
|
||||
font-size:12.0pt;
|
||||
font-family:"Times New Roman";
|
||||
mso-fareast-font-family:"Times New Roman";}
|
||||
p
|
||||
{margin-right:0in;
|
||||
mso-margin-top-alt:auto;
|
||||
mso-margin-bottom-alt:auto;
|
||||
margin-left:0in;
|
||||
mso-pagination:widow-orphan;
|
||||
font-size:12.0pt;
|
||||
font-family:"Times New Roman";
|
||||
mso-fareast-font-family:"Times New Roman";}
|
||||
p.BalloonText, li.BalloonText, div.BalloonText
|
||||
{mso-style-name:"Balloon Text";
|
||||
margin:0in;
|
||||
margin-bottom:.0001pt;
|
||||
mso-pagination:widow-orphan;
|
||||
font-size:8.0pt;
|
||||
font-family:Tahoma;
|
||||
mso-fareast-font-family:"Times New Roman";}
|
||||
@page Section1
|
||||
{size:8.5in 11.0in;
|
||||
margin:1.0in 1.25in 1.0in 1.25in;
|
||||
mso-header-margin:.5in;
|
||||
mso-footer-margin:.5in;
|
||||
mso-paper-source:0;}
|
||||
div.Section1
|
||||
{page:Section1;}
|
||||
-->
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body lang=EN-US style='tab-interval:.5in'>
|
||||
|
||||
<div class=Section1>
|
||||
|
||||
<p align=center style='text-align:center'><b>Eclipse Public License - v 1.0</b>
|
||||
</p>
|
||||
|
||||
<p><span style='font-size:10.0pt'>THE ACCOMPANYING PROGRAM IS PROVIDED UNDER
|
||||
THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE,
|
||||
REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE
|
||||
OF THIS AGREEMENT.</span> </p>
|
||||
|
||||
<p><b><span style='font-size:10.0pt'>1. DEFINITIONS</span></b> </p>
|
||||
|
||||
<p><span style='font-size:10.0pt'>"Contribution" means:</span> </p>
|
||||
|
||||
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
|
||||
in the case of the initial Contributor, the initial code and documentation
|
||||
distributed under this Agreement, and<br clear=left>
|
||||
b) in the case of each subsequent Contributor:</span></p>
|
||||
|
||||
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
|
||||
changes to the Program, and</span></p>
|
||||
|
||||
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
|
||||
additions to the Program;</span></p>
|
||||
|
||||
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>where
|
||||
such changes and/or additions to the Program originate from and are distributed
|
||||
by that particular Contributor. A Contribution 'originates' from a Contributor
|
||||
if it was added to the Program by such Contributor itself or anyone acting on
|
||||
such Contributor's behalf. Contributions do not include additions to the
|
||||
Program which: (i) are separate modules of software distributed in conjunction
|
||||
with the Program under their own license agreement, and (ii) are not derivative
|
||||
works of the Program. </span></p>
|
||||
|
||||
<p><span style='font-size:10.0pt'>"Contributor" means any person or
|
||||
entity that distributes the Program.</span> </p>
|
||||
|
||||
<p><span style='font-size:10.0pt'>"Licensed Patents " mean patent
|
||||
claims licensable by a Contributor which are necessarily infringed by the use
|
||||
or sale of its Contribution alone or when combined with the Program. </span></p>
|
||||
|
||||
<p><span style='font-size:10.0pt'>"Program" means the Contributions
|
||||
distributed in accordance with this Agreement.</span> </p>
|
||||
|
||||
<p><span style='font-size:10.0pt'>"Recipient" means anyone who
|
||||
receives the Program under this Agreement, including all Contributors.</span> </p>
|
||||
|
||||
<p><b><span style='font-size:10.0pt'>2. GRANT OF RIGHTS</span></b> </p>
|
||||
|
||||
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
|
||||
Subject to the terms of this Agreement, each Contributor hereby grants Recipient
|
||||
a non-exclusive, worldwide, royalty-free copyright license to<span
|
||||
style='color:red'> </span>reproduce, prepare derivative works of, publicly
|
||||
display, publicly perform, distribute and sublicense the Contribution of such
|
||||
Contributor, if any, and such derivative works, in source code and object code
|
||||
form.</span></p>
|
||||
|
||||
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
|
||||
Subject to the terms of this Agreement, each Contributor hereby grants
|
||||
Recipient a non-exclusive, worldwide,<span style='color:green'> </span>royalty-free
|
||||
patent license under Licensed Patents to make, use, sell, offer to sell, import
|
||||
and otherwise transfer the Contribution of such Contributor, if any, in source
|
||||
code and object code form. This patent license shall apply to the combination
|
||||
of the Contribution and the Program if, at the time the Contribution is added
|
||||
by the Contributor, such addition of the Contribution causes such combination
|
||||
to be covered by the Licensed Patents. The patent license shall not apply to
|
||||
any other combinations which include the Contribution. No hardware per se is
|
||||
licensed hereunder. </span></p>
|
||||
|
||||
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>c)
|
||||
Recipient understands that although each Contributor grants the licenses to its
|
||||
Contributions set forth herein, no assurances are provided by any Contributor
|
||||
that the Program does not infringe the patent or other intellectual property
|
||||
rights of any other entity. Each Contributor disclaims any liability to Recipient
|
||||
for claims brought by any other entity based on infringement of intellectual
|
||||
property rights or otherwise. As a condition to exercising the rights and
|
||||
licenses granted hereunder, each Recipient hereby assumes sole responsibility
|
||||
to secure any other intellectual property rights needed, if any. For example,
|
||||
if a third party patent license is required to allow Recipient to distribute
|
||||
the Program, it is Recipient's responsibility to acquire that license before
|
||||
distributing the Program.</span></p>
|
||||
|
||||
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>d)
|
||||
Each Contributor represents that to its knowledge it has sufficient copyright
|
||||
rights in its Contribution, if any, to grant the copyright license set forth in
|
||||
this Agreement. </span></p>
|
||||
|
||||
<p><b><span style='font-size:10.0pt'>3. REQUIREMENTS</span></b> </p>
|
||||
|
||||
<p><span style='font-size:10.0pt'>A Contributor may choose to distribute the
|
||||
Program in object code form under its own license agreement, provided that:</span>
|
||||
</p>
|
||||
|
||||
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
|
||||
it complies with the terms and conditions of this Agreement; and</span></p>
|
||||
|
||||
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
|
||||
its license agreement:</span></p>
|
||||
|
||||
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
|
||||
effectively disclaims on behalf of all Contributors all warranties and
|
||||
conditions, express and implied, including warranties or conditions of title
|
||||
and non-infringement, and implied warranties or conditions of merchantability
|
||||
and fitness for a particular purpose; </span></p>
|
||||
|
||||
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
|
||||
effectively excludes on behalf of all Contributors all liability for damages,
|
||||
including direct, indirect, special, incidental and consequential damages, such
|
||||
as lost profits; </span></p>
|
||||
|
||||
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iii)
|
||||
states that any provisions which differ from this Agreement are offered by that
|
||||
Contributor alone and not by any other party; and</span></p>
|
||||
|
||||
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iv)
|
||||
states that source code for the Program is available from such Contributor, and
|
||||
informs licensees how to obtain it in a reasonable manner on or through a
|
||||
medium customarily used for software exchange.<span style='color:blue'> </span></span></p>
|
||||
|
||||
<p><span style='font-size:10.0pt'>When the Program is made available in source
|
||||
code form:</span> </p>
|
||||
|
||||
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
|
||||
it must be made available under this Agreement; and </span></p>
|
||||
|
||||
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b) a
|
||||
copy of this Agreement must be included with each copy of the Program. </span></p>
|
||||
|
||||
<p><span style='font-size:10.0pt'>Contributors may not remove or alter any
|
||||
copyright notices contained within the Program. </span></p>
|
||||
|
||||
<p><span style='font-size:10.0pt'>Each Contributor must identify itself as the
|
||||
originator of its Contribution, if any, in a manner that reasonably allows
|
||||
subsequent Recipients to identify the originator of the Contribution. </span></p>
|
||||
|
||||
<p><b><span style='font-size:10.0pt'>4. COMMERCIAL DISTRIBUTION</span></b> </p>
|
||||
|
||||
<p><span style='font-size:10.0pt'>Commercial distributors of software may
|
||||
accept certain responsibilities with respect to end users, business partners
|
||||
and the like. While this license is intended to facilitate the commercial use
|
||||
of the Program, the Contributor who includes the Program in a commercial
|
||||
product offering should do so in a manner which does not create potential
|
||||
liability for other Contributors. Therefore, if a Contributor includes the
|
||||
Program in a commercial product offering, such Contributor ("Commercial
|
||||
Contributor") hereby agrees to defend and indemnify every other
|
||||
Contributor ("Indemnified Contributor") against any losses, damages and
|
||||
costs (collectively "Losses") arising from claims, lawsuits and other
|
||||
legal actions brought by a third party against the Indemnified Contributor to
|
||||
the extent caused by the acts or omissions of such Commercial Contributor in
|
||||
connection with its distribution of the Program in a commercial product
|
||||
offering. The obligations in this section do not apply to any claims or Losses
|
||||
relating to any actual or alleged intellectual property infringement. In order
|
||||
to qualify, an Indemnified Contributor must: a) promptly notify the Commercial
|
||||
Contributor in writing of such claim, and b) allow the Commercial Contributor
|
||||
to control, and cooperate with the Commercial Contributor in, the defense and
|
||||
any related settlement negotiations. The Indemnified Contributor may participate
|
||||
in any such claim at its own expense.</span> </p>
|
||||
|
||||
<p><span style='font-size:10.0pt'>For example, a Contributor might include the
|
||||
Program in a commercial product offering, Product X. That Contributor is then a
|
||||
Commercial Contributor. If that Commercial Contributor then makes performance
|
||||
claims, or offers warranties related to Product X, those performance claims and
|
||||
warranties are such Commercial Contributor's responsibility alone. Under this
|
||||
section, the Commercial Contributor would have to defend claims against the
|
||||
other Contributors related to those performance claims and warranties, and if a
|
||||
court requires any other Contributor to pay any damages as a result, the
|
||||
Commercial Contributor must pay those damages.</span> </p>
|
||||
|
||||
<p><b><span style='font-size:10.0pt'>5. NO WARRANTY</span></b> </p>
|
||||
|
||||
<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
|
||||
AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT
|
||||
WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING,
|
||||
WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
|
||||
MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
|
||||
responsible for determining the appropriateness of using and distributing the
|
||||
Program and assumes all risks associated with its exercise of rights under this
|
||||
Agreement , including but not limited to the risks and costs of program errors,
|
||||
compliance with applicable laws, damage to or loss of data, programs or
|
||||
equipment, and unavailability or interruption of operations. </span></p>
|
||||
|
||||
<p><b><span style='font-size:10.0pt'>6. DISCLAIMER OF LIABILITY</span></b> </p>
|
||||
|
||||
<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
|
||||
AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR
|
||||
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY
|
||||
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF
|
||||
THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF
|
||||
THE POSSIBILITY OF SUCH DAMAGES.</span> </p>
|
||||
|
||||
<p><b><span style='font-size:10.0pt'>7. GENERAL</span></b> </p>
|
||||
|
||||
<p><span style='font-size:10.0pt'>If any provision of this Agreement is invalid
|
||||
or unenforceable under applicable law, it shall not affect the validity or
|
||||
enforceability of the remainder of the terms of this Agreement, and without
|
||||
further action by the parties hereto, such provision shall be reformed to the
|
||||
minimum extent necessary to make such provision valid and enforceable.</span> </p>
|
||||
|
||||
<p><span style='font-size:10.0pt'>If Recipient institutes patent litigation
|
||||
against any entity (including a cross-claim or counterclaim in a lawsuit)
|
||||
alleging that the Program itself (excluding combinations of the Program with
|
||||
other software or hardware) infringes such Recipient's patent(s), then such
|
||||
Recipient's rights granted under Section 2(b) shall terminate as of the date
|
||||
such litigation is filed. </span></p>
|
||||
|
||||
<p><span style='font-size:10.0pt'>All Recipient's rights under this Agreement
|
||||
shall terminate if it fails to comply with any of the material terms or
|
||||
conditions of this Agreement and does not cure such failure in a reasonable
|
||||
period of time after becoming aware of such noncompliance. If all Recipient's
|
||||
rights under this Agreement terminate, Recipient agrees to cease use and
|
||||
distribution of the Program as soon as reasonably practicable. However,
|
||||
Recipient's obligations under this Agreement and any licenses granted by
|
||||
Recipient relating to the Program shall continue and survive. </span></p>
|
||||
|
||||
<p><span style='font-size:10.0pt'>Everyone is permitted to copy and distribute
|
||||
copies of this Agreement, but in order to avoid inconsistency the Agreement is
|
||||
copyrighted and may only be modified in the following manner. The Agreement
|
||||
Steward reserves the right to publish new versions (including revisions) of
|
||||
this Agreement from time to time. No one other than the Agreement Steward has
|
||||
the right to modify this Agreement. The Eclipse Foundation is the initial
|
||||
Agreement Steward. The Eclipse Foundation may assign the responsibility to
|
||||
serve as the Agreement Steward to a suitable separate entity. Each new version
|
||||
of the Agreement will be given a distinguishing version number. The Program
|
||||
(including Contributions) may always be distributed subject to the version of
|
||||
the Agreement under which it was received. In addition, after a new version of
|
||||
the Agreement is published, Contributor may elect to distribute the Program
|
||||
(including its Contributions) under the new version. Except as expressly stated
|
||||
in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to
|
||||
the intellectual property of any Contributor under this Agreement, whether
|
||||
expressly, by implication, estoppel or otherwise. All rights in the Program not
|
||||
expressly granted under this Agreement are reserved.</span> </p>
|
||||
|
||||
<p><span style='font-size:10.0pt'>This Agreement is governed by the laws of the
|
||||
State of New York and the intellectual property laws of the United States of
|
||||
America. No party to this Agreement will bring a legal action under this
|
||||
Agreement more than one year after the cause of action arose. Each party waives
|
||||
its rights to a jury trial in any resulting litigation.</span> </p>
|
||||
|
||||
<p class=MsoNormal><![if !supportEmptyParas]> <![endif]><o:p></o:p></p>
|
||||
|
||||
</div>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -1,5 +0,0 @@
|
||||
xcat-openstack (2.9) unstable; urgency=low
|
||||
|
||||
* Initial release
|
||||
|
||||
-- root <root@unknown> Mon, 01 Jul 2013 15:04:41 +0800
|
||||
@@ -1 +0,0 @@
|
||||
8
|
||||
@@ -1,14 +0,0 @@
|
||||
Source: xcat-openstack
|
||||
Section: admin
|
||||
Priority: extra
|
||||
Maintainer: xCAT <xcat-user@lists.sourceforge.net>
|
||||
Build-Depends: debhelper (>= 8.0.0)
|
||||
Standards-Version: 3.9.2
|
||||
#Vcs-Git: git://git.debian.org/collab-maint/xcat-openstack.git
|
||||
#Vcs-Browser: http://git.debian.org/?p=collab-maint/xcat-openstack.git;a=summary
|
||||
|
||||
Package: xcat-openstack
|
||||
Architecture: all
|
||||
Depends: xcat
|
||||
Description: Meta-Metapackage for a common, default xCAT management node setup with OpenStack
|
||||
xCAT-OpenStack is an xCAT management node package intended for at-scale management with OpenStack, including hardware management and software management.
|
||||
@@ -1,88 +0,0 @@
|
||||
Eclipse Public License - v 1.0
|
||||
|
||||
THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
|
||||
|
||||
1. DEFINITIONS
|
||||
|
||||
"Contribution" means:
|
||||
|
||||
a) in the case of the initial Contributor, the initial code and documentation distributed under this Agreement, and
|
||||
b) in the case of each subsequent Contributor:
|
||||
|
||||
i) changes to the Program, and
|
||||
|
||||
ii) additions to the Program;
|
||||
|
||||
where such changes and/or additions to the Program originate from and are distributed by that particular Contributor. A Contribution 'originates' from a Contributor if it was added to the Program by such Contributor itself or anyone acting on such Contributor's behalf. Contributions do not include additions to the Program which: (i) are separate modules of software distributed in conjunction with the Program under their own license agreement, and (ii) are not derivative works of the Program.
|
||||
|
||||
"Contributor" means any person or entity that distributes the Program.
|
||||
|
||||
"Licensed Patents " mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program.
|
||||
|
||||
"Program" means the Contributions distributed in accordance with this Agreement.
|
||||
|
||||
"Recipient" means anyone who receives the Program under this Agreement, including all Contributors.
|
||||
|
||||
2. GRANT OF RIGHTS
|
||||
|
||||
a) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, distribute and sublicense the Contribution of such Contributor, if any, and such derivative works, in source code and object code form.
|
||||
|
||||
b) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the Contribution of such Contributor, if any, in source code and object code form. This patent license shall apply to the combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license shall not apply to any other combinations which include the Contribution. No hardware per se is licensed hereunder.
|
||||
|
||||
c) Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow Recipient to distribute the Program, it is Recipient's responsibility to acquire that license before distributing the Program.
|
||||
|
||||
d) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to grant the copyright license set forth in this Agreement.
|
||||
|
||||
3. REQUIREMENTS
|
||||
|
||||
A Contributor may choose to distribute the Program in object code form under its own license agreement, provided that:
|
||||
|
||||
a) it complies with the terms and conditions of this Agreement; and
|
||||
|
||||
b) its license agreement:
|
||||
|
||||
i) effectively disclaims on behalf of all Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose;
|
||||
|
||||
ii) effectively excludes on behalf of all Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits;
|
||||
|
||||
iii) states that any provisions which differ from this Agreement are offered by that Contributor alone and not by any other party; and
|
||||
|
||||
iv) states that source code for the Program is available from such Contributor, and informs licensees how to obtain it in a reasonable manner on or through a medium customarily used for software exchange.
|
||||
|
||||
When the Program is made available in source code form:
|
||||
|
||||
a) it must be made available under this Agreement; and
|
||||
|
||||
b) a copy of this Agreement must be included with each copy of the Program.
|
||||
|
||||
Contributors may not remove or alter any copyright notices contained within the Program.
|
||||
|
||||
Each Contributor must identify itself as the originator of its Contribution, if any, in a manner that reasonably allows subsequent Recipients to identify the originator of the Contribution.
|
||||
|
||||
4. COMMERCIAL DISTRIBUTION
|
||||
|
||||
Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor ("Commercial Contributor") hereby agrees to defend and indemnify every other Contributor ("Indemnified Contributor") against any losses, damages and costs (collectively "Losses") arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Losses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense.
|
||||
|
||||
For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Contributor's responsibility alone. Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial Contributor must pay those damages.
|
||||
|
||||
5. NO WARRANTY
|
||||
|
||||
EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this Agreement , including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations.
|
||||
|
||||
6. DISCLAIMER OF LIABILITY
|
||||
|
||||
EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
7. GENERAL
|
||||
|
||||
If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
|
||||
|
||||
If Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient's patent(s), then such Recipient's rights granted under Section 2(b) shall terminate as of the date such litigation is filed.
|
||||
|
||||
All Recipient's rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipient's rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipient's obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive.
|
||||
|
||||
Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to publish new versions (including revisions) of this Agreement from time to time. No one other than the Agreement Steward has the right to modify this Agreement. The Eclipse Foundation is the initial Agreement Steward. The Eclipse Foundation may assign the responsibility to serve as the Agreement Steward to a suitable separate entity. Each new version of the Agreement will be given a distinguishing version number. The Program (including Contributions) may always be distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to distribute the Program (including its Contributions) under the new version. Except as expressly stated in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or otherwise. All rights in the Program not expressly granted under this Agreement are reserved.
|
||||
|
||||
This Agreement is governed by the laws of the State of New York and the intellectual property laws of the United States of America. No party to this Agreement will bring a legal action under this Agreement more than one year after the cause of action arose. Each party waives its rights to a jury trial in any resulting litigation.
|
||||
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
opt/xcat/lib/perl/xCAT_schema
|
||||
@@ -1 +0,0 @@
|
||||
lib/perl/xCAT_schema/* opt/xcat/lib/perl/xCAT_schema/
|
||||
@@ -1,43 +0,0 @@
|
||||
#!/usr/bin/make -f
|
||||
# -*- makefile -*-
|
||||
# Sample debian/rules that uses debhelper.
|
||||
# This file was originally written by Joey Hess and Craig Small.
|
||||
# As a special exception, when this file is copied by dh-make into a
|
||||
# dh-make output file, you may use that output file without restriction.
|
||||
# This special exception was added by Craig Small in version 0.37 of dh-make.
|
||||
|
||||
# Uncomment this to turn on verbose mode.
|
||||
#export DH_VERBOSE=1
|
||||
|
||||
build:
|
||||
pwd
|
||||
|
||||
clean:
|
||||
dh_testdir
|
||||
dh_testroot
|
||||
dh_clean -d
|
||||
|
||||
install:
|
||||
pwd
|
||||
dh_testdir
|
||||
dh_testroot
|
||||
dh_installdirs
|
||||
dh_install -X".svn"
|
||||
chmod 755 `pwd`/debian/xcat-openstack/opt/xcat/lib/perl/xCAT_schema
|
||||
chmod 644 `pwd`/debian/xcat-openstack/opt/xcat/lib/perl/xCAT_schema/*
|
||||
dh_link
|
||||
|
||||
binary-indep: build install
|
||||
pwd
|
||||
export
|
||||
dh_installman
|
||||
dh_compress
|
||||
dh_installdeb
|
||||
dh_gencontrol
|
||||
dh_md5sums
|
||||
dh_builddeb
|
||||
|
||||
binary-arch:
|
||||
pwd
|
||||
binary: binary-indep binary-arch
|
||||
.PHONY: build clean binary-indep binary-arch binary install configure
|
||||
@@ -1 +0,0 @@
|
||||
1.0
|
||||
@@ -1,106 +0,0 @@
|
||||
# IBM(c) 2013 EPL license http://www.eclipse.org/legal/epl-v10.html
|
||||
package xCAT_schema::Clouds;
|
||||
|
||||
################################################################################
|
||||
#
|
||||
# xCAT database Schema for representing OpenStack clouds in an xCAT cluster
|
||||
#
|
||||
################################################################################
|
||||
%tabspec = (
|
||||
clouds => {
|
||||
cols => [qw(name controller publicnet novanet mgtnet vmnet adminpw dbpwcomments disable)], #do not change 'disable' and 'comments', it is required by xCAT
|
||||
keys => [qw(name)],
|
||||
required => [qw(name)],
|
||||
table_desc => 'OpenStack clouds managed by this xCAT cluster',
|
||||
descriptions => {
|
||||
name => 'The name of this cloud',
|
||||
controller => 'The xCAT node name of the controller node',
|
||||
publicnet => 'The name of the network in the xCAT networks table to be used for the OpenStack public network',
|
||||
novanet => 'The name of the network in the xCAT networks table to be used for the OpenStack Nova network',
|
||||
mgtnet => 'The name of the network in the xCAT networks table to be used for the OpenStack management network',
|
||||
vmnet => 'The name of the network in the xCAT networks table to be used for the OpenStack virtual machine network',
|
||||
adminpw => 'The administrative password',
|
||||
dbpw => 'The database password',
|
||||
comments => 'Any user-written notes.',
|
||||
disable => "Set to 'yes' or '1' to comment out this row.",
|
||||
},
|
||||
},
|
||||
cloud => {
|
||||
cols => [qw(node cloudname comments disable)],
|
||||
keys => [qw(node)],
|
||||
required => [qw(node cloudname)],
|
||||
table_desc => 'xCAT nodes that are used in OpenStack clouds',
|
||||
descriptions => {
|
||||
node=> 'The xCAT node name',
|
||||
cloudname => 'The name of the cloud in the xCAT clouds table that is using this node',
|
||||
comments => 'Any user-written notes.',
|
||||
disable => "Set to 'yes' or '1' to comment out this row.",
|
||||
},
|
||||
},
|
||||
); # end of tabspec definition
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
##################################################################
|
||||
#
|
||||
# Cloud object and attributes for *def commands
|
||||
#
|
||||
##################################################################
|
||||
|
||||
# cloud object
|
||||
%defspec = (
|
||||
cloud => { attrs => [], attrhash => {}, objkey => 'name' },
|
||||
);
|
||||
|
||||
# cloud attributes
|
||||
@{$defspec{cloud}->{'attrs'}} =
|
||||
(
|
||||
{ attr_name => 'name',
|
||||
tabentry => 'clouds.name',
|
||||
access_tabentry => 'clouds.name=attr:name',
|
||||
},
|
||||
{ attr_name => 'controller',
|
||||
tabentry => 'clouds.controller',
|
||||
access_tabentry => 'clouds.name=attr:name',
|
||||
},
|
||||
{ attr_name => 'publicnet',
|
||||
tabentry => 'clouds.publicnet',
|
||||
access_tabentry => 'clouds.name=attr:name',
|
||||
},
|
||||
{ attr_name => 'novanet',
|
||||
tabentry => 'clouds.novanet',
|
||||
access_tabentry => 'clouds.name=attr:name',
|
||||
},
|
||||
{ attr_name => 'mgtnet',
|
||||
tabentry => 'clouds.mgtnet',
|
||||
access_tabentry => 'clouds.name=attr:name',
|
||||
},
|
||||
{ attr_name => 'vmnet',
|
||||
tabentry => 'clouds.vmnet',
|
||||
access_tabentry => 'clouds.name=attr:name',
|
||||
},
|
||||
{ attr_name => 'adminpw',
|
||||
tabentry => 'clouds.adminpw',
|
||||
access_tabentry => 'clouds.name=attr:name',
|
||||
},
|
||||
{ attr_name => 'dbpw',
|
||||
tabentry => 'clouds.dbpw',
|
||||
access_tabentry => 'clouds.name=attr:name',
|
||||
},
|
||||
);
|
||||
|
||||
# node attributes for clouds
|
||||
@{$defspec{node}->{'attrs'}} =
|
||||
(
|
||||
{ attr_name => 'cloud',
|
||||
tabentry => 'cloud.cloudname',
|
||||
access_tabentry => 'cloud.node=attr:node',
|
||||
},
|
||||
);
|
||||
1;
|
||||
|
||||
|
||||
@@ -1,54 +0,0 @@
|
||||
Summary: Meta-Metapackage for a common, default xCAT management node setup with OpenStack
|
||||
Name: xCAT-OpenStack
|
||||
Version: %(cat Version)
|
||||
Release: snap%(date +"%Y%m%d%H%M")
|
||||
License: EPL
|
||||
Group: Applications/System
|
||||
Vendor: IBM Corp.
|
||||
Packager: IBM Corp.
|
||||
Distribution: %{?_distribution:%{_distribution}}%{!?_distribution:%{_vendor}}
|
||||
Prefix: /opt/xcat
|
||||
BuildRoot: /var/tmp/%{name}-%{version}-%{release}-root
|
||||
#BuildArch: noarch
|
||||
Source: xCAT-OpenStack-%(cat Version).tar.gz
|
||||
|
||||
Provides: xCAT-OpenStack = %{version}
|
||||
Requires: xCAT
|
||||
|
||||
%description
|
||||
xCAT-OpenStack is an xCAT management node package intended for at-scale
|
||||
management with OpenStack, including hardware management and software
|
||||
management.
|
||||
|
||||
%prep
|
||||
%setup -q -n xCAT-OpenStack
|
||||
|
||||
%build
|
||||
|
||||
|
||||
%install
|
||||
mkdir -p $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT_schema
|
||||
|
||||
cp -a lib/perl/xCAT_schema/* $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT_schema
|
||||
find $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT_schema -type d -exec chmod 755 {} \;
|
||||
find $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT_schema -type f -exec chmod 644 {} \;
|
||||
|
||||
|
||||
%clean
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
|
||||
%files
|
||||
%{prefix}
|
||||
%defattr(-,root,root)
|
||||
|
||||
|
||||
%post
|
||||
%ifos linux
|
||||
if [ -f "/proc/cmdline" ]; then # prevent running it during install into chroot image
|
||||
if [ -f $RPM_INSTALL_PREFIX0/sbin/xcatd ]; then
|
||||
/etc/init.d/xcatd reload
|
||||
fi
|
||||
fi
|
||||
%endif
|
||||
exit 0
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
Source: xcat-ui
|
||||
Section: admin
|
||||
Priority: extra
|
||||
Maintainer: xCAT <xcat-user@lists.sourceforge.net>
|
||||
Maintainer: Arif Ali <aali@ocf.co.uk>
|
||||
Build-Depends: debhelper (>= 5)
|
||||
Standards-Version: 3.7.2
|
||||
|
||||
|
||||
@@ -75,7 +75,7 @@ function loadConfigPage() {
|
||||
tab.add('discoverTab', 'Discover', '', false);
|
||||
|
||||
// Add the self-service tab
|
||||
tab.add('serviceTab', 'Service', '', false);
|
||||
tab.add('serviceTab', 'Service', '', false);
|
||||
|
||||
// Get list of tables and their descriptions
|
||||
$.ajax({
|
||||
@@ -98,7 +98,7 @@ function loadConfigPage() {
|
||||
return;
|
||||
}
|
||||
|
||||
if (ui.index == 1) {
|
||||
if (ui.index == 1) {
|
||||
loadUpdatePage();
|
||||
} else if (ui.index == 2) {
|
||||
loadUserPage();
|
||||
|
||||
@@ -19,9 +19,9 @@ function loadServicePage(tabId) {
|
||||
|
||||
// Create radio buttons for platforms
|
||||
var hwList = $('<ol>Platforms available:</ol>');
|
||||
var esx = $('<li><input type="radio" name="hw" value="esx" checked/>ESX</li>');
|
||||
var kvm = $('<li><input type="radio" name="hw" value="kvm"/>KVM</li>');
|
||||
var zvm = $('<li><input type="radio" name="hw" value="zvm"/>z\/VM</li>');
|
||||
var esx = $('<li><input type="radio" name="hw" value="esx" disabled/>ESX</li>');
|
||||
var kvm = $('<li><input type="radio" name="hw" value="kvm" disabled/>KVM</li>');
|
||||
var zvm = $('<li><input type="radio" name="hw" value="zvm" checked/>z\/VM</li>');
|
||||
|
||||
hwList.append(esx);
|
||||
hwList.append(kvm);
|
||||
@@ -315,7 +315,7 @@ function configImagePanel(data) {
|
||||
});
|
||||
|
||||
// Create an action menu
|
||||
var actionsMenu = createMenu([refreshLnk, createLnk, editLnk, deleteLnk]);
|
||||
var actionsMenu = createMenu([createLnk, editLnk, deleteLnk, refreshLnk]);
|
||||
actionsMenu.superfish();
|
||||
actionsMenu.css('display', 'inline-block');
|
||||
actionBar.append(actionsMenu);
|
||||
@@ -868,7 +868,7 @@ function configGroupPanel(data) {
|
||||
});
|
||||
|
||||
// Create an action menu
|
||||
var actionsMenu = createMenu([refreshLnk, createLnk, editLnk, deleteLnk]);
|
||||
var actionsMenu = createMenu([createLnk, editLnk, deleteLnk, refreshLnk]);
|
||||
actionsMenu.superfish();
|
||||
actionsMenu.css('display', 'inline-block');
|
||||
actionBar.append(actionsMenu);
|
||||
@@ -955,7 +955,7 @@ function groupDialog() {
|
||||
|
||||
// Check that group attributes are provided before continuing
|
||||
var ready = 1;
|
||||
var inputs = new Array(group);
|
||||
var inputs = new Array(group, ip, hostnames);
|
||||
for (var i in inputs) {
|
||||
if (!inputs[i].val()) {
|
||||
inputs[i].css('border-color', 'red');
|
||||
@@ -1139,7 +1139,7 @@ function editGroupDialog(iGroup, iSelectable, iIp, iHostnames, iComments) {
|
||||
|
||||
// Check that group attributes are provided before continuing
|
||||
var ready = 1;
|
||||
var inputs = new Array(group);
|
||||
var inputs = new Array(group, ip, hostnames);
|
||||
for (var i in inputs) {
|
||||
if (!inputs[i].val()) {
|
||||
inputs[i].css('border-color', 'red');
|
||||
|
||||
@@ -84,35 +84,26 @@ function loadUserTable(data){
|
||||
// Add table rows
|
||||
// Start with the 2nd row (1st row is the headers)
|
||||
for (var i = 1; i < data.rsp.length; i++) {
|
||||
// Split into columns
|
||||
var cols = data.rsp[i].split(',');
|
||||
|
||||
// Trim returned data
|
||||
data.rsp[i] = jQuery.trim(data.rsp[i]);
|
||||
// Split data into columns
|
||||
var cols = data.rsp[i].split(',');
|
||||
|
||||
// Go through each column
|
||||
// Column names are: priority, name, host, commands, noderange, parameters, time, rule, comments, disable
|
||||
for (var j = 0; j < cols.length; j++) {
|
||||
|
||||
// If the column is not complete
|
||||
if (cols[j].count('"') == 1) {
|
||||
while (cols[j].count('"') != 2) {
|
||||
// Merge this column with the adjacent one
|
||||
cols[j] = cols[j] + "," + cols[j + 1];
|
||||
|
||||
// Remove merged row
|
||||
cols.splice(j + 1, 1);
|
||||
}
|
||||
}
|
||||
|
||||
// Replace quote
|
||||
cols[j] = cols[j].replace(new RegExp('"', 'g'), '');
|
||||
cols[j] = cols[j].replace(/"/g, '');
|
||||
}
|
||||
|
||||
// Set the highest priority
|
||||
priority = cols[0];
|
||||
if (priority > topPriority)
|
||||
topPriority = priority;
|
||||
|
||||
|
||||
// Add check box where name = user name
|
||||
cols.unshift('<input type="checkbox" name="' + cols[0] + '"/>');
|
||||
|
||||
|
||||
// Add row
|
||||
table.add(cols);
|
||||
}
|
||||
@@ -178,7 +169,7 @@ function loadUserTable(data){
|
||||
});
|
||||
|
||||
// Create an action menu
|
||||
var actionsMenu = createMenu([refreshLnk, createLnk, editLnk, deleteLnk]);
|
||||
var actionsMenu = createMenu([createLnk, editLnk, deleteLnk, refreshLnk]);
|
||||
actionsMenu.superfish();
|
||||
actionsMenu.css('display', 'inline-block');
|
||||
actionBar.append(actionsMenu);
|
||||
@@ -235,16 +226,8 @@ function openCreateUserDialog(data) {
|
||||
|
||||
userAttr.append($('<div><label>Priority:</label><input type="text" name="priority" disabled="disabled" value="' + priority + '" title="The priority value for this user"/></div>'));
|
||||
userAttr.append($('<div><label>User name:</label><input type="text" name="name" title="The user name to log into xCAT with"/></div>'));
|
||||
var type = $('<div><label>Type:</label></div>');
|
||||
var typeSelect = $('<select name="user_type" title="Specifies the type of user.">' +
|
||||
'<option value="guest">Guest</option>' +
|
||||
'<option value="admin">Administrator</option>' +
|
||||
'</select>');
|
||||
type.append(typeSelect);
|
||||
userAttr.append(type);
|
||||
userAttr.append($('<div><label>Password:</label><input name="password" type="password" title="The user password that will be used to log into xCAT"></div>'));
|
||||
userAttr.append($('<div><label>Confirm password:</label><input name="confirm_password" type="password" title="The user password that will be used to log into xCAT"></div>'));
|
||||
|
||||
optionAttr.append($('<div><label>Host:</label><input type="text" name="host" title="The host from which users may issue the commands specified by this rule. By default, it is all hosts."/></div>'));
|
||||
optionAttr.append($('<div><label>Commands:</label><input type="text" name="commands" title="The list of commands that this rule applies to. By default, it is all commands."/></div>'));
|
||||
optionAttr.append($('<div><label>Parameters:</label><input type="text" name="parameters" title="A regular expression that matches the command parameters (everything except the noderange) that this rule applies to. By default, it is all parameters."/></div>'));
|
||||
@@ -255,6 +238,10 @@ function openCreateUserDialog(data) {
|
||||
'<option value="trusted">Trusted</option>' +
|
||||
'<option value="deny">Deny</option>' +
|
||||
'</select></div>'));
|
||||
var rootPrivilege = $('<div><label>Root privilege:</label></div>');
|
||||
var accessCheckbox = $('<input type="checkbox" name="rootprivilege"/>');
|
||||
optionAttr.append(rootPrivilege);
|
||||
rootPrivilege.append(accessCheckbox);
|
||||
|
||||
optionAttr.append($('<div><label>Comments:</label><input type="text" name="comments" style="width: 250px;" title="Any user written notes"/></div>'));
|
||||
optionAttr.append($('<div><label>Disable:</label><select name="disable" title="Set to yes to disable the user">' +
|
||||
@@ -326,41 +313,20 @@ function openCreateUserDialog(data) {
|
||||
var args = "";
|
||||
if (usrName) {
|
||||
args += ' policy.name=' + usrName;
|
||||
} if (host) {
|
||||
args += " policy.host='" + host + "'";
|
||||
} if (commands) {
|
||||
args += " policy.commands='" + commands + "'";
|
||||
} if (parameters) {
|
||||
args += " policy.parameters='" + parameters + "'";
|
||||
} if (nodeRange) {
|
||||
args += " policy.noderange='" + nodeRange + "'";
|
||||
} if (rule) {
|
||||
args += ' policy.rule=' + rule;
|
||||
} if (disable) {
|
||||
args += ' policy.disable=' + disable;
|
||||
}
|
||||
|
||||
// Handle cases where there are value or no value
|
||||
if (host) {
|
||||
args += " policy.host='" + host + "'";
|
||||
} else {
|
||||
args += " policy.host=''";
|
||||
}
|
||||
|
||||
if (parameters) {
|
||||
args += " policy.parameters='" + parameters + "'";
|
||||
} else {
|
||||
args += " policy.parameters=''";
|
||||
}
|
||||
|
||||
if (nodeRange) {
|
||||
args += " policy.noderange='" + nodeRange + "'";
|
||||
} else {
|
||||
args += " policy.noderange=''";
|
||||
}
|
||||
|
||||
if (comments) {
|
||||
} if (comments) {
|
||||
args += " policy.comments='" + comments + "'";
|
||||
} else {
|
||||
args += " policy.comments=''";
|
||||
}
|
||||
|
||||
if (commands) {
|
||||
args += " policy.commands='" + commands + "'";
|
||||
} else {
|
||||
args += " policy.commands=''";
|
||||
}
|
||||
|
||||
// Trim any extra spaces
|
||||
@@ -410,32 +376,23 @@ function openCreateUserDialog(data) {
|
||||
});
|
||||
|
||||
// Change comments if access checkbox is checked
|
||||
typeSelect.change(function() {
|
||||
accessCheckbox.click( function(){
|
||||
var comments = createUserForm.find('input[name=comments]').val();
|
||||
var cmds = createUserForm.find('input[name=commands]').val();
|
||||
comments = jQuery.trim(comments);
|
||||
cmds = jQuery.trim(cmds);
|
||||
|
||||
var tag = "privilege:root";
|
||||
comments = jQuery.trim(comments);
|
||||
|
||||
// The list of every command used by the self-service page
|
||||
// Every command must be separated by a comma
|
||||
var authorizedCmds = "authcheck,lsdef,nodestat,tabdump,rinv,rpower,rmvm,webportal,webrun";
|
||||
|
||||
// Append tag to commands and comments
|
||||
if (typeSelect.val().indexOf("admin") > -1) {
|
||||
// Append tag to comments
|
||||
if (accessCheckbox.is(':checked')) {
|
||||
if (comments && comments.charAt(comments.length - 1) != ";") {
|
||||
comments += ";";
|
||||
}
|
||||
|
||||
comments += tag;
|
||||
createUserForm.find('input[name=comments]').val(comments);
|
||||
createUserForm.find('input[name=commands]').val("");
|
||||
createUserForm.find('input[name=comments]').val(comments);
|
||||
} else {
|
||||
comments = comments.replace(tag, "");
|
||||
comments = comments.replace(";;", ";");
|
||||
createUserForm.find('input[name=comments]').val(comments);
|
||||
createUserForm.find('input[name=commands]').val(authorizedCmds);
|
||||
createUserForm.find('input[name=comments]').val(comments);
|
||||
}
|
||||
|
||||
// Strip off leading semi-colon
|
||||
@@ -476,11 +433,8 @@ function openCreateUserDialog(data) {
|
||||
createUserForm.find('select[name=disable]').val(disable);
|
||||
|
||||
if (comments.indexOf("privilege:root") > -1) {
|
||||
typeSelect.val("admin");
|
||||
accessCheckbox.attr("checked", true);
|
||||
}
|
||||
} else {
|
||||
// Default user type to guest
|
||||
typeSelect.val("guest").change();
|
||||
}
|
||||
}
|
||||
/**
|
||||
|
||||
@@ -367,7 +367,7 @@ function addAmmNode(){
|
||||
$('#addBladeCenter').prepend(createInfoBar('AMM node was successfully added'));
|
||||
$('#addBladeCenter').dialog("option", "buttons", {
|
||||
"Close" : function() {
|
||||
$('#addBladeCenter').dialog('destroy').remove();
|
||||
$('#addBladeCenter').dialog('close');
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -547,7 +547,7 @@ function addMmScanNode(){
|
||||
msg : ''
|
||||
},
|
||||
success : function(data){
|
||||
$('#addBladeCenter').dialog('destroy').remove();
|
||||
$('#addBladeCenter').dialog('close');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -546,10 +546,10 @@ esxPlugin.prototype.addNode = function() {
|
||||
title: 'Add node',
|
||||
modal: true,
|
||||
width: 400,
|
||||
close: function() {$(this).remove();},
|
||||
close: function(){$(this).remove();},
|
||||
buttons: {
|
||||
"OK" : function() {addEsxNode();},
|
||||
"Cancel": function() {$(this).dialog('destroy').remove();}
|
||||
"OK" : function(){addEsxNode();},
|
||||
"Cancel": function(){$(this).dialog('close');}
|
||||
}
|
||||
});
|
||||
};
|
||||
@@ -587,8 +587,8 @@ function addEsxNode(){
|
||||
|
||||
// Change dialog buttons
|
||||
$('#addEsx').dialog('option', 'buttons', {
|
||||
'Close':function() {
|
||||
$('#addEsx').dialog('destroy').remove();
|
||||
'Close':function(){
|
||||
$('#addEsx').dialog('close');
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -217,7 +217,7 @@ hmcPlugin.prototype.addNode = function() {
|
||||
addHmcNode();
|
||||
},
|
||||
'Cancel' : function() {
|
||||
$('#addHmc').dialog('destroy').remove();
|
||||
$('#addHmc').dialog('close');
|
||||
}
|
||||
});
|
||||
} else {
|
||||
@@ -227,7 +227,7 @@ hmcPlugin.prototype.addNode = function() {
|
||||
// Change dialog buttons
|
||||
$('#addHmc').dialog('option', 'buttons', {
|
||||
'Cancel' : function() {
|
||||
$('#addHmc').dialog('destroy').remove();
|
||||
$('#addHmc').dialog('close');
|
||||
}
|
||||
});
|
||||
|
||||
@@ -295,7 +295,7 @@ function addHmcNode() {
|
||||
msg : ''
|
||||
},
|
||||
success : function(data) {
|
||||
$('#addHmc').dialog('destroy').remove();
|
||||
$('#addHmc').dialog('close');
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -349,7 +349,7 @@ function drawHmcSelector(hmcs) {
|
||||
addPNode();
|
||||
},
|
||||
'Cancel' : function() {
|
||||
$('#addHmc').dialog('destroy').remove();
|
||||
$('#addHmc').dialog('close');
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -466,7 +466,7 @@ function addPNode() {
|
||||
},
|
||||
success : function(data) {
|
||||
// Refresh the area on the right side
|
||||
$('#addHmc').dialog('destroy').remove();
|
||||
$('#addHmc').dialog('close');
|
||||
$('.selectgroup').trigger('click');
|
||||
}
|
||||
});
|
||||
|
||||
@@ -207,7 +207,7 @@ ipmiPlugin.prototype.addNode = function() {
|
||||
addIdataplex();
|
||||
},
|
||||
"Cancel" : function() {
|
||||
$(this).dialog('destroy').remove();
|
||||
$(this).dialog('close');
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -247,7 +247,7 @@ function addIdataplex() {
|
||||
// Change dialog buttons
|
||||
$('#addIdplx').dialog('option', 'buttons', {
|
||||
'Close' : function() {
|
||||
$('#addIdplx').dialog('destroy').remove();
|
||||
$('#addIdplx').dialog('close');
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -544,7 +544,7 @@ kvmPlugin.prototype.addNode = function() {
|
||||
close: function(){$(this).remove();},
|
||||
buttons: {
|
||||
"OK" : function(){addKvmNode();},
|
||||
"Cancel": function(){$(this).dialog('destroy').remove();}
|
||||
"Cancel": function(){$(this).dialog('close');}
|
||||
}
|
||||
});
|
||||
};
|
||||
@@ -583,7 +583,7 @@ function addKvmNode(){
|
||||
// Change dialog buttons
|
||||
$('#addKvm').dialog('option', 'buttons', {
|
||||
'Close':function(){
|
||||
$('#addKvm').dialog('destroy').remove();
|
||||
$('#addKvm').dialog('close');
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
+11
-10
@@ -1854,6 +1854,7 @@ zvmPlugin.prototype.loadProvisionPage = function(tabId) {
|
||||
*/
|
||||
zvmPlugin.prototype.loadResources = function() {
|
||||
// Reset resource table
|
||||
setDiskDataTable('');
|
||||
setNetworkDataTable('');
|
||||
|
||||
// Get hardware control points
|
||||
@@ -2034,12 +2035,12 @@ zvmPlugin.prototype.addNode = function() {
|
||||
|
||||
// If there are no errors
|
||||
if (ready) {
|
||||
$('#addZvm').append(createLoader());
|
||||
$('#addZvm').append(createLoader());
|
||||
|
||||
// Change dialog buttons
|
||||
$('#addZvm').dialog('option', 'buttons', {
|
||||
'Close':function() {
|
||||
$('#addZvm').dialog('destroy').remove();
|
||||
'Close':function(){
|
||||
$('#addZvm').dialog('close');
|
||||
}
|
||||
});
|
||||
|
||||
@@ -2084,12 +2085,12 @@ zvmPlugin.prototype.addNode = function() {
|
||||
var args = "";
|
||||
if (type == 'host') {
|
||||
args = node + ';zvm.hcp=' + hcp
|
||||
+ ';nodehm.mgt=zvm;nodetype.arch=s390x;hypervisor.type=zvm;groups=' + group
|
||||
+ ';nodehm.mgt=zvm;hypervisor.type=zvm;groups=' + group
|
||||
+ ';nodetype.os=' + os;
|
||||
} else {
|
||||
args = node + ';zvm.hcp=' + hcp
|
||||
+ ';zvm.userid=' + userId
|
||||
+ ';nodehm.mgt=zvm' + ';nodetype.arch=s390x' + ';groups=' + group;
|
||||
+ ';nodehm.mgt=zvm' + ';groups=' + group;
|
||||
}
|
||||
|
||||
if (ipRange != "" && ipRange != null) {
|
||||
@@ -2163,12 +2164,12 @@ zvmPlugin.prototype.addNode = function() {
|
||||
var args = "";
|
||||
if (type == 'host') {
|
||||
args = nodeRange + ';zvm.hcp=' + hcp
|
||||
+ ';nodehm.mgt=zvm;nodetype.arch=s390x;hypervisor.type=zvm;groups=' + group
|
||||
+ ';nodehm.mgt=zvm;hypervisor.type=zvm;groups=' + group
|
||||
+ ';nodetype.os=' + os;
|
||||
} else {
|
||||
args = nodeRange + ';zvm.hcp=' + hcp
|
||||
+ ';zvm.userid=' + userIdRange
|
||||
+ ';nodehm.mgt=zvm' + ';nodetype.arch=s390x' + ';groups=' + group;
|
||||
+ ';nodehm.mgt=zvm' + ';groups=' + group;
|
||||
}
|
||||
|
||||
if (ipRange)
|
||||
@@ -2232,7 +2233,7 @@ zvmPlugin.prototype.addNode = function() {
|
||||
}
|
||||
},
|
||||
"Cancel": function(){
|
||||
$(this).dialog('destroy').remove();
|
||||
$(this).dialog( "close" );
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -2558,7 +2559,7 @@ zvmPlugin.prototype.loadLogPage = function(node) {
|
||||
logAttr.append(optsList);
|
||||
|
||||
// Create retrieve log checkbox
|
||||
var retrieveChkBox = $('<li><input type="checkbox" name="t"/></li>');
|
||||
var retrieveChkBox = $('<li><input type="checkbox" name="s"/></li>');
|
||||
optsList.append(retrieveChkBox);
|
||||
retrieveChkBox.append('Retrieve log');
|
||||
|
||||
@@ -2645,7 +2646,7 @@ zvmPlugin.prototype.loadLogPage = function(node) {
|
||||
optStr += '-' + opt;
|
||||
|
||||
// If it is the retrieve log
|
||||
if (opt == 't') {
|
||||
if (opt == 's') {
|
||||
// Append log destination
|
||||
optStr += ';' + $('#' + newTabId + ' input[name=tgtLog]').val();
|
||||
}
|
||||
|
||||
+379
-932
File diff suppressed because it is too large
Load Diff
@@ -828,10 +828,10 @@ function mkCondRespDia() {
|
||||
}
|
||||
});
|
||||
}
|
||||
$(this).dialog('destroy').remove();
|
||||
$(this).dialog('close');
|
||||
},
|
||||
'Cancel' : function() {
|
||||
$(this).dialog('destroy').remove();
|
||||
$(this).dialog('close');
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -920,7 +920,7 @@ function chCondScopeDia() {
|
||||
});
|
||||
},
|
||||
'Cancel' : function() {
|
||||
$(this).dialog('destroy').remove();
|
||||
$(this).dialog('close');
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -941,10 +941,10 @@ function mkResponseDia() {
|
||||
},
|
||||
buttons : {
|
||||
'Ok' : function() {
|
||||
$(this).dialog('destroy').remove();
|
||||
$(this).dialog('close');
|
||||
},
|
||||
'Cancel' : function() {
|
||||
$(this).dialog('destroy').remove();
|
||||
$(this).dialog('close');
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -994,7 +994,7 @@ function startStopCondRespDia() {
|
||||
},
|
||||
buttons : {
|
||||
'Close' : function() {
|
||||
$(this).dialog('destroy').remove();
|
||||
$(this).dialog('close');
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -1122,10 +1122,10 @@ function stopCondRespDia() {
|
||||
$('#rmcEventStatus div').empty().append(data.rsp[0]);
|
||||
}
|
||||
});
|
||||
$(this).dialog('destroy').remove();
|
||||
$(this).dialog('close');
|
||||
},
|
||||
'Cancel' : function() {
|
||||
$(this).dialog('destroy').remove();
|
||||
$(this).dialog('close');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
+112
-129
@@ -400,7 +400,7 @@ function mkAddNodeLink() {
|
||||
});
|
||||
|
||||
// Close dialog
|
||||
addNodeForm.dialog('destroy').remove();
|
||||
addNodeForm.dialog('close');
|
||||
});
|
||||
advanced.append(advancedLnk);
|
||||
addNodeForm.append(advanced);
|
||||
@@ -410,39 +410,39 @@ function mkAddNodeLink() {
|
||||
modal: true,
|
||||
width: 400,
|
||||
title:'Add node',
|
||||
close: function() {$(this).remove();},
|
||||
close: function(){$(this).remove();},
|
||||
buttons: {
|
||||
'Ok': function() {
|
||||
'Ok': function(){
|
||||
// Get hardware management
|
||||
var mgt = $(this).find('select[name=mgt]').val();
|
||||
|
||||
var plugin;
|
||||
switch(mgt) {
|
||||
case "kvm":
|
||||
plugin = new kvmPlugin();
|
||||
break;
|
||||
case "esx":
|
||||
plugin = new esxPlugin();
|
||||
break;
|
||||
case "blade":
|
||||
plugin = new bladePlugin();
|
||||
break;
|
||||
case "hmc":
|
||||
plugin = new hmcPlugin();
|
||||
break;
|
||||
case "ipmi":
|
||||
plugin = new ipmiPlugin();
|
||||
break;
|
||||
case "zvm":
|
||||
plugin = new zvmPlugin();
|
||||
break;
|
||||
case "kvm":
|
||||
plugin = new kvmPlugin();
|
||||
break;
|
||||
case "esx":
|
||||
plugin = new esxPlugin();
|
||||
break;
|
||||
case "blade":
|
||||
plugin = new bladePlugin();
|
||||
break;
|
||||
case "hmc":
|
||||
plugin = new hmcPlugin();
|
||||
break;
|
||||
case "ipmi":
|
||||
plugin = new ipmiPlugin();
|
||||
break;
|
||||
case "zvm":
|
||||
plugin = new zvmPlugin();
|
||||
break;
|
||||
}
|
||||
|
||||
$(this).dialog('destroy').remove();
|
||||
plugin.addNode();
|
||||
$(this).dialog('close');
|
||||
},
|
||||
'Cancel': function(){
|
||||
$(this).dialog('destroy').remove();
|
||||
$(this).dialog('close');
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -658,15 +658,6 @@ function loadNodes(data) {
|
||||
}
|
||||
});
|
||||
|
||||
// Power softoff
|
||||
var powerSoftoffLnk = $('<a>Shutdown</a>');
|
||||
powerSoftoffLnk.click(function() {
|
||||
var tgtNodes = getNodesChecked(nodesTableId);
|
||||
if (tgtNodes) {
|
||||
powerNode(tgtNodes, 'softoff');
|
||||
}
|
||||
});
|
||||
|
||||
// Turn monitoring on
|
||||
var monitorOnLnk = $('<a>Monitor on</a>');
|
||||
monitorOnLnk.click(function() {
|
||||
@@ -695,15 +686,15 @@ function loadNodes(data) {
|
||||
// Create an instance of the plugin
|
||||
var plugin;
|
||||
switch(mgt) {
|
||||
case "kvm":
|
||||
plugin = new kvmPlugin();
|
||||
break;
|
||||
case "esx":
|
||||
plugin = new esxPlugin();
|
||||
break;
|
||||
case "zvm":
|
||||
plugin = new zvmPlugin();
|
||||
break;
|
||||
case "kvm":
|
||||
plugin = new kvmPlugin();
|
||||
break;
|
||||
case "esx":
|
||||
plugin = new esxPlugin();
|
||||
break;
|
||||
case "zvm":
|
||||
plugin = new zvmPlugin();
|
||||
break;
|
||||
}
|
||||
|
||||
plugin.loadClonePage(tgtNodes[i]);
|
||||
@@ -732,7 +723,7 @@ function loadNodes(data) {
|
||||
var scriptLnk = $('<a>Run script</a>');
|
||||
scriptLnk.click(function() {
|
||||
var tgtNodes = getNodesChecked(nodesTableId);
|
||||
if (tgtNodes) {
|
||||
if (tgtNodes) {
|
||||
loadScriptPage(tgtNodes);
|
||||
}
|
||||
});
|
||||
@@ -740,21 +731,21 @@ function loadNodes(data) {
|
||||
// Migrate VM
|
||||
var migrateLnk = $('<a>Migrate</a>');
|
||||
migrateLnk.click(function() {
|
||||
var tgtNodes = getNodesChecked(nodesTableId).split(',');
|
||||
var mgt = "", tmp = "";
|
||||
var tgtNodes = getNodesChecked(nodesTableId).split(',');
|
||||
var mgt = "", tmp = "";
|
||||
for (var i in tgtNodes) {
|
||||
tmp = getNodeAttr(tgtNodes[i], 'mgt');
|
||||
tmp = getNodeAttr(tgtNodes[i], 'mgt');
|
||||
if (!mgt) {
|
||||
mgt = tmp
|
||||
mgt = tmp
|
||||
} else {
|
||||
if (tmp != mgt) {
|
||||
openDialog('warn', "You can pick only one type (mgt) of node to migrate!");
|
||||
return;
|
||||
}
|
||||
if (tmp != mgt) {
|
||||
openDialog('warn', "You can pick only one type (mgt) of node to migrate!");
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Create an instance of the plugin
|
||||
// Create an instance of the plugin
|
||||
var plugin;
|
||||
switch(mgt) {
|
||||
// Only hypervisors support migration
|
||||
@@ -855,24 +846,24 @@ function loadNodes(data) {
|
||||
// Create an instance of the plugin
|
||||
var plugin;
|
||||
switch(mgt) {
|
||||
case "kvm":
|
||||
plugin = new kvmPlugin();
|
||||
break;
|
||||
case "esx":
|
||||
plugin = new esxPlugin();
|
||||
break;
|
||||
case "blade":
|
||||
plugin = new bladePlugin();
|
||||
break;
|
||||
case "hmc":
|
||||
plugin = new hmcPlugin();
|
||||
break;
|
||||
case "ipmi":
|
||||
plugin = new ipmiPlugin();
|
||||
break;
|
||||
case "zvm":
|
||||
plugin = new zvmPlugin();
|
||||
break;
|
||||
case "kvm":
|
||||
plugin = new kvmPlugin();
|
||||
break;
|
||||
case "esx":
|
||||
plugin = new esxPlugin();
|
||||
break;
|
||||
case "blade":
|
||||
plugin = new bladePlugin();
|
||||
break;
|
||||
case "hmc":
|
||||
plugin = new hmcPlugin();
|
||||
break;
|
||||
case "ipmi":
|
||||
plugin = new ipmiPlugin();
|
||||
break;
|
||||
case "zvm":
|
||||
plugin = new zvmPlugin();
|
||||
break;
|
||||
}
|
||||
|
||||
plugin.loadLogPage(tgtNodes[i]);
|
||||
@@ -881,7 +872,7 @@ function loadNodes(data) {
|
||||
|
||||
// Actions
|
||||
var actionsLnk = '<a>Actions</a>';
|
||||
var actsMenu = createMenu([cloneLnk, deleteLnk, migrateLnk, monitorOnLnk, monitorOffLnk, powerOnLnk, powerOffLnk, scriptLnk, powerSoftoffLnk]);
|
||||
var actsMenu = createMenu([cloneLnk, deleteLnk, migrateLnk, monitorOnLnk, monitorOffLnk, powerOnLnk, powerOffLnk, scriptLnk]);
|
||||
|
||||
// Configurations
|
||||
var configLnk = '<a>Configuration</a>';
|
||||
@@ -1355,7 +1346,7 @@ function addNodes2Table(data) {
|
||||
$('.node').bind('click', loadNode);
|
||||
|
||||
// Close dialog for updating table
|
||||
$('.ui-dialog-content').dialog('destroy').remove();
|
||||
$('.ui-dialog-content').dialog('close');
|
||||
|
||||
/**
|
||||
* Enable editable columns
|
||||
@@ -1363,8 +1354,8 @@ function addNodes2Table(data) {
|
||||
// Do not make 1st, 2nd, 3rd, 4th, 5th, or 6th column editable
|
||||
$('#' + nodesTableId + ' td:not(td:nth-child(1),td:nth-child(2),td:nth-child(3),td:nth-child(4),td:nth-child(5),td:nth-child(6))').editable(
|
||||
function(value, settings) {
|
||||
// If users did not do changes, return the value directly
|
||||
// jeditable save the old value in this.revert
|
||||
//if users did not do changes, return the value directly
|
||||
//jeditable save the old value in this.revert
|
||||
if ($(this).attr('revert') == value){
|
||||
return value;
|
||||
}
|
||||
@@ -1636,24 +1627,24 @@ function loadNode(e) {
|
||||
// Create an instance of the plugin
|
||||
var plugin;
|
||||
switch(mgt) {
|
||||
case "kvm":
|
||||
plugin = new kvmPlugin();
|
||||
break;
|
||||
case "esx":
|
||||
plugin = new esxPlugin();
|
||||
break;
|
||||
case "blade":
|
||||
plugin = new bladePlugin();
|
||||
break;
|
||||
case "hmc":
|
||||
plugin = new hmcPlugin();
|
||||
break;
|
||||
case "ipmi":
|
||||
plugin = new ipmiPlugin();
|
||||
break;
|
||||
case "zvm":
|
||||
plugin = new zvmPlugin();
|
||||
break;
|
||||
case "kvm":
|
||||
plugin = new kvmPlugin();
|
||||
break;
|
||||
case "esx":
|
||||
plugin = new esxPlugin();
|
||||
break;
|
||||
case "blade":
|
||||
plugin = new bladePlugin();
|
||||
break;
|
||||
case "hmc":
|
||||
plugin = new hmcPlugin();
|
||||
break;
|
||||
case "ipmi":
|
||||
plugin = new ipmiPlugin();
|
||||
break;
|
||||
case "zvm":
|
||||
plugin = new zvmPlugin();
|
||||
break;
|
||||
}
|
||||
|
||||
// Get tab area where a new tab will be inserted
|
||||
@@ -1758,13 +1749,13 @@ function loadUnlockPage(tgtNodes) {
|
||||
*/
|
||||
var unlockBtn = createButton('Unlock');
|
||||
unlockBtn.css({
|
||||
'width': '80px',
|
||||
'display': 'block'
|
||||
'width': '80px',
|
||||
'display': 'block'
|
||||
});
|
||||
unlockBtn.click(function() {
|
||||
// Remove any warning messages
|
||||
$(this).parents('.ui-tabs-panel').find('.ui-state-error').remove();
|
||||
|
||||
// Remove any warning messages
|
||||
$(this).parents('.ui-tabs-panel').find('.ui-state-error').remove();
|
||||
|
||||
// If a password is given
|
||||
var password = $('#' + newTabId + ' input[name=password]').css('border', 'solid #BDBDBD 1px');
|
||||
if (password.val()) {
|
||||
@@ -1822,7 +1813,7 @@ function loadScriptPage(tgtNodes) {
|
||||
// Create remote script form
|
||||
var scriptForm = $('<div class="form"></div>');
|
||||
|
||||
// Create status bar
|
||||
// Create status bar
|
||||
var barId = 'scriptStatusBar' + inst;
|
||||
var statBar = createStatusBar(barId);
|
||||
statBar.hide();
|
||||
@@ -1896,12 +1887,12 @@ function loadScriptPage(tgtNodes) {
|
||||
*/
|
||||
var runBtn = createButton('Run');
|
||||
runBtn.css({
|
||||
'width': '80px'
|
||||
'width': '80px'
|
||||
});
|
||||
runBtn.click(function() {
|
||||
// Remove any warning messages
|
||||
$(this).parents('.ui-tabs-panel').find('.ui-state-error').remove();
|
||||
|
||||
// Remove any warning messages
|
||||
$(this).parents('.ui-tabs-panel').find('.ui-state-error').remove();
|
||||
|
||||
// Get script to run
|
||||
var textarea = $('#' + newTabId + ' textarea').css('border', 'solid #BDBDBD 1px');
|
||||
|
||||
@@ -2010,7 +2001,7 @@ function loadDeletePage(tgtNodes) {
|
||||
// Create delete form
|
||||
var deleteForm = $('<div class="form"></div>');
|
||||
|
||||
// Create status bar, hide on load
|
||||
// Create status bar, hide on load
|
||||
var statBarId = 'deleteStatusBar' + inst;
|
||||
var statBar = createStatusBar(statBarId).hide();
|
||||
|
||||
@@ -2032,30 +2023,22 @@ function loadDeletePage(tgtNodes) {
|
||||
|
||||
// Confirm delete
|
||||
var instr = $('<p>Are you sure you want to delete <b>' + tgtNodesStr + '</b>?</p>').css('word-wrap', 'break-word');
|
||||
var dbOnly = $('<div><input type="checkbox" name="db-only"/>Only delete entries in database</div>');
|
||||
confirmAttr.append(instr);
|
||||
confirmAttr.append(dbOnly);
|
||||
|
||||
/**
|
||||
* Delete
|
||||
*/
|
||||
var deleteBtn = createButton('Delete');
|
||||
deleteBtn.click(function() {
|
||||
var cmd = "rmvm";
|
||||
// Only delete entries in database if checked
|
||||
if ($("#" + newTabId + " input[name='db-only']").attr('checked')) {
|
||||
cmd = "noderm";
|
||||
}
|
||||
|
||||
// Delete the virtual server
|
||||
$.ajax( {
|
||||
url : 'lib/cmd.php',
|
||||
dataType : 'json',
|
||||
data : {
|
||||
cmd : cmd,
|
||||
cmd : 'rmvm',
|
||||
tgt : tgtNodes,
|
||||
args : '',
|
||||
msg : 'out=' + statBarId + ';cmd=' + cmd + ';tgt=' + tgtNodes
|
||||
msg : 'out=' + statBarId + ';cmd=rmvm;tgt=' + tgtNodes
|
||||
},
|
||||
|
||||
success : updateStatusBar
|
||||
@@ -2118,6 +2101,18 @@ function updateStatusBar(data) {
|
||||
if (prg.html().indexOf('Error') > -1) {
|
||||
failed = true;
|
||||
}
|
||||
|
||||
// Update data table
|
||||
var rowPos;
|
||||
for (var i in tgts) {
|
||||
if (!failed) {
|
||||
// Get row containing the node link and delete it
|
||||
rowPos = findRow(tgts[i], '#' + nodesTableId, 1);
|
||||
dTable.fnDeleteRow(rowPos);
|
||||
}
|
||||
}
|
||||
|
||||
adjustColumnSize(nodesTableId);
|
||||
} else if (cmd == 'xdsh') {
|
||||
// Hide loader
|
||||
$('#' + statBarId).find('img').hide();
|
||||
@@ -2140,13 +2135,6 @@ function updateStatusBar(data) {
|
||||
|
||||
// Enable buttons
|
||||
$('#' + statBarId).parent().find('button').removeAttr('disabled');
|
||||
} else if (cmd == 'noderm') {
|
||||
// Hide loader
|
||||
$('#' + statBarId).find('img').hide();
|
||||
|
||||
// Write ajax response to status bar
|
||||
var prg = $('<pre>Entries deleted in database</pre>');
|
||||
$('#' + statBarId).find('div').append(prg);
|
||||
} else {
|
||||
// Hide loader
|
||||
$('#' + statBarId).find('img').hide();
|
||||
@@ -2164,7 +2152,7 @@ function updateStatusBar(data) {
|
||||
*/
|
||||
function updatePowerStatus(data) {
|
||||
// Hide power loader
|
||||
var powerCol = $('#' + nodesTableId + '_wrapper .dataTables_scrollHead .datatable thead tr th:eq(3)');
|
||||
var powerCol = $('#' + nodesTableId + '_wrapper .dataTables_scrollHead .datatable thead tr th:eq(3)');
|
||||
powerCol.find('img').hide();
|
||||
|
||||
// Get datatable
|
||||
@@ -2218,8 +2206,8 @@ function runScript(inst) {
|
||||
|
||||
var statBarId = 'scriptStatusBar' + inst;
|
||||
$('#' + statBarId).show(); // Show status bar
|
||||
$('#' + statBarId + ' img').show(); // Show loader
|
||||
$('#' + statBarId + ' p').remove(); // Clear status bar
|
||||
$('#' + statBarId + ' img').show(); // Show loader
|
||||
$('#' + statBarId + ' p').remove(); // Clear status bar
|
||||
|
||||
// Disable all fields
|
||||
$('#' + tabId + ' input').attr('disabled', 'true');
|
||||
@@ -3250,16 +3238,14 @@ function advancedLoad(group){
|
||||
}
|
||||
|
||||
var args;
|
||||
var shortzHcps = new Array();
|
||||
for (var h in hcps) {
|
||||
// Get node without domain name
|
||||
args = h.split('.');
|
||||
shortzHcps.push(args[0]);
|
||||
|
||||
// If there are no disk pools or network names cookie for this hcp
|
||||
if (!$.cookie(args[0] + 'diskpools') || !$.cookie(args[0] + 'networks')) {
|
||||
// Check if SMAPI is online
|
||||
$.ajax({
|
||||
$.ajax( {
|
||||
url : 'lib/cmd.php',
|
||||
dataType : 'json',
|
||||
data : {
|
||||
@@ -3272,13 +3258,10 @@ function advancedLoad(group){
|
||||
// Load hardware control point specific info
|
||||
// Get disk pools and network names
|
||||
success : loadHcpInfo
|
||||
});
|
||||
});
|
||||
}
|
||||
} // End of for
|
||||
|
||||
// Save zHCPs as a cookie
|
||||
setzHcpCookies(shortzHcps);
|
||||
|
||||
// Retrieve z/VM hypervisors and their zHCPs
|
||||
if (!$.cookie('zvms')) {
|
||||
$.ajax( {
|
||||
|
||||
+77
-21
@@ -68,7 +68,21 @@ function loadNodesetPage(tgtNodes) {
|
||||
// Create target node or group
|
||||
var tgt = $('<div><label>Target node range:</label><input type="text" name="target" value="' + tgtNodes + '" title="The node or node range to set the boot state for"/></div>');
|
||||
vmAttr.append(tgt);
|
||||
|
||||
|
||||
// Create boot method drop down
|
||||
var method = $('<div></div>');
|
||||
var methodLabel = $('<label>Boot method:</label>');
|
||||
var methodSelect = $('<select id="bootMethod" name="bootMethod" title="The method for node deployment"></select>');
|
||||
methodSelect.append('<option value="boot">boot</option>'
|
||||
+ '<option value="install">install</option>'
|
||||
+ '<option value="iscsiboot">iscsiboot</option>'
|
||||
+ '<option value="netboot">netboot</option>'
|
||||
+ '<option value="statelite">statelite</option>'
|
||||
);
|
||||
method.append(methodLabel);
|
||||
method.append(methodSelect);
|
||||
imageAttr.append(method);
|
||||
|
||||
// Create boot type drop down
|
||||
var type = $('<div></div>');
|
||||
var typeLabel = $('<label>Boot type:</label>');
|
||||
@@ -80,24 +94,58 @@ function loadNodesetPage(tgtNodes) {
|
||||
type.append(typeLabel);
|
||||
type.append(typeSelect);
|
||||
imageAttr.append(type);
|
||||
|
||||
// Create operating system image input
|
||||
|
||||
// Create operating system input
|
||||
var os = $('<div></div>');
|
||||
var osLabel = $('<label>Operating system image:</label>');
|
||||
var osSelect = $('<select name="os" title="The operating system image to be installed on this node"></select>');
|
||||
osSelect.append($('<option value=""></option>'));
|
||||
|
||||
var imageNames = $.cookie('imagenames').split(',');
|
||||
if (imageNames) {
|
||||
imageNames.sort();
|
||||
for (var i in imageNames) {
|
||||
osSelect.append($('<option value="' + imageNames[i] + '">' + imageNames[i] + '</option>'));
|
||||
var osLabel = $('<label>Operating system:</label>');
|
||||
var osInput = $('<input type="text" name="os" title="You must give the operating system of this node or node range, e.g. rhel5.5"/>');
|
||||
osInput.one('focus', function(){
|
||||
var tmp = $.cookie('osvers');
|
||||
if (tmp) {
|
||||
// Turn on auto complete
|
||||
$(this).autocomplete({
|
||||
source: tmp.split(',')
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
os.append(osLabel);
|
||||
os.append(osSelect);
|
||||
os.append(osInput);
|
||||
imageAttr.append(os);
|
||||
|
||||
// Create architecture input
|
||||
var arch = $('<div></div>');
|
||||
var archLabel = $('<label>Architecture:</label>');
|
||||
var archInput = $('<input type="text" name="arch" title="You must give the architecture of this node or node range, e.g. s390x"/>');
|
||||
archInput.one('focus', function(){
|
||||
var tmp = $.cookie('osarchs');
|
||||
if (tmp) {
|
||||
// Turn on auto complete
|
||||
$(this).autocomplete({
|
||||
source: tmp.split(',')
|
||||
});
|
||||
}
|
||||
});
|
||||
arch.append(archLabel);
|
||||
arch.append(archInput);
|
||||
imageAttr.append(arch);
|
||||
|
||||
// Create profiles input
|
||||
var profile = $('<div></div>');
|
||||
var profileLabel = $('<label>Profile:</label>');
|
||||
var profileInput = $('<input type="text" name="profile" title="You must give the profile for this node or node range. The typical default profile is: compute."/>');
|
||||
profileInput.one('focus', function(){
|
||||
tmp = $.cookie('profiles');
|
||||
if (tmp) {
|
||||
// Turn on auto complete
|
||||
$(this).autocomplete({
|
||||
source: tmp.split(',')
|
||||
});
|
||||
}
|
||||
});
|
||||
profile.append(profileLabel);
|
||||
profile.append(profileInput);
|
||||
imageAttr.append(profile);
|
||||
|
||||
// Generate tooltips
|
||||
nodesetForm.find('div input[title],select').tooltip({
|
||||
position: "center right",
|
||||
@@ -139,11 +187,16 @@ function loadNodesetPage(tgtNodes) {
|
||||
|
||||
if (ready) {
|
||||
// Get nodes
|
||||
var tgts = $('#' + tabId + ' input[name=target]').val();
|
||||
var tgts = $('#' + tabId + ' input[name=target]').val();
|
||||
// Get boot method
|
||||
var method = $('#' + tabId + ' select[id=bootMethod]').val();
|
||||
// Get boot type
|
||||
var type = $('#' + tabId + ' select[id=bootType]').val();
|
||||
// Get operating system image
|
||||
var os = $('#' + tabId + ' select[name=os]').val();
|
||||
|
||||
// Get OS, arch, and profile
|
||||
var os = $('#' + tabId + ' input[name=os]').val();
|
||||
var arch = $('#' + tabId + ' input[name=arch]').val();
|
||||
var profile = $('#' + tabId + ' input[name=profile]').val();
|
||||
|
||||
// Disable all inputs, selects, and Ok button
|
||||
inputs.attr('disabled', 'disabled');
|
||||
@@ -159,7 +212,10 @@ function loadNodesetPage(tgtNodes) {
|
||||
data : {
|
||||
cmd : 'nodeadd',
|
||||
tgt : '',
|
||||
args : tgts + ';noderes.netboot=' + type,
|
||||
args : tgts + ';noderes.netboot=' + type
|
||||
+ ';nodetype.os=' + os
|
||||
+ ';nodetype.arch=' + arch
|
||||
+ ';nodetype.profile=' + profile,
|
||||
msg : 'cmd=nodeadd;inst=' + inst
|
||||
},
|
||||
|
||||
@@ -203,8 +259,8 @@ function updateNodesetStatus(data) {
|
||||
|
||||
// Get nodes
|
||||
var tgts = $('#' + tabId + ' input[name=target]').val();
|
||||
// Get operating system image
|
||||
var os = $('#' + tabId + ' select[name=os]').val();
|
||||
// Get boot method
|
||||
var method = $('#' + tabId + ' select[id=bootMethod]').val();
|
||||
|
||||
/**
|
||||
* (2) Update /etc/hosts
|
||||
@@ -320,7 +376,7 @@ function updateNodesetStatus(data) {
|
||||
data : {
|
||||
cmd : 'nodeset',
|
||||
tgt : tgts,
|
||||
args : 'osimage=' + os,
|
||||
args : method,
|
||||
msg : 'cmd=nodeset;inst=' + inst
|
||||
},
|
||||
|
||||
|
||||
@@ -47,10 +47,6 @@ function loadImagesPage() {
|
||||
function loadImages(data) {
|
||||
// Data returned
|
||||
var rsp = data.rsp;
|
||||
if (rsp[0].indexOf('Could not find any object definitions') > -1) {
|
||||
rsp = new Array();
|
||||
}
|
||||
|
||||
// Image attributes hash
|
||||
var attrs = new Object();
|
||||
// Image attributes
|
||||
|
||||
@@ -155,27 +155,27 @@ function loadProvisionPage() {
|
||||
resrcPg.append(resrcInfoBar);
|
||||
|
||||
// Create radio buttons for platforms
|
||||
var rsrcHwList = $('<ol>Platforms available:</ol>');
|
||||
esx = $('<li><input type="radio" name="rsrcHw" value="esx" checked/>ESX</li>');
|
||||
kvm = $('<li><input type="radio" name="rsrcHw" value="kvm"/>KVM</li>');
|
||||
zvm = $('<li><input type="radio" name="rsrcHw" value="zvm"/>z\/VM</li>');
|
||||
ipmi = $('<li><input type="radio" name="rsrcHw" value="ipmi"/>iDataPlex</li>');
|
||||
blade = $('<li><input type="radio" name="rsrcHw" value="blade"/>BladeCenter</li>');
|
||||
hmc = $('<li><input type="radio" name="rsrcHw" value="hmc"/>System p</li>');
|
||||
var hwList = $('<ol>Platforms available:</ol>');
|
||||
var esx = $('<li><input type="radio" name="hw" value="esx" disabled/>ESX</li>');
|
||||
var kvm = $('<li><input type="radio" name="hw" value="kvm" disabled/>KVM</li>');
|
||||
var zvm = $('<li><input type="radio" name="hw" value="zvm" checked/>z\/VM</li>');
|
||||
var ipmi = $('<li><input type="radio" name="hw" value="ipmi" disabled/>iDataPlex</li>');
|
||||
var blade = $('<li><input type="radio" name="hw" value="blade" disabled/>BladeCenter</li>');
|
||||
var hmc = $('<li><input type="radio" name="hw" value="hmc" disabled/>System p</li>');
|
||||
|
||||
rsrcHwList.append(esx);
|
||||
rsrcHwList.append(kvm);
|
||||
rsrcHwList.append(zvm);
|
||||
rsrcHwList.append(blade);
|
||||
rsrcHwList.append(ipmi);
|
||||
rsrcHwList.append(hmc);
|
||||
hwList.append(esx);
|
||||
hwList.append(kvm);
|
||||
hwList.append(zvm);
|
||||
hwList.append(blade);
|
||||
hwList.append(ipmi);
|
||||
hwList.append(hmc);
|
||||
|
||||
resrcPg.append(rsrcHwList);
|
||||
resrcPg.append(hwList);
|
||||
|
||||
var okBtn = createButton('Ok');
|
||||
okBtn.bind('click', function(event) {
|
||||
// Get hardware that was selected
|
||||
var hw = $(this).parent().find('input[name="rsrcHw"]:checked').val();
|
||||
var hw = $(this).parent().find('input[name="hw"]:checked').val();
|
||||
|
||||
// Generate new tab ID
|
||||
var newTabId = hw + 'ResourceTab';
|
||||
|
||||
@@ -170,9 +170,9 @@ function loadServiceProvisionPage(tabId) {
|
||||
|
||||
// Create radio buttons for platforms
|
||||
var hwList = $('<ol>Platforms available:</ol>');
|
||||
var esx = $('<li><input type="radio" name="hw" value="esx" checked/>ESX</li>');
|
||||
var kvm = $('<li><input type="radio" name="hw" value="kvm"/>KVM</li>');
|
||||
var zvm = $('<li><input type="radio" name="hw" value="zvm"/>z\/VM</li>');
|
||||
var esx = $('<li><input type="radio" name="hw" value="esx" disabled/>ESX</li>');
|
||||
var kvm = $('<li><input type="radio" name="hw" value="kvm" disabled/>KVM</li>');
|
||||
var zvm = $('<li><input type="radio" name="hw" value="zvm" checked/>z\/VM</li>');
|
||||
|
||||
hwList.append(esx);
|
||||
hwList.append(kvm);
|
||||
@@ -536,15 +536,6 @@ function loadNodesTable(data) {
|
||||
}
|
||||
});
|
||||
|
||||
// Power softoff
|
||||
var powerSoftoffLnk = $('<a>Shutdown</a>');
|
||||
powerSoftoffLnk.click(function() {
|
||||
var tgtNodes = getNodesChecked(nodesDTId);
|
||||
if (tgtNodes) {
|
||||
powerNode(tgtNodes, 'softoff');
|
||||
}
|
||||
});
|
||||
|
||||
// Turn monitoring on
|
||||
var monitorOnLnk = $('<a>Monitor on</a>');
|
||||
monitorOnLnk.click(function() {
|
||||
@@ -639,7 +630,7 @@ function loadNodesTable(data) {
|
||||
});
|
||||
});
|
||||
|
||||
var actionMenu = createMenu([cloneLnk, deleteLnk, monitorOnLnk, monitorOffLnk, powerOnLnk, powerOffLnk, powerSoftoffLnk, unlockLnk]);
|
||||
var actionMenu = createMenu([cloneLnk, deleteLnk, monitorOnLnk, monitorOffLnk, powerOnLnk, powerOffLnk, unlockLnk]);
|
||||
var menu = createMenu([[actionsLnk, actionMenu], refreshLnk]);
|
||||
menu.superfish();
|
||||
actionBar.append(menu);
|
||||
@@ -1398,10 +1389,24 @@ function deleteNode(tgtNodes) {
|
||||
}
|
||||
}
|
||||
|
||||
// Confirm delete of node
|
||||
// Confirm delete
|
||||
var confirmMsg = $('<p>Are you sure you want to delete ' + tgtNodesStr + '?</p>').css({
|
||||
'display': 'inline',
|
||||
'margin': '5px',
|
||||
'vertical-align': 'middle',
|
||||
'word-wrap': 'break-word'
|
||||
});
|
||||
|
||||
var style = {
|
||||
'display': 'inline-block',
|
||||
'margin': '5px',
|
||||
'vertical-align': 'middle'
|
||||
};
|
||||
|
||||
var dialog = $('<div></div>');
|
||||
var warn = createWarnBar('Are you sure you want to delete ' + tgtNodesStr + '?');
|
||||
dialog.append(warn);
|
||||
var icon = $('<span class="ui-icon ui-icon-alert"></span>').css(style);
|
||||
dialog.append(icon);
|
||||
dialog.append(confirmMsg);
|
||||
|
||||
// Open dialog
|
||||
dialog.dialog({
|
||||
|
||||
+14
-13
@@ -1,8 +1,11 @@
|
||||
/**
|
||||
* Tab constructor
|
||||
*
|
||||
* @param tabId Tab ID
|
||||
* @param tabName Tab name
|
||||
* @param tabId
|
||||
* Tab ID
|
||||
* @param tabName
|
||||
* Tab name
|
||||
* @return Nothing
|
||||
*/
|
||||
var Tab = function(tabId) {
|
||||
this.tabId = tabId;
|
||||
@@ -160,7 +163,7 @@ Table.prototype.init = function(headers) {
|
||||
var headRow = $('<tr></tr>');
|
||||
|
||||
// Append headers
|
||||
for (var i in headers) {
|
||||
for ( var i in headers) {
|
||||
headRow.append('<th>' + headers[i] + '</th>');
|
||||
}
|
||||
|
||||
@@ -192,7 +195,7 @@ Table.prototype.add = function(rowCont) {
|
||||
|
||||
// Create a column for each content
|
||||
var tableCol;
|
||||
for (var i in rowCont) {
|
||||
for ( var i in rowCont) {
|
||||
tableCol = $('<td></td>');
|
||||
tableCol.append(rowCont[i]);
|
||||
tableRow.append(tableCol);
|
||||
@@ -246,7 +249,7 @@ DataTable.prototype.init = function(headers) {
|
||||
var headRow = $('<tr></tr>');
|
||||
|
||||
// Append headers
|
||||
for (var i in headers) {
|
||||
for ( var i in headers) {
|
||||
headRow.append('<th>' + headers[i] + '</th>');
|
||||
}
|
||||
|
||||
@@ -278,7 +281,7 @@ DataTable.prototype.add = function(rowCont) {
|
||||
|
||||
// Create a column for each content
|
||||
var tableCol;
|
||||
for (var i in rowCont) {
|
||||
for ( var i in rowCont) {
|
||||
tableCol = $('<td></td>');
|
||||
tableCol.append(rowCont[i]);
|
||||
tableRow.append(tableCol);
|
||||
@@ -321,6 +324,7 @@ function createStatusBar(barId) {
|
||||
var hide = $('<span class="ui-icon ui-icon-minus"></span>').css({
|
||||
'display': 'inline-block',
|
||||
'float': 'right',
|
||||
'margin': '10px 5px',
|
||||
'cursor': 'pointer'
|
||||
}).click(function() {
|
||||
// Remove info box on-click
|
||||
@@ -467,11 +471,11 @@ function initPage() {
|
||||
// Load jQuery stylesheets
|
||||
includeCss("css/jquery.dataTables.css");
|
||||
includeCss("css/superfish.css");
|
||||
// includeCss("css/jstree.css");
|
||||
includeCss("css/jstree.css");
|
||||
includeCss("css/jquery.jqplot.css");
|
||||
|
||||
// Load custom stylesheet
|
||||
includeCss("css/style.css");
|
||||
includeCss("css/style.css");
|
||||
|
||||
// JQuery plugins
|
||||
includeJs("js/jquery/jquery.dataTables.min.js");
|
||||
@@ -480,14 +484,11 @@ function initPage() {
|
||||
includeJs("js/jquery/jquery.contextmenu.min.js");
|
||||
includeJs("js/jquery/superfish.min.js");
|
||||
includeJs("js/jquery/hoverIntent.min.js");
|
||||
// includeJs("js/jquery/jquery.jstree.min.js");
|
||||
includeJs("js/jquery/jquery.jstree.min.js");
|
||||
includeJs("js/jquery/tooltip.min.js");
|
||||
includeJs("js/jquery/jquery.serverBrowser.min.js");
|
||||
includeJs("js/jquery/jquery.jqplot.min.js");
|
||||
includeJs("js/jquery/jqplot.pieRenderer.min.js");
|
||||
includeJs("js/jquery/jqplot.barRenderer.min.js");
|
||||
includeJs("js/jquery/jqplot.pointLabels.min.js");
|
||||
includeJs("js/jquery/jqplot.categoryAxisRenderer.min.js");
|
||||
includeJs("js/jquery/jqplot.dateAxisRenderer.min.js");
|
||||
includeJs("js/jquery/jquery.topzindex.min.js");
|
||||
|
||||
@@ -913,7 +914,7 @@ function changePassword() {
|
||||
// Change dialog buttons
|
||||
$('#changePassword').dialog('option', 'buttons', {
|
||||
'Close':function(){
|
||||
$('#changePassword').dialog('destroy').remove();
|
||||
$('#changePassword').dialog('close');
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -327,7 +327,7 @@ function isRootAcess() {
|
||||
}
|
||||
}
|
||||
|
||||
if (strcmp($_SESSION["username"], 'root') == 0 || strcmp($_SESSION["username"], 'admin') == 0) {
|
||||
if (strcmp($_SESSION["username"], 'root') == 0) {
|
||||
$_SESSION["xcatpassvalid"] = 1;
|
||||
}
|
||||
|
||||
|
||||
+33
-33
@@ -419,7 +419,7 @@ sub web_unlock {
|
||||
my $password = $request->{arg}->[2];
|
||||
|
||||
# Unlock a node by setting up the SSH keys
|
||||
my $out = `DSH_REMOTE_PASSWORD=$password /opt/xcat/bin/xdsh $node -K`;
|
||||
my $out = `DSH_REMOTE_PASSWORD=$password xdsh $node -K`;
|
||||
|
||||
$callback->( { data => $out } );
|
||||
}
|
||||
@@ -429,7 +429,7 @@ sub web_gangliastatus {
|
||||
|
||||
# Get node range
|
||||
my $nr = $request->{arg}->[1];
|
||||
my $out = `/opt/xcat/bin/xdsh $nr "service gmond status"`;
|
||||
my $out = `xdsh $nr "service gmond status"`;
|
||||
|
||||
# Parse output, and use $callback to send back to the web interface
|
||||
# Output looks like:
|
||||
@@ -466,21 +466,21 @@ sub web_gangliaconf() {
|
||||
my $output;
|
||||
|
||||
# Add gangliamon to the monitoring table (if not already)
|
||||
$output = `/opt/xcat/bin/monadd gangliamon`;
|
||||
$output = `monadd gangliamon`;
|
||||
|
||||
# Run the ganglia configuration script on node
|
||||
if ($nr) {
|
||||
$output = `/opt/xcat/bin/moncfg gangliamon $nr -r`;
|
||||
$output = `moncfg gangliamon $nr -r`;
|
||||
}
|
||||
else {
|
||||
|
||||
# If no node range is given, then assume all nodes
|
||||
|
||||
# Handle localhost (this needs to be 1st)
|
||||
$output = `/opt/xcat/bin/moncfg gangliamon`;
|
||||
$output = `moncfg gangliamon`;
|
||||
|
||||
# Handle remote nodes
|
||||
$output .= `/opt/xcat/bin/moncfg gangliamon -r`;
|
||||
$output .= `moncfg gangliamon -r`;
|
||||
}
|
||||
|
||||
my @lines = split( '\n', $output );
|
||||
@@ -504,28 +504,28 @@ sub web_gangliastart() {
|
||||
my $output;
|
||||
|
||||
# Add gangliamon to the monitoring table (if not already)
|
||||
$output = `/opt/xcat/bin/monadd gangliamon`;
|
||||
$output = `monadd gangliamon`;
|
||||
|
||||
# Start the gmond daemon on node
|
||||
if ($nr) {
|
||||
$output = `/opt/xcat/bin/moncfg gangliamon $nr -r`;
|
||||
$output .= `/opt/xcat/bin/monstart gangliamon $nr -r`;
|
||||
$output = `moncfg gangliamon $nr -r`;
|
||||
$output .= `monstart gangliamon $nr -r`;
|
||||
}
|
||||
else {
|
||||
|
||||
# If no node range is given, then assume all nodes
|
||||
|
||||
# Handle localhost (this needs to be 1st)
|
||||
$output = `/opt/xcat/bin/moncfg gangliamon`;
|
||||
$output = `moncfg gangliamon`;
|
||||
|
||||
# Handle remote nodes
|
||||
$output .= `/opt/xcat/bin/moncfg gangliamon -r`;
|
||||
$output .= `moncfg gangliamon -r`;
|
||||
|
||||
# Handle localhost (this needs to be 1st)
|
||||
$output .= `/opt/xcat/bin/monstart gangliamon`;
|
||||
$output .= `monstart gangliamon`;
|
||||
|
||||
# Handle remote nodes
|
||||
$output .= `/opt/xcat/bin/monstart gangliamon -r`;
|
||||
$output .= `monstart gangliamon -r`;
|
||||
}
|
||||
|
||||
my @lines = split( '\n', $output );
|
||||
@@ -550,17 +550,17 @@ sub web_gangliastop() {
|
||||
|
||||
# Stop the gmond daemon on node
|
||||
if ($nr) {
|
||||
$output = `/opt/xcat/bin/monstop gangliamon $nr -r`;
|
||||
$output = `monstop gangliamon $nr -r`;
|
||||
}
|
||||
else {
|
||||
|
||||
# If no node range is given, then assume all nodes
|
||||
|
||||
# Handle localhost (this needs to be 1st)
|
||||
$output = `/opt/xcat/bin/monstop gangliamon`;
|
||||
$output = `monstop gangliamon`;
|
||||
|
||||
# Handle remote nodes
|
||||
$output .= `/opt/xcat/bin/monstop gangliamon -r`;
|
||||
$output .= `monstop gangliamon -r`;
|
||||
}
|
||||
|
||||
my @lines = split( '\n', $output );
|
||||
@@ -585,7 +585,7 @@ sub web_gangliacheck() {
|
||||
|
||||
# Check if ganglia RPMs are installed
|
||||
my $info;
|
||||
my $info = `/opt/xcat/bin/xdsh $nr "rpm -q ganglia-gmond libganglia libconfuse"`;
|
||||
my $info = `xdsh $nr "rpm -q ganglia-gmond libganglia libconfuse"`;
|
||||
$callback->( { info => $info } );
|
||||
return;
|
||||
}
|
||||
@@ -686,7 +686,7 @@ sub web_installganglia() {
|
||||
|
||||
# Install Ganglia RPMs using updatenode
|
||||
$callback->( { info => "$_: Installing Ganglia..." } );
|
||||
$info = `/opt/xcat/bin/updatenode $_ -S`;
|
||||
$info = `updatenode $_ -S`;
|
||||
$callback->( { info => "$info" } );
|
||||
}
|
||||
|
||||
@@ -2032,9 +2032,9 @@ sub web_addnode {
|
||||
}
|
||||
|
||||
if ( 'hmc' eq $nodetype ) {
|
||||
`/opt/xcat/bin/chdef -t node -o $hcpname username=$username password=$passwd mgt=hmc nodetype=$nodetype ip=$ip groups=all`;
|
||||
`chdef -t node -o $hcpname username=$username password=$passwd mgt=hmc nodetype=$nodetype ip=$ip groups=all`;
|
||||
} else {
|
||||
`/opt/xcat/bin/chdef -t node -o $hcpname username=$username password=$passwd mgt=blade mpa=$hcpname nodetype=$nodetype id=0 groups=mm,all`;
|
||||
`chdef -t node -o $hcpname username=$username password=$passwd mgt=blade mpa=$hcpname nodetype=$nodetype id=0 groups=mm,all`;
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -2052,7 +2052,7 @@ sub web_addnode {
|
||||
$temphash{ $tempArray[$i] } = $tempArray[ $i + 1 ];
|
||||
}
|
||||
|
||||
`/opt/xcat/bin/rscan $hcpname -z > /tmp/rscanall.tmp`;
|
||||
`rscan $hcpname -z > /tmp/rscanall.tmp`;
|
||||
|
||||
unless ( -e '/tmp/rscanall.tmp' ) {
|
||||
return;
|
||||
@@ -2292,7 +2292,7 @@ sub web_passwd() {
|
||||
my $encrypted = `perl -e "print crypt($password, $random)"`;
|
||||
|
||||
# Save in xCAT passwd table
|
||||
`/opt/xcat/sbin/chtab username=$user passwd.key=xcat passwd.password=$encrypted`;
|
||||
`chtab username=$user passwd.key=xcat passwd.password=$encrypted`;
|
||||
|
||||
my $info = "User password successfully updated";
|
||||
$callback->( { info => $info } );
|
||||
@@ -2307,7 +2307,7 @@ sub web_policy() {
|
||||
my $args = $request->{arg}->[2];
|
||||
|
||||
# Save in xCAT passwd and policy tables
|
||||
my $out = `/opt/xcat/sbin/chtab priority=$priority $args`;
|
||||
my $out = `chtab priority=$priority $args`;
|
||||
|
||||
my $info = "User policy successfully updated";
|
||||
$callback->( { info => $info } );
|
||||
@@ -2323,8 +2323,8 @@ sub web_deleteuser() {
|
||||
|
||||
# Delete user from xCAT passwd and policy tables
|
||||
foreach (@users) {
|
||||
`/opt/xcat/sbin/chtab -d username=$_ passwd`;
|
||||
`/opt/xcat/sbin/chtab -d name=$_ policy`;
|
||||
`chtab -d username=$_ passwd`;
|
||||
`chtab -d name=$_ policy`;
|
||||
}
|
||||
|
||||
my $info = "User successfully deleted";
|
||||
@@ -2365,7 +2365,6 @@ sub web_mkzprofile() {
|
||||
my $size = $request->{arg}->[3];
|
||||
|
||||
# Create profile under /var/opt/xcat/profiles
|
||||
`mkdir -p /var/opt/xcat/profiles`;
|
||||
my $var = "";
|
||||
`echo "# Configuration for virtual machines" > /var/opt/xcat/profiles/$profile.conf`;
|
||||
$var = $profile . "_diskpool";
|
||||
@@ -2373,7 +2372,8 @@ sub web_mkzprofile() {
|
||||
$var = $profile . "_eckd_size";
|
||||
`echo "$var=$size" >> /var/opt/xcat/profiles/$profile.conf`;
|
||||
|
||||
# Move directory entry into /var/opt/xcat/profiles from /var/tmp
|
||||
# Move directory entry into /var/opt/xcat/profiles from /var/tmp
|
||||
`mkdir -p /var/opt/xcat/profiles`;
|
||||
`mv /var/tmp/$profile.direct /var/opt/xcat/profiles`;
|
||||
|
||||
my $info = "Profile successfully created/updated";
|
||||
@@ -2467,8 +2467,8 @@ sub web_updateosimage() {
|
||||
my $provMethod = $request->{arg}->[7];
|
||||
my $comments = $request->{arg}->[8];
|
||||
|
||||
`/opt/xcat/sbin/chtab -d imagename=$name osimage`;
|
||||
`/opt/xcat/sbin/chtab osimage.imagename=$name osimage.imagetype=$type osimage.osarch=$arch osimage.osname=$osName osimage.osvers=$osVersion osimage.profile=$profile osimage.provmethod=$provMethod osimage.comments=$comments`;
|
||||
`chtab -d imagename=$name osimage`;
|
||||
`chtab osimage.imagename=$name osimage.imagetype=$type osimage.osarch=$arch osimage.osname=$osName osimage.osvers=$osVersion osimage.profile=$profile osimage.provmethod=$provMethod osimage.comments=$comments`;
|
||||
my $info = "Image successfully updated";
|
||||
$callback->( { info => $info } );
|
||||
}
|
||||
@@ -2483,7 +2483,7 @@ sub web_rmosimage() {
|
||||
|
||||
# Delete user from xCAT passwd and policy tables
|
||||
foreach (@names) {
|
||||
`/opt/xcat/sbin/chtab -d imagename=$_ osimage`;
|
||||
`chtab -d imagename=$_ osimage`;
|
||||
}
|
||||
|
||||
my $info = "Image successfully deleted";
|
||||
@@ -2505,8 +2505,8 @@ sub web_updategroup() {
|
||||
my $comments = $request->{arg}->[4];
|
||||
$comments =~ s/'//g;
|
||||
|
||||
`/opt/xcat/sbin/chtab -d node=$name hosts`;
|
||||
`/opt/xcat/sbin/chtab node=$name hosts.ip="$ip" hosts.hostnames="$hostnames" hosts.comments="$comments"`;
|
||||
`chtab -d node=$name hosts`;
|
||||
`chtab node=$name hosts.ip="$ip" hosts.hostnames="$hostnames" hosts.comments="$comments"`;
|
||||
|
||||
my $info = "Group successfully updated";
|
||||
$callback->( { info => $info } );
|
||||
@@ -2522,7 +2522,7 @@ sub web_rmgroup() {
|
||||
|
||||
# Delete user from xCAT passwd and policy tables
|
||||
foreach (@names) {
|
||||
`/opt/xcat/sbin/chtab -d node=$_ hosts`;
|
||||
`chtab -d node=$_ hosts`;
|
||||
`rm -rf /var/opt/xcat/ippool/$_.pool`;
|
||||
}
|
||||
|
||||
|
||||
@@ -105,11 +105,11 @@ sub provzlinux {
|
||||
}
|
||||
|
||||
# Check the max # of virtual machines allowed
|
||||
my $out = `/opt/xcat/sbin/tabdump nodetype -w nodetype.comments=~"owner:$owner"`;
|
||||
my $out = `tabdump nodetype -w nodetype.comments=~"owner:$owner"`;
|
||||
my @tmp = split( /\n/, $out );
|
||||
my $usrVM = scalar(@tmp) - 1;
|
||||
|
||||
$out = `/opt/xcat/bin/webportal getmaxvm $owner`;
|
||||
$out = `webportal getmaxvm $owner`;
|
||||
$out =~ s/Max allowed: //g;
|
||||
my $maxVM = int($out);
|
||||
|
||||
@@ -137,7 +137,6 @@ sub provzlinux {
|
||||
my $disk_pool;
|
||||
my $eckd_size;
|
||||
my $fba_size;
|
||||
my $profile_conf = $profile;
|
||||
my $default_conf = "/var/opt/xcat/profiles/$profile.conf";
|
||||
my $default_direct = "/var/opt/xcat/profiles/$profile.direct";
|
||||
|
||||
@@ -146,24 +145,22 @@ sub provzlinux {
|
||||
println( $callback, "$profile.direct does not exist. Using default.direct to generate directory entry." );
|
||||
|
||||
# Exit if default.direct does not exist
|
||||
$default_direct = "/var/opt/xcat/profiles/default.direct";
|
||||
$default_conf = "/var/opt/xcat/profiles/default.conf";
|
||||
$profile_conf = "default";
|
||||
if ( !(`test -e $default_direct && echo Exists`) ) {
|
||||
println( $callback, "(Error) $default_direct does not exists" );
|
||||
$default_direct = '/var/opt/xcat/profiles/default.direct';
|
||||
if ( !(`test -e /var/opt/xcat/profiles/default.direct && echo Exists`) ) {
|
||||
println( $callback, '(Error) $default_direct does not exists' );
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
# Exit if default.conf does not exist
|
||||
if ( !(`test -e $default_conf && echo Exists`) ) {
|
||||
println( $callback, "(Error) $default_conf does not exists" );
|
||||
println( $callback, '(Error) $default_conf does not exists' );
|
||||
return;
|
||||
}
|
||||
|
||||
# Exit if default.direct does not exist
|
||||
if ( !(`test -e $default_direct && echo Exists`) ) {
|
||||
println( $callback, "(Error) $default_direct does not exists" );
|
||||
println( $callback, '(Error) $default_direct does not exists' );
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -174,9 +171,9 @@ sub provzlinux {
|
||||
# Configuration for virtual machines
|
||||
# default_diskpool=POOL3
|
||||
# default_eckd_size=10016
|
||||
my $profile_diskpool_parm = $profile_conf . "_diskpool";
|
||||
my $profile_eckd_size_parm = $profile_conf . "_eckd_size";
|
||||
my $profile_fba_size_parm = $profile_conf . "_fba_size";
|
||||
my $profile_diskpool_parm = $profile . "_diskpool";
|
||||
my $profile_eckd_size_parm = $profile . "_eckd_size";
|
||||
my $profile_fba_size_parm = $profile . "_fba_size";
|
||||
my $default_disk_pool;
|
||||
my $default_eckd_size;
|
||||
my $default_fba_size;
|
||||
@@ -199,7 +196,7 @@ sub provzlinux {
|
||||
|
||||
# Use default configuration if profile configuration does not exist
|
||||
if (!$disk_pool && (!$eckd_size || !$fba_size)) {
|
||||
println( $callback, "(Error) $profile_conf configuration for disk pool and size does not exist" );
|
||||
println( $callback, "(Error) $profile configuration for disk pool and size does not exist" );
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -230,15 +227,15 @@ sub provzlinux {
|
||||
# Set node definitions
|
||||
# Also put node into all group
|
||||
if ($group eq 'all') {
|
||||
$out = `/opt/xcat/bin/mkdef -t node -o $node userid=$userid hcp=$hcp mgt=zvm groups=$group`;
|
||||
$out = `mkdef -t node -o $node userid=$userid hcp=$hcp mgt=zvm groups=$group`;
|
||||
} else {
|
||||
# Put node in all group
|
||||
$out = `/opt/xcat/bin/mkdef -t node -o $node userid=$userid hcp=$hcp mgt=zvm groups=$group`;
|
||||
$out = `mkdef -t node -o $node userid=$userid hcp=$hcp mgt=zvm groups=$group,all`;
|
||||
}
|
||||
println( $callback, "$out" );
|
||||
|
||||
# Set nodetype definitions
|
||||
$out = `/opt/xcat/sbin/chtab node=$node hosts.ip=$ip hosts.hostnames=$hostname noderes.netboot=zvm nodetype.nodetype=osi nodetype.provmethod=install nodetype.os=$os nodetype.arch=$arch nodetype.profile=$profile nodetype.comments="owner:$owner"`;
|
||||
$out = `chtab node=$node hosts.ip=$ip hosts.hostnames=$hostname noderes.netboot=zvm nodetype.nodetype=osi nodetype.provmethod=install nodetype.os=$os nodetype.arch=$arch nodetype.profile=$profile nodetype.comments="owner:$owner"`;
|
||||
|
||||
# Create user directory entry replacing LXUSR with user ID
|
||||
# Use /opt/zhcp/conf/default.direct on zHCP as the template
|
||||
@@ -246,7 +243,7 @@ sub provzlinux {
|
||||
# INCLUDE LNXDFLT
|
||||
# COMMAND SET VSWITCH VSW2 GRANT LXUSR
|
||||
$out = `sed $default_direct -e s/LXUSR/$userid/g > /tmp/$node-direct.txt`;
|
||||
$out = `/opt/xcat/bin/mkvm $node /tmp/$node-direct.txt`;
|
||||
$out = `mkvm $node /tmp/$node-direct.txt`;
|
||||
`rm -rf /tmp/$node-direct.txt`;
|
||||
println( $callback, "$out" );
|
||||
if ( $out =~ m/Error/i ) {
|
||||
@@ -286,7 +283,7 @@ sub provzlinux {
|
||||
foreach (@$type) {
|
||||
# Add ECKD disk
|
||||
if ( $_ =~ m/dasd_eckd_mod/i ) {
|
||||
$out = `/opt/xcat/bin/chvm $node --add3390 $disk_pool $virt_addr $eckd_size MR`;
|
||||
$out = `chvm $node --add3390 $disk_pool $virt_addr $eckd_size MR`;
|
||||
println( $callback, "$out" );
|
||||
if ( $out =~ m/Error/i ) {
|
||||
return;
|
||||
@@ -317,7 +314,7 @@ sub provzlinux {
|
||||
|
||||
# Add ECKD disk for each device found
|
||||
for $dev ( keys %devices ) {
|
||||
$out = `/opt/xcat/bin/chvm $node --add3390 $disk_pool $virt_addr $eckd_size MR`;
|
||||
$out = `chvm $node --add3390 $disk_pool $virt_addr $eckd_size MR`;
|
||||
println( $callback, "$out" );
|
||||
if ( $out =~ m/Error/i ) {
|
||||
return;
|
||||
@@ -328,35 +325,36 @@ sub provzlinux {
|
||||
}
|
||||
}
|
||||
|
||||
# Update hosts table
|
||||
`/opt/xcat/sbin/makehosts`;
|
||||
# Update hosts table and DNS
|
||||
`makehosts`;
|
||||
`makedns`;
|
||||
|
||||
# Update DHCP
|
||||
`makedhcp -a`;
|
||||
|
||||
# Toggle node power so COMMAND SET will get executed
|
||||
`/opt/xcat/bin/rpower $node on`;
|
||||
`/opt/xcat/bin/rpower $node off`;
|
||||
`rpower $node on`;
|
||||
`rpower $node off`;
|
||||
|
||||
# Punch kernel, initrd, and ramdisk to node reader
|
||||
$out = `/opt/xcat/sbin/nodeset $node install`;
|
||||
$out = `nodeset $node install`;
|
||||
println( $callback, "$out" );
|
||||
if ( $out =~ m/Error/i ) {
|
||||
return;
|
||||
}
|
||||
|
||||
# IPL reader and begin installation
|
||||
$out = `/opt/xcat/bin/rnetboot $node ipl=00C`;
|
||||
$out = `rnetboot $node ipl=00C`;
|
||||
println( $callback, "$out" );
|
||||
if ( $out =~ m/Error/i ) {
|
||||
return;
|
||||
}
|
||||
|
||||
# Configure Ganglia monitoring
|
||||
$out = `/opt/xcat/bin/moncfg gangliamon $node -r`;
|
||||
$out = `moncfg gangliamon $node -r`;
|
||||
|
||||
# Show node information, e.g. IP, hostname, and root password
|
||||
$out = `/opt/xcat/bin/lsdef $node -i ip,hostnames | egrep "ip=|hostnames="`;
|
||||
$out = `lsdef $node -i ip,hostnames | egrep "ip=|hostnames="`;
|
||||
my $rootpw = getsysrootpw();
|
||||
println( $callback, "Your virtual machine is ready. It may take a few minutes before you can logon using VNC ($node:1). Below is your VM attributes." );
|
||||
println( $callback, "$out" );
|
||||
@@ -568,7 +566,7 @@ sub gennodename {
|
||||
}
|
||||
|
||||
# Check xCAT tables, /etc/hosts, and ping to see if hostname is already used
|
||||
while (`/opt/xcat/bin/nodels $hostname` || `cat /etc/hosts | grep "$ipaddr "` || !(`ping -c 4 $ipaddr` =~ m/100% packet loss/)) {
|
||||
while (`nodels $hostname` || `cat /etc/hosts | grep "$ipaddr "` || !(`ping -c 4 $ipaddr` =~ m/100% packet loss/)) {
|
||||
# Base digit invalid if over 254
|
||||
if ($base_digit > $range_high) {
|
||||
last;
|
||||
@@ -602,11 +600,11 @@ sub clonezlinux {
|
||||
my $owner = $request->{arg}->[3];
|
||||
|
||||
# Check the max # of virtual machines allowed
|
||||
my $out = `/opt/xcat/sbin/tabdump nodetype -w nodetype.comments=~"owner:$owner"`;
|
||||
my $out = `tabdump nodetype -w nodetype.comments=~"owner:$owner"`;
|
||||
my @tmp = split( /\n/, $out );
|
||||
my $usrVM = scalar(@tmp) - 1;
|
||||
|
||||
$out = `/opt/xcat/bin/webportal getmaxvm $owner`;
|
||||
$out = `webportal getmaxvm $owner`;
|
||||
$out =~ s/Max allowed: //g;
|
||||
my $maxVM = int($out);
|
||||
|
||||
@@ -635,13 +633,13 @@ sub clonezlinux {
|
||||
|
||||
# Exit if default.conf does not exist
|
||||
if ( !(`test -e $default_conf && echo Exists`) ) {
|
||||
println( $callback, "(Error) $default_conf does not exists" );
|
||||
println( $callback, '(Error) $default_conf does not exists' );
|
||||
return;
|
||||
}
|
||||
|
||||
# Exit if default.direct does not exist
|
||||
if ( !(`test -e $default_direct && echo Exists`) ) {
|
||||
println( $callback, "(Error) $default_direct does not exists" );
|
||||
println( $callback, '(Error) $default_direct does not exists' );
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -687,34 +685,34 @@ sub clonezlinux {
|
||||
my $userid = $node;
|
||||
|
||||
# Set node definitions
|
||||
$out = `/opt/xcat/bin/mkdef -t node -o $node userid=$userid hcp=$hcp mgt=zvm groups=$group`;
|
||||
$out = `mkdef -t node -o $node userid=$userid hcp=$hcp mgt=zvm groups=$group`;
|
||||
println( $callback, "$out" );
|
||||
|
||||
# Set nodetype definitions
|
||||
$out = `/opt/xcat/sbin/chtab node=$node hosts.ip=$ip hosts.hostnames=$hostname noderes.netboot=zvm nodetype.nodetype=osi nodetype.provmethod=install nodetype.os=$os nodetype.arch=$arch nodetype.profile=$profile nodetype.comments="owner:$owner"`;
|
||||
$out = `chtab node=$node hosts.ip=$ip hosts.hostnames=$hostname noderes.netboot=zvm nodetype.nodetype=osi nodetype.provmethod=install nodetype.os=$os nodetype.arch=$arch nodetype.profile=$profile nodetype.comments="owner:$owner"`;
|
||||
|
||||
# Update hosts table
|
||||
# Update hosts table and DNS
|
||||
sleep(5); # Time needed to update /etc/hosts
|
||||
`/opt/xcat/sbin/makehosts`;
|
||||
`/opt/xcat/sbin/makedns`;
|
||||
`makehosts`;
|
||||
`makedns`;
|
||||
|
||||
# Update DHCP
|
||||
`/opt/xcat/sbin/makedhcp -a`;
|
||||
`makedhcp -a`;
|
||||
println( $callback, "hosts table, DHCP, and DNS updated" );
|
||||
|
||||
# Clone virtual machine
|
||||
sleep(5); # Time needed to update /etc/hosts
|
||||
$out = `/opt/xcat/bin/mkvm $node $src_node pool=$disk_pool`;
|
||||
$out = `mkvm $node $src_node pool=$disk_pool`;
|
||||
println( $callback, "$out" );
|
||||
if ( $out =~ m/Error/i || $out =~ m/Failed/i ) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
# Configure Ganglia monitoring
|
||||
$out = `/opt/xcat/bin/moncfg gangliamon $node -r`;
|
||||
$out = `moncfg gangliamon $node -r`;
|
||||
|
||||
# Show node information, e.g. IP, hostname, and root password
|
||||
$out = `/opt/xcat/bin/lsdef $node | egrep "ip=|hostnames="`;
|
||||
$out = `lsdef $node | egrep "ip=|hostnames="`;
|
||||
my $rootpw = getsysrootpw();
|
||||
println( $callback, "Your virtual machine is ready. It may take a few minutes before you can logon. Below is your VM attributes." );
|
||||
println( $callback, "$out" );
|
||||
@@ -863,7 +861,7 @@ sub findfreenode {
|
||||
if ($node && $ipaddr && $hostname) {
|
||||
|
||||
# Check against xCAT tables, /etc/hosts, and ping to see if hostname is already used
|
||||
if (`/opt/xcat/bin/nodels $node` || `cat /etc/hosts | grep "$ipaddr "` || !(`ping -c 4 $ipaddr` =~ m/100% packet loss/)) {
|
||||
if (`nodels $node` || `cat /etc/hosts | grep "$ipaddr "` || !(`ping -c 4 $ipaddr` =~ m/100% packet loss/)) {
|
||||
next;
|
||||
} else {
|
||||
$found = 1;
|
||||
|
||||
+244
-553
File diff suppressed because it is too large
Load Diff
@@ -25,11 +25,23 @@ my $sha1support = eval {
|
||||
};
|
||||
use IPC::Open3;
|
||||
use IO::Select;
|
||||
use xCAT::GlobalDef;
|
||||
eval {
|
||||
require xCAT::RemoteShellExp;
|
||||
};
|
||||
use warnings "all";
|
||||
require xCAT::InstUtils;
|
||||
#require xCAT::NetworkUtils;
|
||||
require xCAT::Schema;
|
||||
#require Data::Dumper;
|
||||
require xCAT::NodeRange;
|
||||
require xCAT::Version;
|
||||
require DBI;
|
||||
|
||||
our @ISA = qw(Exporter);
|
||||
our @EXPORT_OK = qw(genpassword runcmd3);
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
#--------------------------------------------------------------------------------
|
||||
|
||||
=head1 xCAT::BuildKitUtils
|
||||
|
||||
@@ -278,6 +290,205 @@ sub close_delete_file
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
=head3 runcmd3
|
||||
Run the specified command with optional input and return stderr, stdout, and exit code
|
||||
|
||||
Arguments:
|
||||
command=>[] - Array reference of command to run
|
||||
input=>[] or string - Data to send to stdin of process like piping input
|
||||
Returns:
|
||||
{ exitcode => number, output=> $string, errors => string }
|
||||
=cut
|
||||
sub runcmd3 { #a proper runcmd that indpendently returns stdout, stderr, pid and accepts a stdin
|
||||
my %args = @_;
|
||||
my @indata;
|
||||
my $output;
|
||||
my $errors;
|
||||
if ($args{input}) {
|
||||
if (ref $args{input}) { #array ref
|
||||
@indata = @{$args{input}};
|
||||
} else { #just a string
|
||||
@indata=($args{input});
|
||||
}
|
||||
}
|
||||
my @cmd;
|
||||
if (ref $args{command}) {
|
||||
@cmd = @{$args{command}};
|
||||
} else {
|
||||
@cmd = ($args{command});
|
||||
}
|
||||
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;
|
||||
while ($cmdsel->count()) {
|
||||
@handles = $cmdsel->can_read();
|
||||
foreach (@handles) {
|
||||
my $line;
|
||||
my $done = sysread $_,$line,180;
|
||||
if ($done) {
|
||||
if ($_ eq $cmdout) {
|
||||
$output .= $line;
|
||||
} else {
|
||||
$errors .= $line;
|
||||
}
|
||||
} else {
|
||||
$cmdsel->remove($_);
|
||||
close($_);
|
||||
}
|
||||
}
|
||||
}
|
||||
waitpid($cmdpid,0);
|
||||
my $exitcode = $? >> 8;
|
||||
return { 'exitcode' => $exitcode, 'output' => $output, 'errors' => $errors }
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
=head3 runcmd
|
||||
Run the given cmd and return the output in an array (already chopped).
|
||||
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, reference to output, streaming mode
|
||||
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::BuildKitUtils->runcmd($cmd, -2, 1);
|
||||
$::CALLBACK= your callback (required for streaming from plugins)
|
||||
my $outref = xCAT::BuildKitUtils->runcmd($cmd,-2, 1, 1); streaming
|
||||
|
||||
Comments:
|
||||
If refoutput is true, then the output will be returned as a
|
||||
reference to an array for efficiency.
|
||||
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
sub runcmd
|
||||
|
||||
{
|
||||
|
||||
my ($class, $cmd, $exitcode, $refoutput, $stream) = @_;
|
||||
$::RUNCMD_RC = 0;
|
||||
# redirect stderr to stdout
|
||||
if (!($cmd =~ /2>&1$/)) { $cmd .= ' 2>&1'; }
|
||||
|
||||
my $outref = [];
|
||||
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;
|
||||
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::BuildKitUtils->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::BuildKitUtils::errno = 29;
|
||||
}
|
||||
}
|
||||
if ($refoutput)
|
||||
{
|
||||
chomp(@$outref);
|
||||
return $outref;
|
||||
}
|
||||
elsif (wantarray)
|
||||
{
|
||||
chomp(@$outref);
|
||||
return @$outref;
|
||||
}
|
||||
else
|
||||
{
|
||||
my $line = join('', @$outref);
|
||||
chomp $line;
|
||||
return $line;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
@@ -378,15 +589,12 @@ sub osver
|
||||
$ver = $lines[0];
|
||||
$ver =~ s/\.//;
|
||||
$ver =~ s/[^0-9]*([0-9]+).*/$1/;
|
||||
my $minorver;
|
||||
if (grep /PATCHLEVEL/, $lines[2]) {
|
||||
$minorver = $lines[2];
|
||||
$minorver =~ s/PATCHLEVEL[^0-9]*([0-9]+).*/$1/;
|
||||
}
|
||||
$ver = $ver . ".$minorver" if ( $minorver );
|
||||
|
||||
#print "ver: $ver\n";
|
||||
}
|
||||
elsif (-f "/etc/UnitedLinux-release")
|
||||
{
|
||||
|
||||
$os = "ul";
|
||||
open($relfile,"<","/etc/UnitedLinux-release");
|
||||
$ver = <$relfile>;
|
||||
@@ -452,7 +660,7 @@ sub osver
|
||||
false on failure
|
||||
A reference for the lock being held.
|
||||
=cut
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
sub acquire_lock {
|
||||
my $lock_name = shift;
|
||||
use File::Path;
|
||||
@@ -474,7 +682,7 @@ sub acquire_lock {
|
||||
Returns:
|
||||
false on failure, true on success
|
||||
=cut
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
sub release_lock {
|
||||
my $tlock = shift;
|
||||
unlink($tlock->{path});
|
||||
@@ -482,6 +690,7 @@ sub release_lock {
|
||||
close($tlock->{fd});
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
=head3 get_unique_members
|
||||
@@ -552,4 +761,6 @@ sub full_path
|
||||
return $fullpath;
|
||||
}
|
||||
|
||||
|
||||
|
||||
1;
|
||||
|
||||
@@ -2,79 +2,59 @@
|
||||
|
||||
B<buildkit> - build a product Kit to package software for installation in an xCAT cluster.
|
||||
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
B<buildkit> [B<-?>|B<-h>|B<--help>] [B<-v>|B<--version>]
|
||||
B<buildkit> [B<-V> | B<--verbose>] B<create> I<kit_basename>
|
||||
|
||||
To build a new Kit
|
||||
B<buildkit> [B<-V> | B<--verbose>] B<chkconfig>
|
||||
|
||||
B<buildkit> [B<-V>|B<--verbose]> I<subcommand> [I<kit_name>] [I<repo_name>|B<all>] [B<-l>|B<--kitloc> I<kit_location>]
|
||||
B<buildkit> [B<-V> | B<--verbose>] B<listrepo>
|
||||
|
||||
To add packages to an existing Kit.
|
||||
B<buildkit> [B<-V> | B<--verbose>] B<buildrepo> {I<repo_name> | B<all>}
|
||||
|
||||
B<buildkit> [B<-V> | B<--verbose>] B<cleanrepo> {I<repo_name> | B<all>}
|
||||
|
||||
B<buildkit> [B<-V> | B<--verbose>] B<buildtar>
|
||||
|
||||
B<buildkit> [B<-V> | B<--verbose>] B<cleantar>
|
||||
|
||||
B<buildkit> [B<-V> | B<--verbose>] B<cleanall>
|
||||
|
||||
B<buildkit> [B<-V> | B<--verbose>] B<addpkgs> I<kit_tarfile> {B<-p> | B<--pkgdir>} {B<-k> | B<--kitversion> I<version>} {B<-r> | B<--kitrelease> I<release>} I<package_directory>
|
||||
|
||||
B<command> [B<-?> | B<-h> | B<--help> | B<-v> | B<--version>]
|
||||
|
||||
B<buildkit> [B<-V>|B<--verbose>] I<addpkgs> I<kit_tarfile> [B<-p>|B<--pkgdir> I<package_directory>] [B<-k>|B<--kitversion> I<version>] [B<-r>|B<--kitrelease> I<release>] [B<-l>|B<--kitloc> I<kit_location>]
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
The B<buildkit> command provides a collection of utilities that may be used to package a software product as a Kit tarfile that can be used to install software on the nodes of an xCAT cluster. A Kit contains the product software packages, configuration and control information, and install and customization scripts.
|
||||
The B<buildkit> command is a collection of utilities to package a product as a Kit that can be installed on an xCAT cluster. A Kit is a tarfile containing the product software packages, configuration and control information, and install and customization scripts.
|
||||
|
||||
You will need to run the B<buildkit> command several times with different subcommands to step through the process of building a kit:
|
||||
|
||||
By default the B<buildkit> subcommands will operate in the current working directory, (ie. look for files, create directories etc.). You could specify a different location by using the "B<-l | --kitloc> I<kit_location>" option.
|
||||
|
||||
The I<kit_location> is the full path name of the directory that contains the kit files. You would use the same location value for all the buildkit subcommands.
|
||||
|
||||
For example, to create a new kit named "prodkit" in the directory /home/mykits/ I<either> run:
|
||||
You will need to run the buildkit command several times with different subcommands to step through the process of building a kit:
|
||||
|
||||
=over 4
|
||||
|
||||
=item 1.
|
||||
|
||||
If no location is provided then the command will create a subdirectory called "prodkit" in the current directory "/home/mykits" and the new kit files will be created there.
|
||||
|
||||
B<cd /home/mykits>
|
||||
|
||||
B<buildkit create prodkit>
|
||||
|
||||
or
|
||||
|
||||
=item 2.
|
||||
|
||||
If a location is provided then the Kit files will be created there. Note that the Kit name does not necessarily have to be the directory name where the kit files are located.
|
||||
|
||||
B<buidkit create prodkit -l /home/mykits/prodkit>
|
||||
|
||||
=back
|
||||
|
||||
In both cases the /home/mykits/prodkit directory is created and the inital files for the kit are created in that directory.
|
||||
|
||||
The following example illustrates the basic process for building a new Kit. In this example we are building a Kit named "mytstkit".
|
||||
|
||||
=over 4
|
||||
|
||||
=item 1.
|
||||
|
||||
Change to the directory where you wish to create the Kit.
|
||||
cd to your work directory
|
||||
|
||||
=item 2.
|
||||
|
||||
Create a template directory for your kit:
|
||||
|
||||
B<buildkit create mytstkit>
|
||||
buildkit create kit_basename
|
||||
|
||||
=item 3.
|
||||
|
||||
Change directory to the new "mytstkit" subdirectory that was just created.
|
||||
cd to the new template directory:
|
||||
|
||||
B<cd mytstkit>
|
||||
cd kit_basename
|
||||
|
||||
=item 4.
|
||||
|
||||
Edit the buildkit configuration file for your kit:
|
||||
|
||||
B<vi buildkit.conf>
|
||||
|
||||
(See xCAT Kit documentation for details.)
|
||||
vi buildkit.conf
|
||||
|
||||
=item 5.
|
||||
|
||||
@@ -82,31 +62,32 @@ Create all required files, scripts, plugins, and packages for your kit.
|
||||
|
||||
=item 6.
|
||||
|
||||
Validate your kit build configuration and fix any errors that are reported:
|
||||
Validate your kit build configuration, fixing any errors that are reported:
|
||||
|
||||
B<buildkit chkconfig>
|
||||
buildkit chkconfig
|
||||
|
||||
=item 7.
|
||||
|
||||
List the repos defined in your buildkit configuration file:
|
||||
|
||||
B<buildkit listrepo>
|
||||
buildkit listrepo
|
||||
|
||||
=item 8.
|
||||
|
||||
For each repo name listed, build the repository. Note that if you need to build repositories for OS distributions, versions, or architectures that do not match the current system, you may need to copy your kit template directory to an appropriate server to build that repository, and then copy the results back to your main build server. For example, to build a repo named "rhels6.3" you would run the following command.
|
||||
For each reponame listed, build the repository. Note that if you need to build repositories for OS distributions, versions, or architectures that do not match the current system, you may need to copy your kit template directory to an appropriate server to build that repository, and then copy the results back to your main build server.
|
||||
|
||||
B<buildkit buildrepo rhels6.3>
|
||||
buildkit buildrepo repo_name
|
||||
|
||||
or, you can build all of the repos at one time if there are no OS or architecture dependencies for kitcomponent package builds or kitpackage builds:
|
||||
|
||||
B<buildkit buildrepo all>
|
||||
buildkit buildrepo all
|
||||
|
||||
=item 9.
|
||||
|
||||
Build the kit tar file:
|
||||
|
||||
B<buildkit buildtar>
|
||||
buildkit buildtar
|
||||
|
||||
|
||||
=back
|
||||
|
||||
@@ -114,29 +95,9 @@ B<buildkit buildtar>
|
||||
|
||||
=over 10
|
||||
|
||||
=item B<-h |--help>
|
||||
|
||||
Display usage message.
|
||||
|
||||
=item B<-k|--kitversion> I<version>
|
||||
|
||||
Product version.
|
||||
|
||||
=item B<-l|--kitloc> I<kit_location>
|
||||
|
||||
The directory location of the Kit files.
|
||||
|
||||
=item B<-r|--kitrelease> I<release>
|
||||
|
||||
Product release.
|
||||
|
||||
=item B<-V |--verbose>
|
||||
|
||||
Verbose mode.
|
||||
|
||||
=item B<-v|--version>
|
||||
|
||||
Command version.
|
||||
Command Version.
|
||||
|
||||
=back
|
||||
|
||||
@@ -146,60 +107,43 @@ Command version.
|
||||
|
||||
=item B<create> I<kit_basename>
|
||||
|
||||
Creates a new kit build directory structure for kit I<kit_basename> using the location specified on the command line or the current directory. The sample kit files from /opt/xcat/share/xcat/kits/kit_template are copied over, and the buildkit.conf file is modified for the specified I<kit_basename>.
|
||||
Creates a new kit build directory structure for kit I<kit_basename> in the current directory. The sample kit files from /opt/xcat/share/xcat/kits/kit_template are copied over, and the <cwd>/I<kit_basename>/buildkit.conf is modified for the specified I<kit_basename>.
|
||||
|
||||
=item B<chkconfig>
|
||||
|
||||
Reads the buildkit.conf file, verifies that the file syntax is correct and that all specified files exist.
|
||||
Reads the buildkit.conf file from the current directory, verifies that the file syntax is correct and that all specified files exist.
|
||||
|
||||
=item B<listrepo>
|
||||
|
||||
Reads the buildkit.conf file, lists all Kit package repositories listed in the file, and reports the build status for each repository.
|
||||
Reads the buildkit.conf file from the current directory, lists all Kit package repositories listed in the file, and reports the build status for each repository.
|
||||
|
||||
=item B<buildrepo> {I<repo_name> | B<all>}
|
||||
|
||||
Reads the buildkit.conf file, and builds the specified Kit package repository. The built packages are placed in the directory <kit_location>/build/kit_repodir/I<repo_name>. If B<all> is specified, all kit repositories are built.
|
||||
Reads the buildkit.conf file from the current directory, and builds the specified Kit package repository. The built packages are placed in the directory <cwd>/build/kit_repodir/I<repo_name>. If B<all> is specified, all kit repositories are built.
|
||||
|
||||
=item B<cleanrepo> {I<repo_name> | B<all>}
|
||||
|
||||
Reads the buildkit.conf file, and deletes all the package files and package meta data files from the <kit_location>/build/kit_repodir/I<repo_name> directory. If B<all> is specified, all kit repository files are deleted.
|
||||
Reads the buildkit.conf file from the current directory, and deletes all the package files and package meta data files from the <cwd>/build/kit_repodir/I<repo_name> directory. If B<all> is specified, all kit repository files are deleted.
|
||||
|
||||
=item B<buildtar>
|
||||
|
||||
Reads the buildkit.conf file, validates that all kit repositories have been built, and builds the Kit tar file <kit_location>/I<kitname>.tar.bz2.
|
||||
Reads the buildkit.conf file from the current directory, validates that all kit repositories have been built, and builds the Kit tar file <cwd>/I<kitname>.tar.bz2.
|
||||
|
||||
=item B<cleantar>
|
||||
|
||||
Reads the <kit_location>/buildkit.conf file and I<deletes> the following:
|
||||
|
||||
=over 4
|
||||
|
||||
- Kit tar files matching <kit_location>/I<kit_name*.tar.bz2>.
|
||||
|
||||
- <kit_location>/build/I<kit_name>
|
||||
|
||||
- <kit_location>/rpmbuild
|
||||
|
||||
- <kit_location>/tmp
|
||||
|
||||
- <kit_location>/debbuild
|
||||
|
||||
=back
|
||||
|
||||
Caution: Make sure you back up any tar files you would like to keep before running this subcommand.
|
||||
Reads the buildkit.conf file from the current directory, deletes the Kit tar <cwd>/I<kitname>.tar.bz2, and deletes all files in the build work directory <cwd>/build/I<kitname>.
|
||||
|
||||
=item B<cleanall>
|
||||
|
||||
Equivalent to running B<buildkit cleanrepo all> and B<buildkit cleantar>.
|
||||
|
||||
=item B<addpkgs>
|
||||
=item B<addpkgs> I<kit_tarfile> {B<-p> | B<--pkgdir>} {B<-k> | B<--kitversion> I<version>} {B<-r> | B<--kitrelease> I<release>} I<package_directory>
|
||||
|
||||
I<kit_tarfile> {B<-p> | B<--pkgdir> I<package_directory>} [B<-k> | B<--kitversion> I<version>] [B<-r> | B<--kitrelease> I<release>]
|
||||
|
||||
Add product package rpms to a previously built kit tar file. This is used for partial product kits that are built and shipped separately from the product packages, and are identified with a I<kit_tarfile> name of I<kitname>.B<NEED_PRODUCT_PKGS.tar.bz2>. Optionally, change the kit release and version values when building the new kit tarfile. If kitcomponent version and/or release values are defaulted to the kit values, those will also be changed and new kitcomponent rpms will be built. If kit or kitcomponent scripts, plugins, or other files specify name, release, or version substitution strings, these will all be replaced with the new values when built into the new complete kit tarfile I<kit_location>/I<new_kitname>.B<tar.bz2>.
|
||||
Add product package rpms to a previously built kit tar file. This is used for incomplete product kits that are built and shipped separately from the product packages, and are identified with a I<kit_tarfile> name of I<kitname>.B<NEED_PRODUCT_PKGS.tar.bz2>. Optionally, change the kit release and version values when building the new kit tarfile. If kitcomponent version and/or release values are defaulted to the kit values, those will also be changed and new kitcomponent rpms will be built. If kit or kitcomponent scripts, plugins, or other files specify name, release, or version substitution strings, these will all be replaced with the new values when built into the new complete kit tarfile I<cwd>/I<new_kitname>.B<tar.bz2>.
|
||||
|
||||
=back
|
||||
|
||||
|
||||
=head1 RETURN VALUE
|
||||
|
||||
=over 3
|
||||
@@ -214,6 +158,7 @@ An error has occurred.
|
||||
|
||||
=back
|
||||
|
||||
|
||||
=head1 EXAMPLES
|
||||
|
||||
=over 3
|
||||
@@ -222,42 +167,30 @@ An error has occurred.
|
||||
|
||||
To create the sample kit shipped with the xCAT-buildkit rpm on a RHELS 6.3 server and naming it B<mykit>, run the following commands:
|
||||
|
||||
B<cd /home/myuserid/kits>
|
||||
|
||||
B<buildkit create mykit>
|
||||
|
||||
B<cd mykit>
|
||||
|
||||
B<vi buildkit.conf>
|
||||
|
||||
B<buildkit chkconfig>
|
||||
|
||||
B<buildkit listrepo>
|
||||
|
||||
B<buildkit buildrepo all >
|
||||
|
||||
B<buildkit buildtar>
|
||||
cd /home/myuserid/kits
|
||||
buildkit create mykit
|
||||
cd mykit
|
||||
vi buildkit.conf
|
||||
buildkit chkconfig
|
||||
buildkit listrepo
|
||||
buildkit buildrepo all
|
||||
buildkit buildtar
|
||||
|
||||
=item 2.
|
||||
|
||||
To clean up a kit repository directory after build failures on a RHELS 6.3 server to prepare for a new kit repository build, run:
|
||||
|
||||
B<buildkit cleanrepo rhels6.3>
|
||||
buildkit cleanrepo rhels6.3
|
||||
|
||||
=item 3.
|
||||
|
||||
To clean up all kit build files, including a previously built kit tar file, run
|
||||
|
||||
B<buildkit cleanall>
|
||||
|
||||
=item 4.
|
||||
|
||||
To create a kit named "tstkit" located in /home/foobar/tstkit instead of the current working directory.
|
||||
|
||||
B<buildkit create tstkit -l /home/foobar/tstkit>
|
||||
buildkit cleanall
|
||||
|
||||
=back
|
||||
|
||||
|
||||
=head1 FILES
|
||||
|
||||
/opt/xcat/bin/buildkit
|
||||
@@ -266,14 +199,14 @@ B<buildkit create tstkit -l /home/foobar/tstkit>
|
||||
|
||||
/opt/xcat/share/xcat/kits/kitcomponent.spec.template
|
||||
|
||||
<kit location>/buildkit.conf
|
||||
<cwd>/buildkit.conf
|
||||
|
||||
<kit location>/build/I<kitname>/kit.conf
|
||||
<cwd>/build/I<kitname>/kit.conf
|
||||
|
||||
<kit location>/I<kitname>.tar.bz2
|
||||
<cwd>/I<kitname>.tar.bz2
|
||||
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
addkit(1), lskit(1), rmkit(1), addkitcomp(1), rmkitcomp(1), chkkitcomp(1)
|
||||
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
kit:
|
||||
basename=chef
|
||||
description=Kit for installing chef server, client and workstation
|
||||
version=11.4.0
|
||||
version=1.0
|
||||
release=1
|
||||
ostype=Linux
|
||||
kitlicense=EPL
|
||||
@@ -126,34 +126,34 @@ kitrepo:
|
||||
kitcomponent:
|
||||
basename=chef_server_kit
|
||||
description=For installing chef server
|
||||
version=11.0.6
|
||||
version=1.0
|
||||
release=1
|
||||
serverroles=mgtnode
|
||||
kitrepoid=rhels6_x86_64
|
||||
kitpkgdeps=chef-server
|
||||
postinstall=server.rpm_post
|
||||
#postinstall=server.post
|
||||
postbootscripts=server.post
|
||||
|
||||
kitcomponent:
|
||||
basename=chef_client_kit
|
||||
description=For installing chef client
|
||||
version=11.4.0
|
||||
version=1.0
|
||||
release=1
|
||||
serverroles=compute
|
||||
kitrepoid=rhels6_x86_64
|
||||
kitpkgdeps=chef
|
||||
postinstall=client.rpm_post
|
||||
#postinstall=client.post
|
||||
postbootscripts=client.post
|
||||
|
||||
kitcomponent:
|
||||
basename=chef_workstation_kit
|
||||
description=For installing chef workstation
|
||||
version=11.4.0
|
||||
version=1.0
|
||||
release=1
|
||||
serverroles=compute
|
||||
kitrepoid=rhels6_x86_64
|
||||
kitpkgdeps=chef
|
||||
postinstall=workstation.rpm_post
|
||||
#postinstall=workstation.post
|
||||
postbootscripts=workstation.post
|
||||
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#-------------------------------------------------------------------------------
|
||||
#=head1 client.post
|
||||
#=head2 This command configures the chef client on a xCAT node. It is used
|
||||
# as a postbootscript for chef_client kit
|
||||
# as a post installation script for chef_client_kit.rpm.
|
||||
#=cut
|
||||
#-------------------------------------------------------------------------------
|
||||
if [ "$NODESETSTATE" = "install" ]; then
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
#!/bin/sh
|
||||
# IBM(c) 2013 EPL license http://www.eclipse.org/legal/epl-v10.html
|
||||
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
#=head1 client.post
|
||||
#=head2 This command configures the chef client on a xCAT node. It is used
|
||||
# as a post installation script for chef_client_kit.rpm
|
||||
#=cut
|
||||
#-------------------------------------------------------------------------------
|
||||
if [ -f "/proc/cmdline" ]; then # prevent running it during install into chroot image
|
||||
#configure the chef client configuration files
|
||||
/xcatpost/config_chef_client "$@"
|
||||
fi
|
||||
|
||||
exit 0
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#-------------------------------------------------------------------------------
|
||||
#=head1 server.post
|
||||
#=head2 This command configures the chef server on a xCAT server or node.
|
||||
# It is used as a postbootscript for chef_server kit
|
||||
# It is used as a post install script for chef_server_kit.rpm
|
||||
#=cut
|
||||
#-------------------------------------------------------------------------------
|
||||
if [ "$NODESETSTATE" = "install" ]; then
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
#!/bin/sh
|
||||
# IBM(c) 2013 EPL license http://www.eclipse.org/legal/epl-v10.html
|
||||
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
#=head1 server.post
|
||||
#=head2 This command configures the chef server on a xCAT server or node.
|
||||
# It is used as a post install script for chef_server_kit.rpm
|
||||
#=cut
|
||||
#-------------------------------------------------------------------------------
|
||||
if [ -f "/proc/cmdline" ]; then # prevent running it during install into chroot image
|
||||
#Now configure the chef server
|
||||
/xcatpost/config_chef_server
|
||||
fi
|
||||
|
||||
exit 0
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#-------------------------------------------------------------------------------
|
||||
#=head1 workstation.post
|
||||
#=head2 This command configures the chef workstation on a xCAT node. It is used
|
||||
# as a postbootscript for chef_workstation kit
|
||||
# as a post installation script for chef_workstation_kit.rpm.
|
||||
#=cut
|
||||
#-------------------------------------------------------------------------------
|
||||
if [ "$NODESETSTATE" = "install" ]; then
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
#!/bin/sh
|
||||
# IBM(c) 2013 EPL license http://www.eclipse.org/legal/epl-v10.html
|
||||
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
#=head1 workstation.post
|
||||
#=head2 This command configures the chef workstation on a xCAT node. It is used
|
||||
# as a post installation script for chef_workstation_kit.rpm
|
||||
#=cut
|
||||
#-------------------------------------------------------------------------------
|
||||
if [ -f "/proc/cmdline" ]; then # prevent running it during install into chroot image
|
||||
#configure the chef workstation configuration files
|
||||
/xcatpost/config_chef_workstation "$@"
|
||||
fi
|
||||
|
||||
exit 0
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,306 @@
|
||||
# Kit Build File
|
||||
#
|
||||
# This file was initially auto-generated by the buildkit CLI command.
|
||||
# To create a new kit, the user should modify this file accordingly.
|
||||
# Refer to the buildkit manpage for further details.
|
||||
#
|
||||
|
||||
# kit: This section defines general info for the Kit.
|
||||
# There must be exactly one kit section in a kit build file.
|
||||
#
|
||||
# kit attributes:
|
||||
# basename (mandatory) Kit base name. e.g., kit-lsf
|
||||
# description (optional) Kit description.
|
||||
# version (mandatory) Kit version. e.g., 1.0
|
||||
# ostype (mandatory) Kit OS type. Must be Linux.
|
||||
# AIX is currently not supported.
|
||||
# isinternal (optional) PCM use only.
|
||||
# Indicate if Kit is for internal use.
|
||||
# Use 1 for yes, 0 for no. Default: 0
|
||||
# kitdeployparams (optional) Filename containing a list of kit deployment
|
||||
# parameters, relative to
|
||||
# <Kit Build Directory>/other_files
|
||||
kit:
|
||||
basename=xlc
|
||||
description=XLC12 for Linux
|
||||
version=12.1.0.0
|
||||
ostype=Linux
|
||||
kitlicense=ILAN
|
||||
# kitdeployparams=sample/kitdeployparams.lst
|
||||
|
||||
|
||||
# kitrepo: This section defines a Kit Package Repository.
|
||||
# There must be at least one kitrepo section in a kit build file.
|
||||
# If you want to support multiple OSes, you should create a separate
|
||||
# repo for each OS. Also, no two repos can be defined with the same
|
||||
# OS name, major/minor version and arch. For example, you cannot have
|
||||
# two repos for RHEL 6.2 ppc64 in the same kit.
|
||||
#
|
||||
# kitrepo attributes:
|
||||
# kitrepoid (mandatory) Kit package repository ID.
|
||||
# Must be unique within this file.
|
||||
# osbasename (mandatory) OS distro base name. e.g., rhels.
|
||||
# osmajorversion (mandatory) OS major version. e.g., 6
|
||||
# osminorversion (optional) OS minor version.
|
||||
# osarch (mandatory) OS architecture. e.g., ppc64
|
||||
# compat_osbasenames (optional) Comma-separated list of compatible
|
||||
# OS distro base names. e.g., centos
|
||||
|
||||
kitrepo:
|
||||
kitrepoid=rhels6_ppc64
|
||||
osbasename=rhels
|
||||
osmajorversion=6
|
||||
osarch=ppc64
|
||||
|
||||
kitrepo:
|
||||
kitrepoid=sles11_ppc64
|
||||
osbasename=sles
|
||||
osmajorversion=11
|
||||
osarch=ppc64
|
||||
|
||||
|
||||
# kitcomponent: This section defines one Kit Component.
|
||||
# There can be zero or more kitcomponent sections.
|
||||
# If you want to build a component which supports multiple OSes,
|
||||
# you should create one kitcomponent section for each OS.
|
||||
# Also, no two components in a kit can be defined with the same
|
||||
# base name.
|
||||
# You can define multiple kit components with the same base name
|
||||
# only if each kit component using this base name meets these
|
||||
# requirements:
|
||||
# - Each kit component must be defined with the same version
|
||||
# and release number
|
||||
# - Each kit component must be defined with a unique kitrepoid
|
||||
|
||||
#
|
||||
# kitcomponent attributes:
|
||||
# basename (mandatory) Kit component base name
|
||||
# description (optional) Kit component description
|
||||
# version (mandatory) Kit component version
|
||||
# release (mandatory) Kit component release
|
||||
# serverroles (mandatory) Comma-separated list of servers that this
|
||||
# component can install on. Valid values:
|
||||
# mgtnode,servicenode,compute,loginnode,storagenode
|
||||
# kitrepoid (mandatory) The ID of the kit package repository this
|
||||
# component belongs to
|
||||
# kitcompdeps (optional) Comma-separated list of kit component
|
||||
# dependencies. These kit components can be included in
|
||||
# this kit or in other kits.
|
||||
# ospkgdeps (optional) Comma-separated list of OS package dependencies
|
||||
# These packages must be shipped with the OS distro.
|
||||
# kitpkgdeps (optional) Comma-separated list of kit package names that
|
||||
# will be listed as "REQUIRES" when building this kit
|
||||
# component. Each package must be defined in a separate
|
||||
# kitpackage section. Each package must be in the same
|
||||
# kitrepo as this kit component.
|
||||
# non_native_pkgs (optional) TBD -- NOT SUPPORTED YET!
|
||||
# Comma-separated list of non-native package
|
||||
# paths that will be included as files in this kit
|
||||
# component. All filenames are relative to
|
||||
# <Kit Build Directory>/source_packages
|
||||
# Kit component deployment scripts must be specified
|
||||
# to manage these files.
|
||||
# driverpacks (optional) Comma-separated list of driver package filenames
|
||||
# Each driverpack must be defined in a separate kitpackage
|
||||
# section.
|
||||
# exlist (optional) Exclude list file for stateless image, relative
|
||||
# to <Kit Build Directory>/other_files
|
||||
# Kit component deployment scripts (optional) Each attribute specifies
|
||||
# script path relative to <Kit Build Directory>/scripts
|
||||
# Script attributes:
|
||||
# preinstall, postinstall, preuninstall, postuninstall,
|
||||
# preupgrade, postupgrade, postbootscripts
|
||||
kitcomponent:
|
||||
basename=xlc_compute
|
||||
description=XLC12 for compute nodes
|
||||
version=12.1.0.0
|
||||
release=120323
|
||||
serverroles=compute
|
||||
kitrepoid=rhels6_ppc64
|
||||
ospkgdeps=libstdc++(ppc-32),libstdc++(ppc-64),libstdc++-devel(ppc-32),libstdc++-devel(ppc-64),glibc-devel(ppc-32),glibc-devel(ppc-64)
|
||||
kitpkgdeps=vac.lic >= 12.1.0.0,vacpp.help.pdf >= 12.1.0.0,vacpp.man >= 12.1.0.0,vacpp.rte >= 12.1.0.0,vacpp.rte.lnk >= 12.1.0.0,vacpp.samples >= 12.1.0.0
|
||||
exlist=xlc.exlist
|
||||
genimage_postinstall=xlc_license,rhels_xlc_compute_install
|
||||
non_native_pkgs=EXTERNALPKGS:vac.lib-12.1.0.0*,EXTERNALPKGS:vac.cmp-12.1.0.0*,EXTERNALPKGS:vacpp.lib-12.1.0.0*,EXTERNALPKGS:vacpp.cmp-12.1.0.0*
|
||||
|
||||
kitcomponent:
|
||||
basename=xlc_loginnode
|
||||
description=XLC12 for login nodes
|
||||
version=12.1.0.0
|
||||
release=120323
|
||||
serverroles=loginnode
|
||||
kitrepoid=rhels6_ppc64
|
||||
ospkgdeps=libstdc++(ppc-32),libstdc++(ppc-64),libstdc++-devel(ppc-32),libstdc++-devel(ppc-64),glibc-devel(ppc-32),glibc-devel(ppc-64)
|
||||
kitpkgdeps=vac.lic >= 12.1.0.0,vacpp.help.pdf >= 12.1.0.0,vacpp.man >= 12.1.0.0,vacpp.rte >= 12.1.0.0,vacpp.rte.lnk >= 12.1.0.0,vacpp.samples >= 12.1.0.0
|
||||
exlist=xlc.exlist
|
||||
genimage_postinstall=xlc_license,rhels_xlc_login_install
|
||||
non_native_pkgs=EXTERNALPKGS:vac.lib-12.1.0.0*,EXTERNALPKGS:vac.cmp-12.1.0.0*,EXTERNALPKGS:vacpp.lib-12.1.0.0*,EXTERNALPKGS:vacpp.cmp-12.1.0.0*
|
||||
|
||||
kitcomponent:
|
||||
basename=min_xlc_compute
|
||||
description=Minimal XLC12 packages for compute nodes
|
||||
version=12.1.0.0
|
||||
release=120323
|
||||
serverroles=compute
|
||||
kitrepoid=rhels6_ppc64
|
||||
ospkgdeps=libstdc++(ppc-32),libstdc++(ppc-64),libstdc++-devel(ppc-32),libstdc++-devel(ppc-64),glibc-devel(ppc-32),glibc-devel(ppc-64)
|
||||
kitpkgdeps=vacpp.rte >= 12.1.0.0,vacpp.rte.lnk >= 12.1.0.0
|
||||
exlist=xlc.exlist
|
||||
genimage_postinstall=xlc_license,rhels_min_xlc_compute_install
|
||||
non_native_pkgs=EXTERNALPKGS:vac.lib-12.1.0.0*,EXTERNALPKGS:vac.cmp-12.1.0.0*,EXTERNALPKGS:vacpp.lib-12.1.0.0*,EXTERNALPKGS:vacpp.cmp-12.1.0.0*
|
||||
|
||||
kitcomponent:
|
||||
basename=xlc_compute
|
||||
description=XLC12 for compute nodes
|
||||
version=12.1.0.0
|
||||
release=120323
|
||||
serverroles=compute
|
||||
kitrepoid=sles11_ppc64
|
||||
ospkgdeps=libstdc++(ppc-32),libstdc++(ppc-64),libstdc++-devel(ppc-32),libstdc++-devel(ppc-64),glibc-devel(ppc-32),glibc-devel(ppc-64)
|
||||
kitpkgdeps=vac.lic >= 12.1.0.0,vacpp.help.pdf >= 12.1.0.0,vacpp.man >= 12.1.0.0,vacpp.rte >= 12.1.0.0,vacpp.rte.lnk >= 12.1.0.0,vacpp.samples >= 12.1.0.0
|
||||
exlist=xlc.exlist
|
||||
genimage_postinstall=xlc_license,sles_xlc_compute_install
|
||||
non_native_pkgs=EXTERNALPKGS:vac.lib-12.1.0.0*,EXTERNALPKGS:vac.cmp-12.1.0.0*,EXTERNALPKGS:vacpp.lib-12.1.0.0*,EXTERNALPKGS:vacpp.cmp-12.1.0.0*
|
||||
|
||||
kitcomponent:
|
||||
basename=xlc_loginnode
|
||||
description=XLC12 for login nodes
|
||||
version=12.1.0.0
|
||||
release=120323
|
||||
serverroles=loginnode
|
||||
kitrepoid=sles11_ppc64
|
||||
ospkgdeps=libstdc++(ppc-32),libstdc++(ppc-64),libstdc++-devel(ppc-32),libstdc++-devel(ppc-64),glibc-devel(ppc-32),glibc-devel(ppc-64)
|
||||
kitpkgdeps=vacpp.help.pdf >= 12.1.0.0,vacpp.lib >= 12.1.0.0,vacpp.man >= 12.1.0.0,vacpp.rte >= 12.1.0.0,vacpp.rte.lnk >= 12.1.0.0,vacpp.samples >= 12.1.0.0
|
||||
exlist=xlc.exlist
|
||||
genimage_postinstall=xlc_license,sles_xlc_login_install
|
||||
non_native_pkgs=EXTERNALPKGS:vac.lib-12.1.0.0*,EXTERNALPKGS:vac.cmp-12.1.0.0*,EXTERNALPKGS:vacpp.lib-12.1.0.0*,EXTERNALPKGS:vacpp.cmp-12.1.0.0*
|
||||
|
||||
kitcomponent:
|
||||
basename=min_xlc_compute
|
||||
description=Minimal XLC12 packages for compute nodes
|
||||
version=12.1.0.0
|
||||
release=120323
|
||||
serverroles=compute
|
||||
kitrepoid=sles11_ppc64
|
||||
ospkgdeps=libstdc++(ppc-32),libstdc++(ppc-64),libstdc++-devel(ppc-32),libstdc++-devel(ppc-64),glibc-devel(ppc-32),glibc-devel(ppc-64)
|
||||
kitpkgdeps=vacpp.rte >= 12.1.0.0,vacpp.rte.lnk >= 12.1.0.0
|
||||
exlist=xlc.exlist
|
||||
genimage_postinstall=xlc_license,sles_min_xlc_compute_install
|
||||
non_native_pkgs=EXTERNALPKGS:vac.lib-12.1.0.0*,EXTERNALPKGS:vac.cmp-12.1.0.0*,EXTERNALPKGS:vacpp.lib-12.1.0.0*,EXTERNALPKGS:vacpp.cmp-12.1.0.0*
|
||||
|
||||
|
||||
# kitpackage: This section defines one Kit Package, and how to build it.
|
||||
# There can be zero or more kitpackage sections.
|
||||
# All filenames should be relative paths to
|
||||
# <Kit Build Directory>/source_packages
|
||||
# If you want to build a package which can run on multiple OSes,
|
||||
# you have two options:
|
||||
# 1. Build a separate package for each OS you want to support.
|
||||
# For this option, you need to define one kitpackage section
|
||||
# per supported OS.
|
||||
# 2. Build one package that can run on multiple OSes.
|
||||
# If you are building an RPM package, you are responsible for
|
||||
# creating an RPM spec file that can run on multiple OSes.
|
||||
# For this option, you need to define one kitpackage section
|
||||
# which contains multiple kitrepoid lines.
|
||||
#
|
||||
# kitpackage attributes:
|
||||
# filename (mandatory) Package filename
|
||||
# kitrepoid (mandatory) The repo(s) this package belongs to.
|
||||
# If multiple repos are defined, the package will be built for
|
||||
# the first repo only. For the other repos, a symlink is created
|
||||
# to the package built for the first repo.
|
||||
# Package build methods (optional)
|
||||
# Define how to build the packages.
|
||||
# If you don't specify a build method, the default behavior is
|
||||
# to assume the package is pre-built under
|
||||
# <Kit Build Directory>/source_packages
|
||||
# All files in this section are relative to
|
||||
# <Kit Build Directory>/source_packages
|
||||
# There are four methods to build packages.
|
||||
# 1. Use pre-built RPM package
|
||||
# isexternalpkg: 'no'|'0', 'yes'|'1' (default: 'no')
|
||||
# Indicates whether the RPM package will be added to the
|
||||
# the kit tar file now as part of the kit build process,
|
||||
# or whether the customer will need to separately
|
||||
# obtain the RPM pacakage and add it to the kit tar file
|
||||
# using 'buildkit addpkgs'
|
||||
# rpm_prebuiltdir: If isexternalpkg=yes, path to directory
|
||||
# containing pre-built RPM package
|
||||
# 2. Build RPM from spec + src dir
|
||||
# rpm_spec: Path to spec file.
|
||||
# rpm_srcdir: Path to source directory.
|
||||
# 3. Build RPM from spec + src tarball
|
||||
# rpm_spec: Path to spec file.
|
||||
# rpm_srctarball: Path to source tarball.
|
||||
# 4. Build RPM from source RPM
|
||||
# rpm_srpm: Path to source RPM package.
|
||||
kitpackage:
|
||||
filename=vac.cmp-12.1.0.0-120323.ppc64.rpm
|
||||
kitrepoid=rhels6_ppc64,sles11_ppc64
|
||||
# Method 1: Use pre-built RPM package
|
||||
isexternalpkg=yes
|
||||
|
||||
|
||||
kitpackage:
|
||||
filename=vac.lib-12.1.0.0-120323.ppc64.rpm
|
||||
kitrepoid=rhels6_ppc64,sles11_ppc64
|
||||
# Method 1: Use pre-built RPM package
|
||||
isexternalpkg=yes
|
||||
|
||||
|
||||
kitpackage:
|
||||
filename=vac.lic-12.1.0.0-120323.ppc64.rpm
|
||||
kitrepoid=rhels6_ppc64,sles11_ppc64
|
||||
# Method 1: Use pre-built RPM package
|
||||
isexternalpkg=yes
|
||||
|
||||
|
||||
kitpackage:
|
||||
filename=vacpp.cmp-12.1.0.0-120323.ppc64.rpm
|
||||
kitrepoid=rhels6_ppc64,sles11_ppc64
|
||||
# Method 1: Use pre-built RPM package
|
||||
isexternalpkg=yes
|
||||
|
||||
|
||||
kitpackage:
|
||||
filename=vacpp.help.pdf-12.1.0.0-120323.ppc64.rpm
|
||||
kitrepoid=rhels6_ppc64,sles11_ppc64
|
||||
# Method 1: Use pre-built RPM package
|
||||
isexternalpkg=yes
|
||||
|
||||
|
||||
kitpackage:
|
||||
filename=vacpp.lib-12.1.0.0-120323.ppc64.rpm
|
||||
kitrepoid=rhels6_ppc64,sles11_ppc64
|
||||
# Method 1: Use pre-built RPM package
|
||||
isexternalpkg=yes
|
||||
|
||||
|
||||
kitpackage:
|
||||
filename=vacpp.man-12.1.0.0-120323.ppc64.rpm
|
||||
kitrepoid=rhels6_ppc64,sles11_ppc64
|
||||
# Method 1: Use pre-built RPM package
|
||||
isexternalpkg=yes
|
||||
|
||||
|
||||
kitpackage:
|
||||
filename=vacpp.rte-12.1.0.0-120323.ppc64.rpm
|
||||
kitrepoid=rhels6_ppc64,sles11_ppc64
|
||||
# Method 1: Use pre-built RPM package
|
||||
isexternalpkg=yes
|
||||
|
||||
|
||||
kitpackage:
|
||||
filename=vacpp.rte.lnk-12.1.0.0-120323.ppc64.rpm
|
||||
kitrepoid=rhels6_ppc64,sles11_ppc64
|
||||
# Method 1: Use pre-built RPM package
|
||||
isexternalpkg=yes
|
||||
|
||||
|
||||
kitpackage:
|
||||
filename=vacpp.samples-12.1.0.0-120323.ppc64.rpm
|
||||
kitrepoid=rhels6_ppc64,sles11_ppc64
|
||||
# Method 1: Use pre-built RPM package
|
||||
isexternalpkg=yes
|
||||
|
||||
Executable
+14
@@ -0,0 +1,14 @@
|
||||
./opt/ibmcmp/msg/*
|
||||
+./opt/ibmcmp/msg/en_US*
|
||||
|
||||
./opt/ibmcmp/vac/*/crt/include*
|
||||
./opt/ibmcmp/vac/*/include*
|
||||
./opt/ibmcmp/vac/*/msg/*
|
||||
+./opt/ibmcmp/vac/*/msg/en_US*
|
||||
./opt/ibmcmp/vac/*/lap/LI_*
|
||||
./opt/ibmcmp/vac/*/lap/LA_*
|
||||
./opt/ibmcmp/vac/*/lap/license/*.txt
|
||||
|
||||
./opt/ibmcmp/vacpp/*/include*
|
||||
./opt/ibmcmp/vacpp/*/msg/*
|
||||
+./opt/ibmcmp/vacpp/*/msg/en_US*
|
||||
+175
@@ -0,0 +1,175 @@
|
||||
package xCAT_plugin::<<<buildkit_WILL_INSERT_kitname_HERE>>>_imageprofile;
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
require xCAT::Utils;
|
||||
require xCAT::Table;
|
||||
require xCAT::KitPluginUtils;
|
||||
|
||||
|
||||
# buildkit Processing
|
||||
# In order to avoid collisions with other plugins, the package
|
||||
# name for this plugin must contain the full kit name.
|
||||
# The buildkit buildtar command will copy this file from your plugins
|
||||
# directory to the the kit build directory, renaming the file with the
|
||||
# correct kit name. All strings in this file of the form
|
||||
# <<<buildkit_WILL_INSERT_kitname_HERE>>>
|
||||
# will be replaced with the full kit name. In order for buildkit to
|
||||
# correctly edit this file, do not remove these strings.
|
||||
|
||||
|
||||
# Global Variables
|
||||
|
||||
# This is the full name of the kit which this plugin belongs
|
||||
# to. The kit name is used by some code in process_request()
|
||||
# to determine if the plugin should run. When you are testing
|
||||
# your plugin the kit name should be set to "TESTMODE" to
|
||||
# bypass the plugin check in process_request().
|
||||
|
||||
our ($PLUGIN_KITNAME);
|
||||
#$PLUGIN_KITNAME = "TESTMODE";
|
||||
$PLUGIN_KITNAME = "<<<buildkit_WILL_INSERT_kitname_HERE>>>";
|
||||
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head1
|
||||
|
||||
Image Profile Kit Plugin
|
||||
This plugin contains commands to run custom actions
|
||||
during image profile operations.
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head3 handled_commands
|
||||
|
||||
Return list of kit plugin commands handled by this plugin
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
sub handled_commands {
|
||||
return {
|
||||
kitimagevalidatecomps => '<<<buildkit_WILL_INSERT_kitname_HERE>>>_imageprofile',
|
||||
kitimageimport => '<<<buildkit_WILL_INSERT_kitname_HERE>>>_imageprofile',
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head3 process_request
|
||||
|
||||
Process the kit plugin command.
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
sub process_request {
|
||||
my $request = shift;
|
||||
my $callback = shift;
|
||||
|
||||
# This kit plugin is passed the name of an image profile.
|
||||
# We need to determine which kits is used by this
|
||||
# image profile to decide if this plugin should run or not.
|
||||
|
||||
my $imgprofilename = $request->{arg}->[0];
|
||||
|
||||
my $kitdata = $request->{kitdata};
|
||||
if (! defined($kitdata)) {
|
||||
$kitdata = xCAT::KitPluginUtils->get_kits_used_by_image_profiles([$imgprofilename]);
|
||||
$request->{kitdata} = $kitdata;
|
||||
}
|
||||
|
||||
if ($PLUGIN_KITNAME ne "TESTMODE" && ! exists($kitdata->{$PLUGIN_KITNAME})) {
|
||||
return;
|
||||
}
|
||||
|
||||
# Name of command and node list
|
||||
my $command = $request->{command}->[0];
|
||||
my $args = $request->{arg};
|
||||
|
||||
if($command eq 'kitimagevalidatecomps') {
|
||||
kitimagevalidatecomps($callback, $args);
|
||||
}
|
||||
elsif ($command eq 'kitimageimport') {
|
||||
kitimageimport($callback, $args);
|
||||
|
||||
} else {
|
||||
my $rsp;
|
||||
$rsp->{data}->[0] = "Command is not supported";
|
||||
xCAT::MsgUtils->message("E", $rsp, $callback);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head3 kitimagevalidatecomps
|
||||
|
||||
This command is called to validate new changes to an
|
||||
image profile's kit component list before the changes
|
||||
are committed.
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
sub kitimagevalidatecomps {
|
||||
my $callback = shift;
|
||||
my $args = shift;
|
||||
my $rsp;
|
||||
|
||||
# Parameters
|
||||
my $imgprofilename = $args->[0];
|
||||
my $newcomplist = $args->[1];
|
||||
my @newcomplist = ();
|
||||
if (defined($newcomplist)) {
|
||||
@newcomplist = split(/,/, $newcomplist);
|
||||
}
|
||||
my $newosdistro = $args->[2];
|
||||
my $newosdistroupdate = $args->[3];
|
||||
|
||||
$rsp->{data}->[0] = "Running kitimagevalidatecomps";
|
||||
xCAT::MsgUtils->message("I", $rsp, $callback);
|
||||
|
||||
# TODO
|
||||
# ... ADD YOUR CODE HERE
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head3 kitimageimport
|
||||
|
||||
This command is called after changes to an image profile
|
||||
have been committed.
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
sub kitimageimport {
|
||||
my $callback = shift;
|
||||
my $args = shift;
|
||||
my $rsp;
|
||||
|
||||
# Parameters
|
||||
my $imgprofilename = $args->[0];
|
||||
|
||||
$rsp->{data}->[0] = "Running kitimageimport";
|
||||
xCAT::MsgUtils->message("I", $rsp, $callback);
|
||||
|
||||
# TODO
|
||||
# ... ADD YOUR CODE HERE
|
||||
}
|
||||
|
||||
|
||||
+251
@@ -0,0 +1,251 @@
|
||||
package xCAT_plugin::<<<buildkit_WILL_INSERT_kitname_HERE>>>_nodemgmt;
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
require xCAT::Utils;
|
||||
require xCAT::Table;
|
||||
require xCAT::KitPluginUtils;
|
||||
|
||||
# buildkit Processing
|
||||
# In order to avoid collisions with other plugins, the package
|
||||
# name for this plugin must contain the full kit name.
|
||||
# The buildkit buildtar command will copy this file from your plugins
|
||||
# directory to the the kit build directory, renaming the file with the
|
||||
# correct kit name. All strings in this file of the form
|
||||
# <<<buildkit_WILL_INSERT_kitname_HERE>>>
|
||||
# will be replaced with the full kit name. In order for buildkit to
|
||||
# correctly edit this file, do not remove these strings.
|
||||
|
||||
# Global Variables
|
||||
|
||||
# This is the full name of the kit which this plugin belongs
|
||||
# to. The kit name is used by some code in process_request()
|
||||
# to determine if the plugin should run. When you are testing
|
||||
# your plugin the kit name should be set to "TESTMODE" to
|
||||
# bypass the plugin check in process_request().
|
||||
|
||||
our ($PLUGIN_KITNAME);
|
||||
#$PLUGIN_KITNAME = "TESTMODE";
|
||||
$PLUGIN_KITNAME = "<<<buildkit_WILL_INSERT_kitname_HERE>>>";
|
||||
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head1
|
||||
|
||||
Node Management Kit Plugin
|
||||
This plugin contains commands to run custom actions
|
||||
during node management operations.
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head3 handled_commands
|
||||
|
||||
Return list of kit plugin commands handled by this plugin
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
sub handled_commands {
|
||||
return {
|
||||
kitnodeadd => '<<<buildkit_WILL_INSERT_kitname_HERE>>>_nodemgmt',
|
||||
kitnoderemove => '<<<buildkit_WILL_INSERT_kitname_HERE>>>_nodemgmt',
|
||||
kitnodeupdate => '<<<buildkit_WILL_INSERT_kitname_HERE>>>_nodemgmt',
|
||||
kitnoderefresh => '<<<buildkit_WILL_INSERT_kitname_HERE>>>_nodemgmt',
|
||||
kitnodefinished => '<<<buildkit_WILL_INSERT_kitname_HERE>>>_nodemgmt',
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head3 process_request
|
||||
|
||||
Process the kit plugin command.
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
sub process_request {
|
||||
my $request = shift;
|
||||
my $callback = shift;
|
||||
|
||||
# Name of command and node list
|
||||
my $command = $request->{command}->[0];
|
||||
my $nodes = $request->{node};
|
||||
|
||||
# This kit plugin is passed a list of node names.
|
||||
# We need to determine which kits are used by these
|
||||
# nodes to decide if this plugin should run or not.
|
||||
|
||||
my $kitdata = $request->{kitdata};
|
||||
if (! defined($kitdata)) {
|
||||
$kitdata = xCAT::KitPluginUtils->get_kits_used_by_nodes($nodes);
|
||||
$request->{kitdata} = $kitdata;
|
||||
}
|
||||
|
||||
if ($PLUGIN_KITNAME ne "TESTMODE" && ! exists($kitdata->{$PLUGIN_KITNAME})) {
|
||||
return;
|
||||
}
|
||||
|
||||
# Get the nodes using this plugin's kit
|
||||
$nodes = $kitdata->{$PLUGIN_KITNAME};
|
||||
|
||||
|
||||
if($command eq 'kitnodeadd') {
|
||||
kitnodeadd($callback, $nodes);
|
||||
}
|
||||
elsif ($command eq 'kitnoderemove') {
|
||||
kitnoderemove($callback, $nodes);
|
||||
}
|
||||
elsif ($command eq 'kitnodeupdate') {
|
||||
kitnodeupdate($callback, $nodes);
|
||||
}
|
||||
elsif ($command eq 'kitnoderefresh') {
|
||||
kitnoderefresh($callback, $nodes);
|
||||
}
|
||||
elsif ($command eq 'kitnodefinished') {
|
||||
kitnodefinished($callback);
|
||||
|
||||
} else {
|
||||
my $rsp;
|
||||
$rsp->{data}->[0] = "Command is not supported";
|
||||
xCAT::MsgUtils->message("E", $rsp, $callback);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head3 kitnodeadd
|
||||
|
||||
This command is called when one or more nodes are added
|
||||
to the cluster.
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
sub kitnodeadd {
|
||||
my $callback = shift;
|
||||
my $rsp;
|
||||
|
||||
# Parameters
|
||||
my $nodes = shift;
|
||||
|
||||
$rsp->{data}->[0] = "Running kitnodeadd";
|
||||
xCAT::MsgUtils->message("I", $rsp, $callback);
|
||||
|
||||
# TODO
|
||||
# ... ADD YOUR CODE HERE
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head3 kitnoderemove
|
||||
|
||||
This command is called when one or more nodes are
|
||||
removed from the cluster.
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
sub kitnoderemove {
|
||||
my $callback = shift;
|
||||
my $rsp;
|
||||
|
||||
# Parameters
|
||||
my $nodes = shift;
|
||||
|
||||
$rsp->{data}->[0] = "Running kitnoderemove";
|
||||
xCAT::MsgUtils->message("I", $rsp, $callback);
|
||||
|
||||
# TODO
|
||||
# ... ADD YOUR CODE HERE
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head3 kitnodeupdate
|
||||
|
||||
This command is called when the configuration of one
|
||||
or more nodes are updated.
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
sub kitnodeupdate {
|
||||
my $callback = shift;
|
||||
my $rsp;
|
||||
|
||||
# Parameters
|
||||
my $nodes = shift;
|
||||
|
||||
$rsp->{data}->[0] = "Running kitnodeupdate";
|
||||
xCAT::MsgUtils->message("I", $rsp, $callback);
|
||||
|
||||
# TODO
|
||||
# ... ADD YOUR CODE HERE
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head3 kitnoderefresh
|
||||
|
||||
This command is called when node-related configuration
|
||||
files are updated.
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
sub kitnoderefresh {
|
||||
my $callback = shift;
|
||||
my $rsp;
|
||||
|
||||
# Parameters
|
||||
my $nodes = shift;
|
||||
|
||||
$rsp->{data}->[0] = "Running kitnoderefresh";
|
||||
xCAT::MsgUtils->message("I", $rsp, $callback);
|
||||
|
||||
# TODO
|
||||
# ... ADD YOUR CODE HERE
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head3 kitnodefinished
|
||||
|
||||
This command is called at the end of a node management
|
||||
operation.
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
sub kitnodefinished {
|
||||
my $callback = shift;
|
||||
my $rsp;
|
||||
|
||||
$rsp->{data}->[0] = "Running kitnodefinished";
|
||||
xCAT::MsgUtils->message("I", $rsp, $callback);
|
||||
|
||||
# TODO
|
||||
# ... ADD YOUR CODE HERE
|
||||
}
|
||||
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
|
||||
#!/bin/sh
|
||||
|
||||
if [[ ! -z "$installroot" ]]; then
|
||||
if [ -n "`ls $installroot/opt/xcat/kits/xlc/xlc_min_compute-12.1.0.0-120323-rhels-6-ppc64/*.rpm 2> /dev/null`" ] ; then
|
||||
rpm --force --root $installroot -Uvh $installroot/opt/xcat/kits/xlc/xlc_min_compute-12.1.0.0-120323-rhels-6-ppc64/*.rpm
|
||||
fi
|
||||
else
|
||||
if [ -n "`ls /opt/xcat/kits/xlc/xlc_min_compute-12.1.0.0-120323-rhels-6-ppc64/*.rpm 2> /dev/null`" ] ; then
|
||||
rpm --force -Uvh /opt/xcat/kits/xlc/xlc_min_compute-12.1.0.0-120323-rhels-6-ppc64/*.rpm
|
||||
fi
|
||||
fi
|
||||
|
||||
exit 0
|
||||
~
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
|
||||
#!/bin/sh
|
||||
|
||||
if [[ ! -z "$installroot" ]]; then
|
||||
if [ -n "`ls $installroot/opt/xcat/kits/xlc/xlc_compute-12.1.0.0-120323-rhels-6-ppc64/*.rpm 2> /dev/null`" ] ; then
|
||||
rpm --force --root $installroot -Uvh $installroot/opt/xcat/kits/xlc/xlc_compute-12.1.0.0-120323-rhels-6-ppc64/*.rpm
|
||||
fi
|
||||
else
|
||||
if [ -n "`ls /opt/xcat/kits/xlc/xlc_compute-12.1.0.0-120323-rhels-6-ppc64/*.rpm 2> /dev/null`" ] ; then
|
||||
rpm --force -Uvh /opt/xcat/kits/xlc/xlc_compute-12.1.0.0-120323-rhels-6-ppc64/*.rpm
|
||||
fi
|
||||
fi
|
||||
|
||||
exit 0
|
||||
~
|
||||
xCAT-buildkit/share/xcat/kits/kit_build/compiler/partial_xlc12-Linux/scripts/rhels_xlc_login_install
Executable
+15
@@ -0,0 +1,15 @@
|
||||
|
||||
#!/bin/sh
|
||||
|
||||
if [[ ! -z "$installroot" ]]; then
|
||||
if [ -n "`ls $installroot/opt/xcat/kits/xlc/xlc_login-12.1.0.0-120323-rhels-6-ppc64/*.rpm 2> /dev/null`" ] ; then
|
||||
rpm --force --root $installroot -Uvh $installroot/opt/xcat/kits/xlc/xlc_login-12.1.0.0-120323-rhels-6-ppc64/*.rpm
|
||||
fi
|
||||
else
|
||||
if [ -n "`ls /opt/xcat/kits/xlc/xlc_login-12.1.0.0-120323-rhels-6-ppc64/*.rpm 2> /dev/null`" ] ; then
|
||||
rpm --force -Uvh /opt/xcat/kits/xlc/xlc_login-12.1.0.0-120323-rhels-6-ppc64/*.rpm
|
||||
fi
|
||||
fi
|
||||
|
||||
exit 0
|
||||
~
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
|
||||
#!/bin/sh
|
||||
|
||||
if [[ ! -z "$installroot" ]]; then
|
||||
if [ -n "`ls $installroot/opt/xcat/kits/xlc/xlc_min_compute-12.1.0.0-120323-sles-11-ppc64/*.rpm 2> /dev/null`" ] ; then
|
||||
rpm --force --root $installroot -Uvh $installroot/opt/xcat/kits/xlc/xlc_min_compute-12.1.0.0-120323-sles-11-ppc64/*.rpm
|
||||
fi
|
||||
else
|
||||
if [ -n "`ls /opt/xcat/kits/xlc/xlc_min_compute-12.1.0.0-120323-sles-11-ppc64/*.rpm 2> /dev/null`" ] ; then
|
||||
rpm --force -Uvh /opt/xcat/kits/xlc/xlc_min_compute-12.1.0.0-120323-sles-11-ppc64/*.rpm
|
||||
fi
|
||||
fi
|
||||
|
||||
exit 0
|
||||
~
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
|
||||
#!/bin/sh
|
||||
|
||||
if [[ ! -z "$installroot" ]]; then
|
||||
if [ -n "`ls $installroot/opt/xcat/kits/xlc/xlc_compute-12.1.0.0-120323-sles-11-ppc64/*.rpm 2> /dev/null`" ] ; then
|
||||
rpm --force --root $installroot -Uvh $installroot/opt/xcat/kits/xlc/xlc_compute-12.1.0.0-120323-sles-11-ppc64/*.rpm
|
||||
fi
|
||||
else
|
||||
if [ -n "`ls /opt/xcat/kits/xlc/xlc_compute-12.1.0.0-120323-sles-11-ppc64/*.rpm 2> /dev/null`" ] ; then
|
||||
rpm --force -Uvh /opt/xcat/kits/xlc/xlc_compute-12.1.0.0-120323-sles-11-ppc64/*.rpm
|
||||
fi
|
||||
fi
|
||||
|
||||
exit 0
|
||||
~
|
||||
Executable
+15
@@ -0,0 +1,15 @@
|
||||
|
||||
#!/bin/sh
|
||||
|
||||
if [[ ! -z "$installroot" ]]; then
|
||||
if [ -n "`ls $installroot/opt/xcat/kits/xlc/xlc_login-12.1.0.0-120323-sles-11-ppc64/*.rpm 2> /dev/null`" ] ; then
|
||||
rpm --force --root $installroot -Uvh $installroot/opt/xcat/kits/xlc/xlc_login-12.1.0.0-120323-sles-11-ppc64/*.rpm
|
||||
fi
|
||||
else
|
||||
if [ -n "`ls /opt/xcat/kits/xlc/xlc_login-12.1.0.0-120323-sles-11-ppc64/*.rpm 2> /dev/null`" ] ; then
|
||||
rpm --force -Uvh /opt/xcat/kits/xlc/xlc_login-12.1.0.0-120323-sles-11-ppc64/*.rpm
|
||||
fi
|
||||
fi
|
||||
|
||||
exit 0
|
||||
~
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
#!/bin/sh
|
||||
|
||||
#
|
||||
# Sample script to accept licenses for the IBM vacpp compilers
|
||||
# For Linux:
|
||||
# Assumes all compiler software has been installed
|
||||
|
||||
OS=`uname`
|
||||
if [ $OS != "AIX" ]; then
|
||||
cd $installroot/
|
||||
vacpp_script=`find opt/ibmcmp/vacpp -name new_install -print`
|
||||
|
||||
if [ -n $installroot ]; then
|
||||
# Being run from a stateful install postscript or stateless postbootscript.
|
||||
if [ -n "$vacpp_script" ] ; then
|
||||
echo 1 | chroot $installroot /$vacpp_script
|
||||
fi
|
||||
else
|
||||
# Being run from a stateful install postscript postbootscript.
|
||||
if [ -n "$vacpp_script" ] ; then
|
||||
echo 1 | $vacpp_script
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
@@ -0,0 +1,327 @@
|
||||
# Kit Build File
|
||||
#
|
||||
# This file was initially auto-generated by the buildkit CLI command.
|
||||
# To create a new kit, the user should modify this file accordingly.
|
||||
# Refer to the buildkit manpage for further details.
|
||||
#
|
||||
|
||||
# kit: This section defines general info for the Kit.
|
||||
# There must be exactly one kit section in a kit build file.
|
||||
#
|
||||
# kit attributes:
|
||||
# basename (mandatory) Kit base name. e.g., kit-lsf
|
||||
# description (optional) Kit description.
|
||||
# version (mandatory) Kit version. e.g., 1.0
|
||||
# ostype (mandatory) Kit OS type. Must be Linux.
|
||||
# AIX is currently not supported.
|
||||
# isinternal (optional) PCM use only.
|
||||
# Indicate if Kit is for internal use.
|
||||
# Use 1 for yes, 0 for no. Default: 0
|
||||
# kitdeployparams (optional) Filename containing a list of kit deployment
|
||||
# parameters, relative to
|
||||
# <Kit Build Directory>/other_files
|
||||
kit:
|
||||
basename=xlf
|
||||
description=XLF14 for Linux
|
||||
version=14.1.0.0
|
||||
ostype=Linux
|
||||
kitlicense=ILAN
|
||||
# kitdeployparams=sample/kitdeployparams.lst
|
||||
|
||||
|
||||
# kitrepo: This section defines a Kit Package Repository.
|
||||
# There must be at least one kitrepo section in a kit build file.
|
||||
# If you want to support multiple OSes, you should create a separate
|
||||
# repo for each OS. Also, no two repos can be defined with the same
|
||||
# OS name, major/minor version and arch. For example, you cannot have
|
||||
# two repos for RHEL 6.2 ppc64 in the same kit.
|
||||
#
|
||||
# kitrepo attributes:
|
||||
# kitrepoid (mandatory) Kit package repository ID.
|
||||
# Must be unique within this file.
|
||||
# osbasename (mandatory) OS distro base name. e.g., rhels.
|
||||
# osmajorversion (mandatory) OS major version. e.g., 6
|
||||
# osminorversion (optional) OS minor version.
|
||||
# osarch (mandatory) OS architecture. e.g., ppc64
|
||||
# compat_osbasenames (optional) Comma-separated list of compatible
|
||||
# OS distro base names. e.g., centos
|
||||
|
||||
kitrepo:
|
||||
kitrepoid=rhels6_ppc64
|
||||
osbasename=rhels
|
||||
osmajorversion=6
|
||||
osarch=ppc64
|
||||
|
||||
kitrepo:
|
||||
kitrepoid=sles11_ppc64
|
||||
osbasename=sles
|
||||
osmajorversion=11
|
||||
osarch=ppc64
|
||||
|
||||
|
||||
# kitcomponent: This section defines one Kit Component.
|
||||
# There can be zero or more kitcomponent sections.
|
||||
# If you want to build a component which supports multiple OSes,
|
||||
# you should create one kitcomponent section for each OS.
|
||||
# Also, no two components in a kit can be defined with the same
|
||||
# base name.
|
||||
# You can define multiple kit components with the same base name
|
||||
# only if each kit component using this base name meets these
|
||||
# requirements:
|
||||
# - Each kit component must be defined with the same version
|
||||
# and release number
|
||||
# - Each kit component must be defined with a unique kitrepoid
|
||||
|
||||
#
|
||||
# kitcomponent attributes:
|
||||
# basename (mandatory) Kit component base name
|
||||
# description (optional) Kit component description
|
||||
# version (mandatory) Kit component version
|
||||
# release (mandatory) Kit component release
|
||||
# serverroles (mandatory) Comma-separated list of servers that this
|
||||
# component can install on. Valid values:
|
||||
# mgtnode,service,compute,login,storage
|
||||
# kitrepoid (mandatory) The ID of the kit package repository this
|
||||
# component belongs to
|
||||
# kitcompdeps (optional) Comma-separated list of kit component
|
||||
# dependencies. These kit components can be included in
|
||||
# this kit or in other kits.
|
||||
# ospkgdeps (optional) Comma-separated list of OS package dependencies
|
||||
# These packages must be shipped with the OS distro.
|
||||
# kitpkgdeps (optional) Comma-separated list of kit package names that
|
||||
# will be listed as "REQUIRES" when building this kit
|
||||
# component. Each package must be defined in a separate
|
||||
# kitpackage section. Each package must be in the same
|
||||
# kitrepo as this kit component.
|
||||
# non_native_pkgs (optional) TBD -- NOT SUPPORTED YET!
|
||||
# Comma-separated list of non-native package
|
||||
# paths that will be included as files in this kit
|
||||
# component. All filenames are relative to
|
||||
# <Kit Build Directory>/source_packages
|
||||
# Kit component deployment scripts must be specified
|
||||
# to manage these files.
|
||||
# driverpacks (optional) Comma-separated list of driver package filenames
|
||||
# Each driverpack must be defined in a separate kitpackage
|
||||
# section.
|
||||
# exlist (optional) Exclude list file for stateless image, relative
|
||||
# to <Kit Build Directory>/other_files
|
||||
# Kit component deployment scripts (optional) Each attribute specifies
|
||||
# script path relative to <Kit Build Directory>/scripts
|
||||
# Script attributes:
|
||||
# preinstall, postinstall, preuninstall, postuninstall,
|
||||
# preupgrade, postupgrade, postbootscripts
|
||||
kitcomponent:
|
||||
basename=xlf_compute
|
||||
description=XLF14 for compute nodes
|
||||
version=14.1.0.0
|
||||
release=120323
|
||||
serverroles=compute
|
||||
kitrepoid=rhels6_ppc64
|
||||
ospkgdeps=libstdc++(ppc-32),libstdc++(ppc-64),libstdc++-devel(ppc-32),libstdc++-devel(ppc-64),glibc-devel(ppc-32),glibc-devel(ppc-64),compat-libstdc++-33(ppc-32),compat-libstdc++-33(ppc-64)
|
||||
kitpkgdeps=xlmass.lib >= 7.1.0.0,xlsmp.msg.rte >= 3.1.0.0,xlsmp.rte >= 3.1.0.0,xlsmp.lib >= 3.1.0.0,xlf.msg.rte >= 14.1.0.0,xlf.rte >= 14.1.0.0,xlf.rte.lnk >= 14.1.0.0,xlf.help.pdf >= 14.1.0.0,xlf.samples >= 14.1.0.0,xlf.man >= 14.1.0.0,xlf.lic >= 14.1.0.0
|
||||
exlist=xlf.exlist
|
||||
genimage_postinstall=xlf_license,rhels_xlf_compute_install
|
||||
non_native_pkgs=EXTERNALPKGS:xlf.lib-14.1.0.0-*.rpm,EXTERNALPKGS:xlf.cmp-14.1.0.0-*.rpm
|
||||
|
||||
kitcomponent:
|
||||
basename=xlf_login
|
||||
description=XLF14 for login nodes
|
||||
version=14.1.0.0
|
||||
release=120323
|
||||
serverroles=login
|
||||
kitrepoid=rhels6_ppc64
|
||||
ospkgdeps=libstdc++(ppc-32),libstdc++(ppc-64),libstdc++-devel(ppc-32),libstdc++-devel(ppc-64),glibc-devel(ppc-32),glibc-devel(ppc-64),compat-libstdc++-33(ppc-32),compat-libstdc++-33(ppc-64)
|
||||
kitpkgdeps=xlmass.lib >= 7.1.0.0,xlsmp.msg.rte >= 3.1.0.0,xlsmp.rte >= 3.1.0.0,xlsmp.lib >= 3.1.0.0,xlf.msg.rte >= 14.1.0.0,xlf.rte >= 14.1.0.0,xlf.rte.lnk >= 14.1.0.0,xlf.help.pdf >= 14.1.0.0,xlf.samples >= 14.1.0.0,xlf.man >= 14.1.0.0,xlf.lic >= 14.1.0.0
|
||||
exlist=xlf.exlist
|
||||
genimage_postinstall=xlf_license,rhels_xlf_login_install
|
||||
non_native_pkgs=EXTERNALPKGS:xlf.lib-14.1.0.0-*.rpm,EXTERNALPKGS:xlf.cmp-14.1.0.0-*.rpm
|
||||
|
||||
kitcomponent:
|
||||
basename=min_xlf_compute
|
||||
description=Minimal XLF14 packages for compute nodes
|
||||
version=14.1.0.0
|
||||
release=120323
|
||||
serverroles=compute
|
||||
kitrepoid=rhels6_ppc64
|
||||
ospkgdeps=libstdc++(ppc-32),libstdc++(ppc-64),libstdc++-devel(ppc-32),libstdc++-devel(ppc-64),glibc-devel(ppc-32),glibc-devel(ppc-64),compat-libstdc++-33(ppc-32),compat-libstdc++-33(ppc-64)
|
||||
kitpkgdeps=xlsmp.msg.rte >= 3.1.0.0,xlsmp.rte >= 3.1.0.0,xlf.msg.rte >= 14.1.0.0,xlf.rte >= 14.1.0.0,xlf.rte.lnk >= 14.1.0.00
|
||||
exlist=xlf.exlist
|
||||
genimage_postinstall=xlf_license,rhels_min_xlf_compute_install
|
||||
non_native_pkgs=EXTERNALPKGS:xlf.lib-14.1.0.0-*.rpm,EXTERNALPKGS:xlf.cmp-14.1.0.0-*.rpm
|
||||
|
||||
|
||||
kitcomponent:
|
||||
basename=xlf_compute
|
||||
description=XLF14 for compute nodes
|
||||
version=14.1.0.0
|
||||
release=120323
|
||||
serverroles=compute
|
||||
kitrepoid=sles11_ppc64
|
||||
ospkgdeps=libstdc++(ppc-32),libstdc++(ppc-64),libstdc++-devel(ppc-32),libstdc++-devel(ppc-64),glibc-devel(ppc-32),glibc-devel(ppc-64),compat-libstdc++-33(ppc-32),compat-libstdc++-33(ppc-64)
|
||||
kitpkgdeps=xlmass.lib >= 7.1.0.0,xlsmp.msg.rte >= 3.1.0.0,xlsmp.rte >= 3.1.0.0,xlsmp.lib >= 3.1.0.0,xlf.msg.rte >= 14.1.0.0,xlf.rte >= 14.1.0.0,xlf.rte.lnk >= 14.1.0.0,xlf.help.pdf >= 14.1.0.0,xlf.samples >= 14.1.0.0,xlf.man >= 14.1.0.0,xlf.lic >= 14.1.0.0
|
||||
exlist=xlf.exlist
|
||||
genimage_postinstall=xlf_license,sles_xlf_compute_install
|
||||
non_native_pkgs=EXTERNALPKGS:xlf.lib-14.1.0.0-*.rpm,EXTERNALPKGS:xlf.cmp-14.1.0.0-*.rpm
|
||||
|
||||
kitcomponent:
|
||||
basename=xlf_login
|
||||
description=XLF14 for login nodes
|
||||
version=14.1.0.0
|
||||
release=120323
|
||||
serverroles=login
|
||||
kitrepoid=sles11_ppc64
|
||||
ospkgdeps=libstdc++(ppc-32),libstdc++(ppc-64),libstdc++-devel(ppc-32),libstdc++-devel(ppc-64),glibc-devel(ppc-32),glibc-devel(ppc-64),compat-libstdc++-33(ppc-32),compat-libstdc++-33(ppc-64)
|
||||
kitpkgdeps=xlmass.lib >= 7.1.0.0,xlsmp.msg.rte >= 3.1.0.0,xlsmp.rte >= 3.1.0.0,xlsmp.lib >= 3.1.0.0,xlf.msg.rte >= 14.1.0.0,xlf.rte >= 14.1.0.0,xlf.rte.lnk >= 14.1.0.0,xlf.help.pdf >= 14.1.0.0,xlf.samples >= 14.1.0.0,xlf.man >= 14.1.0.0,xlf.lic >= 14.1.0.0
|
||||
exlist=xlf.exlist
|
||||
genimage_postinstall=xlf_license,sles_xlf_login_install
|
||||
non_native_pkgs=EXTERNALPKGS:xlf.lib-14.1.0.0-*.rpm,EXTERNALPKGS:xlf.cmp-14.1.0.0-*.rpm
|
||||
|
||||
kitcomponent:
|
||||
basename=min_xlf_compute
|
||||
description=Minimal XLF14 packages for compute nodes
|
||||
version=14.1.0.0
|
||||
release=120323
|
||||
serverroles=compute
|
||||
kitrepoid=sles11_ppc64
|
||||
ospkgdeps=libstdc++(ppc-32),libstdc++(ppc-64),libstdc++-devel(ppc-32),libstdc++-devel(ppc-64),glibc-devel(ppc-32),glibc-devel(ppc-64),compat-libstdc++-33(ppc-32),compat-libstdc++-33(ppc-64)
|
||||
kitpkgdeps=xlsmp.msg.rte >= 3.1.0.0,xlsmp.rte >= 3.1.0.0,xlf.msg.rte >= 14.1.0.0,xlf.rte >= 14.1.0.0,xlf.rte.lnk >= 14.1.0.00
|
||||
exlist=xlf.exlist
|
||||
genimage_postinstall=xlf_license,sles_min_xlf_compute_install
|
||||
non_native_pkgs=EXTERNALPKGS:xlf.lib-14.1.0.0-*.rpm,EXTERNALPKGS:xlf.cmp-14.1.0.0-*.rpm
|
||||
|
||||
# kitpackage: This section defines one Kit Package, and how to build it.
|
||||
# There can be zero or more kitpackage sections.
|
||||
# All filenames should be relative paths to
|
||||
# <Kit Build Directory>/source_packages
|
||||
# If you want to build a package which can run on multiple OSes,
|
||||
# you have two options:
|
||||
# 1. Build a separate package for each OS you want to support.
|
||||
# For this option, you need to define one kitpackage section
|
||||
# per supported OS.
|
||||
# 2. Build one package that can run on multiple OSes.
|
||||
# If you are building an RPM package, you are responsible for
|
||||
# creating an RPM spec file that can run on multiple OSes.
|
||||
# For this option, you need to define one kitpackage section
|
||||
# which contains multiple kitrepoid lines.
|
||||
#
|
||||
# kitpackage attributes:
|
||||
# filename (mandatory) Package filename
|
||||
# kitrepoid (mandatory) The repo(s) this package belongs to.
|
||||
# If multiple repos are defined, the package will be built for
|
||||
# the first repo only. For the other repos, a symlink is created
|
||||
# to the package built for the first repo.
|
||||
# Package build methods (optional)
|
||||
# Define how to build the packages.
|
||||
# If you don't specify a build method, the default behavior is
|
||||
# to assume the package is pre-built under
|
||||
# <Kit Build Directory>/source_packages
|
||||
# All files in this section are relative to
|
||||
# <Kit Build Directory>/source_packages
|
||||
# There are four methods to build packages.
|
||||
# 1. Use pre-built RPM package
|
||||
# isexternalpkg: 'no'|'0', 'yes'|'1' (default: 'no')
|
||||
# Indicates whether the RPM package will be added to the
|
||||
# the kit tar file now as part of the kit build process,
|
||||
# or whether the customer will need to separately
|
||||
# obtain the RPM pacakage and add it to the kit tar file
|
||||
# using 'buildkit addpkgs'
|
||||
# rpm_prebuiltdir: If isexternalpkg=yes, path to directory
|
||||
# containing pre-built RPM package
|
||||
# 2. Build RPM from spec + src dir
|
||||
# rpm_spec: Path to spec file.
|
||||
# rpm_srcdir: Path to source directory.
|
||||
# 3. Build RPM from spec + src tarball
|
||||
# rpm_spec: Path to spec file.
|
||||
# rpm_srctarball: Path to source tarball.
|
||||
# 4. Build RPM from source RPM
|
||||
# rpm_srpm: Path to source RPM package.
|
||||
kitpackage:
|
||||
filename=xlf.cmp-14.1.0.0-120323.ppc64.rpm
|
||||
kitrepoid=rhels6_ppc64,sles11_ppc64
|
||||
# Method 1: Use pre-built RPM package
|
||||
isexternalpkg=yes
|
||||
|
||||
|
||||
kitpackage:
|
||||
filename=xlf.help.pdf-14.1.0.0-120323.ppc64.rpm
|
||||
kitrepoid=rhels6_ppc64,sles11_ppc64
|
||||
# Method 1: Use pre-built RPM package
|
||||
isexternalpkg=yes
|
||||
|
||||
|
||||
kitpackage:
|
||||
filename=xlf.lib-14.1.0.0-120323.ppc64.rpm
|
||||
kitrepoid=rhels6_ppc64,sles11_ppc64
|
||||
# Method 1: Use pre-built RPM package
|
||||
isexternalpkg=yes
|
||||
|
||||
|
||||
kitpackage:
|
||||
filename=xlf.lic-14.1.0.0-120323.ppc64.rpm
|
||||
kitrepoid=rhels6_ppc64,sles11_ppc64
|
||||
# Method 1: Use pre-built RPM package
|
||||
isexternalpkg=yes
|
||||
|
||||
|
||||
kitpackage:
|
||||
filename=xlf.man-14.1.0.0-120323.ppc64.rpm
|
||||
kitrepoid=rhels6_ppc64,sles11_ppc64
|
||||
# Method 1: Use pre-built RPM package
|
||||
isexternalpkg=yes
|
||||
|
||||
|
||||
kitpackage:
|
||||
filename=xlf.msg.rte-14.1.0.0-120323.ppc64.rpm
|
||||
kitrepoid=rhels6_ppc64,sles11_ppc64
|
||||
# Method 1: Use pre-built RPM package
|
||||
isexternalpkg=yes
|
||||
|
||||
|
||||
kitpackage:
|
||||
filename=xlf.rte-14.1.0.0-120323.ppc64.rpm
|
||||
kitrepoid=rhels6_ppc64,sles11_ppc64
|
||||
# Method 1: Use pre-built RPM package
|
||||
isexternalpkg=yes
|
||||
|
||||
|
||||
kitpackage:
|
||||
filename=xlf.rte.lnk-14.1.0.0-120323.ppc64.rpm
|
||||
kitrepoid=rhels6_ppc64,sles11_ppc64
|
||||
# Method 1: Use pre-built RPM package
|
||||
isexternalpkg=yes
|
||||
|
||||
|
||||
kitpackage:
|
||||
filename=xlf.samples-14.1.0.0-120323.ppc64.rpm
|
||||
kitrepoid=rhels6_ppc64,sles11_ppc64
|
||||
# Method 1: Use pre-built RPM package
|
||||
isexternalpkg=yes
|
||||
|
||||
|
||||
kitpackage:
|
||||
filename=xlmass.lib-7.1.0.0-120322.ppc64.rpm
|
||||
kitrepoid=rhels6_ppc64,sles11_ppc64
|
||||
# Method 1: Use pre-built RPM package
|
||||
isexternalpkg=yes
|
||||
|
||||
|
||||
kitpackage:
|
||||
filename=xlsmp.lib-3.1.0.0-120315a.ppc64.rpm
|
||||
kitrepoid=rhels6_ppc64,sles11_ppc64
|
||||
# Method 1: Use pre-built RPM package
|
||||
isexternalpkg=yes
|
||||
|
||||
|
||||
kitpackage:
|
||||
filename=xlsmp.msg.rte-3.1.0.0-120315a.ppc64.rpm
|
||||
kitrepoid=rhels6_ppc64,sles11_ppc64
|
||||
# Method 1: Use pre-built RPM package
|
||||
isexternalpkg=yes
|
||||
|
||||
|
||||
kitpackage:
|
||||
filename=xlsmp.rte-3.1.0.0-120315a.ppc64.rpm
|
||||
kitrepoid=rhels6_ppc64,sles11_ppc64
|
||||
# Method 1: Use pre-built RPM package
|
||||
isexternalpkg=yes
|
||||
|
||||
Executable
+14
@@ -0,0 +1,14 @@
|
||||
./opt/ibmcmp/msg/*
|
||||
+./opt/ibmcmp/msg/en_US*
|
||||
|
||||
./opt/ibmcmp/xlmass/*/include*
|
||||
./opt/ibmcmp/xlsmp/*/include*
|
||||
./opt/ibmcmp/xlhelp*
|
||||
|
||||
./opt/ibmcmp/xlf/*/include*
|
||||
./opt/ibmcmp/xlf/*/msg/*
|
||||
+./opt/ibmcmp/xlf/*/msg/en_US*
|
||||
./opt/ibmcmp/xlf/*/lap/LA_*
|
||||
./opt/ibmcmp/xlf/*/lap/LI_*
|
||||
./opt/ibmcmp/xlf/*/lap/license/*.txt
|
||||
|
||||
+175
@@ -0,0 +1,175 @@
|
||||
package xCAT_plugin::<<<buildkit_WILL_INSERT_kitname_HERE>>>_imageprofile;
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
require xCAT::Utils;
|
||||
require xCAT::Table;
|
||||
require xCAT::KitPluginUtils;
|
||||
|
||||
|
||||
# buildkit Processing
|
||||
# In order to avoid collisions with other plugins, the package
|
||||
# name for this plugin must contain the full kit name.
|
||||
# The buildkit buildtar command will copy this file from your plugins
|
||||
# directory to the the kit build directory, renaming the file with the
|
||||
# correct kit name. All strings in this file of the form
|
||||
# <<<buildkit_WILL_INSERT_kitname_HERE>>>
|
||||
# will be replaced with the full kit name. In order for buildkit to
|
||||
# correctly edit this file, do not remove these strings.
|
||||
|
||||
|
||||
# Global Variables
|
||||
|
||||
# This is the full name of the kit which this plugin belongs
|
||||
# to. The kit name is used by some code in process_request()
|
||||
# to determine if the plugin should run. When you are testing
|
||||
# your plugin the kit name should be set to "TESTMODE" to
|
||||
# bypass the plugin check in process_request().
|
||||
|
||||
our ($PLUGIN_KITNAME);
|
||||
#$PLUGIN_KITNAME = "TESTMODE";
|
||||
$PLUGIN_KITNAME = "<<<buildkit_WILL_INSERT_kitname_HERE>>>";
|
||||
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head1
|
||||
|
||||
Image Profile Kit Plugin
|
||||
This plugin contains commands to run custom actions
|
||||
during image profile operations.
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head3 handled_commands
|
||||
|
||||
Return list of kit plugin commands handled by this plugin
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
sub handled_commands {
|
||||
return {
|
||||
kitimagevalidatecomps => '<<<buildkit_WILL_INSERT_kitname_HERE>>>_imageprofile',
|
||||
kitimageimport => '<<<buildkit_WILL_INSERT_kitname_HERE>>>_imageprofile',
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head3 process_request
|
||||
|
||||
Process the kit plugin command.
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
sub process_request {
|
||||
my $request = shift;
|
||||
my $callback = shift;
|
||||
|
||||
# This kit plugin is passed the name of an image profile.
|
||||
# We need to determine which kits is used by this
|
||||
# image profile to decide if this plugin should run or not.
|
||||
|
||||
my $imgprofilename = $request->{arg}->[0];
|
||||
|
||||
my $kitdata = $request->{kitdata};
|
||||
if (! defined($kitdata)) {
|
||||
$kitdata = xCAT::KitPluginUtils->get_kits_used_by_image_profiles([$imgprofilename]);
|
||||
$request->{kitdata} = $kitdata;
|
||||
}
|
||||
|
||||
if ($PLUGIN_KITNAME ne "TESTMODE" && ! exists($kitdata->{$PLUGIN_KITNAME})) {
|
||||
return;
|
||||
}
|
||||
|
||||
# Name of command and node list
|
||||
my $command = $request->{command}->[0];
|
||||
my $args = $request->{arg};
|
||||
|
||||
if($command eq 'kitimagevalidatecomps') {
|
||||
kitimagevalidatecomps($callback, $args);
|
||||
}
|
||||
elsif ($command eq 'kitimageimport') {
|
||||
kitimageimport($callback, $args);
|
||||
|
||||
} else {
|
||||
my $rsp;
|
||||
$rsp->{data}->[0] = "Command is not supported";
|
||||
xCAT::MsgUtils->message("E", $rsp, $callback);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head3 kitimagevalidatecomps
|
||||
|
||||
This command is called to validate new changes to an
|
||||
image profile's kit component list before the changes
|
||||
are committed.
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
sub kitimagevalidatecomps {
|
||||
my $callback = shift;
|
||||
my $args = shift;
|
||||
my $rsp;
|
||||
|
||||
# Parameters
|
||||
my $imgprofilename = $args->[0];
|
||||
my $newcomplist = $args->[1];
|
||||
my @newcomplist = ();
|
||||
if (defined($newcomplist)) {
|
||||
@newcomplist = split(/,/, $newcomplist);
|
||||
}
|
||||
my $newosdistro = $args->[2];
|
||||
my $newosdistroupdate = $args->[3];
|
||||
|
||||
$rsp->{data}->[0] = "Running kitimagevalidatecomps";
|
||||
xCAT::MsgUtils->message("I", $rsp, $callback);
|
||||
|
||||
# TODO
|
||||
# ... ADD YOUR CODE HERE
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head3 kitimageimport
|
||||
|
||||
This command is called after changes to an image profile
|
||||
have been committed.
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
sub kitimageimport {
|
||||
my $callback = shift;
|
||||
my $args = shift;
|
||||
my $rsp;
|
||||
|
||||
# Parameters
|
||||
my $imgprofilename = $args->[0];
|
||||
|
||||
$rsp->{data}->[0] = "Running kitimageimport";
|
||||
xCAT::MsgUtils->message("I", $rsp, $callback);
|
||||
|
||||
# TODO
|
||||
# ... ADD YOUR CODE HERE
|
||||
}
|
||||
|
||||
|
||||
+251
@@ -0,0 +1,251 @@
|
||||
package xCAT_plugin::<<<buildkit_WILL_INSERT_kitname_HERE>>>_nodemgmt;
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
require xCAT::Utils;
|
||||
require xCAT::Table;
|
||||
require xCAT::KitPluginUtils;
|
||||
|
||||
# buildkit Processing
|
||||
# In order to avoid collisions with other plugins, the package
|
||||
# name for this plugin must contain the full kit name.
|
||||
# The buildkit buildtar command will copy this file from your plugins
|
||||
# directory to the the kit build directory, renaming the file with the
|
||||
# correct kit name. All strings in this file of the form
|
||||
# <<<buildkit_WILL_INSERT_kitname_HERE>>>
|
||||
# will be replaced with the full kit name. In order for buildkit to
|
||||
# correctly edit this file, do not remove these strings.
|
||||
|
||||
# Global Variables
|
||||
|
||||
# This is the full name of the kit which this plugin belongs
|
||||
# to. The kit name is used by some code in process_request()
|
||||
# to determine if the plugin should run. When you are testing
|
||||
# your plugin the kit name should be set to "TESTMODE" to
|
||||
# bypass the plugin check in process_request().
|
||||
|
||||
our ($PLUGIN_KITNAME);
|
||||
#$PLUGIN_KITNAME = "TESTMODE";
|
||||
$PLUGIN_KITNAME = "<<<buildkit_WILL_INSERT_kitname_HERE>>>";
|
||||
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head1
|
||||
|
||||
Node Management Kit Plugin
|
||||
This plugin contains commands to run custom actions
|
||||
during node management operations.
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head3 handled_commands
|
||||
|
||||
Return list of kit plugin commands handled by this plugin
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
sub handled_commands {
|
||||
return {
|
||||
kitnodeadd => '<<<buildkit_WILL_INSERT_kitname_HERE>>>_nodemgmt',
|
||||
kitnoderemove => '<<<buildkit_WILL_INSERT_kitname_HERE>>>_nodemgmt',
|
||||
kitnodeupdate => '<<<buildkit_WILL_INSERT_kitname_HERE>>>_nodemgmt',
|
||||
kitnoderefresh => '<<<buildkit_WILL_INSERT_kitname_HERE>>>_nodemgmt',
|
||||
kitnodefinished => '<<<buildkit_WILL_INSERT_kitname_HERE>>>_nodemgmt',
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head3 process_request
|
||||
|
||||
Process the kit plugin command.
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
sub process_request {
|
||||
my $request = shift;
|
||||
my $callback = shift;
|
||||
|
||||
# Name of command and node list
|
||||
my $command = $request->{command}->[0];
|
||||
my $nodes = $request->{node};
|
||||
|
||||
# This kit plugin is passed a list of node names.
|
||||
# We need to determine which kits are used by these
|
||||
# nodes to decide if this plugin should run or not.
|
||||
|
||||
my $kitdata = $request->{kitdata};
|
||||
if (! defined($kitdata)) {
|
||||
$kitdata = xCAT::KitPluginUtils->get_kits_used_by_nodes($nodes);
|
||||
$request->{kitdata} = $kitdata;
|
||||
}
|
||||
|
||||
if ($PLUGIN_KITNAME ne "TESTMODE" && ! exists($kitdata->{$PLUGIN_KITNAME})) {
|
||||
return;
|
||||
}
|
||||
|
||||
# Get the nodes using this plugin's kit
|
||||
$nodes = $kitdata->{$PLUGIN_KITNAME};
|
||||
|
||||
|
||||
if($command eq 'kitnodeadd') {
|
||||
kitnodeadd($callback, $nodes);
|
||||
}
|
||||
elsif ($command eq 'kitnoderemove') {
|
||||
kitnoderemove($callback, $nodes);
|
||||
}
|
||||
elsif ($command eq 'kitnodeupdate') {
|
||||
kitnodeupdate($callback, $nodes);
|
||||
}
|
||||
elsif ($command eq 'kitnoderefresh') {
|
||||
kitnoderefresh($callback, $nodes);
|
||||
}
|
||||
elsif ($command eq 'kitnodefinished') {
|
||||
kitnodefinished($callback);
|
||||
|
||||
} else {
|
||||
my $rsp;
|
||||
$rsp->{data}->[0] = "Command is not supported";
|
||||
xCAT::MsgUtils->message("E", $rsp, $callback);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head3 kitnodeadd
|
||||
|
||||
This command is called when one or more nodes are added
|
||||
to the cluster.
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
sub kitnodeadd {
|
||||
my $callback = shift;
|
||||
my $rsp;
|
||||
|
||||
# Parameters
|
||||
my $nodes = shift;
|
||||
|
||||
$rsp->{data}->[0] = "Running kitnodeadd";
|
||||
xCAT::MsgUtils->message("I", $rsp, $callback);
|
||||
|
||||
# TODO
|
||||
# ... ADD YOUR CODE HERE
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head3 kitnoderemove
|
||||
|
||||
This command is called when one or more nodes are
|
||||
removed from the cluster.
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
sub kitnoderemove {
|
||||
my $callback = shift;
|
||||
my $rsp;
|
||||
|
||||
# Parameters
|
||||
my $nodes = shift;
|
||||
|
||||
$rsp->{data}->[0] = "Running kitnoderemove";
|
||||
xCAT::MsgUtils->message("I", $rsp, $callback);
|
||||
|
||||
# TODO
|
||||
# ... ADD YOUR CODE HERE
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head3 kitnodeupdate
|
||||
|
||||
This command is called when the configuration of one
|
||||
or more nodes are updated.
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
sub kitnodeupdate {
|
||||
my $callback = shift;
|
||||
my $rsp;
|
||||
|
||||
# Parameters
|
||||
my $nodes = shift;
|
||||
|
||||
$rsp->{data}->[0] = "Running kitnodeupdate";
|
||||
xCAT::MsgUtils->message("I", $rsp, $callback);
|
||||
|
||||
# TODO
|
||||
# ... ADD YOUR CODE HERE
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head3 kitnoderefresh
|
||||
|
||||
This command is called when node-related configuration
|
||||
files are updated.
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
sub kitnoderefresh {
|
||||
my $callback = shift;
|
||||
my $rsp;
|
||||
|
||||
# Parameters
|
||||
my $nodes = shift;
|
||||
|
||||
$rsp->{data}->[0] = "Running kitnoderefresh";
|
||||
xCAT::MsgUtils->message("I", $rsp, $callback);
|
||||
|
||||
# TODO
|
||||
# ... ADD YOUR CODE HERE
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head3 kitnodefinished
|
||||
|
||||
This command is called at the end of a node management
|
||||
operation.
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
sub kitnodefinished {
|
||||
my $callback = shift;
|
||||
my $rsp;
|
||||
|
||||
$rsp->{data}->[0] = "Running kitnodefinished";
|
||||
xCAT::MsgUtils->message("I", $rsp, $callback);
|
||||
|
||||
# TODO
|
||||
# ... ADD YOUR CODE HERE
|
||||
}
|
||||
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
|
||||
#!/bin/sh
|
||||
|
||||
if [[ ! -z "$installroot" ]]; then
|
||||
if [ -n "`ls $installroot/opt/xcat/kits/xlf/min_xlf_compute-14.1.0.0-120323-rhels-6-ppc64/*.rpm 2> /dev/null`" ] ; then
|
||||
rpm --force --root $installroot -Uvh $installroot/opt/xcat/kits/xlf/min_xlf_compute-14.1.0.0-120323-rhels-6-ppc64/*.rpm
|
||||
fi
|
||||
else
|
||||
if [ -n "`ls /opt/xcat/kits/xlf/min_xlf_compute-14.1.0.0-120323-rhels-6-ppc64/*.rpm 2> /dev/null`" ] ; then
|
||||
rpm --force -Uvh /opt/xcat/kits/xlf/min_xlf_compute-14.1.0.0-120323-rhels-6-ppc64/*.rpm
|
||||
fi
|
||||
fi
|
||||
|
||||
exit 0
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
|
||||
#!/bin/sh
|
||||
|
||||
if [[ ! -z "$installroot" ]]; then
|
||||
if [ -n "`ls $installroot/opt/xcat/kits/xlf/xlf_compute-14.1.0.0-120323-rhels-6-ppc64/*.rpm 2> /dev/null`" ] ; then
|
||||
rpm --force --root $installroot -Uvh $installroot/opt/xcat/kits/xlf/xlf_compute-14.1.0.0-120323-rhels-6-ppc64/*.rpm
|
||||
fi
|
||||
else
|
||||
if [ -n "`ls /opt/xcat/kits/xlf/xlf_compute-14.1.0.0-120323-rhels-6-ppc64/*.rpm 2> /dev/null`" ] ; then
|
||||
rpm --force -Uvh /opt/xcat/kits/xlf/xlf_compute-14.1.0.0-120323-rhels-6-ppc64/*.rpm
|
||||
fi
|
||||
fi
|
||||
|
||||
exit 0
|
||||
xCAT-buildkit/share/xcat/kits/kit_build/compiler/partial_xlf14-Linux/scripts/rhels_xlf_login_install
Executable
+14
@@ -0,0 +1,14 @@
|
||||
|
||||
#!/bin/sh
|
||||
|
||||
if [[ ! -z "$installroot" ]]; then
|
||||
if [ -n "`ls $installroot/opt/xcat/kits/xlf/xlf_login-14.1.0.0-120323-rhels-6-ppc64/*.rpm 2> /dev/null`" ] ; then
|
||||
rpm --force --root $installroot -Uvh $installroot/opt/xcat/kits/xlf/xlf_login-14.1.0.0-120323-rhels-6-ppc64/*.rpm
|
||||
fi
|
||||
else
|
||||
if [ -n "`ls /opt/xcat/kits/xlf/xlf_login-14.1.0.0-120323-rhels-6-ppc64/*.rpm 2> /dev/null`" ] ; then
|
||||
rpm --force -Uvh /opt/xcat/kits/xlf/xlf_login-14.1.0.0-120323-rhels-6-ppc64/*.rpm
|
||||
fi
|
||||
fi
|
||||
|
||||
exit 0
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
|
||||
#!/bin/sh
|
||||
|
||||
if [[ ! -z "$installroot" ]]; then
|
||||
if [ -n "`ls $installroot/opt/xcat/kits/xlf/min_xlf_compute-14.1.0.0-120323-sles-11-ppc64/*.rpm 2> /dev/null`" ] ; then
|
||||
rpm --force --root $installroot -Uvh $installroot/opt/xcat/kits/xlf/min_xlf_compute-14.1.0.0-120323-sles-11-ppc64/*.rpm
|
||||
fi
|
||||
else
|
||||
if [ -n "`ls /opt/xcat/kits/xlf/min_xlf_compute-14.1.0.0-120323-sles-11-ppc64/*.rpm 2> /dev/null`" ] ; then
|
||||
rpm --force -Uvh /opt/xcat/kits/xlf/min_xlf_compute-14.1.0.0-120323-sles-11-ppc64/*.rpm
|
||||
fi
|
||||
fi
|
||||
|
||||
exit 0
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
|
||||
#!/bin/sh
|
||||
|
||||
if [[ ! -z "$installroot" ]]; then
|
||||
if [ -n "`ls $installroot/opt/xcat/kits/xlf/xlf_compute-14.1.0.0-120323-sles-11-ppc64/*.rpm 2> /dev/null`" ] ; then
|
||||
rpm --force --root $installroot -Uvh $installroot/opt/xcat/kits/xlf/xlf_compute-14.1.0.0-120323-sles-11-ppc64/*.rpm
|
||||
fi
|
||||
else
|
||||
if [ -n "`ls /opt/xcat/kits/xlf/xlf_compute-14.1.0.0-120323-sles-11-ppc64/*.rpm 2> /dev/null`" ] ; then
|
||||
rpm --force -Uvh /opt/xcat/kits/xlf/xlf_compute-14.1.0.0-120323-sles-11-ppc64/*.rpm
|
||||
fi
|
||||
fi
|
||||
|
||||
exit 0
|
||||
Executable
+14
@@ -0,0 +1,14 @@
|
||||
|
||||
#!/bin/sh
|
||||
|
||||
if [[ ! -z "$installroot" ]]; then
|
||||
if [ -n "`ls $installroot/opt/xcat/kits/xlf/xlf_login-14.1.0.0-120323-sles-11-ppc64/*.rpm 2> /dev/null`" ] ; then
|
||||
rpm --force --root $installroot -Uvh $installroot/opt/xcat/kits/xlf/xlf_login-14.1.0.0-120323-sles-11-ppc64/*.rpm
|
||||
fi
|
||||
else
|
||||
if [ -n "`ls /opt/xcat/kits/xlf/xlf_login-14.1.0.0-120323-sles-11-ppc64/*.rpm 2> /dev/null`" ] ; then
|
||||
rpm --force -Uvh /opt/xcat/kits/xlf/xlf_login-14.1.0.0-120323-sles-11-ppc64/*.rpm
|
||||
fi
|
||||
fi
|
||||
|
||||
exit 0
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
#!/bin/sh
|
||||
|
||||
#
|
||||
# Sample script to accept licenses for the IBM xlf compilers
|
||||
# For Linux:
|
||||
# Assumes all compiler software has been installed
|
||||
|
||||
OS=`uname`
|
||||
if [ $OS != "AIX" ]; then
|
||||
cd $installroot/
|
||||
xlf_script=`find opt/ibmcmp/xlf -name new_install -print`
|
||||
|
||||
if [ -n $installroot ]; then
|
||||
# Being run from a stateful install postscript or stateless postbootscript.
|
||||
if [ -n "$xlf_script" ] ; then
|
||||
echo 1 | chroot $installroot /$xlf_script
|
||||
fi
|
||||
else
|
||||
# Being run from a stateful install postscript postbootscript.
|
||||
if [ -n "$xlf_script" ] ; then
|
||||
echo 1 | $xlf_script
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
@@ -0,0 +1,340 @@
|
||||
# Kit Build File
|
||||
#
|
||||
# This file was initially auto-generated by the buildkit CLI command.
|
||||
# To create a new kit, the user should modify this file accordingly.
|
||||
# Refer to the buildkit manpage for further details.
|
||||
#
|
||||
|
||||
# kit: This section defines general info for the Kit.
|
||||
# There must be exactly one kit section in a kit build file.
|
||||
#
|
||||
# kit attributes:
|
||||
# basename (mandatory) Kit base name. e.g., kit-lsf
|
||||
# description (optional) Kit description.
|
||||
# version (mandatory) Kit version. e.g., 1.0
|
||||
# ostype (mandatory) Kit OS type. Must be Linux.
|
||||
# AIX is currently not supported.
|
||||
# isinternal (optional) PCM use only.
|
||||
# Indicate if Kit is for internal use.
|
||||
# Use 1 for yes, 0 for no. Default: 0
|
||||
# kitdeployparams (optional) Filename containing a list of kit deployment
|
||||
# parameters, relative to
|
||||
# <Kit Build Directory>/other_files
|
||||
kit:
|
||||
basename=xlf
|
||||
description=XLF14 for Linux
|
||||
version=14.1.0.0
|
||||
ostype=Linux
|
||||
kitlicense=ILAN
|
||||
# kitdeployparams=sample/kitdeployparams.lst
|
||||
|
||||
|
||||
# kitrepo: This section defines a Kit Package Repository.
|
||||
# There must be at least one kitrepo section in a kit build file.
|
||||
# If you want to support multiple OSes, you should create a separate
|
||||
# repo for each OS. Also, no two repos can be defined with the same
|
||||
# OS name, major/minor version and arch. For example, you cannot have
|
||||
# two repos for RHEL 6.2 ppc64 in the same kit.
|
||||
#
|
||||
# kitrepo attributes:
|
||||
# kitrepoid (mandatory) Kit package repository ID.
|
||||
# Must be unique within this file.
|
||||
# osbasename (mandatory) OS distro base name. e.g., rhels.
|
||||
# osmajorversion (mandatory) OS major version. e.g., 6
|
||||
# osminorversion (optional) OS minor version.
|
||||
# osarch (mandatory) OS architecture. e.g., ppc64
|
||||
# compat_osbasenames (optional) Comma-separated list of compatible
|
||||
# OS distro base names. e.g., centos
|
||||
|
||||
kitrepo:
|
||||
kitrepoid=rhels6_ppc64
|
||||
osbasename=rhels
|
||||
osmajorversion=6
|
||||
osarch=ppc64
|
||||
|
||||
kitrepo:
|
||||
kitrepoid=sles11_ppc64
|
||||
osbasename=sles
|
||||
osmajorversion=11
|
||||
osarch=ppc64
|
||||
|
||||
|
||||
# kitcomponent: This section defines one Kit Component.
|
||||
# There can be zero or more kitcomponent sections.
|
||||
# If you want to build a component which supports multiple OSes,
|
||||
# you should create one kitcomponent section for each OS.
|
||||
# Also, no two components in a kit can be defined with the same
|
||||
# base name.
|
||||
# You can define multiple kit components with the same base name
|
||||
# only if each kit component using this base name meets these
|
||||
# requirements:
|
||||
# - Each kit component must be defined with the same version
|
||||
# and release number
|
||||
# - Each kit component must be defined with a unique kitrepoid
|
||||
|
||||
#
|
||||
# kitcomponent attributes:
|
||||
# basename (mandatory) Kit component base name
|
||||
# description (optional) Kit component description
|
||||
# version (mandatory) Kit component version
|
||||
# release (mandatory) Kit component release
|
||||
# serverroles (mandatory) Comma-separated list of servers that this
|
||||
# component can install on. Valid values:
|
||||
# mgtnode,service,compute,login,storage
|
||||
# kitrepoid (mandatory) The ID of the kit package repository this
|
||||
# component belongs to
|
||||
# kitcompdeps (optional) Comma-separated list of kit component
|
||||
# dependencies. These kit components can be included in
|
||||
# this kit or in other kits.
|
||||
# ospkgdeps (optional) Comma-separated list of OS package dependencies
|
||||
# These packages must be shipped with the OS distro.
|
||||
# kitpkgdeps (optional) Comma-separated list of kit package names that
|
||||
# will be listed as "REQUIRES" when building this kit
|
||||
# component. Each package must be defined in a separate
|
||||
# kitpackage section. Each package must be in the same
|
||||
# kitrepo as this kit component.
|
||||
# non_native_pkgs (optional) TBD -- NOT SUPPORTED YET!
|
||||
# Comma-separated list of non-native package
|
||||
# paths that will be included as files in this kit
|
||||
# component. All filenames are relative to
|
||||
# <Kit Build Directory>/source_packages
|
||||
# Kit component deployment scripts must be specified
|
||||
# to manage these files.
|
||||
# driverpacks (optional) Comma-separated list of driver package filenames
|
||||
# Each driverpack must be defined in a separate kitpackage
|
||||
# section.
|
||||
# exlist (optional) Exclude list file for stateless image, relative
|
||||
# to <Kit Build Directory>/other_files
|
||||
# Kit component deployment scripts (optional) Each attribute specifies
|
||||
# script path relative to <Kit Build Directory>/scripts
|
||||
# Script attributes:
|
||||
# preinstall, postinstall, preuninstall, postuninstall,
|
||||
# preupgrade, postupgrade, postbootscripts
|
||||
kitcomponent:
|
||||
basename=xlf_compute
|
||||
description=XLF14 for compute nodes
|
||||
version=14.1.0.0
|
||||
release=120323
|
||||
serverroles=compute
|
||||
kitrepoid=rhels6_ppc64
|
||||
ospkgdeps=libstdc++(ppc-32),libstdc++(ppc-64),libstdc++-devel(ppc-32),libstdc++-devel(ppc-64),glibc-devel(ppc-32),glibc-devel(ppc-64),compat-libstdc++-33(ppc-32),compat-libstdc++-33(ppc-64)
|
||||
kitpkgdeps=xlmass.lib >= 7.1.0.0,xlsmp.msg.rte >= 3.1.0.0,xlsmp.rte >= 3.1.0.0,xlsmp.lib >= 3.1.0.0,xlf.msg.rte >= 14.1.0.0,xlf.rte >= 14.1.0.0,xlf.rte.lnk >= 14.1.0.0,xlf.help.pdf >= 14.1.0.0,xlf.samples >= 14.1.0.0,xlf.man >= 14.1.0.0,xlf.lic >= 14.1.0.0
|
||||
exlist=xlf.exlist
|
||||
genimage_postinstall=xlf_license,rhels_xlf_compute_install
|
||||
non_native_pkgs=EXTERNALPKGS:xlf.lib-14.1.0.0-*.rpm,EXTERNALPKGS:xlf.cmp-14.1.0.0-*.rpm
|
||||
|
||||
kitcomponent:
|
||||
basename=xlf_login
|
||||
description=XLF14 for login nodes
|
||||
version=14.1.0.0
|
||||
release=120323
|
||||
serverroles=login
|
||||
kitrepoid=rhels6_ppc64
|
||||
ospkgdeps=libstdc++(ppc-32),libstdc++(ppc-64),libstdc++-devel(ppc-32),libstdc++-devel(ppc-64),glibc-devel(ppc-32),glibc-devel(ppc-64),compat-libstdc++-33(ppc-32),compat-libstdc++-33(ppc-64)
|
||||
kitpkgdeps=xlmass.lib >= 7.1.0.0,xlsmp.msg.rte >= 3.1.0.0,xlsmp.rte >= 3.1.0.0,xlsmp.lib >= 3.1.0.0,xlf.msg.rte >= 14.1.0.0,xlf.rte >= 14.1.0.0,xlf.rte.lnk >= 14.1.0.0,xlf.help.pdf >= 14.1.0.0,xlf.samples >= 14.1.0.0,xlf.man >= 14.1.0.0,xlf.lic >= 14.1.0.0
|
||||
exlist=xlf.exlist
|
||||
genimage_postinstall=xlf_license,rhels_xlf_login_install
|
||||
non_native_pkgs=EXTERNALPKGS:xlf.lib-14.1.0.0-*.rpm,EXTERNALPKGS:xlf.cmp-14.1.0.0-*.rpm
|
||||
|
||||
kitcomponent:
|
||||
basename=min_xlf_compute
|
||||
description=Minimal XLF14 packages for compute nodes
|
||||
version=14.1.0.0
|
||||
release=120323
|
||||
serverroles=compute
|
||||
kitrepoid=rhels6_ppc64
|
||||
ospkgdeps=libstdc++(ppc-32),libstdc++(ppc-64),libstdc++-devel(ppc-32),libstdc++-devel(ppc-64),glibc-devel(ppc-32),glibc-devel(ppc-64),compat-libstdc++-33(ppc-32),compat-libstdc++-33(ppc-64)
|
||||
kitpkgdeps=xlsmp.msg.rte >= 3.1.0.0,xlsmp.rte >= 3.1.0.0,xlf.msg.rte >= 14.1.0.0,xlf.rte >= 14.1.0.0,xlf.rte.lnk >= 14.1.0.00
|
||||
exlist=xlf.exlist
|
||||
genimage_postinstall=xlf_license,rhels_min_xlf_compute_install
|
||||
non_native_pkgs=EXTERNALPKGS:xlf.lib-14.1.0.0-*.rpm,EXTERNALPKGS:xlf.cmp-14.1.0.0-*.rpm
|
||||
|
||||
|
||||
kitcomponent:
|
||||
basename=xlf_compute
|
||||
description=XLF14 for compute nodes
|
||||
version=14.1.0.0
|
||||
release=120323
|
||||
serverroles=compute
|
||||
kitrepoid=sles11_ppc64
|
||||
ospkgdeps=libstdc++(ppc-32),libstdc++(ppc-64),libstdc++-devel(ppc-32),libstdc++-devel(ppc-64),glibc-devel(ppc-32),glibc-devel(ppc-64),compat-libstdc++-33(ppc-32),compat-libstdc++-33(ppc-64)
|
||||
kitpkgdeps=xlmass.lib >= 7.1.0.0,xlsmp.msg.rte >= 3.1.0.0,xlsmp.rte >= 3.1.0.0,xlsmp.lib >= 3.1.0.0,xlf.msg.rte >= 14.1.0.0,xlf.rte >= 14.1.0.0,xlf.rte.lnk >= 14.1.0.0,xlf.help.pdf >= 14.1.0.0,xlf.samples >= 14.1.0.0,xlf.man >= 14.1.0.0,xlf.lic >= 14.1.0.0
|
||||
exlist=xlf.exlist
|
||||
genimage_postinstall=xlf_license,sles_xlf_compute_install
|
||||
non_native_pkgs=EXTERNALPKGS:xlf.lib-14.1.0.0-*.rpm,EXTERNALPKGS:xlf.cmp-14.1.0.0-*.rpm
|
||||
|
||||
kitcomponent:
|
||||
basename=xlf_login
|
||||
description=XLF14 for login nodes
|
||||
version=14.1.0.0
|
||||
release=120323
|
||||
serverroles=login
|
||||
kitrepoid=sles11_ppc64
|
||||
ospkgdeps=libstdc++(ppc-32),libstdc++(ppc-64),libstdc++-devel(ppc-32),libstdc++-devel(ppc-64),glibc-devel(ppc-32),glibc-devel(ppc-64),compat-libstdc++-33(ppc-32),compat-libstdc++-33(ppc-64)
|
||||
kitpkgdeps=xlmass.lib >= 7.1.0.0,xlsmp.msg.rte >= 3.1.0.0,xlsmp.rte >= 3.1.0.0,xlsmp.lib >= 3.1.0.0,xlf.msg.rte >= 14.1.0.0,xlf.rte >= 14.1.0.0,xlf.rte.lnk >= 14.1.0.0,xlf.help.pdf >= 14.1.0.0,xlf.samples >= 14.1.0.0,xlf.man >= 14.1.0.0,xlf.lic >= 14.1.0.0
|
||||
exlist=xlf.exlist
|
||||
genimage_postinstall=xlf_license,sles_xlf_login_install
|
||||
non_native_pkgs=EXTERNALPKGS:xlf.lib-14.1.0.0-*.rpm,EXTERNALPKGS:xlf.cmp-14.1.0.0-*.rpm
|
||||
|
||||
kitcomponent:
|
||||
basename=min_xlf_compute
|
||||
description=Minimal XLF14 packages for compute nodes
|
||||
version=14.1.0.0
|
||||
release=120323
|
||||
serverroles=compute
|
||||
kitrepoid=sles11_ppc64
|
||||
ospkgdeps=libstdc++(ppc-32),libstdc++(ppc-64),libstdc++-devel(ppc-32),libstdc++-devel(ppc-64),glibc-devel(ppc-32),glibc-devel(ppc-64),compat-libstdc++-33(ppc-32),compat-libstdc++-33(ppc-64)
|
||||
kitpkgdeps=xlsmp.msg.rte >= 3.1.0.0,xlsmp.rte >= 3.1.0.0,xlf.msg.rte >= 14.1.0.0,xlf.rte >= 14.1.0.0,xlf.rte.lnk >= 14.1.0.00
|
||||
exlist=xlf.exlist
|
||||
genimage_postinstall=xlf_license,sles_min_xlf_compute_install
|
||||
non_native_pkgs=EXTERNALPKGS:xlf.lib-14.1.0.0-*.rpm,EXTERNALPKGS:xlf.cmp-14.1.0.0-*.rpm
|
||||
|
||||
# kitpackage: This section defines one Kit Package, and how to build it.
|
||||
# There can be zero or more kitpackage sections.
|
||||
# All filenames should be relative paths to
|
||||
# <Kit Build Directory>/source_packages
|
||||
# If you want to build a package which can run on multiple OSes,
|
||||
# you have two options:
|
||||
# 1. Build a separate package for each OS you want to support.
|
||||
# For this option, you need to define one kitpackage section
|
||||
# per supported OS.
|
||||
# 2. Build one package that can run on multiple OSes.
|
||||
# If you are building an RPM package, you are responsible for
|
||||
# creating an RPM spec file that can run on multiple OSes.
|
||||
# For this option, you need to define one kitpackage section
|
||||
# which contains multiple kitrepoid lines.
|
||||
#
|
||||
# kitpackage attributes:
|
||||
# filename (mandatory) Package filename
|
||||
# kitrepoid (mandatory) The repo(s) this package belongs to.
|
||||
# If multiple repos are defined, the package will be built for
|
||||
# the first repo only. For the other repos, a symlink is created
|
||||
# to the package built for the first repo.
|
||||
# Package build methods (optional)
|
||||
# Define how to build the packages.
|
||||
# If you don't specify a build method, the default behavior is
|
||||
# to assume the package is pre-built under
|
||||
# <Kit Build Directory>/source_packages
|
||||
# All files in this section are relative to
|
||||
# <Kit Build Directory>/source_packages
|
||||
# There are four methods to build packages.
|
||||
# 1. Use pre-built RPM package
|
||||
# isexternalpkg: 'no'|'0', 'yes'|'1' (default: 'no')
|
||||
# Indicates whether the RPM package will be added to the
|
||||
# the kit tar file now as part of the kit build process,
|
||||
# or whether the customer will need to separately
|
||||
# obtain the RPM pacakage and add it to the kit tar file
|
||||
# using 'buildkit addpkgs'
|
||||
# rpm_prebuiltdir: If isexternalpkg=no, path to directory
|
||||
# containing pre-built RPM package
|
||||
# 2. Build RPM from spec + src dir
|
||||
# rpm_spec: Path to spec file.
|
||||
# rpm_srcdir: Path to source directory.
|
||||
# 3. Build RPM from spec + src tarball
|
||||
# rpm_spec: Path to spec file.
|
||||
# rpm_srctarball: Path to source tarball.
|
||||
# 4. Build RPM from source RPM
|
||||
# rpm_srpm: Path to source RPM package.
|
||||
kitpackage:
|
||||
filename=xlf.cmp-14.1.0.0-120323.ppc64.rpm
|
||||
kitrepoid=rhels6_ppc64,sles11_ppc64
|
||||
# Method 1: Use pre-built RPM package
|
||||
isexternalpkg=no
|
||||
rpm_prebuiltdir=
|
||||
|
||||
|
||||
kitpackage:
|
||||
filename=xlf.help.pdf-14.1.0.0-120323.ppc64.rpm
|
||||
kitrepoid=rhels6_ppc64,sles11_ppc64
|
||||
# Method 1: Use pre-built RPM package
|
||||
isexternalpkg=no
|
||||
rpm_prebuiltdir=
|
||||
|
||||
|
||||
kitpackage:
|
||||
filename=xlf.lib-14.1.0.0-120323.ppc64.rpm
|
||||
kitrepoid=rhels6_ppc64,sles11_ppc64
|
||||
# Method 1: Use pre-built RPM package
|
||||
isexternalpkg=no
|
||||
rpm_prebuiltdir=
|
||||
|
||||
|
||||
kitpackage:
|
||||
filename=xlf.lic-14.1.0.0-120323.ppc64.rpm
|
||||
kitrepoid=rhels6_ppc64,sles11_ppc64
|
||||
# Method 1: Use pre-built RPM package
|
||||
isexternalpkg=no
|
||||
rpm_prebuiltdir=
|
||||
|
||||
|
||||
kitpackage:
|
||||
filename=xlf.man-14.1.0.0-120323.ppc64.rpm
|
||||
kitrepoid=rhels6_ppc64,sles11_ppc64
|
||||
# Method 1: Use pre-built RPM package
|
||||
isexternalpkg=no
|
||||
rpm_prebuiltdir=
|
||||
|
||||
|
||||
kitpackage:
|
||||
filename=xlf.msg.rte-14.1.0.0-120323.ppc64.rpm
|
||||
kitrepoid=rhels6_ppc64,sles11_ppc64
|
||||
# Method 1: Use pre-built RPM package
|
||||
isexternalpkg=no
|
||||
rpm_prebuiltdir=
|
||||
|
||||
|
||||
kitpackage:
|
||||
filename=xlf.rte-14.1.0.0-120323.ppc64.rpm
|
||||
kitrepoid=rhels6_ppc64,sles11_ppc64
|
||||
# Method 1: Use pre-built RPM package
|
||||
isexternalpkg=no
|
||||
rpm_prebuiltdir=
|
||||
|
||||
|
||||
kitpackage:
|
||||
filename=xlf.rte.lnk-14.1.0.0-120323.ppc64.rpm
|
||||
kitrepoid=rhels6_ppc64,sles11_ppc64
|
||||
# Method 1: Use pre-built RPM package
|
||||
isexternalpkg=no
|
||||
rpm_prebuiltdir=
|
||||
|
||||
|
||||
kitpackage:
|
||||
filename=xlf.samples-14.1.0.0-120323.ppc64.rpm
|
||||
kitrepoid=rhels6_ppc64,sles11_ppc64
|
||||
# Method 1: Use pre-built RPM package
|
||||
isexternalpkg=no
|
||||
rpm_prebuiltdir=
|
||||
|
||||
|
||||
kitpackage:
|
||||
filename=xlmass.lib-7.1.0.0-120322.ppc64.rpm
|
||||
kitrepoid=rhels6_ppc64,sles11_ppc64
|
||||
# Method 1: Use pre-built RPM package
|
||||
isexternalpkg=no
|
||||
rpm_prebuiltdir=
|
||||
|
||||
|
||||
kitpackage:
|
||||
filename=xlsmp.lib-3.1.0.0-120315a.ppc64.rpm
|
||||
kitrepoid=rhels6_ppc64,sles11_ppc64
|
||||
# Method 1: Use pre-built RPM package
|
||||
isexternalpkg=no
|
||||
rpm_prebuiltdir=
|
||||
|
||||
|
||||
kitpackage:
|
||||
filename=xlsmp.msg.rte-3.1.0.0-120315a.ppc64.rpm
|
||||
kitrepoid=rhels6_ppc64,sles11_ppc64
|
||||
# Method 1: Use pre-built RPM package
|
||||
isexternalpkg=no
|
||||
rpm_prebuiltdir=
|
||||
|
||||
|
||||
kitpackage:
|
||||
filename=xlsmp.rte-3.1.0.0-120315a.ppc64.rpm
|
||||
kitrepoid=rhels6_ppc64,sles11_ppc64
|
||||
# Method 1: Use pre-built RPM package
|
||||
isexternalpkg=no
|
||||
rpm_prebuiltdir=
|
||||
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
./opt/ibmcmp/msg/*
|
||||
+./opt/ibmcmp/msg/en_US*
|
||||
|
||||
./opt/ibmcmp/xlmass/*/include*
|
||||
./opt/ibmcmp/xlsmp/*/include*
|
||||
./opt/ibmcmp/xlhelp*
|
||||
|
||||
./opt/ibmcmp/xlf/*/include*
|
||||
./opt/ibmcmp/xlf/*/msg/*
|
||||
+./opt/ibmcmp/xlf/*/msg/en_US*
|
||||
./opt/ibmcmp/xlf/*/lap/LA_*
|
||||
./opt/ibmcmp/xlf/*/lap/LI_*
|
||||
./opt/ibmcmp/xlf/*/lap/license/*.txt
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user