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 |
+259
-155
@@ -1,264 +1,368 @@
|
||||
#!/bin/sh
|
||||
#!/bin/bash
|
||||
# Update GSA Ubuntu Repositories or create a local repository
|
||||
#
|
||||
# Author: Leonardo Tonetto (tonetto@linux.vnet.ibm.com)
|
||||
# Revisor: Arif Ali (aali@ocf.co.uk)
|
||||
#
|
||||
# After running this script, add the following line to
|
||||
# /etc/apt/sources.list for local repository
|
||||
# deb file://<core_repo_path>/xcat-core/ maverick main
|
||||
# deb file://<dep_repo_path>/xcat-dep/ maverick main
|
||||
#
|
||||
# Getting Started:
|
||||
# - Check out the xcat-core svn repository (either the trunk or a branch) into
|
||||
# a dir called <rel>/src/xcat-core, where <rel> is the same as the release dir it will be
|
||||
# uploaded to in sourceforge (e.g. devel, or 2.3).
|
||||
# - You probably also want to put root's pub key from the build machine onto sourceforge for
|
||||
# the upload user listed below, so you don't have to keep entering pw's. You can do this
|
||||
# at https://sourceforge.net/account/ssh
|
||||
# - make sure reprepro is installed on the build machine
|
||||
# - Run this script from the local svn repository you just created. It will create the other directories that are needed.
|
||||
|
||||
# Usage: attr=value attr=value ... ./build-ubunturepo { -c | -d }
|
||||
# PROMOTE=1 - if the attribute "PROMOTE" is specified, means an official dot release. This does not
|
||||
# actually build xcat, just uploads the most recent snap build to 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/
|
||||
# or https://sourceforge.net/projects/xcat/files/aix/.
|
||||
# PREGA=1 - use this option with PROMOTE=1 on a branch that already has a released dot release, but this build is
|
||||
# a GA candidate build, not to be released yet. This will result in the tarball being uploaded to
|
||||
# https://sourceforge.net/projects/xcat/files/yum/ or https://sourceforge.net/projects/xcat/files/aix/
|
||||
# (but the tarball file name will be like a released tarball, not a snap build). When you are ready to
|
||||
# release this build, use PROMOTE=1 without PREGA
|
||||
# BUILDALL=1 - build all rpms, whether they changed or not. Should be used for snap builds that are in prep for a release.
|
||||
# UP=0 or UP=1 - override the default upload behavior
|
||||
#
|
||||
# For the dependency packages 1. please run the build-debs-all in xcat-dep svn first( there is usage detail in that script)
|
||||
# 2. run ./build-ubunturepo -d
|
||||
#
|
||||
############################
|
||||
printusage()
|
||||
{
|
||||
printf "Usage: %s {-c | -d} \n" $(basename $0) >&2
|
||||
echo " -c : Build the xcat core packages and create the repo"
|
||||
echo " -d : Create the xcat dep repo. Building the xcat dep packages can refer \"build-debs-all\" from svn"
|
||||
}
|
||||
# For the purpose of getting the distribution name
|
||||
. /etc/lsb-release
|
||||
|
||||
# Supported distributions
|
||||
dists="maverick natty oneiric precise "
|
||||
dists="maverick natty oneiric precise"
|
||||
|
||||
a_flag= # automatic flag - only update if repo was updated
|
||||
c_flag= # xcat-core (trunk-delvel) path
|
||||
d_flag= # xcat-dep (trunk) path
|
||||
u_flag= # gsa user-id
|
||||
p_flag= # gsa passwd
|
||||
local_flag= # build the repository localy
|
||||
r_flag= #genesis base rpm package path
|
||||
|
||||
while getopts 'c:d:u:p:l:a' OPTION
|
||||
while getopts 'cdr:' OPTION
|
||||
do
|
||||
case $OPTION in
|
||||
c) c_flag=1
|
||||
xcat_core_path="$OPTARG"
|
||||
;;
|
||||
d) d_flag=1
|
||||
xcat_dep_path="$OPTARG"
|
||||
;;
|
||||
u) u_flag=1
|
||||
gsa_id="$OPTARG"
|
||||
;;
|
||||
p) p_flag=1
|
||||
gsa_passwd="$OPTARG"
|
||||
;;
|
||||
l) local_flag=1
|
||||
local_repo_path="$OPTARG"
|
||||
;;
|
||||
a) a_flag=1
|
||||
;;
|
||||
|
||||
?) printf "Usage: %s -c <core_trunk_path> [-d <dep_trunk_path>] { -l <local-repo_path> | [-u <gsa_id> -p <gsa_passwd>] } [-a]\n" $(basename $0) >&2
|
||||
echo "-a Automatic: update only if there's any update on repo"
|
||||
r) r_flag=1
|
||||
genesis_rpm_path="$OPTARG"
|
||||
;;
|
||||
?) printusage
|
||||
exit 2
|
||||
;;
|
||||
esac
|
||||
done
|
||||
shift $(($OPTIND - 1))
|
||||
|
||||
if [ -z "$c_flag" -a -z "$d_flag" ]
|
||||
then
|
||||
printf "Usage: %s -c <core_trunk_path> [-d <dep_trunk_path>] { -l <local-repo_path> | [-u <gsa_id> -p <gsa_passwd>] } [-a]\n" $(basename $0) >&2
|
||||
echo "-a Automatic: update only if there's any update on repo"
|
||||
exit 2
|
||||
fi
|
||||
if [ ! -d $xcat_core_path ]
|
||||
then
|
||||
printf "%s: No such directory\n" "$xcat_core_path" >&2
|
||||
if [ -z "$c_flag" -a -z "$d_flag" ];then
|
||||
printusage
|
||||
exit 2
|
||||
fi
|
||||
|
||||
if [ "$d_flag" ]
|
||||
then
|
||||
if [ ! -d $xcat_dep_path ]
|
||||
then
|
||||
printf "%s: No such directory\n" "$xcat_dep_path" >&2
|
||||
exit 2
|
||||
fi
|
||||
if [ "$c_flag" -a "$d_flag" ];then
|
||||
printusage
|
||||
exit 2
|
||||
fi
|
||||
|
||||
if [ "$local_flag" ]
|
||||
then
|
||||
repo_xcat_core_path=$local_repo_path"/xcat-core"
|
||||
repo_xcat_dep_path=$local_repo_path"/xcat-dep"
|
||||
uploader="bp-sawyers"
|
||||
# Find where this script is located to set some build variables
|
||||
old_pwd=`pwd`
|
||||
cd `dirname $0`
|
||||
curdir=`pwd`
|
||||
|
||||
#define the dep source code path, core build target path and dep build target path
|
||||
local_core_repo_path="$curdir/../../xcat-core"
|
||||
xcat_dep_path="$curdir/../../../xcat-dep/src/xcat-dep"
|
||||
local_dep_repo_path="$curdir/../../../xcat-dep/xcat-dep"
|
||||
|
||||
#define the url used for creating the source list file
|
||||
#define the upload dir used for uploading packages
|
||||
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
|
||||
if [ -z "$u_flag" ]
|
||||
then
|
||||
if [ "$p_flag" ]
|
||||
then
|
||||
printf "Usage: %s -c <core_trunk_path> [-d <dep_trunk_path>] { -l <local-repo_path> | [-u <gsa_id> -p <gsa_passwd>] } [-a]\n" $(basename $0) >&2
|
||||
echo "-a Automatic: update only if there's any update on repo"
|
||||
exit 2
|
||||
fi
|
||||
echo -n "GSA id: "
|
||||
read gsa_id
|
||||
echo -n "GSA password: "
|
||||
stty -echo; read gsa_passwd; stty echo;
|
||||
echo ""; echo "";
|
||||
fi
|
||||
|
||||
repo_xcat_core_path="`pwd`/gsa-repo_temp/xcat-core"
|
||||
repo_xcat_dep_path="`pwd`/gsa-repo_temp/xcat-dep"
|
||||
upload_dir="core-snap"
|
||||
tar_name="core-debs-snap.tar.bz2"
|
||||
fi
|
||||
|
||||
if [ "$a_flag" ]
|
||||
then
|
||||
touch svcupdate.trace
|
||||
SVCUP='svcupdate.trace'
|
||||
svn update $xcat_core_path 1> $SVCUP 2>&1
|
||||
if ! grep 'Tree is up to date' $SVCUP
|
||||
then
|
||||
update_core=1
|
||||
else
|
||||
update_core=
|
||||
fi
|
||||
rm -f $SVCUP
|
||||
else
|
||||
update_core=1
|
||||
#use flock to only one person build at the same time
|
||||
# Get a lock, so can not do 2 builds at once
|
||||
exec 8>/var/lock/xcatbld.lock
|
||||
if ! flock -n 8; then
|
||||
echo "Can't get lock /var/lock/xcatbld.lock. Someone else must be doing a build right now. Exiting...."
|
||||
exit 1
|
||||
fi
|
||||
if [ "$c_flag" -a "$update_core" ]
|
||||
|
||||
export HOME=/root
|
||||
|
||||
#sync the gpg key to the build machine local
|
||||
gsa_url=http://pokgsa.ibm.com/projects/x/xcat/build/linux
|
||||
mkdir -p $HOME/.gnupg
|
||||
for key_name in pubring.gpg secring.gpg trustdb.gpg; do
|
||||
if [ ! -f $HOME/.gnupg/$key_name ] || [ `wc -c $HOME/.gnupg/$key_name|cut -f 1 -d' '` == 0 ]; then
|
||||
rm -f $HOME/.gnupg/$key_name
|
||||
wget -P $HOME/.gnupg $gsa_url/keys/$key_name
|
||||
chmod 600 $HOME/.gnupg/$key_name
|
||||
fi
|
||||
done
|
||||
|
||||
if [ "$c_flag" ]
|
||||
then
|
||||
# strip the /src/xcat-core from the end of the dir to get the next dir up and use as the release
|
||||
if [ -z "$REL" ]; then
|
||||
t=${curdir%/src/xcat-core}
|
||||
REL=`basename $t`
|
||||
fi
|
||||
|
||||
#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`
|
||||
|
||||
#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
|
||||
|
||||
#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
|
||||
echo "###############################"
|
||||
echo "# Building xcat-core packages #"
|
||||
echo "###############################"
|
||||
|
||||
CMD_PATH=`pwd`
|
||||
cd $xcat_core_path
|
||||
./build-debs-all "snap" "Nightly_Builds"
|
||||
#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"
|
||||
|
||||
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
|
||||
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
|
||||
|
||||
echo "#################################"
|
||||
echo "# Creating xcat-core repository #"
|
||||
echo "#################################"
|
||||
|
||||
if [ -d $repo_xcat_core_path ]; then
|
||||
rm -rf $repo_xcat_core_path
|
||||
#clean the repo directory
|
||||
if [ -e $local_core_repo_path ]; then
|
||||
rm -rf $local_core_repo_path
|
||||
fi
|
||||
mkdir -p $repo_xcat_core_path/conf
|
||||
|
||||
find . -iname '*.deb' -exec mv {} $repo_xcat_core_path \;
|
||||
|
||||
rm -rf debs/
|
||||
cd $CMD_PATH
|
||||
|
||||
rm -rf $repo_xcat_core_path/conf/distributions
|
||||
mkdir -p $local_core_repo_path
|
||||
cd $local_core_repo_path
|
||||
mkdir conf
|
||||
|
||||
for dist in $dists; do
|
||||
cat << __EOF__ >> $repo_xcat_core_path/conf/distributions
|
||||
cat << __EOF__ >> conf/distributions
|
||||
Origin: xCAT internal repository
|
||||
Label: xcat-core bazaar repository
|
||||
Codename: $dist
|
||||
Architectures: amd64 i386
|
||||
Components: main
|
||||
Description: Repository automatically genereted conf
|
||||
SignWith: yes
|
||||
|
||||
__EOF__
|
||||
done
|
||||
|
||||
cat << __EOF__ > $repo_xcat_core_path/conf/options
|
||||
cat << __EOF__ > conf/options
|
||||
verbose
|
||||
ask-passphrase
|
||||
basedir .
|
||||
__EOF__
|
||||
|
||||
#import the deb packages into the repo
|
||||
for dist in $dists; do
|
||||
for file in `ls $repo_xcat_core_path/*.deb`; do
|
||||
reprepro -b $repo_xcat_core_path includedeb $dist $file;
|
||||
for file in `ls ../debs/*.deb`; do
|
||||
reprepro -b ./ includedeb $dist $file;
|
||||
done
|
||||
done
|
||||
|
||||
mv $xcat_core_path/latest_version $repo_xcat_core_path/xcat-core_latest-build
|
||||
|
||||
cat << '__EOF__' > $repo_xcat_core_path/mklocalrepo.sh
|
||||
#create the mklocalrepo script
|
||||
cat << __EOF__ > mklocalrepo.sh
|
||||
. /etc/lsb-release
|
||||
cd `dirname $0`
|
||||
echo deb file://"`pwd`" $DISTRIB_CODENAME main > /etc/apt/sources.list.d/xcat-core.list
|
||||
__EOF__
|
||||
|
||||
chmod 775 $repo_xcat_core_path/mklocalrepo.sh
|
||||
rm -rf $repo_xcat_core_path/*.deb
|
||||
chmod 775 mklocalrepo.sh
|
||||
|
||||
if [ -z "$local_flag" ]
|
||||
then
|
||||
echo "###############################"
|
||||
echo "# Updating GSA xcat-core repo #"
|
||||
echo "###############################"
|
||||
lftp -e "mirror -R --delete-first $repo_xcat_core_path /projects/i/ipl-xcat/ubuntu/; exit;" -u $gsa_id,$gsa_passwd -p 22 sftp://ausgsa.ibm.com
|
||||
fi ### if [ -z "$local_flag" ]
|
||||
fi ### if [ "$a_flag" ]
|
||||
#create the xcat-core.list file
|
||||
#echo "deb ${sf_repo_url}/${REL}/${upload_dir}/ precise main" > xcat-core.list
|
||||
|
||||
if [ "$a_flag" -a "$d_flag" ]
|
||||
then
|
||||
touch svcupdate.trace
|
||||
SVCUP='svcupdate.trace'
|
||||
svn update $xcat_dep_path 1> $SVCUP 2>&1
|
||||
if ! grep 'Tree is up to date' $SVCUP
|
||||
then
|
||||
update_dep=1
|
||||
else
|
||||
update_dep=
|
||||
cd ../
|
||||
if ! grep xcat /etc/group ; then
|
||||
groupadd xcat
|
||||
fi
|
||||
|
||||
chgrp -R xcat xcat-core
|
||||
chmod -R g+w xcat-core
|
||||
|
||||
#build the tar ball
|
||||
tar -hjcf $tar_name xcat-core
|
||||
chgrp xcat $tar_name
|
||||
chmod g+w $tar_name
|
||||
|
||||
if [ ! -e core-snap ]; then
|
||||
ln -s xcat-core core-snap
|
||||
fi
|
||||
rm -f $SVCUP
|
||||
else
|
||||
update_dep=1
|
||||
|
||||
# Decide whether to upload or not
|
||||
if [ "$UP" != 1 ]; then
|
||||
echo "No need to upload"
|
||||
cd $old_pwd
|
||||
exit 0
|
||||
fi
|
||||
|
||||
#upload the deb packages
|
||||
if [ "$REL" = "devel" -o "$PREGA" != 1 ]; then
|
||||
i=0
|
||||
echo "Uploading RPMs from $upload_dir to ${sf_dir}/ubuntu/${REL}/ ..."
|
||||
while [ $((i+=1)) -le 5 ] && ! rsync -urLv --delete $upload_dir ${uploader},xcat@web.sourceforge.net:${sf_dir}/ubuntu/${REL}/
|
||||
do : ; done
|
||||
fi
|
||||
|
||||
#upload the tar ball
|
||||
if [ "$PROMOTE" = 1 -a "$REL" != "devel" -a "$PREGA" != 1 ]; then
|
||||
echo "";
|
||||
else
|
||||
i=0
|
||||
echo "Uploading $tar_name to ${sf_dir}/ubuntu/${REL}/ ..."
|
||||
while [ $((i+=1)) -le 5 ] && ! rsync -v $tar_name ${uploader},xcat@web.sourceforge.net:${sf_dir}/ubuntu/${REL}/
|
||||
do : ; done
|
||||
fi
|
||||
|
||||
cd $old_pwd
|
||||
fi
|
||||
if [ "$d_flag" -a "$update_dep" ]
|
||||
|
||||
if [ "$d_flag" ]
|
||||
then
|
||||
echo "##############################"
|
||||
echo "# Building xcat-dep packages #"
|
||||
echo "##############################"
|
||||
|
||||
CMD_PATH=`pwd`
|
||||
cd $xcat_dep_path
|
||||
./build-debs-all "snap" "Nightly_Builds"
|
||||
|
||||
echo "################################"
|
||||
echo "# Creating xcat-dep repository #"
|
||||
echo "################################"
|
||||
rm -rf $repo_xcat_dep_path
|
||||
mkdir -p $repo_xcat_dep_path/conf
|
||||
find $xcat_dep_path -iname '*.deb' -exec cp {} $repo_xcat_dep_path \;
|
||||
|
||||
rm -rf $repo_xcat_core_path/conf/distributions
|
||||
#clean all old files
|
||||
if [ -e $local_dep_repo_path ];then
|
||||
rm -rf $local_dep_repo_path
|
||||
fi
|
||||
mkdir -p $local_dep_repo_path
|
||||
cd $local_dep_repo_path
|
||||
mkdir conf
|
||||
|
||||
#create the conf/distributions file
|
||||
for dist in $dists; do
|
||||
cat << __EOF__ >> $repo_xcat_dep_path/conf/distributions
|
||||
cat << __EOF__ >> conf/distributions
|
||||
Origin: xCAT internal repository
|
||||
Label: xcat-dep bazaar repository
|
||||
Codename: $dist
|
||||
Architectures: i386 amd64
|
||||
Components: main
|
||||
Description: Repository automatically genereted conf
|
||||
SignWith: yes
|
||||
|
||||
__EOF__
|
||||
done
|
||||
done
|
||||
|
||||
cat << __EOF__ > $repo_xcat_dep_path/conf/options
|
||||
cat << __EOF__ > conf/options
|
||||
verbose
|
||||
ask-passphrase
|
||||
basedir .
|
||||
__EOF__
|
||||
|
||||
for dist in $dists; do
|
||||
for file in `ls $repo_xcat_dep_path/*.deb`; do
|
||||
reprepro -b $repo_xcat_dep_path includedeb $dist $file;
|
||||
for file in `ls ../debs/*.deb`; do
|
||||
reprepro -b ./ includedeb $dist $file;
|
||||
done
|
||||
done
|
||||
|
||||
cat << '__EOF__' > $repo_xcat_dep_path/mklocalrepo.sh
|
||||
cat << '__EOF__' > mklocalrepo.sh
|
||||
. /etc/lsb-release
|
||||
cd `dirname $0`
|
||||
echo deb file://"`pwd`" $DISTRIB_CODENAME main > /etc/apt/sources.list.d/xcat-dep.list
|
||||
__EOF__
|
||||
|
||||
chmod 775 $repo_xcat_dep_path/mklocalrepo.sh
|
||||
rm -rf $repo_xcat_dep_path/*.deb
|
||||
chmod 775 mklocalrepo.sh
|
||||
|
||||
if [ -z "$local_flag" ]
|
||||
then
|
||||
echo "##############################"
|
||||
echo "# Updating GSA xcat-dep repo #"
|
||||
echo "##############################"
|
||||
lftp -e "mirror -R --delete-first $repo_xcat_dep_path /projects/i/ipl-xcat/ubuntu/; exit;" -u $gsa_id,$gsa_passwd -p 22 sftp://ausgsa.ibm.com
|
||||
fi ### if [ -z "$local_flag" ]
|
||||
fi ### if [ "$d_flag" -a "$a_flag"]
|
||||
#echo ""deb ${sf_repo_url}/xcat-dep/ precise main"" > xcat-dep.list
|
||||
|
||||
if [ -z "$local_flag" ] # delete the temp repo after upload is done
|
||||
then
|
||||
rm -rf ./gsa-repo_temp
|
||||
cd ..
|
||||
if ! grep xcat /etc/group ; then
|
||||
groupadd xcat
|
||||
fi
|
||||
|
||||
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 xcat $dep_tar_name
|
||||
chmod g+w $dep_tar_name
|
||||
|
||||
if [ "$UP" != 1 ];then
|
||||
echo "No need to upload the dep packages"
|
||||
cd $old_pwd
|
||||
exit 0
|
||||
fi
|
||||
|
||||
#upload the dep packages
|
||||
i=0
|
||||
echo "Uploading debs from xcat-dep to ${sf_dir}/ubuntu/xcat-dep/ ..."
|
||||
while [ $((i+=1)) -le 5 ] && ! rsync -urLv --delete xcat-dep ${uploader},xcat@web.sourceforge.net:${sf_dir}/ubuntu/
|
||||
do : ; done
|
||||
#upload the tarball
|
||||
cd $old_pwd
|
||||
fi
|
||||
|
||||
exit 0
|
||||
|
||||
@@ -459,5 +459,11 @@ if [ "$OSNAME" != "AIX" -a "$REL" = "devel" -a "$PROMOTE" != 1 -a -z "$EMBED" ];
|
||||
i=0
|
||||
while [ $((i+=1)) -le 5 ] && ! rsync $verboseflag -r opt/xcat/share/doc/man1 opt/xcat/share/doc/man3 opt/xcat/share/doc/man5 opt/xcat/share/doc/man7 opt/xcat/share/doc/man8 $UPLOADUSER,xcat@web.sourceforge.net:htdocs/
|
||||
do : ; done
|
||||
|
||||
# extract and upload the tools readme
|
||||
rpm2cpio ../$XCATCORE/xCAT-server-*.$NOARCH.rpm | cpio -id ./opt/xcat/share/xcat/tools/README.html
|
||||
i=0
|
||||
while [ $((i+=1)) -le 5 ] && ! rsync $verboseflag opt/xcat/share/xcat/tools/README.html $UPLOADUSER,xcat@web.sourceforge.net:htdocs/tools/
|
||||
do : ; done
|
||||
cd ..
|
||||
fi
|
||||
|
||||
@@ -24,7 +24,7 @@ function makenoarch {
|
||||
else # linux
|
||||
echo "Building $RPMROOT/RPMS/noarch/$RPMNAME-$VER-snap*.noarch.rpm $EMBEDTXT..."
|
||||
tar --exclude .svn -czf $RPMROOT/SOURCES/$RPMNAME-$VER.tar.gz $RPMNAME
|
||||
rm -f $RPMROOT/SRPMS/xCAT-server-$VER*rpm $RPMROOT/RPMS/noarch/$RPMNAME-$VER*rpm
|
||||
rm -f $RPMROOT/SRPMS/$RPMNAME-$VER*rpm $RPMROOT/RPMS/noarch/$RPMNAME-$VER*rpm
|
||||
rpmbuild $QUIET -ta $RPMROOT/SOURCES/$RPMNAME-$VER.tar.gz
|
||||
RC=$?
|
||||
fi
|
||||
|
||||
+61
-51
@@ -157,61 +157,69 @@ B<tabedit> or B<chtab> commands. They can be viewed using B<nodels> or B<tabdum
|
||||
|
||||
Alternatively, the xCAT database can be viewed and edited as logical objects, instead of flat tables.
|
||||
In this mode, xCAT takes care of which table each attribute should go in. To treat the database
|
||||
as logical object definitions, use the commands: lsdef, mkdef, chdef, rmdef. See Object Definitions
|
||||
as logical object definitions, use the commands: B<lsdef>, B<mkdef>, B<chdef>, B<rmdef>. See Object Definitions
|
||||
below.
|
||||
|
||||
xCAT allows the use of different database applications, depending on the needs of your cluster.
|
||||
The default database is SQLite, which is a daemonless, zero-config database. But you could instead
|
||||
choose to use something like postgresql for greater scalability and remote access in the
|
||||
hierarchical/service node case. To use a different database or a different location, create
|
||||
the file /etc/xcat/cfgloc.
|
||||
See the appropriate xCAT docuementation for the format of the file for the database you choose.
|
||||
The following example is for PostgreSQL:
|
||||
the file /etc/xcat/cfgloc. See the appropriate xCAT docuementation for the format of the file for the database you choose.
|
||||
The following example /etc/xcat/cfgloc file is for PostgreSQL:
|
||||
|
||||
|
||||
=over 4
|
||||
|
||||
=item Pg:dbname=xcat;host=<mgmtnode>|<pgadminuserid>|<pgadminpasswd>
|
||||
Pg:dbname=xcat;host=<mgmtnode>|<pgadminuserid>|<pgadminpasswd>
|
||||
|
||||
where mgmtnode is the hostname of the management node adapter on the cluster side, and the pgadminuserid and pgadminpasswd are the database admin and password.
|
||||
|
||||
=back
|
||||
=head2 GROUPS AND REGULAR EXPRESSIONS IN TABLES
|
||||
|
||||
The xCAT database spans a number of tables, some with records associated with particular nodes
|
||||
(such as nodelist and nodehm) and others that do not have a direct relationship with any given node.
|
||||
The tables not associated with a given node are straightforward, the data is stored and retrieved
|
||||
as-is from the database without interpretation, and without any generic inheritance
|
||||
(though some calling code may implement inheritance for specific fields, for example
|
||||
nodehm.power inheriting from nodehm.mgt).
|
||||
|
||||
The tables with records typically retrieved by node name have some extra features to enable a more
|
||||
The xCAT database has a number of tables, some with rows that are keyed by node name
|
||||
(such as noderes and nodehm) and others that are not keyed by node name (for example, the policy table).
|
||||
The tables that are keyed by node name have some extra features that enable a more
|
||||
template-based style to be used:
|
||||
|
||||
Any group name can be used in lieu of a node name in the node field, and that record will then
|
||||
be taken to be applicable to any node in that group. If a field is requested for a specific node,
|
||||
and either a record doesn't exist specifically for that nodename or a record exists, but has no
|
||||
definition for the requested field, that node's groups are then used to search for
|
||||
records. If multiple records could apply from two different groups, the precedence is
|
||||
the order the groups are specified in the nodelist table for that node. This is nearly identical to
|
||||
most xCAT 1.x tab file conventions. This is useful in tables such as noderes, where typical
|
||||
configurations have exactly the same field values for large sets of nodes.
|
||||
Any group name can be used in lieu of a node name in the node field, and that row will then
|
||||
provide "default" attribute values for any node in that group. A row with a specific node name
|
||||
can then override one or more attribute values for that specific node. For example, if the nodehm table contains:
|
||||
|
||||
xCAT 2 extends the above to be made useful where a field will vary for every node with a given tag,
|
||||
but in ways that would be trivial to describe. If a field is of the format /I<pattern>/I<replacement>/,
|
||||
it is taken to be a perl regular expression, to be performed on the nodename. For example, the bmc field
|
||||
of the ipmi table might be B</\z/-bmc/> for a record with node=ipmi to specify that the BMC hostname is derived
|
||||
by appending B<-bmc> to the end of the nodename of every node in the ipmi group.
|
||||
#node,power,mgt,cons,termserver,termport,conserver,serialport,serialspeed,serialflow,getmac,cmdmapping,comments,disable
|
||||
"mygroup",,"ipmi",,,,,,"19200",,,,,
|
||||
"node1",,,,,,,,"115200",,,,,
|
||||
|
||||
As an extension to the above, a regular expression extended with arithmetic operators is available,
|
||||
by using the format |I<pattern>|I<replacement>|. This behaves similarly to the above, but () enclosed parts
|
||||
in I<replacement> are taken to signify arithmetic operations and substituted in. All operations are integer
|
||||
arithmetic, so 5/4 would come out as 1. The typical perl positional variables are available in such expressions.
|
||||
In the above example, the node group called mygroup sets mgt=ipmi and serialspeed=19200. Any nodes that are in this group
|
||||
will have those attribute values, unless overridden. For example, if node2 is a member of mygroup, it will automatically
|
||||
inherit these attribute values (even though it is not explicitly listed in this table). In the case of node1 above, it
|
||||
inherits mgt=ipmi, but overrides the serialspeed to be 115200, instead of 19200. A useful, typical way to use this
|
||||
capability is to create a node group for your nodes and for all the attribute values that are the same for every node,
|
||||
set them at the group level. Then you only have to set attributes for each node that vary from node to node.
|
||||
|
||||
For example, if you have many blades in your cluster and their hostnames have a regular
|
||||
pattern of blade1, blade2, etc., and your BladeCenter management modules also have a hostname
|
||||
pattern of amm1, amm2, etc., then your B<mp> table could be expressed by the following single row:
|
||||
xCAT extends the group capability so that it can also be used for attribute values that vary from node to node
|
||||
in a very regular pattern. For example, if in the ipmi table you want the bmc attribute to be set to whatever the nodename is with
|
||||
"-bmc" appended to the end of it, then use this in the ipmi table:
|
||||
|
||||
"blade","|\D+(\d+)|amm(($1-1)/14+1)|","|\D+(\d+)|(($1-1)%14+1)|",,
|
||||
#node,bmc,bmcport,taggedvlan,bmcid,username,password,comments,disable
|
||||
"compute","/\z/-bmc/",,,,,,,
|
||||
|
||||
In this example, "compute" is a node group that contains all of the compute nodes. The 2nd attribute (bmc) is a regular
|
||||
expression that is similar to a substitution pattern. The 1st part "\z" matches the end of the node name and substitutes "-bmc", effectively appending it to the node name.
|
||||
|
||||
Another example is if node1 is to have IP address 10.0.0.1, node2 is to have IP address 10.0.0.2, etc.,
|
||||
then this could be represented in the hosts table with the single row:
|
||||
|
||||
#node,ip,hostnames,otherinterfaces,comments,disable
|
||||
"compute","|node(\d+)|10.0.0.($1+0)|",,,,
|
||||
|
||||
In this example, the regular expression in the ip attribute uses "|" to separate the 1st and 2nd part. This means that
|
||||
xCAT will allow arithmetic operations in the 2nd part. In the 1st part, "(\d+)", will match the number part of the node
|
||||
name and put that in a variable called $1. The 2nd part
|
||||
is what value to give the ip attribute. In this case it will set it to the string "10.0.0." and the number that is
|
||||
in $1. (Zero is added to $1 just to remove any leading zeroes.)
|
||||
|
||||
A more involved example is with the mp table. If your blades have node names node01, node02, etc., and your chassis
|
||||
node names are cmm01, cmm02, etc., then you might have an mp table like:
|
||||
|
||||
#node,mpa,id,nodetype,comments,disable
|
||||
"blade","|\D+(\d+)|cmm(sprintf('%02d',($1-1)/14+1))|","|\D+(\d+)|(($1-1)%14+1)|",,
|
||||
|
||||
Before you panic, let me explain each column:
|
||||
|
||||
@@ -221,32 +229,34 @@ Before you panic, let me explain each column:
|
||||
|
||||
This is a group name. In this example, we are assuming that all of your blades belong to this
|
||||
group. Each time the xCAT software accesses the B<mp> table to get the management module and slot number
|
||||
of a specific blade (e.g. B<blade20>), this row will match (because B<blade20> is in the B<blade> group).
|
||||
Once this row is matched for B<blade20>, then the processing described in the following items will take
|
||||
of a specific blade (e.g. B<node20>), this row will match (because B<node20> is in the B<blade> group).
|
||||
Once this row is matched for B<node20>, then the processing described in the following items will take
|
||||
place.
|
||||
|
||||
=item B<|\D+(\d+)|amm(($1-1)/14+1)|>
|
||||
=item B<|\D+(\d+)|cmm(sprintf('%02d',($1-1)/14+1))|>
|
||||
|
||||
This is a perl substitution pattern that will produce the value for the second column of the table (the
|
||||
management module hostname).
|
||||
The text B<\D+(\d+)> between the 1st two vertical bars is
|
||||
management module hostname). The text B<\D+(\d+)> between the 1st two vertical bars is
|
||||
a regular expression that matches the node
|
||||
name that was searched for in this table (in this example B<blade20>). The text that matches
|
||||
name that was searched for in this table (in this example B<node20>). The text that matches
|
||||
within the 1st set of parentheses is set to $1. (If there was a 2nd set of parentheses, it would
|
||||
be set to $2, and so on.) In our case, the \D+ matches the non-numeric part of the name
|
||||
(B<blade>) and the \d+ matches the numeric part (B<20>). So $1 is set to B<20>. The text B<amm(($1-1)/14+1)> between the
|
||||
2nd and 3rd vertical bars produces the string that should be used as the value
|
||||
for this column in a hypothetical row for blade20. Since $1 is set to 20, the expression B<($1-1)/14+1> equals
|
||||
19/14 + 1, which equals 2. Therefore the whole string is B<amm2>, which will be used as the hostname
|
||||
(B<node>) and the B<\d+> matches the numeric part (B<20>). So $1 is set to B<20>. The text B<cmm(sprintf('%02d',($1-1)/14+1))> between the
|
||||
2nd and 3rd vertical bars produces the string that should be used as the value for the mpa attribute for node20.
|
||||
Since $1 is set to 20, the expression B<($1-1)/14+1> equals
|
||||
19/14 + 1, which equals 2. (The division is integer division,
|
||||
so 19/14 equals 1. Fourteen is used as the divisor, because there are 14 blades in each chassis.) The value of 2 is then passed into sprintf() with a format string to add a leading
|
||||
zero, if necessary, to always make the number two digits. Lastly the string B<cmm> is added to the beginning,
|
||||
making the resulting string B<cmm02>, which will be used as the hostname
|
||||
of the management module.
|
||||
|
||||
=item B<|\D+(\d+)|(($1-1)%14+1)|>
|
||||
|
||||
This item is similar to the one above. This substituion pattern will produce the value for
|
||||
the 3rd column (the BladeCenter chassis slot number for this blade). Because this row was
|
||||
the match for B<blade20>, the parentheses
|
||||
the 3rd column (the chassis slot number for this blade). Because this row was
|
||||
the match for B<node20>, the parentheses
|
||||
within the 1st set of vertical bars will set $1 to 20. Since % means modulo division, the
|
||||
expression B<($1-1)%14+1> will evaluate to 6.
|
||||
expression B<($1-1)%14+1> will evaluate to B<6>.
|
||||
|
||||
=back
|
||||
|
||||
|
||||
@@ -433,7 +433,7 @@ sub plugin_command {
|
||||
$usesiteglobal = 1;
|
||||
}
|
||||
foreach (@nodes) { #Specified a specific plugin, not a table lookup
|
||||
$handler_hash{$sent->{value}}->{$_} = 1;
|
||||
$handler_hash{$::XCATSITEVALS{$sitekey}}->{$_} = 1;
|
||||
}
|
||||
}
|
||||
} elsif ($hdlspec =~ /:/) { #Specificed a table lookup path for plugin name
|
||||
@@ -998,7 +998,7 @@ sub handle_response {
|
||||
}
|
||||
#print "in handle_response\n";
|
||||
# Handle errors
|
||||
if ($rsp->{errorcode}) {
|
||||
if (defined($rsp->{errorcode})) {
|
||||
if (ref($rsp->{errorcode}) eq 'ARRAY') {
|
||||
foreach my $ecode (@{$rsp->{errorcode}}) {
|
||||
$xCAT::Client::EXITCODE |= $ecode;
|
||||
@@ -1012,22 +1012,38 @@ sub handle_response {
|
||||
#print "printing error\n";
|
||||
if (ref($rsp->{error}) eq 'ARRAY') {
|
||||
foreach my $text (@{$rsp->{error}}) {
|
||||
print STDERR "Error: $text\n";
|
||||
if ($rsp->{NoErrorPrefix}) {
|
||||
print STDERR "$text\n";
|
||||
} else {
|
||||
print STDERR "Error: $text\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
print ("Error: ".$rsp->{error}."\n");
|
||||
if ($rsp->{NoErrorPrefix}) {
|
||||
print STDERR ($rsp->{error}."\n");
|
||||
} else {
|
||||
print STDERR ("Error: ".$rsp->{error}."\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($rsp->{warning}) {
|
||||
#print "printing warning\n";
|
||||
if (ref($rsp->{warning}) eq 'ARRAY') {
|
||||
foreach my $text (@{$rsp->{warning}}) {
|
||||
print STDERR "Warning: $text\n";
|
||||
if ($rsp->{NoWarnPrefix}) {
|
||||
print STDERR "$text\n";
|
||||
} else {
|
||||
print STDERR "Warning: $text\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
print ("Warning: ".$rsp->{warning}."\n");
|
||||
if ($rsp->{NoWarnPrefix}) {
|
||||
print STDERR ($rsp->{warning}."\n");
|
||||
} else {
|
||||
print STDERR ("Warning: ".$rsp->{warning}."\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($rsp->{info}) {
|
||||
|
||||
+11
-13
@@ -8,6 +8,7 @@ use File::stat;
|
||||
use File::Copy;
|
||||
use xCAT::Usage;
|
||||
use Thread qw/yield/;
|
||||
use Storable qw/store_fd fd_retrieve/;
|
||||
|
||||
BEGIN
|
||||
{
|
||||
@@ -29,19 +30,18 @@ sub forward_data {
|
||||
my $rfh;
|
||||
my $rc = @ready_fds;
|
||||
foreach $rfh (@ready_fds) {
|
||||
my $data;
|
||||
if ($data = <$rfh>) {
|
||||
while ($data !~ /ENDOFFREEZE6sK4ci/) {
|
||||
$data .= <$rfh>;
|
||||
}
|
||||
my $responses;
|
||||
eval {
|
||||
$responses = fd_retrieve($rfh);
|
||||
};
|
||||
if ($@ and $@ =~ /^Magic number checking on storable file/) { #this most likely means we ran over the end of available input
|
||||
$fds->remove($rfh);
|
||||
close($rfh);
|
||||
} else {
|
||||
eval { print $rfh "ACK\n"; }; #Ignore ack loss due to child giving up and exiting, we don't actually explicitly care about the acks
|
||||
my $responses=thaw($data);
|
||||
foreach (@$responses) {
|
||||
$callback->($_);
|
||||
}
|
||||
} else {
|
||||
$fds->remove($rfh);
|
||||
close($rfh);
|
||||
}
|
||||
}
|
||||
yield(); #Try to avoid useless iterations as much as possible
|
||||
@@ -62,8 +62,7 @@ sub send_data {
|
||||
foreach(@_) {
|
||||
my %output;
|
||||
if (ref($_) eq HASH) {
|
||||
print $out freeze([$_]);
|
||||
print $out "\nENDOFFREEZE6sK4ci\n";
|
||||
store_fd([$_],$out);
|
||||
yield();
|
||||
waitforack($out);
|
||||
next;
|
||||
@@ -97,8 +96,7 @@ sub send_data {
|
||||
} else {
|
||||
$output{node}->[0]->{data}->[0]->{contents}->[0]=$text;
|
||||
}
|
||||
print $out freeze([\%output]);
|
||||
print $out "\nENDOFFREEZE6sK4ci\n";
|
||||
store_fd([\%output],$out);
|
||||
yield();
|
||||
waitforack($out);
|
||||
}
|
||||
|
||||
@@ -2150,7 +2150,7 @@ sub getchildren
|
||||
$::RUNCMD_RC = 1;
|
||||
return undef;
|
||||
}
|
||||
my @ps = $ppctab->getAllNodeAttribs(['node','parent','nodetype']);
|
||||
my @ps = $ppctab->getAllNodeAttribs(['node','parent','nodetype','hcp']);
|
||||
foreach my $entry ( @ps ) {
|
||||
my $p = $entry->{parent};
|
||||
my $c = $entry->{node};
|
||||
@@ -2161,13 +2161,19 @@ sub getchildren
|
||||
# build hash of ppc.parent -> ppc.node
|
||||
push @{$PPCHASH{$p}}, $c;
|
||||
}
|
||||
elsif ($t eq 'blade') {
|
||||
push @{$PPCHASH{$c}}, $entry->{hcp};
|
||||
}
|
||||
} else { # go look in the nodetype table to find nodetype
|
||||
my $type = getnodetype($c);
|
||||
my $type = getnodetype($c, "ppc");
|
||||
if ( $type eq 'fsp' or $type eq 'bpa')
|
||||
{
|
||||
# build hash of ppc.parent -> ppc.node
|
||||
push @{$PPCHASH{$p}}, $c;
|
||||
}
|
||||
elsif ($type eq "blade") {
|
||||
push @{$PPCHASH{$c}}, $entry->{hcp};
|
||||
}
|
||||
}
|
||||
} # not $p and $c
|
||||
}
|
||||
@@ -2592,4 +2598,170 @@ sub judge_node
|
||||
|
||||
return $flag;
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
=head3 expandnicsattr
|
||||
Expand the nics related attributes into the readable format,
|
||||
for example, the nicsips=eth0!1.1.1.1|2.1.1.1,eth1!3.1.1.1|4.1.1.1
|
||||
expanded format:
|
||||
nicsips.eth0=1.1.1.1|2.1.1.1
|
||||
nicsips.eth1=3.1.1.1|4.1.1.1
|
||||
|
||||
Arguments:
|
||||
nicsattr value, like niccsips=eth0!1.1.1.1|2.1.1.1,eth1!3.1.1.1|4.1.1.1
|
||||
nicnames: only return the value for specific nics, like "eth0,eth1"
|
||||
Returns:
|
||||
expanded format, like:
|
||||
nicsips.eth0=1.1.1.1|2.1.1.1
|
||||
nicsips.eth1=3.1.1.1|4.1.1.1
|
||||
Error:
|
||||
none
|
||||
|
||||
Example:
|
||||
my $nicsstr = xCAT::DBobjUtils->expandnicsattr($attrval);
|
||||
|
||||
Comments:
|
||||
none
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
sub expandnicsattr()
|
||||
{
|
||||
my $nicstr = shift;
|
||||
if (($nicstr) && ($nicstr =~ /xCAT::/))
|
||||
{
|
||||
$nicstr = shift;
|
||||
}
|
||||
my $nicnames = shift;
|
||||
|
||||
my $ret;
|
||||
|
||||
$nicstr =~ /^(.*?)=(.*?)$/;
|
||||
|
||||
#Attribute: nicips, nichostnamesuffix, etc.
|
||||
my $nicattr = $1;
|
||||
|
||||
# Value: eth0!1.1.1.1|2.1.1.1,eth1!3.1.1.1|4.1.1.1
|
||||
my $nicval=$2;
|
||||
|
||||
# $nicarr[0]: eth0!1.1.1.1|2.1.1.1
|
||||
# $nicarr[1]: eth1!3.1.1.1|4.1.1.1
|
||||
my @nicarr = split(/,/, $nicval);
|
||||
|
||||
foreach my $nicentry (@nicarr)
|
||||
{
|
||||
#nicentry: eth0!1.1.1.1|2.1.1.1
|
||||
# $nicv[0]: eth0
|
||||
# $nicv[1]: 1.1.1.1|2.1.1.1
|
||||
my @nicv = split(/!/, $nicentry);
|
||||
|
||||
# only return nic* attr for these specific nics
|
||||
if ($nicnames)
|
||||
{
|
||||
my @nics = split(/,/, $nicnames);
|
||||
if ($nicv[0])
|
||||
{
|
||||
# Do not need to return the nic attr for this nic
|
||||
if (!grep(/^$nicv[0]$/, @nics))
|
||||
{
|
||||
next;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# ignore the line that does not have nicname or value
|
||||
if ($nicv[0] && $nicv[1])
|
||||
{
|
||||
$ret .= " $nicattr.$nicv[0]=$nicv[1]\n";
|
||||
}
|
||||
}
|
||||
|
||||
chomp($ret);
|
||||
return $ret;
|
||||
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
=head3 collapsenicsattr
|
||||
Collapse the nics related attributes into the database format,
|
||||
for example,
|
||||
nicsips.eth0=1.1.1.1|2.1.1.1
|
||||
nicsips.eth1=3.1.1.1|4.1.1.1
|
||||
|
||||
the collapsed format:
|
||||
nicsips=eth0!1.1.1.1|2.1.1.1,eth1!3.1.1.1|4.1.1.1
|
||||
|
||||
The collapse will be done against the hash %::FILEATTRS or %::CLIATTRS,
|
||||
remove the nicips.thx attributes from %::FILEATTRS or %::CLIATTRS,
|
||||
add the collapsed info nicips into %::FILEATTRS or %::CLIATTRS.
|
||||
|
||||
Arguments:
|
||||
$::FILEATTRS{$objname} or $::CLIATTRS{$objname}
|
||||
$objname
|
||||
|
||||
Returns:
|
||||
None, update %::FILEATTRS or %::CLIATTRS directly
|
||||
|
||||
Error:
|
||||
none
|
||||
|
||||
Example:
|
||||
xCAT::DBobjUtils->collapsenicsattr($nodeattrhash);
|
||||
|
||||
Comments:
|
||||
none
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
sub collapsenicsattr()
|
||||
{
|
||||
my $nodeattrhash = shift;
|
||||
if (($nodeattrhash) && ($nodeattrhash =~ /xCAT::/))
|
||||
{
|
||||
$nodeattrhash = shift;
|
||||
}
|
||||
my $objname = shift;
|
||||
|
||||
my %nicattrs = ();
|
||||
foreach my $nodeattr (keys %{$nodeattrhash})
|
||||
{
|
||||
# e.g nicips.eth0
|
||||
# do not need to handle nic attributes without the postfix .ethx,
|
||||
# it will be overwritten by the attributes with the postfix .ethx,
|
||||
if ($nodeattr =~ /^(nic\w+)\.(\w+)$/)
|
||||
{
|
||||
if ($1 && $2)
|
||||
{
|
||||
# chdef <noderange> nicips.eth2= to remove the definition for eth2
|
||||
# in this case, the $nodeattrhash->{'nicips.eth0'} is blank
|
||||
if ($nodeattrhash->{$nodeattr})
|
||||
{
|
||||
# $nicattrs{nicips}{eth0} = "1.1.1.1|1.2.1.1"
|
||||
$nicattrs{$1}{$2} = $nodeattrhash->{$nodeattr};
|
||||
}
|
||||
|
||||
# remove nicips.eth0 from the %::FILEATTRS
|
||||
delete $nodeattrhash->{$nodeattr};
|
||||
}
|
||||
}
|
||||
}
|
||||
# $nicattrs{'nicips'}{'eth0'} = "1.1.1.1|1.2.1.1"
|
||||
# $nicattrs{'nicips'}{'eth1'} = "2.1.1.1|2.2.1.1"
|
||||
foreach my $nicattr (keys %nicattrs)
|
||||
{
|
||||
my @tmparray = ();
|
||||
foreach my $nicname (keys %{$nicattrs{$nicattr}})
|
||||
{
|
||||
# eth0!1.1.1.1|1.2.1.1
|
||||
push @tmparray, "$nicname!$nicattrs{$nicattr}{$nicname}";
|
||||
}
|
||||
# eth0!1.1.1.1|1.2.1.1,eth1!2.1.1.1|2.2.1.1
|
||||
$nodeattrhash->{$nicattr} = join(',', @tmparray);
|
||||
}
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
+55
-26
@@ -592,6 +592,7 @@ sub _execute_dsh
|
||||
xCAT::MsgUtils->message("D", $rsp, $::CALLBACK);
|
||||
$rsp = {};
|
||||
push @{$rsp->{error}}, @{$error_buffers{$user_target}};
|
||||
$rsp->{NoErrorPrefix} = 1;
|
||||
xCAT::MsgUtils->message("E", $rsp, $::CALLBACK,0);
|
||||
}
|
||||
}
|
||||
@@ -607,6 +608,7 @@ sub _execute_dsh
|
||||
xCAT::MsgUtils->message("D", $rsp, $::CALLBACK);
|
||||
$rsp = {};
|
||||
push @{$rsp->{error}}, @{$error_buffers{$user_target}};
|
||||
$rsp->{NoErrorPrefix} = 1;
|
||||
xCAT::MsgUtils->message("E", $rsp, $::CALLBACK,0);
|
||||
|
||||
}
|
||||
@@ -815,7 +817,7 @@ sub fork_fanout_dcp
|
||||
my @dcp_command;
|
||||
my $rsyncfile;
|
||||
|
||||
if (!$$target_properties{'localhost'})
|
||||
if (!$$target_properties{'localhost'}) # this is to a remote host
|
||||
{
|
||||
my $target_type = $$target_properties{'type'};
|
||||
|
||||
@@ -837,6 +839,7 @@ sub fork_fanout_dcp
|
||||
|
||||
$rcp_config{'preserve'} = $$options{'preserve'};
|
||||
$rcp_config{'recursive'} = $$options{'recursive'};
|
||||
$rcp_config{'sudo'} = $$options{'sudo'};
|
||||
|
||||
if ($$options{'pull'})
|
||||
{
|
||||
@@ -869,21 +872,25 @@ sub fork_fanout_dcp
|
||||
my $localhost=0; # this is from the MN to another node
|
||||
@dcp_command =
|
||||
$remoteshell->remote_copy_command(\%rcp_config, $remote_copy);
|
||||
# add sudo for non-root users
|
||||
if ($$options{'sudo'}) {
|
||||
unshift (@dcp_command,'sudo');
|
||||
}
|
||||
|
||||
}
|
||||
else # this is the local host ( running on the Management Node)
|
||||
{
|
||||
if ($$options{'destDir_srcFile'}{$user_target})
|
||||
{
|
||||
my $target_type = $$target_properties{'type'};
|
||||
my $target_type = $$target_properties{'type'};
|
||||
|
||||
my %rcp_config = ();
|
||||
my %rcp_config = ();
|
||||
|
||||
my $remote_copy;
|
||||
my $rsh_extension = 'RSH';
|
||||
my $remote_copy;
|
||||
my $rsh_extension = 'RSH';
|
||||
|
||||
if ($target_type eq 'node')
|
||||
{
|
||||
if ($target_type eq 'node')
|
||||
{
|
||||
$remote_copy =
|
||||
$$options{'node-rcp'}{$$target_properties{'context'}}
|
||||
|| $$target_properties{'remote-copy'};
|
||||
@@ -891,10 +898,10 @@ sub fork_fanout_dcp
|
||||
($remote_copy =~ /\/rsync$/) && ($rsh_extension = 'RSYNC');
|
||||
$rcp_config{'options'} =
|
||||
$$options{'node-options'}{$$target_properties{'context'}};
|
||||
}
|
||||
}
|
||||
|
||||
$rcp_config{'preserve'} = $$options{'preserve'};
|
||||
$rcp_config{'recursive'} = $$options{'recursive'};
|
||||
$rcp_config{'preserve'} = $$options{'preserve'};
|
||||
$rcp_config{'recursive'} = $$options{'recursive'};
|
||||
|
||||
|
||||
$rcp_config{'src-file'} = $$options{'source'};
|
||||
@@ -905,20 +912,19 @@ sub fork_fanout_dcp
|
||||
$rcp_config{'destDir_srcFile'} =
|
||||
$$options{'destDir_srcFile'}{$user_target};
|
||||
|
||||
#eval "require RemoteShell::$rsh_extension";
|
||||
eval "require xCAT::$rsh_extension";
|
||||
my $remoteshell = "xCAT::$rsh_extension";
|
||||
# HERE: Build the dcp command based on the arguments
|
||||
my $localhost=1; # this is on the MN to the MN
|
||||
@dcp_command =
|
||||
eval "require xCAT::$rsh_extension";
|
||||
my $remoteshell = "xCAT::$rsh_extension";
|
||||
# HERE: Build the dcp command based on the arguments
|
||||
my $localhost=1; # this is on the MN to the MN
|
||||
@dcp_command =
|
||||
$remoteshell->remote_copy_command(\%rcp_config, $remote_copy,$localhost);
|
||||
|
||||
}
|
||||
else # just a copy not a sync
|
||||
{
|
||||
}
|
||||
else # just a copy not a sync
|
||||
{
|
||||
@dcp_command =
|
||||
('/bin/cp', '-r', $$options{'source'}, $$options{'target'});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
my $rsp = {};
|
||||
@@ -1034,6 +1040,28 @@ sub fork_fanout_dsh
|
||||
|
||||
if ($$options{'environment'})
|
||||
{
|
||||
# if we are on a servicenode need to get the environment file
|
||||
# from the SNsyncfiledir, not local
|
||||
if (xCAT::Utils->isServiceNode()) {
|
||||
my $newenvfile;
|
||||
my $synfiledir = "/var/xcat/syncfiles"; #default
|
||||
|
||||
# get the directory on the servicenode to and add to filepath
|
||||
my @syndir= xCAT::TableUtils->get_site_attribute("SNsyncfiledir");
|
||||
if ($syndir[0])
|
||||
{
|
||||
$synfiledir = $syndir[0];
|
||||
}
|
||||
$newenvfile = $synfiledir;
|
||||
$newenvfile .= $$options{'environment'};
|
||||
$$options{'environment'} = $newenvfile;
|
||||
}
|
||||
if (!(-e $$options{'environment'}))
|
||||
{
|
||||
my $rsp={};
|
||||
$rsp->{error}->[0] = "File $$options{'environment'} does not exist";
|
||||
xCAT::MsgUtils->message("E", $rsp, $::CALLBACK);
|
||||
}
|
||||
push @dsh_command,
|
||||
"$$options{'pre-command'} . $$options{'environment'} ; $$options{'command'}$$options{'post-command'}";
|
||||
}
|
||||
@@ -1163,13 +1191,13 @@ sub fork_fanout_dsh
|
||||
if ($$options{'execute'})
|
||||
{
|
||||
# first build the scp command to copy the file to execute
|
||||
# down to the node into /tmp/*.dsh
|
||||
# down to the node into /tmp/*.dsh
|
||||
my $rsp = {};
|
||||
$rsp->{data}->[0] = "TRACE: Execute option specified.";
|
||||
$dsh_trace && (xCAT::MsgUtils->message("I", $rsp, $::CALLBACK));
|
||||
|
||||
my %exe_rcp_config = ();
|
||||
$tmp_cmd_file = POSIX::tmpnam . ".dsh";
|
||||
$tmp_cmd_file = POSIX::tmpnam . ".dsh";
|
||||
|
||||
my ($exe_cmd, @args) = @{$$options{'execute'}};
|
||||
my $chmod_cmd = "";
|
||||
@@ -4216,7 +4244,7 @@ sub usage_dcp
|
||||
{
|
||||
### usage message
|
||||
my $usagemsg1 = " xdcp -h \n xdcp -q\n xdcp -V \n xdcp <noderange>\n";
|
||||
my $usagemsg2 = " [-B bypass] [-c] [-f fanout] [-l user_ID]\n";
|
||||
my $usagemsg2 = " [-B bypass] [-c] [-f fanout] [-l user_ID] [--sudo]\n";
|
||||
my $usagemsg3 =
|
||||
" [-m] [-o options] [-p] [-P] [-q] [-Q] [-r node_remote_copy]\n";
|
||||
my $usagemsg4 =
|
||||
@@ -4325,7 +4353,8 @@ sub parse_and_run_dcp
|
||||
'T|trace' => \$options{'trace'},
|
||||
'V|version' => \$options{'version'},
|
||||
'devicetype=s' => \$options{'devicetype'},
|
||||
'nodestatus|nodestatus' => \$options{'nodestatus'},
|
||||
'nodestatus|nodestatus' => \$options{'nodestatus'},
|
||||
'sudo|sudo' => \$options{'sudo'},
|
||||
'X:s' => \$options{'ignore_env'}
|
||||
)
|
||||
)
|
||||
@@ -4570,8 +4599,8 @@ sub parse_and_run_dcp
|
||||
close FILE;
|
||||
# now put the original syncfile on the queue to sync to the SN's
|
||||
$rc =
|
||||
&parse_rsync_input_file_on_MN(\@nodelist, \%options, $tmpsyncfile,
|
||||
$::SYNCSN, $synfiledir,$nodesyncfiledir);
|
||||
&parse_rsync_input_file_on_MN(\@nodelist, \%options,$tmpsyncfile,
|
||||
$::SYNCSN, $synfiledir,$nodesyncfiledir);
|
||||
# cleanup
|
||||
my $cmd = "rm $tmpsyncfile";
|
||||
my @output = xCAT::Utils->runcmd($cmd, 0);
|
||||
|
||||
@@ -0,0 +1,96 @@
|
||||
#!/usr/bin/env perl
|
||||
# IBM(c) 2013 EPL license http://www.eclipse.org/legal/epl-v10.html
|
||||
|
||||
package xCAT::DiscoveryUtils;
|
||||
|
||||
use strict;
|
||||
use XML::Simple;
|
||||
$XML::Simple::PREFERRED_PARSER='XML::Parser';
|
||||
|
||||
use xCAT::MsgUtils;
|
||||
|
||||
=head3 update_discovery_data
|
||||
Update the discovery data from the xcat request to discoverydata table to indicate the discovery events
|
||||
arg1 - the request
|
||||
|
||||
=cut
|
||||
|
||||
sub update_discovery_data {
|
||||
my $class = shift;
|
||||
my $request = shift;
|
||||
|
||||
my %disdata;
|
||||
my %otherdata;
|
||||
|
||||
unless ($request->{'uuid'}->[0]) {
|
||||
xCAT::MsgUtils->message("S", "Discovery Error: Found a node without uuid");
|
||||
}
|
||||
|
||||
if ($request->{'discoverymethod'}->[0]) {
|
||||
$disdata{'method'} = $request->{'discoverymethod'}->[0];
|
||||
} else {
|
||||
$disdata{'method'} = "undef";
|
||||
}
|
||||
|
||||
#discoverytime
|
||||
my ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) = localtime(time);
|
||||
my $currtime = sprintf("%02d-%02d-%04d %02d:%02d:%02d",
|
||||
$mon + 1, $mday, $year + 1900, $hour, $min, $sec);
|
||||
$disdata{'discoverytime'} = $currtime;
|
||||
|
||||
foreach my $attr (keys %$request) {
|
||||
if ($attr =~ /^(command|discoverymethod|_xcat|cacheonly|noderange|environment)/) {
|
||||
next;
|
||||
} elsif ($attr =~ /^(node|uuid|arch|cpucount|cputype|memory|mtm|serial)$/) {
|
||||
$disdata{$attr} = $request->{$attr}->[0];
|
||||
} elsif ($attr eq 'nic') {
|
||||
# Set the nics attributes
|
||||
foreach my $nic (@{$request->{nic}}) {
|
||||
my $nicname = $nic->{'devname'}->[0];
|
||||
foreach my $nicattr (keys %$nic) {
|
||||
my $tbattr;
|
||||
if ($nicattr eq 'driver') {
|
||||
$tbattr = "nicdriver";
|
||||
} elsif ($nicattr eq 'ip4address') {
|
||||
$tbattr = "nicipv4";
|
||||
} elsif ($nicattr eq 'hwaddr') {
|
||||
$tbattr = "nichwaddr";
|
||||
} elsif ($nicattr eq 'pcidev') {
|
||||
$tbattr = "nicpci";
|
||||
} elsif ($nicattr eq 'location') {
|
||||
$tbattr = "nicloc";
|
||||
} elsif ($nicattr eq 'onboardeth') {
|
||||
$tbattr = "niconboard";
|
||||
} elsif ($nicattr eq 'firmdesc') {
|
||||
$tbattr = "nicfirm";
|
||||
} elsif ($nicattr =~ /^(switchname|switchaddr|switchdesc|switchport)$/) {
|
||||
$tbattr = $nicattr;
|
||||
}
|
||||
|
||||
if ($tbattr) {
|
||||
if ($disdata{$tbattr}) {
|
||||
$disdata{$tbattr} .= ','.$nicname.'!'.$nic->{$nicattr}->[0];
|
||||
} else {
|
||||
$disdata{$tbattr} = $nicname.'!'.$nic->{$nicattr}->[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
# store to otherdata for the not parsed attributes
|
||||
$otherdata{$attr} = $request->{$attr};
|
||||
}
|
||||
}
|
||||
|
||||
if (keys %otherdata) {
|
||||
$disdata{'otherdata'} = XMLout(\%otherdata,RootName=>'discoveryotherdata' ,NoAttr=>1);
|
||||
}
|
||||
|
||||
my $distab = xCAT::Table->new('discoverydata');
|
||||
if ($distab) {
|
||||
$distab->setAttribs({uuid=>$request->{'uuid'}->[0]},\%disdata);
|
||||
$distab->close();
|
||||
}
|
||||
}
|
||||
|
||||
1;
|
||||
@@ -67,7 +67,7 @@ sub getHcpAttribs
|
||||
}
|
||||
}
|
||||
|
||||
my @ps = $tabs->{ppc}->getAllNodeAttribs(['node','parent','nodetype']);
|
||||
my @ps = $tabs->{ppc}->getAllNodeAttribs(['node','parent','nodetype','hcp']);
|
||||
for my $entry ( @ps ) {
|
||||
my $tmp_parent = $entry->{parent};
|
||||
my $tmp_node = $entry->{node};
|
||||
@@ -76,6 +76,9 @@ sub getHcpAttribs
|
||||
push @{$ppchash{$tmp_parent}{children}}, $tmp_node;
|
||||
#push @{$ppchash{$tmp_parent}}, $tmp_node;
|
||||
}
|
||||
if (defined($tmp_node) && defined($tmp_type) && ($tmp_type eq "blade") && defined($entry->{hcp})) {
|
||||
push @{$ppchash{$tmp_node}{children}}, $entry->{hcp};
|
||||
}
|
||||
|
||||
#if(exists($ppchash{$tmp_node})) {
|
||||
# if( defined($tmp_type) ) {
|
||||
@@ -173,6 +176,8 @@ sub getIPaddress
|
||||
#the $nodetocheck is its' hcp. So set $nodetocheck to $parent variable.
|
||||
#And then get the FSPs IPs for the CEC.
|
||||
$parent = $nodetocheck;
|
||||
} elsif ($type eq "blade") {
|
||||
return $ppc->{$nodetocheck}->{children}->[0];
|
||||
} else {
|
||||
return undef;
|
||||
}
|
||||
|
||||
@@ -236,7 +236,7 @@ sub powercmd {
|
||||
if($action =~ /^lowpower$/) { $action = "cec_on_low_power"; }
|
||||
#if($action =~ /^cycle$/) {$action = "cec_reboot";}
|
||||
if($action =~ /^cycle$/) {$action = "reset";}
|
||||
if($action !~ /^cec_on_autostart$/ && $action !~ /^cec_off$/ && $action !~ /^cec_on_low_power$/ && $action !~ /^onstandby$/ && $action !~ /^reboot_service_processor$/ && $action !~ /^reset$/) {
|
||||
if($action !~ /^cec_on_autostart$/ && $action !~ /^cec_off$/ && $action !~ /^cec_on_low_power$/ && $action !~ /^onstandby$/ && $action !~ /^reboot_service_processor$/ && $action !~ /^reset$/ && $action !~ /^sms$/) {
|
||||
push @output, [$node_name, "\'$action\' command not supported for $$d[4]", -1 ];
|
||||
return (\@output);
|
||||
}
|
||||
|
||||
@@ -116,6 +116,9 @@ sub enumerate_lcds {
|
||||
} else {
|
||||
my @array = split(/\n/, $data);
|
||||
foreach my $a (@array) {
|
||||
if ($a !~ /:\s?[^\s]*\s?[0|1]/) {
|
||||
next;
|
||||
}
|
||||
my @t = split(/:/, $a);
|
||||
my $name = $t[0];
|
||||
$data = $t[1];
|
||||
@@ -429,8 +432,10 @@ sub lcds {
|
||||
}
|
||||
}
|
||||
|
||||
if( $type =~ /lpar|blade/ ) {
|
||||
if( $type eq "lpar" ) {
|
||||
$action = "query_lcds";
|
||||
} elsif ($type eq "blade") {
|
||||
$action = "pblade_query_lcds";
|
||||
} else {
|
||||
$action = "cec_query_lcds";
|
||||
}
|
||||
|
||||
@@ -2186,8 +2186,12 @@ sub isValidMAC
|
||||
sub isValidHostname
|
||||
{
|
||||
my ($class, $hostname) = @_;
|
||||
if ($hostname =~ /^[a-z0-9][\-a-z0-9]+[a-z0-9]$/){
|
||||
return 1;
|
||||
if ($hostname =~ /^[a-z0-9]/){
|
||||
if ($hostname =~ /[a-z0-9]$/){
|
||||
if ($hostname =~ /^[\-a-z0-9]+$/){
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -99,7 +99,7 @@ sub mkhwconn_parse_args
|
||||
#my $nodetype_hash = $nodetypetab->getNodeAttribs( $node,[qw(nodetype)]);
|
||||
my $node_parent_hash = $ppctab->getNodeAttribs( $node,[qw(parent)]);
|
||||
#$nodetype = $nodetype_hash->{nodetype};
|
||||
$nodetype = xCAT::DBobjUtils->getnodetype($node);
|
||||
$nodetype = xCAT::DBobjUtils->getnodetype($node,"ppc");
|
||||
$node_parent = $node_parent_hash->{parent};
|
||||
if ( !$nodetype )
|
||||
{
|
||||
@@ -107,7 +107,7 @@ sub mkhwconn_parse_args
|
||||
next;
|
||||
} else
|
||||
{
|
||||
unless ( $nodetype =~ /^(fsp|bpa|frame|cec|hmc)$/)
|
||||
unless ( $nodetype =~ /^(blade|fsp|bpa|frame|cec|hmc)$/)
|
||||
{
|
||||
return ( usage("Node type is incorrect. \n"));
|
||||
}
|
||||
@@ -486,8 +486,9 @@ sub mkhwconn
|
||||
# Get IP address
|
||||
############################
|
||||
my $cnode;
|
||||
my $ntype = xCAT::DBobjUtils::getnodetype($node_name);
|
||||
if ($ntype =~ /^(cec|frame)$/)
|
||||
#my $ntype = xCAT::DBobjUtils::getnodetype($node_name);
|
||||
my $ntype = $$d[4];
|
||||
if ($ntype =~ /^(cec|frame|blade)$/)
|
||||
{
|
||||
$cnode = xCAT::DBobjUtils::getchildren($node_name, $opt->{port});
|
||||
} else {
|
||||
@@ -518,12 +519,17 @@ sub mkhwconn
|
||||
next;
|
||||
}
|
||||
|
||||
my ( undef,undef,$mtms,undef,$type) = @$d;
|
||||
my ( undef,undef,$mtms,undef,$type,$bpa) = @$d;
|
||||
my ($user, $passwd);
|
||||
if ( exists $opt->{P})
|
||||
{
|
||||
($user, $passwd) = ('HMC', $opt->{P});
|
||||
}
|
||||
elsif ($type eq "blade") {
|
||||
$user = "USERID";
|
||||
($user, $passwd) = xCAT::PPCdb::credentials( $bpa, $type, $user);
|
||||
$type = "cec";
|
||||
}
|
||||
else
|
||||
{
|
||||
($user, $passwd) = xCAT::PPCdb::credentials( $node_name, $type,'HMC');
|
||||
@@ -707,7 +713,7 @@ sub rmhwconn
|
||||
my $d = $node_hash->{$node_name};
|
||||
|
||||
my ( undef,undef,undef,undef,$type) = @$d;
|
||||
|
||||
if ($type eq "blade") {$type = "cec";}
|
||||
############################
|
||||
# Get IP address
|
||||
############################
|
||||
@@ -724,10 +730,19 @@ sub rmhwconn
|
||||
|
||||
my @ips;
|
||||
foreach my $entry ( @$nodes_found ) {
|
||||
if ( $entry =~ /$mtm\*$serial/) {
|
||||
$entry =~ /ipaddr=(\d+\.\d+\.\d+\.\d+),/;
|
||||
push @ips, $1;
|
||||
if ($entry =~ /type_model_serial_num=([^,]*),/) {
|
||||
my $match_mtm1 = $1;
|
||||
my $match_mtm2 = $match_mtm1;
|
||||
$match_mtm2 =~ s/\-//;
|
||||
if ($match_mtm1 =~ /$mtm\*$serial/ || $match_mtm2 =~ /$mtm\*$serial/) {
|
||||
$entry =~ /ipaddr=(\d+\.\d+\.\d+\.\d+),/;
|
||||
push @ips, $1;
|
||||
}
|
||||
}
|
||||
#if ( $entry =~ /$mtm\*$serial/) {
|
||||
# $entry =~ /ipaddr=(\d+\.\d+\.\d+\.\d+),/;
|
||||
# push @ips, $1;
|
||||
#}
|
||||
}
|
||||
if (!@ips)
|
||||
{
|
||||
|
||||
@@ -827,6 +827,8 @@ sub parse_nodeinfo_file
|
||||
|
||||
my @lines = split /\n/, $filedata;
|
||||
my $obj_found = 0;
|
||||
my $attr_found = 0;
|
||||
my $null_obj;
|
||||
my ($objname, $append);
|
||||
|
||||
foreach my $line (@lines){
|
||||
@@ -835,6 +837,8 @@ sub parse_nodeinfo_file
|
||||
|
||||
# The line ends with :
|
||||
if (grep(/:\s*$/, $line)){
|
||||
$attr_found = 0;
|
||||
$null_obj = $line;
|
||||
($objname, $append) = split(/:/, $line);
|
||||
$objname =~ s/^\s*//; # Remove any leading whitespace
|
||||
$objname =~ s/\s*$//; # Remove any trailing whitespace
|
||||
@@ -852,6 +856,7 @@ sub parse_nodeinfo_file
|
||||
if (! $obj_found){
|
||||
return 0, "No node defined before line \'$line\'";
|
||||
}
|
||||
$attr_found = 1;
|
||||
|
||||
my $attr = $1;
|
||||
my $val = $2;
|
||||
@@ -875,6 +880,81 @@ sub parse_nodeinfo_file
|
||||
return 0, "Invalid Line \'$line\' found";
|
||||
}
|
||||
}
|
||||
|
||||
# Defined object has no attributes
|
||||
if (! $attr_found){
|
||||
return 0, "Invalid Line \'$null_obj\' found";
|
||||
}
|
||||
|
||||
return 1, "";
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
=head3 check_nicips
|
||||
Description: Check if the nicips defined in MAC file is correct
|
||||
format
|
||||
Arguments: $installnic: the installnic defined in networkprofile
|
||||
$netprofileattrsref: the attributes of all nics in networkprofile
|
||||
$freeipshash: the hash of networks' staticrange
|
||||
$nicips: the string of nicips defined in MAC file
|
||||
Returns: ($retcode, $output, $errmsg).
|
||||
$retcode = 1. Parse failed, there are some errors in nicips string. Detailed errors will be set in $errmsg.
|
||||
$retcode = 0. Parse success, the format of nicips is OK..
|
||||
|
||||
=cut
|
||||
#-------------------------------------------------------------------------------
|
||||
sub check_nicips{
|
||||
my $class = shift;
|
||||
my $installnic = shift;
|
||||
my $netprofileattrsref = shift;
|
||||
my $freeipshash = shift;
|
||||
my $othernics = shift;
|
||||
|
||||
my $errmsg = "";
|
||||
my %nics_hash = ();
|
||||
my %netprofileattr = %$netprofileattrsref;
|
||||
|
||||
foreach my $nic_ips (split(/,/, $othernics)) {
|
||||
my @nic_and_ips = ();
|
||||
my $nic = "";
|
||||
my $nic_ip = "";
|
||||
if($nic_ips =~ /!/ and $nic_ips !~ /!$/) {
|
||||
@nic_and_ips = split(/!/, $nic_ips);
|
||||
my $len = @nic_and_ips;
|
||||
$nic = $nic_and_ips[0];
|
||||
$nic_ip = $nic_and_ips[1];
|
||||
|
||||
if (exists $nics_hash{$nic} or $len ne 2) {
|
||||
$errmsg = "The specified nicips is incorrect. It must be formatted correctly, in the form: <nic1>!<nic-ip1>,<nic2>!<nic-ip2>,...";
|
||||
return (1, "", $errmsg);
|
||||
}
|
||||
|
||||
# Check whether other interfaces contain provision nic
|
||||
if ($nic eq $installnic) {
|
||||
$errmsg = "The specified nicips cannot contain NICs used for provisioning.";
|
||||
return (1, "", $errmsg);
|
||||
}
|
||||
|
||||
# Check whether this interface is defined in networkprofile
|
||||
unless (exists $netprofileattr{$nic}){
|
||||
$errmsg = "The specified nicips contains NICs that are not defined in the network profile.";
|
||||
return (1, "", $errmsg);
|
||||
}
|
||||
|
||||
# Check whether specified IP is in each network's static range
|
||||
my $nicnetwork = $netprofileattr{$nic}{'network'};
|
||||
my $freeipsref = $freeipshash->{$nicnetwork};
|
||||
unless (grep{ $_ eq $nic_ip} @$freeipsref){
|
||||
$errmsg = "Specified IP address $nic_ip not in static range of network $netprofileattr{$nic}{'network'}";
|
||||
return (1, "", $errmsg);
|
||||
}
|
||||
}else {
|
||||
$errmsg = "The specified nicips is incorrect. It must be formatted correctly, in the form: <nic1>!<nic-ip1>,<nic2>!<nic-ip2>,...";
|
||||
return (1, "", $errmsg);
|
||||
}
|
||||
$nics_hash{$nic} = $nic_ip;
|
||||
}
|
||||
|
||||
return (0, \%nics_hash, "");
|
||||
}
|
||||
|
||||
|
||||
+13
-1
@@ -98,13 +98,21 @@ sub remote_copy_command
|
||||
{
|
||||
if (-e ("/usr/bin/rsync")) {
|
||||
if (($usersh == 0) || ($localhost == 1)) { # using ssh, or local
|
||||
if ($$config{'sudo'}){
|
||||
$sync_opt = '--rsync-path=sudo /usr/bin/rsync ';
|
||||
} else {
|
||||
$sync_opt = '--rsync-path /usr/bin/rsync ';
|
||||
}
|
||||
} else {
|
||||
$sync_opt = '--rsh /bin/rsh --rsync-path /usr/bin/rsync ';
|
||||
}
|
||||
} else {
|
||||
if (($usersh == 0) || ($localhost == 1)) { # using ssh, or local
|
||||
$sync_opt = '--rsync-path /usr/local/bin/rsync ';
|
||||
if ($$config{'sudo'}){
|
||||
$sync_opt = '--rsync-path=sudo /usr/local/bin/rsync ';
|
||||
} else {
|
||||
$sync_opt = '--rsync-path=/usr/local/bin/rsync ';
|
||||
}
|
||||
} else {
|
||||
$sync_opt = '--rsh /bin/rsh --rsync-path /usr/local/bin/rsync ';
|
||||
}
|
||||
@@ -112,7 +120,11 @@ sub remote_copy_command
|
||||
}
|
||||
else #linux
|
||||
{
|
||||
if ($$config{'sudo'}) {
|
||||
$sync_opt = '--rsync-path=\'sudo /usr/bin/rsync\' ';
|
||||
} else {
|
||||
$sync_opt = '--rsync-path /usr/bin/rsync ';
|
||||
}
|
||||
}
|
||||
# if only syncing the service node or
|
||||
# (no postscripts and no append lines) then do not
|
||||
|
||||
@@ -90,7 +90,7 @@ sub dodiscover {
|
||||
}
|
||||
}
|
||||
my $printinfo = join(",", @printip);
|
||||
send_message($args{reqcallback}, 0, "Sending SLP request on interfaces: $printinfo ...") if ($args{reqcallback});
|
||||
send_message($args{reqcallback}, 0, "Sending SLP request on interfaces: $printinfo ...") if ($args{reqcallback} and !$args{nomsg} );
|
||||
foreach my $srvtype (@srvtypes) {
|
||||
send_service_request_single(%args,ifacemap=>$interfaces,SrvType=>$srvtype);
|
||||
}
|
||||
@@ -170,12 +170,12 @@ sub dodiscover {
|
||||
$interval = time() - $startinterval;
|
||||
if ($args{Time} and $args{Count}) {
|
||||
if ($rspcount >= $args{Count} or $interval >= $args{Time}) {
|
||||
send_message($args{reqcallback}, 0, "Received $rspcount1 responses.") if ($args{reqcallback});
|
||||
send_message($args{reqcallback}, 0, "Received $rspcount1 responses.") if ($args{reqcallback} and !$args{nomsg});
|
||||
last;
|
||||
}
|
||||
}
|
||||
if ($sendcount > $retrytime and $rspcount1 == 0) {
|
||||
send_message($args{reqcallback}, 0, "Received $rspcount1 responses.") if ($args{reqcallback});
|
||||
send_message($args{reqcallback}, 0, "Received $rspcount1 responses.") if ($args{reqcallback} and !$args{nomsg});
|
||||
last;
|
||||
}
|
||||
#########################
|
||||
@@ -184,8 +184,8 @@ sub dodiscover {
|
||||
if ( $interval > $retryinterval){#* (2**$sendcount))) { #double time
|
||||
$sendcount++;
|
||||
$startinterval = time();
|
||||
send_message($args{reqcallback}, 0, "Received $rspcount1 responses.") if ($args{reqcallback});
|
||||
send_message($args{reqcallback}, 0, "Sending SLP request on interfaces: $printinfo ...") if ($args{reqcallback});
|
||||
send_message($args{reqcallback}, 0, "Received $rspcount1 responses.") if ($args{reqcallback} and !$args{nomsg});
|
||||
send_message($args{reqcallback}, 0, "Sending SLP request on interfaces: $printinfo ...") if ($args{reqcallback} and !$args{nomsg});
|
||||
foreach my $srvtype (@srvtypes) {
|
||||
send_service_request_single(%args,ifacemap=>$interfaces,SrvType=>$srvtype);
|
||||
}
|
||||
|
||||
+126
-21
@@ -61,7 +61,7 @@ statelite => {
|
||||
#seriously evaluate wider support of multi-domain environments, will leave them
|
||||
#commented rather than tempt people to try with an expectation that it could work.
|
||||
domain => {
|
||||
cols => [qw(node ou authdomain comments disable)],
|
||||
cols => [qw(node ou authdomain adminuser adminpassword type comments disable)],
|
||||
keys => ['node'],
|
||||
table_desc => 'Mapping of nodes to domain attributes',
|
||||
descriptions => {
|
||||
@@ -70,6 +70,9 @@ domain => {
|
||||
# the above column is unimplemented by anything, so leave it out for this pass
|
||||
ou => 'For an LDAP described machine account (i.e. Active Directory), the orginaztional unit to place the system. If not set, defaults to cn=Computers,dc=your,dc=domain',
|
||||
authdomain => 'If a node should participate in an AD domain or Kerberos realm distinct from domain indicated in site, this field can be used to specify that',
|
||||
adminuser => 'Allow a node specific indication of Administrative user. Most will want to just use passwd table to indicate this once rather than by node.',
|
||||
adminpassword => 'Allow a node specific indication of Administrative user password for the domain. Most will want to ignore this in favor of passwd table.',
|
||||
type => 'Type, if any, of authentication domain to manipulate. The only recognized value at the moment is activedirectory.',
|
||||
comments => 'Any user-written notes.',
|
||||
disable => "Set to 'yes' or '1' to comment out this row.",
|
||||
},
|
||||
@@ -260,6 +263,25 @@ virtsd => {
|
||||
}
|
||||
},
|
||||
|
||||
storage => {
|
||||
cols => [qw(node osvolume size state storagepool fcprange volumetag comments disable)],
|
||||
keys => [qw(node)],
|
||||
table_descr => 'Node storage resources',
|
||||
descriptions => {
|
||||
node => 'The node name',
|
||||
osvolume => "Specification of what storage to place the node OS image onto. Examples include:
|
||||
localdisk (Install to first non-FC attached disk)
|
||||
usbdisk (Install to first USB mass storage device seen)
|
||||
wwn=0x50000393c813840c (Install to storage device with given WWN)",
|
||||
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.',
|
||||
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.',
|
||||
disable => "Set to 'yes' or '1' to comment out this row.",
|
||||
}
|
||||
},
|
||||
websrv => {
|
||||
cols => [qw(node port username password comments disable)],
|
||||
keys => [qw(node)],
|
||||
@@ -323,7 +345,7 @@ chain => {
|
||||
node => 'The node name or group name.',
|
||||
currstate => 'The current or next chain step to be executed on this node by xCAT-genesis. Set by xCAT during node discovery or as a result of nodeset.',
|
||||
currchain => 'The chain steps still left to do for this node. This attribute will be automatically adjusted by xCAT while xCAT-genesis is running on the node (either during node discovery or a special operation like firmware update). During node discovery, this attribute is initialized from the chain attribute and updated as the chain steps are executed.',
|
||||
chain => 'A comma-delimited chain of actions to be performed automatically when this node is discovered. ("Discovered" means a node booted, but xCAT and DHCP did not recognize the MAC of this node. In this case, xCAT initiates the discovery process, the last step of which is to run the operations listed in this chain attribute.) Valid values: discover, boot or reboot, install or netboot, runcmd=<cmd>, runimage=<URL>, shell, standby. (Default - same as no chain). Example, for BMC machines use: runcmd=bmcsetup,shell.',
|
||||
chain => 'A comma-delimited chain of actions to be performed automatically when this node is discovered. ("Discovered" means a node booted, but xCAT and DHCP did not recognize the MAC of this node. In this situation, xCAT initiates the discovery process, the last step of which is to run the operations listed in this chain attribute, one by one.) Valid values: boot or reboot, install or netboot, runcmd=<cmd>, runimage=<URL>, shell, standby. (Default - same as no chain - it will do only the discovery.). Example, for BMC machines use: runcmd=bmcsetup,shell.',
|
||||
ondiscover => 'This attribute is currently not used by xCAT. The "nodediscover" operation is always done during node discovery.',
|
||||
comments => 'Any user-written notes.',
|
||||
disable => "Set to 'yes' or '1' to comment out this row.",
|
||||
@@ -565,7 +587,7 @@ nodepos => {
|
||||
},
|
||||
},
|
||||
noderes => {
|
||||
cols => [qw(node servicenode netboot tftpserver tftpdir nfsserver monserver nfsdir installnic primarynic discoverynics cmdinterface xcatmaster current_osimage next_osimage nimserver routenames comments disable)],
|
||||
cols => [qw(node servicenode netboot tftpserver tftpdir nfsserver monserver nfsdir installnic primarynic discoverynics cmdinterface xcatmaster current_osimage next_osimage nimserver routenames nameservers comments disable)],
|
||||
keys => [qw(node)],
|
||||
tablespace =>'XCATTBS16K',
|
||||
table_desc => 'Resources and settings to use when installing nodes.',
|
||||
@@ -587,6 +609,7 @@ noderes => {
|
||||
next_osimage => 'Not currently used. The name of the osimage data object that represents the OS image that will be installed on the node the next time it is deployed.',
|
||||
nimserver => 'Not used for now. The NIM server for this node (as known by this node).',
|
||||
routenames => 'A comma separated list of route names that refer to rows in the routes table. These are the routes that should be defined on this node when it is deployed.',
|
||||
nameservers => 'An optional node/group specific override for name server list. Most people want to stick to site or network defined nameserver configuration.',
|
||||
comments => 'Any user-written notes.',
|
||||
disable => "Set to 'yes' or '1' to comment out this row.",
|
||||
},
|
||||
@@ -682,8 +705,8 @@ linuximage => {
|
||||
template => 'The fully qualified name of the template file that is used to create the kick start file for diskful installation.',
|
||||
boottarget => 'The name of the boottarget definition. When this attribute is set, xCAT will use the kernel, initrd and kernel params defined in the boottarget definition instead of the default.',
|
||||
addkcmdline=> 'User specified arguments to be passed to the kernel. The user arguments are appended to xCAT.s default kernel arguments. This attribute is ignored if linuximage.boottarget is set.',
|
||||
pkglist => 'The fully qualified name of the file that stores the distro packages list that will be included in the image.',
|
||||
pkgdir => 'The name of the directory where the distro packages are stored.',
|
||||
pkglist => 'The fully qualified name of the file that stores the distro packages list that will be included in the image. Make sure that if the pkgs in the pkglist have dependency pkgs, the dependency pkgs should be found in one of the pkgdir',
|
||||
pkgdir => 'The name of the directory where the distro packages are stored. It could be set multiple paths.The multiple paths must be seperated by ",". The first path in the value of osimage.pkgdir must be the OS base pkg dir path, such as pkgdir=/install/rhels6.2/x86_64,/install/updates . In the os base pkg path, there are default repository data. And in the other pkg path(s), the users should make sure there are repository data. If not, use "createrepo" command to create them. ',
|
||||
otherpkglist => 'The fully qualified name of the file that stores non-distro package lists that will be included in the image.',
|
||||
otherpkgdir => 'The base directory where the non-distro packages are stored.',
|
||||
exlist => 'The fully qualified name of the file that stores the file names and directory names that will be excluded from the image during packimage command. It is used for diskless image only.',
|
||||
@@ -874,7 +897,7 @@ site => {
|
||||
" failed nodes for any xCAT commands. See the 'noderange' manpage for\n".
|
||||
" details on supported formats.\n\n".
|
||||
" forwarders: The DNS servers at your site that can provide names outside of the\n".
|
||||
" cluster. The makedns command will configuire the DNS on the management\n".
|
||||
" cluster. The makedns command will configure the DNS on the management\n".
|
||||
" node to forward requests it does not know to these servers.\n".
|
||||
" Note that the DNS servers on the service nodes will ignore this value\n".
|
||||
" and always be configured to forward requests to the management node.\n\n".
|
||||
@@ -1023,6 +1046,8 @@ site => {
|
||||
" and node requests, e.g. to get postscripts. Default is 64.\n\n".
|
||||
" xcatdport: The port used by the xcatd daemon for client/server communication.\n\n".
|
||||
" xcatiport: The port used by xcatd to receive install status updates from nodes.\n\n",
|
||||
" xcatsslversion: The ssl version by xcatd. Default is SSLv3.\n\n",
|
||||
" xcatsslciphers: The ssl cipher by xcatd. Default is 3DES.\n\n",
|
||||
value => 'The value of the attribute specified in the "key" column.',
|
||||
comments => 'Any user-written notes.',
|
||||
disable => "Set to 'yes' or '1' to comment out this row.",
|
||||
@@ -1201,7 +1226,7 @@ routes => {
|
||||
routename => 'Name used to identify this route.',
|
||||
net => 'The network address.',
|
||||
mask => 'The network mask.',
|
||||
ifname => '(optional) The interface name of the management node facing the gateway.',
|
||||
ifname => 'The interface name that facing the gateway. It is optional for IPv4 routes, but it is required for IPv6 routes.',
|
||||
gateway => 'The gateway that routes the ip traffic from the mn to the nodes. It is usually a service node.',
|
||||
comments => 'Any user-written notes.',
|
||||
disable => "Set to 'yes' or '1' to comment out this row.",
|
||||
@@ -1246,29 +1271,27 @@ nics => {
|
||||
nicips => 'Comma-separated list of IP addresses per NIC. To specify one ip address per NIC:
|
||||
<nic1>!<ip1>,<nic2>!<ip2>,..., for example, eth0!10.0.0.100,ib0!11.0.0.100
|
||||
To specify multiple ip addresses per NIC:
|
||||
<nic1>!<ip1>|<ip2>,<nic2>!<ip1>|<ip2>,..., for example, eth0!10.0.0.100|fd55::214:5eff:fe15:849b,ib0!11.0.0.100|2001::214:5eff:fe15:849a
|
||||
<nic1>!<ip1>|<ip2>,<nic2>!<ip1>|<ip2>,..., for example, eth0!10.0.0.100|fd55::214:5eff:fe15:849b,ib0!11.0.0.100|2001::214:5eff:fe15:849a. The xCAT object definition commands support to use nicips.<nicname> as the sub attributes.
|
||||
Note: The primary IP address must also be stored in the hosts.ip attribute. The nichostnamesuffixes should specify one hostname suffix for each ip address.',
|
||||
nichostnamesuffixes => 'Comma-separated list of hostname suffixes per NIC.
|
||||
If only one ip address is associated with each NIC:
|
||||
<nic1>!<ext1>,<nic2>!<ext2>,..., for example, eth0!-eth0,ib0!-ib0
|
||||
If multiple ip addresses are associcated with each NIC:
|
||||
<nic1>!<ext1>|<ext2>,<nic2>!<ext1>|<ext2>,..., for example, eth0!-eth0|-eth0-ipv6,ib0!-ib0|-ib0-ipv6.',
|
||||
nictypes => 'Comma-separated list of NIC types per NIC. <nic1>!<type1>,<nic2>!<type2>, e.g. eth0!Ethernet,ib0!Infiniband',
|
||||
niccustomscripts => 'Comma-separated list of custom scripts per NIC. <nic1>!<script1>,<nic2>!<script2>, e.g. eth0!configeth eth0, ib0!configib ib0
|
||||
<nic1>!<ext1>|<ext2>,<nic2>!<ext1>|<ext2>,..., for example, eth0!-eth0|-eth0-ipv6,ib0!-ib0|-ib0-ipv6.
|
||||
The xCAT object definition commands support to use nichostnamesuffixes.<nicname> as the sub attributes.
|
||||
Note: According to DNS rules a hostname must be a text string up to 24 characters drawn from the alphabet (A-Z), digits (0-9), minus sign (-),and period (.). When you are specifying "nichostnamesuffixes" or "nicaliases" make sure the resulting hostnames will conform to this naming convention',
|
||||
nictypes => 'Comma-separated list of NIC types per NIC. <nic1>!<type1>,<nic2>!<type2>, e.g. eth0!Ethernet,ib0!Infiniband. The xCAT object definition commands support to use nictypes.<nicname> as the sub attributes.',
|
||||
niccustomscripts => 'Comma-separated list of custom scripts per NIC. <nic1>!<script1>,<nic2>!<script2>, e.g. eth0!configeth eth0, ib0!configib ib0. The xCAT object definition commands support to use niccustomscripts.<nicname> as the sub attribute
|
||||
.',
|
||||
nicnetworks => 'Comma-separated list of networks connected to each NIC.
|
||||
If only one ip address is associated with each NIC:
|
||||
<nic1>!<network1>,<nic2>!<network2>, for example, eth0!10_0_0_0-255_255_0_0, ib0!11_0_0_0-255_255_0_0
|
||||
If multiple ip addresses are associated with each NIC:
|
||||
<nic1>!<network1>|<network2>,<nic2>!<network1>|<network2>, for example, eth0!10_0_0_0-255_255_0_0|fd55:faaf:e1ab:336::/64,ib0!11_0_0_0-255_255_0_0|2001:db8:1:0::/64
|
||||
',
|
||||
nicaliases => 'NOT YET IMPLEMENTED.
|
||||
|
||||
Comma-separated list of aliases for each NIC.
|
||||
|
||||
Format: eth0!<alias>,eth1!<alias1>|<alias2>
|
||||
For example: eth0!moe,eth1!larry|curly',
|
||||
|
||||
<nic1>!<network1>|<network2>,<nic2>!<network1>|<network2>, for example, eth0!10_0_0_0-255_255_0_0|fd55:faaf:e1ab:336::/64,ib0!11_0_0_0-255_255_0_0|2001:db8:1:0::/64. The xCAT object definition commands support to use nicnetworks.<nicname> as the sub attributes.',
|
||||
nicaliases => 'Comma-separated list of hostname aliases for each NIC.
|
||||
Format: eth0!<alias list>,eth1!<alias1 list>|<alias2 list>
|
||||
For multiple aliases per nic use a space-separated list.
|
||||
For example: eth0!moe larry curly,eth1!tom|jerry',
|
||||
comments => 'Any user-written notes.',
|
||||
disable => "Set to 'yes' or '1' to comment out this row.",
|
||||
},
|
||||
@@ -1317,7 +1340,7 @@ osdistroupdate => {
|
||||
},
|
||||
},
|
||||
kit => {
|
||||
cols => [qw(kitname basename description version ostype isinternal kitdeployparams kitdir comments disable)],
|
||||
cols => [qw(kitname basename description version release ostype isinternal kitdeployparams kitdir comments disable)],
|
||||
keys => [qw(kitname)],
|
||||
table_desc => 'This table stores all kits added to the xCAT cluster.',
|
||||
descriptions => {
|
||||
@@ -1325,6 +1348,7 @@ kit => {
|
||||
basename => 'The kit base name',
|
||||
description => 'The Kit description.',
|
||||
version => 'The kit version',
|
||||
release => 'The kit release',
|
||||
ostype => 'The kit OS type. Linux or AIX.',
|
||||
isinternal => 'A flag to indicated if the Kit is internally used. When set to 1, the Kit is internal. If 0 or undefined, the kit is not internal.',
|
||||
kitdeployparams => 'The file containing the default deployment parameters for this Kit. These parameters are added to the OS Image definition.s list of deployment parameters when one or more Kit Components from this Kit are added to the OS Image.',
|
||||
@@ -1374,6 +1398,42 @@ kitcomponent => {
|
||||
disable => "Set to 'yes' or '1' to comment out this row.",
|
||||
},
|
||||
},
|
||||
discoverydata => {
|
||||
cols => [qw(uuid node method discoverytime arch cpucount cputype memory mtm serial nicdriver nicipv4 nichwaddr nicpci nicloc niconboard nicfirm switchname switchaddr switchdesc switchport otherdata comments disable)],
|
||||
keys => [qw(uuid)],
|
||||
tablespace =>'XCATTBS32K',
|
||||
table_desc => 'Discovery data which sent from genesis.',
|
||||
types => {
|
||||
otherdata => 'VARCHAR(2048)',
|
||||
},
|
||||
descriptions => {
|
||||
uuid => 'The uuid of the node which send out the discovery request.',
|
||||
node => 'The node name which assigned to the discovered node.',
|
||||
method => 'The method which handled the discovery request. The method could be one of: switch, blade, profile, sequential.',
|
||||
discoverytime => 'The last time that xCAT received the discovery message.',
|
||||
arch => 'The architecture of the discovered node. e.g. x86_64.',
|
||||
cpucount => 'The cpu number of the discovered node. e.g. 32.',
|
||||
cputype => 'The cpu type of the discovered node. e.g. Intel(R) Xeon(R) CPU E5-2690 0 @ 2.90GHz',
|
||||
memory => 'The memory size of the discovered node. e.g. 198460852',
|
||||
mtm => 'The machine type model of the discovered node. e.g. 786310X',
|
||||
serial => 'The serial number of the discovered node. e.g. 1052EFB',
|
||||
nicdriver => 'The driver of the nic. The value should be comma separated <nic name!driver name>. e.g. eth0!be2net,eth1!be2net',
|
||||
nicipv4 => 'The ipv4 address of the nic. The value should be comma separated <nic name!ipv4 address>. e.g. eth0!10.0.0.212/8',
|
||||
nichwaddr => 'The hardware address of the nic. The should will be comma separated <nic name!hardware address>. e.g. eth0!34:40:B5:BE:DB:B0,eth1!34:40:B5:BE:DB:B4',
|
||||
nicpci => 'The pic device of the nic. The value should be comma separated <nic name!pci device>. e.g. eth0!0000:0c:00.0,eth1!0000:0c:00.1',
|
||||
nicloc => 'The location of the nic. The value should be comma separated <nic name!nic location>. e.g. eth0!Onboard Ethernet 1,eth1!Onboard Ethernet 2',
|
||||
niconboard => 'The onboard info of the nic. The value should be comma separated <nic name!onboard info>. e.g. eth0!1,eth1!2',
|
||||
nicfirm => 'The firmware description of the nic. The value should be comma separated <nic name!fimware description>. e.g. eth0!ServerEngines BE3 Controller,eth1!ServerEngines BE3 Controller',
|
||||
switchname => 'The switch name which the nic connected to. The value should be comma separated <nic name!switch name>. e.g. eth0!c909f06sw01',
|
||||
switchaddr => 'The address of the switch which the nic connected to. The value should be comma separated <nic name!switch address>. e.g. eth0!192.168.70.120',
|
||||
switchdesc => 'The description of the switch which the nic connected to. The value should be comma separated <nic name!switch description>. e.g. eth0!IBM Flex System Fabric EN4093 10Gb Scalable Switch, flash image: version 7.2.6, boot image: version 7.2.6',
|
||||
switchport => 'The port of the switch that the nic connected to. The value should be comma separated <nic name!switch port>. e.g. eth0!INTA2',
|
||||
otherdata => 'The left data which is not parsed to specific attributes (The complete message comes from genesis)',
|
||||
comments => 'Any user-written notes.',
|
||||
disable => "Set to 'yes' or '1' to comment out this row.",
|
||||
},
|
||||
},
|
||||
|
||||
); # end of tabspec definition
|
||||
|
||||
|
||||
@@ -1550,6 +1610,10 @@ my @nodeattrs = (
|
||||
{attr_name => 'netboot',
|
||||
tabentry => 'noderes.netboot',
|
||||
access_tabentry => 'noderes.node=attr:node',
|
||||
},
|
||||
{attr_name => 'nameservers',
|
||||
tabentry => 'noderes.nameservers',
|
||||
access_tabentry => 'noderes.node=attr:node',
|
||||
},
|
||||
{attr_name => 'routenames',
|
||||
tabentry => 'noderes.routenames',
|
||||
@@ -2074,6 +2138,43 @@ my @nodeattrs = (
|
||||
access_tabentry => 'nics.node=attr:node',
|
||||
},
|
||||
######################
|
||||
# prodkey table #
|
||||
######################
|
||||
{attr_name => 'productkey',
|
||||
tabentry => 'prodkey.key',
|
||||
access_tabentry => 'prodkey.node=attr:node',
|
||||
},
|
||||
######################
|
||||
# domain table #
|
||||
######################
|
||||
{attr_name => 'ou',
|
||||
tabentry => 'domain.ou',
|
||||
access_tabentry => 'domain.node=attr:node',
|
||||
},
|
||||
{attr_name => 'domainadminuser',
|
||||
tabentry => 'domain.adminuser',
|
||||
access_tabentry => 'domain.node=attr:node',
|
||||
},
|
||||
{attr_name => 'domainadminpassword',
|
||||
tabentry => 'domain.adminpassword',
|
||||
access_tabentry => 'domain.node=attr:node',
|
||||
},
|
||||
{attr_name => 'authdomain',
|
||||
tabentry => 'domain.authdomain',
|
||||
access_tabentry => 'domain.node=attr:node',
|
||||
},
|
||||
{attr_name => 'domaintype',
|
||||
tabentry => 'domain.type',
|
||||
access_tabentry => 'domain.node=attr:node',
|
||||
},
|
||||
######################
|
||||
# storage table #
|
||||
######################
|
||||
{attr_name => 'osvolume',
|
||||
tabentry => 'storage.osvolume',
|
||||
access_tabentry => 'storage.node=attr:node',
|
||||
},
|
||||
######################
|
||||
# vm table #
|
||||
######################
|
||||
{attr_name => 'vmmanager',
|
||||
@@ -3093,6 +3194,10 @@ push(@{$defspec{group}->{'attrs'}}, @nodeattrs);
|
||||
tabentry => 'kit.version',
|
||||
access_tabentry => 'kit.kitname=attr:kitname',
|
||||
},
|
||||
{attr_name => 'release',
|
||||
tabentry => 'kit.release',
|
||||
access_tabentry => 'kit.kitname=attr:kitname',
|
||||
},
|
||||
{attr_name => 'ostype',
|
||||
tabentry => 'kit.ostype',
|
||||
access_tabentry => 'kit.kitname=attr:kitname',
|
||||
|
||||
@@ -28,7 +28,7 @@ use strict;
|
||||
Input: service nodename
|
||||
Output: Masternode, OS and ARCH
|
||||
Example:
|
||||
xCAT::ServiceNodeUtils->readSNInfo;
|
||||
my $retdata = xCAT::ServiceNodeUtils->readSNInfo;
|
||||
=cut
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
@@ -81,18 +81,18 @@ sub readSNInfo
|
||||
|
||||
Checks the service node table in the database to see
|
||||
if input Service should be setup on the
|
||||
input service node
|
||||
input service node or Management Node (used by AAsn.pm)
|
||||
|
||||
Input:servicenodename,ipaddres(s) and hostnames of service node
|
||||
Output:
|
||||
array of services to setup for this service node
|
||||
hash of services to setup for this service node
|
||||
Globals:
|
||||
$::RUNCMD_RC = 0; good
|
||||
$::RUNCMD_RC = 1; error
|
||||
Error:
|
||||
none
|
||||
Example:
|
||||
@servicestosetup=xCAT::ServiceNodeUtils->isServiceReq($servicenodename, @serviceip) { blah; }
|
||||
$servicestosetup=xCAT::ServiceNodeUtils->isServiceReq($servicenodename, @serviceip) { blah; }
|
||||
|
||||
=cut
|
||||
|
||||
@@ -131,8 +131,14 @@ sub isServiceReq
|
||||
return; # do not setup anything
|
||||
}
|
||||
|
||||
my @process_service_list = ();
|
||||
# Are we on the MN
|
||||
my $mname;
|
||||
if (xCAT::Utils->isMN()) {
|
||||
my @nodeinfo = xCAT::NetworkUtils->determinehostname;
|
||||
$mname = pop @nodeinfo; # get hostname
|
||||
}
|
||||
|
||||
my $servicehash;
|
||||
# read all the nodes from the table, for each service
|
||||
foreach my $service (@services)
|
||||
{
|
||||
@@ -152,18 +158,36 @@ sub isServiceReq
|
||||
# value 1 or yes then we setup the service
|
||||
if (($value eq "1") || ($value eq "YES"))
|
||||
{
|
||||
push @process_service_list,
|
||||
$service; # found service to setup
|
||||
$servicehash->{$service} = "1";
|
||||
} else {
|
||||
$servicehash->{$service} = "0";
|
||||
}
|
||||
}
|
||||
last;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
# if the ftpserver attribute is not defined in the service node table
|
||||
# and we are on
|
||||
# the Linux management node, we need to look at site.vsftp
|
||||
# if the tftpserver attribute is not defined, then we default it 1
|
||||
if (($mname) && (xCAT::Utils->isLinux())) {
|
||||
if (!exists($servicehash->{'ftpserver'})) {
|
||||
my @tmp = xCAT::TableUtils->get_site_attribute("vsftp");
|
||||
if ($tmp[0] && ($tmp[0] !~ /0|NO|No|no|N|n/ )) {
|
||||
$servicehash->{'ftpserver'} = 1;
|
||||
}
|
||||
}
|
||||
if (!exists($servicehash->{'tftpserver'})) {
|
||||
$servicehash->{'tftpserver'} = 1;
|
||||
}
|
||||
}
|
||||
$servicenodetab->close;
|
||||
|
||||
$::RUNCMD_RC = 0;
|
||||
return @process_service_list;
|
||||
return $servicehash;
|
||||
|
||||
}
|
||||
|
||||
|
||||
+28
-30
@@ -36,7 +36,7 @@
|
||||
package xCAT::Table;
|
||||
use xCAT::MsgUtils;
|
||||
use Sys::Syslog;
|
||||
use Storable qw/freeze thaw/;
|
||||
use Storable qw/freeze thaw store_fd fd_retrieve/;
|
||||
use IO::Socket;
|
||||
#use Data::Dumper;
|
||||
use POSIX qw/WNOHANG/;
|
||||
@@ -92,8 +92,6 @@ sub dbc_call {
|
||||
sub dbc_submit {
|
||||
my $request = shift;
|
||||
$request->{'wantarray'} = wantarray();
|
||||
my $data = freeze($request);
|
||||
$data.= "\nENDOFFREEZEQFVyo4Cj6Q0v\n";
|
||||
my $clisock;
|
||||
my $tries=300;
|
||||
while($tries and !($clisock = IO::Socket::UNIX->new(Peer => $dbsockpath, Type => SOCK_STREAM, Timeout => 120) ) ) {
|
||||
@@ -105,22 +103,20 @@ sub dbc_submit {
|
||||
use Carp qw/cluck/;
|
||||
cluck();
|
||||
}
|
||||
print $clisock $data;
|
||||
$data="";
|
||||
store_fd($request,$clisock);
|
||||
#print $clisock $data;
|
||||
my $data="";
|
||||
my $lastline="";
|
||||
while (read($clisock,$lastline,32768)) { #$lastline ne "ENDOFFREEZEQFVyo4Cj6Q0j\n" and $lastline ne "*XCATBUGDETECTED*76e9b54341\n") { #index($lastline,"ENDOFFREEZEQFVyo4Cj6Q0j") < 0) {
|
||||
# $lastline = <$clisock>;
|
||||
$data .= $lastline;
|
||||
}
|
||||
my $retdata = fd_retrieve($clisock);
|
||||
close($clisock);
|
||||
if ($lastline =~ m/\*XCATBUGDETECTED\*76e9b54341\n\z/) { #if it was an error
|
||||
if (ref $retdata eq "SCALAR") { #bug detected
|
||||
#in the midst of the operation, die like it used to die
|
||||
my $err;
|
||||
$data =~ /\*XCATBUGDETECTED\*:(.*):\*XCATBUGDETECTED\*/s;
|
||||
$$retdata =~ /\*XCATBUGDETECTED\*:(.*):\*XCATBUGDETECTED\*/s;
|
||||
$err = $1;
|
||||
die $err;
|
||||
}
|
||||
my @returndata = @{thaw($data)};
|
||||
my @returndata = @{$retdata};
|
||||
if (wantarray) {
|
||||
return @returndata;
|
||||
} else {
|
||||
@@ -201,8 +197,7 @@ sub init_dbworker {
|
||||
xCAT::MsgUtils->message("S","xcatd: possible BUG encountered by xCAT DB worker ".$err);
|
||||
if ($currcon) {
|
||||
eval { #avoid hang by allowin client to die too
|
||||
print $currcon "*XCATBUGDETECTED*:$err:*XCATBUGDETECTED*\n";
|
||||
print $currcon "*XCATBUGDETECTED*76e9b54341\n";
|
||||
store_fd("*XCATBUGDETECTED*:$err:*XCATBUGDETECTED*\n",$currcon);
|
||||
$clientset->remove($currcon);
|
||||
close($currcon);
|
||||
};
|
||||
@@ -230,13 +225,14 @@ sub handle_dbc_conn {
|
||||
my $client = shift;
|
||||
my $clientset = shift;
|
||||
my $data;
|
||||
if ($data = <$client>) {
|
||||
my $lastline;
|
||||
while ($lastline ne "ENDOFFREEZEQFVyo4Cj6Q0v\n") { #$data !~ /ENDOFFREEZEQFVyo4Cj6Q0v/) {
|
||||
$lastline = <$client>;
|
||||
$data .= $lastline;
|
||||
}
|
||||
my $request = thaw($data);
|
||||
my $request;
|
||||
eval {
|
||||
$request = fd_retrieve($client);
|
||||
};
|
||||
if ($@ and $@ =~ /^Magic number checking on storable file/) { #this most likely means we ran over the end of available input
|
||||
$clientset->remove($client);
|
||||
close($client);
|
||||
} elsif ($request) {
|
||||
my $response;
|
||||
my @returndata;
|
||||
if ($request->{'wantarray'}) {
|
||||
@@ -244,12 +240,7 @@ sub handle_dbc_conn {
|
||||
} else {
|
||||
@returndata = (scalar(handle_dbc_request($request)));
|
||||
}
|
||||
$response = freeze(\@returndata);
|
||||
# $response .= "\nENDOFFREEZEQFVyo4Cj6Q0j\n";
|
||||
print $client $response;
|
||||
$clientset->remove($client);
|
||||
close($client);
|
||||
} else { #Connection terminated, clean up
|
||||
store_fd(\@returndata,$client);
|
||||
$clientset->remove($client);
|
||||
close($client);
|
||||
}
|
||||
@@ -2280,17 +2271,16 @@ sub getNodeAttribs
|
||||
#skip undefined values, save time
|
||||
next;
|
||||
}
|
||||
|
||||
if ($datum->{$attrib} =~ /^\/[^\/]*\/[^\/]*\/$/)
|
||||
{
|
||||
my $exp = substr($datum->{$attrib}, 1);
|
||||
chop $exp;
|
||||
my @parts = split('/', $exp, 2);
|
||||
my $retval = $node;
|
||||
my $retval = $node;
|
||||
$retval =~ s/$parts[0]/$parts[1]/;
|
||||
$datum->{$attrib} = $retval;
|
||||
}
|
||||
elsif ($datum->{$attrib} =~ /^\|.*\|.*\|$/)
|
||||
elsif ($datum->{$attrib} =~ /^\|.*\|$/)
|
||||
{
|
||||
|
||||
#Perform arithmetic and only arithmetic operations in bracketed issues on the right.
|
||||
@@ -2300,6 +2290,14 @@ sub getNodeAttribs
|
||||
my $exp = substr($datum->{$attrib}, 1);
|
||||
chop $exp;
|
||||
my @parts = split('\|', $exp, 2);
|
||||
my $arraySize = @parts;
|
||||
if ($arraySize < 2) { # easy regx, generate lhs from node
|
||||
my $lhs;
|
||||
my @numbers = $node =~ m/[\D0]*(\d+)/g;
|
||||
$lhs = '[\D0]*(\d+)' x scalar(@numbers);
|
||||
$lhs .= '.*$';
|
||||
unshift(@parts,$lhs);
|
||||
}
|
||||
my $curr;
|
||||
my $next;
|
||||
my $prev;
|
||||
|
||||
@@ -19,6 +19,7 @@ if ($^O =~ /^aix/i) {
|
||||
use lib "$::XCATROOT/lib/perl";
|
||||
use strict;
|
||||
require xCAT::Table;
|
||||
use File::Path;
|
||||
#-----------------------------------------------------------------------
|
||||
|
||||
=head3
|
||||
|
||||
@@ -60,7 +60,7 @@ my %usage = (
|
||||
BMC specific:
|
||||
rvitals noderange {temp|voltage|wattage|fanspeed|power|leds|lcds|summary|all}",
|
||||
"reventlog" =>
|
||||
"Usage: reventlog <noderange> [all|clear|<number of entries to retrieve>] [-V|--verbose]
|
||||
"Usage: reventlog <noderange> [all [-s]|clear|<number of entries to retrieve> [-s]] [-V|--verbose]
|
||||
reventlog [-h|--help|-v|--version]",
|
||||
"rinv" =>
|
||||
"Usage:
|
||||
@@ -261,7 +261,7 @@ my %usage = (
|
||||
rmvm [-p] [-f]",
|
||||
"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]
|
||||
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][--flexdiscover]",
|
||||
"rflash" =>
|
||||
"Usage:
|
||||
@@ -327,7 +327,7 @@ my %usage = (
|
||||
or
|
||||
updatenode <noderange> [-V|--verbose] [-k|--security] [-s|--sn]
|
||||
or
|
||||
updatenode <noderange> [-V|--verbose] [-F|--sync | -f|--snsync] [-l|--user[username]] [-S|--sw]
|
||||
updatenode <noderange> [-V|--verbose] [-F|--sync | -f|--snsync] [-l|--user[username]] [--fanout=[fanout value]] [-S|--sw]
|
||||
[-P|--scripts [script1,script2,...]] [-s|--sn]
|
||||
[-A|--updateallsw] [-c|--cmdlineonly] [-d alt_source_dir]
|
||||
[attr=val [attr=val...]]
|
||||
@@ -342,8 +342,12 @@ Options:
|
||||
|
||||
[-F|--sync] Perform File Syncing.
|
||||
|
||||
[--fanout] Allows you to assign the fanout value for the command.
|
||||
See xdsh/xdcp fanout parameter in the man page.
|
||||
|
||||
[-f|--snsync] Performs File Syncing to the service nodes that service
|
||||
the nodes in the noderange.
|
||||
|
||||
[-l|--user] User name to run the updatenode command. It overrides the
|
||||
current user which is the default.
|
||||
|
||||
|
||||
+168
-9
@@ -1334,7 +1334,6 @@ sub runxcmd_output
|
||||
if (defined($resp->{error}))
|
||||
{
|
||||
push @$::xcmd_outref, @{$resp->{error}};
|
||||
$::RUNCMD_RC = 1;
|
||||
}
|
||||
if (defined($resp->{errorcode}))
|
||||
{
|
||||
@@ -1386,7 +1385,6 @@ sub runxcmd_output2
|
||||
if (defined($resp->{error}))
|
||||
{
|
||||
push @{$::xcmd_outref_hash->{error}}, @{$resp->{error}};
|
||||
$::RUNCMD_RC = 1;
|
||||
}
|
||||
if (defined($resp->{errorcode}))
|
||||
{
|
||||
@@ -2068,7 +2066,8 @@ sub CheckVersion
|
||||
=head3 osver
|
||||
Returns the os and version of the System you are running on
|
||||
Arguments:
|
||||
none
|
||||
$type: which type of os infor you want. Supported values are:
|
||||
all,os,version,release
|
||||
Returns:
|
||||
0 - ok
|
||||
Globals:
|
||||
@@ -2085,9 +2084,16 @@ sub CheckVersion
|
||||
#-------------------------------------------------------------------------------
|
||||
sub osver
|
||||
{
|
||||
my $type = shift;
|
||||
if ($type =~ /xCAT::Utils/)
|
||||
{
|
||||
$type = shift;
|
||||
}
|
||||
|
||||
my $osver = "unknown";
|
||||
my $os = '';
|
||||
my $ver = '';
|
||||
my $rel = '';
|
||||
my $line = '';
|
||||
my @lines;
|
||||
my $relfile;
|
||||
@@ -2098,14 +2104,31 @@ sub osver
|
||||
close($relfile);
|
||||
chomp($line);
|
||||
$os = "rh";
|
||||
my $verrel=$line;
|
||||
$ver=$line;
|
||||
$ver=~ tr/\.//;
|
||||
$ver =~ s/[^0-9]*([0-9]+).*/$1/;
|
||||
if ( $type ) {
|
||||
$verrel =~ s/[^0-9]*([0-9.]+).*/$1/;
|
||||
($ver,$rel) = split /\./, $verrel;
|
||||
} else {
|
||||
$ver=~ tr/\.//;
|
||||
$ver =~ s/[^0-9]*([0-9]+).*/$1/;
|
||||
}
|
||||
if ($line =~ /AS/) { $os = 'rhas' }
|
||||
elsif ($line =~ /ES/) { $os = 'rhes' }
|
||||
elsif ($line =~ /WS/) { $os = 'rhws' }
|
||||
elsif ($line =~ /Server/) { $os = 'rhserver' }
|
||||
elsif ($line =~ /Client/) { $os = 'rhclient' }
|
||||
elsif ($line =~ /Server/) {
|
||||
if ( $type ) {
|
||||
$os = 'rhels';
|
||||
} else {
|
||||
$os = 'rhserver';
|
||||
}
|
||||
} elsif ($line =~ /Client/) {
|
||||
if ( $type ) {
|
||||
$os = 'rhel';
|
||||
} else {
|
||||
$os = 'rhclient';
|
||||
}
|
||||
}
|
||||
elsif (-f "/etc/fedora-release") { $os = 'rhfc' }
|
||||
}
|
||||
elsif (-f "/etc/SuSE-release")
|
||||
@@ -2120,6 +2143,10 @@ sub osver
|
||||
$ver =~ tr/\.//;
|
||||
$ver =~ s/[^0-9]*([0-9]+).*/$1/;
|
||||
|
||||
$rel = $lines[2];
|
||||
$ver =~ tr/\.//;
|
||||
$rel =~ s/[^0-9]*([0-9]+).*/$1/;
|
||||
|
||||
#print "ver: $ver\n";
|
||||
}
|
||||
elsif (-f "/etc/UnitedLinux-release")
|
||||
@@ -2177,8 +2204,21 @@ sub osver
|
||||
close($relfile);
|
||||
}
|
||||
}
|
||||
$os = "$os" . "$ver";
|
||||
return ($os);
|
||||
if ( $type and $type =~ /all/ ) {
|
||||
if ( $rel ) {
|
||||
return( "$os" . "," . "$ver" . ".$rel" );
|
||||
} else {
|
||||
return( "$os" . "," . "$ver" );
|
||||
}
|
||||
} elsif ( $type and $type =~ /os/ ) {
|
||||
return( $os );
|
||||
} elsif ( $type and $type =~ /version/ ) {
|
||||
return( $ver );
|
||||
} elsif ( $type and $type =~ /release/ ) {
|
||||
return( $rel );
|
||||
} else {
|
||||
return ("$os" . "$ver");
|
||||
}
|
||||
}
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
@@ -3116,4 +3156,123 @@ sub noderangecontainsMn
|
||||
}
|
||||
}
|
||||
|
||||
=head3 filter_nodes
|
||||
##########################################################################
|
||||
# Fliter the nodes to specific groups
|
||||
# For specific command, figure out the node lists which should be handled by blade.pm, fsp.pm or ipmi.pm
|
||||
# mp group: the nodes will be handled by blade.pm
|
||||
# fsp group: the nodes will be handled by fsp.pm
|
||||
# bmc group: the nodes will be handled by ipmi.pm
|
||||
# For rspconfig network, the NGP ppc blade will be included in the group of mp, othewise in the fsp group
|
||||
# For getmacs -D, the NGP ppc blade will be included in the group of common fsp, otherwise in the mp group
|
||||
# For renergy command, NGP blade will be moved to mp group
|
||||
##########################################################################
|
||||
=cut
|
||||
|
||||
sub filter_nodes{
|
||||
my ($class, $req, $mpnodes, $fspnodes, $bmcnodes, $nohandle) = @_;
|
||||
|
||||
my (@nodes,@args,$cmd);
|
||||
if (defined($req->{'node'})) {
|
||||
@nodes = @{$req->{'node'}};
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
if (defined($req->{'command'})) {
|
||||
$cmd = $req->{'command'}->[0];
|
||||
}
|
||||
if (defined($req->{'arg'})) {
|
||||
@args = @{$req->{'arg'}};
|
||||
}
|
||||
# get the nodes in the mp table
|
||||
my $mptabhash;
|
||||
my $mptab = xCAT::Table->new("mp");
|
||||
if ($mptab) {
|
||||
$mptabhash = $mptab->getNodesAttribs(\@nodes, ['mpa','nodetype']);
|
||||
}
|
||||
|
||||
# get the nodes in the ppc table
|
||||
my $ppctabhash;
|
||||
my $ppctab = xCAT::Table->new("ppc");
|
||||
if ($ppctab) {
|
||||
$ppctabhash = $ppctab->getNodesAttribs(\@nodes,['hcp']);
|
||||
}
|
||||
|
||||
# get the nodes in the ipmi table
|
||||
my $ipmitabhash;
|
||||
my $ipmitab = xCAT::Table->new("ipmi");
|
||||
if ($ipmitab) {
|
||||
$ipmitabhash = $ipmitab->getNodesAttribs(\@nodes,['bmc']);
|
||||
}
|
||||
|
||||
my (@mp, @ngpfsp, @ngpbmc, @commonfsp, @commonbmc, @unknow);
|
||||
|
||||
# if existing in both 'mpa' and 'ppc', a ngp power blade
|
||||
# if existing in both 'mpa' and 'ipmi', a ngp x86 blade
|
||||
# if only in 'ppc', a common power node
|
||||
# if only in 'ipmi', a common x86 node
|
||||
foreach (@nodes) {
|
||||
if (defined ($mptabhash->{$_}->[0]) && defined ($mptabhash->{$_}->[0]->{'mpa'})) {
|
||||
if (defined ($ppctabhash->{$_}->[0]) && defined ($ppctabhash->{$_}->[0]->{'hcp'})) {
|
||||
# flex power node
|
||||
push @ngpfsp, $_;
|
||||
next;
|
||||
} elsif (defined ($ipmitabhash->{$_}->[0]) && defined ($ipmitabhash->{$_}->[0]->{'bmc'})) {
|
||||
# flex x86 node
|
||||
push @ngpbmc, $_;
|
||||
next;
|
||||
}
|
||||
else {
|
||||
# Non flex blade, but blade node
|
||||
push @mp, $_;
|
||||
next;
|
||||
}
|
||||
} elsif (defined ($ppctabhash->{$_}->[0]) && defined ($ppctabhash->{$_}->[0]->{'hcp'})) {
|
||||
# common power node
|
||||
push @commonfsp, $_;
|
||||
} elsif (defined ($ipmitabhash->{$_}->[0]) && defined ($ipmitabhash->{$_}->[0]->{'bmc'})) {
|
||||
# common bmc node
|
||||
push @commonbmc, $_;
|
||||
} else {
|
||||
push @unknow, $_;
|
||||
}
|
||||
}
|
||||
|
||||
push @{$mpnodes}, @mp;#blade.pm
|
||||
push @{$fspnodes}, @commonfsp;
|
||||
push @{$bmcnodes}, @commonbmc;
|
||||
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;
|
||||
}
|
||||
} elsif($cmd eq "getmacs") {
|
||||
if (@args && (grep /^-D$/,@args)) {
|
||||
push @{$fspnodes}, @ngpfsp;
|
||||
} else {
|
||||
push @{$mpnodes}, @ngpfsp;
|
||||
}
|
||||
} elsif ($cmd eq "rvitals") {
|
||||
if (@args && (grep /^lcds$/,@args)) {
|
||||
push @{$fspnodes},@ngpfsp;
|
||||
} else {
|
||||
push @{$mpnodes}, @ngpfsp;
|
||||
}
|
||||
} elsif ($cmd eq "renergy") {
|
||||
push @{$mpnodes}, @ngpbmc;
|
||||
push @{$mpnodes}, @ngpfsp;
|
||||
} else {
|
||||
push @{$fspnodes}, @ngpfsp;
|
||||
}
|
||||
|
||||
push @{$nohandle}, @unknow;
|
||||
|
||||
## TRACE_LINE print "Nodes filter: nodetype [commp:@mp,ngpp:@ngpfsp,comfsp:@commonfsp]. mpnodes [@{$mpnodes}], fspnodes [@{$fspnodes}], bmcnodes [@{$bmcnodes}]\n";
|
||||
return 0;
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
@@ -16,6 +16,7 @@ require Exporter;
|
||||
"1310229985.226287" => "centos6",
|
||||
"1323560292.885204" => "centos6.2",
|
||||
"1341569670.539525" => "centos6.3",#x86
|
||||
"1362445555.957609" => "centos6.4",#x86_64
|
||||
"1176234647.982657" => "centos5",
|
||||
"1156364963.862322" => "centos4.4",
|
||||
"1178480581.024704" => "centos4.5",
|
||||
@@ -45,6 +46,8 @@ require Exporter;
|
||||
"1269260915.992102" => "rhels5.5", #i386
|
||||
"1269263646.691048" => "rhels5.5", #x86_64
|
||||
"1328205744.315196" => "rhels5.8", #x86_64
|
||||
"1354216429.587870" => "rhels5.9", #x86_64
|
||||
"1354214009.518521" => "rhels5.9", #ppc64
|
||||
"1285193176.460470" => "rhels6", #x86_64
|
||||
"1285192093.430930" => "rhels6", #ppc64
|
||||
"1305068199.328169" => "rhels6.1", #x86_64
|
||||
@@ -54,6 +57,8 @@ require Exporter;
|
||||
"1339641244.734735" => "rhels6.3", #ppc64
|
||||
"1339640147.274118" => "rhels6.3", #x86_64
|
||||
"1339638991.532890" => "rhels6.3", #i386
|
||||
"1359576752.435900" => "rhels6.4", #x86_64
|
||||
"1359576196.686790" => "rhels6.4", #ppc64
|
||||
"1285193176.593806" => "rhelhpc6", #x86_64
|
||||
"1305067719.718814" => "rhelhpc6.1",#x86_64
|
||||
"1321545261.599847" => "rhelhpc6.2",#x86_64
|
||||
|
||||
@@ -468,6 +468,7 @@ sub grantVSwitch {
|
||||
|
||||
# Use SMAPI EXEC
|
||||
my $out = `ssh $user\@$hcp "$sudo $dir/smcli Virtual_Network_Vswitch_Set -T SYSTEM -n $vswitchId -I $userId"`;
|
||||
xCAT::zvmUtils->printSyslog("grantVSwitch- ssh $user\@$hcp $sudo $dir/smcli Virtual_Network_Vswitch_Set -T SYSTEM -n $vswitchId -I $userId");
|
||||
$out = xCAT::zvmUtils->trimStr($out);
|
||||
|
||||
# If return string contains 'Done' - Operation was successful
|
||||
@@ -564,6 +565,7 @@ sub smapiFlashCopy {
|
||||
# Use SMAPI EXEC to flash copy
|
||||
my $cmd = '\"' . "CMD=FLASHCOPY $srcId $srcAddr 0 END $tgtId $tgtAddr 0 END" . '\"';
|
||||
my $out = `ssh $user\@$hcp "$sudo $dir/smcli xCAT_Commands_IUO -T $hcpUserId -c $cmd"`;
|
||||
xCAT::zvmUtils->printSyslog("smapiFlashCopy- ssh $user\@$hcp $sudo $dir/smcli xCAT_Commands_IUO -T $hcpUserId -c $cmd");
|
||||
|
||||
$out = xCAT::zvmUtils->trimStr($out);
|
||||
|
||||
@@ -656,14 +658,18 @@ sub purgeReader {
|
||||
$sudo = "";
|
||||
}
|
||||
|
||||
xCAT::zvmUtils->printSyslog("sudoer:$user zHCP:$hcp sudo:$sudo");
|
||||
|
||||
my $out;
|
||||
if (xCAT::zvmUtils->smapi4xcat($user, $hcp)) {
|
||||
# Use SMAPI EXEC to purge reader
|
||||
my $cmd = '\"' . "CMD=PURGE $userId RDR ALL" . '\"';
|
||||
$out = `ssh $user\@$hcp "$sudo $dir/smcli xCAT_Commands_IUO -T $userId -c $cmd"`;
|
||||
xCAT::zvmUtils->printSyslog("smcli xCAT_Commands_IUO -T $userId -c $cmd");
|
||||
} else {
|
||||
# Purge reader using CP
|
||||
$out = `ssh -o ConnectTimeout=5 $user\@$hcp "$sudo /sbin/vmcp purge $userId rdr all"`;
|
||||
xCAT::zvmUtils->printSyslog("/sbin/vmcp purge $userId rdr all");
|
||||
}
|
||||
|
||||
$out = xCAT::zvmUtils->trimStr($out);
|
||||
@@ -695,14 +701,18 @@ sub sendCPCmd {
|
||||
$sudo = "";
|
||||
}
|
||||
|
||||
xCAT::zvmUtils->printSyslog("sudoer:$user zHCP:$hcp sudo:$sudo");
|
||||
|
||||
my $out;
|
||||
if (xCAT::zvmUtils->smapi4xcat($user, $hcp)) {
|
||||
# Use SMAPI EXEC to send command
|
||||
$cmd = '\"' . "CMD=SEND CP $userId " . uc($cmd) . '\"';
|
||||
$out = `ssh $user\@$hcp "$sudo $dir/smcli xCAT_Commands_IUO -T $userId -c $cmd"`;
|
||||
xCAT::zvmUtils->printSyslog("smcli xCAT_Commands_IUO -T $userId -c $cmd");
|
||||
} else {
|
||||
# Send CP command to given user
|
||||
$out = `ssh $user\@$hcp "$sudo /sbin/vmcp send cp $userId $cmd"`;
|
||||
xCAT::zvmUtils->printSyslog("/sbin/vmcp send cp $userId $cmd");
|
||||
}
|
||||
|
||||
$out = xCAT::zvmUtils->trimStr($out);
|
||||
|
||||
@@ -286,8 +286,40 @@ sub printLn {
|
||||
|
||||
# Print string
|
||||
my $rsp;
|
||||
my $type = "I";
|
||||
if ($str =~ m/error/i) { # Set to print error if the string contains error
|
||||
$type = "E";
|
||||
}
|
||||
|
||||
$rsp->{data}->[0] = "$str";
|
||||
xCAT::MsgUtils->message( "I", $rsp, $callback );
|
||||
xCAT::MsgUtils->message( $type, $rsp, $callback );
|
||||
# xCAT::MsgUtils->message( "S", $str ); # Print to syslog
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head3 printSyslog
|
||||
|
||||
Description : Print a string to syslog
|
||||
Arguments : String
|
||||
Returns : Nothing
|
||||
Example : xCAT::zvmUtils->printSyslog($str);
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
sub printSyslog {
|
||||
|
||||
# Get inputs
|
||||
my ( $class, $str ) = @_;
|
||||
|
||||
# Prepend where this message came from
|
||||
$str = $class . " " . $str;
|
||||
|
||||
# Print string
|
||||
xCAT::MsgUtils->message( "S", $str );
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -387,7 +419,7 @@ sub getIp {
|
||||
# Get IP address
|
||||
# You need the extra space in the pattern,
|
||||
# else it will confuse gpok2 with gpok21
|
||||
my $out = `cat /etc/hosts | grep "$node "`;
|
||||
my $out = `cat /etc/hosts | egrep -i "$node | $node."`;
|
||||
my @parms = split( ' ', $out );
|
||||
|
||||
return $parms[0];
|
||||
@@ -483,7 +515,7 @@ sub getIfcfgByNic {
|
||||
foreach (@parms) {
|
||||
|
||||
# If the network file contains the NIC address
|
||||
$out = `ssh -o ConnectTimeout=5 $user\@$node "$sudo cat $_" | grep "$nic"`;
|
||||
$out = `ssh -o ConnectTimeout=5 $user\@$node "$sudo cat $_" | egrep -i "$nic"`;
|
||||
if ($out) {
|
||||
|
||||
# Return network file path
|
||||
@@ -682,7 +714,7 @@ sub getMdisks {
|
||||
sub getDedicates {
|
||||
|
||||
# Get inputs
|
||||
my ( $class, $user, $callback, $node ) = @_;
|
||||
my ( $class, $callback, $user, $node ) = @_;
|
||||
|
||||
my $sudo = "sudo";
|
||||
if ($user eq "root") {
|
||||
@@ -697,18 +729,18 @@ sub getDedicates {
|
||||
my $propVals = xCAT::zvmUtils->getNodeProps( 'zvm', $node, @propNames );
|
||||
my $hcp = $propVals->{'hcp'};
|
||||
|
||||
# Get node userID
|
||||
# Get node userId
|
||||
my $userId = $propVals->{'userid'};
|
||||
|
||||
my $out = `ssh $user\@$hcp "$sudo $dir/getuserentry $userId" | grep "DEDICATE"`;
|
||||
|
||||
my $out = `ssh $user\@$hcp "$sudo $dir/smcli Image_Query_DM -T $userId" | egrep -i "DEDICATE"`;
|
||||
|
||||
# Get DEDICATE statements
|
||||
my @lines = split( '\n', $out );
|
||||
my @dedicates;
|
||||
foreach (@lines) {
|
||||
$_ = xCAT::zvmUtils->trimStr($_);
|
||||
|
||||
# Save MDISK statements
|
||||
# Save statements
|
||||
push( @dedicates, $_ );
|
||||
}
|
||||
|
||||
@@ -2125,6 +2157,7 @@ sub querySSI {
|
||||
Description : Execute a remote command
|
||||
Arguments : User (root or non-root)
|
||||
Node
|
||||
Command to execute
|
||||
Returns : Output returned from executing command
|
||||
Example : my $out = xCAT::zvmUtils->rExecute($user, $node, $cmd);
|
||||
|
||||
@@ -2146,4 +2179,51 @@ sub rExecute {
|
||||
$cmd = "'" . $cmd . "'";
|
||||
$out = `ssh $user\@$node "$sudo sh -c $cmd"`;
|
||||
return $out;
|
||||
}
|
||||
|
||||
#-------------------------------------------------------
|
||||
|
||||
=head3 getUsedFcpDevices
|
||||
|
||||
Description : Get a list of used FCP devices in the zFCP pools
|
||||
Arguments : User (root or non-root)
|
||||
zHCP
|
||||
Returns : List of known FCP devices
|
||||
Example : my %devices = xCAT::zvmUtils->getUsedFcpDevices($user, $zhcp);
|
||||
|
||||
=cut
|
||||
|
||||
#-------------------------------------------------------
|
||||
sub getUsedFcpDevices {
|
||||
my ( $class, $user, $hcp ) = @_;
|
||||
|
||||
# Directory where zFCP pools are
|
||||
my $pool = "/var/opt/zhcp/zfcp";
|
||||
|
||||
my $sudo = "sudo";
|
||||
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:
|
||||
# #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,2000000000000112,,3B00-3B3F,,,
|
||||
$args[6] = xCAT::zvmUtils->trimStr($args[6]);
|
||||
|
||||
# Push used or allocated devices into hash
|
||||
if ($args[6]) {
|
||||
$usedDevices{uc($args[6])} = 1;
|
||||
}
|
||||
}
|
||||
|
||||
return %usedDevices;
|
||||
}
|
||||
+233
-62
@@ -60,9 +60,9 @@ function loadServicePage(tabId) {
|
||||
title = 'z/VM';
|
||||
|
||||
// Get zVM host names
|
||||
if (!$.cookie('srv_zvm')){
|
||||
if (!$.cookie('zvms')){
|
||||
$.ajax( {
|
||||
url : 'lib/srv_cmd.php',
|
||||
url : 'lib/cmd.php',
|
||||
dataType : 'json',
|
||||
data : {
|
||||
cmd : 'webportal',
|
||||
@@ -349,24 +349,45 @@ function imageDialog() {
|
||||
var info = createInfoBar('Provide the following attributes for the image. The image name will be generated based on the attributes you will give.');
|
||||
imageForm.append(info);
|
||||
|
||||
var imageName = $('<div><label>Image name:</label><input type="text" name="imagename" disabled="disabled"/></div>');
|
||||
var selectable = $('<div><label>Selectable:</label><input type="checkbox" name="selectable"/></div>');
|
||||
var imageType = $('<div><label>Image type:</label><input type="text" name="imagetype" value="linux"/></div>');
|
||||
var architecture = $('<div><label>OS architecture:</label><input type="text" name="osarch"/></div>');
|
||||
var osName = $('<div><label>OS name:</label><input type="text" name="osname" value="Linux"/></div>');
|
||||
var osVersion = $('<div><label>OS version:</label><input type="text" name="osvers"/></div>');
|
||||
var profile = $('<div><label>Profile:</label><input type="text" name="profile"/></div>');
|
||||
var imageName = $('<div><label>Image name:</label><input type="text" name="imagename" disabled="disabled" title="The name of the image"/></div>');
|
||||
var selectable = $('<div><label>Selectable:</label><input type="checkbox" name="selectable" title="Select if you want this image to appear on the self service portal"/></div>');
|
||||
var imageType = $('<div><label>Image type:</label><input type="text" name="imagetype" value="linux" title="The type of operating system image this definition represents"/></div>');
|
||||
var architecture = $('<div><label>OS architecture:</label><input type="text" name="osarch" title="The hardware architecture of this node. Valid values: x86_64, ppc64, x86, ia64, and s390x."/></div>');
|
||||
var osName = $('<div><label>OS name:</label><input type="text" name="osname" value="Linux" title="Operating system name"/></div>');
|
||||
var osVersion = $('<div><label>OS version:</label><input type="text" name="osvers" title="The Linux operating system deployed on this node. Valid values: rhel*, centos*, fedora*, and sles* (where * is the version #)."/></div>');
|
||||
var profile = $('<div><label>Profile:</label><input type="text" name="profile" title="The node usage category"/></div>');
|
||||
var provisionMethod = $('<div><label>Provision method:</label></div>');
|
||||
var provisionSelect = $('<select name="provmethod">'
|
||||
var provisionSelect = $('<select name="provmethod" title="The provisioning method for node deployment">'
|
||||
+ '<option value=""></option>'
|
||||
+ '<option value="install">install</option>'
|
||||
+ '<option value="netboot">netboot</option>'
|
||||
+ '<option value="statelite">statelite</option>'
|
||||
+ '</select>');
|
||||
provisionMethod.append(provisionSelect);
|
||||
var comments = $('<div><label>Description:</label><input type="text" name="comments"/></div>');
|
||||
var comments = $('<div><label>Description:</label><input type="text" name="comments" title="Any user-written notes"/></div>');
|
||||
imageForm.append(imageName, selectable, imageType, architecture, osName, osVersion, profile, provisionMethod, comments);
|
||||
|
||||
// Generate tooltips
|
||||
imageForm.find('div input[title],textarea[title],select[title]').tooltip({
|
||||
position: "center right",
|
||||
offset: [-2, 10],
|
||||
effect: "fade",
|
||||
opacity: 0.8,
|
||||
delay: 0,
|
||||
predelay: 800,
|
||||
events: {
|
||||
def: "mouseover,mouseout",
|
||||
input: "mouseover,mouseout",
|
||||
widget: "focus mouseover,blur mouseout",
|
||||
tooltip: "mouseover,mouseout"
|
||||
},
|
||||
|
||||
// Change z index to show tooltip in front
|
||||
onBeforeShow: function() {
|
||||
this.getTip().css('z-index', $.topZIndex());
|
||||
}
|
||||
});
|
||||
|
||||
// Open dialog to add image
|
||||
imageForm.dialog({
|
||||
title:'Create image',
|
||||
@@ -466,30 +487,37 @@ function imageDialog() {
|
||||
* @param iComments Image description
|
||||
*/
|
||||
function editImageDialog(iName, iSelectable, iOsVersion, iOsArch, iOsName, iType, iProfile, iMethod, iComments) {
|
||||
// Create form to add profile
|
||||
var dialogId = 'editImage';
|
||||
var inst = 0;
|
||||
var dialogId = 'editImage' + inst;
|
||||
while ($('#' + dialogId).length) {
|
||||
// If one already exists, generate another one
|
||||
inst = inst + 1;
|
||||
dialogId = 'editImage' + inst;
|
||||
}
|
||||
|
||||
// Create form to add profile
|
||||
var imageForm = $('<div id="' + dialogId + '" class="form"></div>');
|
||||
|
||||
// Create info bar
|
||||
var info = createInfoBar('Provide the following attributes for the image. The image name will be generated based on the attributes you will give.');
|
||||
imageForm.append(info);
|
||||
|
||||
var imageName = $('<div><label>Image name:</label><input type="text" name="imagename" disabled="disabled"/></div>');
|
||||
var selectable = $('<div><label>Selectable:</label><input type="checkbox" name="selectable"/></div>');
|
||||
var imageType = $('<div><label>Image type:</label><input type="text" name="imagetype" value="linux"/></div>');
|
||||
var architecture = $('<div><label>OS architecture:</label><input type="text" name="osarch"/></div>');
|
||||
var osName = $('<div><label>OS name:</label><input type="text" name="osname"/></div>');
|
||||
var osVersion = $('<div><label>OS version:</label><input type="text" name="osvers"/></div>');
|
||||
var profile = $('<div><label>Profile:</label><input type="text" name="profile"/></div>');
|
||||
var imageName = $('<div><label>Image name:</label><input type="text" name="imagename" disabled="disabled" title="The name of the image"/></div>');
|
||||
var selectable = $('<div><label>Selectable:</label><input type="checkbox" name="selectable" title="Select if you want this image to appear on the self service portal"/></div>');
|
||||
var imageType = $('<div><label>Image type:</label><input type="text" name="imagetype" value="linux" title="The type of operating system image this definition represents"/></div>');
|
||||
var architecture = $('<div><label>OS architecture:</label><input type="text" name="osarch" title="The hardware architecture of this node. Valid values: x86_64, ppc64, x86, ia64, and s390x."/></div>');
|
||||
var osName = $('<div><label>OS name:</label><input type="text" name="osname" value="Linux" title="Operating system name"/></div>');
|
||||
var osVersion = $('<div><label>OS version:</label><input type="text" name="osvers" title="The Linux operating system deployed on this node. Valid values: rhel*, centos*, fedora*, and sles* (where * is the version #)."/></div>');
|
||||
var profile = $('<div><label>Profile:</label><input type="text" name="profile" title="The node usage category"/></div>');
|
||||
var provisionMethod = $('<div><label>Provision method:</label></div>');
|
||||
var provisionSelect = $('<select name="provmethod">'
|
||||
var provisionSelect = $('<select name="provmethod" title="The provisioning method for node deployment">'
|
||||
+ '<option value=""></option>'
|
||||
+ '<option value="install">install</option>'
|
||||
+ '<option value="netboot">netboot</option>'
|
||||
+ '<option value="statelite">statelite</option>'
|
||||
+ '</select>');
|
||||
provisionMethod.append(provisionSelect);
|
||||
var comments = $('<div><label>Description:</label><input type="text" name="comments"/></div>');
|
||||
var comments = $('<div><label>Description:</label><input type="text" name="comments" title="Any user-written notes"/></div>');
|
||||
imageForm.append(imageName, selectable, imageType, architecture, osName, osVersion, profile, provisionMethod, comments);
|
||||
|
||||
// Fill in image attributes
|
||||
@@ -504,6 +532,27 @@ function editImageDialog(iName, iSelectable, iOsVersion, iOsArch, iOsName, iType
|
||||
if (iSelectable == "yes")
|
||||
imageForm.find('input[name="selectable"]').attr('checked', 'checked');
|
||||
|
||||
// Generate tooltips
|
||||
imageForm.find('div input[title],textarea[title],select[title]').tooltip({
|
||||
position: "center right",
|
||||
offset: [-2, 10],
|
||||
effect: "toggle",
|
||||
opacity: 0.8,
|
||||
delay: 0,
|
||||
predelay: 800,
|
||||
events: {
|
||||
def: "mouseover,mouseout",
|
||||
input: "mouseover,mouseout",
|
||||
widget: "focus mouseover,blur mouseout",
|
||||
tooltip: "mouseover,mouseout"
|
||||
},
|
||||
|
||||
// Change z index to show tooltip in front
|
||||
onBeforeShow: function() {
|
||||
this.getTip().css('z-index', $.topZIndex());
|
||||
}
|
||||
});
|
||||
|
||||
// Open dialog to add image
|
||||
imageForm.dialog({
|
||||
title:'Edit image',
|
||||
@@ -682,7 +731,7 @@ function configGroupPanel(data) {
|
||||
// Create table
|
||||
var tableId = panelId + 'Datatable';
|
||||
var table = new DataTable(tableId);
|
||||
table.init(['<input type="checkbox" onclick="selectAllCheckbox(event, $(this))">', 'Name', 'Selectable', 'IP', 'Hostname', 'Network', 'Description']);
|
||||
table.init(['<input type="checkbox" onclick="selectAllCheckbox(event, $(this))">', 'Name', 'Selectable', 'IP', 'Hostname', 'Description']);
|
||||
|
||||
// Insert groups into table
|
||||
var nodePos = 0;
|
||||
@@ -738,12 +787,6 @@ function configGroupPanel(data) {
|
||||
desc = jQuery.trim(desc);
|
||||
}
|
||||
|
||||
// Save network
|
||||
if (tmp[j].indexOf('network:') > -1) {
|
||||
network = tmp[j].replace('network:', '');
|
||||
network = jQuery.trim(network);
|
||||
}
|
||||
|
||||
// Is the group selectable?
|
||||
if (tmp[j].indexOf('selectable:') > -1) {
|
||||
selectable = tmp[j].replace('selectable:', '');
|
||||
@@ -753,7 +796,7 @@ function configGroupPanel(data) {
|
||||
}
|
||||
|
||||
// Columns are: name, selectable, network, and description
|
||||
var cols = new Array(name, selectable, ip, hostname, network, desc);
|
||||
var cols = new Array(name, selectable, ip, hostname, desc);
|
||||
|
||||
// Add remove button where id = user name
|
||||
cols.unshift('<input type="checkbox" name="' + name + '"/>');
|
||||
@@ -802,10 +845,9 @@ function configGroupPanel(data) {
|
||||
var selectable = cols.eq(2).text();
|
||||
var ip = cols.eq(3).text();
|
||||
var hostnames = cols.eq(4).text();
|
||||
var network = cols.eq(5).text();
|
||||
var description = cols.eq(6).text();
|
||||
var description = cols.eq(5).text();
|
||||
|
||||
editGroupDialog(group, selectable, ip, hostnames, network, description);
|
||||
editGroupDialog(group, selectable, ip, hostnames, description);
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -860,13 +902,35 @@ function groupDialog() {
|
||||
var info = createInfoBar('Provide the following attributes for the group.');
|
||||
groupForm.append(info);
|
||||
|
||||
var group = $('<div><label>Group:</label><input type="text" name="group"/></div>');
|
||||
var selectable = $('<div><label>Selectable:</label><input type="checkbox" name="selectable"/></div>');
|
||||
var ip = $('<div><label>IP:</label><input type="text" name="ip"/></div>');
|
||||
var hostnames = $('<div><label>Hostnames:</label><input type="text" name="hostnames"/></div>');
|
||||
var network = $('<div><label>Network:</label><input type="text" name="network"/></div>');
|
||||
var comments = $('<div><label>Description:</label><input type="text" name="comments"/></div>');
|
||||
groupForm.append(group, selectable, ip, hostnames, network, comments);
|
||||
var group = $('<div><label>Group:</label><input type="text" name="group" title="The group name"/></div>');
|
||||
var selectable = $('<div><label>Selectable:</label><input type="checkbox" name="selectable" title="Select if you want this group to appear on the self service portal"/></div>');
|
||||
var ip = $('<div><label>IP:</label><input type="text" name="ip" title="The IP address of the nodes, usually given as a regular expression, e.g. |ihost(\d+)|10.1.1.($1+0)|"/></div>');
|
||||
var hostnames = $('<div><label>Hostnames:</label><input type="text" name="hostnames" title="The hostname of the nodes, usually given as a regular expression, e.g. |(.*)|($1).sourceforge.net|"/></div>');
|
||||
var comments = $('<div><label>Description:</label><input type="text" name="comments" title="A description of the group"/></div>');
|
||||
var ipPool = $('<div><label style="vertical-align: top;">IP pool:</label><textarea name="ip_pool" title="A pool of node names, IP addresses, and hostnames that can be chosen from for a newly provisioned virtual machine. An entry in the pool could be: ihost12,10.1.2.12,ihost12.endicott.ibm.com. A newline separates each entry."/></div>');
|
||||
|
||||
groupForm.append(group, selectable, ip, hostnames, comments, ipPool);
|
||||
|
||||
// Generate tooltips
|
||||
groupForm.find('div input[title],textarea[title],select[title]').tooltip({
|
||||
position: "center right",
|
||||
offset: [-2, 10],
|
||||
effect: "fade",
|
||||
opacity: 0.8,
|
||||
delay: 0,
|
||||
predelay: 800,
|
||||
events: {
|
||||
def: "mouseover,mouseout",
|
||||
input: "mouseover,mouseout",
|
||||
widget: "focus mouseover,blur mouseout",
|
||||
tooltip: "mouseover,mouseout"
|
||||
},
|
||||
|
||||
// Change z index to show tooltip in front
|
||||
onBeforeShow: function() {
|
||||
this.getTip().css('z-index', $.topZIndex());
|
||||
}
|
||||
});
|
||||
|
||||
// Open dialog to add image
|
||||
groupForm.dialog({
|
||||
@@ -875,7 +939,7 @@ function groupDialog() {
|
||||
close: function(){
|
||||
$(this).remove();
|
||||
},
|
||||
width: 400,
|
||||
width: 600,
|
||||
buttons: {
|
||||
"Ok": function() {
|
||||
// Remove any warning messages
|
||||
@@ -886,12 +950,12 @@ function groupDialog() {
|
||||
var selectable = $(this).find('input[name="selectable"]');
|
||||
var ip = $(this).find('input[name="ip"]');
|
||||
var hostnames = $(this).find('input[name="hostnames"]');
|
||||
var network = $(this).find('input[name="network"]');
|
||||
var comments = $(this).find('input[name="comments"]');
|
||||
var ipPool = $(this).find('textarea[name=ip_pool]').val();
|
||||
|
||||
// Check that group attributes are provided before continuing
|
||||
var ready = 1;
|
||||
var inputs = new Array(group, ip, hostnames, network);
|
||||
var inputs = new Array(group, ip, hostnames);
|
||||
for (var i in inputs) {
|
||||
if (!inputs[i].val()) {
|
||||
inputs[i].css('border-color', 'red');
|
||||
@@ -910,6 +974,10 @@ function groupDialog() {
|
||||
'Close': function() {$(this).dialog("close");}
|
||||
});
|
||||
|
||||
// A newline at the end of IP pool is needed
|
||||
ipPool = ipPool.replace(/^\s+|\s+$/g, '');
|
||||
ipPool += '\n';
|
||||
|
||||
// Set default description
|
||||
if (!comments.val())
|
||||
comments.val('No description');
|
||||
@@ -918,12 +986,12 @@ function groupDialog() {
|
||||
var args = "updategroup;" + group.val() + ";'" + ip.val() + "';'" + hostnames.val() + "';";
|
||||
|
||||
if (selectable.attr("checked"))
|
||||
args += "'description:" + comments.val() + "|network:" + network.val() + "|selectable:yes";
|
||||
args += "'description:" + comments.val() + "|selectable:yes";
|
||||
else
|
||||
args += "'description:" + comments.val() + "|network:" + network.val() + "|selectable:no";
|
||||
args += "'description:" + comments.val() + "|selectable:no";
|
||||
|
||||
// Add image to xCAT
|
||||
$.ajax( {
|
||||
$.ajax({
|
||||
url : 'lib/cmd.php',
|
||||
dataType : 'json',
|
||||
data : {
|
||||
@@ -935,6 +1003,37 @@ function groupDialog() {
|
||||
|
||||
success : updatePanel
|
||||
});
|
||||
|
||||
// Write IP pool file to /var/tmp
|
||||
$.ajax({
|
||||
url : 'lib/cmd.php',
|
||||
dataType : 'json',
|
||||
data : {
|
||||
cmd : 'write',
|
||||
tgt : '/var/tmp/' + group.val() + '.pool',
|
||||
args : '',
|
||||
cont : ipPool,
|
||||
msg : dialogId + ';' + group.val()
|
||||
},
|
||||
|
||||
success : function(data) {
|
||||
var args = data.msg.split(';');
|
||||
|
||||
// Create profile in xCAT
|
||||
$.ajax({
|
||||
url : 'lib/cmd.php',
|
||||
dataType : 'json',
|
||||
data : {
|
||||
cmd : 'webrun',
|
||||
tgt : '',
|
||||
args : 'mkippool;' + args[1],
|
||||
msg : args[0]
|
||||
},
|
||||
|
||||
success: updatePanel
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
"Cancel": function() {
|
||||
@@ -951,35 +1050,72 @@ function groupDialog() {
|
||||
* @param iSelectable Is group selectable from the service page
|
||||
* @param iIp Group IP regex
|
||||
* @param iHostnames Group hostnames regex
|
||||
* @param iNetwork Group network, e.g. 10.1.2.0/24
|
||||
* @param iComments Group description
|
||||
*/
|
||||
function editGroupDialog(iGroup, iSelectable, iIp, iHostnames, iNetwork, iComments) {
|
||||
function editGroupDialog(iGroup, iSelectable, iIp, iHostnames, iComments) {
|
||||
// Create form to add profile
|
||||
var dialogId = 'createGroup';
|
||||
var dialogId = 'createGroup-' + iGroup;
|
||||
var groupForm = $('<div id="' + dialogId + '" class="form"></div>');
|
||||
|
||||
// Create info bar
|
||||
var info = createInfoBar('Provide the following attributes for the group.');
|
||||
groupForm.append(info);
|
||||
|
||||
var group = $('<div><label>Group:</label><input type="text" name="group"/></div>');
|
||||
var selectable = $('<div><label>Selectable:</label><input type="checkbox" name="selectable"/></div>');
|
||||
var ip = $('<div><label>IP:</label><input type="text" name="ip"/></div>');
|
||||
var hostnames = $('<div><label>Hostnames:</label><input type="text" name="hostnames"/></div>');
|
||||
var network = $('<div><label>Network:</label><input type="text" name="network"/></div>');
|
||||
var comments = $('<div><label>Description:</label><input type="text" name="comments"/></div>');
|
||||
groupForm.append(group, selectable, ip, hostnames, network, comments);
|
||||
var group = $('<div><label>Group:</label><input type="text" name="group" title="The group name"/></div>');
|
||||
var selectable = $('<div><label>Selectable:</label><input type="checkbox" name="selectable" title="Select if you want this group to appear on the self service portal"/></div>');
|
||||
var ip = $('<div><label>IP:</label><input type="text" name="ip" title="The IP address for the group, usually given as a regular expression, e.g. |ihost(\d+)|10.1.1.($1+0)|"/></div>');
|
||||
var hostnames = $('<div><label>Hostnames:</label><input type="text" name="hostnames" title="The hostname for the group, usually given as a regular expression, e.g. |(.*)|($1).sourceforge.net|"/></div>');
|
||||
var comments = $('<div><label>Description:</label><input type="text" name="comments" title="A description of the group"/></div>');
|
||||
var ipPool = $('<div><label style="vertical-align: top;">IP pool:</label><textarea name="ip_pool" title="A pool of node names, IP addresses, and hostnames that can be chosen from for a newly provisioned virtual machine."/></div>');
|
||||
|
||||
groupForm.append(group, selectable, ip, hostnames, comments, ipPool);
|
||||
|
||||
// Query IP pool based on group name
|
||||
$.ajax({
|
||||
url : 'lib/cmd.php',
|
||||
dataType : 'json',
|
||||
data : {
|
||||
cmd : 'webrun',
|
||||
tgt : '',
|
||||
args : 'lsippool;' + iGroup,
|
||||
msg : dialogId
|
||||
},
|
||||
|
||||
success : function(data) {
|
||||
// Populate textarea with IP pool entries
|
||||
$('#' + data.msg).find('textarea[name="ip_pool"]').val(data.rsp[0]);
|
||||
}
|
||||
});
|
||||
|
||||
// Fill in group attributes
|
||||
groupForm.find('input[name="group"]').val(iGroup);
|
||||
groupForm.find('input[name="ip"]').val(iIp);
|
||||
groupForm.find('input[name="hostnames"]').val(iHostnames);
|
||||
groupForm.find('input[name="network"]').val(iNetwork);
|
||||
groupForm.find('input[name="comments"]').val(iComments);
|
||||
if (iSelectable == "yes")
|
||||
groupForm.find('input[name="selectable"]').attr('checked', 'checked');
|
||||
|
||||
// Generate tooltips
|
||||
groupForm.find('div input[title],textarea[title],select[title]').tooltip({
|
||||
position: "center right",
|
||||
offset: [-2, 10],
|
||||
effect: "toggle",
|
||||
opacity: 0.8,
|
||||
delay: 0,
|
||||
predelay: 800,
|
||||
events: {
|
||||
def: "mouseover,mouseout",
|
||||
input: "mouseover,mouseout",
|
||||
widget: "focus mouseover,blur mouseout",
|
||||
tooltip: "mouseover,mouseout"
|
||||
},
|
||||
|
||||
// Change z index to show tooltip in front
|
||||
onBeforeShow: function() {
|
||||
this.getTip().css('z-index', $.topZIndex());
|
||||
}
|
||||
});
|
||||
|
||||
// Open dialog to add image
|
||||
groupForm.dialog({
|
||||
title:'Edit group',
|
||||
@@ -987,7 +1123,7 @@ function editGroupDialog(iGroup, iSelectable, iIp, iHostnames, iNetwork, iCommen
|
||||
close: function(){
|
||||
$(this).remove();
|
||||
},
|
||||
width: 400,
|
||||
width: 600,
|
||||
buttons: {
|
||||
"Ok": function() {
|
||||
// Remove any warning messages
|
||||
@@ -998,12 +1134,12 @@ function editGroupDialog(iGroup, iSelectable, iIp, iHostnames, iNetwork, iCommen
|
||||
var selectable = $(this).find('input[name="selectable"]');
|
||||
var ip = $(this).find('input[name="ip"]');
|
||||
var hostnames = $(this).find('input[name="hostnames"]');
|
||||
var network = $(this).find('input[name="network"]');
|
||||
var comments = $(this).find('input[name="comments"]');
|
||||
var ipPool = $(this).find('textarea[name=ip_pool]').val();
|
||||
|
||||
// Check that group attributes are provided before continuing
|
||||
var ready = 1;
|
||||
var inputs = new Array(group, ip, hostnames, network);
|
||||
var inputs = new Array(group, ip, hostnames);
|
||||
for (var i in inputs) {
|
||||
if (!inputs[i].val()) {
|
||||
inputs[i].css('border-color', 'red');
|
||||
@@ -1022,6 +1158,10 @@ function editGroupDialog(iGroup, iSelectable, iIp, iHostnames, iNetwork, iCommen
|
||||
'Close': function() {$(this).dialog("close");}
|
||||
});
|
||||
|
||||
// A newline at the end of IP pool is needed
|
||||
ipPool = ipPool.replace(/^\s+|\s+$/g, '');
|
||||
ipPool += '\n';
|
||||
|
||||
// Set default description
|
||||
if (!comments.val())
|
||||
comments.val('No description');
|
||||
@@ -1030,9 +1170,9 @@ function editGroupDialog(iGroup, iSelectable, iIp, iHostnames, iNetwork, iCommen
|
||||
var args = "updategroup;" + group.val() + ";'" + ip.val() + "';'" + hostnames.val() + "';";
|
||||
|
||||
if (selectable.attr("checked"))
|
||||
args += "'description:" + comments.val() + "|network:" + network.val() + "|selectable:yes";
|
||||
args += "'description:" + comments.val() + "|selectable:yes";
|
||||
else
|
||||
args += "'description:" + comments.val() + "|network:" + network.val() + "|selectable:no";
|
||||
args += "'description:" + comments.val() + "|selectable:no";
|
||||
|
||||
// Add image to xCAT
|
||||
$.ajax( {
|
||||
@@ -1047,6 +1187,37 @@ function editGroupDialog(iGroup, iSelectable, iIp, iHostnames, iNetwork, iCommen
|
||||
|
||||
success : updatePanel
|
||||
});
|
||||
|
||||
// Write IP pool file to /var/tmp
|
||||
$.ajax({
|
||||
url : 'lib/cmd.php',
|
||||
dataType : 'json',
|
||||
data : {
|
||||
cmd : 'write',
|
||||
tgt : '/var/tmp/' + group.val() + '.pool',
|
||||
args : '',
|
||||
cont : ipPool,
|
||||
msg : dialogId + ';' + group.val()
|
||||
},
|
||||
|
||||
success : function(data) {
|
||||
var args = data.msg.split(';');
|
||||
|
||||
// Create profile in xCAT
|
||||
$.ajax({
|
||||
url : 'lib/cmd.php',
|
||||
dataType : 'json',
|
||||
data : {
|
||||
cmd : 'webrun',
|
||||
tgt : '',
|
||||
args : 'mkippool;' + args[1],
|
||||
msg : args[0]
|
||||
},
|
||||
|
||||
success: updatePanel
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
"Cancel": function() {
|
||||
|
||||
@@ -224,15 +224,15 @@ function openCreateUserDialog(data) {
|
||||
|
||||
createUserForm.append(info, userFS, optionFS);
|
||||
|
||||
userAttr.append($('<div><label>Priority:</label><input type="text" name="priority" disabled="disabled" value="' + priority + '"/></div>'));
|
||||
userAttr.append($('<div><label>User name:</label><input type="text" name="name"/></div>'));
|
||||
userAttr.append($('<div><label>Password:</label><input name="password" type="password"></div>'));
|
||||
userAttr.append($('<div><label>Confirm password:</label><input name="confirm_password" type="password"></div>'));
|
||||
optionAttr.append($('<div><label>Host:</label><input type="text" name="host"/></div>'));
|
||||
optionAttr.append($('<div><label>Commands:</label><input type="text" name="commands"/></div>'));
|
||||
optionAttr.append($('<div><label>Parameters:</label><input type="text" name="parameters"/></div>'));
|
||||
optionAttr.append($('<div><label>Node Range:</label><input type="text" name="nodeRange"/></div>'));
|
||||
optionAttr.append($('<div><label>Rule:</label><select name="rule">' +
|
||||
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>'));
|
||||
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>'));
|
||||
optionAttr.append($('<div><label>Node Range:</label><input type="text" name="nodeRange" title="The node range that this rule applies to. By default, it is all nodes."/></div>'));
|
||||
optionAttr.append($('<div><label>Rule:</label><select name="rule" title="Specifies how this rule should be applied. Valid values are: allow, accept, trusted, and deny.">' +
|
||||
'<option value="allow">Allow</option>' +
|
||||
'<option value="accept">Accept</option>' +
|
||||
'<option value="trusted">Trusted</option>' +
|
||||
@@ -243,12 +243,33 @@ function openCreateUserDialog(data) {
|
||||
optionAttr.append(rootPrivilege);
|
||||
rootPrivilege.append(accessCheckbox);
|
||||
|
||||
optionAttr.append($('<div><label>Comments:</label><input type="text" name="comments" style="width: 250px;"/></div>'));
|
||||
optionAttr.append($('<div><label>Disable:</label><select name="disable">' +
|
||||
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">' +
|
||||
'<option value="">No</option>' +
|
||||
'<option value="yes">Yes</option>' +
|
||||
'</select></div>'));
|
||||
|
||||
// Generate tooltips
|
||||
createUserForm.find('div input[title],select[title]').tooltip({
|
||||
position: "center right",
|
||||
offset: [-2, 10],
|
||||
effect: "fade",
|
||||
opacity: 0.8,
|
||||
delay: 0,
|
||||
predelay: 800,
|
||||
events: {
|
||||
def: "mouseover,mouseout",
|
||||
input: "mouseover,mouseout",
|
||||
widget: "focus mouseover,blur mouseout",
|
||||
tooltip: "mouseover,mouseout"
|
||||
},
|
||||
|
||||
// Change z index to show tooltip in front
|
||||
onBeforeShow: function() {
|
||||
this.getTip().css('z-index', $.topZIndex());
|
||||
}
|
||||
});
|
||||
|
||||
// Open dialog to add disk
|
||||
createUserForm.dialog({
|
||||
title:'Configure user',
|
||||
@@ -323,7 +344,7 @@ function openCreateUserDialog(data) {
|
||||
data : {
|
||||
cmd : 'webrun',
|
||||
tgt : '',
|
||||
args : 'policy|' + priority + '|' + args,
|
||||
args : 'policy||' + priority + '||' + args,
|
||||
msg : dialogId
|
||||
},
|
||||
|
||||
@@ -337,7 +358,7 @@ function openCreateUserDialog(data) {
|
||||
data : {
|
||||
cmd : 'webrun',
|
||||
tgt : '',
|
||||
args : 'passwd|' + usrName + '|' + password,
|
||||
args : 'passwd||' + usrName + '||' + password,
|
||||
msg : dialogId
|
||||
},
|
||||
|
||||
@@ -455,7 +476,7 @@ function openDeleteUserDialog(users) {
|
||||
data : {
|
||||
cmd : 'webrun',
|
||||
tgt : '',
|
||||
args : 'deleteuser|' + users,
|
||||
args : 'deleteuser||' + users,
|
||||
msg : dialogId
|
||||
},
|
||||
success : updatePanel
|
||||
|
||||
@@ -70,6 +70,15 @@ esxPlugin.prototype.loadConfigPage = function(tabId) {
|
||||
profileLnk.trigger('click');
|
||||
};
|
||||
|
||||
/**
|
||||
* Migrate node
|
||||
*
|
||||
* @param node Node to migrate
|
||||
*/
|
||||
esxPlugin.prototype.loadMigratePage = function(node) {
|
||||
openDialog('info', 'Not yet supported');
|
||||
};
|
||||
|
||||
/**
|
||||
* Clone node (service page)
|
||||
*
|
||||
|
||||
@@ -68,6 +68,15 @@ kvmPlugin.prototype.loadConfigPage = function(tabId) {
|
||||
profileLnk.trigger('click');
|
||||
};
|
||||
|
||||
/**
|
||||
* Migrate node
|
||||
*
|
||||
* @param node Node to migrate
|
||||
*/
|
||||
kvmPlugin.prototype.loadMigratePage = function(node) {
|
||||
openDialog('info', 'Not yet supported');
|
||||
};
|
||||
|
||||
/**
|
||||
* Clone node (service page)
|
||||
*
|
||||
|
||||
+85
-39
@@ -33,7 +33,7 @@ zvmPlugin.prototype.loadConfigPage = function(tabId) {
|
||||
|
||||
// Create accordion panel for images
|
||||
var imgSection = $('<div id="zvmConfigImages"></div>');
|
||||
var imgLnk = $('<h3><a href="#">Images</a></h3>').click(function () {
|
||||
var imgLnk = $('<h3><a href="#">Templates</a></h3>').click(function () {
|
||||
// Do not load panel again if it is already loaded
|
||||
if ($('#zvmConfigImages').find('.dataTables_wrapper').length)
|
||||
return;
|
||||
@@ -67,7 +67,7 @@ zvmPlugin.prototype.loadConfigPage = function(tabId) {
|
||||
*
|
||||
* @param node Node to clone
|
||||
*/
|
||||
zvmPlugin.prototype.serviceClone = function(node) {
|
||||
zvmPlugin.prototype.serviceClone = function(node) {
|
||||
var owner = $.cookie('xcat_username');
|
||||
var group = getUserNodeAttr(node, 'groups');
|
||||
|
||||
@@ -95,7 +95,7 @@ zvmPlugin.prototype.loadServiceProvisionPage = function(tabId) {
|
||||
|
||||
// Create provision table
|
||||
var provTable = $('<table id="select-table" style="margin: 10px;"></table');
|
||||
var provHeader = $('<thead class="ui-widget-header"> <th>zVM</th> <th>Group</th> <th>Image</th></thead>');
|
||||
var provHeader = $('<thead class="ui-widget-header"> <th>zVM</th> <th>Group</th> <th>Template</th> <th>Image</th></thead>');
|
||||
var provBody = $('<tbody></tbody>');
|
||||
var provFooter = $('<tfoot></tfoot>');
|
||||
provTable.append(provHeader, provBody, provFooter);
|
||||
@@ -108,16 +108,18 @@ zvmPlugin.prototype.loadServiceProvisionPage = function(tabId) {
|
||||
// Create row to contain selections
|
||||
var provRow = $('<tr></tr>');
|
||||
provBody.append(provRow);
|
||||
// Create columns for zVM, group, and image
|
||||
// Create columns for zVM, group, template, and image
|
||||
var zvmCol = $('<td style="vertical-align: top;"></td>');
|
||||
provRow.append(zvmCol);
|
||||
var groupCol = $('<td style="vertical-align: top;"></td>');
|
||||
provRow.append(groupCol);
|
||||
var imageCol = $('<td style="vertical-align: top;"></td>');
|
||||
provRow.append(imageCol);
|
||||
var tmplCol = $('<td style="vertical-align: top;"></td>');
|
||||
provRow.append(tmplCol);
|
||||
var imgCol = $('<td style="vertical-align: top;"></td>');
|
||||
provRow.append(imgCol);
|
||||
|
||||
provRow.children('td').css({
|
||||
'min-width': '250px'
|
||||
'min-width': '200px'
|
||||
});
|
||||
|
||||
/**
|
||||
@@ -130,26 +132,41 @@ zvmPlugin.prototype.loadServiceProvisionPage = function(tabId) {
|
||||
|
||||
var hcp = $('#select-table tbody tr:eq(0) td:eq(0) input[name="hcp"]:checked').val();
|
||||
var group = $('#select-table tbody tr:eq(0) td:eq(1) input[name="group"]:checked').val();
|
||||
var img = $('#select-table tbody tr:eq(0) td:eq(2) input[name="image"]:checked').val();
|
||||
var tmpl = $('#select-table tbody tr:eq(0) td:eq(2) input[name="image"]:checked').val();
|
||||
var img = $('#select-table tbody tr:eq(0) td:eq(3) input[name="master"]:checked').val();
|
||||
var owner = $.cookie('xcat_username');
|
||||
|
||||
if (!hcp || !group || !img) {
|
||||
if (img && !group) {
|
||||
// Show warning message
|
||||
var warn = createWarnBar('You need to select a group');
|
||||
warn.prependTo($(this).parent());
|
||||
} else if (!img && (!hcp || !group || !tmpl)) {
|
||||
// Show warning message
|
||||
var warn = createWarnBar('You need to select an option for each column');
|
||||
var warn = createWarnBar('You need to select a zHCP, group, and image');
|
||||
warn.prependTo($(this).parent());
|
||||
} else {
|
||||
// Begin by creating VM
|
||||
createzVM(tabId, group, hcp, img, owner);
|
||||
if (img) {
|
||||
// Begin by clonning VM
|
||||
|
||||
// Submit request to clone VM
|
||||
// webportal clonezlinux [src node] [group] [owner]
|
||||
var iframe = createIFrame('lib/srv_cmd.php?cmd=webportal&tgt=&args=clonezlinux;' + img + ';' + group + ';' + owner + '&msg=&opts=flush');
|
||||
iframe.prependTo($('#zvmProvisionTab'));
|
||||
} else {
|
||||
// Begin by creating VM
|
||||
createzVM(tabId, group, hcp, tmpl, owner);
|
||||
}
|
||||
}
|
||||
});
|
||||
provForm.append(provisionBtn);
|
||||
|
||||
// Load zVMs, groups, and images into their respective columns
|
||||
// Load zVMs, groups, template, and image into their respective columns
|
||||
loadSrvGroups(groupCol);
|
||||
loadOSImages(imageCol);
|
||||
loadOSImages(tmplCol);
|
||||
loadGoldenImages(imgCol);
|
||||
|
||||
// Get zVM host names
|
||||
if (!$.cookie('zvm')){
|
||||
if (!$.cookie('zvms')){
|
||||
$.ajax( {
|
||||
url : 'lib/srv_cmd.php',
|
||||
dataType : 'json',
|
||||
@@ -516,8 +533,8 @@ zvmPlugin.prototype.loadServiceInventory = function(data) {
|
||||
var nicVDev, nicType, nicPortName, nicNumOfDevs, nicLanName;
|
||||
|
||||
// Loop through each NIC (Data contained in 2 lines)
|
||||
for (l = 0; l < attrs[keys[k]].length; l = l + 2) {
|
||||
if (attrs[keys[k]][l]) {
|
||||
for (l = 0; l < attrs[keys[k]].length; l++) {
|
||||
if (attrs[keys[k]][l].indexOf('Adapter') != -1) {
|
||||
args = attrs[keys[k]][l].split(' ');
|
||||
|
||||
// Get NIC virtual device, type, port name, and number of devices
|
||||
@@ -953,6 +970,8 @@ zvmPlugin.prototype.loadInventory = function(data) {
|
||||
var tabId = args[0].replace('out=', '');
|
||||
// Get node
|
||||
var node = args[1].replace('node=', '');
|
||||
// Clear any existing cookie
|
||||
$.cookie(node + 'processes', null);
|
||||
|
||||
// Remove loader
|
||||
$('#' + tabId).find('img').remove();
|
||||
@@ -1528,8 +1547,8 @@ zvmPlugin.prototype.loadInventory = function(data) {
|
||||
var nicVDev, nicType, nicPortName, nicNumOfDevs, nicLanName;
|
||||
|
||||
// Loop through each NIC (Data contained in 2 lines)
|
||||
for (l = 0; l < attrs[keys[k]].length; l = l + 2) {
|
||||
if (attrs[keys[k]][l]) {
|
||||
for (l = 0; l < attrs[keys[k]].length; l++) {
|
||||
if (attrs[keys[k]][l].indexOf('Adapter') != -1) {
|
||||
args = attrs[keys[k]][l].split(' ');
|
||||
|
||||
// Get NIC virtual device, type, port name, and number of devices
|
||||
@@ -1864,20 +1883,20 @@ zvmPlugin.prototype.addNode = function() {
|
||||
// Create provision type drop down
|
||||
var type = $('<div></div>');
|
||||
var typeLabel = $('<label>Type:</label>');
|
||||
var typeSelect = $('<select type="text" name="type"></select>');
|
||||
var typeSelect = $('<select type="text" name="type" title="The type of node"></select>');
|
||||
typeSelect.append('<option value="vm" selected="selected">VM</option>');
|
||||
typeSelect.append('<option value="host">Host</option>');
|
||||
type.append(typeLabel);
|
||||
type.append(typeSelect);
|
||||
addNodeForm.append(type);
|
||||
|
||||
addNodeForm.append('<div><label>Node range *:</label><input type="text" name="node"/></div>');
|
||||
addNodeForm.append('<div><label>User ID range *:</label><input type="text" name="userId"/></div>');
|
||||
addNodeForm.append('<div><label>zHCP *:</label><input type="text" name="hcp"/></div>');
|
||||
addNodeForm.append('<div><label>Groups *:</label><input type="text" name="groups"/></div>');
|
||||
addNodeForm.append('<div><label>Operating system *:</label><input type="text" name="os"/></div>');
|
||||
addNodeForm.append('<div><label>IP address range:</label><input name="ip" type="text"></div>');
|
||||
addNodeForm.append('<div><label>Hostname range:</label><input name="hostname" type="text"></div>');
|
||||
addNodeForm.append('<div><label>Node range *:</label><input type="text" name="node" title="The node or node range to add into xCAT. A node range must be given as: node1-node9 or node[1-9]."/></div>');
|
||||
addNodeForm.append('<div><label>User ID range *:</label><input type="text" name="userId" title="The user ID or a user ID range. A user ID range must be given as: user1-user9 or user[1-9]."/></div>');
|
||||
addNodeForm.append('<div><label>zHCP *:</label><input type="text" name="hcp" title="The System z hardware control point (zHCP) responsible for managing the node(s)"/></div>');
|
||||
addNodeForm.append('<div><label>Groups *:</label><input type="text" name="groups" title="The group where the new node(s) will be placed under"/></div>');
|
||||
addNodeForm.append('<div><label>Operating system *:</label><input type="text" name="os" title="The z/VM operating system version, e.g. zvm6.1."/></div>');
|
||||
addNodeForm.append('<div><label>IP address range:</label><input name="ip" type="text" title="The IP address range for the node(s). An IP address range must be given in the following format: 192.168.0.1-192.168.9."></div>');
|
||||
addNodeForm.append('<div><label>Hostname range:</label><input name="hostname" type="text" title="The hostname range for the node(s). A hostname range must be given in the following format: ihost1.sourceforge.net-ihost9.sourceforge.net."></div>');
|
||||
addNodeForm.append('<div><label>* required</label></div>');
|
||||
|
||||
// OS field only required for hosts
|
||||
@@ -1895,6 +1914,27 @@ zvmPlugin.prototype.addNode = function() {
|
||||
}
|
||||
});
|
||||
|
||||
// Generate tooltips
|
||||
addNodeForm.find('div input[title],select[title]').tooltip({
|
||||
position: "center right",
|
||||
offset: [-2, 10],
|
||||
effect: "fade",
|
||||
opacity: 0.8,
|
||||
delay: 0,
|
||||
predelay: 800,
|
||||
events: {
|
||||
def: "mouseover,mouseout",
|
||||
input: "mouseover,mouseout",
|
||||
widget: "focus mouseover,blur mouseout",
|
||||
tooltip: "mouseover,mouseout"
|
||||
},
|
||||
|
||||
// Change z index to show tooltip in front
|
||||
onBeforeShow: function() {
|
||||
this.getTip().css('z-index', $.topZIndex());
|
||||
}
|
||||
});
|
||||
|
||||
// Open form as a dialog
|
||||
addNodeForm.dialog({
|
||||
title: 'Add node',
|
||||
@@ -2211,7 +2251,7 @@ zvmPlugin.prototype.loadMigratePage = function(tgtNode) {
|
||||
var hcp = new Object();
|
||||
|
||||
// Create a drop-down for z/VM destinations
|
||||
var destSelect = $('<select name="dest"></select>')
|
||||
var destSelect = $('<select name="dest" title="The z/VM SSI cluster name of the destination system to which the specified virtual machine will be relocated."></select>')
|
||||
destSelect.append($('<option></option>'));
|
||||
for (var i in hosts) {
|
||||
args = hosts[i].split(':');
|
||||
@@ -2279,7 +2319,12 @@ zvmPlugin.prototype.loadMigratePage = function(tgtNode) {
|
||||
vmAttr.append(dest);
|
||||
|
||||
// Action Parameter
|
||||
var actionparam = $('<div><label>Action:</label><select name="action"><option value=""></option><option value="MOVE">Move</option><option value="TEST">Test</option><option value="CANCEL">Cancel</option></select></div>');
|
||||
var actionparam = $('<div><label>Action:</label><select name="action" title="Initiate a VMRELOCATE of the virtual machine. Test the specified virtual machine and determine if it is eligible to be relocated. Stop the relocation of the specified virtual machine.">' +
|
||||
'<option value=""></option>' +
|
||||
'<option value="MOVE">Move</option>' +
|
||||
'<option value="TEST">Test</option>' +
|
||||
'<option value="CANCEL">Cancel</option>' +
|
||||
'</select></div>');
|
||||
vmAttr.append(actionparam);
|
||||
|
||||
// Parameters label
|
||||
@@ -2291,7 +2336,10 @@ zvmPlugin.prototype.loadMigratePage = function(tgtNode) {
|
||||
optionalFS.append(optAttr);
|
||||
|
||||
// Immediate Parameter
|
||||
var immediateparam = $('<div><label>Immediate:</label><select name="immediate"><option value="NO">No (default)</option><option value="YES">Yes</option></select></div>');
|
||||
var immediateparam = $('<div><label>Immediate:</label><select name="immediate" title="Select No to specify immediate processing (default). Select Yes to specify the VMRELOCATE command will do one early pass through virtual machine storage and then go directly to the quiesce stage. The defaults for both max_total and max_quiesce are NOLIMIT when immediate=YES is specified.">' +
|
||||
'<option value="NO">No (default)</option>' +
|
||||
'<option value="YES">Yes</option>' +
|
||||
'</select></div>');
|
||||
optAttr.append(immediateparam);
|
||||
immediateparam.change(function() {
|
||||
if ($('#' + newTabId + ' select[name=immediate]').val() == 'yes') {
|
||||
@@ -2314,7 +2362,7 @@ zvmPlugin.prototype.loadMigratePage = function(tgtNode) {
|
||||
optAttr.append(forceParam);
|
||||
|
||||
// Generate tooltips
|
||||
migrateForm.find('div input[title]').tooltip({
|
||||
migrateForm.find('div input[title],select[title]').tooltip({
|
||||
position: "center right",
|
||||
offset: [-2, 10],
|
||||
effect: "fade",
|
||||
@@ -2394,18 +2442,16 @@ zvmPlugin.prototype.loadMigratePage = function(tgtNode) {
|
||||
if (maxQuiesce.val() <= 0) {
|
||||
args = args + "max_quiesce=NOLIMIT;";
|
||||
} else {
|
||||
args = args + "'max_quiesce=" + maxQuiesce.val() + "';";
|
||||
args = args + "max_quiesce=" + maxQuiesce.val() + ";";
|
||||
}
|
||||
|
||||
// Append force argument
|
||||
if ($("input[name=force]:checked").length > 0) {
|
||||
args = args + "'force="
|
||||
$("input[name=force]:checked").each(function() {
|
||||
args = args + $(this).val() + ' ';
|
||||
args += $(this).val() + ' ';
|
||||
});
|
||||
args = args + "';";
|
||||
} else {
|
||||
args = args + ";";
|
||||
args += "';";
|
||||
}
|
||||
|
||||
var statBarId = 'migrateStatusBar' + inst;
|
||||
@@ -2528,7 +2574,7 @@ zvmPlugin.prototype.loadLogPage = function(node) {
|
||||
setChkBox.append('Set options');
|
||||
|
||||
// Create log options input
|
||||
var logOpt = $('<li><label>Log options:</label><input type="text" name="logOpt"/></li>');
|
||||
var logOpt = $('<li><label style="width: 80px; vertical-align: top;">Log options:</label><textarea name="logOpt"></textarea></li>');
|
||||
logOpt.hide();
|
||||
optsList.append(logOpt);
|
||||
|
||||
@@ -2541,7 +2587,7 @@ zvmPlugin.prototype.loadLogPage = function(node) {
|
||||
tgtLog.toggle();
|
||||
});
|
||||
|
||||
setChkBox.bind('click', function(event) {
|
||||
setChkBox.find('input').bind('click', function(event) {
|
||||
logOpt.toggle();
|
||||
});
|
||||
|
||||
@@ -2608,7 +2654,7 @@ zvmPlugin.prototype.loadLogPage = function(node) {
|
||||
// If it is set options
|
||||
if (opt == 'o') {
|
||||
// Append options
|
||||
optStr += ';' + $('#' + newTabId + ' input[name=logOpt]').val();
|
||||
optStr += ';' + $('#' + newTabId + ' textarea[name=logOpt]').val();
|
||||
}
|
||||
|
||||
// Append ; to end of string
|
||||
|
||||
+1355
-628
File diff suppressed because it is too large
Load Diff
+95
-104
@@ -418,24 +418,24 @@ function mkAddNodeLink() {
|
||||
|
||||
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.addNode();
|
||||
@@ -686,24 +686,15 @@ function loadNodes(data) {
|
||||
// Create an instance of the plugin
|
||||
var plugin;
|
||||
switch(mgt) {
|
||||
case "blade":
|
||||
plugin = new bladePlugin();
|
||||
break;
|
||||
case "fsp":
|
||||
plugin = new fspPlugin();
|
||||
break;
|
||||
case "hmc":
|
||||
plugin = new hmcPlugin();
|
||||
break;
|
||||
case "ipmi":
|
||||
plugin = new ipmiPlugin();
|
||||
break;
|
||||
case "ivm":
|
||||
plugin = new ivmPlugin();
|
||||
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]);
|
||||
@@ -741,34 +732,35 @@ function loadNodes(data) {
|
||||
var migrateLnk = $('<a>Migrate</a>');
|
||||
migrateLnk.click(function() {
|
||||
var tgtNodes = getNodesChecked(nodesTableId).split(',');
|
||||
var mgt = "", tmp = "";
|
||||
for (var i in tgtNodes) {
|
||||
var mgt = getNodeAttr(tgtNodes[i], 'mgt');
|
||||
|
||||
// Create an instance of the plugin
|
||||
var plugin;
|
||||
switch(mgt) {
|
||||
case "blade":
|
||||
plugin = new bladePlugin();
|
||||
break;
|
||||
case "fsp":
|
||||
plugin = new fspPlugin();
|
||||
break;
|
||||
case "hmc":
|
||||
plugin = new hmcPlugin();
|
||||
break;
|
||||
case "ipmi":
|
||||
plugin = new ipmiPlugin();
|
||||
break;
|
||||
case "ivm":
|
||||
plugin = new ivmPlugin();
|
||||
break;
|
||||
case "zvm":
|
||||
plugin = new zvmPlugin();
|
||||
break;
|
||||
tmp = getNodeAttr(tgtNodes[i], 'mgt');
|
||||
if (!mgt) {
|
||||
mgt = tmp
|
||||
} else {
|
||||
if (tmp != mgt) {
|
||||
openDialog('warn', "You can pick only one type (mgt) of node to migrate!");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
plugin.loadMigratePage(tgtNodes[i]);
|
||||
}
|
||||
|
||||
// Create an instance of the plugin
|
||||
var plugin;
|
||||
switch(mgt) {
|
||||
// Only hypervisors support migration
|
||||
case "kvm":
|
||||
plugin = new kvmPlugin();
|
||||
break;
|
||||
case "esx":
|
||||
plugin = new esxPlugin();
|
||||
break;
|
||||
case "zvm":
|
||||
plugin = new zvmPlugin();
|
||||
break;
|
||||
}
|
||||
|
||||
plugin.loadMigratePage(tgtNodes);
|
||||
});
|
||||
|
||||
// Update
|
||||
@@ -854,24 +846,24 @@ function loadNodes(data) {
|
||||
// Create an instance of the plugin
|
||||
var plugin;
|
||||
switch(mgt) {
|
||||
case "blade":
|
||||
plugin = new bladePlugin();
|
||||
break;
|
||||
case "fsp":
|
||||
plugin = new fspPlugin();
|
||||
break;
|
||||
case "hmc":
|
||||
plugin = new hmcPlugin();
|
||||
break;
|
||||
case "ipmi":
|
||||
plugin = new ipmiPlugin();
|
||||
break;
|
||||
case "ivm":
|
||||
plugin = new ivmPlugin();
|
||||
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]);
|
||||
@@ -1635,24 +1627,24 @@ function loadNode(e) {
|
||||
// Create an instance of the plugin
|
||||
var plugin;
|
||||
switch(mgt) {
|
||||
case "blade":
|
||||
plugin = new bladePlugin();
|
||||
break;
|
||||
case "fsp":
|
||||
plugin = new fspPlugin();
|
||||
break;
|
||||
case "hmc":
|
||||
plugin = new hmcPlugin();
|
||||
break;
|
||||
case "ipmi":
|
||||
plugin = new ipmiPlugin();
|
||||
break;
|
||||
case "ivm":
|
||||
plugin = new ivmPlugin();
|
||||
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
|
||||
@@ -1864,8 +1856,12 @@ function loadScriptPage(tgtNodes) {
|
||||
upload.append(label, file, subBtn);
|
||||
scriptAttr.append(upload);
|
||||
|
||||
// Script
|
||||
var script = $('<div><label>Script:</label><textarea title="The code to run against the node range"/>');
|
||||
scriptAttr.append(script);
|
||||
|
||||
// Generate tooltips
|
||||
scriptForm.find('div input[title]').tooltip({
|
||||
scriptForm.find('div input[title],textarea').tooltip({
|
||||
position: "center right",
|
||||
offset: [-2, 10],
|
||||
effect: "fade",
|
||||
@@ -1879,10 +1875,6 @@ function loadScriptPage(tgtNodes) {
|
||||
}
|
||||
});
|
||||
|
||||
// Script
|
||||
var script = $('<div><label>Script:</label><textarea/>');
|
||||
scriptAttr.append(script);
|
||||
|
||||
// Ajax form options
|
||||
var options = {
|
||||
// Output to text area
|
||||
@@ -2958,7 +2950,7 @@ function openSetAttrsDialog() {
|
||||
$(this).remove();
|
||||
},
|
||||
height: 400,
|
||||
width: 700,
|
||||
width: 800,
|
||||
buttons: {
|
||||
"Save": function() {
|
||||
// Remove any warning messages
|
||||
@@ -3284,7 +3276,6 @@ function advancedLoad(group){
|
||||
|
||||
success : function(data) {
|
||||
setzVMCookies(data);
|
||||
loadWwpns();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ function loadNodesetPage(tgtNodes) {
|
||||
// Create boot method drop down
|
||||
var method = $('<div></div>');
|
||||
var methodLabel = $('<label>Boot method:</label>');
|
||||
var methodSelect = $('<select id="bootMethod" name="bootMethod"></select>');
|
||||
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>'
|
||||
@@ -86,7 +86,7 @@ function loadNodesetPage(tgtNodes) {
|
||||
// Create boot type drop down
|
||||
var type = $('<div></div>');
|
||||
var typeLabel = $('<label>Boot type:</label>');
|
||||
var typeSelect = $('<select id="bootType" name="bootType"></select>');
|
||||
var typeSelect = $('<select id="bootType" name="bootType" title="The type of network booting to use for this node"></select>');
|
||||
typeSelect.append('<option value="zvm">zvm</option>'
|
||||
+ '<option value="install">pxe</option>'
|
||||
+ '<option value="iscsiboot">yaboot</option>'
|
||||
@@ -147,7 +147,7 @@ function loadNodesetPage(tgtNodes) {
|
||||
imageAttr.append(profile);
|
||||
|
||||
// Generate tooltips
|
||||
nodesetForm.find('div input[title]').tooltip({
|
||||
nodesetForm.find('div input[title],select').tooltip({
|
||||
position: "center right",
|
||||
offset: [-2, 10],
|
||||
effect: "fade",
|
||||
|
||||
@@ -364,17 +364,32 @@ function openAddImageDialog() {
|
||||
|
||||
// Create info bar
|
||||
var info = createInfoBar('Provide the following attributes for the image. The image name will be generated based on the attributes you will give.');
|
||||
addImageForm.append(info);
|
||||
|
||||
var imageFS = $('<fieldset></fieldset>');
|
||||
var imageLegend = $('<legend>Image</legend>');
|
||||
imageFS.append(imageLegend);
|
||||
var imageAttr = $('<div style="display: inline-table; vertical-align: middle;"></div>');
|
||||
imageFS.append($('<div style="display: inline-table; vertical-align: middle;"><img src="images/provision/operating_system.png"></img></div>'));
|
||||
imageFS.append(imageAttr);
|
||||
|
||||
var optionFS = $('<fieldset></fieldset>');
|
||||
var optionLegend = $('<legend>Options</legend>');
|
||||
optionFS.append(optionLegend);
|
||||
var optionAttr = $('<div style="display: inline-table; vertical-align: middle;"></div>');
|
||||
optionFS.append($('<div style="display: inline-table; vertical-align: middle;"><img src="images/provision/setting.png" style="width: 70px;"></img></div>'));
|
||||
optionFS.append(optionAttr);
|
||||
|
||||
addImageForm.append(info, imageFS, optionFS);
|
||||
|
||||
// Create inputs for image attributes
|
||||
var imageName = $('<div><label>Image name:</label><input type="text" name="imagename" disabled="disabled"/></div>');
|
||||
var imageType = $('<div><label>Image type:</label><input type="text" name="imagetype"/></div>');
|
||||
var architecture = $('<div><label>OS architecture:</label><input type="text" name="osarch"/></div>');
|
||||
var osName = $('<div><label>OS name:</label><input type="text" name="osname"/></div>');
|
||||
var osVersion = $('<div><label>OS version:</label><input type="text" name="osvers"/></div>');
|
||||
var profile = $('<div><label>Profile:</label><input type="text" name="profile"/></div>');
|
||||
var imageName = $('<div><label>Image name:</label><input type="text" name="imagename" disabled="disabled" title="The name of this xCAT OS image definition"/></div>');
|
||||
var imageType = $('<div><label>Image type:</label><input type="text" name="imagetype" value="linux" title="The type of operating system image this definition represents"/></div>');
|
||||
var architecture = $('<div><label>OS architecture:</label><input type="text" name="osarch" title="The hardware architecture of this image. Valid values: x86_64, x86, ia64, ppc64, and s390x."/></div>');
|
||||
var osName = $('<div><label>OS name:</label><input type="text" name="osname" value="Linux" title="Operating system name"/></div>');
|
||||
var osVersion = $('<div><label>OS version:</label><input type="text" name="osvers" title="The operating system deployed on this node. Valid values: rhel*, centos*, fedora*, sles* (where * is the version #)."/></div>');
|
||||
var profile = $('<div><label>Profile:</label><input type="text" name="profile" title="The node usage category"/></div>');
|
||||
var provisionMethod = $('<div><label>Provision method:</label></div>');
|
||||
var provisionSelect = $('<select name="provmethod">'
|
||||
var provisionSelect = $('<select name="provmethod" title="The provisioning method for node deployment">'
|
||||
+ '<option value=""></option>'
|
||||
+ '<option value="install">install</option>'
|
||||
+ '<option value="netboot">netboot</option>'
|
||||
@@ -383,32 +398,8 @@ function openAddImageDialog() {
|
||||
provisionMethod.append(provisionSelect);
|
||||
|
||||
// Create inputs for optional attributes
|
||||
var exList = $('<div><label>Exclusion list:</label></div>');
|
||||
var exListInput = $('<input type="text" name="exlist"/>');
|
||||
exList.append(exListInput);
|
||||
exListInput.serverBrowser({
|
||||
onSelect : function(path) {
|
||||
$('#addImage input[name="exlist"]').val(path);
|
||||
},
|
||||
onLoad : function() {
|
||||
return $('#addImage input[name="exlist"]').val();
|
||||
},
|
||||
knownPaths : [{
|
||||
text : 'Install',
|
||||
image : 'desktop.png',
|
||||
path : '/install'
|
||||
}],
|
||||
imageUrl : 'images/serverbrowser/',
|
||||
systemImageUrl : 'images/serverbrowser/',
|
||||
handlerUrl : 'lib/getpath.php',
|
||||
title : 'Browse',
|
||||
requestMethod : 'POST',
|
||||
width : '500',
|
||||
height : '300',
|
||||
basePath : '/install' // Limit user to only install directory
|
||||
});
|
||||
var otherpkgDirectory = $('<div><label>Other package directory:</label></div>');
|
||||
var otherpkgDirectoryInput = $('<input type="text" name="otherpkgdir"/>');
|
||||
var otherpkgDirectoryInput = $('<input type="text" name="otherpkgdir" title="The base directory where the non-distro packages are stored"/>');
|
||||
otherpkgDirectory.append(otherpkgDirectoryInput);
|
||||
otherpkgDirectoryInput.serverBrowser({
|
||||
onSelect : function(path) {
|
||||
@@ -432,7 +423,7 @@ function openAddImageDialog() {
|
||||
basePath : '/install' // Limit user to only install directory
|
||||
});
|
||||
var packageDirectory = $('<div><label>Package directory:</label></div>');
|
||||
var packageDirectoryInput = $('<input type="text" name="pkgdir"/>');
|
||||
var packageDirectoryInput = $('<input type="text" name="pkgdir" title="The name of the directory where the distro packages are stored"/>');
|
||||
packageDirectory.append(packageDirectoryInput);
|
||||
packageDirectoryInput.serverBrowser({
|
||||
onSelect : function(path) {
|
||||
@@ -456,7 +447,7 @@ function openAddImageDialog() {
|
||||
basePath : '/install' // Limit user to only install directory
|
||||
});
|
||||
var packageList = $('<div><label>Package list:</label></div>');
|
||||
var packageListInput = $('<input type="text" name="pkglist"/>');
|
||||
var packageListInput = $('<input type="text" name="pkglist" title="The fully qualified name of the file that stores the distro packages list that will be included in the image"/>');
|
||||
packageList.append(packageListInput);
|
||||
packageListInput.serverBrowser({
|
||||
onSelect : function(path) {
|
||||
@@ -479,32 +470,8 @@ function openAddImageDialog() {
|
||||
height : '300',
|
||||
basePath : '/install' // Limit user to only install directory
|
||||
});
|
||||
var postInstall = $('<div><label>Post install script:</label></div>');
|
||||
var postInstallInput = $('<input type="text" name="postinstall"/>');
|
||||
postInstall.append(postInstallInput);
|
||||
postInstallInput.serverBrowser({
|
||||
onSelect : function(path) {
|
||||
$('#addImage input[name="postinstall"]').val(path);
|
||||
},
|
||||
onLoad : function() {
|
||||
return $('#addImage input[name="postinstall"]').val();
|
||||
},
|
||||
knownPaths : [{
|
||||
text : 'Install',
|
||||
image : 'desktop.png',
|
||||
path : '/install'
|
||||
}],
|
||||
imageUrl : 'images/serverbrowser/',
|
||||
systemImageUrl : 'images/serverbrowser/',
|
||||
handlerUrl : 'lib/getpath.php',
|
||||
title : 'Browse',
|
||||
requestMethod : 'POST',
|
||||
width : '500',
|
||||
height : '300',
|
||||
basePath : '/install' // Limit user to only install directory
|
||||
});
|
||||
var template = $('<div><label>Template:</label></div>');
|
||||
var templateInput = $('<input type="text" name="template"/>');
|
||||
var templateInput = $('<input type="text" name="template" title="The fully qualified name of the template file that is used to create the kickstart or autoyast file for diskful installation"/>');
|
||||
template.append(templateInput);
|
||||
templateInput.serverBrowser({
|
||||
onSelect : function(path) {
|
||||
@@ -528,9 +495,30 @@ function openAddImageDialog() {
|
||||
basePath : '/install' // Limit user to only install directory
|
||||
});
|
||||
|
||||
addImageForm.append(imageName, imageType, architecture, osName, osVersion, profile, provisionMethod,
|
||||
exList, otherpkgDirectory, packageDirectory, packageList, postInstall, template);
|
||||
imageAttr.append(imageName, imageType, architecture, osName, osVersion, profile, provisionMethod);
|
||||
optionAttr.append(otherpkgDirectory, packageDirectory, packageList, template);
|
||||
|
||||
// Generate tooltips
|
||||
addImageForm.find('div input[title],select[title]').tooltip({
|
||||
position: "center right",
|
||||
offset: [-2, 10],
|
||||
effect: "fade",
|
||||
opacity: 0.8,
|
||||
delay: 0,
|
||||
predelay: 800,
|
||||
events: {
|
||||
def: "mouseover,mouseout",
|
||||
input: "mouseover,mouseout",
|
||||
widget: "focus mouseover,blur mouseout",
|
||||
tooltip: "mouseover,mouseout"
|
||||
},
|
||||
|
||||
// Change z index to show tooltip in front
|
||||
onBeforeShow: function() {
|
||||
this.getTip().css('z-index', $.topZIndex());
|
||||
}
|
||||
});
|
||||
|
||||
// Open dialog to add image
|
||||
addImageForm.dialog({
|
||||
title:'Add image',
|
||||
@@ -538,7 +526,8 @@ function openAddImageDialog() {
|
||||
close: function(){
|
||||
$(this).remove();
|
||||
},
|
||||
width: 400,
|
||||
beight: 400,
|
||||
width: 600,
|
||||
buttons: {
|
||||
"Ok": function(){
|
||||
// Remove any warning messages
|
||||
@@ -553,11 +542,9 @@ function openAddImageDialog() {
|
||||
var provisionMethod = $(this).find('select[name="provmethod"]');
|
||||
|
||||
// Get optional image attributes
|
||||
var exList = $(this).find('input[name="exlist"]');
|
||||
var otherpkgDirectory = $(this).find('input[name="otherpkgdir"]');
|
||||
var pkgDirectory = $(this).find('input[name="pkgdir"]');
|
||||
var pkgList = $(this).find('input[name="pkglist"]');
|
||||
var postInstall = $(this).find('input[name="postinstall"]');
|
||||
var template = $(this).find('input[name="template"]');
|
||||
|
||||
// Check that image attributes are provided before continuing
|
||||
@@ -595,16 +582,12 @@ function openAddImageDialog() {
|
||||
'provmethod=' + provisionMethod.val();
|
||||
|
||||
// Get optional attributes
|
||||
if (exList.val())
|
||||
args += ';exlist=' + exList.val();
|
||||
if (otherpkgDirectory.val())
|
||||
args += ';otherpkgdir=' + otherpkgDirectory.val();
|
||||
if (pkgDirectory.val())
|
||||
args += ';pkgdir=' + pkgDirectory.val();
|
||||
if (pkgList.val())
|
||||
args += ';pkglist=' + pkgList.val();
|
||||
if (postInstall.val())
|
||||
args += ';postinstall=' + postInstall.val();
|
||||
if (template.val())
|
||||
args += ';template=' + template.val();
|
||||
|
||||
@@ -1059,8 +1042,8 @@ function openEditImagePage(tgtImage) {
|
||||
// There is an element called groups that will override the defaults for the groups attribute.
|
||||
// Hence, the input must have use CSS to override the float and width.
|
||||
|
||||
// Split attributes into 3 per row
|
||||
if (attrIndex > 0 && !(attrIndex % 3)) {
|
||||
// Split attributes into 2 per row
|
||||
if (attrIndex > 0 && !(attrIndex % 2)) {
|
||||
div.css('display', 'inline-block');
|
||||
}
|
||||
|
||||
@@ -1303,15 +1286,15 @@ function openCopyCdDialog() {
|
||||
// Create Linux ISO input
|
||||
var iso = $('<div></div>');
|
||||
var isoLabel = $('<label> Linux ISO/DVD:</label>').css('vertical-align', 'middle');
|
||||
var isoInput = $('<input type="text" id="iso" name="iso"/>').css('width', '300px');
|
||||
var isoInput = $('<input type="text" id="iso" name="iso" title="The fully qualified name of the disk image file"/>').css('width', '300px');
|
||||
iso.append(isoLabel);
|
||||
iso.append(isoInput);
|
||||
copyLinuxForm.append(iso);
|
||||
|
||||
// Create architecture input
|
||||
copyLinuxForm.append('<div><label>Architecture:</label><input type="text" id="arch" name="arch"/></div>');
|
||||
copyLinuxForm.append('<div><label>Architecture:</label><input type="text" id="arch" name="arch" title="The hardware architecture of this node. Valid values: x86_64, x86, ia64, ppc64, and s390x."/></div>');
|
||||
// Create distribution input
|
||||
copyLinuxForm.append('<div><label>Distribution:</label><input type="text" id="distro" name="distro"/></div>');
|
||||
copyLinuxForm.append('<div><label>Distribution:</label><input type="text" id="distro" name="distro" title="The operating system name. Valid values: rhel*, centos*, fedora*, sles* (where * is the version #)."/></div>');
|
||||
|
||||
/**
|
||||
* Browse
|
||||
@@ -1342,6 +1325,27 @@ function openCopyCdDialog() {
|
||||
basePath : '/install' // Limit user to only install directory
|
||||
});
|
||||
|
||||
// Generate tooltips
|
||||
copyLinuxForm.find('div input[title],select[title]').tooltip({
|
||||
position: "center right",
|
||||
offset: [-2, 10],
|
||||
effect: "fade",
|
||||
opacity: 0.8,
|
||||
delay: 0,
|
||||
predelay: 800,
|
||||
events: {
|
||||
def: "mouseover,mouseout",
|
||||
input: "mouseover,mouseout",
|
||||
widget: "focus mouseover,blur mouseout",
|
||||
tooltip: "mouseover,mouseout"
|
||||
},
|
||||
|
||||
// Change z index to show tooltip in front
|
||||
onBeforeShow: function() {
|
||||
this.getTip().css('z-index', $.topZIndex());
|
||||
}
|
||||
});
|
||||
|
||||
// Open dialog to copy CD
|
||||
copyLinuxForm.dialog({
|
||||
title:'Copy CD',
|
||||
|
||||
+104
-80
@@ -114,47 +114,45 @@ function loadServicePage() {
|
||||
}
|
||||
});
|
||||
|
||||
// Get OS image names
|
||||
$.ajax({
|
||||
url : 'lib/srv_cmd.php',
|
||||
dataType : 'json',
|
||||
async : true,
|
||||
data : {
|
||||
cmd : 'tabdump',
|
||||
tgt : '',
|
||||
args : 'osimage',
|
||||
msg : ''
|
||||
},
|
||||
|
||||
success : function(data) {
|
||||
setOSImageCookies(data);
|
||||
}
|
||||
});
|
||||
|
||||
// Get contents of hosts table
|
||||
$.ajax({
|
||||
url : 'lib/srv_cmd.php',
|
||||
dataType : 'json',
|
||||
async : true,
|
||||
data : {
|
||||
cmd : 'tabdump',
|
||||
tgt : '',
|
||||
args : 'hosts',
|
||||
msg : ''
|
||||
},
|
||||
|
||||
success : function(data) {
|
||||
setGroupCookies(data);
|
||||
}
|
||||
});
|
||||
|
||||
var provTabId = 'provisionTab';
|
||||
serviceTabs.add(provTabId, 'Provision', '', false);
|
||||
loadServiceProvisionPage(provTabId);
|
||||
|
||||
serviceTabs.select(manageTabId);
|
||||
|
||||
// Get OS image names
|
||||
if (!$.cookie('srv_imagenames')){
|
||||
$.ajax( {
|
||||
url : 'lib/srv_cmd.php',
|
||||
dataType : 'json',
|
||||
data : {
|
||||
cmd : 'tabdump',
|
||||
tgt : '',
|
||||
args : 'osimage',
|
||||
msg : ''
|
||||
},
|
||||
|
||||
success : function(data) {
|
||||
setOSImageCookies(data);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Get contents of hosts table
|
||||
if (!$.cookie('srv_groups')) {
|
||||
$.ajax( {
|
||||
url : 'lib/srv_cmd.php',
|
||||
dataType : 'json',
|
||||
data : {
|
||||
cmd : 'tabdump',
|
||||
tgt : '',
|
||||
args : 'hosts',
|
||||
msg : ''
|
||||
},
|
||||
|
||||
success : function(data) {
|
||||
setGroupCookies(data);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -241,22 +239,38 @@ function loadServiceProvisionPage(tabId) {
|
||||
title = 'z/VM';
|
||||
|
||||
// Get zVM host names
|
||||
if (!$.cookie('srv_zvm')){
|
||||
$.ajax( {
|
||||
url : 'lib/srv_cmd.php',
|
||||
dataType : 'json',
|
||||
data : {
|
||||
cmd : 'webportal',
|
||||
tgt : '',
|
||||
args : 'lszvm',
|
||||
msg : ''
|
||||
},
|
||||
$.ajax({
|
||||
url : 'lib/srv_cmd.php',
|
||||
dataType : 'json',
|
||||
async : false,
|
||||
data : {
|
||||
cmd : 'webportal',
|
||||
tgt : '',
|
||||
args : 'lszvm',
|
||||
msg : ''
|
||||
},
|
||||
|
||||
success : function(data) {
|
||||
setzVMCookies(data);
|
||||
}
|
||||
});
|
||||
}
|
||||
success : function(data) {
|
||||
setzVMCookies(data);
|
||||
}
|
||||
});
|
||||
|
||||
// Get master copies for clone
|
||||
$.ajax({
|
||||
url : 'lib/srv_cmd.php',
|
||||
dataType : 'json',
|
||||
async : false,
|
||||
data : {
|
||||
cmd : 'webportal',
|
||||
tgt : '',
|
||||
args : 'lsgoldenimages',
|
||||
msg : ''
|
||||
},
|
||||
|
||||
success : function(data) {
|
||||
setGoldenImagesCookies(data);
|
||||
}
|
||||
});
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -858,18 +872,15 @@ function loadNode(e) {
|
||||
// Create an instance of the plugin
|
||||
var plugin;
|
||||
switch (mgt) {
|
||||
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 "zvm":
|
||||
plugin = new zvmPlugin();
|
||||
break;
|
||||
}
|
||||
|
||||
// Select tab
|
||||
@@ -1082,11 +1093,27 @@ function setUserNodes(data) {
|
||||
// where column names are: node, os, arch, profile, provmethod, supportedarchs, nodetype, comments, disable
|
||||
var cols = data.rsp[i].split(',');
|
||||
var node = cols[0].replace(new RegExp('"', 'g'), '');
|
||||
var owner = cols[7].replace(new RegExp('"', 'g'), '');
|
||||
owner = owner.replace('owner:', '');
|
||||
|
||||
if (owner == userName) {
|
||||
usrNodes.push(node);
|
||||
// Comments can contain the owner and description
|
||||
var comments = new Array();
|
||||
if (cols[7].indexOf(';') > -1) {
|
||||
comments = cols[7].replace(new RegExp('"', 'g'), '').split(';');
|
||||
} else {
|
||||
comments.push(cols[7].replace(new RegExp('"', 'g'), ''));
|
||||
}
|
||||
|
||||
// Extract the owner
|
||||
var owner;
|
||||
for (var j in comments) {
|
||||
if (comments[j].indexOf('owner:') > -1) {
|
||||
owner = comments[j].replace('owner:', '');
|
||||
|
||||
if (owner == userName) {
|
||||
usrNodes.push(node);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
} // End of for
|
||||
|
||||
@@ -1317,18 +1344,15 @@ function cloneNode(tgtNodes) {
|
||||
// Create an instance of the plugin
|
||||
var plugin;
|
||||
switch (hw) {
|
||||
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 "zvm":
|
||||
plugin = new zvmPlugin();
|
||||
break;
|
||||
}
|
||||
|
||||
// Clone node
|
||||
@@ -1684,7 +1708,7 @@ function getMonitorMetrics(node) {
|
||||
var node, status;
|
||||
|
||||
// Get the ganglia status
|
||||
for ( var i in ganglia) {
|
||||
for (var i in ganglia) {
|
||||
// ganglia[0] = nodeName and ganglia[1] = state
|
||||
node = jQuery.trim(ganglia[i][0]);
|
||||
status = jQuery.trim(ganglia[i][1]);
|
||||
|
||||
+8
-8
@@ -490,6 +490,7 @@ function initPage() {
|
||||
includeJs("js/jquery/jquery.jqplot.min.js");
|
||||
includeJs("js/jquery/jqplot.pieRenderer.min.js");
|
||||
includeJs("js/jquery/jqplot.dateAxisRenderer.min.js");
|
||||
includeJs("js/jquery/jquery.topzindex.min.js");
|
||||
|
||||
// Page plugins
|
||||
includeJs("js/configure/configure.js");
|
||||
@@ -586,7 +587,6 @@ function initPage() {
|
||||
loadHelpPage();
|
||||
} else {
|
||||
// Load nodes page by default
|
||||
includeJs("js/jquery/jquery.topzindex.min.js");
|
||||
includeJs("js/nodes/nodeset.js");
|
||||
includeJs("js/nodes/rnetboot.js");
|
||||
includeJs("js/nodes/updatenode.js");
|
||||
@@ -676,21 +676,21 @@ function writeRsp(rsp, pattern) {
|
||||
* @param msg Message to show
|
||||
*/
|
||||
function openDialog(type, msg) {
|
||||
var msgDialog;
|
||||
var msgDialog = $('<div></div>');
|
||||
var title = "";
|
||||
if (type == "warn") {
|
||||
// Create warning message
|
||||
msgDialog = $('<div class="ui-state-error ui-corner-all">'
|
||||
+ '<p><span class="ui-icon ui-icon-alert"></span>' + msg + '</p>'
|
||||
+ '</div>');
|
||||
msgDialog.append(createWarnBar(msg));
|
||||
title = "Warning";
|
||||
} else {
|
||||
// Create info message
|
||||
msgDialog = $('<div class="ui-state-highlight ui-corner-all">'
|
||||
+ '<p><span class="ui-icon ui-icon-info"></span>' + msg + '</p>'
|
||||
+'</div>');
|
||||
msgDialog.append(createInfoBar(msg));
|
||||
title = "Info";
|
||||
}
|
||||
|
||||
// Open dialog
|
||||
msgDialog.dialog({
|
||||
title: title,
|
||||
modal: true,
|
||||
close: function(){
|
||||
$(this).remove();
|
||||
|
||||
+3
-3
@@ -41,14 +41,14 @@ if (isset($_GET["cmd"])) {
|
||||
}
|
||||
|
||||
// If no $args are given, set $args_array to NULL
|
||||
// Separators used are: | or ;
|
||||
// Separators used are: || or ;
|
||||
$args_array = array();
|
||||
if ($args) {
|
||||
// If $args contains multiple arguments, split it into an array
|
||||
if (strpos($args, "|")) {
|
||||
if (strpos($args, "||")) {
|
||||
// Split the arguments into an array
|
||||
$args_array = array();
|
||||
$args_array = explode("|", $args);
|
||||
$args_array = explode("||", $args);
|
||||
} else if (strpos($args, ";")) {
|
||||
// Split the arguments into an array
|
||||
$args_array = array();
|
||||
|
||||
@@ -93,7 +93,7 @@ function submit_request($req, $skipVerify, $opts_array){
|
||||
syslog(LOG_INFO, "Sending request: $cmd $nr");
|
||||
stream_set_blocking($fp, 0); // Set as non-blocking
|
||||
fwrite($fp,$req->asXML()); // Send XML to xcatd
|
||||
set_time_limit(900); // Set 15 minutes timeout (for long running requests)
|
||||
set_time_limit(3600); // Set 15 minutes timeout (for long running requests)
|
||||
// The default is 30 seconds which is too short for some requests
|
||||
|
||||
// Turn on output buffering
|
||||
|
||||
@@ -91,7 +91,7 @@ function submit_request($req, $skipVerify, $opts_array){
|
||||
syslog(LOG_INFO, "Sending request: $cmd $nr");
|
||||
stream_set_blocking($fp, 0); // Set as non-blocking
|
||||
fwrite($fp,$req->asXML()); // Send XML to xcatd
|
||||
set_time_limit(900); // Set 15 minutes timeout (for long running requests)
|
||||
set_time_limit(3600); // Set 15 minutes timeout (for long running requests)
|
||||
// The default is 30 seconds which is too short for some requests
|
||||
|
||||
// Turn on output buffering
|
||||
|
||||
@@ -45,11 +45,11 @@ if (isset($_GET["cmd"])) {
|
||||
}
|
||||
|
||||
// If $args contains multiple arguments, split it into an array
|
||||
// Separators used are: | or ;
|
||||
if (strpos($args, "|")) {
|
||||
// Separators used are: || or ;
|
||||
if (strpos($args, "||")) {
|
||||
// Split the arguments into an array
|
||||
$arr = array();
|
||||
$arr = explode("|", $args);
|
||||
$arr = explode("||", $args);
|
||||
} else if (strpos($args, ";")) {
|
||||
// Split the arguments into an array
|
||||
$arr = array();
|
||||
|
||||
@@ -70,6 +70,9 @@ sub process_request {
|
||||
'deleteuser' => \&web_deleteuser,
|
||||
'mkzprofile' => \&web_mkzprofile,
|
||||
'rmzprofile' => \&web_rmzprofile,
|
||||
'mkippool' => \&web_mkippool,
|
||||
'rmippool' => \&web_rmippool,
|
||||
'lsippool' => \&web_lsippool,
|
||||
'updateosimage' => \&web_updateosimage,
|
||||
'rmosimage' => \&web_rmosimage,
|
||||
'updategroup' => \&web_updategroup,
|
||||
@@ -2241,10 +2244,11 @@ sub web_graphinfo {
|
||||
}
|
||||
}
|
||||
|
||||
@missinfoarray = (@missinfoarray, @unsupportarray);
|
||||
foreach (@missinfoarray) {
|
||||
$missretstr = $missretstr . $_ . ':linux:other;';
|
||||
}
|
||||
|
||||
|
||||
# Combine all information into a string
|
||||
my $retstr = $pretstr . $bladeretstr . $xretstr . $missretstr;
|
||||
if ($retstr) {
|
||||
@@ -2369,6 +2373,7 @@ sub web_mkzprofile() {
|
||||
`echo "$var=$size" >> /var/opt/xcat/profiles/$profile.conf`;
|
||||
|
||||
# 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";
|
||||
@@ -2394,6 +2399,60 @@ sub web_rmzprofile() {
|
||||
$callback->( { info => $info } );
|
||||
}
|
||||
|
||||
sub web_mkippool() {
|
||||
|
||||
# Create group IP pool
|
||||
my ( $request, $callback, $sub_req ) = @_;
|
||||
|
||||
# Get profile
|
||||
my $group = $request->{arg}->[1];
|
||||
|
||||
# Move directory entry into /var/opt/xcat/ippool from /var/tmp
|
||||
`mkdir -p /var/opt/xcat/ippool`;
|
||||
`mv /var/tmp/$group.pool /var/opt/xcat/ippool`;
|
||||
|
||||
my $info = "IP pool successfully created/updated";
|
||||
$callback->( { info => $info } );
|
||||
}
|
||||
|
||||
sub web_rmippool() {
|
||||
|
||||
# Delete group IP pool
|
||||
my ( $request, $callback, $sub_req ) = @_;
|
||||
|
||||
# Get profile
|
||||
my $group = $request->{arg}->[1];
|
||||
my @groups = split( ',', $group );
|
||||
|
||||
# Delete IP pool under /var/opt/xcat/ippool
|
||||
foreach (@groups) {
|
||||
`rm -rf /var/opt/xcat/ippool/$_.pool`;
|
||||
}
|
||||
|
||||
my $info = "IP pool successfully deleted";
|
||||
$callback->( { info => $info } );
|
||||
}
|
||||
|
||||
sub web_lsippool() {
|
||||
|
||||
# List IP pool
|
||||
my ( $request, $callback, $sub_req ) = @_;
|
||||
|
||||
# Get profile
|
||||
my $group = $request->{arg}->[1];
|
||||
|
||||
# IP pool contained in /var/opt/xcat/ippool where a file exists per group
|
||||
my $entries;
|
||||
if ( !(`test -e /var/opt/xcat/ippool/$group.pool && echo Exists`) ) {
|
||||
$entries = "No IP pool found!";
|
||||
} else {
|
||||
# List IP pool under /var/opt/xcat/ippool
|
||||
$entries = `cat /var/opt/xcat/ippool/$group.pool`;
|
||||
}
|
||||
|
||||
$callback->( { info => $entries } );
|
||||
}
|
||||
|
||||
sub web_updateosimage() {
|
||||
|
||||
# Add OS image to xCAT table
|
||||
@@ -2464,6 +2523,7 @@ sub web_rmgroup() {
|
||||
# Delete user from xCAT passwd and policy tables
|
||||
foreach (@names) {
|
||||
`chtab -d node=$_ hosts`;
|
||||
`rm -rf /var/opt/xcat/ippool/$_.pool`;
|
||||
}
|
||||
|
||||
my $info = "Group successfully deleted";
|
||||
|
||||
@@ -40,7 +40,8 @@ sub process_request {
|
||||
'clonezlinux' => \&clonezlinux,
|
||||
'genhostip' => \&genhostip,
|
||||
'getmaxvm' => \&getmaxvm,
|
||||
'getuserprivilege' => \&getuserprivilege
|
||||
'getuserprivilege' => \&getuserprivilege,
|
||||
'lsgoldenimages' => \&lsgoldenimages
|
||||
);
|
||||
|
||||
# Check if the request is authorized
|
||||
@@ -214,12 +215,13 @@ sub provzlinux {
|
||||
|
||||
# Create VM
|
||||
# e.g. webportal provzlinux [group] [hcp] [image]
|
||||
my ($node, $ip, $base_digit) = gennodename( $callback, $group );
|
||||
if (!$base_digit) {
|
||||
println( $callback, "(Error) Failed to generate node name" );
|
||||
# my ($node, $ip, $base_digit) = gennodename( $callback, $group );
|
||||
my ($node, $ip, $hostname) = findfreenode( $callback, $group );
|
||||
if (!$node) {
|
||||
println( $callback, "Unable to find a free node, IP, and hostname for $group from the IP pool" );
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
my $userid = $node;
|
||||
|
||||
# Set node definitions
|
||||
@@ -231,9 +233,9 @@ sub provzlinux {
|
||||
$out = `mkdef -t node -o $node userid=$userid hcp=$hcp mgt=zvm groups=$group,all`;
|
||||
}
|
||||
println( $callback, "$out" );
|
||||
|
||||
|
||||
# Set nodetype definitions
|
||||
$out = `chtab node=$node 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
|
||||
@@ -673,7 +675,13 @@ sub clonezlinux {
|
||||
|
||||
# Create VM
|
||||
# e.g. webportal provzlinux [group] [hcp] [image]
|
||||
my ($node, $ip, $base_digit) = gennodename( $callback, $group );
|
||||
# my ($node, $ip, $base_digit) = gennodename( $callback, $group );
|
||||
my ($node, $ip, $hostname) = findfreenode( $callback, $group );
|
||||
if (!$node) {
|
||||
println( $callback, "Unable to find a free node, IP, and hostname for $group from the IP pool" );
|
||||
return;
|
||||
}
|
||||
|
||||
my $userid = $node;
|
||||
|
||||
# Set node definitions
|
||||
@@ -681,7 +689,7 @@ sub clonezlinux {
|
||||
println( $callback, "$out" );
|
||||
|
||||
# Set nodetype definitions
|
||||
$out = `chtab node=$node 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 and DNS
|
||||
sleep(5); # Time needed to update /etc/hosts
|
||||
@@ -715,8 +723,9 @@ sub genhostip {
|
||||
my ( $request, $callback, $sub_req ) = @_;
|
||||
my $group = $request->{arg}->[1];
|
||||
|
||||
my ($node, $ip, $base_digit) = gennodename( $callback, $group );
|
||||
println( $callback, "$node: $ip" );
|
||||
# my ($node, $ip, $base_digit) = gennodename( $callback, $group );
|
||||
my ($node, $ip, $hostname) = findfreenode( $callback, $group );
|
||||
println( $callback, "$node: $ip, $hostname" );
|
||||
}
|
||||
|
||||
sub getmaxvm {
|
||||
@@ -781,4 +790,86 @@ sub getuserprivilege {
|
||||
|
||||
$callback->( { data => "Privilege: $privilege" } );
|
||||
}
|
||||
|
||||
sub lsgoldenimages {
|
||||
my ( $request, $callback, $sub_req ) = @_;
|
||||
|
||||
# Find the golden image that can be cloned by searching nodetype table for nodetype.provmethod=clone
|
||||
my $clones = "";
|
||||
my $comments = "";
|
||||
my $description = "";
|
||||
my @args;
|
||||
|
||||
# Look in 'policy' table
|
||||
my $tab = xCAT::Table->new( 'nodetype', -create => 1, -autocommit => 0 );
|
||||
my @results = $tab->getAllAttribsWhere( "provmethod='clone'", 'node', 'comments' );
|
||||
foreach (@results) {
|
||||
if ($_->{'node'}) {
|
||||
$clones .= $_->{'node'} . ": ";
|
||||
|
||||
$comments = $_->{'comments'};
|
||||
@args = split(';', $comments);
|
||||
foreach (@args) {
|
||||
if ($_ =~ m/description:/i) {
|
||||
$description = $_;
|
||||
$description =~ s/description://g;
|
||||
$description =~ s/\s*$//; # Trim right
|
||||
$description =~ s/^\s*//; # Trim left
|
||||
} else {
|
||||
$description = "No comments";
|
||||
}
|
||||
}
|
||||
|
||||
$clones .= $description . ",";
|
||||
}
|
||||
}
|
||||
|
||||
# Delete last comma
|
||||
$clones = substr($clones, 0, -1);
|
||||
|
||||
$callback->( { data => $clones } );
|
||||
}
|
||||
|
||||
sub findfreenode {
|
||||
# Generate node name based on given group
|
||||
my ( $callback, $group ) = @_;
|
||||
|
||||
# IP pool contained in /var/opt/xcat/ippool where a file exists per group
|
||||
if ( !(`test -e /var/opt/xcat/ippool/$group.pool && echo Exists`) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
# IP pool group format: node, IP, hostname
|
||||
# It would look similar to:
|
||||
# ihost10,10.1.136.10,ihost10.endicott.ibm.com
|
||||
# ihost11,10.1.136.11,ihost11.endicott.ibm.com
|
||||
# ihost12,10.1.136.12,ihost12.endicott.ibm.com
|
||||
my $node;
|
||||
my $ipaddr;
|
||||
my $hostname;
|
||||
|
||||
my $out = `cat /var/opt/xcat/ippool/$group.pool | grep -v "#"`;
|
||||
my @entries = split( /\n/, $out );
|
||||
if (@entries < 1) {
|
||||
return;
|
||||
}
|
||||
|
||||
my $found = 0;
|
||||
foreach(@entries) {
|
||||
# Grab the 1st free entry found
|
||||
($node, $ipaddr, $hostname) = split(/,/, $_);
|
||||
if ($node && $ipaddr && $hostname) {
|
||||
|
||||
# Check against xCAT tables, /etc/hosts, and ping to see if hostname is already used
|
||||
if (`nodels $node` || `cat /etc/hosts | grep "$ipaddr "` || !(`ping -c 4 $ipaddr` =~ m/100% packet loss/)) {
|
||||
next;
|
||||
} else {
|
||||
$found = 1;
|
||||
return ($node, $ipaddr, $hostname);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
1;
|
||||
+995
-235
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,5 @@
|
||||
xcat-buildkit (2.9) precise; urgency=low
|
||||
|
||||
* Initial release.
|
||||
|
||||
-- root <root@ubuntu> Fri, 01 Mar 2013 14:05:43 +0800
|
||||
@@ -0,0 +1 @@
|
||||
5
|
||||
@@ -0,0 +1,11 @@
|
||||
Source: xcat-buildkit
|
||||
Section: admin
|
||||
Priority: extra
|
||||
Maintainer: xu qing <qxuqxu@cn.ibm.com>
|
||||
Build-Depends: debhelper (>= 5)
|
||||
Standards-Version: 3.7.2
|
||||
|
||||
Package: xcat-buildkit
|
||||
Architecture: all
|
||||
Depends: dpkg-dev, devscripts, debhelper
|
||||
Description: xCAT-buildkit provides the buildkit tool and sample kit files to build an xCAT kit.
|
||||
@@ -0,0 +1,88 @@
|
||||
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.
|
||||
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
opt/xcat/share/xcat/kits/kit_template
|
||||
opt/xcat/share/xcat/kits/debian_template
|
||||
opt/xcat/bin
|
||||
opt/xcat/lib/perl/xCAT
|
||||
opt/xcat/share/man/man1
|
||||
opt/xcat/share/doc/man1
|
||||
opt/xcat/share/doc/packages/xCAT-buildkit
|
||||
@@ -0,0 +1 @@
|
||||
LICENSE.html
|
||||
@@ -0,0 +1,7 @@
|
||||
share/man/man1/* opt/xcat/share/man/man1/
|
||||
share/doc/man1/* opt/xcat/share/doc/man1/
|
||||
share/xcat/kits/kit_template/* opt/xcat/share/xcat/kits/kit_template/
|
||||
share/xcat/kits/debian_template/* opt/xcat/share/xcat/kits/debian_template/
|
||||
lib/perl/xCAT/* opt/xcat/lib/perl/xCAT/
|
||||
bin/* opt/xcat/bin/
|
||||
LICENSE.html opt/xcat/share/doc/packages/xCAT-buildkit/
|
||||
Executable
+60
@@ -0,0 +1,60 @@
|
||||
#!/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
|
||||
|
||||
export DH_COMPAT=5
|
||||
|
||||
|
||||
build:
|
||||
pwd
|
||||
mkdir -p share/man/man1
|
||||
mkdir -p share/doc/man1
|
||||
pod2man pods/man1/buildkit.1.pod > share/man/man1/buildkit.1
|
||||
pod2html pods/man1/buildkit.1.pod > share/doc/man1/buildkit.1.html
|
||||
|
||||
clean:
|
||||
dh_testdir
|
||||
dh_testroot
|
||||
dh_clean -d
|
||||
|
||||
install:
|
||||
pwd
|
||||
dh_testdir
|
||||
dh_testroot
|
||||
dh_installdirs
|
||||
dh_install -X".svn"
|
||||
chmod 444 debian/xcat-buildkit/opt/xcat/share/man/man1/*
|
||||
chmod 644 debian/xcat-buildkit/opt/xcat/share/doc/man1/*
|
||||
find debian/xcat-buildkit/opt/xcat/share/xcat/kits -type d -exec chmod 755 {} \;
|
||||
find debian/xcat-buildkit/opt/xcat/share/xcat/kits -type f -exec chmod 644 {} \;
|
||||
find debian/xcat-buildkit/opt/xcat/lib/perl/xCAT -type d -exec chmod 755 {} \;
|
||||
find debian/xcat-buildkit/opt/xcat/lib/perl/xCAT -type f -exec chmod 644 {} \;
|
||||
chmod -R 755 debian/xcat-buildkit/opt/xcat/bin/*
|
||||
find debian/xcat-buildkit/opt/xcat/share/doc/packages/xCAT-buildkit -type f -exec chmod 644 {} \;
|
||||
dh_link
|
||||
|
||||
|
||||
# Build architecture-independent files here.
|
||||
binary-indep: build install
|
||||
dh_installchangelogs
|
||||
dh_compress
|
||||
dh_installdeb
|
||||
dh_gencontrol
|
||||
dh_md5sums
|
||||
dh_builddeb
|
||||
|
||||
# We have nothing to do by default.
|
||||
|
||||
# Build architecture-dependent files here.
|
||||
binary-arch:
|
||||
pwd
|
||||
|
||||
binary: binary-indep binary-arch
|
||||
.PHONY: build clean binary-indep binary-arch binary install configure
|
||||
@@ -0,0 +1 @@
|
||||
1.0
|
||||
@@ -633,6 +633,20 @@ sub osver
|
||||
}
|
||||
}
|
||||
}
|
||||
elsif (-f "/etc/debian_version") #possible debian
|
||||
{
|
||||
if (open($relfile, "<", "/etc/issue")){
|
||||
$line = <$relfile>;
|
||||
if ( $line =~ /debian.*/i){
|
||||
$os = "debian";
|
||||
my $relfile1;
|
||||
open($relfile1, "<", "/etc/debian_version");
|
||||
$ver = <$relfile1>;
|
||||
close($relfile1);
|
||||
}
|
||||
close($relfile);
|
||||
}
|
||||
}
|
||||
$os = "$os" . "," . "$ver";
|
||||
return ($os);
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ 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>} I<package_directory>
|
||||
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>]
|
||||
|
||||
@@ -74,10 +74,14 @@ List the repos defined in your buildkit configuration file:
|
||||
|
||||
=item 8.
|
||||
|
||||
For each reponame listed, build the repository. Note that if you need to build repositories for OS distributions or versions 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 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.
|
||||
|
||||
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:
|
||||
|
||||
buildkit buildrepo all
|
||||
|
||||
=item 9.
|
||||
|
||||
Build the kit tar file:
|
||||
@@ -123,19 +127,19 @@ Reads the buildkit.conf file from the current directory, and deletes all the pac
|
||||
|
||||
=item B<buildtar>
|
||||
|
||||
Reads the buildkit.conf file from the current directory, validates that all kit repositories have been built, and builds the Kit tar file <cwd>/build/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 buildkit.conf file from the current directory, deletes the Kit tar <cwd>/build/I<kitname>.tar.bz2, and deletes all files in the build work directory <cwd>/build/I<kitname>.
|
||||
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> I<kit_tarfile> {B<-p> | B<--pkgdir>} I<package_directory>
|
||||
=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>
|
||||
|
||||
Add product package rpms to a previously built kit tar file. This is used for product kits that are built and shipped separately from the product packages.
|
||||
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
|
||||
|
||||
@@ -169,7 +173,7 @@ To create the sample kit shipped with the xCAT-buildkit rpm on a RHELS 6.3 serve
|
||||
vi buildkit.conf
|
||||
buildkit chkconfig
|
||||
buildkit listrepo
|
||||
buildkit buildrepo rhels6.3
|
||||
buildkit buildrepo all
|
||||
buildkit buildtar
|
||||
|
||||
=item 2.
|
||||
@@ -199,7 +203,7 @@ To clean up all kit build files, including a previously built kit tar file, run
|
||||
|
||||
<cwd>/build/I<kitname>/kit.conf
|
||||
|
||||
<cwd>/build/I<kitname>.tar.bz2
|
||||
<cwd>/I<kitname>.tar.bz2
|
||||
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
<<<INSERT_kitcomponent_basename_HERE>>> (1.0) precise; urgency=low
|
||||
|
||||
* Kit component package build.
|
||||
|
||||
-- root <root@ubuntu> Fri, 01 Mar 2013 14:05:43 +0800
|
||||
@@ -0,0 +1 @@
|
||||
5
|
||||
@@ -0,0 +1,11 @@
|
||||
Source: <<<INSERT_kitcomponent_basename_HERE>>>
|
||||
Section: admin
|
||||
Priority: extra
|
||||
Maintainer: xcatkit <root@ubuntu>
|
||||
Build-Depends: debhelper (>= 5)
|
||||
Standards-Version: 3.7.2
|
||||
|
||||
Package: <<<INSERT_kitcomponent_basename_HERE>>>
|
||||
Architecture: all
|
||||
Depends: <<<INSERT_kitcomponent_ospkgdeps_HERE>>>,<<<INSERT_kitcomponent_kitpkgdeps_HERE>>>,<<<INSERT_kitcomponent_kitcompdeps_HERE>>>
|
||||
Description: <<<INSERT_kitcomponent_desc_HERE>>>
|
||||
+6
-8
@@ -1,5 +1,5 @@
|
||||
#!/bin/sh
|
||||
# postinst script for xcat-genesis
|
||||
# postinst script for aaa
|
||||
#
|
||||
# see: dh_installdeb(1)
|
||||
|
||||
@@ -20,13 +20,11 @@ set -e
|
||||
|
||||
case "$1" in
|
||||
configure)
|
||||
if [ -f /tmp/xCAT-genesis_upgrade.tmp ];then
|
||||
if [ -f "/proc/cmdline" ]; then # prevent running it during install into chroot image
|
||||
. /etc/profile.d/xcat.sh
|
||||
mknb x86_64
|
||||
fi
|
||||
rm /tmp/xCAT-genesis_upgrade.tmp
|
||||
fi
|
||||
<<<INSERT_kitcomponent_postinstall_script_HERE>>>
|
||||
if [ -f /tmp/<<<INSERT_kitcomponent_upgrade_flag_HERE>>> ]
|
||||
<<<INSERT_kitcomponent_postupgrade_script_HERE>>>
|
||||
rm /tmp/<<<INSERT_kitcomponent_upgrade_flag_HERE>>>
|
||||
fi
|
||||
;;
|
||||
|
||||
abort-upgrade|abort-remove|abort-deconfigure)
|
||||
@@ -0,0 +1,41 @@
|
||||
#!/bin/sh
|
||||
# postrm script for aaa
|
||||
#
|
||||
# see: dh_installdeb(1)
|
||||
|
||||
set -e
|
||||
|
||||
# summary of how this script can be called:
|
||||
# * <postrm> `remove'
|
||||
# * <postrm> `purge'
|
||||
# * <old-postrm> `upgrade' <new-version>
|
||||
# * <new-postrm> `failed-upgrade' <old-version>
|
||||
# * <new-postrm> `abort-install'
|
||||
# * <new-postrm> `abort-install' <old-version>
|
||||
# * <new-postrm> `abort-upgrade' <old-version>
|
||||
# * <disappearer's-postrm> `disappear' <overwriter>
|
||||
# <overwriter-version>
|
||||
# for details, see http://www.debian.org/doc/debian-policy/ or
|
||||
# the debian-policy package
|
||||
|
||||
|
||||
case "$1" in
|
||||
upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
|
||||
;;
|
||||
|
||||
remove|purge)
|
||||
<<<INSERT_kitcomponent_postuninstall_script_HERE>>>
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "postrm called with unknown argument \`$1'" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
# dh_installdeb will replace this with shell code automatically
|
||||
# generated by other debhelper scripts.
|
||||
|
||||
#DEBHELPER#
|
||||
|
||||
exit 0
|
||||
@@ -0,0 +1,42 @@
|
||||
#!/bin/sh
|
||||
# preinst script for aaa
|
||||
#
|
||||
# see: dh_installdeb(1)
|
||||
|
||||
set -e
|
||||
|
||||
# summary of how this script can be called:
|
||||
# * <new-preinst> `install'
|
||||
# * <new-preinst> `install' <old-version>
|
||||
# * <new-preinst> `upgrade' <old-version>
|
||||
# * <old-preinst> `abort-upgrade' <new-version>
|
||||
# for details, see http://www.debian.org/doc/debian-policy/ or
|
||||
# the debian-policy package
|
||||
|
||||
|
||||
case "$1" in
|
||||
install)
|
||||
<<<INSERT_kitcomponent_preinstall_script_HERE>>>
|
||||
;;
|
||||
|
||||
upgrade)
|
||||
if [ -f /tmp/<<<INSERT_kitcomponent_upgrade_flag_HERE>>> ]
|
||||
<<<INSERT_kitcomponent_preupgrade_script_HERE>>>
|
||||
fi
|
||||
;;
|
||||
|
||||
abort-upgrade)
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "preinst called with unknown argument \`$1'" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
# dh_installdeb will replace this with shell code automatically
|
||||
# generated by other debhelper scripts.
|
||||
|
||||
#DEBHELPER#
|
||||
|
||||
exit 0
|
||||
@@ -0,0 +1,46 @@
|
||||
#!/bin/sh
|
||||
# prerm script for aaa
|
||||
#
|
||||
# see: dh_installdeb(1)
|
||||
|
||||
set -e
|
||||
|
||||
# summary of how this script can be called:
|
||||
# * <prerm> `remove'
|
||||
# * <old-prerm> `upgrade' <new-version>
|
||||
# * <new-prerm> `failed-upgrade' <old-version>
|
||||
# * <conflictor's-prerm> `remove' `in-favour' <package> <new-version>
|
||||
# * <deconfigured's-prerm> `deconfigure' `in-favour'
|
||||
# <package-being-installed> <version> `removing'
|
||||
# <conflicting-package> <version>
|
||||
# for details, see http://www.debian.org/doc/debian-policy/ or
|
||||
# the debian-policy package
|
||||
|
||||
|
||||
case "$1" in
|
||||
remove)
|
||||
<<<INSERT_kitcomponent_preuninstall_script_HERE>>>
|
||||
;;
|
||||
|
||||
upgrade)
|
||||
touch /tmp/<<<INSERT_kitcomponent_upgrade_flag_HERE>>>
|
||||
;;
|
||||
|
||||
deconfigure)
|
||||
;;
|
||||
|
||||
failed-upgrade)
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "prerm called with unknown argument \`$1'" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
# dh_installdeb will replace this with shell code automatically
|
||||
# generated by other debhelper scripts.
|
||||
|
||||
#DEBHELPER#
|
||||
|
||||
exit 0
|
||||
@@ -0,0 +1,29 @@
|
||||
#!/usr/bin/make -f
|
||||
|
||||
export DH_COMPAT=5
|
||||
|
||||
build:
|
||||
pwd
|
||||
|
||||
clean:
|
||||
dh_testdir
|
||||
dh_testroot
|
||||
dh_clean -d
|
||||
|
||||
install:
|
||||
pwd
|
||||
dh_install
|
||||
|
||||
binary-indep: build install
|
||||
dh_installchangelogs
|
||||
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
|
||||
@@ -0,0 +1 @@
|
||||
1.0
|
||||
@@ -0,0 +1,219 @@
|
||||
# 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
|
||||
# release (optional) Kit release. e.g., 1
|
||||
# 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
|
||||
# kitlicense (mandatory) Kit license string to be built into all
|
||||
# kitcomponent packages
|
||||
# kittarfilename (optional) Filename.tar.bz2 to be used for the generated
|
||||
# kit. Default is <basename>-<version>-<ostype>.tar.bz2
|
||||
kit:
|
||||
basename=chef
|
||||
description=Kit for installing chef server, client and workstation
|
||||
version=1.0
|
||||
release=1
|
||||
ostype=Linux
|
||||
kitlicense=EPL
|
||||
|
||||
|
||||
# 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 x86_64 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., x86_64
|
||||
# compat_osbasenames (optional) Comma-separated list of compatible
|
||||
# OS distro base names. e.g., centos
|
||||
|
||||
kitrepo:
|
||||
kitrepoid=rhels6_x86_64
|
||||
osbasename=rhels
|
||||
osmajorversion=6
|
||||
#osminorversion=
|
||||
osarch=x86_64
|
||||
|
||||
#compat_osbasenames=
|
||||
|
||||
|
||||
# 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 (optional) Kit component version. If not set, defaults
|
||||
# to kit version
|
||||
# release (optional) Kit component release. If not set, defaults
|
||||
# to kit release. Error if both are not set.
|
||||
# serverroles (mandatory) Comma-separated list of servers that this
|
||||
# component can install on. Valid values:
|
||||
# mgtnode,servicenode,compute,login,storage,utility
|
||||
# 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)
|
||||
# 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 and may contain
|
||||
# wildcards. If a filename is prefixed by 'EXTERNALPKGS:'
|
||||
# the file will not be built into the kit tarfile, but
|
||||
# will need to be added later with a 'buildkit addpkgs'
|
||||
# command.
|
||||
# Files will be placed in
|
||||
# /opt/xcat/kits/<kitbasename>/<kitcomponent_name>
|
||||
# when the kitcomponent package is deployed to an
|
||||
# OS image.
|
||||
# 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,
|
||||
# genimage_postinstall
|
||||
kitcomponent:
|
||||
basename=chef_server_kit
|
||||
description=For installing chef server
|
||||
version=1.0
|
||||
release=1
|
||||
serverroles=mgtnode
|
||||
kitrepoid=rhels6_x86_64
|
||||
kitpkgdeps=chef-server
|
||||
#postinstall=server.post
|
||||
postbootscripts=server.post
|
||||
|
||||
kitcomponent:
|
||||
basename=chef_client_kit
|
||||
description=For installing chef client
|
||||
version=1.0
|
||||
release=1
|
||||
serverroles=compute
|
||||
kitrepoid=rhels6_x86_64
|
||||
kitpkgdeps=chef
|
||||
#postinstall=client.post
|
||||
postbootscripts=client.post
|
||||
|
||||
kitcomponent:
|
||||
basename=chef_workstation_kit
|
||||
description=For installing chef workstation
|
||||
version=1.0
|
||||
release=1
|
||||
serverroles=compute
|
||||
kitrepoid=rhels6_x86_64
|
||||
kitpkgdeps=chef
|
||||
#postinstall=workstation.post
|
||||
postbootscripts=workstation.post
|
||||
|
||||
|
||||
|
||||
# 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) A comma-separated list of kit reponames 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
|
||||
# The filename may contain wildcards to avoid needing to
|
||||
# specify an explicit package version-release filename.
|
||||
# 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=chef-server-*
|
||||
kitrepoid=rhels6_x86_64
|
||||
isexternalpkg=no
|
||||
rpm_prebuiltdir=rhels6/x86_64
|
||||
|
||||
kitpackage:
|
||||
filename=chef-11*
|
||||
kitrepoid=rhels6_x86_64
|
||||
isexternalpkg=no
|
||||
rpm_prebuiltdir=rhels6/x86_64
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
#!/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 [ "$NODESETSTATE" = "install" ]; then
|
||||
#prevent getting called during full install bootup
|
||||
#because the function will be called in the rpm %post section instead
|
||||
exit 0
|
||||
else
|
||||
if [ -f "/proc/cmdline" ]; then # prevent running it during install into chroot image
|
||||
#configure the chef client configuration files
|
||||
/xcatpost/config_chef_client "$@"
|
||||
fi
|
||||
fi
|
||||
|
||||
exit 0
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
#!/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 [ "$NODESETSTATE" = "install" ]; then
|
||||
#prevent getting called during full install bootup
|
||||
#because the function will be called in the rpm %post section instead
|
||||
exit 0
|
||||
else
|
||||
if [ -f "/proc/cmdline" ]; then # prevent running it during install into chroot image
|
||||
#Now configure the chef server
|
||||
/xcatpost/config_chef_server
|
||||
fi
|
||||
fi
|
||||
|
||||
exit 0
|
||||
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
#!/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 [ "$NODESETSTATE" = "install" ]; then
|
||||
#prevent getting called during full install bootup
|
||||
#because the function will be called in the rpm %post section instead
|
||||
exit 0
|
||||
else
|
||||
if [ -f "/proc/cmdline" ]; then # prevent running it during install into chroot image
|
||||
#configure the chef workstation configuration files
|
||||
/xcatpost/config_chef_workstation "$@"
|
||||
fi
|
||||
fi
|
||||
|
||||
exit 0
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ kit:
|
||||
description=XLC12 for Linux
|
||||
version=12.1.0.0
|
||||
ostype=Linux
|
||||
kitlicense=IPLA
|
||||
kitlicense=ILAN
|
||||
# kitdeployparams=sample/kitdeployparams.lst
|
||||
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ kit:
|
||||
description=XLF14 for Linux
|
||||
version=14.1.0.0
|
||||
ostype=Linux
|
||||
kitlicense=IPLA
|
||||
kitlicense=ILAN
|
||||
# kitdeployparams=sample/kitdeployparams.lst
|
||||
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ kit:
|
||||
description=XLF14 for Linux
|
||||
version=14.1.0.0
|
||||
ostype=Linux
|
||||
kitlicense=IPLA
|
||||
kitlicense=ILAN
|
||||
# kitdeployparams=sample/kitdeployparams.lst
|
||||
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ kit:
|
||||
description=essl for Linux
|
||||
version=5.1.1
|
||||
ostype=Linux
|
||||
kitlicense=IPLA
|
||||
kitlicense=ILAN
|
||||
kitdeployparams=essl.env
|
||||
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ kit:
|
||||
description=essl for Linux
|
||||
version=5.1.1
|
||||
ostype=Linux
|
||||
kitlicense=IPLA
|
||||
kitlicense=ILAN
|
||||
kitdeployparams=essl.env
|
||||
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ kit:
|
||||
description=General Parallel File System
|
||||
version=3.5.0-7
|
||||
ostype=Linux
|
||||
kitlicense=IPLA
|
||||
kitlicense=ILAN
|
||||
#kitdeployparams=
|
||||
|
||||
|
||||
|
||||
+1
-1
@@ -25,7 +25,7 @@ kit:
|
||||
description=General Parallel File System
|
||||
version=3.5.0-7
|
||||
ostype=Linux
|
||||
kitlicense=IPLA
|
||||
kitlicense=ILAN
|
||||
#kitdeployparams=
|
||||
|
||||
|
||||
|
||||
+1
-1
@@ -25,7 +25,7 @@ kit:
|
||||
description=General Parallel File System
|
||||
version=3.5.0-7
|
||||
ostype=Linux
|
||||
kitlicense=IPLA
|
||||
kitlicense=ILAN
|
||||
#kitdeployparams=
|
||||
|
||||
|
||||
|
||||
+1
-1
@@ -25,7 +25,7 @@ kit:
|
||||
description=General Parallel File System
|
||||
version=3.5.0-7
|
||||
ostype=Linux
|
||||
kitlicense=IPLA
|
||||
kitlicense=ILAN
|
||||
#kitdeployparams=
|
||||
|
||||
|
||||
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>GPFS Documentation</TITLE>
|
||||
<meta http-equiv="REFRESH" content="0;url=http://publib.boulder.ibm.com/infocenter/clresctr/vxrx/topic/com.ibm.cluster.gpfs.doc/gpfsbooks.html"></HEAD>
|
||||
<BODY>
|
||||
Redirecting to:
|
||||
http://publib.boulder.ibm.com/infocenter/clresctr/vxrx/topic/com.ibm.cluster.gpfs.doc/gpfsbooks.html
|
||||
</BODY>
|
||||
</HTML>
|
||||
+330
@@ -0,0 +1,330 @@
|
||||
# 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=gpfs
|
||||
description=General Parallel File System
|
||||
version=3.5.0-9
|
||||
ostype=Linux
|
||||
kitlicense=ILAN
|
||||
#kitdeployparams=
|
||||
|
||||
|
||||
# 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 x86_64 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., x86_64
|
||||
# compat_osbasenames (optional) Comma-separated list of compatible
|
||||
# OS distro base names. e.g., centos
|
||||
|
||||
kitrepo:
|
||||
kitrepoid=rhels6_x86_64
|
||||
osbasename=rhels
|
||||
osmajorversion=6
|
||||
osarch=x86_64
|
||||
|
||||
#compat_osbasenames=
|
||||
|
||||
kitrepo:
|
||||
kitrepoid=sles11_x86_64
|
||||
osbasename=sles
|
||||
osmajorversion=11
|
||||
osarch=x86_64
|
||||
|
||||
# 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,login,storage,utility
|
||||
# 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=gpfs_compute
|
||||
description=GPFS for compute nodes
|
||||
version=3.5.0
|
||||
release=9
|
||||
serverroles=compute,servicenode
|
||||
kitrepoid=rhels6_x86_64
|
||||
#kitcompdeps=
|
||||
ospkgdeps=yum
|
||||
kitpkgdeps=gpfs.libsrc >= 3.5.0,gpfs.src >= 3.5.0,gpfs.base >= 3.5.0,gpfs.gpl >= 3.5.0,gpfs.msg.en_US >= 3.5.0,gpfs.docs >= 3.5.0
|
||||
#driverpacks=
|
||||
exlist=gpfs.exlist
|
||||
postbootscripts=gpfs_mmsdrfs,gpfs_start,gpfs_config
|
||||
genimage_postinstall=rhels_gpfs_compute_update
|
||||
non_native_pkgs=EXTERNALPKGS:gpfs.base-3.5.0-9.x86_64.update.rpm,EXTERNALPKGS:gpfs.gplbin*
|
||||
|
||||
kitcomponent:
|
||||
basename=min_gpfs_compute
|
||||
description=Minimal GPFS for compute nodes
|
||||
version=3.5.0
|
||||
release=9
|
||||
serverroles=compute,servicenode
|
||||
kitrepoid=rhels6_x86_64
|
||||
#kitcompdeps=
|
||||
ospkgdeps=yum
|
||||
kitpkgdeps=gpfs.libsrc >= 3.5.0,gpfs.src >= 3.5.0,gpfs.base >= 3.5.0,gpfs.gpl >= 3.5.0,gpfs.msg.en_US >= 3.5.0
|
||||
#driverpacks=
|
||||
exlist=min-gpfs.exlist
|
||||
postbootscripts=gpfs_mmsdrfs,gpfs_start,gpfs_config
|
||||
genimage_postinstall=rhels_min_gpfs_compute_update
|
||||
non_native_pkgs=EXTERNALPKGS:gpfs.base-3.5.0-9.x86_64.update.rpm,EXTERNALPKGS:gpfs.gplbin*
|
||||
|
||||
kitcomponent:
|
||||
basename=gpfs_login
|
||||
description=GPFS for login nodes
|
||||
version=3.5.0
|
||||
release=9
|
||||
serverroles=login
|
||||
kitrepoid=rhels6_x86_64
|
||||
#kitcompdeps=
|
||||
ospkgdeps=yum
|
||||
kitpkgdeps=gpfs.libsrc >= 3.5.0,gpfs.src >= 3.5.0,gpfs.base >= 3.5.0,gpfs.gpl >= 3.5.0,gpfs.msg.en_US >= 3.5.0,gpfs.docs >= 3.5.0
|
||||
#driverpacks=
|
||||
exlist=gpfs.exlist
|
||||
postbootscripts=gpfs_mmsdrfs,gpfs_start,gpfs_config
|
||||
genimage_postinstall=rhels_gpfs_login_update
|
||||
non_native_pkgs=EXTERNALPKGS:gpfs.base-3.5.0-9.x86_64.update.rpm,EXTERNALPKGS:gpfs.gplbin*
|
||||
|
||||
kitcomponent:
|
||||
basename=gpfs_storage
|
||||
description=GPFS for storage nodes
|
||||
version=3.5.0
|
||||
release=9
|
||||
serverroles=storage,servicenode
|
||||
kitrepoid=rhels6_x86_64
|
||||
#kitcompdeps=
|
||||
ospkgdeps=yum
|
||||
kitpkgdeps=gpfs.libsrc >= 3.5.0,gpfs.src >= 3.5.0,gpfs.base >= 3.5.0,gpfs.gpl >= 3.5.0,gpfs.msg.en_US >= 3.5.0,gpfs.docs >= 3.5.0
|
||||
#driverpacks=
|
||||
exlist=gpfs.exlist
|
||||
postbootscripts=gpfs_mmsdrfs,gpfs_start,gpfs_config_storage
|
||||
genimage_postinstall=rhels_gpfs_storage_update
|
||||
non_native_pkgs=EXTERNALPKGS:gpfs.base-3.5.0-9.x86_64.update.rpm,EXTERNALPKGS:gpfs.gplbin*
|
||||
|
||||
kitcomponent:
|
||||
basename=gpfs_compute
|
||||
description=GPFS for compute nodes
|
||||
version=3.5.0
|
||||
release=9
|
||||
serverroles=compute,servicenode
|
||||
kitrepoid=sles11_x86_64
|
||||
#kitcompdeps=
|
||||
ospkgdeps=zypper
|
||||
kitpkgdeps=gpfs.libsrc >= 3.5.0,gpfs.src >= 3.5.0,gpfs.base >= 3.5.0,gpfs.gpl >= 3.5.0,gpfs.msg.en_US >= 3.5.0 ,gpfs.docs >= 3.5.0
|
||||
#driverpacks=
|
||||
exlist=gpfs.exlist
|
||||
postbootscripts=gpfs_mmsdrfs,gpfs_start,gpfs_config
|
||||
genimage_postinstall=sles_gpfs_compute_update
|
||||
non_native_pkgs=EXTERNALPKGS:gpfs.base-3.5.0-9.x86_64.update.rpm,EXTERNALPKGS:gpfs.gplbin*
|
||||
|
||||
kitcomponent:
|
||||
basename=min_gpfs_compute
|
||||
description=Minimal GPFS for compute nodes
|
||||
version=3.5.0
|
||||
release=9
|
||||
serverroles=compute,servicenode
|
||||
kitrepoid=sles11_x86_64
|
||||
#kitcompdeps=
|
||||
ospkgdeps=zypper
|
||||
kitpkgdeps=gpfs.libsrc >= 3.5.0,gpfs.src >= 3.5.0,gpfs.base >= 3.5.0,gpfs.gpl >= 3.5.0,gpfs.msg.en_US >= 3.5.0
|
||||
#driverpacks=
|
||||
exlist=min-gpfs.exlist
|
||||
postbootscripts=gpfs_mmsdrfs,gpfs_start,gpfs_config
|
||||
genimage_postinstall=sles_min_gpfs_compute_update
|
||||
non_native_pkgs=EXTERNALPKGS:gpfs.base-3.5.0-9.x86_64.update.rpm,EXTERNALPKGS:gpfs.gplbin*
|
||||
|
||||
kitcomponent:
|
||||
basename=gpfs_login
|
||||
description=GPFS for login nodes
|
||||
version=3.5.0
|
||||
release=9
|
||||
serverroles=login
|
||||
kitrepoid=sles11_x86_64
|
||||
#kitcompdeps=
|
||||
ospkgdeps=zypper
|
||||
kitpkgdeps=gpfs.libsrc >= 3.5.0,gpfs.src >= 3.5.0,gpfs.base >= 3.5.0,gpfs.gpl >= 3.5.0,gpfs.msg.en_US >= 3.5.0,gpfs.docs >= 3.5.0
|
||||
#driverpacks=
|
||||
exlist=gpfs.exlist
|
||||
postbootscripts=gpfs_mmsdrfs,gpfs_start,gpfs_config
|
||||
genimage_postinstall=sles_gpfs_login_update
|
||||
non_native_pkgs=EXTERNALPKGS:gpfs.base-3.5.0-9.x86_64.update.rpm,EXTERNALPKGS:gpfs.gplbin*
|
||||
|
||||
kitcomponent:
|
||||
basename=gpfs_storage
|
||||
description=GPFS for storage nodes
|
||||
version=3.5.0
|
||||
release=9
|
||||
serverroles=storage,servicenode
|
||||
kitrepoid=sles11_x86_64
|
||||
#kitcompdeps=
|
||||
ospkgdeps=zypper
|
||||
kitpkgdeps=gpfs.libsrc >= 3.5.0,gpfs.src >= 3.5.0,gpfs.base >= 3.5.0,gpfs.gpl >= 3.5.0,gpfs.msg.en_US >= 3.5.0,gpfs.docs >= 3.5.0
|
||||
#driverpacks=
|
||||
exlist=gpfs.exlist
|
||||
postbootscripts=gpfs_mmsdrfs,gpfs_start,gpfs_config_storage
|
||||
genimage_postinstall=sles_gpfs_storage_update
|
||||
non_native_pkgs=EXTERNALPKGS:gpfs.base-3.5.0-9.x86_64.update.rpm,EXTERNALPKGS:gpfs.gplbin*
|
||||
|
||||
|
||||
|
||||
# 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=gpfs.base-3.5.0-9.x86_64.rpm
|
||||
kitrepoid=rhels6_x86_64,sles11_x86_64
|
||||
# Method 1: Use pre-built RPM package
|
||||
isexternalpkg=yes
|
||||
|
||||
|
||||
kitpackage:
|
||||
filename=gpfs.gpl-3.5.0-9.noarch.rpm
|
||||
kitrepoid=rhels6_x86_64,sles11_x86_64
|
||||
# Method 1: Use pre-built RPM package
|
||||
isexternalpkg=yes
|
||||
|
||||
|
||||
kitpackage:
|
||||
filename=gpfs.docs-3.5.0-9.noarch.rpm
|
||||
kitrepoid=rhels6_x86_64,sles11_x86_64
|
||||
# Method 1: Use pre-built RPM package
|
||||
isexternalpkg=yes
|
||||
|
||||
|
||||
kitpackage:
|
||||
filename=gpfs.msg.en_US-3.5.0-9.noarch.rpm
|
||||
kitrepoid=rhels6_x86_64,sles11_x86_64
|
||||
# Method 1: Use pre-built RPM package
|
||||
isexternalpkg=yes
|
||||
|
||||
|
||||
kitpackage:
|
||||
filename=gpfs.src-3.5.0-9.noarch.rpm
|
||||
kitrepoid=rhels6_x86_64,sles11_x86_64
|
||||
# Method 1: Use pre-built RPM package
|
||||
isexternalpkg=yes
|
||||
|
||||
|
||||
kitpackage:
|
||||
filename=gpfs.libsrc-3.5.0-9.noarch.rpm
|
||||
kitrepoid=rhels6_x86_64,sles11_x86_64
|
||||
# Method 1: Use pre-built RPM package
|
||||
isexternalpkg=yes
|
||||
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>GPFS Documentation</TITLE>
|
||||
<meta http-equiv="REFRESH" content="0;url=http://publib.boulder.ibm.com/infocenter/clresctr/vxrx/topic/com.ibm.cluster.gpfs.doc/gpfsbooks.html"></HEAD>
|
||||
<BODY>
|
||||
Redirecting to:
|
||||
http://publib.boulder.ibm.com/infocenter/clresctr/vxrx/topic/com.ibm.cluster.gpfs.doc/gpfsbooks.html
|
||||
</BODY>
|
||||
</HTML>
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
./usr/lpp/mmfs/include*
|
||||
./usr/lpp/mmfs/samples*
|
||||
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
# Exclude list for building a minimal diskless image
|
||||
|
||||
./usr/lpp/mmfs/include*
|
||||
./usr/lpp/mmfs/samples*
|
||||
./usr/lpp/mmfs/src*
|
||||
+65
@@ -0,0 +1,65 @@
|
||||
#!/bin/sh
|
||||
|
||||
#
|
||||
# Sample script to install and configure GPFS
|
||||
# For AIX:
|
||||
# Assumes the GPFS filesets and updates were installed using
|
||||
# xCAT bundle files or some other mechanism. This script does not
|
||||
# install additional software.
|
||||
# It will do the following:
|
||||
# - create /var/mmfs/etc/nsddevices that simply returns 0
|
||||
# - add GPFS paths to profile
|
||||
# For Linux:
|
||||
# Assumes the base GPFS rpms were installed with the xCAT 'otherpkgs'
|
||||
# postscript (stateful install) or with the otherpkgs processing of
|
||||
# genimage (stateless/statelite install). This script will install any
|
||||
# gpfs update rpms that exist on the xCAT management node in the
|
||||
# /install/post/gpfs_updates directory.
|
||||
# This is necessary because the GPFS updates can ONLY be installed
|
||||
# after the base rpms have been installed, and the update rpms cannot
|
||||
# exist in any rpm repositories used by xCAT otherpkgs processing
|
||||
# since they will confuse rpm tools such as zypper and yum.
|
||||
# This script will also do the following:
|
||||
# - create /var/mmfs/etc/nsddevices that simply returns 0
|
||||
# - add GPFS paths to profile
|
||||
|
||||
OS=`uname`
|
||||
|
||||
# Create an empty nsddevices script for GPFS
|
||||
# This assumes that the node is NOT an NSD server
|
||||
if [ $OS != "AIX" ]; then
|
||||
# Create the script on the node
|
||||
mkdir -p /var/mmfs/etc
|
||||
echo 'return 0' > /var/mmfs/etc/nsddevices
|
||||
chmod 744 /var/mmfs/etc/nsddevices
|
||||
fi
|
||||
|
||||
|
||||
# Add GPFS path to profile
|
||||
if [ $OS != "AIX" ]; then
|
||||
gpfsprofile=/etc/profile.d/gpfs
|
||||
if [ ! -f "/proc/cmdline" ]; then
|
||||
gpfsprofile=$gpfsprofile
|
||||
fi
|
||||
if [ ! -e $gpfsprofile.sh ]; then
|
||||
echo 'export PATH=$PATH:/usr/lpp/mmfs/bin' > $gpfsprofile.sh
|
||||
echo 'setenv PATH $PATH:/usr/lpp/mmfs/bin' > $gpfsprofile.csh
|
||||
# Turn off LANG support since we did not install other msg catalogs
|
||||
echo 'export LC_CTYPE=POSIX' >> $gpfsprofile.sh
|
||||
echo 'setenv LC_CTYPE POSIX' >> $gpfsprofile.csh
|
||||
echo 'export LC_ALL=POSIX' >> $gpfsprofile.sh
|
||||
echo 'setenv LC_ALL POSIX' >> $gpfsprofile.csh
|
||||
chmod 744 $gpfsprofile.sh
|
||||
chmod 744 $gpfsprofile.csh
|
||||
fi
|
||||
fi
|
||||
|
||||
# If you are using a shared home directory stored in GPFS,
|
||||
# create the symbolic link
|
||||
#
|
||||
# GPFSHOME=/gpfs/home
|
||||
# HOMEDIR=/u
|
||||
# ln -s $GPFSHOME $HOMEDIR
|
||||
|
||||
|
||||
|
||||
+65
@@ -0,0 +1,65 @@
|
||||
#!/bin/sh
|
||||
|
||||
#
|
||||
# Sample script to install and configure GPFS
|
||||
# For AIX:
|
||||
# Assumes the GPFS filesets and updates were installed using
|
||||
# xCAT bundle files or some other mechanism. This script does not
|
||||
# install additional software.
|
||||
# It will do the following:
|
||||
# - create /var/mmfs/etc/nsddevices that simply returns 0
|
||||
# - add GPFS paths to profile
|
||||
# For Linux:
|
||||
# Assumes the base GPFS rpms were installed with the xCAT 'otherpkgs'
|
||||
# postscript (stateful install) or with the otherpkgs processing of
|
||||
# genimage (stateless/statelite install). This script will install any
|
||||
# gpfs update rpms that exist on the xCAT management node in the
|
||||
# /install/post/gpfs_updates directory.
|
||||
# This is necessary because the GPFS updates can ONLY be installed
|
||||
# after the base rpms have been installed, and the update rpms cannot
|
||||
# exist in any rpm repositories used by xCAT otherpkgs processing
|
||||
# since they will confuse rpm tools such as zypper and yum.
|
||||
# This script will also do the following:
|
||||
# - create /var/mmfs/etc/nsddevices that simply returns 0
|
||||
# - add GPFS paths to profile
|
||||
|
||||
OS=`uname`
|
||||
|
||||
## Create an empty nsddevices script for GPFS
|
||||
## This assumes that the node is NOT an NSD server
|
||||
#if [ $OS != "AIX" ]; then
|
||||
# # Create the script on the node
|
||||
# mkdir -p /var/mmfs/etc
|
||||
# echo 'return 0' > /var/mmfs/etc/nsddevices
|
||||
# chmod 744 /var/mmfs/etc/nsddevices
|
||||
#fi
|
||||
|
||||
|
||||
# Add GPFS path to profile
|
||||
if [ $OS != "AIX" ]; then
|
||||
gpfsprofile=/etc/profile.d/gpfs
|
||||
if [ ! -f "/proc/cmdline" ]; then
|
||||
gpfsprofile=$gpfsprofile
|
||||
fi
|
||||
if [ ! -e $gpfsprofile.sh ]; then
|
||||
echo 'export PATH=$PATH:/usr/lpp/mmfs/bin' > $gpfsprofile.sh
|
||||
echo 'setenv PATH $PATH:/usr/lpp/mmfs/bin' > $gpfsprofile.csh
|
||||
# Turn off LANG support since we did not install other msg catalogs
|
||||
echo 'export LC_CTYPE=POSIX' >> $gpfsprofile.sh
|
||||
echo 'setenv LC_CTYPE POSIX' >> $gpfsprofile.csh
|
||||
echo 'export LC_ALL=POSIX' >> $gpfsprofile.sh
|
||||
echo 'setenv LC_ALL POSIX' >> $gpfsprofile.csh
|
||||
chmod 744 $gpfsprofile.sh
|
||||
chmod 744 $gpfsprofile.csh
|
||||
fi
|
||||
fi
|
||||
|
||||
# If you are using a shared home directory stored in GPFS,
|
||||
# create the symbolic link
|
||||
#
|
||||
# GPFSHOME=/gpfs/home
|
||||
# HOMEDIR=/u
|
||||
# ln -s $GPFSHOME $HOMEDIR
|
||||
|
||||
|
||||
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
#!/bin/sh
|
||||
# xCAT postscript to configure GPFS on a stateless node.
|
||||
# Before booting nodes with this postscript, gpfs must be up and configured correctly on the node
|
||||
# pointed to by the -p flag below. The $MASTER environment variable will be set by xCAT to
|
||||
# the service node or management node of this booting node. If you want the nodes to get their
|
||||
# GPFS configuration from a different node, replace $MASTER with that IP address.
|
||||
|
||||
# The source server:location of the mmsdrfs file. Default is this xCAT MN.
|
||||
#SOURCE=gpfsmgr:/var/mmfs/gen/mmsdrfs
|
||||
SOURCE=/var/mmfs/gen/mmsdrfs
|
||||
|
||||
# The gpfsmgr which save the mmsdrfs file. generally it is XCATMASTER
|
||||
GPFSMGR=$MASTER
|
||||
|
||||
if [[ ! -z "$installroot" ]]; then
|
||||
OS=`uname`
|
||||
if [[ "$OS" != "AIX" ]]; then
|
||||
rsync -i -t $SOURCE $installroot/var/mmfs/gen/mmsdrfs
|
||||
if [[ $? != 0 ]]
|
||||
then
|
||||
echo "Error: rsync -i -t $SOURCE $installroot/var/mmfs/gen/mmsdrfs failed. Please make sure GPFS is configured correctly!"
|
||||
else
|
||||
echo "rsync -i -t $SOURCE $installroot/var/mmfs/gen/mmsdrfs succeed"
|
||||
fi
|
||||
exit
|
||||
fi
|
||||
else
|
||||
echo "Restoring GPFS configration file from server."
|
||||
/usr/lpp/mmfs/bin/mmsdrrestore -p $GPFSMGR -R /usr/bin/scp &
|
||||
fi
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Run this script as a postscript on any node (stateless, statefull,
|
||||
# full-disk install, AIX, Linux) to start the GPFS daemon
|
||||
#
|
||||
|
||||
# If you have any special network dependencies, you may want to add code
|
||||
# to check them first
|
||||
|
||||
/usr/lpp/mmfs/bin/mmstartup
|
||||
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [[ ! -z "$installroot" ]]; then
|
||||
if [ -n "`ls $installroot/opt/xcat/kits/gpfs/gpfs_compute-3.5.0-9-rhels-6-x86_64/*.rpm 2> /dev/null`" ] ; then
|
||||
rpm --force --root $installroot -Uvh $installroot/opt/xcat/kits/gpfs/gpfs_compute-3.5.0-9-rhels-6-x86_64/*.rpm
|
||||
fi
|
||||
else
|
||||
if [ -n "`ls /opt/xcat/kits/gpfs/gpfs_compute-3.5.0-9-rhels-6-x86_64/*.rpm 2> /dev/null`" ] ; then
|
||||
rpm --force -Uvh /opt/xcat/kits/gpfs/gpfs_compute-3.5.0-9-rhels-6-x86_64/*.rpm
|
||||
fi
|
||||
fi
|
||||
|
||||
exit 0
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [[ ! -z "$installroot" ]]; then
|
||||
if [ -n "`ls $installroot/opt/xcat/kits/gpfs/gpfs_login-3.5.0-9-rhels-6-x86_64/*.rpm 2> /dev/null`" ] ; then
|
||||
rpm --force --root $installroot -Uvh $installroot/opt/xcat/kits/gpfs/gpfs_login-3.5.0-9-rhels-6-x86_64/*.rpm
|
||||
fi
|
||||
else
|
||||
if [ -n "`ls /opt/xcat/kits/gpfs/gpfs_login-3.5.0-9-rhels-6-x86_64/*.rpm 2> /dev/null`" ] ; then
|
||||
rpm --force -Uvh /opt/xcat/kits/gpfs/gpfs_login-3.5.0-9-rhels-6-x86_64/*.rpm
|
||||
fi
|
||||
fi
|
||||
|
||||
exit 0
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [[ ! -z "$installroot" ]]; then
|
||||
if [ -n "`ls $installroot/opt/xcat/kits/gpfs/gpfs_storage-3.5.0-9-rhels-6-x86_64/*.rpm 2> /dev/null`" ] ; then
|
||||
rpm --force --root $installroot -Uvh $installroot/opt/xcat/kits/gpfs/gpfs_storage-3.5.0-9-rhels-6-x86_64/*.rpm
|
||||
fi
|
||||
else
|
||||
if [ -n "`ls /opt/xcat/kits/gpfs/gpfs_storage-3.5.0-9-rhels-6-x86_64/*.rpm 2> /dev/null`" ] ; then
|
||||
rpm --force -Uvh /opt/xcat/kits/gpfs/gpfs_storage-3.5.0-9-rhels-6-x86_64/*.rpm
|
||||
fi
|
||||
fi
|
||||
|
||||
exit 0
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [[ ! -z "$installroot" ]]; then
|
||||
if [ -n "`ls $installroot/opt/xcat/kits/gpfs/min_gpfs_compute-3.5.0-9-rhels-6-x86_64/*.rpm 2> /dev/null`" ] ; then
|
||||
rpm --force --root $installroot -Uvh $installroot/opt/xcat/kits/gpfs/min_gpfs_compute-3.5.0-9-rhels-6-x86_64/*.rpm
|
||||
fi
|
||||
else
|
||||
if [ -n "`ls /opt/xcat/kits/gpfs/min_gpfs_compute-3.5.0-9-rhels-6-x86_64/*.rpm 2> /dev/null`" ] ; then
|
||||
rpm --force -Uvh /opt/xcat/kits/gpfs/min_gpfs_compute-3.5.0-9-rhels-6-x86_64/*.rpm
|
||||
fi
|
||||
fi
|
||||
|
||||
exit 0
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [[ ! -z "$installroot" ]]; then
|
||||
if [ -n "`ls $installroot/opt/xcat/kits/gpfs/gpfs_compute-3.5.0-9-sles-11-x86_64/*.rpm 2> /dev/null`" ] ; then
|
||||
rpm --force --root $installroot -Uvh $installroot/opt/xcat/kits/gpfs/gpfs_compute-3.5.0-9-sles-11-x86_64/*.rpm
|
||||
fi
|
||||
else
|
||||
if [ -n "`ls /opt/xcat/kits/gpfs/gpfs_compute-3.5.0-9-sles-11-x86_64/*.rpm 2> /dev/null`" ] ; then
|
||||
rpm --force -Uvh /opt/xcat/kits/gpfs/gpfs_compute-3.5.0-9-sles-11-x86_64/*.rpm
|
||||
fi
|
||||
fi
|
||||
|
||||
exit 0
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [[ ! -z "$installroot" ]]; then
|
||||
if [ -n "`ls $installroot/opt/xcat/kits/gpfs/gpfs_login-3.5.0-9-sles-11-x86_64/*.rpm 2> /dev/null`" ] ; then
|
||||
rpm --force --root $installroot -Uvh $installroot/opt/xcat/kits/gpfs/gpfs_login-3.5.0-9-sles-11-x86_64/*.rpm
|
||||
fi
|
||||
else
|
||||
if [ -n "`ls /opt/xcat/kits/gpfs/gpfs_login-3.5.0-9-sles-11-x86_64/*.rpm 2> /dev/null`" ] ; then
|
||||
rpm --force -Uvh /opt/xcat/kits/gpfs/gpfs_login-3.5.0-9-sles-11-x86_64/*.rpm
|
||||
fi
|
||||
fi
|
||||
|
||||
exit 0
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [[ ! -z "$installroot" ]]; then
|
||||
if [ -n "`ls $installroot/opt/xcat/kits/gpfs/gpfs_storage-3.5.0-9-sles-11-x86_64/*.rpm 2> /dev/null`" ] ; then
|
||||
rpm --force --root $installroot -Uvh $installroot/opt/xcat/kits/gpfs/gpfs_storage-3.5.0-9-sles-11-x86_64/*.rpm
|
||||
fi
|
||||
else
|
||||
if [ -n "`ls /opt/xcat/kits/gpfs/gpfs_storage-3.5.0-9-sles-11-x86_64/*.rpm 2> /dev/null`" ] ; then
|
||||
rpm --force -Uvh /opt/xcat/kits/gpfs/gpfs_storage-3.5.0-9-sles-11-x86_64/*.rpm
|
||||
fi
|
||||
fi
|
||||
|
||||
exit 0
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [[ ! -z "$installroot" ]]; then
|
||||
if [ -n "`ls $installroot/opt/xcat/kits/gpfs/min_gpfs_compute-3.5.0-9-rhels-6-x86_64/*.rpm 2> /dev/null`" ] ; then
|
||||
rpm --force --root $installroot -Uvh $installroot/opt/xcat/kits/gpfs/min_gpfs_compute-3.5.0-9-rhels-6-x86_64/*.rpm
|
||||
fi
|
||||
else
|
||||
if [ -n "`ls /opt/xcat/kits/gpfs/min_gpfs_compute-3.5.0-9-rhels-6-x86_64/*.rpm 2> /dev/null`" ] ; then
|
||||
rpm --force -Uvh /opt/xcat/kits/gpfs/min_gpfs_compute-3.5.0-9-rhels-6-x86_64/*.rpm
|
||||
fi
|
||||
fi
|
||||
|
||||
exit 0
|
||||
@@ -25,7 +25,7 @@ kit:
|
||||
description=pessl for Linux
|
||||
version=4.2.0
|
||||
ostype=Linux
|
||||
kitlicense=IPLA
|
||||
kitlicense=ILAN
|
||||
kitdeployparams=pessl.env
|
||||
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ kit:
|
||||
description=pessl for Linux
|
||||
version=4.2.0
|
||||
ostype=Linux
|
||||
kitlicense=IPLA
|
||||
kitlicense=ILAN
|
||||
kitdeployparams=pessl.env
|
||||
|
||||
|
||||
|
||||
+14
-14
@@ -25,7 +25,7 @@ kit:
|
||||
description=Parallel Environment Runtime Edition
|
||||
version=1.3.0.0
|
||||
ostype=Linux
|
||||
kitlicense=IPLA
|
||||
kitlicense=ILAN
|
||||
kitdeployparams=pe.env
|
||||
|
||||
|
||||
@@ -109,7 +109,7 @@ kitcomponent:
|
||||
basename=pperte_compute
|
||||
description=PE RTE for compute nodes
|
||||
version=1.3.0.0
|
||||
release=1302a
|
||||
release=0
|
||||
serverroles=compute
|
||||
kitrepoid=rhels6_ppc64
|
||||
#kitcompdeps=
|
||||
@@ -124,7 +124,7 @@ kitcomponent:
|
||||
basename=min_pperte_compute
|
||||
description=Minimal PE RTE for compute nodes
|
||||
version=1.3.0.0
|
||||
release=1302a
|
||||
release=0
|
||||
serverroles=compute
|
||||
kitrepoid=rhels6_ppc64
|
||||
#kitcompdeps=
|
||||
@@ -139,7 +139,7 @@ kitcomponent:
|
||||
basename=pperte_login
|
||||
description=PE RTE for login nodes
|
||||
version=1.3.0.0
|
||||
release=1302a
|
||||
release=0
|
||||
serverroles=login
|
||||
kitrepoid=rhels6_ppc64
|
||||
#kitcompdeps=
|
||||
@@ -155,7 +155,7 @@ kitcomponent:
|
||||
basename=pperte_compute
|
||||
description=PE RTE for compute nodes
|
||||
version=1.3.0.0
|
||||
release=1302a
|
||||
release=0
|
||||
serverroles=compute
|
||||
kitrepoid=sles11_ppc64
|
||||
#kitcompdeps=
|
||||
@@ -170,7 +170,7 @@ kitcomponent:
|
||||
basename=min_pperte_compute
|
||||
description=Minimal PE RTE for compute nodes
|
||||
version=1.3.0.0
|
||||
release=1302a
|
||||
release=0
|
||||
serverroles=compute
|
||||
kitrepoid=sles11_ppc64
|
||||
#kitcompdeps=
|
||||
@@ -185,7 +185,7 @@ kitcomponent:
|
||||
basename=pperte_login
|
||||
description=PE RTE for login nodes
|
||||
version=1.3.0.0
|
||||
release=1302a
|
||||
release=0
|
||||
serverroles=login
|
||||
kitrepoid=sles11_ppc64
|
||||
#kitcompdeps=
|
||||
@@ -245,42 +245,42 @@ kitcomponent:
|
||||
|
||||
### RH6 ppc64 rpms
|
||||
kitpackage:
|
||||
filename=pperte-1.3.0.0-1302a.ppc64.rpm
|
||||
filename=pperte-1.3.0.0-*.ppc64.rpm
|
||||
kitrepoid=rhels6_ppc64,sles11_ppc64
|
||||
# Method 1: Use pre-built RPM package
|
||||
isexternalpkg=yes
|
||||
|
||||
|
||||
kitpackage:
|
||||
filename=pperteman-1.3.0.0-1302a.ppc64.rpm
|
||||
filename=pperteman-1.3.0.0-*.ppc64.rpm
|
||||
kitrepoid=rhels6_ppc64,sles11_ppc64
|
||||
# Method 1: Use pre-built RPM package
|
||||
isexternalpkg=yes
|
||||
|
||||
|
||||
kitpackage:
|
||||
filename=ppertesamples-1.3.0.0-1302a.ppc64.rpm
|
||||
filename=ppertesamples-1.3.0.0-*.ppc64.rpm
|
||||
kitrepoid=rhels6_ppc64,sles11_ppc64
|
||||
# Method 1: Use pre-built RPM package
|
||||
isexternalpkg=yes
|
||||
|
||||
|
||||
kitpackage:
|
||||
filename=ppe_rte_1300-1.3.0.0-1302a.ppc64.rpm
|
||||
filename=ppe_rte_1300-1.3.0.0-*.ppc64.rpm
|
||||
kitrepoid=rhels6_ppc64,sles11_ppc64
|
||||
# Method 1: Use pre-built RPM package
|
||||
isexternalpkg=yes
|
||||
|
||||
|
||||
kitpackage:
|
||||
filename=ppe_rte_man-1.3.0.0-1302a.ppc64.rpm
|
||||
filename=ppe_rte_man-1.3.0.0-*.ppc64.rpm
|
||||
kitrepoid=rhels6_ppc64,sles11_ppc64
|
||||
# Method 1: Use pre-built RPM package
|
||||
isexternalpkg=yes
|
||||
|
||||
|
||||
kitpackage:
|
||||
filename=ppe_rte_samples-1.3.0.0-1302a.ppc64.rpm
|
||||
filename=ppe_rte_samples-1.3.0.0-*.ppc64.rpm
|
||||
kitrepoid=rhels6_ppc64,sles11_ppc64
|
||||
# Method 1: Use pre-built RPM package
|
||||
isexternalpkg=yes
|
||||
@@ -296,7 +296,7 @@ kitpackage:
|
||||
|
||||
### License rpm gets placed in all repos
|
||||
kitpackage:
|
||||
filename=ppe_rte_license-1.3.0.0-1302a.ppc64.rpm
|
||||
filename=ppe_rte_license-1.3.0.0-*.ppc64.rpm
|
||||
kitrepoid=rhels6_ppc64,sles11_ppc64
|
||||
# Method 1: Use pre-built RPM package
|
||||
isexternalpkg=yes
|
||||
|
||||
+14
-14
@@ -25,7 +25,7 @@ kit:
|
||||
description=Parallel Environment Runtime Edition
|
||||
version=1.3.0.0
|
||||
ostype=Linux
|
||||
kitlicense=IPLA
|
||||
kitlicense=ILAN
|
||||
kitdeployparams=pe.env
|
||||
|
||||
|
||||
@@ -109,7 +109,7 @@ kitcomponent:
|
||||
basename=pperte_compute
|
||||
description=PE RTE for compute nodes
|
||||
version=1.3.0.0
|
||||
release=1302a
|
||||
release=0
|
||||
serverroles=compute
|
||||
kitrepoid=rhels6_x86_64
|
||||
#kitcompdeps=
|
||||
@@ -124,7 +124,7 @@ kitcomponent:
|
||||
basename=min_pperte_compute
|
||||
description=Minimal PE RTE for compute nodes
|
||||
version=1.3.0.0
|
||||
release=1302a
|
||||
release=0
|
||||
serverroles=compute
|
||||
kitrepoid=rhels6_x86_64
|
||||
#kitcompdeps=
|
||||
@@ -139,7 +139,7 @@ kitcomponent:
|
||||
basename=pperte_login
|
||||
description=PE RTE for login nodes
|
||||
version=1.3.0.0
|
||||
release=1302a
|
||||
release=0
|
||||
serverroles=login
|
||||
kitrepoid=rhels6_x86_64
|
||||
#kitcompdeps=
|
||||
@@ -155,7 +155,7 @@ kitcomponent:
|
||||
basename=pperte_compute
|
||||
description=PE RTE for compute nodes
|
||||
version=1.3.0.0
|
||||
release=1302a
|
||||
release=0
|
||||
serverroles=compute
|
||||
kitrepoid=sles11_x86_64
|
||||
#kitcompdeps=
|
||||
@@ -170,7 +170,7 @@ kitcomponent:
|
||||
basename=min_pperte_compute
|
||||
description=Minimal PE RTE for compute nodes
|
||||
version=1.3.0.0
|
||||
release=1302a
|
||||
release=0
|
||||
serverroles=compute
|
||||
kitrepoid=sles11_x86_64
|
||||
#kitcompdeps=
|
||||
@@ -185,7 +185,7 @@ kitcomponent:
|
||||
basename=pperte_login
|
||||
description=PE RTE for login nodes
|
||||
version=1.3.0.0
|
||||
release=1302a
|
||||
release=0
|
||||
serverroles=login
|
||||
kitrepoid=sles11_x86_64
|
||||
#kitcompdeps=
|
||||
@@ -245,42 +245,42 @@ kitcomponent:
|
||||
|
||||
### RH6 x86_64 rpms
|
||||
kitpackage:
|
||||
filename=pperte-1.3.0.0-1302a.x86_64.rpm
|
||||
filename=pperte-1.3.0.0-*.x86_64.rpm
|
||||
kitrepoid=rhels6_x86_64,sles11_x86_64
|
||||
# Method 1: Use pre-built RPM package
|
||||
isexternalpkg=yes
|
||||
|
||||
|
||||
kitpackage:
|
||||
filename=pperteman-1.3.0.0-1302a.x86_64.rpm
|
||||
filename=pperteman-1.3.0.0-*.x86_64.rpm
|
||||
kitrepoid=rhels6_x86_64,sles11_x86_64
|
||||
# Method 1: Use pre-built RPM package
|
||||
isexternalpkg=yes
|
||||
|
||||
|
||||
kitpackage:
|
||||
filename=ppertesamples-1.3.0.0-1302a.x86_64.rpm
|
||||
filename=ppertesamples-1.3.0.0-*.x86_64.rpm
|
||||
kitrepoid=rhels6_x86_64,sles11_x86_64
|
||||
# Method 1: Use pre-built RPM package
|
||||
isexternalpkg=yes
|
||||
|
||||
|
||||
kitpackage:
|
||||
filename=ppe_rte_1300-1.3.0.0-1302a.x86_64.rpm
|
||||
filename=ppe_rte_1300-1.3.0.0-*.x86_64.rpm
|
||||
kitrepoid=rhels6_x86_64,sles11_x86_64
|
||||
# Method 1: Use pre-built RPM package
|
||||
isexternalpkg=yes
|
||||
|
||||
|
||||
kitpackage:
|
||||
filename=ppe_rte_man-1.3.0.0-1302a.x86_64.rpm
|
||||
filename=ppe_rte_man-1.3.0.0-*.x86_64.rpm
|
||||
kitrepoid=rhels6_x86_64,sles11_x86_64
|
||||
# Method 1: Use pre-built RPM package
|
||||
isexternalpkg=yes
|
||||
|
||||
|
||||
kitpackage:
|
||||
filename=ppe_rte_samples-1.3.0.0-1302a.x86_64.rpm
|
||||
filename=ppe_rte_samples-1.3.0.0-*.x86_64.rpm
|
||||
kitrepoid=rhels6_x86_64,sles11_x86_64
|
||||
# Method 1: Use pre-built RPM package
|
||||
isexternalpkg=yes
|
||||
@@ -296,7 +296,7 @@ kitpackage:
|
||||
|
||||
### License rpm gets placed in all repos
|
||||
kitpackage:
|
||||
filename=ppe_rte_license-1.3.0.0-1302a.x86_64.rpm
|
||||
filename=ppe_rte_license-1.3.0.0-*.x86_64.rpm
|
||||
kitrepoid=rhels6_x86_64,sles11_x86_64
|
||||
# Method 1: Use pre-built RPM package
|
||||
isexternalpkg=yes
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user