Compare commits

..

235 Commits

Author SHA1 Message Date
arif 547ad31bc8 Add configbridge script
* Allows to add linuxbridge
* Allows to add OVS bridges
* taken from xHRM script and modified
2015-02-17 04:00:39 +00:00
litingt 4530a2f3ec update confignics cases 2015-02-15 01:59:49 -08:00
litingt bdf1602f3c Merge branch 'master' of ssh://git.code.sf.net/p/xcat/xcat-core 2015-02-15 01:54:43 -08:00
Leo.C.Wu 366dcba7fe #4572, post scripts configfirewall for ubuntu is NOT implemented. 2015-02-15 00:26:34 -08:00
litingt cea4d11d0e add copy iso image in case 2015-02-15 00:23:25 -08:00
Leo.C.Wu e6bc9c0e35 #4572, post scripts configfirewall for ubuntu is NOT implemented. 2015-02-15 15:25:16 +08:00
litingt 47bd617b48 remove enter character which causes failure in some cases 2015-02-14 20:43:46 -08:00
litingt 99703c4975 update for case matching 2015-02-14 20:39:08 -08:00
ertaozh 9a5301f985 fix bug 4433: chvm CN add_physlots= returns "Can not get hypervisor information" 2015-02-14 22:21:53 -05:00
ertaozh 884b1fdac9 fix bug 4434 :mkvm vm --full could not add all the resource to vm 2015-02-14 22:07:40 -05:00
daniceexi 3550373879 changed the definition of installnic and primarynic in Schema.pm:noderes table 2015-02-13 03:44:40 -05:00
daniceexi eeec7c6d4f Continue the change for avoiding sslv3 2015-02-13 03:07:51 -05:00
baiyuan 76a9da1e87 defect 4571 /etc/network/interfaces overwriten after firstboot 2015-02-12 22:58:44 -05:00
daniceexi 8eb652f9b1 Ubuntu/genimage: support multiple local mirror in osimage.pkgdir. The first one will be used to create bootstraps. The procedure to create osimage is: 1. create bootstrap with local/remote mirror; 2. add all mirror in osimage.pkgdir to sourcelist; 3. do osimage update; 4. install kernel; 5 install otherpkgs. 2015-02-12 22:43:03 -05:00
daniceexi bf7645a4f5 Continue the fix to avoid sslv3 in xcatd. In this commit, all the calling to [openssl s_client] in xcat code which used to connect to xcatd will add arguments [-no_ssl3 -no_ssl2] to avoid the using of sslv2/3 2015-02-12 20:19:00 -05:00
daniceexi b2eb57d072 Add default value for attribute site.xcatsslversion=TLSv1 to avoid using sslv3 which might cause POODLE Attach 2015-02-12 09:44:01 -05:00
litingt d41512f24c fix bug 4568, support user specified OS in xcattest configuration file 2015-02-12 00:40:55 -08:00
immarvin 662a62c57a there should be only 1 local package directory speicified in pkgdir attribute, the removed code slice seems unnecessary 2015-02-12 00:24:15 -08:00
litingt eb14f2bc5d remove openstack error message 2015-02-11 19:59:29 -08:00
Casandra Qiu 5adb477361 support confluent console for kvm 2015-02-11 10:28:19 -05:00
jjohnson2 6e4036dafb Merge branch 'master' of ssh://git.code.sf.net/p/xcat/xcat-core 2015-02-11 10:19:44 -05:00
immarvin 9598c45746 add support for online mirrors in pkgdir during provision 2015-02-11 03:12:38 -08:00
immarvin 3faba40ece uncomment the updates/security/src entries and correct some entries in source.list 2015-02-11 01:31:11 -08:00
daniceexi 35e6a500a8 sles.pm, more code change for installnic/primarynic code refine 2015-02-11 02:52:03 -05:00
ertaozh 860600e782 fix bug 4556: There are some failed message during Ubuntu ppc64le stateless provision 2015-02-11 02:36:36 -05:00
daniceexi a2d89b5d69 Continue the change to refine installnic and primarynic code 2015-02-11 02:31:54 -05:00
jjohnson2 fd4b6db4c7 Remove dead reference to a password
The line in question is dead code, and therefore has no effect
(it either dies or gets overwritten short time later).  Removing
it makes the code cleaner and counters the tendency for someone
to think we might be using a hard coded password in this file.
2015-02-10 14:42:32 -05:00
immarvin 423f007a7f refine the code to use installnic and primarynic to generate network boot kernel parameters. All the logic to use installnic/primarynic have been put in NetworkUtils->gen_net_boot_params 2015-02-10 02:41:35 -08:00
ertaozh d90a770ef2 To use the refined code about installnic and primarynic for ubuntu 2015-02-10 04:01:54 -05:00
daniceexi e3ad7b1017 Ubuntu/genimage: support to use local mirror in pkgdir with http format 2015-02-10 03:43:58 -05:00
GONG Jie 82be975146 Add pkglist, exlist, postinstall files for RHEL 7.1 support on ppc64le 2015-02-10 15:15:34 +08:00
litingt 465c25d22b add rh7 support 2015-02-09 19:56:16 -08:00
daniceexi 18dfb991c0 refine the code to use installnic and primarynic to generate network boot kernel parameters. All the logic to use installnic/primarynic have been put in NetworkUtils->gen_net_boot_params 2015-02-09 07:02:19 -05:00
litingt 1efc379a5f update case 2015-02-09 01:59:16 -08:00
Junxiaw 3b63df478e modify xCATreg 2015-02-08 07:28:47 -08:00
linggao edbe36c98d Make nics.nicextraparams work for any user defined settings, fixed defect 4541 and 4542 2015-02-06 16:08:31 -05:00
jjohnson2 d9d0ac7835 Merge branch 'master' of ssh://git.code.sf.net/p/xcat/xcat-core 2015-02-06 14:22:18 -05:00
jjohnson2 e15c2a7595 Fix RHEL7/CentOS7 netboot with BOOTIF
xcatroot ramroot setup did not correctly change BOOTIF to
match expectations.  Remove 01- and replace - with : to match
ip output
2015-02-06 14:22:12 -05:00
Victor Hu 2bc3c5f031 Seems like mklocalrepo never worked for Zypper because the
/etc/yum.repos.d was hard coded.  Enhanced to work with
SLES distributions
2015-02-06 10:55:14 -05:00
daniceexi 54bb58fa17 code drop for ubuntu diskless genimage to use local mirror 2015-02-06 08:53:21 -05:00
ligc dc4138c13c fix for bug 4562: a shell syntax problem 2015-02-06 16:26:19 +08:00
Junxiaw 31f473c09c modify bundlelist 2015-02-05 21:09:08 -08:00
Junxiaw cc515c0aea modify bundlelist delete #chdef_t_o_attr 2015-02-05 19:09:21 -08:00
Junxiaw c0be673a4d modify bundlelist delete #chdef_t_o_attr 2015-02-05 18:51:45 -08:00
Victor Hu 15e68b1555 No man page for xCAT-confluent, comment out call to xpod2man 2015-02-05 16:26:47 -05:00
Victor Hu f8cb5bbe66 Add xCAT-confluent package to Ubuntu and Debian build scripts 2015-02-05 16:20:33 -05:00
Victor Hu 6da3d8ee0e getslnodes.py was using argparse, which is not included on centos6.5
and not available in python 2.6... switched to using docopt for
command line interface argument parsing.  This python library is
pulled in by the SoftLayer python bindings so it's not an extra step.
2015-02-05 15:57:37 -05:00
Victor Hu dccae166ad Added some changes to build xCAT-confluent 2015-02-05 15:00:59 -05:00
jjohnson2 5d963f0fee Recognize more variants of Windows 2012
Windows 2012 R2 and updates can take a number of forms, be more forgiving.
2015-02-05 13:38:00 -05:00
Casandra Qiu ef1556e494 Fix the misuse of == to compare strings in perl 2015-02-05 12:04:42 -05:00
Victor Hu 3369dfb94f Added a print out to help the user configure /etc/fstab for
automount of the consistent file storage on reboot
2015-02-05 11:05:01 -05:00
Victor Hu d324f22ed6 Renamed utility softlayer_nas.py to softlayer_storage.py.
Extended the utility to support mounting of --type=nas|consistent
The consistent performance file storage is the high available
storage type on SoftLayer.  One we supported multiple types
the "nas" in the utility name no longer made sense.
2015-02-05 10:55:24 -05:00
Bruce Potter d2e659ede3 Merge branch 'master' of ssh://git.code.sf.net/p/xcat/xcat-core
merge of addition of getslnodes.py
2015-02-05 10:09:38 -05:00
Bruce Potter 77c193fe90 rewrote getslnodes in python 2015-02-05 10:07:14 -05:00
Junxiaw 76a14a0713 modify bundlelist 2015-02-05 06:45:53 -08:00
Junxiaw 4cafcfe310 modify bundlelist 2015-02-05 03:09:50 -08:00
ertaozh 4dd21f1775 fix bug 4555: lsslp -s PBMC does not honor -n flag 2015-02-05 04:35:16 -05:00
immarvin 276abb3db3 add description of specifying multiple mirrors in the linuximage.pkgdir for ubuntu 2015-02-05 01:51:15 -08:00
Jia Zhao a578f264f1 Not run makedhcp during nodeimport 2015-02-05 13:55:30 +08:00
daniceexi d875a07bad Enable debug for otherpkgs to debug the issue that otherpkgs does not finish when install service node for sles11.3 2015-02-04 22:08:58 -05:00
Casandra Qiu 7f90f85103 Bug #4537, clean up sles12 genimage output 2015-02-04 14:22:45 -05:00
Victor Hu ad782ec517 Add files and directory framework to generate the xCAT-confluent RPM
Cleaned up some of the comments in the beginning of buildcore.sh
using spaces instead of tabs and added the build for xCAT-confluent.

The xCAT-confluent rpm is intended to be used for xCAT2.X releases to
support confluent.  This rpm has a requirement on confluent_server package.
For 2.9.1, xCAT-confluent is optional.  For 2.10, the plan is to default
the console service to confluent.
2015-02-04 14:00:40 -05:00
mellor 874f77afed defect 4082 - change previous fix to disable warnings when calling setlogsock to work with older versions of perl too 2015-02-04 08:00:03 -05:00
chudegao 09a0e5fe1f Merge branch 'master' of ssh://git.code.sf.net/p/xcat/xcat-core 2015-02-04 10:16:05 +08:00
chudegao 530e9785ae fix 4545,restart xcatd hang due to perl syntax error in low perl version 5.10.x 2015-02-04 10:15:44 +08:00
daniceexi 7e550ebeaf pscp, fixed a code change error 2015-02-03 21:11:26 -05:00
litingt 751f918bdd update case 2015-02-02 20:05:08 -08:00
litingt 4253312315 update case 2015-02-02 19:53:16 -08:00
litingt a4ca553751 update case 2015-02-02 19:43:24 -08:00
litingt bb001497b0 update case 2015-02-02 19:40:49 -08:00
litingt d3b6905d0d update case 2015-02-02 19:32:56 -08:00
litingt e171490770 update cases 2015-02-02 19:29:22 -08:00
litingt 80cb8aecf4 update cases 2015-02-02 19:18:16 -08:00
immarvin e941049b9b add support for online mirrors during provision 2015-02-02 02:13:14 -08:00
litingt 8a4647387a update bundle list 2015-02-01 23:25:04 -08:00
litingt 6ca0cd115d update case 2015-02-01 23:16:36 -08:00
litingt e8019a65ec Merge branch 'master' of ssh://git.code.sf.net/p/xcat/xcat-core 2015-02-01 20:26:36 -08:00
litingt 8823e07198 update case 2015-02-01 20:23:48 -08:00
litingt 5c2a0d3122 update case for arch 2015-02-01 20:16:45 -08:00
jjohnson2 3cb83b2a19 Recognize confetty installed by pip
On some systems, pip install confetty will go to
/usr/local/bin.  Recognize and accept that.
2015-01-30 17:00:19 -05:00
jjohnson2 57f9ca6acf Allow wcons to accept geometry
If user passes in geometry, intelligently merge with
tiling geometry rather than confusingly attempt to
pass it through.
2015-01-30 16:58:49 -05:00
Victor Hu 2ea900b745 Added files to xCAT-SoftLayer RPM
Create a python library for xcat as a starting point for transition
to Python based in xCAT3.  There are also plans to switch over to
using the SoftLayer Python API (over Perl)

xCAT-SoftLayer.spec file will ship lib/python/xcat directory.  A new
bin file 'softlayer_nas.py" is created to help assist users with
mounting and unmount the SoftLayer NAS shared filesystem

DevOps Task #10959 unser xCAT_SoftLayer project
2015-01-30 16:00:00 -05:00
jjohnson2 a5bc39556c Fix confetty race condition induced by wcons
wcons was leaving a common control socket defined for all invocations
of confetty.  Fix this by not setting a socket for any but the first.
The channel is currently only used for wcons initial tiling, so
it should only be bothered with for that anyway.
2015-01-30 14:26:15 -05:00
litingt 7647a67a71 add xdsh cases to daily regression 2015-01-30 01:33:49 -08:00
litingt b6a3d0283d add xdsh cases to daily regression 2015-01-30 01:32:03 -08:00
litingt 53aaea1dbf add xdsh cases to daily regression 2015-01-30 01:31:04 -08:00
litingt 922bcb6303 add xdsh cases to daily regression 2015-01-30 01:30:03 -08:00
litingt f9ba641f5c add xdsh cases to daily regression 2015-01-30 01:29:05 -08:00
litingt 1ef6d35f40 add confignics cases to daily regression 2015-01-30 01:26:31 -08:00
litingt 98cb0c6550 add confignics cases to daily regression 2015-01-30 01:18:25 -08:00
linggao 2d4b8abcaa Merge branch 'master' of ssh://git.code.sf.net/p/xcat/xcat-core 2015-01-29 16:44:13 -05:00
linggao 1562ece18a More on building xCAT-vlan on ubuntu 2015-01-29 16:43:57 -05:00
Victor Hu 5cd9060421 The mklocalrepo.sh file is automatically created for xcat-core
and xcat-dep.  For xcat-dep on linux (non ubuntu), mklocalrepo.sh
should be executed in the <os>/<arch> subdirectory. If xCAT*.repo
file is not found in the executing directory, print out
a message to tell the user instead of creating a blank file in
/etc/yum.repos.d which will not work anyway.
2015-01-29 11:27:36 -05:00
daniceexi d3b729dadc energy.pm - changed the xml output format of renergy command which using energy.pm (p8 support) 2015-01-29 04:00:13 -05:00
litingt a69f063635 add kit cases to daily regression 2015-01-28 23:01:01 -08:00
chudegao dbc15d337b Refactor netboot attribute for adding nodes in PCM way 2015-01-29 11:31:34 +08:00
immarvin 1d6ba3646e add support for grub2-tftp and grub2-http as the netboot method 2015-01-28 01:15:23 -08:00
Jia Zhao 9c45c6ee64 Addding netboot image check for ubuntu nodeimport 2015-01-28 09:40:22 +08:00
linggao b70205c74e added vlan build for Ubuntu 2015-01-27 15:02:14 -05:00
linggao 8f50e34e6a adds xCAT-vlan nto build process 2015-01-27 14:11:48 -05:00
linggao 220374b22f add files for xCAT-vlan 2015-01-27 12:09:37 -05:00
immarvin b877e034fb #4538 [DEV] incorrect /etc/init/hvc0.conf on ubuntu 14.04.1-ppc64le kvm node after provisioning 2015-01-27 00:26:27 -08:00
Victor Hu e4486ca231 Improve the error message for the missing netboot/initrd.gz
on Ubuntu Linux.  This needs to be obtained from the Ubuntu
download site and copied over into the netboot directory.
2015-01-26 11:45:19 -05:00
ertaozh decd51de2d fix defect 4535: xcat can not get the right disk name for powerkvm VM 2015-01-26 04:31:29 -05:00
Junxiaw 6ba12f6085 modify bundle 2015-01-25 06:42:14 -08:00
ertaozh 26d4494c92 fix bug 4533 PMR: kvm vm can't be powered on when vmstoragemodel=virtio 2015-01-23 03:28:46 -05:00
linggao 7ebafe4ade minor fix in ospkgs 2015-01-22 16:03:42 -05:00
linggao a887fadd83 Supports multiple SDK cd's for sles in ospkgs and otherpkgs 2015-01-22 15:32:18 -05:00
linggao 2bd7845673 Fix sles sdk support 2015-01-22 12:23:34 -05:00
chudegao 6a703f9ea7 fix 4513 enable root logon permission in remoteshell,4522 support remove os pkgs in ubuntu pkg list 2015-01-22 16:32:03 +08:00
chudegao ebee9deebe Merge branch 'master' of ssh://git.code.sf.net/p/xcat/xcat-core 2015-01-22 09:55:12 +08:00
linggao 788f0a4a97 Added support for mutiple sdk CDs for sles diskless 2015-01-21 18:11:56 -05:00
mellor b34537ec2e defect 4529: send msg to install monitor process to reload perl modules when rescanplugins called 2015-01-21 16:08:34 -05:00
immarvin 5684af2cef fix defect #4526 [FVT] Bash script /xcatpost/otherpkgs stuck at apt-get forever while installing ubuntu service node, eliminate the prompts while installing xcat packages 2015-01-20 23:29:21 -08:00
Victor Hu 5549d2e033 Certain system services are now started with the SLES12 operating system, to keep backwards compatiability, check if the service is in etc/init.d in the rootimg and only run inssrv on those.
Smarter code added for loading kernel modules
2015-01-20 16:38:51 -05:00
ertaozh 2436fee9c8 fix bug 4528: Three identical otherpkglist files in /etc/apt/source.list.d on service node installed via xCAT 2015-01-20 03:34:10 -05:00
ligc 1b4173456b Merge branch 'master' of ssh://git.code.sf.net/p/xcat/xcat-core 2015-01-20 14:19:43 +08:00
ligc 93e00147f8 fix for bug 4515: start isc-dhcp-server when starting xcatd on Ubuntu MN 2015-01-20 14:19:08 +08:00
Jia Zhao 3b86d90a7c merge from 2.9 about supporting powerkvm in nodeimport 2015-01-20 14:15:07 +08:00
Casandra Qiu b040807148 fix hostname issue for diskless support 2015-01-19 16:48:40 -05:00
qyin 421a2750f9 fix copycds: on debian/ubuntu doesn't support -o option 2015-01-19 15:26:49 +08:00
chudegao 44482e2510 fix 4520,stateless hit grub for ubuntu 2015-01-19 14:28:17 +08:00
ligc a7ee19d740 fix for bug 4448: check rsyslogd existence before running rsyslogd 2015-01-19 14:22:49 +08:00
Casandra Qiu 58e8a9e0a5 genimage changes to support sles12 diskless on x86_64 2015-01-16 23:35:18 -05:00
Victor Hu ee61b112a2 [Task 6675] genimage requires dracut diretories for sles12 2015-01-16 15:41:58 -05:00
ertaozh 9195cf7faf For bug 4524: Only one local directory is supported in otherpkgdir attribute of an osimage definition 2015-01-16 04:46:25 -05:00
Junxiaw 4f98ae5159 modify autotest testcase 2015-01-16 01:16:41 -08:00
Junxiaw 8ac7bb8160 modify autotest testcase 2015-01-16 01:13:20 -08:00
ertaozh dc3fb9d4c9 fix bug 4476: Get "no free leases" when MN and target Nodes are in different subnets 2015-01-15 04:38:20 -05:00
immarvin 36faf1885b fix defect #4523 [DEV]'rpower' complains missing 'Sys::Virt perl module' in ubuntu14.04.1 ppc64el hierarchy scenario 2015-01-15 01:04:37 -08:00
litingt dc20d6b610 genimage case 2015-01-14 23:56:48 -08:00
Junxiaw 038c490f34 modify autotest installation case 2015-01-14 22:32:56 -08:00
litingt cfba09c37b add apt-key add once more before xcat installation on ubuntu 2015-01-14 19:41:18 -08:00
Junxiaw 1274f18767 modify autotest command case 2015-01-14 01:34:10 -08:00
Junxiaw 1c35227c0e modify autotest installation case 2015-01-14 01:07:10 -08:00
ertaozh 7722f97afa fix bug 4491: Switch Ubuntu diskless dir /dev mount type to devtmpfs 2015-01-14 03:24:14 -05:00
litingt f7b5607abe add copycds test case for -p,-o,-i and -w 2015-01-13 19:12:21 -08:00
immarvin 7705db6a4f fix defect #4519 [DEV]too much duplicate /etc/fstab entries on service node 2015-01-13 02:56:33 -08:00
daniceexi 312dec35bf rpower manpage: remove the incorrect request to install acpid for softoff in diskless 2015-01-11 22:04:52 -05:00
daniceexi ee57f7f934 defect 4492: confignics: don't run customized script for installnic if not specify the -s 2015-01-11 21:42:47 -05:00
Victor Hu 43717c4b11 add files to support creation of default osimage templates for sles12 diskless compute (netboot) when running copycds 2015-01-09 14:49:26 -05:00
Victor Hu d426eb6fc2 added code to recognize disc3 of SLES Server and SDK images and not overwrite disc1 due to media.1 directory 2015-01-09 14:49:21 -05:00
Victor Hu 70a1efec75 fixed incorrect day of week for 11/20/2007, causing warning when building rpm 2015-01-09 13:50:39 -05:00
ligc 573aba58d6 fix for bug 4507: check the distribution name specified with copycds -n in debian.pm 2015-01-09 15:10:59 +08:00
Leo.C.Wu 0b2ca38509 1. fix error message when removing a package in ubuntu, 2. fix error message when update packages, 3. fix apt source not correct in ospkgs 2015-01-09 11:26:09 +08:00
Leo.C.Wu c2c9052396 fix bug: 4511: post script otherpkg throws incorrect message in ubuntu/debian 2015-01-09 11:25:12 +08:00
Leo.C.Wu b55d6bf3b7 fix bug: #4512 nodeset will throw error if osimage pkgdir contains multi-value in ubuntu 2015-01-09 11:25:12 +08:00
Victor Hu 09045aca5e convert dos based compute.sles11.s390x.pkglist to linux 2015-01-08 13:36:42 -05:00
daniceexi 2c09d13724 update the manpage for renergy command that don't set power saving for P8 server which is running in OPAL mode 2015-01-08 06:26:12 -05:00
ligc 1e83fdea72 rsyslog configuration on Ubuntu, the file ownership of /var/log/messages should be syslog:adm 2015-01-08 16:23:29 +08:00
immarvin f38cd3b07c Merge branch 'master' of ssh://git.code.sf.net/p/xcat/xcat-core 2015-01-08 00:47:24 -08:00
immarvin a482d160f7 fix defect [bugs:#4497] Ubuntu pre script is not executed when provision CN 2015-01-08 00:47:06 -08:00
daniceexi a73c068748 Change the gpg key to [xCAT Security Key] 2015-01-07 20:51:08 -05:00
daniceexi 4ea9e9d6fc Change the gpg key to [xCAT Security Key] 2015-01-07 01:31:46 -05:00
ertaozh af5301faab enhance for fix bug 4466: ubuntu 14.10 genimage for netboot results in an unbootable image 2015-01-07 00:05:54 -05:00
immarvin f6fec4ed6d add ubuntu service node otherpkglist 2015-01-06 20:03:31 -08:00
ertaozh 3578cdfc8d fix bug 4466: ubuntu 14.10 genimage for netboot results in an unbootable image 2015-01-06 05:43:08 -05:00
immarvin db0d13d518 add service node pkglist and template files for ubuntu 2015-01-06 02:16:27 -08:00
ertaozh 3fc42a55fb fix bug 4455: nodeset return error for ubuntu if no serialport attribute set, add warning information if no serialport attribute specified 2015-01-05 07:03:52 -05:00
ertaozh c7b16d52e1 fix bug 4455: nodeset return error for ubuntu if no serialport attribute set 2015-01-05 06:35:05 -05:00
huweihua 611b55d5f9 1. git pull will try 3 times. 2. xcat build and installation will have log 2015-01-05 04:38:02 -05:00
litingt 9c3671ed76 add xCAT commands for PCM, fix defect 4477 2015-01-04 23:37:09 -08:00
Jia Zhao b32dc297e7 fix lskmodules support ubuntu14.04 2015-01-04 16:32:37 +08:00
huweihua 1ed206cddf enhancement -a attribute 2015-01-04 03:13:45 -05:00
immarvin 4aad4a8312 fix defect [bugs:#4497] Ubuntu pre script is not executed when provision CN 2015-01-03 20:26:03 -08:00
huweihua 7300b1c598 delete status check during isntallation 2014-12-31 23:40:23 -05:00
daniceexi 5131f51509 Remove the capping related information from man page and usage 2014-12-29 03:00:32 -05:00
daniceexi ad68658c3c defect 4500: skip the PIPE signal when call xcatd->relay_fds() to receive messages from plugin processes 2014-12-29 02:47:43 -05:00
daniceexi 24fbf6eea0 defect 4496: Add feature to support the error message monitoring from installer pre script 2014-12-26 06:23:36 -05:00
daniceexi 175ac75c8e Add man page for P8 energy; some minor fixes in CIMUtils.pm and energy.pm 2014-12-26 05:58:04 -05:00
huweihua 630f2c2776 Merge branch 'master' of ssh://git.code.sf.net/p/xcat/xcat-core 2014-12-24 01:55:10 -05:00
ertaozh b8ab60014a [Energy management support for P8 with CIM] enhance of support to query power,fanspeed,cpuspeed,temp attributes 2014-12-24 01:55:57 -05:00
daniceexi 1c3496a1db defect 4492: to support comstomized script for install nic 2014-12-24 06:22:58 -05:00
huweihua b23048cd1e add support ubuntu part 2014-12-24 01:54:48 -05:00
huweihua d00c051680 fix bug of test case makeconservercf_null 2014-12-24 01:43:29 -05:00
huweihua e104d8381a add arch to case nodestat_noderange 2014-12-24 01:41:13 -05:00
daniceexi 7f23e82638 add the code to get ip of hcp from hostname 2014-12-24 02:54:47 -05:00
daniceexi 32bddb1087 add the support for syssbpower sysIPLtime 2014-12-23 11:02:40 -05:00
daniceexi e21cad3891 Merge branch 'master' of ssh://daniceexi@git.code.sf.net/p/xcat/xcat-core 2014-12-23 10:13:02 -05:00
daniceexi 378c162578 check stanby fsp ip 2014-12-23 10:12:54 -05:00
daniceexi 06f4eca23b defect 4490: In ddns.pm, to udpate all the NS server in the zone file 2014-12-23 09:03:49 -05:00
daniceexi 77d46e97cc defect 3969: support return multiple ips for networkUtils->my_ip_facing() 2014-12-23 06:59:00 -05:00
ertaozh 673372434d [Energy management support for P8 with CIM] support to query power,fanspeed,cpuspeed,temp attributes 2014-12-23 05:34:53 -05:00
ligc 5ff9396c01 fix for bug 4334: require perl-Sys-Virt explicitly 2014-12-23 13:40:04 +08:00
daniceexi 5ebd7c1f25 add the require of perl(LWP::Protocol::https) which will be used in CIMUtils.pm in xCAT-server/xCAT-server.spec 2014-12-23 04:50:41 -05:00
daniceexi 62b04f0d6c [Energy management support for P8 with CIM] support to display cim xml payload if specifying -V 2014-12-23 03:02:43 -05:00
daniceexi 06115c9cb8 more code change for P8 energy support 2014-12-23 02:42:16 -05:00
ligc 9597e0664d bug 4473: fix for locales setup for Ubuntu stateless nodes 2014-12-23 09:28:52 +08:00
daniceexi a9cc379b7f code checkin for P8 energy support with CIM 2014-12-22 08:25:43 -05:00
ligc 35bbcafc43 fix for bug 4489: shell syntax problem in otherpkgs 2014-12-22 16:19:27 +08:00
huweihua 569a4d80f6 remove odbcsetup script from SN's postscripts list 2014-12-21 22:27:35 -05:00
ertaozh 2f04a8a456 deal with "NAMEDINSTANCE" for renergy 2014-12-21 21:25:36 -05:00
Casandra Qiu cb267ebd9e bug#4488 Failed to run ospkgs for SLES12 2014-12-19 16:32:15 -05:00
Junxiaw 20ced0c162 modify autotest command bundle 2014-12-19 01:58:30 -08:00
Junxiaw 561da31533 modify bundle 2014-12-19 00:24:52 -08:00
root 3e88f028ff Merge branch 'master' of ssh://git.code.sf.net/p/xcat/xcat-core 2014-12-19 00:22:33 -08:00
Junxiaw 4cc51b28fd modify bundle 2014-12-19 00:20:58 -08:00
ligc edfc3dbfc2 fix the problem with file "Version" 2014-12-19 14:06:10 +08:00
Junxiaw 999a474a5b modify autotest installation case 2014-12-18 19:29:07 -08:00
Junxiaw 604fc160d5 modify autotest installation case 2014-12-18 19:28:23 -08:00
Junxiaw 7b79e00498 modify pping command 2014-12-18 18:45:41 -08:00
Junxiaw 47872d2a3c modify copycds command 2014-12-18 18:40:32 -08:00
Junxiaw ad7b908e60 modify makedns command 2014-12-18 18:39:08 -08:00
Junxiaw 503a31ad51 modify makedhcp command 2014-12-18 18:37:02 -08:00
Junxiaw 88f2fa9e6a modify bundle 2014-12-18 18:28:45 -08:00
Casandra Qiu 6d27741713 #4482 Otherpkgs postscripts didn't support SLES12 2014-12-18 10:45:33 -05:00
linggao 248e391ed7 added confluent console support for replaycons command. 2014-12-18 10:28:47 -05:00
immarvin 66feb6f8fc fix defect #4481 netmask being picked up from active MN instead of Networks table 2014-12-18 00:04:22 -08:00
ligc 7b445592d3 add pkglist and template for fedora21 ppc64le 2014-12-18 14:53:55 +08:00
daniceexi 04e9c80c9c More code drop 2014-12-17 12:42:08 -05:00
ligc d4c332557e fix for bug 4472, copycds problems with rhels7.1 ppc64le 2014-12-17 11:43:09 +08:00
baiyuan a1ae55521a fix 4479 [FVT]build xCAT-buildkit failed forpods/man1/buildkit.1.pod around line 217 2014-12-16 22:10:17 -05:00
daniceexi f5fb045e0c initial version of CIM Utils 2014-12-16 09:49:12 -05:00
huweihua 4b7ac9d9b8 do some enchancement 2014-12-16 00:29:02 -05:00
daniceexi f3ba9ab3eb fix the specific format in the doc of restapi which causes the getxcatdocs (pandoc) cannot generate doc for REST_API_Reference 2014-12-14 08:40:21 -05:00
daniceexi 8232e7301f defect 4468: (NodeRange.pm) fix the issue that table_object->{_use_cache} was not turned off in Noderange which will cause the Table.pm cannot get correct column for nodelist table 2014-12-14 05:24:08 -05:00
daniceexi 127313aa16 defect 4467: In Template.pm, fix the issue that added a emptry line at the head of the parition script which causes the partition script cannot find correct shell interpreter 2014-12-14 05:18:55 -05:00
huweihua 700c97c05b Do enhancement. scope:rhp,slesp,rhx,slesx 2014-12-12 05:42:02 -05:00
ligc 0e98588df8 bug 4469: add the check for ppc64le arch in pre.rh.rhel7 2014-12-11 16:32:38 +08:00
huweihua 4924d8a9c5 do some enhancement 2014-12-11 03:10:03 -05:00
litingt 65a9cfe9bf xCAT commands bundle file on ubuntu on x 2014-12-11 00:55:53 -08:00
litingt 443d8aef02 xCAT commands bundle file on sles on x 2014-12-11 00:55:34 -08:00
litingt fb8dd3cbeb xCAT commands bundle file on rhels on X 2014-12-11 00:55:06 -08:00
litingt 275374fb99 xCAT commands bundle file on ubuntu on P 2014-12-11 00:54:35 -08:00
litingt 7dc7a1e668 xCAT commands bundle file on sles on P 2014-12-11 00:54:13 -08:00
litingt 01ad8c0032 rhels commands bundle on P 2014-12-11 00:53:17 -08:00
litingt 418eec7c40 aix command bundle file 2014-12-11 00:51:33 -08:00
huweihua 317cf1a05f fix spelling mistake 2014-12-11 00:59:54 -05:00
huweihua c370b7e2ac make xcattest can recognize MAC addr in conf file 2014-12-11 00:57:31 -05:00
ligc 64cea6d8b1 fix for bug 4463: use service network restart to restart network, and wait longer for the network adapters initialization 2014-12-10 15:45:12 +08:00
linggao dc9806c023 add more checking for gateway in configib postscript 2014-12-09 09:57:31 -05:00
ligc db84e8ee89 fix for bug 4456, change the rcons shebang line to /bin/bash 2014-12-08 14:34:36 +08:00
ligc 04cec164fa fix for bug 4459: increase the timeout value in xcatinstallpost, 11 nics takes about 40 seconds, change the wait timeout to be 180 seconds 2014-12-08 10:27:19 +08:00
linggao 729907f7eb Allow specifying mtu and connected_mode settings in configeth and configib per request from defect 3567 2014-12-04 09:32:59 -05:00
litingt bb8b43eeac new development version is 2.10 2014-12-04 00:58:44 -08:00
190 changed files with 15408 additions and 2853 deletions
+1 -1
View File
@@ -1 +1 @@
2.9
2.10
+1 -1
View File
@@ -68,7 +68,7 @@ function makedeb {
}
# build all debian packages
packages="xCAT-client xCAT-nbroot xCAT-nbroot2 perl-xCAT xCAT-server xCAT-UI xCAT xCATsn xCAT-test xCAT-IBMhpc xCAT-rmc"
packages="xCAT-client xCAT-nbroot xCAT-nbroot2 perl-xCAT xCAT-server xCAT-UI xCAT xCATsn xCAT-test xCAT-IBMhpc xCAT-rmc xCAT-vlan xCAT-confluent"
for file in `echo $packages`
do
+1 -2
View File
@@ -194,8 +194,7 @@ then
if [ ! -d ../../$package_dir_name ];then
mkdir -p "../../$package_dir_name"
fi
#packages="xCAT-client xCAT-genesis-scripts perl-xCAT xCAT-server xCAT-UI xCAT xCATsn xCAT-test xCAT-OpenStack xCAT-OpenStack-baremetal xCAT-buildkit"
packages="xCAT-client xCAT-genesis-scripts perl-xCAT xCAT-server xCAT xCATsn xCAT-test xCAT-buildkit"
packages="xCAT-client xCAT-genesis-scripts perl-xCAT xCAT-server xCAT xCATsn xCAT-test xCAT-buildkit xCAT-vlan xCAT-confluent"
target_archs=(amd64 ppc64el)
for file in `echo $packages`
do
+43 -28
View File
@@ -12,37 +12,37 @@
# at https://sourceforge.net/account/ssh
# - On Linux: make sure createrepo is installed on the build machine
# - On AIX: Install openssl and openssh installp pkgs and run updtvpkg. Install from http://www.perzl.org/aix/ :
# apr, apr-util, bash, bzip2, db4, expat, gdbm, gettext, glib2, gmp, info, libidn, neon, openssl (won't
# conflict with the installp version - but i don't think you need this), pcre, perl-DBD-SQLite, perl-DBI,
# popt, python, readline, rsynce, sqlite, subversion, unixODBC, zlib. Install wget from http://www-03.ibm.com/systems/power/software/aix/linux/toolbox/alpha.html
# apr, apr-util, bash, bzip2, db4, expat, gdbm, gettext, glib2, gmp, info, libidn, neon, openssl (won't
# conflict with the installp version - but i don't think you need this), pcre, perl-DBD-SQLite, perl-DBI,
# popt, python, readline, rsynce, sqlite, subversion, unixODBC, zlib.
# Install wget from http://www-03.ibm.com/systems/power/software/aix/linux/toolbox/alpha.html
# - Run this script from the local svn repository you just created. It will create the other
# directories that are needed.
# Usage: buildcore.sh [attr=value attr=value ...]
# Before running buildcore.sh, you must change the local git repo to the branch you want built, using: git checkout <branch>
# PROMOTE=1 - if the attribute "PROMOTE" is specified, means an official dot release. This does not
# actually build xcat, just uploads the most recent snap build to https://sourceforge.net/projects/xcat/files/xcat/ .
# If not specified, a snap build is assumed, which uploads to https://sourceforge.net/projects/xcat/files/yum/
# or https://sourceforge.net/projects/xcat/files/aix/.
# PREGA=1 - use this option with PROMOTE=1 on a branch that already has a released dot release, but this build is
# a GA candidate build, not to be released yet. This will result in the tarball being uploaded to
# https://sourceforge.net/projects/xcat/files/yum/ or https://sourceforge.net/projects/xcat/files/aix/
# (but the tarball file name will be like a released tarball, not a snap build). When you are ready to
# release this build, use PROMOTE=1 without PREGA
# BUILDALL=1 - build all rpms, whether they changed or not. Should be used for snap builds that are in prep for a release.
# UP=0 or UP=1 - override the default upload behavior
# SVNUP=<filename> - control which rpms get built by specifying a coresvnup file
# GITUP=<filename> - control which rpms get built by specifying a coregitup file
# EMBED=<embedded-environment> - the environment for which a minimal version of xcat should be built, e.g. zvm or flex
# VERBOSE=1 - to see lots of verbose output
# Before running buildcore.sh, you must change the local git repo to the branch you want built, using: git checkout <branch>
# PROMOTE=1 - if the attribute "PROMOTE" is specified, means an official dot release. This does not actually build
# xcat, just uploads the most recent snap build to https://sourceforge.net/projects/xcat/files/xcat/ .
# If not specified, a snap build is assumed, which uploads to https://sourceforge.net/projects/xcat/files/yum/
# or https://sourceforge.net/projects/xcat/files/aix/.
# PREGA=1 - use this option with PROMOTE=1 on a branch that already has a released dot release, but this build is
# a GA candidate build, not to be released yet. This will result in the tarball being uploaded to
# https://sourceforge.net/projects/xcat/files/yum/ or https://sourceforge.net/projects/xcat/files/aix/
# (but the tarball file name will be like a released tarball, not a snap build). When you are ready to
# release this build, use PROMOTE=1 without PREGA
# BUILDALL=1 - build all rpms, whether they changed or not. Should be used for snap builds that are in prep for a release.
# UP=0 or UP=1 - override the default upload behavior
# SVNUP=<filename> - control which rpms get built by specifying a coresvnup file
# GITUP=<filename> - control which rpms get built by specifying a coregitup file
# EMBED=<embedded-environment> - the environment for which a minimal version of xcat should be built, e.g. zvm or flex
# VERBOSE=1 - to see lots of verbose output
# you can change this if you need to
UPLOADUSER=bp-sawyers
FRS=/home/frs/project/x/xc/xcat
# These are the rpms that should be built for each kind of xcat build
#ALLBUILD="perl-xCAT xCAT-client xCAT-server xCAT-IBMhpc xCAT-rmc xCAT-UI xCAT-test xCAT-buildkit xCAT xCATsn xCAT-genesis-scripts xCAT-OpenStack xCAT-SoftLayer xCAT-OpenStack-baremetal"
ALLBUILD="perl-xCAT xCAT-client xCAT-server xCAT-test xCAT-buildkit xCAT xCATsn xCAT-genesis-scripts xCAT-SoftLayer"
ALLBUILD="perl-xCAT xCAT-client xCAT-server xCAT-test xCAT-buildkit xCAT xCATsn xCAT-genesis-scripts xCAT-SoftLayer xCAT-vlan xCAT-confluent"
ZVMBUILD="perl-xCAT xCAT-server xCAT-UI"
ZVMLINK="xCAT-client xCAT xCATsn"
# xCAT and xCATsn have PCM specific configuration - conserver-xcat, syslinux-xcat
@@ -241,11 +241,13 @@ if [ "$OSNAME" = "AIX" ]; then
fi
# Build the rest of the noarch rpms
for rpmname in xCAT-client xCAT-server xCAT-IBMhpc xCAT-rmc xCAT-UI xCAT-test xCAT-buildkit xCAT-SoftLayer; do
for rpmname in xCAT-client xCAT-server xCAT-IBMhpc xCAT-rmc xCAT-UI xCAT-test xCAT-buildkit xCAT-SoftLayer xCAT-vlan xCAT-confluent; do
#if [ "$EMBED" = "zvm" -a "$rpmname" != "xCAT-server" -a "$rpmname" != "xCAT-UI" ]; then continue; fi # for zvm embedded env only need to build server and UI
if [[ " $EMBEDBUILD " != *\ $rpmname\ * ]]; then continue; fi
if [ "$OSNAME" = "AIX" -a "$rpmname" = "xCAT-buildkit" ]; then continue; fi # do not build xCAT-buildkit on aix
if [ "$OSNAME" = "AIX" -a "$rpmname" = "xCAT-SoftLayer" ]; then continue; fi # do not build xCAT-softlayer on aix
if [ "$OSNAME" = "AIX" -a "$rpmname" = "xCAT-buildkit" ]; then continue; fi # do not build xCAT-buildkit on aix
if [ "$OSNAME" = "AIX" -a "$rpmname" = "xCAT-SoftLayer" ]; then continue; fi # do not build xCAT-softlayer on aix
if [ "$OSNAME" = "AIX" -a "$rpmname" = "xCAT-vlan" ]; then continue; fi # do not build xCAT-vlan on aix
if [ "$OSNAME" = "AIX" -a "$rpmname" = "xCAT-confluent" ]; then continue; fi # do not build xCAT-confluent on aix
if $GREP $rpmname $GITUP || [ "$BUILDALL" == 1 ]; then
UPLOAD=1
maker $rpmname
@@ -279,7 +281,8 @@ if [ "$OSNAME" != "AIX" ]; then
fi
# Build the xCAT and xCATsn rpms for all platforms
for rpmname in xCAT xCATsn xCAT-OpenStack xCAT-OpenStack-baremetal; do
#for rpmname in xCAT xCATsn xCAT-OpenStack xCAT-OpenStack-baremetal; do
for rpmname in xCAT xCATsn; do
#if [ "$EMBED" = "zvm" ]; then break; fi
if [[ " $EMBEDBUILD " != *\ $rpmname\ * ]]; then continue; fi
if [ $SOMETHINGCHANGED == 1 -o "$BUILDALL" == 1 ]; then # used to be: if $GREP -E "^[UAD] +$rpmname/" $GITUP; then
@@ -359,7 +362,7 @@ if [ "$OSNAME" != "AIX" ]; then
echo '%_signature gpg' >> $MACROS
fi
if ! $GREP '%_gpg_name' $MACROS 2>/dev/null; then
echo '%_gpg_name Jarrod Johnson' >> $MACROS
echo '%_gpg_name xCAT Security Key' >> $MACROS
fi
echo "Signing RPMs..."
build-utils/rpmsign.exp `find $DESTDIR -type f -name '*.rpm'` | grep -v -E '(already contains identical signature|was already signed|rpm --quiet --resign|WARNING: standard input reopened)'
@@ -422,7 +425,18 @@ EOF
#!/bin/sh
cd `dirname $0`
REPOFILE=`basename xCAT-*.repo`
sed -e 's|baseurl=.*|baseurl=file://'"`pwd`"'|' $REPOFILE | sed -e 's|gpgkey=.*|gpgkey=file://'"`pwd`"'/repodata/repomd.xml.key|' > /etc/yum.repos.d/$REPOFILE
if [[ $REPOFILE == "xCAT-*.repo" ]]; then
echo "ERROR: For xcat-dep, please execute $0 in the correct <os>/<arch> subdirectory"
exit 1
fi
#
# default to RHEL yum, if doesn't exist try Zypper
#
DIRECTORY="/etc/yum.repos.d"
if [[ ! -d ${DIRECTORY} ]]; then
DIRECTORY="/etc/zypp/repos.d"
fi
sed -e 's|baseurl=.*|baseurl=file://'"`pwd`"'|' $REPOFILE | sed -e 's|gpgkey=.*|gpgkey=file://'"`pwd`"'/repodata/repomd.xml.key|' > ${DIRECTORY}/$REPOFILE
cd -
EOF2
chmod 775 mklocalrepo.sh
@@ -502,8 +516,9 @@ if [ "$OSNAME" != "AIX" -a "$REL" = "devel" -a "$PROMOTE" != 1 -a -z "$EMBED" ];
rpm2cpio ../$XCATCORE/perl-xCAT-*.$NOARCH.rpm | cpio -id '*.html'
rpm2cpio ../$XCATCORE/xCAT-test-*.$NOARCH.rpm | cpio -id '*.html'
rpm2cpio ../$XCATCORE/xCAT-buildkit-*.$NOARCH.rpm | cpio -id '*.html'
rpm2cpio ../$XCATCORE/xCAT-OpenStack-*.x86_64.rpm | cpio -id '*.html'
#rpm2cpio ../$XCATCORE/xCAT-OpenStack-*.x86_64.rpm | cpio -id '*.html'
rpm2cpio ../$XCATCORE/xCAT-SoftLayer-*.$NOARCH.rpm | cpio -id '*.html'
rpm2cpio ../$XCATCORE/xCAT-vlan-*.$NOARCH.rpm | cpio -id '*.html'
i=0
while [ $((i+=1)) -le 5 ] && ! rsync $verboseflag -r opt/xcat/share/doc/man1 opt/xcat/share/doc/man3 opt/xcat/share/doc/man5 opt/xcat/share/doc/man7 opt/xcat/share/doc/man8 $UPLOADUSER,xcat@web.sourceforge.net:htdocs/
do : ; done
+1 -1
View File
@@ -92,7 +92,7 @@ if [ "$OSNAME" != "AIX" ]; then
echo '%_signature gpg' >> $MACROS
fi
if ! $GREP -q '%_gpg_name' $MACROS 2>/dev/null; then
echo '%_gpg_name Jarrod Johnson' >> $MACROS
echo '%_gpg_name xCAT Security Key' >> $MACROS
fi
# Sign the rpms that are not already signed. The "standard input reopened" warnings are normal.
+4 -4
View File
@@ -63,7 +63,7 @@ echo "This is an Ubuntu system"
mkdir -p $CURDIR/build
for rpmname in xCAT-client xCAT-genesis-scripts perl-xCAT xCAT-server xCAT xCATsn xCAT-test; do
for rpmname in xCAT-client xCAT-genesis-scripts perl-xCAT xCAT-server xCAT xCATsn xCAT-test xCAT-vlan; do
rpmname_low=`echo $rpmname | tr '[A-Z]' '[a-z]'`
echo "============================================"
echo "$rpmname_low"
@@ -102,14 +102,14 @@ echo "This is an $OSNAME system"
# Build the rest of the noarch rpms
for rpmname in xCAT-client xCAT-server xCAT-IBMhpc xCAT-rmc xCAT-test xCAT-buildkit; do
for rpmname in xCAT-client xCAT-server xCAT-IBMhpc xCAT-rmc xCAT-test xCAT-buildkit xCAT-vlan; do
if [ "$OSNAME" = "AIX" -a "$rpmname" = "xCAT-buildkit" ]; then continue; fi
$CURDIR/makerpm $rpmname
done
#build xCAT-genesis-scripts if it is x86_64 platform
ARCH=$(uname -p)
if [ "$ARCH" = "x64_64" ]; then
if [ "$ARCH" = "x86_64" ]; then
$CURDIR/makerpm xCAT-genesis-scripts x86_64
else
$CURDIR/makerpm xCAT-genesis-scripts ppc64
@@ -141,7 +141,7 @@ echo "This is an $OSNAME system"
#begin to create repo for redhat platform
grep -i 'Red' /etc/issue;
grep -i 'Red' /etc/*release*;
if [ "$OSNAME" != "AIX" -a $? -eq 0 ]; then
cat >$CURDIR/build/xCAT-core.repo << EOF
[xcat-2-core]
+462
View File
@@ -0,0 +1,462 @@
#! /usr/bin/env perl
# IBM(c) 2014 EPL license http://www.eclipse.org/legal/epl-v10.html
# This package offers subroutines to access CIM server
package xCAT::CIMUtils;
use strict;
use warnings;
use HTTP::Headers;
use HTTP::Request;
use LWP::UserAgent;
use XML::LibXML;
use Data::Dumper;
=head1 HTTP_PARAMS
A hash which includes all the parameters for accessing HTTP server. The valid parameter:
ip: The IP address of the HTTP server
user: The user to access HTTP server.
password: The password for the user.
method: The http method. (GET, PUT, POST, DELETE). Default is GET
protocol: The protocol which will be used to access HTTP server. (http/https). Default is https
format: The format of payload. Default is xml
payload: The payload of http
Example:
my %http_params = ( ip => '192.168.1.1',
port => '5989',
user => 'HMC',
password => 'admin',
method => 'POST',
protocol => 'https');
=cut
=head1 enum_instance ()
Description:
Enumerate CIM instances.
Arguments:
http_params: A reference to HTTP_PARAMS
cim_params: The CIM parameters
classname - a mandatory param to specify the class that enumerate will target to.
Return:
1 - A hash reference. The valid key includes:
rc - The return code. 0 - success. > 0 - fail.
cim_rc - The return code from CIM server.
msg - Output message.
2 - Array of instances, each instance is a hash contains lots of properties.
3 - The name path of instance
=cut
sub enum_instance
{
my $http_params = shift;
unless (ref($http_params)) {
$http_params = shift;
}
my $cim_params = shift;
# This is a mandatory parameter
unless ($cim_params->{classname}) {
return ({rc => 1, msg => "Missed the classname"});
}
unless ($cim_params->{namespace}) {
$cim_params->{namespace} = "ibmsd";
}
# prepare the CIM payload
my $tmpnode;
# create a new doc
my $doc = XML::LibXML->createDocument('1.0','UTF-8');
# create and add the root element
my $root = $doc->createElement("CIM");
$root->setAttribute("CIMVERSION", "2.0");
$root->setAttribute("DTDVERSION", "2.0");
$doc->setDocumentElement($root);
# create and add the MESSAGE element
my $message = $doc->createElement("MESSAGE");
$message->setAttribute("ID", "1000");
$message->setAttribute("PROTOCOLVERSION", "1.0");
$root->addChild($message);
# add a SIMPLE REQUEST
my $simple_request = $doc->createElement("SIMPLEREQ");
$message->addChild($simple_request);
# add an IMETHOD CALL
my $imethod_call = $doc->createElement("IMETHODCALL");
$imethod_call->setAttribute("NAME", "EnumerateInstances");
$simple_request->addChild($imethod_call);
# add the local name space path
my $localnamespacepath = $doc->createElement("LOCALNAMESPACEPATH");
$tmpnode = $doc->createElement("NAMESPACE");
$tmpnode->setAttribute("NAME", "root");
$localnamespacepath->addChild($tmpnode);
$tmpnode = $doc->createElement("NAMESPACE");
$tmpnode->setAttribute("NAME", $cim_params->{namespace});
$localnamespacepath->addChild($tmpnode);
$imethod_call->addChild($localnamespacepath);
# add the target class name
my $param_classname = $doc->createElement("IPARAMVALUE");
$param_classname->setAttribute("NAME", "ClassName");
$imethod_call->addChild($param_classname);
my $classname = $doc->createElement("CLASSNAME");
$classname->setAttribute("NAME", $cim_params->{classname});
$param_classname->addChild($classname);
# add several common parameters
$imethod_call->appendWellBalancedChunk('<IPARAMVALUE NAME="DeepInheritance"><VALUE>TRUE</VALUE></IPARAMVALUE><IPARAMVALUE NAME="LocalOnly"><VALUE>FALSE</VALUE></IPARAMVALUE><IPARAMVALUE NAME="IncludeQualifiers"><VALUE>FALSE</VALUE></IPARAMVALUE><IPARAMVALUE NAME="IncludeClassOrigin"><VALUE>TRUE</VALUE></IPARAMVALUE>');
my $payload = $doc->toString();
# generate http request
my $ret = gen_http_request($http_params, $payload);
if ($ret->{rc}) {
return $ret;
}
# send request to http server
$ret = send_http_request($http_params, $ret->{request});
if ($ret->{rc}) {
return $ret;
}
# parse the http response
my $ret_value;
my $parser = XML::LibXML->new();
my $resp_doc = $parser->parse_string($ret->{payload});
# check the error message from CIM
my $error_node = $resp_doc->getElementsByTagName("ERROR");
if ($error_node) {
my $msg = $error_node->[0]->getAttribute("DESCRIPTION");
my $errorcode = $error_node->[0]->getAttribute("CODE");
return ({rc => 1, cim_rc => $errorcode, msg => $error_node->[0]->getAttribute("DESCRIPTION")." [cim return code: $errorcode]"});
}
# get the name path of the instance, which is used to set property
my @namepath = $resp_doc->getElementsByTagName("INSTANCENAME");
my $namepath_string;
if (@namepath) {
$namepath_string = $namepath[0]->toString();
}
# get all the instance elements
my @instances = $resp_doc->getElementsByTagName("VALUE.NAMEDINSTANCE");
foreach my $instance (@instances) {
# get all the property element for each instance
my @properties = $instance->getElementsByTagName("PROPERTY");
if (my @property_arrays = $instance->getElementsByTagName("PROPERTY.ARRAY")) {
push @properties, @property_arrays;
}
my $ins_value;
foreach my $property (@properties) {
# get name, vlaue and type for each property. (only the one which has value)
if (my $pname = $property->getAttribute("NAME")) {
if (my $pvalue = $property->getAttribute("TYPE")) {
$ins_value->{property}->{$pname}->{type} = $pvalue;
}
if ($property->getElementsByTagName("VALUE.ARRAY")) {
my @nodelist = $property->getElementsByTagName("VALUE");
my @value_array = ();
foreach my $n (@nodelist) {
push @value_array, $n->textContent;
}
$ins_value->{property}->{$pname}->{value} = join(',',@value_array);
} elsif (my $node = $property->getElementsByTagName("VALUE")) {
$ins_value->{property}->{$pname}->{value} = $node->[0]->textContent;
}
}
}
push @{$ret_value}, $ins_value;
}
return ({rc =>0}, $ret_value, $namepath_string);
}
=head1 set_property ()
Description:
Set the property for an instance.
Arguments:
http_params: A reference to HTTP_PARAMS
cim_params: The CIM parameters
namepath - a mandatory param to specify the path of the instance.
It should be returned from 'enum_instance' subroutine.
Return:
1 - A hash reference. The valid key includes:
rc - The return code. 0 - success. > 0 - fail.
cim_rc - The return code from CIM server.
msg - Output message.
=cut
sub set_property
{
my $http_params = shift;
unless (ref($http_params)) {
$http_params = shift;
}
my $cim_params = shift;
# This is a mandatory parameter
unless ($cim_params->{namepath}) {
return ({rc => 1, msg => "Missed the name path for the instance"});
}
unless ($cim_params->{namespace}) {
$cim_params->{namespace} = "ibmsd";
}
# prepare the CIM payload
my $tmpnode;
# create a new doc
my $doc = XML::LibXML->createDocument('1.0','UTF-8');
# create and add the root element
my $root = $doc->createElement("CIM");
$root->setAttribute("CIMVERSION", "2.0");
$root->setAttribute("DTDVERSION", "2.0");
$doc->setDocumentElement($root);
# create and add the MESSAGE element
my $message = $doc->createElement("MESSAGE");
$message->setAttribute("ID", "1000");
$message->setAttribute("PROTOCOLVERSION", "1.0");
$root->addChild($message);
# add a SIMPLE REQUEST
my $simple_request = $doc->createElement("SIMPLEREQ");
$message->addChild($simple_request);
# add an IMETHOD CALL
my $imethod_call = $doc->createElement("IMETHODCALL");
$imethod_call->setAttribute("NAME", "SetProperty");
$simple_request->addChild($imethod_call);
# add the local name space path
my $localnamespacepath = $doc->createElement("LOCALNAMESPACEPATH");
$tmpnode = $doc->createElement("NAMESPACE");
$tmpnode->setAttribute("NAME", "root");
$localnamespacepath->addChild($tmpnode);
$tmpnode = $doc->createElement("NAMESPACE");
$tmpnode->setAttribute("NAME", $cim_params->{namespace});
$localnamespacepath->addChild($tmpnode);
$imethod_call->addChild($localnamespacepath);
# add the target property name
my $param_propertyname = $doc->createElement("IPARAMVALUE");
$param_propertyname->setAttribute("NAME", "PropertyName");
$imethod_call->addChild($param_propertyname);
$tmpnode = $doc->createElement("VALUE");
$tmpnode->appendTextNode($cim_params->{propertyname});
$param_propertyname->addChild($tmpnode);
# add the target property value
my $param_newvaluename = $doc->createElement("IPARAMVALUE");
$param_newvaluename->setAttribute("NAME", "NewValue");
$imethod_call->addChild($param_newvaluename);
$tmpnode = $doc->createElement("VALUE");
$tmpnode->appendTextNode($cim_params->{propertyvalue});
$param_newvaluename->addChild($tmpnode);
# add parameters of instance name path
my $param_namepath = $doc->createElement("IPARAMVALUE");
$param_namepath->setAttribute("NAME", "InstanceName");
$param_namepath->appendWellBalancedChunk($cim_params->{namepath});
$imethod_call->addChild($param_namepath);
my $payload = $doc->toString();
# generate http request
my $ret = gen_http_request($http_params, $payload);
if ($ret->{rc}) {
return $ret;
}
# send request to http server
$ret = send_http_request($http_params, $ret->{request});
if ($ret->{rc}) {
return $ret;
}
# parse the http response
my $ret_value;
my $parser = XML::LibXML->new();
my $resp_doc = $parser->parse_string($ret->{payload});
# check the error message from CIM
my $error_node = $resp_doc->getElementsByTagName("ERROR");
if ($error_node) {
my $msg = $error_node->[0]->getAttribute("DESCRIPTION");
my $errorcode = $error_node->[0]->getAttribute("CODE");
return ({rc => 1, cim_rc => $errorcode, msg => $error_node->[0]->getAttribute("DESCRIPTION")." [cim return code: $errorcode]"});
}
# if no http and cim error, the setting was succeeded
return ($ret);
}
=head1 gen_http_request ()
Description:
Generate a http request.
Arguments:
http_params: A reference to HTTP_PARAMS
payload: The payload for the http request. It can be null if the payload has been set in http_params.
Return:
A hash reference. The valid key includes:
rc - The return code. 0 - success. > 0 - fail.
msg - Output message
request - The generated HTTP::Request object
=cut
sub gen_http_request
{
my $http_params = shift;
my $http_payload = shift;
# check the mandatory parameters
unless (defined ($http_params->{ip}) && defined ($http_params->{port}) && defined($http_params->{user}) && defined($http_params->{password})) {
return ({rc => 1, msg => "Missed the mandatory parameters: ip, port, user or password"});
}
# set the default value for parameters
unless (defined ($http_params->{protocol})) {
$http_params->{protocol} = 'https';
}
unless (defined ($http_params->{format})) {
$http_params->{format} = 'xml';
}
unless (defined ($http_params->{method})) {
$http_params->{method} = 'GET';
}
my $payload = '';
if (defined ($http_params->{payload})) {
$payload = $http_params->{payload};
}
if (defined ($http_payload)) {
unless (ref($http_payload)) { #Todo: support payloasd to be a hash
$payload = $http_payload;
}
}
# create the http head
my $header = HTTP::Headers->new('content-type' => "application/$http_params->{format}",
'Accept' => "application/$http_params->{format}",
'User-Agent' => "xCAT/2",
'Host' => "$http_params->{ip}:$http_params->{port}");
# set the user & password
$header->authorization_basic($http_params->{user}, $http_params->{password});
# set the length of payload
my $plen = length($payload);
$header->push_header('Content-Length' => $plen);
# create the URL
my $url = "$http_params->{protocol}://$http_params->{ip}:$http_params->{port}";
my $request = HTTP::Request->new($http_params->{method}, $url, $header, $payload);
# set the http version
$request->protocol('HTTP/1.1');
return ({rc => 0, request => $request});
}
=head1 send_http_request ()
Description:
Send http request to http server and waiting for the response.
Arguments:
http_params: A reference to HTTP_PARAMS
http_request: A HTTP::Request object
Return:
A hash reference. The valid key includes:
rc - The return code. 0 - success. > 0 - fail.
http_rc - The return code of http. 200, 400 ...
msg - Output message
payload - The http response from http server
=cut
sub send_http_request
{
my $http_params = shift;
my $http_request = shift;
# Load the library LWP::Protocol::https for https support
if ($http_params->{protocol} eq 'https') {
eval { require LWP::Protocol::https};
if ($@) {
return ({rc => 1, msg => "Failed to load perl library LWP::Protocol::https"});
}
}
# create a new HTTP User Agent Object
my $ua = LWP::UserAgent->new(ssl_opts => { verify_hostname => 0, SSL_verify_mode => 0});
if ($http_params->{timeout}) {
$ua->timeout($http_params->{timeout});
} else {
$ua->timeout(10); # the default timeout is 10s
}
if (defined($http_params->{verbose}) && defined ($http_params->{callback})) {
$http_params->{callback}({data => ["\n========CIM Request Start========", $http_request->as_string(), "=======CIM Request End======="]});
}
# send request and receive the response
my $response = $ua->request($http_request);
if (defined($http_params->{verbose}) && defined ($http_params->{callback}) && defined ($response->{_content})) {
$http_params->{callback}({data => ["\n========CIM Response Start========", $response->{_content}, "=======CIM Response End======="]});
}
# check the http response
if (defined ($response) && defined ($response->{_rc}) && defined ($response->{_msg})) {
if ($response->{_rc} eq "200" && $response->{_msg} eq "OK") {
return ({rc => 0, http_rc => $response->{_rc}, msg => "$response->{_msg} [http return code: $response->{_rc}]", payload => $response->{_content}});
}
}
return ({rc => 1, http_rc => $response->{_rc}, msg => $response->{_msg}});
}
1;
+5
View File
@@ -237,6 +237,10 @@ if (ref($request) eq 'HASH') { # the request is an array, not pure XML
}
}
my $client;
my %sslargs;
if (defined($ENV{'XCATSSLVER'})) {
$sslargs{SSL_version} = $ENV{'XCATSSLVER'};
}
if (-r $keyfile and -r $certfile and -r $cafile) {
$client = IO::Socket::SSL->start_SSL($pclient,
SSL_key_file => $keyfile,
@@ -245,6 +249,7 @@ if (ref($request) eq 'HASH') { # the request is an array, not pure XML
SSL_verify_mode => SSL_VERIFY_PEER,
SSL_use_cert => 1,
Timeout => 0,
%sslargs,
);
} else {
$client = IO::Socket::SSL->start_SSL($pclient,
+1 -1
View File
@@ -407,7 +407,7 @@ sub lshwconn_parse_args
}
if (scalar(@error_type_nodes)) {
my $tmp_nodelist = join ',', @error_type_nodes;
my $link = (scalar(@error_type_nodes) == '1')? 'is':'are';
my $link = (scalar(@error_type_nodes) eq '1')? 'is':'are';
return( ["Node type of node(s) $tmp_nodelist $link not supported for this command in FSPAPI.\n"]);
}
#$nodetypetab->close();
+13 -13
View File
@@ -141,13 +141,13 @@ sub chvm_parse_extra_options {
} elsif ($cmd eq "vmmemory") {
if ($value =~ /^([\d|.]+)([G|M]?)\/([\d|.]+)([G|M]?)\/([\d|.]+)([G|M]?)$/i) {
my ($mmin, $mcur, $mmax);
if ($2 == "G" or $2 == '') {
if ($2 eq "G" or $2 eq '') {
$mmin = $1 * 1024;
}
if ($4 == "G" or $4 == '') {
if ($4 eq "G" or $4 eq '') {
$mcur = $3 * 1024;
}
if ($6 == "G" or $6 == '') {
if ($6 eq "G" or $6 eq '') {
$mmax = $5 * 1024;
}
unless ($mmin <= $mcur and $mcur <= $mmax) {
@@ -872,17 +872,17 @@ sub do_op_extra_cmds {
if ($param =~ /(\d+)([G|M]?)\/(\d+)([G|M]?)\/(\d+)([G|M]?)/i) {
my $memsize = $memhash->{mem_region_size};
my $min = $1;
if ($2 == "G" or $2 == '') {
if ($2 eq "G" or $2 eq '') {
$min = $min * 1024;
}
$min = int($min/$memsize);
my $cur = $3;
if ($4 == "G" or $4 == '') {
if ($4 eq "G" or $4 eq '') {
$cur = $cur * 1024;
}
$cur = int($cur/$memsize);
my $max = $5;
if ($6 == "G" or $6 == '') {
if ($6 eq "G" or $6 eq '') {
$max = $max * 1024;
}
$max = int($max/$memsize);
@@ -928,7 +928,7 @@ sub do_op_extra_cmds {
}
if (@query_array) {
my $rethash = query_cec_info_actions($request, $name, $d, 1, \@query_array);
unless (scalar keys(%$memhash)) {
unless (scalar keys(%$rethash)) {
push @values, [$mtms, "Can not get hypervisor information", 1];
next;
}
@@ -1183,7 +1183,7 @@ sub get_cec_lpar_name {
my @value = split(/\n/, $lpar_info);
foreach my $v (@value) {
if($v =~ /lparname:\s*([^\,]*),\s*lparid:\s*([\d]+),/) {
if($2 == $lparid) {
if($2 eq $lparid) {
return $1;
}
}
@@ -1738,7 +1738,7 @@ sub parse_part_get_info {
$hash->{process_units_avail} = $2;
} elsif ($line =~ /Authority Lpar id:(\w+)/i) {
$hash->{service_lparid} = $1;
} elsif ($line =~ /(\d+),(\d+),[^,]*,(\w+),\w*\(([\w| |-|_]*)\)/) {
} elsif ($line =~ /(\d+),(\d+),[^,]*,(\w+),\w*\(([\w| |-|_|\/]*)\)/) {
$hash->{bus}->{$3}->{cur_lparid} = $1;
$hash->{bus}->{$3}->{bus_slot} = $2;
$hash->{bus}->{$3}->{des} = $4;
@@ -2001,7 +2001,7 @@ sub query_cec_info {
last;
}
#push @result, [@td[3], $rethash, 0];
push @result, @$rethash;
#push @result, @$rethash;
}
}
if ($args->{updatedb} and %lpar_hash) {
@@ -2347,13 +2347,13 @@ sub mkspeclpar {
next;
}
my ($mmin, $mcur, $mmax);
if ($2 == "G" or $2 == '') {
if ($2 eq "G" or $2 eq '') {
$mmin = $1 * 1024;
}
if ($4 == "G" or $4 == '') {
if ($4 eq "G" or $4 eq '') {
$mcur = $3 * 1024;
}
if ($6 == "G" or $6 == '') {
if ($6 eq "G" or $6 eq '') {
$mmax = $5 * 1024;
}
unless ($mmin <= $mcur and $mcur <= $mmax) {
+127 -54
View File
@@ -1098,7 +1098,8 @@ sub my_if_netmap
Error:
none
Example:
xCAT::NetworkUtils->my_ip_facing
my $ip = xCAT::NetworkUtils->my_ip_facing($peerip)
my @ip = xCAT::NetworkUtils->my_ip_facing($peerip) # return multiple
Comments:
none
=cut
@@ -1116,6 +1117,8 @@ sub my_ip_facing
unless ($peernumber) { return undef; }
my $noden = unpack("N", inet_aton($peer));
my @nets = split /\n/, `/sbin/ip addr`;
my @ips;
foreach (@nets)
{
my @elems = split /\s+/;
@@ -1128,10 +1131,19 @@ sub my_ip_facing
my $curn = unpack("N", inet_aton($curnet));
if (($noden & $curmask) == ($curn & $curmask))
{
return $curnet;
push @ips, $curnet;
}
}
return undef;
if (@ips) {
if (wantarray) {
return @ips;
} else {
return $ips[0];
}
} else {
return undef;
}
}
#-------------------------------------------------------------------------------
@@ -2018,49 +2030,6 @@ sub getNodeNameservers{
return \%nodenameservers;
}
#-------------------------------------------------------------------------------
=head3 getNodeGateway
Description:
Get gateway from the networks table of the node.
Arguments:
ip: the ip address of the node
Returns:
Return a string, of the gateway
undef - Failed to get the gateway
Globals:
none
Error:
none
Example:
my $gateway = xCAT::NetworkUtils::getNodeGateway('192.168.1.0');
Comments:
none
=cut
#-------------------------------------------------------------------------------
sub getNodeGateway
{
my $ip=shift;
if( $ip =~ /xCAT::NetworkUtils/)
{
$ip=shift;
}
my $gateway=undef;
my $nettab = xCAT::Table->new("networks");
if ($nettab) {
my @nets = $nettab->getAllAttribs('net','mask','gateway');
foreach my $net (@nets) {
if (xCAT::NetworkUtils::isInSameSubnet( $net->{'net'}, $ip, $net->{'mask'}, 0)) {
$gateway=$net->{'gateway'};
}
}
}
return $gateway;
}
#-------------------------------------------------------------------------------
@@ -2093,18 +2062,22 @@ sub getNodeNetworkCfg
$node =shift;
}
my $nets = xCAT::NetworkUtils::my_nets();
my $ip = xCAT::NetworkUtils->getipaddr($node);
my $mask = undef;
my $gateway = undef;
for my $net (keys %$nets)
{
my $netname;
($netname,$mask) = split /\//, $net;
last if ( xCAT::NetworkUtils::isInSameSubnet( $netname, $ip, $mask, 1));
my $nettab = xCAT::Table->new("networks");
if ($nettab) {
my @nets = $nettab->getAllAttribs('net','mask','gateway');
foreach my $net (@nets) {
if (xCAT::NetworkUtils::isInSameSubnet( $net->{'net'}, $ip, $net->{'mask'}, 0)) {
$gateway=$net->{'gateway'};
$mask=$net->{'mask'};
}
}
}
$gateway=xCAT::NetworkUtils::getNodeGateway($ip);
return ($ip, $node, $gateway, xCAT::NetworkUtils::formatNetmask($mask,1,0));
return ($ip, $node, $gateway, xCAT::NetworkUtils::formatNetmask($mask,0,0));
}
@@ -2455,6 +2428,106 @@ sub get_all_nicips{
}
}
#-------------------------------------------------------------------------------
=head3 gen_net_boot_params
Description:
This subroutine is used to generate all possible kernel parameters for network boot (rh/sles/ubuntu + diskfull/diskless)
The supported network boot parameters:
ksdevice - Specify network device for Anaconda. For rh6 and earlier. Format: 'ksdevice={$mac|$nicname}'
BOOTIF - Specify network device for Anaconda. The boot device which set by pxe. xCAT also set it if the bootload is not pxe. Format 'BOOTIF={$mac}'
ifname - Specify a interfacename<->mac pair, it will set the interfacename to the interface which has the <mac>. Format 'ifname=$ifname:$mac'
# This will only be generated when linuximage.nodebootif is set.
bootdev - Specify the boot device. Mostly it's used with <ip> parameter and when there are multiple <ip> params. Format 'bootdev={$mac|$ifname}
ip - Specify the network configuration for an interface. Format: 'ip=dhcp', 'ip=$ifname:dhcp'
netdevice - Specify network device for Linuxrc (Suse bootloader). Format: 'netdevice={$mac|$nicname}'
netdev - Specify the interfacename which is used by xCAT diskless boot script to select the network interface. Format: 'netdev=$nicname'
Reference:
Redhat anaconda doc: https://github.com/rhinstaller/anaconda/blob/master/docs/boot-options.txt
Suse Linuxrc do: https://en.opensuse.org/SDB:Linuxrc
Arguments:
$installnic <- node.installnic
$primarynic <- node.primarynic
$macmac <- node.mac
$nodebootif <- linuximage.nodebootif
Returns:
$net_params - The key will be the parameter name, the value for the key will be the parameter value.
Valid Parameter Name:
ksdevice
netdev
netdevice
ip
ifname
BOOTIF
And following two keys also will be returned for reference
mac
nicname
Example:
my $netparams = xCAT::NetworkUtils->gen_net_boot_params($installnic, $primmarynic, $macmac, $nodebootif);
=cut
#-------------------------------------------------------------------------------
sub gen_net_boot_params
{
my $class = shift;
my $installnic = shift;
my $primarynic = shift;
my $macmac = shift;
my $nodebootif = shift;
my $net_params;
# arbitrary use primarynic if installnic is not set
unless ($installnic) {
$installnic = $primarynic;
}
# just use the installnic to generate the nic related kernel parameters
my $mac;
my $nicname;
if ((! defined ($installnic)) || ($installnic eq "") || ($installnic =~ /^mac$/i)) {
$mac = $macmac;
$net_params->{mac} = $mac;
} elsif ($installnic =~ /^[0-9a-fA-F]{2}:[0-9a-fA-F]{2}:[0-9a-fA-F]{2}:[0-9a-fA-F]{2}:[0-9a-fA-F]{2}:[0-9a-fA-F]{2}$/) {
$mac = $installnic;
$net_params->{mac} = $mac;
$net_params->{setmac} = $mac;
} else {
$mac = $macmac;
$nicname = $installnic;
$net_params->{nicname} = $nicname;
$net_params->{mac} = $mac;
}
if ($nicname) {
$net_params->{ksdevice} = "ksdevice=$nicname";
$net_params->{ip} = "ip=$nicname:dhcp";
$net_params->{netdev} = "netdev=$nicname";
$net_params->{netdevice} = "netdevice=$nicname";
$net_params->{ifname} = "ifname=$nodebootif:$mac";
} elsif ($mac) {
$net_params->{ksdevice} = "ksdevice=$mac";
$net_params->{BOOTIF} = "BOOTIF=$mac";
$net_params->{bootdev} = "bootdev=$mac";
$net_params->{ip} = "ip=dhcp";
if ($nodebootif) {
$net_params->{ifname} = "ifname=$nodebootif:$mac";
}
$net_params->{netdevice} = "netdevice=$mac";
}
return $net_params;
}
1;
+1
View File
@@ -196,6 +196,7 @@ sub expandatom {
$nodelist->_set_use_cache(1);
@allnodeset = $nodelist->getAllAttribs('node','groups');
%allnodehash = map { $_->{node} => 1 } @allnodeset;
$nodelist->_set_use_cache(0); #The {_use_cache} for nodelist table object must be turn off, otherwise it will keep open and affect the Table.pm subroutines like getNodesAttribs when it tries to access nodelist table to get status column.
}
my $verify = (scalar(@_) >= 1 ? shift : 1);
my %options = @_; # additional options
+1 -1
View File
@@ -339,7 +339,7 @@ sub lshwconn_parse_args
}
if (scalar(@error_type_nodes)) {
my $tmp_nodelist = join ',', @error_type_nodes;
my $link = (scalar(@error_type_nodes) == '1')? 'is':'are';
my $link = (scalar(@error_type_nodes) eq '1')? 'is':'are';
return( ["Node type of node(s) $tmp_nodelist $link not supported for this command.\n"]);
}
$request->{nodetype} = $nodetype;
+237 -29
View File
@@ -277,7 +277,7 @@ sub get_nodes_nic_attrs{
my $nodes = shift;
my $nicstab = xCAT::Table->new( 'nics');
my $entry = $nicstab->getNodesAttribs($nodes, ['nictypes', 'nichostnamesuffixes', 'nichostnameprefixes', 'niccustomscripts', 'nicnetworks', 'nicips']);
my $entry = $nicstab->getNodesAttribs($nodes, ['nictypes', 'nichostnamesuffixes', 'nichostnameprefixes', 'niccustomscripts', 'nicnetworks', 'nicips', 'nicextraparams']);
my %nicsattrs;
my @nicattrslist;
@@ -361,6 +361,19 @@ sub get_nodes_nic_attrs{
$nicsattrs{$node}{$nicattrs[0]}{'ip'} = $nicattrs[1];
}
}
if($entry->{$node}->[0]->{'nicextraparams'}){
@nicattrslist = split(",", $entry->{$node}->[0]->{'nicextraparams'});
foreach (@nicattrslist){
my @nicattrs;
if ($_ =~ /!/) {
@nicattrs = split("!", $_);
} else {
@nicattrs = split(":", $_);
}
$nicsattrs{$node}{$nicattrs[0]}{'extraparams'} = $nicattrs[1];
}
}
}
return \%nicsattrs;
@@ -845,6 +858,13 @@ sub check_profile_consistent{
my $arch = $nodetypeentry->{'arch'};
$nodetypetab->close();
# Get Imageprofile pkgdir
my $osdistroname = $os . "-" . $arch;
my $osdistrotab = xCAT::Table->new('osdistro');
my $osdistroentry = ($osdistrotab->getAllAttribsWhere("osdistroname = '$osdistroname'", 'ALL' ))[0];
my $pkgdir = $osdistroentry->{'dirpaths'};
$osdistrotab->close();
# Get networkprofile netboot and installnic
my $noderestab = xCAT::Table->new('noderes');
my $noderesentry = $noderestab->getNodeAttribs($networkprofile, ['netboot', 'installnic']);
@@ -876,24 +896,33 @@ sub check_profile_consistent{
my $nodetype = undef;
$nodetype = $ntentry->{'nodetype'} if ($ntentry->{'nodetype'});
$ppctab->close();
# Checking whether netboot initrd image for Ubuntu ppc64
# This image should be downloaded from internet
if ($arch =~ /ppc64/i and $os =~ /ubuntu/i and !(-e "$pkgdir/install/netboot/initrd.gz")){
return 0, "The netboot initrd is not found in $pkgdir/install/netboot, please download it firstly.";
}
# Check if exists provision network
if (not ($installnic and exists $netprofile_nicshash{$installnic}{"network"})){
return 0, "Provisioning network not defined for network profile."
}
# Remove check mechanism about arch and netboot attribute
# Attribute 'neboot' will be generated based on arch, management method, os
# Profile consistent keys, arch=>netboot, mgt=>nictype
my $ppc_netboot = 'yaboot';
if( $os =~ /rhels7/ ){
$ppc_netboot = 'grub2';
}
my %profile_dict = ('x86' => 'xnba','x86_64' => 'xnba', 'ppc64' => $ppc_netboot,
'ppc64el' => $ppc_netboot,
'fsp' => 'FSP', 'ipmi' => 'BMC');
#my $ppc_netboot = 'yaboot';
#if( $os =~ /rhels7/ ){
# $ppc_netboot = 'grub2';
#}
#my %profile_dict = ('x86' => 'xnba','x86_64' => 'xnba', 'ppc64' => $ppc_netboot,
# 'ppc64el' => $ppc_netboot,
# 'fsp' => 'FSP', 'ipmi' => 'BMC');
# Check if imageprofile is consistent with networkprofile
if ($profile_dict{$arch} ne $netboot) {
return 0, "Imageprofile's arch is not consistent with networkprofile's netboot."
}
#if ($profile_dict{$arch} ne $netboot) {
# return 0, "Imageprofile's arch is not consistent with networkprofile's netboot."
#}
# Check if networkprofile is consistent with hardwareprofile
if (not $hardwareprofile) { # Not define hardwareprofile
@@ -903,29 +932,29 @@ sub check_profile_consistent{
return 0, "$nictype networkprofile must use with hardwareprofile.";
}
}
if ($mgt eq 'vm')
{
return 1, "";
}
my %mgt_dict = ('fsp' => 'FSP', 'ipmi' => 'BMC', 'kvm' => '');
# For nodetype is lpar node, not need to check the nictype as it is not required for lpar node
if (not $nictype and $mgt and $nodetype ne 'lpar' ) {
# define hardwareprofile, not define fsp or bmc networkprofile, and the node type is not lpar
return 0, "$profile_dict{$mgt} hardwareprofile must use with $profile_dict{$mgt} networkprofile.";
if ($mgt eq 'vm') {
return 1, "";
}
if ($profile_dict{$mgt} ne $nictype and $nodetype ne 'lpar') {
# Networkprofile's nictype is not consistent with hadrwareprofile's mgt, and the node type is not lpar
return 0, "Networkprofile's nictype is not consistent with hardwareprofile's mgt.";
if ($nodetype eq 'lpar') {
if ($nictype) {
# Can not associate FSP/BMC network if the node type is lpar
return 0, "The node with hardware type $nodetype can not use with $nictype networkprofile.";
}
return 1, ""
}
if ($nodetype eq 'lpar' and $nictype eq 'FSP')
{
# can not associate FSP network if the node type is lpar
return 0, "The node with hardware type $nodetype can not use with $nictype networkprofile.";
if ($mgt and $mgt_dict{$mgt} ne $nictype) {
my $errmsg = "$mgt hardwareprofile must use with $mgt_dict{$mgt} networkprofile.";
if ( $mgt eq 'kvm' ) {
$errmsg = "$mgt hardwareprofile must use with non-BMC and non-FSP networkprofile."
}
return 0, $errmsg;
}
return 1, "";
}
@@ -1254,3 +1283,182 @@ sub gen_chain_for_profiles{
}
return (0, $final_chain);
}
#-------------------------------------------------------------------------------
=head3 get_all_vmhosts
Description : Get all vm hosts/hypervisor from DB.
Arguments : N/A
Returns : ref for vm hosts/hypervisor hash.
Example :
my $hashref = xCAT::ProfiledNodeUtils->get_all_vmhosts();
=cut
#-------------------------------------------------------------------------------
sub get_all_vmhosts
{
my %vmhostshash;
my $nodelisttab = xCAT::Table->new('nodelist');
# groups like '__Hypervisor_pkvm' means this node is Power KVM hypervisor
my @vmhosts = $nodelisttab->getAllAttribsWhere("groups like '%__Hypervisor_kvm%'", 'node');
foreach (@vmhosts) {
if($_->{'node'}) {
$vmhostshash{$_->{'node'}} = 1;
}
}
$nodelisttab->close();
# Return the ref accordingly
return \%vmhostshash;
}
#-------------------------------------------------------------------------------
=head3 get_netboot_attr
Description : Get netboot attribute for node
Arguments : $imageprofile - image profile name, mandatory. e.g. "__ImageProfile_rhels7.0-x86_64-stateful-mgmtnode"
$hardwareprofile - harware profile name, optional. e.g. "__HardwareProfile_IBM_System_x_M4"
Returns : (returncode, netboot)
returncode=0 - can not get netboot value,netboot is the error message
returncode=1 - can get netboot value,netboot is the right value
=cut
#-------------------------------------------------------------------------------
sub get_netboot_attr{
my $class = shift;
my $imageprofile = shift;
my $hardwareprofile = shift;
my $netboot;
my @nodegrps = xCAT::TableUtils->list_all_node_groups();
unless(grep{ $_ eq $imageprofile} @nodegrps)
{
return 0, "Image profile not defined in DB."
}
$imageprofile =~ s/^__ImageProfile_//;
if ($hardwareprofile){
unless(grep{ $_ eq $hardwareprofile} @nodegrps)
{
return 0, "Hardware profile not defined in DB."
}
$hardwareprofile =~ s/^__HardwareProfile_//;
}
else
{
$hardwareprofile = '*';
}
# Get os name, os major version, osarch
my $osimage_tab = xCAT::Table->new('osimage');
my $osimage_tab_entry = $osimage_tab->getAttribs({'imagename'=> $imageprofile},('osdistroname'));
my $osdistroname = $osimage_tab_entry->{'osdistroname'};
$osimage_tab->close();
my $osdistro_tab = xCAT::Table->new('osdistro');
my $osdistro_tab_entry = $osdistro_tab->getAttribs({'osdistroname'=> $osdistroname},('basename', 'majorversion', 'arch'));
my $os_name = $osdistro_tab_entry->{'basename'};
my $os_major_version = $osdistro_tab_entry->{'majorversion'};
my $os_arch = $osdistro_tab_entry->{'arch'};
$osdistro_tab->close;
# Treate os name rhel,centos,rhelhpc same as rhels
if ($os_name eq 'centos' || $os_name eq 'rhelhpc' || $os_name eq 'rhel')
{
$os_name = 'rhels';
}
# Treate arch ppc64el same as ppc64le,x86 same as x86_64
if ($os_arch eq 'ppc64el')
{
$os_arch = 'ppc64le';
}elsif ($os_arch eq 'x86')
{
$os_arch = 'x86_64';
}
# Rule for netboot attribute.If update the rule,just update %netboot_dict and @condition_array
# It's sequence sensitive: os arch -> os name -> os major version -> hardware profile
# Priority | Arch | OS Name | OS Major Version | Hardware Profile | Noderes.netboot |
# 1 | x86_64/x86 | * | * | * | xnba |
# 2 | ppc64 | rhels | 7 | * | grub2 |
# 3 | | * | * | * | yaboot |
# 4 | ppc64le/el | * | * | IBM_PowerNV | petiboot |
# 5 | | * | * | * | grub2 |
# arch osname version hardware netboot
my %netboot_dict = ( 'x86_64' => 'xnba',
'ppc64' => {
'rhels' => {
'7' => 'grub2',
'*' => 'yaboot',
},
'*' => 'yaboot',
},
'ppc64le' => {
'*' => {
'*' => {
'IBM_PowerNV' => 'petiboot',
'*' => 'grub2',
},
},
},
);
my $condition_array_ref = [$os_arch, $os_name, $os_major_version, $hardwareprofile];
$netboot = cal_netboot(\%netboot_dict, $condition_array_ref);
if($netboot eq '0')
{
return 0, "Can not get the netboot attribute";
}
else
{
return 1, $netboot;
}
}
#-------------------------------------------------------------------------------
=head3 cal_netboot
Description : Calculate netboot attribute by conditions recursively, internal use.
Arguments : $netboot_dict_ref
$condition_array_ref
Returns : netboot
returncode=0 - can not get netboot value
=cut
#-------------------------------------------------------------------------------
sub cal_netboot{
my $netboot_dict_ref = shift;
my $condition_array_ref = shift;
my $condition_array_len = scalar @$condition_array_ref;
if( $condition_array_len == 0 ){
return 0;
}
my $condition = shift @$condition_array_ref;
if( (exists($netboot_dict_ref->{$condition})) || (exists($netboot_dict_ref->{'*'})) )
{
if(!exists($netboot_dict_ref->{$condition}))
{
$condition = '*';
}
if(ref($netboot_dict_ref->{$condition}) eq 'HASH')
{
if($condition_array_len > 1)
{
return cal_netboot($netboot_dict_ref->{$condition}, $condition_array_ref);
}
else
{
return 0;
}
}
else
{
return $netboot_dict_ref->{$condition};
}
}
else
{
return 0;
}
}
+18 -8
View File
@@ -542,7 +542,7 @@ networks => {
netname => 'Name used to identify this network definition.',
net => 'The network address.',
mask => 'The network mask.',
mgtifname => 'The interface name of the management/service node facing this network. !remote! indicates a non-local network for relay DHCP.',
mgtifname => 'The interface name of the management/service node facing this network. !remote!<nicname> indicates a non-local network on a specific nic for relay DHCP.',
gateway => 'The network gateway. It can be set to an ip address or the keyword <xcatmaster>, the keyword <xcatmaster> indicates the cluster-facing ip address configured on this management node or service node. Leaving this field blank means that there is no gateway for this network.',
dhcpserver => 'The DHCP server that is servicing this network. Required to be explicitly set for pooled service node operation.',
tftpserver => 'The TFTP server that is servicing this network. If not set, the DHCP server is assumed.',
@@ -643,14 +643,14 @@ noderes => {
descriptions => {
node => 'The node name or group name.',
servicenode => 'A comma separated list of node names (as known by the management node) that provides most services for this node. The first service node on the list that is accessible will be used. The 2nd node on the list is generally considered to be the backup service node for this node when running commands like snmove.',
netboot => 'The type of network booting to use for this node. Valid values: pxe or xnba for x86* architecture, yaboot for POWER architecture, grub2 for RHEL7 on Power. Notice: yaboot is not supported from rhels7 on Power,use grub2 instead',
netboot => 'The type of network booting to use for this node. Valid values: pxe or xnba for x86* architecture, yaboot for POWER architecture, grub2-tftp and grub2-http for RHEL7 on Power and all the os deployment on Power LE. Notice: yaboot is not supported from rhels7 on Power,use grub2-tftp or grub2-http instead, the difference between the 2 is the file transfer protocol(i.e, http or tftp)',
tftpserver => 'The TFTP server for this node (as known by this node). If not set, it defaults to networks.tftpserver.',
tftpdir => 'The directory that roots this nodes contents from a tftp and related perspective. Used for NAS offload by using different mountpoints.',
nfsserver => 'The NFS or HTTP server for this node (as known by this node).',
monserver => 'The monitoring aggregation point for this node. The format is "x,y" where x is the ip address as known by the management node and y is the ip address as known by the node.',
nfsdir => 'The path that should be mounted from the NFS server.',
installnic => 'The network adapter on the node that will be used for OS deployment, the installnic can be set to the network adapter name or the mac address or the keyword "mac" which means that the network interface specified by the mac address in the mac table will be used. If not set, primarynic will be used.',
primarynic => 'The network adapter on the node that will be used for xCAT management, the primarynic can be set to the network adapter name or the mac address or the keyword "mac" which means that the network interface specified by the mac address in the mac table will be used. Default is eth0.',
installnic => 'The network adapter on the node that will be used for OS deployment, the installnic can be set to the network adapter name or the mac address or the keyword "mac" which means that the network interface specified by the mac address in the mac table will be used. If not set, primarynic will be used. If primarynic is not set too, the keyword "mac" will be used as default.',
primarynic => 'This attribute will be deprecated. All the used network interface will be determined by installnic. The network adapter on the node that will be used for xCAT management, the primarynic can be set to the network adapter name or the mac address or the keyword "mac" which means that the network interface specified by the mac address in the mac table will be used. Default is eth0.',
discoverynics => 'If specified, force discovery to occur on specific network adapters only, regardless of detected connectivity. Syntax can be simply "eth2,eth3" to restrict discovery to whatever happens to come up as eth2 and eth3, or by driver name such as "bnx2:0,bnx2:1" to specify the first two adapters managed by the bnx2 driver',
cmdinterface => 'Not currently used.',
xcatmaster => 'The hostname of the xCAT service node (as known by this node). This acts as the default value for nfsserver and tftpserver, if they are not set. If xcatmaster is not set, the node will use whoever responds to its boot request as its master. For the directed bootp case for POWER, it will use the management node if xcatmaster is not set.',
@@ -756,9 +756,9 @@ linuximage => {
boottarget => 'The name of the boottarget definition. When this attribute is set, xCAT will use the kernel, initrd and kernel params defined in the boottarget definition instead of the default.',
addkcmdline=> 'User specified arguments to be passed to the kernel. The user arguments are appended to xCAT.s default kernel arguments. This attribute is ignored if linuximage.boottarget is set.',
pkglist => 'The fully qualified name of the file that stores the distro packages list that will be included in the image. Make sure that if the pkgs in the pkglist have dependency pkgs, the dependency pkgs should be found in one of the pkgdir',
pkgdir => 'The name of the directory where the distro packages are stored. It could be set multiple paths.The multiple paths must be seperated by ",". The first path in the value of osimage.pkgdir must be the OS base pkg dir path, such as pkgdir=/install/rhels6.2/x86_64,/install/updates . In the os base pkg path, there are default repository data. And in the other pkg path(s), the users should make sure there are repository data. If not, use "createrepo" command to create them. ',
pkgdir => 'The name of the directory where the distro packages are stored. It could be set multiple paths.The multiple paths must be seperated by ",". The first path in the value of osimage.pkgdir must be the OS base pkg dir path, such as pkgdir=/install/rhels6.2/x86_64,/install/updates . In the os base pkg path, there are default repository data. And in the other pkg path(s), the users should make sure there are repository data. If not, use "createrepo" command to create them. For ubuntu, multiple mirrors can be specified in the pkgdir attribute, the mirrors must be prefixed by the protocol(http/ssh) and delimited with "," between each other.',
otherpkglist => 'The fully qualified name of the file that stores non-distro package lists that will be included in the image.',
otherpkgdir => 'The base directory where the non-distro packages are stored.',
otherpkgdir => 'The base directory where the non-distro packages are stored. Only 1 local directory supported at present.',
exlist => 'The fully qualified name of the file that stores the file names and directory names that will be excluded from the image during packimage command. It is used for diskless image only.',
postinstall => 'The fully qualified name of the script file that will be run at the end of the genimage command. It is used for diskless image only.',
rootimgdir => 'The directory name where the image is stored. It is generally used for diskless image. it also can be used in sysclone environment to specify where the image captured from golden client is stored. in sysclone environment, rootimgdir is generally assigned to some default value by xcat, but you can specify your own store directory. just one thing need to be noticed, wherever you save the image, the name of last level directory must be the name of image. for example, if your image name is testimage and you want to save this image under home directoy, rootimgdir should be assigned to value /home/testimage/',
@@ -1420,7 +1420,7 @@ firmware => {
},
nics => {
cols => [qw(node nicips nichostnamesuffixes nichostnameprefixes nictypes niccustomscripts nicnetworks nicaliases comments disable)],
cols => [qw(node nicips nichostnamesuffixes nichostnameprefixes nictypes niccustomscripts nicnetworks nicaliases nicextraparams comments disable)],
keys => [qw(node)],
tablespace =>'XCATTBS16K',
table_desc => 'Stores NIC details.',
@@ -1457,6 +1457,12 @@ nics => {
Format: eth0!<alias list>,eth1!<alias1 list>|<alias2 list>
For multiple aliases per nic use a space-separated list.
For example: eth0!moe larry curly,eth1!tom|jerry',
nicextraparams => 'Comma-separated list of extra parameters that will be used for each NIC configuration.
If only one ip address is associated with each NIC:
<nic1>!<param1=value1 param2=value2>,<nic2>!<param3=value3>, for example, eth0!MTU=1500,ib0!MTU=65520 CONNECTED_MODE=yes.
If multiple ip addresses are associated with each NIC:
<nic1>!<param1=value1 param2=value2>|<param3=value3>,<nic2>!<param4=value4 param5=value5>|<param6=value6>, for example, eth0!MTU=1500|MTU=1460,ib0!MTU=65520 CONNECTED_MODE=yes.
The xCAT object definition commands support to use nicextraparams.<nicname> as the sub attributes.',
comments => 'Any user-written notes.',
disable => "Set to 'yes' or '1' to comment out this row.",
},
@@ -2383,7 +2389,11 @@ my @nodeattrs = (
tabentry => 'nics.nicaliases',
access_tabentry => 'nics.node=attr:node',
},
######################
{attr_name => 'nicextraparams',
tabentry => 'nics.nicextraparams',
access_tabentry => 'nics.node=attr:node',
},
#######################
# prodkey table #
######################
{attr_name => 'productkey',
+7
View File
@@ -185,6 +185,13 @@ sub isServiceReq
if (!exists($servicehash->{'tftpserver'})) {
$servicehash->{'tftpserver'} = 1;
}
# On Ubuntu management node, we disabled the isc-dhcp-server in upstart,
# through file /etc/init/isc-dhcp-server.override, see bug 4399
# however, this causes a new problem, bug 4515
# the fix is to start dhcp server when starting xcatd
if (!exists($servicehash->{'dhcpserver'}) && xCAT::Utils->osver() =~ /ubuntu.*/i) {
$servicehash->{'dhcpserver'} = 1;
}
}
$servicenodetab->close;
+8 -4
View File
@@ -333,12 +333,16 @@ my %usage = (
renergy [-v | --version]
Power 6 server specific :
renergy noderange [-V] { all | { [savingstatus] [cappingstatus] [cappingmaxmin] [cappingvalue] [cappingsoftmin] [averageAC] [averageDC] [ambienttemp] [exhausttemp] [CPUspeed] } }
renergy noderange [-V] { {savingstatus}={on | off} | {cappingstatus}={on | off} | {cappingwatt}=watt | {cappingperc}=percentage }
renergy noderange [-V] { all | { [savingstatus] [cappingstatus] [cappingmaxmin] [cappingvalue] [cappingsoftmin] [averageAC] [averageDC] [ambienttemp] [exhausttemp] [CPUspeed] } }
renergy noderange [-V] { {savingstatus}={on | off} | {cappingstatus}={on | off} | {cappingwatt}=watt | {cappingperc}=percentage }
Power 7 server specific :
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 }
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 }
Power 8 server specific :
renergy noderange [-V] { all | [savingstatus] [dsavingstatus] [averageAC] [averageAChistory] [averageDC] [averageDChistory] [ambienttemp] [ambienttemphistory] [exhausttemp] [exhausttemphistory] [fanspeed] [fanspeedhistory] [CPUspeed] [CPUspeedhistory] [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 }
BladeCenter specific :
For Management Modules:
+122 -26
View File
@@ -3298,13 +3298,68 @@ sub noderangecontainsMn
return; # if no MN in the noderange, return nothing
}
# the MTM of P6 and P7 machine
my %MTM_P6P7 = (
# P6 systems
'7998-60X' => 1,
'7998-61X' => 1,
'7778-23X' => 1,
'8203-E4A' => 1,
'8204-E8A' => 1,
'8234-EMA' => 1,
'9117-MMA' => 1,
'9119-FHA' => 1,
# P7 systems
'8406-70Y' => 1,
'8406-71Y' => 1,
'7891-73X' => 1,
'7891-74X' => 1,
'8231-E2B' => 1,
'8202-E4B' => 1,
'8231-E2B' => 1,
'8205-E6B' => 1,
'8233-E8B' => 1,
'8236-E8C' => 1,
'9117-MMB' => 1,
'9179-MHB' => 1,
'9119-FHB' => 1,
);
#-----------------------------------------------------------------------------
=head3 isP6P7
Check whether a MTM is a P6 or P7 machine
Parameter: MTM of Power machine
=cut
#-------------------------------------------------------------------------------
sub isP6P7
{
my $class = shift;
my $mtm = shift;
if ($class !~ /Utils/) {
$mtm = $class;
}
if (defined $MTM_P6P7{$mtm} && $MTM_P6P7{$mtm} == 1) {
return 1;
}
return 0;
}
=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
# mp group (argument: $mpnodes): the nodes will be handled by blade.pm
# fsp group (argument: $fspnodes): the nodes will be handled by fsp.pm
# bmc group (argument: $bmcnodes): 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
@@ -3346,13 +3401,29 @@ sub filter_nodes{
if ($ipmitab) {
$ipmitabhash = $ipmitab->getNodesAttribs(\@nodes,['bmc']);
}
# get the node attributes from the nodehm table
my $nodehmhash;
my $nodehmtab = xCAT::Table->new("nodehm");
if ($nodehmtab) {
$nodehmhash = $nodehmtab->getNodesAttribs(\@nodes,['mgt']);
}
my (@mp, @ngpfsp, @ngpbmc, @commonfsp, @commonbmc, @unknow);
# get the node attributes from the nodetype table
my $nodetypehash;
my $nodetypetab = xCAT::Table->new("nodetype");
if ($nodetypetab) {
$nodetypehash = $nodetypetab->getNodesAttribs(\@nodes, ['arch']);
}
# get the node attributes from the vpd table
my $vpdhash,
my $vpdtab = xCAT::Table->new("vpd");
if ($vpdtab) {
$vpdhash = $vpdtab->getNodesAttribs(\@nodes, ['mtm']);
}
my (@mp, @ngpfsp, @ngpbmc, @commonfsp, @commonbmc, @unknow, @nonppcle, @p6p7);
# if existing in both 'mpa' and 'ppc', a ngp power blade
# if existing in both 'mpa' and 'ipmi', a ngp x86 blade
@@ -3386,9 +3457,21 @@ sub filter_nodes{
} elsif (defined ($ppctabhash->{$_}->[0]) && defined ($ppctabhash->{$_}->[0]->{'hcp'})) {
# common power node
push @commonfsp, $_;
# whether is a Power 8 or higher with FSP
if (defined ($vpdhash->{$_}->[0]) && defined ($vpdhash->{$_}->[0]->{'mtm'})) {
if (isP6P7($vpdhash->{$_}->[0]->{'mtm'})) {
push @p6p7, $_;
}
}
} elsif (defined ($ipmitabhash->{$_}->[0]) && defined ($ipmitabhash->{$_}->[0]->{'bmc'})) {
# common bmc node
push @commonbmc, $_;
# whether is a Power 8 or higher with FSP
if (defined ($nodetypehash->{$_}->[0]) && defined ($nodetypehash->{$_}->[0]->{'arch'})) {
if ($nodetypehash->{$_}->[0]->{'arch'} ne "ppc64le") {
push @nonppcle, $_;
}
}
} else {
push @unknow, $_;
}
@@ -3422,6 +3505,16 @@ sub filter_nodes{
push @{$mpnodes}, @ngpfsp;
}
} elsif ($cmd eq "renergy") {
# for renergy command, only the p6,p7 get to the general fsp.pm
# P8 and higher will get in the energy.pm
@{$fspnodes} = ();
push @{$fspnodes}, @p6p7;
# for rnergy command, only the non-ppcle nodes get to the general ipmi.pm
# ppcle of P8 and higher will get in the energy.pm
@{$bmcnodes} = ();
push @{$bmcnodes}, @nonppcle;
if (grep /^(relhistogram)/, @args) {
push @{$bmcnodes}, @ngpbmc;
} else {
@@ -4375,29 +4468,32 @@ sub cleanup_for_powerLE_hardware_discovery {
#This may also be a "|" delimited string of "mac address!hostname" format (such as "01:02:03:04:05:0E!node5|01:02:03:05:0F!node6-eth1").
sub parseMacTabEntry{
my $macString=shift;
if( $macString =~ /xCAT::Utils/)
{
$macString=shift;
my $macString=shift;
if( $macString =~ /xCAT::Utils/) {
$macString=shift;
}
my $HostName=shift;
my $mac_ret;
my @macEntry=split(/\|/,$macString);
foreach my $mac_t (@macEntry){
if($mac_t =~ /!/){
if($mac_t =~ /(.+)!$HostName$/){
$mac_ret=$1;
}
}else{
$mac_ret=$mac_t;
}
}
}
my $HostName=shift;
my $mac_ret;
my @macEntry=split(/\|/,$macString);
foreach my $mac_t (@macEntry){
if($mac_t =~ /!/){
if($mac_t =~ /(.+)!$HostName$/){
$mac_ret=$1;
}
}else{
$mac_ret=$mac_t;
}
}
return $mac_ret;
if ($mac_ret) {
if ($mac_ret !~ /:/) {
$mac_ret =~ s/(..)(..)(..)(..)(..)(..)/$1:$2:$3:$4:$5:$6/;
}
}
return $mac_ret;
}
-2
View File
@@ -614,8 +614,6 @@ sub punch2Reader {
my $out;
if ( $os =~ m/sles10/i ) {
$out = `ssh -o ConnectTimeout=5 $user\@$hcp "$sudo /sbin/vmur punch $options -u $userId -r $srcFile -N $tgtFile"`;
} elsif ( $os =~ m/sles11/i ) {
$out = `ssh -o ConnectTimeout=5 $user\@$hcp "$sudo /usr/sbin/vmur punch $options -u $userId -r $srcFile -N $tgtFile"`;
} elsif ( $os =~ m/rhel/i ) {
$out = `ssh -o ConnectTimeout=5 $user\@$hcp "$sudo /usr/sbin/vmur punch $options -u $userId -r $srcFile -N $tgtFile"`;
} else {
+111
View File
@@ -0,0 +1,111 @@
#!/usr/bin/env python
"""
Usage: getslnodes.py [-h] [-v] [<hostname-match>]
Description:
Query your SoftLayer account and get attributes for each bare metal server.
The attributes can be piped to 'mkdef -z' to define the nodes into the xCAT
Database so that xCAT can manage them.
getslnodes requires a the .softlayer configuration file defined which can
be set by running "sl config setup" on the command line.
positional arguments:
hostname-match Select servers that include this partial hostname.
Optional:
-h, --help show this help message and exit
-v, --verbose display verbose output
"""
import sys
try:
import docopt
import pprint
import SoftLayer
except ImportError as e:
print 'Error: install missing python module before running this command: ' + str(e)
sys.exit(2)
def get_sl_servers():
# username, api_key, endpoint_url come from the .softlayer file
client = SoftLayer.Client()
mask = "hostname, fullyQualifiedDomainName, manufacturerSerialNumber, \
operatingSystem.id, operatingSystem.passwords.username, operatingSystem.passwords.password, \
remoteManagementAccounts.username, remoteManagementAccounts.password, remoteManagementComponent.ipmiIpAddress, \
primaryBackendNetworkComponent.primaryIpAddress, primaryBackendNetworkComponent.macAddress"
#
# If they specified hnmatch, it would be faster to have softlayer filter the response with something like:
# filter={'hardware': {'hostname': {'operation': '*= '+hostname}, 'domain': {'operation': '*= '+domain}}}
# But those 2 operations are ANDed together, so it will not work. And currently, filtering does not work on fullyQualifiedDomainName.
#
servers = client['Account'].getHardware(mask=mask)
return servers
def print_xcat_node_stanza(servers, hnmatch):
for server in servers:
if hnmatch and server['fullyQualifiedDomainName'].find(hnmatch) == -1:
continue
print "\n"+server['hostname']+":"
print "\tobjtype=node"
print "\tgroups=slnode,ipmi,all"
print "\tmgt=ipmi"
print "\tbmc="+server['remoteManagementComponent']['ipmiIpAddress']
# I have seen svrs with no remoteManagementAccounts entries
if len(server['remoteManagementAccounts']):
print "\tbmcusername="+server['remoteManagementAccounts'][0]['username']
print "\tbmcpassword="+server['remoteManagementAccounts'][0]['password']
print "\tip="+server['primaryBackendNetworkComponent']['primaryIpAddress']
print "\tmac="+server['primaryBackendNetworkComponent']['macAddress']
print "\tserial="+server['manufacturerSerialNumber']
print "\tnetboot=xnba"
print "\tarch=x86_64"
# Find the root or Administrator username and pw
username = None
password = None
for entry in server['operatingSystem']['passwords']:
if entry['username'] == 'root' or entry['username'] == 'Administrator':
# found it
username = entry['username']
password = entry['password']
break
elif not username:
# save the 1st entry, in case we never find root or Administrator
username = entry['username']
password = entry['password']
if username and password:
userStr = ", user:"+username+", pw:"+password
print "\tusercomment=hostname:"+server['fullyQualifiedDomainName']+userStr
if __name__ == '__main__':
try:
arguments = (docopt.docopt(__doc__, version="1.0"))
# print arguments
servers = get_sl_servers()
if arguments['--verbose']:
pprint.pprint(servers)
print_xcat_node_stanza(servers, arguments['<hostname-match>'])
except docopt.DocoptExit as e:
print e
except SoftLayer.exceptions.SoftLayerAPIError as e:
print e
sys.exit(1)
+140
View File
@@ -0,0 +1,140 @@
#!/usr/bin/python
"""
Usage:
softlayer_storage.py --type=<type> [--hostname=<hostname> --username=<username> --password=<password> --mountpoint=<mountpoint> ] (mount | unmount)
softlayer_storage.py --type=<type> [options] (mount | unmount)
Options:
-h --help Show help screen
--version Show version
--type=<type> Type of File Storage to mount ( consistent | nas )
--hostname=<hostname> SoftLayer Storage hostname
--username=<username> SoftLayer Storage LUN username
--password=<password> SoftLayer Storage LUN password
--mountpoint=<mountpoint> The mountpoint to use [default: /mnt/nas]
Description:
For consistent performance file storate, make sure the host accessing the
file storage has been authorized through the SoftLayer portal.
"""
import os
import sys
import docopt
path = os.path.dirname(os.path.realpath(__file__))
path = os.path.realpath(os.path.join(path, '..', 'lib', 'python'))
if path.startswith('/opt'):
# if installed into system path, do not muck with things
sys.path.append(path)
from xcat import xcatutils
def mount_nas_storage(hostname, user, passwd, mountPoint):
print "Attempting to mount the NAS File Storage at %s" %(mountPoint)
if xcatutils.isMounted(mountPoint):
raise xcatutils.xCatError("The mount point %s is already in use." %(mountPoint))
cmd = "mount -t cifs //%s/%s -o username=%s,password=%s,rw,nounix,iocharset=utf8,file_mode=0644,dir_mode=0755 %s" %(hostname, user, user, passwd, mountPoint)
out,err = xcatutils.run_command(cmd)
if err:
raise xcatutils.xCatError("Error when mounting. (%s)" %(err))
else:
print "Success\n"
# To help out with automount, print this msg
print "\nNote: To configure automount on reboot, add the following into /etc/fstab:"
cmd = "//%s/%s %s cifs defaults,username=%s,password=%s 0 0" %(hostname,user,mountPoint,user,passwd)
print "%s\n" %(cmd)
def mount_consistent_storage(hostname, user, mountPoint):
# TODO: would be good to be able to specify the nfs version as a argument
print "Attempting to mount the Consistent Performance File Storage at %s" %(mountPoint)
if xcatutils.isMounted(mountPoint):
raise xcatutils.xCatError("The mount point %s is already in use." %(mountPoint))
cmd = "mount -t nfs4 %s:/%s %s" %(hostname, user, mountPoint)
out,err = xcatutils.run_command(cmd)
if err:
raise xcatutils.xCatError("Error when mounting. (%s)" %(err))
else:
print "Success\n"
# To help out with automount, print this msg
print "\nNote: To configure automount on reboot, add the following into /etc/fstab:"
cmd = "%s:/%s %s nfs4 defaults,hard,intr 0 0" %(hostname,user,mountPoint)
print "%s\n" %(cmd)
def unmount_storage(mountPoint):
print "Attempting to unmount the NAS at %s..." %(mountPoint)
if not xcatutils.isMounted(mountPoint):
raise xcatutils.xCatError("The mount point %s is NOT mounted." %(mountPoint))
else:
cmd = "umount %s" %(mountPoint)
out,err = xcatutils.run_command(cmd)
if err:
print "Encountered error while unmounting..."
print err
def setup_softlayer_storage():
#
# set code defaults to consistent file storage options
#
requirePassword=False
preReqPackages = ['nfs-utils','nfs-utils-lib']
#
# if NAS is selected as the type, override the code defaults
#
if 'nas' in arguments['--type']:
requirePassword=True
preReqPackages = ['cifs-utils']
#
# verify information before starting
#
if arguments['--hostname'] is None:
arguments['--hostname'] = xcatutils.getUserInput("Enter the SoftLayer storage hostname")
if arguments['--username'] is None:
arguments['--username'] = xcatutils.getUserInput("Enter the SoftLayer storage username")
if arguments['--password'] is None and requirePassword:
arguments['--password'] = xcatutils.getUserInput("Enter the SoftLayer storage password")
#
# install prereqs
#
print "Checking for installed packages: %s" %(preReqPackages)
xcatutils.installPackages(preReqPackages)
#
# mount the file storage
#
if 'nas' in arguments['--type']:
mount_nas_storage(arguments['--hostname'],arguments['--username'],arguments['--password'],arguments['--mountpoint'])
elif 'consistent' in arguments['--type']:
mount_consistent_storage(arguments['--hostname'],arguments['--username'],arguments['--mountpoint'])
if __name__ == '__main__':
try:
arguments = (docopt.docopt(__doc__, version="1.0"))
if not arguments['--type'] in ('nas', 'consistent'):
raise xcatutils.xCatError("The type=%s is not a supported file system type." %(arguments['--type']))
if arguments['unmount']:
unmount_storage(arguments['--mountpoint'])
else:
setup_softlayer_storage()
except docopt.DocoptExit as e:
print e
except xcatutils.xCatError as e:
print "xCatError: %s" %(e)
@@ -0,0 +1,85 @@
import sys
import os
import platform
class xCatError(Exception):
def __init__(self, value):
self.value = value
def __str__(self):
return repr(self.value)
def isMounted(mountPoint):
if os.path.ismount(mountPoint):
return True
else:
return False
def run_command(cmd):
"""
Function: run_command
Arguments: cmd - string to be run as a command
Description: runs the command then returns out and err
"""
import subprocess
p = subprocess.Popen(cmd, shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, close_fds=True)
(out,err) = p.communicate()
return (out,err)
def isRhel():
myDistro = platform.linux_distribution()
if "Red Hat Enterprise Linux Server" or "CentOS" in myDistro:
return True
else:
return False
def isSles():
myDistro = platform.linux_distribution()
if "SUSE Linux Enterprise Server" in myDistro:
return True
else:
return False
def isUbuntu():
myDistro = platform.linux_distribution()
if "Ubuntu" in myDistro:
return True
else:
return False
def getUserInput(question):
response = raw_input("%s: " %(question))
return response
def filterInstalledPackages(pkglist=[]):
fulllist = ""
if isRhel():
# using YUM
import yum
yb = yum.YumBase()
for x in pkglist:
if not yb.rpmdb.searchNevra(name='%s' %(x)):
fulllist += "%s " %(x)
return fulllist
def installPackages(pkglist=[]):
fulllist = filterInstalledPackages(pkglist)
if isRhel():
if fulllist.strip() != "":
cmd = "yum -y install %s" %(fulllist)
out,err = xcatutils.run_command(cmd)
elif isSles():
print "Using zyppr..."
elif isUbuntu():
print "Using apt-get..."
else:
print "Error!"
+5
View File
@@ -47,6 +47,9 @@ xCAT-SoftLayer provides Utilities to make xCAT work in a SoftLayer environment.
%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/%{prefix}/bin
mkdir -p $RPM_BUILD_ROOT/%{prefix}/lib
mkdir -p $RPM_BUILD_ROOT/%{prefix}/lib/python
mkdir -p $RPM_BUILD_ROOT/%{prefix}/lib/python/xcat
mkdir -p $RPM_BUILD_ROOT/%{prefix}/share/xcat/install
#mkdir -p $RPM_BUILD_ROOT/%{prefix}/share/xcat/sysclone/postscripts
mkdir -p $RPM_BUILD_ROOT/%{prefix}/share/doc/packages/xCAT-SoftLayer
@@ -59,6 +62,8 @@ cp -p -R share/xcat/install/* $RPM_BUILD_ROOT/%{prefix}/share/xcat/install/
cp -d bin/* $RPM_BUILD_ROOT/%{prefix}/bin
chmod 755 $RPM_BUILD_ROOT/%{prefix}/bin/*
cp -d lib/python/xcat/* $RPM_BUILD_ROOT/%{prefix}/lib/python/xcat/
#cp -d postscripts/* $RPM_BUILD_ROOT/%{prefix}/share/xcat/sysclone/postscripts
#chmod 755 $RPM_BUILD_ROOT/%{prefix}/share/xcat/sysclone/postscripts/*
+2 -2
View File
@@ -210,11 +210,11 @@ Add product package rpms to a previously built kit tar file. This is used for p
=over 3
=item 0
=item <B>0
The command completed successfully.
=item 1
=item <B>1
An error has occurred.
+2 -3
View File
@@ -180,8 +180,7 @@ if ($::RUNCMD_RC != 0)
exit(1);
}
# check if 9.X release not built by us is installed, setup different
# SLES used default dir
if ( (grep(/postgresql9/, @output)) && ($::linuxos !~ /sles/) ){ # postgresql 9.x
if (grep(/postgresql9/, @output)) { # postgresql 9.x
# figure out which 9.x release and build path
my @parseout= split(/\-/, $output[0]);
my @ptflevel= split ("postgresql9",$parseout[0]);
@@ -987,7 +986,7 @@ sub setupxcatdb
$cmd = "/var/lib/pgsql/bin/psql -d $::dbname -U postgres";
} else { # Linux
$cmd = "$::pgcmddir/psql -d $::dbname -U postgres";
if ( ($debianflag) || ($::linuxos =~ /sles/) ){
if ($debianflag){
$cmd = "su - postgres -c '$::pgcmddir/psql -d $::dbname -U postgres'";
}
}
+6
View File
@@ -59,6 +59,11 @@ if ($::NOEXPAND) { # this is when ppping is calling us and has already expanded
@nodes = split(/,/, $noderange);
}
else { # the normal case of the user running the cmd - expand the noderange using xcatd
my %sslargs;
if (defined($ENV{'XCATSSLVER'})) {
$sslargs{SSL_version} = $ENV{'XCATSSLVER'};
}
my $client = IO::Socket::SSL->new(
PeerAddr=>$xcathost,
SSL_key_file=> xCAT::Utils->getHomeDir()."/.xcat/client-cred.pem",
@@ -66,6 +71,7 @@ else { # the normal case of the user running the cmd - expand the noderange us
SSL_ca_file => xCAT::Utils->getHomeDir()."/.xcat/ca.pem",
SSL_use_cert => 1,
SSL_verify_mode => 1,
%sslargs,
);
die "Connection failure: $!\n" unless ($client);
my %cmdref = (command => 'noderange', noderange => $noderange);
+6
View File
@@ -77,12 +77,18 @@ my $noderange = $ARGV[0];
my @user = getpwuid($>);
my $homedir=$user[7];
my %sslargs;
if (defined($ENV{'XCATSSLVER'})) {
$sslargs{SSL_version} = $ENV{'XCATSSLVER'};
}
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,
%sslargs,
#SSL_verify_mode => 1,
);
die "Connection failure: $!\n" unless ($client);
-1
View File
@@ -137,7 +137,6 @@ sub processoutput { #This way, one arbiter handles output, no interrupting
sub scpnode {
my $inputs = shift;
my $nodehdl = shift;
my $out = shift;
my $node = shift;
my $in;
#my $args = join(" ",@_);
+1 -1
View File
@@ -52,7 +52,7 @@ if [ -n "$2" ]; then
fi
fi
if [ -x "/opt/confluent/bin/confetty" ] || [ -x "/usr/bin/confetty" ]; then
if [ -x "/opt/confluent/bin/confetty" ] || [ -x "/usr/bin/confetty" ] || [ -x "/usr/local/bin/confetty" ]; then
#use confluent
CONFETTY="confetty"
if [ -x "/opt/confluent/bin/confetty" ]; then
+12 -3
View File
@@ -18,9 +18,11 @@ my $sb;
my $tilefact;
my $xrm="-xrm xterm.mainMenu.*.font:fixed -xrm xterm.vtMenu.*.font:fixed -xrm xterm.fontMenu.*.font:fixed -xrm xterm -xrm xterm.vt100.font6:grvga.737";
my $font = "5x7";
my $sizegeometry;
GetOptions(
#'sb' => \$sb,
'tile|t:i' => \$tilefact,
'geometry|g:s' => \$sizegeometry,
#'font|f=s' => \$font
);
my $noderange = $ARGV[$#ARGV];
@@ -104,7 +106,8 @@ if (defined($tilefact)) {
$ENV{CONSCONTROLPATH} = "/tmp/wconscontrol.$firstnode.$$";
system("xterm $xrm -bg black -fg white -title $firstnode -n $firstnode -geometry +0+0 ".join(" ",@ARGV)." -e /bin/bash -c \"$mydir/xtcd.pl ".$ENV{DISPLAY}." $firstnode $firstnode & let SDATE=`date +%s`+5; $mydir/rcons $firstnode ".$conservers{$firstnode}."; if [ \\\$SDATE -gt \\`date +%s\\` ]; then echo Press enter to close; read SDATE; fi \" &");
system("xterm $xrm -bg black -fg white -title $firstnode -n $firstnode -geometry $sizegeometry+0+0 ".join(" ",@ARGV)." -e /bin/bash -c \"/bin/true ".$ENV{DISPLAY}." $firstnode $firstnode & let SDATE=`date +%s`+5; $mydir/rcons $firstnode ".$conservers{$firstnode}."; if [ \\\$SDATE -gt \\`date +%s\\` ]; then echo Press enter to close; read SDATE; fi \" &");
$ENV{CONSCONTROLPATH} = "";
my $remainwait = 2;
while (not -S "/tmp/wconscontrol.$firstnode.$$" and $remainwait > 0) {
sleep(0.1);
@@ -154,7 +157,11 @@ if (defined($tilefact)) {
$currx=0;
}
} else {
system("xterm $xrm -bg black -fg white -title $firstnode -n $firstnode ".join(" ",@ARGV)." -e /bin/bash -c \"$mydir/xtcd.pl ".$ENV{DISPLAY}." $firstnode $firstnode & let SDATE=`date +%s`+5; $mydir/rcons $firstnode ".$conservers{$firstnode}."; if [ \\\$SDATE -gt \\`date +%s\\` ]; then echo Press enter to close; read SDATE; fi\" &");
my $geo;
if ($sizegeometry) {
$geo = "-g $sizegeometry ";
}
system("xterm $xrm $geo-bg black -fg white -title $firstnode -n $firstnode ".join(" ",@ARGV)." -e /bin/bash -c \"$mydir/xtcd.pl ".$ENV{DISPLAY}." $firstnode $firstnode & let SDATE=`date +%s`+5; $mydir/rcons $firstnode ".$conservers{$firstnode}."; if [ \\\$SDATE -gt \\`date +%s\\` ]; then echo Press enter to close; read SDATE; fi\" &");
}
my $geometry="";
@@ -162,7 +169,7 @@ foreach (@nodes) {
if ($tilefact) {
my $corrected_x=$currx+$wmxo;
my $corrected_y=$curry+$wmyo;
$geometry="-geometry +$corrected_x+$corrected_y";
$geometry="-geometry $sizegeometry+$corrected_x+$corrected_y";
$currx+=$window_width;
if ($currx >= ($tilefact * $window_width)) {
$currx=0;
@@ -171,6 +178,8 @@ foreach (@nodes) {
$curry = $panel_pad; #+$top_pad;
}
}
} elsif ($sizegeometry) {
$geometry = "-geometry $sizegeometry";
}
system("xterm $xrm -bg black -fg white ".join(" ",@ARGV)." -title $_ -n $_ $geometry -e /bin/bash -c \"$mydir/xtcd.pl .".$ENV{DISPLAY}." $_ $_ & let SDATE=`date +%s`+5; $mydir/rcons $_ ".$conservers{$_}."; if [ \\\$SDATE -gt \\`date +%s\\` ]; then echo Press enter to close; read SDATE; fi\" &");
+24
View File
@@ -97,3 +97,27 @@ opt/xcat/bin/xcatclientnnr opt/xcat/bin/rmkitcomp
opt/xcat/bin/xcatclientnnr opt/xcat/bin/chkkitcomp
opt/xcat/bin/xcatclientnnr opt/xcat/bin/lskitdeployparam
opt/xcat/bin/xcatclient opt/xcat/bin/postage
opt/xcat/bin/xcatclient opt/xcat/bin/cfghost
opt/xcat/bin/xcatclientnnr opt/xcat/bin/cfgve
opt/xcat/bin/xcatclientnnr opt/xcat/bin/chzone
opt/xcat/bin/xcatclientnnr opt/xcat/bin/configfpc
opt/xcat/bin/xcatclientnnr opt/xcat/bin/geninitrd
opt/xcat/bin/xcatclientnnr opt/xcat/bin/lskmodules
opt/xcat/bin/xcatclientnnr opt/xcat/bin/lsve
opt/xcat/bin/xcatclientnnr opt/xcat/bin/mkzone
opt/xcat/bin/xcatclientnnr opt/xcat/bin/nodeaddunmged
opt/xcat/bin/xcatclient opt/xcat/bin/nodechmac
opt/xcat/bin/xcatclient opt/xcat/bin/nodechprofile
opt/xcat/bin/xcatclientnnr opt/xcat/bin/nodediscoverdef
opt/xcat/bin/xcatclientnnr opt/xcat/bin/nodediscoverls
opt/xcat/bin/xcatclientnnr opt/xcat/bin/nodediscoverstart
opt/xcat/bin/xcatclientnnr opt/xcat/bin/nodediscoverstatus
opt/xcat/bin/xcatclientnnr opt/xcat/bin/nodediscoverstop
opt/xcat/bin/xcatclientnnr opt/xcat/bin/nodeimport
opt/xcat/bin/xcatclient opt/xcat/bin/nodepurge
opt/xcat/bin/xcatclient opt/xcat/bin/noderefresh
opt/xcat/bin/xcatclient opt/xcat/bin/noderegenips
opt/xcat/bin/xcatclientnnr opt/xcat/bin/rmosdistro
opt/xcat/bin/xcatclientnnr opt/xcat/bin/rmzone
opt/xcat/bin/xcatclientnnr opt/xcat/bin/slpdiscover
opt/xcat/bin/xcatclient opt/xcat/bin/xCATWorld
+15 -1
View File
@@ -134,12 +134,22 @@ To import nodes using a profile, follow the following steps:
cec=mycec
lparid=2
# Node information file ends.
Example of a node information file that specifies a PowerKVM Guest node that uses KVM management:
# Node information file begins
# This entry defines a PowerKVM Guest node.
# Make sure the node 'vm01' is already created on Hypervisor
vm01:
mac=b8:ef:3f:28:31:15
vmhost=pkvm1
# Node information file ends.
The node information file includes the following items:
B<__hostname__:> This is a mandatory item.
Description: The name of the node, where __hostname__ is automatically generated by the node name format. You can also input a fixed node name, for example compute-node.
Description: The name of the node, where __hostname__ is automatically generated by the node name format. You can also input a fixed node name, for example "compute-node".
B<mac=<mac-address>> This is a mandatory item.
@@ -185,6 +195,10 @@ B<unit=<rack-server-unit-location>> This is an optional item.
Description: node location info, for rack server only. Specify the node's start unit number in rack, in U. this item must be specified together with rack and height.
B<vmhost=<PowerKVM Hypervisior Host Name>> This is a mandatory option for defining PowerKVM Guest nodes.
Description: Specifies the vmhost of a Power KVM Guest node, where <vmhost> is the host name of PowerKVM Hypervisior.
3. Import the nodes, by using the following commands. Note: If we want to import PureFlex X/P nodes, hardware profile must be set to a PureFlex hardware type.
nodeimport file=/root/hostinfo.txt networkprofile=default_cn imageprofile=rhels6.3_packaged hostnameformat=compute-#NNN
+110 -16
View File
@@ -27,17 +27,38 @@ B<Power 7 server specific :>
=over 2
B<renergy> I<noderange> [-V] { all | [savingstatus] [dsavingstatus]
[cappingstatus] [cappingmaxmin] [cappingvalue] [cappingsoftmin]
[averageAC] [averageDC] [ambienttemp] [exhausttemp] [CPUspeed]
[syssbpower] [sysIPLtime] [fsavingstatus] [ffoMin] [ffoVmin]
[ffoTurbo] [ffoNorm] [ffovalue]}
B<renergy> I<noderange> [-V] { savingstatus={on | off}
| dsavingstatus={on-norm | on-maxp | off}
| fsavingstatus={on | off} | ffovalue=MHZ
| cappingstatus={on | off} | cappingwatt=watt
| cappingperc=percentage }
=back
B<Power 8 server specific :>
=over 2
B<renergy> I<noderange> [-V] { all | [savingstatus] [dsavingstatus]
[cappingstatus] [cappingmaxmin] [cappingvalue] [cappingsoftmin]
[averageAC] [averageDC] [ambienttemp] [exhausttemp] [CPUspeed]
[averageAC] [averageAChistory] [averageDC] [averageDChistory]
[ambienttemp] [ambienttemphistory] [exhausttemp] [exhausttemphistory]
[fanspeed] [fanspeedhistory] [CPUspeed] [CPUspeedhistory]
[syssbpower] [sysIPLtime] [fsavingstatus] [ffoMin] [ffoVmin]
[ffoTurbo] [ffoNorm] [ffovalue]}
B<renergy> I<noderange> [-V] { savingstatus={on | off}
| dsavingstatus={on-norm | on-maxp | off}
| fsavingstatus={on | off} | ffovalue=MHZ
| cappingstatus={on | off} | cappingwatt=watt
| cappingperc=percentage }
| fsavingstatus={on | off} | ffovalue=MHZ }
I<NOTE:> The setting operation for B<Power 8> server is only supported
for the server which is running in PowerVM mode. Do NOT run the setting
for the server which is running in OPAL mode.
=back
@@ -127,10 +148,11 @@ user can query and set the power saving and power capping status, and also can
query the average consumed energy, the ambient and exhaust temperature,
the processor frequency for a server.
B<renergy> command supports IBM POWER6 and POWER7 rack-mounted servers,
B<renergy> command supports IBM POWER6, POWER7 and POWER8 rack-mounted servers,
BladeCenter management modules, blade servers, and iDataPlex servers.
For system p rack-mounted servers, the following specific hardware types are supported:
For I<Power6> and I<Power7> rack-mounted servers, the following specific hardware types are supported:
I<8203-E4A>, I<8204-E8A>, I<9125-F2A>, I<8233-E8B>, I<8236-E8C>.
For I<Power8> server, there's no hardware type restriction.
The parameter I<noderange> needs to be specified for the B<renergy> command to
get the target servers. The I<noderange> should be a list of CEC node names, blade
@@ -234,11 +256,13 @@ will get response immediately.
=head1 B<PREREQUISITES>
For the system p nodes, the B<renergy> command depends
For the I<Power6> and I<Power7> nodes, the B<renergy> command depends
on the Energy Management Plugin B<xCAT-pEnergy> to
communicate with server. B<xCAT-pEnergy> can be downloaded from the IBM web site:
http://www.ibm.com/support/fixcentral/. (Other Software -> EM)
NOTE: I<Power8> nodes don't need this specific energy management package.
For iDataPlex nodes, the B<renergy> command depends
on the Energy Management Plugin B<xCAT-xEnergy> to
communicate with server. This plugin must be requested from IBM.
@@ -262,12 +286,14 @@ Display the version information.
Verbose output.
=item B<all>
Query all energy attributes which supported by the specific
type of hardware.
For I<Power8> machines, will not display the attributes
for historical records.
=item B<pd1all>
Query all energy attributes of the power domain 1 for blade
@@ -282,6 +308,10 @@ management module node.
Query the current ambient temperature. (Unit is centigrade)
=item B<ambienttemphistory>
Query the historical records which were generated in last one hour for B<ambienttemp>.
=item B<availableDC>
Query the total DC power available for the entire blade center chassis.
@@ -298,10 +328,18 @@ averageAC is the total AC power being consumed by all modules
in the chassis. It also includes power consumed by the Chassis
Cooling Devices for BCH chassis.
=item B<averageAChistory>
Query the historical records which were generated in last one hour for B<averageAC>.
=item B<averageDC>
Query the average power consumed (Output). (Unit is watt)
=item B<averageDChistory>
Query the historical records which were generated in last one hour for B<averageDC>.
=item B<capability>
Query the Power Capabilities of the blade server.
@@ -380,6 +418,10 @@ guaranteed.
Query the effective processor frequency. (Unit is MHz)
=item B<CPUspeedhistory>
Query the historical records which were generated in last one hour for B<CPUspeed>
=item B<dsavingstatus>
Query the dynamic power saving status. The result should
@@ -410,6 +452,21 @@ B<savingstatus> is in turn off status.
Query the current exhaust temperature. (Unit is centigrade)
=item B<exhausttemphistory>
Query the historical records which were generated in last one hour for B<exhausttemp>
=item B<fanspeed>
Query the fan speed for all the fans which installed in this node. (Unit is RPM - Rotations Per Minute))
If there are multiple fans for a node, multiple lines will be output. And a fan name in bracket will be
appended after B<fanspped> attribute name.
=item B<fanspeedhistory>
Query the historical records which were generated in last one hour for B<fanspeed>.
=item B<ffoMin>
Query the minimum cpu frequency which can be set for FFO. (Fixed
@@ -455,7 +512,7 @@ The ffovalue setting operation needs about 1 minute to take effect.
Query the status of FFO. The result should be 'on' or 'off'.
'on' - enable; 'off' - disable.
=item B<fsavingstatus>={B<on> B<off>}
=item B<fsavingstatus>={B<on> | B<off>}
Set the status of FFO. The value must be 'on' or 'off'.
@@ -574,7 +631,7 @@ Query the time used from FSP standby to OS standby.
=item B<syssbpower>
Query the system power consumed prior to power on.
(Unit is MHz)
(Unit is Watt)
=item B<thermaloutput>
@@ -595,7 +652,7 @@ center chassis.
=item 1
Query all the attributes which CEC1,CEC2 supported.
Query all attributes which CEC1,CEC2 supported.
B<renergy> CEC1,CEC2 all
@@ -629,6 +686,43 @@ The output of the query operation:
=item 2
Query the B<fanspeed> attribute for Power8 CEC.
B<renergy> CEC1 fanspeed
The output of the query operation:
CEC1: fanspeed (Fan U78CB.001.WZS00MA-A1 00002101): 5947 RPM
CEC1: fanspeed (Fan U78CB.001.WZS00MA-A2 00002103): 6081 RPM
CEC1: fanspeed (Fan U78CB.001.WZS00MA-A3 00002105): 6108 RPM
CEC1: fanspeed (Fan U78CB.001.WZS00MA-A4 00002107): 6000 RPM
CEC1: fanspeed (Fan U78CB.001.WZS00MA-A5 00002109): 6013 RPM
CEC1: fanspeed (Fan U78CB.001.WZS00MA-A6 0000210B): 6013 RPM
CEC1: fanspeed (Fan U78CB.001.WZS00MA-E1 0000210C): 4992 RPM
CEC1: fanspeed (Fan U78CB.001.WZS00MA-E2 0000210D): 5016 RPM
=item 3
Query the historical records for the B<CPUspeed> attribute. (Power8 CEC)
B<renergy> CEC1 CPUspeedhistory
The output of the query operation:
CEC1: CPUspeedhistory: 2027 MHZ: 20141226042900
CEC1: CPUspeedhistory: 2027 MHZ: 20141226042930
CEC1: CPUspeedhistory: 2244 MHZ: 20141226043000
CEC1: CPUspeedhistory: 2393 MHZ: 20141226043030
CEC1: CPUspeedhistory: 2393 MHZ: 20141226043100
CEC1: CPUspeedhistory: 2393 MHZ: 20141226043130
CEC1: CPUspeedhistory: 2393 MHZ: 20141226043200
CEC1: CPUspeedhistory: 2393 MHZ: 20141226043230
CEC1: CPUspeedhistory: 2393 MHZ: 20141226043300
CEC1: CPUspeedhistory: 2393 MHZ: 20141226043330
...
=item 4
Query all the attirbutes for management module node MM1. (For chassis)
B<renergy> MM1 all
@@ -658,7 +752,7 @@ The output of the query operation:
in this power domain.
mm1: thermaloutput: 9717.376000 BTU/hour
=item 3
=item 5
Query all the attirbutes for blade server node blade1.
@@ -674,7 +768,7 @@ The output of the query operation:
blade1: maxCPUspeed: 4204MHZ
blade1: savingstatus: off
=item 4
=item 6
Query the attributes savingstatus, cappingstatus
and CPUspeed for server CEC1.
@@ -687,7 +781,7 @@ The output of the query operation:
CEC1: cappingstatus: on
CEC1: CPUspeed: 3621 MHz
=item 5
=item 7
Turn on the power saving function of CEC1.
@@ -698,7 +792,7 @@ The output of the setting operation:
CEC1: Set savingstatus succeeded.
CEC1: This setting may need some minutes to take effect.
=item 6
=item 8
Set the power capping value base on the percentage of the
max-min capping value. Here, set it to 50%.
-2
View File
@@ -86,8 +86,6 @@ Reboot the service processor. If there are primary and secondary FSPs/BPAs of on
Attempt to request clean shutdown of OS (may not detect failures in completing command)
For stateless osimage, the 'acpid' package needs to be added to the .pkglist configuration file for the stateless osimage to enable the 'softoff' function.
=item B<off>
Turn power off.
+8
View File
@@ -294,6 +294,14 @@ export XCATROOT PATH MANPATH
export PERL_BADLANG=0
EOF
# export XCATSSLVER for sles11. Others OS can work without this setting.
if [ -r /etc/SuSE-release ]; then
ver=`grep 'VERSION' /etc/SuSE-release | awk -F= '{print $2}' | sed 's/ //g'`
if [ "$ver" = "11" ]; then
echo 'export XCATSSLVER=TLSv1' >> /etc/profile.d/xcat.sh
fi
fi
cat << EOF > /etc/profile.d/xcat.csh
setenv XCATROOT "$RPM_INSTALL_PREFIX0"
setenv PATH \${XCATROOT}/bin:\${XCATROOT}/sbin:\${XCATROOT}/share/xcat/tools:\${PATH}
+326
View File
@@ -0,0 +1,326 @@
<html xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:w="urn:schemas-microsoft-com:office:word"
xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
<meta name=ProgId content=Word.Document>
<meta name=Generator content="Microsoft Word 9">
<meta name=Originator content="Microsoft Word 9">
<title>Eclipse Public License - Version 1.0</title>
<!--[if gte mso 9]><xml>
<o:DocumentProperties>
<o:Revision>2</o:Revision>
<o:TotalTime>3</o:TotalTime>
<o:Created>2004-03-05T23:03:00Z</o:Created>
<o:LastSaved>2004-03-05T23:03:00Z</o:LastSaved>
<o:Pages>4</o:Pages>
<o:Words>1626</o:Words>
<o:Characters>9270</o:Characters>
<o:Lines>77</o:Lines>
<o:Paragraphs>18</o:Paragraphs>
<o:CharactersWithSpaces>11384</o:CharactersWithSpaces>
<o:Version>9.4402</o:Version>
</o:DocumentProperties>
</xml><![endif]--><!--[if gte mso 9]><xml>
<w:WordDocument>
<w:TrackRevisions/>
</w:WordDocument>
</xml><![endif]-->
<style>
<!--
/* Font Definitions */
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;
mso-font-charset:0;
mso-generic-font-family:swiss;
mso-font-pitch:variable;
mso-font-signature:553679495 -2147483648 8 0 66047 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{mso-style-parent:"";
margin:0in;
margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:12.0pt;
font-family:"Times New Roman";
mso-fareast-font-family:"Times New Roman";}
p
{margin-right:0in;
mso-margin-top-alt:auto;
mso-margin-bottom-alt:auto;
margin-left:0in;
mso-pagination:widow-orphan;
font-size:12.0pt;
font-family:"Times New Roman";
mso-fareast-font-family:"Times New Roman";}
p.BalloonText, li.BalloonText, div.BalloonText
{mso-style-name:"Balloon Text";
margin:0in;
margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:8.0pt;
font-family:Tahoma;
mso-fareast-font-family:"Times New Roman";}
@page Section1
{size:8.5in 11.0in;
margin:1.0in 1.25in 1.0in 1.25in;
mso-header-margin:.5in;
mso-footer-margin:.5in;
mso-paper-source:0;}
div.Section1
{page:Section1;}
-->
</style>
</head>
<body lang=EN-US style='tab-interval:.5in'>
<div class=Section1>
<p align=center style='text-align:center'><b>Eclipse Public License - v 1.0</b>
</p>
<p><span style='font-size:10.0pt'>THE ACCOMPANYING PROGRAM IS PROVIDED UNDER
THE TERMS OF THIS ECLIPSE PUBLIC LICENSE (&quot;AGREEMENT&quot;). ANY USE,
REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE
OF THIS AGREEMENT.</span> </p>
<p><b><span style='font-size:10.0pt'>1. DEFINITIONS</span></b> </p>
<p><span style='font-size:10.0pt'>&quot;Contribution&quot; means:</span> </p>
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
in the case of the initial Contributor, the initial code and documentation
distributed under this Agreement, and<br clear=left>
b) in the case of each subsequent Contributor:</span></p>
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
changes to the Program, and</span></p>
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
additions to the Program;</span></p>
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>where
such changes and/or additions to the Program originate from and are distributed
by that particular Contributor. A Contribution 'originates' from a Contributor
if it was added to the Program by such Contributor itself or anyone acting on
such Contributor's behalf. Contributions do not include additions to the
Program which: (i) are separate modules of software distributed in conjunction
with the Program under their own license agreement, and (ii) are not derivative
works of the Program. </span></p>
<p><span style='font-size:10.0pt'>&quot;Contributor&quot; means any person or
entity that distributes the Program.</span> </p>
<p><span style='font-size:10.0pt'>&quot;Licensed Patents &quot; mean patent
claims licensable by a Contributor which are necessarily infringed by the use
or sale of its Contribution alone or when combined with the Program. </span></p>
<p><span style='font-size:10.0pt'>&quot;Program&quot; means the Contributions
distributed in accordance with this Agreement.</span> </p>
<p><span style='font-size:10.0pt'>&quot;Recipient&quot; means anyone who
receives the Program under this Agreement, including all Contributors.</span> </p>
<p><b><span style='font-size:10.0pt'>2. GRANT OF RIGHTS</span></b> </p>
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
Subject to the terms of this Agreement, each Contributor hereby grants Recipient
a non-exclusive, worldwide, royalty-free copyright license to<span
style='color:red'> </span>reproduce, prepare derivative works of, publicly
display, publicly perform, distribute and sublicense the Contribution of such
Contributor, if any, and such derivative works, in source code and object code
form.</span></p>
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
Subject to the terms of this Agreement, each Contributor hereby grants
Recipient a non-exclusive, worldwide,<span style='color:green'> </span>royalty-free
patent license under Licensed Patents to make, use, sell, offer to sell, import
and otherwise transfer the Contribution of such Contributor, if any, in source
code and object code form. This patent license shall apply to the combination
of the Contribution and the Program if, at the time the Contribution is added
by the Contributor, such addition of the Contribution causes such combination
to be covered by the Licensed Patents. The patent license shall not apply to
any other combinations which include the Contribution. No hardware per se is
licensed hereunder. </span></p>
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>c)
Recipient understands that although each Contributor grants the licenses to its
Contributions set forth herein, no assurances are provided by any Contributor
that the Program does not infringe the patent or other intellectual property
rights of any other entity. Each Contributor disclaims any liability to Recipient
for claims brought by any other entity based on infringement of intellectual
property rights or otherwise. As a condition to exercising the rights and
licenses granted hereunder, each Recipient hereby assumes sole responsibility
to secure any other intellectual property rights needed, if any. For example,
if a third party patent license is required to allow Recipient to distribute
the Program, it is Recipient's responsibility to acquire that license before
distributing the Program.</span></p>
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>d)
Each Contributor represents that to its knowledge it has sufficient copyright
rights in its Contribution, if any, to grant the copyright license set forth in
this Agreement. </span></p>
<p><b><span style='font-size:10.0pt'>3. REQUIREMENTS</span></b> </p>
<p><span style='font-size:10.0pt'>A Contributor may choose to distribute the
Program in object code form under its own license agreement, provided that:</span>
</p>
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
it complies with the terms and conditions of this Agreement; and</span></p>
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
its license agreement:</span></p>
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
effectively disclaims on behalf of all Contributors all warranties and
conditions, express and implied, including warranties or conditions of title
and non-infringement, and implied warranties or conditions of merchantability
and fitness for a particular purpose; </span></p>
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
effectively excludes on behalf of all Contributors all liability for damages,
including direct, indirect, special, incidental and consequential damages, such
as lost profits; </span></p>
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iii)
states that any provisions which differ from this Agreement are offered by that
Contributor alone and not by any other party; and</span></p>
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iv)
states that source code for the Program is available from such Contributor, and
informs licensees how to obtain it in a reasonable manner on or through a
medium customarily used for software exchange.<span style='color:blue'> </span></span></p>
<p><span style='font-size:10.0pt'>When the Program is made available in source
code form:</span> </p>
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
it must be made available under this Agreement; and </span></p>
<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b) a
copy of this Agreement must be included with each copy of the Program. </span></p>
<p><span style='font-size:10.0pt'>Contributors may not remove or alter any
copyright notices contained within the Program. </span></p>
<p><span style='font-size:10.0pt'>Each Contributor must identify itself as the
originator of its Contribution, if any, in a manner that reasonably allows
subsequent Recipients to identify the originator of the Contribution. </span></p>
<p><b><span style='font-size:10.0pt'>4. COMMERCIAL DISTRIBUTION</span></b> </p>
<p><span style='font-size:10.0pt'>Commercial distributors of software may
accept certain responsibilities with respect to end users, business partners
and the like. While this license is intended to facilitate the commercial use
of the Program, the Contributor who includes the Program in a commercial
product offering should do so in a manner which does not create potential
liability for other Contributors. Therefore, if a Contributor includes the
Program in a commercial product offering, such Contributor (&quot;Commercial
Contributor&quot;) hereby agrees to defend and indemnify every other
Contributor (&quot;Indemnified Contributor&quot;) against any losses, damages and
costs (collectively &quot;Losses&quot;) arising from claims, lawsuits and other
legal actions brought by a third party against the Indemnified Contributor to
the extent caused by the acts or omissions of such Commercial Contributor in
connection with its distribution of the Program in a commercial product
offering. The obligations in this section do not apply to any claims or Losses
relating to any actual or alleged intellectual property infringement. In order
to qualify, an Indemnified Contributor must: a) promptly notify the Commercial
Contributor in writing of such claim, and b) allow the Commercial Contributor
to control, and cooperate with the Commercial Contributor in, the defense and
any related settlement negotiations. The Indemnified Contributor may participate
in any such claim at its own expense.</span> </p>
<p><span style='font-size:10.0pt'>For example, a Contributor might include the
Program in a commercial product offering, Product X. That Contributor is then a
Commercial Contributor. If that Commercial Contributor then makes performance
claims, or offers warranties related to Product X, those performance claims and
warranties are such Commercial Contributor's responsibility alone. Under this
section, the Commercial Contributor would have to defend claims against the
other Contributors related to those performance claims and warranties, and if a
court requires any other Contributor to pay any damages as a result, the
Commercial Contributor must pay those damages.</span> </p>
<p><b><span style='font-size:10.0pt'>5. NO WARRANTY</span></b> </p>
<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
AGREEMENT, THE PROGRAM IS PROVIDED ON AN &quot;AS IS&quot; BASIS, WITHOUT
WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING,
WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
responsible for determining the appropriateness of using and distributing the
Program and assumes all risks associated with its exercise of rights under this
Agreement , including but not limited to the risks and costs of program errors,
compliance with applicable laws, damage to or loss of data, programs or
equipment, and unavailability or interruption of operations. </span></p>
<p><b><span style='font-size:10.0pt'>6. DISCLAIMER OF LIABILITY</span></b> </p>
<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF
THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF
THE POSSIBILITY OF SUCH DAMAGES.</span> </p>
<p><b><span style='font-size:10.0pt'>7. GENERAL</span></b> </p>
<p><span style='font-size:10.0pt'>If any provision of this Agreement is invalid
or unenforceable under applicable law, it shall not affect the validity or
enforceability of the remainder of the terms of this Agreement, and without
further action by the parties hereto, such provision shall be reformed to the
minimum extent necessary to make such provision valid and enforceable.</span> </p>
<p><span style='font-size:10.0pt'>If Recipient institutes patent litigation
against any entity (including a cross-claim or counterclaim in a lawsuit)
alleging that the Program itself (excluding combinations of the Program with
other software or hardware) infringes such Recipient's patent(s), then such
Recipient's rights granted under Section 2(b) shall terminate as of the date
such litigation is filed. </span></p>
<p><span style='font-size:10.0pt'>All Recipient's rights under this Agreement
shall terminate if it fails to comply with any of the material terms or
conditions of this Agreement and does not cure such failure in a reasonable
period of time after becoming aware of such noncompliance. If all Recipient's
rights under this Agreement terminate, Recipient agrees to cease use and
distribution of the Program as soon as reasonably practicable. However,
Recipient's obligations under this Agreement and any licenses granted by
Recipient relating to the Program shall continue and survive. </span></p>
<p><span style='font-size:10.0pt'>Everyone is permitted to copy and distribute
copies of this Agreement, but in order to avoid inconsistency the Agreement is
copyrighted and may only be modified in the following manner. The Agreement
Steward reserves the right to publish new versions (including revisions) of
this Agreement from time to time. No one other than the Agreement Steward has
the right to modify this Agreement. The Eclipse Foundation is the initial
Agreement Steward. The Eclipse Foundation may assign the responsibility to
serve as the Agreement Steward to a suitable separate entity. Each new version
of the Agreement will be given a distinguishing version number. The Program
(including Contributions) may always be distributed subject to the version of
the Agreement under which it was received. In addition, after a new version of
the Agreement is published, Contributor may elect to distribute the Program
(including its Contributions) under the new version. Except as expressly stated
in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to
the intellectual property of any Contributor under this Agreement, whether
expressly, by implication, estoppel or otherwise. All rights in the Program not
expressly granted under this Agreement are reserved.</span> </p>
<p><span style='font-size:10.0pt'>This Agreement is governed by the laws of the
State of New York and the intellectual property laws of the United States of
America. No party to this Agreement will bring a legal action under this
Agreement more than one year after the cause of action arose. Each party waives
its rights to a jury trial in any resulting litigation.</span> </p>
<p class=MsoNormal><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>
</div>
</body>
</html>
@@ -0,0 +1,2 @@
#!/bin/bash
exec /opt/xcat/share/xcat/cons/hmc $CONFLUENT_NODE
@@ -0,0 +1,2 @@
#!/bin/bash
exec /opt/xcat/share/xcat/cons/kvm $CONFLUENT_NODE
+58
View File
@@ -0,0 +1,58 @@
Summary: xCAT integration with confluent systems management server
Name: xCAT-confluent
Version: %(cat Version)
Release: snap%(date +"%Y%m%d%H%M")
Epoch: 4
License: EPL
Group: Applications/System
Source: xCAT-confluent-%(cat Version).tar.gz
Packager: IBM Corp.
Vendor: IBM Corp.
Distribution: %{?_distribution:%{_distribution}}%{!?_distribution:%{_vendor}}
Prefix: /opt/xcat
BuildRoot: /var/tmp/%{name}-%{version}-%{release}-root
%ifos linux
BuildArch: noarch
%endif
Requires: confluent_server
Provides: xCAT-confluent = %{epoch}:%{version}
%description
xCAT confluent provides the necessary integration pieces to utilize the confluent
system management server
%prep
%setup -q -n xCAT-confluent
%build
# Convert pods to man pages and html pages
#./xpod2man
%install
rm -rf $RPM_BUILD_ROOT
# Uncomment the following line if we ship bin files
# mkdir -p $RPM_BUILD_ROOT/%{prefix}/bin
# cp -d bin/* $RPM_BUILD_ROOT/%{prefix}/bin/
# chmod 755 $RPM_BUILD_ROOT/%{prefix}/bin/*
mkdir -p $RPM_BUILD_ROOT/opt/confluent
cp -dr confluent/* $RPM_BUILD_ROOT/opt/confluent/
#cp share/man/man1/* $RPM_BUILD_ROOT/%{prefix}/share/man/man1
#chmod 444 $RPM_BUILD_ROOT/%{prefix}/share/man/man1/*
#cp share/doc/man1/* $RPM_BUILD_ROOT/%{prefix}/share/doc/man1
#chmod 644 $RPM_BUILD_ROOT/%{prefix}/share/doc/man1/*
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root)
# Uncomment the following line if we ship bin files
# %{prefix}
/opt/confluent
%post
+214
View File
@@ -0,0 +1,214 @@
#!/usr/bin/perl
# IBM(c) 2007 EPL license http://www.eclipse.org/legal/epl-v10.html
# First builds the xCAT summary man page from Synopsis of each man page.
# Then converts all of the pod man pages into html (including links to each other)
# We assume that this script is run in the xCAT-vlan-2.0 dir, so everything is
# done relative to that.
use strict;
#use lib '.';
use Pod::Man;
use Pod::Html;
my $poddir = 'pods';
my $mandir = 'share/man';
my $htmldir = 'share/doc';
my $cachedir = '/tmp';
my @pods = getPodList($poddir);
#foreach (@pods) { print "$_\n"; } exit;
# Build the cmd overview page.
#writesummarypage("$poddir/man1/xcat.1.pod", @pods);
# Build the man page for each pod.
#mkdir($mandir) or die "Error: could not create $mandir.\n";
print "Converting PODs to man pages...\n";
foreach my $podfile (@pods) {
my $manfile = $podfile;
$manfile =~ s/^$poddir/$mandir/; # change the beginning of the path
$manfile =~ s/\.pod$//; # change the ending
my $mdir = $manfile;
$mdir =~ s|/[^/]*$||; # get rid of the basename part
if (system("mkdir -p $mdir")) { die "Error: could not create $mdir.\n"; }
my ($section) = $podfile =~ /\.(\d+)\.pod$/;
convertpod2man($podfile, $manfile, $section);
}
my @dummyPods = createDummyPods($poddir, \@pods);
# Build the html page for each pod.
#mkdir($htmldir) or die "Error: could not create $htmldir.\n";
print "Converting PODs to HTML pages...\n";
# have to clear the cache, because old entries can cause a problem
unlink("$cachedir/pod2htmd.tmp", "$cachedir/pod2htmi.tmp");
foreach my $podfile (@pods) {
my $htmlfile = $podfile;
$htmlfile =~ s/^$poddir/$htmldir/; # change the beginning of the path
$htmlfile =~ s/\.pod$/\.html/; # change the ending
my $hdir = $htmlfile;
$hdir =~ s|/[^/]*$||; # get rid of the basename part
if (system("mkdir -p $hdir")) { die "Error: could not create $hdir.\n"; }
#print "$podfile, $htmlfile, $poddir, $htmldir\n";
convertpod2html($podfile, $htmlfile, $poddir, $htmldir);
}
# Remove the dummy pods
unlink @dummyPods;
rmdir "$poddir/man7";
exit;
# To enable linking between the cmd man pages and the db man pages, need to:
# grep thru the cmd pods searching for references (L<>) to any section 5 man page
# if that pod does not exist, create an empty one that will satisfy pod2html
# keep track of all dummy pods created, so they can be removed later
sub createDummyPods {
my ($poddir, $pods) = @_;
my $cmd = "grep -r -E 'L<.+\\([57]\\)\\|.+\\.[57]>' " . $poddir;
#print "Running cmd: ", $cmd, "\n";
my @lines = `$cmd`;
if ($?) { print "Error running: $cmd\n"; print join('', @lines); }
#my @lines;
#system($cmd);
my @dummyPods;
foreach my $l (@lines) {
#print "$l\n";
my @matches = $l =~ /L<([^\(]+)\(([57])\)\|\1\.[57]>/g; # get all the matches in the line
# The above line should create the array with every other entry being the man page name
# and every other entry is the section # (5 or 7)
my $cmd;
while ($cmd=shift @matches) {
#foreach my $m (@matches) {
my $section = shift @matches;
my $filename = "$poddir/man$section/$cmd.$section.pod";
#print "$filename\n";
if (!(grep /^$filename$/, @$pods) && !(grep /^$filename$/, @dummyPods)) { push @dummyPods, $filename; }
}
}
# Create these empty files
print "Creating empty linked-to files: ", join(', ', @dummyPods), "\n";
mkdir "$poddir/man7";
foreach my $d (@dummyPods) {
if (!open(TMP, ">>$d")) { warn "Could not create dummy pod file $d ($!)\n"; }
else { close TMP; }
}
return @dummyPods;
}
# Recursively get the list of pod man page files.
sub getPodList {
my $poddir = shift;
my @files;
# 1st get toplevel dir listing
opendir(DIR, $poddir) or die "Error: could not read $poddir.\n";
my @topdir = grep !/^\./, readdir(DIR); # /
close(DIR);
# Now go thru each subdir (these are man1, man3, etc.)
foreach my $mandir (@topdir) {
opendir(DIR, "$poddir/$mandir") or die "Error: could not read $poddir/$mandir.\n";
my @dir = grep !/^\./, readdir(DIR); # /
close(DIR);
foreach my $file (@dir) {
push @files, "$poddir/$mandir/$file";
}
}
return sort @files;
}
# Create the xcat man page that gives a summary description of each xcat cmd.
# Not used.
sub writesummarypage {
my $file = shift; # relative path file name of the man page
# the rest of @_ contains the pod files that describe each cmd
open(FILE, ">$file") or die "Error: could not open $file for writing.\n";
print FILE <<'EOS1';
=head1 NAME
B<xcat> - extreme Cluster Administration Tool.
=head1 DESCRIPTION
Extreme Cluster Administration Toolkit (xCAT). xCAT is a scalable distributed computing management
and provisioning tool that provides a unified interface for hardware control, discovery, and
OS diskful/diskfree deployment.
=head1 XCAT DATABASE
All of the cluster configuration information is in the xCAT database. See L<xcatdb(5)|xcatdb.5> for
descriptions of every table in the database.
=head1 XCAT COMMANDS
What follows is a short description of each xCAT command. To get more information about a particular
command, see its man page. Note that the commands are listed in alphabetical order B<within each section>,
i.e. all the commands in section 1, then the commands in section 3, etc.
=over 12
EOS1
# extract the summary for each cmd from its man page
foreach my $manpage (@_) {
my ($sectionnum) = $manpage =~ /\.(\d+)\.pod$/;
# Suck in the whole file, then we will parse it.
open(MANPAGE, "$manpage") or die "Error: could not open $manpage for reading.\n";
my @contents = <MANPAGE>;
my $wholemanpage = join('', @contents);
close(MANPAGE);
# This regex matches: optional space, =head1, space, title, space, cmd, space, description, newline
my ($cmd, $description) = $wholemanpage =~ /^\s*=head1\s+\S+\s+(\S+)\s+(.+?)\n/si;
if (!defined($cmd)) { print "Warning: $manpage is not in a recognized structure. It will be ignored.\n"; next; }
if (!defined($description)) { print "Warning: $manpage does not have a description for $cmd. It will be ignored.\n"; next; }
$cmd =~ s/^.<(.+)>$/$1/; # if the cmd name has pod formatting around it, strip it off
$description =~ s/^-\s*//; # if the description has a leading hypen, strip it off
print FILE "\n=item L<$cmd($sectionnum)|$cmd.$sectionnum>\n\n".$description."\n";
}
# Artificially add the xcattest cmd, because the xCAT-test rpm will add this
print FILE "\n=item L<xcattest(1)|xcattest.1>\n\nRun automated xCAT test cases.\n";
print FILE <<"EOS3";
=back
EOS3
close FILE;
}
# Create the html page for one pod.
sub convertpod2html {
my ($podfile, $htmlfile, $poddir, $htmldir) = @_;
#TODO: use --css=<stylesheet> and --title=<pagetitle> to make the pages look better
pod2html($podfile,
"--outfile=$htmlfile",
"--podpath=man1",
"--podroot=$poddir",
"--htmldir=$htmldir",
"--recurse",
"--cachedir=$cachedir",
);
}
# Create the man page for one pod.
sub convertpod2man {
my ($podfile, $manfile, $section) = @_;
my $parser = Pod::Man->new(section => $section);
$parser->parse_from_file($podfile, $manfile);
}
@@ -3,9 +3,9 @@
$RES::Condition{'CheckFTPonSN_AIX'} = {
Name => q(CheckFTPonSN_AIX),
ResourceClass => q(IBM.Sensor),
EventExpression => q(String != "ftpd is active"),
EventExpression => q(String ne "ftpd is active"),
EventDescription => q(For AIX only. An event will be generated when the FTP server is down on the service node. There may be other nodes in this management domain such as HMCs. To exclude them, just change the SelectionString to: "ProgramName=='vsftpd' && NodeNameList >< {'hmc1','hmc2}" where hmc1 and hmc2 are the names for the nodes that you want to exclude.),
RearmExpression => q(String == "ftpd is active"),
RearmExpression => q(String eq "ftpd is active"),
RearmDescription => q(A rearm event will be generated when the FTP server is up on the service node.),
SelectionString => q(Name="CheckFTPSensor_AIX"),
ManagementScope => q(4),
@@ -3,9 +3,9 @@
$RES::Condition{'CheckxCATonSN'} = {
Name => q(CheckxCATonSN),
ResourceClass => q(IBM.Sensor),
EventExpression => q(String != "xcatd is ok"),
EventExpression => q(String ne "xcatd is ok"),
EventDescription => q(An event will be generated when xcatd is not working.),
RearmExpression => q(String == "xcatd is ok"),
RearmExpression => q(String eq "xcatd is ok"),
RearmDescription => q(An rearm event will be generated when xcatd resumes working state.),
SelectionString => q(Name="CheckxCATSensor"),
ManagementScope => q(4),
+5
View File
@@ -70,6 +70,11 @@ if ($hmtab) {
exit(1);
}
my $file = "/var/log/consoles/$node";
#use confluent if it is there
if ((-x "/opt/confluent/bin/confetty") || (-x "/usr/bin/confetty")) {
$file = "/var/log/confluent/consoles/$node";
}
#print "file=$file\n";
#if has conserver, goto conserver the execute replaycons command
my @hostinfo=xCAT::NetworkUtils->determinehostname();
+1 -1
View File
@@ -2152,7 +2152,7 @@ sub findme {
my @nodes = ();
my $pbmc_node;
foreach (@$tmp_nodes) {
if ($::XCATPPCHASH{$_}) {
if ($::XCATMPHASH{$_}) {
$pbmc_node = $_;
} else {
push @nodes, $_;
+17 -4
View File
@@ -1195,14 +1195,27 @@ sub getImageitems_for_node
}
# SLES sdk
#Adds SDK repositoryi for sles. The SDKDIR is a comma separated list of
#directory names. For example:
#SDKDIR='/install/sles12/x86_64/sdk1,/install/sles12/x86_64/sdk2'
if ($os =~ /sles.*/)
{
my @sdkdir=();
my $installdir = $::XCATSITEVALS{'installdir'} ? $::XCATSITEVALS{'installdir'} : "/install";
my $sdkdir = "$installdir/$os/$arch/sdk1";
if (-e "$sdkdir")
if (opendir(SRCDIR, "$installdir/$os/$arch/")) {
while (my $tmpfile = readdir(SRCDIR)) {
if ($tmpfile =~ m/^sdk/) {
my $srcdir_sdk = "$installdir/$os/$arch/${tmpfile}";
if ( -d "$srcdir_sdk") {
push @sdkdir, $srcdir_sdk;
}
}
}
}
if (@sdkdir > 0)
{
$result .= "SDKDIR='" . $sdkdir . "'\n";
$result .= "SDKDIR='" . join(',', @sdkdir) . "'\n";
$result .= "export SDKDIR\n";
}
}
+57 -2
View File
@@ -136,7 +136,7 @@ sub subvars {
# append preseed directive lines
while (<PKGLISTFILE>) {
chomp $_;
if (/^\s*#.*/ ){
if ((/^\s*#.*/ ) || ( $_ =~ /^-/ )){
next;
}
$pkglist .= " " . $_;
@@ -248,6 +248,7 @@ sub subvars {
$inc =~ s/#CRYPT:([^:]+):([^:]+):([^#]+)#/crydb($1,$2,$3)/eg;
$inc =~ s/#COMMAND:([^#]+)#/command($1)/eg;
$inc =~ s/#KICKSTARTNET#/kickstartnetwork()/eg;
$inc =~ s/#MIRRORSPEC#/mirrorspec()/eg;
$inc =~ s/#YAST2NET#/yast2network()/eg;
$inc =~ s/#ESXIPV6SETUP#/esxipv6setup()/eg;
$inc =~ s/#WINTIMEZONE#/xCAT::TZUtils::get_wintimezone()/eg;
@@ -272,7 +273,7 @@ sub subvars {
if ($partitionfile && $doneincludes) {
#the content of the specified file is a script which can write partition definition into /tmp/partitionfile
# split the partition file out from the $inc
($inc, $partcontent) = split(/FFFFFFFFFFFFPARTITIONFILESTART/, $inc);
($inc, $partcontent) = split(/FFFFFFFFFFFFPARTITIONFILESTART\n/, $inc);
if ($scriptflag){
# since the whole partition file needs be packaged in %pre first and generate an executable file at running time,
# all the special chars like ',",%,\ need be kept, we have to use the base64 coding to code it and put it in
@@ -741,6 +742,60 @@ sub kickstartnetwork {
return $line;
}
sub mirrorspec{
my $line;
my $ostab = xCAT::Table->new('nodetype');
my %oents = %{$ostab->getNodesAttribs([$node],[qw(os arch profile provmethod)])};
my $ent = $oents{$node}->[0];
my $imagename;
if ($ent and $ent->{provmethod} and ($ent->{provmethod} ne 'install') and ($ent->{provmethod} ne 'netboot') and ($ent->{provmethod} ne 'statelite')) {
$imagename=$ent->{provmethod};
}
unless($imagename){
$tmplerr ="cannot determine the osimage for $node";
return;
}
my $pkgdirval;
my $linuximagetab=xCAT::Table->new('linuximage', -create=>1);
my $ref = $linuximagetab->getAttribs({imagename => $imagename}, 'pkgdir');
if (($ref) && ($ref->{'pkgdir'})) {
$pkgdirval=$ref->{'pkgdir'};
}
my $pkgdir;
my @mirrors;
my @pkgdirlist=split(/,/,$pkgdirval);
foreach (@pkgdirlist){
if($_ =~ /^http|ssh/){
push @mirrors,$_;
}else{
$pkgdir=$_;
}
}
if($pkgdir){
$line .="
d-i mirror/country string manual\n
d-i mirror/protocol string http\n
d-i mirror/http/directory string $pkgdir\n
d-i mirror/http/proxy string\n";
}
if(scalar @mirrors){
my $index=0;
foreach(@mirrors){
$line .= "
d-i apt-setup/local$index/repository string deb $_\n
d-i apt-setup/local$index/comment string online mirror $index\n";
$index=$index+1;
}
}
return $line;
}
sub yast2network {
my $line;
@@ -116,9 +116,10 @@ sub process_request {
if ($command eq 'kitnodeadd' or $command eq 'kitnodeupdate' or $command eq 'kitnoderefresh') {
push @commandslist, ['makehosts', ''];
push @commandslist, ['makedns', ''];
if ($macflag) {
push @commandslist, ['makedhcp', ''];
}
# Remove 'makedhcp' command, nodeset will update dhcp lease file
#if ($macflag) {
# push @commandslist, ['makedhcp', ''];
#}
push @commandslist, ['makeknownhosts', ''];
if ($runconservercmd) {
push @commandslist, ['makeconservercf', ''];
+7 -3
View File
@@ -429,7 +429,7 @@ sub setupInstallloc
{
# update fstab
my $cmd = "grep $master:$installloc $installdir /etc/fstab ";
my $cmd = "grep \"$master:$installloc $installdir\" /etc/fstab ";
xCAT::Utils->runcmd($cmd, -1);
if ($::RUNCMD_RC != 0)
{
@@ -544,9 +544,13 @@ sub setup_DHCP
if (xCAT::Utils->isMN()) { # on the MN
#my @output = xCAT::Utils->runcmd("service dhcpd status", -1);
#if ($::RUNCMD_RC != 0) { # not running
my $retcode= xCAT::Utils->checkservicestatus("dhcpd");
my $dhcpservice = "dhcpd";
if (-e "/etc/init.d/isc-dhcp-server") { #Ubuntu
$dhcpservice = "isc-dhcp-server";
}
my $retcode= xCAT::Utils->checkservicestatus($dhcpservice);
if($retcode!=0){
$rc = xCAT::Utils->startservice("dhcpd");
$rc = xCAT::Utils->startservice($dhcpservice);
if ($rc != 0)
{
return 1;
+1 -1
View File
@@ -547,7 +547,7 @@ sub processArgs
# --nics is the equivalent of -i nicips,nichostnamesuffixes...
if ($::opt_nics) {
$::opt_i="nicips,nichostnamesuffixes,nichostnameprefixes,nictypes,niccustomscripts,nicnetworks,nicaliases";
$::opt_i="nicips,nichostnamesuffixes,nichostnameprefixes,nictypes,niccustomscripts,nicnetworks,nicaliases,nicextraparams";
}
# -i and -s cannot be used together
+73 -219
View File
@@ -745,81 +745,32 @@ sub mknetboot
$kcmdline .= " nonodestatus ";
}
# add one parameter: ifname=<eth0>:<mac address>
# which is used for dracut
# the redhat5.x os will ignore it
my $useifname=0;
#for rhels5.x-ppc64, if installnic="mac", BOOTIF=<mac> should be appended
my $usemac=0;
my $nicname="";
if ($reshash->{$node}->[0] and $reshash->{$node}->[0]->{installnic} and $reshash->{$node}->[0]->{installnic} ne "mac") {
$useifname=1;
#$kcmdline .= "ifname=".$reshash->{$node}->[0]->{installnic} . ":";
$nicname=$reshash->{$node}->[0]->{installnic};
} elsif ($nodebootif) {
$useifname=1;
#$kcmdline .= "ifname=$nodebootif:";
$nicname=$nodebootif;
} elsif ($reshash->{$node}->[0] and $reshash->{$node}->[0]->{primarynic} and $reshash->{$node}->[0]->{primarynic} ne "mac") {
$useifname=1;
#$kcmdline .= "ifname=".$reshash->{$node}->[0]->{primarynic}.":";
$nicname=$reshash->{$node}->[0]->{primarynic};
}else{
if($arch=~ /ppc/)
{
$usemac=1;
}
}
#else { #no, we autodetect and don't presume anything
# $kcmdline .="eth0:";
# print "eth0 is used as the default booting network devices...\n";
#}
# append the mac address
# Add kernel parameters to specify the boot network interface
my $installnic;
my $primarynic;
my $mac;
if( ($usemac || $useifname) && $machash->{$node}->[0] && $machash->{$node}->[0]->{'mac'}) {
# TODO: currently, only "mac" attribute with classic style is used, the "|" delimited string of "macaddress!hostname" format is not used
$mac = $machash->{$node}->[0]->{'mac'};
# if ( (index($mac, "|") eq -1) and (index($mac, "!") eq -1) ) {
#convert to linux format
if ($mac !~ /:/) {
$mac =~s/(..)(..)(..)(..)(..)(..)/$1:$2:$3:$4:$5:$6/;
}
$mac =~ s/!.*//; #remove multi-interface mac information
$mac =~ s/\|.*//;
# } else {
# $callback->({ error=>[ qq{In the "mac" table, the "|" delimited string of "macaddress!hostname" format is not supported by "nodeset <nr> netboot|statelite if installnic/primarynic is set".}], errorcode=>[1]});
# return;
# }
if (defined ($reshash->{$node}->[0]) && $reshash->{$node}->[0]->{installnic}) {
$installnic = $reshash->{$node}->[0]->{installnic};
}
if( ($nicname ne "") and (not xCAT::NetworkUtils->isValidMAC($nicname) )){
if ($useifname && $mac) {
$kcmdline .= "ifname=$nicname:$mac ";
}
$kcmdline .= "netdev=$nicname ";
}else {
if($mac){
$kcmdline .= "BOOTIF=$mac ";
}
if (defined ($reshash->{$node}->[0]) and $reshash->{$node}->[0]->{primarynic}) {
$primarynic = $reshash->{$node}->[0]->{primarynic};
}
if (defined ($machash->{$node}->[0]) && $machash->{$node}->[0]->{'mac'}) {
$mac = xCAT::Utils->parseMacTabEntry($machash->{$node}->[0]->{'mac'}, $node);
}
my $net_params = xCAT::NetworkUtils->gen_net_boot_params($installnic, $primarynic, $mac, $nodebootif);
# add "netdev=<eth0>" or "BOOTIF=<mac>"
# which are used for other scenarios
#my $netdev = "";
#if ($reshash->{$node}->[0] and $reshash->{$node}->[0]->{installnic} and $reshash->{$node}->[0]->{installnic} ne "mac") {
# $kcmdline .= "netdev=" . $reshash->{$node}->[0]->{installnic} . " ";
#} elsif ($nodebootif) {
# $kcmdline .= "netdev=" . $nodebootif . " ";
#} elsif ( $reshash->{$node}->[0] and $reshash->{$node}->[0]->{primarynic} and $reshash->{$node}->[0]->{primarynic} ne "mac") {
# $kcmdline .= "netdev=" . $reshash->{$node}->[0]->{primarynic} . " ";
#} else {
# if ( ($usemac || $useifname) && $mac) {
# $kcmdline .= "BOOTIF=" . $mac . " ";
# }
#}
if (defined ($net_params->{ifname}) || defined ($net_params->{netdev})) {
if (defined ($net_params->{ifname})) {
$kcmdline .= "$net_params->{ifname} ";
}
if ( defined ($net_params->{netdev})) {
$kcmdline .= "$net_params->{netdev} ";
}
} elsif (defined ($net_params->{BOOTIF}) && ($net_params->{setmac} || $arch=~ /ppc/)) {
$kcmdline .= "$net_params->{BOOTIF} ";
}
my %client_nethash = xCAT::DBobjUtils->getNetwkInfo( [$node] );
if ( $client_nethash{$node}{mgtifname} =~ /hf/ )
@@ -998,13 +949,13 @@ sub mkinstall
my $restab = xCAT::Table->new('noderes');
my $bptab = xCAT::Table->new('bootparams',-create=>1);
my $hmtab = xCAT::Table->new('nodehm');
my $mactab = xCAT::Table->new('mac');
my %osents = %{$ostab->getNodesAttribs(\@nodes, ['profile', 'os', 'arch', 'provmethod'])};
my %rents =
%{$restab->getNodesAttribs(\@nodes,
my %rents = %{$restab->getNodesAttribs(\@nodes,
['xcatmaster', 'nfsserver', 'tftpdir', 'primarynic', 'installnic'])};
my %hents =
%{$hmtab->getNodesAttribs(\@nodes,
my %hents = %{$hmtab->getNodesAttribs(\@nodes,
['serialport', 'serialspeed', 'serialflow'])};
my %macents = %{$mactab->getNodesAttribs(\@nodes, ['mac'])};
#my $addkcmdhash =
# $bptab->getNodesAttribs(\@nodes, ['addkcmdline']);
require xCAT::Template;
@@ -1388,15 +1339,8 @@ sub mkinstall
#We have a shot...
my $ent = $rents{$node}->[0];
# $restab->getNodeAttribs($node,
# ['nfsserver', 'primarynic', 'installnic']);
my $sent = $hents{$node}->[0];
# $hmtab->getNodeAttribs(
# $node,
# [
# 'serialport', 'serialspeed', 'serialflow'
# ]
# );
my $macent = $macents{$node}->[0];
my $instserver = $xcatmaster;
if ($ent and $ent->{nfsserver}) {
$instserver=$ent->{nfsserver};
@@ -1408,15 +1352,15 @@ sub mkinstall
$instserver=$ip;
}
}
my $httpprefix=$pkgdir;
if ($installroot =~ /\/$/) {
$httpprefix =~ s/^$installroot/\/install\//;
} else {
$httpprefix =~ s/^$installroot/\/install/;
}
my $httpprefix=$pkgdir;
if ($installroot =~ /\/$/) {
$httpprefix =~ s/^$installroot/\/install\//;
} else {
$httpprefix =~ s/^$installroot/\/install/;
}
my $kcmdline;
my $kversion=$os;
$kversion =~ s/^\D*([\.0-9]+)/$1/;
$kversion =~ s/\.$//;
@@ -1440,63 +1384,27 @@ sub mkinstall
if ($maxmem) {
$kcmdline.=" mem=$maxmem";
}
my $ksdev = "";
if ($ent->{installnic})
{
if ($ent->{installnic} eq "mac")
{
my $mactab = xCAT::Table->new("mac");
my $macref = $mactab->getNodeAttribs($node, ['mac']);
$ksdev = xCAT::Utils->parseMacTabEntry($macref->{mac},$node);
}
else
{
$ksdev = $ent->{installnic};
}
}
elsif ($ent->{primarynic})
{
if ($ent->{primarynic} eq "mac")
{
my $mactab = xCAT::Table->new("mac");
my $macref = $mactab->getNodeAttribs($node, ['mac']);
$ksdev = xCAT::Utils->parseMacTabEntry($macref->{mac},$node);
}
else
{
$ksdev = $ent->{primarynic};
}
}
else
{
$ksdev = "bootif"; #if not specified, fall back to bootif
}
if ($ksdev eq "")
{
$callback->(
{
error => ["No MAC address defined for " . $node],
errorcode => [1]
}
);
}
if($esxi){
$ksdev =~ s/eth/vmnic/g;
}
my $nicname;
if(xCAT::Utils->version_cmp($kversion,"7.0")<0){
$kcmdline .= " ksdevice=" . $ksdev;
}else{
if(xCAT::NetworkUtils->isValidMAC($ksdev)){
$kcmdline .= " BOOTIF=" . $ksdev;
}elsif($ksdev ne "bootif"){
$nicname=$ksdev;
}
}
# Add kernel parameters to specify the boot network interface
if($esxi){
$ent->{installnic} =~ s/eth/vmnic/g;
$ent->{primarynic} =~ s/eth/vmnic/g;
}
my $mac;
if ($macent->{mac}) {
$mac = xCAT::Utils->parseMacTabEntry($macent->{mac}, $node);
}
my $net_params = xCAT::NetworkUtils->gen_net_boot_params($ent->{installnic}, $ent->{primarynic}, $mac);
my $nicname = $net_params->{nicname};
if(xCAT::Utils->version_cmp($kversion,"7.0") < 0){
$kcmdline .= " $net_params->{ksdevice} ";
}elsif ($arch =~ /ppc/) {
$kcmdline .= " $net_params->{BOOTIF} ";
}
#if site.managedaddressmode=static, specify the network configuration as kernel options
#to avoid multicast dhcp
if($::XCATSITEVALS{managedaddressmode} =~ /static/){
@@ -1527,7 +1435,6 @@ sub mkinstall
$kcmdline .= " ifname=$nicname:$mac";
}
$kcmdline .=" ip=$ipaddr"."::"."$gateway".":"."$netmask".":"."$hostname".":"."$nicname".":"."none";
$kcmdline .=" bootdev=$nicname ";
}
@@ -1557,12 +1464,8 @@ sub mkinstall
}
}
}else{
unless(xCAT::Utils->version_cmp($kversion,"7.0")<0){
if($nicname){
$kcmdline .=" ip=$nicname:dhcp ";
}else{
$kcmdline .=" ip=dhcp ";
}
if (xCAT::Utils->version_cmp($kversion,"7.0") >= 0){
$kcmdline .= " $net_params->{ip} ";
}
}
@@ -1684,13 +1587,15 @@ sub mksysclone
my $restab = xCAT::Table->new('noderes');
my $bptab = xCAT::Table->new('bootparams',-create=>1);
my $hmtab = xCAT::Table->new('nodehm');
my $mactab = xCAT::Table->new('mac');
my %osents = %{$ostab->getNodesAttribs(\@nodes, ['profile', 'os', 'arch', 'provmethod'])};
my %rents =
%{$restab->getNodesAttribs(\@nodes,
my %rents = %{$restab->getNodesAttribs(\@nodes,
['xcatmaster', 'nfsserver', 'tftpdir', 'primarynic', 'installnic'])};
my %hents =
%{$hmtab->getNodesAttribs(\@nodes,
my %hents = %{$hmtab->getNodesAttribs(\@nodes,
['serialport', 'serialspeed', 'serialflow'])};
my %macents = %{$mactab->getNodesAttribs(\@nodes, ['mac'])};
my @entries = xCAT::TableUtils->get_site_attribute("xcatdport");
my $port_entry = $entries[0];
my $xcatdport="3001";
@@ -1958,50 +1863,20 @@ sub mksysclone
#We have a shot...
my $ent = $rents{$node}->[0];
my $sent = $hents{$node}->[0];
my $macent = $macents{$node}->[0];
my $kcmdline =
"ramdisk_size=$ramdisk_size";
my $ksdev = "";
if ($ent->{installnic})
{
if ($ent->{installnic} eq "mac")
{
my $mactab = xCAT::Table->new("mac");
my $macref = $mactab->getNodeAttribs($node, ['mac']);
$ksdev = xCAT::Utils->parseMacTabEntry($macref->{mac},$node);
}
else
{
$ksdev = $ent->{installnic};
}
my $kcmdline = "ramdisk_size=$ramdisk_size";
# Add kernel parameters to specify the boot network interface
my $mac;
if ($macent->{mac}) {
$mac = xCAT::Utils->parseMacTabEntry($macent->{mac}, $node);
}
elsif ($ent->{primarynic})
{
if ($ent->{primarynic} eq "mac")
{
my $mactab = xCAT::Table->new("mac");
my $macref = $mactab->getNodeAttribs($node, ['mac']);
$ksdev = xCAT::Utils->parseMacTabEntry($macref->{mac},$node);
}
else
{
$ksdev = $ent->{primarynic};
}
}
else
{
$ksdev = "bootif"; #if not specified, fall back to bootif
}
if ($ksdev eq "")
{
$callback->(
{
error => ["No MAC address defined for " . $node],
errorcode => [1]
}
);
}
$kcmdline .= " ksdevice=" . $ksdev;
my $net_params = xCAT::NetworkUtils->gen_net_boot_params($ent->{installnic}, $ent->{primarynic}, $mac);
$kcmdline .= " $net_params->{ksdevice} ";
if ($arch =~ /ppc/) {
$kcmdline .= " $net_params->{BOOTIF} ";
}
#TODO: dd=<url> for driver disks
if (defined($sent->{serialport}))
@@ -2031,27 +1906,6 @@ sub mksysclone
}
$kcmdline .= " XCAT=$xcatmaster:$xcatdport xcatd=$xcatmaster:$xcatdport SCRIPTNAME=$imagename";
my $nodetab = xCAT::Table->new('nodetype');
my $archref = $nodetab->getNodeAttribs($node, ['arch']);
if ($archref->{arch} eq "ppc64"){
my $mactab = xCAT::Table->new('mac');
my $macref = $mactab->getNodeAttribs($node, ['mac']);
my $formatmac = xCAT::Utils->parseMacTabEntry($macref->{mac},$node);
$formatmac =~ s/:/-/g;
$formatmac = "01-".$formatmac;
$kcmdline .= " BOOTIF=$formatmac ";
}
#$kcmdline .= " noipv6";
# add the addkcmdline attribute to the end
# of the command, if it exists
#my $addkcmd = $addkcmdhash->{$node}->[0];
# add the extra addkcmd command info, if in the table
#if ($addkcmd->{'addkcmdline'}) {
# $kcmdline .= " ";
# $kcmdline .= $addkcmd->{'addkcmdline'};
#}
my $k;
my $i;
#$k = "xcat/genesis.kernel.$arch";
@@ -2338,7 +2192,7 @@ sub copycd
);
return;
}
if ($arch =~ /ppc/) { $arch = "ppc64" }
if ($arch eq "ppc") { $arch = "ppc64" }
}
if($inspection)
+62 -50
View File
@@ -355,13 +355,15 @@ sub process_request {
if ($net and $net->{nameservers})
{
my $valid = 0;
my $myip = xCAT::NetworkUtils->my_ip_facing($net->{net});
my @myips = xCAT::NetworkUtils->my_ip_facing($net->{net});
foreach (split /,/, $net->{nameservers})
{
chomp $_;
if (($_ eq $myip) || ($_ eq '<xcatmaster>') || ($_ eq $sitens))
{
$valid += 1;
foreach my $myip (@myips) {
if (($_ eq $myip) || ($_ eq '<xcatmaster>') || ($_ eq $sitens))
{
$valid += 1;
}
}
}
unless ($valid > 0)
@@ -1411,60 +1413,66 @@ sub add_or_delete_records {
}
my $zone;
foreach $zone (keys %{$ctx->{updatesbyzone}}) {
my $ip = xCAT::NetworkUtils->getipaddr($ctx->{nsmap}->{$zone});
if( !defined $ip) {
xCAT::SvrUtils::sendmsg([1,"Please make sure $ctx->{nsmap}->{$zone} exist either in /etc/hosts or DNS."], $callback);
return 1;
unless (defined ($ctx->{nsmap}->{$zone}) && $ctx->{nsmap}->{$zone}) {
next;
}
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);
foreach $entry (@{$ctx->{updatesbyzone}->{$zone}}) {
if ($ctx->{deletemode}) {
$update->push(update=>rr_del($entry));
} else {
$update->push(update=>rr_add($entry));
# the ns for zone might be multiple ones which separated with ,
foreach my $zoneserver (split(',', $ctx->{nsmap}->{$zone})) {
my $ip = xCAT::NetworkUtils->getipaddr($zoneserver);
if( !defined $ip) {
xCAT::SvrUtils::sendmsg([1,"Please make sure $zoneserver exist either in /etc/hosts or DNS."], $callback);
return 1;
}
$numreqs -= 1;
if ($numreqs == 0) {
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);
foreach $entry (@{$ctx->{updatesbyzone}->{$zone}}) {
if ($ctx->{deletemode}) {
$update->push(update=>rr_del($entry));
} else {
$update->push(update=>rr_add($entry));
}
$numreqs -= 1;
if ($numreqs == 0) {
$update->sign_tsig("xcat_key",$ctx->{privkey});
$numreqs=300;
my $reply = $resolver->send($update);
if ($reply)
{
if ($reply->header->rcode ne 'NOERROR')
{
xCAT::SvrUtils::sendmsg([1,"Failure encountered updating $zone, error was ".$reply->header->rcode.". See more details in system log."], $callback);
}
}
else
{
xCAT::SvrUtils::sendmsg([1,"No reply received when sending DNS update to zone $zone"], $callback);
}
$update = Net::DNS::Update->new($zone); #new empty request
}
}
if ($numreqs != 300) { #either no entries at all to begin with or a perfect multiple of 300
$update->sign_tsig("xcat_key",$ctx->{privkey});
$numreqs=300;
my $reply = $resolver->send($update);
if ($reply)
{
if ($reply->header->rcode ne 'NOERROR')
if ($reply)
{
xCAT::SvrUtils::sendmsg([1,"Failure encountered updating $zone, error was ".$reply->header->rcode.". See more details in system log."], $callback);
if ($reply->header->rcode ne 'NOERROR')
{
xCAT::SvrUtils::sendmsg([1,"Failure encountered updating $zone, error was ".$reply->header->rcode.". See more details in system log."], $callback);
}
}
else
{
xCAT::SvrUtils::sendmsg([1,"No reply received when sending DNS update to zone $zone"], $callback);
}
}
else
{
xCAT::SvrUtils::sendmsg([1,"No reply received when sending DNS update to zone $zone"], $callback);
}
$update = Net::DNS::Update->new($zone); #new empty request
# sometimes resolver does not work if the update zone request sent so quick
sleep 1;
}
}
if ($numreqs != 300) { #either no entries at all to begin with or a perfect multiple of 300
$update->sign_tsig("xcat_key",$ctx->{privkey});
my $reply = $resolver->send($update);
if ($reply)
{
if ($reply->header->rcode ne 'NOERROR')
{
xCAT::SvrUtils::sendmsg([1,"Failure encountered updating $zone, error was ".$reply->header->rcode.". See more details in system log."], $callback);
}
}
else
{
xCAT::SvrUtils::sendmsg([1,"No reply received when sending DNS update to zone $zone"], $callback);
}
# sometimes resolver does not work if the update zone request sent so quick
sleep 1;
}
}
xCAT::SvrUtils::sendmsg("Completed updating DNS records.", $callback);
}
@@ -1516,13 +1524,17 @@ sub find_nameserver_for_dns {
if ($reply->header->rcode ne 'NOERROR') {
xCAT::SvrUtils::sendmsg([1,"Failure encountered querying $zone, error was ".$reply->header->rcode], $callback);
}
my @zoneserver;
foreach my $record ($reply->answer) {
if ( $record->nsdname =~ /blackhole.*\.iana\.org/) {
$ctx->{nsmap}->{$zone} = 0;
} else {
$ctx->{nsmap}->{$zone} = $record->nsdname;
push @zoneserver, $record->nsdname;
}
}
unless (defined ($ctx->{nsmap}->{$zone})) {
$ctx->{nsmap}->{$zone} = join(',', @zoneserver);
}
} else {
$ctx->{nsmap}->{$zone} = 0;
}
+82 -79
View File
@@ -212,9 +212,17 @@ sub copycd
#this plugin needs $path...
return;
}
if ( $distname
and $distname !~ /^debian/i
and $distname !~ /^ubuntu/i)
{
if ( $copypath || $noosimage || $nonoverwrite ){
$callback->({info=> ["copycd on debian/ubuntu doesn't support -p, -o, -w options!"]});
#If they say to call it something unidentifiable, give up?
return;
}
if ( $copypath || $nonoverwrite ){
$callback->({info=> ["copycd on debian/ubuntu doesn't support -p, -w options!"]});
return;
}
@@ -253,7 +261,9 @@ sub copycd
# So that we have the netboot images
$isnetinst = 1 if ($line2[7] eq "NETINST");
$distname="debian".$ver;
if (!$distname) {
$distname="debian".$ver;
}
$detdistname="debian".$ver;
}
elsif ($prod eq "Ubuntu" or $prod eq "Ubuntu-Server" )
@@ -261,7 +271,9 @@ sub copycd
# to cover for LTS releases
$darch = $line2[7] if ($line2[2] eq "LTS");
$distname="ubuntu".$ver;
if (!$distname) {
$distname="ubuntu".$ver;
}
$detdistname="ubuntu".$ver;
$discno = `cat $path/README.diskdefines | grep 'DISKNUM ' | awk '{print \$3}'`;
}
@@ -407,17 +419,19 @@ sub copycd
}
$callback->({data => "Media copy operation successful"});
my @ret=xCAT::SvrUtils->update_tables_with_templates($distname, $arch, $temppath, $osdistroname);
if ($ret[0] != 0) {
$callback->({data => "Error when updating the osimage tables: " . $ret[1]});
}
my @ret=xCAT::SvrUtils->update_tables_with_diskless_image($distname, $arch, undef, "netboot", $temppath, $osdistroname);
if ($ret[0] != 0) {
$callback->({data => "Error when updating the osimage tables for stateless: " . $ret[1]});
}
my @ret=xCAT::SvrUtils->update_tables_with_diskless_image($distname, $arch, undef, "statelite", $temppath, $osdistroname);
if ($ret[0] != 0) {
$callback->({data => "Error when updating the osimage tables for statelite: " . $ret[1]});
unless($noosimage) {
my @ret=xCAT::SvrUtils->update_tables_with_templates($distname, $arch, $temppath, $osdistroname);
if ($ret[0] != 0) {
$callback->({data => "Error when updating the osimage tables: " . $ret[1]});
}
my @ret=xCAT::SvrUtils->update_tables_with_diskless_image($distname, $arch, undef, "netboot", $temppath, $osdistroname);
if ($ret[0] != 0) {
$callback->({data => "Error when updating the osimage tables for stateless: " . $ret[1]});
}
my @ret=xCAT::SvrUtils->update_tables_with_diskless_image($distname, $arch, undef, "statelite", $temppath, $osdistroname);
if ($ret[0] != 0) {
$callback->({data => "Error when updating the osimage tables for statelite: " . $ret[1]});
}
}
}
}
@@ -451,6 +465,7 @@ sub mkinstall
my $restab = xCAT::Table->new('noderes');
my $bptab = xCAT::Table->new('bootparams',-create=>1);
my $hmtab = xCAT::Table->new('nodehm');
my $mactab = xCAT::Table->new('mac');
my %osents = %{$ostab->getNodesAttribs(\@nodes, ['profile', 'os', 'arch', 'provmethod'])};
my %rents =
%{$restab->getNodesAttribs(\@nodes,
@@ -458,6 +473,7 @@ sub mkinstall
my %hents =
%{$hmtab->getNodesAttribs(\@nodes,
['serialport', 'serialspeed', 'serialflow'])};
my %macents = %{$mactab->getNodesAttribs(\@nodes, ['mac'])};
#my $addkcmdhash =
# $bptab->getNodesAttribs(\@nodes, ['addkcmdline']);
require xCAT::Template;
@@ -490,6 +506,8 @@ sub mkinstall
my $profile;
my $tmplfile;
my $pkgdir;
my $pkgdirval;
my @mirrors;
my $pkglistfile;
my $imagename; # set it if running of 'nodeset osimage=xxx'
my $platform;
@@ -564,13 +582,23 @@ sub mkinstall
$arch = $ph->{osarch};
$profile = $ph->{profile};
$platform=xCAT_plugin::debian::getplatform($os);
$tmplfile=$ph->{template};
$pkgdirval=$ph->{pkgdir};
my @pkgdirlist=split(/,/,$pkgdirval);
foreach (@pkgdirlist){
if($_ =~ /^http|ssh/){
push @mirrors,$_;
}else{
$pkgdir=$_;
}
}
$tmplfile=$ph->{template};
$pkgdir=$ph->{pkgdir};
if (!$pkgdir) {
$pkgdir="$installroot/$os/$arch";
}
$pkglistfile=$ph->{pkglist};
$pkglistfile=$ph->{pkglist};
}
else {
$os = $ent->{os};
@@ -699,7 +727,7 @@ sub mkinstall
}
if ($arch =~ /ppc64/i and !(-e "$pkgdir/install/netboot/initrd.gz")) {
$callback->({error => ["The netboot initrd not found in $pkgdir/install/netboot, pls download first"],
$callback->({error => ["The network boot initrd.gz is not found in $pkgdir/install/netboot. This is provided by Ubuntu, please download and retry."],
errorcode=>[1]});
next;
}
@@ -711,6 +739,7 @@ sub mkinstall
my $initrdpath;
my $maxmem;
if (
(
($arch =~ /x86/ and
@@ -776,6 +805,7 @@ sub mkinstall
# 'serialport', 'serialspeed', 'serialflow'
# ]
# );
my $macent = $macents{$node}->[0];
my $instserver;
if ($ent and $ent->{xcatmaster}){
$instserver = $ent->{xcatmaster};
@@ -807,32 +837,13 @@ sub mkinstall
if ($maxmem) {
$kcmdline.=" mem=$maxmem";
}
my $ksdev = "";
if ($ent->{installnic}){
if ($ent->{installnic} eq "mac"){
my $mactab = xCAT::Table->new("mac");
my $macref = $mactab->getNodeAttribs($node, ['mac']);
$ksdev = xCAT::Utils->parseMacTabEntry($macref->{mac},$node);
}
else{
$ksdev = $ent->{installnic};
}
}
elsif ($ent->{primarynic}){
if ($ent->{primarynic} eq "mac"){
my $mactab = xCAT::Table->new("mac");
my $macref = $mactab->getNodeAttribs($node, ['mac']);
$ksdev = xCAT::Utils->parseMacTabEntry($macref->{mac},$node);
}
else{
$ksdev = $ent->{primarynic};
}
my $net_params = xCAT::NetworkUtils->gen_net_boot_params($ent->{installnic},$ent->{primarynic},$macent->{mac});
if (exists($net_params->{nicname})) {
$kcmdline .= " netcfg/choose_interface=". $net_params->{nicname};
} elsif (exists($net_params->{mac})) {
$kcmdline .= " netcfg/choose_interface=". $net_params->{mac};
}
if ($ksdev){
$kcmdline .= " netcfg/choose_interface=" . $ksdev;
}
#TODO: dd=<url> for driver disks
if (defined($sent->{serialport})){
unless ($sent->{serialspeed}){
@@ -848,6 +859,12 @@ sub mkinstall
if ($sent->{serialflow} =~ /(hard|cts|ctsrts)/){
$kcmdline .= "n8r";
}
} else {
$callback->(
{
warning => ["rcons my not work since no serialport specified"],
}
);
}
#$kcmdline .= " noipv6";
# add the addkcmdline attribute to the end
@@ -1422,17 +1439,16 @@ sub mknetboot
# add one parameter: ifname=<eth0>:<mac address>
# which is used for dracut
# the redhat5.x os will ignore it
my $useifname=0;
if ($reshash->{$node}->[0] and $reshash->{$node}->[0]->{installnic} and $reshash->{$node}->[0]->{installnic} ne "mac") {
$useifname=1;
$kcmdline .= "ifname=".$reshash->{$node}->[0]->{installnic} . ":";
} elsif ($nodebootif) {
$useifname=1;
$kcmdline .= "ifname=$nodebootif:";
} elsif ($reshash->{$node}->[0] and $reshash->{$node}->[0]->{primarynic} and $reshash->{$node}->[0]->{primarynic} ne "mac") {
$useifname=1;
$kcmdline .= "ifname=".$reshash->{$node}->[0]->{primarynic}.":";
my $installnic = undef;
my $primarynic = undef;
my $mac = undef;
if ($reshash->{$node}->[0] and $reshash->{$node}->[0]->{installnic}) {
$installnic = $reshash->{$node}->[0]->{installnic};
}
if ($reshash->{$node}->[0] and $reshash->{$node}->[0]->{primarynic}) {
$primarynic= $reshash->{$node}->[0]->{primarynic};
}
#else { #no, we autodetect and don't presume anything
# $kcmdline .="eth0:";
@@ -1443,34 +1459,15 @@ sub mknetboot
if( $machash->{$node}->[0] && $machash->{$node}->[0]->{'mac'}) {
# TODO: currently, only "mac" attribute with classic style is used, the "|" delimited string of "macaddress!hostname" format is not used
$mac = xCAT::Utils->parseMacTabEntry($machash->{$node}->[0]->{'mac'},$node);
# if ( (index($mac, "|") eq -1) and (index($mac, "!") eq -1) ) {
#convert to linux format
if ($mac !~ /:/) {
$mac =~s/(..)(..)(..)(..)(..)(..)/$1:$2:$3:$4:$5:$6/;
}
# } else {
# $callback->({ error=>[ qq{In the "mac" table, the "|" delimited string of "macaddress!hostname" format is not supported by "nodeset <nr> netboot|statelite if installnic/primarynic is set".}], errorcode=>[1]});
# return;
# }
}
if ($useifname && $mac) {
$kcmdline .= "$mac ";
my $net_params = xCAT::NetworkUtils->gen_net_boot_params($installnic, $primarynic, $mac, $nodebootif);
if (defined($net_params->{ifname})) {
$kcmdline .= "$net_params->{ifname} ";
}
# add "netdev=<eth0>" or "BOOTIF=<mac>"
# which are used for other scenarios
my $netdev = "";
if ($reshash->{$node}->[0] and $reshash->{$node}->[0]->{installnic} and $reshash->{$node}->[0]->{installnic} ne "mac") {
$kcmdline .= "netdev=" . $reshash->{$node}->[0]->{installnic} . " ";
} elsif ($nodebootif) {
$kcmdline .= "netdev=" . $nodebootif . " ";
} elsif ( $reshash->{$node}->[0] and $reshash->{$node}->[0]->{primarynic} and $reshash->{$node}->[0]->{primarynic} ne "mac") {
$kcmdline .= "netdev=" . $reshash->{$node}->[0]->{primarynic} . " ";
} else {
if ( !$useifname && $mac) {
$kcmdline .= "BOOTIF=" . $mac . " ";
}
if (defined($net_params->{netdev})) {
$kcmdline .= "$net_params->{netdev} ";
} elsif (defined($net_params->{BOOTIF}) && ($net_params->{setmac} || $arch=~ /ppc/)) {
$kcmdline .= "$net_params->{BOOTIF} ";
}
my %client_nethash = xCAT::DBobjUtils->getNetwkInfo( [$node] );
@@ -1507,6 +1504,12 @@ sub mknetboot
{
$kcmdline .= "n8r";
}
} else {
$callback->(
{
warning => ["rcons my not work since no serialport specified"],
}
);
}
# add the addkcmdline attribute to the end
# of the command, if it exists
+30 -9
View File
@@ -1450,7 +1450,7 @@ sub process_request
my $n = $_->{net};
my $if = $_->{mgtifname};
my $nm = $_->{mask};
if ($if =~ /!remote!/ and $n !~ /:/) { #only take in networks with special interface, but only v4 for now
if ($if =~ /!remote!\S+/ and $n !~ /:/) { #only take in networks with special interface, but only v4 for now
push @nrn, "$n:$if:$nm";
}
}
@@ -1467,20 +1467,27 @@ sub process_request
{
next;
}
my $netif = $ent[1];
if ($netif =~ /!remote!/) {
$netif =~ s/!remote!\s*(.*)$/$1/;
}
# Bridge nics
if ((-f "/usr/sbin/brctl") || (-f "/sbin/brctl"))
{
system "brctl showmacs $ent[1] 2>&1 1>/dev/null";
#system "brctl showmacs $ent[1] 2>&1 1>/dev/null";
system "brctl showmacs $netif 2>&1 1>/dev/null";
if ($? == 0)
{
$activenics{$ent[1]} = 1;
#$activenics{$ent[1]} = 1;
$activenics{$netif} = 1;
next;
}
}
if ($ent[1] =~ m/(remote|ipoib|ib|vlan|bond|eth|myri|man|wlan|en\S*\d+|em\S*\d+)/)
#if ($ent[1] =~ m/(remote|ipoib|ib|vlan|bond|eth|myri|man|wlan|en\S*\d+|em\S*\d+)/)
if ($netif =~ m/(remote|ipoib|ib|vlan|bond|eth|myri|man|wlan|en\S*\d+|em\S*\d+)/)
{ #Mask out many types of interfaces, like xCAT 1.x
$activenics{$ent[1]} = 1;
#$activenics{$ent[1]} = 1;
$activenics{$netif} = 1;
}
}
}
@@ -1700,7 +1707,18 @@ sub process_request
{
next;
}
if ($activenics{$line[1]} and $line[3] !~ /G/)
my $netif = $line[1];
if ($netif =~ /!remote!/) {
$netif =~ s/!remote!\s*(.*)$/$1/;
if (!defined($activenics{"!remote!"})) {
next;
} elsif (!defined($activenics{$netif})) {
addnic($netif,\@dhcpconf);
$activenics{$netif} = 1;
}
}
#if ($activenics{$line[1]} and $line[3] !~ /G/)
if ($activenics{$netif} and $line[3] !~ /G/)
{
addnet($line[0], $line[2]);
}
@@ -2123,6 +2141,9 @@ sub addnet
if ($ent[0] eq $net and $ent[2] eq $mask)
{
$nic = $ent[1];
if ($nic =~ /!remote!/) {
$nic =~ s/!remote!\s*(.*)$/$1/;
}
# The first nic that matches the network,
# what will happen if there are more than one nics in the same subnet,
# and we want to use the second nic as the dhcp interfaces?
@@ -2537,8 +2558,8 @@ sub addnic
#$restartdhcp=1;
#print "Adding NIC $nic\n";
if ($nic =~ /!remote!/) {
push @$conf, "#shared-network $nic {\n";
push @$conf, "#\} # $nic nic_end\n";
#push @$conf, "#shared-network $nic {\n";
#push @$conf, "#\} # $nic nic_end\n";
} else {
push @$conf, "shared-network $nic {\n";
push @$conf, "\} # $nic nic_end\n";
File diff suppressed because it is too large Load Diff
+2 -1
View File
@@ -101,6 +101,7 @@ my %guestidmap = (
"centos6.*" => "rhel6_",
"centos5.*" => "rhel5_",
"centos4.*" => "rhel4_",
"sles12.*" => "sles12_",
"sles11.*" => "sles11_",
"sles10.*" => "sles10_",
"win2k8" => "winLonghorn",
@@ -2475,7 +2476,7 @@ sub clone_vms_from_master {
sub make_customization_spec {
my $node = shift;
my %args = @_;
my $password="Passw0rd";
my $password;
my $wintimezone;
#map of number to strings can be found at
#http://osman-shener-en.blogspot.com/2008/02/unattendedtxt-time-zone-index.html
+1 -1
View File
@@ -81,7 +81,7 @@ sub preprocess_request {
my (@fspnodes, @nohandle);
xCAT::Utils->filter_nodes($arg1, undef, \@fspnodes, undef, \@nohandle);
if (@fspnodes) {
$arg1->{noderange} = \@fspnodes;
$arg1->{node} = \@fspnodes;
} else {
return [];
}
+2 -1
View File
@@ -170,6 +170,7 @@ sub process_request {
$pkglist = $ref_linuximage_tab->{'pkglist'};
$srcdir = $ref_linuximage_tab->{'pkgdir'};
$srcdir_otherpkgs = $ref_linuximage_tab->{'otherpkgdir'};
$otherpkglist = $ref_linuximage_tab->{'otherpkglist'};
$postinstall_filename = $ref_linuximage_tab->{'postinstall'};
@@ -292,7 +293,7 @@ sub process_request {
if ($interactive) { $cmd .= " --interactive" }
if ($onlyinitrd) { $cmd .= " --onlyinitrd" }
if ($srcdir) { $cmd .= " --srcdir $srcdir";}
if ($srcdir) { $cmd .= " --srcdir \"$srcdir\"";}
if ($pkglist) { $cmd .= " --pkglist $pkglist";}
if ($srcdir_otherpkgs) { $cmd .= " --otherpkgdir \"$srcdir_otherpkgs\""; }
if ($otherpkglist) { $cmd .= " --otherpkglist $otherpkglist"; }
+35 -6
View File
@@ -26,8 +26,10 @@ my %usage = (
"nodeset" => "Usage: nodeset <noderange> [install|shell|boot|runcmd=bmcsetup|netboot|iscsiboot|osimage[=<imagename>]|offline]",
);
sub handled_commands {
# process noderes:netboot like "grub2-<transfer protocol>"
# such as grub2-http and grub2-tftp
return {
nodeset => "noderes:netboot"
nodeset => "noderes:netboot=(grub2[-]?.*)"
}
}
@@ -189,20 +191,47 @@ sub setstate {
}
$tftpserverip{$tftpserver} = $serverip;
}
my $grub2protocol="tftp";
if (defined ($nrhash{$node}->[0]) && $nrhash{$node}->[0]->{'netboot'}
&& ($nrhash{$node}->[0]->{'netboot'} =~ /grub2-(.*)/)) {
$grub2protocol = $1;
}
unless($grub2protocol =~ /^http|tftp$/ ){
$::callback->(
{
error => [
"Invalid netboot method, please check noderes.netboot for $node"
],
errorcode => [1]
}
);
return;
}
print $pcfg "set default=\"xCAT OS Deployment\"\n";
print $pcfg "menuentry \"xCAT OS Deployment\" {\n";
print $pcfg " insmod http\n";
print $pcfg " insmod tftp\n";
print $pcfg " set root=http,$serverip\n";
print $pcfg " set root=$grub2protocol,$serverip\n";
print $pcfg " echo Loading Install kernel ...\n";
my $protocolrootdir="";
if($grub2protocol =~ /^http$/)
{
$protocolrootdir=$tftpdir;
}
if ($kern and $kern->{kcmdline}) {
print $pcfg " linux $tftpdir/$kern->{kernel} $kern->{kcmdline}\n";
print $pcfg " linux $protocolrootdir/$kern->{kernel} $kern->{kcmdline}\n";
} else {
print $pcfg " linux $tftpdir/$kern->{kernel}\n";
print $pcfg " linux $protocolrootdir/$kern->{kernel}\n";
}
print $pcfg " echo Loading initial ramdisk ...\n";
if ($kern and $kern->{initrd}) {
print $pcfg " initrd $tftpdir/$kern->{initrd}\n";
print $pcfg " initrd $protocolrootdir/$kern->{initrd}\n";
}
print $pcfg "}";
@@ -457,7 +486,7 @@ sub process_request {
my $mactab=xCAT::Table->new('mac',-create=>1);
my $machash=$mactab->getNodesAttribs(\@nodes,['mac']);
my $nrtab=xCAT::Table->new('noderes',-create=>1);
my $nrhash=$nrtab->getNodesAttribs(\@nodes,['servicenode','tftpserver','xcatmaster']);
my $nrhash=$nrtab->getNodesAttribs(\@nodes,['servicenode','tftpserver','xcatmaster','netboot']);
my $typetab=xCAT::Table->new('nodetype',-create=>1);
my $typehash=$typetab->getNodesAttribs(\@nodes,['os','provmethod','arch','profile']);
my $linuximgtab=xCAT::Table->new('linuximage',-create=>1);
+61 -17
View File
@@ -287,6 +287,7 @@ sub lskmodules {
}
return ( $rc - 1 );
}
if ($::VERBOSE) {
my $rsp;
push @{ $rsp->{data} }, "Running lskmodules command... ";
@@ -301,7 +302,7 @@ sub lskmodules {
xCAT::MsgUtils->message( "E", $rsp, $::CALLBACK );
return 1;
}
# Get the list of kernel modules in each rpm/img file
my @modlist;
foreach my $source (@sources) {
@@ -309,7 +310,12 @@ sub lskmodules {
$source =~ s/^dud://;
push (@modlist, &mods_in_img($source) );
} else {
$source =~ s/^rpm://;
my $osver = xCAT::Utils->osver();
if ($osver =~ /ubuntu/) {
$source =~ s/^deb://;
}else{
$source =~ s/^rpm://;
}
push (@modlist, &mods_in_rpm($source) );
}
}
@@ -328,7 +334,7 @@ sub lskmodules {
push @{ $rsp->{data} }, $mn->{name}.': '.$mn->{description};
}
}
#xCAT::MsgUtils->message( "I", $rsp, $::CALLBACK );
if ( $rsp ) {
$::CALLBACK->($rsp);
}
@@ -443,7 +449,7 @@ sub set_sources {
if ( defined($::opt_u) ) {
my $outab = xCAT::Table->new('osdistroupdate');
foreach my $ou (split( ',', $::opt_u)) {
my ($ou_entry) = $outab->getAttribs({'osupdatename'=>$ou},('dirpath'));
my ($ou_entry) = $outab->getAttribs({'osupdatename'=>$ou},('dirpath','basename'));
if ( !($ou_entry) || !(defined($ou_entry->{'dirpath'})) ) {
if ($::VERBOSE) {
my $rsp;
@@ -453,7 +459,16 @@ sub set_sources {
next;
}
my $dirpath = $ou_entry->{'dirpath'};
my @kernel_rpms = `find $dirpath -name kernel-*.rpm`;
my @kernel_rpms = ();
if ($ou_entry->{'basename'} =~ /^ubuntu/)
{
@kernel_rpms = `find $dirpath/pool/main/l/linux/ -name *.deb`;
}
else
{
@kernel_rpms = `find $dirpath -name kernel-*.rpm`;
}
foreach my $krpm (@kernel_rpms) {
chomp($krpm);
my $base_krpm = basename($krpm);
@@ -477,13 +492,13 @@ sub set_sources {
if ( defined($::opt_o) ) {
my $odtab = xCAT::Table->new('osdistro');
foreach my $od (split( ',', $::opt_o)) {
my ($od_entry) = $odtab->getAttribs({'osdistroname'=>$od},('dirpaths'));
my ($od_entry) = $odtab->getAttribs({'osdistroname'=>$od},('dirpaths','basename'));
if ( !($od_entry) ) {
# try building dirpath from distro_name/local_arch
my $arch = `uname -m`;
chomp($arch);
$arch = "x86" if ($arch =~ /i.86$/);
my $dirpath = $installdir.'/'.$od.'/'.$arch;
my $dirpath = $installdir.'/'.$od.'/'.$arch;
if (!(-e $dirpath)) {
if ($::VERBOSE) {
my $rsp;
@@ -492,7 +507,17 @@ sub set_sources {
}
next;
}
my @kernel_rpms = `find $dirpath -name kernel-*.rpm`;
my @kernel_rpms = ();
if ($od_entry->{'basename'} =~ /ubuntu/)
{
@kernel_rpms = `find $dirpath/pool/main/l/linux/ -name *.deb`;
}
else
{
@kernel_rpms = `find $dirpath -name kernel-*.rpm`;
}
foreach my $krpm (@kernel_rpms) {
chomp($krpm);
my $base_krpm = basename($krpm);
@@ -504,7 +529,16 @@ sub set_sources {
}
} else {
foreach my $dirpath (split( ',', $od_entry->{'dirpaths'})){
my @kernel_rpms = `find $dirpath -name kernel-*.rpm`;
my @kernel_rpms = ();
if ($od_entry->{'basename'} =~ /ubuntu/)
{
@kernel_rpms = `find $dirpath/pool/main/l/linux/ -name *.deb`;
}
else
{
@kernel_rpms = `find $dirpath -name kernel-*.rpm`;
}
#my @kernel_rpms = `find $dirpath -name kernel-*.rpm`;
foreach my $krpm (@kernel_rpms) {
chomp($krpm);
my $base_krpm = basename($krpm);
@@ -573,14 +607,24 @@ sub mods_in_rpm {
my $tmp_path = "/tmp/lskmodules_expanded_rpm";
mkpath($tmp_path);
if (-r $krpm) {
if (system ("cd $tmp_path; rpm2cpio $krpm | cpio -idum *.ko > /dev/null 2>&1 ; cd - > /dev/null 2>&1")) {
my $rsp;
push @{ $rsp->{data} }, "Unable to extract files from the rpm $krpm.";
xCAT::MsgUtils->message( "E", $rsp, $::CALLBACK );
rmtree($tmp_path);
return;
}
} else {
my $osver = xCAT::Utils->osver();
if ($osver =~ /ubuntu/) {
if (system ("cd $tmp_path; dpkg -X $krpm $tmp_path > /dev/null 2>&1 ; cd - > /dev/null 2>&1")) {
my $rsp;
push @{ $rsp->{data} }, "Unable to extract files from the deb package $krpm.";
xCAT::MsgUtils->message( "E", $rsp, $::CALLBACK );
rmtree($tmp_path);
return;}
}else{
if (system ("cd $tmp_path; rpm2cpio $krpm | cpio -idum *.ko > /dev/null 2>&1 ; cd - > /dev/null 2>&1")) {
my $rsp;
push @{ $rsp->{data} }, "Unable to extract files from the rpm $krpm.";
xCAT::MsgUtils->message( "E", $rsp, $::CALLBACK );
rmtree($tmp_path);
return;
}
}
}else{
my $rsp;
push @{ $rsp->{data} }, "Unable to read rpm $krpm.";
xCAT::MsgUtils->message( "E", $rsp, $::CALLBACK );
+11 -25
View File
@@ -37,14 +37,10 @@ my $parser;
my @destblacklist;
my $updatetable; #when a function is performing per-node operations, it can queue up a table update by populating parts of this hash
my $confdata; #a reference to serve as a common pointer betweer VMCommon functions and this plugin
my $libvirtsupport;
$libvirtsupport = eval {
require Sys::Virt;
if (Sys::Virt->VERSION =~ /^0\.[10]\./) {
require Sys::Virt;
if (Sys::Virt->VERSION =~ /^0\.[10]\./) {
die;
}
1;
};
}
use XML::Simple;
$XML::Simple::PREFERRED_PARSER='XML::Parser';
@@ -67,9 +63,6 @@ my $callback;
my $requester; #used to track the user
sub handled_commands {
#unless ($libvirtsupport) {
# return {};
#}
return {
rpower => 'nodehm:power,mgt',
mkvm => 'nodehm:power,mgt',
@@ -556,9 +549,11 @@ sub build_diskstruct {
}
}
my $cdprefix='hd';
if ($storagemodel eq 'virtio') {
$cdprefix='vd';
} elsif ($storagemodel eq 'scsi') {
# device name vd* doesn't work for CDROM, so delete it.
#if ($storagemodel eq 'virtio') {
# $cdprefix='vd';
#} els
if ($storagemodel eq 'scsi') {
$cdprefix='sd';
}
$suffidx += 1;
@@ -2611,18 +2606,9 @@ sub process_request {
$requester=$request->{_xcat_authname}->[0];
}
$callback = shift;
unless ($libvirtsupport) {
$libvirtsupport = eval {
require Sys::Virt;
if ( xCAT::Utils::version_cmp(Sys::Virt->VERSION, "0.2.0") < 0 ) {
die;
}
1;
};
}
unless ($libvirtsupport) { #Still no Sys::Virt module
$callback->({error=>"Sys::Virt perl module missing or older than 0.2.0, unable to fulfill KVM plugin requirements",errorcode=>[42]});
return [];
require Sys::Virt;
if ( xCAT::Utils::version_cmp(Sys::Virt->VERSION, "0.2.0") < 0 ) {
die;
}
require Sys::Virt::Domain;
%runningstates = (&Sys::Virt::Domain::STATE_NOSTATE=>1,&Sys::Virt::Domain::STATE_RUNNING=>1,&Sys::Virt::Domain::STATE_BLOCKED=>1);
+6 -2
View File
@@ -171,7 +171,7 @@ my %globalnodetype = (
ivm => $::NODETYPE_PPC,
cmm => $::NODETYPE_MP,
lpar =>"$::NODETYPE_PPC,$::NODETYPE_OSI",
pbmc => $::NODETYPE_PPC,
pbmc => $::NODETYPE_MP,
);
my %globalmgt = (
fsp => "fsp",
@@ -1128,6 +1128,10 @@ sub parse_responses {
$atthash{ip} = ${$searchmacs{$rsp}}{peername};
$atthash{url} = ${$searchmacs{$rsp}}{payload};
$atthash{hostname} = 'Server-'.$atthash{mtm}.'-SN'.$atthash{serial};
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};
}
$outhash{'Server-'.$atthash{mtm}.'-SN'.$atthash{serial}} = \%atthash;
}elsif (($type eq SERVICE_FSP) && (${$attributes->{'machinetype-model'}}[0] =~ /^7895|1457|7954/ )) {
@@ -1496,7 +1500,7 @@ sub xCATdB {
$machash{$hostname} = {mac=>$mac} if ($type =~ /^fsp|bpa$/);
} elsif ( $type =~ /^pbmc$/) {
$nodelisthash{$hostname} = {groups=>$groups, hidden=>$hidden};
$ppchash{$hostname} = {nodetype=>$globalhwtype{$type}};
$mphash{$hostname} = {nodetype=>$globalhwtype{$type}};
$vpdhash{$hostname} = {mtm=>$model, serial=>$serial};
$nodehmhash{$hostname} = {mgt=>$globalmgt{$type}};
$nodetypehash{$hostname} = {nodetype=>$globalnodetype{$type}};
+45 -3
View File
@@ -42,8 +42,10 @@ my %allracks;
my %allchassis;
my %allswitches;
my %all_switchports;
my %allvmhosts;
my @switch_records;
my $netboot;
# The array of all chassis which is special CMM
my %allcmmchassis;
@@ -380,6 +382,13 @@ Usage:
setrsp_errormsg($errmsg);
return;
}
# Get the netboot attribute for node
my ($retcode, $retval) = xCAT::ProfiledNodeUtils->get_netboot_attr($imageprofile, $hardwareprofile);
if (not $retcode) {
setrsp_errormsg($retval);
return;
}
$netboot = $retval;
# Get database records: all hostnames, all ips, all racks...
xCAT::MsgUtils->message('S', "Getting database records.");
@@ -430,6 +439,10 @@ Usage:
# Get all LPAR ids
$recordsref = xCAT::ProfiledNodeUtils->get_all_lparids(\%allcecs);
%alllparids = %$recordsref;
# Get all vm hosts/hypervisiors
$recordsref = xCAT::ProfiledNodeUtils->get_all_vmhosts();
%allvmhosts = %$recordsref;
#TODO: can not use getallnode to get rack infos.
$recordsref = xCAT::ProfiledNodeUtils->get_all_rack(1);
@@ -762,6 +775,7 @@ Usage:
my $nodelstab = xCAT::Table->new('nodelist');
my $nodeshashref = $nodelstab->getNodesAttribs($nodes, ['groups']);
my %updatenodeshash;
my %updatenodereshash;
my %nodeoldprofiles = ();
foreach (@$nodes){
@@ -865,18 +879,27 @@ Usage:
setrsp_infostr("Warning: no profile changes detect.");
return;
}
# Get the netboot attribute for node
my ($retcode, $retval) = xCAT::ProfiledNodeUtils->get_netboot_attr($imageprofile, $hardwareprofile);
if (not $retcode) {
setrsp_errormsg($retval);
return;
}
my $new_netboot = $retval;
# Update nodes' attributes
foreach (@$nodes) {
$updatenodeshash{$_}{'groups'} .= $profile_groups;
}
$updatenodereshash{$_}{'netboot'} = $new_netboot;
}
#update DataBase.
setrsp_progress("Updating database records...");
my $nodetab = xCAT::Table->new('nodelist',-create=>1);
$nodetab->setNodesAttribs(\%updatenodeshash);
$nodetab->close();
my $noderestab = xCAT::Table->new('noderes',-create=>1);
$noderestab->setNodesAttribs(\%updatenodereshash);
$noderestab->close();
#update node's status:
if($profile_status eq "defined"){
xCAT::Utils->runxcmd({command=>["updatenodestat"], node=>$nodes, arg=>['defined']}, $request_command, -1, 2);
@@ -1773,6 +1796,16 @@ sub findme{
}
}
}
my $imageprofile = $args_dict{'imageprofile'};
my $networkprofile = $args_dict{'networkprofile'};
my $hardwareprofile = $args_dict{'hardwareprofile'};
# Get the netboot attribute for node
my ($retcode, $retval) = xCAT::ProfiledNodeUtils->get_netboot_attr($imageprofile, $hardwareprofile);
if (not $retcode) {
setrsp_errormsg($retval);
return;
}
$netboot = $retval;
# Get database records: all hostnames, all ips, all racks...
# To improve performance, we should initalize a daemon later??
@@ -2103,6 +2136,9 @@ sub gen_new_hostinfo_dict{
$hostinfo_dict{$item}{"mgt"} = "fsp";
}
# Set netboot attribute for node
$hostinfo_dict{$item}{"netboot"} = $netboot;
# get the chain attribute from hardwareprofile and insert it to node.
my $chaintab = xCAT::Table->new('chain');
my $hardwareprofile = $args_dict{'hardwareprofile'};
@@ -2538,6 +2574,12 @@ sub validate_node_entry{
}
}
}
}elsif ($_ eq "vmhost") {
# Support PowerKVM vms
my $vm_host= $node_entry{"vmhost"};
if (! exists $allvmhosts{$node_entry{$_}}){
$errmsg .= "The VM host name $node_entry{$_} that is specified in the node information file is not defined in the system.\n";
}
}else{
$errmsg .= "Invalid attribute $_ specified\n";
}
+11 -11
View File
@@ -610,7 +610,7 @@ sub set_route {
# ipv6 network
if ($net =~ /:/) {
if (xCAT::Utils->isLinux()) {
if ( $gw_ip == "" || $gw_ip == "::" ) {
if ( $gw_ip eq "" || $gw_ip eq "::" ) {
$cmd="ip -6 route add $net/$mask dev $ifname";
} else {
$cmd="ip -6 route add $net/$mask via $gw_ip";
@@ -620,7 +620,7 @@ sub set_route {
}
} else {
if (xCAT::Utils->isLinux()) {
if ( $gw_ip == "" || $gw_ip == "0.0.0.0" ) {
if ( $gw_ip eq "" || $gw_ip eq "0.0.0.0" ) {
$cmd="route add -net $net netmask $mask dev $ifname";
} else {
$cmd="route add -net $net netmask $mask gw $gw_ip";
@@ -691,7 +691,7 @@ sub delete_route {
my $cmd;
if ($net =~ /:/) {
if (xCAT::Utils->isLinux()) {
if ( $gw_ip == "" || $gw_ip == "::" ) {
if ( $gw_ip eq "" || $gw_ip eq "::" ) {
$cmd = "ip -6 route delete $net/$mask dev $ifname";
} else {
$cmd = "ip -6 route delete $net/$mask via $gw_ip";
@@ -701,7 +701,7 @@ sub delete_route {
}
} else {
if (xCAT::Utils->isLinux()) {
if ( $gw_ip == "" || $gw_ip == "0.0.0.0" ) {
if ( $gw_ip eq "" || $gw_ip eq "0.0.0.0" ) {
$cmd="route delete -net $net netmask $mask dev $ifname";
} else {
$cmd="route delete -net $net netmask $mask gw $gw_ip";
@@ -850,13 +850,13 @@ sub addPersistentRoute_Sles {
#print "hasConfiged=$hasConfiged\n";
my $new_config;
if ($net =~ /:/) {
if ( $gw_ip == "" || $gw_ip == "::" ) {
if ( $gw_ip eq "" || $gw_ip eq "::" ) {
$new_config = "$net/$mask :: - $ifname\n";
} else {
$new_config = "$net/$mask $gw_ip - -\n";
}
} else {
if ( $gw_ip == "" || $gw_ip == "0.0.0.0" ) {
if ( $gw_ip eq "" || $gw_ip eq "0.0.0.0" ) {
$new_config="$net 0.0.0.0 $mask $ifname\n";
} else {
$new_config="$net $gw_ip $mask $ifname\n";
@@ -1026,7 +1026,7 @@ sub addPersistentRoute_RH {
$new_config="$ifname $net/$mask $gw_ip";
} else {
if ( $gw_ip == "" || $gw_ip == "0.0.0.0" ) {
if ( $gw_ip eq "" || $gw_ip eq "0.0.0.0" ) {
$new_config="any net $net netmask $mask dev $ifname\n";
} else {
$new_config="any net $net netmask $mask gw $gw_ip\n";
@@ -1170,7 +1170,7 @@ sub addPersistentRoute_Debian{
#ipv6
if ( $net =~ /:/){
if ( $gw_ip == "" || $gw_ip == "::" ) {
if ( $gw_ip eq "" || $gw_ip eq "::" ) {
$cmd = "grep \"$net/$mask dev $ifname\" $conf_file";
$route_conf = " up route -A inet6 add $net/$mask dev $ifname \n down route -A inet6 del $net/$mask dev $ifname \n";
} else {
@@ -1180,7 +1180,7 @@ sub addPersistentRoute_Debian{
}
else { #ipv4
$cmd = "grep \"-net $net netmask $mask gw $gw_ip\" $conf_file";
if ( $gw_ip == "" || $gw_ip == "0.0.0.0" ) {
if ( $gw_ip eq "" || $gw_ip eq "0.0.0.0" ) {
$route_conf = " up route add -net $net netmask $mask dev $ifname \n down route del -net $net netmask $mask dev $ifname \n";
} else {
$route_conf = " up route add -net $net netmask $mask gw $gw_ip \n down route del -net $net netmask $mask gw $gw_ip\n";
@@ -1242,14 +1242,14 @@ sub deletePersistentRoute_Debian{
preParse_Debian();
#ipv6
if ( $net =~ /:/){
if ( $gw_ip == "" || $gw_ip == "::" ) {
if ( $gw_ip eq "" || $gw_ip eq "::" ) {
$match = "$net/$mask dev $ifname";
} else {
$match = "$net/$mask gw $gw_ip";
}
}
else {
if ( $gw_ip == "" || $gw_ip == "0.0.0.0" ) {
if ( $gw_ip eq "" || $gw_ip eq "0.0.0.0" ) {
$match = "net $net netmask $mask dev $ifname";
} else {
$match = "net $net netmask $mask gw $gw_ip";
+1 -1
View File
@@ -135,7 +135,7 @@ sub findme {
my $mtms = $request->{'mtm'}->[0]."*".$request->{'serial'}->[0];
my $tmp_nodes = $::XCATVPDHASH{$mtms};
foreach (@$tmp_nodes) {
if ($::XCATPPCHASH{$_}) {
if ($::XCATMPHASH{$_}) {
$pbmc_node = $_;
}
}
+82 -100
View File
@@ -580,28 +580,33 @@ sub mknetboot
# add flow control setting
$kcmdline .= "FC=$useflowcontrol ";
# add the kernel-booting parameter: netdev=<eth0>, or BOOTIF=<mac>
my $netdev = "";
my $mac = xCAT::Utils->parseMacTabEntry($machash->{$node}->[0]->{mac},$node);
# add dhcp for ip
$kcmdline .= "ip=dhcp ";
if ($reshash->{$node}->[0] and $reshash->{$node}->[0]->{installnic} and ($reshash->{$node}->[0]->{installnic} ne "mac")) {
$kcmdline .= "netdev=" . $reshash->{$node}->[0]->{installnic} . " ";
} elsif ($nodebootif) {
$kcmdline .= "netdev=" . $nodebootif . " ";
} elsif ($reshash->{$node}->[0] and $reshash->{$node}->[0]->{primarynic} and ($reshash->{$node}->[0]->{primarynic} ne "mac")) {
$kcmdline .= "netdev=" . $reshash->{$node}->[0]->{primarynic} . " ";
} else {
if ($arch =~ /x86/) {
#do nothing, we'll let pxe/xnba work their magic
} elsif ($mac) {
$kcmdline .= "BOOTIF=" . $mac . " ";
} else {
$callback->({
error=>[qq{"cannot get the mac address for $node in mac table"}],
errorcode=>[1]
});
}
}
my $mac;
my $installnic;
my $primarynic;
if ($reshash->{$node}->[0] and $reshash->{$node}->[0]->{installnic}){
$installnic=$reshash->{$node}->[0]->{installnic};
}
if ($reshash->{$node}->[0] and $reshash->{$node}->[0]->{primarynic}){
$primarynic=$reshash->{$node}->[0]->{primarynic};
}
if (defined ($machash->{$node}->[0]) && $machash->{$node}->[0]->{'mac'}) {
$mac = xCAT::Utils->parseMacTabEntry($machash->{$node}->[0]->{mac},$node);
}
my $net_params = xCAT::NetworkUtils->gen_net_boot_params($installnic, $primarynic, $mac, $nodebootif);
if (defined ($net_params->{ifname}) || defined ($net_params->{netdev})) {
$kcmdline .= " $net_params->{ifname} $net_params->{netdev} ";
} elsif (defined ($net_params->{BOOTIF}) && ($net_params->{setmac} || $arch=~ /ppc/)) {
$kcmdline .= " $net_params->{BOOTIF} ";
}
if (defined $sent->{serialport}) {
@@ -1113,49 +1118,30 @@ sub mkinstall
. $netserver . ":" . $httpport
. "$httpprefix/1";
my $netdev = "";
if ($ent->{installnic})
{
if ($ent->{installnic} eq "mac")
{
my $mactab = xCAT::Table->new("mac");
my $macref = $mactab->getNodeAttribs($node, ['mac']);
$netdev = xCAT::Utils->parseMacTabEntry($macref->{mac},$node);
}
else
{
$netdev = $ent->{installnic};
}
my $installnic;
my $primarynic;
my $mac;
if ($ent->{installnic}){
$installnic=$ent->{installnic};
}
if($ent->{primarynic}){
$primarynic=$ent->{primarynic};
}
elsif ($ent->{primarynic})
{
if ($ent->{primarynic} eq "mac")
{
my $mactab = xCAT::Table->new("mac");
my $macref = $mactab->getNodeAttribs($node, ['mac']);
$netdev = xCAT::Utils->parseMacTabEntry($macref->{mac},$node);
}
else
{
$netdev = $ent->{primarynic};
}
my $mactab = xCAT::Table->new("mac");
my $macref = $mactab->getNodeAttribs($node, ['mac']);
if($macref->{mac}){
$mac=xCAT::Utils->parseMacTabEntry($macref->{mac},$node);
}
else
{
$netdev = "bootif";
}
if ($netdev eq "") #why it is blank, no mac defined?
{
$callback->(
{
error => ["No mac.mac for $node defined"],
errorcode => [1]
}
);
}
unless ($netdev eq "bootif") { #if going by bootif, BOOTIF will suffice
$kcmdline .= " netdevice=" . $netdev;
my $net_params=xCAT::NetworkUtils->gen_net_boot_params($installnic, $primarynic, $mac);
if (defined ($net_params->{netdevice})) {
$kcmdline .= " $net_params->{netdevice} ";
}
# Add the kernel paramets for driver update disk loading
foreach (@dd_drivers) {
@@ -1464,33 +1450,30 @@ sub mksysclone
my $sent = $hents{$node}->[0];
my $kcmdline = "ramdisk_size=$ramdisk_size";
my $ksdev = "";
if ($ent->{installnic})
{
$ksdev = $ent->{installnic};
my $installnic;
my $primarynic;
my $mac;
if ($ent->{installnic}){
$installnic= $ent->{installnic};
}
if ($ent->{primarynic}){
$primarynic=$ent->{primarynic};
}
elsif ($ent->{primarynic})
{
$ksdev = $ent->{primarynic};
}
else
{
$ksdev = "bootif"; #if not specified, fall back to bootif
my $mactab = xCAT::Table->new("mac");
my $macref = $mactab->getNodeAttribs($node, ['mac']);
if($macref->{mac}){
$mac=xCAT::Utils->parseMacTabEntry($macref->{mac},$node);
}
if ($ksdev eq "mac")
{
my $mactab = xCAT::Table->new("mac");
my $macref = $mactab->getNodeAttribs($node, ['mac']);
$ksdev = xCAT::Utils->parseMacTabEntry($macref->{mac},$node);
}
unless ( $ksdev eq "bootif" ) {
$kcmdline .= " netdevice=" . $ksdev;
}
my $net_params = xCAT::NetworkUtils->gen_net_boot_params($installnic,$primarynic,$mac);
$kcmdline .= " $net_params->{netdevice} ";
if ($arch =~ /ppc/) {
$kcmdline .= " dhcptimeout=150";
$kcmdline .= " $net_params->{BOOTIF} ";
}
if (defined($sent->{serialport}))
@@ -1512,18 +1495,6 @@ sub mksysclone
}
$kcmdline .= " XCAT=$xcatmaster:$xcatdport xcatd=$xcatmaster:$xcatdport SCRIPTNAME=$imagename";
my $nodetab = xCAT::Table->new('nodetype');
my $archref = $nodetab->getNodeAttribs($node, ['arch']);
if ($archref->{arch} eq "ppc64"){
my $mactab = xCAT::Table->new('mac');
my $macref = $mactab->getNodeAttribs($node, ['mac']);
my $formatmac = xCAT::Utils->parseMacTabEntry($macref->{mac},$node);
$formatmac =~ s/:/-/g;
$formatmac = "01-".$formatmac;
$kcmdline .= " BOOTIF=$formatmac ";
}
my $i = "xcat/genesis.fs.$arch.gz";
if ( -r "$tftpdir/xcat/genesis.fs.$arch.lzma" ){
$i = "xcat/genesis.fs.$arch.lzma";
@@ -1710,7 +1681,7 @@ sub copycd
my $prod = <$mfile>;
close($mfile);
if ($prod =~ m/SUSE-Linux-Enterprise-Server/ || $prod =~ m/SUSE-Linux-Enterprise-Software-Development-Kit/ || $prod =~ m/SLES/)
if ($prod =~ m/SUSE-Linux-Enterprise-Server/ || $prod =~ m/SUSE-Linux-Enterprise-Software-Development-Kit/ || $prod =~ m/SLES/ || $prod =~ m/SDK/ )
{
if (-f "$mntpath/content") {
my $content;
@@ -1724,9 +1695,13 @@ sub copycd
unless ($distname) { $distname = $detdistname; }
}
unless ($distname) {
if (/^DISTRO/) {
$_ =~ /sles:(\d+),/;
$distname = "sles".$1;
if (/^DISTRO/ || /^LABEL/) {
# only set to $1 if the regex was successful
if ($_ =~ /sles:(\d+),/) {
$distname = "sles".$1;
} elsif ($_ =~ /Software Development Kit\s*(\d+)/) {
$distname = "sles".$1;
}
}
}
}
@@ -1736,8 +1711,15 @@ sub copycd
$detdistname = "sles" . $subparts[0];
unless ($distname) { $distname = "sles" . $subparts[0] };
}
if($prod =~ m/Software-Development-Kit/) {
if ($distname eq 'sles11.3') {
if($prod =~ m/Software-Development-Kit/ || $prod =~ m/SDK/ ) {
#
# It's been seen that the 3rd disc on the SDK ISO images are using 'media.1' instead of
# media.3 to represent the 3rd disc. This code here is to work around this issue. I'm not
# sure why this only applies to sles 11.3 since I do see the same issue in sles 11. But will
# keep the logic as is... checking for >= 11.3
#
(my $numver = $distname) =~ s/[^0-9]//g;
if ($numver >= 11.3 ) {
if ($discnumber == 1 and $totaldiscnumber == 1) { #disc 3, aka disc1 of 'debug'
$discnumber = 3;
}
+1 -1
View File
@@ -786,7 +786,7 @@ sub liteItem {
# the /etc/mtab should be handled every time even the parent /etc/ has been handled.
# if adding /etc/ to litefile, only tmpfs should be used.
if ($entry[1] == "/etc/mtab") {
if ($entry[1] eq "/etc/mtab") {
$isChild = 0;
}
+1 -1
View File
@@ -162,7 +162,7 @@ sub process_request {
my $mtms = $req->{'mtm'}->[0]."*".$req->{'serial'}->[0];
my $tmp_nodes = $::XCATVPDHASH{$mtms};
foreach (@$tmp_nodes) {
if ($::XCATPPCHASH{$_}) {
if ($::XCATMPHASH{$_}) {
$pbmc_node = $_;
}
}
+1 -1
View File
@@ -3185,7 +3185,7 @@ sub updateOS
xCAT::MsgUtils->message("I", $rsp, $callback);
}
elsif ("$installOS$version" =~ m/sles11/i)
elsif ("$installOS$version" =~ m/sles/i)
{
# SUSE repository path - http://10.1.100.1/install/sles10.3/s390x/1/
+2 -4
View File
@@ -742,11 +742,9 @@ sub copycd
$darch = "x86_64";
} elsif (/BuildBranch=win7_rtm/){
$distname = "win7";
} elsif (/BuildBranch=winblue_rtm/){
} elsif (/BuildBranch=winblue_r/){
if (-r $mntpath . "/sources/background_svr.bmp") {
if (! -r $mntpath . "/sources/EI.CFG") {
$distname = "win2012r2";
}
$distname = "win2012r2";
}
} elsif (/BuildBranch=win8_rtm/){
if (-r $mntpath . "/sources/background_cli.bmp") {
+12 -11
View File
@@ -1126,7 +1126,7 @@ sub changeVM {
}
$out = xCAT::zvmUtils->rExecute($::SUDOER, $node, "echo 0x$wwpn:0x$lun >> /etc/sysconfig/hardware/hwcfg-zfcp-bus-ccw-0.0.$device");
} elsif ( $os =~ m/sles11/i ) {
} elsif ( $os =~ m/sles/i ) {
$out = `ssh $::SUDOER\@$node "$::SUDO /sbin/zfcp_host_configure 0.0.$device 1"`;
if ($out) {
xCAT::zvmUtils->printLn($callback, "$node: $out");
@@ -1932,12 +1932,13 @@ sub changeVM {
# SLES 10: /etc/sysconfig/hardware/hwcfg-zfcp-bus-ccw-*
# SLES 11: /etc/udev/rules.d/51-zfcp*
my $expression = "";
if ( $os =~ m/sles10/i ) {
if ( $os =~ m/sles/i ) {
$expression = "/$lun/d";
$out = `ssh $::SUDOER\@$node "$::SUDO sed -i -e $expression /etc/sysconfig/hardware/hwcfg-zfcp-bus-ccw-0.0.$device"`;
} elsif ( $os =~ m/sles11/i ) {
$expression = "/$lun/d";
$out = `ssh $::SUDOER\@$node "$::SUDO sed -i -e $expression /etc/udev/rules.d/51-zfcp-0.0.$device.rules"`;
if ( $os =~ m/sles10/i ) {
$out = `ssh $::SUDOER\@$node "$::SUDO sed -i -e $expression /etc/sysconfig/hardware/hwcfg-zfcp-bus-ccw-0.0.$device"`;
} else {
$out = `ssh $::SUDOER\@$node "$::SUDO sed -i -e $expression /etc/udev/rules.d/51-zfcp-0.0.$device.rules"`;
}
} elsif ( $os =~ m/rhel/i ) {
$expression = "/$lun/d";
$out = `ssh $::SUDOER\@$node "$::SUDO sed -i -e $expression /etc/zfcp.conf"`;
@@ -4440,7 +4441,7 @@ EOM"`;
}
# If it is SLES 11 - ifcfg-qeth file is in /etc/sysconfig/network
elsif ( $srcOs =~ m/sles11/i ) {
elsif ( $srcOs =~ m/sles/i ) {
$out = `ssh $::SUDOER\@$hcp "$::SUDO grep -H -i -r $srcNicAddr $cloneMntPt/etc/sysconfig/network/ifcfg-eth*"`;
xCAT::zvmUtils->printSyslog("grep -H -i -r $srcNicAddr $cloneMntPt/etc/sysconfig/network/ifcfg-eth*");
xCAT::zvmUtils->printSyslog("$out");
@@ -5081,12 +5082,12 @@ sub nodeSet {
my $device;
my $chanIds = "$readChannel $writeChannel $dataChannel";
# SLES 11
if ( $os =~ m/sles11/i ) {
$device = "eth0";
} else {
# SLES
if ( $os =~ m/sles10/i ) {
# SLES 10
$device = "qeth-bus-ccw-$readChannel";
} else {
$device = "eth0";
}
$out =
+3 -3
View File
@@ -139,10 +139,10 @@ until ($quit) {
my $winboot = $winpepath."Boot/pxeboot.0";
if ($archp) {
my $clienttype = substr($data, $archp, 5);
if ($clienttype == "00000") {
if ($clienttype eq "00000") {
#if ("$package[$archp]$package[$archp+1]$package[$archp+2]$package[$archp+3]$package[$archp+4]" == "00000") {
$winboot = $winpepath."Boot/pxeboot.0";
} elsif ($clienttype == "00007") {
} elsif ($clienttype eq "00007") {
$winboot = $winpepath."Boot/bootmgfw.efi";
}
}
@@ -322,7 +322,7 @@ sub my_ip_facing
(my $curnet, my $maskbits) = split /\//, $elems[2];
my $curmask = 2**$maskbits - 1 << (32 - $maskbits);
my $curn = unpack("N", inet_aton($curnet));
if (($noden & $curmask) == ($curn & $curmask))
if (($noden & $curmask) eq ($curn & $curmask))
{
return inet_aton($curnet);
}
+11
View File
@@ -1250,6 +1250,7 @@ sub initDB
$chtabcmds .= "$::XCATROOT/sbin/chtab key=cleanupxcatpost site.value=no;";
$chtabcmds .= "$::XCATROOT/sbin/chtab key=dhcplease site.value=43200;";
$chtabcmds .= "$::XCATROOT/sbin/chtab key=auditnosyslog site.value=0;";
$chtabcmds .= "$::XCATROOT/sbin/chtab key=xcatsslversion site.value=TLSv1;";
#$chtabcmds .= "$::XCATROOT/sbin/chtab key=useflowcontrol site.value=yes;"; # need to fix 4031
if ($::osname eq 'AIX')
@@ -1504,6 +1505,16 @@ sub initDB
}
}
# add default value to site.xcatsslversion
$cmds = "$::XCATROOT/sbin/chtab key=xcatsslversion site.value=TLSv1;";
$outref = xCAT::Utils->runcmd("$cmds", 0);
if ($::RUNCMD_RC != 0)
{
xCAT::MsgUtils->message('E',"Could not add default value for site.xcatsslversion.");
}
}
# remove xcatserver,xcatclient
# from the postscripts. They are now called by servicenode
+52 -10
View File
@@ -113,9 +113,9 @@ use Sys::Syslog qw(:DEFAULT setlogsock);
openlog("xcatd",,"local4");
# turn off warnings for call to setlogsock. puts out warning message if
# syslog tcp port not defined in /etc/services. this can safely be ignored.
no warnings qw(Sys::Syslog);
no warnings;
setlogsock(["tcp","unix","stream"]);
use warnings qw(Sys::Syslog);
use warnings;
use xCAT::NotifHandler;
use xCAT_monitoring::monitorctrl;
@@ -278,6 +278,10 @@ sub daemonize {
}
my %cmd_handlers;
my $rescanreadpipe;
my $rescanwritepipe;
my $rescanrselect;
my $rescanrequest = "rescanplugins";
sub do_installm_service {
unless ($sport) { return; }
#This function servers as a handler for messages from installing nodes
@@ -341,6 +345,19 @@ sleep 0.05; #up to 50 ms outage possible
my $conn;
next unless $conn = $socket->accept;
# check if a rescanplugins request has come in
my @rescans;
if (@rescans = $rescanrselect->can_read(0)) {
foreach my $rrequest (@rescans) {
my $rescan_request = fd_retrieve($rrequest);
if ($$rescan_request =~ /rescanplugins/) {
scan_plugins('','1');
} else {
print "ignoring unrecognized pipe request received by install monitor from ssl listener: $rescan_request \n";
}
}
}
my $client_name;
my $client_aliases;
my @clients;
@@ -551,12 +568,12 @@ sub do_discovery_process {
$dispatch_requests=0;
populate_site_hash();
populate_vpd_hash();
populate_ppc_hash();
populate_mp_hash();
while (not $quit) {
if ((time()-$vintage)> 15) {
populate_site_hash();
populate_vpd_hash();
populate_ppc_hash();
populate_mp_hash();
$vintage = time();
} #site table reread every 15 second
my $msg = fd_retrieve($broker);
@@ -991,6 +1008,14 @@ unless ($pid_UDP) {
xexit(0);
}
close($sslctl);
# Set up communication pipe to have ssl listener tell install monitor to
# rescanplugins
if ( !(socketpair($rescanreadpipe, $rescanwritepipe,AF_UNIX,SOCK_STREAM,PF_UNSPEC)) ) {
xCAT::MsgUtils->message("S", "socketpair failed: $!");
}
$rescanrselect = new IO::Select;
$rescanrselect->add($rescanreadpipe);
$pid_MON = xCAT::Utils->xfork;
if (! defined $pid_MON) {
xCAT::MsgUtils->message("S", "Unable to fork installmonitor");
@@ -1509,6 +1534,9 @@ sub plugin_command {
# rescanplugins request gets handled directly here in xcatd
if ($req->{command}->[0] eq 'rescanplugins') {
scan_plugins($chwritepipe,'1');
if ($rescanwritepipe) {
store_fd(\$rescanrequest,$rescanwritepipe);
}
} else {
${"xCAT_plugin::".$modname."::"}{process_request}->($req,$callback,\&do_request);
}
@@ -1602,6 +1630,9 @@ sub plugin_command {
# rescanplugins request gets handled directly here in xcatd
if ($req->{command}->[0] eq 'rescanplugins') {
scan_plugins($chwritepipe,'1');
if ($rescanwritepipe) {
store_fd(\$rescanrequest,$rescanwritepipe);
}
} else {
${"xCAT_plugin::".$modname."::"}{process_request}->($req,$callback,\&do_request);
}
@@ -1836,6 +1867,9 @@ sub dispatch_request {
# rescanplugins request gets handled directly here in xcatd
if ($_->{command}->[0] eq 'rescanplugins') {
scan_plugins($chwritepipe,'1');
if ($rescanwritepipe) {
store_fd(\$rescanrequest,$rescanwritepipe);
}
} else {
${"xCAT_plugin::".$modname."::"}{process_request}->($_,$dispatch_cb,\&do_request);
}
@@ -1925,6 +1959,9 @@ sub dispatch_request {
# rescanplugins request gets handled directly here in xcatd
if ($_->{command}->[0] eq 'rescanplugins') {
scan_plugins($chwritepipe,'1');
if ($rescanwritepipe) {
store_fd(\$rescanrequest,$rescanwritepipe);
}
} else {
${"xCAT_plugin::".$modname."::"}{process_request}->($_,\&dispatch_callback,\&do_request);
}
@@ -2108,14 +2145,14 @@ sub populate_vpd_hash {
push @{$::XCATVPDHASH{$mtms}}, $_->{node};
}
}
sub populate_ppc_hash {
%::XCATPPCHASH=();
my $ppctab = xCAT::Table->new('ppc',-create=>0);
unless ($ppctab) {return;}
my @entries = $ppctab->getAllAttribs(qw/node nodetype/);
sub populate_mp_hash {
%::XCATMPHASH=();
my $mptab = xCAT::Table->new('mp',-create=>0);
unless ($mptab) {return;}
my @entries = $mptab->getAllAttribs(qw/node nodetype/);
foreach (@entries) {
if ($_->{nodetype} and $_->{nodetype} eq 'pbmc') {
$::XCATPPCHASH{$_->{node}}=$_->{nodetype};
$::XCATMPHASH{$_->{node}}=$_->{nodetype};
}
}
}
@@ -2392,6 +2429,11 @@ sub relay_fds { #Relays file descriptors from pipes to children to the SSL socke
my $rfh;
my $rc = @readyset;
my $text;
# A PIPE signal might be received when run fd_retrieve from the plugin sub processors
# This mostly happens when there are multiple plugins are called for certain command
# So spkit the pipe error handle
$pipeexpected=1;
foreach $rfh (@readyset) { #go through each child, extract a complete, atomic message
my $line;
my $resp;
@@ -0,0 +1,11 @@
#Please make sure there is a space between @ and group name
yp-tools
wget
vim-minimal
ntpdate
nfs-utils
rsync
net-tools
openssh-server
util-linux-ng
rsyslog
@@ -0,0 +1,156 @@
#egan@us.ibm.com
#
#cmdline
lang en_US
#
# Where's the source?
# nfs --server hostname.of.server or IP --dir /path/to/RH/CD/image
#
#nfs --server #XCATVAR:INSTALL_NFS# --dir #XCATVAR:INSTALL_SRC_DIR#
%include /tmp/repos
#device ethernet e100
keyboard "us"
#
# Clear the MBR
#
zerombr
#
# Wipe out the disk
#
clearpart --all --initlabel
#clearpart --linux
#key --skip
#
# Customize to fit your needs
#
#XCAT_PARTITION_START#
#No RAID
#/boot really significant for this sort of setup nowadays?
#part /boot --size 50 --fstype ext3
%include /tmp/partitioning
#XCAT_PARTITION_END#
#RAID 0 /scr for performance
#part / --size 1024 --ondisk sda
#part swap --size 512 --ondisk sda
#part /var --size 1024 --ondisk sdb
#part swap --size 512 --ondisk sdb
#part raid.01 --size 1 --grow --ondisk sda
#part raid.02 --size 1 --grow --ondisk sdb
#raid /scr --level 0 --device md0 raid.01 raid.02
#Full RAID 1 Sample
#part raid.01 --size 50 --ondisk sda
#part raid.02 --size 50 --ondisk sdb
#raid /boot --level 1 --device md0 raid.01 raid.02
#
#part raid.11 --size 1024 --ondisk sda
#part raid.12 --size 1024 --ondisk sdb
#raid / --level 1 --device md1 raid.11 raid.12
#
#part raid.21 --size 1024 --ondisk sda
#part raid.22 --size 1024 --ondisk sdb
#raid /var --level 1 --device md2 raid.21 raid.22
#
#part raid.31 --size 1024 --ondisk sda
#part raid.32 --size 1024 --ondisk sdb
#raid swap --level 1 --device md3 raid.31 raid.32
#
#part raid.41 --size 1 --grow --ondisk sda
#part raid.42 --size 1 --grow --ondisk sdb
#raid /scr --level 1 --device md4 raid.41 raid.42
#
# bootloader config
# --append <args>
# --useLilo
# --md5pass <crypted MD5 password for GRUB>
#
bootloader
#
# install or upgrade
#
install
#
# text mode install (default is graphical)
#
text
#
# firewall
#
firewall --disabled
#
# mouse selection
#
#mouse genericps/2 --emulthree
#
# Select a zone
# Add the --utc switch if your hardware clock is set to GMT
#
#timezone US/Hawaii
#timezone US/Pacific
#timezone US/Mountain
#timezone US/Central
#timezone US/Eastern
timezone --utc "#TABLE:site:key=timezone:value#"
#
# Don't do X
#
skipx
#
# To generate an encrypted root password use:
#
# perl -e 'print crypt("blah","Xa") . "\n";'p
# openssl passwd -apr1 -salt xxxxxxxx password
#
# where "blah" is your root password.
#
#rootpw --iscrypted XaLGAVe1C41x2
#rootpw XaLGAVe1C41x2 --iscrypted
rootpw --iscrypted #CRYPT:passwd:key=system,username=root:password#
#
# NIS setup: auth --enablenis --nisdomain sensenet
# --nisserver neptune --useshadow --enablemd5
#
# OR
auth --useshadow --enablemd5
#
# SE Linux
#
selinux --disabled
#
# Reboot after installation
#
reboot
#
#end of section
#
%packages --ignoremissing
#INCLUDE_DEFAULT_PKGLIST#
%end
%pre
#INCLUDE:#ENV:XCATROOT#/share/xcat/install/scripts/pre.rh.rhel7#
%end
%post
#INCLUDE:#ENV:XCATROOT#/share/xcat/install/scripts/post.rh#
%end
@@ -0,0 +1,36 @@
#Please make sure there is a space between @ and group name
@ Network Infrastructure Server
@ System administration tools
@ System Management
@ X Window System
@ Development Tools
autofs
ksh
tcsh
ntp
tftp
xinetd
rsh
rsh-server
psacct
nfs-utils
net-snmp
rsync
yp-tools
ypserv
ypbind
m4
sendmail-cf
gdb
binutils
openssh-server
util-linux
perl-DBD-MySQL
perl-Socket6
unixODBC
perl-DBD-MySQL
mysql-connector-odbc
perl-DBD-Pg
wget
util-linux-ng
net-tools
@@ -0,0 +1 @@
xcat/xcat-dep/rh7/ppc64le/systemimager-client
+2 -2
View File
@@ -33,14 +33,14 @@ echo "DHCLIENT_PRIMARY_DEVICE=yes" >> ifcfg-$PRINIC
fi
perl -pi -e 's/^FIREWALL="yes"/FIREWALL="no"/' /etc/sysconfig/network/config
/etc/init.d/network restart
service network restart
RAND=$(perl -e 'print int(rand(50)). "\n"')
sleep $RAND
jsi=0
while [ $(hostname) == 'linux' ]
do
if [ $jsi -gt 10 ]; then
if [ $jsi -gt 180 ]; then
logger "Slept too long!"
exit
fi
@@ -32,7 +32,7 @@ done >>/etc/resolv.conf
ln -sf /bin/bash /bin/sh
#
#delete the useless apt repo
sed -i 's/^deb.*updates.*$/#&/g' /etc/apt/sources.list
#sed -i 's/^deb.*updates.*$/#&/g' /etc/apt/sources.list
# Run xCAT post install
#
export MASTER_IP="#XCATVAR:XCATMASTER#"
@@ -185,53 +185,54 @@ echo "$TMP" > /xcatpost/mypostscript
export NODE=#TABLE:nodelist:THISNODE:node#
export OSVER=#TABLE:nodetype:THISNODE:os#
export ARCH=#TABLE:nodetype:THISNODE:arch#
export CONSOLEPORT=#TABLE:nodehm:THISNODE:serialport#
export CONSOLEPORT=#TABLEBLANKOKAY:nodehm:THISNODE:serialport#
#addsiteyum
if [[ -r /boot/grub/menu.lst ]]; then
sed -i 's/^serial/#serial/' /boot/grub/menu.lst
sed -i 's/^terminal/#terminal/' /boot/grub/menu.lst
elif [[ -r /boot/grub/grub.cfg ]] ; then
UPDATEGRUB=1
fi
export PROVMETHOD=#TABLE:nodetype:THISNODE:provmethod#
export KERNELARGS=#TABLE:linuximage:$PROVMETHOD:addkcmdline#
if [[ -n $KERNELARGS ]] ; then
sed -i "s/\(GRUB_CMDLINE_LINUX=\).*/\1\"$KERNELARGS\"/" /etc/default/grub
UPDATEGRUB=1
update-grub
fi
if echo "$ARCH" | grep -i 'ppc64'; then
if [ -z "$CONSOLEPORT" ] ; then
export CONSOLEPORT=0
fi
CONSOLE="hvc$CONSOLEPORT"
if [[ -r /etc/default/grub ]] ; then
sed -i "s/GRUB_CMDLINE_LINUX_DEFAULT=.*/GRUB_CMDLINE_LINUX_DEFAULT=\"console=$CONSOLE\"/" /etc/default/grub
else
echo "GRUB_CMDLINE_LINUX_DEFAULT=\"console=$CONSOLE\"" > /etc/default/grub
fi
UPDATEGRUB=1
update-grub
cat >/etc/init/$CONSOLE\.conf << 'EOF'
start on stopped rc RUNLEVEL=[2345] and (not-container or container container CONTAINER=lxc or container CONTAINER=lxc-libvirt)
start on stopped rc RUNLEVEL=[2345] and (
not-container or
container CONTAINER=lxc or
container CONTAINER=lxc-libvirt)
stop on runlevel [!2345]
respawn
#exec /sbin/getty -L 115200 hvc0 vt102
script
for i in `cat /proc/cmdline`; do
KEY=`echo $i|cut -d= -f 1`
if [ "$KEY" == "console" -a "$i" != "console=tty0" ]; then
VALUE=`echo $i | cut -d= -f 2`
COTTY=`echo $VALUE|cut -d, -f 1`
COSPEED=`echo $VALUE|cut -d, -f 2|cut -dn -f 1`
exec /sbin/getty -L $COSPEED $COTTY vt102
VALUE=`echo $i | awk -F= '{print $2}'`
COTTY=`echo $VALUE|awk -F, '{print $1}'`
COSPEED=`echo $VALUE|awk -F, '{print $2}'|awk -Fn '{print $1}'`
break
fi
done
exec /sbin/getty -L $COSPEED $COTTY vt102
end script
EOF
fi
if [[ $UPDATEGRUB -eq 1 ]]; then
update-grub
fi
sed -i 's/\(deb.*security.*\)/#\1/' /etc/apt/sources.list
#sed -i 's/\(deb.*security.*\)/#\1/' /etc/apt/sources.list
#iso does not contains source deb packages
sed -i 's/^\(\s*deb-src.*install.*\)$/#\1/g' /etc/apt/sources.list
#sed -i 's/^\(\s*deb-src.*install.*\)$/#\1/g' /etc/apt/sources.list
#delete the 127.0.1.1 line from /etc/hosts
sed -i '/127.0.1.1/d' /etc/hosts
updateflag.awk $MASTER 3002
@@ -87,6 +87,10 @@ try:
percent = 0
count = 0
numpack = 0
pre = 0
if(os.path.isfile('/tmp/xcatpre.log')):
ilog = '/tmp/xcatpre.log'
pre = 1
if(os.path.isfile('/tmp/packaging.log')):
ilog = '/tmp/packaging.log'
if(os.path.isfile('/mnt/sysimage/root/install.log')):
@@ -101,7 +105,7 @@ try:
firstline = linecache.getline(ilog,1)
line = linecache.getline(ilog,count)
linecache.clearcache()
if(line and not post):
if(line and not post and not pre):
r1 = re.compile("^Installing (\d+) ")
m1 = r1.search(firstline)
if m1:
@@ -128,7 +132,7 @@ try:
else:
newline = "prep"
line = "installing " + newline
if(line and post):
if(line and post and not pre):
line = "installing " + line
if(not line):
line = "installing prep"
+7 -3
View File
@@ -75,6 +75,10 @@ try:
percent = 0
count = 0
numpack = 0
pre = 0
if(os.path.isfile('/tmp/xcatpre.log')):
ilog = '/tmp/xcatpre.log'
pre = 1
if(os.path.isfile('/tmp/packaging.log')):
ilog = '/tmp/packaging.log'
if(os.path.isfile('/mnt/sysimage/tmp/post.log')):
@@ -84,7 +88,7 @@ try:
count = len(open(ilog).readlines())
line = linecache.getline(ilog,count)
linecache.clearcache()
if(line and not post):
if(line and not post and not pre):
r2 = re.compile("Installing ([^ ]*) \((\d+)/(\d+)\)")
m2 = r2.search(line)
if m2:
@@ -92,7 +96,7 @@ try:
else:
newline = "post"
line = "installing " + newline
if(line and post):
if(line and post and not pre):
line = "installing " + line
if(not line):
line = "installing prep"
@@ -196,7 +200,7 @@ if uname -r|grep '^3.*el7' > /dev/null; then
EFIFSTYPE=efi
fi
if [ `uname -m` = "ppc64" ]; then
if [ `uname -m` = "ppc64" -o `uname -m` = "ppc64le" ]; then
echo 'part None --fstype "PPC PReP Boot" --ondisk '$instdisk' --size 8' >> /tmp/partitioning
fi
if [ -d /sys/firmware/efi ]; then
@@ -16,10 +16,7 @@ d-i netcfg/dhcp_timeout string 120
### Mirror settings
# If you select ftp, the mirror/country string does not need to be set.
d-i mirror/country string manual
d-i mirror/protocol string http
d-i mirror/http/directory string #INCLUDE_OSIMAGE_PKGDIR#
d-i mirror/http/proxy string
#MIRRORSPEC#
# Suite to install.
#d-i mirror/suite string testing
@@ -52,7 +49,7 @@ d-i partman/early_command string \
head -n1 /tmp/devs-with-boot | egrep -o '\S+[^0-9]' > /tmp/boot_disk; \
rm /tmp/devs-with-boot 2>/dev/null || true; \
else \
DEV=`ls /dev/disk/by-path/* -l | egrep -o '/dev.*sd[^0-9]$' | sort -t : -k 1 -k 2 -k 3 -k 4 -k 5 -k 6 -k 7 -k 8 -g | head -n1 | egrep -o 'sd.*$'`; \
DEV=`ls /dev/disk/by-path/* -l | egrep -o '/dev.*[s|h|v]d[^0-9]$' | sort -t : -k 1 -k 2 -k 3 -k 4 -k 5 -k 6 -k 7 -k 8 -g | head -n1 | egrep -o '[s|h|v]d.*$'`; \
if [[ "$DEV" == "" ]]; then DEV="sda"; fi; \
echo "/dev/$DEV" > /tmp/boot_disk; \
fi; \
@@ -103,7 +100,7 @@ tasksel tasksel/first multiselect standard
d-i pkgsel/include string #INCLUDE_DEFAULT_PKGLIST_PRESEED#
d-i debian-installer/allow_unauthenticated string true
d-i debian-installer/allow_unauthenticated boolean true
d-i pkgsel/update-policy select none
d-i pkgsel/updatedb boolean false
@@ -120,12 +117,12 @@ xserver-xorg xserver-xorg/config/monitor/mode-list \
select 1024x768 @ 60 Hz
# To workaround the "Unmount partitions that are in use?" question,
# run the "umount /media" after the preseed is read in
d-i preseed/early_command string wget http://`cat /tmp/xcatserver`/install/autoinst/#HOSTNAME#.pre; \
chmod u+x #HOSTNAME#.pre; \
./#HOSTNAME#.pre
# To workaround the "Unmount partitions that are in use?" question
d-i preseed/early_command string umount /media || true
./#HOSTNAME#.pre; \
umount /media || true
d-i preseed/late_command string wget http://`cat /tmp/xcatserver`/install/autoinst/#HOSTNAME#.post; \
chmod u+x #HOSTNAME#.post; \
@@ -0,0 +1,8 @@
openssh-server
ntp
gawk
nfs-common
snmpd
libdbd-mysql-perl
libodbc1
@@ -0,0 +1,135 @@
### Localization
d-i debian-installer/locale string en_US
d-i localechooser/supported-locales multiselect en_US.UTF-8
# Keyboard Selection
d-i console-setup/ask_detect boolean false
d-i keyboard-configuration/layoutcode string en
### Network Configuration
d-i netcfg/get_hostname string unassigned-hostname
d-i netcfg/get_domain string unassigned-domain
d-i netcfg/wireless_wep string
d-i netcfg/dhcp_timeout string 120
### Mirror settings
# If you select ftp, the mirror/country string does not need to be set.
#MIRRORSPEC#
# Suite to install.
#d-i mirror/suite string testing
# Suite to use for loading installer components (optional).
#d-i mirror/udeb/suite string testing
### Partitioning
# This creates a small /boot partition, suitable
# swap, and uses the rest of the space for the root partition:
d-i partman-auto/method string regular
d-i partman-lvm/device_remove_lvm boolean true
d-i partman-md/device_remove_md boolean true
#create the /tmp/partitioning based on the uefi or legacy bios
d-i partman/early_command string \
set -x; \
rm /tmp/devs-with-boot 2>/dev/null || true; \
for d in $(list-devices partition); do \
mkdir -p /tmp/mymount; \
rc=0; \
mount $d /tmp/mymount || rc=$?; \
if [[ $rc -eq 0 ]]; then \
[[ -d /tmp/mymount/boot ]] && echo $d >>/tmp/devs-with-boot; \
umount /tmp/mymount; \
fi \
done; \
if [[ -e /tmp/devs-with-boot ]]; then \
head -n1 /tmp/devs-with-boot | egrep -o '\S+[^0-9]' > /tmp/boot_disk; \
rm /tmp/devs-with-boot 2>/dev/null || true; \
else \
DEV=`ls /dev/disk/by-path/* -l | egrep -o '/dev.*sd[^0-9]$' | sort -t : -k 1 -k 2 -k 3 -k 4 -k 5 -k 6 -k 7 -k 8 -g | head -n1 | egrep -o 'sd.*$'`; \
if [[ "$DEV" == "" ]]; then DEV="sda"; fi; \
echo "/dev/$DEV" > /tmp/boot_disk; \
fi; \
debconf-set partman-auto/disk "$(cat /tmp/boot_disk)"
d-i partman-auto/expert_recipe_file string /tmp/partitioning
# This makes partman automatically partition without confirmation, provided
# that you told it what to do using one of the methods above.
d-i partman/confirm_write_new_label boolean true
d-i partman/choose_partition select finish
d-i partman/confirm boolean true
d-i partman/confirm_nooverwrite boolean true
### Account setup
d-i passwd/root-login boolean true
d-i passwd/make-user boolean false
d-i passwd/root-password-crypted password #CRYPT:passwd:key=system,username=root:password#
### Clock and time zone setup
d-i clock-setup/ntp boolean true
d-i clock-setup/ntp-server string #TABLE:site:key=master:value#
d-i clock-setup/utc boolean true
d-i time/zone string #TABLE:site:key=timezone:value#
### Apt setup
d-i apt-setup/multiverse boolean false
d-i apt-setup/universe boolean false
d-i apt-setup/backports boolean false
d-i apt-setup/updates boolean false
### Boot loader installation
d-i grub-installer/only_debian boolean true
### Package selection
tasksel tasksel/first multiselect standard
# gawk required for the xCAT scripts to work
# Otherwise it installs mawk, which doesn't work
d-i pkgsel/include string #INCLUDE_DEFAULT_PKGLIST_PRESEED#
d-i debian-installer/allow_unauthenticated boolean true
d-i pkgsel/update-policy select none
d-i pkgsel/updatedb boolean false
### Finishing up the installation
d-i finish-install/reboot_in_progress note
### X configuration
xserver-xorg xserver-xorg/autodetect_monitor boolean true
xserver-xorg xserver-xorg/config/monitor/selection-method \
select medium
xserver-xorg xserver-xorg/config/monitor/mode-list \
select 1024x768 @ 60 Hz
# To workaround the "Unmount partitions that are in use?" question,
# run the "umount /media" after the preseed is read in
d-i preseed/early_command string wget http://`cat /tmp/xcatserver`/install/autoinst/#HOSTNAME#.pre; \
chmod u+x #HOSTNAME#.pre; \
./#HOSTNAME#.pre; \
umount /media || true
d-i preseed/late_command string wget http://`cat /tmp/xcatserver`/install/autoinst/#HOSTNAME#.post; \
chmod u+x #HOSTNAME#.post; \
cp ./#HOSTNAME#.post /target/root/post.script; \
mount -o bind /proc /target/proc -t proc; \
mount -o bind /dev /target/dev; \
mount -o bind /dev/pts /target/dev/pts -t devpts; \
mount -o bind /sys /target/sys; \
chroot /target /root/post.script; \
cp /target/etc/network/interfaces /etc/network/interfaces
@@ -0,0 +1,6 @@
mariadb-client
mariadb-common
mariadb-server
xcat-core/xcatsn
xcat-dep/conserver-xcat
@@ -121,6 +121,9 @@ export NICCUSTOMSCRIPTS
NICNETWORKS=#TABLE:nics:$NODE:nicnetworks#
export NICNETWORKS
NICEXTRAPARAMS=#TABLE:nics:$NODE:nicextraparams#
export NICEXTRAPARAMS
CFGMGR=#TABLE:cfgmgt:$NODE:cfgmgr#
export CFGMGR
@@ -68,9 +68,9 @@ xCATCmd () {
# $2 is the command
ARCH=`uname -m`
if [ x$ARCH = x"ppc64" -a x$OS = x"rh" ]; then
echo "<xcatrequest>\n<command>${2}</command>\n</xcatrequest>" | /usr/sbin/chroot ${MNTDIR} /usr/bin/openssl s_client -quiet -connect ${1} -rand /bin/nice 2>/dev/null
echo "<xcatrequest>\n<command>${2}</command>\n</xcatrequest>" | /usr/sbin/chroot ${MNTDIR} /usr/bin/openssl s_client -quiet -no_ssl3 -no_ssl2 -connect ${1} -rand /bin/nice 2>/dev/null
else
echo "<xcatrequest>\n<command>${2}</command>\n</xcatrequest>" | LD_LIBRARY_PATH=${MNTDIR}/lib64:${MNTDIR}/usr/lib64 ${MNTDIR}/usr/bin/openssl s_client -quiet -connect ${1} -rand /bin/nice 2>/dev/null
echo "<xcatrequest>\n<command>${2}</command>\n</xcatrequest>" | LD_LIBRARY_PATH=${MNTDIR}/lib64:${MNTDIR}/usr/lib64 ${MNTDIR}/usr/bin/openssl s_client -quiet -no_ssl3 -no_ssl2 -connect ${1} -rand /bin/nice 2>/dev/null
fi
}
@@ -128,7 +128,7 @@ GetSyncInfo () {
xCATCmd () {
# $1 is the xCAT server
# $2 is the command
echo "<xcatrequest>\n<command>${2}</command>\n</xcatrequest>" | LD_LIBRARY_PATH=${MNTDIR}/lib64:${MNTDIR}/usr/lib64 ${MNTDIR}/usr/bin/openssl s_client -quiet -connect ${1} -rand /bin/nice 2>/dev/null
echo "<xcatrequest>\n<command>${2}</command>\n</xcatrequest>" | LD_LIBRARY_PATH=${MNTDIR}/lib64:${MNTDIR}/usr/lib64 ${MNTDIR}/usr/bin/openssl s_client -quiet -no_ssl3 -no_ssl2 -connect ${1} -rand /bin/nice 2>/dev/null
}
@@ -128,7 +128,7 @@ GetSyncInfo () {
xCATCmd () {
# $1 is the xCAT server
# $2 is the command
echo "<xcatrequest>\n<command>${2}</command>\n</xcatrequest>" | /usr/sbin/chroot ${MNTDIR} /usr/bin/openssl s_client -quiet -connect ${1} -rand /bin/nice 2>/dev/null
echo "<xcatrequest>\n<command>${2}</command>\n</xcatrequest>" | /usr/sbin/chroot ${MNTDIR} /usr/bin/openssl s_client -quiet -no_ssl3 -no_ssl2 -connect ${1} -rand /bin/nice 2>/dev/null
}
@@ -0,0 +1 @@
compute.rhels7.ppc64.exlist
@@ -0,0 +1 @@
compute.rhels7.ppc64.pkglist
@@ -0,0 +1 @@
compute.rhels7.ppc64.postinstall
@@ -252,7 +252,9 @@ if [ -z $STATEMNT ]; then
MACX=`ip link show $netdev | grep ether | awk '{print $2}'`
elif [ ! -z "$BOOTIF" ]; then
MACX=$BOOTIF
ETHX=$(getdevfrommac $BOOTIF)
MACX=${MACX#01-}
MACX=${MACX//-/:}
ETHX=$(getdevfrommac $MACX)
fi
if [ ! -z "$MACX" ] && [ ! -z "$ETHX" ]; then
@@ -1,29 +1,29 @@
aaa_base
bash
nfs-utils
openssl
dhcpcd
kernel-default
openssh
procps
psmisc
wget
vim
sysconfig
syslog-ng
klogd
dbus-1
dbus-1-glib
hal
pam
pam-modules
rsync
bc
timezone
iputils
libzio
s390-32
s390-tools
mdadm
udev
ntp
aaa_base
bash
nfs-utils
openssl
dhcpcd
kernel-default
openssh
procps
psmisc
wget
vim
sysconfig
syslog-ng
klogd
dbus-1
dbus-1-glib
hal
pam
pam-modules
rsync
bc
timezone
iputils
libzio
s390-32
s390-tools
mdadm
udev
ntp
@@ -0,0 +1,36 @@
./boot*
./etc/bootsplash/themes/SLES/images*
./opt/sci/include*
./usr/include*
./usr/lib/locale*
./usr/lib/perl5/5.10.0/ppc64-linux-thread-multi/auto/Encode/CN*
./usr/lib/perl5/5.10.0/ppc64-linux-thread-multi/auto/Encode/JP*
./usr/lib/perl5/5.10.0/ppc64-linux-thread-multi/auto/Encode/TW*
./usr/lib/perl5/5.10.0/ppc64-linux-thread-multi/auto/Encode/KR*
./usr/lib/perl5/5.10.0/ppc64-linux-thread-multi/Encode/CN*
./usr/lib/perl5/5.10.0/ppc64-linux-thread-multi/Encode/JP*
./usr/lib/perl5/5.10.0/ppc64-linux-thread-multi/Encode/KR*
./usr/lib/perl5/5.10.0/ppc64-linux-thread-multi/Encode/TW*
./usr/lib64/gcc/powerpc64-suse-linux/4.3/include*
./usr/local/include*
./usr/local/man*
./usr/powerpc64-suse-linux/include*
./usr/share/X11/locale/*
+./usr/share/X11/locale/en_US.UTF-8*
+./usr/share/X11/locale/C*
./usr/share/cracklib*
./usr/share/doc*
./usr/share/doc/packages/cyrus-sasl/doc*
./usr/share/gnome*
./usr/share/i18n*
./usr/share/info*
./usr/share/locale/*
+./usr/share/locale/en_US*
+./usr/share/locale/C*
./usr/share/man*
./usr/share/omf*
./usr/share/vim/site/doc*
./usr/share/vim/vim72/doc*
./var/cache/man*
./var/cache/yum*
@@ -0,0 +1,43 @@
aaa_base
bash
coreutils
keyutils
lvm2
nfs-kernel-server
openssl
dhcp-client
openssh
procps
psmisc
wget
sysconfig
rsyslog
vim
rsync
timezone
bc
ntp
gzip
e2fsprogs
parted
binutils
tar
open-iscsi
curl
plymouth
btrfsprogs
cryptsetup
dmraid
mdadm
multipath-tools
gpg2
cifs-utils
open-lldp
fcoe-utils
which
util-linux-systemd
util-linux-systemd
plymouth-dracut
udev
kernel-default
@@ -0,0 +1,46 @@
#!/bin/sh
#-- Do not remove following line if you want to make use of CVS version tracking
#-- $Id: compute.postinstall,v 1.21 2008/09/04 12:05:45 sikorsky Exp $
#-- jurij.sikorsky@t-systems.cz
#--
#-- this script is run after all packages from $profile.pkglist are installed
#--
#-- it gets these arguments:
#--
#-- $1 = install root (chroot directory for profile)
#-- $2 = OS version
#-- $3 = architecture
#-- $4 = profile name
#-- $5 = work dir (where genimage is located)
#--
#--
installroot=$1
osver=$2
arch=$3
profile=$4
workdir=$5
#-- Example how /etc/fstab can be automatically generated during image generation:
cat <<END >$installroot/etc/fstab
proc /proc proc rw 0 0
sysfs /sys sysfs rw 0 0
devpts /dev/pts devpts rw,gid=5,mode=620 0 0
${profile}_${arch} / tmpfs rw 0 1
none /tmp tmpfs defaults,size=10m 0 2
none /var/tmp tmpfs defaults,size=10m 0 2
END
#-- Uncomment the line contains "cons" in /etc/inittab
#cons:12345:respawn:/sbin/smart_agetty -L 38400 console
TMP_inittab=`sed 's/\(#\)\(cons:12345.*\)$/\2/' $installroot/etc/inittab`
echo "$TMP_inittab" > $installroot/etc/inittab
#-- Example of booted image versioning
#-- We want to know, with what configuration (version of the image) each node was booted.
#-- Hence, we keep image definition files and postscripts in CVS. During image generation we create file /etc/IMGVERSION and fill it with CVS "$Id$" of files with image definition (.pkglist, .exlist, .repolist, .postinstall). Then, during boot, each "CVS enabled" postscript (see /install/postscripts/cvs_template.sh and /install/postscripts/cvs_template.pl) adds one line to /etc/IMGVERSION. Then you can determine in any time what image you are running and what postscipts in which versions were run.
#cat /dev/null > $installroot/etc/IMGVERSION
#for ext in pkglist exlist postinstall repolist; do
# [ -r $workdir/$profile.$ext ] && cat $workdir/$profile.$ext | grep -E '^[[:space:]]*#.*[[:space:]]\$Id' >> $installroot/etc/IMGVERSION
#done
@@ -0,0 +1,36 @@
./boot*
./etc/bootsplash/themes/SLES/images*
./opt/sci/include*
./usr/include*
./usr/lib/locale*
./usr/lib/perl5/5.10.0/x86_64-linux-thread-multi/auto/Encode/CN*
./usr/lib/perl5/5.10.0/x86_64-linux-thread-multi/auto/Encode/JP*
./usr/lib/perl5/5.10.0/x86_64-linux-thread-multi/auto/Encode/TW*
./usr/lib/perl5/5.10.0/x86_64-linux-thread-multi/auto/Encode/KR*
./usr/lib/perl5/5.10.0/x86_64-linux-thread-multi/Encode/CN*
./usr/lib/perl5/5.10.0/x86_64-linux-thread-multi/Encode/JP*
./usr/lib/perl5/5.10.0/x86_64-linux-thread-multi/Encode/KR*
./usr/lib/perl5/5.10.0/x86_64-linux-thread-multi/Encode/TW*
./usr/lib64/gcc/x86_64-suse-linux/4.3/include*
./usr/local/include*
./usr/local/man*
./usr/x86_64-suse-linux/include*
./usr/share/X11/locale/*
+./usr/share/X11/locale/en_US.UTF-8*
+./usr/share/X11/locale/C*
./usr/share/cracklib*
./usr/share/doc*
./usr/share/doc/packages/cyrus-sasl/doc*
./usr/share/gnome*
./usr/share/i18n*
./usr/share/info*
./usr/share/locale/*
+./usr/share/locale/en_US*
+./usr/share/locale/C*
./usr/share/man*
./usr/share/omf*
./usr/share/vim/site/doc*
./usr/share/vim/vim72/doc*
./var/cache/man*
./var/cache/yum*
@@ -0,0 +1,41 @@
aaa_base
coreutils
bash
nfs-kernel-server
keyutils
lvm2
openssl
dhcp-client
openssh
procps
psmisc
wget
sysconfig
rsyslog
vim
rsync
timezone
bc
ntp
gzip
e2fsprogs
parted
binutils
tar
open-iscsi
curl
plymouth
btrfsprogs
cryptsetup
dmraid
mdadm
multipath-tools
gpg2
which
cifs-utils
open-lldp
fcoe-utils
kernel-firmware
util-linux-systemd
kernel-default

Some files were not shown because too many files have changed in this diff Show More