Compare commits

..

1135 Commits

Author SHA1 Message Date
arif 1bb7a6d223 add nicextraparam feature to configbond script 2015-04-15 20:55:17 +01:00
Casandra Qiu 896877deb7 Bug #4642 httpd didn't start up for rhels7.1 diskless server node 2015-04-15 14:08:40 -04:00
ligc bbcfef36e2 fix for bug 4591: print a more reasonable message when no disk found on the node 2015-04-15 02:05:47 -04:00
Junxiaw cd6c70e22e modify installation testcase 2015-04-15 01:37:58 -04:00
ertaozh 4d7ca44ef5 fix bug 4639: using updatenode to install cuda failed 2015-04-14 06:23:12 -04:00
immarvin 9eed5a49df use R:: as the prefix to persistent kernel cmdline in addkcmdline instead of P:: 2015-04-14 02:36:28 -07:00
litingt 8cce1682ac update packimage cases 2015-04-14 03:48:13 -04:00
Victor Hu 5019ce2e9f Comment out the set -x for otherpkgs 2015-04-13 16:32:27 -04:00
jjohnson2 2d5bc5b1e6 Put Lenovo Thinkserver support in correct location 2015-04-10 08:44:50 -04:00
immarvin 43ec8b55ef support persistent kernel cmdline after diskful installation 2015-04-10 02:54:01 -07:00
ligc 520a74e3da Build genesis-base on CentOS 6.6: add virtio_pci to support the virtual network adapters 2015-04-10 04:51:18 -04:00
ligc c4438568d7 fix a problem caused by checkin 8e0a2fe479 2015-04-10 03:54:30 -04:00
ertaozh 6b13006087 GPU supporting: create cuda tmpl file link for diskfull, create cudaruntime pkglist file link for diskless 2015-04-10 03:38:36 -04:00
ligc 2e1c907ca6 fix xCAT-genesis-builder/install: use relative path for basename, the basename is in different directory for different OS 2015-04-10 03:35:21 -04:00
ligc 9cdbf88346 fix xCAT-genesis-builder/install: use relative path for basename, the basename is in different directory for different OS 2015-04-10 03:33:27 -04:00
litingt 897192224e modify UPLOADER from bp-sawyers to litingt 2015-04-10 03:17:09 -04:00
litingt 5e7021bb80 modify UPLOADER from bp-sawyers to litingt 2015-04-10 03:15:24 -04:00
litingt f5deaf59cb add confignics -s in ubuntu diskful installation case 2015-04-10 02:01:41 -04:00
litingt 4e8957d984 add confignics -s in diskful installation case 2015-04-10 01:58:47 -04:00
ertaozh e959e5a698 GPU supporting: remove linux-image and linux-headers from diskfull pkglist, modify hackuname to not overwrite uname-binary 2015-04-09 07:23:03 -04:00
litingt 2ad95b27e4 add debug infor 2015-04-08 21:54:04 -04:00
jjohnson2 3746d974b8 Add sg driver to genesis for ThinkServer firmware
Thinkserver firmware update interface uses sg facility
to stage updates in the TSM.  Allow genesis to run
osput by providing the appropriate kernel module.
The UTF-32 processing can come bundled in the runimage
payload, but the kernel driver is not so reasonable.
2015-04-08 15:21:58 -04:00
jjohnson2 5ac2c0a4d6 Improve IPMI FRU parsing for Lenovo Thinkservers
Lenovo Thinkservers provide logically addressed FRUs that
aren't typed as logical FRU.  Change so that the
addressing rather than the type drives our behavior to
read or skip.

Thinkservers explicitly have a locator record for FRU 0.
Ignore such a locator record.

If a board info area is not followed by a product or
multirecord area, give the board area parsing code access
to the end of the area in case board info data runs
beyond the end of the claimed area.
2015-04-08 15:11:36 -04:00
Lei Ai 33f614b584 merge fix for 4634 from 2.9.1-pcm branch 2015-04-08 17:14:25 +08:00
WangXiaoPeng 6004cc18f1 Change in Utils.pm->filter_nodes() to recoganize ppc64le if it's arch matchs to ppc64.* 2015-04-08 01:26:38 -04:00
Jia Zhao 0e227799b9 support geninitrd for PowerKVM Hypervisor 2015-04-08 13:20:25 +08:00
litingt 060ae4f8c1 add sleep time 2015-04-07 21:56:46 -04:00
litingt 88b0009e12 add sleep time for makehosts_n 2015-04-07 06:06:57 -04:00
litingt 47fd4327b6 remove lslite_noderange since ubuntu does not support statelite now 2015-04-07 06:03:45 -04:00
Jia Zhao 33b992ae81 support define powerKVM hypervisor in nodeimport 2015-04-07 16:55:44 +08:00
Victor Hu 603a07def3 change the relative path for xcat-dep for build-ubunturepo to
match the structure being set up in the new build environment in c910
2015-04-06 15:30:31 -04:00
ertaozh 014d8ce183 add linux-headers into pkglist which is useful for cuda installing 2015-04-03 04:56:21 -04:00
ertaozh 78bc498a76 cuda installation supporting for ubuntu14.04.2 ppc64el 2015-04-03 04:05:38 -04:00
Jia Zhao c339024112 update messages in nodeimport 2015-04-02 15:52:02 +08:00
Jia Zhao b769c4b1bc Update nodeimport error messages for kvm nodes 2015-04-02 15:23:09 +08:00
ertaozh f844701198 fix bug 4555 lsslp -s PBMC does not honor -n flag, need to update nodetype attribute for predefined node after discoveried 2015-04-01 23:17:20 -04:00
root cc73b77243 modify testcase 2015-04-01 06:19:55 -04:00
WangXiaoPeng 9616e681a5 defect 4579: check the running of sshd at end of remoteshell, start it if needed 2015-04-01 03:51:49 -04:00
jjohnson2 48ae224911 ESXi 6 changes
ESXi 6 is for the most part identical to ESXi5 in how it is managed.
Have the esxi5 specific code also cover esxi6
2015-03-31 09:51:11 -04:00
jjohnson2 4d3e209c3e Push xCAT nodegroup membership to confluent
With noderanges, it would be very handy for xCAT
group membership to be reflected in confluent.  Have
makeconfluentcfg push that data into confluent.
2015-03-30 15:25:33 -04:00
ertaozh b2a04a221b fix bug 4611: PowerNV stateful CN provision will hang at reboot stage 2015-03-30 04:56:42 -04:00
WangXiaoPeng 358e83a5bb defect 4615: For renergy command against P8 node, support the concurrent performing node communication for multiple nodes. 2015-03-27 07:23:24 -04:00
Jia Zhao b94a492b21 fix nodeset command error in PCM nodeimport 2015-03-27 14:42:49 +08:00
Jia Zhao 8f298de177 fix bug 4614: genimage and provision is failed when osdistroupdate is associated 2015-03-27 14:36:31 +08:00
WangXiaoPeng 2fd0f59cca fixed the issue that bridge module cannot be loaded automatically on SL6.6 2015-03-27 01:33:36 -04:00
jjohnson2 3cc5e0cdf4 Fix asu handling of exotic characters
Exotic characters that may be interpreted by shell
are now quoted to prevent any interpolation.
2015-03-26 15:52:44 -04:00
jjohnson2 39bc1e21a6 Change wvid to pass IP to client
When remote xCAT client is used, often the client will not have
the same name resolution in place as the management node.  For
wvid, mitigate this by passing the IP address to the client.
If name resolution worked before, this should be no downside.
If routing also doesn't work, well the user is no worse off than
before at the moment.
2015-03-26 10:01:10 -04:00
WangXiaoPeng aa7765accf defect 4625: fix the issue that restapi does not work on Ubuntu 2015-03-26 07:15:33 -04:00
WangXiaoPeng 21204f4dde fix the issue that POST - /networks does not work. and fix the ssl connection failure on ubuntu 2015-03-26 07:15:23 -04:00
WangXiaoPeng f02a5e927d defect 4625: create necessary dirs for apache2 cfg 2015-03-26 07:15:15 -04:00
immarvin b572fc52b4 fix defect #4620 pgsqlsetup script hang on sles11.3 2015-03-25 20:39:48 -07:00
Victor Hu f8bd32838a Change the debian/rules file to executable to supress
a warning during the build.  The rules file is required to have
execute permission as it's the debian "Makefile"
2015-03-25 17:42:51 -04:00
Victor Hu 506493aa0a Add debian related files to xCAT-confluent subdirectory.
The debian build was not building this package
2015-03-25 16:39:25 -04:00
Victor Hu 419af5ce88 Merge branch 'master' of ssh://git.code.sf.net/p/xcat/xcat-core 2015-03-25 13:36:40 -04:00
Victor Hu 30950ea29e Stop the ubuntu build when errors occur instead of just continuing. 2015-03-25 13:35:53 -04:00
immarvin 719c6d0de3 fix defect #4616 On rhels7.x env, stateful node status will be failed duo to privision nic is not ready when run postscript 2015-03-25 03:48:19 -07:00
Victor Hu 28e6939268 update the error message on xpod2man to better reflect what is
going on, looking for man5 pages, instead of claiming error
running the command.
2015-03-24 15:48:20 -04:00
Victor Hu e80b5d707e Put the wget command in a variable so we can log the output
to a file instead of wget default log messages to stderr.

This helps us without automated build scripts and not breaking
on output written to stderr
2015-03-24 13:55:14 -04:00
jjohnson2 1bce6d44c8 Have ppping and psh verify peer
psh and ppping failed to verify the server certificate
2015-03-24 13:39:19 -04:00
ertaozh 5068a8b99d fix defect 4624: mlx4_en.ko missing from Ubuntu stateless image 2015-03-24 03:56:20 -04:00
Jia Zhao 5371f78dbb setting vpd.uuid for powerkvm nodes during nodeimport 2015-03-24 15:30:17 +08:00
Lei Ai 9f839cd82f 4612 Update script pgsqlsetup against PGSQL secure hole 2015-03-23 11:52:01 +08:00
jjohnson2 71d4dabbd4 Give confetty based consoles more of a grace period
For people doing X forwarding, wcons tiling has always been
flaky.  For confluent, we have a better cue, so give it
more time for the sake of X forwarded users
2015-03-20 11:00:10 -04:00
jjohnson2 ff3eee61f3 Merge branch 'master' of ssh://git.code.sf.net/p/xcat/xcat-core 2015-03-20 10:59:20 -04:00
jjohnson2 fb02c18853 Fix erroneous 'noping' in various circumstances
nmap's raw IP facility is prone to mistakes in various
environments.  Disable the raw IP handling by
telling nmap to run as if it didn't have privilege
2015-03-20 10:58:26 -04:00
Victor Hu b0979eafc9 Add a LOG option to buildcore.sh to allow for some output to redirect
to a log file.  Currently only used to optionally redirect wget
output to a log instead of stderr.  Output to stderr will cause automated
build scripts to fail.
2015-03-19 12:14:27 -04:00
ertaozh 465fc18b2a fix bug 4600: p8LE hardware discovery will hung when the first LINK UP nic is not in Management Network 2015-03-19 03:10:47 -04:00
immarvin 89f58e514a fix defect #4613 [DEV] rhels7.0 provisioning complains !dracut-cmdline[78]: Warning: 'ksdevice=<MAC>' is deprecated. Using BOOTIF=01-00-21-5e-a6-3d-d7 instead! 2015-03-18 21:45:28 -07:00
Victor Hu 254f7b7b43 This is really a hack. The xCAT-UI spec file should not have a hard
coded location for compiler.jar file. However, I don't feel we should
check in that compiler.jar file, so I've put it into a tools directory
under the new build environment structure in c910 so we can more easily
re-create build machines.

The file path is automatically generated if it's not found to exists
so we don't break the current build scripts.
2015-03-18 16:51:49 -04:00
ertaozh f731fb2ec9 fix bug 4609: rcons returns /opt/xcat/bin/rcons: line 62: [: ==: unary operator expected 2015-03-17 07:50:21 -04:00
Victor Hu 28cb65ebac rcons automatically uses confluent when it's installed on the xCAT
management machine.  Tests for /opt/confluent/bin/confetty

Change to first check consoleservice keyword in site table before
using confluent.  This allows us to install confluent on the machine
and control use with the keyword
2015-03-17 07:47:32 -04:00
daniceexi e2713f9b7b the initrd for stateless has to been built first to make the installkernel cfg file added first. Refer to checkin 3df16cd4e3 for rh7 2015-03-17 03:03:49 -04:00
linggao a2fa0c2a28 Fixed defect 4606: cannot ssh to genesis 2015-03-16 23:36:10 -04:00
linggao 50a086327b Fixed defect 4608: getmacs does not work for x222 nodes 2015-03-16 16:17:08 -04:00
immarvin b99e85f108 suppress some invalid message during genimage 2015-03-16 07:13:13 -07:00
immarvin 17b29dcd17 fix defect #4525 [DEV] ubuntu 14.04.1 ppc64el hierarchy stateless provision hang on wget: bad address 'c910f03c05k07' 2015-03-16 03:24:01 -07:00
immarvin cddf0ba309 fix defect for #4539 [FVT] On RHEL 7.1 ppc64, the name of network adapters changed after the operating system installation 2015-03-16 02:24:11 -07:00
Lei Ai 8e0a2fe479 4590:update genesis rpm builder for compatible with MCP package 2015-03-16 13:57:58 +08:00
daniceexi 7c804caa9e defect 4598: hardeths script will do nothing if the interface has not IP and mac address 2015-03-16 00:57:27 -04:00
daniceexi 56d468f669 defect 4603: fix the code logic of how to get the fsp of cec 2015-03-13 04:53:32 -04:00
GONG Jie f6ea4a1bbc Merge branch 'master' of ssh://git.code.sf.net/p/xcat/xcat-core 2015-03-13 16:30:10 +08:00
GONG Jie ecf9564c46 Fix typo of previous commit for bug #4451. Fix bug#4601 2015-03-13 16:29:53 +08:00
daniceexi 0bd0860cdc add netboot pkglist for ubuntu 14.04.2 x86_64 2015-03-13 01:53:53 -04:00
Victor Hu d08a231d1a Remove the "set -x" in the xCAT-vlan spec file causing unnecessary
output to the log files when building xCAT-vlan RPM
2015-03-12 15:27:29 -04:00
Victor Hu e581247ade When building xCAT-server rpm, a Unknow option: help message
appears.  This is caused by the xCATreg tool not implementing
the --help option  (was -h or ? for help)

build-readme requires the tools to implement the help option
2015-03-12 15:10:53 -04:00
xCAT Build Machine 6c6994af5a Merge branch 'master' of ssh://git.code.sf.net/p/xcat/xcat-core 2015-03-12 11:17:13 -04:00
xCAT Build Machine f66b9b9c12 Fix some minor formatting issue in buildcore.sh 2015-03-12 11:16:52 -04:00
immarvin 1636b11e4b fix defect #4595 [FVT]:CN ip is not correctly configured on sles11.3 when installnic and primarynic is blank 2015-03-12 07:03:24 -07:00
Jia Zhao ebe61dbab5 fix nodeimport getting netboot attribute error 2015-03-12 17:30:02 +08:00
litingt 7333896fcb add xCAT-vlan for PCM team 2015-03-12 00:31:47 -07:00
litingt 7ff60abe6e put xCAT-genesis-scripts-ppc64 in PCM build 2015-03-12 00:31:13 -07:00
amy0701 ff2e58e66f fix confignics -s does not work in postscripts 2015-03-12 01:27:24 -04:00
chudegao c51cfca5e1 fix feature request 189, support not contain existing postscript in kit 2015-03-11 18:02:31 +08:00
daniceexi 793a6c1709 defect 4539: for rh7, remove the HWADDR entry from ifcfg-ethx files to skip the deadlock of cfg in ifcfg-ethx and real system 2015-03-11 06:04:50 -04:00
daniceexi 3a65b11326 defect 4586: when run genimage for ubuntu, grub_pc package cannot be configured correctly (postinst failed). It will cause the failure of genimage. use environment variable [DEBIAN_FRONTEND=noninteractive] for each apt-get run to make the apt-get default action is to say yes for any question 2015-03-11 04:04:38 -04:00
baiyuan acd15d4648 fix confignics -s to config installnic when installnic is not in nics table 2015-03-10 23:40:28 -04:00
mellor d009a51b1c defect 4349: update previous fix to rmkitcomp 2015-03-10 17:12:50 -04:00
mellor 8f90acc07c defect 4349: fix rmkitcomp othepkgs dir removal; fix typo in Schema.pm to now display kitcomponent reponame correctly 2015-03-10 14:50:15 -04:00
mellor 551bc0ab11 defect 4494: fix lskmodules to find both *.deb and *.udeb packages 2015-03-10 08:42:27 -04:00
Jia Zhao e5cee0d433 fix nodeimport error on PowerNV node 2015-03-10 19:52:07 +08:00
daniceexi 9e2ca88638 defect:4592 ubuntu:genimage, move the running of postinstall script before determining the linux kernel version since postinstall script might add new kernel pakcage 2015-03-10 03:48:34 -04:00
daniceexi 52f78c5449 defect 4586: copy /proc/cpuinfo from host node to rootimage 2015-03-10 01:25:46 -04:00
mellor 85f758bd0d defect 4587 - fix xcatd msg for undefined variable: Use of uninitialized value $line in length 2015-03-09 13:56:47 -04:00
GONG Jie c1eeb2f1ed Fix bug#4551 - [FVT] Command genimage print out information of succeed even if dracut was failed 2015-03-09 14:51:40 +08:00
GONG Jie d381d3e723 Fix bug#4570 - [FVT] xCAT::Utils->runcmd() did not set a correct $::RUNCMD_RC when streaming mode is using 2015-03-09 14:45:07 +08:00
GONG Jie f5d79bdaa2 Fix bug#4521 - [FVT] Script "mysqlsetup" assume end user has an empty MySQL/MariaDB root password. Which is not ture on Ubuntu Linux. 2015-03-09 14:39:55 +08:00
GONG Jie 63df86d1a3 Change all the name of template files with "rhel7" to "rhels7" 2015-03-09 14:38:03 +08:00
GONG Jie 798eb16f3b Change all the name of template files with "rhel7" to "rhels7" 2015-03-06 18:41:02 +08:00
daniceexi 19853bf2d2 Change the code to generate MACADDRESS var in mypostscript. var MACMAC will show the mac.mac. var MACADDRESS will show the installnic which calculated from mac.mac 2015-03-06 05:22:40 -05:00
chudegao 6227d2f2b6 Merge branch 'master' of ssh://git.code.sf.net/p/xcat/xcat-core 2015-03-06 14:10:19 +08:00
chudegao 4f34aae746 fix 4588, there's some perl grammar warning in vlan.pm 2015-03-06 14:09:13 +08:00
GONG Jie 282d1e354d Merge branch 'master' of ssh://git.code.sf.net/p/xcat/xcat-core 2015-03-06 14:00:32 +08:00
GONG Jie 1b7974de07 Add the discinfo of RHEL 7.1 on x86_64, ppc64 and ppc64le 2015-03-06 13:59:45 +08:00
GONG Jie 320d7743d3 Add the discinfo of RHEL 7 on x86_64 and ppc64 2015-03-06 13:56:45 +08:00
daniceexi 1bf4c73c5d change the definition of attributes linxuimage.otherpkglist and linuximage.postinstall that the value of them can be multiple files which separated with , 2015-03-05 22:05:52 -05:00
daniceexi c94b02d789 defect 4589: fix the issue in genimage.pm that when checking the existence of file in pkglist,otherpkglist,postinstall attributes, the value of the attributes could be multiple files which separated with , 2015-03-05 22:05:34 -05:00
ligc 6c44423812 fix for bug 4458: check the return value from Table.pm::setAttribs 2014-03-06 09:14:41 +08:00
Victor Hu 21caa0d9b9 Bug #4585, in the debian.pm code when we are looking at the pkgdir
directories, the last one was being used.  However, the first one
on the list should be used per man page:

"The first path in the value of osimage.pkgdir must be
the OS base pkg dir path,..."

Fixing to use the first directory specified.

Also fixed a bunch for formatting, space, tab issues...
2015-03-04 14:40:40 -05:00
immarvin 147185c198 fix defect #4539 [FVT] On RHEL 7.1 ppc64, the name of network adapters changed after the operating system 2015-03-04 01:26:16 -08:00
daniceexi 32753450ae defect 4580: a minor change for the syntax 2015-03-02 21:30:51 -05:00
Victor Hu 30f6a66814 Bug #4518 - extra slash in the symlink when -p option is presented
For sles.pm, clean up the $path variable to remove multiple slash
and trailing slash.

In debian.pm , move the check for -p and -w further down so it does
not appear unless we have decided that debian is the image we are
copying.  The message is misleading when copycds is run for non
ubuntu/debian OSes
2015-03-02 12:38:28 -05:00
daniceexi 350421129d change the default memory size for diskless node to be 4G from 512M 2015-03-02 05:24:08 -05:00
daniceexi 9ec565a908 Continue the change for avoiding sslv3 2015-03-02 05:04:43 -05:00
Casandra Qiu 78cdcc04b3 Bug #4580, Parse Mac Address before generate network boot params 2015-02-27 09:05:34 -05:00
Victor Hu 73ed881e05 The check for Ubuntu OS is looking for /etc/os-release. The new RHEL/SLES
O/S are all using this file (RHEL7, SLES12) So that check is not correct
anymore.  If the file exists, test that it contains Ubuntu

For pushinitrd, check that the IP address is set in the node definition
before we start executing the command as a pre-check.
2015-02-25 14:00:58 -05:00
Victor Hu 0a4c7179c4 Introduced a bug on earlier commit ec9658105909d7d91ad10d60495840a348fe6fef
On the checks for pkglist, otherpkglist and postinstall_files,
should make sure the variable is not empty string before seeing if the
file exists
2015-02-24 11:04:37 -05:00
Victor Hu a632f3186c For Ubuntu 14.04.2 LTS support, the linux-image-generic is called
linux-image-generic-lts-utopic and in the genimage we search for
linux-image-generic pattern and replace with "linux-image-generic"
This causes problems when creating diskless images for Ubuntu 14.04.2

Also creating new pkglist files for diskful and diskless images
2015-02-20 13:45:12 -05:00
ertaozh 733e2bc0cd Fix a defect for the function that generate network boot kernel parameters 2015-02-16 21:29:27 -05: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
huweihua 1967441266 do some enhancement 2014-12-02 21:44:58 -05:00
daniceexi b02452e2fb defect 4453: In the Postage.pm, fix the issue that he xcatmaster attribute for node cannot be set to 'MASTER' env viriable in mypostscript 2014-12-03 01:12:31 -05:00
huweihua 4097b7f845 do some enhancement 2014-12-02 03:16:24 -05:00
immarvin 21da21dec2 Merge branch 'master' of ssh://git.code.sf.net/p/xcat/xcat-core 2014-12-01 07:56:49 -08:00
immarvin 628067db4d add centos7 stateless stuff 2014-12-01 07:56:25 -08:00
zhaoertao f5577e7921 fix bug 4441 xcat genimage won't install os upgrade, add the "http" started otherpkgdir into apt.list file 2014-12-01 09:12:29 -05:00
huweihua be301fac1e do some enhancement 2014-12-01 06:35:47 -05:00
immarvin 30623ebd13 Merge branch 'master' of ssh://git.code.sf.net/p/xcat/xcat-core 2014-11-28 01:49:50 -08:00
daniceexi 476f9f7b94 defect 4442: fix the issue in xcatd that new UDP won't exit with error message when it cannot get socket during the xcatd fast restart 2014-11-28 06:57:36 -05:00
immarvin b8602d756f fix defect #4299 Node provision failed because kickstart file have unreasonable conf which caused by switch discovery emthod 2014-11-28 01:49:33 -08:00
ligc 607e2bd385 fix for bug 4399: on Ubuntu, disable isc-dhcp-server in upstart to avoid two dhcp server daemons, let xcat totally mangae dhcp server 2014-11-28 10:13:34 +08:00
ligc 2e32683a52 fix for bug 4440: write /etc/network/interfaces to /etc/network/interfaces.d/<nicname>, check if the target file name is blank 2013-11-28 11:19:06 +08:00
ligc 5ef5b62877 Remove the AIX multicast route words from lsslp manpage, it is required after 2.7.8 2013-11-27 16:06:29 +08:00
huweihua f9430e7364 add /etc/inittab depending on doc in sourceforce 2014-11-26 02:36:13 -05:00
zhaoertao d9e87410d4 Fix bug 4381 :sles12 rcons could not work on P8LE. 2014-11-26 02:29:04 -05:00
zhaoertao 288ffa7b68 Enhance of fix bug 4381 :sles12 rcons could not work on P8LE. For ubuntu LE diskless 2014-11-26 01:23:27 -05:00
huweihua da02c2bce7 Merge branch 'master' of ssh://git.code.sf.net/p/xcat/xcat-core 2014-11-25 22:00:08 -05:00
huweihua 217887b177 xcat auto test provision test cases 2014-11-25 21:59:33 -05:00
daniceexi cdacb9a85f defect 4426: support persistent route setting for Ubuntu/Debian in routeop postscript 2014-11-25 12:41:13 -05:00
zhaoertao 641be270e9 fix bug 4381 :sles12 rcons could not work on P8LE. This checkin support rcons for ubuntu LE diskfull and diskless 2014-11-25 04:45:29 -05:00
immarvin d9b5d07882 fix defect #4430 On rhels7,the package util-linux-ng changed to util-linux 2014-11-24 22:28:30 -08:00
immarvin ee20161772 update the boot options of redhat family since some options are already deprecated or replaced 2014-11-24 21:50:32 -08:00
Junxiaw e6b4ca9913 add autotest testcase 2014-11-24 18:56:03 -08:00
Junxiaw c33901f267 add autotest testcase 2014-11-24 18:52:17 -08:00
root 56228c180b add autotest testcase 2014-11-24 18:49:17 -08:00
root c5549a6533 Merge branch 'master' of ssh://git.code.sf.net/p/xcat/xcat-core 2014-11-24 18:40:15 -08:00
daniceexi 9d0b4b1be7 4390: In DB Access process, recover the signal handle in %SIG which was cleaned up by accident. This fix should be removed if fixed the root cause of %SIG clean up. 2014-11-24 09:41:43 -05:00
Casandra Qiu c21a1d35a2 Merge branch 'master' of ssh://cxhong@216.34.181.155/p/xcat/xcat-core 2014-11-22 21:25:30 -05:00
Casandra Qiu 69bf4249be Bug#4385 mysqlsetup does not support mariaDB in Ubuntu 2014-11-22 21:24:28 -05:00
huweihua cb62009306 fix defect4393: confignics --ibport 2 Cannot find device ib0 on diskless node although ib drivers is installed 2014-11-21 06:51:20 -05:00
zhaoertao e14dc92c12 fix bug 4415: Ubuntu 14.10 diskfull installation failed on IBM PowerKVM guest 2014-11-21 02:50:51 -05:00
zhaoertao c264c8b3a8 fix bug 4424: Failed to genimage for Ubuntu 14.10 diskless node on ppc64el 2014-11-21 02:37:40 -05:00
zhaoertao c65b55b79d fix bug 4410: Command genimage failed on Ubuntu 14.04.1 ppc64el with kernelver attribute 2014-11-21 02:26:23 -05:00
immarvin 3f59552d0c fix defect #4307 [FVT]:chdef newimage -u give out wrong arch in ubuntu; fix defect #4345 Utils->osver routine does not support Redhat7 or SLES12;fix defect #4308 [FVT]: osarch default value of user defined osimage is ppc64le. needs to change to ppc64el 2014-11-21 00:19:37 -08:00
immarvin 72c058edc9 enhance the script to support various bootmgr 2014-11-20 01:57:27 -08:00
litingt b9f206c746 remove xCAT-UI xCAT-OpenStack xCAT-OpenStack-baremetal 2014-11-20 01:30:10 -08:00
zhaoertao 037ed0bcfd fix bug 4411: Typo in the command genimage output, "geniamge" -> "genimage" 2014-11-20 02:56:23 -05:00
daniceexi 029e6d18ca defect 4419: change the db notification runs in DB process instead of fork a new one since the fork new process will cause DBI connection gets into confusing 2014-11-20 07:14:50 -05:00
daniceexi 900963b1db defect 4375: fix the xcatd which has issue to receive request from xcatd which is longer than about 160,000 bytes 2014-11-20 07:08:36 -05:00
zhaoertao 089315126c fix bug 4410: Command genimage failed on Ubuntu 14.04.1 ppc64el 2014-11-20 02:00:45 -05:00
Casandra Qiu 28d2110a5e fix bug#4366 change /bin/sh to /bin/bash 2014-11-19 09:42:19 -05:00
huweihua 2b74e1de3c Merge branch 'master' of ssh://git.code.sf.net/p/xcat/xcat-core 2014-11-19 06:10:05 -05:00
huweihua c5e82bb0fd fix defect4414: if there is rsync service already run, sysclone rsync server start unsuccessfully. 2014-11-19 06:09:23 -05:00
baiyuan ba51617afd fix /n after uname -p 2014-11-19 06:01:54 -05:00
huweihua 458d82a3b2 fix defect4407: Cloned rhels7 node doesn't have IP address in rh7 2014-11-19 03:32:12 -05:00
huweihua 1c0ff10789 fix defect4397: sysclone analysize genesis fs name failed in rh7.0 2014-11-19 03:23:19 -05:00
daniceexi 3a4cefe53b defect 4336,4352: in xcatd, for aix, make all the process (fix for udp process) to be stopped when received TERM singal from stopsrc command to the main process 2014-11-19 07:44:49 -05:00
zhaoertao 449ee0f808 correct postinstall scripts for ubuntu diskless 2014-11-19 03:16:44 -05:00
root a139146cba Merge branch 'master' of ssh://git.code.sf.net/p/xcat/xcat-core 2014-11-18 19:18:14 -08:00
root 2d4e7c9fdd Merge branch 'master' of ssh://git.code.sf.net/p/xcat/xcat-core 2014-11-16 21:33:05 -08:00
baiyuan 0d6d911fa5 defect 4394 buildkit preuninstall did not work 2014-11-14 04:50:30 -05:00
baiyuan f2f03bc718 defect 4394 buildkit preuninstall did not work 2014-11-14 04:50:15 -05:00
immarvin 72739e890d Merge branch 'master' of ssh://git.code.sf.net/p/xcat/xcat-core 2014-11-14 01:30:14 -08:00
immarvin 11cd20ada5 add build timestamp to the xcat-dep 2014-11-14 01:29:29 -08:00
root 738f891d61 Merge branch 'master' of ssh://git.code.sf.net/p/xcat/xcat-core 2014-11-13 19:00:19 -08:00
zhaoertao 65814f3b59 fix bug 4395: ubuntu didn't get pkgdir from the osimage pkdir attribute 2014-11-13 21:54:17 -05:00
root 87fadccb22 Merge branch 'master' of ssh://git.code.sf.net/p/xcat/xcat-core 2014-11-13 05:45:22 -08:00
immarvin 6f4c3875d2 add xnba-undi and elilo to xCAT dependency list on ppc64le, since the 2 packages are all arch-indep 2014-11-13 00:47:49 -08:00
immarvin e9d56917fc remove some EOF ubuntu releases,add 14.10 release code 2014-11-13 00:45:46 -08:00
daniceexi ab8beaf15d change detect_dhcpd tool to support Ubuntu 2014-11-13 07:08:15 -05:00
zhaoertao e638a90375 fix bug 4392:xCAT upgrade failed because of xcat-genesis-scripts-amd64 and xcat-genesis-scripts 2014-11-13 03:25:54 -05:00
huweihua ac83f5c65f fix defect4389:omit the output of ifup command 2014-11-13 03:03:31 -05:00
huweihua 4607e8138f fix defect4388: forbid firmware update during Mellanox drives installation 2014-11-13 02:53:34 -05:00
zhaoertao e40229e41d fix bug 4391 xcat-genesis-scripts create mismatch directory with its arch 2014-11-13 02:12:03 -05:00
baiyuan 6f38163688 close debug mode 2014-11-13 01:10:55 -05:00
baiyuan 31d1cf9961 configure lsf cluster and start up lsf cluster 2014-11-13 01:07:56 -05:00
baiyuan 5f72bfa56f do lsf installation and basic configuration 2014-11-13 00:39:48 -05:00
daniceexi df970f4cb0 defect 4384: fix the issue that copycds command cannot be ctrl+c cleanly. The root cause was INT signal was not received by the plugin process after it sends out from relay_fds. The fix is to send both INT and TERM. TERM can be received in this case. 2014-11-13 03:24:33 -05:00
root 3a3256b518 Merge branch 'master' of ssh://git.code.sf.net/p/xcat/xcat-core 2014-11-12 21:18:07 -08:00
zhaoertao 834ae798ca fix bug 4387 :sles12:mkvm failed 2014-11-12 22:09:35 -05:00
zhaoertao b4d9167344 fix bug 4382 :increase /tmp size for default ubuntu diskless node 2014-11-12 21:34:33 -05:00
jjohnson2 e2c31bad27 Implement confluent usage by r/wcons 2014-11-12 16:48:44 -05:00
Casandra Qiu 2d1961c4f9 bug#4286 makedns should have a verbose mode 2014-11-12 10:24:38 -05:00
ligc b777d3dfa5 Merge branch 'master' of ssh://git.code.sf.net/p/xcat/xcat-core 2014-11-12 03:41:08 -05:00
ligc 7ee1498601 fix for bug 4341: xCAT needs perl-Digest-SHA1 but RHEL7 will not install perl-Digest-SHA1 by default 2014-11-12 03:40:54 -05:00
daniceexi 01f4cc8917 defect 4367: support rinv command to get disk information for block device like /dev/sda16 2014-11-12 05:16:27 -05:00
zhaoertao 502cc6aaad fix bug 4271 Avoid use a seperate /boot partition in the default partition strategy for Ubuntu 2014-11-12 03:38:16 -05:00
root 7bcc0909a9 Merge branch 'master' of ssh://git.code.sf.net/p/xcat/xcat-core 2014-11-11 22:32:53 -08:00
zhaoertao 9e86ac498c enhance for fix debug 4324: xcat provisioning of does not go consistantly to the same disk drive. 2014-11-11 21:33:47 -05:00
immarvin 84712be32c support apache2.4 in ubuntu 2014-11-11 19:04:52 -08:00
Victor Hu 3eaaa3b6f3 Bug 4373: enhance warning msg in otherpks to be more clear with yum. 2014-11-11 15:54:04 -05:00
Victor Hu a09f2d6faa add work around for umount partition question during ubuntu install 2014-11-11 15:37:29 -05:00
daniceexi 21d12983c9 Since xcatd fast restart cannot be supported in systemd enabled OS, we implemented fast restart in restartxcatd command 2014-11-11 12:18:58 -05:00
huweihua ba343557ec fix bug: disappeared in petitboot environment 2014-11-11 07:02:51 -05:00
huweihua 7f58d3fd6c fix bug: disappeared in prtitboot environment 2014-11-11 06:57:23 -05:00
zhaoertao 9f91e914d9 enhance for fix debug 4324: xcat provisioning of does not go consistantly to the same disk drive. 2014-11-11 05:11:48 -05:00
root 68fbecb21a Merge branch 'master' of ssh://git.code.sf.net/p/xcat/xcat-core 2014-11-09 21:06:01 -08:00
daniceexi ce7ed0cb72 Check the version of perl-Net-DNS. If it's perl-Net-DNS-0.73-1.28, output an error message that require the update and return 2014-11-10 04:26:22 -05:00
root 084e71387b Merge branch 'master' of ssh://git.code.sf.net/p/xcat/xcat-core 2014-11-09 21:04:03 -08:00
litingt 85af82dc02 add xCAT-genesis-scripts in 2014-11-09 21:44:00 -05:00
root 83bf291a3d Merge branch 'master' of ssh://git.code.sf.net/p/xcat/xcat-core 2014-11-04 19:19:47 -08:00
huweihua 9f830ffc17 get rid of needless systemimager monitor service for sysclone 2014-11-04 21:52:13 -05:00
huweihua 23a132c497 fix the bug when use dracut to rebuild initrd 2014-11-04 21:45:44 -05:00
huweihua 51f9f121bc get rid of needless output 2014-11-04 21:43:02 -05:00
huweihua 06bbdbc33f support rhels7.0 2014-11-04 21:40:49 -05:00
linggao 8622f3f9bd fixed defect 2994 imgexport/imgimport problems 2014-11-04 11:39:58 -05:00
Lei Ai 1fb1b283bb set netboot to for PPC64LE 2014-11-04 22:16:09 +08:00
lissav df45650bfb defect 4355 2014-11-04 07:51:04 -05:00
lissav c31b275d54 Merge branch 'master' of ssh://git.code.sf.net/p/xcat/xcat-core 2014-11-03 12:42:19 -05:00
baiyuan 2ace529fee range lskit to support -K -R -C and theirs xml format 2014-11-03 03:55:24 -05:00
baiyuan 852fc3c164 back to original kit.pm 2014-11-03 03:49:19 -05:00
baiyuan b15e8e9db8 Merge branch 'master' of ssh://git.code.sf.net/p/xcat/xcat-core 2014-11-03 03:35:12 -05:00
zhaoertao 47c91ef186 defect lskit to support seperate -R -C as xml format 2014-11-03 07:48:57 -08:00
baiyuan c8426f9f43 pick up ligc fix for bug 4347: lsvpd does not output the word 'cpu' on Ubuntu LE 2014-11-03 03:34:33 -05:00
baiyuan 943b31d0ff defect4303 --- add -C support for lskit 2014-11-03 00:40:30 -05:00
baiyuan 5c9bd40b1f defect4303 --- add -R support for lskit 2014-11-03 00:08:49 -05:00
immarvin dd63773ee8 dd conf support for apache2.4:create a new file xcat-ws.conf.apache22 2014-10-31 03:12:25 -07:00
immarvin b6c35465dc update configuration file for apache2.4 on sles12 2014-10-31 02:48:33 -07:00
immarvin 9ba2726f83 add conf support for apache2.4 2014-10-31 02:43:22 -07:00
baiyuan ec1ef81ea8 fix defect 4349 [dev]after rmkit/rmkitcomp -i kitcomp list, kitrepo dir in otherpkgdir is not deleted 2014-10-31 04:40:09 -04:00
lissav 5078f8293b Merge branch 'master' of ssh://git.code.sf.net/p/xcat/xcat-core 2014-10-30 08:49:40 -04:00
lissav 6b040b23f7 fix defect 4343 2014-10-30 08:49:19 -04:00
baiyuan 9539644ca1 fix 4344 kit repo lose mount after xcat MN reboot in ubuntu 2014-10-30 08:36:47 -04:00
zhaoertao aa0f63c2b7 fix bug 4340:could not do diskless install on p8le vm 2014-10-30 03:24:58 -04:00
root cc971870f9 Merge branch 'master' of ssh://git.code.sf.net/p/xcat/xcat-core 2014-10-19 17:56:15 -07:00
zhaoertao 255811ee1f fix bugs that no BOOTIF set for ubuntu diskless 2014-10-18 17:13:02 -07:00
baiyuan b9577cb9ef non_native package use this script, update sample using real content 2014-10-17 03:22:36 -04:00
immarvin 5ad09597bd replace ifconfig with ip 2014-10-16 03:00:18 -07:00
immarvin 5b5ad7d6d7 fix defect #4297 PMR 32466,L6Q,000 autoinst file generated hangs install at running postscripts 2014-10-16 02:26:27 -07:00
immarvin 2f6be40923 fix defect #4274 default otherpkgdir is /install/post/otherpkgs/ubuntu14.04/ppc64el in ubu 2014-10-15 21:24:38 -07:00
immarvin 2a494808f7 fix defect #4293 [[FVT]:genimage failed not finding otherpkg repo file 2014-10-15 08:42:35 -07:00
zhaoertao 053225fb26 fix bug 4296 :p8le hw discovery error info about syslog and dmidecode 2014-10-15 00:21:48 -07:00
ligc 3b05fc84b0 fix for bug 4290: add requires ipmitool-xcat for ppc64 2014-10-14 22:50:30 -04:00
mellor 2511cebef8 defect 4284 - fixed xcatd attempt to write to broken pipe which caused DB processes to not get killed 2014-10-14 20:48:51 -04:00
mellor c85c5acdee defect 4294 - fix rmkitcomp to recognize ubuntu prerequisite prep-kitcomp otherpkgslist entry 2014-10-14 18:35:41 -04:00
mellor 0c51f6e92a fix schema def mapping of missing kit and kitcomponent attrs 2014-10-14 18:00:39 -04:00
root 31c9e1f812 modify installation test case part sn installation on ppc64 for redhat 2014-09-18 02:04:56 -07:00
root af98c573fb modify xdcp test case part one 2014-09-17 20:08:35 -07:00
root 1eb7f10e2e modify xdcp test case part one 2014-09-17 20:06:11 -07:00
baiyuan 47d8713482 fix syntax error in postinst 2014-09-17 05:57:59 -04:00
baiyuan 7d84551ce5 fix syntax error in postinst and preinst 2014-09-17 05:57:28 -04:00
mellor b855150aee support -s PBMC for lsslp 2014-09-17 02:12:37 -07:00
root d041294800 modify rscan test case part one 2014-09-17 01:21:34 -07:00
baiyuan 8557d86359 fix absolute filename in Packages that make otherpkgs intall deb package fail 2014-09-17 04:03:46 -04:00
daniceexi a6b4056b2e Merge branch 'master' of ssh://daniceexi@git.code.sf.net/p/xcat/xcat-core 2014-09-17 02:38:08 -04:00
daniceexi e0bbf7b1db Code change to support SL6 2014-09-17 02:37:39 -04:00
baiyuan 6ec8d4c4e3 ubu power LE arch is ppc64el,ubu kit componet basename xxx-compute 2014-09-16 02:25:08 -04:00
ligc 252da58c78 fix for bug 4272: do not check php rpm, check file existence instead 2014-09-16 02:27:02 -04:00
immarvin 9d628fb636 fix defect #4155 [fvt]2.9:could not install xcat use the latest build for no perl(Confluent::Client) 2014-09-15 21:00:26 -07:00
baiyuan a4ac5c5187 add lskit/addkit/rmkit/lskitcomp/addkitcomp/rmkitcomp/chkkitcomp/lskitdeployparam 2014-09-15 22:52:27 -04:00
Bruce Potter ba9dc1cd5e Merge branch 'master' of ssh://git.code.sf.net/p/xcat/xcat-core
updated xCAT-SoftLayer for rhel
2014-09-15 11:54:06 -04:00
Bruce Potter 2cf01b06b3 updated xCAT-SoftLayer for rhel 2014-09-15 11:53:48 -04:00
lissav f2901b06d0 fix description 2014-09-15 07:02:11 -04:00
qyin fe890637c9 fix issue 241844 The added os packages are not installed when reinstall nodes. 2014-09-15 17:32:28 +08:00
immarvin 83ed138db2 fix defect #4155 [fvt]2.9:could not install xcat use the latest build for no perl(Confluent::Client) 2014-09-15 03:04:57 -07:00
immarvin 7f8b48ba40 fix defect #4155 [fvt]2.9:could not install xcat use the latest build for no perl(Confluent::Client) 2014-09-15 02:50:34 -07:00
immarvin d0585fe056 fix defect #4155 [fvt]2.9:could not install xcat use the latest build for no perl(Confluent::Client) 2014-09-15 02:41:51 -07:00
qyin ae1dde7d9a Fix: 242668 [Rank6][Vlan] [Switch] [sles]Cannot found secure vlan network after flex up node in cluster within vlan 2014-09-15 15:55:01 +08:00
lissav 80772ee81c missed a path 2014-09-12 09:22:29 -04:00
lissav 66a38f0075 Found undocumented attribute in xcatd and added some more info to auditnosyslog 2014-09-12 09:19:19 -04:00
daniceexi a7621d345f defect 4264: fix issue in configib postscript to make it only touch the ifcfg-* files which are passed in from command line params 2014-09-12 07:52:21 -04:00
lissav 6c46d5b75d set default value for auditnosyslog on install and init DB 2014-09-12 07:29:09 -04:00
immarvin 1a5de449ef fix defect #4080 investigate RH7 kdump support 2014-09-11 20:52:23 -07:00
lissav aff90b34ac Support for auditlog without syslog 2014-09-11 13:39:55 -04:00
lissav 61b8040369 Support for auditlog without syslog 2014-09-11 13:14:04 -04:00
lissav 9a237c699b Support for auditlog without syslog 2014-09-11 13:12:56 -04:00
mellor 42b0f43780 support mtms based hardware discovery 2014-09-11 02:38:47 -07:00
litingt c66fe0d131 change git directory 2014-09-10 21:30:11 -04:00
zhaoertao 088ee8e9cd add an attribute for findme used to check it is running powerNV model 2014-09-10 01:51:06 -07:00
Jarrod Johnson 541dcf53d3 Handle more invalid characters in SPD model field if encountered 2014-09-09 13:41:19 -04:00
Jarrod Johnson 532c7d618c Recognize Lenovo IMM2 for wvid 2014-09-09 10:40:53 -04:00
mellor aab450c4de added --uploaduser as option and fixed default 2014-09-09 10:04:17 -04:00
mellor 7bbc3e8add man page updates for a new --continue flag to getxcatdocs 2014-09-09 09:40:48 -04:00
mellor 9dd06c1047 second pass at new getxcatdocs - convert tables to pandoc, fix image downloads, and more 2014-09-09 09:31:06 -04:00
lissav 40b5891c4a defect 4254 2014-09-08 12:20:14 -04:00
lissav 0c77d04e7c Defect 4270 2014-09-08 08:15:09 -04:00
Jarrod Johnson c79eca69df Add support for System X M5 generation for firmware inventory 2014-09-05 10:44:55 -04:00
zhaoertao 0f4a674527 modify genesis to support system P hardware discovery 2014-09-05 02:10:54 -07:00
huweihua 447b31ee60 modify code format error 2014-09-04 02:07:02 -04:00
zhaoertao ae5320d82b fix bug 4267:Missing includes for Sys::Syslog in /opt/xcat/lib/perl/xCAT_plugin/petitboot.pm 2014-09-03 02:04:27 -07:00
zhaoertao d8faafb4b4 add option "password" for rspconfig to change password for default user through IPMI 2014-09-03 01:21:22 -07:00
Jarrod Johnson 573fc1790f Mellanox renamed their driver in later kernels. If new name detected, substitute it 2014-09-02 10:37:23 -04:00
immarvin 8a6b60a769 #4262 The type of error message in rmosdistro is not string ref 2014-09-02 01:54:01 -07:00
huweihua 201fb1871b add Prep partition flag setting 2014-09-01 04:08:01 -04:00
huweihua ab8e64217f move Prep partition flag setting to imgcapture.pm 2014-09-01 04:03:49 -04:00
huweihua 027d4ff52a add some exclude file for support system p 2014-09-01 04:00:47 -04:00
ligc 18a3c26864 fix for bug 4265: remove getxcatdocs from PCM build 2014-08-31 23:24:42 -04:00
immarvin 1e2329be1d Merge branch 'master' of ssh://git.code.sf.net/p/xcat/xcat-core 2014-08-31 20:53:45 -07:00
immarvin 9fae510b2e correct a typo 2014-08-31 20:52:56 -07:00
immarvin fda569d340 fix defect #4263 Some packages in pkglist file are not exist in RHEL7 2014-08-31 20:35:11 -07:00
qyin f4ef1202fe Merge branch 'master' of ssh://git.code.sf.net/p/xcat/xcat-core 2014-09-01 10:49:59 +08:00
qyin eb5655a9e4 fix issue 241844 The added os packages are not installed when reinstall nodes. 2014-09-01 10:46:05 +08:00
lissav e140fcd040 defect 4262 2014-08-29 07:29:32 -04:00
junxiaw 3eabe15ff3 modify autotest xCATreg code 2014-08-29 00:35:59 -07:00
immarvin eaf7325a1c fix defect #4242 In physical rhel7 env,set installnic=ethx can not provision compute node. 2014-08-29 00:31:56 -07:00
Jia Zhao d87440ec41 merge from 2.8 branch about name mistake 2014-08-28 17:27:15 +08:00
ligc baa3edb3ca fix for bug 4372, set selinux be in permissive mode for RHEL 7 2013-11-26 16:49:09 +08:00
ligc fea8c45131 fix for bug 4288, add the -i flag to pasu manpage 2013-11-26 15:48:20 +08:00
ligc 01da31702e fix for bug 4421: change the term 'rpms' to 'packages' to make it be common for both RHEL/SLES and Ubuntu. Removed the postscripts/otherpkgs.ubuntu 2013-11-26 15:04:09 +08:00
ligc 358959724d fix for bug 4422: fix the ubuntu template problem with x86_64 kvm virtual machnes 2013-11-21 14:16:20 +08:00
litingt 5d55cc5dbe add help option 2014-11-19 20:28:18 -08:00
litingt 95e9cc18fb remove packages xCAT-IBMhpc xCAT-rmc xCAT-UI xCAT-OpenStack xCAT-OpenStack-baremetal in ALLBUILD 2014-11-19 20:18:59 -08:00
mellor afe37ebeab initialize rc var in Table.pm and tabutils.pm to remove warnings when running xcatd in foreground 2014-11-19 17:34:04 -05:00
ligc b19461a479 fix for bug 3343: remove the print Dumper(xxx) from the code 2013-11-20 10:53:00 +08:00
ligc 3281a3d1c3 fix for bug 4404, systemctl import-environment does not work on RHEL 7, should use systemctl set-environment 2013-11-20 10:37:03 +08:00
Casandra Qiu 5373b22b61 Bug#4408 pgsqlsetup didn't work on ubuntu 2014-11-18 09:57:24 -05:00
zhaoertao f6761bb0b7 fix bug 4126:vios:mkvm failedo 2014-11-18 05:29:23 -05:00
zhaoertao 3eec0c921d fix bug 4206: lsvm return null if the cec is in off state 2014-11-18 03:49:37 -05:00
zhaoertao 280ad16dbe fix bug 4377: add postinstall file under /opt/xcat/share/xcat/netboot/ubuntu for ubuntu support 2014-11-17 08:34:16 -05:00
ligc a74177cb86 fix for bug 4400, export DEBIAN_FRONTEND=noninteractive when running apt-get commands to avoid interactive procedure 2013-11-18 17:46:07 +08:00
ligc 02269d22b5 fix for bug 4400: add additional apt-get flag to avoid prompting interactive ations during packages installation 2013-11-18 16:29:13 +08:00
ligc f0987c908f fix for bug 4374: support running postscripts under directories in /intall/postscripts/ 2013-11-12 16:42:03 +08:00
baiyuan a049714a3e fix defect 4371 [fvt]2.9:restart xcatd error for kit.pm compilationerror 2014-11-10 03:45:48 -05:00
zhaoertao 878d9443dd enable SMT for powerKVM VMs 2014-11-10 03:09:23 -05:00
daniceexi d047c4cdf5 defect 4370: minor change in message for makedns 2014-11-10 06:34:14 -05:00
ligc cad641241d fix for bug 4369: fix the missing info in xcat.log on Ubuntu 2013-11-11 09:17:10 +08:00
Victor Hu b865f08e2e Merge branch 'bug3963' 2014-11-07 08:43:55 -05:00
baiyuan cec473c646 find the only version from dpkg -I 2014-11-07 03:20:13 -05:00
zhaoertao 392fc1b3cb fix bug 4368 mkvm for lpars in different CECs will failed 2014-11-07 03:00:38 -05:00
zhaoertao 614594fa52 4342 Wrong cpucount number is counted for PowerKVM host 2014-11-07 02:13:00 -05:00
baiyuan 340c5fc553 fix duplicate lines for IPADDR and NETMASK 2014-11-06 21:27:43 -05:00
Victor Hu b59f72bd8e changes to support --noupdate flag on genimage 2014-11-06 16:58:19 -05:00
zhaoertao 0215a5bed2 add PReP partition for sles12 ppc64le 2014-11-06 05:17:34 -05:00
daniceexi f0b9cac61c defect 4304: fixed several things: 1. how to handle ctrl+c; 2. handle the plugin process cannot be stopped by TERM signal to process group SSL_Listener. (make the plugin process locate in the SSL_listener process group); 3. Make DB Access process exits later than in processing request. 2014-11-06 06:24:50 -05:00
ligc 43c9fecd1a add sles12 pkglist and autoyast template 2014-11-06 01:38:34 -05:00
ligc b8bd2acad8 SLES12 ppc64le support: build ppc64le RPMs 2013-11-07 09:05:46 +08:00
Casandra Qiu e83055a0a1 bug #4364 change default vmnicmodel to virtio 2014-11-05 11:32:44 -05:00
zhaoertao 0705721307 fix bug 4357:After run nodeset <node> runimage' may fail 2014-11-05 06:07:30 -05:00
zhaoertao c20b47d205 enhance for fix debug 4324: xcat provisioning of does not go consistantly to the same disk drive. 2014-11-05 05:11:13 -05:00
litingt 2490baf473 update case to remove operation for xcatdport 2014-11-05 01:17:34 -08:00
huweihua 3ebf2f7851 fix the bug when use dracut to rebuild initrd 2014-11-05 02:22:40 -05:00
huweihua 00e96b2b57 Merge branch 'master' of ssh://git.code.sf.net/p/xcat/xcat-core 2014-11-05 01:52:06 -05:00
huweihua 24cc328940 add comments 2014-11-05 01:50:45 -05:00
baiyuan 8f6bd7a584 add lskitcomp -C support 2014-11-05 01:18:51 -05:00
zhaoertao 522a815c3d fix debug 4324: xcat provisioning of does not go consistantly to the same disk drive. 2014-11-05 01:00:55 -05:00
ligc da874a91f2 fix for bug 4347: lsvpd does not output the word 'cpu' on Ubuntu LE, it outputs 'processor' instead 2013-11-04 15:42:23 +08:00
zhaoertao 2170c7196f defect 4303 arrange lskit options 2014-11-03 07:13:53 -08:00
ligc f101f97df4 fix for defect 4337, add TERM into the systemd through systemctl import-environment TERM 2013-10-31 13:23:19 +08:00
mellor 0b35d9edd7 defect 4335 - remove confluent.pm and kit.pm from AIX builds 2014-10-29 10:41:13 -04:00
baiyuan dff4cad29f fix defect 3847 buildkit addpkgs -k -r left useless kit component rpm in complete kit repos dir 2014-10-29 05:14:53 -04:00
immarvin 1c379b1590 fix defect #4326 [fvt]2.9:load config file failed if more than one mac during vm install 2014-10-29 02:49:02 -07:00
ligc f6d48a858b fix for bug 4333: add the powerkvm 2.1.1 disc info 2013-10-30 15:13:01 +08:00
ligc cd4c886ba1 fix for rcons problem with kvm on SLES 12 and on PowerKVM 2013-10-30 14:55:32 +08:00
immarvin b94dcb02e4 fix defect #4326 [fvt]2.9:load config file failed if more than one mac during vm install 2014-10-29 00:54:58 -07:00
mellor 4781a420d2 defect 3348 - rmkitcomp by basename now removes all kitcomponents matching that name instead of just the highest 2014-10-28 17:47:51 -04:00
lissav c40c63ad77 defect 4329 2014-10-28 09:38:02 -04:00
lissav 424886c5d0 defect 3723 2014-10-28 07:15:05 -04:00
zhaoertao e81496cac9 support ubuntu 14.04.1 ppc64el diskless 2014-10-28 06:09:37 -04:00
baiyuan cf5ae47428 add osarch comments for Ubuntu Power LE 2014-10-28 05:46:23 -04:00
baiyuan 50f2f825ac use Utils instead of BuildkitUtils.pm 2014-10-28 05:36:29 -04:00
baiyuan 475e64aa69 use ppc64el now for ubuntu package use ppc64el 2014-10-28 05:14:42 -04:00
baiyuan dcaa4416af remove xcat-buildkit,xCAT-buildkit is here 2014-10-28 04:19:59 -04:00
immarvin ab0cba2748 Merge branch 'master' of ssh://git.code.sf.net/p/xcat/xcat-core 2014-10-28 01:59:34 -07:00
immarvin fead0c878e fix defect #4327 [dev] copycds should use ppc64le instead of ppc64el in ubuntu ppc64le 2014-10-28 01:58:19 -07:00
baiyuan f8db0659f0 fix 4325 Use buildkit to create kit,the osarch is always ppc64el .It's not consistenct with real osarch 2014-10-28 03:45:23 -04:00
baiyuan dab45f5df2 change name compute.ubuntu14.04.ppc64el.pkglist to compute.ubuntu14.04.ppc64le.pkglist 2014-10-28 03:39:23 -04:00
baiyuan 15bc5437f4 fix 4313 rmkitcomp, there is no options for --noscripts 2014-10-27 10:07:26 -04:00
baiyuan c57e57fc3f fix 4313 update help iniformation for some kit commands 2014-10-27 10:04:02 -04:00
baiyuan 49e7a6d393 multipul env param 2014-10-27 09:34:57 -04:00
baiyuan 13c93831bf use read only mount for kitcomponent during addkitcomp 2014-10-27 08:53:44 -04:00
baiyuan 3ec9780b6e fix 4322,genimage failed with pperte KIT componentwhich has environment variable 2014-10-27 05:59:56 -04:00
zhaoertao f5cf1968df add dependency xcat-buildkit for package xcat 2014-10-27 04:49:39 -04:00
zhaoertao a44d508044 add package xcat depending on xcat-buildkit 2014-10-27 03:57:21 -07:00
huweihua 8431d6cad9 fix defect 4295, sysclone can't clone a SLES11.3 golden client 2014-10-26 22:38:25 -04:00
Victor Hu f00771ff92 add rhel6.6 compute node media info to discinfo.pm 2014-10-24 15:03:40 -04:00
daniceexi 6244920305 Enhance the ddns.pm to support the site.dnsinterfaces for DNS server to listen on specific interfaces instead of all 2014-10-24 09:43:31 -04:00
ligc a3028511fa remove the ifnarch s390x, the ifarch/ifnarch does not work for noarch package, grub2-xcat is shipped with s390 xcat-dep 2014-10-24 03:54:08 -04:00
ligc 215e4620b6 fix for bug 4319: should not require ipmitool-xcat and xCAT-genesis-base on AIX 2013-10-25 11:47:53 +08:00
litingt b4cd2e016b add kit bucket test data 2014-10-23 19:33:05 -07:00
litingt f1a75b17d3 add addkit test cases 2014-10-23 19:25:37 -07:00
litingt 851094e6a1 add buildkit test cases 2014-10-23 19:23:32 -07:00
litingt f383d4d0fc add addkitcomp test cases 2014-10-23 19:21:46 -07:00
litingt 37672312ba add chkkitcomp test cases 2014-10-23 19:20:06 -07:00
litingt 8133553481 add lskitdeployparam test cases 2014-10-23 19:18:43 -07:00
litingt ad2b7370cc add lskit test cases 2014-10-23 19:17:35 -07:00
litingt 0db64ebb8e add rmkit case 2014-10-23 19:15:59 -07:00
litingt 85075225ca add rmkitcomp cases 2014-10-23 19:14:53 -07:00
litingt f35a5b6071 add lskitcomp cases 2014-10-23 19:13:25 -07:00
litingt 91c67cea57 add KITDATA for kit case test 2014-10-23 19:10:39 -07:00
litingt ad0118ddf9 fix defect 4314 update for ubuntu specific case support 2014-10-23 19:06:34 -07:00
lissav be7dea96d5 add setup of MN/SN SLES12/rsyslog 8 support defect 4311 2014-10-23 09:20:13 -04:00
baiyuan ae11f1f4fe fix defect 4309 lskitdeployparam -k returns kit plugin bug 2014-10-23 05:19:46 -04:00
daniceexi 50a441209b Code drop for supporting KVM/VMware based virtualization in rest api interface 2014-10-23 08:17:16 -04:00
linggao 73d08b58fa added nmapoptions in the site table to resolve network slow response issues in nmap. defect 4300 2014-10-22 18:36:59 -04:00
mellor 7e8c02bf07 defect 4304 - fixed some more interprocess communication problems 2014-10-22 17:20:07 -04:00
Victor Hu f904ce2cc1 add media tags for rhels6.6 support, x86_64 and power 2014-10-22 16:12:27 -04:00
zhaoertao 0096a8dde0 fix bug: 4310 xdsh to Cisco SG300-52 switch does not work, don't affect the original supporting 2014-10-22 15:39:24 -07:00
zhaoertao de215daef3 fix bug: 4310 xdsh to Cisco SG300-52 switch does not work 2014-10-22 14:55:08 -07:00
lissav 75f15ce9b7 SLES12/rsyslog 8 support defect 4311 2014-10-22 07:42:42 -04:00
huweihua b5f708ed39 fix defect 4289: sysclone failed to update target node with rpm update 2014-10-22 05:36:16 -04:00
huweihua ccfa70d8c8 support lvm in legacy mode on x system 2014-10-22 05:23:43 -04:00
zhaoertao c270d5e563 support copycds and nodeset for SLES 12 ppc64le 2014-10-22 08:26:00 -07:00
zhaoertao a049575c4f fix bug 4305:error info :Unknown arch during ubuntu 14.04.01 osimage nodeset on p8le env 2014-10-22 03:21:39 -07:00
daniceexi d718ba8396 defect 4283: add note head of the subtourines (in hosts.pm) which called in ddns.pm. Generally xcat does not suggest that call subroutine of xcat_plugin from antoher xcat_plugin module, but since the change would be big, I add this note head the subroutines as a notification for the member who would change the involved subroutines. 2014-10-22 02:03:07 -04:00
lissav 402c91cfcc fix syntax error 2014-10-21 15:23:44 -04:00
baiyuan 79d784a384 Merge branch 'master' of ssh://git.code.sf.net/p/xcat/xcat-core 2014-10-21 05:18:51 -04:00
immarvin 5b59d6eddf Merge branch 'master' of ssh://git.code.sf.net/p/xcat/xcat-core 2014-10-21 03:18:22 -07:00
immarvin 2c070624ff process the genimage with kit stuff 2014-10-21 03:18:04 -07:00
baiyuan 9552485df6 genimage cannot use Symbolic link in ubuntu,use mount --band instead 2014-10-21 05:18:14 -04:00
Victor Hu 1d781ea39f Bug #3832 rewrite logic for dhcpd config, avoid dual code path 2014-10-20 14:42:54 -04:00
baiyuan 49bf7c1200 defect 4302 lskit/lskitcomp --xml has no output 2014-10-20 05:24:09 -04:00
baiyuan d5320ca977 defect 4302 lskit/lskitcomp --xml has no output 2014-10-20 05:18:19 -04:00
baiyuan 3573ced9eb defect 4301: buildkit -v does not have correct output 2014-10-20 01:53:43 -04:00
ligc 0654fa65e6 fix for bug 2796: should not include AIX perl path in @INC on Linux 2013-10-22 16:58:19 +08:00
huweihua 8ea1539aa2 remove excess debug output 2014-10-21 04:40:02 -04:00
huweihua 3ce3e80a4c add support for Ubuntu14.04.1 in p8 le 2014-10-21 04:34:35 -04:00
huweihua 2959c875ed add support for Ubuntu14.04.1 in p8 le 2014-10-21 04:32:18 -04:00
ligc fd13ae7232 fix for 4260: otherpkgs to add the fix for SL 2013-10-22 15:37:07 +08:00
ligc f474dbd1b9 fix for bug 4260: otherpkgs add /etc/yum.repos.d/xCAT-* for centos 2013-10-22 15:02:48 +08:00
ligc 9b402bb656 fix a problem in the last checkin 2013-10-21 11:11:50 +08:00
ligc e570ed6e49 remoteshell fix for SLES 12 support, sshd is not enabled by default on SLES 12, enable sshd in remoteshell postscript 2013-10-21 11:02:37 +08:00
ligc 57c53ba533 copycds supports sles12 2013-10-15 15:36:23 +08:00
ligc 99e6319765 fix for building genesis-base for PCM on MCP 2013-10-15 09:51:21 +08:00
lissav c631a0107d new fix for 4285 2014-10-13 08:28:55 -04:00
ligc 24f771dbe6 fix rpm packaging problem with xCAT-genesis-scripts 2014-10-13 03:31:06 -04:00
ligc cde6b88011 xCAT-genesis-base: add head, basename, whoami for P8 LE firmware update 2013-10-14 14:47:21 +08:00
daniceexi 088cb897b2 add the dracut_033 dir for stateless support of centos,SL,ol. It's just a dir link to the rh 2014-10-13 06:59:19 -04:00
daniceexi fdfa1fe290 defect 4283: fix the syntax issues in the hosts.pm and NetworkUtils.pm for the code that support multiple domain and makehosts against nics table 2014-10-10 11:13:39 -04:00
baiyuan 037a8db481 fix prep pakage name in kit.conf for Ubuntu 2014-10-10 06:47:03 -04:00
lissav 8ff7a04ee3 defect 4285 2014-10-10 06:38:27 -04:00
lissav 85019012cb Merge branch 'master' of ssh://git.code.sf.net/p/xcat/xcat-core 2014-10-10 06:19:42 -04:00
zhaoertao dd636f8108 support firmware update for p8LE 2014-10-10 03:14:52 -07:00
lissav 33213acfae Add --ip to the interface defect 4285 2014-10-10 06:14:05 -04:00
ligc 50d51f4e40 add xfs kernel module and binary for sysclone support on RHEL 7 2013-10-11 17:31:55 +08:00
ligc ae31875596 lsdef -t auditlog may return nothing 2013-10-11 11:44:21 +08:00
Victor Hu 64c3c7c273 missed ~ in =~ in changes from dhcp.pm 2014-10-09 13:38:22 -04:00
Victor Hu 062bc44605 Merge branch 'master' of ssh://git.code.sf.net/p/xcat/xcat-core 2014-10-09 13:37:49 -04:00
baiyuan 425dbf90ed wrong complete kit path 2014-10-09 03:19:08 -04:00
Victor Hu 9af411c290 Merge branch 'master' of ssh://git.code.sf.net/p/xcat/xcat-core 2014-10-08 14:24:05 -04:00
Casandra Qiu 5cb4f7a8d9 bug #4081, remove syntax warnings 2014-10-08 13:51:48 -04:00
Victor Hu 1c0f2b5bef clean up formatting of dhpc.pm 2014-10-08 13:33:23 -04:00
Victor Hu e438c2f766 Add check for Ubuntu on Power7 where iso called powerpc 2014-10-08 13:32:24 -04:00
baiyuan ee82fa97b4 add fix debian preinstall script errors 2014-10-08 09:06:52 -04:00
baiyuan 97df5ec9a6 In ubuntu, rpm can be installed, if rpm is installed,ubuntu will use rpm instead of dpkg,so check dpkg first 2014-10-08 04:32:48 -04:00
daniceexi b76e15c487 minor fix for configib 2014-10-08 08:10:51 -04:00
zhaoertao 32d389cbee add message for 'mknb' in ubuntu LE 2014-10-07 23:19:36 -07:00
mellor cc67df3caa minor error msg fixes for kit cmds 2014-10-07 18:03:47 -04:00
mellor f5296e4107 fix def mapping of kitrepo osbasename attribute 2014-10-07 17:47:53 -04:00
mellor e9dd282fdf defect 4282 fix debian preinstall script errors 2014-10-07 14:05:22 -04:00
mellor 590b18a34c defect 4277 - allow gpfs_updates script to create gpfs.csh profile that works for both csh and tcsh 2014-10-06 10:20:45 -04:00
zhaoertao aea40b0226 fix an issue about hardware discovery process: the sub process can not receive findme request immediately 2014-10-04 23:20:48 -07:00
Victor Hu c3f0760164 Bug:3832 - test sles OS before checking dhcpd6 file when ipv6 used, fix formatting 2014-10-01 18:02:46 -04:00
mellor 1d241dedf0 added undocumented flag to buildkit to allow our local build team to create Ubuntu kits on our RH build servers 2014-10-01 15:16:54 -04:00
mellor 3133cbeb3f 1. add xCAT depend on xcat-genesis-scripts, 2. fix mknb issue, 3. modify xcatconfig to call mknb <ppc64/x86_64> 2014-09-29 21:26:52 -07:00
mellor 03c9a17566 Miss xCAT-buildkit in build-ubunturepo 2014-09-29 20:28:05 -07:00
mellor 88003827c9 build xCAT-genesis-scripts for p8LE 2014-09-29 20:25:37 -07:00
mellor 1aa1f30cdc added xCAT-buildkit package to build-ubunturepo 2014-09-29 17:57:23 -04:00
mellor 87840527c2 enhance for p8 hardware discovery 2014-09-26 03:55:57 -07:00
mellor 4e008d7895 enhance for p8 hardware discovery 2014-09-26 03:54:52 -07:00
huweihua e2e8463d64 add test for update delta changes 2014-09-25 22:48:53 -04:00
litingt d0198f8592 add waiting time 2014-09-25 04:39:38 -04:00
litingt 769f05bd91 add time delay 2014-09-25 04:35:31 -04:00
yinle 365b378f4b add check before sending mail to avoid mail warning 2014-09-25 15:31:11 -07:00
yinle 7ab784ea38 Merge branch 'master' of ssh://git.code.sf.net/p/xcat/xcat-core 2014-09-25 15:28:10 -07:00
yinle 5054e01a26 Merge branch 'master' of ssh://git.code.sf.net/p/xcat/xcat-core 2014-09-25 14:52:34 -07:00
ligc 6aabbe5ae2 build xCAT-genesis-scripts for ppc64 2014-09-25 02:22:46 -04:00
ligc af16b12041 Merge branch 'master' of ssh://git.code.sf.net/p/xcat/xcat-core 2014-09-25 02:17:48 -04:00
ligc 0541a3361a add Requires: xCAT-genesis-scripts-ppc64 in xCAT.spec for ppc64 arch 2014-09-25 02:17:35 -04:00
huweihua 641d9bd78a add otherpkgs.pkglist file for rh5 + system x 2014-09-25 02:10:42 -04:00
mellor b06aa3afb0 enhance of creating default netboot configuration file for p8 hardware discovery 2014-09-24 20:23:20 -07:00
ligc 7ae2e3d8f3 change the xCAT-genesis-base version from 2.8 to 2.9 2014-09-24 22:58:51 -04:00
lissav b0eff0cf94 fix build of http://xcat.sourceforge.net/man5/xcatdb.5.html 2014-09-24 07:12:23 -04:00
baiyuan d29aea3c01 add get_latest_version_deb 2014-09-24 06:46:59 -04:00
mellor 08e0ce42f0 correct the default configuration file for p8 hardware discovery 2014-09-24 02:41:55 -07:00
mellor ee1a1574c3 generate default netboot configure file for p8 hardware discovery 2014-09-24 02:38:54 -07:00
baiyuan d8eeeb306b fix dpkg compare version op 2014-09-24 04:19:33 -04:00
daniceexi ac34247aba defect 4726: cold reset bmc for specific firmware in the end of bmcsetup to make bmc take effect. 2014-09-24 03:14:32 -04:00
baiyuan ec61ef27da add metadeb and all support 2014-09-23 22:47:52 -04:00
Jarrod Johnson 4100dd77e4 Add capability for plugins to supply a description in update_tables_with_templates 2014-09-23 10:46:28 -04:00
baiyuan fc8b2cc4eb prep deb support in buildrepo 2014-09-23 06:39:08 -04:00
huweihua 0fa2dbd486 add otherpkgs.pkglist for sysclone on rh6+p, rh7+x, rh7+p 2014-09-23 04:38:37 -04:00
huweihua 7edce8ec57 add pkglist for sysclone on sles 11 and p system 2014-09-23 04:36:31 -04:00
mellor 5576b8b1f4 enhance for finding bootnic in genesis 2014-09-22 20:37:29 -07:00
baiyuan 92d313bb20 change ubu arch in validate_os 2014-09-22 23:11:15 -04:00
mellor f39c0f46a1 enhance for MTM based p8 hardware discovery 2014-09-22 19:11:16 -07:00
lissav 547cbd4217 add xmlapi test cases, they do not need to ship with rpm 2014-09-22 10:28:08 -04:00
baiyuan 25ffc91f0f find latest deb pkg 2014-09-22 04:24:00 -04:00
baiyuan a5dceadccf NEW_kit_addpkgs support debian 2014-09-22 04:09:22 -04:00
mellor 1407d0044e Do clean up things for Power LE hardware discovery 2014-09-19 08:00:13 -07:00
mellor ba706470d0 support rspconfig <node> ip/netmask/gateway for Power LE machine 2014-09-19 07:50:53 -07:00
mellor 61517af5ce remove the lsslp defined pbmc node from the found nodes 2014-09-18 20:01:37 -07:00
baiyuan ec400ad4b4 add pkg1 sample for debian kit to let default buildkit.conf work 2014-09-18 05:35:23 -04:00
immarvin 425f741435 remove temp file fron git 2014-09-18 01:19:02 -07:00
immarvin d12e49efe3 remove temp files in the git 2014-09-18 01:16:33 -07:00
yinle 04f26ded54 minor fix 2014-08-21 10:49:08 -07:00
Jia Zhao e8d48b81e0 Merge branch 'master' of ssh://git.code.sf.net/p/xcat/xcat-core 2014-08-20 16:56:49 +08:00
Jia Zhao a2332700d5 Merge branch 'master' of ssh://git.code.sf.net/p/xcat/xcat-core 2014-08-20 16:56:02 +08:00
ligc 68758810b0 fix for xCAT-genesis-builder.spec, can not use /, will cause problem for RHEL 7 2014-08-20 04:55:55 -04:00
Jia Zhao 8ced43ef98 fix long name error during import node 2014-08-20 16:55:10 +08:00
huweihua b383556d34 make mkinitrd support rhels5.x and centos5.x 2014-08-20 04:06:33 -04:00
daniceexi fc55bc9fd7 fix the issue that config alias would remove the original ip on the dev 2014-08-20 08:52:08 -04:00
Jia Zhao 99365ff4a8 add lparid in nodeimport man page 2014-08-20 15:39:25 +08:00
Jia Zhao e1c67b0724 fix no bmc ip while reinstall node 2014-08-20 15:33:29 +08:00
mellor ec38cf3e61 add copycds man pg example for supplemental iso 2014-08-19 07:41:38 -04:00
zhaoertao 2c12505a11 fix bug 4251:nodeset return xnba plugin bug, pid 657 when node mac is not defined 2014-08-19 00:25:42 -07:00
zhaoertao 2a6fe02049 fix bug 4195:rinv returns different content between with and without -x flag 2014-08-18 20:31:55 -07:00
ligc 6a44ddea08 update xcatconfig to call mknb ppc64 on power 2013-09-26 14:51:52 +08:00
ligc d7081292fc fix for 4261: add the getnodesetstat support for grub2 2013-08-29 15:18:48 +08:00
huweihua ef94ee5642 sysclone support p: set target node boot from disk after clone install 2014-08-28 02:21:56 -04:00
ligc 3beec6c8b1 fix two copyright files xCAT-genesis-scripts/debian/copyright and xCAT-OpenStack-baremetal/debian/copyright, should use EPL license 2013-08-29 09:31:54 +08:00
ligc 13b71591e0 add the qlcnic module into genesis-base, it is for Q-Logic 10Gb Virtual Fabric Adaptor NICs, ibm nx360m4 is equipped with this adapter 2013-08-28 16:39:02 +08:00
ligc 5cccca9d1c fix a problem for compiling ppc64 genesis-base 2013-08-28 16:20:01 +08:00
zhaoertao 15cc210445 fix bug 4250 xcat crashes system console on IBM power system: 8248-L4T 2014-08-27 00:50:58 -07:00
ligc 90ed515fb3 support genesis-base on ppc64: use -N with dracut command on ppc64 2013-08-28 11:25:53 +08:00
ligc 9a05a5ea1f fix the file <xxxxdirectory> from install of xCAT-genesis-scripts-ppc64-1:2.9-snap201408210348.noarch conflicts with file from package xCAT-genesis-base-ppc64-1:2.9-snap201408210346.noarch, if the rpms are built on RHEL 7 or Fedora 20 2014-08-26 04:29:01 -04:00
ligc 151409cff9 Compile genesis-base on Fedora ppc64, the ibm virtual disk module is ibmvscsi 2014-08-26 02:36:13 -04:00
Jia Zhao 975b90e619 validate cec and lparid during nodeimport 2014-08-26 14:11:31 +08:00
immarvin 9b5f4e2d05 fix defect #4246 In rhel7/p8 env,sometimes cn provision status is failed. 2014-08-25 21:29:03 -07:00
huweihua f9e77f3ddf add sfdisk command for sysclone support p 2014-08-25 03:26:34 -04:00
huweihua 18a8cdf36a sysclone support p system 2014-08-25 03:23:47 -04:00
huweihua 246f7d1e2b sysclone support p system 2014-08-25 03:15:58 -04:00
huweihua 40f96179a6 only used by sysclone, change the disk by-id name of targer node when deploy it 2014-08-25 03:00:13 -04:00
immarvin 4e9ee2bbdc add kdump support for redhat7 stateless 2014-08-24 22:30:39 -07:00
immarvin a6ca187a16 add kdump support for redhat7 2014-08-24 07:54:52 -07:00
zhaoertao 7fffc07e54 Fix bug 4257: chvm hugepage doesn't work with dfm on Powerlinux 2014-08-22 03:27:41 -07:00
Lei Ai 4753c86b38 merge fix from 2.8 branch: clear currchain while regen chain 2014-08-22 17:01:54 +08:00
mellor 812fc4b3bc man page updates for rewritten getxcatdocs to work with Allura wiki on sourceforge 2014-08-21 19:03:46 -04:00
mellor 77625c7fe9 rewrote getxcatdocs to work with Allura wiki on sourceforge 2014-08-21 16:14:29 -04:00
immarvin 6bfb39fb7d Merge branch 'master' of ssh://git.code.sf.net/p/xcat/xcat-core 2014-08-21 02:06:05 -07:00
immarvin d92fc99a3a add template and pkglist of kvm.rhel7 2014-08-21 02:05:18 -07:00
ligc 70668c86a8 Merge branch 'master' of ssh://git.code.sf.net/p/xcat/xcat-core 2014-08-21 03:44:23 -04:00
ligc 7ae7479c3a support xcat genesis on ppc64: check if the dmidecode exists before run dmidecode 2014-08-21 03:42:12 -04:00
zhaoertao c703748797 remove lowpower option for rpower from Usage 2014-08-21 00:26:37 -07:00
immarvin 79ad455b31 fix defect #4253 [DEV] the substitution bug in post.xcat 2014-08-21 00:08:37 -07:00
immarvin 33fd485628 fulfill the requirement of defect #4242 In physical rhel7 env,set installnic=ethx can not provision compute node. 2014-08-20 23:27:00 -07:00
ligc ac121cabbe support genesis on ppc64, compile on Fedora 20 ppc64 2013-08-22 16:04:33 +08:00
ligc c455d1dbe9 fix for bug 4249: use xCAT::Utils in ddns.pm 2013-08-20 11:02:16 +08:00
daniceexi ea56c3ebee Code change for the support of latest ganglia on ppc64 2014-08-18 10:05:09 -04:00
chenglch 7e90a37681 upgrade ironic baremetal driver for ironic update a abstract class 2014-08-17 22:21:25 -04:00
lissav 4903509b05 fix example 2014-08-14 08:09:21 -04:00
Jarrod Johnson 09ac1b8a27 Add DDR4 SPD decode 2014-08-13 17:00:37 -04:00
immarvin 83baec8526 #4227 Enhance configfirewall script to handle rhel7 firewall rule setting 2014-08-13 00:53:56 -07:00
immarvin 81e86de979 fix defect #4245 In rhels 7 env,setupntp script will show error message 2014-08-12 08:37:20 -07:00
ligc 7be4cc008c add the xCATsn into the PCM build, PCM team requires this 2014-08-12 05:43:54 -04:00
Lei Ai c635c4da8a Merge nodechmac enhance from 2.8 branch 2014-08-12 17:31:24 +08:00
huweihua 2e9cc3742f add --no-bootloader option for si_updateclient command 2014-08-12 04:55:52 -04:00
chudegao 6003b146ae merge getmacs function from 2.8.2-pcm and fix a bug 2014-08-10 22:09:21 +08:00
immarvin 3b194a3815 fix defect #4238 [FVT]: xcat installation on sles gives out /sbin/SuSEfirewall2: line 507: /proc/net/ip_tables_names: No such file or directory 2014-08-09 04:25:16 -07:00
immarvin 2c196c5b63 #4242 In physical rhel7 env,set installnic=ethx can not provision compute node. 2014-08-09 02:22:21 -07:00
immarvin 1f37d0d359 fix defect #4238 [FVT]: xcat installation on sles gives out /sbin/SuSEfirewall2: line 507: /proc/net/ip_tables_names: No such file or directory 2014-08-08 08:56:11 -07:00
immarvin 513c8d0e1b correct a typo 2014-08-07 20:35:57 -07:00
huweihua ce985114c6 add entries for support sysclone on p and LVM 2014-08-07 21:49:12 -04:00
chenglch 2366886fc9 ironic baremetal driver rsetboot net 2014-08-07 05:15:51 -04:00
daniceexi fd1a6dba31 defect 4232: fix1 - support interface named like em5 which is the general format of Ubuntu; fix2 - fix the issue that confignics cannot handle the networks attribute has multiple nets for one nic 2014-08-07 02:38:27 -04:00
yinle 4b7acd5bb1 record more log and adjust format 2014-08-06 14:48:58 -07:00
Jia Zhao 281b0ade7e fix importing node error in rh7 with power8 env 2014-08-06 13:53:15 +08:00
lissav d0ee775708 defect 4230 2014-08-05 07:31:04 -04:00
lissav da17bda0a5 fix comment for changes in 3870 2014-08-05 07:10:44 -04:00
huweihua 19e7c2071d fix bug4218:rscan -w writes wrong mgt for the CECs 2014-08-04 22:03:40 -04:00
ligc e48e3b1c1a fix for bug 4212: rnetboot -m and rpower -m arguments parsing error 2013-08-05 17:52:24 +08:00
ligc 3e1316d9a6 fix for bug 4241: do not try to run mknb on ppc64 for now 2013-08-05 17:27:15 +08:00
daniceexi ef0fbad422 fix the issue in rcons that it generated empty .consolerc. and fixed the issue that generated incorect .consolerc when run multiple rcons in parallel 2014-08-04 10:14:26 -04:00
zhaoertao 46f1d9465e fix bug 4191 [FVT on Power 8 DFM]mkvm won't create a partition according to the definition 2014-08-01 03:12:01 -07:00
chenglch b5fca17987 add ironic baremetal driver 2014-08-01 05:06:02 -04:00
Jarrod Johnson 48641cf945 Modify for 0.2 confluent
0.2 confluent rethought some facets.  Adapt to that reality
2014-07-31 09:09:17 -04:00
zhaoertao ea79842882 fix bug 4228:rpower cec suspend return conflict result and 4199:getmacs can't get physical partition's macs, modified manpage and usage for rpower and getmacs 2014-07-31 02:25:43 -07:00
ligc 49814b311c fix a message typo in *sqlsetup scripts 2013-08-01 16:42:45 +08:00
zhaoertao 545fe7fb50 fix bug 4211 [FVT on Power 8 DFM]There is no description for rnetboot ipl in man rnetboot 2014-07-31 01:22:56 -07:00
zhaoertao d3f25a84db fix bug 4213 [FVT on Power 8 DFM]rnetboot -v returns wrong command version 2014-07-31 01:02:47 -07:00
zhaoertao b06ac7a8c9 fix bug 4221 [FVT on P8 BE with HMC] help info of rspconfig is not clear 2014-07-30 23:46:06 -07:00
zhaoertao f3c2e1f22d fix defect 4222 [FVT on P8 BE with HMC] rspconfig returns hmc plugin bug 2014-07-30 19:57:14 -07:00
daniceexi 3c97d11beb Enhance restapi automation doc generator to make it can generate the markdown formatted doc 2014-07-30 10:16:30 -04:00
ligc 5d547f0985 fix for bug 4239: do not use ip command on AIX 2013-07-31 16:23:43 +08:00
daniceexi a10fe3f1d6 enable the rvitals and lsvm commands handle in ppc.pm 2014-07-30 07:37:31 -04:00
huweihua f9b61a3bf1 add comment to attr rootimgdir in sysclone environment 2014-07-30 01:35:25 -04:00
daniceexi d13d0835c4 defect 4226: fix the issue that rvital cannot handle cec which has no parent att was set 2014-07-30 04:17:32 -04:00
immarvin 113e7372fc add default pkglist for ubuntu netboot 2014-07-29 20:45:11 -07:00
huweihua d2a6ee27d5 add updatenode usage in sysclone environment 2014-07-29 22:30:51 -04:00
mellor 1db0f7419e Merge branch 'master' of ssh://git.code.sf.net/p/xcat/xcat-core 2014-07-29 12:36:37 -04:00
mellor 0d90767a46 defect 4229 update xCAT-client spec and add man for rescanplugins in xCAT 2.9 only 2014-07-29 12:35:38 -04:00
lissav 8e06c3fb23 remove mediawiki path from the man pages 2014-07-29 12:17:19 -04:00
lissav a03ecf8daa remove mediawiki path from the man pages 2014-07-29 12:16:06 -04:00
lissav 7203b4db08 fix comments 2014-07-29 12:00:20 -04:00
mellor 27abfa4c23 defect 4229 replace xcatd reload with call to new rescanplugins in kit add and kit remove for xCAT 2.9 only 2014-07-29 11:55:46 -04:00
mellor cea7f53e91 defect 4229 add new rescanplugins support to xcatd 2014-07-29 11:19:55 -04:00
immarvin 84eca8b73b add compute.ubuntu14.04.pkglist for netboot 2014-07-29 03:40:57 -07:00
immarvin 17317c3ef3 #4165 [FVT]:copycds -i return no DISKNO 2014-07-29 02:34:08 -07:00
ligc 2f666702c2 fix for bug 4203: update the makeconservercf manpage and usage information 2014-07-28 17:32:54 -05:00
ligc 1a35256053 fix for bug 4202: parse the rcons -help and rcons --help 2014-07-28 17:01:19 -05:00
immarvin d2cda7eb9e fix defect #4201 grub2 failure with mixed case mac address 2014-07-28 02:45:13 -07:00
ligc 7b52961f4b fix for bug 4184: make the message 'make sure rcons works for <node>' be non-verbose message 2014-07-28 16:35:49 -05:00
immarvin 1bafec231a add net-tools to service pkglist 2014-07-28 02:21:25 -07:00
ligc fc6536eb30 fix for bug 4150: modify xCAT-genesis-scripts.spec, xCAT-genesis-base.spec and xcatconfig to not run mknb twice during xcat installation/update 2014-07-27 22:43:38 -04:00
lissav 109e086253 defect 4235 2014-07-25 09:09:29 -04:00
lissav 5ffb067e5e defect 4235 2014-07-24 11:05:45 -04:00
lissav 8ce66a26f0 defect 4235 2014-07-24 10:46:36 -04:00
ligc 498afad13c fix for bug 4129: remove duplicate messages in debian.pm 2014-07-24 17:23:47 -05:00
ligc 0d78da8895 fix for bug 4187: uncomment the SSL_verify_mode in prsync for RHEL7 2014-07-24 17:06:33 -05:00
daniceexi d17b873107 Discover ip attributes for lsslp -s IVM; change the default discovred ivm named with ivm-mtm-sn instead of Server-mtm-sn 2014-07-24 09:33:23 -04:00
daniceexi d94108f7bb code change to support lsslp and rscan for IVM. fix the issue that IVM lpar boots to openfirmware after os deployment by adding a command [chsyscfg boot_mode=norm] after rnetboot to make the bootmode to normal instead of of 2014-07-23 10:20:17 -04:00
immarvin 8b362709b4 fix defect #4233 syslog changes give syntax error on AIX 2014-07-22 23:20:03 -07:00
immarvin b07006d576 fix defect #4229 xcatd will restart when add a kit or remove a kit that has a plugin 2014-07-22 20:36:44 -07:00
lissav 7680ac2dec fix for ecdsa support 2014-07-22 10:30:22 -04:00
lissav dad35bb816 defect 4231 2014-07-22 07:22:55 -04:00
yinle 8945dd34c3 fix the bug of processing result 2014-07-22 16:49:55 -07:00
lissav ba99e7cef1 defect 4231 2014-07-21 12:48:42 -04:00
lissav 22d0dd5eb7 defect 4231 2014-07-21 12:47:03 -04:00
lissav 946664e1a1 defect 4231 2014-07-21 12:44:57 -04:00
yinle e92f283f53 fix a minor bug 2014-07-21 16:48:22 -07:00
immarvin 07d51d6e5e add comment for servicemap subroutine 2014-07-17 08:04:45 -07:00
yinle 3187579cab bug fixing 2014-07-17 16:39:57 -07:00
zhaoertao 7b4aea756f make options for chvm easier to understand 2014-07-16 02:39:38 -07:00
immarvin dd1478c5e1 fix the defect #4217 [FVT]pgsqlsetup -i failed to start postgresql 2014-07-15 03:10:55 -07:00
daniceexi 399159c045 changed the plugin for renergy to handle the output format change in nmap 2014-07-15 10:11:12 -04:00
zhaoertao a68140b3b9 fix a bug about putting mypostscripts for ubuntu 2014-07-13 21:52:57 -07:00
lissav 0fba751c63 fix incorrect change for starting mysql using startservice, sles/rh different 2014-07-11 08:52:48 -04:00
yinle 4de9ae70fa minor fix 2014-07-10 16:00:08 -07:00
Lei Ai 9b7842df35 merge profile consistent check fix from 2.8 branch 2014-07-10 11:39:09 +08:00
daniceexi a3cc1f8c3d SL6.5 support 2014-07-10 02:48:05 -04:00
daniceexi 984cc68c7a routeop: for replace operator, convert dotted-decimal netmask to CIDR format 2014-07-09 08:43:44 -04:00
zhaoertao 39ff855a02 remove option 'lowpower' for rpower, it is used for p7IH only 2014-07-09 00:32:09 -07:00
Jarrod Johnson b987c7c15f CentOS 7 Everything ISO recognition 2014-07-08 16:53:36 -04:00
baiyuan 26ac0c0eec back to original for xdsh non-root support 2014-07-08 02:52:33 -04:00
zhaoertao a2d182ca9a fix bug 4186 [FVT on Power 8 DFM]chvm can't delete a assigned adapter for physical partition 2014-07-07 15:48:18 -07:00
lissav 69017348db defect 4182 2014-07-07 10:34:13 -04:00
baiyuan 2957dc90cb enhance code for both root and non-root user 2014-07-07 09:33:14 -04:00
baiyuan 47a98444ab support both root user and non-root user in xcat mn 2014-07-07 08:48:06 -04:00
ligc 3757a0aeec Merge branch 'master' of ssh://git.code.sf.net/p/xcat/xcat-core 2014-07-07 17:54:37 -05:00
ligc 394f19aa65 add the ibmveth and ibmvscsi driver into genesis-base, for genesis support on ppc64 nodes 2014-07-07 17:53:17 -05:00
ligc 1ea6e1c04a fix for bug 4187: uncomment the SSL_verify_mode in prsync for RHEL7 2014-07-07 10:18:24 -05:00
baiyuan 437021b8e0 support for non-root 2014-07-07 01:03:46 -04:00
baiyuan 01a3803d0a support for non-root user 2014-07-07 01:01:21 -04:00
immarvin 6891beab89 fix defect #4190 [DEV]apache2 configuration file /etc/apache2/conf-enabled/xcat.conf.apach24 failed to be applied on ubuntu14.04 MN 2014-07-05 04:54:29 -07:00
immarvin 17cbf2ac8b fix defect #4190 [DEV]apache2 configuration file /etc/apache2/conf-enabled/xcat.conf.apach24 failed to be applied on ubuntu14.04 MN 2014-07-05 02:49:42 -07:00
immarvin b5ff0604a2 fix defect #4189 [DEV] ubuntu14.04-x86_64-netboot-compute provision complains (/tmp/updateflag: line 4: nc: command not found) and defect #4188 [DEV]2 warning message during genimage ubuntu14.04-x86_64-netboot-compute 2014-07-04 23:32:58 -07:00
immarvin b6afbee55f add support for Upstart of ubuntu on service management 2014-07-04 09:08:12 -07:00
yinle 60d993bcac modify log reading and fix some bugs 2014-07-04 17:08:36 -07:00
immarvin 0d5a3becee add support for Upstart of ubuntu on service management 2014-07-04 02:11:04 -07:00
zhaoertao 8c296f2257 supporting of build xcat-core for ppc64el 2014-07-04 00:14:11 -07:00
daniceexi 16b585a088 defect 4111: enhance the [routeop replace] to support redhat and sles. /etc/sysconfig/network-scripts/route-ifname is used for redhat to store the persistent route setting. The ip command is used to replace route command. 2014-07-03 16:29:02 -04:00
ligc c4223de958 xCAT-genesis-scripts spec to work for both x86_64 and ppc64 2014-07-03 17:49:13 -05:00
immarvin 8cab4c75d8 add net-tools to the compute.rhel7.pkglist 2014-07-03 01:40:20 -07:00
ligc f50d12f695 update xCAT-genesis-builder makerpm for ppc64 platform 2014-07-03 09:21:52 -05:00
ligc bfc49280f3 remove efibootmgr from xCAT-genesis-builder.spec, efibootmgr will be installed on x86_64 Linux, and the efibootmgr prerequisite breaks genesis on ppc64 platform 2014-07-02 17:52:10 -05:00
huweihua 12df11297b modify defect: miss boot_root attr in legacy mode 2014-07-02 05:20:51 -04:00
huweihua 7b4ac7b45b delete some comments 2014-07-02 05:12:22 -04:00
zhaoertao 31fde8c3f4 support set 'x%' for option '-l rootlimitsize' of genimage 2014-07-01 02:15:47 -07:00
immarvin 364849f5bd fix defect #4180 [DEV](xcatconfig -i) complains (Command failed: find /usr/share/zoneinfo -type f -exec cmp -s /etc/localtime {} \; -print | grep -v posix | grep -v SystemV 2>&1. Error message: .) on ubuntu14.04 2014-07-01 03:07:51 -07:00
zhaoertao 827d039ebf support for ubuntu 14.04 for p8le 2014-07-01 01:55:27 -07:00
junxiaw 01d0036bc6 modify restapi case for node 2014-06-30 19:25:58 -07:00
daniceexi 899428db2c defect 4178,4179: pass the [all] parameter to inventory and vitals resource, this is must have for ppc node; make the return code of rinv and rvitals always to be 0 so that rest api could handle the return message which has both success and failure. 2014-06-30 13:00:28 -04:00
daniceexi 96d9612893 Change the default operator of setroute script to be replace from add. If you want to use add, run it as [setroute add] 2014-06-30 04:21:55 -04:00
Jarrod Johnson 8352acdab2 Modify strategy in case where login succeeds but set priv does not
Previously it would go all the way back.  Instead, go back just one step.
2014-06-27 11:50:06 -04:00
litingt b2365aad67 create repo 2014-06-27 01:28:25 -07:00
litingt f0dc19b045 for commit log file 2014-06-27 00:34:20 -07:00
immarvin 2bcc60220a add ubuntu14.04 build support 2014-06-26 21:14:11 -07:00
litingt 5e50058a81 add commit file judge 2014-06-26 21:05:33 -07:00
litingt d9f82f9805 add commit information for mail 2014-06-26 02:28:35 -07:00
junxiaw 85ff5011bf modify xCATreg 2014-06-25 07:26:34 -07:00
junxiaw 27710159d2 modify xCATreg 2014-06-25 07:00:59 -07:00
lissav c220404af1 defect 4171 2014-06-25 07:10:11 -04:00
huweihua da5ed2be0d add some dir/file to exclude configuration file 2014-06-25 04:47:46 -04:00
ligc 5467f1ed24 fix for bug 4177: rhel7 uses interface names ethp1s2/enp1s2 2014-06-25 14:42:59 -05:00
litingt a5e9a4a2c4 add log location 2014-06-25 00:11:32 -07:00
Lei Ai 9f4ceb8354 merge 2.8 fix for profiled nodes 2014-06-25 08:59:01 +08:00
Bruce Potter 6ec4a80f52 adapter xcat softlayer rpm for 2.8.5 2014-06-24 16:39:05 -04:00
immarvin eb34ca52c0 fix defect#4171 [FVT]:xcatd is not running after rh7 sn is setup 2014-06-24 08:12:43 -07:00
lissav 7c8aec0bd3 fix rinstall/winstall man page 2014-06-24 09:14:30 -04:00
lissav d04edd2119 update rinstall man page 2014-06-24 09:00:59 -04:00
lissav 3a91016c26 add rinstall plugin 2014-06-24 07:53:50 -04:00
lissav d4c7b7051b add rinstall plugin 2014-06-24 07:49:45 -04:00
lissav 6933635111 put rinstall in wrong directory 2014-06-24 07:48:22 -04:00
lissav 357b0b8ba0 Defect 4164, change rinstall to a plugin 2014-06-24 07:44:24 -04:00
lissav a36d004f83 Defect 4164, change rinstall to a plugin 2014-06-24 07:38:55 -04:00
yinle fafd2a3284 modify log file location to /resgression/result/ 2014-06-24 17:11:28 -07:00
litingt 0082f79f34 comment mn install 2014-06-23 23:15:48 -07:00
yinle 0308e295ee Add check of read configuration file 2014-06-24 10:57:47 -07:00
huweihua 157aa15fd3 sysclone: fix some bug in Softlayer environment 2014-06-23 05:06:20 -04:00
huweihua cab2354b99 sysclone: fix some bug in Softlayer environment 2014-06-23 05:01:38 -04:00
junxiaw a16ea6d6e8 modify xcattest installation case 2014-06-22 11:28:06 -07:00
junxiaw 3cbefa06df modify xcattest installation case 2014-06-22 11:27:16 -07:00
junxiaw 44b9e57af6 modify xCATreg 2014-06-22 11:15:19 -07:00
Jarrod Johnson 2af67b457f Correct mistake in the FRU parsing code in the product area 2014-06-20 14:53:16 -04:00
Jarrod Johnson 272c793745 Improve robustness in downgrade of session privilege 2014-06-20 14:43:46 -04:00
yinle 770d1ae776 1. fix some bugs; 2. format of mail content 2014-06-20 19:02:14 -07:00
daniceexi 457003a0c6 configbond: ifdown the bond before ifup it for the case it has been configured 2014-06-20 04:36:28 -04:00
immarvin 51262156b1 add some packages to service node pkglist for rhel7 2014-06-19 20:43:10 -07:00
daniceexi 408189df1f code drop for postscript configbond 2014-06-20 02:59:22 -04:00
daniceexi ea29179f16 fix the issue that cannot handle the case that XX in #INCLUDE:XX# also replacable 2014-06-19 12:52:57 -04:00
yinle 54c7dc77ec 1. adjust code structure;2.add data process; 3. log and send mail 2014-06-19 17:36:52 -07:00
huweihua 9be66d4e28 sysclone add feature: update delta change from golden client to target node 2014-06-19 04:48:08 -04:00
huweihua 0293406d2b sysclone add feature: update delta change from golden client to target node 2014-06-19 04:36:40 -04:00
huweihua 7c79c52e89 sysclone add feature: update delta change from golden client to target node 2014-06-19 04:34:16 -04:00
huweihua 9045bc8c9b add some comment for sysclone 2014-06-19 04:26:09 -04:00
huweihua 686cbd7d44 add some comment for sysclone 2014-06-19 04:24:07 -04:00
junxiaw fdcdfd31d1 modify installation case 2014-06-19 01:27:43 -07:00
root 6774ddc36b Merge branch 'master' of ssh://git.code.sf.net/p/xcat/xcat-core 2014-06-19 01:19:32 -07:00
junxiaw 49c8235318 modify installation case 2014-06-19 01:18:45 -07:00
huweihua 6af8964e0c sysclone add feature: update delta change from golden client to target node 2014-06-19 04:13:26 -04:00
huweihua d185b3791c sysclone add feature: update delta change from golden client to target node 2014-06-19 04:09:53 -04:00
huweihua 02c9efee97 add feature: update delta change from golden client to target node 2014-06-19 03:57:55 -04:00
junxiaw a0f5f21b2c modify installation case 2014-06-19 00:57:09 -07:00
junxiaw 07f5fd7887 modify installation case 2014-06-19 00:48:04 -07:00
immarvin 7c2f1653a9 add *.tmpl and *.pkglist files for rhel7 service node 2014-06-19 00:35:31 -07:00
immarvin b9a2dc6b25 correct a typo 2014-06-18 00:45:00 -07:00
Jia Zhao cad677f29a fix noderegenips generate conflict ips 2014-06-18 13:38:05 +08:00
junxiaw c47c9ac1ca modify installation case 2014-06-17 22:10:16 -07:00
junxiaw 01f459cd1d modify installation case 2014-06-17 22:09:06 -07:00
junxiaw 9f83e565c0 modify installation case 2014-06-17 22:06:36 -07:00
junxiaw 983fab8b05 modify installation case 2014-06-17 22:03:56 -07:00
junxiaw ddbc02cbf5 modify installation case 2014-06-17 20:33:55 -07:00
junxiaw 6d1bb5d3a9 modify installation case 2014-06-17 20:31:47 -07:00
Lei Ai 314937c12c Merge switches format adjust for nodeimport. 2014-06-17 17:15:31 +08:00
Lei Ai ae85fe3e7f Merge branch 'master' of ssh://git.code.sf.net/p/xcat/xcat-core 2014-06-17 17:14:04 +08:00
immarvin d49424b6c8 add discinfo of rhelhpc7.0 2014-06-16 01:58:35 -07:00
immarvin c778b849e9 replace ifconfig with ip 2014-06-14 08:52:44 -07:00
immarvin 43b1ddd1db replace ifconfig with ip 2014-06-13 20:13:49 -07:00
immarvin 8cf5aacd8f replace ifconfig with ip 2014-06-13 19:37:44 -07:00
immarvin 18b11a7b1b replace ifconfig with ip 2014-06-13 09:36:40 -07:00
immarvin 30a9a37a19 Merge branch 'master' of ssh://git.code.sf.net/p/xcat/xcat-core 2014-06-13 09:06:39 -07:00
immarvin 560dd57b15 replace ifconfig with ip,replace service with systemd 2014-06-13 09:06:12 -07:00
immarvin d7eb089a6e replace ifconfig with ip 2014-06-13 10:38:59 -04:00
immarvin 2b3115299f fix defext #4162 Wrong value of kernel argument ifname= - diskless/stateless node failed to boot in RHEL7 environment 2014-06-13 04:34:09 -07:00
lissav 59a277bc40 fix incorrect call 2014-06-13 05:48:53 -04:00
daniceexi 829a613617 minor change for partition file handling 2014-06-13 06:55:37 -04:00
daniceexi 7a1f2f0ec0 use the base64 coding to pass the partition file into kickstart/autoyast pre script 2014-06-13 06:23:36 -04:00
Lei Ai d1b5103807 merge switches support in nodeinfo file from 2.8 branch 2014-06-13 14:34:28 +08:00
junxiaw d4e6fdfe5a modify xcatreg code for autotest ubuntu branch 2014-06-12 01:52:46 -07:00
daniceexi 905b709cd2 make subvars could handle the var in #INCLUDE 2014-06-12 09:05:36 -04:00
zhaoertao 3bf749e8fe fix bug 4069 'rspconfig hmc sshcfg=enable' failed in rhel7.0 environment 2014-06-11 23:16:11 -07:00
Jarrod Johnson 8aaec27237 Try failing over to another syntax for wvid http call 2014-06-11 15:54:04 -04:00
mellor d6a55aa3dd defect 4082 - disable warnings when calling setlogsock 2014-06-11 13:20:42 -04:00
lissav a51870ea58 fix 4161 2014-06-11 08:28:46 -04:00
immarvin 469b6ae3c6 Merge branch 'master' of ssh://git.code.sf.net/p/xcat/xcat-core 2014-06-11 02:54:01 -07:00
immarvin 4987ea5e95 fix 4132 [DEV]sles11.3 provision hang when site.managedaddressmode=static 2014-06-11 02:53:37 -07:00
immarvin 7c98f84c36 replace sysvinit with newly added subroutines in xCAT::Utils 2014-06-11 01:40:35 -07:00
junxiaw 31404156e6 modify xcatreg code for autotest code 2014-06-11 01:24:52 -07:00
zhaoertao 1baf28a360 support rsetboot for p8 2014-06-11 00:21:56 -07:00
daniceexi 10b2198bf3 support replace operation for routeop postscript. So far only supports the persistent route setting for sles. 2014-06-11 07:13:42 -04:00
daniceexi c2b85fe9af Make ping test in SMS could accept timeout value which exported from ENV:TIMEOUT4PINGTEST 2014-06-11 04:37:49 -04:00
mellor a96a4aceb5 defect 4147 fix snmove route add and updatenode calls 2014-06-10 16:47:20 -04:00
Jarrod Johnson f5851bc826 Elaborate upon ipmi.bmcport behavior for a number of IBM system x systems 2014-06-10 14:07:31 -04:00
immarvin f7b9a9a40b replace the service/chkconfig related stuff with newly added subroutine in xCAT::Utils 2014-06-10 08:56:11 -07:00
mellor 51add4de64 defect 4035 fix merge error in previous checkin to handle multiple servicenode entries 2014-06-10 08:55:08 -04:00
immarvin aac1c20125 Merge branch 'master' of ssh://git.code.sf.net/p/xcat/xcat-core 2014-06-10 06:28:27 -07:00
immarvin 5fe158f353 replace service stuff with newly added subrotines in xCAT::Utils 2014-06-10 06:11:07 -07:00
huweihua e252efee1e add rootimgdir attr for sysclone osimage definition 2014-06-10 04:54:56 -04:00
huweihua 97538d1494 add rootimgdir attr for sysclone osimage definition 2014-06-10 04:37:26 -04:00
daniceexi 5e935ac943 restructure the code in Template.pm->subvars to handle recusive #INCLUDE. It also fixed the support of #INCLUDE in osimage.partitionfile 2014-06-10 08:03:22 -04:00
immarvin c40e8e109a replace the service stuff with newly added systemd subroutines 2014-06-09 20:19:51 -07:00
lissav c75e3d0544 fix load error syntax incorrect 2014-06-09 12:06:37 -04:00
lissav 1ae17b155a defect 4157 2014-06-09 11:48:33 -04:00
lissav fd5a4b4561 Merge branch 'master' of ssh://git.code.sf.net/p/xcat/xcat-core 2014-06-09 11:41:47 -04:00
immarvin 539feaca28 add systemctl support for xCAT-sn 2014-06-09 09:01:44 -07:00
lissav 042fd93b09 defect 4157 2014-06-09 11:40:47 -04:00
immarvin fbce828647 correct the message 2014-06-09 06:52:07 -07:00
immarvin 5d479620a4 repleace the servcie stuff with newly added generic subroutines in xcat-client 2014-06-09 06:40:14 -07:00
immarvin 87afa435a3 replace the service stuff with new added generic routines 2014-06-08 08:25:01 -07:00
immarvin c4ffdc484d undo the previous commit and redo the commit 2014-06-08 06:18:08 -07:00
immarvin 2384376d2e add generic subroutine and function of service management 2014-06-08 06:01:15 -07:00
Bruce Potter 0875fc1d24 improved msg for getslnodes when missing dependencies for sl api 2014-06-07 09:17:52 -04:00
lissav 52c35aad8a defect 4154 2014-06-05 09:11:49 -04:00
baiyuan 74fea7a308 imgimport does not support kit related in 2.8.x,warning replace error for defect 4093 2014-06-05 02:06:22 -04:00
huweihua 5302abb4a9 fix bug: in sysclone, provmethod attribute gets cleared 2014-06-04 23:27:09 -04:00
root b51add79a9 xcattest modify for loadcase dir 2014-06-04 16:26:58 -07:00
daniceexi 4f3bf457a6 defect 4153: resolve the merge conflict which introduced by commit 899cb5028d 2014-06-04 08:45:42 -04:00
daniceexi d5e6982054 defect 4152: fix a typo which was introduced when support rh7 that using -N for dracut command 2014-06-04 07:38:21 -04:00
daniceexi ef3f29352f update the doc part in xcatws.cgi for GET action against nodes/networks/osimages/policy to use keyword ALLRESOURCES 2014-06-04 06:18:07 -04:00
Jarrod Johnson 3f3b6eaaa1 Avoid requesting IBM VPD data for FRU locator records that do not advertise such data. 2014-06-03 15:32:24 -04:00
mellor 48a0eedb88 defect 4147 - allow nodeset to continue if prescript errors 2014-06-03 14:20:05 -04:00
mellor c501349c2f defect 4147 again - fix prescripts preprocess_request to only process nodes that have prescripts defined 2014-06-03 11:39:58 -04:00
mellor cd96e91c11 defect 4147 - fix prescripts preprocess_request to only process nodes that have prescripts defined 2014-06-03 11:39:44 -04:00
yinle c4b71ab3d9 1. read configuration file; 2. log and debug; 2014-06-03 07:48:04 -07:00
daniceexi 1925650c96 defect 4151:restapi: add error message if using incorrect authorize keys/passwd 2014-06-03 07:32:30 -04:00
daniceexi b78515b8bc REST API: support keyword ALLRESOURCES for GET nodes,networks,osimage,policy 2014-06-03 05:03:04 -04:00
Jarrod Johnson ce8f3c0599 Support shortname directive for templates that may require it 2014-06-02 16:27:20 -04:00
Jarrod Johnson 93e42585d9 Merge branch 'master' of ssh://git.code.sf.net/p/xcat/xcat-core 2014-06-02 15:12:28 -04:00
mellor 6afbba9bf4 clarify osimage partitionfile description 2014-06-02 15:16:16 -04:00
Jarrod Johnson 97d08bf849 Change RHEL7 to use lvm for / by default 2014-06-02 15:11:53 -04:00
Jarrod Johnson 3d3f69cdbe Fix mistakes in the adjustment to rhel7 default FS cohice 2014-06-02 13:49:14 -04:00
Jarrod Johnson d4f35031c9 Apply previous changes to the pre for rhel7 specifically 2014-06-02 13:39:00 -04:00
Jarrod Johnson cfbd30bf98 Update auto-partitioning for RHEL7
In RHEL7, the preferred filesystem is now xfs and the efi partition
type is unambiguously present.
2014-06-02 13:33:57 -04:00
Bruce Potter 5b0a30a986 Merge branch 'master' of ssh://git.code.sf.net/p/xcat/xcat-core
prep softlayer related files for backporting to 2.8
2014-06-02 09:54:58 -04:00
Bruce Potter 72497eb0b6 prepare softlayer related files for backporting to 2.8 2014-06-02 09:44:02 -04:00
Brian Elliott Finley 6040b0a853 - test_hca_state - handle multi-adapter systems better. Improved
output.  Add filter option.
2014-06-01 21:55:35 -05:00
Jarrod Johnson 69763c4327 Fix problem where firmware was erroneously marked pending 2014-05-30 11:27:37 -04:00
Jarrod Johnson f43352521e Mark pending firmware to be clear that firmware is not yet active 2014-05-30 11:24:38 -04:00
Jarrod Johnson 27d8ca563b Fix BMCPORT specification working with spaces 2014-05-30 11:05:05 -04:00
Jarrod Johnson 6e9d88a842 Fix rpower wake turning off an on system 2014-05-30 10:23:31 -04:00
immarvin 53374908bf fix defect #4146 post.rh.common scipt has ifconfig that does work even on Redhat6 2014-05-30 03:13:13 -07:00
Bruce Potter 2b92556a12 Merge branch 'master' of ssh://git.code.sf.net/p/xcat/xcat-core
fixed bug in xcatws.cgi for handling attrs with = in it
2014-05-29 16:12:52 -04:00
Bruce Potter 6dabd85bfe fixed bug in xcatws.cgi handling attr values with = in it 2014-05-29 16:08:54 -04:00
Bruce Potter 19c8698264 just changed comments 2014-05-29 16:07:57 -04:00
Jarrod Johnson 4176bab034 Merge branch 'master' of ssh://git.code.sf.net/p/xcat/xcat-core 2014-05-29 10:32:55 -04:00
Jarrod Johnson 41e73881de Fix output that occurs on require xCAT::Client when ip is not in path 2014-05-29 10:32:50 -04:00
immarvin 78cd8978e2 backup xcat.conf.apach22 in /etc/xcat/conf.orig/ 2014-05-29 03:45:01 -07:00
immarvin 6374c80de3 correct xCATsn.spec to support apache2/httpd 2.4.x 2014-05-29 02:55:36 -07:00
immarvin 8b094a6df9 fix defect #4145 [DEV] /etc/httpd/conf.d/xcat.conf is missing after xcat upgrade 2014-05-29 01:34:38 -07:00
Jia Zhao 44e3271119 merge code from branch 2.8 2014-05-29 14:30:09 +08:00
daniceexi d26a616680 defect 4144: to allow the recursion call for local named that the dns resolve request from other network is also allowed 2014-05-29 07:29:24 -04:00
Jarrod Johnson 6f9c87f6b2 For non ipmi methods, have confluent use the xcat<meth>.sh module that corresponds 2014-05-28 15:27:31 -04:00
Bruce Potter d5134f8c91 Merge branch 'master' of ssh://git.code.sf.net/p/xcat/xcat-core
got cross-vlan sysclone working in softlayer
2014-05-28 10:21:53 -04:00
Bruce Potter 4d35d617ed got cross-vlan sysclone working in softlayer 2014-05-28 10:21:43 -04:00
lissav ba33248764 defect 4091 RHEL7 support 2014-05-28 10:08:51 -04:00
daniceexi 813fba8c6b defect 4079: to support rh7 that hostname is cfged in /etc/hostname. Check the existence of /etc/hostname, use itif yes, otherwise use /etc/sysconfig/network 2014-05-28 10:30:01 -04:00
immarvin 25b2fee331 correct the build spec and script 2014-05-28 02:27:01 -07:00
litingt 172927ef77 modify minor error 2014-05-28 01:10:05 -07:00
yinle 9e11cce4dd add cases0 2014-05-27 14:49:12 -07:00
yinle 1179350392 add cases0 2014-05-27 14:49:12 -07:00
yinle 2aabbf40e6 add cases0 2014-05-27 14:49:11 -07:00
yinle 8a6c4b642f add cases0 2014-05-27 14:49:11 -07:00
yinle a07ce9e7f0 add cases0 2014-05-27 14:49:11 -07:00
yinle 0cf4be5a5f add cases0 2014-05-27 14:49:11 -07:00
yinle 926221ee07 add cases0 2014-05-27 14:49:11 -07:00
yinle a98946efdd add cases0 2014-05-27 14:49:11 -07:00
Jarrod Johnson 77ba6d499a Add 8.1/2012r2 KMS keys 2014-05-27 11:28:02 -04:00
Jarrod Johnson bf55ee9416 Merge branch 'master' of ssh://git.code.sf.net/p/xcat/xcat-core 2014-05-27 11:27:55 -04:00
yinle eff65a7f3f Fix some bugs 2014-05-27 14:28:55 -07:00
ligc 5399ef9258 fix for bug 4142: add vios as a new device type 2014-05-27 17:00:26 -05:00
daniceexi a582549916 defect 4083: the dash and busybox rpm packages have been removed from rh7 iso and xcat stateless and satelite do not need them any more for rh7, so remove them from the stateless and statelite pkglist 2014-05-27 09:57:52 -04:00
root becd9d1202 xCATreg enhance 2014-05-27 00:19:37 -07:00
daniceexi 8da129f633 xcatws.cgi: fix the output when slpnodes resource has no output; fix the output message for nodestat resource 2014-05-27 07:47:39 -04:00
daniceexi 61ce49e627 defect 4133: continue the fix for the xml escape char conversion when getting mypostscript 2014-05-26 01:18:28 -04:00
Bruce Potter 516ab61cc3 Merge branch 'master' of ssh://git.code.sf.net/p/xcat/xcat-core
softlayer install and sysclone working for strangely ordered nics and cross vlan
2014-05-24 05:46:33 -04:00
Bruce Potter 29457d1177 softlayer install and sysclone working for strangely ordered nics and cross vlan 2014-05-24 05:46:14 -04:00
immarvin e41e21b9b5 correct the getNodeNetworkCfg to get the network gateway 2014-05-23 02:56:39 -07:00
daniceexi eb6d32c244 defect: 4133: fix the code to transfer escape character for the output of getpostscript.awk 2014-05-23 03:03:30 -04:00
lissav 3f691766a6 defect 4138 2014-05-22 09:42:40 -04:00
lissav 49a534cf53 defect 4009 support for DB2 fix most calls but left one todo 2014-05-21 10:13:41 -04:00
lissav c7b7c0abd0 defect 4009 support for DB2 2014-05-21 09:49:11 -04:00
lissav 03a880dbf2 defect 4009 support for DB2 2014-05-21 09:42:39 -04:00
lissav 5eaae003d8 defect 4009 support for DB2 2014-05-21 09:17:28 -04:00
lissav bcda93b1f1 defect 4009 support for DB2 2014-05-21 08:44:46 -04:00
immarvin cd78dd4ed0 fix defect #4128 [fvt]2.8.4:ubuntu 12.04 lsxcat -v could get version info 2014-05-21 01:34:43 -07:00
qyin a966ac3d73 fix the nodeset - noupdate initrd issue 2014-05-21 14:53:05 +08:00
qyin 5de62313a9 fix the nodeset - noupdate initrd issue 2014-05-21 14:39:26 +08:00
daniceexi a40eb3d054 defect 4125:support to have parameters in niccustomscripts attribute 2014-05-21 04:37:35 -04:00
Jarrod Johnson a7484ee4ec Remove test value in previous commit 2014-05-20 15:15:25 -04:00
Jarrod Johnson 802366a48e Add a plugin to push xCAT config to confluent 2014-05-20 15:10:23 -04:00
daniceexi b86a62a148 defect 4134: missing the use of xCAT::SvrUtils in conserver.pm so that when makeconservercf walks into error path to call SverUtils->sendmsg, an code error is displayed 2014-05-20 10:14:22 -04:00
yinle 725fb69a51 add send mail 2014-05-20 06:28:20 -07:00
daniceexi 427e91463e defect 4133: transfer the xml specific character which starts with & to general format 2014-05-20 07:59:01 -04:00
daniceexi 1206a25baf rh stateless support. remove the tmp and root dir mount requirement in fstab. They can be handled correctly by dracut and dracut cfg file 2014-05-19 10:22:48 -04:00
daniceexi 10a1b7502d rh7 statelite support. remove the root dir from fstab to avoiding the remount which overwrite the root dir to rw 2014-05-19 10:20:00 -04:00
daniceexi 8fee9e9ae8 rh7 statelite support. create /etc/sysconfig/network-scripts/ifcfg-ethx for statelite node 2014-05-19 10:17:51 -04:00
ligc 687b9b1dd5 fix for bug 4130: mkdef/chdef handle the nics* attributes for node group 2014-05-19 10:59:16 -05:00
Jarrod Johnson 6041b8cc78 Further changes for ADK 8.1 2014-05-16 15:16:08 -04:00
Jarrod Johnson 8af6186305 Update for 8.1 version of ADK 2014-05-16 15:13:41 -04:00
Jarrod Johnson 2e40553fb7 Merge branch 'master' of ssh://git.code.sf.net/p/xcat/xcat-core 2014-05-15 10:24:24 -04:00
Jarrod Johnson 471d947171 Implement bittorrent support for RHEL stateless/statelite with ramfs 2014-05-15 10:23:48 -04:00
Bruce Potter f4b1cce7cc Merge branch 'master' of ssh://git.code.sf.net/p/xcat/xcat-core
softlayer scripted install and sysclone both working with bonding
2014-05-15 10:07:51 -04:00
Bruce Potter 071d78f5f5 softlayer scripted install and sysclone both working with bonding 2014-05-15 10:07:12 -04:00
Bruce Potter 4bfe14d67f softlayer scripted install and sysclone both working with bonding 2014-05-15 10:05:48 -04:00
baiyuan 4940f8ab80 support compiler xlf15 and xlc13 on aix 2014-05-15 04:13:14 -04:00
zhaoertao 86ce2a4ccb fix bugs about petitboot configure file, ubuntu sshd issue 2014-05-15 00:43:52 -07:00
yinle 956f45d7b3 minor fix 2014-05-15 06:48:24 -07:00
yinle 23bd81f4a6 minor fix 2014-05-15 06:39:26 -07:00
yinle aea0692520 Modify match info 2014-05-15 06:21:46 -07:00
daniceexi ff172d1ef1 rh7 diskless support that don't cfg tmp in fstab 2014-05-15 06:56:19 -04:00
daniceexi 3df16cd4e3 for rh7, the initrd for stateless has to been built first to make the installkernel cfg file added first 2014-05-15 03:54:58 -04:00
mellor 0c668d1cf0 Merge branch 'master' of ssh://git.code.sf.net/p/xcat/xcat-core 2014-05-14 11:00:57 -04:00
lissav 269ef4d950 defect 4091 2014-05-14 08:01:41 -04:00
daniceexi 231dbd84f5 use ip command to replace ifconfig in xcatroot for diskless on rh3 2014-05-14 08:03:35 -04:00
lissav e4befe9959 defect 4091 2014-05-13 09:06:51 -04:00
yinle 51b81d2116 Modify flag and help information 2014-05-13 05:37:14 -07:00
lissav 0e21fa3931 backup 4091, not correct 2014-05-12 13:25:44 -04:00
lissav d8431f4fd3 defect 4124 2014-05-12 12:48:04 -04:00
lissav 1700471ada defect 4076 2014-05-12 10:46:39 -04:00
lissav 8071c719c6 defect 4076 2014-05-12 10:43:52 -04:00
Bruce Potter 273e6f226b Merge branch 'master' of ssh://git.code.sf.net/p/xcat/xcat-core
modified softlayer sysclone for bonded nics
2014-05-12 08:08:57 -04:00
Bruce Potter 988ffd5ba9 modified softlayer sysclone for bonded nics 2014-05-12 08:08:31 -04:00
immarvin 8927265eba change the uploader to ligc 2014-05-12 02:06:08 -07:00
immarvin 67daf3f0b0 fix defect #4123 [fvt]2.8.4:ubuntu 12.04 diskfull install failed 2014-05-12 01:57:52 -07:00
lissav 7a3e2e2461 defect 4091 remove ifconfig calls 2014-05-09 10:19:52 -04:00
immarvin 80ddcd845b correct the dns configuration during node provision when unicast dhcp is enabled 2014-05-09 02:05:16 -07:00
lissav 7293046915 defect 4091 2014-05-08 09:49:39 -04:00
lissav eebfcc912b REDHAT7 support defect 4091 2014-05-08 09:29:46 -04:00
immarvin d915fcf4b7 add replace token in kickstart template file for rhels6.x86_64 and rhel7 to support unicast dhcp 2014-05-08 03:45:39 -07:00
immarvin bf306b5fc1 fix the problem that redhat provisioning on X will enter infinite installation loop when unicats dhcp is enabled 2014-05-08 03:35:37 -07:00
daniceexi cee55105de add dracut support scripts for dracut-033. Most of them are copied from dracut 2014-05-08 10:14:54 -04:00
daniceexi 40d4c75b29 code change for rh7 stateless support 2014-05-08 10:14:54 -04:00
yinle 49dd61bcac Add some debug info for the script 2014-05-08 08:04:04 -07:00
yinle e590737654 Add cmdcheck for xcattest 2014-05-08 06:07:12 -07:00
immarvin cde9aed074 fix defect 4117 and 4113 2014-05-08 00:38:30 -07:00
yinle bbd6972315 Add a new file restapitest 2014-05-08 05:17:17 -07:00
yinle 8af243775a Add test script restapitest to xcat-test 2014-05-08 02:48:21 -07:00
Jarrod Johnson 1f48dcea9c Recognize Win2012R2 media 2014-05-07 14:17:00 -04:00
lissav 3ad0eb8f16 defect 4091 remove linux ifconfig calls 2014-05-07 11:07:15 -04:00
mellor ec0a921395 Merge branch 'master' of ssh://git.code.sf.net/p/xcat/xcat-core 2014-05-06 14:10:57 -04:00
lissav 3e1ff658fa defect 4091 2014-05-06 08:01:47 -04:00
lissav 595bc352fd defect 4091 2014-05-05 13:36:41 -04:00
lissav 5a770129e3 defect 4112 2014-05-05 11:55:05 -04:00
mellor 1bed59f010 defect 4035 handle multiple servicenode entries 2014-04-30 17:51:27 -04:00
626 changed files with 38875 additions and 6993 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
+84 -30
View File
@@ -27,6 +27,7 @@
# 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
# LOG=<filename> - provide an LOG file option to redirect some output into log file
#
# For the dependency packages 1. please run the build-debs-all in xcat-dep svn first( there is usage detail in that script)
# 2. run ./build-ubunturepo -d
@@ -53,7 +54,7 @@ for i in $*; do
done
# Supported distributions
dists="maverick natty oneiric precise saucy"
dists="saucy trusty utopic"
c_flag= # xcat-core (trunk-delvel) path
d_flag= # xcat-dep (trunk) path
@@ -86,7 +87,7 @@ if [ "$c_flag" -a "$d_flag" ];then
exit 2
fi
uploader="bp-sawyers"
uploader="ligc"
# Find where this script is located to set some build variables
old_pwd=`pwd`
cd `dirname $0`
@@ -94,8 +95,7 @@ curdir=`pwd`
#define the dep source code path, core build target path and dep build target path
local_core_repo_path="$curdir/../../xcat-core"
xcat_dep_path="$curdir/../../../xcat-dep/src/xcat-dep"
local_dep_repo_path="$curdir/../../../xcat-dep/xcat-dep"
local_dep_repo_path="$curdir/../../xcat-dep/xcat-dep"
#define the url used for creating the source list file
#define the upload dir used for uploading packages
@@ -112,13 +112,18 @@ fi
export HOME=/root
WGET_CMD="wget"
if [ ! -z ${LOG} ]; then
WGET_CMD="wget -o ${LOG}"
fi
#sync the gpg key to the build machine local
gsa_url=http://pokgsa.ibm.com/projects/x/xcat/build/linux
mkdir -p $HOME/.gnupg
for key_name in pubring.gpg secring.gpg trustdb.gpg; do
if [ ! -f $HOME/.gnupg/$key_name ] || [ `wc -c $HOME/.gnupg/$key_name|cut -f 1 -d' '` == 0 ]; then
rm -f $HOME/.gnupg/$key_name
wget -P $HOME/.gnupg $gsa_url/keys/$key_name
${WGET_CMD} -P $HOME/.gnupg $gsa_url/keys/$key_name
chmod 600 $HOME/.gnupg/$key_name
fi
done
@@ -194,27 +199,40 @@ 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"
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
file_low=`echo $file | tr '[A-Z]' '[a-z]'`
if grep -q $file $update_log || [ "$BUILDALL" == 1 -o "$file" = "perl-xCAT" ]; then
rm -f ../../$package_dir_name/${file_low}_*.deb
#only for genesis package
rm -f ../../$package_dir_name/${file_low}-amd64_*.deb
cd $file
dch -v $pkg_version -b -c debian/changelog $build_string
dpkg-buildpackage -uc -us
rc=$?
if [ $rc -gt 0 ]; then
echo "Error: $file build package failed exit code $rc"
fi
cd -
find $file -maxdepth 3 -type d -name "${file_low}*" | grep debian | xargs rm -rf
find $file -maxdepth 3 -type f -name "files" | grep debian | xargs rm -rf
mv ${file_low}* ../../$package_dir_name/
if [ "$file" = "xCAT" -o "$file" = "xCAT-genesis-scripts" ]; then
target_archs="amd64 ppc64el"
else
target_archs="all"
fi
for target_arch in `echo $target_archs`
do
if grep -q $file $update_log || [ "$BUILDALL" == 1 -o "$file" = "perl-xCAT" ]; then
rm -f ../../$package_dir_name/${file_low}_*.$target_arch.deb
#genesis scripts package, don't remove genesis amd64 files
#rm -f ../../$package_dir_name/${file_low}-amd64_*.deb
cd $file
dch -v $pkg_version -b -c debian/changelog $build_string
if [ "$target_arch" = "all" ]; then
dpkg-buildpackage -uc -us
else
dpkg-buildpackage -uc -us -a$target_arch
fi
rc=$?
if [ $rc -gt 0 ]; then
echo "Error: $file build package failed exit code $rc"
exit $rc
fi
cd -
find $file -maxdepth 3 -type d -name "${file_low}*" | grep debian | xargs rm -rf
find $file -maxdepth 3 -type f -name "files" | grep debian | xargs rm -rf
mv ${file_low}* ../../$package_dir_name/
fi
done
done
find ../../$package_dir_name/* ! -name *.deb | xargs rm -f
@@ -250,11 +268,16 @@ then
mkdir conf
for dist in $dists; do
if [ "$dist" = "trusty" ] || [ "$dist" = "utopic" ]; then
tmp_out_arch="amd64 ppc64el"
else
tmp_out_arch="amd64"
fi
cat << __EOF__ >> conf/distributions
Origin: xCAT internal repository
Label: xcat-core bazaar repository
Codename: $dist
Architectures: amd64
Architectures: $tmp_out_arch
Components: main
Description: Repository automatically genereted conf
SignWith: yes
@@ -269,17 +292,29 @@ basedir .
__EOF__
#import the deb packages into the repo
amd_files=`ls ../$package_dir_name/*.deb | grep -v "ppc64el"`
all_files=`ls ../$package_dir_name/*.deb`
for dist in $dists; do
for file in `ls ../$package_dir_name/*.deb`; do
if [ "$dist" = "trusty" ] || [ "$dist" = "utopic" ]; then
deb_files=$all_files
else
deb_files=$amd_files
fi
for file in $deb_files; do
reprepro -b ./ includedeb $dist $file;
done
done
#create the mklocalrepo script
cat << '__EOF__' > mklocalrepo.sh
. /etc/lsb-release
cd `dirname $0`
echo deb file://"`pwd`" $DISTRIB_CODENAME main > /etc/apt/sources.list.d/xcat-core.list
host_arch=`uname -m`
if [ "$host_arch" != "ppc64le" ];then
host_arch="amd64"
else
host_arch="ppc64el"
fi
echo deb [arch=$host_arch] file://"`pwd`" $DISTRIB_CODENAME main > /etc/apt/sources.list.d/xcat-core.list
__EOF__
chmod 775 mklocalrepo.sh
@@ -353,11 +388,16 @@ then
#create the conf/distributions file
for dist in $dists; do
if [ "$dist" = "trusty" ] || [ "$dist" = "utopic" ]; then
tmp_out_arch="amd64 ppc64el"
else
tmp_out_arch="amd64"
fi
cat << __EOF__ >> conf/distributions
Origin: xCAT internal repository
Label: xcat-dep bazaar repository
Codename: $dist
Architectures: amd64
Architectures: $tmp_out_arch
Components: main
Description: Repository automatically genereted conf
SignWith: yes
@@ -371,8 +411,16 @@ ask-passphrase
basedir .
__EOF__
#import the deb packages into the repo
amd_files=`ls ../debs/*.deb | grep -v "ppc64el"`
all_files=`ls ../debs/*.deb`
for dist in $dists; do
for file in `ls ../debs/*.deb`; do
if [ "$dist" = "trusty" ] || [ "$dist" = "utopic" ]; then
deb_files=$all_files
else
deb_files=$amd_files
fi
for file in $deb_files; do
reprepro -b ./ includedeb $dist $file;
done
done
@@ -380,7 +428,13 @@ __EOF__
cat << '__EOF__' > mklocalrepo.sh
. /etc/lsb-release
cd `dirname $0`
echo deb file://"`pwd`" $DISTRIB_CODENAME main > /etc/apt/sources.list.d/xcat-dep.list
host_arch=`uname -m`
if [ "$host_arch" != "ppc64le" ];then
host_arch="amd64"
else
host_arch="ppc64el"
fi
echo deb [arch=$host_arch] file://"`pwd`" $DISTRIB_CODENAME main > /etc/apt/sources.list.d/xcat-dep.list
__EOF__
chmod 775 mklocalrepo.sh
@@ -396,7 +450,7 @@ __EOF__
chmod -R g+w xcat-dep
#create the tar ball
dep_tar_name=xcat-dep-ubuntu.tar.bz
dep_tar_name=xcat-dep-ubuntu-snap`date +%Y%m%d`.tar.bz
tar -hjcf $dep_tar_name xcat-dep
chgrp root $dep_tar_name
chmod g+w $dep_tar_name
+68 -46
View File
@@ -12,42 +12,45 @@
# 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
# LOG=<filename> - provide an LOG file option to redirect some output into log file
# you can change this if you need to
UPLOADUSER=bp-sawyers
UPLOADUSER=litingt
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 xCAT-vlan xCAT-confluent"
ZVMBUILD="perl-xCAT xCAT-server xCAT-UI"
ZVMLINK="xCAT-client xCAT xCATsn"
# xCAT has PCM specific configuration - conserver-xcat, syslinux-xcat
# xCAT and xCATsn have PCM specific configuration - conserver-xcat, syslinux-xcat
# xCAT-server has PCM specific configuration - RESTAPI(perl-JSON)
PCMBUILD="xCAT xCAT-server"
PCMLINK="perl-xCAT xCAT-client xCAT-buildkit xCAT-genesis-scripts-x86_64"
# xCAT-client has PCM specific configuration - getxcatdocs(perl-JSON)
PCMBUILD="xCAT xCAT-server xCAT-client xCATsn"
PCMLINK="perl-xCAT xCAT-buildkit xCAT-genesis-scripts-x86_64 xCAT-genesis-scripts-ppc64 xCAT-vlan"
# Note: for FSM, the FlexCAT rpm is built separately from gsa/git
FSMBUILD="perl-xCAT xCAT-client xCAT-server"
FSMLINK=""
@@ -83,21 +86,19 @@ if [ "$OSNAME" != "AIX" ]; then
echo "Can't get lock /var/lock/xcatbld-$REL.lock. Someone else must be doing a build right now. Exiting...."
exit 1
fi
export HOME=/root # This is so rpm and gpg will know home, even in sudo
# This is so rpm and gpg will know home, even in sudo
export HOME=/root
fi
# for the git case, query the current branch and set REL (changing master to devel if necessary)
function setbranch {
#git checkout $BRANCH
#REL=`git rev-parse --abbrev-ref HEAD`
REL=`git name-rev --name-only HEAD`
if [ "$REL" = "master" ]; then
REL="devel"
fi
}
if [ "$REL" = "xcat-core" ]; then # using git
if [ "$REL" = "xcat-core" ]; then # using git
GIT=1
setbranch # this changes the REL variable
fi
@@ -129,7 +130,7 @@ fi
XCATCORE="xcat-core" # core-snap is a sym link to xcat-core
if [ "$GIT" = "1" ]; then # using git - need to include REL in the path where we put the built rpms
if [ "$GIT" = "1" ]; then # using git - need to include REL in the path where we put the built rpms
DESTDIR=../../$REL$EMBEDDIR/$XCATCORE
else
DESTDIR=../..$EMBEDDIR/$XCATCORE
@@ -182,7 +183,8 @@ fi
# If they have not given us a premade update file, do an svn update or git pull and capture the results
SOMETHINGCHANGED=0
if [ "$GIT" = "1" ]; then # using git
if [ "$GIT" = "1" ]; then
# using git
if [ -z "$GITUP" ]; then
GITUP=../coregitup
echo "git pull > $GITUP"
@@ -196,7 +198,8 @@ if [ "$GIT" = "1" ]; then # using git
if ! $GREP 'Already up-to-date' $GITUP; then
SOMETHINGCHANGED=1
fi
else # using svn
else
# using svn
GIT=0
if [ -z "$SVNUP" ]; then
SVNUP=../coresvnup
@@ -239,17 +242,19 @@ 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
#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
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 [[ " $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
fi
if [ "$OSNAME" = "AIX" ]; then
if [ "$rpmname" = "xCAT-client" -o "$rpmname" = "xCAT-server" ]; then # we do not automatically install the rest of the rpms on AIX
if [ "$rpmname" = "xCAT-client" -o "$rpmname" = "xCAT-server" ]; then
# we do not automatically install the rest of the rpms on AIX
echo "rpm -Uvh $rpmname-$SHORTSHORTVER*rpm" >> $DESTDIR/instxcat
fi
fi
@@ -264,6 +269,8 @@ if [ "$OSNAME" != "AIX" ]; then
ORIGFAILEDRPMS="$FAILEDRPMS"
./makerpm xCAT-genesis-scripts x86_64 "$EMBED"
if [ $? -ne 0 ]; then FAILEDRPMS="$FAILEDRPMS xCAT-genesis-scripts-x86_64"; fi
./makerpm xCAT-genesis-scripts ppc64 "$EMBED"
if [ $? -ne 0 ]; then FAILEDRPMS="$FAILEDRPMS xCAT-genesis-scripts-ppc64"; fi
if [ "$FAILEDRPMS" = "$ORIGFAILEDRPMS" ]; then # all succeeded
rm -f $DESTDIR/xCAT-genesis-scripts*rpm
rm -f $SRCDIR/xCAT-genesis-scripts*rpm
@@ -275,8 +282,7 @@ 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
#if [ "$EMBED" = "zvm" ]; then break; fi
for rpmname in xCAT xCATsn; do
if [[ " $EMBEDBUILD " != *\ $rpmname\ * ]]; then continue; fi
if [ $SOMETHINGCHANGED == 1 -o "$BUILDALL" == 1 ]; then # used to be: if $GREP -E "^[UAD] +$rpmname/" $GITUP; then
UPLOAD=1
@@ -286,7 +292,7 @@ for rpmname in xCAT xCATsn xCAT-OpenStack xCAT-OpenStack-baremetal; do
./makerpm $rpmname "$EMBED"
if [ $? -ne 0 ]; then FAILEDRPMS="$FAILEDRPMS $rpmname"; fi
else
for arch in x86_64 ppc64 s390x; do
for arch in x86_64 ppc64 ppc64le s390x; do
if [ "$rpmname" = "xCAT-OpenStack" -a "$arch" != "x86_64" ] || [ "$rpmname" = "xCAT-OpenStack-baremetal" -a "$arch" != "x86_64" ] ; then continue; fi # only bld openstack for x86_64 for now
./makerpm $rpmname $arch "$EMBED"
if [ $? -ne 0 ]; then FAILEDRPMS="$FAILEDRPMS $rpmname-$arch"; fi
@@ -338,6 +344,10 @@ fi
#else we will continue
# Prepare the RPMs for pkging and upload
WGET_CMD="wget"
if [ ! -z ${LOG} ]; then
WGET_CMD="wget -o ${LOG}"
fi
# get gpg keys in place
if [ "$OSNAME" != "AIX" ]; then
@@ -345,7 +355,7 @@ if [ "$OSNAME" != "AIX" ]; then
for i in pubring.gpg secring.gpg trustdb.gpg; do
if [ ! -f $HOME/.gnupg/$i ] || [ `wc -c $HOME/.gnupg/$i|cut -f 1 -d' '` == 0 ]; then
rm -f $HOME/.gnupg/$i
wget -P $HOME/.gnupg $GSA/keys/$i
${WGET_CMD} -P $HOME/.gnupg $GSA/keys/$i
chmod 600 $HOME/.gnupg/$i
fi
done
@@ -355,7 +365,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)'
@@ -367,10 +377,10 @@ if [ "$OSNAME" != "AIX" ]; then
gpg -a --detach-sign $DESTDIR/repodata/repomd.xml
gpg -a --detach-sign $SRCDIR/repodata/repomd.xml
if [ ! -f $DESTDIR/repodata/repomd.xml.key ]; then
wget -P $DESTDIR/repodata $GSA/keys/repomd.xml.key
${WGET_CMD} -q -P $DESTDIR/repodata $GSA/keys/repomd.xml.key
fi
if [ ! -f $SRCDIR/repodata/repomd.xml.key ]; then
wget -P $SRCDIR/repodata $GSA/keys/repomd.xml.key
${WGET_CMD} -P $SRCDIR/repodata $GSA/keys/repomd.xml.key
fi
fi
@@ -418,7 +428,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
@@ -498,8 +519,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
+2 -2
View File
@@ -19,7 +19,7 @@
# VERBOSE=1 - to see lots of verbose output
# you can change this if you need to
UPLOADUSER=bp-sawyers
UPLOADUSER=litingt
FRS=/home/frs/project/x/xc/xcat
OSNAME=$(uname)
@@ -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.
+7 -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,15 +102,17 @@ 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
fi
@@ -139,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]
@@ -150,6 +152,7 @@ gpgcheck=0
EOF
cp $CURDIR/build/xCAT-core.repo /etc/yum.repos.d/
createrepo $CURDIR/build
else
rm -f /etc/zypp/repos.d/xCAT-core.repo
zypper ar file://$CURDIR/build xCAT-core
+32 -2
View File
@@ -23,6 +23,18 @@ function makenoarch {
RC=$?
else # linux
echo "Building $RPMROOT/RPMS/noarch/$RPMNAME-$VER-snap*.noarch.rpm $EMBEDTXT..."
# TODO: should fix this up, this is a hack for the new build machine
if [ $RPMNAME = "xCAT-UI" ]; then
# Only if the old compiler.jar file does not exist.....
if [ ! -e /xcat2/build/tools/compiler.jar ]; then
# look for the dynamic location of the compiler.jar file
DIRNAME=`dirname $(readlink -f $0)`
COMPILER_JAR=`echo "${DIRNAME%%linux_rpm/*}tools/compiler.jar"`
if [ -f $COMPILER_JAR ]; then
sed -i "s#/xcat2/build/tools/compiler.jar#${COMPILER_JAR}#g" xCAT-UI/xCAT-UI.spec
fi
fi
fi
tar --exclude .svn -czf $RPMROOT/SOURCES/$RPMNAME-$VER.tar.gz $RPMNAME
rm -f $RPMROOT/SRPMS/$RPMNAME-$VER*rpm $RPMROOT/RPMS/noarch/$RPMNAME-$VER*rpm
rpmbuild $QUIET -ta $RPMROOT/SOURCES/$RPMNAME-$VER.tar.gz
@@ -85,6 +97,7 @@ function makexcat {
cd `dirname $0`/$RPMNAME
tar --exclude .svn -czf $RPMROOT/SOURCES/license.tar.gz LICENSE.html
cp xcat.conf $RPMROOT/SOURCES
cp xcat.conf.apach24 $RPMROOT/SOURCES
cp xCATSN $RPMROOT/SOURCES
cd - >/dev/null
elif [ "$RPMNAME" = "xCAT-buildkit" ]; then
@@ -105,7 +118,23 @@ function makexcat {
fi
}
# make ironic rpm for ironic baremetal driver
function makeironic {
RPMNAME="$1"
ARCH="$2"
cd `dirname $0`/$RPMNAME
cp -rf ironic_baremetal /tmp/
cd /tmp/ironic_baremetal
git init
git add *
git commit -a -m "generate rpm"
python setup.py bdist_rpm
rm -rf $RPMROOT/RPMS/$ARCH/
mkdir -p $RPMROOT/RPMS/$ARCH/
cp -rf dist/*.rpm $RPMROOT/RPMS/$ARCH/
rm -rf /tmp/ironic_baremetal
}
# Make the xCAT-nbroot-core rpm
function makenbroot {
@@ -205,7 +234,6 @@ else # linux
fi
fi
if [ "$1" = "xCAT" -o "$1" = "xCATsn" -o "$1" = "xCAT-buildkit" -o "$1" = "xCAT-OpenStack" ]; then
exportEmbed $3
makexcat $1 $2
@@ -218,6 +246,8 @@ elif [ "$1" = "xCAT-genesis-builder" ]; then
elif [ "$1" = "xCAT-genesis-scripts" ]; then
exportEmbed $3
makegenesisscripts $1 $2
elif [ "$1" = "xCAT-OpenStack-ironic" ]; then
makeironic $1 $2
else # must be one of the noarch rpms
exportEmbed $2
makenoarch $1
+1 -1
View File
@@ -266,7 +266,7 @@ See http://www.perl.com/doc/manual/html/pod/perlre.html for information on perl
As of xCAT 2.8.1, you can use a modified version of the regular expression support described in the previous section. You do not need to enter the node information (1st part of the expression), it will be derived from the input nodename. You only need to supply the 2nd part of the expression to determine the value to give the attribute. For examples, see
https://sourceforge.net/apps/mediawiki/xcat/index.php?title=Listing_and_Modifying_the_Database#Easy_Regular_expressions
https://sourceforge.net/p/xcat/wiki/Listing_and_Modifying_the_Database/#easy-regular-expressions
=head1 OBJECT DEFINITIONS
+1 -1
View File
@@ -48,7 +48,7 @@ binary-arch: build install
chmod 644 `pwd`/debian/perl-xcat/opt/xcat/share/doc/man5/*
chmod 644 `pwd`/debian/perl-xcat/opt/xcat/share/man/man7/*
chmod 644 `pwd`/debian/perl-xcat/opt/xcat/share/doc/man7/*
./modifyUtils `cat ../Version` `svn info | grep Revision | cut -d" " -f 2`
./modifyUtils `cat ../Version` `git log -n 1 | head -n 1 | cut -f 2 -d ' '`
# dh_installmenu
# dh_installdebconf
# dh_installlogrotate
+125 -2
View File
@@ -500,6 +500,7 @@ sub setCFMPkglistFile {
Arguments:
$imagename - the specified linuximage name
@curospkgs - the currently selected OS packages list
$mode - using Fuzzy Matching or Exact Matching to check packages
Returns:
0 - update successfully
1 - update failed
@@ -509,13 +510,22 @@ sub setCFMPkglistFile {
none
Example:
my $ret = CAT::CFMUtils->updateCFMPkglistFile($imagename, @cur_selected_pkgs);
my $ret = CAT::CFMUtils->updateCFMPkglistFile($imagename, @cur_selected_pkgs, 1);
=cut
#-----------------------------------------------------------------------------
sub updateCFMPkglistFile {
my ($class, $img, $ospkgs) = @_;
my ($class, $img, $ospkgs, $mode) = @_;
if(defined($mode)){
# Exact Matching
$mode = 1;
}else {
# Fuzzy Matching
$mode = 0;
}
my @cur_selected = @$ospkgs;
my $cfmpkglist = "/install/osimages/$img/pkglist.cfm";
@@ -549,6 +559,14 @@ sub updateCFMPkglistFile {
my @selected = @$selected_ref;
@basepkgs = xCAT::CFMUtils->arrayops("U", \@basepkgs, \@selected);
}
# Fuzzy Matching
if (not $mode){
my ($ref1, $ref2, $ref3) = xCAT::CFMUtils->updateSelectedPkgs(\@pre_selected, \@pre_removed, \@cur_selected);
@pre_selected = @$ref1;
@pre_removed = @$ref2;
@cur_selected = @$ref3;
}
# get diff between previous and current selected OS packages lists
my @diff = xCAT::CFMUtils->getPkgsDiff(\@pre_selected, \@cur_selected);
@@ -661,6 +679,48 @@ sub getPreOSpkgsList {
return (\@selected, \@removed);
}
#-----------------------------------------------------------------------------
=head3 getPreBaseOSpkgsList
Get previously selected and removed base OS packages lists from pkglist file. Packages named with "example.xxx" should be the base name "example"
Arguments:
$ospkglist - the path for ospkglist file
Returns:
refs for selected and removed OS packages arrays
Globals:
none
Error:
none
Example:
my $pre_selected_ref = xCAT::CFMUtils->getPreOSpkgsList($ospkglist);
=cut
#-----------------------------------------------------------------------------
sub getPreBaseOSpkgsList {
my ($class, $pkglist) = @_;
my ($pre_selected_ref, $pre_removed_ref) = xCAT::CFMUtils->getPreOSpkgsList($pkglist);
my %pre_selected_hash = ();
foreach (@$pre_selected_ref) {
my @names = split(/\./, $_);
my $basename = $names[0];
if ($_ =~ /^$basename\.([^\.]+)$/) {
$pre_selected_hash{$basename} = 1;
}else {
$pre_selected_hash{$_} = 1;
}
}
my @pre_selected = keys %pre_selected_hash;
return \@pre_selected;
}
#-----------------------------------------------------------------------------
=head3 getPkgsDiff
@@ -819,3 +879,66 @@ sub arrayops {
#return (\@union, \@intersection, \@difference);
}
#-----------------------------------------------------------------------------
=head3 updateSelectedPkgs
Update previous selected, previous removed and current selected packages based on fuzzy matching rules. Packages named with "example.i686" should be same with package "example"
Arguments:
\@pre_selected - reference to previous selected packages
\@pre_removed - reference to previous removed packages
\@cur_selected - reference to current selected packages
Returns:
new previous selected, previous removed, current selected packages
Globals:
none
Error:
none
Example:
my ($ref1, $ref2, $ref3) = xCAT::CFMUtils->arrayops(\@pre_selected, \@pre_removed, \@cur_selected);
=cut
#-----------------------------------------------------------------------------
sub updateSelectedPkgs() {
my ($class, $pre_selected_ref, $pre_removed_ref, $cur_selected_ref) = @_;
my %pre_selected_hash = map{$_ => 1} @$pre_selected_ref;
my %pre_removed_hash = map{$_ => 1} @$pre_removed_ref;
my %cur_selected_hash = map{$_ => 1} @$cur_selected_ref;
my %new_pre_selected_hash = %pre_selected_hash;
my %new_pre_removed_hash = %pre_removed_hash;
my %new_cur_selected_hash = %cur_selected_hash;
foreach (keys %cur_selected_hash) {
my $father = $_;
my $flag = 0;
foreach (keys %pre_selected_hash) {
my $child = $_;
if ($child =~ /^$father\.([^\.]+)$/) {
$new_cur_selected_hash{$child} = 1;
$flag = 1;
}
}
if ($flag and not exists $pre_selected_hash{$father}){
delete $new_cur_selected_hash{$father} if exists $new_cur_selected_hash{$father};
}
foreach (keys %pre_removed_hash) {
my $child = $_;
if ($child =~ /^$father\.([^\.]+)$/) {
delete $new_pre_removed_hash{$child} if exists $new_pre_removed_hash{$child};
}
}
}
my @new_cur_selected = keys %new_cur_selected_hash;
my @new_pre_selected = keys %new_pre_selected_hash;
my @new_pre_removed = keys %new_pre_removed_hash;
return (\@new_pre_selected, \@new_pre_removed, \@new_cur_selected);
}
+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;
+6 -1
View File
@@ -29,7 +29,7 @@ if ($inet6support) {
if ($^O =~ /^linux/i) {
# Is IPv6 enabled on the MN or xcat client node at all?
my $ipv6enabled = `ip addr | grep inet6`;
my $ipv6enabled = `ip addr 2> /dev/null | grep inet6`;
if (!$ipv6enabled) {
$inet6support = 0;
}
@@ -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,
+16 -4
View File
@@ -1020,6 +1020,7 @@ sub fork_fanout_dsh
}
}
# save the original exports, we are going to add the unique node name below
my $firstpass=0;
while (@$targets_waiting
&& (keys(%$targets_active) < $$options{'fanout'}))
{
@@ -1046,6 +1047,7 @@ sub fork_fanout_dsh
}
if ($$options{'environment'})
{
if ($firstpass ==0) { # do the servicenode stuff only once
# if we are on a servicenode need to get the environment file
# from the SNsyncfiledir, not local
if (xCAT::Utils->isServiceNode()) {
@@ -1068,8 +1070,10 @@ sub fork_fanout_dsh
$rsp->{error}->[0] = "File $$options{'environment'} does not exist";
xCAT::MsgUtils->message("E", $rsp, $::CALLBACK);
}
# build the xdsh command
push @dsh_command,
$firstpass=1;
}
# build the xdsh command
push @dsh_command,
"$exportnode$$options{'pre-command'} . $$options{'environment'} ; $$options{'command'}$$options{'post-command'}";
}
@@ -4032,7 +4036,7 @@ sub parse_and_run_dsh
{ # from sinv, discard this name
undef @$nodes;
}
if (@$nodes)
if (@$nodes[0])
{
my $rsp = {};
$rsp->{error}->[0] =
@@ -4403,6 +4407,14 @@ sub parse_and_run_dcp
xCAT::MsgUtils->message("E", $rsp, $::CALLBACK, 1);
return;
}
if (@$nodes[0])
{
my $rsp = {};
$rsp->{error}->[0] =
"Input noderange:@$nodes and any other xdsh flags or environment variables are not valid with -i flag.";
xCAT::MsgUtils->message("E", $rsp, $::CALLBACK, 1);
return;
}
}
if ((!(defined($nodes))) && (!(defined($options{'rootimg'}))))
{ # no nodes and not -i option, error
@@ -4501,7 +4513,7 @@ sub parse_and_run_dcp
#
# build list of nodes
my @nodelist;
if (@$nodes)
if (@$nodes[0])
{ # there are nodes
@nodelist = @$nodes;
$options{'nodes'} = join(',', @nodelist);
+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();
+8 -6
View File
@@ -517,12 +517,14 @@ sub getmacs {
$data.= "\n$_\n";
push @$value, "\n$_\n";
} elsif ( /^ent\s+/ || /^hfi-ent\s+/ ) {
my @fields = split /\s+/, $_;
my $mac = $fields[2];
$mac = format_mac( $mac );
$fields[2] = $mac;
$data .= join(" ",@fields)."\n";
push @$value, join(" ",@fields)."\n";
#my @fields = split /\s+/, $_;
#my $mac = $fields[2];
#$mac = format_mac( $mac );
#$fields[2] = $mac;
#$data .= join(" ",@fields)."\n";
#push @$value, join(" ",@fields)."\n";
$data .= "$_\n";
push @$value, "$_\n";
}
}
push @$res,[$node,$data,0];
+4 -4
View File
@@ -264,7 +264,7 @@ sub temp {
# No frame commands for IVM
#################################
if ( $hwtype eq "ivm" ) {
push @result, [$name,"$prefix Not available (No BPA)",1];
push @result, [$name,"$prefix Not available (No BPA)",0];
next;
}
#################################
@@ -272,14 +272,14 @@ sub temp {
#################################
if ( @$d[4] !~ /^(fsp|lpar|cec)$/ ) {
my $text = "$prefix Only available for CEC/LPAR";
push @result, [$name,$text,1];
push @result, [$name,$text,0];
next;
}
#################################
# Error - No frame
#################################
if ( $mtms eq "0" ) {
push @result, [$name,"$prefix Not available (No BPA)",1];
push @result, [$name,"$prefix Not available (No BPA)",0];
next;
}
#################################
@@ -352,7 +352,7 @@ sub rackenv {
#################################
if ( @$d[4] !~ /^(bpa|frame)$/ ) {
my $text = "$prefix Only available for BPA/Frame";
push @result, [$name,$text,1];
push @result, [$name,$text,0];
next;
}
+144 -57
View File
@@ -52,9 +52,10 @@ my @query_array = ();
my %param_list_map = (
'vmcpus' => 'part_get_lpar_processing',
'vmmemory' => 'part_get_lpar_memory',
'vmphyslots' => 'part_get_all_io_bus_info',
'vmnics' => 'part_get_all_vio_info',
'vmstorage' => 'part_get_all_vio_info',
'add_physlots' => 'part_get_all_io_bus_info',
'del_physlots' => 'part_get_all_io_bus_info',
'add_vmnics' => 'part_get_all_vio_info',
'add_vmstorage' => 'part_get_all_vio_info',
'del_vadapter' => 'part_get_all_vio_info'
);
@@ -62,7 +63,7 @@ sub chvm_parse_extra_options {
my $args = shift;
my $opt = shift;
# Partition used attributes #
my @support_ops = qw(vmcpus vmmemory vmphyslots vmothersetting vmstorage vmnics del_vadapter);
my @support_ops = qw(vmcpus vmmemory add_physlots vmothersetting add_vmstorage add_vmnics del_vadapter del_physlots);
if (ref($args) ne 'ARRAY') {
return "$args";
}
@@ -94,7 +95,13 @@ sub chvm_parse_extra_options {
if ($value !~ /^\d+$/) {
return "Invalid param '$value', only one slot id can be specified";
}
} elsif ($cmd eq "del_physlots") {
my @tmp_array = split ",",$value;
foreach (@tmp_array) {
unless (/(0x\w{8})/) {
return "'$_' is invalid";
}
}
} elsif ($cmd eq "vmothersetting") {
if ($value =~ /hugepage:\s*(\d+)/i) {
$opt->{huge_page} = $1;
@@ -105,7 +112,7 @@ sub chvm_parse_extra_options {
$tmp_hash{'get_cec_bsr'} = 1;
}
next;
} elsif ($cmd eq "vmstorage") {
} elsif ($cmd eq "add_vmstorage") {
if (exists($opt->{vios})) {
if ($value !~ /\d+/) {
return "'$value' is invalid, must be numbers";
@@ -134,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) {
@@ -149,7 +156,7 @@ sub chvm_parse_extra_options {
} else {
return "'$value' is invalid";
}
} elsif ($cmd eq "vmphyslots") {
} elsif ($cmd eq "add_physlots") {
my @tmp_array = split ",",$value;
foreach (@tmp_array) {
unless (/(0x\w{8})/) {
@@ -163,7 +170,7 @@ sub chvm_parse_extra_options {
return "'$_' is invalid";
}
}
} elsif ($cmd eq "vmnics") {
} elsif ($cmd eq "add_vmnics") {
my @tmp_array = split ",", $value;
foreach (@tmp_array) {
unless (/^vlan\d+$/i) {
@@ -199,8 +206,9 @@ sub chvm_parse_args {
# Process command-line arguments
#############################################
if ( !defined( $args )) {
$request->{method} = $cmd;
return( \%opt );
#$request->{method} = $cmd;
#return( \%opt );
return ( usage() );
}
#############################################
# Checks case in GetOptions, allows opts
@@ -415,7 +423,7 @@ sub chvm_parse_args {
my $check_chvm_arg = chvm_parse_extra_options(\@ARGV, \%opt);
if (defined($check_chvm_arg)) {
return (usage("Invalid argument: $check_chvm_arg"));
} elsif (($opt{lparname} ne '*') && (scalar(@{$request->{node}}) > '1')){
} elsif (($opt{lparname}) && ($opt{lparname} ne '*') && (scalar(@{$request->{node}}) > '1')){
return(usage( "Invalid argument: must specify '*' for more than one node" ));
}
if ((exists($opt{lparname}) ||exists($opt{huge_page})) &&
@@ -608,7 +616,6 @@ sub mkvm_parse_args {
if ( (!exists( $opt{i} ) || !exists( $opt{r} )) ) {
return(usage());
}
}
$opt{target} = \@{$request->{node}};
my $ppctab = xCAT::Table->new( 'ppc');
unless($ppctab) {
@@ -633,9 +640,11 @@ sub mkvm_parse_args {
return(usage("For Power 775, please make sure the noderange are in one CEC "));
}
}
if (exists($opt{p775})) {
#if (exists($opt{p775})) {
$request->{node} = [$other_p];
$request->{noderange} = $other_p;
#}
}
####################################
# No operands - add command name
@@ -794,14 +803,27 @@ sub do_op_extra_cmds {
if ($op eq "lparname") {
$action = "set_lpar_name";
} elsif ($op eq "huge_page") {
my @td = @$d;
@td[0] = 0;
my $tmphash = &query_cec_info_actions($request, $name, \@td, 1, ["get_huge_page"]);
if ($tmphash->{huge_page_avail}) {
if ($param > $tmphash->{huge_page_avail}) {
push @values, [$name, "No enough huge pages, only $tmphash->{huge_page_avail} pages available", 0];
$param = $tmphash->{huge_page_avail};
}
$param = "1/$param/$param";
} else {
push @values, [$name, "No huge page available to configure", 0];
next;
}
$action = "set_huge_page";
} elsif ($op eq "vmcpus") {
$action = "part_set_lpar_pending_proc";
} elsif ($op eq "vmphyslots") {
} elsif ($op eq "add_physlots" or $op eq "del_physlots") {
$action = "set_io_slot_owner_uber";
} elsif ($op eq "del_vadapter") {
$action = "part_clear_vslot_config";
} elsif ($op eq "vmnics") {
} elsif ($op eq "add_vmnics") {
my @vlans = split /,/,$param;
foreach (@vlans) {
if (/vlan(\d+)/i) {
@@ -820,7 +842,7 @@ sub do_op_extra_cmds {
}
}
next;
} elsif ($op eq "vmstorage") {
} elsif ($op eq "add_vmstorage") {
foreach my $v_info (@$param) {
if ($v_info =~ /(\d+),([\w_-]*):(\d+)/) {
my $vios = &find_lpar_id($request, @$d[3], $2);
@@ -842,21 +864,25 @@ sub do_op_extra_cmds {
my @td = @$d;
@td[0] = 0;
$memhash = &query_cec_info_actions($request, $name, \@td, 1, ["part_get_hyp_process_and_mem"]);
unless (scalar keys(%$memhash)) {
push @values, [$mtms, "Can not get hypervisor information", 1];
next;
}
if (!exists($memhash->{run})) {
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);
@@ -871,7 +897,11 @@ sub do_op_extra_cmds {
$memhash->{lpar_used_regions} = 0;
my $ret = &deal_with_avail_mem($request, $name, $d, $memhash);
if (ref($ret) eq "ARRAY") {
return ([[@$ret]]);
if (@$ret[2]) {
return ([[@$ret]]);
} else {
push @values, $ret;
}
}
$param = $memhash->{memory};
$action = "part_set_lpar_pending_mem";
@@ -885,17 +915,27 @@ sub do_op_extra_cmds {
}
my $tmp_value = ($param eq '*') ? $name : $param;
xCAT::MsgUtils->verbose_message($request, "$request->{command} $action for node:$name, parm:$tmp_value.");
my $value = xCAT::FSPUtils::fsp_api_action($request, $name, $d, $action, 0, $tmp_value);
my @tmpd = @$d;
if ($op eq "del_physlots") {
@tmpd[0] = "-1";
}
my $value = xCAT::FSPUtils::fsp_api_action($request, $name, \@tmpd, $action, 0, $tmp_value);
if (@$value[1] && ((@$value[1] =~ /Error/i) && (@$value[2] ne '0'))) {
return ([[$name, @$value[1], '1']]) ;
} else {
push @values, [$name, "Success", '0'];
}
}
my $rethash = query_cec_info_actions($request, $name, $d, 1, \@query_array);
# need to add update db here
$lpar_hash{$name} = $rethash;
$lpar_hash{$name}->{parent} = @$d[3];
if (@query_array) {
my $rethash = query_cec_info_actions($request, $name, $d, 1, \@query_array);
unless (scalar keys(%$rethash)) {
push @values, [$mtms, "Can not get hypervisor information", 1];
next;
}
# need to add update db here
$lpar_hash{$name} = $rethash;
$lpar_hash{$name}->{parent} = @$d[3];
}
}
}
if (%lpar_hash) {
@@ -1143,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;
}
}
@@ -1667,7 +1707,7 @@ sub xCATdB {
$profile,
$parent );
return( xCAT::PPCdb::add_ppc( $hwtype, [$values] ));
return( xCAT::PPCdb::add_ppc( $hwtype, [$values],'','',"FSP" ));
}
return undef;
}
@@ -1698,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;
@@ -1942,14 +1982,26 @@ sub query_cec_info {
}
my $rethash = query_cec_info_actions($request, $name, $d, $usage, ["part_get_lpar_processing","part_get_lpar_memory","part_get_all_io_bus_info","part_get_all_vio_info","get_huge_page","get_cec_bsr"], \%tmp_hash);
#push @result, [$name, $rethash, 0];
push @result, @$rethash;
#push @result, @$rethash;
if (scalar (@$rethash)) {
push @result, @$rethash;
} else {
push @result, [$name, "No information got", -1];
last;
}
$lpar_hash{$name} = \%tmp_hash;
$lpar_hash{$name}->{parent} = @$d[3];
}
if (@td[0] == 0) {
my $rethash = query_cec_info_actions($request, @td[3],\@td, $usage);
if (scalar (@$rethash)) {
push @result, @$rethash;
} else {
push @result, [@td[3], "No information got", -1];
last;
}
#push @result, [@td[3], $rethash, 0];
push @result, @$rethash;
#push @result, @$rethash;
}
}
if ($args->{updatedb} and %lpar_hash) {
@@ -2049,9 +2101,12 @@ sub deal_with_avail_mem {
my $cur_mem_in_G = $lparhash->{hyp_avail_mem} * $lparhash->{mem_region_size} * 1.0 / 1024;
return([$name, "Parse reserverd regions failed, no enough memory, available:$cur_mem_in_G GB.", 1]);
}
if ($cur > $cur_avail) {
my $new_cur = $cur_avail;
$lparhash->{memory} = "$min/$new_cur/$max";
if (($cur_avail > 0) and ($cur > $cur_avail)) {
my $cur_avail_in_G = $cur_avail * $lparhash->{mem_region_size} * 1.0 / 1024;
$lparhash->{memory} = "$min/$cur_avail/$max";
unless ($lparhash->{full_par}) {
return([$name, "Available memory is less than required, allocate $cur_avail_in_G GB.", 0]);
}
}
} else {
return ([$name, "Failed to get hypervisor reserved memory regions.", 1]);
@@ -2089,6 +2144,7 @@ sub create_lpar {
my $name = shift;
my $d = shift;
my $lparhash = shift;
my @ret = ();
my $values;
if (exists($request->{opt}->{vios})) {
$values = xCAT::FSPUtils::fsp_api_action($request, $name, $d, "part_set_lpar_def_state", 0, 0x03);
@@ -2101,7 +2157,7 @@ sub create_lpar {
$values = xCAT::FSPUtils::fsp_api_action($request, $name, $d, "set_lpar_name", 0, $name);
if (@$values[2] ne 0) {
&set_lpar_undefined($request, $name, $d);
return ([$name, @$values[1], @$values[0]]);
return ([[$name, @$values[1], @$values[0]]]);
}
xCAT::FSPUtils::fsp_api_action($request, $name, $d, "part_set_lpar_shared_pool_util_auth");
xCAT::FSPUtils::fsp_api_action($request, $name, $d, "part_set_lpar_group_id");
@@ -2112,7 +2168,7 @@ sub create_lpar {
#$values = xCAT::FSPUtils::fsp_api_action($request, $name, $d, "set_io_slot_owner", 0, join(",",@phy_io_array));
if (@$values[2] ne 0) {
&set_lpar_undefined($request, $name, $d);
return ([$name, @$values[1], @$values[2]]);
return ([[$name, @$values[1], @$values[2]]]);
}
}
if (exists($lparhash->{nics})) {
@@ -2128,7 +2184,7 @@ sub create_lpar {
$values = xCAT::FSPUtils::fsp_api_action($request,$name, $d, "part_set_veth_slot_config",0,"0,$vlanid,$mac");
if (@$values[2] ne 0) {
&set_lpar_undefined($request, $name, $d);
return ([$name, @$values[1], @$values[2]]);
return ([[$name, @$values[1], @$values[2]]]);
}
}
}
@@ -2138,7 +2194,7 @@ sub create_lpar {
$values = xCAT::FSPUtils::fsp_api_action($request,$name, $d, "part_set_vscsi_slot_config",0,$v_info);
if (@$values[2] ne 0) {
&set_lpar_undefined($request, $name, $d);
return ([$name, @$values[1], @$values[2]]);
return ([[$name, @$values[1], @$values[2]]]);
}
}
}
@@ -2169,19 +2225,23 @@ sub create_lpar {
$values = xCAT::FSPUtils::fsp_api_action($request, $name, $d, "part_set_lpar_pending_proc", 0, $lparhash->{cpus});
if (@$values[2] ne 0) {
&set_lpar_undefined($request, $name, $d);
return ([$name, @$values[1], @$values[2]]);
return ([[$name, @$values[1], @$values[2]]]);
}
$values = &deal_with_avail_mem($request, $name, $d,$lparhash);
if (ref($values) eq "ARRAY") {
&set_lpar_undefined($request, $name, $d);
return ([@$values]);
if (@$values[2]) {
&set_lpar_undefined($request, $name, $d);
return ([[@$values]]);
} else {
push @ret, $values;
}
}
#print "======>memory:$lparhash->{memory}.\n";
$values = xCAT::FSPUtils::fsp_api_action($request, $name, $d, "part_set_lpar_pending_mem", 0, $lparhash->{memory});
if (@$values[2] ne 0) {
&set_lpar_undefined($request, $name, $d);
return ([$name, @$values[1], @$values[2]]);
return ([[$name, @$values[1], @$values[2]]]);
}
xCAT::FSPUtils::fsp_api_action($request, $name, $d, "part_set_lpar_comp_modes");
@@ -2196,9 +2256,11 @@ sub create_lpar {
$values = xCAT::FSPUtils::fsp_api_action($request, $name, $d, "part_set_lpar_def_state", 0, 0x02);
}
if (@$values[2] ne 0) {
return ([$name, @$values[1], @$values[2]]);
return ([[$name, @$values[1], @$values[2]]]);
}
return ([$name, "Done", 0]);
push @ret, [$name, "Done", 0];
#return ([$name, "Done", 0]);
return \@ret;
}
sub mkspeclpar {
@@ -2213,7 +2275,7 @@ sub mkspeclpar {
return([["Error","Cannot open vm table", 1]]);
}
while (my ($mtms, $h) = each (%$hash)) {
my $memhash;
my $memhash = undef;
my @nodes = keys(%$h);
my $ent = $vmtab->getNodesAttribs(\@nodes, ['cpus', 'memory','physlots', 'othersettings', 'storage', 'nics']);
while (my ($name, $d) = each (%$h)) {
@@ -2221,12 +2283,18 @@ sub mkspeclpar {
push @result, [$name, "Node must be LPAR", 1];
last;
}
if (!exists($memhash->{run})) {
#if (!exists($memhash->{run}))
#{
my @td = @$d;
@td[0] = 0;
$memhash = &query_cec_info_actions($request, $name, \@td, 1, ["part_get_hyp_process_and_mem","lpar_lhea_mac","part_get_all_io_bus_info"]);
$memhash->{run} = 1;
}
unless (scalar keys(%$memhash)) {
push @result, [$mtms, "Can not get hypervisor information", 1];
last;
}
#$memhash->{run} = 1;
#}
my $tmp_ent = $ent->{$name}->[0];
if (exists($opt->{vmcpus})) {
$tmp_ent->{cpus} = $opt->{vmcpus};
@@ -2261,19 +2329,31 @@ sub mkspeclpar {
if ($tmp_ent->{cpus} =~ /^(\d+)\/(\d+)\/(\d+)$/) {
unless ($1 <= $2 and $2 <= $3) {
return([[$name, "Parameter for 'vmcpus' is invalid", 1]]);
} elsif ($memhash->{process_units_avail} eq '0') {
push @result, [$name, "No process available", 1];
next;
} elsif ($2 > $memhash->{process_units_avail}) {
my $cur = $memhash->{process_units_avail};
my $min = $1 > $cur ? $cur : $1;
$tmp_ent->{cpus} = "$min/$cur/$3";
push @result, [$name, "Available processor is less than required, allocate $cur processors.", 0];
}
} else {
return([[$name, "Parameter for 'vmcpus' is invalid", 1]]);
}
if ($tmp_ent->{memory} =~ /^([\d|.]+)([G|M]?)\/([\d|.]+)([G|M]?)\/([\d|.]+)([G|M]?)$/i) {
if ($memhash->{hyp_avail_mem} eq '0') {
push @result, [$name, "No memory available", 1];
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) {
@@ -2372,9 +2452,13 @@ sub mkspeclpar {
$tmp_ent->{phy_hea} = $memhash->{phy_drc_group_port};
$tmp_ent->{logic_drc_phydrc} = $memhash->{logic_drc_phydrc};
$values = &create_lpar($request, $name, $d, $tmp_ent);
push @result, $values;
push @result, @$values;
#need to add update db here
my $rethash = query_cec_info_actions($request, $name, $d, 1, ["part_get_lpar_processing","part_get_lpar_memory","part_get_all_vio_info","part_get_all_io_bus_info","get_huge_page","get_cec_bsr"]);
unless (scalar keys(%$rethash)) {
push @result, [$mtms, "Can not get hypervisor information", 1];
next;
}
$lpar_hash{$name} = $rethash;
$lpar_hash{$name}->{parent} = @$d[3];
@@ -2404,8 +2488,9 @@ sub mkfulllpar {
my @td = @$d;
@td[0] = 0;
$rethash = query_cec_info_actions($request, $name, \@td, 1);
if (ref($rethash) ne 'HASH') {
return ([[$mtms, "Cann't get hypervisor info hash", 1]]);
unless (scalar keys(%$rethash)) {
push @result, [$mtms, "Can not get hypervisor information", 1];
next;
}
$rethash->{run} = 1;
#print Dumper($rethash);
@@ -2415,15 +2500,17 @@ sub mkfulllpar {
$lpar_param{memory} = "1/".$rethash->{hyp_avail_mem}."/".$rethash->{hyp_config_mem};
$lpar_param{hyp_config_mem} = $rethash->{hyp_config_mem};
$lpar_param{hyp_avail_mem} = $rethash->{hyp_avail_mem};
$lpar_param{mem_region_size} = $rethash->{mem_region_size};
my @phy_io_array = keys(%{$rethash->{bus}});
$lpar_param{physlots} = join(",", @phy_io_array);
$lpar_param{huge_page} = "1/".$rethash->{huge_page_avail}."/".$rethash->{huge_page_avail};
$lpar_param{bsr_num} = $rethash->{cec_bsr_avail};
$lpar_param{phy_hea} = $rethash->{phy_drc_group_port};
$lpar_param{logic_drc_phydrc} = $rethash->{logic_drc_phydrc};
$lpar_param{full_par} = 1;
$values = &create_lpar($request, $name, $d, \%lpar_param);
$rethash->{logic_drc_phydrc} = $lpar_param{logic_drc_phydrc};
push @result, $values;
push @result, @$values;
$name = undef;
$d = undef;
}
Regular → Executable
+17 -9
View File
@@ -217,14 +217,23 @@ sub is_me
#my ($b1, $b2, $b3, $b4) = split /\./, $nameIP;
# get all the possible IPs for the node I'm running on
my $ifcmd = "ifconfig -a | grep 'inet'";
my $result = xCAT::Utils->runcmd($ifcmd, -1, 1);
# this is a common subroutine for both AIX and Linux,
# AIX does not have ip command
my $ipcmd;
if ( -f "/sbin/ip" )
{
$ipcmd = "ip addr | grep 'inet'";
}
else
{
$ipcmd = "ifconfig -a | grep 'inet'";
}
my $result = xCAT::Utils->runcmd($ipcmd, -1, 1);
if ($::RUNCMD_RC != 0)
{
my $rsp;
# push @{$rsp->{data}}, "Could not run $ifcmd.\n";
# xCAT::MsgUtils->message("E", $rsp, $callback);
$::VERBOSE = $verb;
my $str="Error running ipcmd";
xCAT::MsgUtils->message("S", $str);
$::VERBOSE = $verb;
return 0;
}
@@ -232,7 +241,6 @@ sub is_me
{
my ($inet, $myIP, $str) = split(" ", $int);
chomp $myIP;
$myIP =~ s/addr://;
$myIP =~ s/\/.*//; # ipv6 address 4000::99/64
$myIP =~ s/\%.*//; # ipv6 address ::1%1/128
@@ -1135,8 +1143,8 @@ sub dolitesetup
if (!$file) {
next;
}
}
# ex. .../inst_root/foo/bar/ or .../inst_root/etc/lppcfg
my $instrootfile = $instrootloc . $file;
Regular → Executable
+72 -10
View File
@@ -629,7 +629,8 @@ sub get_adap_prop {
$cmd[0] = "\" supported-network-types\" " . $phandle . " get-package-property\r";
$msg[0] = "Status: rc and all supported network types now on stack\n";
#$pattern[0] = "(.*)3 >(.*)";
$pattern[0] = "3 >";
#$pattern[0] = "3 >";
$pattern[0] = "ok";
$newstate[0] = 1;
# state 1, return code and string on stack
@@ -637,7 +638,8 @@ sub get_adap_prop {
$cmd[1] = ".\r";
$msg[1] = "Status: All supported network types now on stack\n";
#$pattern[1] = "(.*)2 >(.*)";
$pattern[1] = "2 >";
#$pattern[1] = "2 >";
$pattern[1] = "ok";
$newstate[1] = 2;
# state 2, data ready to decode
@@ -691,6 +693,16 @@ sub get_adap_prop {
$timeout,
[ qr/$pattern[$state]/i,
sub {
if ($state eq 1) {
if ($rconsole->before() =~ /-\d+/) {
nc_msg($verbose, "Status: Error getting adapter property for phandle=$phandle.\n");
$state = 7;
$rconsole->clear_accum();
$rc = 1;
return 1;
}
}
nc_msg($verbose, $msg[$state]);
$state = $newstate[$state];
$rconsole->clear_accum();
@@ -878,6 +890,15 @@ sub get_mac_addr {
$timeout,
[qr/$pattern[$state]/=>
sub {
if ($state eq 1) {
if ($rconsole->before() =~ /-\d+/) {
nc_msg($verbose, "Status: Error getting MAC address for phandle=$phandle.\n");
$rconsole->clear_accum();
$state = 4;
$rc = 1;
return undef;
}
}
nc_msg($verbose, $msg[$state]);
$state = $newstate[$state];
$rconsole->clear_accum();
@@ -1019,7 +1040,8 @@ sub get_mac_addr {
$cmd[0] = "\" ibm,loc-code\" $phandle get-package-property\r";
$msg[0] = "Status: return code and loc-code now on stack\n";
#$pattern[0] = "(.*)3 >(.*)";
$pattern[0] = "3 >";
#$pattern[0] = "3 >";
$pattern[0] = "ok";
$newstate[0] = 1;
# cmd(1) is a dot (.). This is a stack manipulation command that removes one
@@ -1052,6 +1074,16 @@ sub get_mac_addr {
$timeout,
[qr/$pattern[$state]/=>
sub {
if ($state eq 1) {
if ($rconsole->before() =~ /-\d+/) {
nc_msg($verbose, "Status: Error getting adapter location for phandle=$phandle.");
$rconsole->clear_accum();
$state = 3;
$rc = 1;
return undef;
}
}
nc_msg($verbose, $msg[$state]);
$rconsole->clear_accum();
$state = $newstate[$state];
@@ -1125,10 +1157,19 @@ sub get_mac_addr {
return undef if ($rc eq 1);
}
# Did we find one or more adapters?
if ($result[3] =~ /(\w*):(.*):(\w*\.\w*\.\w*):/) {
$loc_code = $3;
}else {
my @loc_array = split /\n/,$result[3];
my $found = 0;
$loc_code = '';
foreach my $line ( @loc_array ) {
if ($line =~ /(\w*):(.*):([\w|\.|-]*):/) {
$loc_code .= $3;
$found = 1;
}
}
if ($found) {
$loc_code =~ s/\.$//;
return $loc_code;
} else {
return undef;
}
}
@@ -1240,6 +1281,12 @@ sub ping_server{
$msg[3] = "Status: ping return code now on stack\n";
$newstate[3] = 4;
# get the timeout for ping test
my $to4pt;
if ( $ENV{TIMEOUT4PINGTEST} =~ /^\d+$/ ) {
$to4pt = ",$ENV{TIMEOUT4PINGTEST}";
}
#IPv6
if ( $server_ip =~ /:/ ) {
#::1, calculate link local address
@@ -1249,9 +1296,9 @@ sub ping_server{
} else {
$linklocal_ip = $client_ip;
}
$cmd[3] = "ping $full_path_name:ipv6,$server_ip,$linklocal_ip,$gateway_ip\r";
$cmd[3] = "ping $full_path_name:ipv6,$server_ip,$linklocal_ip,$gateway_ip$to4pt\r";
} else {
$cmd[3] = "ping $full_path_name:$server_ip,$client_ip,$gateway_ip\r";
$cmd[3] = "ping $full_path_name:$server_ip,$client_ip,$gateway_ip$to4pt\r";
}
$pattern[3] = ".*ping(.*)ok(.*)0 >(.*)";
@@ -2628,7 +2675,7 @@ sub lparnetbootexp
sub {
$rc = 2;
$rconsole->clear_accum();
nc_msg($verbose, "Please make sure rcons $node works.\n");
nc_msg(1, "Please make sure rcons $node works.\n");
}
],
);
@@ -3000,6 +3047,21 @@ sub lparnetbootexp
$device_type = "physical";
}
if (defined($mac_address)) {
my @newmacs = ();
my @allmacs = split /\|/,$mac_address;
if ( !xCAT::Utils->isAIX() ) {
foreach my $mac_a ( @allmacs ) {
$mac_a = lc($mac_a);
$mac_a =~ s/(\w{2})/$1:/g;
$mac_a =~ s/:$//;
push @newmacs, $mac_a;
}
$mac_address = join("|",@newmacs);
}
}
if($colon) {
nc_msg($verbose, "$adap_type[$i]\:$loc_code\:$mac_address\:$full_path_name_array[$i]\:$ping_result\:$device_type\:\:\:\:\n");
$outputarrayindex++;
+37 -23
View File
@@ -138,8 +138,9 @@ This program module file, supports the xcat messaging and logging
N - Node informational goes to STDOUT
S - Message will be logged to syslog ( severe error)
Note S can be combined with other flags for example
SE logs message to syslog and is sent to STDERR.
SA logs message to syslog and to the auditlog DB table
SE logs message to syslog and is sent to STDERR.
SA logs message to syslog and to the auditlog DB table. (only xcatd)
A logs message auditlog DB table only. (only for xcatd)
V - verbose. This flag is not valid, the calling routine
should check for verbose mode before calling the message
@@ -175,7 +176,7 @@ This program module file, supports the xcat messaging and logging
# Message to Syslog
xCAT::MsgUtils->message('S', "Host $host not responding\n");
# Message to Syslog and auditlog table
# Message to Syslog and auditlog table (only used by xcatd)
# see tabdump -d auditlog
my $rsp = {};
$rsp->{syslogdata}->[0] = "$host not responding\n"; # for syslog
@@ -189,6 +190,18 @@ This program module file, supports the xcat messaging and logging
$rsp->{status} -> [0] = $status;
xCAT::MsgUtils->message('SA', $rsp);
# Message to only auditlog table (only used by xcatd)
# see tabdump -d auditlog
my $rsp = {};
$rsp->{userid} ->[0] = $user;
$rsp->{clientname} -> [0] = $client;
$rsp->{clienttype} -> [0] = $clienttype;
$rsp->{command} -> [0] = $command;
$rsp->{noderange} -> [0] = $noderange;
$rsp->{args} -> [0] = $arguments;
$rsp->{status} -> [0] = $status;
xCAT::MsgUtils->message('A', $rsp);
# Message to Log and Syslog
xCAT::MsgUtils->message('LS', "Host $host not responding\n");
@@ -197,44 +210,44 @@ This program module file, supports the xcat messaging and logging
Use with callback
# Message to callback
my $rsp = {};
my $rsp = {};
$rsp->{data}->[0] = "Job did not run. \n";
xCAT::MsgUtils->message("D", $rsp, $::CALLBACK);
my $rsp = {};
my $rsp = {};
$rsp->{error}->[0] = "No hosts in node list\n";
xCAT::MsgUtils->message("E", $rsp, $::CALLBACK);
my $rsp = {};
$rsp->{node}->[0]->{name}->[0] ="mynode";
$rsp->{node}->[0]->{data}->[0] ="mydata";
xCAT::MsgUtils->message("N", $rsp, $callback);
my $rsp = {};
$rsp->{node}->[0]->{name}->[0] ="mynode";
$rsp->{node}->[0]->{data}->[0] ="mydata";
xCAT::MsgUtils->message("N", $rsp, $callback);
my $rsp = {};
my $rsp = {};
$rsp->{info}->[0] = "No hosts in node list\n";
xCAT::MsgUtils->message("I", $rsp, $::CALLBACK);
my $rsp = {};
my $rsp = {};
$rsp->{sinfo}->[0] = "No hosts in node list\n";
xCAT::MsgUtils->message("IS", $rsp, $::CALLBACK);
my $rsp = {};
my $rsp = {};
$rsp->{warning}->[0] = "No hosts in node list\n";
xCAT::MsgUtils->message("W", $rsp, $::CALLBACK);
my $rsp = {};
my $rsp = {};
$rsp->{error}->[0] = "Host not responding\n";
xCAT::MsgUtils->message("S", $rsp, $::CALLBACK);
# Message to Syslog and callback
my $rsp = {};
my $rsp = {};
$rsp->{error}->[0] = "Host not responding\n";
xCAT::MsgUtils->message("SE", $rsp, $::CALLBACK);
# Message to Syslog and callback
my $rsp = {};
my $rsp = {};
$rsp->{info}->[0] = "Host not responding\n";
xCAT::MsgUtils->message("SI", $rsp, $::CALLBACK);
@@ -274,17 +287,19 @@ sub message
my $call_back = shift; # optional
my $exitcode = shift; # optional
# should be I,IS, D, E, S, SA ,LS, W , L,N
# should be I,IS, D, E, S, SA,A ,LS, W , L,N
# or S(I, D, E, S, W, L,N)
#
# if new SA option need to split syslog messages from auditlog entry
# if SA option need to split syslog messages from auditlog entry
#
my $newrsp;
if ($sev eq 'SA')
{ # if SA then need to pull first entry from $rsp
# for syslog, to preserve old interface
if (($sev eq 'SA') || ($sev eq 'A'))
{ # if SA ( syslog and auditlog) or A ( only auditlog)then need to pull first entry from $rsp
# for syslog, to preserve old interface
$newrsp = $rsp;
if ($sev eq 'SA'){ # syslog and auditlog
$rsp = $newrsp->{syslogdata}->[0];
}
}
my $stdouterrf = \*STDOUT;
my $stdouterrd = '';
@@ -449,11 +464,10 @@ sub message
}
}
# is syslog requested
# is syslog option requested
if ($sev =~ /S/)
{
# If they want this msg to also go to syslog, do that now
eval {
openlog("xCAT", "nofatal,pid", "local4");
@@ -474,7 +488,7 @@ sub message
# if write to auditlog table requested, if not on service node
if (xCAT::Utils->isMN()){
if ($sev eq 'SA')
if (($sev eq 'SA') || ($sev eq 'A'))
{
require xCAT::Table;
my $auditlogentry;
+301 -252
View File
@@ -19,7 +19,7 @@ use File::Path;
use Math::BigInt;
use Socket;
use xCAT::GlobalDef;
use Data::Dumper;
#use Data::Dumper;
use strict;
use warnings "all";
my $socket6support = eval { require Socket6 };
@@ -69,14 +69,14 @@ This program module file, is a set of network utilities used by xCAT commands.
#-------------------------------------------------------------------------------
sub getNodeDomains()
{
my $class = shift;
my $class = shift;
my $nodes = shift;
my @nodelist = @$nodes;
my %nodedomains;
# Get the network info for each node
my %nethash = xCAT::DBobjUtils->getNetwkInfo(\@nodelist);
my %nethash = xCAT::DBobjUtils->getNetwkInfo(\@nodelist);
# get the site domain value
my @domains = xCAT::TableUtils->get_site_attribute("domain");
@@ -85,12 +85,13 @@ sub getNodeDomains()
# for each node - set hash value to network domain or default
# to site domain
foreach my $node (@nodelist) {
if ($nethash{$node}{domain}) {
$nodedomains{$node} = $nethash{$node}{domain};
} else {
$nodedomains{$node} = $sitedomain;
}
}
unless (defined($node)) {next;}
if (defined($nethash{$node}) && $nethash{$node}{domain}) {
$nodedomains{$node} = $nethash{$node}{domain};
} else {
$nodedomains{$node} = $sitedomain;
}
}
return \%nodedomains;
}
@@ -643,16 +644,11 @@ sub get_nic_ip
{
my $nic;
my %iphash;
my $cmd = "ifconfig -a";
my $result = `$cmd`;
my $mode = "MULTICAST";
my $payingattention=0;
my $interface;
my $keepcurrentiface;
#############################################
# Error running command
#############################################
if ( !$result ) {
return undef;
}
if (xCAT::Utils->isAIX()) {
##############################################################
@@ -664,6 +660,14 @@ sub get_nic_ip
# en1: ...
#
##############################################################
my $cmd = "ifconfig -a";
my $result = `$cmd`;
#############################################
# Error running command
#############################################
if ( !$result ) {
return undef;
}
my @adapter = split /(\w+\d+):\s+flags=/, $result;
foreach ( @adapter ) {
if ($_ =~ /^(en\d)/) {
@@ -683,44 +687,39 @@ sub get_nic_ip
}
}
}
else {
##############################################################
# Should look like this for Linux:
# eth0 Link encap:Ethernet HWaddr 00:02:55:7B:06:30
# inet addr:9.114.154.193 Bcast:9.114.154.223
# inet6 addr: fe80::202:55ff:fe7b:630/64 Scope:Link
# UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
# RX packets:1280982 errors:0 dropped:0 overruns:0 frame:0
# TX packets:3535776 errors:0 dropped:0 overruns:0 carrier:0
# collisions:0 txqueuelen:1000
# RX bytes:343489371 (327.5 MiB) TX bytes:870969610 (830.6 MiB)
# Base address:0x2600 Memory:fbfe0000-fc0000080
#
# eth1 ...
# Redhat7
#eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
# inet 10.1.0.178 netmask 255.255.0.0 broadcast 10.1.255.255
#
##############################################################
my @adapter= split /\n{2,}/, $result;
foreach ( @adapter ) {
if ( !($_ =~ /LOOPBACK/ ) and
$_ =~ /UP( |,|>)/ and
$_ =~ /$mode/ ) {
my @ip = split /\n/;
for my $ent ( @ip ) {
if ($ent =~ /^(eth\d|ib\d|hf\d)\s+/) {
$nic = $1;
}
if ($ent =~ /^(eth\d:|ib\d:|hf\d:)\s+/) {
$nic = $1;
}
$ent=~ s/addr://; # works for Redhat7 also
if ( $ent =~ /^\s*inet \s*(\d+\.\d+\.\d+\.\d+)/ ) {
$iphash{$nic} = $1;
next;
}
else { # linux
my @ipoutput = `ip addr`;
#############################################
# Error running command
#############################################
if ( !@ipoutput ) {
return undef;
}
foreach my $line (@ipoutput) {
if ($line =~ /^\d/) { # new interface, new context..
if ($interface and not $keepcurrentiface) {
#don't bother reporting unusable nics
delete $iphash{$interface};
}
$keepcurrentiface=0;
if ( !($line =~ /LOOPBACK/ ) and
$line =~ /UP( |,|>)/ and
$line =~ /$mode/ ) {
$payingattention=1;
$line =~ /^([^:]*): ([^:]*):/;
$interface=$2;
} else {
$payingattention=0;
next;
}
}
unless ($payingattention) { next; }
if ($line =~ /inet/) {
$keepcurrentiface=1;
}
if ( $line =~ /^\s*inet \s*(\d+\.\d+\.\d+\.\d+)/ ) {
$iphash{$interface} = $1;
}
}
}
@@ -1099,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
@@ -1117,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+/;
@@ -1129,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;
}
}
#-------------------------------------------------------------------------------
@@ -1603,58 +1614,124 @@ sub thishostisnot
=cut
#-----------------------------------------------------------------------------
#sub gethost_ips1
#{
# my ($class) = @_;
# my $cmd;
# my @ipaddress;
# $cmd = "ifconfig" . " -a";
# $cmd = $cmd . "| grep \"inet\"";
# my @result = xCAT::Utils->runcmd($cmd, 0);
# if ($::RUNCMD_RC != 0)
# {
# xCAT::MsgUtils->message("S", "Error from $cmd\n");
# exit $::RUNCMD_RC;
# }
# foreach my $addr (@result)
# {
# my @ip;
# if (xCAT::Utils->isLinux())
# {
# if ($addr =~ /inet6/)
# {
# #TODO, Linux ipv6
# }
# else
# {
# my ($inet, $addr1, $Bcast, $Mask) = split(" ", $addr);
# #@ip = split(":", $addr1);
# #push @ipaddress, $ip[1];
# $addr1 =~ s/.*://;
# push @ipaddress, $addr1;
# }
# }
# else
# { #AIX
# if ($addr =~ /inet6/)
# {
# $addr =~ /\s*inet6\s+([\da-fA-F:]+).*\/(\d+)/;
# my $v6ip = $1;
# my $v6mask = $2;
# if ($v6ip)
# {
# push @ipaddress, $v6ip;
# }
# }
# else
# {
# my ($inet, $addr1, $netmask, $mask1, $Bcast, $bcastaddr) =
# split(" ", $addr);
# push @ipaddress, $addr1;
# }
#
# }
# }
# my @names = @ipaddress;
# foreach my $ipaddr (@names)
# {
# my $hostname = xCAT::NetworkUtils->gethostname($ipaddr);
# if ($hostname)
# {
# my @shorthost = split(/\./, $hostname);
# push @ipaddress, $shorthost[0];
# }
# }
#
# return @ipaddress;
#}
sub gethost_ips
{
my ($class) = @_;
my $cmd;
my @ipaddress;
$cmd = "ifconfig" . " -a";
$cmd = $cmd . "| grep \"inet\"";
my @result = xCAT::Utils->runcmd($cmd, 0);
if ($::RUNCMD_RC != 0)
if (xCAT::Utils->isLinux())
{
xCAT::MsgUtils->message("S", "Error from $cmd\n");
exit $::RUNCMD_RC;
$cmd="ip -4 --oneline addr show |awk -F ' ' '{print \$4}'|awk -F '/' '{print \$1}'";
my @result =xCAT::Utils->runcmd($cmd);
if ($::RUNCMD_RC != 0)
{
xCAT::MsgUtils->message("S", "Error from $cmd\n");
exit $::RUNCMD_RC;
}
push @ipaddress, @result;
}
foreach my $addr (@result)
{
my @ip;
if (xCAT::Utils->isLinux())
{
if ($addr =~ /inet6/)
{
#TODO, Linux ipv6
}
else
{
my ($inet, $addr1, $Bcast, $Mask) = split(" ", $addr);
#@ip = split(":", $addr1);
#push @ipaddress, $ip[1];
$addr1 =~ s/.*://;
push @ipaddress, $addr1;
}
}
else
{ #AIX
if ($addr =~ /inet6/)
{
$addr =~ /\s*inet6\s+([\da-fA-F:]+).*\/(\d+)/;
my $v6ip = $1;
my $v6mask = $2;
if ($v6ip)
{
push @ipaddress, $v6ip;
}
}
else
{
my ($inet, $addr1, $netmask, $mask1, $Bcast, $bcastaddr) =
split(" ", $addr);
push @ipaddress, $addr1;
}
else
{ #AIX
$cmd = "ifconfig" . " -a";
$cmd = $cmd . "| grep \"inet\"";
my @result = xCAT::Utils->runcmd($cmd, 0);
if ($::RUNCMD_RC != 0)
{
xCAT::MsgUtils->message("S", "Error from $cmd\n");
exit $::RUNCMD_RC;
}
foreach my $addr (@result)
{
if ($addr =~ /inet6/)
{
$addr =~ /\s*inet6\s+([\da-fA-F:]+).*\/(\d+)/;
my $v6ip = $1;
my $v6mask = $2;
if ($v6ip)
{
push @ipaddress, $v6ip;
}
}
else
{
my ($inet, $addr1, $netmask, $mask1, $Bcast, $bcastaddr) =
split(" ", $addr);
push @ipaddress, $addr1;
}
}
}
}
my @names = @ipaddress;
foreach my $ipaddr (@names)
{
@@ -1665,9 +1742,9 @@ sub gethost_ips
push @ipaddress, $shorthost[0];
}
}
return @ipaddress;
}
#-------------------------------------------------------------------------------
=head3 get_subnet_aix
@@ -1843,102 +1920,6 @@ sub validate_ip
}
return([0]);
}
#-------------------------------------------------------------------------------
=head3 getFacingIP
Gets the ip address of the adapter of the localhost that is facing the
the given node.
Assume it is the same as my_ip_facing...
Arguments:
The name of the node that is facing the localhost.
Returns:
The ip address of the adapter that faces the node.
=cut
#-------------------------------------------------------------------------------
sub getFacingIP
{
my ($class, $node) = @_;
my $ip;
my $cmd;
my @ipaddress;
my $nodeip = inet_ntoa(inet_aton($node));
unless ($nodeip =~ /\d+\.\d+\.\d+\.\d+/)
{
return 0; #Not supporting IPv6 here IPV6TODO
}
$cmd = "ifconfig" . " -a";
$cmd = $cmd . "| grep \"inet \"";
my @result = xCAT::Utils->runcmd($cmd, 0);
if ($::RUNCMD_RC != 0)
{
xCAT::MsgUtils->message("S", "Error from $cmd\n");
exit $::RUNCMD_RC;
}
# split node address
my ($n1, $n2, $n3, $n4) = split('\.', $nodeip);
foreach my $addr (@result)
{
my $ip;
my $mask;
if (xCAT::Utils->isLinux())
{
my ($inet, $addr1, $Bcast, $Mask) = split(" ", $addr);
if ((!$addr1) || (!$Mask)) { next; }
my @ips = split(":", $addr1);
my @masks = split(":", $Mask);
$ip = $ips[1];
$mask = $masks[1];
}
else
{ #AIX
my ($inet, $addr1, $netmask, $mask1, $Bcast, $bcastaddr) =
split(" ", $addr);
if ((!$addr1) && (!$mask1)) { next; }
$ip = $addr1;
$mask1 =~ s/0x//;
$mask =
`printf "%d.%d.%d.%d" \$(echo "$mask1" | sed 's/../0x& /g')`;
}
if ($ip && $mask)
{
# split interface IP
my ($h1, $h2, $h3, $h4) = split('\.', $ip);
# split mask
my ($m1, $m2, $m3, $m4) = split('\.', $mask);
# AND this interface IP with the netmask of the network
my $a1 = ((int $h1) & (int $m1));
my $a2 = ((int $h2) & (int $m2));
my $a3 = ((int $h3) & (int $m3));
my $a4 = ((int $h4) & (int $m4));
# AND node IP with the netmask of the network
my $b1 = ((int $n1) & (int $m1));
my $b2 = ((int $n2) & (int $m2));
my $b3 = ((int $n3) & (int $m3));
my $b4 = ((int $n4) & (int $m4));
if (($b1 == $a1) && ($b2 == $a2) && ($b3 == $a3) && ($b4 == $a4))
{
return $ip;
}
}
}
xCAT::MsgUtils->message("S", "Cannot find master for the node $node\n");
return 0;
}
#-------------------------------------------------------------------------------
=head3 isIpaddr
@@ -1992,50 +1973,6 @@ sub isIpaddr
}
#-------------------------------------------------------------------------------
=head3 getSubnetGateway
Description:
Get gateway from the networks table of the specified net.
Arguments:
net: the net, ie. the "net" field of the networks table
Returns:
Return a string, of the gateway
undef - Failed to get the gateway
Globals:
none
Error:
none
Example:
my $gateway = xCAT::NetworkUtils::getSubnetGateway('192.168.1.0');
Comments:
none
=cut
#-------------------------------------------------------------------------------
sub getSubnetGateway
{
my $netname=shift;
if( $netname =~ /xCAT::NetworkUtils/)
{
$netname=shift;
}
my $gateway=undef;
my $nettab = xCAT::Table->new("networks");
unless($nettab) { die "No entry defined in networks"; }
my @nets = $nettab->getAllAttribs('net','gateway');
foreach(@nets)
{
if("$_->{net}" eq "$netname")
{
$gateway = $_->{gateway};
last;
}
}
return $gateway;
}
#-------------------------------------------------------------------------------
@@ -2093,6 +2030,7 @@ sub getNodeNameservers{
return \%nodenameservers;
}
#-------------------------------------------------------------------------------
=head3 getNodeNetworkCfg
@@ -2122,22 +2060,28 @@ sub getNodeNetworkCfg
if( $node =~ /xCAT::NetworkUtils/)
{
$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;
$gateway=xCAT::NetworkUtils::getSubnetGateway($netname);
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'};
}
}
}
return ($ip, $node, $gateway, xCAT::NetworkUtils::formatNetmask($mask,1,0));
return ($ip, $node, $gateway, xCAT::NetworkUtils::formatNetmask($mask,0,0));
}
#-------------------------------------------------------------------------------
=head3 get_hdwr_ip
@@ -2211,7 +2155,13 @@ sub pingNodeStatus {
foreach (@mon_nodes) {
$deadnodes{$_}=1;
}
open (NMAP, "nmap -PE --system-dns --send-ip -sP ". $nodes . " 2> /dev/null|") or die("Cannot open nmap pipe: $!");
# get additional options from site table
my @nmap_options = xCAT::TableUtils->get_site_attribute("nmapoptions");
my $more_options = $nmap_options[0];
#call namp
open (NMAP, "nmap -PE --system-dns --send-ip -sP $more_options ". $nodes . " 2> /dev/null|") or die("Cannot open nmap pipe: $!");
my $node;
while (<NMAP>) {
if (/Host (.*) \(.*\) appears to be up/) {
@@ -2478,6 +2428,105 @@ 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=$nicname:$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 -5
View File
@@ -311,9 +311,6 @@ sub notify {
my ($modname, $path, $suffix) = fileparse($_, ".pm");
# print "modname=$modname, path=$path, suffix=$suffix\n";
if ($suffix =~ /.pm/) { #it is a perl module
my $pid;
if ($pid=xCAT::Utils->xfork()) { }
elsif (defined($pid)) {
my $fname;
if (($path eq "") || ($path eq ".\/")) {
#default path is /opt/xcat/lib/perl/xCAT_monitoring/ if there is no path specified
@@ -328,8 +325,7 @@ sub notify {
else {
${"xCAT_monitoring::".$modname."::"}{processTableChanges}->($action, $tablename, $old_data, $new_data);
}
exit 0;
}
return 0;
}
else { #it is a command
my $pid;
+23 -2
View File
@@ -21,7 +21,6 @@ sub parse_args {
my %opt = ();
my $cmd = $request->{command};
my $args = $request->{arg};
my @VERSION = qw( 2.1 );
#############################################
# Responds with usage statement
@@ -60,7 +59,8 @@ sub parse_args {
# Option -v for version
####################################
if ( exists( $opt{v} )) {
return( \@VERSION );
my $version = xCAT::Utils->Version();
return ([$version]);
}
if ( exists( $opt{s} ) ){
@@ -350,6 +350,27 @@ sub do_rnetboot {
last;
}
}
# Set the boot mode to norm from 'of' (open firmware)
# NOW, only necessary for IVM
my $hwtype = @$exp[2];
if ($hwtype eq "ivm") {
my $server = @$exp[3];
# creat connection first
my @newexp = xCAT::PPCcli::connect( $request, $hwtype, $server );
if (ref($newexp[0]) eq "Expect" ) {
my $cfg = "lpar_id=@$d[0],boot_mode=norm";
# change the boot mode to 'norm'
xCAT::PPCcli::chsyscfg(\@newexp, "prof", $d, $cfg);
xCAT::PPCcli::disconnect(\@newexp);
} else {
my $rsp;
$rsp->{data} = ["Failed to set the boot mode to normal. For rnetboot command, you have to rpower off and then on the node after finishing the OS deployment."];
xCAT::MsgUtils->message("E", $rsp, $request->{callback});
}
}
return $result;
}
+3 -3
View File
@@ -436,9 +436,9 @@ sub sshcfg {
#####################################
# userid@host not found in key file
#####################################
if ( $sshkey !~ /\s+(\S+\@\S+$)/ ) {
return( [[$server,"Cannot find userid\@host in '$fname'",RC_ERROR]] );
}
#if ( $sshkey !~ /\s+(\S+\@\S+$)/ ) {
# return( [[$server,"Cannot find userid\@host in '$fname'",RC_ERROR]] );
#}
my $logon = $1;
#####################################
+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;
+8 -2
View File
@@ -75,6 +75,7 @@ sub add_ppc {
my $values = shift;
my $not_overwrite = shift;
my $otherinterfaces = shift;
my $callfile = shift;
my @tabs = qw(ppc vpd nodehm nodelist nodetype hosts mac);
my %db = ();
###################################
@@ -119,7 +120,12 @@ sub add_ppc {
# Specify CEC and Frame's mgt as fsp and bpa
if ( $type =~ /^cec$/) {
$mgt = "fsp";
if ( $callfile eq "PPC" ) {
$mgt = "hmc";
}
if ( $callfile eq "FSP" ) {
$mgt = "fsp";
}
}
if ( $type =~ /^frame$/) {
$mgt = "bpa";
@@ -320,7 +326,7 @@ sub update_lpar {
}
}
if (defined($write)) {
&add_ppc($hwtype, \@write_list);
&add_ppc($hwtype, \@write_list,'','',"FSP");
return ([@update_list,@write_list]);
} else {
foreach ( @tabs ) {
+21 -22
View File
@@ -14,7 +14,7 @@ use xCAT::Usage;
use xCAT::NodeRange;
use xCAT::DBobjUtils;
use xCAT::FSPUtils;
use xCAT::TableUtils qw(get_site_Master);
use xCAT::TableUtils;
%::QUERY_ATTRS = (
'savingstatus' => 1,
'dsavingstatus' => 1,
@@ -223,7 +223,6 @@ sub renergy {
my ($node, $attrs) = %$nodehash;
my $cec_name = @$attrs[2];
my $hw_type = @$attrs[4];
if (!$cec_name) {
return ([[$node, "ERROR: Cannot find the cec name, check the attributes: vpd.serial, vpd.mtm.", 1]]);
@@ -295,43 +294,43 @@ sub renergy {
foreach (@hcps_ip) {
$deadnodes{$_}=1;
}
open (NMAP, "nmap -PE --system-dns --send-ip -sP ". join(' ',@hcps_ip) . " 2> /dev/null|") or die("Cannot open nmap pipe: $!");
my $node1;
my $msg1;
# get additional options from site table
my @nmap_options = xCAT::TableUtils->get_site_attribute("nmapoptions");
my $more_options = $nmap_options[0];
open (NMAP, "nmap -PE --system-dns --send-ip -sP $more_options ". join(' ',@hcps_ip) . " 2> /dev/null|") or die("Cannot open nmap pipe: $!");
my $node;
while (<NMAP>) {
#print "$_\n";
if (/Host (.*) \((.*)\) appears to be up/) {
$node1=$2;
unless ($deadnodes{$node1}) {
$node=$2;
unless ($deadnodes{$node}) {
foreach (keys %deadnodes) {
if ($node1 =~ /^$_\./) {
$node1 = $_;
if ($node =~ /^$_\./) {
$node = $_;
last;
}
}
}
delete $deadnodes{$node1};
delete $deadnodes{$node};
if ($verbose) {
push @return_msg, [$node, $_, 0];
}
push(@pingable_hcp, $node1);
} elsif (/Nmap scan report for ([^ ]*) \((.*)\)/) {
$node1=$2;
$msg1=$_;
push(@pingable_hcp, $node);
} elsif (/Nmap scan report for ([^ ]*)/) {
$node=$1;
} elsif (/Host is up./) {
unless ($deadnodes{$node1}) {
unless ($deadnodes{$node}) {
foreach (keys %deadnodes) {
if ($node1 =~ /^$_\./) {
$node1 = $_;
if ($node =~ /^$_\./) {
$node = $_;
last;
}
}
}
delete $deadnodes{$node1};
if ($verbose) {
push @return_msg, [$node, "$msg1$_", 0];
}
push(@pingable_hcp, $node1);
delete $deadnodes{$node};
push(@pingable_hcp, $node);
}
}
} else {
+10 -6
View File
@@ -144,12 +144,16 @@ sub connect {
##################################
# Set options
##################################
my $hosttab = xCAT::Table->new( 'hosts' );
if ( $hosttab) {
my $hostshash = $hosttab->getNodeAttribs( $server, [qw(ip otherinterfaces)]);
if ( $hostshash ) {
$server = $hostshash->{ip};
}
#my $hosttab = xCAT::Table->new( 'hosts' );
#if ( $hosttab) {
# my $hostshash = $hosttab->getNodeAttribs( $server, [qw(ip otherinterfaces)]);
# if ( $hostshash ) {
# $server = $hostshash->{ip};
# }
#}
$server = xCAT::NetworkUtils::getNodeIPaddress( $server );
unless ($server) {
return( "Unable to get IP address for $server" );
}
# my $serverip = inet_ntoa(inet_aton($server));
my $url = "https://$server/cgi-bin/cgi?form=2";
+2 -2
View File
@@ -347,7 +347,7 @@ sub bus {
#################################
# Output header
#################################
push @result, [$name,"I/O Bus Information"];
push @result, [$name,"I/O Bus Information", 0];
#################################
# Output error
@@ -532,7 +532,7 @@ sub config {
#################################
# Output header
#################################
push @result, [$name,"Machine Configuration Info"];
push @result, [$name,"Machine Configuration Info", 0];
my $i;
foreach ( @prefix ) {
+37 -10
View File
@@ -555,6 +555,9 @@ sub getmacs {
} else {
$type = "virtualio";
}
if ($mac_addr) {
$mac_addr = format_mac($mac_addr);
}
my %att = ();
$att{'MAC_Address'} = ($mac_addr) ? $mac_addr : "N/A";
@@ -627,9 +630,9 @@ sub getmacs {
}
foreach ( @$value ) {
if ( /^#\s?Type/ ) {
$data.= "\n$_\n";
$data.= "\n$_\n";
} else {
$data.= format_mac( $_ );
$data.= "$_\n";
}
}
@@ -756,7 +759,7 @@ sub getmacs {
if ( /^#\s?Type/ ) {
$data.= "\n$_\n";
} elsif ( /^ent\s+/ or /^hfi-ent\s+/ ) {
$data.= format_mac( $_ );
$data.= "$_\n";
}
}
#####################################
@@ -801,10 +804,8 @@ sub cal_mac {
##########################################################################
sub format_mac {
my $data = shift;
my $mac = shift;
$data =~ /^(\S+\s+\S+\s+)(\S+)(\s+.*)$/;
my $mac = $2;
#####################################
# Get adapter mac
#####################################
@@ -813,6 +814,10 @@ sub format_mac {
if ( !xCAT::Utils->isAIX() ) {
foreach my $mac_a ( @macs ) {
if (&checkmac($mac_a)) {
push @newmacs, $mac_a;
next;
}
#################################
# Delineate MAC with colons
#################################
@@ -821,14 +826,30 @@ sub format_mac {
$mac_a =~ s/:$//;
push @newmacs, $mac_a;
}
my $newmac = join("|",@newmacs);
$data =~ s/$mac/$newmac/;
$mac = join("|",@newmacs);
}
return( "$data\n" );
return( "$mac\n" );
}
##########################################################################
# checkmac format
##########################################################################
sub checkmac {
my $mac = shift;
if ( !xCAT::Utils->isAIX()) {
if ($mac =~ /\w{2}:\w{2}:\w{2}:\w{2}:\w{2}:\w{2}/) {
return 1;
} else {
return 0;
}
} else {
return 1;
}
}
##########################################################################
# Write first valid adapter MAC to database
@@ -847,6 +868,9 @@ sub writemac {
# Find first valid adapter
#####################################
foreach ( @$data ) {
unless (&checkmac($_)) {
next;
}
if ( /^ent\s+/ or /^hfi-ent\s+/ ) {
$value = $_;
#####################################
@@ -869,6 +893,9 @@ sub writemac {
#####################################
if ( $pingret ne "successful" ) {
foreach ( @$data ) {
unless (&checkmac($_)) {
next;
}
if ( /^ent\s+/ or /^hfi-ent\s+/ ) {
$value = $_;
$ping_test = 0;
@@ -890,7 +917,7 @@ sub writemac {
#####################################
# Get adapter mac
#####################################
$value = format_mac( $value );
#$value = format_mac( $value );
@fields = split /\s+/, $value;
$mac = $fields[2];
+1 -1
View File
@@ -411,7 +411,7 @@ sub format_output {
# Strip errors for results
#######################################
my @val = grep( !/^#.*: ERROR /, @$values );
xCAT::PPCdb::add_ppc( $hwtype, \@val );
xCAT::PPCdb::add_ppc( $hwtype, \@val ,'','',"PPC");
}
###########################################
+4 -4
View File
@@ -203,7 +203,7 @@ sub voltage {
# Voltages available in frame
#################################
if ( @$d[4] ne "bpa" ) {
push @result, [$name,"$text Only available for BPA",1];
push @result, [$name,"$text Only available for BPA",0];
next;
}
my $volt = enumerate_volt( $exp, $d );
@@ -256,7 +256,7 @@ sub temp {
# No frame commands for IVM
#################################
if ( $hwtype eq "ivm" ) {
push @result, [$name,"$prefix Not available (No BPA)",1];
push @result, [$name,"$prefix Not available (No BPA)",0];
next;
}
#################################
@@ -264,14 +264,14 @@ sub temp {
#################################
if ( @$d[4] !~ /^(fsp|cec|lpar)$/ ) {
my $text = "$prefix Only available for CEC/LPAR";
push @result, [$name,$text,1];
push @result, [$name,$text,0];
next;
}
#################################
# Error - No frame
#################################
if ( $mtms eq "0" ) {
push @result, [$name,"$prefix Not available (No BPA)",1];
push @result, [$name,"$prefix Not available (No BPA)",0];
next;
}
#################################
+1 -1
View File
@@ -1913,7 +1913,7 @@ sub xCATdB {
$profile,
$parent );
return( xCAT::PPCdb::add_ppc( $hwtype, [$values] ));
return( xCAT::PPCdb::add_ppc( $hwtype, [$values],'','',"PPC" ));
}
return undef;
}
+456 -47
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;
@@ -653,6 +666,39 @@ sub get_all_cecs
}
}
#-------------------------------------------------------------------------------
=head3 get_all_lparids
Description : Get all LPAR ids in system.
Arguments : ref of all cecs
Returns : ref for LPAR ids hash.
Example :
my $arrayref = xCAT::ProfiledNodeUtils->get_all_lparids(\%allcecs);
=cut
#-------------------------------------------------------------------------------
sub get_all_lparids
{
my $class= shift;
my $cecsref = shift;
my %allcecs = %$cecsref;
my %lparids;
my $ppctab = xCAT::Table->new('ppc');
foreach my $cec (keys %allcecs) {
my @ids = $ppctab->getAllAttribsWhere("hcp = '$cec'", 'id');
foreach (@ids) {
if ( $_->{'id'} ){
$lparids{$cec}{$_->{'id'}} = 0;
}
}
}
$ppctab->close();
return \%lparids;
}
#-------------------------------------------------------------------------------
=head3 is_discover_started
@@ -690,6 +736,7 @@ sub get_nodes_profiles
{
my $class = shift;
my $nodelistref = shift;
my $groupnamemode = shift;
my %profile_dict;
my $nodelisttab = xCAT::Table->new('nodelist');
@@ -709,8 +756,12 @@ sub get_nodes_profiles
if ( $idx == 2 ){
# The group string will like @NetworkProfile_<profile name>
# So, index should +3, 2 for '__', 1 for _.
my $append_index = length($profile) + 3;
$profile_dict{$_}{$profile} = substr $group, $append_index;
if ($groupnamemode) {
$profile_dict{$_}{$profile} = $group;
} else{
my $append_index = length($profile) + 3;
$profile_dict{$_}{$profile} = substr $group, $append_index;
}
last;
}
}
@@ -719,28 +770,6 @@ sub get_nodes_profiles
return \%profile_dict;
}
#-------------------------------------------------------------------------------
=head3 get_imageprofile_prov_osvers
Description : Get A node's provisioning os version and profile from its imageprofile attribute.
Arguments : $imgprofilename - imageprofile name
Returns : node's osversion and profile
=cut
#-------------------------------------------------------------------------------
sub get_imageprofile_prov_osvers
{
my $class = shift;
my $imgprofilename = shift;
my $osimgtab = xCAT::Table->new('osimage');
my $osimgentry = ($osimgtab->getAllAttribsWhere("imagename = '$imgprofilename'", 'ALL' ))[0];
my $osversion = $osimgentry->{'osvers'};
my $profile = $osimgentry->{'profile'};
return ($osversion, $profile);
}
#-------------------------------------------------------------------------------
=head3 get_imageprofile_prov_method
@@ -761,7 +790,7 @@ sub get_imageprofile_prov_method
my $nodetypestab = xCAT::Table->new('nodetype');
my $entry = ($nodetypestab->getAllAttribsWhere("node = '$imgprofilename'", 'ALL' ))[0];
my $osimgname = $entry->{'provmethod'};
return $entry->{'provmethod'};
#my $osimgtab = xCAT::Table->new('osimage');
#my $osimgentry = ($osimgtab->getAllAttribsWhere("imagename = '$osimgname'", 'ALL' ))[0];
@@ -770,6 +799,27 @@ sub get_imageprofile_prov_method
#-------------------------------------------------------------------------------
=head3 get_imageprofile_prov_osvers
Description : Get A node's provisioning os version and profile from its imageprofile attribute.
Arguments : $imgprofilename - imageprofile name
Returns : node's osversion and profile
=cut
#-------------------------------------------------------------------------------
sub get_imageprofile_prov_osvers
{
my $class = shift;
my $imgprofilename = shift;
my $osimgtab = xCAT::Table->new('osimage');
my $osimgentry = ($osimgtab->getAllAttribsWhere("imagename = '$imgprofilename'", 'ALL' ))[0];
my $osversion = $osimgentry->{'osvers'};
my $profile = $osimgentry->{'profile'};
return ($osversion, $profile);
}
#-------------------------------------------------------------------------------
=head3 check_profile_consistent
Description : Check if three profile consistent
Arguments : $imageprofile - image profile name
@@ -801,16 +851,20 @@ sub check_profile_consistent{
}
}
# Profile consistent keys, arch=>netboot, mgt=>nictype
my %profile_dict = ('x86' => 'xnba','x86_64' => 'xnba', 'ppc64' => 'yaboot',
'fsp' => 'FSP', 'ipmi' => 'BMC');
# Get Imageprofile arch
my $nodetypetab = xCAT::Table->new('nodetype');
my $nodetypeentry = $nodetypetab->getNodeAttribs($imageprofile, ['arch']);
my $nodetypeentry = $nodetypetab->getNodeAttribs($imageprofile, ['os','arch']);
my $os = $nodetypeentry->{'os'};
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']);
@@ -842,16 +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');
# 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
@@ -861,24 +932,29 @@ sub check_profile_consistent{
return 0, "$nictype networkprofile must use with hardwareprofile.";
}
}
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, "";
}
@@ -920,6 +996,72 @@ sub is_fsp_node
#-------------------------------------------------------------------------------
=head3 is_kvm_node
Description : Judge whether nodes are KVM nodes.
Arguments : $hardwareprofile - hardwareprofile name
Returns : 1 - KVM nodes
0 - Not KVM nodes
=cut
#-------------------------------------------------------------------------------
sub is_kvm_node
{
my $class = shift;
my $hardwareprofile = shift;
if (not $hardwareprofile) {
return 0;
}
#Get hardwareprofile mgt
my $nodehmtab = xCAT::Table->new('nodehm');
my $mgtentry = $nodehmtab->getNodeAttribs($hardwareprofile, ['mgt']);
my $mgt = undef;
$mgt = $mgtentry->{'mgt'} if ($mgtentry->{'mgt'});
$nodehmtab->close();
if ($mgt eq 'kvm') {
return 1;
}
return 0;
}
#-------------------------------------------------------------------------------
=head3 is_kvm_hypv_node
Description : Judge whether nodes are KVM nodes.
Arguments : $imageprofile - imageprofile name
Returns : 1 - KVM hypervisor nodes
0 - Not KVM hypervisor nodes
=cut
#-------------------------------------------------------------------------------
sub is_kvm_hypv_node
{
my $class = shift;
my $imageprofile = shift;
# Get provmethod
my $provmethod = xCAT::ProfiledNodeUtils->get_imageprofile_prov_method($imageprofile);
unless ($provmethod ){
return 0;
}
my $osimage_tab = xCAT::Table->new('osimage');
my $osimage_tab_entry = $osimage_tab->getAttribs({'imagename'=> $provmethod},('osdistroname'));
my $osdistroname = $osimage_tab_entry->{'osdistroname'};
$osimage_tab->close();
if ($osdistroname and $osdistroname =~ /^pkvm/ ) {
return 1;
}
return 0;
}
#-------------------------------------------------------------------------------
=head3 get_nodes_cmm
Description : Get the CMM of nodelist
Arguments : $nodelist - the ref of node list array
@@ -1140,3 +1282,270 @@ sub check_nicips{
return (0, \%nics_hash, "");
}
#-------------------------------------------------------------------------------
=head3 gen_chain_for_profiles
Description: Generate a chain string based on Network/Hardware/Image profiles.
Arguments: $profiles_hash: The reference for profiles hash.
For example:
$profiles_hash = { 'HardwareProfile' => 'IBM_NeXtScale_M4',
'ImageProfile' => 'rhels6.5-x86_64-stateful-compute',
'NetworkProfile' => 'default_network_profile',
}
$hw_reconfig: the flag shows whether we need re-configure all hardware
relative settings or not: like runcmds, runimg...etc
Returns: ($retcode, $chain)
$retcode = 1. Generate chain failed, $chain stands for error message.
$retcode = 0. Generate chain OK. $chain stands for the chain string.
=cut
#-------------------------------------------------------------------------------
sub gen_chain_for_profiles{
my $class = shift;
my $profiles_hashref = shift;
my $hw_reconfig = shift;
my $final_chain = "";
if (! $profiles_hashref){
return (1, "Missing parameter for gen_chain_for_profiles.");
}
# A node must have at least imageprofile and network profile.
unless (defined $profiles_hashref->{'ImageProfile'}){
return (1, "No imageprofile specified in profiles hash.");
}
unless (defined $profiles_hashref->{'NetworkProfile'}){
return (1, "No networkprofile specified in profiles hash.");
}
my $hwprofile = $profiles_hashref->{'HardwareProfile'};
my $imgprofile = $profiles_hashref->{'ImageProfile'};
my $netprofile = $profiles_hashref->{'NetworkProfile'};
# Get node's provisioning method
my $provmethod = xCAT::ProfiledNodeUtils->get_imageprofile_prov_method($imgprofile);
unless ($provmethod ){
return (1, "Can not get provisioning method for image profile $imgprofile");
}
my $netprofileattr = xCAT::ProfiledNodeUtils->get_nodes_nic_attrs([$netprofile])->{$netprofile};
unless ($netprofileattr){
return (1, "Can not get attributes for network profile $netprofile");
}
# Get node's netboot attribute
my ($retcode, $retval) = xCAT::ProfiledNodeUtils->get_netboot_attr($imgprofile, $hwprofile);
if (not $retcode) {
return (1, $retval);
}
my $netboot = $retval;
$final_chain = 'osimage='.$provmethod.":--noupdateinitrd";
# get the chain attribute from hardwareprofile and insert it to node.
if (defined $hwprofile and $hwprofile and $hw_reconfig){
my $chaintab = xCAT::Table->new('chain');
my $chain = $chaintab->getNodeAttribs($hwprofile, ['chain']);
if (exists $chain->{'chain'}) {
my $hw_chain = $chain->{'chain'};
$final_chain = $hw_chain.',osimage='.$provmethod.":--noupdateinitrd";
}
}
#run bmcsetups.
#PowerNV nodes can't use 'runcmd=bmcsetup' to set BMC.
if ((exists $netprofileattr->{"bmc"}) and $hw_reconfig and $netboot ne 'petitboot'){
if (index($final_chain, "runcmd=bmcsetup") == -1){
$final_chain = 'runcmd=bmcsetup,'.$final_chain.':reboot4deploy';
}
else{
$final_chain = $final_chain.':reboot4deploy';
}
}
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."
}
}
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';
}
# Identify whether this node is PowerKVM or PowerNV if os arch is ppc64le
# If hardware profile is defined
my $mgt = '*';
if ($os_arch eq 'ppc64le' and $hardwareprofile ne '*') {
my $nodehmtab = xCAT::Table->new('nodehm');
my $nodehmtab_entry = $nodehmtab->getNodeAttribs($hardwareprofile, ['mgt']);
if (defined $nodehmtab_entry->{'mgt'}) {
$mgt = $nodehmtab_entry->{'mgt'};
}
}
# 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 | Management method | Noderes.netboot |
# 1 | x86_64/x86 | * | * | * | xnba |
# 2 | ppc64 | rhels | 7 | * | grub2 |
# 2 | ppc64 | pkvm | * | * | petitboot |
# 3 | | * | * | * | yaboot |
# 4 | ppc64le/el | * | * | * | grub2
# 4 | ppc64le/el | * | * | ipmi | petitboot
# arch osname version hardware netboot
my %netboot_dict = ( 'x86_64' => 'xnba',
'ppc64' => {
'rhels' => {
'7' => 'grub2',
'*' => 'yaboot',
},
'pkvm' => 'petitboot',
'*' => 'yaboot',
},
'ppc64le' => {
'*' => {
'*' => {
'*' => 'grub2',
'ipmi' => 'petitboot',
},
},
},
);
my $condition_array_ref = [$os_arch, $os_name, $os_major_version, $mgt];
$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;
}
}
+4
View File
@@ -810,6 +810,10 @@ sub senddeviceskeys
# add to the command
$setupcmd .=$key;
$setupcmd .="\"";
# Special case for vios
if ($ENV{DEVICETYPE} eq 'vios') {
$setupcmd = "\"echo $key | tee -a ~/.ssh/authorized_keys2\"";
}
# For each input device
my @nodelist=split(/,/,$nodes);
foreach my $node (@nodelist) {
+8 -4
View File
@@ -116,6 +116,9 @@ sub dodiscover {
send_message($args{reqcallback}, 0, "The rarge is too large and may be time consuming. Broadcast is recommended.");
}
}
#no need to check site.nmapoptions because it specifilly
# uses T5 for certain performance requirement.
`/usr/bin/nmap $range -sn -PE -n --send-ip -T5 `;
my $nmapres = `/usr/bin/nmap $range -PE -p 427 -n --send-ip -T5 `;
foreach my $line (split(/\n\n/,$nmapres)) {
@@ -287,7 +290,7 @@ sub dodiscover {
if ($rethash{$peername}) {
next; #got a dupe, discard
}
my $result = process_slp_packet(packet=>$slpkg,sockaddr=>$pkg,'socket'=>$args{'socket'});
my $result = process_slp_packet(packet=>$slpkg,sockaddr=>$pkg,'socket'=>$args{'socket'}, peername=>$peername, callback=>$args{reqcallback});
if ($result) {
if ($peername =~ /\./) { #ipv4
$peername =~ s/::ffff://;
@@ -371,9 +374,10 @@ sub process_slp_packet {
if ($parsedpacket->{FunctionId} == 2) {#Service Reply
parse_service_reply($parsedpacket->{payload},$parsedpacket);
unless (ref $parsedpacket->{service_urls} and scalar @{$parsedpacket->{service_urls}}) { return undef; }
if ($parsedpacket->{attributes}) { #service reply had ext
return $parsedpacket; #don't bother sending attrrequest, already got it in first packet
if ($parsedpacket->{attributes} && get_mac_for_addr($args{peername})) {
#service reply had ext. Stop here if has gotten attributes and got mac.
#continue the unicast request for service attributes if cannot find mac for peernode
return $parsedpacket; #don't bother sending attrrequest, already got it in first packet
}
my $srvtype = $xid_to_srvtype_map{$parsedpacket->{Xid}};
my $packet = generate_attribute_request(%args,SrvType=>$srvtype);
+68 -10
View File
@@ -650,7 +650,8 @@ sub decode_spd {
8 => "DDR2 SDRAM",
9 => "DDR2 SDRAM FB-DIMM",
10 => "DDR2 SDRAM FB-DIMM PROBE",
11 => "DDR3 SDRAM"
11 => "DDR3 SDRAM",
12 => "DDR4 SDRAM",
);
my %modtypes = (
@@ -668,33 +669,35 @@ sub decode_spd {
1333 => 10600,
1600 => 12800,
1867 => 14900,
2132 => 17000,
2133 => 17000,
2134 => 17000,
);
my %ddr3modcap = (
my %ddrmodcap = (
0 => 256,
1 => 512,
2 => 1024,
3 => 2048,
4 => 4096,
5 => 8192,
6 => 16384
6 => 16384,
7 => 32768,
);
my %ddr3devwidth = (
my %ddrdevwidth = (
0 => 4,
1 => 8,
2 => 16,
3 => 32
);
my %ddr3ranks = (
my %ddrranks = (
0 => 1,
1 => 2,
2 => 3,
3 => 4
);
my %ddr3buswidth = (
my %ddrbuswidth = (
0 => 8,
1 => 16,
2 => 32,
@@ -728,10 +731,10 @@ sub decode_spd {
$rethash->{product}->{name} .= " ECC";
}
$rethash->{product}->{name}.=" ".$modtypes{$spd[3]&0x0f};
my $sdramcap=$ddr3modcap{$spd[4]&0xf};
my $buswidth=$ddr3buswidth{$spd[8]&0b111};
my $sdramwidth=$ddr3devwidth{$spd[7]&0b111};
my $ranks = $ddr3ranks{($spd[7]&0b111000)>>3};
my $sdramcap=$ddrmodcap{$spd[4]&0xf};
my $buswidth=$ddrbuswidth{$spd[8]&0b111};
my $sdramwidth=$ddrdevwidth{$spd[7]&0b111};
my $ranks = $ddrranks{($spd[7]&0b111000)>>3};
my $capacity = $sdramcap/8*$buswidth/$sdramwidth*$ranks;
@@ -769,6 +772,61 @@ sub decode_spd {
# $rawspd .= sprintf("%02X ",$_);
#}
#push @{$rethash->{product}->{extra}},$rawspd;
} elsif ($spd[2] == 12) { #DDR4 spec applies
# spd[125] spd[18] spd[18is sdram min cycle time .. spd125 is fine offset for min time
# mtb and ftb are fixed in ddr4 spd spec.. mtb is always 0.125 ns and ftb is always 0.001 ns
my $speed;
my $clock;
if ($spd[17] == 0) {
my $fineoffset = $spd[125];
if ($fineoffset & 0b10000000) {
#negative value, twos complement
$fineoffset = 0-(($fineoffset ^ 0xff) + 1);
}
$clock = int(2/((0.125*$spd[18] + $fineoffset*0.001)*0.001));
$speed = $speedfromclock{$clock};
unless ($speed) { $speed = "UNKNOWN"; }
} else { # this would mean a different MTB and FTB than spec indicated..
$clock = "UNKNOWN";
$speed = "UNKNOWN";
}
$rethash->{product}->{name}="PC4-".$speed." ($clock MT/s)";
if ($spd[13]&0b11000 == 0b1000) {
$rethash->{product}->{name} .= " ECC";
}
$rethash->{product}->{name}.=" ".$modtypes{$spd[3]&0x0f};
my $sdramcap=$ddrmodcap{$spd[4]&0xf};
my $buswidth=$ddrbuswidth{$spd[13]&0b111};
my $sdramwidth=$ddrdevwidth{$spd[12]&0b111};
my $ranks = $ddrranks{($spd[12]&0b111000)>>3};
my $capacity = $sdramcap/8*$buswidth/$sdramwidth*$ranks;
if ($capacity < 1024) {
$capacity = $capacity."MB";
} else {
$capacity = ($capacity/1024)."GB";
}
$rethash->{product}->{name} = $capacity." ".$rethash->{product}->{name};
$rethash->{product}->{manufacturer} = decode_manufacturer($spd[320],$spd[321]);
$rethash->{product}->{buildlocation} = sprintf("%02x",$spd[322]);
if ($spd[120] != 0 or $spd[121] != 0) {
$rethash->{product}->{builddate} = sprintf("Week %x of 20%02x",$spd[323],$spd[324]);
}
foreach (@spd[329..348]) {
if ($_ > 126 or $_ < 32) {
$rethash->{product}->{model}="Malformed SPD";
}
}
unless ($rethash->{product}->{model}) {
$rethash->{product}->{model}=pack("C*",@spd[329..348]);
}
#my $rawspd="SPD Dump: ";
#foreach (@spd) {
# $rawspd .= sprintf("%02X ",$_);
#}
#push @{$rethash->{product}->{extra}},$rawspd;
} else {
$rethash->{product}->{model}="Unrecognized SPD";
}
+107 -25
View File
@@ -326,7 +326,7 @@ bootparams => {
'kernel' => 'The kernel that network boot actions should currently acquire and use. Note this could be a chained boot loader such as memdisk or a non-linux boot loader',
'initrd' => 'The initial ramdisk image that network boot actions should use (could be a DOS floppy or hard drive image if using memdisk as kernel)',
'kcmdline' => 'Arguments to be passed to the kernel',
'addkcmdline' => 'User specified one or more parameters to be passed to the kernel',
'addkcmdline' => 'User specified one or more parameters to be passed to the kernel. For the kernel options need to be persistent after installation, specify them with prefix "R::"',
'dhcpstatements' => 'xCAT manipulated custom dhcp statements (not intended for user manipulation)',
'adddhcpstatements' => 'Custom dhcp statements for administrator use (not implemneted yet)',
comments => 'Any user-written notes.',
@@ -393,7 +393,46 @@ ipmi => {
descriptions => {
node => 'The node name or group name.',
bmc => 'The hostname of the BMC adapater.',
bmcport => 'In systems with selectable shared/dedicated ethernet ports, this parameter can be used to specify the preferred port. 0 means use the shared port, 1 means dedicated, blank is to not assign',
bmcport => ' In systems with selectable shared/dedicated ethernet ports,
this parameter can be used to specify the preferred port. 0
means use the shared port, 1 means dedicated, blank is to not
assign.
The following special cases exist for IBM System x servers:
For x3755 M3 systems, 0 means use the dedicated port, 1 means
shared, blank is to not assign.
For certain systems which have a mezzaine or ML2 adapter, there is a second
value to include:
For x3750 M4 (Model 8722):
0 2 1st 1Gbps interface for LOM
0 0 1st 10Gbps interface for LOM
0 3 2nd 1Gbps interface for LOM
0 1 2nd 10Gbps interface for LOM
For x3750 M4 (Model 8752), x3850/3950 X6, dx360 M4, x3550 M4, and x3650 M4:
0 Shared (1st onboard interface)
1 Dedicated
2 0 First interface on ML2 or mezzanine adapter
2 1 Second interface on ML2 or mezzanine adapter
2 2 Third interface on ML2 or mezzanine adapter
2 3 Fourth interface on ML2 or mezzanine adapter',
taggedvlan => 'Have bmcsetup place the BMC on the specified vlan tag on a shared netwirk interface. Some network devices may be incompatible with this option',
bmcid => 'Unique identified data used by discovery processes to distinguish known BMCs from unrecognized BMCs',
username => 'The BMC userid. If not specified, the key=ipmi row in the passwd table is used as the default.',
@@ -503,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.',
@@ -604,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.',
@@ -689,7 +728,7 @@ osimage => {
description => 'OS Image Description',
provmethod => 'The provisioning method for node deployment. The valid values are install, netboot,statelite,boottarget,dualboot,sysclone. If boottarget is set, you must set linuximage.boottarget to the name of the boottarget definition. It is not used by AIX.',
rootfstype => 'The filesystem type for the rootfs is used when the provmethod is statelite. The valid values are nfs or ramdisk. The default value is nfs',
osdistroname => 'The name of the OS distro definition. This attribute can be used to specify which OS distro to use, instead of using the osname,osvers,and osarch attributes.',
osdistroname => 'The name of the OS distro definition. This attribute can be used to specify which OS distro to use, instead of using the osname,osvers,and osarch attributes. For *kit commands, the attribute will be used to read the osdistro table for the osname, osvers, and osarch attributes. If defined, the osname, osvers, and osarch attributes defined in the osimage table will be ignored.',
osupdatename => 'A comma-separated list of OS distro updates to apply to this osimage.',
cfmdir => 'CFM directory name for PCM. Set to /install/osimages/<osimage name>/cfmdir by PCM. ',
profile => 'The node usage category. For example compute, service.',
@@ -713,16 +752,16 @@ linuximage => {
table_desc => 'Information about a Linux operating system image that can be used to deploy cluster nodes.',
descriptions => {
imagename => 'The name of this xCAT OS image definition.',
template => 'The fully qualified name of the template file that is used to create the kick start file for diskful installation.',
template => 'The fully qualified name of the template file that will be used to create the OS installer configuration file for stateful installations (e.g. kickstart for RedHat, autoyast for SLES).',
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.',
addkcmdline=> 'User specified arguments to be passed to the kernel. The user arguments are appended to xCAT.s default kernel arguments. For the kernel options need to be persistent after installation, specify them with prefix "R::". 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. ',
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.',
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. It could be set multiple paths.The multiple paths must be seperated by ",".',
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 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 could be set multiple paths.The multiple paths must be seperated by ",". 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/',
kerneldir => 'The directory name where the 3rd-party kernel is stored. It is used for diskless image only.',
nodebootif => 'The network interface the stateless/statelite node will boot over (e.g. eth0)',
otherifce => 'Other network interfaces (e.g. eth1) in the image that should be configured via DHCP',
@@ -732,7 +771,7 @@ linuximage => {
permission => 'The mount permission of /.statelite directory is used, its default value is 755',
dump => qq{The NFS directory to hold the Linux kernel dump file (vmcore) when the node with this image crashes, its format is "nfs://<nfs_server_ip>/<kdump_path>". If you want to use the node's "xcatmaster" (its SN or MN), <nfs_server_ip> can be left blank. For example, "nfs:///<kdump_path>" means the NFS directory to hold the kernel dump file is on the node's SN, or MN if there's no SN.},
crashkernelsize => 'the size that assigned to the kdump kernel. If the kernel size is not set, 256M will be the default value.',
partitionfile => 'The path of the configuration file which is used to part the disk for the node. For stateful: two types of value can be set for this attribute. One is "<partition file absolute path>", the content of the partition file must use the corresponding format with the OS type. The other one is "s:<partition file absolute path>", the content of the partition file should be a shell script which must write the partition definition into /tmp/partitionfile on the node. For statelite: the valid value is <partition file absolute path>, refer to the statelite doc for the xCAT defined format of the configuration file.',
partitionfile => 'The path of the configuration file which will be used to partition the disk for the node. For stateful osimages,two types of files are supported: "<partition file absolute path>" which contains a partitioning definition that will be inserted directly into the generated autoinst configuration file and must be formatted for the corresponding OS installer (e.g. kickstart for RedHat, autoyast for SLES). "s:<partitioning script absolute path>" which specifies a shell script that will be run from the OS installer configuration file %pre section; the script must write the correct partitioning definition into the file /tmp/partitionfile on the node which will be included into the configuration file during the install process. For statelite osimages, partitionfile should specify "<partition file absolute path>"; see the xCAT Statelite documentation for the xCAT defined format of this configuration file.',
driverupdatesrc => 'The source of the drivers which need to be loaded during the boot. Two types of driver update source are supported: Driver update disk and Driver rpm package. The value for this attribute should be comma separated sources. Each source should be the format tab:full_path_of_srouce_file. The tab keyword can be: dud (for Driver update disk) and rpm (for driver rpm). If missing the tab, the rpm format is the default. e.g. dud:/install/dud/dd.img,rpm:/install/rpm/d.rpm',
comments => 'Any user-written notes.',
disable => "Set to 'yes' or '1' to comment out this row.",
@@ -747,7 +786,7 @@ winimage => {
imagename => 'The name of this xCAT OS image definition.',
template => 'The fully qualified name of the template file that is used to create the windows unattend.xml file for diskful installation.',
installto => 'The disk and partition that the Windows will be deployed to. The valid format is <disk>:<partition>. If not set, default value is 0:1 for bios boot mode(legacy) and 0:3 for uefi boot mode; If setting to 1, it means 1:1 for bios boot and 1:3 for uefi boot',
partitionfile => 'The path of partition configuration file. Since the partition configuration for bios boot mode and uefi boot mode are different, this configuration file should include two parts if customer wants to support both bios and uefi mode. If customer just wants to support one of the modes, specify one of them anyway. Example of partition configuration file: [BIOS]xxxxxxx[UEFI]yyyyyyy. To simplify the setting, you also can set installto in partitionfile with section likes [INSTALLTO]0:1',
partitionfile => 'The path of partition configuration file. Since the partition configuration for bios boot mode and uefi boot mode are different, this configuration file can include both configurations if you need to support both bios and uefi mode. Either way, you must specify the boot mode in the configuration. Example of partition configuration file: [BIOS]xxxxxxx[UEFI]yyyyyyy. To simplify the setting, you also can set installto in partitionfile with section like [INSTALLTO]0:1',
winpepath => 'The path of winpe which will be used to boot this image. If the real path is /tftpboot/winboot/winpe1/, the value for winpepath should be set to winboot/winpe1',
comments => 'Any user-written notes.',
disable => "Set to 'yes' or '1' to comment out this row.",
@@ -885,8 +924,11 @@ site => {
" -----------------\n".
"DATABASE ATTRIBUTES\n".
" -----------------\n".
" auditnosyslog: If set to 1, then commands will only be written to the auditlog table.\n".
" This attribute set to 1 and auditskipcmds=ALL means no logging of commands.\n".
" Default is to write to both the auditlog table and syslog.\n".
" auditskipcmds: List of commands and/or client types that will not be\n".
" written to the auditlog table.\n".
" written to the auditlog table and syslog. See auditnosyslog.\n".
" 'ALL' means all cmds will be skipped. If attribute is null, all\n".
" commands will be written.\n".
" clienttype:web would skip all commands from the web client\n".
@@ -904,6 +946,7 @@ site => {
" nodestatus: If set to 'n', the nodelist.status column will not be updated during\n".
" the node deployment, node discovery and power operations. The default is to update.\n\n".
" skiptables: Comma separated list of tables to be skipped by dumpxCATdb\n\n".
" skipvalidatelog: If set to 1, then getcredentials and getpostscripts calls will not be logged in syslog.\n\n".
" -------------\n".
"DHCP ATTRIBUTES\n".
" -------------\n".
@@ -952,6 +995,16 @@ site => {
" dnsupdaters: The value are \',\' separated string which will be added to the zone config\n".
" section. This is an interface for user to add configuration entries to\n".
" the zone sections in named.conf.\n\n".
" dnsinterfaces: The network interfaces DNS server should listen on. If it is the same\n".
" for all nodes, use a simple comma-separated list of NICs. To\n".
" specify different NICs for different nodes:\n".
" xcatmn|eth1,eth2;service|bond0.\n".
" In this example xcatmn is the name of the xCAT MN, and DNS there\n".
" should listen on eth1 and eth2. On all of the nodes in group\n".
" 'service' DNS should listen on the bond0 nic.\n".
" NOTE: if using this attribute to block certain interfaces, make sure\n".
" the ip maps to your hostname of xCAT MN is not blocked since xCAT needs to\n".
" use this ip to communicate with the local NDS server on MN.\n\n".
" -------------------------\n".
"HARDWARE CONTROL ATTRIBUTES\n".
" -------------------------\n".
@@ -1079,6 +1132,13 @@ site => {
" httpport: The port number that the booting/installing nodes should contact the\n".
" http server on the MN/SN on. It is your responsibility to configure\n".
" the http server to listen on that port - xCAT will not do that.\n\n".
" nmapoptions: Additional options for the nmap command. nmap is used in pping, \n".
" nodestat, xdsh -v and updatenode commands. Sometimes additional \n".
" performance tuning may be needed for nmap due to network traffic.\n".
" For example, if the network response time is too slow, nmap may not\n".
" give stable output. You can increase the timeout value by specifying \n".
" '--min-rtt-timeout 1s'. xCAT will append the options defined here to \n".
" the nmap command.\n\n".
" ntpservers: A comma delimited list of NTP servers for the cluster - often the\n".
" xCAT management node.\n\n".
" svloglocal: if set to 1, syslog on the service node will not get forwarded to the\n".
@@ -1121,9 +1181,9 @@ site => {
" locking out admin interactive use. This value works with the\n".
" xcatmaxconnections and xcatmaxbatch attributes. Is not supported on AIX.\n".
" If the value is no, nodes sleep for a random time before contacting\n".
" xcatd, and retry. On a new install of xcat, this value will be set to yes.\n".
" xcatd, and retry. The default is no.\n".
" See the following document for details:\n".
" https://sourceforge.net/apps/mediawiki/xcat/index.php?title=Hints_and_Tips_for_Large_Scale_Clusters\n\n".
" Hints_and_Tips_for_Large_Scale_Clusters\n\n".
" xcatmaxconnections: Number of concurrent xCAT protocol requests before requests\n".
" begin queueing. This applies to both client command requests\n".
" and node requests, e.g. to get postscripts. Default is 64.\n\n".
@@ -1360,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.',
@@ -1397,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.",
},
@@ -1518,7 +1584,7 @@ discoverydata => {
method => 'The method which handled the discovery request. The method could be one of: switch, blade, profile, sequential.',
discoverytime => 'The last time that xCAT received the discovery message.',
arch => 'The architecture of the discovered node. e.g. x86_64.',
cpucount => 'The cpu number of the discovered node. e.g. 32.',
cpucount => 'The number of cores multiply by threads core supported for the discovered node. e.g. 192.',
cputype => 'The cpu type of the discovered node. e.g. Intel(R) Xeon(R) CPU E5-2690 0 @ 2.90GHz',
memory => 'The memory size of the discovered node. e.g. 198460852',
mtm => 'The machine type model of the discovered node. e.g. 786310X',
@@ -2323,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',
@@ -3574,6 +3644,10 @@ push(@{$defspec{group}->{'attrs'}}, @nodeattrs);
tabentry => 'kit.kitdeployparams',
access_tabentry => 'kit.kitname=attr:kitname',
},
{attr_name => 'kitdir',
tabentry => 'kit.kitdir',
access_tabentry => 'kit.kitname=attr:kitname',
},
);
#############################
@@ -3590,8 +3664,8 @@ push(@{$defspec{group}->{'attrs'}}, @nodeattrs);
tabentry => 'kitrepo.kitname',
access_tabentry => 'kitrepo.kitreponame=attr:kitreponame',
},
{attr_name => 'osname',
tabentry => 'kitrepo.osname',
{attr_name => 'osbasename',
tabentry => 'kitrepo.osbasename',
access_tabentry => 'kitrepo.kitreponame=attr:kitreponame',
},
{attr_name => 'osmajorversion',
@@ -3636,7 +3710,7 @@ push(@{$defspec{group}->{'attrs'}}, @nodeattrs);
access_tabentry => 'kitcomponent.kitcompname=attr:kitcompname',
},
{attr_name => 'kitreponame',
tabentry => 'kitcomponent.kitrepoid',
tabentry => 'kitcomponent.kitreponame',
access_tabentry => 'kitcomponent.kitcompname=attr:kitcompname',
},
{attr_name => 'basename',
@@ -3659,6 +3733,10 @@ push(@{$defspec{group}->{'attrs'}}, @nodeattrs);
tabentry => 'kitcomponent.kitpkgdeps',
access_tabentry => 'kitcomponent.kitcompname=attr:kitcompname',
},
{attr_name => 'prerequisite',
tabentry => 'kitcomponent.prerequisite',
access_tabentry => 'kitcomponent.kitcompname=attr:kitcompname',
},
{attr_name => 'driverpacks',
tabentry => 'kitcomponent.driverpacks',
access_tabentry => 'kitcomponent.kitcompname=attr:kitcompname',
@@ -3671,6 +3749,10 @@ push(@{$defspec{group}->{'attrs'}}, @nodeattrs);
tabentry => 'kitcomponent.postbootscripts',
access_tabentry => 'kitcomponent.kitcompname=attr:kitcompname',
},
{attr_name => 'genimage_postinstall',
tabentry => 'kitcomponent.genimage_postinstall',
access_tabentry => 'kitcomponent.kitcompname=attr:kitcompname',
},
{attr_name => 'exlist',
tabentry => 'kitcomponent.exlist',
access_tabentry => 'kitcomponent.kitcompname=attr:kitcompname',
+9 -6
View File
@@ -10,12 +10,8 @@ BEGIN
# if AIX - make sure we include perl 5.8.2 in INC path.
# Needed to find perl dependencies shipped in deps tarball.
if ($^O =~ /^aix/i) {
use lib "/usr/opt/perl5/lib/5.8.2/aix-thread-multi";
use lib "/usr/opt/perl5/lib/5.8.2";
use lib "/usr/opt/perl5/lib/site_perl/5.8.2/aix-thread-multi";
use lib "/usr/opt/perl5/lib/site_perl/5.8.2";
}
unshift(@INC, qw(/usr/opt/perl5/lib/5.8.2/aix-thread-multi /usr/opt/perl5/lib/5.8.2 /usr/opt/perl5/lib/site_perl/5.8.2/aix-thread-multi /usr/opt/perl5/lib/site_perl/5.8.2));
}
use lib "$::XCATROOT/lib/perl";
use strict;
#-----------------------------------------------------------------------------
@@ -189,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;
+9 -1
View File
@@ -179,6 +179,10 @@ sub init_dbworker {
#setup signal in NotifHandler so that the cache can be updated
xCAT::NotifHandler::setup($$, 0);
# NOTE: There's a bug that sometimes the %SIG is cleaned up by accident, but we cannot figure out when and why
# this happens. The temporary fix is to backup the %SIG and recover it when necessary.
my %SIGbakup = %SIG;
while (not $exitdbthread) {
eval {
my @ready_socks = $clientset->can_read;
@@ -191,6 +195,7 @@ sub init_dbworker {
} else {
eval {
handle_dbc_conn($currcon,$clientset);
unless (%SIG && defined ($SIG{USR1})) { %SIG = %SIGbakup; }
};
if ($@) {
my $err=$@;
@@ -215,6 +220,9 @@ sub init_dbworker {
exit(0);
}
}
# sleep a while to make sure the client process has done
sleep 1.5;
close($dbworkersocket);
unlink($dbsockpath);
exit 0;
@@ -3834,7 +3842,7 @@ sub writeAllEntries
}
my $filename = shift;
my $fh;
my $rc;
my $rc = 0;
# open the file for write
unless (open($fh," > $filename")) {
my $msg="Unable to open $filename for write \n.";
+2 -5
View File
@@ -10,11 +10,8 @@ BEGIN
# if AIX - make sure we include perl 5.8.2 in INC path.
# Needed to find perl dependencies shipped in deps tarball.
if ($^O =~ /^aix/i) {
use lib "/usr/opt/perl5/lib/5.8.2/aix-thread-multi";
use lib "/usr/opt/perl5/lib/5.8.2";
use lib "/usr/opt/perl5/lib/site_perl/5.8.2/aix-thread-multi";
use lib "/usr/opt/perl5/lib/site_perl/5.8.2";
}
unshift(@INC, qw(/usr/opt/perl5/lib/5.8.2/aix-thread-multi /usr/opt/perl5/lib/5.8.2 /usr/opt/perl5/lib/site_perl/5.8.2/aix-thread-multi /usr/opt/perl5/lib/site_perl/5.8.2));
}
use lib "$::XCATROOT/lib/perl";
use strict;
+21 -12
View File
@@ -18,8 +18,9 @@ use xCAT::Utils;
my %usage = (
"rnetboot" =>
"Usage: rnetboot <noderange> [-s net|hd] [-F] [-f] [-V|--verbose] [-m table.colum==expectedstatus] [-m table.colum==expectedstatus...] [-r <retrycount>] [-t <timeout>]
rnetboot <noderange> [ipl= address]
rnetboot [-h|--help|-v|--version]",
rnetboot [-h|--help|-v|--version]
zVM specific:
rnetboot <noderange> [ipl= address]",
"rpower" =>
"Usage: rpower <noderange> [--nodeps] [on|onstandby|off|suspend|reset|stat|state|boot] [-V|--verbose] [-m table.colum==expectedstatus][-m table.colum==expectedstatus...] [-r <retrycount>] [-t <timeout>]
rpower [-h|--help|-v|--version]
@@ -27,10 +28,12 @@ my %usage = (
rpower <noderange> [boot] [ -c <path to iso> ]
PPC (with IVM or HMC) specific:
rpower <noderange> [--nodeps] [of] [-V|--verbose]
PPC (HMC) specific:
rpower <noderange> [onstandby] [-V|--verbose]
CEC (with HMC) specific:
rpower <noderange> [on|off|reset|boot|onstandby]
LPAR(with HMC) specific:
rpower <noderange> [on|off|reset|stat|state|boot|of|sms|softoff]
CEC(using Direct FSP Management) specific:
rpower <noderange> [on|onstandby|off|stat|state|lowpower|resetsp]
rpower <noderange> [on|onstandby|off|stat|state|resetsp]
Frame(using Direct FSP Management) specific:
rpower <noderange> [stat|state|rackstandby|exit_rackstandby|resetsp]
LPAR(using Direct FSP Management) specific:
@@ -131,7 +134,7 @@ my %usage = (
textid=<*>|
frame=<*>|
ntp=<[ntp],[ip],[frequency],[v3]>
FSP/BPA Common:
FSP/CEC (using ASM Interface) Specific:
rspconfig <noderange> [autopower|iocap|decfg|memdecfg|procdecfg|time|date|spdump|sysdump|network|hostname]
rspconfig <noderange> autopower=<enable|disable>|
iocap=<enable|disable>|
@@ -241,8 +244,10 @@ my %usage = (
chvm <noderange> --p775 -i <id> [-m <memory_interleaving>] -r <partition_rule>
chvm <noderange> [lparname=<*|name>]
chvm <noderange> [vmcpus=min/req/max] [vmmemory=min/req/max]
[vmphyslots=drc_index1,drc_index2...] [vmothersetting=hugepage:N,bsr:N]
[vmnics=vlan1,vlan2] [vmstorage=<N|viosnode:slotid>] [--vios]
[vmothersetting=hugepage:N,bsr:N]
[add_physlots=drc_index1,drc_index2...]
[add_vmnics=vlan1,vlan2] [add_vmstorage=<N|viosnode:slotid>] [--vios]
chvm <noderange> [del_physlots=drc_index1,drc_index2...]
chvm <noderange> [del_vadapter=slotid]
VMware specific:
chvm <noderange> [-a size][-d disk][-p disk][--resize disk=size][--cpus count][--mem memory]
@@ -328,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:
+1004 -14
View File
File diff suppressed because it is too large Load Diff
+16 -3
View File
@@ -18,6 +18,7 @@ require Exporter;
"1341569670.539525" => "centos6.3",#x86
"1362445555.957609" => "centos6.4",#x86_64
"1385726732.061157" => "centos6.5",#x86_64
"1404489053.504589" => "centos7.0",
"1176234647.982657" => "centos5",
"1156364963.862322" => "centos4.4",
"1178480581.024704" => "centos4.5",
@@ -66,12 +67,21 @@ require Exporter;
"1359576196.686790" => "rhels6.4", #ppc64
"1384196515.415715" => "rhels6.5", #x86_64
"1384198011.520581" => "rhels6.5", #ppc64
"1411733344.627228" => "rhels6.6", #x86_64
"1411733344.616389" => "rhels6.6", #ppc64
"1399449226.171922" => "rhels7", #x86_64
"1399449226.155578" => "rhels7", #ppc64
"1424360759.989976" => "rhels7.1", #x86_64
"1424360759.878519" => "rhels7.1", #ppc64
"1424361409.280138" => "rhels7.1", #ppc64le
"1285193176.593806" => "rhelhpc6", #x86_64
"1305067719.718814" => "rhelhpc6.1",#x86_64
"1321545261.599847" => "rhelhpc6.2",#x86_64
"1339640148.070971" => "rhelhpc6.3",#x86_64
"1359576195.413831" => "rhelhpc6.4",#x86_64, RHEL ComputeNode
"1384196516.465862" => "rhelhpc6.5",#x86_64, RHEL ComputeNode
"1411733344.599861" => "rhelhpc6.6",#x86_64, RHEL ComputeNode
"1399449226.140088" => "rhelhpc7.0",#x86_64, RHEL ComputeNode
"1194015916.783841" => "fedora8",
"1194015385.299901" => "fedora8",
"1210112435.291709" => "fedora9",
@@ -90,9 +100,12 @@ require Exporter;
"1194512327.501046" => "rhas4.6",
"1241464993.830723" => "rhas4.8", #x86-64
"1273608367.051780" => "SL5.5", #x86_64 DVD ISO
"1299104542.844706" => "SL6", #x86_64 DVD ISO
"1394111947.452332" => "pkvm2.1", # ppc64
"1273608367.051780" => "SL5.5", #x86_64 DVD ISO
"1299104542.844706" => "SL6", #x86_64 DVD ISO
"1390839789.062069" => "SL6.5", #x86_64 DVD ISO Install
"1394111947.452332" => "pkvm2.1", # ppc64, PowerKVM
"1413749127.352649" => "pkvm2.1.1", # ppc64, PowerKVM
);
my %numdiscs = (
"1156364963.862322" => 4,
-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 {
@@ -0,0 +1,10 @@
# AIX Bundle file for compiler runtime packages
I:xlC.aix61
I:xlC.rte
I:xlfrte
I:xlfrte.aix61
I:xlfrte.msg.en_US
I:xlsmp.aix61.rte
I:xlsmp.msg.en_US.rte
I:xlsmp.rte
@@ -103,7 +103,7 @@ else # assume Linux
fi
if [ ! -e $gpfsprofile.sh ]; then
echo 'export PATH=$PATH:/usr/lpp/mmfs/bin' > $gpfsprofile.sh
echo 'setenv PATH $PATH:/usr/lpp/mmfs/bin' > $gpfsprofile.csh
echo 'setenv PATH ${PATH}:/usr/lpp/mmfs/bin' > $gpfsprofile.csh
# Turn off LANG support since we did not install other msg catalogs
echo 'export LC_CTYPE=POSIX' >> $gpfsprofile.sh
echo 'setenv LC_CTYPE POSIX' >> $gpfsprofile.csh
@@ -62,7 +62,8 @@ else
file=$1
fi
ifconfig -a | grep 'inet ' | awk ' { print $2 } ' | grep -v 127.0.0.1 |
#ifconfig -a | grep 'inet ' | awk ' { print $2 } ' | grep -v 127.0.0.1 |
ip -4 -oneline addr show 2>/dev/null |grep inet | sed -ne "s/.*inet //p"|awk -F ' ' '{print $1}'|awk -F '/' '{print $1}'|
while read my_address ; do
##print "checking $my_address"
grep -q " ${my_address}$" $file
+85 -35
View File
@@ -1,38 +1,88 @@
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: xcat-openstack-baremetal
Source: <url://example.com>
Eclipse Public License - v 1.0
Files: *
Copyright: <years> <put author's name and email here>
<years> <likewise for another author>
License: <special license>
<Put the license of the package here indented by 1 space>
<This follows the format of Description: lines in control file>
.
<Including paragraphs>
THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
# If you want to use GPL v2 or later for the /debian/* files use
# the following clauses, or change it to suit. Delete these two lines
Files: debian/*
Copyright: 2014 root <root@unknown>
License: GPL-2+
This package is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
.
This package is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>
.
On Debian systems, the complete text of the GNU General
Public License version 2 can be found in "/usr/share/common-licenses/GPL-2".
1. DEFINITIONS
# Please also look if there are files or directories which have a
# different copyright/license attached and list them here.
# Please avoid to pick license terms that are more restrictive than the
# packaged work, as it may make Debian's contributions unacceptable upstream.
"Contribution" means:
a) in the case of the initial Contributor, the initial code and documentation distributed under this Agreement, and
b) in the case of each subsequent Contributor:
i) changes to the Program, and
ii) additions to the Program;
where such changes and/or additions to the Program originate from and are distributed by that particular Contributor. A Contribution 'originates' from a Contributor if it was added to the Program by such Contributor itself or anyone acting on such Contributor's behalf. Contributions do not include additions to the Program which: (i) are separate modules of software distributed in conjunction with the Program under their own license agreement, and (ii) are not derivative works of the Program.
"Contributor" means any person or entity that distributes the Program.
"Licensed Patents " mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program.
"Program" means the Contributions distributed in accordance with this Agreement.
"Recipient" means anyone who receives the Program under this Agreement, including all Contributors.
2. GRANT OF RIGHTS
a) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, distribute and sublicense the Contribution of such Contributor, if any, and such derivative works, in source code and object code form.
b) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the Contribution of such Contributor, if any, in source code and object code form. This patent license shall apply to the combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license shall not apply to any other combinations which include the Contribution. No hardware per se is licensed hereunder.
c) Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow Recipient to distribute the Program, it is Recipient's responsibility to acquire that license before distributing the Program.
d) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to grant the copyright license set forth in this Agreement.
3. REQUIREMENTS
A Contributor may choose to distribute the Program in object code form under its own license agreement, provided that:
a) it complies with the terms and conditions of this Agreement; and
b) its license agreement:
i) effectively disclaims on behalf of all Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose;
ii) effectively excludes on behalf of all Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits;
iii) states that any provisions which differ from this Agreement are offered by that Contributor alone and not by any other party; and
iv) states that source code for the Program is available from such Contributor, and informs licensees how to obtain it in a reasonable manner on or through a medium customarily used for software exchange.
When the Program is made available in source code form:
a) it must be made available under this Agreement; and
b) a copy of this Agreement must be included with each copy of the Program.
Contributors may not remove or alter any copyright notices contained within the Program.
Each Contributor must identify itself as the originator of its Contribution, if any, in a manner that reasonably allows subsequent Recipients to identify the originator of the Contribution.
4. COMMERCIAL DISTRIBUTION
Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor ("Commercial Contributor") hereby agrees to defend and indemnify every other Contributor ("Indemnified Contributor") against any losses, damages and costs (collectively "Losses") arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Losses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense.
For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Contributor's responsibility alone. Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial Contributor must pay those damages.
5. NO WARRANTY
EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this Agreement , including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations.
6. DISCLAIMER OF LIABILITY
EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
7. GENERAL
If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.
If Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient's patent(s), then such Recipient's rights granted under Section 2(b) shall terminate as of the date such litigation is filed.
All Recipient's rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipient's rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipient's obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive.
Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to publish new versions (including revisions) of this Agreement from time to time. No one other than the Agreement Steward has the right to modify this Agreement. The Eclipse Foundation is the initial Agreement Steward. The Eclipse Foundation may assign the responsibility to serve as the Agreement Steward to a suitable separate entity. Each new version of the Agreement will be given a distinguishing version number. The Program (including Contributions) may always be distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to distribute the Program (including its Contributions) under the new version. Except as expressly stated in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or otherwise. All rights in the Program not expressly granted under this Agreement are reserved.
This Agreement is governed by the laws of the State of New York and the intellectual property laws of the United States of America. No party to this Agreement will bring a legal action under this Agreement more than one year after the cause of action arose. Each party waives its rights to a jury trial in any resulting litigation.
-2
View File
@@ -1,2 +0,0 @@
xcat-openstack-baremetal_2.8.4-1_all.deb admin extra
xcat-openstack-baremetal_2.8.4-1_all.deb admin extra
@@ -1,201 +0,0 @@
dh_installdirs
dh_installdirs
dh_install
dh_link
dh_installman
dh_compress
dh_installdeb
dh_gencontrol
dh_md5sums
dh_builddeb
dh_builddeb
dh_installdirs
dh_install
dh_link
dh_installman
dh_compress
dh_installdeb
dh_gencontrol
dh_md5sums
dh_builddeb
dh_builddeb
dh_installdirs
dh_install
dh_link
dh_installman
dh_compress
dh_installdeb
dh_gencontrol
dh_md5sums
dh_builddeb
dh_builddeb
dh_installdirs
dh_install
dh_link
dh_installman
dh_compress
dh_installdeb
dh_gencontrol
dh_md5sums
dh_builddeb
dh_builddeb
dh_installdirs
dh_install
dh_link
dh_installman
dh_compress
dh_installdeb
dh_gencontrol
dh_md5sums
dh_builddeb
dh_builddeb
dh_installdirs
dh_install
dh_link
dh_installman
dh_compress
dh_installdeb
dh_gencontrol
dh_md5sums
dh_builddeb
dh_builddeb
dh_installdirs
dh_install
dh_link
dh_installman
dh_compress
dh_installdeb
dh_gencontrol
dh_md5sums
dh_builddeb
dh_builddeb
dh_installdirs
dh_install
dh_link
dh_installman
dh_compress
dh_installdeb
dh_gencontrol
dh_md5sums
dh_builddeb
dh_builddeb
dh_installdirs
dh_install
dh_link
dh_installman
dh_compress
dh_installdeb
dh_gencontrol
dh_md5sums
dh_builddeb
dh_builddeb
dh_installdirs
dh_install
dh_link
dh_installman
dh_compress
dh_installdeb
dh_gencontrol
dh_md5sums
dh_builddeb
dh_builddeb
dh_installdirs
dh_install
dh_link
dh_installman
dh_compress
dh_installdeb
dh_gencontrol
dh_md5sums
dh_builddeb
dh_builddeb
dh_installdirs
dh_install
dh_link
dh_installman
dh_compress
dh_installdeb
dh_gencontrol
dh_md5sums
dh_builddeb
dh_builddeb
dh_installdirs
dh_install
dh_link
dh_installman
dh_compress
dh_installdeb
dh_gencontrol
dh_md5sums
dh_builddeb
dh_builddeb
dh_installdirs
dh_install
dh_link
dh_installman
dh_compress
dh_installdeb
dh_gencontrol
dh_md5sums
dh_builddeb
dh_builddeb
dh_installdirs
dh_install
dh_link
dh_installman
dh_compress
dh_installdeb
dh_gencontrol
dh_md5sums
dh_builddeb
dh_builddeb
dh_installdirs
dh_install
dh_link
dh_installman
dh_compress
dh_installdeb
dh_gencontrol
dh_md5sums
dh_builddeb
dh_builddeb
dh_installdirs
dh_install
dh_link
dh_installman
dh_compress
dh_installdeb
dh_gencontrol
dh_md5sums
dh_builddeb
dh_builddeb
dh_installdirs
dh_install
dh_link
dh_installman
dh_compress
dh_installdeb
dh_gencontrol
dh_md5sums
dh_builddeb
dh_builddeb
dh_installdirs
dh_install
dh_link
dh_installman
dh_compress
dh_installdeb
dh_gencontrol
dh_md5sums
dh_builddeb
dh_builddeb
dh_installdirs
dh_install
dh_link
dh_installman
dh_compress
dh_installdeb
dh_gencontrol
dh_md5sums
dh_builddeb
dh_builddeb
@@ -100,8 +100,8 @@ change_host_name()
if [ "$str_os_type" = "sles" ];then
echo "Persistently changing the hostname not implemented yet."
#debian ubuntu
elif [ "$str_os_type" = "debian" ];then
#debian ubuntu and rh7
elif [ -f "/etc/hostname" ];then
conf_file="/etc/hostname"
echo "$str_hostname" > $conf_file
else
@@ -36,8 +36,8 @@ change_host_name()
if [ "$str_os_type" = "sles" ];then
echo "Persistently changing the hostname not implemented yet."
#debian ubuntu
elif [ "$str_os_type" = "debian" ];then
#debian ubuntu and rh7
elif [ -f "/etc/hostname" ];then
conf_file="/etc/hostname"
echo "$str_hostname" > $conf_file
else
+1 -1
View File
@@ -71,7 +71,7 @@ sub createDummyPods {
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); }
if ($?) { print "Did not find any section 5 man page, creating dummy pods...\n"; print join('', @lines); }
#my @lines;
#system($cmd);
my @dummyPods;
@@ -0,0 +1,6 @@
include AUTHORS
include ChangeLog
exclude .gitignore
exclude .gitreview
global-exclude *.pyc
@@ -0,0 +1,44 @@
xCAT Driver for ironic x86/64 machine
==================================
xCAT is a Extreme Cluster/Cloud Administration Toolkit. We can use xcat
to do :
1 hardward discoveery
2 remote hardware control
3 remote sonsole
4 hardware inventory
5 firmware flashing
Ironic is a project in Openstack, it will replace the nova-baremetal in juno release. Ironic's design is very flexable, we can add driver to extend function
without change any code in Openstack. Ironic xCAT driver takes the advantage of xcat and openstack, we can use it to deploy the baremetal machine very easily.
Before using this driver, we must setup the openstack environment at least for two nodes( ironic conductor and neutron network node can't setup on the same node)
Ironic conductor and the baremetal node( waiting for deploy) must in the same vlan
Add the follows in the ironic egg-info entry_points.txt file (ironic.drivers section)
pxe_xcat = ironic.drivers.xcat:XCATBaremetalDriver
When the openstack with ironic is ready, just execute command in the ironic_xcat directory as follows:
$ python setup.py install
Restart the ironic-conductor process
Initialize the xcat environment according to http://sourceforge.net/p/xcat/wiki/XCAT_iDataPlex_Cluster_Quick_Start/
Using xCAT baremetal driver need config site table and run copycds to generate image. The node definition is not requirement.
Ironic use neutron as the network service.
Check the openvswitch config on the network node ,make sure brbm bridge connect to the baremetal node.
==================================================================================
Some Example to use the xCAT baremetal driver.
$touch /tmp/rhelhpc6.5-x86_64-install-compute.qcow2;glance image-create --name rhelhpc6.5-x86_64-install-compute --public --disk-format qcow2 --container-format bare --property xcat_image_name='rhels6.4-x86_64-install-compute' < /tmp/rhelhpc6.5-x86_64-install-compute.qcow2
--name rhelhpc6.5-x86_64-install-compute is the image name in xcat. You can use lsdef -t osimage on the ironic-conductor node which xcat is installed.
$ ironic node-create --driver pxe_xcat -i ipmi_address=xxx.xxx.xxx.xxx -i ipmi_username=userid -i ipmi_password=password -i xcat_node=x3550m4n02 -i xcatmaster=10.1.0.241 -i netboot=xnba -i ipmi_terminal_port=0 -p memory_mb=2048 -p cpus=8
$ ironic port-create --address ff:ff:ff:ff:ff:ff --node_uuid <ironic node uuid>
$ nova boot --flavor baremetal --image <image-id> testing --nic net-id=<internal network id>
@@ -0,0 +1,25 @@
"""xCAT baremtal exceptions.
"""
from oslo.config import cfg
import six
from ironic.openstack.common.gettextutils import _
from ironic.openstack.common import log as logging
from ironic.common.exception import IronicException
LOG = logging.getLogger(__name__)
class xCATCmdFailure(IronicException):
message = _("xcat call failed: %(cmd)s %(node)s %(args)s.")
class xCATDeploymentFailure(IronicException):
message = _("xCAT node deployment failed for node %(node)s:%(error)s")
class GetNetworkFixedIPFailure(IronicException):
message = _("get fixed ip failed for mac %(mac_address)s")
class GetNetworkIdFailure(IronicException):
message = _("get node network in failed for mac %(mac_address)s")
class FailedToGetInfoOnPort(IronicException):
message = _("Show info on port: %(port_id)s failed.")
@@ -0,0 +1,41 @@
"""
Get the network from neutron
This is a xcat patch for the ironic/common/neutron.py
"""
from neutronclient.common import exceptions as neutron_client_exc
from ironic.common import exception
from ironic.openstack.common import log as logging
from ironic.common import neutron
from ironic.drivers.modules import xcat_exception
LOG = logging.getLogger(__name__)
def get_vif_port_info(task, port_id):
""" Get detail port info from neutron with a given port id """
api = neutron.NeutronAPI(task.context)
try:
port_info = api.client.show_port(port_id)
except neutron_client_exc.NeutronClientException:
LOG.exception(_("Failed to get port info %s."), port_id)
raise exception.FailedToGetInfoOnPort(port_id=port_id)
return port_info
def get_ports_info_from_neutron(task):
""" Get neutron port info from neutron about this task """
vifs = neutron.get_node_vif_ids(task)
if not vifs:
LOG.warning(_("No VIFs found for node %(node)s when attempting to "
"update Neutron DHCP BOOT options."),
{'node': task.node.uuid})
return
failures = []
vif_ports_info = {}
for port_id, port_vif in vifs.iteritems():
try:
vif_ports_info[port_id] = get_vif_port_info(task,port_vif)
except xcat_exception.FailedToGetInfoOnPort(port_id=port_vif):
failures.append(port_vif)
return vif_ports_info
@@ -0,0 +1,462 @@
"""
pxe procedure for the xcat baremetal driver
use xcat to config dhcp and tftp
"""
import os
import time
import paramiko
import datetime
from oslo.config import cfg
from ironic.common import exception
from ironic.common import image_service as service
from ironic.common import keystone
from ironic.common import states
from ironic.common import utils
from ironic.conductor import task_manager
from ironic.conductor import utils as manager_utils
from ironic.drivers import base
from ironic.drivers import utils as driver_utils
from ironic.openstack.common import log as logging
from ironic.openstack.common import strutils
from ironic.drivers.modules import xcat_neutron
from ironic.drivers.modules import xcat_util
from ironic.openstack.common import loopingcall
from nova.openstack.common import timeutils
from ironic.openstack.common import lockutils
from ironic.drivers.modules import xcat_exception
pxe_opts = [
cfg.StrOpt('pxe_append_params',
default='nofb nomodeset vga=normal',
help='Additional append parameters for baremetal PXE boot.'),
cfg.StrOpt('default_ephemeral_format',
default='ext4',
help='Default file system format for ephemeral partition, '
'if one is created.'),
]
xcat_opts = [
cfg.StrOpt('network_node_ip',
default='127.0.0.1',
help='IP address of neutron network node'),
cfg.StrOpt('ssh_user',
default='root',
help='Username of neutron network node.'),
cfg.StrOpt('ssh_password',
default='cluster',
help='Password of neutron network node'),
cfg.IntOpt('ssh_port',
default=22,
help='ssh connection port for the neutron '),
cfg.StrOpt('host_filepath',
default='/etc/hosts',
help='host file of server'),
cfg.IntOpt('deploy_timeout',
default=3600,
help='max depolyment time(seconds) for the xcat driver'),
cfg.IntOpt('deploy_checking_interval',
default=30,
help='interval time(seconds) to check the xcat deploy state'),
]
LOG = logging.getLogger(__name__)
CONF = cfg.CONF
CONF.register_opts(pxe_opts, group='pxe')
CONF.register_opts(xcat_opts, group='xcat')
CONF.import_opt('use_ipv6', 'ironic.netconf')
REQUIRED_PROPERTIES = {
'pxe_deploy_kernel': _("UUID (from Glance) of the deployment kernel. "
"Required."),
'pxe_deploy_ramdisk': _("UUID (from Glance) of the ramdisk that is "
"mounted at boot time. Required."),
}
COMMON_PROPERTIES = REQUIRED_PROPERTIES
EM_SEMAPHORE = 'xcat_pxe'
def _check_for_missing_params(info_dict, param_prefix=''):
missing_info = []
for label, value in info_dict.items():
if not value:
missing_info.append(param_prefix + label)
if missing_info:
raise exception.InvalidParameterValue(_(
"Can not validate PXE bootloader. The following parameters "
"were not passed to ironic: %s") % missing_info)
def _parse_driver_info(node):
"""Gets the driver specific Node deployment info.
This method validates whether the 'driver_info' property of the
supplied node contains the required information for this driver to
deploy images to the node.
:param node: a single Node.
:returns: A dict with the driver_info values.
"""
info = node.driver_info
d_info = {}
d_info['xcat_node'] = info.get('xcat_node')
return d_info
def _parse_instance_info(node):
"""Gets the instance specific Node deployment info.
This method validates whether the 'instance_info' property of the
supplied node contains the required information for this driver to
deploy images to the node.
:param node: a single Node.
:returns: A dict with the instance_info values.
"""
info = node.instance_info
i_info = {}
i_info['image_source'] = info.get('image_source')
i_info['root_gb'] = info.get('root_gb')
i_info['image_file'] = i_info['image_source']
_check_for_missing_params(i_info)
# Internal use only
i_info['deploy_key'] = info.get('deploy_key')
i_info['swap_mb'] = info.get('swap_mb', 0)
i_info['ephemeral_gb'] = info.get('ephemeral_gb', 0)
i_info['ephemeral_format'] = info.get('ephemeral_format')
err_msg_invalid = _("Can not validate PXE bootloader. Invalid parameter "
"%(param)s. Reason: %(reason)s")
for param in ('root_gb', 'swap_mb', 'ephemeral_gb'):
try:
int(i_info[param])
except ValueError:
reason = _("'%s' is not an integer value.") % i_info[param]
raise exception.InvalidParameterValue(err_msg_invalid %
{'param': param, 'reason': reason})
if i_info['ephemeral_gb'] and not i_info['ephemeral_format']:
i_info['ephemeral_format'] = CONF.pxe.default_ephemeral_format
preserve_ephemeral = info.get('preserve_ephemeral', False)
try:
i_info['preserve_ephemeral'] = strutils.bool_from_string(
preserve_ephemeral, strict=True)
except ValueError as e:
raise exception.InvalidParameterValue(err_msg_invalid %
{'param': 'preserve_ephemeral', 'reason': e})
return i_info
def _parse_deploy_info(node):
"""Gets the instance and driver specific Node deployment info.
This method validates whether the 'instance_info' and 'driver_info'
property of the supplied node contains the required information for
this driver to deploy images to the node.
:param node: a single Node.
:returns: A dict with the instance_info and driver_info values.
"""
info = {}
info.update(_parse_instance_info(node))
info.update(_parse_driver_info(node))
return info
def _validate_glance_image(ctx, deploy_info):
"""Validate the image in Glance.
Check if the image exist in Glance and if it contains the
'kernel_id' and 'ramdisk_id' properties.
:raises: InvalidParameterValue.
"""
image_id = deploy_info['image_source']
if not image_id:
raise exception.ImageNotFound
class PXEDeploy(base.DeployInterface):
"""PXE Deploy Interface: just a stub until the real driver is ported."""
def get_properties(self):
return COMMON_PROPERTIES
def validate(self, task):
"""Validate the deployment information for the task's node.
:param task: a TaskManager instance containing the node to act on.
:raises: InvalidParameterValue.
"""
node = task.node
if not driver_utils.get_node_mac_addresses(task):
raise exception.InvalidParameterValue(_("Node %s does not have "
"any port associated with it.") % node.uuid)
d_info = _parse_deploy_info(node)
# Try to get the URL of the Ironic API
try:
# TODO(lucasagomes): Validate the format of the URL
CONF.conductor.api_url or keystone.get_service_url()
except (exception.CatalogFailure,
exception.CatalogNotFound,
exception.CatalogUnauthorized):
raise exception.InvalidParameterValue(_(
"Couldn't get the URL of the Ironic API service from the "
"configuration file or keystone catalog."))
_validate_glance_image(task.context, d_info)
@task_manager.require_exclusive_lock
def deploy(self, task):
"""Start deployment of the task's node'.
Config host file and xcat dhcp, generate image info for xcat
and issues a reboot request to the power driver.
This causes the node to boot into the deployment ramdisk and triggers
the next phase of PXE-based deployment via
VendorPassthru._continue_deploy().
:param task: a TaskManager instance containing the node to act on.
:returns: deploy state DEPLOYDONE.
"""
d_info = _parse_deploy_info(task.node)
if not task.node.instance_info.get('fixed_ip_address') or not task.node.instance_info.get('image_name'):
raise exception.InvalidParameterValue
self._config_host_file(d_info,task.node.instance_info.get('fixed_ip_address'))
self._make_dhcp()
self._nodeset_osimage(d_info,task.node.instance_info.get('image_name'))
manager_utils.node_set_boot_device(task, 'pxe', persistent=True)
manager_utils.node_power_action(task, states.REBOOT)
try:
self._wait_for_node_deploy(task)
except xcat_exception.xCATDeploymentFailure:
LOG.info(_("xcat deployment failed"))
return states.ERROR
return states.DEPLOYDONE
@task_manager.require_exclusive_lock
def tear_down(self, task):
"""Tear down a previous deployment on the task's node.
Power off the node. All actual clean-up is done in the clean_up()
method which should be called separately.
:param task: a TaskManager instance containing the node to act on.
:returns: deploy state DELETED.
"""
manager_utils.node_power_action(task, states.POWER_OFF)
return states.DELETED
def prepare(self, task):
"""Prepare the deployment environment for this task's node.
Get the image info from glance, config the mac for the xcat
use ssh and iptables to disable dhcp on network node
:param task: a TaskManager instance containing the node to act on.
"""
# TODO(deva): optimize this if rerun on existing files
d_info = _parse_deploy_info(task.node)
i_info = task.node.instance_info
image_id = d_info['image_source']
try:
glance_service = service.Service(version=1, context=task.context)
image_name = glance_service.show(image_id)['name']
i_info['image_name'] = image_name
except (exception.GlanceConnectionFailed,
exception.ImageNotAuthorized,
exception.Invalid):
LOG.warning(_("Failed to connect to Glance to get the properties "
"of the image %s") % image_id)
node_mac_addresses = driver_utils.get_node_mac_addresses(task)
vif_ports_info = xcat_neutron.get_ports_info_from_neutron(task)
try:
network_info = self._get_deploy_network_info(vif_ports_info, node_mac_addresses)
except (xcat_exception.GetNetworkFixedIPFailure,xcat_exception.GetNetworkIdFailure):
LOG.error(_("Failed to get network info"))
return
if not network_info:
LOG.error(_("Failed to get network info"))
return
fixed_ip_address = network_info['fixed_ip_address']
deploy_mac_address = network_info['mac_address']
network_id = network_info['network_id']
i_info['fixed_ip_address'] = fixed_ip_address
i_info['network_id'] = network_id
i_info['deploy_mac_address'] = deploy_mac_address
# use iptables to drop the dhcp mac of baremetal machine
self._ssh_append_dhcp_rule(CONF.xcat.network_node_ip,CONF.xcat.ssh_port,CONF.xcat.ssh_user,
CONF.xcat.ssh_password,network_id,deploy_mac_address)
self._chdef_node_mac_address(d_info,deploy_mac_address)
def clean_up(self, task):
"""Clean up the deployment environment for the task's node.
Unlinks TFTP and instance images and triggers image cache cleanup.
Removes the TFTP configuration files for this node. As a precaution,
this method also ensures the keystone auth token file was removed.
:param task: a TaskManager instance containing the node to act on.
"""
pass
def take_over(self, task):
pass
def _get_deploy_network_info(self, vif_ports_info, valid_node_mac_addrsses):
"""Get network info from mac address of ironic node.
:param vif_ports_info: info collection from neutron ports
:param valid_node_mac_addrsses: mac address from ironic node
:raises: GetNetworkFixedIpFailure if search the fixed ip from mac address failure
:raises: GetNetworkIdFailure if search the network id from mac address failure
"""
network_info = {}
for port_info in vif_ports_info.values():
if(port_info['port']['mac_address'] in valid_node_mac_addrsses ):
network_info['fixed_ip_address'] = port_info['port']['fixed_ips'][0]['ip_address']
if not network_info['fixed_ip_address']:
raise xcat_exception.GetNetworkFixedIPFailure(mac_address=port_info['port']['mac_address'])
network_info['mac_address'] = port_info['port']['mac_address']
network_info['network_id'] = port_info['port']['network_id']
if not network_info['network_id']:
raise xcat_exception.GetNetworkIdFailure(mac_address=port_info['port']['mac_address'])
network_info['port_id'] = port_info['port']['id']
return network_info
return network_info
def _chdef_node_mac_address(self, driver_info, deploy_mac):
""" run chdef command to set mac address"""
cmd = 'chdef'
args = 'mac='+ deploy_mac
try:
out_err = xcat_util.exec_xcatcmd(driver_info, cmd, args)
LOG.info(_("xcat chdef cmd exetute output: %(out_err)s") % {'out_err':out_err})
except xcat_exception.xCATCmdFailure as e:
LOG.warning(_("xcat chdef failed for node %(xcat_node)s with "
"error: %(error)s.")
% {'xcat_node': driver_info['xcat_node'], 'error': e})
raise exception.IPMIFailure(cmd=cmd)
@lockutils.synchronized(EM_SEMAPHORE, 'xcat-hosts-')
def _config_host_file(self, driver_info, deploy_ip):
""" append node and ip infomation to host file"""
with open(CONF.xcat.host_filepath,"r+") as f:
lines = []
for line in f:
temp = line.split('#')
if temp[0].strip():
host_name = xcat_util._tsplit(temp[0].strip(),(' ','\t'))[1]
if driver_info['xcat_node'] not in host_name:
lines.append(line)
# append a new line to host file
line = "%s\t%s\n" %(deploy_ip,driver_info['xcat_node'])
lines.append(line)
f.seek(0)
f.truncate()
for line in lines:
f.write(line)
def _nodeset_osimage(self, driver_info, image_name):
"""run nodeset command to config the image for the xcat node
:param driver_info: xcat node deploy info
:param image_name: image for the xcat deployment
"""
cmd = 'nodeset'
args = 'osimage='+ image_name
try:
xcat_util.exec_xcatcmd(driver_info, cmd, args)
except xcat_exception.xCATCmdFailure as e:
LOG.warning(_("xcat nodeset failed for node %(xcat_node)s with "
"error: %(error)s.")
% {'xcat_node': driver_info['xcat_node'], 'error': e})
def _make_dhcp(self):
"""run makedhcp command to setup dhcp environment for the xcat node"""
cmd = ['makedhcp',
'-n'
]
try:
out, err = utils.execute(*cmd)
LOG.info(_(" excute cmd: %(cmd)s \n output: %(out)s \n. Error: %(err)s \n"),
{'cmd':cmd,'out': out, 'err': err})
except Exception as e:
LOG.error(_("Unable to execute %(cmd)s. Exception: %(exception)s"),
{'cmd': cmd, 'exception': e})
# makedhcp -a
cmd = ['makedhcp',
'-a'
]
try:
out, err = utils.execute(*cmd)
LOG.info(_(" excute cmd: %(cmd)s \n output: %(out)s \n. Error: %(err)s \n"),
{'cmd':cmd,'out': out, 'err': err})
except Exception as e:
LOG.error(_("Unable to execute %(cmd)s. Exception: %(exception)s"),
{'cmd': cmd, 'exception': e})
def _ssh_append_dhcp_rule(self,ip,port,username,password,network_id,mac_address):
""" drop the dhcp package in network node to avoid of confilct of dhcp """
netns = 'qdhcp-%s' %network_id
append_cmd = 'sudo ip netns exec %s iptables -A INPUT -m mac --mac-source %s -j DROP' % \
(netns,mac_address)
cmd = [append_cmd]
xcat_util.xcat_ssh(ip,port,username,password,cmd)
def _ssh_delete_dhcp_rule(self,ip,port,username,password,network_id,mac_address):
""" delete the iptable rule on network node to recover the environment"""
netns = 'qdhcp-%s' %network_id
cancel_cmd = 'sudo ip netns exec %s iptables -D INPUT -m mac --mac-source %s -j DROP' % \
(netns,mac_address)
cmd = [cancel_cmd]
xcat_util.xcat_ssh(ip,port,username,password,cmd)
def _wait_for_node_deploy(self, task):
"""Wait for xCAT node deployment to complete."""
locals = {'errstr':''}
driver_info = _parse_deploy_info(task.node)
node_mac_addrsses = driver_utils.get_node_mac_addresses(task)
i_info = task.node.instance_info
def _wait_for_deploy():
out,err = xcat_util.exec_xcatcmd(driver_info,'nodels','nodelist.status')
if err:
locals['errstr'] = _("Error returned when quering node status"
" for node %s:%s") % (driver_info['xcat_node'], err)
LOG.warning(locals['errstr'])
raise loopingcall.LoopingCallDone()
if out:
node,status = out.split(": ")
status = status.strip()
if status == "booted":
LOG.info(_("Deployment for node %s completed.")
% driver_info['xcat_node'])
raise loopingcall.LoopingCallDone()
if (CONF.xcat.deploy_timeout and
timeutils.utcnow() > expiration):
locals['errstr'] = _("Timeout while waiting for"
" deployment of node %s.") % driver_info['xcat_node']
LOG.warning(locals['errstr'])
raise loopingcall.LoopingCallDone()
expiration = timeutils.utcnow() + datetime.timedelta(
seconds=CONF.xcat.deploy_timeout)
timer = loopingcall.FixedIntervalLoopingCall(_wait_for_deploy)
# default check every 10 seconds
timer.start(interval=CONF.xcat.deploy_checking_interval).wait()
if locals['errstr']:
raise xcat_exception.xCATDeploymentFailure(locals['errstr'])
# deploy end, delete the dhcp rule for xcat
self._ssh_delete_dhcp_rule(CONF.xcat.network_node_ip,CONF.xcat.ssh_port,CONF.xcat.ssh_user,
CONF.xcat.ssh_password,i_info['network_id'],node_mac_addrsses[0])
@@ -0,0 +1,444 @@
"""
IPMI power manager driver.
"""
import contextlib
import os
import stat
import tempfile
import time
from oslo.config import cfg
from ironic.common import exception
from ironic.common import states
from ironic.common import utils
from ironic.conductor import task_manager
from ironic.drivers import base
from ironic.drivers.modules import console_utils
from ironic.openstack.common import excutils
from ironic.openstack.common import log as logging
from ironic.openstack.common import loopingcall
from ironic.openstack.common import processutils
from ironic.drivers.modules import xcat_exception
from ironic.drivers.modules import xcat_util
CONF = cfg.CONF
CONF.import_opt('retry_timeout',
'ironic.drivers.modules.ipminative',
group='ipmi')
CONF.import_opt('min_command_interval',
'ironic.drivers.modules.ipminative',
group='ipmi')
LOG = logging.getLogger(__name__)
VALID_PRIV_LEVELS = ['ADMINISTRATOR', 'CALLBACK', 'OPERATOR', 'USER']
REQUIRED_PROPERTIES = {
'ipmi_address': _("IP address or hostname of the node. Required.")
}
OPTIONAL_PROPERTIES = {
'ipmi_password': _("password. Optional."),
'ipmi_priv_level': _("privilege level; default is ADMINISTRATOR. One of "
"%s. Optional.") % ', '.join(VALID_PRIV_LEVELS),
'ipmi_username': _("username; default is NULL user. Optional.")
}
COMMON_PROPERTIES = REQUIRED_PROPERTIES.copy()
COMMON_PROPERTIES.update(OPTIONAL_PROPERTIES)
CONSOLE_PROPERTIES = {
'ipmi_terminal_port': _("node's UDP port to connect to. Only required for "
"console access.")
}
TIMING_SUPPORT = None
def _is_timing_supported(is_supported=None):
# shim to allow module variable to be mocked in unit tests
global TIMING_SUPPORT
if (TIMING_SUPPORT is None) and (is_supported is not None):
TIMING_SUPPORT = is_supported
return TIMING_SUPPORT
def check_timing_support():
"""Check the installed version of ipmitool for -N -R option support.
Support was added in 1.8.12 for the -N -R options, which enable
more precise control over timing of ipmi packets. Prior to this,
the default behavior was to retry each command up to 18 times at
1 to 5 second intervals.
http://ipmitool.cvs.sourceforge.net/viewvc/ipmitool/ipmitool/ChangeLog?revision=1.37 # noqa
This method updates the module-level TIMING_SUPPORT variable so that
it is accessible by any driver interface class in this module. It is
intended to be called from the __init__ method of such classes only.
:returns: boolean indicating whether support for -N -R is present
:raises: OSError
"""
if _is_timing_supported() is None:
# Directly check ipmitool for support of -N and -R options. Because
# of the way ipmitool processes' command line options, if the local
# ipmitool does not support setting the timing options, the command
# below will fail.
try:
out, err = utils.execute(*['ipmitool', '-N', '0', '-R', '0', '-h'])
except processutils.ProcessExecutionError:
# the local ipmitool does not support the -N and -R options.
_is_timing_supported(False)
else:
# looks like ipmitool supports timing options.
_is_timing_supported(True)
def _console_pwfile_path(uuid):
"""Return the file path for storing the ipmi password for a console."""
file_name = "%(uuid)s.pw" % {'uuid': uuid}
return os.path.join(tempfile.gettempdir(), file_name)
def _parse_driver_info(node):
"""Gets the parameters required for ipmitool to access the node.
:param node: the Node of interest.
:returns: dictionary of parameters.
:raises: InvalidParameterValue if any required parameters are missing.
"""
info = node.driver_info or {}
address = info.get('ipmi_address')
username = info.get('ipmi_username')
password = info.get('ipmi_password')
port = info.get('ipmi_terminal_port')
priv_level = info.get('ipmi_priv_level', 'ADMINISTRATOR')
xcat_node = info.get('xcat_node')
xcatmaster = info.get('xcatmaster')
netboot = info.get('netboot')
if port:
try:
port = int(port)
except ValueError:
raise exception.InvalidParameterValue(_(
"IPMI terminal port is not an integer."))
if not address:
raise exception.InvalidParameterValue(_(
"IPMI address not supplied to xcat driver."))
if priv_level not in VALID_PRIV_LEVELS:
valid_priv_lvls = ', '.join(VALID_PRIV_LEVELS)
raise exception.InvalidParameterValue(_(
"Invalid privilege level value:%(priv_level)s, the valid value"
" can be one of %(valid_levels)s") %
{'priv_level': priv_level, 'valid_levels': valid_priv_lvls})
if not xcat_node:
raise exception.InvalidParameterValue(_(
"xcat node name not supplied to xcat driver"))
if not xcatmaster:
raise exception.InvalidParameterValue(_(
"xcatmaster not supplied to xcat driver"))
if not netboot:
raise exception.InvalidParameterValue(_(
"netboot not supplied to xcat driver"))
return {
'address': address,
'username': username,
'password': password,
'port': port,
'uuid': node.uuid,
'priv_level': priv_level,
'xcat_node': xcat_node,
'xcatmaster': xcatmaster,
'netboot': netboot
}
def chdef_node(driver_info):
"""Run the chdef command in xcat, config the node
:param driver_info: driver_info for the xcat node
"""
cmd = 'chdef'
args = 'mgt=ipmi' + \
' bmc=' + driver_info['address'] + \
' bmcusername=' + driver_info['username'] + \
' bmcpassword=' + driver_info['password'] + \
' xcatmaster=' + driver_info['xcatmaster']+ \
' netboot=' + driver_info['netboot']+ \
' primarynic=mac'+ \
' installnic=mac'+ \
' monserver=' + driver_info['xcatmaster'] + \
' nfsserver=' + driver_info['xcatmaster'] + \
' serialflow=hard'+ \
' serialspeed=115200' + \
' serialport=' + str(driver_info['port']);
try:
xcat_util.exec_xcatcmd(driver_info, cmd, args)
except xcat_exception.xCATCmdFailure as e:
LOG.warning(_("xcat chdef failed for node %(node_id)s with "
"error: %(error)s.")
% {'node_id': driver_info['uuid'], 'error': e})
def _sleep_time(iter):
"""Return the time-to-sleep for the n'th iteration of a retry loop.
This implementation increases exponentially.
:param iter: iteration number
:returns: number of seconds to sleep
"""
if iter <= 1:
return 1
return iter ** 2
def _set_and_wait(target_state, driver_info):
"""Helper function for DynamicLoopingCall.
This method changes the power state and polls the BMCuntil the desired
power state is reached, or CONF.ipmi.retry_timeout would be exceeded by the
next iteration.
This method assumes the caller knows the current power state and does not
check it prior to changing the power state. Most BMCs should be fine, but
if a driver is concerned, the state should be checked prior to calling this
method.
:param target_state: desired power state
:param driver_info: the ipmitool parameters for accessing a node.
:returns: one of ironic.common.states
:raises: IPMIFailure on an error from ipmitool (from _power_status call).
"""
if target_state == states.POWER_ON:
state_name = "on"
elif target_state == states.POWER_OFF:
state_name = "off"
def _wait(mutable):
try:
# Only issue power change command once
if mutable['iter'] < 0:
xcat_util.exec_xcatcmd(driver_info,'rpower',state_name)
else:
mutable['power'] = _power_status(driver_info)
except Exception:
# Log failures but keep trying
LOG.warning(_("xcat rpower %(state)s failed for node %(node)s."),
{'state': state_name, 'node': driver_info['uuid']})
finally:
mutable['iter'] += 1
if mutable['power'] == target_state:
raise loopingcall.LoopingCallDone()
sleep_time = _sleep_time(mutable['iter'])
if (sleep_time + mutable['total_time']) > CONF.ipmi.retry_timeout:
# Stop if the next loop would exceed maximum retry_timeout
LOG.error(_('xcat rpower %(state)s timed out after '
'%(tries)s retries on node %(node_id)s.'),
{'state': state_name, 'tries': mutable['iter'],
'node_id': driver_info['uuid']})
mutable['power'] = states.ERROR
raise loopingcall.LoopingCallDone()
else:
mutable['total_time'] += sleep_time
return sleep_time
# Use mutable objects so the looped method can change them.
# Start 'iter' from -1 so that the first two checks are one second apart.
status = {'power': None, 'iter': -1, 'total_time': 0}
timer = loopingcall.DynamicLoopingCall(_wait, status)
timer.start().wait()
return status['power']
def _power_on(driver_info):
"""Turn the power ON for this node.
:param driver_info: the xcat parameters for accessing a node.
:returns: one of ironic.common.states POWER_ON or ERROR.
:raises: IPMIFailure on an error from ipmitool (from _power_status call).
"""
return _set_and_wait(states.POWER_ON, driver_info)
def _power_off(driver_info):
"""Turn the power OFF for this node.
:param driver_info: the xcat parameters for accessing a node.
:returns: one of ironic.common.states POWER_OFF or ERROR.
:raises: IPMIFailure on an error from ipmitool (from _power_status call).
"""
return _set_and_wait(states.POWER_OFF, driver_info)
def _power_status(driver_info):
"""Get the power status for a node.
:param driver_info: the xcat access parameters for a node.
:returns: one of ironic.common.states POWER_OFF, POWER_ON or ERROR.
:raises: IPMIFailure on an error from ipmitool.
"""
cmd = "rpower"
try:
out_err = xcat_util.exec_xcatcmd(driver_info,cmd,'status')
except Exception as e:
LOG.warning(_("xcat rpower status failed for node %(node_id)s with "
"error: %(error)s.")
% {'node_id': driver_info['uuid'], 'error': e})
if out_err[0].split(' ')[1].strip() == "on":
return states.POWER_ON
elif out_err[0].split(' ')[1].strip() == "off":
return states.POWER_OFF
else:
return states.ERROR
class XcatPower(base.PowerInterface):
def __init__(self):
try:
check_timing_support()
except OSError:
raise exception.DriverLoadError(
driver=self.__class__.__name__,
reason="Unable to locate usable xcat command in "
"the system path when checking xcat version")
def get_properties(self):
return COMMON_PROPERTIES
def validate(self, task):
"""Validate driver_info for xcat driver.
Check that node['driver_info'] contains IPMI credentials.
:param task: a TaskManager instance containing the node to act on.
:raises: InvalidParameterValue if required ipmi parameters are missing.
"""
driver_info = _parse_driver_info(task.node)
try:
chdef_node(driver_info)
except exception:
LOG.error(_("chdef xcat info error!"))
def get_power_state(self, task):
"""Get the current power state of the task's node.
:param task: a TaskManager instance containing the node to act on.
:returns: one of ironic.common.states POWER_OFF, POWER_ON or ERROR.
"""
driver_info = _parse_driver_info(task.node)
return _power_status(driver_info)
@task_manager.require_exclusive_lock
def set_power_state(self, task, pstate):
"""Turn the power on or off.
:param task: a TaskManager instance containing the node to act on.
:param pstate: The desired power state, one of ironic.common.states
POWER_ON, POWER_OFF.
:raises: InvalidParameterValue if required ipmi parameters are missing
or if an invalid power state was specified.
:raises: PowerStateFailure if the power couldn't be set to pstate.
"""
driver_info = _parse_driver_info(task.node)
if pstate == states.POWER_ON:
state = _power_on(driver_info)
elif pstate == states.POWER_OFF:
state = _power_off(driver_info)
else:
raise exception.InvalidParameterValue(_("set_power_state called "
"with invalid power state %s.") % pstate)
if state != pstate:
raise exception.PowerStateFailure(pstate=pstate)
@task_manager.require_exclusive_lock
def reboot(self, task):
"""Cycles the power to the task's node.
:param task: a TaskManager instance containing the node to act on.
:raises: InvalidParameterValue if required ipmi parameters are missing.
:raises: PowerStateFailure if the final state of the node is not
POWER_ON.
"""
driver_info = _parse_driver_info(task.node)
_power_off(driver_info)
state = _power_on(driver_info)
if state != states.POWER_ON:
raise exception.PowerStateFailure(pstate=states.POWER_ON)
class IPMIShellinaboxConsole(base.ConsoleInterface):
"""A ConsoleInterface that uses ipmitool and shellinabox."""
def __init__(self):
try:
check_timing_support()
except OSError:
raise exception.DriverLoadError(
driver=self.__class__.__name__,
reason="Unable to locate usable xcat command in "
"the system path when checking xcat version")
def get_properties(self):
return COMMON_PROPERTIES
def validate(self, task):
"""Validate the Node console info.
:param task: a task from TaskManager.
:raises: InvalidParameterValue
"""
driver_info = _parse_driver_info(task.node)
if not driver_info['xcat_node']:
raise exception.InvalidParameterValue(_(
"xcat node name not supplied to xcat baremetal driver."))
if not driver_info['port']:
raise exception.InvalidParameterValue(_(
"IPMI terminal port not supplied to IPMI driver."))
def start_console(self, task):
"""Start a remote console for the node."""
driver_info = _parse_driver_info(task.node)
path = _console_pwfile_path(driver_info['uuid'])
pw_file = console_utils.make_persistent_password_file(
path, driver_info['password'])
ipmi_cmd = "/:%(uid)s:%(gid)s:HOME:ipmitool -H %(address)s" \
" -I lanplus -U %(user)s -f %(pwfile)s" \
% {'uid': os.getuid(),
'gid': os.getgid(),
'address': driver_info['address'],
'user': driver_info['username'],
'pwfile': pw_file}
if CONF.debug:
ipmi_cmd += " -v"
ipmi_cmd += " sol activate"
console_utils.start_shellinabox_console(driver_info['uuid'],
driver_info['port'],
ipmi_cmd)
def stop_console(self, task):
"""Stop the remote console session for the node."""
driver_info = _parse_driver_info(task.node)
console_utils.stop_shellinabox_console(driver_info['uuid'])
utils.unlink_without_raise(_console_pwfile_path(driver_info['uuid']))
def get_console(self, task):
"""Get the type and connection information about the console."""
driver_info = _parse_driver_info(task.node)
url = console_utils.get_shellinabox_console_url(driver_info['port'])
return {'type': 'shellinabox', 'url': url}
@@ -0,0 +1,110 @@
"""
util for xcat baremetal driver
exec_xcatcmd
xcat_ssh to excute remote cmd
"""
import paramiko
import time
import socket
from ironic.openstack.common import log as logging
from oslo.config import cfg
from ironic.drivers.modules import xcat_exception
from ironic.common import utils
xcat_opts = [
cfg.IntOpt('ssh_session_timeout',
default=10,
help='ssh session time'),
cfg.FloatOpt('ssh_shell_wait',
default=0.5,
help='wait time for the ssh cmd excute'),
cfg.IntOpt('ssh_buf_size',
default=65535,
help='Maximum size (in charactor) of cache for ssh, '
'including those in use'),
cfg.StrOpt('ssh_key',
default=None,
help='ssh private key to login '),
cfg.StrOpt('ssh_key_pass',
default=None,
help='Maximum size (in charactor) of cache for ssh, '
'including those in use'),
]
LOG = logging.getLogger(__name__)
CONF = cfg.CONF
CONF.register_opts(xcat_opts, group='xcat')
LAST_CMD_TIME = {}
def xcat_ssh(ip,port,username,password,cmd):
""" exec remote command with ssh """
key =None
if CONF.xcat.ssh_key:
try:
key=paramiko.RSAKey.from_private_key_file(CONF.xcat.ssh_key)
except paramiko.PasswordRequiredException:
if not CONF.ssh_key_pass:
raise Exception.message("no pubkey password")
key = paramiko.RSAKey.from_private_key_file(
CONF.xcat.ssh_key, CONF.xcat.ssh_key.ssh_key_pass)
s = paramiko.SSHClient()
s.set_missing_host_key_policy(paramiko.AutoAddPolicy())
try:
s.connect(ip,port,username=username,password=password,pkey=key,
timeout=CONF.xcat.ssh_session_timeout)
except socket.timeout as e:
LOG.error(_("Unable to connect to the ssh server Exception: %(exception)s"),
{'exception': e})
chan = s.invoke_shell()
output = chan.recv(CONF.xcat.ssh_buf_size)
while not output.rstrip().endswith('#') and not output.rstrip().endswith('$'):
output = chan.recv(CONF.xcat.ssh_buf_size)
for c in cmd :
_xcat_ssh_exec(chan,c,password)
def _xcat_ssh_exec(chan,cmd,password):
""" exec ssh command """
chan.send(cmd + '\n')
time.sleep(CONF.xcat.ssh_shell_wait)
ret = chan.recv(CONF.xcat.ssh_buf_size)
if 'password' in ret and ret.rstrip().endswith(':'):
chan.send(password + '\n')
output = chan.recv(CONF.xcat.ssh_buf_size)
while not output.rstrip().endswith('#') and not output.rstrip().endswith('$'):
output = chan.recv(CONF.xcat.ssh_buf_size)
return output
def _tsplit(string, delimiters):
""" Behaves str.split but supports multiple delimiters. """
delimiters = tuple(delimiters)
stack = [string,]
for delimiter in delimiters:
for i, substring in enumerate(stack):
substack = substring.split(delimiter)
stack.pop(i)
for j, _substring in enumerate(substack):
stack.insert(i+j, _substring)
return stack
def exec_xcatcmd(driver_info, command, args):
""" excute xcat cmd """
cmd = [command,
driver_info['xcat_node']
]
cmd.extend(args.split(" "))
# NOTE: ensure that no communications are excuted more
# often than once every min_command_interval seconds.
time_till_next_poll = CONF.ipmi.min_command_interval - (
time.time() - LAST_CMD_TIME.get(driver_info['xcat_node'], 0))
if time_till_next_poll > 0:
time.sleep(time_till_next_poll)
try:
out, err = utils.execute(*cmd)
if err:
raise xcat_exception.xCATCmdFailure(cmd=cmd,node=driver_info['xcat_node'],
args=args)
finally:
LAST_CMD_TIME[driver_info['xcat_node']] = time.time()
return out, err
@@ -0,0 +1,27 @@
"""
XCATBaremetalDriver
use xcat to deploy a baremetal machine
"""
from ironic.drivers import base
from ironic.drivers.modules import ipmitool
from ironic.drivers.modules import pxe
from ironic.drivers.modules import xcat_pxe
from ironic.drivers import utils
from ironic.drivers.modules import xcat_rpower
class XCATBaremetalDriver(base.BaseDriver):
"""xCAT driver
This driver implements the `core` functionality, combinding
:class:`ironic.drivers.xcat_rpower.XcatPower` for power on/off and reboot with
:class:`ironic.driver.xcat_pxe.PXEDeploy` for image deployment. Implementations are in
those respective classes; this class is merely the glue between them.
"""
def __init__(self):
self.power = xcat_rpower.XcatPower()
self.console = ipmitool.IPMIShellinaboxConsole()
self.deploy = xcat_pxe.PXEDeploy()
self.management = ipmitool.IPMIManagement()
self.vendor = pxe.VendorPassthru()
@@ -0,0 +1,33 @@
[DEFAULT]
# The list of modules to copy from oslo-incubator
module=cliutils
module=config.generator
module=context
module=db
module=db.sqlalchemy
module=db.sqlalchemy.migration_cli
module=eventlet_backdoor
module=excutils
module=fileutils
module=gettextutils
module=importutils
module=jsonutils
module=local
module=lockutils
module=log
module=loopingcall
module=network_utils
module=periodic_task
module=policy
module=processutils
module=service
module=strutils
module=timeutils
module=versionutils
# Tools
# The base module to hold the copy of openstack.common
base=ironic
@@ -0,0 +1,51 @@
[metadata]
name = ironic
version = 2014.2
summary = OpenStack Bare Metal Provisioning
description-file =
README.rst
author = chenglch
author-email = chenglch@cn.ibm.com
home-page = http://xcat.sf.net/
classifier =
Environment :: OpenStack
Intended Audience :: Information Technology
Intended Audience :: System Administrators
License :: OSI Approved :: Apache Software License
Operating System :: POSIX :: Linux
Programming Language :: Python
Programming Language :: Python :: 2
Programming Language :: Python :: 2.7
Programming Language :: Python :: 2.6
[files]
packages =
ironic
[entry_points]
ironic.drivers =
agent_ipmitool = ironic.drivers.agent:AgentAndIPMIToolDriver
agent_pyghmi = ironic.drivers.agent:AgentAndIPMINativeDriver
agent_ssh = ironic.drivers.agent:AgentAndSSHDriver
fake = ironic.drivers.fake:FakeDriver
fake_agent = ironic.drivers.fake:FakeAgentDriver
fake_iboot = ironic.drivers.fake:FakeIBootDriver
fake_ipminative = ironic.drivers.fake:FakeIPMINativeDriver
fake_ipmitool = ironic.drivers.fake:FakeIPMIToolDriver
fake_pxe = ironic.drivers.fake:FakePXEDriver
fake_seamicro = ironic.drivers.fake:FakeSeaMicroDriver
fake_ssh = ironic.drivers.fake:FakeSSHDriver
ilo = ironic.drivers.ilo:IloDriver
pxe_iboot = ironic.drivers.pxe:PXEAndIBootDriver
pxe_ipminative = ironic.drivers.pxe:PXEAndIPMINativeDriver
pxe_ipmitool = ironic.drivers.pxe:PXEAndIPMIToolDriver
pxe_seamicro = ironic.drivers.pxe:PXEAndSeaMicroDriver
pxe_ssh = ironic.drivers.pxe:PXEAndSSHDriver
pxe_xcat = ironic.drivers.xcat:XCATBaremetalDriver
[pbr]
autodoc_index_modules = True
[global]
setup-hooks =
pbr.hooks.setup_hook
@@ -0,0 +1,30 @@
#!/usr/bin/env python
# Copyright (c) 2013 Hewlett-Packard Development Company, L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# THIS FILE IS MANAGED BY THE GLOBAL REQUIREMENTS REPO - DO NOT EDIT
import setuptools
# In python < 2.7.4, a lazy loading of package `pbr` will break
# setuptools if some other modules registered functions in `atexit`.
# solution from: http://bugs.python.org/issue15881#msg170215
try:
import multiprocessing # noqa
except ImportError:
pass
setuptools.setup(
setup_requires=['pbr'],
pbr=True)
@@ -0,0 +1,22 @@
hacking>=0.8.0,<0.9
coverage>=3.6
discover
fixtures>=0.3.14
mock>=1.0
Babel>=1.3
MySQL-python
psycopg2
python-ironicclient
python-subunit>=0.0.18
testrepository>=0.0.18
testtools>=0.9.34
# Doc requirements
sphinx>=1.1.2,!=1.2.0,<1.3
sphinxcontrib-pecanwsme>=0.8
oslosphinx
# Required for Nova unit tests in ironic/nova/tests/ and can be removed
# once the driver code lands in Nova.
http://tarballs.openstack.org/nova/nova-master.tar.gz#egg=nova
mox>=0.5.3
+1 -1
View File
@@ -89,7 +89,7 @@ rm -rf $RPM_BUILD_ROOT
%ifos linux
if [ -f "/proc/cmdline" ]; then # prevent running it during install into chroot image
if [ -f $RPM_INSTALL_PREFIX0/sbin/xcatd ]; then
/etc/init.d/xcatd reload
/etc/init.d/xcatd restart
fi
fi
%endif
+1 -1
View File
@@ -40,7 +40,7 @@ my $hnmatch = $ARGV[0]; # if they specified a hostname match, only show svrs th
readconf("$ENV{HOME}/.slconfig"); # get the userid and api key from the config file
my $slinstalled = eval { push @INC, $CONFIG{apidir}; require SoftLayer::API::SOAP; };
if (!$slinstalled) { die "Error: the SoftLayer::API::SOAP perl module is not installed. Download it using 'git clone https://github.com/softlayer/softlayer-api-perl-client' and put the directory in ~/.slconfig ."; }
if (!$slinstalled) { die "$@\nError: either the SoftLayer::API::SOAP perl module is not installed, or some dependencies are missing. Download it using 'git clone https://github.com/softlayer/softlayer-api-perl-client', put the directory in ~/.slconfig , and ensure its dependencies are installed."; }
my $client = SoftLayer::API::SOAP->new('SoftLayer_Account', undef, $CONFIG{userid}, $CONFIG{apikey});
+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)
+88
View File
@@ -0,0 +1,88 @@
#!/usr/bin/perl
# remove entries from the .ssh/known_hosts file for a node
use strict;
use Getopt::Long;
use Data::Dumper;
#$Data::Dumper::Maxdepth=2;
# Globals - these are set once and then only read.
my $HELP;
my $VERBOSE;
my $file = '~/.ssh/known_hosts';
my $usage = sub {
my $exitcode = shift @_;
print "Usage: khrem <node>\n";
print " Removes the entries in the .ssh/known_hosts file associated with this node.\n";
exit $exitcode;
};
# Process the cmd line args
Getopt::Long::Configure("bundling");
#Getopt::Long::Configure("pass_through");
Getopt::Long::Configure("no_pass_through");
if (!GetOptions('h|?|help' => \$HELP, 'v|verbose' => \$VERBOSE)) { $usage->(1); }
if ($HELP) { $usage->(0); }
if (scalar(@ARGV)!=1) { $usage->(1); }
my $node = $ARGV[0]; # if they specified a hostname match, only show svrs that start with that
my @output = runcmd("host $node");
my $hostname;
my $line = shift @output;
#print "line=$line\n";
if ($line =~ m/is an alias for /) {
($hostname) = $line =~ m/is an alias for ([^\.]+)/;
#print "hostname=$hostname\n";
$line = shift @output;
}
#print "line=$line\n";
my ($ip) = $line =~ m/has address (.+)$/;
if (defined($hostname)) {
print "Removing entries from $file for: $node, $hostname, $ip\n";
runcmd("sed -i '/^$node/d;/^$hostname/d;/^$ip/d' $file");
}
else {
print "Removing entries from $file for: $node, $ip\n";
runcmd("sed -i '/^$node/d;/^$ip/d' $file");
}
exit(0);
# Pring msg only if -v was specified
sub verbose { if ($VERBOSE) { print shift, "\n"; } }
# Run a command. If called in the context of return an array, it will capture the output
# of the cmd and return it. Otherwise, it will display the output to stdout.
# If the cmd has a non-zero rc, this function will die with a msg.
sub runcmd
{
my ($cmd) = @_;
my $rc;
$cmd .= ' 2>&1' ;
verbose($cmd);
my @output;
if (wantarray) {
@output = `$cmd`;
$rc = $?;
}
else {
system($cmd);
$rc = $?;
}
if ($rc) {
$rc = $rc >> 8;
if ($rc > 0) { die "Error: rc $rc return from cmd: $cmd\n"; }
else { die "Error: system error returned from cmd: $cmd\n"; }
}
elsif (wantarray) { return @output; }
}
+104 -25
View File
@@ -12,26 +12,43 @@ use Socket;
# Globals - these are set once and then only read.
my $HELP;
my $VERBOSE;
my $DRYRUN;
my $WAITTIME;
my $PROVMETHOD;
my $XCATNETBOOTTITLE = 'xCAT network boot kernel and initrd';
my $usage = sub {
my $exitcode = shift @_;
print "Usage: modifygrub [-?|-h|--help] [-v|--verbose] [-w <waittime>] [-p <provmethod] <kernel-path> <initrd-path> <kernel-parms> <mn-ip>\n\n";
print "Usage: modifygrub [-?|-h|--help] [-v|--verbose] [--dryrun] [-w <waittime>] [-p <provmethod] <kernel-path> <initrd-path> <kernel-parms> <mn-ip>\n\n";
if (!$exitcode) {
print "Modify the grub config file on the node to boot the specified kernel and initrd.\n";
}
exit $exitcode;
};
if (-f '/etc/os-release') { die "This script doesn't support ubuntu yet.\n"; }
my $file = '/etc/os-release';
if (-f $file) {
#
# SLES and RHEL also have /etc/os-release file, so actually need to open the file
# and look for Ubuntu in the 'NAME=' lines before declaring Ubuntu
#
open my $info, $file or die "Could not open $file: $!";
while( my $line = <$info>) {
if (index($line, 'NAME=') != -1) {
if ($line =~ /Ubuntu/i) {
die "This script does not support Ubuntu at this time.\n";
}
}
}
close $info;
}
# Process the cmd line args
Getopt::Long::Configure("bundling");
#Getopt::Long::Configure("pass_through");
Getopt::Long::Configure("no_pass_through");
if (!GetOptions('h|?|help' => \$HELP, 'v|verbose' => \$VERBOSE, 'w|waittime=s' => \$WAITTIME, 'p|provmethod=s' => \$PROVMETHOD)) { $usage->(1); }
if (!GetOptions('h|?|help' => \$HELP, 'v|verbose' => \$VERBOSE, 'dryrun' => \$DRYRUN, 'w|waittime=s' => \$WAITTIME, 'p|provmethod=s' => \$PROVMETHOD)) { $usage->(1); }
if ($HELP) { $usage->(0); }
if (scalar(@ARGV) != 4) { $usage->(1); }
@@ -59,26 +76,53 @@ sub addKernelParms {
# replace <nodename> with the nodename
my $nodename = $ENV{NODE}; # this env var is set by xdsh
$args->{kernelparms} =~ s/<nodename>/$nodename/g;
# get node ip and add it to the kernel parms
my ($nic, $ip, $netmask, $network, $broadcast, $gateway, $mac) = getNodeIpInfo($args);
if (!$ip) { die "Error: could not find the NIC that would connect to the xCAT mgmt node's IP (".$args->{mnip}.").\n"; }
# if we are booting genesis, need to add the BOOTIF parm
my $bootif;
#if (defined($PROVMETHOD) && $PROVMETHOD eq 'sysclone') {
if ($args->{kernelpath} =~ m/genesis\.kernel\.x86_64/) {
$bootif = $mac;
# genesis case, add additional parms for sysclone or nodeset shell
my $bootif = $mac;
$bootif =~ s/:/-/g;
$bootif = "BOOTIF=01-$bootif";
}
if (defined($PROVMETHOD) && $PROVMETHOD eq 'sysclone') {
# add additional parms for sysclone
# DEVICE=eth0 IPADDR=10.0.0.99 NETMASK=255.255.255.0 NETWORK=10.0.0.0 BROADCAST=10.0.0.255 GATEWAY=10.0.0.1 GATEWAYDEV=eth0
#todo: should we also add ETHER_SLEEP=$WAITTIME textmode=1 dns=$mnip ?
$args->{kernelparms} .= " $bootif IPADDR=$ip NETMASK=$netmask NETWORK=$network BROADCAST=$broadcast GATEWAY=$gateway HOSTNAME=$nodename DEVICE=$nic GATEWAYDEV=$nic";
}
else { # scripted install or genesis shell
$args->{kernelparms} .= " $bootif hostip=$ip netmask=$netmask gateway=$gateway dns=$mnip hostname=$nodename netdevice=$nic netwait=$WAITTIME textmode=1";
else { # scripted install (kickstart or autoyast)
if ($args->{kernelparms} =~ m/autoyast=/) { # sles
# if site.managedaddressmode=static is set, it will put several of these kernel parms on there for us. Do not duplicate in that case.
if ($args->{kernelparms} !~ m/ hostip=/) { $args->{kernelparms} .= " hostip=$ip"; }
if ($args->{kernelparms} !~ m/ netmask=/) { $args->{kernelparms} .= " netmask=$netmask"; }
if ($args->{kernelparms} !~ m/ gateway=/) { $args->{kernelparms} .= " gateway=$gateway"; }
if ($args->{kernelparms} !~ m/ hostname=/) { $args->{kernelparms} .= " hostname=$nodename"; }
if ($args->{kernelparms} !~ m/ dns=/) { $args->{kernelparms} .= " dns=$mnip"; }
# If they set installnic=mac (recommended), the netdevice will already be set to the mac.
# If they explicitly set installnic=<nic>, then ksdevice will be set to that and we will not disturb it here.
# Otherwise add netdevice set to the nic we calculated it should be.
if ($args->{kernelparms} !~ m/ netdevice=/) { $args->{kernelparms} .= " netdevice=$nic"; }
$args->{kernelparms} .= " netwait=$WAITTIME textmode=1";
# print Dumper($args->{kernelparms})
}
elsif ($args->{kernelparms} =~ m/ks=/) { # rhel/centos
# See https://www.centos.org/docs/5/html/Installation_Guide-en-US/s1-kickstart2-startinginstall.html
# and http://fedoraproject.org/wiki/Anaconda/NetworkIssues for description of kickstart kernel parms
# if site.managedaddressmode=static is set, it will put several of these kernel parms on there for us. Do not duplicate in that case.
if ($args->{kernelparms} !~ m/ ip=/) { $args->{kernelparms} .= " ip=$ip"; }
if ($args->{kernelparms} !~ m/ netmask=/) { $args->{kernelparms} .= " netmask=$netmask"; }
if ($args->{kernelparms} !~ m/ gateway=/) { $args->{kernelparms} .= " gateway=$gateway"; }
if ($args->{kernelparms} !~ m/ hostname=/) { $args->{kernelparms} .= " hostname=$nodename"; }
if ($args->{kernelparms} !~ m/ dns=/) { $args->{kernelparms} .= " dns=$mnip"; }
# If they set installnic=mac (recommended), the ksdevice will already be set to the mac.
# If they explicitly set installnic=<nic>, then ksdevice will be set to that and we will not disturb it here.
# Otherwise ksdevice will be set to bootif, and we change it to the nic we calculated it should be.
if ($args->{kernelparms} =~ m/ ksdevice=bootif/) { $args->{kernelparms} =~ s/ ksdevice=bootif/ ksdevice=$nic/; }
elsif ($args->{kernelparms} !~ m/ ksdevice=/) { $args->{kernelparms} .= " ksdevice=$nic"; }
$args->{kernelparms} .= " nicdelay=$WAITTIME linksleep=$WAITTIME textmode=1";
# print Dumper($args->{kernelparms})
}
else { die "Error: for scripted installs, only support SLES or RHEL/CentOS as the target OS.\n"; }
}
}
@@ -86,11 +130,11 @@ sub addKernelParms {
# get this nodes nic, ip, netmask, gateway, and mac. Returns them in a 5 element array.
sub getNodeIpInfo {
my $args = shift @_;
my ($ipprefix) = $args->{mnip}=~m/^(\d+\.\d+)\./; #todo: this is a hack, just using the 1st 2 octets of the mn ip addr
my ($ipprefix) = $args->{mnip}=~m/^(\d+)\./; #todo: this is a hack, just using the 1st octet of the mn ip addr
verbose("using IP prefix $ipprefix");
# parse ip addr show output, looking for ipprefix, to determine nic and ip
my @output = runcmd("ip addr show");
# parse ip addr show output, looking for ipprefix, to determine nic, ip, mac
my @output = runcmd("/sbin/ip addr show");
my ($nic, $mac, $ipandmask);
foreach my $line (@output) {
my ($nictmp, $mactmp, $iptmp);
@@ -98,25 +142,55 @@ sub getNodeIpInfo {
if (($mactmp) = $line=~m|^\s+link/ether\s+(\S+) |) { $mac = $mactmp; } # got mac, remember it
if (($iptmp) = $line=~m/^\s+inet\s+($ipprefix\S+) /) { $ipandmask = $iptmp; last; } # got ip, we are done
}
if (!defined($ipandmask)) { die "Error: can't find a NIC with a prefix $ipprefix that communicates with".$args->{mnip}.".\n"; }
my ($ip, $netmask, $network, $broadcast) = convertIpAndMask($ipandmask);
# if the nic is a bonded nic (common on sl), then find the 1st real nic that is part of it
my $realnic = $nic;
# if the nic is a bonded nic (common on sl), then find the 1st real nic that is up that is part of it.
# also find that real nics real mac
my $realnic;
if ($nic =~ /^bond/) {
my @nics = grep(m/\s+master\s+$nic\s+/, @output);
if (!scalar(@nics)) { die "Error: can't find the NICs that are part of $nic.\n"; }
($realnic) = $nics[0]=~m/^\d+:\s+(\S+): /;
# go back thru the ip add show output and find the mac of this nic
foreach my $line (@output) {
my ($nictmp, $mactmp, $foundnic);
if (($nictmp) = $line=~m/^\d+:\s+(\S+): / && $nictmp eq $realnic) { $foundnic = 1; }
if (($mactmp) = $line=~m|^\s+link/ether\s+(\S+) | && $foundnic) { $mac = $mactmp; last; } # got mac, we are done
foreach my $line (@nics) {
my ($nictmp, $state) = $line=~m/^\d+:\s+(\S+): .* state\s+(\S+)/;
if (defined($nictmp) && defined($state) && $state eq 'UP') { $realnic = $nictmp; last; } # got ip, we are done
}
if (!defined($realnic)) { die "Error: can't find a physical NIC that is up and part of $nic.\n"; }
# now get the real mac of this real nic (when 2 nics are bonded, ip addr show displays one of the nics
# macs for both nics and the bond). So we have to depend on /proc/net/bonding/$bond instead.
my @bondout = runcmd("cat /proc/net/bonding/$nic");
my $foundnic;
foreach my $line (@bondout) {
my $mactmp;
if ($line=~m/^Slave Interface:\s+$realnic/) { $foundnic = 1; } # found the stanza for this nic, remember it
if ($foundnic && (($mactmp) = $line=~m/^Permanent HW addr:\s+(\S+)/)) { $mac = $mactmp; last; }
}
}
else { $realnic = $nic; }
# centos/redhat seems to name the nic in a different order than sles on some svrs.
# sles seems to name them in the same order as 'ip addr show' displays them, centos does not.
# so if we are on centos right now, we need to count down to determine the number that sles
# will give the nic that we have selected, because it is the sles naming that we care about,
# because that is the initrd that will be running in the scripted install case.
# This works similarly (at least in some case) when rhel is the target OS.
# The preferred way is for the user to set installnic=mac, then we do not need to run this code.
# For the sysclone case, genesis doxcat uses the mac to find the nic.
if (isRedhat() && $args->{kernelparms} !~ m/ ksdevice=\S*:/ && $args->{kernelparms} !~ m/ netdevice=\S*:/) {
my @nics = grep(m/^\d+:\s+eth/, @output);
my $i = 0;
foreach my $line (@nics) {
my ($nictmp) = $line=~m/^\d+:\s+(\S+):/;
if (defined($nictmp) && $nictmp eq $realnic) { $realnic = "eth$i"; last; } # got ip, we are done
$i++;
}
print "Determined that SLES/RHEL will call the install NIC $realnic (it has mac $mac)\n";
}
# finally, find the gateway
my $gateway;
my @output = runcmd("ip route");
my @output = runcmd("/sbin/ip route");
# we are looking for a line like: 10.0.0.0/8 via 10.54.51.1 dev bond0
my @networks = grep(m/ via .* $nic\s*$/, @output);
if (scalar(@networks)) { ($gateway) = $networks[0]=~m/ via\s+(\S+)/; }
@@ -197,6 +271,11 @@ sub updateGrub {
"\tkernel " . $fileprefix . $args->{kernelpath} . ' ' . $args->{kernelparms} . "\n",
"\tinitrd " . $fileprefix . $args->{initrdpath} . "\n",
);
if ($DRYRUN) {
print "Dry run: would add this stanza to $grubfile:\n";
foreach my $l (@entry) { print $l; }
return;
}
my $needtowritefile = 1;
if (grep(/^title\s+$XCATNETBOOTTITLE/, @lines)) { $needtowritefile = updateGrubEntry(\@lines, \@entry); } # there is already an entry in there
+144 -38
View File
@@ -4,7 +4,7 @@
# even across vlans (w/o setting up pxe/dhcp broadcast relay). This assumes a working
# OS is on the node. This script is primarily meant to be used in the softlayer environment.
#todo: site attr for using static ip?
#todo: work with site.managedaddressmode=static for sles
use strict;
use Getopt::Long;
@@ -13,45 +13,50 @@ use Data::Dumper;
# Globals - these are set once and then only read.
my $HELP;
my $VERBOSE;
my $DRYRUN;
my $WAITTIME;
my $NOAUTOINST;
my $usage = sub {
my $exitcode = shift @_;
print "Usage: pushinitrd [-?|-h|--help] [-v|--verbose] [-w <waittime>] <noderange>\n\n";
print "Usage: pushinitrd [-?|-h|--help] [-v|--verbose] [--dryrun] [-w <waittime>] [--noautoinst] <noderange>\n\n";
if (!$exitcode) {
print "Copy the initrd, kernel, params, and static IP info to nodes, so they can net install\n";
print "even across vlans (w/o setting up pxe/dhcp broadcast relay). This assumes a working\n";
print "OS is on the node, that you've run nodeset for these nodes, and that all of the nodes\n";
print "are using the same osimage.\n";
print "in this noderange are using the same osimage.\n";
}
exit $exitcode;
};
# Process the cmd line args
Getopt::Long::Configure("bundling");
#Getopt::Long::Configure("pass_through");
# Getopt::Long::Configure("pass_through");
Getopt::Long::Configure("no_pass_through");
if (!GetOptions('h|?|help' => \$HELP, 'v|verbose' => \$VERBOSE, 'w|waittime=s' => \$WAITTIME, 'a|noautoinst' => \$NOAUTOINST)) { $usage->(1); }
if (!GetOptions('h|?|help' => \$HELP, 'v|verbose' => \$VERBOSE, 'dryrun' => \$DRYRUN, 'w|waittime=s' => \$WAITTIME, 'a|noautoinst' => \$NOAUTOINST)) { $usage->(1); }
if ($HELP) { $usage->(0); }
if (scalar(@ARGV) != 1) { $usage->(1); }
if (!defined($WAITTIME)) { $WAITTIME = 75; } # seconds to wait after configuring the nic (to let the switch handle the state change)
my $noderange = $ARGV[0];
#
# Run some Node verification before starting pushinitrd
#
verifyNodeConfiguration($noderange);
my %bootparms = getBootParms($noderange);
copyFilesToNodes($noderange, \%bootparms);
updateGrubOnNodes($noderange, \%bootparms);
if ($bootparms{osimageprovmethod} eq 'install' && !$NOAUTOINST) { modifyAutoinstFiles($noderange, \%bootparms); }
if ($DRYRUN) { exit(0); }
if ($bootparms{osimageprovmethod} eq 'install' && $bootparms{osimageosvers}=~ m/^sles/ && !$NOAUTOINST) { modifyAutoinstFiles($noderange, \%bootparms); }
if ($bootparms{osimageprovmethod} eq 'sysclone') { copySyscloneFiles(); }
exit(0);
# Query the db for the kernel, initrd, and kcmdline attributes of the 1st node in the noderange
sub getBootParms {
my $nr = shift @_;
@@ -66,15 +71,27 @@ sub getBootParms {
# for now just pick the 1st one. They should all be the same, except for the node name in kcmdline
chomp($gresults[0]);
$gresults[0] =~ s/^\S+:\s+$attr:\s*//;
#print "gresults='$gresults[0]'\n";
if ($gresults[0] !~ m/\S/) { die "Error: attribute $attr not defined for the noderange. Did you run 'nodeset <noderange> osimage=<osimage>' ?\n"; }
$bootparms{$a} = $gresults[0];
}
$bootparms{kcmdline} =~ s|/install/autoinst/\S+|/install/autoinst/<nodename>|;
# from the nodes provmethod, get the osimage provmethod, so we know the type of install
@output = runcmd("lsdef -t osimage $bootparms{provmethod} -ci provmethod");
chomp($output[0]);
my ($junk, $provmethod) = split(/=/, $output[0]);
$bootparms{osimageprovmethod} = $provmethod;
@output = runcmd("lsdef -t osimage $bootparms{provmethod} -ci provmethod,osvers");
foreach my $line (@output) {
chomp($line);
if ($line =~ m/^Could not find/) { die "Error: provmethod $bootparms{provmethod} is set for the node, but there is no osimage definition by that name."; }
if ($line =~ m/ provmethod=/) {
my ($junk, $provmethod) = split(/=/, $line);
$bootparms{osimageprovmethod} = $provmethod;
}
if ($line =~ m/ osvers=/) {
my ($junk, $osvers) = split(/=/, $line);
$bootparms{osimageosvers} = $osvers;
}
}
#print "provmethod=$bootparms{osimageprovmethod}, osvers=$bootparms{osimageosvers}\n"; exit;
# get the mgmt node cluster-facing ip addr
@output = runcmd('lsdef -t site -ci master');
@@ -97,8 +114,15 @@ sub copyFilesToNodes {
my $localfile = "/tftpboot/$file";
# for the
my $remotefile = '/boot/' . remoteFilename($file);
print "Copying $localfile to $nr:$remotefile\n";
runcmd("xdcp $nr -p $localfile $remotefile");
my $cmd = "xdcp $nr -p $localfile $remotefile";
if ($DRYRUN) {
print "Dry run: Copying $localfile to $nr:$remotefile\n";
print "Dry run: $cmd\n";
}
else {
print "Copying $localfile to $nr:$remotefile\n";
runcmd($cmd);
}
}
}
@@ -117,10 +141,12 @@ sub updateGrubOnNodes {
my $nr = shift @_;
my $bootparms = shift @_;
my $vtxt = ($VERBOSE ? '-v' : '');
my $dtxt = ($DRYRUN ? '--dryrun' : '');
my @output = runcmd('which modifygrub');
my $modifygrub = $output[0];
chomp($modifygrub);
my $cmd = "xdsh $nr -e $modifygrub $vtxt -w $WAITTIME -p " . $bootparms->{osimageprovmethod} . ' ' . remoteFilename($bootparms->{kernel}) . ' ' . remoteFilename($bootparms->{initrd}) . ' ';
my $euser ="root";
my $cmd = "xdsh $nr -l $euser -e $modifygrub $vtxt $dtxt -w $WAITTIME -p " . $bootparms->{osimageprovmethod} . ' ' . remoteFilename($bootparms->{kernel}) . ' ' . remoteFilename($bootparms->{initrd}) . ' ';
# we need to quote the kernel parms, both here when passing it to xdsh, and on the node
# when xdsh is passing it to modifygrub. The way to get single quotes inside single quotes
# is to quote each of the outer single quotes with double quotes.
@@ -131,8 +157,7 @@ sub updateGrubOnNodes {
}
# Hack the autoinst files to wait in a key spot to make them work even tho it takes
# the NICs almost a min before they can transmit after a state change.
# Hack the autoinst files to overcome the nic coming up delay.
#todo: this has only been tested with SLES nodes
sub modifyAutoinstFiles {
my $nr = shift @_;
@@ -142,36 +167,40 @@ sub modifyAutoinstFiles {
my @nodes = runcmd("nodels $nr");
chomp(@nodes);
# Modify chroot.sles to insert a wait in the /etc/init.d/network of each node. This is
# necessary because even tho compute.sles11.softlayer.tmpl configures bonding, when autoyast
# reboots the node after installing the rpms, it does not bring up the network in the normal way
# at first and seems to skip any bonding and the if-up.d scripts. So we are left doing this.
# (After autoyast is done with all of its post-configuration, it brings up the network in the
# normal way, so bonding gets done then, which is good at least.)
# Edit each file to have chroot.sles insert a wait at the end of /etc/init.d/network
# this finds the end of boot.sh script (which is chroot.sles)
my $search = '\n\]\]>\s*</source>\s*</script>\s*</chroot-scripts>';
# hack the /etc/init.d/network script to put a wait in it
my $file = '/mnt/etc/init.d/network'; # at this point in the installation, the permanent file system is just mounted
#my $waitstring = 'echo Sleeping for 55s;sleep 55';
# this is the string to insert in the nodes /etc/init.d/network script. It is a while loop pinging the mn, but some of the chars need to be escaped for sed
my $waitstring = 'echo -n Waiting to reach xCAT mgmt node ' . $bootparms->{mnip} . '.;xcatretries=60;while \[ \$\(\(xcati+=1\)\) -le \$xcatretries \] \&\& ! ping -c2 -w3 ' . $bootparms->{mnip} .' \>\/dev\/null 2\>\&1; do echo -n .; done; if \[ \$xcati -le \$xcatretries \]; then echo success; else echo failed; fi; sleep 3';
my $waitstring = 'echo -n Waiting to reach xCAT mgmt node ' . $bootparms->{mnip} . '.;xcatretries=60;while \[ \$\(\(xcati+=1\)\) -le \$xcatretries \] \&\& ! ping -c2 -w3 ' . $bootparms->{mnip} .' \>\/dev\/null 2\>\&1; do echo -n .; done; if \[ \$xcati -le \$xcatretries \]; then echo success; else echo failed; fi';
# this crazy sed string is from google. It gathers up the whole file into the hold buffer, and then the substitution is done on the whole file
my $sedstring = q|sed -n '1h;1!H;${;g;s/\(\t\treload_firewall\n\)\n/\1\t\t| . $waitstring . q(\n\n/g;p;}') . " $file > $file.new";
# finally create the perl replace string that will be used to modify the autoinst file
my $replace = "$sedstring\nchmod 755 $file.new; mv -f $file.new $file";
# Now instead we add a script that gets invoked by the OS after the nic is brought up
# these are specific to SLES
#my $netdir = '/etc/sysconfig/network';
#my $filename = '/etc/sysconfig/network/if-up.d/xcat-sl-wait';
#my $mnip = $bootparms->{mnip};
#todo: to support rhel, use these values instead
#my $netdir='/etc/sysconfig/network-scripts';
#my $filename='/sbin/ifup-local';
# this does not work, because midway thru the autoyast process, the if-up.d scripts do not seem to get invoked
# so autoyast fails to get he media
# Add a script that gets invoked by the OS after the nic is brought up
# Note: this does not work, because midway thru the autoyast process, the if-up.d scripts do not seem to get invoked
# so autoyast fails to get the media
# these are specific to SLES
#my $netdir = '/etc/sysconfig/network';
#my $filename = '/etc/sysconfig/network/if-up.d/xcat-sl-wait';
#my $mnip = $bootparms->{mnip};
#todo: to support rhel, use these values instead
#my $netdir='/etc/sysconfig/network-scripts';
#my $filename='/sbin/ifup-local';
#my $replace = qq(
#FILENAME=$filename
#NETDIR=$netdir
#MNIP=$mnip
#);
#FILENAME=$filename
#NETDIR=$netdir
#MNIP=$mnip
#);
# $replace .= q(
#cat >$FILENAME << EOF1
#MNIP=$MNIP
@@ -194,15 +223,36 @@ sub modifyAutoinstFiles {
#chmod +x $FILENAME
#);
# now actually update the file
# The compute.sles11.softlayer.tmpl file contains 2 variables (node ip and netmask) that are
# not replaced by Template.pm. Substitute those in the autoinst files now.
# Also use our own multiline sed to put the network script hack in.
print "Updating /install/autoinst files.\n";
foreach my $n (@nodes) {
my $f = "/install/autoinst/$n";
my ($ip, $netmask, $gateway) = getNodeIpInfo($n);
runcmd("sudo sed -i 's/#NODEIPADDR#/$ip/;s/#NODENETMASK#/$netmask/;s/#NODEGATEWAY#/$gateway/' $f");
my $matches = sed($f, $search, $replace, mode=>'insertbefore');
if (!$matches) { die "Error: could not find the right place in $f to insert the sed of the network wait.\n"; }
}
}
sub verifyNodeConfiguration {
my $nr = shift @_;
my @nodes = runcmd("nodels $nr");
chomp(@nodes);
foreach my $n (@nodes) {
# Verify the IP is set for the node
my @output = runcmd("nodels $n hosts.ip");
chomp($output[0]);
my ($junk, $ip) = split(/\s+/, $output[0]);
#todo: also support getting the ip from name resolution
if (!$ip) {
die "Error: The ip attribute must be set for $n.\n";
}
}
}
# Copy softlayer specific systemimager post-install scripts to the systemimager location.
# These cause si to use static ip and insert a wait into the bring up of the network.
@@ -213,8 +263,64 @@ sub copySyscloneFiles {
}
# Get IP and network of a node
sub getNodeIpInfo {
my $node = shift;
# get ip for the node
my @output = runcmd("nodels $node hosts.ip");
chomp($output[0]);
my ($junk, $ip) = split(/\s+/, $output[0]);
#todo: also support getting the ip from name resolution
# find relevant network in the networks table
# first get the networks in a hash
my %networks;
@output = runcmd("lsdef -t network -ci net,mask,gateway");
foreach my $line (@output) {
chomp($line);
my ($netname, $attr, $val) = $line =~ m/^(.+):\s+(.+?)=(.+)$/;
$networks{$netname}->{$attr} = $val;
}
# now go thru the networks looking for the correct one
my ($netmask, $gateway);
foreach my $key (keys %networks) {
if (isIPinNet($ip, $networks{$key}->{net}, $networks{$key}->{mask})) { # found it
$netmask = $networks{$key}->{mask};
$gateway = $networks{$key}->{gateway};
last;
}
}
if (!$netmask) { die "Error: could not find a network in the networks table that $node $ip is part of.\n"; }
if (!$gateway) { die "Error: gateway not specified in the networks table for the network that $node $ip is part of.\n"; }
verbose("IP info for $node: ip=$ip, netmask=$netmask, gateway=$gateway");
return ($ip, $netmask, $gateway);
}
# Is the IP in the network/netmask combo
sub isIPinNet {
my ($ip, $net, $mask) = @_;
my $ipbin = convert2bin($ip);
my $netbin = convert2bin($net);
my $maskbin = convert2bin($mask);
$ipbin &= $maskbin;
if ($ipbin && $netbin && ($ipbin == $netbin)) { return 1; }
else { return 0; }
}
# Convert dotted decimal format (1.2.3.4) to a binary number
sub convert2bin {
my @arr=split(/\./, shift);
my ($bin) = unpack('N', pack('C4',@arr ) );
return $bin;
}
# this is like multi-line sed replace function
# Args: filename, search-string, replace-string
# Args: filename, search-string, replace-string, options (mode=>{insertbefore,insertafter,replace})
sub sed {
my ($file, $search, $replace, %options) = @_;
#my $opts = 's';
+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!"
@@ -1,6 +0,0 @@
#!/bin/bash
# set the default route of the node to the ip address and nic passed in
set -x
ip route replace to default via $1 dev $2
@@ -67,7 +67,6 @@
</user>
</users>
<networking>
<keep_install_network config:type="boolean">true</keep_install_network>
<dns>
<domain>#TABLE:site:key=domain:value#</domain>
<hostname>#TABLE:nodelist:$NODE:node#</hostname>
@@ -78,10 +77,53 @@
<search>#TABLE:site:key=domain:value#</search>
</searchlist>
</dns>
<interfaces config:type="list">
<interface>
<bonding_master>yes</bonding_master>
<bonding_module_opts>mode=4 miimon=100 downdelay=0 updelay=0 lacp_rate=fast xmit_hash_policy=1</bonding_module_opts>
<bonding_slave0>eth0</bonding_slave0>
<bonding_slave1>eth2</bonding_slave1>
<device>bond0</device>
<bootproto>static</bootproto>
<startmode>auto</startmode>
<ipaddr>#NODEIPADDR#</ipaddr>
<netmask>#NODENETMASK#</netmask>
<usercontrol>no</usercontrol>
</interface>
<interface>
<bootproto>none</bootproto>
<device>eth0</device>
<name>Ethernet Card 0</name>
<startmode>off</startmode>
</interface>
<interface>
<bootproto>none</bootproto>
<device>eth2</device>
<name>Ethernet Card 2</name>
<startmode>off</startmode>
</interface>
</interfaces>
<routing>
<ip_forward config:type="boolean">false</ip_forward>
<routes config:type="list">
<route>
<destination>default</destination>
<device>-</device>
<gateway>#NODEGATEWAY#</gateway>
<netmask>-</netmask>
</route>
</routes>
</routing>
</networking>
<files config:type="list">
<file>
<file_contents><![CDATA[alias bond0 bonding
]]></file_contents>
<file_owner>root</file_owner>
<file_path>/etc/modprobe.d/bond0.conf</file_path>
<file_permissions>644</file_permissions>
</file>
</files>
<scripts>
#INCLUDE:#ENV:XCATROOT#/share/xcat/install/scripts/pre.sles#
#INCLUDE:#ENV:XCATROOT#/share/xcat/install/scripts/chroot.sles#
@@ -1,43 +0,0 @@
#!/bin/bash
# Add a script that will run when the network is brought up to wait until the
# xcat mn can be pinged.
. /tmp/post-install/variables.txt
if [ -d "/etc/sysconfig/network-scripts/" ];then
#redhat
NETDIR=/etc/sysconfig/network-scripts
filename=/sbin/ifup-local
elif [ -d "/etc/sysconfig/network/" ];then
#suse
NETDIR=/etc/sysconfig/network
filename=/etc/sysconfig/network/if-up.d/xcat-sl-wait
else
#ubuntu
echo "Does not support ubuntu."
exit 1
fi
# Create the wait script, overwriting a copy that may have come from the golden client
# (in case the mn/image server is different).
# this part of the file we want to expand the variables in the content
cat >$filename << EOF1
MNIP=$IMAGESERVER
NETDIR=$NETDIR
EOF1
# this part of the file we do NOT want to expand the variables in the content
cat >>$filename << 'EOF2'
NIC="$1"
# look in this ifcfg script to get the nics ip to see if this is the one we should be waiting on
NICIP=`awk -F= '/^IPADDR/ {print $2}' $NETDIR/ifcfg-$NIC | tr -d \' `
if [ "${NICIP%.*.*}" != "${MNIP%.*.*}" ]; then exit; fi # hack: compare the 1st 2 octets
echo -n Waiting to reach xCAT mgmt node $MNIP.
xcatretries=60
while [ $((xcati+=1)) -le $xcatretries ] && ! ping -c2 -w3 $MNIP >/dev/null 2>&1; do echo -n .; done
if [ $xcati -le $xcatretries ]; then echo " success"; else echo " failed"; fi
sleep 3
EOF2
chmod +x $filename
+82
View File
@@ -0,0 +1,82 @@
#!/bin/bash
# SI post-install script to configure the efi boot mgr or grub after SI has installed the OS
# SI post-install scripts run in a chroot environment of the final OS image
if [ -d /sys/firmware/efi ]; then
echo "Setting Boot Manager for the next boot."
echo "delete all sysclone boot list"
str_bootnums=`efibootmgr | grep 'syscloneLinux' | awk '{print $1}' | sed 's/boot//i' | sed 's/*//'`
for str_num in $str_bootnums
do
efibootmgr -b $str_num -B -q
done
if [ -f "/boot/efi/EFI/redhat/grub.efi" ];then
efibootmgr -c -l \\EFI\\redhat\\grub.efi -L syscloneLinux
elif [ -f "/boot/efi/efi/SuSE/elilo.efi" ];then
efibootmgr -c -l \\efi\\SuSE\\elilo.efi -L syscloneLinux
else
echo "Can not find the boot loader."
exit 1
fi
else
echo "run grub-install to configure the MBR."
if [ -e /etc/mtab ];then
mv /etc/mtab /etc/mtab.bak
fi
grep -v rootfs /proc/mounts > /etc/mtab
boot_device=''
if [ -f "/etc/systemconfig/systemconfig.conf" ];then
boot_device=`cat /etc/systemconfig/systemconfig.conf | grep BOOTDEV | awk '{print $3}'`
else
boot_root=`mount | grep -E ' on\s+/ type ' | awk '{print $1}'`
boot_device=`echo $boot_root | sed -e 's/[0-9]*$//'`
#str_temp=`mount | awk '{print $1","$3}'`
#for line in $str_temp
#do
# mp=`echo $line | awk -F, '{print $2}'`
# if [ "$mp" = "/" ];then
# boot_device=`echo $line | awk -F, '{print $1}' | sed -e 's/[0-9]*$//'`
# break
# fi
#done
fi
if [ -n "$boot_device" ];then
echo "The boot device is $boot_device"
echo "The boot root device is $boot_root"
else
echo "Can not find the boot device, return error"
exit 1
fi
# set grub to use this boot device
if grep -qe '^VERSION\s*=\s*11' /etc/SuSE-release; then
#sles11, run grub-install.unsupported directly
echo "grub-install.unsupported --no-floppy --recheck $boot_device"
grub-install.unsupported --no-floppy --recheck $boot_device
# note: the error about grub-set-default not existing is harmless, because we want the default to be 0 anyway
else
#for sles10, should run grub-install with parameters
echo "grub-install --no-floppy --recheck $boot_device"
grub-install --no-floppy --recheck $boot_device
fi
# change the entries in the grub conf file to use the correct boot root device
# (not the one leftover from the golden image)
if [ -f "/boot/grub/grub.conf" ];then
conffile="/boot/grub/grub.conf"
else
conffile="/boot/grub/menu.lst"
fi
sed -i 's| root=\S*| root='$boot_root'|' $conffile
sed -i 's| resume=\S*| noresume|' $conffile
if [ -e /etc/mtab.bak ];then
mv -f /etc/mtab.bak /etc/mtab
else
rm -f /etc/mtab
fi
fi
@@ -1,9 +1,12 @@
#!/bin/bash
# Configure network settings after SI has installed the OS
# SI post-install script to configure network settings after SI has installed the OS
# SI post-install scripts run in a chroot environment of the final OS image
. /tmp/post-install/variables.txt
bondingopts='mode=4 miimon=100 downdelay=0 updelay=0 lacp_rate=fast xmit_hash_policy=1'
# determine if we should be using a static ip or dhcp
staticIP () {
# Eventually we should use the SI variable IP_ASSIGNMENT_METHOD below to determine this.
@@ -35,11 +38,23 @@ if [ -n "$rule_file" ];then
fi
hostname $HOSTNAME
bond=bond0
# this is a softlayer assumption that the two devices on the private net will be eth0 and eth2
if [[ $DEVICE == "eth0" ]]; then
DEVICE2=eth2
elif [[ $DEVICE == "eth2" ]]; then
DEVICE2=eth0
fi
ip addr show|grep -q -E "^[0-9]+:\s+$DEVICE2:" # make sure it exists on the system
if [[ $? == 0 ]]; then
DEVICE2EXISTS="yes"
fi
device_names=`ifconfig -a | grep -i hwaddr | grep -i 'Ethernet' | grep -v usb| awk '{print $1}'`
str_cfg_file=''
if [ -d "/etc/sysconfig/network-scripts/" ];then
#redhat
dir="/etc/sysconfig/network-scripts"
grep -i HOSTNAME /etc/sysconfig/network
if [ $? -eq 0 ];then
sed -i "s/HOSTNAME=.*/HOSTNAME=$HOSTNAME/g" /etc/sysconfig/network
@@ -47,21 +62,60 @@ if [ -d "/etc/sysconfig/network-scripts/" ];then
echo "HOSTNAME=$HOSTNAME" >> /etc/sysconfig/network
fi
if staticIP; then
# delete all nic cfg files left over from the golden node
for i in $device_names;do
rm -f "$dir/ifcfg-$i"
done
# set static ip from variables in variables.txt
i="$DEVICE"
str_cfg_file="/etc/sysconfig/network-scripts/ifcfg-$i"
# write ifcfg-bond0. For now we assume the installnic should be part of bond0,
# because in SL i think that is always the case.
i="$bond"
str_cfg_file="$dir/ifcfg-$i"
echo "DEVICE=$i" > $str_cfg_file
echo "BOOTPROTO=static" >> $str_cfg_file
echo "BOOTPROTO=none" >> $str_cfg_file
echo "ONBOOT=yes" >> $str_cfg_file
echo "USERCTL=no" >> $str_cfg_file
echo 'BONDING_OPTS="'$bondingopts'"' >> $str_cfg_file
echo "IPADDR=$IPADDR" >> $str_cfg_file
echo "NETMASK=$NETMASK" >> $str_cfg_file
echo "NETWORK=$NETWORK" >> $str_cfg_file
echo "BROADCAST=$BROADCAST" >> $str_cfg_file
#todo: add gateway config? Not sure, because the boot kernels gateway might not be the final OS gateway
# write ifcfg-eth0
i="$DEVICE"
str_cfg_file="$dir/ifcfg-$i"
echo "DEVICE=$i" > $str_cfg_file
echo "BOOTPROTO=none" >> $str_cfg_file
echo "MASTER=$bond" >> $str_cfg_file
echo "ONBOOT=yes" >> $str_cfg_file
echo "SLAVE=yes" >> $str_cfg_file
echo "USERCTL=no" >> $str_cfg_file
i="$DEVICE2"
str_cfg_file="$dir/ifcfg-$i"
if [[ $DEVICE2EXISTS == "yes" ]]; then
# write ifcfg-eth2
echo "DEVICE=$i" > $str_cfg_file
echo "BOOTPROTO=none" >> $str_cfg_file
echo "MASTER=$bond" >> $str_cfg_file
echo "ONBOOT=yes" >> $str_cfg_file
echo "SLAVE=yes" >> $str_cfg_file
echo "USERCTL=no" >> $str_cfg_file
else
rm -f $str_cfg_file # in case it was left over in the image that was captured
fi
# write modprobe alias config
str_cfg_file="/etc/modprobe.d/$bond.conf"
echo "alias $bond bonding" > $str_cfg_file
#todo: figure out how to set the default gateway in rhel
else
# use dhcp for all nics
for i in $device_names;do
str_cfg_file="/etc/sysconfig/network-scripts/ifcfg-$i"
str_cfg_file="$dir/ifcfg-$i"
echo "DEVICE=$i" > $str_cfg_file
echo "BOOTPROTO=dhcp" >> $str_cfg_file
echo "NM_CONTROLLED=yes" >> $str_cfg_file
@@ -70,23 +124,77 @@ if [ -d "/etc/sysconfig/network-scripts/" ];then
fi
elif [ -d "/etc/sysconfig/network/" ];then
#suse
dir="/etc/sysconfig/network"
echo "$HOSTNAME" > /etc/HOSTNAME
if staticIP; then
# delete all nic cfg files left over from the golden node
for i in $device_names;do
rm -f "$dir/ifcfg-$i"
done
# set static ip from variables in variables.txt
i="$DEVICE"
str_cfg_file="/etc/sysconfig/network/ifcfg-$i"
echo "DEVICE=$i" > $str_cfg_file
echo "BOOTPROTO=static" >> $str_cfg_file
# write ifcfg-bond0. For now we assume the installnic should be part of bond0,
# because in SL i think that is always the case.
i="$bond"
str_cfg_file="$dir/ifcfg-$i"
echo "BOOTPROTO=static" > $str_cfg_file
echo "STARTMODE=onboot" >> $str_cfg_file
echo "BONDING_MASTER=yes" >> $str_cfg_file
echo "BONDING_MODULE_OPTS='$bondingopts'" >> $str_cfg_file
echo "NAME='Bonded Interface'" >> $str_cfg_file
echo "IPADDR=$IPADDR" >> $str_cfg_file
echo "NETMASK=$NETMASK" >> $str_cfg_file
echo "NETWORK=$NETWORK" >> $str_cfg_file
echo "BROADCAST=$BROADCAST" >> $str_cfg_file
echo "USERCONTROL=no" >> $str_cfg_file
echo "BONDING_SLAVE_0=$DEVICE" >> $str_cfg_file
if [[ $DEVICE2EXISTS == "yes" ]]; then
echo "BONDING_SLAVE_1=$DEVICE2" >> $str_cfg_file
fi
# write ifcfg-eth0
i="$DEVICE"
str_cfg_file="$dir/ifcfg-$i"
echo "BOOTPROTO=none" > $str_cfg_file
echo "STARTMODE=hotplug" >> $str_cfg_file
i="$DEVICE2"
str_cfg_file="$dir/ifcfg-$i"
if [[ $DEVICE2EXISTS == "yes" ]]; then
# write ifcfg-eth2
echo "BOOTPROTO=none" > $str_cfg_file
echo "STARTMODE=hotplug" >> $str_cfg_file
else
rm -f $str_cfg_file # in case it was left over in the image that was captured
fi
# write modprobe alias config
str_cfg_file="/etc/modprobe.d/$bond.conf"
echo "alias $bond bonding" > $str_cfg_file
# set the default gateway (at this point this is the private nic gateway, to handle provision across vlans)
file=/etc/sysconfig/network/routes
if grep -q -E '^default ' $file; then
# replace the default route that is already in there
sed -i 's/^default .*$/default '$GATEWAY' - -/' $file
else
# no default route yet, append to file
echo "default $GATEWAY - -" >>$file
fi
# this was the original config of the eth0 nic (without bonding)
#echo "DEVICE=$i" > $str_cfg_file
#echo "BOOTPROTO=static" >> $str_cfg_file
#echo "STARTMODE=onboot" >> $str_cfg_file
#echo "IPADDR=$IPADDR" >> $str_cfg_file
#echo "NETMASK=$NETMASK" >> $str_cfg_file
#echo "NETWORK=$NETWORK" >> $str_cfg_file
#echo "BROADCAST=$BROADCAST" >> $str_cfg_file
#todo: add gateway config? Not sure, because the boot kernels gateway might not be the final OS gateway
else
# use dhcp for all nics
for i in $device_names;do
str_cfg_file="/etc/sysconfig/network/ifcfg-$i"
str_cfg_file="$dir/ifcfg-$i"
echo "DEVICE=$i" > $str_cfg_file
echo "BOOTPROTO=dhcp" >> $str_cfg_file
echo "STARTMODE=onboot" >> $str_cfg_file
+20
View File
@@ -0,0 +1,20 @@
#!/bin/bash
#Used only by sysclone
# This SI post-install script is needed because the initrd that autoyast/kickstart/ubuntu builds when installing
# sles/rh/ubuntu on the golden node may not have the drivers when that initrd runs on the node that is
# being deployed with this image (specifically, drivers to be able to mount the disk).
# So rebuild the initrd on the to-node after putting the image on the disk, but before rebooting.
#todo: Make this script work on red hat by checking for dracut and using that if it exists.
# And do whatever is necessary on ubuntu.
if [[ -f /sbin/dracut ]]; then
# redhat/centos
echo "Running dracut to regenerate the initrd with the drivers needed by this node:"
dracut --force
else
# suse/sles
echo "Running mkinitrd to regenerate the initrd with the drivers needed by this node:"
mkinitrd
fi
+25
View File
@@ -0,0 +1,25 @@
#!/bin/bash
# SI post-install script, run after SI has installed the OS, to kill processes SI does not kill
# (so /a can be umounted cleanly)
# SI post-install scripts run in a chroot environment of the final OS image
if [ -f "/etc/SuSE-release" ];then
str_out=`ps -ef | grep -v grep | grep syslog-ng`
if [ $? -eq 0 ];then
str_id=`echo $str_out | awk '{print $2}'`
kill -9 $str_id
fi
fi
# SI starts klogd in the chroot, but does not kill it. Remove this line when SI fixes their bug.
killall klogd
# flush all write buffers, just in case SI can not umount /a
echo "Syncing file systems"
sync
#todo: remove
#echo "Processes still using /:"
#fuser -v /
#sleep 30
+17 -4
View File
@@ -17,6 +17,11 @@ BuildArch: noarch
Requires: xCAT-server
#Requires: xCAT-server >= %{epoch}:%(cat Version|cut -d. -f 1,2)
# perl-ExtUtils-MakeMaker, perl-CPAN, perl-Test-Harness are only available in rhel.
# When this rpm supports being installed in sles, need to add these to xcat-dep.
# perl-SOAP-Lite is already in xcat-dep
Requires: perl-ExtUtils-MakeMaker perl-CPAN perl-Test-Harness perl-SOAP-Lite
Provides: xCAT-SoftLayer = %{epoch}:%{version}
%description
@@ -42,8 +47,11 @@ 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/install/postscripts
#mkdir -p $RPM_BUILD_ROOT/%{prefix}/share/xcat/sysclone/postscripts
mkdir -p $RPM_BUILD_ROOT/%{prefix}/share/doc/packages/xCAT-SoftLayer
mkdir -p $RPM_BUILD_ROOT/%{prefix}/share/man/man1
mkdir -p $RPM_BUILD_ROOT/%{prefix}/share/doc/man1
@@ -54,8 +62,10 @@ 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 postscripts/* $RPM_BUILD_ROOT/install/postscripts
chmod 755 $RPM_BUILD_ROOT/install/postscripts/*
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/*
cp -d si-post-install/* $RPM_BUILD_ROOT/%{prefix}/share/xcat/sysclone/post-install
chmod 755 $RPM_BUILD_ROOT/%{prefix}/share/xcat/sysclone/post-install/*
@@ -75,4 +85,7 @@ rm -rf $RPM_BUILD_ROOT
%defattr(-,root,root)
#%doc LICENSE.html
%{prefix}
/install/postscripts
%post
# We are shipping the postscripts in a sysclone dir and then copying them to /install/postscripts here,
# because we want to allow base xcat to eventually ship them and not conflict on the file name/path
+1 -1
View File
@@ -71,7 +71,7 @@ sub createDummyPods {
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); }
if ($?) { print "Did not find any section 5 man page, creating dummy pods...\n"; print join('', @lines); }
#my @lines;
#system($cmd);
my @dummyPods;
Regular → Executable
View File
+2 -4
View File
@@ -101,15 +101,13 @@ ln -sf ../bin/xcatclientnnr $RPM_BUILD_ROOT/%{prefix}/bin/webportal
# Inspect whether PHP related RPM packages are installed
%ifos linux
if [ -e "/etc/redhat-release" ]; then
rpm -q php >/dev/null
if [ $? != 0 ]; then
if [ ! -e "/etc/httpd/conf.d/php.conf" ]; then
echo ""
echo "Error! php has not been installed. Please run 'yum install php' before installing xCAT-UI.";
exit -1;
fi
else # SUSE
rpm -q apache2-mod_php5 php5 >/dev/null
if [ $? != 0 ]; then
if [ ! -e "/etc/apache2/conf.d/php5.conf" ]; then
echo ""
echo "Error! apache2-mod_php5 and php5 have not been installed. Please run 'zypper install apache2-mod_php5 php5' before installing xCAT-UI."
exit -1;
+265 -41
View File
@@ -322,6 +322,7 @@ if (
'k|kitversion=s' => \$::KITVERSION,
'r|kitrelease=s' => \$::KITRELEASE,
'l|kitloc=s' => \$::KITLOC,
'for=s' => \$::FOROSVERSARCH,
)
)
{
@@ -337,18 +338,34 @@ if ($::HELP)
}
my $debianflag = 0;
my $dpkg_flag = '-uc -us';
my $tempstring = xCAT::BuildKitUtils->osver();
if ( $tempstring =~ /debian/ || $tempstring =~ /ubuntu/ ){
$debianflag = 1;
}
# This is an undocumented flag to support our local build team
# to allow building Ubuntu kits on our RH build machines.
# It requires RH rpms such as dep, fakeroot, perl-File-DesktopEntry,
# perl-File-BaseDir, and html2text to be installed on the build server
# for this to work. To use this flag:
# buildkit --for ubuntu buildrepo <reponame>
# buildkit --for ubuntu buildtar
if ($::FOROSVERSARCH) {
if ( $::FOROSVERSARCH =~ /debian/ || $::FOROSVERSARCH =~ /ubuntu/ ) {
$debianflag=1;
$dpkg_flag .= ' -A -d';
}
}
# display the version statement if -v or --version is specified
if ($::VERSION)
{
my $versioncmd = "rpm -q --qf \"%{NAME}: %{VERSION}-%{RELEASE} \n\" xCAT-buildkit";
my $message = "Error quering xCAT-buildkit rpm. Version info is not available. \n";
if ( $debianflag ){
$versioncmd = "dpkg-query --show -f='\${PackageSpec}: \${Version}\n' xcat-buildkit";
$versioncmd = "dpkg-query --show -f='\${binary:Package}: \${Version}\n' xcat-buildkit";
$message = "Error quering xcat-buildkit package. Version info is not available. \n";
}
if ( system($versioncmd) ) {
@@ -764,20 +781,21 @@ sub kit_buildrepo1
}
}
# Build kitcomponent metapackages
# Build kitcomponent preppackages and metapackages
if ( $debianflag ){
foreach my $kc (@{$::bldkit_config->{kitcomponent}{entries}}) {
if ($repoid ne $kc->{kitrepoid}) { next; }
my $debname = "$repodir/".&comppkgname($kc);
if (-r $debname) { next; }
if ($::VERBOSE) { print "building kitcomponent metapackage for $kc->{basename} \n";}
if ($::VERBOSE) { print "building kitcomponent package for $kc->{basename} \n";}
if (&build_kitcomp_debian($kc)) {
print "Error building kitcomponent metapackage for $kc->{basename} \n";
return 1;
}
}
if ( system("dpkg-scanpackages $repodir > $repodir/Packages") ) {
print "Error building the repository meta-data with the dpkg-scanpackages command \n";
if ( system("cd $repodir;dpkg-scanpackages . > Packages") ) {
print "Error building the repository meta-data with the dpkg-scanpackages command \n";
return 1;
}
}
@@ -1005,7 +1023,7 @@ sub kit_buildtar
}
}
print "Creating tar file $tarfile.\n";
print "Creating tar file $::current_dir/$kitfilename.\n";
if ( system("cd $::deploy_dir; cd ..; tar -cjhf $tarfile $kitname/*") ) {
print "Error building tarfile $tarfile \n";
@@ -1145,8 +1163,16 @@ sub edit_bldkitconf
my ($osbasename,$osmore) = split(/\,/, $osinfo);
my ($osmajorversion,$osminorversion) = split(/\./, $osmore);
my $osarch=`uname -p`;
chomp($osarch);
my $kitcomponent_basename = $kitname."_compute";
if ($debianflag==1) {
if($osarch eq "ppc64le"){
$osarch="ppc64el";
}
$kitcomponent_basename = $kitname."-compute";
}
for (@lines) {
s/<<<INSERT_kitbasename_HERE>>>/$kitname/;
s/<<<INSERT_kitrepoid_HERE>>>/$kitrepoid/;
@@ -1865,6 +1891,12 @@ sub validate_os
my ($osmajorversion,$osminorversion) = split(/\./, $osmore);
my $osarch=`uname -p`;
chomp($osarch);
if ($debianflag==1) {
if($osarch eq "ppc64le"){
$osarch="ppc64el";
}
}
$osinfo =~ s/\,//;
my $repo_osinfo = "$repo->{osbasename}$repo->{osmajorversion}";
if (defined($repo->{osminorversion})){
@@ -1969,7 +2001,7 @@ sub build_kitcomp
$::VALID_PRER_COMPONENT = 0;
if ( !$::PREREQUISITE ) {
if ( $comp->{ospkgdeps} || $comp->{preinstall} || $comp->{preupgrade} || $comp->{preuninstall} ) {
if ( $comp->{ospkgdeps} || $comp->{preinstall} || $comp->{preupgrade} ) {
if ( &gen_kitcomp_spec($comp,\%repo, 'PREREQUISITE') ) { return 1; }
# run the rpmbuild command
@@ -2344,7 +2376,7 @@ sub gen_kitcomp_spec
s/<<<INSERT_kitcomponent_postinstall_script_HERE>>>/$postscript/;
s/<<<INSERT_kitcomponent_preupgrade_script_HERE>>>//;
s/<<<INSERT_kitcomponent_postupgrade_script_HERE>>>/$postupscript/;
s/<<<INSERT_kitcomponent_preuninstall_script_HERE>>>//;
s/<<<INSERT_kitcomponent_preuninstall_script_HERE>>>/$preunscript/;
s/<<<INSERT_kitcomponent_postuninstall_script_HERE>>>/$postunscript/;
}
}
@@ -2407,14 +2439,45 @@ sub build_kitcomp_debian{
}
}
#run the dpkg-buildpackage command
my $curdir = $::workdir;
my $cmd = "rm -Rf $debbuilddir";
system($cmd);
mkpath($debbuilddir);
#Create debian directory for this kit component
if ( &gen_kitcomp_debdir($comp,\%repo) ) { return 1; }
$::VALID_PREP_COMPONENT = 0;
if ( !$::PREREQUISITE ) {
if ( $comp->{ospkgdeps} || $comp->{preinstall} || $comp->{preupgrade} || $comp->{preuninstall} ) {
#Create debian directory for this kit component preppackage
if ( &gen_kitcomp_debdir_prep($comp,\%repo) ) { return 1; }
$::VALID_PREP_COMPONENT = 1;
# build prep deb
my $prep_compversion = $comp->{version} . "-" . $comp->{release};
my $prep_buildstring = "Prep Kit component build package.";
my $prep_debbuilddir = $::workdir."/debbuild/"."prep-".$comp->{kitcompname};
my $prep_debianbuildcmd = "cd $prep_debbuilddir;debchange -v $prep_compversion -b -c debian/changelog $prep_buildstring;dpkg-buildpackage $dpkg_flag";
if ( system($prep_debianbuildcmd) ) {
print "Error running \"dpkg-buildpackage $dpkg_flag\" command for kit component prep-$comp->{kitcompname} meta package\n";
return 1;
}
}
#Create debian directory for this kit component metapackage
if ( &gen_kitcomp_debdir($comp,\%repo,'METADEB') ) { return 1; }
} else {
#Create debian directory for this kit component
if ( &gen_kitcomp_debdir($comp,\%repo,'ALL') ) { return 1; }
}
if (defined($comp->{non_native_pkgs}) ) {
my $sourcedir = $::workdir."/source_packages";
@@ -2436,11 +2499,11 @@ sub build_kitcomp_debian{
}
}
my $compversion = $comp->{version} . "-" . $comp->{release};
my $buildstring = "Kit component build package.";
my $debianbuildcmd = "cd $debbuilddir;dch -v $compversion -b -c debian/changelog $buildstring;dpkg-buildpackage -uc -us";
my $buildstring = "\'Kit component build package.\'";
my $debianbuildcmd = "cd $debbuilddir;debchange -v $compversion -b -c debian/changelog $buildstring;dpkg-buildpackage $dpkg_flag";
if ( !$::NON_NATIVE_PKGS->{$comp->{kitcompname}} ) {
if ( system($debianbuildcmd) ) {
print "Error running \"dpkg-buildpackage -uc -us\" command for kit component $comp->{kitcompname} meta package\n";
print "Error running \"dpkg-buildpackage $dpkg_flag\" command for kit component $comp->{kitcompname} meta package\n";
return 1;
}
my $repodir = $::base_repodir."/".$repo{kitreponame};
@@ -2456,6 +2519,99 @@ sub build_kitcomp_debian{
return 0;
}
#-----------------------------------------------------------------------------
=head3 gen_kitcomp_debdir_prep
=cut
#-----------------------------------------------------------------------------
sub gen_kitcomp_debdir_prep{
my $comp = shift;
my $repo = shift;
my $scriptdir = $::workdir."/scripts/";
my $combuilddir = $::workdir."/debbuild/"."prep-".$comp->{kitcompname};
#copy the debian dir template to the build path
mkpath("$combuilddir/debian");
my $cmd = "cp -Rf " . $::XCATSHARE . "/kits/debian_template/* $combuilddir/debian/";
system($cmd);
my $kitname = $::bldkit_config->{kit}{entries}[0]->{basename};
my $kitcompname = "prep-".$comp->{kitcompname};
my $upgradeflag = "pre-".$comp->{basename} . ".tmp";
my ($prescript,$postscript,$preupscript,$postupscript,$preunscript,$postunscript,$nonnativepkgs) = '';
if (defined($comp->{preinstall})) {
$prescript = &load_script("$scriptdir$comp->{preinstall}");
}
if (defined($comp->{preupgrade})) {
$preupscript = &load_script("$scriptdir$comp->{preupgrade}");
}
if (defined($comp->{preuninstall})) {
$preunscript = &load_script("$scriptdir$comp->{preuninstall}");
}
#replace all special sub string in all files under debian
unless (opendir(DH, "${combuilddir}/debian/")){
print "Can not open the xCAT Kit Component debian dir: ${combuilddir}/debian/";
return 1;
}
foreach (readdir(DH)){
my $file = "${combuilddir}/debian/$_";
if ( -d $file){
next;
}
unless ( open ( FH, "<", $file )){
print "Error attempting to open the xCAT Kit Component ${kitcompname}'s debian template file $file.\n";
close(DH);
return 1;
}
if ($::VERBOSE){
print "Reading the xCAT Kit Component ${kitcompname}'s debian template file $file. \n";
}
my @lines = <FH>;
close(FH);
my $prep_comp_name="prep-".$comp->{basename};
for(@lines) {
chomp;
s/<<<INSERT_kitcomponent_basename_HERE>>>/$prep_comp_name/;
s/<<<INSERT_kitcomponent_ospkgdeps_HERE>>>/$comp->{ospkgdeps}/;
s/<<<INSERT_kitcomponent_kitpkgdeps_HERE>>>//;
s/<<<INSERT_kitcomponent_kitcompdeps_HERE>>>//;
s/<<<INSERT_kitcomponent_desc_HERE>>>/$comp->{description}/;
s/<<<INSERT_kitcomponent_upgrade_flag_HERE>>>/$upgradeflag/;
s/<<<INSERT_kitcomponent_preinstall_script_HERE>>>/$prescript/;
s/<<<INSERT_kitcomponent_postinstall_script_HERE>>>//;
s/<<<INSERT_kitcomponent_preupgrade_script_HERE>>>/$preupscript/;
s/<<<INSERT_kitcomponent_postupgrade_script_HERE>>>//;
s/<<<INSERT_kitcomponent_preuninstall_script_HERE>>>/$preunscript/;
s/<<<INSERT_kitcomponent_postuninstall_script_HERE>>>//;
}
my $joined_lines = join("\n", @lines);
@lines = split(/\\n/,$joined_lines);
open (FH, ">", $file);
if ($::VERBOSE){
print "Created kitcomponent ${kitcompname}'s build file under debian dir $file";
}
print FH @lines;
close(FH);
}
closedir(DH);
return 0;
}
#-----------------------------------------------------------------------------
=head3 gen_kitcomp_debdir
@@ -2468,6 +2624,7 @@ sub build_kitcomp_debian{
sub gen_kitcomp_debdir{
my $comp = shift;
my $repo = shift;
my $level = shift;
my $scriptdir = $::workdir."/scripts/";
my $combuilddir = $::workdir."/debbuild/".$comp->{kitcompname};
@@ -2481,29 +2638,38 @@ sub gen_kitcomp_debdir{
my $upgradeflag = $comp->{basename} . ".tmp";
my ($prescript,$postscript,$preupscript,$postupscript,$preunscript,$postunscript,$nonnativepkgs) = '';
if (defined($comp->{preinstall})) {
$prescript = &load_script("$scriptdir$comp->{preinstall}");
}
if (defined($comp->{postinstall})) {
$postscript = &load_script("$scriptdir$comp->{postinstall}");
}
if (defined($comp->{preupgrade})) {
$preupscript = &load_script("$scriptdir$comp->{preupgrade}");
}
if (defined($comp->{postupgrade})) {
$postupscript = &load_script("$scriptdir$comp->{postupgrade}");
}
if (defined($comp->{preuninstall})) {
$preunscript = &load_script("$scriptdir$comp->{preuninstall}");
}
if (defined($comp->{postuninstall})) {
$postunscript = &load_script("$scriptdir$comp->{postuninstall}");
}
if (defined($comp->{non_native_pkgs})) {
$nonnativepkgs = "\n";
$nonnativepkgs .= "mkdir -p \$RPM_BUILD_ROOT/opt/xcat/kits/$kitname/$kitcompname \n";
$nonnativepkgs .= "cp -a * \$RPM_BUILD_ROOT/opt/xcat/kits/$kitname/$kitcompname \n";
if ($level eq 'METADEB' || $level eq 'ALL')
{
if (defined($comp->{postinstall})) {
$postscript = &load_script("$scriptdir$comp->{postinstall}");
}
if (defined($comp->{postupgrade})) {
$postupscript = &load_script("$scriptdir$comp->{postupgrade}");
}
if (defined($comp->{postuninstall})) {
$postunscript = &load_script("$scriptdir$comp->{postuninstall}");
}
if (defined($comp->{non_native_pkgs})) {
$nonnativepkgs = "\n";
$nonnativepkgs .= "mkdir -p \$RPM_BUILD_ROOT/opt/xcat/kits/$kitname/$kitcompname \n";
$nonnativepkgs .= "cp -a * \$RPM_BUILD_ROOT/opt/xcat/kits/$kitname/$kitcompname \n";
}
}
if ($level eq 'ALL')
{
if (defined($comp->{preinstall})) {
$prescript = &load_script("$scriptdir$comp->{preinstall}");
}
if (defined($comp->{preupgrade})) {
$preupscript = &load_script("$scriptdir$comp->{preupgrade}");
}
if (defined($comp->{preuninstall})) {
$preunscript = &load_script("$scriptdir$comp->{preuninstall}");
}
}
#replace all special sub string in all files under debian
unless (opendir(DH, "${combuilddir}/debian/")){
@@ -2528,12 +2694,20 @@ sub gen_kitcomp_debdir{
}
my @lines = <FH>;
close(FH);
my $prepcomp="prep-".$comp->{basename};
for(@lines) {
chomp;
s/<<<INSERT_kitcomponent_basename_HERE>>>/$comp->{basename}/;
s/<<<INSERT_kitcomponent_ospkgdeps_HERE>>>/$comp->{ospkgdeps}/;
s/<<<INSERT_kitcomponent_kitpkgdeps_HERE>>>/$comp->{kitpkgdeps}/;
s/<<<INSERT_kitcomponent_kitcompdeps_HERE>>>/$comp->{kitcompdeps}/;
if ( $::VALID_PREP_COMPONENT ) {
s/<<<INSERT_kitcomponent_kitcompdeps_HERE>>>/$comp->{kitcompdeps},$prepcomp/;
}
else
{
s/<<<INSERT_kitcomponent_kitcompdeps_HERE>>>/$comp->{kitcompdeps}/;
}
s/<<<INSERT_kitcomponent_desc_HERE>>>/$comp->{description}/;
s/<<<INSERT_kitcomponent_upgrade_flag_HERE>>>/$upgradeflag/;
s/<<<INSERT_kitcomponent_preinstall_script_HERE>>>/$prescript/;
@@ -2682,8 +2856,13 @@ sub create_kitconf
$::kit_config->{$s}{entries}[$li]->{kitreponame} =
$se->{kitreponame};
if ( !$::PREREQUISITE and ($se->{ospkgdeps} || $se->{preinstall} || $se->{preupgrade} || $se->{preuninstall}) ) {
$::kit_config->{$s}{entries}[$li]->{prerequisite} =
if ( $debianflag ){
$::kit_config->{$s}{entries}[$li]->{prerequisite} =
"prep-" . $se->{basename};
}else{
$::kit_config->{$s}{entries}[$li]->{prerequisite} =
"prep_" . $se->{basename};
}
}
}
$li++;
@@ -3401,7 +3580,7 @@ sub kit_addpkgs
#for debian/ubuntu
my $repodir = $tmpdir . "/repos/".$non_native_kitreponame;
if ( $debianflag ){
my $debbuildcmd = "cd $source_dir;dpkg-buildpackage -uc -us";
my $debbuildcmd = "cd $source_dir;dpkg-buildpackage $dpkg_flag";
if ( system($debbuildcmd) ){
print "error running debian build cmd for kit component $non_native_basename meta package.\n";
return 1;
@@ -3587,9 +3766,13 @@ sub NEW_kit_addpkgs
if ($kp->{isexternalpkg} eq 'yes') {
my $ext_filename = $kp->{filename};
my $ext_reponames = $kp->{kitreponame};
my $files = xCAT::BuildKitUtils->find_latest_pkg(\@pkgdirlist, $ext_filename);
my $files;
if($debianflag){
$files = xCAT::BuildKitUtils->find_latest_pkg_deb(\@pkgdirlist, $ext_filename);
}
else {
$files = xCAT::BuildKitUtils->find_latest_pkg(\@pkgdirlist, $ext_filename);
}
if (!defined($files) ) {
print "Error: The product package file $ext_filename was not found in the package directory(s) @pkgdirlist.\n";
# Cleanup
@@ -3709,6 +3892,47 @@ sub NEW_kit_addpkgs
}
}
#When using -k -r, there are useless repodir
#delete useless repo dir
my $kitrepodirby=$::base_repodir;
my $cmdby = "/bin/ls $kitrepodirby 2>/dev/null";
my $outputby = `$cmdby`;
my @allrepolist = split(/\n/, $outputby);
my @dellist;
foreach my $reponame (@allrepolist)
{
my $match=0;
foreach my $kr (@{$::bldkit_config->{kitrepo}{entries}})
{
my $repodirname = "$kr->{kitreponame}";
if ( ${repodirname} eq ${reponame} )
{
${match}++;
}
}
if ( ${match} == 0 )
{
push(@dellist,$reponame);
}
}
foreach my $del (@dellist)
{
my $delrepodir=$::base_repodir."/".$del ;
if ( -d $delrepodir )
{
my $delcmd="rm -Rf $delrepodir";
if ( system($delcmd) )
{
print "Failed to delete useless repo directory \n";
}
}
}
# Build the full kit tar file
my $buildtar_rc = &kit_buildtar;
@@ -134,6 +134,87 @@ sub get_latest_version
}
}
#--------------------------------------------------------------------------
=head3 get_latest_version_deb
Find the latest version in a list of debs with the same basename
Arguments:
- the repo location
- a list of debs with the same basename
Returns:
- name of deb
- undef
Example:
my $new_d = xCAT::BuildKitUtils->get_latest_version($repodir, \@rpmlist);
Comments:
=cut
#--------------------------------------------------------------------------
sub get_latest_version_deb
{
my ($class, $repodir, $debs) = @_;
my @deblist = @$debs;
my %localversions_hash = ();
my $file_name;
my %founddeb;
my $latest;
my $i = 0;
foreach my $deb (@deblist)
{
# include path
my $fulldebpath = "$repodir/$deb*";
chomp $deb;
# get the basename, version, and release for this deb
print "dpkg -I $repodir/$deb |grep Package|awk '{print \$2}'";
my $basenamedeb = `dpkg -I $repodir/$deb |grep Package|awk '{print \$2}'`;
chomp $basenamedeb;
my $versiondeb = `dpkg -I $repodir/$deb |grep Version|awk '{print \$2}'`;
chomp $versiondeb;
$founddeb{$basenamedeb}{$deb}{version}=$versiondeb;
$i++;
}
if ($i == 0)
{
print "error\n";
return undef;
}
foreach my $r (keys %founddeb ) {
# if more than one with same basename then find the latest
my $latestmatch="";
foreach my $fdeb (keys %{$founddeb{$r}} ) {
# if we already found a match in some other dir
if ($latestmatch) {
# then we need to figure out which is the newest
# if the $fdeb is newer than use iti
if ( ! xCAT::BuildKitUtils->testVersion_deb($founddeb{$r}{$fdeb}{version}, 'gt', $founddeb{$r}{$latestmatch}{version}) ) {
$latestmatch = $fdeb;
}
} else {
$latestmatch = $fdeb;
}
}
$latest=$latestmatch;
}
if ($i == 0)
{
print "Error: Could not determine the latest version for the following list of debs: @deblist\n";
return undef;
} else {
return ($latest);
}
}
#--------------------------------------------------------------------------
=head3 find_latest_pkg
@@ -160,6 +241,7 @@ sub find_latest_pkg
my @rpms;
my %foundrpm;
# need to check each pkgdir for the rpm(s)
# - if more than one match need to pick latest
# find all the matches in all the directories
@@ -223,6 +305,128 @@ sub find_latest_pkg
}
}
#--------------------------------------------------------------------------
=head3 find_latest_pkg_deb
Find the latest deb package give the deb name and a list of
possible package locations.
Arguments:
- a list of package directories
- the name of the deb
Returns:
- \@founddeblist
- undef
Example:
my $newrpm = xCAT::BuildKitUtils->find_latest_pkg_deb(\@pkgdirs, $debname);
Comments:
=cut
#--------------------------------------------------------------------------
sub find_latest_pkg_deb
{
my ($class, $pkgdirs, $debname) = @_;
my @pkgdirlist = @$pkgdirs;
my @debs;
my %founddeb;
# need to check each pkgdir for the deb(s)
# - if more than one match need to pick latest
# find all the matches in all the directories
foreach my $debdir (@pkgdirlist) {
my $ffile = $debdir."/".$debname;
if ( system("/bin/ls $ffile > /dev/null 2>&1") ){
# if not then skip to next dir
next;
} else {
# if so then get the details and add it to the %founddeb hash
my $cmd = "/bin/ls $ffile 2>/dev/null";
my $output = `$cmd`;
my @deblist = split(/\n/, $output);
if ( scalar(@deblist) == 0) {
next;
}
foreach my $r (@deblist) {
my $basename = `dpkg -I $r* |grep Package|awk '{print \$2}'|head -1`;
chomp $basename;
my $version = `dpkg -I $r* |grep Version|awk '{print \$2}'|head -1`;
chomp $version;
$founddeb{$basename}{$r}{version}=$version;
}
}
}
# for each unique deb basename
foreach my $r (keys %founddeb ) {
# if more than one with same basename then find the latest
my $latestmatch="";
foreach my $fdeb (keys %{$founddeb{$r}} ) {
# if we already found a match in some other dir
if ($latestmatch) {
# then we need to figure out which is the newest
# if the $fdeb is newer than use it
if ( ! xCAT::BuildKitUtils->testVersion_deb($founddeb{$r}{$fdeb}{version}, 'gt', $founddeb{$r}{$latestmatch}{version}) ) {
$latestmatch = $fdeb;
}
} else {
$latestmatch = $fdeb;
}
}
push(@debs, $latestmatch);
}
if (scalar(@debs)) {
return \@debs;
} else {
return undef;
}
}
#------------------------------------------------------------------------------
=head3 testVersion_deb
Compare version1 and version2 according to the operator and
return 1 0 or 0.
Arguments:
$version1
$operator
$version2
Returns:
1 or 0
Example:
Comments:
The return value is generated with the Require query
=cut
#-----------------------------------------------------------------------------
sub testVersion_deb
{
my ($class, $version1, $operator, $version2) = @_;
if ($::VERBOSE) {
print "dpkg --compare-versions $version1 $operator $version2 \n";
}
my $result =`dpkg --compare-versions $version1 $operator $version2`;
return $result;
}
#------------------------------------------------------------------------------
+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.
@@ -21,7 +21,7 @@ set -e
case "$1" in
configure)
<<<INSERT_kitcomponent_postinstall_script_HERE>>>
if [ -f /tmp/<<<INSERT_kitcomponent_upgrade_flag_HERE>>> ]
if [ -f /tmp/<<<INSERT_kitcomponent_upgrade_flag_HERE>>> ]; then
<<<INSERT_kitcomponent_postupgrade_script_HERE>>>
rm /tmp/<<<INSERT_kitcomponent_upgrade_flag_HERE>>>
fi
@@ -17,10 +17,12 @@ set -e
case "$1" in
install)
<<<INSERT_kitcomponent_preinstall_script_HERE>>>
echo "preinstall processing"
;;
upgrade)
if [ -f /tmp/<<<INSERT_kitcomponent_upgrade_flag_HERE>>> ]
if [ -f /tmp/<<<INSERT_kitcomponent_upgrade_flag_HERE>>> ]; then
echo "preupgrade processing"
<<<INSERT_kitcomponent_preupgrade_script_HERE>>>
fi
;;
View File
@@ -96,7 +96,8 @@ kit:
#
# osminorversion (optional) OS minor version. (ex. "4")
#
# osarch (mandatory) OS architecture. (ex. "x86_64")
# osarch (mandatory) OS architecture. (ex.redhat x86_64 should be "x86_64", Ubuntu Power LE should be "ppc64el",
# For Ubuntu Power LE, system arch is ppc64le, for ubuntu software package, should use "ppc64el",
#
# compat_osbasenames (optional) Comma-separated list of compatible
# OS distribution base names. (ex. "centos")
@@ -1,3 +1,21 @@
#!/bin/sh
echo "running sample-comp1 genimage_post script"
rpmdir="/opt/xcat/kits/<<<buildkit_WILL_INSERT_kit_basename_HERE>>>/<<<buildkit_WILL_INSERT_kitcomponent_name_HERE>>>"
if [[ ! -z "$installroot" ]]; then
if [ -n "`ls $installroot$rpmdir/*.deb 2> /dev/null`" ] ; then
dpkg -i --force-all --instdir=$installroot $installroot$rpmdir/*.deb
elif [ -n "`ls $installroot$rpmdir/*.rpm 2> /dev/null`" ] ; then
rpm --force --root $installroot -Uvh $installroot$rpmdir/*.rpm
fi
else
if [ -n "`ls $rpmdir/*.deb 2> /dev/null`" ] ; then
dpkg -i --force-all $rpmdir/*.deb
elif [ -n "`ls $rpmdir/*.rpm 2> /dev/null`" ] ; then
rpm --force -Uvh $rpmdir/*.rpm
fi
fi
exit 0
@@ -26,9 +26,6 @@ BuildRoot: /var/tmp/%{name}-%{version}-%{release}-root
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root)
<<<INSERT_kitcomponent_files_HERE>>>
%changelog
@@ -48,6 +45,11 @@ rm -rf $RPM_BUILD_ROOT
%preun
<<<INSERT_kitcomponent_preuninstall_script_HERE>>>
%files
%defattr(-,root,root)
<<<INSERT_kitcomponent_files_HERE>>>
%postun
<<<INSERT_kitcomponent_postuninstall_script_HERE>>>
+39 -19
View File
@@ -590,13 +590,16 @@ sub startxcatd
} else {
$xcmd = "$::XCATROOT/sbin/restartxcatd";
}
system($xcmd);
}
else
{
$xcmd = "service xcatd restart";
#$xcmd = "service xcatd restart";
my $ret=xCAT::Utils->restartservice("xcatd");
return $ret;
}
system($xcmd);
}
#-----------------------------------------------------------------------------
@@ -618,13 +621,16 @@ sub shutdownxcatd
if ($::osname eq 'AIX')
{
$xcmd = "stopsrc -s xcatd";
system($xcmd);
}
else
{
$xcmd = "service xcatd stop";
#$xcmd = "service xcatd stop";
my $ret=xCAT::Utils->stopservice("xcatd");
return $ret;
}
system($xcmd);
}
#-----------------------------------------------------------------------------
@@ -1872,7 +1878,7 @@ sub restorexcatdb
# restore the database
xCAT::MsgUtils->message(
"I",
"Restoring the xCat Database with $::backupdir to DB2 database.\nThis could take several minutes."
"Restoring the xCAT Database with $::backupdir to DB2 database.\nThis could take several minutes."
);
if (!(-d $::backupdir))
{ # does not exist, error
@@ -2073,11 +2079,12 @@ sub adddb2paths
#-----------------------------------------------------------------------------
sub remove
{
my $cmd;
my @output;
my $error = 0;
#see if DB2 is installed
if (!(-e ($::installdb2dir)))
my $cmd;
my @output;
my $error = 0;
my $retcode=0;
#see if DB2 is installed
if (!(-e ($::installdb2dir)))
{
my $message =
"\nDB2 is not installed.";
@@ -2120,18 +2127,23 @@ sub remove
my $cmd = "ps -elf|grep xcatd";
my @output = xCAT::Utils->runcmd($cmd, 0);
if ($::RUNCMD_RC == 0)
{
if ($::osname eq 'AIX')
{
my $cmd = "startsrc -s xcatd";
xCAT::Utils->runcmd($cmd, -1);
$retcode=$::RUNCMD_RC;
}
else
{
my $cmd = "service xcatd start";
#my $cmd = "service xcatd start";
$retcode=xCAT::Utils->startservice("xcatd");
}
xCAT::Utils->runcmd($cmd, -1);
if ($::RUNCMD_RC !=0)
#xCAT::Utils->runcmd($cmd, -1);
#if ($::RUNCMD_RC !=0)
if($retcode!=0)
{
my $message = "can't start xcatd";
$error += 1;
@@ -2155,13 +2167,17 @@ sub remove
if ($::osname eq 'AIX')
{
my $cmd = "stopsrc -s xcatd";
xCAT::Utils->runcmd($cmd, -1);
$retcode=$::RUNCMD_RC;
}
else
{
my $cmd = "service xcatd stop";
#my $cmd = "service xcatd stop";
$retcode=xCAT::Utils->stopservice("xcatd");
}
xCAT::Utils->runcmd($cmd, -1);
if ($::RUNCMD_RC !=0)
#xCAT::Utils->runcmd($cmd, -1);
#if ($::RUNCMD_RC !=0)
if($retcode!=0)
{
my $message = "can't stop xcatd";
xCAT::MsgUtils->message("E", "$message");
@@ -2198,13 +2214,17 @@ sub remove
if ($::osname eq 'AIX')
{
my $cmd = "startsrc -s xcatd";
xCAT::Utils->runcmd($cmd, -1);
$retcode=$::RUNCMD_RC;
}
else
{
my $cmd = "service xcatd start";
#my $cmd = "service xcatd start";
$retcode=xCAT::Utils->startservice("xcatd");
}
xCAT::Utils->runcmd($cmd, -1);
if ($::RUNCMD_RC !=0)
#xCAT::Utils->runcmd($cmd, -1);
#if ($::RUNCMD_RC !=0)
if($retcode!=0)
{
my $message = "can't start xcatd";
xCAT::MsgUtils->message("E", "$message");
+10 -3
View File
@@ -43,6 +43,7 @@ my $interactive;
my $onlyinitrd;
my $dryrun;
my $ignorekernelchk;
my $noupdate;
#-----------------------------------------------------------------------------
=head3 print_usage - usage message
@@ -55,8 +56,8 @@ sub print_usage
print "Usage:\n";
print " genimage\n\n";
print " genimage --dryrun\n\n";
print ' genimage -o <osver> [-a <arch>] -p <profile> -i <nodebootif> -n <nodenetdrivers> [--onlyinitrd] [-r <otherifaces>] [-k <kernelver>] [-g <krpmver>] [-m statelite] [-l rootlimitsize] [-t tmplimitsize] [--permission <permission>] [--interactive] [--dryrun]'."\n\n";
print ' genimage [-o <osver>] [-a <arch>] [-p <profile>] [-i <nodebootif>] [-n <nodenetdrivers>] [--onlyinitrd] [-r <otherifaces>] [-k <kernelver>] [-g <krpmver>] [-m statelite] [-l rootlimitsize] [-t tmplimitsize] [--permission <permission>] [--interactive] [--dryrun] <imagename>'."\n\n";
print ' genimage -o <osver> [-a <arch>] -p <profile> -i <nodebootif> -n <nodenetdrivers> [--onlyinitrd] [-r <otherifaces>] [-k <kernelver>] [-g <krpmver>] [-m statelite] [-l rootlimitsize] [-t tmplimitsize] [--permission <permission>] [--interactive] [--dryrun] [--noupdate]'."\n\n";
print ' genimage [-o <osver>] [-a <arch>] [-p <profile>] [-i <nodebootif>] [-n <nodenetdrivers>] [--onlyinitrd] [-r <otherifaces>] [-k <kernelver>] [-g <krpmver>] [-m statelite] [-l rootlimitsize] [-t tmplimitsize] [--permission <permission>] [--interactive] [--dryrun] [--noupdate] <imagename>'."\n\n";
print " --permission is used for statelite only\n";
print " -g is used for SLES only\n\n";
print " -m is used for urbuntu, debian and fedora12 only\n\n";
@@ -90,6 +91,7 @@ if (!GetOptions(
'onlyinitrd' => \$onlyinitrd,
'dryrun' => \$dryrun,
'ignorekernelchk' => \$ignorekernelchk,
'noupdate' => \$noupdate,
'h|help' => \$help,
'v|version' => \$version,
)) {
@@ -176,7 +178,8 @@ if ((!$imagename) && (!$os)){
my @dircontents = `ls $installdir`;
chomp(@dircontents);
foreach (@dircontents) {
if($_ =~ /(rhel|fedora|sl|centos|suse)/){
# SL matches Scientific Linux, sl matches sles amd sled
if($_ =~ /(rhel|fedora|SL|centos|sl|suse)/){
push @oses,$_;
}
}
@@ -408,6 +411,10 @@ if ($ignorekernelchk) {
push @arg, "--ignorekernelchk";
}
if ($noupdate) {
push @arg, "--noupdate";
}
my $cmdref;
push (@{$cmdref->{arg}}, @arg);
$cmdref->{command}->[0] = "genimage";
+366 -160
View File
@@ -1,191 +1,397 @@
#!/usr/bin/perl
# IBM(c) 2007 EPL license http://www.eclipse.org/legal/epl-v10.html
# Downloads/converts the xCAT docs on the sourceforge wiki to local HTML and PDF.
# Downloads/converts the xCAT docs on the sourceforge Allura wiki to local HTML and PDF.
# This script is not dependent on other xCAT code, so you can copy it to a machine
# that has internet access to run it. Before running this command, you must have
# wget, python, and pisa installed. See: http://sourceforge.net/apps/mediawiki/xcat/index.php?title=Editing_xCAT_Documentation_Pages#Converting_Wiki_Pages_to_HTML_and_PDFs .
# curl, pandoc, and latex installed. See: http://sourceforge.net/p/xcat/wiki/Editing_and_Downloading_xCAT_Documentation/#converting-wiki-pages-to-html-and-pdfs
# Note: do not use the --upload option, unless your machine has authority to write to http://xcat.sourceforge.net/doc/ .
# You also need to set $UPLOADUSER to your sourceforge user.
# You also need to set $UPLOADUSER to your sourceforge user:
my $UPLOADUSER = 'bp-sawyers';
#BEGIN
#{
# $::XCATROOT = $ENV{'XCATROOT'} ? $ENV{'XCATROOT'} : -d '/opt/xcat' ? '/opt/xcat' : '/usr';
#}
use strict;
#use lib "$::XCATROOT/lib/perl";
#use xCAT::Utils;
use Getopt::Long;
#use File::Path;
use Cwd;
#use Data::Dumper;
use JSON;
use List::Util qw[max];
# URL for the xCAT Allura wiki API markdown on SourceForge
my $SF_URL='http://sourceforge.net/rest';
my $WIKI_URL=$SF_URL.'/p/xcat/wiki/';
# Update this list if you group any xcat docs on a separate page such that they
# are no longer linked from the main doc page:
my @INDEXDOCS = ('XCAT_Documentation',
'Power_775_Cluster_Documentation',
'Highly_Available_Management_Node',
'Mixed_Cluster_Support',
'IBM_HPC_Stack_in_an_xCAT_Cluster');
# Update this list if you group any xcat docs on a separate page such that they are no longer linked from the
# main doc page.
my @indexdocs = ('XCAT_Documentation', 'Power_775_Cluster_Documentation', 'Highly_Available_Management_Node', 'Mixed_Cluster_Support', 'IBM_HPC_Stack_in_an_xCAT_Cluster');
#my $VERSION;
my $HELP;
my $UPLOAD;
my $UPLOADONLY;
my $IGNOREERRORS;
my $CONTINUE;
my $SINGLE_DOC;
my $VERBOSE;
my $usage = sub {
my $exitcode = shift @_;
print "Usage: getxcatdocs [-?|-h|--help] [-v|--verbose] [-u|--upload] [--uploadonly] [<destination-dir>]\n";
exit $exitcode;
};
# Process the cmd line args
Getopt::Long::Configure("bundling");
#Getopt::Long::Configure("pass_through");
Getopt::Long::Configure("no_pass_through");
if (!GetOptions('h|?|help' => \$HELP, 'v|verbose' => \$VERBOSE, 'u|upload' => \$UPLOAD, 'uploadonly' => \$UPLOADONLY )) { $usage->(1); }
if ($HELP) { $usage->(0); }
#if ($VERSION) {
#print xCAT::Utils->Version(), "\n";
# exit;
#}
if ($^O =~ /^aix/i) { die "Error: this command is not yet supported on AIX.\n"; }
my $destdir = scalar(@ARGV) ? $ARGV[0] : '.';
chdir($destdir) or die "Can not cd to $destdir: $!\n";
#my $docdir = $ENV{'PWD'};
# Download the HTML docs and convert them all to pdfs
my @dir;
if (!$UPLOADONLY) {
@dir = gethtmldocs('html');
convert2pdf('pdf', \@dir);
}
# tar/compress
my $date=`date +%Y%m%d%H%M`;
chop $date;
my $docname="xcat-docs-snap$date.tar.gz";
#system('pwd');
my $cmd = "tar -zcf $docname html pdf 2>&1";
verbose($cmd);
system($cmd) == 0 or die "Error running $cmd: $!, rc=$?";
# Optionally upload the tarball to sourceforge
if ($UPLOAD || $UPLOADONLY) {
my $UPLOADUSER = 'bp-sawyers';
my $count = 1;
#my $cmd = "rsync -v $docname $UPLOADUSER," . 'xcat@web.sourceforge.net:htdocs/doc/';
my $cmd = "rsync -v $docname $UPLOADUSER," . 'xcat@web.sourceforge.net:/home/frs/project/x/xc/xcat/doc/';
print "$cmd\n";
while ($count<=5 && system("$cmd 2>&1")) { $count++; }
}
exit 0;
my $MDDIR;
my $HTMLDIR;
my $PDFDIR;
my $IMAGEDIR;
my %LOADEDDOCS;
sub verbose { if ($VERBOSE) { print shift, "\n"; } }
my $usage = sub {
my $exitcode = shift @_;
print "Usage: getxcatdocs [-?|-h|--help] \n";
print "Usage: getxcatdocs [-v|--verbose] [-u|--upload] [--uploadonly] [-U|--uploaduser sourceforge_id] [-i|--ignoreerrors] [<destination-dir>]\n";
print "Usage: getxcatdocs [-v|--verbose] [-c|--continue] [-d|--doc single_doc] [-i|--ignoreerrors] [<destination-dir>]\n";
exit $exitcode;
};
# Main processing
# Process the cmd line args
Getopt::Long::Configure("bundling");
#Getopt::Long::Configure("pass_through");
Getopt::Long::Configure("no_pass_through");
if (!GetOptions(
'h|?|help' => \$HELP,
'v|verbose' => \$VERBOSE,
'u|upload' => \$UPLOAD,
'uploadonly' => \$UPLOADONLY,
'uploaduser' => \$UPLOADUSER,
'c|continue' => \$CONTINUE,
'i|ignoreerrors' => \$IGNOREERRORS,
'd|doc=s' => \$SINGLE_DOC ))
{ $usage->(1); }
if ($HELP) { $usage->(0); }
if ($^O =~ /^aix/i) { die "Error: this command is not yet supported on AIX.\n"; }
my $DESTDIR = scalar(@ARGV) ? $ARGV[0] : '.';
chdir($DESTDIR) or die "Can not cd to $DESTDIR: $!\n";
my $json = JSON->new();
if ($SINGLE_DOC) {
$MDDIR = '.';
$HTMLDIR = '.';
$PDFDIR = '.';
$IMAGEDIR = '.';
download_doc($SINGLE_DOC);
convert_doc($SINGLE_DOC);
exit;
}
# Download the HTML docs and convert them all to pdfs
if (!$UPLOADONLY) { gethtmldocs(); }
# tar/compress
my $date=`date +%Y%m%d%H%M`;
chop $date;
my $docname="xcat-docs-snap$date.tar.gz";
my $cmd = "tar -zcf $docname html pdf images 2>&1";
verbose($cmd);
system($cmd) == 0 or die "Error running $cmd: $!, rc=$?";
# Optionally upload the tarball to sourceforge
if ($UPLOAD || $UPLOADONLY) {
my $count = 1;
#my $cmd = "rsync -v $docname $UPLOADUSER," . 'xcat@web.sourceforge.net:htdocs/doc/';
my $cmd = "rsync -v $docname $UPLOADUSER," . 'xcat@web.sourceforge.net:/home/frs/project/x/xc/xcat/doc/';
print "$cmd\n";
while ($count<=5 && system("$cmd 2>&1")) { $count++; }
}
exit 0;
# Download all of the html docs from several "index" docs
sub gethtmldocs {
my $dir = shift;
my $savedir = getcwd();
#File::Path::make_path($dir);
mkdir($dir);
chdir($dir);
#system('pwd');
unlink <*>; # delete all the files in the dir, in case they previously ran this
#system('ls');
my $indexes = '';
foreach my $index (@indexdocs) {
$indexes .= qq('http://sourceforge.net/apps/mediawiki/xcat/index.php?title=$index&printable=yes' );
}
print "Downloading the xCAT wiki documentation to $dir, from: $indexes ...\n";
runwget($indexes);
# Remove the funny chars from the links to other docs and rename the docs
#my $sedcmd = q(sed -i 's/<a href="\/apps\/mediawiki\/xcat\/index.php?title/<a href="index.php%3Ftitle/' *);
# sed -i 's/href="index.php%3Ftitle=/href="/g' index.php\?title\=
# sed -i 's/<a href="\([^"]*\)"/<a href="\1.html"/'
# This searches for '<a href="index.php?title=' and then all text before a '"' or '#', and then removes the front part and add .html on the end
# Note: this does not convert the 'MediaWiki:*' files because they are used in <link> tags, but converting them does not seem to do any good anyway.
my $cmd = q(sed -i 's/<a href="index.php?title=\\([^"#]*\\)\\("\|#\\)/<a href="\1.html\2/g' *);
verbose($cmd);
system($cmd) == 0 or die "Error running $cmd: $!, rc=$?";
# get the list of docs
opendir(DIR, '.') or die "Error: could not read the just created html directory.\n";
#my @docs = grep /^index.php\?title=/, readdir(DIR); # /
my @docs;
foreach my $f (readdir(DIR)) {
if ($f !~ /^index.php\?title=/ || $f =~ /^index.php\?title=MediaWiki:/) { next; }
my $newf = $f;
$newf =~ s/^index.php\?title=//;
if ($newf !~ /\./) { $newf .= '.html'; }
verbose("Renaming $f to $newf");
rename($f, $newf);
push @docs, $newf;
}
close(DIR);
chdir($savedir);
return @docs;
$MDDIR = 'md';
$HTMLDIR = 'html';
$PDFDIR = 'pdf';
$IMAGEDIR = 'images';
mkdir($MDDIR);
mkdir($HTMLDIR);
mkdir($PDFDIR);
mkdir($IMAGEDIR);
#delete all the files in the dirs in case they previously ran this
if ($CONTINUE) {
print "CONTINUING with files already in $MDDIR";
my @mdfiles = glob "$MDDIR/*.md";
foreach my $mdf (@mdfiles) {
$mdf =~ s/^$MDDIR\///;
$mdf =~ s/\.md//;
$LOADEDDOCS{$mdf}=1;
}
} else {
unlink <$MDDIR/*>;
unlink <$HTMLDIR/*>;
unlink <$PDFDIR/*>;
unlink <$IMAGEDIR/*>;
}
print "\nDownloading and converting the xCAT wiki document list from $WIKI_URL ...\n";
foreach my $index (@INDEXDOCS) {
my @related_docs = download_doc($index);
foreach my $docref (@related_docs) {
my $docref_name = $docref;
$docref_name =~ s/\/.*\/(.+)\/$/$1/;
download_doc($docref_name);
}
}
foreach my $doc (keys %LOADEDDOCS) {
convert_doc($doc);
}
return;
}
# Convert to pdf
sub convert2pdf {
my ($dir, $files) = @_;
my $savedir = getcwd();
#File::Path::make_path($dir);
mkdir($dir);
chdir($dir);
if (system('which xhtml2pdf >/dev/null 2>&1')) { die "xhtml2pdf is not installed. See http://sourceforge.net/apps/mediawiki/xcat/index.php?title=Editing_xCAT_Documentation_Pages#Converting_Wiki_Pages_to_HTML_and_PDFs .\n"; }
unlink <*>; # delete all the files in the dir, in case they previously ran this
foreach my $file (@$files) {
#if ($file =~ /^index.php\?title=MediaWiki:/ || $file eq 'index.php?title=XCAT_Documentation') { next; }
if ($file eq 'XCAT_Documentation') { next; }
#my ($docname) = $file =~ /^index.php\?title=(.+)$/;
$file =~ s/\.html$//;
print "Converting $file to PDF format...\n";
my $url = 'http://sourceforge.net/apps/mediawiki/xcat/index.php?title=' . $file . '&printable=yes';
my $destfile = "$file.pdf";
my $cmd = "xhtml2pdf '$url' '$destfile' ";
runh2p($cmd);
}
chdir($savedir);
sub download_doc {
my $doc_name = shift;
if ( $LOADEDDOCS{$doc_name} ) { return; }
verbose("processing $doc_name");
$LOADEDDOCS{$doc_name}=1;
my $curlcmd = "curl --retry 5 -X GET $WIKI_URL/$doc_name";
verbose($curlcmd);
my $docjson = `$curlcmd`;
if ($? && !$IGNOREERRORS) { die "error encountered in $curlcmd \n";}
my $jsout = $json->decode($docjson);
foreach my $att (@{$jsout->{attachments}}) {
my $wgetcmd = "wget -P $IMAGEDIR/ $att->{url}";
verbose($wgetcmd);
system($wgetcmd);
if ($? && !$IGNOREERRORS) { die "error encountered in $wgetcmd \n";}
}
open(MDFILE, ">$MDDIR/${doc_name}.md") or die "Could not open >$MDDIR/${doc_name}.md";
print MDFILE $jsout->{text};
close MDFILE;
return @{$jsout->{related_artifacts}};
}
sub convert_doc {
my $doc_name = shift;
open(MDFILE, "<$MDDIR/${doc_name}.md") or die "Could not open <$MDDIR/${doc_name}.md";
my @doc_lines = <MDFILE>;
close MDFILE;
my $doc_text = join('',@doc_lines);
$doc_text = process_includes($doc_text,0);
if ($doc_text =~ /begin_xcat_table/) {
open(MDFILE, ">$MDDIR/${doc_name}.md") or die "Could not open >$MDDIR/${doc_name}.md";
print MDFILE $doc_text;
close MDFILE;
convert_tables($doc_name);
open(MDFILE, "<$MDDIR/${doc_name}.md") or die "Could not open <$MDDIR/${doc_name}.md";
@doc_lines = <MDFILE>;
close MDFILE;
$doc_text = join('',@doc_lines);
}
## Make image refs local
$doc_text =~ s/\!\[\]\(.+\/(.+)\.png\)/\!\[\]\(\.\.\/$IMAGEDIR\/$1\.png\)/g;
$doc_text =~ s/\!\[\]\(.+\/(.+)\.PNG\)/\!\[\]\(\.\.\/$IMAGEDIR\/$1\.PNG\)/g;
$doc_text =~ s/\!\[\]\(.+\/(.+)\.jpg\)/\!\[\]\(\.\.\/$IMAGEDIR\/$1\.jpg\)/g;
$doc_text =~ s/\[img src=(.+)\.png\]/\!\[\]\(\.\.\/$IMAGEDIR\/$1\.png\)/g;
$doc_text =~ s/\[img src=(.+)\.PNG\]/\!\[\]\(\.\.\/$IMAGEDIR\/$1\.PNG\)/g;
$doc_text =~ s/\[img src=(.+)\.jpg\]/\!\[\]\(\.\.\/$IMAGEDIR\/$1\.jpg\)/g;
## Remove [TOC] entries
$doc_text =~ s/\[TOC\]//g;
open(MDFILE, ">$MDDIR/${doc_name}.md") or die "Could not open >$MDDIR/${doc_name}.md";
print MDFILE $doc_text;
close MDFILE;
my $pandoccmd = "pandoc -s --toc $MDDIR/${doc_name}.md -o $HTMLDIR/${doc_name}.html";
verbose($pandoccmd);
system($pandoccmd);
if ($? && !$IGNOREERRORS) { die "error encountered in $pandoccmd \n";}
# This rename is probably a hack, but I didn't want to take the time to
# figure out what was going on:
# pandoc does different processing if target filetype is html
# but all internal refs only work in browser when there is no html filetype
rename "$HTMLDIR/${doc_name}.html","$HTMLDIR/${doc_name}";
$doc_text =~ s/\!\[\]\(\.\.\/$IMAGEDIR\/(.+)\.png\)/\!\[\]\(\.\/$IMAGEDIR\/$1\.png\)/g;
$doc_text =~ s/\!\[\]\(\.\.\/$IMAGEDIR\/(.+)\.PNG\)/\!\[\]\(\.\/$IMAGEDIR\/$1\.PNG\)/g;
$doc_text =~ s/\!\[\]\(\.\.\/$IMAGEDIR\/(.+)\.jpg\)/\!\[\]\(\.\/$IMAGEDIR\/$1\.jpg\)/g;
open(MDFILE, ">$MDDIR/${doc_name}.md") or die "Could not open >$MDDIR/${doc_name}.md";
print MDFILE $doc_text;
close MDFILE;
my $pandoccmd2 = "pandoc --toc $MDDIR/${doc_name}.md -o $PDFDIR/${doc_name}.pdf";
verbose($pandoccmd2);
system($pandoccmd2);
if ($? && !$IGNOREERRORS) { die "error encountered in $pandoccmd2 \n";}
}
# Run the wget cmd and filter out some of the silly output
sub runwget {
my $index = shift;
# options we might consider: --html-extension --restrict-file-names=windows --cut-dirs=3
# options that do not work: --relative
#my $rejectlist = q('*title=Special:*,*title=Talk:*,*title=-&*,*title=HowTos,*title=Main_Page,*title=MediaWiki:*,*title=Release_Notes,*title=Wish_List_for_xCAT_2,*&action=edit*,*&action=history*,*&printable=yes*,*&oldid=*,index.html,opensearch_desc.php,xcat,login.php,support');
my $rejectlist = q('*title=Special:*,*title=Talk:*,*title=-&*,*title=HowTos,*title=Main_Page,*title=Release_Notes,*title=Wish_List_for_xCAT_2,*&action=edit*,*&action=history*,*&printable=yes*,*&oldid=*,index.html,opensearch_desc.php,xcat,login.php,support');
my $cmd = qq(wget --recursive --convert-links --no-verbose --progress=bar --level=1 --page-requisites --no-parent --no-host-directories --no-directories --no-clobber --execute robots=off --post-data='printable=yes' --reject $rejectlist $index);
verbose($cmd);
open(OUT, "$cmd 2>&1 |") || die "can't fork $cmd: $!\n";
while (<OUT>) {
if (/URL:https*:\/\/sourceforge\.net.+\s+->\s+\"(\S+)\"\s+\[/) { print "Downloaded $1.\n"; }
else { print; }
}
close OUT || print "Error running $cmd: $! $?\n";
sub process_includes {
my $doc_text = shift;
my $include_nest = shift;
if ($include_nest++ > 10) { die "nested include processing greater than 10. Infinite recursion???"; }
while (1) {
if ($doc_text =~ /\[\[(\s*)include (\s*)ref=(\s*)(.+)(\s*)\]\]/) {
my $next_include = $4;
download_doc($next_include);
open(INCLDFILE, "<$MDDIR/${next_include}.md") or die "Could not open <$MDDIR/${next_include}.md";
my @include_lines = <INCLDFILE>;
close INCLDFILE;
# my $include_text = join('\n', @include_lines);
my $include_text = join('', @include_lines);
$include_text = process_includes($include_text,$include_nest);
$doc_text =~ s/\[\[(\s*)include (\s*)ref=(\s*)$next_include(\s*)\]\]/$include_text/g;
} else {
last;
}
}
return $doc_text;
}
# Run the xhtml2pdf cmd and filter out some of the silly output
sub runh2p {
my $cmd = shift;
verbose($cmd);
open(OUT, "$cmd 2>&1 |") || die "can't fork $cmd: $!\n";
while (<OUT>) {
next if /DeprecationWarning:\sthe sets module is deprecated/;
next if /from sets import ImmutableSet/;
next if /^\s*import sets\s*$/;
next if /^Converting\ssourceforge.net/;
print;
}
close OUT || print "Error running $cmd: $! $?\n";
sub convert_tables {
my $doc_name=shift;
my $infile="$MDDIR/${doc_name}.md";
my $outfile=$infile;
open(MDFILE, "<$infile") or die "Could not open <$infile";
my @inlines=<MDFILE>;
close MDFILE;
my @outlines;
my @tablines;
my $in_comment=0;
my $xcat_table=0;
my $numcols=1;
my @colwidths=(0);
my $tabcount=0;
verbose("converting tables in $doc_name");
foreach my $line (@inlines) {
if ($line =~ /\<\!---/) { $in_comment=1; next; }
if ($in_comment) {
if ($line =~ /begin_xcat_table/) {$xcat_table=1; next;}
if ($xcat_table) {
if ($line =~ /numcols=(\d+)/) { $numcols=$1; next;}
if ($line =~ /colwidths=([\d,]+)/) { @colwidths=split(',',$1); next;}
}
if ($line =~ /end_xcat_table/) {
my $separator = '+';
foreach my $c (@colwidths) {
if ($c > 0) { $separator .= '-' x $c; }
$separator .= '+';
}
$separator .= "\n";
my $headsep = $separator;
$headsep =~ s/-/=/g;
my $rowline = $separator;
$rowline =~ s/-/ /g;
my $nosep=0;
foreach my $tabline(@tablines) {
if ($tabline =~ /^\s*$/) { next;}
if ($tabline =~ /^\-\-/) {
push (@outlines,$headsep);
$nosep = 1;
next;
}
if ($nosep) { $nosep=0;} else {push (@outlines,$separator);}
$tabline =~ s/^\s*\|//;
my @vals = split (/\|/,$tabline);
my $last_cell_line=0;
my $colnum=0;
my @tabrow;
foreach my $c (@colwidths) {
if ($c > 0) {
my $colval=$vals[$colnum];
$colval =~ s/(\s*)$//;
my $vallen = length($colval);
my $cell_line=0;
while ($vallen > $c) {
$tabrow[$cell_line++][$colnum] = substr($colval,0,$c);
$vallen -= $c;
$colval = substr($colval,$c,$vallen);
}
$tabrow[$cell_line][$colnum] = substr($colval,0,$vallen);
if ($vallen < $c) {
$tabrow[$cell_line][$colnum] .= " " x ($c-$vallen);
}
$last_cell_line = max($cell_line,$last_cell_line);
}
$colnum++;
}
my @rowlines;
for (my $i=0;$i<=$last_cell_line;$i++) {
for (my $j=0;$j<=$numcols-1;$j++) {
$rowlines[$i] .= "|";
if ($tabrow[$i][$j]) { $rowlines[$i] .= $tabrow[$i][$j]; }
else { $rowlines[$i] .= " " x $colwidths[$j]; }
}
$rowlines[$i] .= "|\n";
}
push (@outlines,@rowlines);
}
push (@outlines,$separator);
# reset to process next table
@tablines = ();
$xcat_table=0; $numcols=1;@colwidths=(0);next;
}
if ($line =~ /--\>/) {$in_comment=0;next;}
next;
}
if ($xcat_table) { push (@tablines,$line); next; }
push (@outlines,$line);
next;
}
open(MD2FILE, ">$outfile") or die "Could not open >$outfile";
print MD2FILE @outlines;
close MD2FILE;
return;
}

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