Compare commits

...

94 Commits

Author SHA1 Message Date
bp-sawyers e0e6874bb5 Fix noderange bug 3572 by switching back to jarrod's bracket noderange fix
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@16276 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
2013-05-14 02:19:27 +00:00
bp-sawyers 8e3d1735a6 fix bug 3429 - noderange with multiple brackets do not show all nodes
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@16241 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
2013-05-10 17:39:20 +00:00
nott a5362a40a0 add check for blank file name
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@16238 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
2013-05-10 16:47:58 +00:00
zhaoertao f8b6035f94 fix bug 3562:"rspconfig cmm USERID=<password>" doesn't update password properly for existing hdwr connection
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@16232 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
2013-05-10 05:25:45 +00:00
daniceexi 32b8f7363e defect 3532: back port the change for flex support to 2.7
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@16118 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
2013-04-28 08:14:59 +00:00
ligc 9925cb7099 fix for bug 3533: rnetboot hang for Power5 servers
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@16098 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
2013-04-27 07:24:48 +00:00
zhaoertao 468d01294a fix bug 3531: New CMM firmware is adding node # \( textid \) wrapper around textd - breaks rscan -u
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@16089 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
2013-04-27 02:02:00 +00:00
jjhua 380928afe2 fixed bug 3354
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@16070 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
2013-04-26 02:25:30 +00:00
daniceexi fbb5188133 defect 3516: fixed the typo to handle the getnextdestiny result
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@16041 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
2013-04-23 08:33:20 +00:00
jjhua 796a855e9f fixed bug 3513
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@16018 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
2013-04-19 05:58:20 +00:00
jwsimpson 318c8a95b5 Updated to add onstandby and sms to usage
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@16010 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
2013-04-17 14:45:43 +00:00
daniceexi d366c51298 Backport the flex renergy management support from 2.8.1 to 2.7
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@16001 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
2013-04-17 07:09:24 +00:00
zhaoertao ab402d90a0 fix bug 3502 rspconfig support for USERID=<password> for CMM in genesis case
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@15996 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
2013-04-17 06:55:48 +00:00
yinle 44c9aea4e2 Continue to fix bug 3428 lsslp -n does not check xCAT DB properly for current objects, support matching cmm with MTMS.
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@15899 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
2013-04-09 12:14:18 +00:00
immarvin 312aec61c5 add /lib64/libnss_files.so.2 into initrd, this is needed by mount.nfs in sles11.2
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@15871 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
2013-04-08 08:16:27 +00:00
lissav 6a11d0230f fix for SF defect 3412
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@15765 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
2013-04-01 15:57:14 +00:00
zhaoertao eacf7bb705 fix bug:3451 New xCAT Support for mkhwconn -s and "sfp" for Flex P blades with HMC
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@15671 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
2013-03-27 11:39:08 +00:00
zhaoertao 66990705cf modify "rvitals <flex node> lcds" using pblade_query_lcds to get the lcds info
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@15633 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
2013-03-25 02:46:13 +00:00
jwsimpson e78a1a792a added support for TransAM
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@15615 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
2013-03-21 17:25:49 +00:00
nott a0348fa10b fix rmnimres subroutine
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@15611 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
2013-03-21 13:55:55 +00:00
immarvin 3593f5c5f6 fixed some syntax in storage.rhels6.tmpl, as some variables are no longer supported in the kickstart. rename storage.pglist to storage.pkglist
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@15598 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
2013-03-21 02:43:33 +00:00
jwsimpson 0aa1bb69f8 FSPpower.pm updated to allow sms
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@15540 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
2013-03-15 21:36:48 +00:00
jwsimpson 24daaf4167 lsslp Usage update to add FSP and IMM2 to -s option
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@15531 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
2013-03-15 13:41:25 +00:00
yinle e3e3950755 fix bug 3428: lsslp -n does not check xCAT DB properly for current objects
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@15529 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
2013-03-15 07:48:54 +00:00
yinle 36bc7c7ef7 fix the issue that lsslp put in the SLP request messages into the "stana" files working with lsslp -z flag
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@15526 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
2013-03-15 06:11:48 +00:00
yinle eac2017ebe fix the issue that lsslp put in the SLP request messages into the "stana" files working with lsslp -z flag
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@15524 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
2013-03-15 06:07:11 +00:00
jjhua ba6db26013 fixed bug 3259, disabled the the centos internet repos added by the os.
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@15494 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
2013-03-14 02:27:30 +00:00
jjhua be6c764c15 have the addsiteyum be called before running the postscripts, the repos might be needed by some other user customized scripts.
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@15492 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
2013-03-14 02:23:59 +00:00
jwsimpson afb39ee9f6 Updated to skip Flex power blades when "-s CEC" is specified - also corrected model to not filter on 8236 for flex
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@15486 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
2013-03-13 19:16:19 +00:00
yinle 29af239759 fix bug 3413 lssp -s CEC not finding FSP for P7 740 server on 70 NGP HW
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@15474 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
2013-03-13 09:38:16 +00:00
daniceexi 1789b73dc7 defect 3195: change the search pattern to the uxspi binary path
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@15460 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
2013-03-12 11:13:45 +00:00
immarvin 7e88064d17 support rhels6.4 for ppc64 and x86_64
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@15384 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
2013-03-05 07:02:02 +00:00
lissav 8745f3716a fix defect 3401
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@15370 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
2013-03-04 16:42:23 +00:00
jwsimpson 31f33bdc6e lsslp.pm updated to remove CEC entries for p flex blades. Also added support for imm2.
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@15353 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
2013-03-01 21:07:28 +00:00
billwajda 1800b644a4 fix sf bug 3363 - updated chvm manpage for P 775 info
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@15347 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
2013-03-01 19:06:06 +00:00
billwajda 83c7a6c518 fix sf bug 3363 - modified FSPvm.pm to not allow incorrect -m parameter
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@15346 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
2013-03-01 19:04:59 +00:00
lissav 136a29d4cc add crontab -l, putting in 2.7 because this really was for the P7IH support
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@15334 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
2013-03-01 13:40:06 +00:00
sjing 760f6bba6e sync the fix for bug 3144.
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@15313 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
2013-03-01 06:31:30 +00:00
lissav 4fd19c1cb3 add crontab -l
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@15263 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
2013-02-26 16:00:52 +00:00
zhaoertao 2fc43ee369 fix bug 3382:"rvitals cec lcds" no output
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@15240 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
2013-02-22 09:17:27 +00:00
jjhua db9f372318 the wrong repository path on sles, correct it
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@15235 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
2013-02-22 05:49:59 +00:00
zhaoertao 2579006170 enhancement for 'rvitals <Flex node> all' to display 'lcds' infomaiton in case no 'nodetype' attribute defined in 'mp' table
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@15234 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
2013-02-22 05:28:49 +00:00
jjhua 2e08e93f6a fixed bug 3338, for aix, get the ib information with node name through iblinkinfo -l on the HSM
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@15053 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
2013-02-05 06:53:29 +00:00
jjhua ef3f6264a1 fixed bug 3338, for aix, get the ib information with node name through iblinkinfo -l on the HSM
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@15052 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
2013-02-05 06:52:49 +00:00
jbjohnso 4d822dc512 Have kvm tolerate trailing / on vm.storage dir:// urls
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@15041 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
2013-02-01 21:41:35 +00:00
jbjohnso 365e767cee Correct problem where /// regexes corrupt other substitutions
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@15020 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
2013-01-30 16:32:50 +00:00
jbjohnso 6b85f59313 Have IPMI tolerate incorrect rqaddr field to communicate with buggy BMCs that don't comply to the spec
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@15012 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
2013-01-29 20:10:14 +00:00
jbjohnso d6ac310ac4 Have SLP accept unicast fragmented UDP packets to get more data
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@15011 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
2013-01-29 19:55:49 +00:00
wanghuaz 94790e7adb Fixing bug 3257: Updated PE exlist for PE1200/1209/1300/
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@14995 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
2013-01-25 09:07:43 +00:00
bp-sawyers db4608c4f4 add pasu cmd and man page
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@14986 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
2013-01-24 16:54:17 +00:00
wanghuaz c8c259b87d Fixing bug 3180: use >> to avoid overwrite the same file
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@14979 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
2013-01-24 10:14:39 +00:00
zhaoertao c52d9e4173 fix bug 3119:rvitals returns error when using more than 7 nodes at a time
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@14961 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
2013-01-23 09:29:57 +00:00
wanghuaz d9f1cddbe2 Fixing bug 3207, setting /var/mmfs to be persistent caused performance problem for GPFS.
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@14946 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
2013-01-22 14:30:11 +00:00
bp-sawyers efc0943a60 Fixed error msg when getpostscript.pm can not match node name, to show original name
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@14925 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
2013-01-18 22:23:11 +00:00
daniceexi 08e280ab0d defect 3287:avoid to running gettyset for rh6 and higher
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@14891 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
2013-01-15 13:54:57 +00:00
daniceexi e5f6a985ee defect 3287:avoid to running gettyset for sles11 and higher
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@14889 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
2013-01-15 13:19:00 +00:00
sjing b09d4b62d0 Sync fix for bug 3202
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@14878 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
2013-01-15 02:35:49 +00:00
daniceexi 3237dc7029 make the centos to support dracut
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@14870 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
2013-01-14 06:59:51 +00:00
wanghuaz 5ad03e3ea3 Update gpfs_mmsdrfs to use mmsdrrestore to restore gpfs config file
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@14804 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
2013-01-08 13:57:05 +00:00
daniceexi 6ce7c4a5ed Make sure the hostname has been set before configure the statelite
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@14797 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
2013-01-08 06:34:44 +00:00
daniceexi 028c57b77f add the option check for litefile
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@14795 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
2013-01-08 06:31:40 +00:00
yinle e39dd3b483 Fix bug 2654, waring message for "rnetboot -m -r" misses information.
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@14777 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
2013-01-07 09:08:18 +00:00
lissav 50d9b30366 fix for defect 3267
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@14739 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
2013-01-03 16:02:24 +00:00
linggao d147b6fab4 fixed defect 3266
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@14735 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
2013-01-02 22:11:43 +00:00
lissav e55ac17bbf fix defect 3203
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@14723 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
2013-01-02 14:33:50 +00:00
lissav 94feb79653 Fix incorrect info
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@14707 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
2012-12-24 11:48:53 +00:00
zhaoertao d0d7d0fca7 fix bug 3262:rflash firmware update with --activate concurrent to HMC CEC powerd off CEC
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@14701 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
2012-12-21 09:04:57 +00:00
yinle c07e084196 Fix bug #2987 getmacs -o has some issues.
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@14700 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
2012-12-21 08:36:17 +00:00
yinle f0e1f5fd21 Fix bug #2986 getmacs -h missing -o option
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@14697 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
2012-12-21 08:30:29 +00:00
jjhua b1d7fe518d fixed bug 3259, remove the old yum repo before addsiteyum
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@14684 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
2012-12-19 07:53:43 +00:00
daniceexi aadf88afd8 fix a typo that output of postscript could not be written to /var/log/xcat/xcat.log
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@14673 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
2012-12-18 03:08:13 +00:00
daniceexi c0a425a610 fix a typo that output of postscript could not be written to /var/log/xcat/xcat.log
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@14672 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
2012-12-18 03:07:10 +00:00
daniceexi 64edcd07cd Fixed the hang issue of reboot/shutdown a nfs-based statelite node
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@14633 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
2012-12-12 08:07:33 +00:00
phamt db9d0474a1 Fixed clone error because of missing plugin.
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@14613 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
2012-12-11 03:31:40 +00:00
ligc c88186c3b2 fix a typo in my_nets, to not throw away all the remote networks
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@14611 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
2012-12-11 02:40:31 +00:00
lissav 2679d81c3e document device support
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@14606 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
2012-12-10 14:28:54 +00:00
lissav a72ebc81ed Add support for sinv to devices
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@14605 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
2012-12-10 14:18:46 +00:00
lissav cd82e2ed40 fix osimage example
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@14603 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
2012-12-10 13:52:36 +00:00
ligc 0124789e7c undo fix for bug 3393278: should fix some where else, external behaviour of nodels <empty_group> is changed and some customer is affected
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@14600 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
2012-12-10 08:56:03 +00:00
lissav d709219803 add examples of running against an image
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@14595 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
2012-12-09 11:43:49 +00:00
jjhua 3c3612546a currently, our ospkgs script in xCAT 2.7 doesn't work. Fixed it
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@14583 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
2012-12-07 09:34:39 +00:00
zhaoertao 5baf467a50 reventlog supporting Firebird through CMM
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@14580 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
2012-12-07 06:47:44 +00:00
ligc b1634bdf06 fix for bug 3221: check if the attributes specified with -i are valid attributes
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@14573 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
2012-12-06 14:02:09 +00:00
zhaoertao 1a844bae71 update rbeacon manpage
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@14569 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
2012-12-06 08:06:31 +00:00
zhaoertao 253a919d38 fix bug 3218: Support 'rbeacon' for Firebird blade
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@14568 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
2012-12-06 07:17:12 +00:00
zhaoertao 3217183ffb fix bug 3194: power usage NOSUCHINSTANCE in firebird plus
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@14566 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
2012-12-06 05:58:13 +00:00
zhaoertao 46d9b6345c fix bug 3185: rvitals NODE lcds has no output on rhels6.2 and NGP Flex blades
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@14564 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
2012-12-06 03:26:05 +00:00
phamt 7ca468b29b Switch over to Utils.pm instead of TableUtils.pm
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@14562 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
2012-12-05 16:14:34 +00:00
zhaoertao 0638e0cf77 update rbeacon manpage, rbeacon supporting Firebird will be included in the next release
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@14554 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
2012-12-05 06:56:50 +00:00
daniceexi 80f583859f fixed the issue that tftp could not be started on sles10
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@14551 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
2012-12-05 02:57:17 +00:00
daniceexi a1e9904375 defect 3213: sync the fix that moving pid location from /tmp/xcat to /var/run/xcat to xCATsn.spec
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@14537 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
2012-12-04 09:21:47 +00:00
ligc 2732e1f90d fix for bug 3208: exclude eventlog and auditlog with lsdef -a, performance improvements for lsdef -t eventlog and lsdef -t auditlog
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@14533 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
2012-12-04 05:56:28 +00:00
phamt 7c624d9026 Fixed bug in chhypervisor --resetsmapi
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@14510 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
2012-11-30 18:33:33 +00:00
lissav 9aaae028f2 update Version
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@14507 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
2012-11-30 12:21:39 +00:00
71 changed files with 1943 additions and 668 deletions
+1 -1
View File
@@ -1 +1 @@
2.7.6
2.7.7
-4
View File
@@ -408,10 +408,6 @@ sub plugin_command {
$req->{emptynoderange} = [1];
}
if(@nodes == 0 ) {
print "No nodes or noderanges specified\n";
return 1;
}
}
if (@nodes) { $req->{node} = \@nodes; }
my %unhandled_nodes;
+46 -2
View File
@@ -395,6 +395,44 @@ sub getobjdefs
xCAT::MsgUtils->message("E", $rsp, $::callback);
}
}
} elsif (($objtype eq 'auditlog') || ($objtype eq 'eventlog')) {
# Special case for auditlog/eventlog
# All the auditlog/eventlog attributes are in auditlog/eventlog table,
# Do not need to read the table multiple times for each attribute.
# The auditlog/eventlog is likely be very big over time,
# performance is a big concern with the general logic
my @TableRowArray = xCAT::DBobjUtils->getDBtable($objtype);
foreach my $objname (sort @{$type_obj{$objtype}}) {
if (@TableRowArray)
{
my $foundinfo = 0;
foreach my $entry (@TableRowArray)
{
if ($entry->{recid} eq $objname)
{
foreach my $k (keys %{$entry})
{
# recid is the object name, do not need to be in the attributes list
if ($k eq 'recid') { next; }
if (defined($entry->{$k}) ) {
$foundinfo++;
if ($verbose == 1) {
$objhash{$objname}{$k} = "$entry->{$k}\t(Table:$objtype - Key:$k)";
} else {
$objhash{$objname}{$k} = $entry->{$k};
}
}
}
if ($foundinfo)
{
$objhash{$objname}{'objtype'} = $objtype;
}
# There should not be multiple entries with the same recid
last;
} # end if($entry->
} # end foreach my $entry
} # end if(@TableTowArray
} # end foreach my $objname
} else {
# get the object type decription from Schema.pm
my $datatype = $xCAT::Schema::defspec{$objtype};
@@ -2115,7 +2153,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};
@@ -2126,13 +2164,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
}
+6 -1
View File
@@ -69,7 +69,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};
@@ -78,6 +78,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) ) {
@@ -175,6 +178,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;
}
+8 -1
View File
@@ -215,7 +215,7 @@ sub rnetboot {
my $options = $request->{opt};
my $hwtype = @$exp[2];
my $result;
my $name;
my $name = $request->{node};
my $callback = $request->{callback};
#####################################
# Get node data
@@ -238,6 +238,13 @@ sub rnetboot {
C => $o->{client},
m => $o->{mac}
);
#####################################
# Parse node range
#####################################
if ($name =~ /ARRAY/) {
$name = join(',', @$name);
}
#####################################
# Strip colons from mac address
#####################################
+1 -1
View File
@@ -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);
}
+6 -1
View File
@@ -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/ ) {
if( $type eq "lpar" ) {
$action = "query_lcds";
} elsif ($type eq "blade") {
$action = "pblade_query_lcds";
} else {
$action = "cec_query_lcds";
}
+11 -2
View File
@@ -202,8 +202,11 @@ sub chvm_parse_args {
# pending memory interleaving mode (1- interleaved, 2- non-interleaved)
# non-interleaved mode means the memory cannot be shared across the processors in an octant.
# interleaved means the memory can be shared.
# non-interleaved mode: Memory allocations are only interleaved across the two
# memory controllers on a local chip in the octant
# interleaved mode: Memory allocations are interleaved evenly across all eight
# memory controllers in the octant
# Note: A octant with partition value 2-5 can not be set with memory interleaving = 1.
if( exists($opt{m}) ) {
if( $opt{m} =~ /^interleaved$/ || $opt{m} =~ /^1$/ ) {
$opt{m} = 1;
@@ -238,6 +241,9 @@ sub chvm_parse_args {
if( grep(/^$subelems[1]$/, @ratio ) != 1) {
return(usage( "Invalid octant configuration value in $elem.\n For Power 775, octant configuration values only could be 1, 2, 3, 4, 5. Please see the details in manpage of chvm." ));
}
if( $opt{m} == 1 && $subelems[1] > 1 ) {
return(usage("Need to specify \"-m 2\" when specifying an octant configuration value greater than 1. Error!"));
}
if( exists($octant_cfg{$subelems[0]}) && $octant_cfg{$subelems[0]} == $subelems[1] ) {
return(usage("In the octant configuration rule, same octant with different octant configuration value. Error!"));
}
@@ -249,6 +255,9 @@ sub chvm_parse_args {
if( $left < 0 || $left > 7 || $right < 0 || $right > 7) {
return(usage("Octant ID only could be 0 to 7 in the octant configuration rule $elem"));
}
if( $opt{m} == 1 && $subelems[1] > 1 ) {
return(usage("Need to specify \"-m 2\" when specifying an octant configuration value greater than 1. Error!"));
}
if($left == $right) {
if( grep(/^$subelems[1]$/, @ratio ) != 1) {
return(usage( "Invalid octant configuration value in $elem.\n For Power 775, octant configuration values only could be 1, 2, 3, 4, 5. Please see the details in manpage of chvm." ));
+4
View File
@@ -1134,6 +1134,10 @@ sub dolitesetup
# $file could be full path file name or dir name
# ex. /foo/bar/ or /etc/lppcfg
my ($node, $option, $file) = split (/\|/, $line);
if (!$file) {
next;
}
# ex. .../inst_root/foo/bar/ or .../inst_root/etc/lppcfg
my $instrootfile = $instrootloc . $file;
+36 -7
View File
@@ -1849,6 +1849,14 @@ sub boot_network {
$state = $newstate[$state];
}
],
# For some old firmware, does not output "----"
[qr/BOOTP/=>
sub {
nc_msg ($verbose, $msg[$state]);
$rconsole->clear_accum();
$state = $newstate[$state];
}
],
[qr/]/=>
sub {
nc_msg($verbose, "Unexpected prompt\n");
@@ -1917,7 +1925,28 @@ sub Boot {
#],
[qr/BOOTP/=> #-ex
sub {
nc_msg($verbose, "# Network boot proceeding, exiting.\n");
nc_msg($verbose, "# Network boot proceeding - matched BOOTP, exiting.\n");
$rconsole->clear_accum();
}
],
# Welcome to AIX - some old firmware does not output BOOTP or ----
[qr/Welcome/=> #-ex
sub {
nc_msg($verbose, "# Network boot proceeding - matched Welcome, exiting.\n");
$rconsole->clear_accum();
}
],
# tftp file download - some old firmware does not output BOOTP or ----
[qr/FILE/=> #-ex
sub {
nc_msg($verbose, "# Network boot proceeding - matched FILE.\n");
$rconsole->clear_accum();
}
],
# some old firmware does not output BOOTP or ----
[qr/Elapsed/=> #-ex
sub {
nc_msg($verbose, "# Network boot proceeding - matched Elapsed, exiting.\n");
$rconsole->clear_accum();
}
],
@@ -3148,12 +3177,12 @@ sub lparnetbootexp
}
],
);
return [1] if ($rc eq 1);
}
nc_msg($verbose, "# bootp sent over network.\n");
$rc = Boot($rconsole, $node, $verbose);#, @expect_out);
unless ($rc eq 0) {
nc_msg($verbose, "Can't boot here. \n");
return [1] if ($rc eq 1);
nc_msg($verbose, "# bootp sent over network.\n");
$rc = Boot($rconsole, $node, $verbose);#, @expect_out);
unless ($rc eq 0) {
nc_msg($verbose, "Can't boot here. \n");
}
}
}
+11 -8
View File
@@ -189,12 +189,13 @@ sub expandatom { #TODO: implement table selection as an atom (nodetype.os==rhels
@allnodeset = $nodelist->getAllAttribs('node','groups');
%allnodehash = map { $_->{node} => 1 } @allnodeset;
}
my $verify = (scalar(@_) == 1 ? shift : 1);
my $verify = (scalar(@_) >= 1 ? shift : 1);
my %args = @_;
my @nodes= ();
#TODO: these env vars need to get passed by the client to xcatd
my $nprefix=(defined ($ENV{'XCAT_NODE_PREFIX'}) ? $ENV{'XCAT_NODE_PREFIX'} : 'node');
my $nsuffix=(defined ($ENV{'XCAT_NODE_SUFFIX'}) ? $ENV{'XCAT_NODE_SUFFIX'} : '');
if ($allnodehash{$atom}) { #The atom is a plain old nodename
if (not $args{genericrange} and $allnodehash{$atom}) { #The atom is a plain old nodename
return ($atom);
}
if ($atom =~ /^\(.*\)$/) { # handle parentheses by recursively calling noderange()
@@ -208,6 +209,7 @@ sub expandatom { #TODO: implement table selection as an atom (nodetype.os==rhels
}
# Try to match groups?
unless ($args{genericrange}) {
unless ($grptab) {
$grptab = xCAT::Table->new('nodegroup');
}
@@ -269,6 +271,7 @@ sub expandatom { #TODO: implement table selection as an atom (nodetype.os==rhels
}
}
}
}
if ($atom =~ m/[=~]/) { #TODO: this is the clunky, slow code path to acheive the goal. It also is the easiest to write, strange coincidence. Aggregating multiples would be nice
my @nodes;
@@ -287,7 +290,7 @@ sub expandatom { #TODO: implement table selection as an atom (nodetype.os==rhels
}
if ($atom =~ m/^[0-9]+\z/) { # if only numbers, then add the prefix
my $nodename=$nprefix.$atom.$nsuffix;
return expandatom($nodename,$verify);
return expandatom($nodename,$verify,%args);
}
my $nodelen=@nodes;
if ($nodelen > 0) {
@@ -322,12 +325,12 @@ sub expandatom { #TODO: implement table selection as an atom (nodetype.os==rhels
$subrange=$subrange."$start$subelem" . ($morebrackets?'':$ending) . "$subop";
}
foreach (split /,/,$subrange) {
my @newnodes=expandatom($_, ($morebrackets?0:$verify));
my @newnodes=expandatom($_, ($morebrackets?0:$verify), genericrange=>$morebrackets);
if (!$morebrackets) { push @nodes,@newnodes; }
else {
# for each of the new nodes, add the 2nd brackets and then expand
foreach my $n (@newnodes) {
push @nodes, expandatom("$n$ending", $verify);
push @nodes, expandatom("$n$ending", $verify, %args);
}
}
}
@@ -349,7 +352,7 @@ sub expandatom { #TODO: implement table selection as an atom (nodetype.os==rhels
$suf=$nsuffix;
}
foreach ("$startnum".."$endnum") {
my @addnodes=expandatom($pref.$_.$suf,$verify);
my @addnodes=expandatom($pref.$_.$suf,$verify,%args);
@nodes=(@nodes,@addnodes);
}
return (@nodes);
@@ -376,7 +379,7 @@ sub expandatom { #TODO: implement table selection as an atom (nodetype.os==rhels
$right=$2;
}
if ($left eq $right) { #if they said node1-node1 for some strange reason
return expandatom($left,$verify);
return expandatom($left,$verify,%args);
}
my @leftarr=split(/(\d+)/,$left);
my @rightarr=split(/(\d+)/,$right);
@@ -413,7 +416,7 @@ sub expandatom { #TODO: implement table selection as an atom (nodetype.os==rhels
}
}
foreach ($leftarr[$idx]..$rightarr[$idx]) {
my @addnodes=expandatom($prefix.$_.$luffix,$verify);
my @addnodes=expandatom($prefix.$_.$luffix,$verify,%args);
push @nodes,@addnodes;
}
return (@nodes); #the return has been built, return, exiting loop and all
+24 -9
View File
@@ -98,7 +98,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 )
{
@@ -106,7 +106,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"));
}
@@ -484,8 +484,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 {
@@ -515,12 +516,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');
@@ -703,7 +709,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
############################
@@ -720,10 +726,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)
{
+9
View File
@@ -74,6 +74,15 @@ sub parse_args {
return(usage( "Invalid Argument: $ARGV[0]" ));
}
####################################
# Check -o argument
####################################
if ( exists($opt{o}) ) {
unless (exists($opt{D})){
return(usage( "The -o flag must be used with -D flag" ));
}
}
####################################
# Check argument for ping test
####################################
if ( exists($opt{D}) ) {
+13 -9
View File
@@ -533,18 +533,22 @@ sub get_lic_filenames {
#############
if($fff ne $2) {
$upgrade_required = 1;
if($activate ne "disruptive") {
$msg = "Option --activate's value should be 'disruptive'";
return ("", "","", $msg, -1);
}
} else {
if(($pns eq $1) && ($4 <= $active_level)) {
$msg = $msg. "Upgrade $mtms $activate!";
# if($activate ne "concurrent") {
# $msg = "Option --actviate's value should be disruptive";
# return ("", "","", $msg, -1);
# }
if(($pns eq $1) && ($3 > $active_level) && ($4 <= $active_level)) {
$msg = $msg. "Upgrade $mtms $activate!";
if($activate ne "concurrent") {
$msg = "Option --actviate's value should be 'concurrent'";
return ("", "","", $msg, -1);
}
} else {
$msg = $msg . "Upgrade $mtms!";
if($activate !~ /^(disruptive|concurrent)$/) {
$msg = "Option --activate's value shouldn't be $activate, and it must be disruptive or concurrent";
$msg = $msg . "Upgrade $mtms!";
if($activate ne "disruptive") {
$msg = "Option --activate's value should be 'disruptive'";
return ("", "","", $msg, -1);
}
}
+30 -3
View File
@@ -60,9 +60,10 @@ sub usage
" -p <template path> [-o output file ] [-t <template count>]\n";
my $usagemsg4 = " [-r remove templates] [-s <seednode>]\n";
my $usagemsg5 = " [-e exactmatch] [-i ignore] [-V verbose]\n";
my $usagemsg5A = " [-l userid] [--devicetype type_of_device]\n";
my $usagemsg6 = " {-c <command> | -f <command file>}";
my $usagemsg .= $usagemsg1 .= $usagemsg1a .= $usagemsg3 .= $usagemsg4 .=
$usagemsg5 .= $usagemsg6;
$usagemsg5 .= $usagemsg5A .= $usagemsg6;
### end usage mesage
my $rsp = {};
@@ -110,6 +111,8 @@ sub parse_and_run_sinv
's|seed=s' => \$options{'seed_node'},
'e|exactmatch' => \$options{'exactmatch'},
'i|ignorefirst' => \$options{'ignorefirst'},
'l|user=s' => \$options{'user'},
'devicetype|devicetype=s' => \$options{'devicetype'},
'c|cmd=s' => \$options{'sinv_cmd'},
'f|file=s' => \$options{'sinv_cmd_file'},
'v|version' => \$options{'version'},
@@ -198,14 +201,36 @@ sub parse_and_run_sinv
# strip off the program and the noderange
#
my @nodelist = ();
my @cmdparts = split(' ', $cmd);
my @cmdparts = ();
if ($options{'devicetype'}) {
# must split different because devices have commands with spaces
@cmdparts = split(' ', $cmd,3);
} else {
@cmdparts = split(' ', $cmd);
}
my $cmdtype = shift @cmdparts;
my $noderange = shift @cmdparts;
my @cmd = ();
if ($noderange =~ /^-/)
if ($noderange =~ /^-/) # if imageupdate not node
{ # no noderange
push @cmd, $noderange; # put flag back on command
}
# root is sending the command
my @envs;
# if -l user id supplied
if ($options{'user'}) {
push @cmd,"-l";
push @cmd,$options{'user'};
push @envs,"DSH_TO_USERID=$options{'user'}";
}
# if device type supplied
if ($options{'devicetype'}) {
push @cmd,"--devicetype";
my $switchtype = $options{'devicetype'};
$switchtype =~ s/::/\//g;
push @cmd,$switchtype;
}
foreach my $part (@cmdparts)
{
@@ -471,6 +496,7 @@ sub parse_and_run_sinv
{
command => [$cmdtype],
node => \@seed,
env => [@envs],
arg => [@cmd]
},
\&$cmdoutput
@@ -500,6 +526,7 @@ sub parse_and_run_sinv
{
command => [$cmdtype],
node => \@nodelist,
env => [@envs],
arg => [@cmd]
},
\&$cmdoutput
+9 -7
View File
@@ -91,7 +91,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);
}
@@ -117,7 +117,7 @@ sub dodiscover {
# receive untill there is none
########################################
while ($waitforsocket->can_read(0)) {
my $peer = $args{'socket'}->recv($slppacket,1400,0);
my $peer = $args{'socket'}->recv($slppacket,3000,0);
push @peerarray, $peer;
push @pkgarray, $slppacket;
}
@@ -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);
}
@@ -394,9 +394,11 @@ sub send_service_request_single {
$ipnum= $ipnum | (2**(32-$maskbits))-1;
my $bcastn = pack("N",$ipnum);
my $bcastaddr = sockaddr_in(427,$bcastn);
$socket->sockopt(SO_BROADCAST, 1) or die("sockopt: $!\n");
$socket->send($packet,0,$bcastaddr);
setsockopt($socket,0,IP_MULTICAST_IF,$ipn);
$socket->send($packet,0,$ipv4sockaddr);
$socket->send($packet,0,$bcastaddr);
}
}
}
+3 -2
View File
@@ -2314,8 +2314,9 @@ sub getNodeAttribs
my $exp = substr($datum->{$attrib}, 1);
chop $exp;
my @parts = split('/', $exp, 2);
$node =~ s/$parts[0]/$parts[1]/;
$datum->{$attrib} = $node;
my $retval = $node;
$retval =~ s/$parts[0]/$parts[1]/;
$datum->{$attrib} = $retval;
}
elsif ($datum->{$attrib} =~ /^\|.*\|.*\|$/)
{
+21 -7
View File
@@ -36,7 +36,7 @@ my %usage = (
LPAR(using Direct FSP Management) specific:
rpower <noderange> [on|off|reset|stat|state|boot|of|sms]
Blade(using Direct FSP Management) specific:
rpower <noderange> [on|off|cycle|state]
rpower <noderange> [on|onstandby|off|cycle|state|sms]
Blade(using AMM) specific:
rpower <noderange> [cycle|softoff] [-V|--verbose]
zVM specific:
@@ -185,7 +185,7 @@ my %usage = (
PPC specific:
getmacs <noderange> [-F filter]
getmacs <noderange> [-M]
getmacs <noderange> [-V| --verbose] [-f] [-d] [--arp] | [-D [-S server] [-G gateway] [-C client]]
getmacs <noderange> [-V| --verbose] [-f] [-d] [--arp] | [-D [-o] [-S server] [-G gateway] [-C client]]
blade specific:
getmacs <noderange> [-V| --verbose] [-d] [--arp] [-i ethN|enN]
",
@@ -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]",
"rflash" =>
"Usage:
@@ -317,10 +317,24 @@ my %usage = (
renergy noderange [-V] { all | { [savingstatus] [dsavingstatus] [cappingstatus] [cappingmaxmin] [cappingvalue] [cappingsoftmin] [averageAC] [averageDC] [ambienttemp] [exhausttemp] [CPUspeed] [syssbpower] [sysIPLtime] [fsavingstatus] [ffoMin] [ffoVmin] [ffoTurbo] [ffoNorm] [ffovalue] } }
renergy noderange [-V] { {savingstatus}={on | off} | {dsavingstatus}={on-norm | on-maxp | off} | {fsavingstatus}={on | off} | {ffovalue}=MHZ | {cappingstatus}={on | off} | {cappingwatt}=watt | {cappingperc}=percentage }
Blade specific :
renergy noderange [-V] { all | pd1all | pd2all | { [pd1status] [pd2status] [pd1policy] [pd2policy] [pd1powermodule1] [pd1powermodule2] [pd2powermodule1] [pd2powermodule2] [pd1avaiablepower] [pd2avaiablepower] [pd1reservedpower] [pd2reservedpower] [pd1remainpower] [pd2remainpower] [pd1inusedpower] [pd2inusedpower] [availableDC] [averageAC] [thermaloutput] [ambienttemp] [mmtemp] } }
renergy noderange [-V] { all | { [averageDC] [capability] [cappingvalue] [CPUspeed] [maxCPUspeed] [savingstatus] [dsavingstatus] } }
renergy noderange [-V] { {savingstatus}={on | off} | {dsavingstatus}={on-norm | on-maxp | off} }",
BladeCenter specific :
For Management Modules:
renergy noderange [-V] { all | pd1all | pd2all | [pd1status] [pd2status] [pd1policy] [pd2policy] [pd1powermodule1] [pd1powermodule2] [pd2powermodule1] [pd2powermodule2] [pd1avaiablepower] [pd2avaiablepower] [pd1reservedpower] [pd2reservedpower] [pd1remainpower] [pd2remainpower] [pd1inusedpower] [pd2inusedpower] [availableDC] [averageAC] [thermaloutput] [ambienttemp] [mmtemp] }
For a blade server nodes:
renergy noderange [-V] { all | [averageDC] [capability] [cappingvalue] [CPUspeed] [maxCPUspeed] [savingstatus] [dsavingstatus] }
renergy noderange [-V] { savingstatus={on | off} | dsavingstatus={on-norm | on-maxp | off} }
Flex specific :
For Flex Management Modules:
renergy noderange [-V] { all | [powerstatus] [powerpolicy] [powermodule] [avaiablepower] [reservedpower] [remainpower] [inusedpower] [availableDC] [averageAC] [thermaloutput] [ambienttemp] [mmtemp] }
For Flex node (power and x86):
renergy noderange [-V] { all | [averageDC] [capability] [cappingvalue] [cappingmaxmin] [cappingmax] [cappingmin] [cappingGmin] [CPUspeed] [maxCPUspeed] [savingstatus] [dsavingstatus] }
renergy noderange [-V] { cappingstatus={on | off} | cappingwatt=watt | cappingperc=percentage | savingstatus={on | off} | dsavingstatus={on-norm | on-maxp | off} }
iDataPlex specific :
renergy noderange [-V] [ { cappingmaxmin | cappingmax | cappingmin } ] [cappingstatus] [cappingvalue] [relhistogram]
renergy noderange [-V] { cappingstatus={on | enable | off | disable} | {cappingwatt|cappingvalue}=watt }",
"updatenode" =>
"Usage:
updatenode [-h|--help|-v|--version]
+119 -1
View File
@@ -2384,7 +2384,7 @@ sub my_nets
my $n = $_->{net};
my $if = $_->{mgtifname};
my $nm = $_->{mask};
if (!$n || !$if || $nm)
if (!$n || !$if || !$nm)
{
next; #incomplete network
}
@@ -6439,5 +6439,123 @@ sub pingNodeStatus {
return %status;
}
=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;
+5 -3
View File
@@ -49,9 +49,11 @@ require Exporter;
"1305067911.467189" => "rhels6.1", #ppc64
"1321546114.510099" => "rhels6.2", #x86_64
"1321546739.676170" => "rhels6.2", #ppc64
"1339641244.734735" => "rhels6.3", #ppc64
"1339640147.274118" => "rhels6.3", #x86_64
"1339638991.532890" => "rhels6.3", #i386
"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",
"1194015916.783841" => "fedora8",
"1194015385.299901" => "fedora8",
+14 -128
View File
@@ -1,132 +1,18 @@
#!/bin/bash
#!/bin/sh
# xCAT postscript to configure GPFS on a compute 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.
# Run this script to sync the GPFS mmsdrfs file into the node images
# Set the SOURCE, TARGETDIR, IMAGE, and SERVICE variables appropriately
cmd="/usr/lpp/mmfs/bin/mmsdrrestore -p $MASTER -R /usr/bin/scp"
$cmd > /dev/null 2>&1
# Usage: gpfs_mmsdrfs [packimage|liteimg] [syncinstall]
# For Linux, if packimage or liteimg specified,
# will run that command for the image if rsync updated any
# destination files
# If syncinstall specified, and if site.install_loc is blank,
# sync the /install directory to the SERVICE noderange
# if rysnc updated any destination files
#
# To keep your diskless images current with any GPFS changes, run this
# script periodically from cron using the packimage/liteimg and
# syncinstall options as required by your cluster
#
# 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 target directory on the xCAT MN that holds the master copy
TARGETDIR=/install/mmfs/gen
# The noderange for service nodes
SERVICE=service
# The images to be updated (list as many as needed)
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
# EDIT HERE TO SPECIFY IMAGES TO BE UPDATED!!!
# default is to update all images !!!
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
IMAGE[1]=ALL_IMAGES
#IMAGE[1]=sles11-ppc64-netboot-service
#IMAGE[2]=sles11-ppc64-netboot-compute
# If $installroot is set, then this script was called from genimage
# Ignore all IMAGE variables and only rsync to $installroot
if [[ ! -z "$installroot" ]]; then
OS=`uname`
if [[ "$OS" != "AIX" ]]; then
rsync -i -t $SOURCE $installroot/var/mmfs/gen/mmsdrfs
exit
fi
if [[ $? != 0 ]]
then
echo "mmsdrrestore failed!"
exit 2
else
echo "mmsdrrestore succeeded"
fi
# rsync the GPFS config file to the MN
# DEVELOPER NOTE: Keep all code above this rsync call as short
# and efficient as possible.
# This script may be frequently called from cron.
if [ ! -d $TARGETDIR ]; then
mkdir -p $TARGETDIR
fi
result=`rsync -i -t $SOURCE $TARGETDIR/mmsdrfs`
r1=`echo $result | cut -c1`
if [ "$r1" == ">" ]; then
OS=`uname`
packcmd=""
syncinstall=""
if [ "$1" == "packimage" ] || [ "$1" == "liteimg" ]; then
packcmd=$1
fi
if [ "$1" == "syncinstall" ] || [ "$2" == "syncinstall" ]; then
if [ -z "`/opt/xcat/bin/nodels $SERVICE`" ]; then
SERVICE=""
fi
installloc=`/opt/xcat/bin/gettab key=installloc site.value`
if [ -z "$installloc" ]; then
syncinstall="yes"
fi
fi
if [[ -z "${IMAGE[1]}" || "${IMAGE[1]}" == "ALL_IMAGES" ]]; then
if [ $OS = "AIX" ]; then
imgtable="nimimage"
else
imgtable="linuximage"
fi
IMAGE=(`tabdump $imgtable | cut -d, -f1 | grep -v '#' | tr -d '"'`)
fi
if [ $OS = "AIX" ]; then
# do AIX stuff
updates=""
for syncimage in ${IMAGE[@]}; do
spot=`/opt/xcat/bin/gettab imagename=$syncimage nimimage.spot`
if [ -n "$spot" ]; then
dest=`lsnim -Z -a location $spot | grep -v '#' | cut -f2 -d':' `
if [ -n "$dest" ]; then
mkdir -p $dest/lpp/bos/inst_root/var/mmfs/gen
cp $TARGETDIR/mmsdrfs $dest/lpp/bos/inst_root/var/mmfs/gen/mmsdrfs
if [[ -n "$syncinstall" && -n "$SERVICE" ]]; then
/opt/xcat/bin/xdcp $SERVICE $TARGETDIR/mmsdrfs $dest/lpp/bos/inst_root/var/mmfs/gen
fi
fi
fi
shared_root=`/opt/xcat/bin/gettab imagename=$syncimage nimimage.shared_root`
if [ -n "$shared_root" ]; then
dest=`lsnim -Z -a location $shared_root | grep -v '#' | cut -f2 -d':' `
if [ -n "$dest" ]; then
mkdir -p $dest/var/mmfs/gen
cp $TARGETDIR/mmsdrfs $dest/var/mmfs/gen/mmsdrfs
if [[ -n "$syncinstall" && -n "$SERVICE" ]]; then
/opt/xcat/bin/xdcp $SERVICE $TARGETDIR/mmsdrfs $dest/var/mmfs/gen
fi
fi
fi
done
else # do Linux stuff
updates=""
for syncimage in ${IMAGE[@]}; do
dest=`/opt/xcat/bin/gettab imagename=$syncimage linuximage.rootimgdir`
if [ -n "$dest" ]; then
dest=$dest/rootimg/var/mmfs/gen/mmsdrfs
cp $TARGETDIR/mmsdrfs $dest
if [ -n "$packcmd" ]; then
updates="yes"
/opt/xcat/sbin/$packcmd $syncimage
fi
fi
done
if [ -n "$updates" ] && [ -n "$syncinstall" ] && [ -n "$SERVICE" ]; then
xdcp $SERVICE -r /usr/bin/rsync -o '-e ssh -craz' /install/netboot /install/netboot
fi
fi
fi
@@ -105,10 +105,10 @@ else # assume Linux
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
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
@@ -1,4 +1,4 @@
#image,file,options,comments,disable
"ALL","/var/mmfs/","persistent","for GPFS",
"ALL","/var/mmfs/","tmpfs","for GPFS",
"ALL","/var/adm/ras/","persistent","for GPFS",
"ALL","/gpfs/",,"for GPFS",
1 #image file options comments disable
2 ALL /var/mmfs/ persistent tmpfs for GPFS
3 ALL /var/adm/ras/ persistent for GPFS
4 ALL /gpfs/ for GPFS
@@ -0,0 +1,10 @@
./opt/ibmhpc/lapi/include*
./opt/ibmhpc/lapi/pnsd/include*
./opt/ibmhpc/lapi/samples*
./opt/ibmhpc/pecurrent/ppe.poe/include*
./opt/ibmhpc/pecurrent/ppe.poe/man/*
./opt/ibmhpc/pecurrent/ppe.poe/samples*
./opt/ibmhpc/pecurrent/hal/include*
./etc/opt/ibmhpc/license/*.txt
+1
View File
@@ -13,6 +13,7 @@ package xCAT_plugin::webportal;
use strict;
require xCAT::Utils;
require xCAT::MsgUtils;
require xCAT::zvmUtils;
require xCAT::DBobjUtils;
require IO::Socket::INET;
use Getopt::Long;
+393
View File
@@ -0,0 +1,393 @@
#!/usr/bin/perl
#!/usr/bin/env perl
# IBM(c) 2007 EPL license http://www.eclipse.org/legal/epl-v10.html
# Run the asu64 utility out of band to multiple nodes, either sequentially or in parallel
BEGIN
{
$::XCATROOT = $ENV{'XCATROOT'} ? $ENV{'XCATROOT'} : -d '/opt/xcat' ? '/opt/xcat' : '/usr';
}
use strict;
close(STDIN);
open(STDIN,"<","/dev/null");
use lib "$::XCATROOT/lib/perl";
use IO::Socket::SSL;
use XML::Simple;
$XML::Simple::PREFERRED_PARSER='XML::Parser';
use Data::Dumper;
use IO::Handle;
use IO::Select;
use xCAT::Utils;
use Getopt::Long;
use POSIX qw(:signal_h :errno_h :sys_wait_h);
use Thread qw(yield);
$::asucmd = '/opt/ibm/toolscenter/asu/asu64';
my $interface;
my $username;
my $passwd;
my $fanout;
my $batchfile;
my $help;
Getopt::Long::Configure("require_order");
Getopt::Long::Configure("bundling");
Getopt::Long::Configure("no_pass_through");
if (!GetOptions(
"i|interface=s" => \$interface,
"p|passwd=s" => \$passwd,
'l|loginname=s' => \$username,
'f|fanout=i' => \$fanout,
'b|batch=s' => \$batchfile,
'r|retry' => \$::RETRY,
'd|donotfilter' => \$::DONOTFILTER,
"n|nonodecheck" => \$::NONODECHECK, #does not check the noderange, in this case, noderange need to be a simple list of nodes.
"V|verbose" => \$::VERBOSE,
'h|help' => \$help,
) || $help || ($batchfile && scalar(@ARGV)!=1) || (!$batchfile && scalar(@ARGV)<2) ) {
print "Usage: pasu [-V] [-d] [-n] [-i <hostname-suffix>] [-l <user>] [-p <passwd>] [-f <fanout>] <noderange> <command>\n";
print " pasu [-V] [-d] [-n] [-i <hostname-suffix>] [-l <user>] [-p <passwd>] [-f <fanout>] -b <batchfile> <noderange>\n";
exit;
}
my %nodehdl;
my $xcathost='localhost:3001';
my $pasumaxp = 64;
if ($ENV{XCATHOST}) {
$xcathost=$ENV{XCATHOST};
}
if ($ENV{XCATPSHFANOUT}) {
$pasumaxp=$ENV{XCATPSHFANOUT};
}
if ($fanout) { # see if they overroad the fanout from the command line
$pasumaxp=$fanout;
}
my $noderange = shift @ARGV;
my @nodes=();
#print "fanout=$fanout, username=$username, noderange=$noderange\n";
my $nodeattrs;
if ($::NONODECHECK) {
@nodes=split(/,/, $noderange);
}
else { # contact xcatd to expand noderange and get ipmi attrs
# do not need to do this call, because getting the ipmi atts will also give us a list of nodes
#@nodes = expandnoderange($noderange);
# this is reference to a hash, each key is the nodename and the value is a reference to a hash of attr values
$nodeattrs = getipmiattrs($noderange);
#print Dumper($nodeattrs);
#foreach my $k (keys(%$nodeattrs)) {
# print "$k:\n";
# my $subhash = $nodeattrs->{$k};
# foreach my $k2 (keys(%$subhash)) { print " $k2=", $subhash->{$k2}, "\n"; }
#}
#exit;
@nodes = keys(%$nodeattrs);
}
my ($defaultuser, $defaultpw);
if (!defined($username) || !defined($passwd)) {
($defaultuser, $defaultpw) = getdefaultcredentials();
#if (!defined($username)) { $username = $user; }
#if (!defined($passwd)) { $passwd = $pw; }
if ($::VERBOSE) { print "default username=$defaultuser, passwd=$defaultpw\n"; }
}
my $children = 0;
my $inputs = new IO::Select;
my %pids; # pid => node
my %exitcodes; # Keep a list of children with known exit codes
my %foundcodes;
my @retries; # the nodes that fail with connection error
if ($interface) {
foreach (@nodes) {
s/$/-$interface/;
}
}
# Fork the processes for running asu for each node
#todo: i thought we would need retry logic because i thought asu had problems running
# in parallel. So far (up to 24 nodes) have not had any problem, but keeping the
# logic in just in case.
@retries = @nodes;
while (scalar(@retries)) {
@nodes = @retries;
@retries = ();
foreach (@nodes) {
my $node=$_;
my $ipmiattrs = $nodeattrs->{$node};
my $bmc = $ipmiattrs->{bmc};
if (!defined($bmc)) {
print "$node: the ipmi.bmc attribute is not defined, skipping.\n";
next;
}
# if we have already forked the max # of simultaneous processes, wait till 1 finishes
while ($children > $pasumaxp) { processoutput($inputs); }
# fork anothe process
my $child;
$children++;
# precedence on the username and password is: cli option, ipmi table, passwd table
my ($user, $pw);
if (defined($username)) { $user = $username; } # cli option
elsif (defined($ipmiattrs->{username})) { $user = $ipmiattrs->{username}; }
else { $user = $defaultuser; }
if (defined($passwd)) { $pw = $passwd; } # cli option
elsif (defined($ipmiattrs->{password})) { $pw = $ipmiattrs->{password}; }
else { $pw = $defaultpw; }
if ($::VERBOSE) { print "For node $node using bmc=$bmc, user=$user, pw=$pw\n"; }
#asunode(\$child,$node,$username,$passwd,@ARGV[1 .. $#ARGV]);
asunode(\$child,$node,$bmc,$user,$pw,$batchfile,@ARGV); # child is the fd of the child process
$inputs->add($child);
$nodehdl{$child} = $node;
}
# quiesce everything
while ($inputs->count) {
processoutput($inputs);
}
while (processoutput($inputs)) {};
while (wait != -1) {
yield;
}
}
my $exitcode=0;
foreach (values %pids) {
my $possible_codes = join ",",keys %foundcodes;
unless (defined $exitcodes{$_}) {
print stderr "$_: *** pasu missed exit code, probably one of the following: $possible_codes\n";
}
}
foreach (keys %exitcodes) {
if ($exitcodes{$_}) {
print stderr "$_: *** asu exited with error code ".$exitcodes{$_}.".\n";
$exitcode++;
}
}
if ($exitcode) { #Exit code reflects number of failed nodes
$exitcode=$exitcode%256; #keep from overflowing valid values
unless ($exitcode) { #if number of failed nodes happened to be evenly divisible by 256, make it non-zero again
$exitcode++;
}
}
exit($exitcode);
# Process output on the select stmt from the forked cmds
sub processoutput { #This way, one arbiter handles output, no interrupting
my $inputs = shift; # the select object that contains all the file descriptors
my @readyins = $inputs->can_read(1); # child fds with some output available
my $rc = @readyins;
my $readyh;
foreach $readyh (@readyins) {
my $cursel = new IO::Select; # need to do non-blocking reads on this fd
$cursel->add($readyh);
while ($cursel->can_read(0)) {
my $line = <$readyh>;
unless ($line) {
$inputs->remove($readyh);
close($readyh);
$exitcodes{$nodehdl{$readyh}} = $? >> 8;
$children--;
next;
}
chomp($line);
if ($::RETRY && ($line =~ /Connection link error/i) ) {
if ($::VERBOSE) { print "Need to retry $nodehdl{$readyh}\n"; }
push @retries, $nodehdl{$readyh};
} elsif ($::DONOTFILTER || ($line!~/IBM Advanced Settings Utility version/i &&
$line!~/Licensed Materials - Property of IBM/i &&
$line!~/\(C\) Copyright IBM Corp. \d+-\d+ All Rights Reserved/i &&
$line!~/Connected to IMM at IP address/i )) {
print $nodehdl{$readyh}.": ".$line."\n";
}
}
}
no strict 'subs';
IO::Handle::flush(stdout);
use strict 'subs';
yield; #Explicitly give all children a chance to refill any buffers
return $rc;
}
# Fork the asu cmd for 1 node
sub asunode {
my $out = shift; # this is a reference to the child file descriptor
my $node = shift;
my $bmc = shift;
my $username = shift;
my $passwd = shift;
my $batchfile = shift;
my $args;
if ($batchfile) {
$args = "batch $batchfile";
} else {
foreach my $a (@_) { $args .= ' ' . xCAT::Utils->quote($a); }
}
my $cmd = "$::asucmd $args --host $bmc --user $username --password $passwd 2>&1 |";
if ($::VERBOSE) { print "forking $cmd\n"; }
my $pid = open($$out, $cmd);
$pids{$pid} = $node;
}
# Contact xcatd to expand the noderange into a list of nodes
sub expandnoderange {
my $noderange = shift @_;
my @nodes;
my @user = getpwuid($>);
my $homedir=$user[7];
my $client = IO::Socket::SSL->new(
PeerAddr=>$xcathost,
SSL_key_file=>$homedir."/.xcat/client-cred.pem",
SSL_cert_file=>$homedir."/.xcat/client-cred.pem",
SSL_ca_file => $homedir."/.xcat/ca.pem",
SSL_use_cert => 1,
#SSL_verify_mode => 1,
);
die "Connection failure: $!\n" unless ($client);
#todo: get the bmc attr for each node, not the node name itself
my %cmdref = (command => 'noderange', noderange => $noderange);
$SIG{ALRM} = sub { die "No response getting noderange" };
alarm(15);
my $msg = XMLout(\%cmdref,RootName=>'xcatrequest', NoAttr=>1, KeyAttr => []);
if ($ENV{XCATXMLTRACE}) { print $msg; }
print $client $msg;
alarm(15);
my $response="";
while (<$client>) {
alarm(0);
$response .= $_;
if ($response =~ m/<\/xcatresponse>/) {
if ($ENV{XCATXMLTRACE}) { print $response; }
my $rsp=XMLin($response, ForceArray => ['node']);
$response='';
if ($rsp->{warning}) {
printf "Warning: ".$rsp->{warning}."\n";
}
if ($rsp->{error}) {
die ("ERROR: ".$rsp->{error}."\n");
} elsif ($rsp->{node}) {
@nodes=@{$rsp->{node}};
}
if ($rsp->{serverdone}) {
last;
}
}
}
close($client);
if ($::VERBOSE) { print 'Nodes:', join(',',@nodes), "\n"; }
return @nodes;
}
# Contact xcatd to get from the ipmi table for this list of nodes: bmc, username, password
sub getipmiattrs {
my $noderange = shift @_;
my $nodeattrs; # this will be a reference to a hash
my @user = getpwuid($>);
my $homedir=$user[7];
my $client = IO::Socket::SSL->new(
PeerAddr=>$xcathost,
SSL_key_file=>$homedir."/.xcat/client-cred.pem",
SSL_cert_file=>$homedir."/.xcat/client-cred.pem",
SSL_ca_file => $homedir."/.xcat/ca.pem",
SSL_use_cert => 1,
#SSL_verify_mode => 1,
);
die "Connection failure: $!\n" unless ($client);
my %cmdref = (command => 'getNodesAttribs', noderange => $noderange, table => 'ipmi');
push (@{$cmdref{attr}}, qw(bmc username password));
$SIG{ALRM} = sub { die "No response getting ipmi attributes" };
alarm(15);
my $msg = XMLout(\%cmdref,RootName=>'xcatrequest', NoAttr=>1, KeyAttr => []);
if ($ENV{XCATXMLTRACE}) { print $msg; }
print $client $msg;
alarm(15);
my $response="";
while (<$client>) {
alarm(0);
$response .= $_;
if ($response =~ m/<\/xcatresponse>/) {
if ($ENV{XCATXMLTRACE}) { print $response; }
my $rsp=XMLin($response, ForceArray => ['node']);
$response='';
if ($rsp->{warning}) {
printf "Warning: ".$rsp->{warning}."\n";
}
if ($rsp->{error}) {
die ("ERROR: ".$rsp->{error}."\n");
} elsif ($rsp->{node}) {
#print Dumper($rsp->{node});
$nodeattrs=$rsp->{node}; # this is reference to a hash, each key is the nodename and the value is a reference to a hash of attr values
}
if ($rsp->{serverdone}) {
last;
}
}
}
close($client);
#if ($::VERBOSE) { print 'Nodes:', join(',',$nodeattrs), "\n"; }
return $nodeattrs;
}
# Contact xcatd to get the default user/pw for ipmi in the xcat passwd table
sub getdefaultcredentials {
my @data;
my @user = getpwuid($>);
my $homedir=$user[7];
my $client = IO::Socket::SSL->new(
PeerAddr=>$xcathost,
SSL_key_file=>$homedir."/.xcat/client-cred.pem",
SSL_cert_file=>$homedir."/.xcat/client-cred.pem",
SSL_ca_file => $homedir."/.xcat/ca.pem",
SSL_use_cert => 1,
#SSL_verify_mode => 1,
);
die "Connection failure: $!\n" unless ($client);
#todo: use lissas new db api instead
my %cmdref = (command => 'tabdump', arg => 'passwd');
#push (@{$cmdref->{arg}}, 'passwd');
$SIG{ALRM} = sub { die "No response getting userid and password" };
alarm(15);
my $msg = XMLout(\%cmdref,RootName=>'xcatrequest', NoAttr=>1, KeyAttr => []);
if ($ENV{XCATXMLTRACE}) { print $msg; }
print $client $msg;
alarm(15);
my $response="";
while (<$client>) {
alarm(0);
$response .= $_;
if ($response =~ m/<\/xcatresponse>/) {
if ($ENV{XCATXMLTRACE}) { print $response; }
my $rsp=XMLin($response, ForceArray => ['node']);
$response='';
if ($rsp->{warning}) {
printf "Warning: ".$rsp->{warning}."\n";
}
if ($rsp->{error}) {
die ("ERROR: ".$rsp->{error}."\n");
} elsif ($rsp->{data}) {
@data=@{$rsp->{data}};
}
if ($rsp->{serverdone}) {
last;
}
}
}
close($client);
# go thru the data lines and find the ipmi row
my ($user, $pw);
foreach my $d (@data) {
#if ($::VERBOSE) { print "$d\n"; }
my @cols = split(',', $d);
if ($cols[0] eq '"ipmi"') {
($user) = $cols[1] =~ /"(.*)"/;
($pw) = $cols[2] =~ /"(.*)"/;
last;
}
}
if (!defined($user) || !defined($pw)) { die "Did not find the ipmi username and password in the xCAT passwd table.\n"; }
return ($user, $pw);
}
# vim: set et ts=2 sts=2 sw=2 :
+93 -22
View File
@@ -1,6 +1,6 @@
=head1 NAME
B<chvm> - Changes HMC-, IVM-, and zVM-managed partition profiles or virtual machines. For Power 775, chvm could be used to change the octant configuration values for generating LPARs; change the I/O slots assignment to LPARs within the same CEC.
B<chvm> - Changes HMC-, IVM-, and zVM-managed partition profiles or virtual machines. For Power 775, chvm is used to change the octant configuration values for generating LPARs, set the octant memory interleaving value and change the I/O slots assignment to LPARs within the same CEC.
=head1 SYNOPSIS
@@ -14,7 +14,7 @@ B<chvm> [B<-V>| B<--verbose>] I<noderange> [B<-p> I<profile>]
B<chvm> [B<-V>| B<--verbose>] I<noderange> I<attr>=I<val> [I<attr>=I<val>...]
=head2 PPC (using Direct FSP Management) specific:
=head2 PPC (using Direct FSP Management for Power 775) specific:
B<chvm> I<noderange> [B<-p> I<profile>]
@@ -84,13 +84,75 @@ The chvm command modifies the partition profile for the partitions specified in
This command also supports to change specific partition attributes by specifying one or more "attribute equals value" pairs in command line directly, without whole partition profile.
=head2 PPC (using Direct FSP Management) specific:
=head2 PPC (using Direct FSP Management for Power 775) specific:
chvm could be used to change the octant configuration values for generating LPARs. chvm is designed to set the Octant configure value to split the CPU and memory for partitions, and set Octant Memory interleaving value. The chvm will only set the pending attributes value. After chvm, the CEC needs to be rebooted manually for the pending values to be enabled. Before reboot the cec, the administrator can use chvm to change the partition plan. If the the partition needs I/O slots, the administrator should use chvm to assign the I/O slots.
The chvm command is used to set the Power 775 pending octant partition configuration value, the pending memory interleave value, and also is used to assign the I/O slots to an lpar within the CEC.
chvm is also designed to assign the I/O slots to the new LPAR. Both the current IO owning lpar and the new IO owning lpar must be powered off before an IO assignment. Otherwise, if the I/O slot is belonged to an Lpar and the LPAR is power on, the command will return an error when trying to assign that slot to a different lpar.
The octant configuration value specifies one of five preset configurations. Each configuration specifies the number of lpars per octant and the percentage of CPUs and memory assigned to those lpars. The configuration values include:
The administrator should use lsvm to get the profile content, and then edit the content, and add the node name with ":" manually before the I/O which will be assigned to the node. And then the profile can be piped into the chvm command, or changed with the -p flag.
=over
=over
=item B<1> - One partition with all cpus and memory of the octant
=item B<2> - Two partitions with a 50/50 split of cpus and memory
=item B<3> - Three partitions with a 25/25/50 split of cpus and memory
=item B<4> - Four partitions with a 25/25/25/25 split of cpus and memory
=item B<5> - Two partitions with a 25/75 split of cpus and memory
=back
=back
The memory interleaving value specifies how the memory is accessed within the octant and can be one of two values:
=over
=over
=item B<1> - interleaved or 8MC mode
Memory allocations are interleaved evenly across all eight memory controllers in the octant. This is the default value if -m is not specified. A value of 1 must NOT be specified if the octant is to be partitioned, i.e. have an octant configuration value of 2-5.
=item B<2> - non-interleaved or 2MC mode
Memory allocations are only interleaved across the two memory controllers on a local chip in the octant. A value of 2 MUST be specified if the octant is to be partitioned, i.e. have an octant configuration value of 2-5.
=back
=back
If octants in the same CEC are to have different memory interleaving values then they must be configured in separate chvm commands. For example, if octant zero is to have an octant configuration of 2 and octant one through seven are to have an octant configuration of 1 and a memory interleave value of 1 then the two commands would be:
chvm lpar1,lpar2 -i 1 -m 2 -r 0:2
chvm lpar3-lpar9 -i 5 -m 1 -r 1-7:1
The lsvm command can be used to verify the pending octant configurations are correct for the CEC.
To activate the pending configuration the CEC needs to be manually rebooted.
Once the CEC has the correct active configuration, the chvm command can then be used to assign I/O slots to new partitions in the CEC. Once again, the lsvm command can be used to display the current I/O slot assignments of the CEC. Before running the chvm command to update I/O slot assignments, ensure that both the current I/O owning lpar and the new I/O owning lpar are powered off. Otherwise, the chvm will return an error.
The lsvm command output can be redirected to a file. This file can then be edited to include only the current sixteen I/O slot assignments. A sample of some of the output is:
1: 537/U78A9.001.0123456-P1-C9/0x21010219/2/1
1: 514/U78A9.001.0123456-P1-C17/0x21010202/2/1
1: 568/U78A9.001.0123456-P1-C2/0x21010238/2/1
1: 561/U78A9.001.0123456-P1-C3/0x21010231/2/1
The number, as in the above example, or text before the ":" indicates the lpar id of the node or the node name. To change the I/O slot assignment, change this value to the new lpar id or node name, for example, 5 for lpar id 5 or use the node name "lpar5". For example:
1: 537/U78A9.001.0123456-P1-C9/0x21010219/2/1
1: 514/U78A9.001.0123456-P1-C17/0x21010202/2/1
5: 568/U78A9.001.0123456-P1-C2/0x21010238/2/1
5: 561/U78A9.001.0123456-P1-C3/0x21010231/2/1
This file can then be piped into the chvm command, or specified with the -p flag.
=head2 VMware/KVM specific:
@@ -134,33 +196,39 @@ Verbose output.
=back
=head2 PPC (using Direct FSP Management) specific:
=head2 PPC (using Direct FSP Management for Power 775) specific:
=over 10
=item B<-i>
Starting numeric id of the newly created partitions. For Power 775 using Direct FSP Management, the id value only could be B<1>, B<5>, B<9>, B<13>, B<17>, B<21>, B<25> and B<29>.
Starting numeric id of the first lpar in the octant. Valid id values are B<1>, B<5>, B<9>, B<13>, B<17>, B<21>, B<25> and B<29>. These values correspond to the first lpar id in each of the eight octants.
=item B<-m>
memory interleaving. The setting value only could be B<1> or B<2>. B<2> means B<non-interleaved> mode (also 2MC mode), the memory cannot be shared across the processors in an octant. B<1> means B<interleaved> mode (also 8MC mode) , the memory can be shared. The default value is B<1> .
1 - interleaved or 8MC mode
2 - non-interleaved or 2MC mode
See interleaving description above for more information.
=item B<-r>
partition rule.
Octant partition configuration rule. The rule specifies the octant and the octant configuration value.
If all the octants configuration value are same in one CEC, it will be " B<-r> B<0-7>:I<value>" .
The format is " B<-r> B<octant_number:value>"
Multiple octants can be specified in the same rule: " B<-r> B<0-7>:I<value>"
If the octants use the different configuration value in one cec, it will be "B<-r> B<0>:I<value1>,B<1>:I<value2>,...B<7>:I<value7>", or "B<-r> B<0>:I<value1>,B<1-7>:I<value2>" and so on.
The octants configuration value for one Octant could be B<1>, B<2>, B<3>, B<4>, B<5>. The meanings of the octants configuration value are as following:
The octant configuration value specifies one of five preset configurations (B<1>, B<2>, B<3>, B<4>, B<5>). Each configuration specifies the number of lpars per octant and the percentage of CPUs and memory assigned to those lpars. The configuration values include:
1 -- 1 partition with all cpus and memory of the octant
2 -- 2 partitions with a 50/50 split of cpus and memory
3 -- 3 partitions with a 25/25/50 split of cpus and memory
4 -- 4 partitions with a 25/25/25/25 split of cpus and memory
5 -- 2 partitions with a 25/75 split of cpus and memory
1 - One partition with all cpus and memory of the octant
2 - Two partitions with a 50/50 split of cpus and memory
3 - Three partitions with a 25/25/50 split of cpus and memory
4 - Four partitions with a 25/25/25/25 split of cpus and memory
5 - Two partitions with a 25/75 split of cpus and memory
=item B<-p> I<profile>
@@ -338,9 +406,9 @@ Output is similar to:
lpar4: Success
=head2 PPC (using Direct FSP Management) specific:
=head2 PPC (using Direct FSP Management for Power 775) specific:
1. For Power 775, to create a new partition lpar1 on the first octant of the cec cec01, lpar1 will use all the cpu and memory of the octant 0, enter:
1. For Power 775, to create a new partition lpar1 on the first octant of CEC cec01, lpar1 will use all the cpu and memory of the octant 0, enter:
mkdef -t node -o lpar1 mgt=fsp groups=all parent=cec01 nodetype=lpar hcp=cec01
@@ -353,7 +421,7 @@ Output is similar to:
lpar1: Success
cec01: Please reboot the CEC cec1 firstly, and then use chvm to assign the I/O slots to the LPARs
2. For Power 775, to create new partitions lpar1-lpar8 on the whole cec cec01, each LPAR will use all the cpu and memory of each octant, enter:
2. For Power 775, to create new partitions lpar1-lpar8 on the whole CEC cec01, each LPAR will use all the cpu and memory of each octant, enter:
mkdef -t node -o lpar1-lpar8 nodetype=lpar mgt=fsp groups=all parent=cec01 hcp=cec01
@@ -373,18 +441,21 @@ Output is similar to:
lpar8: Success
cec01: Please reboot the CEC cec1 firstly, and then use chvm to assign the I/O slots to the LPARs
3. For Power 775 cec1, to create new partitions lpar1-lpar9, the lpar1 will use 25% CPU and 25% memory of the first octant, and lpar2 will use the left CPU and memory of the first octant. lpar3-lpar9 will use all the cpu and memory of each octant, enter:
3. For Power 775 cec1, to create new partitions lpar1-lpar9, where lpar1 will use 25% CPU and memory resource and lpar2 will use the remaining 75% resources of octant 0 and lpar3-lpar9 will use all the cpu and memory of octants 2-7, enter:
mkdef -t node -o lpar1-lpar9 mgt=fsp groups=all parent=cec1 nodetype=lpar hcp=cec1
then:
chvm lpar1-lpar9 -i 1 -m 1 -r 0:5,1-7:1
chvm lpar1-lpar2 -i 1 -m 2 -r 0:5
chvm lpar3-lpar9 -i 5 -m 1 -r 1-7:1
Output is similar to:
lpar1: Success
lpar2: Success
cec1: Please reboot the CEC cec1 firstly, and then use chvm to assign the I/O slots to the LPARs
lpar3: Success
lpar4: Success
lpar5: Success
+1 -1
View File
@@ -9,7 +9,7 @@ I<lsslp [-h| --help]>
I<lsslp [-v| --version]>
I<lsslp [noderange] [-V] [-i ip[,ip..]][-w][-r|-x|-z][-n][-s CEC|FRAME|MM|IVM|RSA|HMC|CMM][-t tries][-I][-C counts][-T timeout][--vpdtable]>
I<lsslp [noderange] [-V] [-i ip[,ip..]][-w][-r|-x|-z][-n][-s CEC|FRAME|MM|IVM|RSA|HMC|CMM|IMM2|FSP][-t tries][-I][-C counts][-T timeout][--vpdtable]>
=head1 DESCRIPTION
+188
View File
@@ -0,0 +1,188 @@
=head1 NAME
B<pasu> - run the ASU to many nodes in parallel
=head1 SYNOPSIS
B<pasu> [B<-V>] [B<-d>] [B<-n>] [B<-l> I<user>] [B<-p> I<passwd>] [B<-f> I<fanout>] I<noderange> I<command>
B<pasu> [B<-V>] [B<-d>] [B<-n>] [B<-l> I<user>] [B<-p> I<passwd>] [B<-f> I<fanout>] B<-b> I<batchfile> I<noderange>
B<pasu> [B<-h> | B<--help>]
=head1 DESCRIPTION
The B<pasu> command runs the ASU command in out-of-band mode in parallel to multiple nodes. Out-of-band mode means
that ASU connects from the xCAT management node to the IMM (BMC) of each node to set or query the ASU settings. To
see all of the ASU settings available on the node, use the "show all" command. To query or set multiple values,
use the B<-b> (batch) option. To group similar output from multiple nodes, use L<xcoll(1)|xcoll.1>.
Before running B<pasu>, you must install the ASU RPM from IBM. You can download it from the IBM Fix Central site.
You also must configure the IMMs properly according to xCAT documentation. Run "B<rpower> I<noderange> B<stat>"
to confirm that the IMMs are configured properly.
=head1 OPTIONS
=over 10
=item B<-n|--nonodecheck>
Do not send the noderange to xcatd to expand it into a list of nodes. Use the noderange exactly as it is specified
to pasu. In this case, the noderange must be a simple list of comma-separated hostnames of the IMMs.
=item B<-l|--loginname> I<username>
The username to use to connect to the IMMs. If not specified, the row in the xCAT B<passwd> table with key "ipmi"
will be used to get the username.
=item B<-p|--passwd> I<passwd>
The password to use to connect to the IMMs. If not specified, the row in the xCAT passwd table with key "ipmi"
will be used to get the password.
=item B<-f|--fanout>
How many processes to run in parallel simultaneously. The default is 64. You can also set the XCATPSHFANOUT
environment variable.
=item B<-b|--batch> -I<batchfile>
A simple text file that contains multiple ASU commands, each on its own line.
=item B<-d|--donotfilter>
By default, pasu filters out (i.e. does not display) the standard initial output from ASU:
IBM Advanced Settings Utility version 9.30.79N
Licensed Materials - Property of IBM
(C) Copyright IBM Corp. 2007-2012 All Rights Reserved
Connected to IMM at IP address node2-imm
If you want this output to be displayed, use this flag.
=item B<-V|--verbose>
Display verbose messages.
=item B<-h|--help>
Display usage message.
=back
=head1 RETURN VALUE
0 The command completed successfully.
1 An error has occurred.
=head1 EXAMPLES
=over 3
=item 1.
To display the Com1ActiveAfterBoot setting on 2 nodes:
pasu node1,node2 show DevicesandIOPorts.Com1ActiveAfterBoot
Output is similar to:
node1: DevicesandIOPorts.Com1ActiveAfterBoot=Enable
node2: DevicesandIOPorts.Com1ActiveAfterBoot=Enable
=item 2.
To display the Com1ActiveAfterBoot setting on all compute nodes:
pasu compute show DevicesandIOPorts.Com1ActiveAfterBoot | xcoll
Output is similar to:
====================================
compute
====================================
DevicesandIOPorts.Com1ActiveAfterBoot=Enable
=item 3.
To set several settings on all compute nodes, create a batch file
called (for example) asu-settings with contents:
set DevicesandIOPorts.Com1ActiveAfterBoot Enable
set DevicesandIOPorts.SerialPortSharing Enable
set DevicesandIOPorts.SerialPortAccessMode Dedicated
set DevicesandIOPorts.RemoteConsole Enable
Then run:
pasu -b asu-settings compute | xcoll
Output is similar to:
====================================
compute
====================================
Batch mode start.
[set DevicesandIOPorts.Com1ActiveAfterBoot Enable]
DevicesandIOPorts.Com1ActiveAfterBoot=Enable
[set DevicesandIOPorts.SerialPortSharing Enable]
DevicesandIOPorts.SerialPortSharing=Enable
[set DevicesandIOPorts.SerialPortAccessMode Dedicated]
DevicesandIOPorts.SerialPortAccessMode=Dedicated
[set DevicesandIOPorts.RemoteConsole Enable]
DevicesandIOPorts.RemoteConsole=Enable
Beginning intermediate batch update.
Waiting for command completion status.
Command completed successfully.
Completed intermediate batch update.
Batch mode competed successfully.
=item 4.
To confirm that all the settings were made on all compute nodes, create a batch file
called (for example) asu-show with contents:
show DevicesandIOPorts.Com1ActiveAfterBoot
show DevicesandIOPorts.SerialPortSharing
show DevicesandIOPorts.SerialPortAccessMode
show DevicesandIOPorts.RemoteConsole
Then run:
pasu -b asu-show compute | xcoll
Output is similar to:
====================================
compute
====================================
Batch mode start.
[show DevicesandIOPorts.Com1ActiveAfterBoot]
DevicesandIOPorts.Com1ActiveAfterBoot=Enable
[show DevicesandIOPorts.SerialPortSharing]
DevicesandIOPorts.SerialPortSharing=Enable
[show DevicesandIOPorts.SerialPortAccessMode]
DevicesandIOPorts.SerialPortAccessMode=Dedicated
[show DevicesandIOPorts.RemoteConsole]
DevicesandIOPorts.RemoteConsole=Enable
Batch mode competed successfully.
=back
=head1 FILES
/opt/xcat/bin/pasu
=head1 SEE ALSO
L<noderange(3)|noderange.3>, L<rpower(1)|rpower.1>, L<xcoll(1)|xcoll.1>
+10 -5
View File
@@ -5,17 +5,22 @@ B<rbeacon> - Turns beacon on/off/blink or gives status of a node or noderange.
=head1 SYNOPSIS
B<rbeacon> [B<-h>|B<--help>|B<-v>|B<--version>]
=head2 IPMI specific:
B<rbeacon> I<noderange> {B<on>|B<off>}
=head2 Blade specific:
B<rbeacon> I<noderange> {B<on>|B<blink>|B<off>|B<stat>}
B<rbeacon> [B<-h>|B<--help>]
B<rbeacon> {B<-v>|B<--version>}
=head1 DESCRIPTION
B<rbeacon> Turns beacon (a light on the front of the physical server) on/off/blink or gives status of a node or noderange.
For B<IPMI specific>, it represents the systems were managed through I<ipmi> mode. And for B<Blade specific>, it represents managing the systems using I<blade> mode.
=head1 EXAMPLES
rbeacon 1,3 off
+60 -13
View File
@@ -44,7 +44,7 @@ B<BladeCenter specific :>
=over 2
B<For Management Modules as the target:>
B<For Management Modules:>
=over 4
@@ -58,7 +58,7 @@ B<renergy> I<noderange> [-V] { all | pd1all | pd2all | [pd1status]
=back
B<For a blades as the target:>
B<For a blade server nodes:>
=over 4
@@ -67,12 +67,45 @@ B<renergy> I<noderange> [-V] { all | [averageDC]
[savingstatus] [dsavingstatus] }
B<renergy> I<noderange> [-V] { savingstatus={on | off}
| dsavingstatus={on-norm | on-maxp | off} }
| dsavingstatus={on-norm | on-maxp | off} }
=back
=back
B<Flex specific :>
=over 2
B<For Flex Management Modules:>
=over 4
B<renergy> I<noderange> [-V] { all | [powerstatus]
[powerpolicy] [powermodule] [avaiablepower] [reservedpower]
[remainpower] [inusedpower] [availableDC] [averageAC]
[thermaloutput] [ambienttemp] [mmtemp] }
=back
B<For Flex node (power and x86):>
=over 4
B<renergy> I<noderange> [-V] { all | [averageDC]
[capability] [cappingvalue] [cappingmaxmin] [cappingmax]
[cappingmin] [cappingGmin] [CPUspeed] [maxCPUspeed]
[savingstatus] [dsavingstatus] }
B<renergy> I<noderange> [-V] { cappingstatus={on | off}
| cappingwatt=watt | cappingperc=percentage
| savingstatus={on | off} | dsavingstatus={on-norm | on-maxp | off} }
=back
=back
B<iDataPlex specific :>
=over 2
@@ -273,10 +306,21 @@ enabled, phase 2 or higher
dynamicPowerMeasurementWithPowerCapping: the module with power meter capability,
both measurement and capping enabled, phase 2 or higher
=item B<cappingGmin>
Query the Guaranteed Minimum power capping value in watts.
=item B<cappingmax>
Query the Maximum of power capping value in watts.
=item B<cappingmaxmin>
Query the maximum and minimum of power capping value
which can be set for a CEC or blade server. (Unit is watt)
Query the Maximum and Minimum of power capping value in watts.
=item B<cappingmin>
Query the Minimum of power capping value in watts.
=item B<cappingperc>=B<percentage>
@@ -414,36 +458,39 @@ Query the maximum processor frequency. (Unit is MHz)
Query the current temperature of management module.
(Unit is centigrade)
=item B<pd1status>
=item B<pd1status | powerstatus>
Query the status of power domain 1 for blade management
module node.
=item B<pd1policy>
Note: for the attribute without the leading 'pd1' which
means there's only one power doamin in the chassis.
=item B<pd1policy | powerpolicy>
Query the power management policy of power domain 1.
=item B<pd1powermodule1>
=item B<pd1powermodule1 | powermodule>
Query the First Power Module capacity in power domain 1.
=item B<pd1powermodule2>
=item B<pd1powermodule2 | powermodule>
Query the Second Power Module capacity in power domain 1.
=item B<pd1avaiablepower>
=item B<pd1avaiablepower | avaiablepower>
Query the total available power in power domain 1.
=item B<pd1reservedpower>
=item B<pd1reservedpower | reservedpower>
Query the power that has been reserved for power domain 1.
=item B<pd1remainpower>
=item B<pd1remainpower | remainpower>
Query the remaining power available in power domain 1.
=item B<pd1inusedpower>
=item B<pd1inusedpower | inusedpower>
Query the total power being used in power domain 1.
+1 -1
View File
@@ -34,7 +34,7 @@ B<rpower> I<noderange> [B<on>|B<off>|B<stat>|B<state>|B<reset>|B<boot>|B<of>|B<s
=head2 Blade (using Direct FSP Management) specific:
B<rpower> I<noderange> [B<on>|B<off>|B<cycle>]
B<rpower> I<noderange> [B<on>|B<onstandby>|B<off>|B<cycle>|B<sms>]
=head2 Blade specific:
+46 -4
View File
@@ -4,7 +4,7 @@ B<sinv> - Checks the software configuration of the nodes in the cluster.
=head1 B<SYNOPSIS>
B<sinv> [B<-o> I<output>] [B<-p> I<template path>] [B<-t> I<template count>] [B<-s> I<seed node>] [B<-i>] [B<-e>] [B<-r>] [B<-V>] [[B<-f> I<command file>] | [B<-c> I<command>]]
B<sinv> [B<-o> I<output>] [B<-p> I<template path>] [B<-t> I<template count>] [B<-s> I<seed node>] [B<-i>] [B<-e>] [B<-r>] [B<-V>] [B<--devicetype> I<type_of_device>] [B<-l> I<userID>] [[B<-f> I<command file>] | [B<-c> I<command>]]
B<sinv> [B<-h> | B<-v>]
@@ -132,13 +132,33 @@ it would be considered a match, as long as all rpms listed in the template
were on the node. With exactmatch set, the output must be identical
to the template.
=item B<--devicetype> I<type_of_device>
Specify a user-defined device type that references the location
of relevant device configuration file. The devicetype value must
correspond to a valid device configuration file.
xCAT ships some default configuration files
for Ethernet switches and and IB switches under
I</opt/xcat/share/xcat/devicetype> directory. If you want to overwrite
any of the configuration files, please copy it to I</var/opt/xcat/>
directory and cutomize it.
For example, I<base/IBSwitch/Qlogic/config> is the configuration
file location if devicetype is specified as IBSwitch::Qlogic.
xCAT will first search config file using I</var/opt/xcat/> as the base.
If not found, it will search for it using
I</opt/xcat/share/xcat/devicetype/> as the base.
=item B<-l>|B<--user> I<user_ID>
Specifies a remote user name to use for remote command execution.
=item B<-c>|B<--command>
The xdsh or rinv command that will be run. The command should be enclosed in
double quotes to insure correct shell interpretation.
double quotes to insure correct shell interpretation. This parameter must only contain, the node range or the image path (Linux) or spot name for AIX. It cannot be used to set additional input flags to xdsh or rinv (for example -s,-T,-e). See examples below.
B<Note:> do not add the | xdshcoll to the command,
it is automatically added by sinv.
it is automatically added by sinv. sinv also automatically sets the -v flag for xdsh.
=item B<-f>|B<--file>
@@ -239,9 +259,31 @@ B<sinv> I<-c "xdsh node1-node4 lslpp -l | grep bos.adt" -s node1 -e -p /tmp/sin
Note: the /tmp/sinv.template file must be empty, otherwise it will be used
as an admin generated template.
=item *
To execute B<sinv> on the Linux osimage defined for cn1. First build a template from the /etc/hosts on the node. Then run sinv to compare.
B<xdsh> I<cn1 "cat /etc/hosts" | xdshcoll > /tmp/sinv2/template"
B<sinv> I<-c "xdsh -i /install/netboot/rhels6/ppc64/test_ramdisk_statelite/rootimg cat /etc/hosts" -e -t1 -p /tmp/sinv.template -o /tmp/sinv.output>
=item *
To execute B<sinv> on the AIX NIM 611dskls spot and compare /etc/hosts to compute1 node, run the following:
B<xdsh> I<compute1 "cat /etc/hosts" | xdshcoll > /tmp/sinv2/template"
B<sinv> I<-c "xdsh -i 611dskls cat /etc/hosts" -e -t1 -p /tmp/sinv.template -o /tmp/sinv.output>
=item *
To execute B<sinv> on the device mswitch2 and compare to mswitch1
B<sinv> I<-c "xdsh mswitch enable;show version" -s mswitch1 -p /tmp/sinv/template --devicetype IBSwitch::Mellanox -l admin -t 2>
=back
=head1 B<Files>
B<Files>
B</opt/xcat/bin/sinv/>
+1 -3
View File
@@ -245,9 +245,7 @@ messages to standard output during execution to each target.
Verifies each target before executing any remote commands
on the target. If a target is not responding, execution of
remote commands for the target is canceled. When specified
with the B<-i> flag, the user is prompted to retry the
verification request.
remote commands for the target is canceled.
=item B<-V>|B<--version>
+1 -1
View File
@@ -24,6 +24,6 @@ while [ ! -f /tmp/destiny.xml ] || grep error /tmp/destiny.xml; do
fi
done
rm /tmp/destreq.xml
DESTINY=`grep destiny /tmp/destiny.xml | awk -F'>' '{print $2}'|awk -F'<' '{print $1}'`
DESTINY=`grep '<destiny>' /tmp/destiny.xml | awk -F'>' '{print $2}'|awk -F'<' '{print $1}'`
rm /tmp/destiny.xml
echo $DESTINY
+1 -1
View File
@@ -822,7 +822,7 @@ sub parse_ipmi_payload {
my @payload = @_;
#for now, just trash the headers, this has been validated to death anyway
#except seqlun, that one is important
unless ($payload[4] == $self->{seqlun} and $payload[0] == $self->{rqaddr} and $payload[1]>>2 == $self->{expectednetfn} and $payload[5] == $self->{expectedcmd} ) {
unless ($payload[4] == $self->{seqlun} and $payload[1]>>2 == $self->{expectednetfn} and $payload[5] == $self->{expectedcmd} ) {
#both sequence number and arqaddr must match, because we are using rqaddr to extend the sequence number
#print "Successfully didn't get confused by stale response ".$payload[4]." and ".($self->{seqlun}-4)."\n";
#hexdump(@payload);
+13 -11
View File
@@ -656,16 +656,15 @@ sub makescript
}
# get postscripts for images
my $osimgname = $provmethod;
my $et2;
if($provmethod !~ /^install$|^netboot$|^statelite$/){ # using imagename
my $osimgname = $provmethod;
if($osimgname =~ /install|netboot|statelite/){
$osimgname = "$os-$arch-$provmethod-$profile";
}
my $et2 =
$et2 =
$ostab->getAttribs({'imagename' => "$osimgname"}, ['postscripts', 'postbootscripts']);
$ps = $et2->{'postscripts'};
if ($ps)
{
$ps = $et2->{'postscripts'};
if ($ps)
{
foreach my $n (split(/,/, $ps))
{
if (!exists($post_hash{$n}))
@@ -674,6 +673,7 @@ sub makescript
push @scriptd, $n . "\n";
}
}
}
}
# get postscripts for node specific
@@ -724,9 +724,10 @@ sub makescript
}
# get postbootscripts for image
my $ips = $et2->{'postbootscripts'};
if ($ips)
{
if($provmethod !~ /^install$|^netboot$|^statelite$/){ # using imagename
my $ips = $et2->{'postbootscripts'};
if ($ips)
{
foreach my $n (split(/,/, $ips))
{
if (!exists($postboot_hash{$n}))
@@ -735,6 +736,7 @@ sub makescript
push @scriptd, $n . "\n";
}
}
}
}
+3
View File
@@ -1469,6 +1469,9 @@ sub enable_TFTPhpa
# get the version of TCP/IP protocol
my $protocols;
my $v4only="-4 ";
if (xCAT::Utils->osver() =~ /^sle[sc]10/) {
$v4only = "";
}
open($protocols,"<","/proc/net/protocols");
if ($protocols) {
my $line;
+43 -5
View File
@@ -273,7 +273,7 @@ sub processArgs
}
# -t node is the default value
if (!$::opt_t && !$::opt_a && ($::command eq "lsdef"))
if (!$::opt_t && !$::opt_a && !$::opt_h && ($::command eq "lsdef"))
{
$::opt_t = 'node';
}
@@ -803,6 +803,10 @@ sub processArgs
# for every type of data object get the list of defined objects
foreach my $t (keys %{xCAT::Schema::defspec})
{
# exclude the auditlog and eventlog,
# the auditlog and eventlog tables might be very big
# use lsdef -t auditlog or lsdef -t eventlog instead
if (($t eq 'auditlog') || ($t eq 'eventlog')) { next; }
$::objectsfrom_opta = 1;
@@ -1669,7 +1673,7 @@ sub defch
{
my $rsp;
$rsp->{data}->[0] =
"\'$attr\' is not a valid attribute name for for an object type of \'$::objtype\'.";
"\'$attr\' is not a valid attribute name for an object type of \'$::objtype\'.";
$rsp->{data}->[1] = "Skipping to the next attribute.";
xCAT::MsgUtils->message("E", $rsp, $::callback);
$error = 1;
@@ -2278,7 +2282,7 @@ sub setFINALattrs
my $rsp;
$rsp->{data}->[0] =
"\'$attr\' is not a valid attribute name for for an object type of \'$::objtype\'.";
"\'$attr\' is not a valid attribute name for an object type of \'$::objtype\'.";
xCAT::MsgUtils->message("E", $rsp, $::callback);
$error = 1;
next;
@@ -2729,6 +2733,18 @@ sub defls
# for each type
foreach my $type (@::clobjtypes)
{
# Check if -i specifies valid attributes
# get the data type definition from Schema.pm
my %validattrslist;
if ($::opt_i)
{
my $datatype = $xCAT::Schema::defspec{$type};
foreach my $this_attr (sort @{$datatype->{'attrs'}})
{
my $a = $this_attr->{attr_name};
$validattrslist{$a} = 1;
}
}
my %defhash;
@@ -2803,10 +2819,32 @@ sub defls
my @attrlist;
if (($type ne 'site') && ($type ne 'monitoring'))
{
# get the list of all attrs for this type object
# -i is specified
if (scalar(@::AttrList) > 0) {
@attrlist = @::AttrList;
foreach my $attr (@::AttrList)
{
# For site and monitoring, does not check if -i attributes are valid
if (($type eq 'site') || ($type eq 'monitoring'))
{
@attrlist = @::AttrList;
} else {
if (defined($validattrslist{$attr}))
{
if (!grep(/^$attr$/, @attrlist))
{
push @attrlist, $attr;
}
} else {
my $rsp;
$rsp->{data}->[0] =
"\'$attr\' is not a valid attribute name for an object type of \'$type\'.";
xCAT::MsgUtils->message("E", $rsp, $::callback);
next;
}
}
}
} else {
# get the list of all attrs for this type object
# get the data type definition from Schema.pm
my $datatype =
$xCAT::Schema::defspec{$type};
+1 -3
View File
@@ -5940,7 +5940,7 @@ sub rmnimres
}
# foreach attr in the image def
my $error;
my $error=0;
foreach my $attr (sort(keys %{$imagedef{$osimage}}))
{
chomp $attr;
@@ -6012,7 +6012,6 @@ sub rmnimres
my $rsp;
push @{$rsp->{data}}, "The resource named \'$resname\' will not be removed.\n";
xCAT::MsgUtils->message("I", $rsp, $callback);
$error++;
next;
}
@@ -6066,7 +6065,6 @@ sub rmnimres
if ($loc)
{
my $cmd = qq~/usr/bin/rm -R $loc~;
my $output = xCAT::Utils->runcmd("$cmd", -1);
$output = xCAT::InstUtils->xcmd($callback, $subreq, "xdsh", $targetsn, $cmd, 0);
}
}
+1 -1
View File
@@ -128,7 +128,7 @@ sub process_request
sub using_dracut
{
my $os = shift;
if ($os =~ /(rhels|rhel)(\d+)/) {
if ($os =~ /(rhels|rhel|centos)(\d+)/) {
if ($2 >= 6) {
return 1;
}
+398 -203
View File
@@ -55,13 +55,13 @@ sub handled_commands {
getrvidparms => 'nodehm:mgt',
rvitals => 'nodehm:mgt=blade|fsp',
rinv => 'nodehm:mgt',
rbeacon => 'nodehm:mgt',
rbeacon => 'nodehm:mgt=blade|fsp',
rspreset => 'nodehm:mgt',
rspconfig => 'nodehm:mgt=blade|fsp', # Get into blade.pm for rspconfig if mgt equals blade or fsp
rbootseq => 'nodehm:mgt',
reventlog => 'nodehm:mgt',
reventlog => 'nodehm:mgt=blade|fsp',
switchblade => 'nodehm:mgt',
renergy => 'nodehm:mgt',
renergy => 'nodehm:mgt=blade|fsp|ipmi',
lsflexnode => 'blade',
mkflexnode => 'blade',
rmflexnode => 'blade',
@@ -400,16 +400,19 @@ sub eventlog { #Tried various optimizations, but MM seems not to do bulk-request
my $text=$5;
my $matchstring;
if ($slot > 0) {
$matchstring=sprintf("BLADE_%02d",$slot);
#$matchstring=sprintf("BLADE_%02d",$slot);
$matchstring=sprintf("NODE_%02d",$slot);
} else {
$matchstring="^(?!BLADE).*";
#$matchstring="^(?!BLADE).*";
$matchstring="^(?!NODE).*";
}
if ($source =~ m/$matchstring$/i) { #MM guys changed their minds on capitalization
$numentries++;
unshift @output,"$sev:$date $time $text"; #unshift to get it in a sane order
} else {
foreach (@moreslots) {
$matchstring=sprintf("BLADE_%02d",$_);
#$matchstring=sprintf("BLADE_%02d",$_);
$matchstring=sprintf("NODE_%02d",$_);
if ($source =~ m/$matchstring$/i) { #MM guys changed their minds on capitalization
$numentries++;
unshift @output,"$sev:$date $time $text"; #unshift to get it in a sane order
@@ -874,12 +877,15 @@ sub vitals {
my $tmp;
if ( defined $slot and $slot > 0) { #-- querying some blade
if (grep /watt/,@vitems) {
if ($slot < 8) {
$tmp = $session->get(["1.3.6.1.4.1.2.3.51.2.2.10.2.1.1.7.".($slot+16)]);
if ($mpatype eq 'cmm') {
$tmp = $session->get(["1.3.6.1.4.1.2.3.51.2.2.10.2.1.1.7.".($slot+24)]);
} else {
$tmp = $session->get(["1.3.6.1.4.1.2.3.51.2.2.10.3.1.1.7.".($slot+9)]);
if ($slot < 8) {
$tmp = $session->get(["1.3.6.1.4.1.2.3.51.2.2.10.2.1.1.7.".($slot+16)]);
} else {
$tmp = $session->get(["1.3.6.1.4.1.2.3.51.2.2.10.3.1.1.7.".($slot+9)]);
}
}
unless ($tmp =~ /Not Readable/) {
if ($tmp =~ /(\d+)W/) {
@@ -1483,7 +1489,13 @@ sub rscan {
if ($name =~ /Comm Error/) {
next;
}
if ($data[1] =~ /\(\s*([^\s]*)\s*\)/) {
$name = $1;
} elsif ($data[1] =~ /^\s*([^s]*)\s*$/) {
$name = $1;
$name =~ s/ /_/;
$name =~ tr/A-Z/a-z/;
}
if (exists($opt{u})) {
## TRACE_LINE print "Rscan: orig_name [$name]\n";
@@ -1717,7 +1729,17 @@ sub rscan_stanza {
if ($data[1] =~ /Comm Error/) {
next;
}
$result .= "$data[1]:\n\tobjtype=node\n";
my $objname;
if ($data[1] =~ /\(\s*([^\s]*)\s*\)/) {
$objname = $1;
} elsif ($data[1] =~ /^\s*([^s]*)\s*$/) {
$objname = $1;
$objname =~ s/ /_/;
$objname =~ tr/A-Z/a-z/;
} else {
$objname = $data[1];
}
$result .= "$objname:\n\tobjtype=node\n";
foreach ( @rscan_attribs ) {
my $d = $data[$i++];
@@ -2221,6 +2243,25 @@ my $savingstatus_oid = ".1.3.6.1.4.1.2.3.51.2.2.10.4.1.1.1.6"; #bladeDetailsP
my $dsavingstatus_oid = ".1.3.6.1.4.1.2.3.51.2.2.10.4.1.1.1.7"; #bladeDetailsDynamicPowerSaver
my $dsperformance_oid = ".1.3.6.1.4.1.2.3.51.2.2.10.4.1.1.1.8"; #bladeDetailsDynamicPowerFavorPerformanceOverPower
# New attributes which supported by CMM
my $PowerControl_oid = ".1.3.6.1.4.1.2.3.51.2.2.10.4.1.1.1.9"; #bladeDetailsPowerControl
my $PowerPcapMin_oid = ".1.3.6.1.4.1.2.3.51.2.2.10.4.1.1.1.10"; #bladeDetailsPcapMin
my $PowerPcapGMin_oid = ".1.3.6.1.4.1.2.3.51.2.2.10.4.1.1.1.11"; #bladeDetailsPcapGuaranteedMin
my $PowerPcapMax_oid = ".1.3.6.1.4.1.2.3.51.2.2.10.4.1.1.1.12"; #bladeDetailsPcapMax
# New table used to control the power management
#my $powerPcapMin =".1.3.6.1.4.1.2.3.51.2.22.31.6.1.10"; # componentPowerDetailsPcapMin
#my $powerPcapGMin = ".1.3.6.1.4.1.2.3.51.2.22.31.6.1.11"; # componentPowerDetailsPcapGuaranteedMin
#my $powerPcapMax = ".1.3.6.1.4.1.2.3.51.2.22.31.6.1.12"; # componentPowerDetailsPcapMax
#my $powerPcapSet = ".1.3.6.1.4.1.2.3.51.2.22.31.6.1.3"; # componentPowerDetailsMaxPowerConfig
#my $powerControl = ".1.3.6.1.4.1.2.3.51.2.22.31.6.1.9"; # componentPowerDetailsPowerControl
#my $powersavingstatus_oid = ".1.3.6.1.4.1.2.3.51.2.22.31.6.1.6"; #componentPowerDetailsPowerSaverMode
#my $powerdsavingstatus_oid = ".1.3.6.1.4.1.2.3.51.2.22.31.6.1.7"; #componentPowerDetailsDynamicPowerSaver
#my $powerdsperformance_oid = ".1.3.6.1.4.1.2.3.51.2.22.31.6.1.8"; #componentPowerDetailsDynamicPowerFavorPerformanceOverPower
# The meaning of obj fuelGaugePowerManagementPolicySetting
my %pdpolicymap = (
'0' => "redundantWithoutPerformanceImpact",
@@ -2239,16 +2280,14 @@ my %capabilitymap = (
'3' => "dynamicPowerManagement",
'4' => "dynamicPowerMeasurement1",
'5' => "dynamicPowerMeasurement2",
'6' => "dynamicPowerMeasurement2",
'6' => "dynamicPowerMeasurementWithPowerCapping",
'255' => "notApplicable",
);
# The valid attributes the renergy command can support
# 1 for readonly; 2 for write; 3 readwrite
my %mm_valid_items = (
'all' => 1,
'pd1all' => 1,
'pd2all' => 1,
'pd1status' => 1,
'pd2status' => 1,
'pd1policy' => 1,
@@ -2271,8 +2310,45 @@ my %mm_valid_items = (
'ambienttemp' => 1,
'mmtemp' => 1,
);
my %cmm_valid_items = (
'powerstatus' => 1,
'powerpolicy' => 1,
'powermodule' => 1,
'avaiablepower' => 1,
'reservedpower' => 1,
'remainpower' => 1,
'inusedpower' => 1,
'availableDC' => 1,
'averageAC' => 1,
'thermaloutput' => 1,
'ambienttemp' => 1,
'mmtemp' => 1,
);
my %pd1_valid_items = (
'pd1status' => 1,
'pd1policy' => 1,
'pd1powermodule1' => 1,
'pd1powermodule2' => 1,
'pd1avaiablepower' => 1,
'pd1reservedpower' => 1,
'pd1remainpower' => 1,
'pd1inusedpower' => 1,
);
my %pd2_valid_items = (
'pd2status' => 1,
'pd2policy' => 1,
'pd2powermodule1' => 1,
'pd2powermodule2' => 1,
'pd2avaiablepower' => 1,
'pd2reservedpower' => 1,
'pd2remainpower' => 1,
'pd2inusedpower' => 1,
);
my %blade_valid_items = (
'all' => 1,
'averageDC' => 1,
'cappingmaxmin' => 0,
'cappingmax' => 0,
@@ -2287,6 +2363,22 @@ my %blade_valid_items = (
'dsavingstatus' => 3,
);
my %flex_blade_valid_items = (
'averageDC' => 1,
'cappingmaxmin' => 1,
'cappingmax' => 1,
'cappingmin' => 1,
'cappingGmin' => 1,
'capability' => 1,
'cappingvalue' => 1,
'cappingwatt' => 2,
'cappingperc' => 2,
'CPUspeed' => 1,
'maxCPUspeed' => 1,
'cappingstatus' => 3,
'savingstatus' => 3,
'dsavingstatus' => 3,
);
# use the slot number of serverblade to get the powerdomain number
# and the bay number in the powerdomain
@@ -2325,6 +2417,9 @@ sub getpdbayinfo {
$pdnum = 1;
$pdbay = $slot + 17;
}
} elsif ($bc_type =~ /^7893$/) { # for flex
$pdnum = 1;
$pdbay = $slot + 24;
} else { # for common blade center
if ($slot < 7) {
$pdnum = 1;
@@ -2361,59 +2456,100 @@ sub renergy {
if (!$item) {
next;
}
my $readpath = ();
my $checkpath = ();
if ($item =~ /^all$/) {
if ($mpa eq $node) {
#handle the mm itself
push @readlist, ('pd1status','pd2status','pd1policy','pd2policy',
'pd1powermodule1','pd1powermodule2','pd2powermodule1',
'pd2powermodule2','pd1avaiablepower','pd2avaiablepower',
'pd1reservedpower','pd2reservedpower','pd1remainpower',
'pd2remainpower','pd1inusedpower','pd2inusedpower',
'availableDC','averageAC','thermaloutput','ambienttemp',
'mmtemp');
if ($mptype eq "cmm") {
$readpath = \%cmm_valid_items;
} else { # Assume it's AMM
$readpath = \%mm_valid_items;
}
} else {
push @readlist, ('averageDC','capability','cappingvalue','CPUspeed','maxCPUspeed','savingstatus','dsavingstatus');
if ($mptype eq "cmm") {
$readpath = \%flex_blade_valid_items;
} else { # Assume it's AMM
$readpath = \%blade_valid_items;
}
}
} elsif ($item =~ /^pd1all$/) {
push @readlist, ('pd1status','pd1policy','pd1powermodule1',
'pd1powermodule2','pd1avaiablepower','pd1reservedpower',
'pd1remainpower','pd1inusedpower');
if ($mpa ne $node) {
return (1, "pd1all is NOT available for flex or blade center server.");
}
if ($mptype eq "cmm") { # It only works for AMM
return (1, "pd1all is NOT available for flex chassis.");
}
$readpath = \%pd1_valid_items;
} elsif ($item =~ /^pd2all$/) {
push @readlist, ('pd2status','pd2policy','pd2powermodule1',
'pd2powermodule2','pd2avaiablepower','pd2reservedpower',
'pd2remainpower','pd2inusedpower');
if ($mpa ne $node) {
return (1, "pd2all is NOT available for flex or blade center server.");
}
if ($mptype eq "cmm") { # It only works for AMM
return (1, "pd2all is NOT available for flex chassis.");
}
$readpath = \%pd2_valid_items;
} elsif ($item =~ /^cappingmaxmin$/) {
push @readlist, ('cappingmin','cappingmax');
} elsif ($item =~ /(.*)=(.*)/) {
my $name = $1;
my $value = $2;
if ($mpa eq $node) {
if ($mm_valid_items{$name} < 2) {
return (1, "$name is NOT writable.");
if ($mptype eq "cmm") {
$checkpath = \%cmm_valid_items;
} else {
$checkpath = \%mm_valid_items;
}
} else {
if ($blade_valid_items{$name} < 2) {
return (1, "$name is NOT writable.");
if ($mptype eq "cmm") {
$checkpath = \%flex_blade_valid_items;
} else {
$checkpath = \%blade_valid_items;
}
}
if ($checkpath->{$name} < 2) {
return (1, "$name is NOT writable.");
}
$writelist{$name} = $value;
#if ($name eq "cappingwatt" || $name eq "cappingperc") {
# push @r4wlist, ('cappingmin','cappingmax');
#}
if ($name eq "cappingwatt" || $name eq "cappingperc") {
push @r4wlist, ('cappingmin','cappingmax');
}
} else {
if ($mpa eq $node) {
if ($mm_valid_items{$item} != 1 && $mm_valid_items{$item} != 3) {
return (1, "$item is NOT a valid attribute.");
if ($mptype eq "cmm") {
$checkpath = \%cmm_valid_items;
} else {
$checkpath = \%mm_valid_items;
}
} else {
if ($blade_valid_items{$item} != 1 && $blade_valid_items{$item} != 3) {
return (1, "$item is NOT a valid attribute.");
if ($mptype eq "cmm") {
$checkpath = \%flex_blade_valid_items;
} else {
$checkpath = \%blade_valid_items;
}
}
if ($checkpath->{$item} != 1 && $checkpath->{$item} != 3) {
return (1, "$item is NOT a valid attribute.");
}
push @readlist, $item;
}
# Handle the attribute equals 'all', 'pd1all', 'pd2all'
if ($readpath) {
foreach (keys %$readpath) {
if ($readpath->{$_} == 1 || $readpath->{$_} == 3) {
if (/^cappingmaxmin$/) { next;}
push @readlist, $_;
}
}
}
}
# does not support to read and write in one command
if ( @readlist && %writelist ) {
return (1, "Cannot handle read and write in one command.");
@@ -2440,15 +2576,15 @@ sub renergy {
my @output = ();
foreach my $item (sort(@readlist)) {
my $oid = "";
if ($item eq "pd1status") {
if ($item =~ /^(pd1status|powerstatus)$/) {
$oid = $pdstatus_oid.".1";
} elsif ($item eq "pd2status") {
$oid = $pdstatus_oid.".2";
} elsif ($item eq "pd1policy") {
} elsif ($item =~ /^(pd1policy|powerpolicy)$/) {
$oid = $pdpolicy_oid.".1";
} elsif ($item eq "pd2policy") {
$oid = $pdpolicy_oid.".2";
} elsif ($item eq "pd1powermodule1") {
} elsif ($item =~ /^(pd1powermodule1|powermodule)$/) {
$oid = $pdmodule1_oid.".1";
} elsif ($item eq "pd2powermodule1") {
$oid = $pdmodule1_oid.".2";
@@ -2456,19 +2592,19 @@ sub renergy {
$oid = $pdmodule2_oid.".1";
} elsif ($item eq "pd2powermodule2") {
$oid = $pdmodule2_oid.".2";
} elsif ($item eq "pd1avaiablepower") {
} elsif ($item =~ /^(pd1avaiablepower|avaiablepower)$/) {
$oid = $pdavailablepower_oid.".1";
} elsif ($item eq "pd2avaiablepower") {
$oid = $pdavailablepower_oid.".2";
} elsif ($item eq "pd1reservedpower") {
} elsif ($item =~ /^(pd1reservedpower|reservedpower)$/) {
$oid = $pdreservepower_oid.".1";
} elsif ($item eq "pd2reservedpower") {
$oid = $pdreservepower_oid.".2";
} elsif ($item eq "pd1remainpower") {
} elsif ($item =~ /^(pd1remainpower|remainpower)$/) {
$oid = $pdremainpower_oid.".1";
} elsif ($item eq "pd2remainpower") {
$oid = $pdremainpower_oid.".2";
} elsif ($item eq "pd1inusedpower") {
} elsif ($item =~ /^(pd1inusedpower|inusedpower)$/) {
$oid = $pdinused_oid.".1";
} elsif ($item eq "pd2inusedpower") {
$oid = $pdinused_oid.".2";
@@ -2490,30 +2626,26 @@ sub renergy {
$pdnum++;
$oid =~ s/pdnum/$pdnum/;
$oid = $oid.".".$pdbay;
} elsif ($item eq "cappingmax") {
my ($pdnum, $pdbay) = getpdbayinfo($bc_type, $slot);
$oid = $maxallocpower_oid;
$pdnum++;
$oid =~ s/pdnum/$pdnum/;
$oid = $oid.".".$pdbay;
} elsif ($item eq "cappingmin") {
my ($pdnum, $pdbay) = getpdbayinfo($bc_type, $slot);
$oid = $minallocpower_oid;
$pdnum++;
$oid =~ s/pdnum/$pdnum/;
$oid = $oid.".".$pdbay;
} elsif ($item eq "capability") {
} elsif ($item eq "capability") {
my ($pdnum, $pdbay) = getpdbayinfo($bc_type, $slot);
$oid = $powercapability_oid;
$pdnum++;
$oid =~ s/pdnum/$pdnum/;
$oid = $oid.".".$pdbay;
} elsif ($item eq "cappingmax") {
$oid = $PowerPcapMax_oid.".".$slot;
} elsif ($item eq "cappingmin") {
$oid = $PowerPcapMin_oid.".".$slot;
} elsif ($item eq "cappingGmin") {
$oid = $PowerPcapGMin_oid.".".$slot;
} elsif ($item eq "cappingvalue") {
$oid = $powercapping_oid.".".$slot;
} elsif ($item eq "CPUspeed") {
$oid = $effCPU_oid.".".$slot;
} elsif ($item eq "maxCPUspeed") {
$oid = $maxCPU_oid.".".$slot;
} elsif ($item eq "cappingstatus") {
$oid = $PowerControl_oid.".".$slot;
} elsif ($item eq "savingstatus") {
$oid = $savingstatus_oid.".".$slot;
} elsif ($item eq "dsavingstatus") {
@@ -2529,28 +2661,39 @@ sub renergy {
if ($data ne ""
&& $data ne "NOSUCHINSTANCE"
&& $data ne "notApplicable" ) {
if ($item =~ /pd[1|2]policy/) {
if ($item =~ /^(pd1|pd2|power)policy$/) {
push @output, "$item: $pdpolicymap{$data}";
} elsif ($item eq "capability") {
push @output, "$item: $capabilitymap{$data}";
} elsif ($item =~/cappingvalue|averageDC|cappingmax|cappingmin/) {
} elsif ($item =~/cappingvalue|averageDC|cappingmax|cappingmin|cappingGmin/) {
if ($item eq "cappingvalue" && $data eq "0") {
push @output,"$item: na";
} else {
my $bladewidth = $session->get([$bladewidth_oid.".$slot"]);
if ($session->{ErrorStr}) { return (1,$session->{ErrorStr}); }
$data =~ s/W$//;
$data =~ s/[^\d]*$//;
foreach (1..$bladewidth-1) {
$oid =~ /(\d+)$/;
my $next = $1+$_;
$oid =~ s/(\d+)$/$next/;
my $nextdata=$session->get([$oid]);
if ($session->{ErrorStr}) { return (1,$session->{ErrorStr}); }
$nextdata =~ s/W$//;
$nextdata =~ s/[^\d]*$//;
$data += $nextdata;
}
push @output, "$item: $data"."W";
}
} elsif ($item eq "cappingstatus") {
if ($data eq "2" || $data eq "5" || $data eq "10") {
# 1 all off; 2 cap;
# 4 staticsaving; 5 cap + staticsaving;
# 9 dynamicsaving; 10 cap + dynamicsaving;
push @output,"$item: on";
} elsif ($data eq "0" || $data eq "1" || $data eq "3" || $data eq "4" || $data eq "9") {
push @output, "$item: off";
} else {
push @output,"$item: na";
}
} elsif ($item eq "savingstatus") {
if ($data eq "0") {
push @output,"$item: off";
@@ -2593,43 +2736,141 @@ sub renergy {
foreach my $item (keys %writelist) {
my $oid = "";
my $svalue;
my $cvalue;
my $capmax;
my $capmin;
if ($item eq "cappingwatt" || $item eq "cappingperc") {
if (0) {
foreach my $i (@setneed) {
if ($i =~ /^cappingmax: (\d*)W/) {
$capmax = $1;
} elsif ($i =~ /^cappingmin: (\d*)W/) {
$capmin = $1;
}
if ($item eq "cappingstatus") {
if ($writelist{$item} eq "on") {
$cvalue = "1";
} elsif ($writelist{$item} eq "off") {
$cvalue = "0";
} else {
return (1, "The setting value should be on|off.");
}
if (! (defined ($capmax) && defined ($capmin))) {
return (1, "Cannot get the value of cappingmin or cappingmax.");
}
if ($item eq "cappingwatt" && ($writelist{$item} > $capmax || $writelist{$item} < $capmin)) {
return (1, "The set value should be in the range $capmin - $capmax.");
}
if ($item eq "cappingperc") {
if ($writelist{$item} > 100 || $writelist{$item} < 0) {
return (1, "The percentage value should be in the range 0 - 100");
}
$writelist{$item} = int (($capmax-$capmin)*$writelist{$item}/100 + $capmin);
}
}
my $data = $session->set(new SNMP::Varbind([$powercapping_oid, $slot, $writelist{$item} ,'INTEGER']));
unless ($data) { return (1,$session->{ErrorStr}); }
my $ndata=$session->get([$powercapping_oid.".".$slot]);
# Get the power control value
my $cdata = $session->get([$PowerControl_oid.".".$slot]);
if ($session->{ErrorStr}) { return (1,$session->{ErrorStr}); }
if ($ndata ne $writelist{$item}) {
# 1 all off; 2 cap;
# 4 staticsaving; 5 cap + staticsaving;
# 9 dynamicsaving; 10 cap + dynamicsaving;
if ($cvalue eq "1") {
# to enable capping
if ($cdata eq "2" || $cdata eq "5" || $cdata eq "10") {
return (0, "Power capping has been enabled.");
} elsif ($cdata eq "0" || $cdata eq "1") {
$cvalue = "2";
} elsif ($cdata eq "4") {
$cvalue = "5";
} elsif ($cdata eq "9") {
$cvalue = "10";
} else {
return (1, "Encountered error to turn on capping.");
}
} else {
# to disable capping
if ($cdata eq "1" || $cdata eq "4" || $cdata eq "9") {
return (0, "Power capping has been disabled.");
} elsif ($cdata eq "2") {
$cvalue = "1";
} elsif ($cdata eq "5") {
$cvalue = "4";
} elsif ($cdata eq "10") {
$cvalue = "9";
} else {
return (1, "Encountered error to turn off capping.");
}
}
my $data = $session->set(new SNMP::Varbind([$PowerControl_oid, $slot, $cvalue ,'INTEGER']));
unless ($data) { return (1,$session->{ErrorStr}); }
my $rdata=$session->get([$PowerControl_oid.".".$slot]);
if ($session->{ErrorStr}) { return (1,$session->{ErrorStr}); }
if ($rdata ne $cvalue) {
return (1, "$item: set operation failed.");
}
} elsif ($item eq "cappingwatt" || $item eq "cappingperc") {
my $bladewidth = $session->get([$bladewidth_oid.".$slot"]);
if ($session->{ErrorStr}) { return (1,$session->{ErrorStr}); }
if ($bladewidth == 1) {
foreach my $i (@setneed) {
if ($i =~ /^cappingmax: (\d*)W/) {
$capmax = $1;
} elsif ($i =~ /^cappingmin: (\d*)W/) {
$capmin = $1;
}
}
if (! (defined ($capmax) && defined ($capmin))) {
return (1, "Cannot get the value of cappingmin or cappingmax.");
}
if ($item eq "cappingwatt" && ($writelist{$item} > $capmax || $writelist{$item} < $capmin)) {
return (1, "The set value should be in the range $capmin - $capmax.");
}
if ($item eq "cappingperc") {
if ($writelist{$item} > 100 || $writelist{$item} < 0) {
return (1, "The percentage value should be in the range 0 - 100");
}
$writelist{$item} = int (($capmax-$capmin)*$writelist{$item}/100 + $capmin);
}
my $data = $session->set(new SNMP::Varbind([$powercapping_oid, $slot, $writelist{$item} ,'INTEGER']));
unless ($data) { return (1,$session->{ErrorStr}); }
my $ndata=$session->get([$powercapping_oid.".".$slot]);
if ($session->{ErrorStr}) { return (1,$session->{ErrorStr}); }
if ($ndata ne $writelist{$item}) {
return (1, "$item: set operation failed.");
}
} elsif ($bladewidth == 2) {
# for double wide blade, the capping needs to be set for the two slots one by one
# base on the min/max of the slots to know the rate of how many set to slot1 and how many set to slot2
my $min1 = $session->get([$PowerPcapMin_oid.".".$slot]);
if ($session->{ErrorStr}) { return (1,$session->{ErrorStr}); }
my $min2 = $session->get([$PowerPcapMin_oid.".".($slot+1)]);
if ($session->{ErrorStr}) { return (1,$session->{ErrorStr}); }
my $max1 = $session->get([$PowerPcapMax_oid.".".$slot]);
if ($session->{ErrorStr}) { return (1,$session->{ErrorStr}); }
my $max2 = $session->get([$PowerPcapMax_oid.".".($slot+1)]);
if ($session->{ErrorStr}) { return (1,$session->{ErrorStr}); }
my ($cv1, $cv2);
if ($item eq "cappingperc") {
if ($writelist{$item} > 100 || $writelist{$item} < 0) {
return (1, "The percentage value should be in the range 0 - 100");
}
$cv1 = int (($max1-$min1)*$writelist{$item}/100 + $min1);
$cv2 = int (($max2-$min2)*$writelist{$item}/100 + $min2);
} elsif ($item eq "cappingwatt") {
if (($min1 + $min2)>$writelist{$item} || ($max1+$max2)< $writelist{$item}) {
return (1, "The set value should be in the range ".($min1 + $min2)." - ".($max1+$max2).".");
} elsif (($max1 + $max2) == $writelist{$item}) {
$cv1 = $max1;
$cv2 = $max2;
} elsif (($min1 + $min2) == $writelist{$item}) {
$cv1 = $min1;
$cv2 = $min2;
} else {
my $x1 = ($max1+$min1)/2;
my $x2 = ($max2+$min2)/2;
# cv1/cv2 = $x1/$x2; cv1+cv2=$writelist{$item}
$cv1 = int ($writelist{$item}*$x1/($x1+$x2));
$cv2 = $writelist{$item} - $cv1;
}
}
my $data = $session->set(new SNMP::Varbind([$powercapping_oid, $slot, $cv1 ,'INTEGER']));
unless ($data) { return (1,$session->{ErrorStr}); }
$data = $session->set(new SNMP::Varbind([$powercapping_oid, ($slot+1), $cv2 ,'INTEGER']));
unless ($data) { return (1,$session->{ErrorStr}); }
} else {
return (1, "Don't know the wide of the blade.");
}
} elsif ($item eq "savingstatus") {
if ($writelist{$item} eq "on") {
$svalue = "1";
@@ -2778,6 +3019,8 @@ sub renergy {
}
}
}
} else {
return (1, "$item is NOT a valid attribute..");
}
push @output, "$item: Set operation succeeded.";
@@ -3271,12 +3514,12 @@ sub bladecmd {
if (defined($vitals_info) and defined($vitals_info->{$currnode})) {
my $attr = $vitals_info->{$currnode};
my $fsp_api = ($::XCATROOT) ? "$::XCATROOT/sbin/fsp-api" : "/opt/xcat/sbin/fsp-api";
my $cmd = "$fsp_api -a query_lcds -T 0 -t 0:$$attr[3]:$$attr[0]:$currnode: 2>&1";
my $cmd = "$fsp_api -a pblade_query_lcds -T 0 -t 0:$$attr[3]:$$attr[0]:$currnode: 2>&1";
my $res = xCAT::Utils->runcmd($cmd, -1);
if ($res !~ /error/i) {
my @array = split(/\n/, $res);
foreach my $a(@array) {
my ($name, $data) = split(/:/,$a);
foreach my $a (@array) {
my ($name,$data) = split(/:/, $a);
if ($data =~ /1\|(\w[\w\s]*)/) {
push @result, "Current LCD: $1";
} else {
@@ -3634,8 +3877,8 @@ sub preprocess_request {
#parse the arguments for commands
if ($command eq "getmacs") {
my (@mpnodes, @fspnodes, @nohandle);
filter_nodes($request, \@mpnodes, \@fspnodes, \@nohandle);
my (@mpnodes, @nohandle);
xCAT::Utils->filter_nodes($request, \@mpnodes, undef, undef, \@nohandle);
if (@nohandle) {
$callback->({data=>"Cannot figure out plugin for nodes:@nohandle"});
}
@@ -3672,12 +3915,22 @@ sub preprocess_request {
$request = {};
return;
}
#} elsif ($command eq "rspconfig") {
my (@mpnodes, @nohandle);
xCAT::Utils->filter_nodes($request, \@mpnodes, undef, undef, \@nohandle);
if (@nohandle) {
$callback->({data=>"Error: Cannot figure out plugin for nodes:@nohandle"});
}
if (@mpnodes) {
$noderange = \@mpnodes;
} else {
$request = {};
return;
}
} elsif ($command =~ /^(rspconfig|rvitals)$/) {
# All the nodes with mgt=blade or mgt=fsp will get here
# filter out the nodes for blade.pm
my (@mpnodes, @fspnodes, @nohandle);
filter_nodes($request, \@mpnodes, \@fspnodes, \@nohandle);
my (@mpnodes, @nohandle);
xCAT::Utils->filter_nodes($request, \@mpnodes, undef, undef, \@nohandle);
if (@nohandle) {
$callback->({data=>"Cannot figure out plugin for nodes:@nohandle"});
}
@@ -3711,10 +3964,19 @@ sub preprocess_request {
return [];
}
my %mpatype = ();
foreach my $node (@$noderange) {
my $ent=$mptabhash->{$node}->[0]; #$mptab->getNodeAttribs($node,['mpa', 'id']);
if (defined($ent->{mpa})) { push @{$mpa_hash{$ent->{mpa}}{nodes}}, $node;}
elsif ($indiscover) {
my $mpaent;
if (defined($ent->{mpa})) {
push @{$mpa_hash{$ent->{mpa}}{nodes}}, $node;
unless ($mpatype{$ent->{mpa}}) {
my $mpaent = $mptab->getNodeAttribs($ent->{mpa},['nodetype']);
if ($mpaent && $mpaent->{'nodetype'}) {
$mpatype{$ent->{mpa}} = $mpaent->{'nodetype'};
}
}
} elsif ($indiscover) {
next;
} else {
$callback->({data=>["no mpa defined for node $node"]});
@@ -3723,7 +3985,7 @@ sub preprocess_request {
}
if (defined($ent->{id})) { push @{$mpa_hash{$ent->{mpa}}{ids}}, $ent->{id};}
else { push @{$mpa_hash{$ent->{mpa}}{ids}}, "";}
if (defined($ent->{nodetype})) { push @{$mpa_hash{$ent->{mpa}}{nodetype}}, $ent->{nodetype};}
if (defined($mpatype{$ent->{mpa}})) { push @{$mpa_hash{$ent->{mpa}}{nodetype}}, $mpatype{$ent->{mpa}};}
else { push @{$mpa_hash{$ent->{mpa}}{nodetype}}, "mm";}
}
@@ -3755,90 +4017,6 @@ sub preprocess_request {
return \@requests;
}
##########################################################################
# Fliter the nodes that are NGP ppc blade node or common fsp node
# 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
##########################################################################
sub filter_nodes{
my ($req, $mpnodes, $fspnodes, $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 parent of the service processor
# for the NGP ppc blade, the ppc.parent is the mpa
my $ppctabhash;
my $ppctab = xCAT::Table->new("ppc");
if ($ppctab) {
$ppctabhash = $ppctab->getNodesAttribs(\@nodes,['nodetype']);
}
my (@mp, @ngpfsp, @commonfsp, @unknow);
my %fspparent;
# Get the parent for each node
foreach (@nodes) {
if (defined ($mptabhash->{$_}->[0]->{'mpa'})) {
if (defined ($ppctabhash->{$_}->[0]->{'nodetype'}) && ($ppctabhash->{$_}->[0]->{'nodetype'} eq "blade")) {
push @ngpfsp, $_;
next;
}
else {
# Non NGP power blade
push @mp, $_;
next;
}
} elsif (defined ($ppctabhash->{$_}->[0]->{'nodetype'})) {
# otherwise, this is a general power node
push @commonfsp, $_;
} else {
push @unknow, $_;
}
}
push @{$mpnodes}, @mp;
push @{$fspnodes}, @commonfsp;
if (@args && ($cmd eq "rspconfig")) {
if (!(grep /^(cec_off_policy|pending_power_on_side)/, @args)) {
push @{$mpnodes}, @ngpfsp;
} else {
push @{$fspnodes}, @ngpfsp;
}
} elsif($cmd eq "getmacs") {
if (@args && (grep /^-D$/,@args)) {
push @{$fspnodes}, @ngpfsp;
} else {
push @{$mpnodes}, @ngpfsp;
}
} elsif ($cmd eq "rvitals") {
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}]\n";
return 0;
}
sub build_more_info{
my $noderange=shift;
my $callback=shift;
@@ -3852,16 +4030,24 @@ sub build_more_info{
my %mpa_hash=();
my $mptabhash = $mptab->getNodesAttribs($noderange,['mpa','id','nodetype']);
my %mpatype = ();
foreach my $node (@$noderange) {
my $ent=$mptabhash->{$node}->[0]; #$mptab->getNodeAttribs($node,['mpa', 'id']);
if (defined($ent->{mpa})) { push @{$mpa_hash{$ent->{mpa}}{nodes}}, $node;}
else {
if (defined($ent->{mpa})) {
push @{$mpa_hash{$ent->{mpa}}{nodes}}, $node;
unless ($mpatype{$ent->{mpa}}) {
my $mpaent = $mptab->getNodeAttribs($ent->{mpa},['nodetype']);
if ($mpaent && $mpaent->{'nodetype'}) {
$mpatype{$ent->{mpa}} = $mpaent->{'nodetype'};
}
}
} else {
$callback->({data=>["no mpa defined for node $node"]});
return @moreinfo;;
}
if (defined($ent->{id})) { push @{$mpa_hash{$ent->{mpa}}{ids}}, $ent->{id};}
else { push @{$mpa_hash{$ent->{mpa}}{ids}}, "";}
if (defined($ent->{nodetype})) { push @{$mpa_hash{$ent->{mpa}}{nodetype}}, $ent->{nodetype};}
if (defined($mpatype{$ent->{mpa}})) { push @{$mpa_hash{$ent->{mpa}}{nodetype}}, $mpatype{$ent->{mpa}};}
else { push @{$mpa_hash{$ent->{mpa}}{nodetype}}, "mm";}
}
@@ -4177,13 +4363,15 @@ sub clicmds {
my $curraddr = $mpa;
if ($args{curraddr}) {
$curraddr = $args{curraddr};
} elsif (defined($handled{'initnetwork'})) {
} elsif (defined($handled{'initnetwork'}) or defined($handled{'USERID'})) {
# get the IP of mpa from the hosts.otherinterfaces
my $hoststab = xCAT::Table->new('hosts');
if ($hoststab) {
my $hostdata = $hoststab->getNodeAttribs($node, ['otherinterfaces']);
if (!$hostdata->{'otherinterfaces'}) {
return ([1,\@unhandled,"Cannot find the temporary IP from the hosts.otherinterfaces"]);
if (!defined($handled{'USERID'})) {
return ([1,\@unhandled,"Cannot find the temporary IP from the hosts.otherinterfaces"]);
}
} else {
$curraddr = $hostdata->{'otherinterfaces'};
}
@@ -4297,6 +4485,14 @@ sub clicmds {
elsif (/^userpassword$/) {$result = passwd($t, $mpa, $1, $handled{$_}, $promote_pass, $mm);}
if (!defined($result)) {next;}
push @data, "$_: @$result";
if (/^initnetwork$/) {
if (!@$result[0]) {
my $hoststab = xCAT::Table->new('hosts');
if ($hoststab) {
$hoststab->setNodeAttribs($mpa, {otherinterfaces=>''});
}
}
}
$Rc |= shift(@$result);
push @cfgtext,@$result;
}
@@ -4444,11 +4640,11 @@ sub get_blades_for_mpa {
my %blades_hash = ();
my $mptab = xCAT::Table->new('mp');
my $ppctab = xCAT::Table->new('ppc');
my @attribs = qw(id pprofile parent hcp);
my @attribs = qw(id nodetype parent hcp);
if (!defined($mptab) or !defined($ppctab)) {
return undef;
}
my @nodearray = $mptab->getAttribs({mpa=>$mpa,nodetype=>"blade"}, qw(node));
my @nodearray = $mptab->getAttribs({mpa=>$mpa}, qw(node));
my @blades = ();
my $nodesattrs;
if (!defined(@nodearray)) {
@@ -4466,12 +4662,11 @@ sub get_blades_for_mpa {
my @values = ();
if (!defined($att)) {
next;
} elsif ($att and $att->{parent} and ($att->{parent} ne $mpa)) {
} elsif (!defined($att->{parent}) or ($att->{parent} ne $mpa) or !defined($att->{nodetype}) or $att->{nodetype} ne "blade") {
next;
}
my $request;
my $nodetype = "blade";
my $hcp_ip = xCAT::FSPUtils::getIPaddress($request, $nodetype, $att->{hcp});
my $hcp_ip = xCAT::FSPUtils::getIPaddress($request, $att->{nodetype}, $att->{hcp});
if (!defined($hcp_ip) or ($hcp_ip == -3)) {
next;
}
@@ -4547,7 +4742,7 @@ sub passwd {
} elsif ($res =~ /The hdwr_svr daemon is not currently running/i) {
return ([1, "Update password for 'hdwr_svr' failed because the 'hdwr_svr' daemon is not currently running. Please recreate the connections between blades and hdwr_svr."]);
}
my $hws_cmd = "$fsp_api -a reset_hws_pw -u $user -p $oldpass -P $pass -T 0 -t 0:$$att[3]:$$att[0]:$node_name: 2>&1";
my $hws_cmd = "$fsp_api -a reset_hws_pw -u HMC -p $oldpass -P $pass -T 0 -t 0:$$att[3]:$$att[0]:$node_name: 2>&1";
#print "===>set_hws_cmd=$hws_cmd\n";
$res = xCAT::Utils->runcmd($hws_cmd, -1);
@@ -5240,7 +5435,7 @@ sub dompa {
}
# Only telnet commands
unless ( @$args ) {
if($command ne "getmacs"){
if(($command ne "getmacs")&& ($command ne "rbeacon")){
return;
}
}
+2 -1
View File
@@ -1009,7 +1009,8 @@ sub add_or_delete_records {
}
my $zone;
foreach $zone (keys %{$ctx->{updatesbyzone}}) {
my $resolver = Net::DNS::Resolver->new(nameservers=>[$ctx->{nsmap}->{$zone}]);
my $ip = xCAT::NetworkUtils->getipaddr($ctx->{nsmap}->{$zone});
my $resolver = Net::DNS::Resolver->new(nameservers=>[$ip]);
my $entry;
my $numreqs = 300; # limit to 300 updates in a payload, something broke at 644 on a certain sample, choosing 300 for now
my $update = Net::DNS::Update->new($zone);
+6 -97
View File
@@ -4,6 +4,7 @@ package xCAT_plugin::fsp;
use strict;
use xCAT::PPC;
use xCAT::DBobjUtils;
use xCAT::Utils;
use xCAT_plugin::hmc;
##########################################################################
@@ -12,7 +13,7 @@ use xCAT_plugin::hmc;
sub handled_commands {
return {
rpower => 'nodehm:power,mgt',
reventlog => 'nodehm:mgt',
#reventlog => 'nodehm:mgt',
rspconfig => 'nodehm:mgt',
mkhwconn => 'nodehm:mgt',
rmhwconn => 'nodehm:mgt',
@@ -72,13 +73,12 @@ sub preprocess_request {
my $callback = $arg2;
getmulcon($node,$callback);
return [];
}
#if ($arg1->{command}->[0] eq "rspconfig") {
if ($arg1->{command}->[0] =~ /rspconfig|rvitals/) {
}
if ($arg1->{command}->[0] =~ /rspconfig|rvitals|getmacs|renergy/) {
# All the nodes with mgt=blade or mgt=fsp will get here
# filter out the nodes for fsp.pm
my (@mpnodes, @fspnodes, @nohandle);
filter_nodes($arg1, \@mpnodes, \@fspnodes, \@nohandle);
my (@fspnodes, @nohandle);
xCAT::Utils->filter_nodes($arg1, undef, \@fspnodes, undef, \@nohandle);
if (@fspnodes) {
$arg1->{noderange} = \@fspnodes;
} else {
@@ -86,15 +86,6 @@ sub preprocess_request {
}
}
if ($arg1->{command}->[0] eq "getmacs") {
my (@mpnodes, @fspnodes, @nohandle);
filter_nodes($arg1, \@mpnodes, \@fspnodes, \@nohandle);
if (@fspnodes) {
$arg1->{noderange} = \@fspnodes;
} else {
return [];
}
}
xCAT::PPC::preprocess_request(__PACKAGE__,@_);
}
@@ -105,88 +96,6 @@ sub process_request {
xCAT::PPC::process_request(__PACKAGE__,@_);
}
##########################################################################
# Fliter the nodes that are NGP ppc blade node or common fsp node
# 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
##########################################################################
sub filter_nodes{
my ($req, $mpnodes, $fspnodes, $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 parent of the service processor
# for the NGP ppc blade, the ppc.parent is the mpa
my $ppctabhash;
my $ppctab = xCAT::Table->new("ppc");
if ($ppctab) {
$ppctabhash = $ppctab->getNodesAttribs(\@nodes,['nodetype']);
}
my (@mp, @ngpfsp, @commonfsp, @unknow);
my %fspparent;
# Get the parent for each node
foreach (@nodes) {
if (defined ($mptabhash->{$_}->[0]->{'mpa'})) {
if (defined ($ppctabhash->{$_}->[0]->{'nodetype'}) && ($ppctabhash->{$_}->[0]->{'nodetype'} eq "blade")) {
push @ngpfsp, $_;
next;
}
else {
# Non NGP power blade
push @mp, $_;
next;
}
} elsif (defined ($ppctabhash->{$_}->[0]->{'nodetype'})) {
# otherwise, this is a general power node
push @commonfsp, $_;
} else {
push @unknow, $_;
}
}
push @{$mpnodes}, @mp;
push @{$fspnodes}, @commonfsp;
if (@args && ($cmd eq "rspconfig")) {
if (!(grep /^(cec_off_policy|pending_power_on_side)/, @args)) {
push @{$mpnodes}, @ngpfsp;
} else {
push @{$fspnodes}, @ngpfsp;
}
} elsif($cmd eq "getmacs") {
if (@args && (grep /^-D$/,@args)) {
push @{$fspnodes}, @ngpfsp;
} else {
push @{$mpnodes}, @ngpfsp;
}
} elsif ($cmd eq "rvitals") {
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}]\n";
return 0;
}
##########################################################################
# get hcp and id for rcons with fsp
##########################################################################
@@ -65,9 +65,10 @@ sub process_request
$client = $request->{'_xcat_clienthost'}->[0];
}
my $origclient = $client;
if ($client) { ($client) = noderange($client) };
unless ($client) { #Not able to do identify the host in question
xCAT::MsgUtils->message("S","Received getpostscript from $client, which couldn't be correlated to a node (domain mismatch?)");
xCAT::MsgUtils->message("S","Received getpostscript from $origclient, which couldn't be correlated to a node (domain mismatch?)");
return;
}
my $state;
+5
View File
@@ -5800,6 +5800,11 @@ sub preprocess_request {
$chunksize=$::XCATSITEVALS{syspowermaxnodes};
$delayincrement=$::XCATSITEVALS{syspowerinterval};
}
} elsif ($command eq "renergy") {
# filter out the nodes which should be handled by ipmi.pm
my (@bmcnodes, @nohandle);
xCAT::Utils->filter_nodes($request, undef, undef, \@bmcnodes, \@nohandle);
$realnoderange = \@bmcnodes;
}
+1
View File
@@ -177,6 +177,7 @@ sub get_storage_pool_by_url {
unless ($path =~ /^\//) {
$path = '/'.$path;
}
$path =~ s/\/\z//; #delete trailing / if table specifies, a perfectly understable 'mistake'
my $checkpath = $pool->findnodes("/pool/target/path/text()")->[0]->data;
if ($checkpath eq $path) {
last;
+95 -14
View File
@@ -16,6 +16,7 @@ use xCAT::PPCdb;
use xCAT::NodeRange;
use xCAT::Utils;
my $option_s;
#require xCAT::MacMap;
require xCAT_plugin::blade;
@@ -37,12 +38,14 @@ use constant {
SERVICE_IVM => "integrated-virtualization-manager",
SERVICE_MM => "management-module",
SERVICE_CMM => "chassis-management-module",
SERVICE_IMM2 => "integrated-management-module2",
SERVICE_RSA => "remote-supervisor-adapter",
SERVICE_RSA2 => "remote-supervisor-adapter-2",
#SLP_CONF => "/usr/local/etc/slp.conf",
#SLPTOOL => "/usr/local/bin/slptool",
TYPE_MM => "mm",
TYPE_CMM => "cmm",
TYPE_IMM2 => "imm2",
TYPE_RSA => "rsa",
TYPE_BPA => "bpa",
TYPE_HMC => "hmc",
@@ -69,6 +72,7 @@ my %service_slp = (
@{[ SERVICE_IVM ]} => TYPE_IVM,
@{[ SERVICE_MM ]} => TYPE_MM,
@{[ SERVICE_CMM ]} => TYPE_CMM,
@{[ SERVICE_IMM2 ]} => TYPE_IMM2,
@{[ SERVICE_RSA ]} => TYPE_RSA,
@{[ SERVICE_RSA2 ]} => TYPE_RSA
);
@@ -140,6 +144,7 @@ my %globalhwtype = (
frame => $::NODETYPE_FRAME,
cec => $::NODETYPE_CEC,
cmm => $::NODETYPE_CMM,
imm2 => $::NODETYPE_IMM2,
);
my %globalnodetype = (
fsp => $::NODETYPE_PPC,
@@ -160,6 +165,7 @@ my %globalmgt = (
ivm => "ivm",
rsa => "blade",
cmm => "blade",
imm2 => "blade",
hmc => "hmc",
);
my %globalid = (
@@ -227,6 +233,7 @@ sub parse_args {
FRAME => HARDWARE_SERVICE.":".SERVICE_FRAME,
RSA => HARDWARE_SERVICE.":".SERVICE_RSA.":",
CMM => HARDWARE_SERVICE.":".SERVICE_CMM,
IMM2 => HARDWARE_SERVICE.":".SERVICE_IMM2,
MM => HARDWARE_SERVICE.":".SERVICE_MM.":"
);
#############################################
@@ -305,6 +312,7 @@ sub parse_args {
if ( !exists( $services{$opt{s}} )) {
return(usage( "Invalid service: $opt{s}" ));
}
$option_s = $opt{s};
$globalopt{service} = $services{$opt{s}};
}
#############################################
@@ -515,6 +523,7 @@ sub invoke_dodiscover {
$arg{Retry} = $maxt;
$arg{Count} = $globalopt{C} if($globalopt{C});
$arg{Time} = $globalopt{T} if($globalopt{T});
$arg{nomsg} = 1 if($globalopt{z} or $globalopt{x});
$arg{reqcallback} = $request->{callback} if($request->{callback});
my ($searchmacsref,$sendcount,$rsp) = xCAT::SLP::dodiscover(%arg);
@@ -965,12 +974,13 @@ sub parse_responses {
###########################################
my %atthash;
if (( $type eq SERVICE_RSA ) or ( $type eq SERVICE_RSA2 ) or
( $type eq SERVICE_MM )) {
( $type eq SERVICE_MM ) or ( $type eq SERVICE_IMM2 )) {
$atthash{type} = $service_slp{$type};
$atthash{mtm} = ${$attributes->{'enclosure-machinetype-model'}}[0];
$atthash{serial} = ${$attributes->{'enclosure-serial-number'}}[0];
$atthash{slot} = int(${$attributes->{'slot'}}[0]);
$atthash{ip} = ${$attributes->{'ip-address'}}[0];
if ( $type eq SERVICE_IMM2 ) { $atthash{ip} = ${$attributes->{'ipv4-address'}}[0]; }
else { $atthash{ip} = ${$attributes->{'ip-address'}}[0]; }
$atthash{mac} = $rsp;
$atthash{hostname} = get_host_from_url($request, $attributes);
$atthash{otherinterfaces} = ${$attributes->{'ip-address'}}[0];
@@ -995,6 +1005,10 @@ sub parse_responses {
$atthash{otherinterfaces} = ${$attributes->{'ipv4-address'}}[0];
$outhash{'Server-'.$atthash{mtm}.'-SN'.$atthash{serial}} = \%atthash;
$$length = length( $atthash{ip}) if ( length( $atthash{ip} ) > $$length );
if (exists($::OLD_DATA_CACHE{"mp*".$atthash{mtm}."*".$atthash{serial}})){
$atthash{hostname} = $::OLD_DATA_CACHE{"mp*".$atthash{mtm}."*".$atthash{serial}};
push @matchnode,'Server-'.$atthash{mtm}.'-SN'.$atthash{serial};
}
trace( $request, "Discover node $atthash{hostname}: type is $atthash{type}, \
mtm is $atthash{mtm}, sn is $atthash{serial}, side is $atthash{side}, \
ip is $atthash{ip}, mac is $atthash{mac}, mname is $atthash{mname},\
@@ -1022,7 +1036,70 @@ sub parse_responses {
trace( $request, "Discover node $atthash{hostname}: type is $atthash{type},\
mtm is $atthash{mtm},sn is $atthash{serial}, ip is $atthash{ip},\
mac is $atthash{mac}, otherinterfaces is $atthash{otherinterfaces}" );
}else {
}elsif (($type eq SERVICE_FSP) && (${$attributes->{'machinetype-model'}}[0] =~ /^7895|1457|7954/ )) {
# Skip this entry if "-s CEC" was specified - we do not list FSP entries for Flex when only CECs were requested
next unless ($option_s ne "CEC");
#begin to define fsp and bpa
my %tmphash;
$tmphash{type} = ($type eq SERVICE_BPA) ? TYPE_BPA : TYPE_FSP;
$tmphash{mtm} = ${$attributes->{'machinetype-model'}}[0];
$tmphash{serial} = ${$attributes->{'serial-number'}}[0];
$tmphash{ip} = ${$searchmacs{$rsp}}{peername};
my $loc = ($tmphash{ip} =~ ${$attributes->{'ip-address'}}[0]) ? 0:1; #every entry has two ip-addresses
$tmphash{side} = (int(${$attributes->{'slot'}}[0]) == 0) ? 'B-'.$loc:'A-'.$loc;
$tmphash{mac} = $rsp;
$tmphash{parent} = 'Server-'.$tmphash{mtm}.'-SN'.$tmphash{serial};
$tmphash{hostname} = $tmphash{ip};
$tmphash{url} = ${$searchmacs{$rsp}}{payload};
$tmphash{otherinterfaces} = ${$searchmacs{$rsp}}{peername};
$tmphash{bpcmtm} = ${$attributes->{'bpc-machinetype-model'}}[0];
$tmphash{bpcsn} = ${$attributes->{'bpc-serial-number'}}[0];
$tmphash{fid} = int(${$attributes->{'frame-number'}}[0]);
$tmphash{cid} = int(${$attributes->{'cage-number'}}[0]);
$outhash{$tmphash{ip}} = \%tmphash;
$$length = length( $tmphash{ip}) if ( length( $tmphash{ip} ) > $$length );
trace( $request, "Discover node $tmphash{hostname}:type is $tmphash{type}, mtm is $tmphash{mtm}, \
sn is $tmphash{serial}, side is $tmphash{side},parent is $tmphash{parent},ip is $tmphash{ip}, \
cec id is $tmphash{cid} , frame id is $tmphash{fid},mac is $tmphash{mac}, \
otherinterfaces is $tmphash{otherinterfaces}" );
#####################################################################
#define another side to fix the issue that the result is imcomplete
#####################################################################
my %tmphash1;
$tmphash1{ip} = (${$searchmacs{$rsp}}{peername} =~ ${$attributes->{'ip-address'}}[0])?${$attributes->{'ip-address'}}[1]:${$attributes->{'ip-address'}}[0];
unless ($outhash{$tmphash1{ip}}) {
my $validflag = 1;
foreach (@invalidiplist){
if ( $tmphash1{ip} =~ /^($_)/ ){
$validflag = 0;
last;
}
}
if ($validflag == 1) {
$tmphash1{type} = ($type eq SERVICE_BPA) ? TYPE_BPA : TYPE_FSP;
$tmphash1{mtm} = ${$attributes->{'machinetype-model'}}[0];
$tmphash1{serial} = ${$attributes->{'serial-number'}}[0];
my $loc = ($tmphash1{ip} =~ ${$attributes->{'ip-address'}}[0]) ? 0:1; #every entry has two ip-addresses
$tmphash1{side} = (int(${$attributes->{'slot'}}[0]) == 0) ? 'B-'.$loc:'A-'.$loc;
$tmphash1{mac} = xCAT::SLP::get_mac_for_addr($tmphash1{ip});
$tmphash1{parent} = 'Server-'.$tmphash1{mtm}.'-SN'.$tmphash1{serial};
$tmphash1{hostname} = $tmphash1{ip};
$tmphash1{otherinterfaces} = ${$searchmacs{$rsp}}{peername};
$tmphash1{bpcmtm} = ${$attributes->{'bpc-machinetype-model'}}[0];
$tmphash1{bpcsn} = ${$attributes->{'bpc-serial-number'}}[0];
$tmphash1{fid} = int(${$attributes->{'frame-number'}}[0]);
$tmphash1{cid} = int(${$attributes->{'cage-number'}}[0]);
$outhash{$tmphash1{ip}} = \%tmphash1;
$$length = length( $tmphash1{ip}) if ( length( $tmphash1{ip} ) > $$length );
trace( $request, "Discover another node $tmphash1{hostname}:type is $tmphash1{type}, mtm is $tmphash1{mtm}, \
sn is $tmphash1{serial}, side is $tmphash1{side},parent is $tmphash1{parent},ip is $tmphash1{ip}, \
cec id is $tmphash1{cid} , frame id is $tmphash1{fid},mac is $tmphash1{mac}, \
otherinterfaces is $tmphash1{otherinterfaces}" );
}
}
}else {
#begin to define fsp and bpa
my %tmphash;
$tmphash{type} = ($type eq SERVICE_BPA) ? TYPE_BPA : TYPE_FSP;
@@ -1138,7 +1215,7 @@ sub parse_responses {
$newhostname = $::OLD_DATA_CACHE{"frame*".${$outhash{$h}}{mtm}."*".${$outhash{$h}}{serial}};
if ($newhostname) {
${$outhash{$h}}{hostname} = $newhostname ;
trace ( $request, "$h find hostname $newhostname");
trace ( $request, "$h found hostname $newhostname");
push @matchnode, $h;
}
}
@@ -1160,7 +1237,7 @@ sub parse_responses {
$parent = $existing_node if ($existing_node);
}
${$outhash{$h}}{parent} = $parent;
trace( $request, "$h find parent $parent") if ($parent);
trace( $request, "$h found parent $parent") if ($parent);
}
trace( $request, "\n\n\nBegin to find cec hostname");
@@ -1168,7 +1245,7 @@ sub parse_responses {
if(${$outhash{$h}}{type} eq TYPE_CEC) {
my $newhostname1 = $::OLD_DATA_CACHE{"cec*".${$outhash{$h}}{mtm}.'*'.${$outhash{$h}}{serial}};
if ($newhostname1) {
trace( $request, "$h find hostname $newhostname1 with mtms");
trace( $request, "$h found hostname $newhostname1 with mtms");
${$outhash{$h}}{hostname} = $newhostname1;
push @matchnode, $h;
}
@@ -1177,7 +1254,7 @@ sub parse_responses {
my $newhostname2 = $::OLD_DATA_CACHE{"cec*".$tp.'*'.${$outhash{$h}}{cid}};
if ($newhostname2) {
${$outhash{$h}}{hostname} = $newhostname2;
trace( $request, "$h find hostname $newhostname2 with parent and id");
trace( $request, "$h found hostname $newhostname2 with parent and id");
push @matchnode, $h;
}
}
@@ -1185,16 +1262,17 @@ sub parse_responses {
trace( $request, "\n\n\nBegin to find fsp/bpa's hostname and parent");
foreach my $h ( keys %outhash ) {
# Added a skip if processing Flex blades
if(${$outhash{$h}}{type} eq TYPE_FSP or ${$outhash{$h}}{type} eq TYPE_BPA) {
$newhostname = $::OLD_DATA_CACHE{${$outhash{$h}}{type}."*".${$outhash{$h}}{mtm}.'*'.${$outhash{$h}}{serial}.'*'.${$outhash{$h}}{side}};
if ($newhostname){
${$outhash{$h}}{hostname} = $newhostname ;
trace( $request, "$h find hostname $newhostname");
trace( $request, "$h found hostname $newhostname");
push @matchnode, $h;
}
my $ptmp = ${$outhash{$h}}{parent};
${$outhash{$h}}{parent} = ${$outhash{$ptmp}}{hostname};
trace( $request, "$h find parent ${$outhash{$ptmp}}{hostname}");
${$outhash{$h}}{parent} = ${$outhash{$ptmp}}{hostname} unless((${$outhash{$h}}{type} eq TYPE_FSP) && ${$outhash{$h}}{mtm} =~ /^7895|1457|7954/ );
trace( $request, "$h found parent ${$outhash{$ptmp}}{hostname}");
#check if fsp/bpa's ip is valid
my $vip = check_ip(${$outhash{$h}}{ip});
unless ( $vip ) { #which means the ip is a valid one
@@ -1210,10 +1288,11 @@ sub parse_responses {
${$outhash{$child}}{fid} = ${$outhash{$h}}{fid};
${$outhash{$child}}{cid} = ${$outhash{$h}}{cid};
trace( $request, "child is $child, fid is ${$outhash{$child}}{fid}, cid is ${$outhash{$child}}{cid}");
}
}
}
} # end - process fsp and bpa
} # end process responses loop
##########################################################
# If there is -n flag, skip the matched nodes
##########################################################
@@ -1250,7 +1329,9 @@ sub parse_responses {
}
send_msg ( $request, 0, "These nodes defined in database but can't be discovered: $notdisnode \n");
}
foreach my $no(keys %outhash) {
delete $outhash{$no} unless ( ${$outhash{$no}}{hostname} );
}
return \%outhash;
}
##########################################################################
@@ -1639,7 +1720,7 @@ sub process_request {
$min = "more than 2";
}
#my $start1 = Time::HiRes::gettimeofday();
send_msg( \%request, 0, "$sendcount requests with $rspc responses. Now processing responses. This will take $min minutes...");
send_msg( \%request, 0, "$sendcount requests with $rspc responses. Now processing responses. This will take $min minutes...") unless ($globalopt{x} or $globalopt{z});
format_output( \%request, $searchmacsref);
#my $elapsed1 = Time::HiRes::gettimeofday() - $start1;
#send_msg( \%request, 0, "$num nodes takes $elapsed1");
@@ -257,6 +257,13 @@ sub process_request {
# the directory/file in litefile table must be the absolute path ("/***")
foreach my $entry (@$listNew) {
my @tmp = split (/\s+/, $entry);
# check the validity of the option
if ($tmp[1] !~ /^(tmpfs|persistent|localdisk|rw|ro|con|link|tmpfs,rw|link,ro|link,persistent|link,con)$/) {
$callback->({error=>[qq{ $tmp[2] has invalid option. The valid options: tmpfs persistent localdisk rw ro con link tmpfs,rw link,ro link,persistent link,con}], errorcode=>[1]});
return;
}
unless ($tmp[2] =~ m{^/}) {
$callback->({error=>[qq{ $tmp[2] is not one absolute path. }], errorcode=>[1]});
return;
+1 -1
View File
@@ -1146,7 +1146,7 @@ ions.\n";
if ($::RUNCMD_RC != 0)
{
my $rsp;
$rsp->{data}->[0] = "$::msgstr Could not create a NIM definition for \'$group\'.\n";
$rsp->{data}->[0] = "$::msgstr Error running command \'$cmd\'.\n";
if ($::verbose)
{
$rsp->{data}->[1] = "$output";
+14 -3
View File
@@ -214,9 +214,20 @@ sub preprocess_request
# if it is not being service by the MN
if (!grep(/$snkey/, @MNnodeipaddr))
{
# if it is a good SN, one ready to service the nodes
if (grep(/$snkey/, @::good_SN))
#if it is a good SN, one ready to service the nodes
# split if a pool
# if one in the pool is good, send the command to the
# daemon
my @sn_list = split ',', $snkey;
my $goodsn=0;
foreach my $sn (@sn_list) {
if (grep(/$sn/, @::good_SN)) {
$goodsn=1;
last;
}
}
# found a good service node
if ($goodsn == 1)
{
my $noderequests =
&process_nodes($req, $sn, $snkey,$synfiledir);
+6 -9
View File
@@ -3670,13 +3670,13 @@ sub nodeSet {
$userId =~ tr/a-z/A-Z/;
# Get install directory and domain from site table
my @entries = xCAT::TableUtils->get_site_attribute("installdir");
my @entries = xCAT::Utils->get_site_attribute("installdir");
my $installDir = $entries[0];
@entries = xCAT::TableUtils->get_site_attribute("domain");
@entries = xCAT::Utils->get_site_attribute("domain");
my $domain = $entries[0];
@entries = xCAT::TableUtils->get_site_attribute("master");
@entries = xCAT::Utils->get_site_attribute("master");
my $master = $entries[0];
@entries = xCAT::TableUtils->get_site_attribute("xcatdport");
@entries = xCAT::Utils->get_site_attribute("xcatdport");
my $xcatdPort = $entries[0];
# Get node OS, arch, and profile from 'nodetype' table
@@ -4870,7 +4870,7 @@ sub updateNode {
$userId =~ tr/a-z/A-Z/;
# Get install directory
my @entries = xCAT::TableUtils->get_site_attribute("installdir");
my @entries = xCAT::Utils->get_site_attribute("installdir");
my $installDir = $entries[0];
# Get host IP and hostname from /etc/hosts
@@ -5410,10 +5410,7 @@ sub changeHypervisor {
}
# resetsmapi
elsif ( $args->[0] eq "--resetsmapi" ) {
# This is no longer supported in chvm. Using chhypervisor instead.
changeHypervisor( $callback, $node, $args );
elsif ( $args->[0] eq "--resetsmapi" ) {
# Assuming zVM 6.1 or older
# Force each worker machine off
my @workers = ('VSMWORK1', 'VSMWORK2', 'VSMWORK3', 'VSMREQIN', 'VSMREQIU');
+2 -12
View File
@@ -1010,16 +1010,6 @@ sub plugin_command {
unless (@nodes) {
$req->{emptynoderange} = [1];
}
if(@nodes == 0) {
my $rsp = {errorcode=>1,error=>"NO node or noderange specified"};
$rsp->{serverdone} = {};
if ($sock) {
print $sock XMLout($rsp,RootName=>'xcatresponse' ,NoAttr=>1);
}
return ($rsp);
}
}
if (@nodes) { $req->{node} = \@nodes; }
@@ -1221,8 +1211,8 @@ sub plugin_command {
if ($sock) { close $pfd; }
unless ($handler_hash{$_} == 1) {
#ok, if nodes have numbers, this sorts them numerically... roughly..
#if node doesn't, then it spews a message, need to fix
my @nodes = sort {($a =~ /(\d+)/)[0] <=> ($b =~ /(\d+)/)[0] || $a cmp $b } (keys %{$handler_hash{$_}});
#if node doesn't, then it sorts out alphabetically.
my @nodes = sort {($a =~ /(\d+)/ ? $1 : -1)[0] <=> ($b =~ /(\d+)/ ? $1 : -1)[0] || $a cmp $b } (keys %{$handler_hash{$_}});
$req->{node}=\@nodes;
}
no strict "refs";
+2 -2
View File
@@ -217,7 +217,7 @@ sub snap_it {
@Commands_array = (
"uname -a","ifconfig -a","netstat -in","netstat -rn","env",
"reventlog -a","lsmod","/sbin/lspci","lssrc -a","rpm -qa",
"ls $installdir",
"ls $installdir","/bin/crontab -l",
"find /tftpboot -size -32k","ls -lR $xcatroot",
"arp -a","ps -edlf","ps -aux","ulimit -a","df -k","oslevel",
"netstat -A","errpt -a","/usr/sbin/instfix -i",
@@ -227,7 +227,7 @@ sub snap_it {
@Commands_array = (
"uname -a","ifconfig -a","netstat -in","netstat -rn","env",
"reventlog -a","lsmod","/sbin/lspci","lssrc -a","rpm -qa",
"ls $installdir",
"ls $installdir","/usr/bin/crontab -l",
"find /tftpboot -size -32k","ls -lR $xcatroot",
"arp -a","ps -edlf","ps -aux","ulimit -a","df -k",
"cat /etc/issue","lsxcatd -a");
@@ -5,3 +5,4 @@ tcl
tk
tcsh
libgcc.ppc
gcc-gfortran
@@ -5,3 +5,4 @@ perl
tcl
tk
tcsh
gcc-gfortran
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/sh
#
#
# Sample script to customize options for Mellonax OFED IB support
@@ -42,9 +42,9 @@ if [ $OS != "AIX" ]; then
#download_dir=`echo $OFED_DIR | cut -d '/' -f3-`
#wget -l inf -N -r --waitretry=10 --random-wait --retry-connrefused -t 10 -T 60 -nH --cut-dirs=5 ftp://$SITEMASTER/$download_dir/ 2> /tmp/wget.log
download_dir=$OFED_DIR
wget -l inf -N -r --waitretry=10 --random-wait --retry-connrefused -t 10 -T 60 -nH --cut-dirs=6 --reject "index.html*" --no-parent http://$SITEMASTER$download_dir/ 2> /tmp/wget.log
wget -l inf -N -r --waitretry=10 --random-wait --retry-connrefused -t 10 -T 60 -nH --cut-dirs=6 --reject "index.html*" --no-parent http://$SITEMASTER$download_dir/.mlnx 2>> /tmp/wget.log
wget -l inf -N -r --waitretry=10 --random-wait --retry-connrefused -t 10 -T 60 -nH --cut-dirs=6 --reject "index.html*" --no-parent http://$SITEMASTER$download_dir/.supported_kernels 2>> /tmp/wget.log
wget -l inf -N -r --waitretry=10 --random-wait --retry-connrefused -t 10 -T 60 -nH --cut-dirs=6 --reject "index.html*" --no-parent http://$MASTER$download_dir/ 2> /tmp/wget.log
wget -l inf -N -r --waitretry=10 --random-wait --retry-connrefused -t 10 -T 60 -nH --cut-dirs=6 --reject "index.html*" --no-parent http://$MASTER$download_dir/.mlnx 2>> /tmp/wget.log
wget -l inf -N -r --waitretry=10 --random-wait --retry-connrefused -t 10 -T 60 -nH --cut-dirs=6 --reject "index.html*" --no-parent http://$MASTER$download_dir/.supported_kernels 2>> /tmp/wget.log
#rpm -Uvh --force libibverbs-devel*.rpm
perl -x mlnxofedinstall --without-32bit --force
rm -Rf /tmp/ofed
@@ -88,6 +88,7 @@ else
while [ $num -lt $loop_number ]
do
`rmdev -d -l ib$num >/dev/null 2>&1`
`rmdev -d -l iba$num >/dev/null 2>&1`
n=`expr $num % 2`
if [ $n == 1 ]
then
@@ -96,7 +97,9 @@ else
fi
num=`expr $num + 1`
done
`rmdev -dl icm >/dev/null 2>&1`
mkdev -c management -s infiniband -t icm
cfgmgr
loop_number=`lsdev -Cc adapter |grep iba |wc -l`
fi
@@ -116,8 +119,10 @@ do
if [ $NODE ]
then
hostname="$NODE-$nic"
shortname=$NODE
else
hostname="$HOST-$nic"
shortname=$HOST
fi
`ifconfig $nic up`
if [ $PLTFRM == "Linux" ]
@@ -172,24 +177,25 @@ GATEWAY=$gateway" > $dir/ifcfg-$nic
fi
elif [ $PLTFRM == "AIX" ]
then
lsdev -C | grep icm | grep Available
if [ $? -ne 0 ]
then
mkdev -c management -s infiniband -t icm
if [ $? -ne 0 ]
then
mkdev -l icm
if [ $? -ne 0 ]
then
exit $?
fi
fi
fi
#lsdev -C | grep icm | grep Available
#if [ $? -ne 0 ]
#then
# mkdev -c management -s infiniband -t icm
# if [ $? -ne 0 ]
# then
# mkdev -l icm
# if [ $? -ne 0 ]
# then
# exit $?
# fi
# fi
#fi
#Configure the IB interfaces. Customize the port num.
iba_num=$num
ib_adapter="iba$iba_num"
port=1
chdev -l $ib_adapter -a hostname=$shortname
mkiba -a $ip -i $nic -A $ib_adapter -p $port -P -1 -S up -m $netmask
fi
fi
@@ -85,11 +85,17 @@ else
num0=`expr $num \* 2`
num1=`expr $num0 + 1`
`rmdev -d -l ib$num0 >/dev/null 2>&1`
`rmdev -d -l iba$num0 >/dev/null 2>&1`
`rmdev -d -l ib$num1 >/dev/null 2>&1`
`rmdev -d -l iba$num1 >/dev/null 2>&1`
`rmdev -d -l ml$num >/dev/null 2>&1`
num=`expr $num + 1`
done
`rmdev -dl icm >/dev/null 2>&1`
mkdev -c management -s infiniband -t icm
cfgmgr
ib_number=`lsdev -Cc adapter |grep iba |wc -l`
loop_number=`expr $ib_number \* 2`
@@ -109,8 +115,10 @@ do
if [ $NODE ]
then
hostname="$NODE-$nic"
shortname=$NODE;
else
hostname="$HOST-$nic"
shortname=$HOST;
fi
`ifconfig $nic up`
if [ $PLTFRM == "Linux" ]
@@ -180,19 +188,19 @@ GATEWAY=$gateway" > $dir/ifcfg-$nic
fi
elif [ $PLTFRM == "AIX" ]
then
lsdev -C | grep icm | grep Available
if [ $? -ne 0 ]
then
mkdev -c management -s infiniband -t icm
if [ $? -ne 0 ]
then
mkdev -l icm
if [ $? -ne 0 ]
then
exit $?
fi
fi
fi
#lsdev -C | grep icm | grep Available
#if [ $? -ne 0 ]
#then
# mkdev -c management -s infiniband -t icm
# if [ $? -ne 0 ]
# then
# mkdev -l icm
# if [ $? -ne 0 ]
# then
# exit $?
# fi
# fi
#fi
#Configure the IB interfaces. Customize the port num.
@@ -204,6 +212,7 @@ GATEWAY=$gateway" > $dir/ifcfg-$nic
else
port=2
fi
chdev -l $ib_adapter -a hostname=$shortname
mkiba -a $ip -i $nic -A $ib_adapter -p $port -P -1 -S up -m $netmask
fi
fi
@@ -5,7 +5,6 @@
cmdline
lang en_US
langsupport en_US
network --bootproto dhcp
#
@@ -92,11 +91,6 @@ text
#
firewall --disabled
#
# mouse selection
#
#mouse genericps/2 --emulthree
mouse none
#
# Select a zone
@@ -151,7 +145,7 @@ reboot
#
#end of section
#
%packages --resolvedeps
%packages
#INCLUDE_DEFAULT_PKGLIST#
%pre
@@ -179,6 +173,6 @@ remove_qla
remove_lpfc
echo "All qla modules removed"
sleep 10
#INCLUDE:../scripts/pre.rh#
#INCLUDE:#ENV:XCATROOT#/share/xcat/install/scripts/pre.rh#
%post
#INCLUDE:../scripts/post.rh#
#INCLUDE:#ENV:XCATROOT#/share/xcat/install/scripts/post.rh#
@@ -86,7 +86,7 @@ run_ps () {
echo "\"\`date\` Running postscript: \$@\"" | tee -a \$logfile
#./\$@ 2>&1 1> /tmp/tmp4xcatlog
#cat /tmp/tmp4xcatlog | tee -a \$logfile
./\$@ 2>&1 | tee -a $logfile
./\$@ 2>&1 | tee -a \$logfile
else
echo "\"\`date\` Postscript \$1 does NOT exist.\"" | tee -a \$logfile
fi
@@ -125,11 +125,12 @@ chkconfig --add xcatpostinit1
TMP=`sed "/postbootscripts-start-here/,/postbootscripts-end-here/ d" /xcatpost/mypostscript`
echo "$TMP" > /xcatpost/mypostscript
/xcatpost/mypostscript
export NODE=#TABLE:nodelist:THISNODE:node#
export OSVER=#TABLE:nodetype:THISNODE:os#
export ARCH=#TABLE:nodetype:THISNODE:arch#
addsiteyum
/xcatpost/mypostscript
sed -i 's/^serial/#serial/' /boot/grub/grub.conf
sed -i 's/^terminal/#terminal/' /boot/grub/grub.conf
updateflag.awk $MASTER 3002
@@ -21,6 +21,17 @@ declare -a CLIST
declare -a PLIST
ME=`hostname -s`
MAX=30
TRIES=1
while [ x$ME = x ];do
TRIES=$[ $TRIES+1 ]
if [ $TRIES -eq $MAX ]; then
echo "Can NOT get the hostname of the node. System will fail to enable the persistent files.">/dev/console
break
fi
sleep 1
ME=`hostname -s`
done
PERSISTENT="${MNTDIR}/$SL/persistent/$ME"
@@ -539,3 +550,7 @@ ResolveLinks
#cp -r -a ${DEFAULT}/* /.snapshot/tmpfs/
# foo
# Copy the fake network interface configuration file to /etc/sysconfig/network to handle
# the issue of reboot nfs-based statelite
/bin/cp /tmp/ifcfg-* $MNTDIR/etc/sysconfig/network
@@ -21,6 +21,17 @@ declare -a CLIST
declare -a PLIST
ME=`hostname`
MAX=30
TRIES=1
while [ x$ME = x ];do
TRIES=$[ $TRIES+1 ]
if [ $TRIES -eq $MAX ]; then
echo "Can NOT get the hostname of the node. System will fail to enable the persistent files.">/dev/console
break
fi
sleep 1
ME=`hostname -s`
done
PERSISTENT="${MNTDIR}/$SL/persistent/$ME"
@@ -1469,6 +1469,8 @@ sub generic_post { #This function is meant to leave the image in a state approxi
print $cfgfile " FLOWFLAG=\"-h\"\n";
print $cfgfile " fi\n";
print $cfgfile " if [ -x /sbin/initctl ]; then\n"; # Upstart style
# The syntax of next line is not correct, that means it does NOthing. (rh6 and higher)
# And it should NOT work for rh6 and higher, otherwise it will cauase multiple agetty for ttySx
print $cfgfile " initctl emit --no-wait fedora.serial-console-available \$COTTY \$COSPEED\n";
print $cfgfile " else\n";
print $cfgfile " echo xco:2345:respawn:/sbin/agetty \$FLOWFLAG \$COTTY \$COSPEED xterm >> /etc/inittab\n";
+21 -1
View File
@@ -990,6 +990,11 @@ while ! ifconfig | grep inet; do
sleep 1
netstart \$IFACE
done
# Add a fake interface configuration file for the boot interface to skip the
# ifdown of the interface during the reboot/shutdown to skip the fs broken of
# nfs based file system
echo "STARTMODE=nfsroot" > /tmp/ifcfg-\$IFACE
ip addr add dev lo 127.0.0.1/8
ip link set lo up
cd /
@@ -1253,7 +1258,12 @@ EOMS
close($inifile);
open($inifile,">"."/tmp/xcatinitrd.$$/bin/netstart");
print $inifile "#!/bin/bash \n";
print $inifile "dhcpcd \${1}\n";
if ($osver_host == 10) {
print $inifile "dhcpcd \${1}\n";
} else { # for sles11 or higher
# -p is used to keep the network connection during the shutdown. Used for nfs-based statelite shutdown
print $inifile "dhcpcd \${1} -p\n";
}
#-- Bring other NICs up in /bin/netstart in initrd for NIC failover
foreach (split /,/,$othernics) {
@@ -1301,9 +1311,11 @@ END
if ($arch =~ /x86_64/) {
push @filestoadd,"lib64/libnss_dns.so.2";
push @filestoadd,"lib64/libnss_files.so.2";
}
else {
push @filestoadd,"lib/libnss_dns.so.2";
push @filestoadd,"lib/libnss_files.so.2";
}
# cross-platfrom support on power6&7 etc
@@ -1506,6 +1518,14 @@ sub generic_post { # This function is meant to leave the image in a state approx
print $cfgfile "# Short-Description: gettyset\n";
print $cfgfile "# Description:\n";
print $cfgfile "### END INIT INFO\n";
print $cfgfile "VERS=`grep VERSION /etc/SuSE-release`\n";
print $cfgfile "if [ -n \"\$VERS\" ]; then\n";
print $cfgfile " VERNUM=`echo \$VERS|awk -F= \'{print \$2}\'|sed -e \'s/ //g\'`\n";
print $cfgfile "fi\n";
print $cfgfile "if [ \"\$VERNUM\" -gt 10 ]; then\n";
print $cfgfile " exit\n";
print $cfgfile "fi\n";
print $cfgfile "\n";
print $cfgfile "for i in `cat /proc/cmdline`; do\n";
print $cfgfile ' KEY=`echo $i|cut -d= -f 1`' . "\n";
print $cfgfile " if [ \"\$KEY\" == \"console\" -a \"\$i\" != \"console=tty0\" ]; then\n";
+1 -1
View File
@@ -427,7 +427,7 @@ export SEP_INSTALL_PATH=/tmp
# UXSPI environment variable
export UXLITE_CLEAN_INVFILE=1
export UXSPI_CLEAN_INVFILE=1
export UXSPI_BINARY_PATH=`find /toolscenter/uxspi -name '*uxspi*.anyos*' | sort | tail -n 1`
export UXSPI_BINARY_PATH=`find /toolscenter/uxspi -name '*uxspi*.anyos*bin' | sort | tail -n 1`
export UXSPI_GUI_CMD="xterm -geometry 168x58+5+5 +sb -e ${UXSPI_BINARY_PATH}"
export UXSPI_TUI_CMD="${UXSPI_BINARY_PATH} update --tui --firmware -l ${UXSPI_BOOTABLE} --timeout=${UXSPI_TIMEOUT}"
+11 -2
View File
@@ -1,8 +1,8 @@
#!/bin/sh
cd `dirname $0`
if [ ! -d repos/$OSVER/$ARCH ]; then
logger -t xcat "addsiteyum: repos/$OSVER/$ARCH is not a directory"
exit;
logger -t xcat -p local4.err "addsiteyum: repos/$OSVER/$ARCH is not a directory"
exit -1;
fi
for i in repos/$OSVER/$ARCH/*
do
@@ -12,4 +12,13 @@ do
TARGFILE=`basename $i`
TARGFILE=`echo $TARGFILE|sed -e s/.tmpl$/.repo/`
sed -e s!#INSTSERVER#!$MASTER! $i > /etc/yum.repos.d/$TARGFILE
# disable the internet repos which are created by addsiteyum
if [ -r "/etc/yum.repos.d/CentOS-Base.repo" ]; then
TMP=`sed -e '/enabled/d' /etc/yum.repos.d/CentOS-Base.repo | sed -e '/^gpgkey/i enabled=0'`
echo "$TMP" > /etc/yum.repos.d/CentOS-Base.repo
fi
done
exit 0
+21 -5
View File
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/sh
# IBM(c) 2010 EPL license http://www.eclipse.org/legal/epl-v10.html
#-------------------------------------------------------------------------------
@@ -101,6 +101,21 @@ if [ -z "$OSPKGDIR" ]; then
fi
fi
default_pkgdir="$INSTALLDIR/$OSVER/$ARCH"
if [ $OSPKGDIR == $default_pkgdir ]; then
if ( pmatch "$OSVER" "rhels5*" ); then
if [ $ARCH == "x86_64" ]; then
OSPKGDIR="$OSPKGDIR/Server"
fi
fi
if ( pmatch "$OSVER" "sles*" ); then
OSPKGDIR="$OSPKGDIR/1"
elif ( pmatch "$OSVER" "SL5*" ); then
OSPKGDIR="$OSPKGDIR/SL"
fi
fi
if [ "$SDKDIR" != "" ]; then
if [ $mounted -eq 0 ]; then
SDKDIR="$NFSSERVER/$SDKDIR"
@@ -108,11 +123,12 @@ if [ "$SDKDIR" != "" ]; then
fi
if [ $mounted -eq 0 ]; then
OSPKGDIR_NO_PREFIX=${OSPKGDIR#$INSTALLDIR}
#OSPKGDIR_NO_PREFIX=${OSPKGDIR#$INSTALLDIR}
if [ "$OSPKGDIR" != "$OSPKGDIR_NO_PREFIX" ]; then
OSPKGDIR="$NFSSERVER/$OSPKGDIR_NO_PREFIX"
fi
#if [ "$OSPKGDIR" != "$OSPKGDIR_NO_PREFIX" ]; then
# OSPKGDIR="$NFSSERVER/$OSPKGDIR_NO_PREFIX"
#fi
OSPKGDIR="$NFSSERVER/$OSPKGDIR"
fi
logger -t xcat "NFSSERVER=$NFSSERVER"
+1 -1
View File
@@ -347,7 +347,7 @@ run_ps () {
echo \"\`date\` Running postscript: \$@\" | tee -a \$logfile
#./\$@ 2>&1 1> /tmp/tmp4xcatlog
#cat /tmp/tmp4xcatlog | tee -a \$logfile
./\$@ 2>&1 | tee -a $logfile
./\$@ 2>&1 | tee -a \$logfile
else
echo \"\`date\` Postscript \$1 does NOT exist.\" | tee -a \$logfile
fi
+16
View File
@@ -93,6 +93,17 @@ fi
%endif
%post
# create dir for the current pid and move the original ones from /tmp/xcat to /var/run/xcat
mkdir -p /var/run/xcat
if [ -r "/tmp/xcat/installservice.pid" ]; then
mv /tmp/xcat/installservice.pid /var/run/xcat/installservice.pid
fi
if [ -r "/tmp/xcat/udpservice.pid" ]; then
mv /tmp/xcat/udpservice.pid /var/run/xcat/udpservice.pid
fi
if [ -r "/tmp/xcat/mainservice.pid" ]; then
mv /tmp/xcat/mainservice.pid /var/run/xcat/mainservice.pid
fi
if [ "$1" = "1" ]; then #Only if installing for the first time..
@@ -128,6 +139,11 @@ fi
/etc/init.d/$apachedaemon reload
fi
echo "xCATsn is now installed"
%else
# start xcatd on AIX
XCATROOT=$RPM_INSTALL_PREFIX0 $RPM_INSTALL_PREFIX0/sbin/restartxcatd
echo "xCATsn is now installed"
%endif
fi