Compare commits

...

122 Commits

Author SHA1 Message Date
arif 1a6c7f750d add reset of BMC for x3755 M4 (8722) after the BMC has been configured
Signed-off-by: Arif Ali <mail@arif-ali.co.uk>
2014-09-18 16:52:37 +01:00
litingt 1545942a68 change log for 2.8.5.1 2014-09-16 19:47:33 -07:00
litingt e1dbf80554 change version to 2.8.5.1 2014-09-16 19:43:21 -07:00
ligc 51b69940b6 fix for bug 4265: remove getxcatdocs from PCM build 2014-08-31 23:27:03 -04:00
qyin 493fbd6f2d Merge branch '2.8' of ssh://git.code.sf.net/p/xcat/xcat-core into 2.8 2014-09-01 11:11:31 +08:00
immarvin f4d5f63441 fix a typo 2014-08-31 20:55:50 -07:00
immarvin 950d3b361f fix defect #4263 Some packages in pkglist file are not exist in RHEL7 2014-08-31 20:33:29 -07:00
qyin 30b1129843 fix issue 241844 The added os packages are not installed when reinstall nodes. 2014-09-01 11:00:18 +08:00
lissav e83d853f34 defect 4262 2014-08-29 07:27:49 -04:00
immarvin c176c37dad fix defect #4242 In physical rhel7 env,set installnic=ethx can not provision compute node. 2014-08-29 00:30:28 -07:00
Jia Zhao a2907dc160 fix message error in nodeimport 2014-08-28 17:28:59 +08:00
Jia Zhao c2055a9b5e merge name mistake in node info file 2014-08-28 17:16:50 +08:00
ligc eae580c867 fix for 4261: add the getnodesetstat support for grub2 2013-08-29 15:15:56 +08:00
ligc 38d16243d7 fix two copyright files xCAT-genesis-scripts/debian/copyright and xCAT-OpenStack-baremetal/debian/copyright, should use EPL license 2013-08-29 09:33:45 +08:00
Jia Zhao dad5005539 validate cec and lparid during nodeimport 2014-08-26 14:01:53 +08:00
immarvin 6daba3107c fix defect #4246 In rhel7/p8 env,sometimes cn provision status is failed. 2014-08-25 21:28:21 -07:00
immarvin 7043664575 add kdump support for redhat7 stateless 2014-08-24 22:30:06 -07:00
immarvin 0f7b27e3e3 add kdump support for redhat7 2014-08-24 07:54:02 -07:00
zhaoertao f280d931ed Fix bug 4257: chvm hugepage doesn't work with dfm on Powerlinux 2014-08-22 03:25:37 -07:00
Lei Ai ff0a52935f clear currchain while refresh chain record 2014-08-22 16:59:45 +08:00
mellor b555e65e36 man page updates for rewritten getxcatdocs to work with Allura wiki on sourceforge 2014-08-21 19:04:27 -04:00
mellor 8d635e9cf0 rewrote getxcatdocs to work with Allura wiki on sourceforge 2014-08-21 16:12:05 -04:00
immarvin 606550feec add template and pkglist of kvm.rhel7 2014-08-21 02:03:35 -07:00
zhaoertao 37f23d4922 remove lowpower option for rpower from Usage 2014-08-21 00:25:29 -07:00
immarvin daace5a881 fix defect #4253 [DEV] the substitution bug in post.xcat 2014-08-21 00:07:58 -07:00
immarvin b7ce4802a1 fulfill the requirement of defect #4242 In physical rhel7 env,set installnic=ethx can not provision compute node. 2014-08-20 23:26:17 -07:00
Jia Zhao 9d98e4c170 fix long name error during import node 2014-08-20 17:00:34 +08:00
ligc eededa0273 fix for xCAT-genesis-builder.spec, can not use /, will cause problem for RHEL 7 2014-08-20 04:56:46 -04:00
huweihua 534faf3b21 modify some comments 2014-08-20 04:02:47 -04:00
huweihua 5dc0c06751 make mkinitrd support rhels5.x and centos5.x 2014-08-20 03:58:17 -04:00
daniceexi 003fafcff3 fix the issue that config alias would remove the original ip on the dev 2014-08-20 08:51:03 -04:00
Jia Zhao 71ab7016db fix no bmc ip while reinstall node 2014-08-20 15:27:11 +08:00
mellor 99844cb290 add copycds man pg example for supplemental iso 2014-08-19 07:40:35 -04:00
zhaoertao 26f2948643 fix bug 4251:nodeset return xnba plugin bug, pid 657 when node mac is not defined 2014-08-19 00:27:44 -07:00
zhaoertao 798623d742 fix bug 4195:rinv returns different content between with and without -x flag 2014-08-18 20:33:06 -07:00
ligc f5d2396cbb fix for bug 4249: use xCAT::Utils in ddns.pm 2013-08-20 11:01:08 +08:00
lissav 2076deac16 fix example 2014-08-14 08:08:35 -04:00
Jarrod Johnson d8a6738f44 Add DDR4 SPD decode 2014-08-13 17:01:26 -04:00
Jia Zhao 5a2ecbbffa Update man page of nodeimport command to support P8 2014-08-13 16:15:34 +08:00
immarvin 661f76a629 #4227 Enhance configfirewall script to handle rhel7 firewall rule setting 2014-08-13 00:52:59 -07:00
immarvin c86b4bda96 fix defect #4245 In rhels 7 env,setupntp script will show error message 2014-08-12 08:36:44 -07:00
ligc 9b707af3b9 Merge branch '2.8' of ssh://git.code.sf.net/p/xcat/xcat-core into 2.8 2014-08-12 05:41:58 -04:00
ligc 3f02b58f15 add the xCATsn into the PCM build, PCM team requires this 2014-08-12 05:41:40 -04:00
Lei Ai 2878c63455 Merge branch '2.8' of ssh://git.code.sf.net/p/xcat/xcat-core into 2.8 2014-08-12 17:19:18 +08:00
Lei Ai de4ccd729e Support runimages associating with hardwareprofiles while replace nodes (nodechmac) 2014-08-12 17:18:31 +08:00
huweihua 844fb5faa6 add --no-bootloader option for si_updateclient command 2014-08-12 05:00:42 -04:00
chudegao 1d18788c73 merge getmacs function from 2.8.2-pcm and fix a bug 2014-08-10 22:01:27 +08:00
immarvin 9069f4dffd 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:24:42 -07:00
immarvin 8ee690c6a1 #4242 In physical rhel7 env,set installnic=ethx can not provision compute node. 2014-08-09 02:20:50 -07:00
immarvin 7375805801 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:51:30 -07:00
immarvin 413810fcb7 correct a typo 2014-08-07 20:35:15 -07:00
huweihua 7f925c885d add entries for support sysclone on p and LVM 2014-08-07 21:42:33 -04:00
daniceexi 89679fe77b 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:36:59 -04:00
Jia Zhao 3f75ebb967 fix importing node error in rh7 with power8 env 2014-08-06 13:56:41 +08:00
lissav fdc7fb40f3 defect 4230 2014-08-05 07:25:42 -04:00
lissav 83f874bb47 fix comment for changes in 3870 2014-08-05 07:09:07 -04:00
huweihua c014aa666b fix bug4218: rscan -w writes wrong mgt for the CECs 2014-08-04 21:53:07 -04:00
huweihua 592ab30a86 fix bug4218: rscan -w writes wrong mgt for the CECs 2014-08-04 21:52:37 -04:00
ligc a65455aafd fix for bug 4212: rnetboot -m and rpower -m arguments parsing error 2013-08-05 17:51:49 +08:00
ligc e2ec591723 fix for bug 4241: do not try to run mknb on ppc64 for now 2013-08-05 17:27:58 +08:00
daniceexi 54da16c6e9 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:13:42 -04:00
zhaoertao 90a8eb313a fix bug 4191 [FVT on Power 8 DFM]mkvm won't create a partition according to the definition 2014-08-01 03:10:35 -07:00
zhaoertao 25c8cf7a5b 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:27:36 -07:00
ligc d53813b356 fix a message typo in *sqlsetup scripts 2013-08-01 16:41:42 +08:00
zhaoertao 3d0f867aed fix bug 4211 [FVT on Power 8 DFM]There is no description for rnetboot ipl in man rnetboot 2014-07-31 01:21:52 -07:00
zhaoertao 78228d5f8c fix bug 4213 [FVT on Power 8 DFM]rnetboot -v returns wrong command version 2014-07-31 01:04:46 -07:00
huweihua 8cd8a891c4 fix defect 4218: rscan -w writes wrong mgt for the CECs 2014-07-31 03:24:01 -04:00
zhaoertao f81dfc7442 fix bug 4221 [FVT on P8 BE with HMC] help info of rspconfig is not clear 2014-07-30 23:44:17 -07:00
zhaoertao ea2cc6440f fix defect 4222 [FVT on P8 BE with HMC] rspconfig returns hmc plugin bug 2014-07-30 19:56:03 -07:00
daniceexi 54706d91f1 Enhance restapi automation doc generator to make it can generate the markdown formatted doc 2014-07-30 10:15:41 -04:00
ligc cdac8c65a1 fix for bug 4239: do not use ip command on AIX 2013-07-31 16:24:47 +08:00
ligc 2c8cb58058 undo the last wrong checkin 98c70c2ee4, broke all the symbolic link files 2013-07-31 15:43:30 +08:00
ligc 1db2339bfb Revert "Revert "fix for bug 4239: do not use ip command on AIX""
This reverts commit 5b348a3220.
2013-07-31 15:26:40 +08:00
ligc fdd3bae198 Revert "Revert "Revert "fix for bug 4239: do not use ip command on AIX"""
This reverts commit 64a2057a94.
2013-07-31 15:22:04 +08:00
ligc 64a2057a94 Revert "Revert "fix for bug 4239: do not use ip command on AIX""
This reverts commit 5b348a3220.
2013-07-31 15:13:40 +08:00
ligc 5b348a3220 Revert "fix for bug 4239: do not use ip command on AIX"
This reverts commit 98c70c2ee4.
2013-07-31 15:12:38 +08:00
ligc 98c70c2ee4 fix for bug 4239: do not use ip command on AIX 2013-07-31 14:51:55 +08:00
daniceexi 3400529a3b enable the rvitals and lsvm commands handle in ppc.pm 2014-07-30 07:36:15 -04:00
huweihua 2b1ef866c3 add comment to attr rootimgdir in sysclone environment 2014-07-30 01:39:36 -04:00
daniceexi dea6b2f894 defect 4226: fix the issue that rvital cannot handle cec which has no parent att was set 2014-07-30 04:16:25 -04:00
huweihua 74df4bb65b add updatenode usage in sysclone environment 2014-07-29 22:24:12 -04:00
lissav 1149e0e1fa remove mediawiki path from the man pages 2014-07-29 12:18:03 -04:00
lissav c20b20c4bb remove mediawiki path from the man pages 2014-07-29 12:10:17 -04:00
lissav 213d17ca74 fix comments 2014-07-29 11:59:21 -04:00
mellor e4839d2f81 defect 4229 add new rescanplugins support to xcatd 2014-07-29 11:18:39 -04:00
immarvin 3ed8c3b884 add compute.ubuntu14.04.pkglist for netboot 2014-07-29 03:29:59 -07:00
immarvin ba23e072a1 #4165 [FVT]:copycds -i return no DISKNO 2014-07-29 02:33:28 -07:00
ligc 0d4888af5a fix for bug 4203: update the makeconservercf manpage and usage information 2014-07-28 17:32:03 -05:00
ligc af1a4d62f9 fix for bug 4202: parse the rcons -help and rcons --help 2014-07-28 17:02:38 -05:00
immarvin 4d5102b346 fix defect #4201 grub2 failure with mixed case mac address 2014-07-28 02:42:57 -07:00
ligc 775068fdba fix for bug 4184: make the message 'make sure rcons works for <node>' be non-verbose message 2014-07-28 16:34:52 -05:00
immarvin be2a2df4a6 add net-tools to service pkglist 2014-07-28 02:20:06 -07:00
ligc 99d7a6d3fa 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:45:37 -04:00
lissav 31cff24c27 defect 4235 2014-07-25 09:08:33 -04:00
lissav d8eb46372a defect 4235 2014-07-24 11:04:58 -04:00
lissav 328ff3fa75 defect 4235 2014-07-24 10:45:36 -04:00
ligc 80dc1ce1a7 fix for bug 4130: mkdef/chdef handle the nics* attributes for node group 2014-07-24 17:26:14 -05:00
ligc 649d6820db fix for bug 4129: remove duplicate messages in debian.pm 2014-07-24 17:24:36 -05:00
ligc 56a62ffb03 fix a problem in the previous check for bug fix 4119 2014-07-24 17:00:08 -05:00
ligc 489a16287b fix for bug 4119: add comments for postscripts confignics/configeth/configib 2014-07-24 16:56:15 -05:00
ligc 843bad685c fix for bug 4119: add comments for postscripts confignics/configeth/configib 2014-07-24 16:50:30 -05:00
ligc 292d7ea5d9 fix for bug 4119: add comments for postscripts confignics/configeth/configib 2014-07-24 16:49:24 -05:00
daniceexi 08d923735c 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:32:43 -04:00
daniceexi 82adc2746b 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:18:11 -04:00
immarvin 67ee622cdd fix defect #4233 syslog changes give syntax error on AIX 2014-07-22 23:16:48 -07:00
immarvin 9e71b35a43 fix defect #4229 xcatd will restart when add a kit or remove a kit that has a plugin 2014-07-22 20:34:23 -07:00
lissav 44bae8d8ea fix for ecdsa support 2014-07-22 10:29:42 -04:00
lissav 5ad5eb1b1e defect 4231 2014-07-22 07:21:51 -04:00
lissav b42741e5a1 defect 4231 2014-07-21 12:43:33 -04:00
lissav 616b6fbc6d defect 4231 2014-07-21 12:42:10 -04:00
lissav b47d73efec defect 4231 2014-07-21 12:39:55 -04:00
ligc 7d68e94f89 fix for bug 4136: per node consoleondemand backport from 2.9 to 2.8.5 2014-07-21 10:32:36 -05:00
immarvin aac3f853f1 add comment for servicemap subroutine 2014-07-17 08:03:58 -07:00
zhaoertao b46d7f8fe1 make options for chvm easier to understand 2014-07-16 02:36:18 -07:00
immarvin 4fb700d3fd fix the defect #4217 [FVT]pgsqlsetup -i failed to start postgresql 2014-07-15 03:10:05 -07:00
daniceexi 954bd12f28 changed the plugin for renergy to handle the output format change in nmap 2014-07-15 10:10:27 -04:00
lissav a4da00bbf2 fix incorrect change for starting mysql using startservice, sles/rh different 2014-07-11 08:52:02 -04:00
Lei Ai 357ece6e9e support VM for node management profiles consistent check 2014-07-10 11:36:59 +08:00
daniceexi 8552292c70 SL6.5 support 2014-07-10 02:45:00 -04:00
daniceexi 014c69c7b9 routeop: for replace operator, convert dotted-decimal netmask to CIDR format 2014-07-09 08:42:08 -04:00
zhaoertao 1ff39a437d remove option 'lowpower' for rpower, it is used for p7IH only 2014-07-09 00:29:44 -07:00
Jarrod Johnson 02f0dc07e4 CentOS 7 Everything ISO recognition 2014-07-08 16:53:58 -04:00
107 changed files with 2463 additions and 676 deletions
+1 -11
View File
@@ -1,14 +1,4 @@
xCAT - eXtreme Cloud Administration Toolkit
xCAT is a toolkit for the deployment and administration of clusters.
xCAT documentation is available at: http://xcat.sourceforge.net/
xCAT is made available as open source software under the EPL license:
http://www.opensource.org/licenses/eclipse-1.0.php
xCAT 2.8.5.1 is for Intel Haswell support for IBM m5 server.
+1 -1
View File
@@ -1 +1 @@
2.8.5
2.8.5.1
+4 -3
View File
@@ -44,10 +44,11 @@ FRS=/home/frs/project/x/xc/xcat
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"
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"
# Note: for FSM, the FlexCAT rpm is built separately from gsa/git
FSMBUILD="perl-xCAT xCAT-client xCAT-server"
FSMLINK=""
+10 -2
View File
@@ -4036,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] =
@@ -4407,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
@@ -4505,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);
+71 -29
View File
@@ -52,10 +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',
'add_physlots' => 'part_get_all_io_bus_info',
'del_physlots' => 'part_get_all_io_bus_info',
'vmnics' => 'part_get_all_vio_info',
'vmstorage' => 'part_get_all_vio_info',
'add_vmnics' => 'part_get_all_vio_info',
'add_vmstorage' => 'part_get_all_vio_info',
'del_vadapter' => 'part_get_all_vio_info'
);
@@ -63,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 del_physlots);
my @support_ops = qw(vmcpus vmmemory add_physlots vmothersetting add_vmstorage add_vmnics del_vadapter del_physlots);
if (ref($args) ne 'ARRAY') {
return "$args";
}
@@ -112,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";
@@ -156,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})/) {
@@ -170,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) {
@@ -801,14 +801,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" or $op eq "del_physlots") {
} 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) {
@@ -827,7 +840,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);
@@ -878,7 +891,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";
@@ -1678,7 +1695,7 @@ sub xCATdB {
$profile,
$parent );
return( xCAT::PPCdb::add_ppc( $hwtype, [$values] ));
return( xCAT::PPCdb::add_ppc( $hwtype, [$values],'','',"FSP" ));
}
return undef;
}
@@ -2060,9 +2077,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]);
@@ -2100,6 +2120,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);
@@ -2112,7 +2133,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");
@@ -2123,7 +2144,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})) {
@@ -2139,7 +2160,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]]]);
}
}
}
@@ -2149,7 +2170,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]]]);
}
}
}
@@ -2180,19 +2201,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");
@@ -2207,9 +2232,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 {
@@ -2232,11 +2259,12 @@ 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;
#$memhash->{run} = 1;
}
my $tmp_ent = $ent->{$name}->[0];
if (exists($opt->{vmcpus})) {
@@ -2272,11 +2300,23 @@ 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 == '') {
$mmin = $1 * 1024;
@@ -2383,7 +2423,7 @@ 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"]);
$lpar_hash{$name} = $rethash;
@@ -2426,15 +2466,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
+11 -1
View File
@@ -217,7 +217,17 @@ sub is_me
#my ($b1, $b2, $b3, $b4) = split /\./, $nameIP;
# get all the possible IPs for the node I'm running on
my $ipcmd = "ip addr | grep 'inet'";
# 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)
{
Regular → Executable
+1 -1
View File
@@ -2634,7 +2634,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");
}
],
);
+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;
}
+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 ) {
+14 -19
View File
@@ -296,42 +296,37 @@ sub renergy {
$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;
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";
+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" );
}
###########################################
+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;
}
+121 -8
View File
@@ -655,6 +655,38 @@ 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
Description : Judge whether profiled nodes discovering is running or not.
Arguments : NA
@@ -690,6 +722,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 +742,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;
}
}
@@ -739,7 +776,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];
@@ -800,13 +837,10 @@ 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();
@@ -847,6 +881,13 @@ sub check_profile_consistent{
return 0, "Provisioning network not defined for network profile."
}
# 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,
'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."
@@ -860,6 +901,11 @@ sub check_profile_consistent{
return 0, "$nictype networkprofile must use with hardwareprofile.";
}
}
if ($mgt eq 'vm')
{
return 1, "";
}
# 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' ) {
@@ -1139,3 +1185,70 @@ 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");
}
$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.
if ((exists $netprofileattr->{"bmc"}) and $hw_reconfig){
if (index($final_chain, "runcmd=bmcsetup") == -1){
$final_chain = 'runcmd=bmcsetup,'.$final_chain.':reboot4deploy';
}
else{
$final_chain = $final_chain.':reboot4deploy';
}
}
return (0, $final_chain);
}
+5 -4
View File
@@ -287,7 +287,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 +371,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 ($_ & 0b10000000) {
$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";
}
+8 -3
View File
@@ -571,7 +571,7 @@ nodegroup => {
},
},
nodehm => {
cols => [qw(node power mgt cons termserver termport conserver serialport serialspeed serialflow getmac cmdmapping comments disable)],
cols => [qw(node power mgt cons termserver termport conserver serialport serialspeed serialflow getmac cmdmapping consoleondemand comments disable)],
keys => [qw(node)],
tablespace =>'XCATTBS16K',
table_desc => "Settings that control how each node's hardware is managed. Typically, an additional table that is specific to the hardware type of the node contains additional info. E.g. the ipmi, mp, and ppc tables.",
@@ -588,6 +588,7 @@ nodehm => {
serialflow => "The flow control value of the serial port for this node. For SOL this is typically 'hard'.",
getmac => 'The method to use to get MAC address of the node with the getmac command. If not set, the mgt attribute will be used. Valid values: same as values for mgmt attribute.',
cmdmapping => 'The fully qualified name of the file that stores the mapping between PCM hardware management commands and xCAT/third-party hardware management commands for a particular type of hardware device. Only used by PCM.',
consoleondemand => 'This overrides the value from site.consoleondemand; (0=no, 1=yes). Default is the result from site.consoleondemand.',
comments => 'Any user-written notes.',
disable => "Set to 'yes' or '1' to comment out this row.",
},
@@ -1155,9 +1156,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".
@@ -1972,6 +1973,10 @@ my @nodeattrs = (
{attr_name => 'serialflow',
tabentry => 'nodehm.serialflow',
access_tabentry => 'nodehm.node=attr:node',
},
{attr_name => 'consoleondemand',
tabentry => 'nodehm.consoleondemand',
access_tabentry => 'nodehm.node=attr:node',
},
##################
# vpd table #
+12 -8
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,9 @@ 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:
Regular → Executable
+165 -2
View File
@@ -2521,6 +2521,12 @@ sub check_deployment_monitoring_settings()
($attr, $val) = split /=~/,$m,2;
$val =~ s/^\///;
$val =~ s/\/$//;
} elsif ($m =~ /^[^=]*!=/) {
($attr, $val) = split /!=/,$m,2;
} elsif ($m =~ /^[^=]*!~/) {
($attr, $val) = split /!~/,$m,2;
$val =~ s/^\///;
$val =~ s/\/$//;
} else {
my $rsp={};
$rsp->{data}->[0] = "Invalid string \"$m\" specified with -m flag";
@@ -3536,6 +3542,98 @@ sub gettimezone
}
#--------------------------------------------------------------------------------
=head3 specialservicemgr
some special services cannot be processed in sysVinit, upstart and systemd framework, should be process here...
Arguments:
service name:
action: start/stop/restart/status/enable/disable
outputoption:
1: return a hashref with the keys:"retcode","retmsg"
otherwise: return retcode only
Returns:
a hashref if $outputoption is 1,the hash structure is:
{"retcode"=>(status code, 0 for running/active,1 for stopped/inactive,2 for failed)
"retmsg" =>(status string, running/active/stopped/inactive/failed)
}
the status code otherwise
retcode: 127 if the service specified is not processed
the exit code of the service operation if the service specified is processed
Globals:
none
Error:
none
Example:
my $ret=xCAT::Utils->specialservicemgr("firewall","start");
Comments:
none
=cut
#--------------------------------------------------------------------------------
sub specialservicemgr{
my $svcname=shift;
my $action=shift;
my $outputoption=shift;
my %ret;
$ret{retcode}=127;
if($svcname eq "firewall")
{
my $cmd="type -P SuSEfirewall2 >/dev/null 2>&1";
xCAT::Utils->runcmd($cmd,-1);
if($::RUNCMD_RC)
{
$ret{retcode}=127;
if(defined $outputoption and $outputoption == 1){
return \%ret;
}else{
return $ret{retcode};
}
}else{
if(($action eq "start") || ($action eq "stop"))
{
$cmd="SuSEfirewall2 $action";
}elsif($action eq "restart"){
$cmd="SuSEfirewall2 stop;SuSEfirewall2 start";
}elsif($action eq "disable"){
$cmd="SuSEfirewall2 off";
}elsif($action eq "enable"){
$cmd="SuSEfirewall2 on";
}elsif($action eq "status"){
$cmd="service SuSEfirewall2_setup status";
}else{
$ret{retcode}=127;
if(defined $outputoption and $outputoption == 1){
return \%ret;
}else{
return $ret{retcode};
}
}
$ret{retmsg}=xCAT::Utils->runcmd($cmd,-1);
$ret{retcode}= $::RUNCMD_RC;
if(defined $outputoption and $outputoption == 1){
return \%ret;
}else{
return $ret{retcode};
}
}
}
if(defined $outputoption and $outputoption == 1){
return \%ret;
}else{
return $ret{retcode};
}
}
#--------------------------------------------------------------------------------
@@ -3576,12 +3674,19 @@ sub servicemap{
#"service manager name(SYSVinit/systemd) $svcmgrtype"
#=> ["list of possible service file names for the specified $svcname under the specified $svcmgrtype "]
# }
#
#
# if there are more than 1 possible service names for a service among
# different os distributions and os releases, the service should be
# specified in %svchash with structure
# (general service name) => {list of possible service names}
#
my %svchash=(
"dhcp" => ["dhcp3-server","dhcpd","isc-dhcp-server"],
"nfs" => ["nfsserver","nfs-server","nfs","nfs-kernel-server"],
"named" => ["named","bind9"],
"syslog" => ["syslog","syslogd","rsyslog"],
"firewall" => ["iptables","firewalld","SuSEfirewall2_setup","ufw"],
"firewall" => ["iptables","firewalld","ufw"],
"http" => ["apache2","httpd"],
"ntpserver" =>["ntpd","ntp"],
"mysql" => ["mysqld","mysql"],
@@ -3595,7 +3700,7 @@ sub servicemap{
}elsif ($svcmgrtype == 1){
$path="/usr/lib/systemd/system/";
$postfix=".service";
$retdefault=$svcname.".service";
# $retdefault=$svcname.".service";
}elsif ($svcmgrtype == 2){
$path="/etc/init/";
$postfix=".conf";
@@ -3648,6 +3753,13 @@ sub startservice{
$svcname=shift;
}
my $retval=0;
$retval=specialservicemgr($svcname,"start");
if($retval != 127)
{
return $retval;
}
my $cmd="";
#for Systemd
my $svcunit=undef;
@@ -3712,6 +3824,16 @@ sub stopservice{
$svcname=shift;
}
my $retval=0;
$retval=specialservicemgr($svcname,"stop");
if($retval != 127)
{
return $retval;
}
my $cmd="";
my $svcunit=undef;
my $svcd=undef;
@@ -3774,6 +3896,14 @@ sub restartservice{
$svcname=shift;
}
my $retval=0;
$retval=specialservicemgr($svcname,"restart");
if($retval != 127)
{
return $retval;
}
my $cmd="";
my $svcunit=undef;
my $svcd=undef;
@@ -3844,6 +3974,18 @@ sub checkservicestatus{
my $outputoption=shift;
my $retval;
$retval=specialservicemgr($svcname,"status",1);
if($retval->{retcode} != 127)
{
if(defined $outputoption and $outputoption == 1 ){
return $retval;
}elsif(exists $retval->{retcode}){
return $retval->{retcode};
}
}
my $cmd="";
my $svcunit=undef;
my $svcd=undef;
@@ -3937,6 +4079,16 @@ sub enableservice{
$svcname=shift;
}
my $retval=0;
$retval=specialservicemgr($svcname,"enable");
if($retval != 127)
{
return $retval;
}
my $cmd="";
my $svcunit=undef;
my $svcd=undef;
@@ -4003,6 +4155,17 @@ sub disableservice{
$svcname=shift;
}
my $retval=0;
$retval=specialservicemgr($svcname,"disable");
if($retval != 127)
{
return $retval;
}
my $cmd="";
my $svcunit=undef;
my $svcjob=undef;
+4 -2
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",
@@ -91,8 +92,9 @@ 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
"1273608367.051780" => "SL5.5", #x86_64 DVD ISO
"1299104542.844706" => "SL6", #x86_64 DVD ISO
"1390839789.062069" => "SL6.5", #x86_64 DVD ISO Install
);
my %numdiscs = (
"1156364963.862322" => 4,
+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.
+1 -1
View File
@@ -1878,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
+2 -1
View File
@@ -176,7 +176,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,$_;
}
}
+188 -164
View File
@@ -1,190 +1,214 @@
#!/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 = 'mellor';
#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;
# 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 $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;
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] [-i|--ignoreerrors] [<destination-dir>]\n";
print "Usage: getxcatdocs [-v|--verbose] [-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,
'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) {
my $scurlcmd = "curl -X GET $wiki_url$SINGLE_DOC";
verbose($scurlcmd);
my $pagecontent = `$scurlcmd`;
if ($? && !$IGNOREERRORS) { die "error encountered in $scurlcmd \n";}
my $pageout = $json->decode($pagecontent);
foreach my $pageatt (@{$pageout->{attachments}}) {
my $swgetcmd = "wget $pageatt->{url}";
verbose($swgetcmd);
system($swgetcmd);
if ($? && !$IGNOREERRORS) { die "error encountered in $swgetcmd \n";}
}
convert_doc($SINGLE_DOC,$pageout->{text},'.','.','.','.');
exit;
}
# Download the HTML docs and convert them all to pdfs
if (!$UPLOADONLY) { gethtmldocs('md','html','pdf','images'); }
# tar/compress
my $date=`date +%Y%m%d%H%M`;
chop $date;
my $docname="xcat-docs-snap$date.tar.gz";
chdir($destdir) or die "Can not cd to $destdir: $!\n";
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;
my $mddir = shift;
my $htmldir = shift;
my $pdfdir = shift;
my $imagedir = shift;
my $savedir = getcwd();
mkdir($mddir);
mkdir($htmldir);
mkdir($pdfdir);
mkdir($imagedir);
#delete all the files in the dirs in case they previously ran this
unlink <$mddir/*>;
unlink <$htmldir/*>;
unlink <$pdfdir/*>;
unlink <$imagedir/*>;
print "\nDownloading and converting the xCAT wiki document list from $wiki_url ...\n";
my @doclist;
my %donelist;
foreach my $index (@indexdocs) {
if ( $donelist{$index} ) { next; }
my $indexcmd = "curl -X GET $wiki_url/$index";
verbose($indexcmd);
my $indexmd = `$indexcmd`;
if ($? && !$IGNOREERRORS) { die "error encountered in $indexcmd \n";}
my $jsout = $json->decode($indexmd);
push @doclist,@{$jsout->{related_artifacts}};
foreach my $att (@{$jsout->{attachments}}) {
my $iwgetcmd = "wget -P $imagedir/ $att->{url}";
verbose($iwgetcmd);
system($iwgetcmd);
if ($? && !$IGNOREERRORS) { die "error encountered in $iwgetcmd \n";}
}
convert_doc($index,$jsout->{text},$mddir,$htmldir,$pdfdir,$imagedir);
$donelist{$index}=1;
}
print "\nDownloading and converting the xCAT wiki documentation to $savedir ...\n";
foreach my $doc (@doclist) {
my $doc_name = $doc;
$doc_name =~ s/\/.*\/(.+)\/$/$1/;
if ( $donelist{$doc_name} ) { next; }
verbose("processing $doc");
my $doc_url=$sf_url.$doc;
my $curlcmd = "curl -X GET $doc_url";
verbose($curlcmd);
my $pagecontent = `$curlcmd`;
my $pageout = $json->decode($pagecontent);
foreach my $pageatt (@{$pageout->{attachments}}) {
my $wgetcmd = "wget -P $imagedir/ $pageatt->{url}";
system($wgetcmd);
if ($? && !$IGNOREERRORS) { die "error encountered in $wgetcmd \n";}
}
convert_doc($doc_name,$pageout->{text},$mddir,$htmldir,$pdfdir,$imagedir);
$donelist{$doc_name}=1;
}
chdir($savedir);
}
sub convert_doc {
my $doc_name = shift;
my $doc_text = shift;
my $mddir = shift;
my $htmldir = shift;
my $pdfdir = shift;
my $imagedir = shift;
## 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;
open(MDFILE, ">$mddir/${doc_name}.md") or die;
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;
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";}
# 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);
}
# 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 || die "Error running $cmd: $! $?";
}
# 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 /^Converting\ssourceforge.net/;
print;
}
close OUT || die "Error running $cmd: $! $?";
}
+9 -10
View File
@@ -888,15 +888,14 @@ sub mysqlstart
} else { # it is mysql
#if ($::linuxos =~ /rh.*/)
#{
# $cmd = "service mysqld start";
#}
#else
#{ # sles
# $cmd = "service mysql start";
#}
$ret=xCAT::Utils->startservice("mysql");
if ($::linuxos =~ /rh.*/)
{
$ret=xCAT::Utils->startservice("mysqld");
}
else
{ # sles
$ret=xCAT::Utils->startservice("mysql");
}
}
}
if ($ret != 0)
@@ -1788,7 +1787,7 @@ sub restorexcatdb
# restore the database
xCAT::MsgUtils->message(
"I",
"Restoring the xCat Database with $::backupdir to MySQL database.\nThis could take several minutes."
"Restoring the xCAT Database with $::backupdir to MySQL database.\nThis could take several minutes."
);
if (!(-d $::backupdir))
{ # does not exist, error
+1 -1
View File
@@ -1331,7 +1331,7 @@ sub restorexcatdb
# restore the database
xCAT::MsgUtils->message(
"I",
"Restoring the xCat Database with $::backupdir to PostgreSQL database.\nThis could take several minutes."
"Restoring the xCAT Database with $::backupdir to PostgreSQL database.\nThis could take several minutes."
);
if (!(-d $::backupdir))
{ # does not exist, error
+12 -9
View File
@@ -13,7 +13,7 @@ if [ "$os" == "AIX" ]; then
export HOME
fi
if [ -z "$1" ] || [ "$1" = "-h" ]; then
if [ -z "$1" ] || [ "$1" = "-h" ] || [ "$1" = "-help" ] || [ "$1" = "--help" ]; then
echo "rcons - remotely accesses the serial console of a node"
echo "rcons <singlenode> [conserver] [-f]"
echo "rcons <singlenode> [conserver] [-s]"
@@ -66,14 +66,17 @@ if [ -f "/usr/bin/console" ] || [ -f "/bin/console" ]; then
#Detect console support of SSL, only fixup consolerc if encryption is detected
if ! console -h 2>&1 | grep "encryption not compiled" > /dev/null; then
if [ ! -f $HOME/.consolerc ]; then
echo 'config * {' > $HOME/.consolerc
echo " port 782;" >> $HOME/.consolerc
echo " sslenabled yes;" >> $HOME/.consolerc
echo " sslauthority $HOME/.xcat/ca.pem;" >> $HOME/.consolerc
echo " sslcredentials $HOME/.xcat/client-cred.pem;" >> $HOME/.consolerc
echo '}' >> $HOME/.consolerc
fi
# generate .consolerc if it does not exist or is empty
if [ ! -s $HOME/.consolerc ]; then
cat > $HOME/.consolerc << EOF
config * {
port 782;
sslenabled yes;
sslauthority $HOME/.xcat/ca.pem;
sslcredentials $HOME/.xcat/client-cred.pem;
}
EOF
fi
else
# ssl is not enabled, comment out the ssl settings in .consolerc
if [ -f $HOME/.consolerc ]; then
+8 -7
View File
@@ -23,8 +23,9 @@ B<chvm> I<noderange> I<--p775> B<-i id> [B<-m> I<memory_interleaving>] B<-r> I<p
B<chvm> I<noderange> [B<lparname>={B<*>|B<name>}]
B<chvm> I<noderange> [B<vmcpus=min/req/max>] [B<vmmemory=min/req/max>]
[B<vmphyslots=drc_index1,drc_index2...>] [B<vmothersetting=hugepage:N,bsr:N>]
[B<vmnics=vlan1[,vlan2..]]> [B<vmstorage=<N|viosnode:slotid>>] [B<--vios>]
[B<vmothersetting=hugepage:N,bsr:N>]
[B<add_physlots=drc_index1,drc_index2...>]
[B<add_vmnics=vlan1[,vlan2..]]> [B<add_vmstorage=<N|viosnode:slotid>>] [B<--vios>]
[B<del_physlots=drc_index1,drc_index2...>]
[B<del_vadapter=slotid>]
@@ -114,7 +115,7 @@ The administrator should use lsvm to get the profile content, and then edit the
For normal power machine:
chvm could be used to modify the resources assigned to partitions. The admin shall specify the attributes with options I<vmcpus>, I<vmmemory>, I<vmphyslots>, I<vmothersetting>, I<vmnics> and/or I<vmstorage>. If nothing specified, nothing will be returned.
chvm could be used to modify the resources assigned to partitions. The admin shall specify the attributes with options I<vmcpus>, I<vmmemory>, I<add_physlots>, I<vmothersetting>, I<add_vmnics> and/or I<add_vmstorage>. If nothing specified, nothing will be returned.
=head2 VMware/KVM specific:
@@ -198,11 +199,11 @@ Name of I/O slots assignment profile. Shall work with option B<--p775>.
Set LPAR name for the specified lpars. If '*' specified, it means to get names from xCAT database and then set them for the specified lpars. If a string is specified, it only supports single node and the string will be set for the specified lpar. The user can use lsvm to check the lparnames for lpars.
=item B<vmcpus=value> B<vmmemory=value> B<vmphyslots=value> B<vmothersetting=value>
=item B<vmcpus=value> B<vmmemory=value> B<add_physlots=value> B<vmothersetting=value>
To specify the parameters that will be modified.
=item B<vmnics=value> B<vmstorage=value> [B<--vios>]
=item B<add_vmnics=value> B<add_vmstorage=value> [B<--vios>]
To create new virtual adapter for the specified node.
@@ -509,7 +510,7 @@ The output is similar to:
To modify the resource assignment:
chvm lpar1 vmcpus=1/2/16 vmmemory=1G/8G/32G vmphyslots=0x21010202
chvm lpar1 vmcpus=1/2/16 vmmemory=1G/8G/32G add_physlots=0x21010202
The output is similar to:
@@ -531,7 +532,7 @@ The resource information after modification is similar to:
lpar1: 1/2/2
lpar1: 128.
Note: The physical I/O resources specified with I<vmphyslots> will be appended to the specified partition. The physical I/O resources which are not specified but belonged to the partition will not be removed. For more information about I<vmphyslots>, please refer to L<lsvm(1)|lsvm.1>.
Note: The physical I/O resources specified with I<add_physlots> will be appended to the specified partition. The physical I/O resources which are not specified but belonged to the partition will not be removed. For more information about I<add_physlots>, please refer to L<lsvm(1)|lsvm.1>.
=head2 VMware/KVM specific:
+2 -2
View File
@@ -24,8 +24,8 @@ The B<configfpc> command discovers the FPCs and collects the MAC address. The MA
This process is repeated until no more FPCs are discovered.
For more information on xCAT support of NeXtScale and configfpc see:
https://sourceforge.net/apps/mediawiki/xcat/index.php?title=XCAT_NeXtScale_Clusters
For more information on xCAT support of NeXtScale and configfpc see the following doc:
XCAT_NeXtScale_Clusters
=head1 OPTIONS
+1 -1
View File
@@ -24,7 +24,7 @@ The xcatd daemon will be stopped during migration on the MN. No xCAT commands s
The db2sqlsetup script must be run on each Service Node, after the DB2 Client code has been installed, to setup the DB2 Client (-C). There are two postscripts that are provided ( db2install and odbcsetup) that will automatically setup you Service Node as a DB2 client.
For full information on the setup of DB2, see http://sourceforge.net/apps/mediawiki/xcat/index.php?title=Setting_Up_DB2_as_the_xCAT_DB.
For full information on the setup of DB2, see the following doc: Setting_Up_DB2_as_the_xCAT_DB.
When running of db2sqlsetup on the MN:
One password must be supplied for the setup, a password for the xcatdb unix id which will be used as the DB2 instance id and database name. The password will be prompted for interactively or can be input with the XCATDB2PW environment variable.
+1 -1
View File
@@ -38,7 +38,7 @@ B<osupdatename> - comma separated 'osdistroupdate' object. Each 'osdistroupdate'
Linux distro update. When run geninitrd, 'kernel-*.rpm' will be searched from osdistroupdate.dirpath
to get all the rpm packages and then search the drivers from the rpm packages.
Refer to the doc: https://sourceforge.net/apps/mediawiki/xcat/index.php?title=Using_Linux_Driver_Update_Disk
Refer to the doc: Using_Linux_Driver_Update_Disk
=back
+5 -1
View File
@@ -26,10 +26,14 @@ The getmacs command collects MAC address from a single or range of nodes.
Note that on AIX systems, the returned MAC address is not colon-seperated (for example 8ee2245cf004), while on Linux systems the MAC address is colon-seperated (for example 8e:e2:24:5c:f0:04).
If no ping test performed, getmacs writes the first adapter MAC to the xCAT database. If ping test performed, getmacs will write the first successfully pinged MAC to xCAT database.
For PPC (without HMC, using Direct FSP Management) specific:
For PPC (using Direct FSP Management) specific:
Note: If network adapters are physically assigned to LPARs, getmacs cannot read the MAC addresses unless perform ping test, since there is no HMC command to read them and getmacs has to login to open formware. And if the LPARs has never been activated before, getmacs need to be performed with the option "B<-D>" to get theirs MAC addresses.
For PPC (using HMC) specific:
Note: The option "B<-D>" B<must> be used to get MAC addresses of LPARs.
For IBM Flex Compute Node (Compute Node for short) specific:
Note: If "B<-d>" is specified, all the MAC of the blades will be displayed. If no option specified, the first MAC address of the blade will be written to mac table.
+16 -12
View File
@@ -4,19 +4,23 @@ B<getxcatdocs> - downloads the xCAT documentation and converts to HTML and PDF
=head1 SYNOPSIS
B<getxcatdocs> [B<-?> | B<-h> | B<--help> | B<-v> | B<--version>] [I<destination-dir>]
B<getxcatdocs> [B<-?> | B<-h> | B<--help>]
B<getxcatdocs> [B<-v> | B<--verbose>] [I<destination-dir>]
B<getxcatdocs> [B<-v> | B<--verbose>] [B<-d> | B<--doc> I<single_doc>] [I<destination-dir>]
=head1 DESCRIPTION
The B<getxcatdocs> command downloads the xCAT documentation from the wiki and converts it to both HTML and PDF.
This enables reading the documentation when you do not have internet access. Note that this command does not
download/convert the entire xCAT wiki - only the "official" xCAT documentation linked from https://sourceforge.net/apps/mediawiki/xcat/index.php?title=XCAT_Documentation .
download/convert the entire xCAT wiki - only the "official" xCAT documentation linked from http://sourceforge.net/p/xcat/wiki/XCAT_Documentation.
If I<destination-dir> is specified, B<getxcatdocs> will put the converted documentation in that directory, in 2 sub-directories: html, pdf.
Otherwise, it will put it in the current directory (in the same two sub-directories).
If I<destination-dir> is specified, B<getxcatdocs> will put the converted documentation in that directory, in 3 sub-directories: html, pdf, images.
Otherwise, it will put it in the current directory (in the same three sub-directories).
B<getxcatdocs> uses wget to do the download the documents and xhtml2pdf to convert them to PDF. To install xhtml2pdf, see:
https://sourceforge.net/apps/mediawiki/xcat/index.php?title=Editing_xCAT_Documentation_Pages#Converting_Wiki_Pages_to_HTML_and_PDFs .
If B<--doc> I<single_doc> is specified, only that one wiki page will be downloaded and converted.
B<getxcatdocs> uses curl to run the Allura wiki API to download the document markdown text, and Pandoc with LaTex them to PDF. You must have all of these functions installed to run B<getxcatdocs>. See:
http://sourceforge.net/p/xcat/wiki/Editing_and_Downloading_xCAT_Documentation/#converting-wiki-pages-to-html-and-pdfs
=head2 Limitations:
@@ -26,24 +30,24 @@ https://sourceforge.net/apps/mediawiki/xcat/index.php?title=Editing_xCAT_Documen
This command does not run on AIX or Windows.
=item *
The conversion to HTML does not yet honor the xCAT wiki style sheet.
=back
=head1 OPTIONS
=over 10
=item B<-v|--version>
=item B<-v|--verbose>
Command Version.
Run the command in verbose mode.
=item B<-?|-h|--help>
Display usage message.
=item B<-d|--doc> I<single_doc>
Run this command for a single document only. If you get errors about Official-xcat-doc.png not found, either download this image directly from http://sourceforge.net/p/xcat/wiki/XCAT_Documentation/attachment/Official-xcat-doc.png or run B<getxcatdocs -d XCAT_Documentation> first.
=back
=head1 RETURN VALUE
+2 -2
View File
@@ -41,8 +41,8 @@ The Memory Interleaving Mode has 3 valid options:
1 - interleaved
2 - non-interleaved
More information about this part, refer to the section Using the *vm commands to define partitions in xCAT DFM in the link below.
https://sourceforge.net/apps/mediawiki/xcat/index.php?title=XCAT_Power_775_Hardware_Management
More information about this part, refer to the section Using the *vm commands to define partitions in xCAT DFM in the following doc:
XCAT_Power_775_Hardware_Management
=head2 For KVM and Vmware
+7 -7
View File
@@ -68,13 +68,13 @@ To display all information:
Output is similar to:
Version 2.7 (svn r, built Tue Jan 17 15:16:33 EST 2012)
This is a Management Node
cfgloc=mysql:dbname=xcatdb;host=10.6.0.1|xcatadmin
dbengine=mysql
dbname=xcatdb
dbhost=10.6.0.1
dbadmin=xcatadmin
Version 2.8.5 (git commit 0d4888af5a7a96ed521cb0e32e2c918a9d13d7cc, built Tue Jul 29 02:22:47 EDT 2014)
This is a Management Node
cfgloc=mysql:dbname=xcatdb;host=9.114.34.44|xcatadmin
dbengine=mysql
dbname=xcatdb
dbhost=9.114.34.44
dbadmin=xcatadmin
=back
+3 -3
View File
@@ -20,7 +20,7 @@ B<mysqlsetup> {B<-L>|B<--LL>} [-V|--verbose]
=head1 DESCRIPTION
B<mysqlsetup> - Sets up the MySQL or MariaDB database (linux only for MariaDB) for xCAT to use. The mysqlsetup script is run on the Management Node as root after the MySQL code or MariaDB code has been installed. Before running the init option, the MySQL server should be stopped, if it is running. The xCAT daemon, xcatd, must be running, do not stop it. No xCAT commands should be run during the init process, because we will be migrating the xCAT database to MySQL or MariaDB and restarting the xcatd daemon as well as the MySQL daemon. For full information on all the steps that will be done, read the "Configure MySQL and Migrate xCAT Data to MySQL" sections in
https://sourceforge.net/apps/mediawiki/xcat/index.php?title=Setting_Up_MySQL_as_the_xCAT_DB
Setting_Up_MySQL_as_the_xCAT_DB
Two passwords must be supplied for the setup, a password for the xcatadmin id and a password for the root id in the MySQL database. These will be prompted for interactively, unless the environment variables XCATMYSQLADMIN_PW and XCATMYSQLROOT_PW are set to the passwords for the xcatadmin id and root id in the database,resp.
Note below we refer to MySQL but it works the same for MariaDB.
@@ -57,13 +57,13 @@ This option runs during update, it will take all the host from the input file (p
This option sets up the ODBC /etc/../odbcinst.ini, /etc/../odbc.ini and the .odbc.ini file in roots home directory will be created and initialized to run off the xcatdb MySQL database.
See "Add ODBC Support" in
https://sourceforge.net/apps/mediawiki/xcat/index.php?title=Setting_Up_MySQL_as_the_xCAT_DB
Setting_Up_MySQL_as_the_xCAT_DB
=item B<-L|--LL>
Additional database configuration specifically for the LoadLeveler product.
See "Add ODBC Support" in
https://sourceforge.net/apps/mediawiki/xcat/index.php?title=Setting_Up_MySQL_as_the_xCAT_DB
Setting_Up_MySQL_as_the_xCAT_DB
=back
+9
View File
@@ -128,6 +128,11 @@ To import nodes using a profile, follow the following steps:
__hostname__:
mac=b8:ac:6f:37:59:28
cec=mycec
__hostname__:
mac=b8:ac:6f:37:59:29
cec=mycec
lpaid=2
# Node information file ends.
The node information file includes the following items:
@@ -152,6 +157,10 @@ B<cec=<cec-name>> This is a mandatory option for defining Power rack-mounted no
Description: Specifies the name of a Power rack-mount central electronic complex (CEC).
B<lparid=<lpar-id>> This is a optional option for defining Power rack-mounted nodes.
Description: Specifies the LPAR ID of a Power rack-mounted node, where <lpar-id> is the ID number. The default value is 1 if it is not defined.
B<ip=<ip-address>> This is an optional item.
Description: Specify the IP address used for provisioning a node, where <ip-address> is in the form xxx.xxx.xxx.xxx. If this item is not included, the IP address used to provision the node is generated automatically according to the Network Profile used by the node.
+1 -1
View File
@@ -40,7 +40,7 @@ The init option is used to setup an installed PostgreSQL database so that xCAT c
On AIX, it additionally setup the xcatadm unix id and the postgres id and group. For AIX, you should be using the PostgreSQL rpms available from the xCAT website. For Linux, you should use the PostgreSQL rpms shipped with the OS. You can chose the -o option, to run after the init.
To add additional nodes to access the PostgreSQL server, setup on the Management Node, edit the pg_hba.conf file.
For more documentation see:https://sourceforge.net/apps/mediawiki/xcat/index.php?title=Setting_Up_PostgreSQL_as_the_xCAT_DB
For more documentation see the following documentation: Setting_Up_PostgreSQL_as_the_xCAT_DB
=item B<-N|--nostart>
+5 -5
View File
@@ -60,8 +60,8 @@ If it outputs B<"Timeout waiting for prompt"> during the upgrade, please set the
In currently Direct FSP/BPA Management, our B<rflash> doesn't support B<concurrent> value of B<--activate> flag, and supports B<disruptive> and B<deferred>. The B<disruptive> option will cause any affected systems that are powered on to be powered down before installing and activating the update. So we require that the systems should be powered off before do the firmware update.
The B<deferred> option will load the new firmware into the T (temp) side, but will not activate it like the disruptive firmware. The customer will continue to run the Frames and CECs working with the P (perm) side and can wait for a maintenance window where they can activate and boot the Frame/CECs with new firmware levels. Refer to the link to get more details:
https://sourceforge.net/apps/mediawiki/xcat/index.php?title=XCAT_Power_775_Hardware_Management#Perform_Deferred_Firmware_upgrades_for_frame.2FCEC_on_Power_775
The B<deferred> option will load the new firmware into the T (temp) side, but will not activate it like the disruptive firmware. The customer will continue to run the Frames and CECs working with the P (perm) side and can wait for a maintenance window where they can activate and boot the Frame/CECs with new firmware levels. Refer to the following documentation to get more details:
XCAT_Power_775_Hardware_Management#Perform_Deferred_Firmware_upgrades_for_frame.2FCEC_on_Power_775
In Direct FSP/BPA Management, there is -d <data_directory> option. The default value is /tmp. When do firmware update, rflash will put some related data from rpm packages in <data_directory> directory, so the execution of rflash will require available disk space in <data_directory> for the command to properly execute:
@@ -71,12 +71,12 @@ For one GFW rpm package and one power code rpm package , if the GFW rpm package
For Power 775, the rflash command takes effect on the primary and secondary FSPs or BPAs almost in parallel.
For more details about the Firmware Update using Direct FSP/BPA Management, refer to:
https://sourceforge.net/apps/mediawiki/xcat/index.php?title=XCAT_Power_775_Hardware_Management#Updating_the_BPA_and_FSP_firmware_using_xCAT_DFM
XCAT_Power_775_Hardware_Management
=head2 NeXtScale FPC specific:
The command will update firmware for NeXtScale FPC when given an FPC node and the http information needed to access the firmware. The http imformation required includes both the MN IP address as well as the directory containing the firmware. It is recommended that the firmware be downloaded and placed in the /install directory structure as the xCAT MN /install directory is configured with the correct permissions for http. Refer to the link to get more details:
https://sourceforge.net/apps/mediawiki/xcat/index.php?title=XCAT_NeXtScale_Clusters#Update_the_FPC_firmware_.28optional.29
The command will update firmware for NeXtScale FPC when given an FPC node and the http information needed to access the firmware. The http imformation required includes both the MN IP address as well as the directory containing the firmware. It is recommended that the firmware be downloaded and placed in the /install directory structure as the xCAT MN /install directory is configured with the correct permissions for http. Refer to the doc to get more details:
XCAT_NeXtScale_Clusters
=head1 B<Options>
+2 -2
View File
@@ -96,7 +96,7 @@ Retrieves deconfigured resources. Deconfigured resources are hw components (cpus
=item B<-x>
To output the information of deconfigured resources in XML format.
To output the raw information of deconfigured resources for CEC.
=item B<asset>
@@ -223,7 +223,7 @@ To retrieve all information available from blade node4, enter:
=item *
To output the information of deconfigured resources in XML format for CEC cec01, enter:
To output the raw information of deconfigured resources for CEC cec01, enter:
rinv cec01 deconfig -x
+2
View File
@@ -8,6 +8,8 @@ B<rnetboot> [B<-V>|B<--verbose>] [B<-s> I<boot_device_order>] [B<-F>] [B<-f>] I<
B<rnetboot> [B<-h>|B<--help>] [B<-v>|B<--version>]
=head2 zVM specific:
B<rnetboot> noderange [B<ipl=> I<address>]
+6 -8
View File
@@ -16,17 +16,19 @@ B<rpower> I<noderange> [B<on>|B<off>|B<softoff>|B<reset>|B<boot>|B<stat>|B<state
B<rpower> I<noderange> [B<--nodeps>] {B<of>}
=head2 PPC (with HMC) specific:
=head2 CEC (with HMC) specific:
B<rpower> I<noderange> [B<onstandby>]
B<rpower> I<noderange> [B<on>|B<off>|B<reset>|B<boot>|B<onstandby>]
B<rpower> I<noderange> [B<softoff>]
=head2 LPAR (with HMC) specific:
B<rpower> I<noderange> [B<on>|B<off>|B<stat>|B<state>|B<reset>|B<boot>|B<of>|B<sms>|B<softoff>]
=head2 CEC (using Direct FSP Management) specific:
B<rpower> I<noderange> [B<onstandby>|B<stat>|B<state>] [B<-T tooltype>]
B<rpower> I<noderange> [B<on>|B<off>|B<lowpower>|B<resetsp>]
B<rpower> I<noderange> [B<on>|B<off>|B<resetsp>]
=head2 Frame (using Direct FSP Management) specific:
@@ -64,10 +66,6 @@ Turn power on to standby state
The value could be B<lpar> or B<fnm>. The tooltype value B<lpar> is for xCAT and B<fnm> is for CNM. The default value is "B<lpar>". For cold start in the large cluster, it will save a lot of time if the admins use "B<rpower> I<noderange> B<onstandby> B<-T> B<fnm>" to power on all the CECs from the management node through the B<fnm> connections.
=item B<lowpower>
Turn CEC to low power state (state EOCT). This is a disruptive operation which requires the CEC to be powered off prior to entering low power mode. And we can use power off command to get out of lowepower state.
=item B<rackstandby>
Places the rack in the rack standby state. It requires that all CECs and DE be powered off before it will run.
+17 -7
View File
@@ -89,7 +89,7 @@ Files may be distributed and synchronized for both diskless and
diskfull nodes. Syncing files to NFS-based statelite nodes is not supported.
More information on using the synchronization file function is in
https://sourceforge.net/apps/mediawiki/xcat/index.php?title=Using_Updatenode.
the following doc: Using_Updatenode.
=head3 Create the synclist file
@@ -100,7 +100,7 @@ and the destination location for the files on the target node.
For more information on creating your synclist files and where to put them, read:
http://sourceforge.net/apps/mediawiki/xcat/index.php?title=Sync-ing_Config_Files_to_Nodes
Sync-ing_Config_Files_to_Nodes
=head3 Run updatenode to synchronize the files
@@ -111,7 +111,7 @@ http://sourceforge.net/apps/mediawiki/xcat/index.php?title=Sync-ing_Config_Files
=head2 To install or update software
updatenode can be use to install or update software on the nodes. See the following documentation for setting up otherpkgs:
https://sourceforge.net/apps/mediawiki/xcat/index.php?title=Install_Additional_Packages
Install_Additional_Packages
To install/update the packages, run:
@@ -136,11 +136,14 @@ B<For AIX systems:>
Note: The updatenode command is used to update AIX diskfull nodes only. For updating diskless AIX nodes refer to the xCAT for AIX update documentation and use the xCAT mknimimage command.
For information on updating software on AIX cluster:
For diskful installs, read:
https://sourceforge.net/apps/mediawiki/xcat/index.php?title=XCAT_AIX_RTE_Diskfull_Nodes
XCAT_AIX_RTE_Diskfull_Nodes
For diskless installs, read:
https://sourceforge.net/apps/mediawiki/xcat/index.php?title=XCAT_AIX_Diskless_Nodes
XCAT_AIX_Diskless_Nodes
updatenode can also be used in Sysclone environment to push delta changes to target node. After capturing the delta changes from the golden client to management node, just run below command to push delta changes to target nodes.
updatenode <targetnoderange> -S
=head2 To run postscripts
The scripts must be copied to the /install/postscripts
@@ -342,7 +345,8 @@ Display usage message.
=item B<-k|--security>
Update the ssh keys and host keys for the service nodes and compute nodes;
Update the ca and credentials to the service nodes. Never run this command to the Management Node, it will take down xcatd.
Update the ca and credentials to the service nodes. Never run this command to the Management Node, it will take down xcatd.
You must be running updatenode as root to use the -k flag.
=item B<-l>|B<--user> I<user_ID>
@@ -362,7 +366,7 @@ be run during install. You should use updatenode <noderange> -F instead.
=item B<-S|--sw>
Specifies that node software should be updated.
Specifies that node software should be updated. In Sysclone environment, specifies pushing the delta changes to target nodes.
=item B<-s|--sn>
@@ -567,6 +571,12 @@ See Granting_Users_xCAT_privileges for required sudo setup.
B<updatenode node1 -l user1 -P syslog>
=item 22
In Sysclone environment, after capturing the delta changes from golden client to management node, to run updatenode to push these delta changes to target nodes.
B<updatenode target-node -S>
=back
+1 -1
View File
@@ -205,7 +205,7 @@ For example, your rsynclist file may look like this:
Note: no order can be assumed by the order that the EXECUTE,EXECUTEALWAYS and APPEND clause fall in the synclist file.
For more information on syncing files to node, read https://sourceforge.net/apps/mediawiki/xcat/index.php?title=Sync-ing_Config_Files_to_Nodes
For more information on syncing files to node, read Sync-ing_Config_Files_to_Nodes
On Linux rsync always uses ssh remoteshell. On AIX, ssh or rsh is used depending on the site.useSSHonAIX attribute.
+10
View File
@@ -91,6 +91,16 @@ Output will be similar to:
For the attributes that are not recognized, the value will be blank.
=item *
To copy the packages from a supplemental DVD ISO file:
copycds -n /isodir/RHEL6.5/RHEL6.5-Supplementary-20131114.2-Server-ppc64-DVD1.iso -n rhels6.5-supp
Also, remember to add the new directory to your osimage definition:
chdef -t osimage myosimage -p pkgdir=/install/rhels6.5-supp/ppc64
=back
=head1 SEE ALSO
+2 -2
View File
@@ -6,9 +6,9 @@ B<makeconservercf> - creates the conserver configuration file from info in the x
B<makeconservercf> [B<-V|--verbose>] [B<-d|--delete>] I<noderange>
B<makeconservercf> [B<-V|--verbose>] [B<-l|--local>]
B<makeconservercf> [B<-V|--verbose>] [B<-l|--local>] [I<noderange>]
B<makeconservercf> [B<-V|--verbose>] [B<-c|--conserver>] I<noderange>
B<makeconservercf> [B<-V|--verbose>] [B<-c|--conserver>] [I<noderange>]
B<makeconservercf> [B<-V|--verbose>] I<noderange> [B<-t|--trust>] I<hosts>
+1 -1
View File
@@ -31,7 +31,7 @@ Only entries in /etc/hosts or the hosts specified by B<noderange> that have a co
By default, B<makedns> sets up the B<named> service and updates the DNS records on the local system (management node). If the -e flag is specified, it will also update the DNS records on any external DNS server that is listed in the /etc/resolv.conf on the management node. (Assuming the external DNS server can recognize the xCAT key as authentication.)
For more information on Cluster Name Resolution:
https://sourceforge.net/apps/mediawiki/xcat/index.php?title=Cluster_Name_Resolution
read the following doc:Cluster_Name_Resolution
=head1 OPTIONS
+10
View File
@@ -13,6 +13,8 @@ Prefix: /opt/xcat
BuildRoot: /var/tmp/%{name}-%{version}-%{release}-root
%define fsm %(if [ "$fsm" = "1" ];then echo 1; else echo 0; fi)
%define pcm %(if [ "$pcm" = "1" ];then echo 1; else echo 0; fi)
%define notpcm %(if [ "$pcm" = "1" ];then echo 0; else echo 1; fi)
# AIX will build with an arch of "ppc"
%ifos linux
@@ -115,6 +117,14 @@ cp share/xcat/tools/* $RPM_BUILD_ROOT/%{prefix}/share/xcat/tools
#cp usr/share/xcat/scripts/setup-local-client.sh $RPM_BUILD_ROOT/usr/share/xcat/scripts/setup-local-client.sh
#chmod 755 $RPM_BUILD_ROOT/usr/share/xcat/scripts/setup-local-client.sh
# PCM does not need getxcatdocs
# getxcatdocs causes xCAT-client requires perl-JSON, which is not shipped with PCM
%if %pcm
rm -f $RPM_BUILD_ROOT/%{prefix}/bin/getxcatdocs
rm -f $RPM_BUILD_ROOT/%{prefix}/share/doc/man1/getxcatdocs.1.html
rm -f $RPM_BUILD_ROOT/%{prefix}/share/man/man1/getxcatdocs.1
%endif
# These links get made in the RPM_BUILD_ROOT/prefix area
ln -sf xcatclient $RPM_BUILD_ROOT/%{prefix}/bin/rpower
ln -sf xcatclient $RPM_BUILD_ROOT/%{prefix}/bin/rscan
+6 -1
View File
@@ -617,4 +617,9 @@ dracut_install /lib64/rsyslog/lmnet.so
dracut_install /lib64/rsyslog/lmstrmsrv.so
dracut_install /lib64/rsyslog/imuxsock.so
dracut_install /usr/lib64/libnfsidmap/nsswitch.so
dracut_install killall logger nc nslookup bc chown chroot dd expr kill mkdosfs parted rsync shutdown sort ssh-keygen tr blockdev findfs insmod kexec lvm mdadm mke2fs pivot_root sshd swapon tune2fs mkreiserfs reiserfstune # for sysclone
dracut_install killall logger nc nslookup bc chown chroot dd expr kill mkdosfs parted rsync shutdown sort ssh-keygen tr blockdev findfs insmod kexec lvm mdadm mke2fs pivot_root sshd swapon tune2fs mkreiserfs reiserfstune pvcreate lvremove vgremove vgcreate lvcreate lvscan lvchange vgchange pvdisplay lvdisplay vgdisplay blkid dmsetup # for sysclone
dracut_install /lib/udev/rules.d/10-dm.rules
dracut_install /lib/udev/rules.d/11-dm-lvm.rules
dracut_install /lib/udev/rules.d/13-dm-disk.rules
dracut_install /lib/udev/rules.d/69-dm-lvm-metad.rules
dracut_install /lib/udev/rules.d/95-dm-notify.rules
+4
View File
@@ -5,3 +5,7 @@ instmods macvlan macvtap 8021q bridge bonding vmxnet3 cpufreq_ondemand acpi-cpuf
instmods mptctl #LSI firmware management requires this
instmods mlx4_ib ib_umad #make the mellanox ib available enough to examine /sys
instmods reiserfs #reiserfs on sysclone
instmods ibmveth # ppc64 virtual ethernet
instmods ibmvscsic # ppc64 virtual disk
instmods ehea # ppc64 hea ethernet
instmods dm-mod #support LVM for sysclone
+4 -1
View File
@@ -53,7 +53,10 @@ cd -
if [ "$1" == "2" ]; then #only on upgrade, as on install it's probably not going to work...
if [ -f "/proc/cmdline" ]; then # prevent running it during install into chroot image
. /etc/profile.d/xcat.sh
mknb %{tarch}
#mknb %{tarch}
echo "If you are installing/updating xCAT-genesis-base separately, not as part of installing/updating all of xCAT, run 'mknb <arch> manually'"
mkdir -p /etc/xcat
touch /etc/xcat/genesis-base-updated
fi
fi
@@ -41,4 +41,4 @@ cd -
%Files
%defattr(-,root,root)
%doc LICENSE.html
/
/opt/xcat/share/xcat/netboot/genesis/builder
+15
View File
@@ -368,6 +368,21 @@ if [ ! "$IPMIVER" == "1.5" ]; then
if [ $TRIES -gt $TIMEOUT ]; then echo "ERROR"; else echo "OK"; fi
fi
XPROD=`ipmitool mc info|grep "^Product ID"|awk '{print $4}'`
if [ "$XPROD" = "309" ] ; then
# Reset the BMC for the x3755 M4 (8722), otherwise will not be able to get to the BMC
echo "Resetting BMC ..."
ipmitool mc reset cold
echo "Waiting for the BMC to appear ..."
sleep 15
TRIES=0
while ! ipmitool lan print $LANCHAN > /dev/null; do
sleep 3
let TRIES=TRIES+1
if [ $TRIES -gt $TIMEOUT ]; then break; fi
done
fi
# update the node status to 'bmcready'
for parm in `cat /proc/cmdline`; do
key=`echo $parm|awk -F= '{print $1}'`
+85 -33
View File
@@ -1,36 +1,88 @@
Format: http://dep.debian.net/deps/dep5
Upstream-Name: xcat-genesis-scripts
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: 2013 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.
"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.
@@ -67,6 +67,7 @@ cd -
# should run mknb. Tried to use rpm triggers, but in several cases the trigger would
# get run multiple times.
#echo "touching /etc/xcat/genesis-scripts-updated"
echo "If you are installing/updating xCAT-genesis-base separately, not as part of installing/updating all of xCAT, run 'mknb <arch> manually'"
mkdir -p /etc/xcat
touch /etc/xcat/genesis-scripts-updated
+5 -4
View File
@@ -1237,7 +1237,7 @@ sub resolve {
#############################
# Find MTMS in vpd database
#############################
if ( exists( $att->{parent} )) {
if ( $att->{parent}) {
my @attrs = qw(mtm serial);
my ($vpd) = $tabs->{vpd}->getNodeAttribs($att->{parent},\@attrs);
@@ -2195,9 +2195,10 @@ sub process_request {
#if( $request->{hwtype} ne 'hmc' ) {
if( $request->{hwtype} !~ /hmc|ivm/ ) {
$request->{fsp_api} = 1;
#For using rspconfig to disable/enable dev/celogin1 through ASMI
my $arg = $request->{arg};
if($request->{command} eq "rspconfig" and grep(/^(dev|celogin1)/, @$arg)) {
#For using rspconfig options through ASMI
#my $arg = $request->{arg};
#if($request->{command} eq "rspconfig" and grep(/^(dev|celogin1)/, @$arg)) {
if($request->{command} eq "rspconfig" and ref($request->{method}) eq 'HASH') {
$request->{fsp_api} = 0;
}
} else {
+33
View File
@@ -1866,6 +1866,39 @@ sub getPostScripts
$result .= "setbootfromdisk\n";
}
#for redhat 7, append "disableconsistentNICrename" to default postscripts
#if "net.ifnames=0" is specified in kcmdline/addkcmdline of node or osimage
my $tftpdir = xCAT::TableUtils::getTftpDir();
my $osimagetab=xCAT::Table->new('osimage',-create=>1);
my $osimgent = $osimagetab->getAttribs({imagename => $osimgname },'osvers');
my $os = $osimgent->{'osvers'};
my $nrret = $::GLOBAL_TAB_HASH{noderes}{$node};
my $netboot = $nrret->{'netboot'};
if( (($os =~ "rhel7*") || ($os =~ "rhels7*")) && ($nodesetstate) && ($nodesetstate eq "install") )
{
my $nodecfg;
if($netboot eq "grub2")
{
$nodecfg="$tftpdir/boot/grub2/$node";
}elsif($netboot eq "xnba")
{
$nodecfg="$tftpdir/xcat/xnba/nodes/$node";
}elsif($netboot eq "pxe")
{
$nodecfg="$tftpdir/pxelinux.cfg/$node";
}
my $rc=system("grep net.ifnames=0 $nodecfg >/dev/null 2>&1");
if($rc ==0)
{
$result .= "disableconsistentNICrename\n";
}
}
return $result;
}
+17
View File
@@ -53,6 +53,7 @@ sub getNodesetStates
my @pxenodes = ();
my @yabootnodes = ();
my @xnbanodes= ();
my @grub2nodes = ();
my $tabdata = $tab->getNodesAttribs(\@nodes, ['node', 'netboot']);
foreach my $node (@nodes)
{
@@ -75,6 +76,10 @@ sub getNodesetStates
{
push(@aixnodes, $node);
}
elsif ($nb eq "grub2")
{
push(@grub2nodes, $node);
}
}
my @retarray;
@@ -131,6 +136,18 @@ sub getNodesetStates
xCAT::MsgUtils->message('E', $retarray[1]);
}
}
if (@grub2nodes > 0)
{
require xCAT_plugin::grub2;
@retarray =
xCAT_plugin::grub2::getNodesetStates(\@grub2nodes, $hashref);
if ($retarray[0])
{
$retcode = $retarray[0];
$errormsg .= $retarray[1];
xCAT::MsgUtils->message('E', $retarray[1]);
}
}
}
return (0, "");
}
+2 -2
View File
@@ -671,9 +671,9 @@ sub kickstartnetwork {
my $line = "network --onboot=yes --bootproto=";
my $hoststab;
my $mactab = xCAT::Table->new('mac',-create=>0);
unless ($mactab) { die "mac table should always exist prior to template processing when doing autoula"; }
unless ($mactab) { $tmplerr ="mac table should always exist prior to template processing when doing autoula"; return;}
my $ent = $mactab->getNodeAttribs($node,['mac'],prefetchcache=>1);
unless ($ent and $ent->{mac}) { die "missing mac data for $node"; }
unless ($ent and $ent->{mac}) { $tmplerr ="missing mac data for $node"; return;}
my $suffix = $ent->{mac};
$suffix = lc($suffix);
if ($::XCATSITEVALS{managedaddressmode} eq "autoula") {
+2 -2
View File
@@ -2586,7 +2586,7 @@ sub setFINALattrs
# special case for the nic* attributes
# merge nic*.eth0, nic*.eth1
if ($::FILEATTRS{$objname}{objtype} eq 'node')
if (($::FILEATTRS{$objname}{objtype} eq 'node') || ($::FILEATTRS{$objname}{objtype} eq 'group'))
{
xCAT::DBobjUtils->collapsenicsattr($::FILEATTRS{$objname}, $objname);
}
@@ -2647,7 +2647,7 @@ sub setFINALattrs
unless(exists($::CLIATTRS{$objname})) {
next;
}
if ($::CLIATTRS{$objname}{objtype} eq 'node')
if (($::CLIATTRS{$objname}{objtype} eq 'node') || ($::CLIATTRS{$objname}{objtype} eq 'group'))
{
# Even if only the nicips.eth0 is specified with CLI,
# need to read the whole nicips attribute from the nics table,
+12 -2
View File
@@ -2196,6 +2196,13 @@ sub copycd
$distname = "rhels5";
}
}
elsif ($desc =~ /^Scientific Linux (\d)\.(\d)/)
{
unless ($distname)
{
$distname = "SL$1.$2";
}
}
elsif ($desc =~ /^LTS$/)
{
unless ($distname)
@@ -2230,10 +2237,13 @@ sub copycd
if($inspection)
{
my $retinfo="DISTNAME:$distname\n"."ARCH:$arch\n";
if($dno) {
$retinfo=$retinfo."DISCNO:$dno\n";
}
$callback->(
{
info =>
"DISTNAME:$distname\n"."ARCH:$arch\n"."DISCNO:$dno\n"
info =>"$retinfo"
}
);
return;
+21 -8
View File
@@ -13,14 +13,14 @@ use strict;
use Data::Dumper;
my @cservers = qw(mrv cyclades);
my %termservers; #list of noted termservers
my $siteondemand; # The site value for consoleondemand
my $usage_string=
" makeconservercf [-d|--delete] noderange
makeconservercf [-l|--local]
makeconservercf [-c|--conserver]
makeconservercf
makeconservercf -h|--help
makeconservercf -v|--version
" makeconservercf [-V|--verbose] [-d|--delete] noderange
makeconservercf [-V|--verbose] [-l|--local] [noderange]
makeconservercf [-V|--verbose] [-c|--conserver] [noderange]
makeconservercf [-V|--verbose] noderange [-t|--trust] hosts
makeconservercf [-h|--help|-v|--version]
-c|--conserver The conserver gets set up only on the conserver host.
The default goes down to all the conservers on
the server nodes and set them up
@@ -28,6 +28,7 @@ my $usage_string=
The default goes down to all the conservers on
the server nodes and set them up
-d|--delete Conserver has the relevant entries for the given noderange removed immediately from configuration
-t|--trust Add additional trusted hosts.
-h|--help Display this usage statement.
-V|--verbose Verbose mode.
-v|--version Display the version number.";
@@ -277,6 +278,10 @@ sub docfheaders {
my $site_entry = $entries[0];
if ( defined($site_entry) and $site_entry eq "yes" ) {
push @newheaders," options ondemand;\n";
$siteondemand=1;
}
else {
$siteondemand=0;
}
push @newheaders,"}\n";
@@ -323,7 +328,7 @@ sub makeconservercf {
my $hmtab = xCAT::Table->new('nodehm');
my @cfgents1;# = $hmtab->getAllNodeAttribs(['cons','serialport','mgt','conserver','termserver','termport']);
if (($nodes and @$nodes > 0) or $req->{noderange}->[0]) {
@cfgents1 = $hmtab->getNodesAttribs($nodes,['node','cons','serialport','mgt','conserver','termserver','termport']);
@cfgents1 = $hmtab->getNodesAttribs($nodes,['node','cons','serialport','mgt','conserver','termserver','termport','consoleondemand']);
# Adjust the data structure to make the result consistent with the getAllNodeAttribs() call we make if a noderange was not specified
my @tmpcfgents1;
foreach my $ent (@cfgents1)
@@ -336,7 +341,7 @@ sub makeconservercf {
@cfgents1 = @tmpcfgents1
} else {
@cfgents1 = $hmtab->getAllNodeAttribs(['cons','serialport','mgt','conserver','termserver','termport']);
@cfgents1 = $hmtab->getAllNodeAttribs(['cons','serialport','mgt','conserver','termserver','termport','consoleondemand']);
}
@@ -539,6 +544,14 @@ foreach my $node (sort keys %$cfgenthash) {
push @$content," exec $locerror".$::XCATROOT."/share/xcat/cons/".$cmeth." ".$node.";\n"
}
}
if (defined($cfgent->{consoleondemand})) {
if ($cfgent->{consoleondemand} && !$siteondemand ) {
push @$content," options ondemand;\n";
}
elsif (!$cfgent->{consoleondemand} && $siteondemand ) {
push @$content," options !ondemand;\n";
}
}
push @$content,"}\n";
push @$content,"#xCAT END $node CONS\n";
}
@@ -198,6 +198,17 @@ sub process_request
`logger -t xCAT -p local4.info "credentials: Unable to read private RSA key"` ;
next;
}
} elsif ($parm =~ /ssh_ecdsa_hostkey/) {
`logger -t xCAT -p local4.info "credentials: sending $parm"` ;
if (-r "/etc/xcat/hostkeys/$client/ssh_host_ecdsa_key") {
$tfilename="/etc/xcat/hostkeys/$client/ssh_host_ecdsa_key";
} elsif (-r "/etc/xcat/hostkeys/ssh_host_ecdsa_key") {
$tfilename="/etc/xcat/hostkeys/ssh_host_ecdsa_key";
} else {
push @{$rsp->{'error'}},"Unable to read private ECDSA key from /etc/xcat/hostkeys";
`logger -t xCAT -p local4.info "credentials: Unable to read private ECDSA key"` ;
next;
}
} elsif ($parm =~ /xcat_cfgloc/) {
`logger -t xCAT -p local4.info "credentials: sending $parm"` ;
unless (-r "/etc/xcat/cfgloc") {
+1
View File
@@ -7,6 +7,7 @@ use xCAT::Table;
use Sys::Hostname;
use xCAT::TableUtils;
use xCAT::NetworkUtils qw/getipaddr/;
use xCAT::Utils;
use Math::BigInt;
use MIME::Base64;
use xCAT::SvrUtils;
-1
View File
@@ -397,7 +397,6 @@ sub copycd
{
my $osdistoname = $distname . "-" . $arch;
my $temppath = "$installroot/$distname/$arch";
$callback->({data => "Media copy operation successful"});
my @ret=xCAT::SvrUtils->update_osdistro_table($distname, $arch, $temppath, $osdistroname);
if ($ret[0] != 0) {
$callback->({data => "Error when updating the osdistro tables: " . $ret[1]});
+1 -1
View File
@@ -248,7 +248,7 @@ sub setstate {
}
if ($nodemac =~ /:/) {
my $tmp = $nodemac;
my $tmp = lc($nodemac);
$tmp =~ s/(..):(..):(..):(..):(..):(..)/$1-$2-$3-$4-$5-$6/g;
my $pname = "grub.cfg-01-" . $tmp;
unlink($tftpdir."/boot/grub2/".$pname);
+4 -2
View File
@@ -1411,7 +1411,8 @@ sub addkit
if ( $hasplugin ) {
# Issue xcatd reload to load the new plugins
system("/etc/init.d/xcatd restart");
#system("/etc/init.d/xcatd restart");
system("XCATRELOAD=yes xcatd -p /var/run/xcatd.pid");
}
}
}
@@ -1731,7 +1732,8 @@ sub rmkit
if ( $hasplugin ) {
# Issue xcatd reload to load the new plugins
system("/etc/init.d/xcatd restart");
#system("/etc/init.d/xcatd restart");
system("XCATRELOAD=yes xcatd -p /var/run/xcatd.pid");
}
}
+27
View File
@@ -1090,6 +1090,30 @@ sub parse_responses {
trace( $request, "Discover node $atthash{hostname}: type is $atthash{type},\
mtm is $atthash{mtm},sn is $atthash{serial}, ip is $atthash{ip},\
mac is $atthash{mac}, otherinterfaces is $atthash{otherinterfaces}" );
} elsif ($type eq SERVICE_IVM) {
$atthash{type} = $service_slp{$type};
$atthash{mtm} = ${$attributes->{'machinetype-model'}}[0];
$atthash{serial} = ${$attributes->{'serial-number'}}[0];
$atthash{id} = ${$attributes->{'lparid'}}[0];
$atthash{ip} = ${$attributes->{'ip-address'}}[0];
$atthash{hostname} = get_host_from_url($request, $attributes);
$atthash{hostname} =~ s/^Server/ivm/;
my @ips = @{$attributes->{'ip-address'}};
foreach my $tmpip (@ips) {
if (exists($::OLD_DATA_CACHE{"ivm*".$atthash{mtm}."*".$atthash{serial}})){
$atthash{hostname} = $::OLD_DATA_CACHE{"ivm*".$atthash{mtm}."*".$atthash{serial}};
push @matchnode, 'Server-'.$atthash{mtm}.'-SN'.$atthash{serial};
$atthash{ip} = $tmpip;
}
}
$atthash{mac} = $rsp;
$atthash{url} = ${$searchmacs{$rsp}}{payload};
$atthash{otherinterfaces} = ${$attributes->{'ip-address'}}[0];
$outhash{'Server-'.$atthash{mtm}.'-SN'.$atthash{serial}} = \%atthash;
$$length = length( $atthash{ip}) if ( length( $atthash{ip} ) > $$length );
trace( $request, "Discover node $atthash{hostname}: type is $atthash{type},\
mtm is $atthash{mtm},sn is $atthash{serial}, ip is $atthash{ip},\
mac is $atthash{mac}, otherinterfaces is $atthash{otherinterfaces}" );
}elsif (($type eq SERVICE_FSP) && (${$attributes->{'machinetype-model'}}[0] =~ /^7895|1457|7954/ )) {
# Skip this entry if "-s CEC" was specified - we do not list FSP entries for Flex when only CECs were requested
next unless ($option_s ne "CEC");
@@ -1546,6 +1570,9 @@ sub format_stanza {
if ($type =~ /^fsp|bpa|cmm$/){
$result .= "\totherinterfaces=${$outhash->{$name}}{otherinterfaces}\n";
}
if ($type eq "ivm") {
$result .= "\tip=${$outhash->{$name}}{ip}\n";
}
$result .= "\thwtype=$globalhwtype{$type}\n";
}
return( $result );
+1 -1
View File
@@ -258,7 +258,7 @@ sub rmosdistro
#remove the osdistro entry
$osdistrotab->delEntries(\%keyhash);
$osdistrotab->commit;
$callback->({info=>"rmosdistro: remove $_ success",errorcode=>[0]});
$callback->({info=>["rmosdistro: remove $_ success"],errorcode=>[0]})
}
@@ -246,6 +246,13 @@ sub process_request {
}
}
#restore the install.netboot of xcat dracut module
if(-e "$rootimg_dir/usr/lib/dracut/modules.d/97xcat/install"){
xCAT::Utils->runcmd("mv $rootimg_dir/usr/lib/dracut/modules.d/97xcat/install $rootimg_dir/.statebackup/install", 0, 1);
}
xCAT::Utils->runcmd("cp /opt/xcat/share/xcat/netboot/rh/dracut_033/install.netboot $rootimg_dir/usr/lib/dracut/modules.d/97xcat/install", 0, 1);
my $xcat_packimg_tmpfile = "/tmp/xcat_packimg.$$";
my $excludestr = "find . -xdev ";
my $includestr;
@@ -439,6 +446,8 @@ sub process_request {
xCAT::Utils->runcmd("mv $rootimg_dir/.statebackup$filename $rootimg_dir$filename", 0, 1);
}
}
xCAT::Utils->runcmd("mv $rootimg_dir/.statebackup/install $rootimg_dir/usr/lib/dracut/modules.d/97xcat/install", 0, 1);
xCAT::Utils->runcmd("mv $rootimg_dir/.statebackup/statelite $rootimg_dir/etc/init.d/statelite", 0, 1);
xCAT::Utils->runcmd("rm -rf $rootimg_dir/.statebackup", 0, 1);
}
+268 -106
View File
@@ -33,6 +33,7 @@ my %allhostnames;
my %allbmcips;
my %allmacs;
my %allcecs;
my %alllparids;
my %allmacsupper;
my %allips;
my %allinstallips;
@@ -425,6 +426,10 @@ Usage:
# Get all CEC names
$recordsref = xCAT::ProfiledNodeUtils->get_all_cecs(1);
%allcecs = %$recordsref;
# Get all LPAR ids
$recordsref = xCAT::ProfiledNodeUtils->get_all_lparids(\%allcecs);
%alllparids = %$recordsref;
#TODO: can not use getallnode to get rack infos.
$recordsref = xCAT::ProfiledNodeUtils->get_all_rack(1);
@@ -491,6 +496,16 @@ Usage:
return;
}
# Get no mac address nodes when user only defined CEC in NIF for 7R2 support.
my @nomacnodes = ();
foreach my $nomacnode(@nodelist){
if(defined($hostinfo_dict{$nomacnode}{'cec'}) &&
not (defined($hostinfo_dict{$nomacnode}{'mac'})) &&
not (defined($hostinfo_dict{$nomacnode}{'switch'}))){
push @nomacnodes, $nomacnode;
}
}
# Create the full hostinfo dict.
xCAT::MsgUtils->message('S', "Generating new hostinfo string.");
my ($retcode_gen, $retstr_gen) = gen_new_hostinfo_dict(\%hostinfo_dict);
@@ -535,6 +550,75 @@ Usage:
}
}
# Use xcat command: getmacs <noderanges> -D to automatically get node mac address
# If some of nodes can not get mac address, then finally remove them with warning msg.
if(@nomacnodes){
# Sleep 10 seconds to ensure the basic node attributes are effected
sleep 10;
$retref = xCAT::Utils->runxcmd({command=>["getmacs"], node=>\@nomacnodes, arg=>['-D']}, $request_command, 0, 2);
$retstrref = parse_runxcmd_ret($retref);
if($::RUNCMD_RC != 0){
$warnstr .= "Warning: Can not discover MAC address by getmacs command for some node(s).";
}
# Parse the output of "getmacs <noderange> -D" to filter success and failed nodes.
my @successnodes = ();
my @failednodes = ();
my $nodelistref = $retref->{'node'};
my $index = 0;
my $name = '';
my $contents = '';
if($nodelistref){
foreach(@$nodelistref){
# Get node name.
if($nodelistref->[$index]->{'name'}){
$name = $nodelistref->[$index]->{'name'}->[0];
}
# Get node data contents.
if($nodelistref->[$index]->{'data'}->[0]->{'contents'}){
$contents = $nodelistref->[$index]->{'data'}->[0]->{'contents'}->[0];
}
# Get success and failed nodes list.
if(defined($name) and $contents =~ /[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}/){
push @successnodes, $name;
}else{
push @failednodes, $name;
}
$index++;
}
}
# Reconfigure the nodes that MAC address discovered by getmacs command
if(@successnodes){
$mac_addr_mode = 1;
my $retref = xCAT::Utils->runxcmd({command=>["kitnodeadd"], node=>\@successnodes, sequential=>[1], macflag=>[$mac_addr_mode]}, $request_command, 0, 2);
my $retstrref = parse_runxcmd_ret($retref);
if ($::RUNCMD_RC != 0){
$warnstr .= "Warning: failed to run command kitnodeadd.";
if ($retstrref->[1]) {
$warnstr .= "Details: $retstrref->[1]";
}
}
}
# Remove these nodes that can not get mac address by xcat command: getmacs <noderange> -D.
if(@failednodes){
my $nodermretref = xCAT::Utils->runxcmd({command=>["noderm"], node=>\@failednodes}, $request_command, 0, 2);
my $nodermretstrref = parse_runxcmd_ret($nodermretref);
if($::RUNCMD_RC != 0){
$warnstr .= "Warning: Cannot remove some of nodes that not MAC address discovered by getmacs command.";
if($nodermretstrref->[1]){
$warnstr .= "Details: $nodermretstrref->[1]";
}
}
}
# Push the success nodes to nodelist and remove the failed nodes from nodelist.
@nodelist = xCAT::CFMUtils->arrayops("U", \@nodelist, \@successnodes);
@failednodes = xCAT::CFMUtils->arrayops("I", \@nodelist, \@failednodes);
@nodelist = xCAT::CFMUtils->arrayops("D", \@nodelist, \@failednodes);
}
setrsp_progress("Imported nodes.");
#TODO: get the real nodelist here.
setrsp_success(\@nodelist, $warnstr);
@@ -725,38 +809,55 @@ Usage:
}
}
#fix 241844 issue, use local variable to store args_dict value
my $imageprofile = undef;
my $networkprofile = undef;
my $hardwareprofile = undef;
if(exists $args_dict{'imageprofile'}){
$imageprofile = $args_dict{'imageprofile'};
}
if(exists $args_dict{'networkprofile'}){
$networkprofile = $args_dict{'networkprofile'};
}
if(exists $args_dict{'hardwareprofile'}){
$hardwareprofile = $args_dict{'hardwareprofile'};
}
# After checking, all nodes' profile should be same
# Get the new profile with specified ones in args_dict
my $changeflag = 0;
my $profile_groups;
my $profile_status;
if(exists $args_dict{'networkprofile'}){
$profile_groups .= $args_dict{'networkprofile'}.",";
if ($args_dict{'networkprofile'} ne $nodeoldprofiles{'networkprofile'}){
if($networkprofile){
$profile_groups .= $networkprofile . ",";
if ($networkprofile ne $nodeoldprofiles{'networkprofile'}){
$changeflag = 1;
}else{
xCAT::MsgUtils->message('S', "Specified networkprofile is same with current value, ignore.");
delete($args_dict{'networkprofile'});
$networkprofile = undef;
}
}
if(exists $args_dict{'hardwareprofile'}){
$profile_groups .= $args_dict{'hardwareprofile'}.",";
if ($args_dict{'hardwareprofile'} ne $nodeoldprofiles{'hardwareprofile'}){
if($hardwareprofile){
$profile_groups .= $hardwareprofile . ",";
if ($hardwareprofile ne $nodeoldprofiles{'hardwareprofile'}){
$profile_status = 'defined';
$changeflag = 1;
}else{
xCAT::MsgUtils->message('S', "Specified hardwareprofile is same with current value, ignore.");
delete($args_dict{'hardwareprofile'});
$hardwareprofile = undef;
}
}
if(exists $args_dict{'imageprofile'}){
$profile_groups .= $args_dict{'imageprofile'}.",";
if ($args_dict{'imageprofile'} ne $nodeoldprofiles{'imageprofile'}){
if($imageprofile){
$profile_groups .= $imageprofile . ",";
if ($imageprofile ne $nodeoldprofiles{'imageprofile'}){
$profile_status = 'defined';
$changeflag = 1;
}else{
xCAT::MsgUtils->message('S', "Specified imageprofile is same with current value, ignore.");
delete($args_dict{'imageprofile'});
$imageprofile = undef;
}
}
# make sure there are something changed, otherwise we should quit without any changes.
@@ -783,48 +884,107 @@ Usage:
my $retref;
my $retstrref;
# Call update plugins first.
if(exists $args_dict{'hardwareprofile'} || exists $args_dict{'imageprofile'}){
setrsp_progress("Configuring nodes...");
$retref = "";
$retref = xCAT::Utils->runxcmd({command=>["kitnodeupdate"], node=>$nodes, sequential=>[1]}, $request_command, 0, 2);
$retstrref = parse_runxcmd_ret($retref);
if ($::RUNCMD_RC != 0){
setrsp_progress("Warning: failed to call kit commands.");
}
}
# If network profile specified. Need re-generate IPs for all nodess again.
# As new design, ignore BMC/FSP NIC while reinstall nodes
if(exists $args_dict{'networkprofile'}){
my $newNetProfileName = $args_dict{'networkprofile'};
# As new design, ignore BMC/FSP NIC while reinstall nodes
if($networkprofile){
my $newNetProfileName = $networkprofile;
my $oldNetProfileName = $nodeoldprofiles{'networkprofile'};
my $newNicsRef = xCAT::ProfiledNodeUtils->get_nodes_nic_attrs([$newNetProfileName])->{$newNetProfileName};
my $oldNicsRef = xCAT::ProfiledNodeUtils->get_nodes_nic_attrs([$oldNetProfileName])->{$oldNetProfileName};
my %updateNicsHash = ();
my %reserveNicsHash = ();
foreach my $newNic (keys %$newNicsRef) {
if ($newNicsRef->{$newNic}->{'type'} ne 'BMC' and $newNicsRef->{$newNic}->{'type'} ne 'FSP'){
$updateNicsHash{$newNic} = 1;
}
}
# Add BMC/FSP as reserve NICs and not remove it form nics table
foreach my $oldNic (keys %$oldNicsRef) {
if ($oldNicsRef->{$oldNic}->{'type'} ne 'BMC' and $oldNicsRef->{$oldNic}->{'type'} ne 'FSP'){
$updateNicsHash{$oldNic} = 1;
} else {
$reserveNicsHash{$oldNic} = 1;
}
}
my $updateNics = join(",", keys %updateNicsHash);
my $reserveNics = join(",", keys %reserveNicsHash);
setrsp_progress("Regenerate IP addresses for nodes...");
$retref = "";
$retref = xCAT::Utils->runxcmd({command=>["noderegenips"], node=>$nodes, arg=>["nics=$updateNics"], sequential=>[1]}, $request_command, 0, 2);
$retref = xCAT::Utils->runxcmd({command=>["noderegenips"], node=>$nodes, arg=>["nics=$updateNics", "reservenics=$reserveNics"], sequential=>[1]}, $request_command, 0, 2);
$retstrref = parse_runxcmd_ret($retref);
if ($::RUNCMD_RC != 0){
setrsp_progress("Warning: failed to generate IPs for nodes.");
}
}
# Update node's chain table if we need to re-provisioning OS...
# We need to re-provision OS if:
# hardware profile changed or
# image profile changed or
# network profile changed.
if (($imageprofile) or ($networkprofile) or ($hardwareprofile)){
my $nodetypetab = xCAT::Table->new('nodetype');
my $firstnode = $nodes->[0];
my $profiles = xCAT::ProfiledNodeUtils->get_nodes_profiles([$firstnode], 1);
unless ($profiles){
setrsp_errormsg("Can not get node profiles.");
return;
}
# If we have hardware changes, reconfigure everything including BMC.
my $chainret = 0;
my $chainstr = "";
if($hardwareprofile){
($chainret, $chainstr) = xCAT::ProfiledNodeUtils->gen_chain_for_profiles($profiles->{$firstnode}, 1);
} else {
($chainret, $chainstr) = xCAT::ProfiledNodeUtils->gen_chain_for_profiles($profiles->{$firstnode}, 0);
}
if ($chainret != 0){
setrsp_errormsg("Failed to generate chain string for nodes.");
return;
}
# DB update: chain table.
my %chainAttr = {};
foreach my $node (@$nodes){
$chainAttr{$node}{'chain'} = $chainstr;
$chainAttr{$node}{'currchain'} = '';
}
my $chaintab = xCAT::Table->new('chain', -create=>1);
$chaintab->setNodesAttribs(\%chainAttr);
$chaintab->close();
# Run node plugins to refresh node relateive configurations.
$retref = {};
setrsp_progress("Updating DNS entries");
$retref = xCAT::Utils->runxcmd({command=>["makedns"], node=>$nodes, arg=>['-d']}, $request_command, 0, 2);
my $retstrref = parse_runxcmd_ret($retref);
if ($::RUNCMD_RC != 0){
setrsp_progress("Warning: failed to call kit commands.");
}
$retref = {};
setrsp_progress("Updating hosts entries");
$retref = xCAT::Utils->runxcmd({command=>["makehosts"], node=>$nodes, arg=>['-d']}, $request_command, 0, 2);
$retref = {};
$retstrref = parse_runxcmd_ret($retref);
if ($::RUNCMD_RC != 0){
setrsp_progress("Warning: failed to call kit commands.");
}
setrsp_progress("Re-creating nodes...");
$retref = xCAT::Utils->runxcmd({command=>["kitnodeadd"], node=>$nodes, macflag=>[1]}, $request_command, 0, 2);
$retstrref = parse_runxcmd_ret($retref);
if ($::RUNCMD_RC != 0){
setrsp_progress("Warning: failed to call kit commands.");
}
}
setrsp_progress("Updated the image/network/hardware profiles used by nodes.");
setrsp_success($nodes);
}
@@ -851,7 +1011,7 @@ Usage:
setrsp_infostr($helpmsg);
return;
}
my @enabledparams = ('nics');
my @enabledparams = ('nics', 'reservenics');
my $ret = validate_args($helpmsg, \@enabledparams);
if (! $ret){
return;
@@ -859,6 +1019,7 @@ Usage:
my @updateNics = ();
my @removedNics = ();
my @reserveNics = ();
my $netProfileName = '';
my $netProfileNicsRef;
my %freeIPsHash = ();
@@ -892,6 +1053,9 @@ Usage:
if(exists $args_dict{'nics'}){
@updateNics = split(",", $args_dict{'nics'});
}
if (exists $args_dict{'reservenics'}){
@reserveNics = split(",", $args_dict{'reservenics'});
}
foreach (@updateNics){
unless ($netProfileNicsRef->{$netProfileName}->{$_}){
# We want to remove this nic from these nodes.
@@ -980,6 +1144,14 @@ Usage:
$fsp_flag = 1;
$fspipsAttr{$node}{"hcp"} = $nextip;
}
}
}
# Add reserve nics
foreach my $nicname (@reserveNics){
my $oldip = $nodesNicsRef->{$node}->{$nicname}->{"ip"};
if ($oldip) {
$nicipsAttr{$node}{nicips} .= $nicname."!".$oldip.",";
}
}
}
@@ -1009,65 +1181,6 @@ Usage:
$ppctab->close();
}
#9. If provisioning NIC ip or BMC ip changed for nodes, update chain table
# If FSP ip changed for nodes, push the new ip to fsp and establish hardware connection
my @kitcommands = ();
if ( $provision_flag or $bmc_flag) {
#Get node's provmethod.
my $nodetypetab = xCAT::Table->new('nodetype');
my $firstnode = $nodes->[0];
my $records = $nodetypetab->getNodeAttribs($firstnode, ['node', 'provmethod']);
my $imgname = $records->{provmethod};
my $chainstr = "osimage=$imgname";
if ( $bmc_flag ) {
$chainstr = "runcmd=bmcsetup,osimage=$imgname:reboot4deploy";
}
# Update chain table
my %chainAttr = {};
foreach my $node (@$nodes){
$chainAttr{$node}{'chain'} = $chainstr;
}
my $chaintab = xCAT::Table->new('chain', -create=>1);
$chaintab->setNodesAttribs(\%chainAttr);
$chaintab->close();
# Remove all nodes information
push(@kitcommands, "removenodes");
# Add all nodes information back
push(@kitcommands, "kitnodeadd");
} elsif ( $fsp_flag ) {
# Remove all nodes information
push(@kitcommands, "removenodes");
# Add all nodes information back
push(@kitcommands, "kitnodeadd");
} else {
push(@kitcommands, "kitnoderefresh");
}
#10. Call plugins.
foreach my $command (@kitcommands) {
my $retref;
if ($command eq 'removenodes'){
setrsp_progress("Updating DNS entries");
$retref = xCAT::Utils->runxcmd({command=>["makedns"], node=>$nodes, arg=>['-d']}, $request_command, 0, 2);
setrsp_progress("Updating hosts entries");
$retref = "";
$retref = xCAT::Utils->runxcmd({command=>["makehosts"], node=>$nodes, arg=>['-d']}, $request_command, 0, 2);
next;
}
$retref = "";
$retref = xCAT::Utils->runxcmd({command=>[$command], node=>$nodes, sequential=>[1]}, $request_command, 0, 2);
my $retstrref = parse_runxcmd_ret($retref);
if ($::RUNCMD_RC != 0){
setrsp_progress("Warning: failed to call kit commands.");
last;
}
}
setrsp_progress("Re-generated node's IPs for specified nics.");
setrsp_success($nodes);
}
@@ -1208,20 +1321,59 @@ Usage:
return;
}
# re-create the chain record as updating mac may means for replacing a new brand hardware...
# Call Plugins.
my $profiles = xCAT::ProfiledNodeUtils->get_nodes_profiles([$hostname], 1);
unless ($profiles){
setrsp_errormsg("Can not get node profiles.");
return;
}
(my $chainret, my $chainstr) = xCAT::ProfiledNodeUtils->gen_chain_for_profiles($profiles->{$hostname}, 1);
if ($chainret != 0){
setrsp_errormsg("Failed to generate chain string for nodes.");
return;
}
# Update database records.
setrsp_progress("Updating database...");
# MAC table
my $mactab = xCAT::Table->new('mac',-create=>1);
$mactab->setNodeAttribs($hostname, {mac=>$args_dict{'mac'}});
$mactab->close();
# Call Plugins.
# DB update: chain table.
my $chaintab = xCAT::Table->new('chain', -create=>1);
$chaintab->setNodeAttribs($hostname, {chain=>$chainstr, currchain=>''});
$chaintab->close();
# Run node plugins to refresh node relateive configurations.
setrsp_progress("Configuring nodes...");
my $retref = xCAT::Utils->runxcmd({command=>["kitnodeupdate"], node=>[$hostname], sequential=>[1]}, $request_command, 0, 2);
my $retref = {};
setrsp_progress("Updating DNS entries");
$retref = xCAT::Utils->runxcmd({command=>["makedns"], node=>[$hostname], arg=>['-d']}, $request_command, 0, 2);
my $retstrref = parse_runxcmd_ret($retref);
if ($::RUNCMD_RC != 0){
setrsp_progress("Warning: failed to call kit commands.");
}
$retref = {};
setrsp_progress("Updating hosts entries");
$retref = xCAT::Utils->runxcmd({command=>["makehosts"], node=>[$hostname], arg=>['-d']}, $request_command, 0, 2);
$retref = {};
$retstrref = parse_runxcmd_ret($retref);
if ($::RUNCMD_RC != 0){
setrsp_progress("Warning: failed to call kit commands.");
}
setrsp_progress("Re-creating nodes...");
$retref = xCAT::Utils->runxcmd({command=>["kitnodeadd"], node=>[$hostname], macflag=>[1]}, $request_command, 0, 2);
$retstrref = parse_runxcmd_ret($retref);
if ($::RUNCMD_RC != 0){
setrsp_progress("Warning: failed to call kit commands.");
}
# Update node's status.
setrsp_progress("Updating node status...");
xCAT::Utils->runxcmd({command=>["updatenodestat"], node=>[$hostname], arg=>['defined']}, $request_command, -1, 2);
@@ -1755,6 +1907,15 @@ sub gen_new_hostinfo_dict{
# Get node's provisioning method
my $provmethod = xCAT::ProfiledNodeUtils->get_imageprofile_prov_method($args_dict{'imageprofile'});
# Generate node's chain.
my %nodeprofiles = ('NetworkProfile' => $args_dict{'networkprofile'},
'ImageProfile' => $args_dict{'imageprofile'});
if (defined $args_dict{'hardwareprofile'}) {$nodeprofiles{'HardwareProfile'} = $args_dict{'hardwareprofile'}}
(my $errcode, my $chainstr) = xCAT::ProfiledNodeUtils->gen_chain_for_profiles(\%nodeprofiles, 1);
if ($errcode != 0){
return (0, "Failed to generate chain for nodes.");
}
# start to check windows nodes, product will indicate it is a windows node: win2k8r2.enterprise
my ($osvers, $osprofile) = xCAT::ProfiledNodeUtils->get_imageprofile_prov_osvers($provmethod);
my $product = undef;
@@ -1899,23 +2060,10 @@ sub gen_new_hostinfo_dict{
my $hardwareprofile = $args_dict{'hardwareprofile'};
my $chain = $chaintab->getNodeAttribs($hardwareprofile, ['chain']);
if (exists $chain->{'chain'}) {
my $hardwareprofile_chain = $chain->{'chain'};
$hostinfo_dict{$item}{"chain"} = $hardwareprofile_chain.',osimage='.$provmethod.":--noupdateinitrd";
}
else {
$hostinfo_dict{$item}{"chain"} = 'osimage='.$provmethod.":--noupdateinitrd";
}
$hostinfo_dict{$item}{"chain"} = $chainstr;
if (exists $netprofileattr{"bmc"}){ # Update BMC records.
$hostinfo_dict{$item}{"mgt"} = "ipmi";
if (index($hostinfo_dict{$item}{"chain"}, "runcmd=bmcsetup") == -1){
$hostinfo_dict{$item}{"chain"} = 'runcmd=bmcsetup,'.$hostinfo_dict{$item}{"chain"}.':reboot4deploy';
}
else{
$hostinfo_dict{$item}{"chain"} = $hostinfo_dict{$item}{"chain"}.':reboot4deploy';
}
if (exists $ipshash{"bmc"}){
$hostinfo_dict{$item}{"bmc"} = $ipshash{"bmc"};
@@ -2009,6 +2157,9 @@ sub validate_node_entries{
foreach my $hostname (@::profiledNodeObjNames){
if (exists $hostnamedict{$hostname}){
push @invalid_records, [$hostname, "Duplicated hostname defined"];
} elsif (length($hostname) > 63){
# As the rule of IDN encoding, the length of hostname should less than 64 characters.
push @invalid_records, [$hostname, "The length of hostname is more than 63 characters"];
} else{
$hostnamedict{$hostname} = 0;
}
@@ -2166,11 +2317,12 @@ sub validate_node_entry{
if (exists $allhostnames{$node_name}) {
$errmsg .= "Node name $node_name already exists. You must use a new node name.\n";
}
# Must specify either MAC or switch + port.
# Must specify either MAC, CEC or switch + port.
if (exists $node_entry{"mac"} ||
exists $node_entry{"switches"} ){
exists $node_entry{"switches"} ||
exists $node_entry{"cec"}){
} else{
$errmsg .= "MAC address or switches is not specified. You must specify the MAC address or switches.\n";
$errmsg .= "MAC address, cec, switches is not specified. You must specify the MAC address, CEC name or switches.\n";
}
if (! xCAT::NetworkUtils->isValidHostname($node_name)){
@@ -2304,10 +2456,20 @@ sub validate_node_entry{
$errmsg .= "The lparid option must be used with the cec option.\n";
}
}elsif ($_ eq "cec"){
my $cec_name = $node_entry{"cec"};
my $lpar_id = 1;
# Check the specified CEC is existing
if (! exists $allcecs{$node_entry{$_}}){
$errmsg .= "The CEC name $node_entry{$_} that is specified in the node information file is not defined in the system.\n";
}elsif (exists $node_entry{"lparid"}){
$lpar_id = $node_entry{"lparid"};
}
if (exists $alllparids{$cec_name}{$lpar_id}){
$errmsg .= "The CEC name $cec_name and LPAR id $lpar_id already exist in the database or in the nodeinfo file. You must use a new CEC name and LPAR id.\n";
}else{
$alllparids{$cec_name}{$lpar_id} = 0;
}
}elsif ($_ eq "nicips"){
# Check Multi-Nic's ip
my $othernics = $node_entry{$_};
@@ -0,0 +1,194 @@
# IBM(c) 2007 EPL license http://www.eclipse.org/legal/epl-v10.html
#-------------------------------------------------------
=head1
xCAT plugin package to tell xcatd daemon to rescan plugin directory
Supported command:
rescanplugins->rescanplugins
=cut
#-------------------------------------------------------
package xCAT_plugin::rescanplugins;
BEGIN
{
$::XCATROOT = $ENV{'XCATROOT'} ? $ENV{'XCATROOT'} : '/opt/xcat';
}
use lib "$::XCATROOT/lib/perl";
use xCAT::Utils;
use xCAT::MsgUtils;
use Getopt::Long;
use strict;
1;
#-------------------------------------------------------
=head3 handled_commands
Return list of commands handled by this plugin
=cut
#-------------------------------------------------------
sub handled_commands
{
return {rescanplugins => "rescanplugins"};
}
#-------------------------------------------------------
=head3 preprocess_request
If hierarchy, send request to xcatd on service nodes
=cut
#-------------------------------------------------------
sub preprocess_request
{
my $req = shift;
my $callback = shift;
my $subreq = shift;
$::CALLBACK=$callback;
my $args = $req->{arg};
my $envs = $req->{env};
#if already preprocessed, go straight to request
if (($req->{_xcatpreprocessed}) and
($req->{_xcatpreprocessed}->[0] == 1) ) { return [$req]; }
# do your processing here
# return info
if ($args) {
@ARGV = @{$args}; # get arguments
}
Getopt::Long::Configure("posix_default");
Getopt::Long::Configure("no_gnu_compat");
Getopt::Long::Configure("bundling");
my %options = ();
if (
!GetOptions(
'h|help' => \$options{'help'},
's|servicenodes' => \$options{'servicenodes'},
'v|version' => \$options{'version'},
'V|Verbose' => \$options{'verbose'}
)
)
{
&usage;
exit 1;
}
if ($options{'help'})
{
&usage;
exit 0;
}
if ($options{'version'})
{
my $version = xCAT::Utils->Version();
#$version .= "\n";
my $rsp={};
$rsp->{data}->[0] = $version;
xCAT::MsgUtils->message("I",$rsp,$callback, 0);
exit 0;
}
if ( @ARGV && $ARGV[0] ) {
my $rsp={};
$rsp->{data}->[0] = "Ignoring arguments ". join(',',@ARGV);
xCAT::MsgUtils->message("I",$rsp,$callback, 0);
}
if ( $req->{node} && $req->{node}->[0] ) {
my $rsp={};
$rsp->{data}->[0] = "Ignoring nodes ". join(',',@{$req->{node}});
xCAT::MsgUtils->message("I",$rsp,$callback, 0);
$req->{node}=[];
}
if ($options{'servicenodes'}) {
# Run rescanplugins on MN and all service nodes
# build an individual request for each service node
my @requests;
my $MNreq = {%$req};
$MNreq->{_xcatpreprocessed}->[0] = 1;
push @requests, $MNreq;
foreach my $sn (xCAT::ServiceNodeUtils->getAllSN())
{
my $SNreq = {%$req};
$SNreq->{'_xcatdest'} = $sn;
$SNreq->{_xcatpreprocessed}->[0] = 1;
push @requests, $SNreq;
}
return \@requests; # return requests for all Service nodes
}
return [$req];
}
#-------------------------------------------------------
=head3 process_request
Process the command
=cut
#-------------------------------------------------------
sub process_request
{
my $req = shift;
my $callback = shift;
my $subreq = shift;
# The xcatd daemon should intercept this command and process it directly
print "in rescanplugins->process_request -- xcatd should process this request directly. WE SHOULD NEVER GET HERE \n";
my $rsp={};
$rsp->{data}->[0] = "in rescanplugins->process_request: xcatd should process this request directly. WE SHOULD NEVER GET HERE";
xCAT::MsgUtils->message("I", $rsp, $callback, 0);
return;
}
#-------------------------------------------------------------------------------
=head3
usage
puts out usage message for help
Arguments:
None
Returns:
Globals:
Error:
None
=cut
#-------------------------------------------------------------------------------
sub usage
{
## usage message
my $usagemsg = " rescanplugins [-h|--help] \n rescanplugins [-v|--version] \n rescanplugins [-s|--servicenodes]\n";
### end usage mesage
my $rsp = {};
$rsp->{data}->[0] = $usagemsg;
xCAT::MsgUtils->message("I", $rsp, $::CALLBACK);
return;
}
+1 -1
View File
@@ -1057,7 +1057,7 @@ sub updatenode
my $installdir = xCAT::TableUtils->getInstallDir();
#if the postscripts directory exists then make sure it is
# world readable and executable by root
# world readable by root
my $postscripts = "$installdir/postscripts";
if (-e $postscripts)
{
+1 -1
View File
@@ -289,7 +289,7 @@ sub setstate {
}
}
if ($nodemac =~ /:/) {
my $tmp = $nodemac;
my $tmp =lc($nodemac);
$tmp =~ s/(..):(..):(..):(..):(..):(..)/$1-$2-$3-$4-$5-$6/g;
my $pname = "yaboot.conf-" . $tmp;
unlink($tftpdir."/".$pname);
+46 -19
View File
@@ -31,7 +31,6 @@ use Socket;
#-----------------------------------------------------------------------------
# Main
$::progname = "xcatconfig";
my $args = join ' ', @ARGV;
$::command = "$0 $args";
@@ -916,10 +915,12 @@ sub settunables
If node private node hostkeys do not exist in either directory or force option
or generate host key option, we need to generate them
These keys are installed on the nodes in /etc/ssh directory and allow the
node to ssh without password node to node.
node to ssh to the other nodes and the MN or SN to be able to ssh to the node
Without known_hosts warning messages.
They are store in /etc/xcat/hostkeys on the MN.
This also includes some migration to /install/postscripts/hostkeys
The public key is also installed in /install/postscripts/hostkeys
for the install process
The private key is downloaded by remoteshell postscript using the credentials.pm interface
=cut
@@ -956,7 +957,7 @@ sub genSSHNodeHostKey
}
}
# remove the old keys
# remove the old keys from the /intall/postscripts/hostkeys directroy
if (-r $hostkey)
{
my $cmd = "/bin/rm $::INSTALLDIR/postscripts/hostkeys/ssh_host*";
@@ -970,7 +971,7 @@ sub genSSHNodeHostKey
}
}
# remove the old keys
# remove the old keys from the /etc/xcat/hostkeys directory
if (-r $hostkey2)
{
my $cmd = "/bin/rm /etc/xcat/hostkeys/ssh_host*";
@@ -1014,6 +1015,18 @@ sub genSSHNodeHostKey
{
xCAT::MsgUtils->message('E', "Could not generate SSH2 DSA key.");
}
# see if this system supports the ecdsa
if (-e "/etc/ssh/ssh_host_ecdsa_key") {
xCAT::MsgUtils->message('I', "Generating SSH2 ECDSA Key...");
$cmd =
"/usr/bin/ssh-keygen -t ecdsa -f /etc/xcat/hostkeys/ssh_host_ecdsa_key -C '' -N ''";
$outref = xCAT::Utils->runcmd("$cmd", 0);
if ($::RUNCMD_RC != 0)
{
xCAT::MsgUtils->message('E', "Could not generate SSH2 ECDSA key.");
}
}
# copy the public keys to install directory
$cmd =
@@ -1855,22 +1868,36 @@ sub setupLinuxexports
#-----------------------------------------------------------------------------
sub mknb
{
# The xCAT-genesis-scripts.spec file touches /etc/xcat/genesis-scripts-updated so we know to run
# mknb here.
if ($::arch eq "x86_64" && (-f '/etc/xcat/genesis-scripts-updated') ) {
unlink '/etc/xcat/genesis-scripts-updated';
my $cmd = "$::XCATROOT/sbin/mknb $::arch";
xCAT::MsgUtils->message('I', "Running '$cmd', triggered by the installation/update of xCAT-genesis-scripts-x86_64 ...");
# The xCAT-genesis-scripts.spec file touches /etc/xcat/genesis-scripts-updated or
# the xCAT-genesis-base.spec file touches /etc/xcat/genesis-base-updated,
# so we know to run mknb here.
my $cmd;
if ($::arch eq "x86_64" && (-f '/etc/xcat/genesis-scripts-updated') ) {
unlink '/etc/xcat/genesis-scripts-updated';
# Do not print messages or run command twice
if (-f '/etc/xcat/genesis-base-updated') {
unlink '/etc/xcat/genesis-base-updated';
}
$cmd = "$::XCATROOT/sbin/mknb $::arch";
xCAT::MsgUtils->message('I', "Running '$cmd', triggered by the installation/update of xCAT-genesis-scripts-x86_64 ...");
}
if ($::arch eq "x86_64" && (-f '/etc/xcat/genesis-base-updated')) {
unlink '/etc/xcat/genesis-base-updated';
$cmd = "$::XCATROOT/sbin/mknb $::arch";
xCAT::MsgUtils->message('I', "Running '$cmd', triggered by the installation/update of xCAT-genesis-base-x86_64 ...");
}
#my $outref = xCAT::Utils->runcmd("$cmd", 0);
system($cmd);
if ($? != 0) {
my $rc = $? >> 8;
xCAT::MsgUtils->message('E', "The 'mknb $::arch' command returned error code: $rc.");
if ($cmd) {
system($cmd);
if ($? != 0) {
my $rc = $? >> 8;
xCAT::MsgUtils->message('E', "The 'mknb $::arch' command returned error code: $rc.");
}
else {
xCAT::MsgUtils->message('I', "The 'mknb $::arch' command completed successfully.");
}
}
else {
xCAT::MsgUtils->message('I', "The 'mknb $::arch' command completed successfully.");
}
}
}
#-----------------------------------------------------------------------------
+59 -11
View File
@@ -716,6 +716,8 @@ sleep 0.05;
sub scan_plugins {
my $serialdest = shift;
my $rescan = shift;
%cmd_handlers=();
my @plugins=glob($plugins_dir."/*.pm");
foreach (@plugins) {
/.*\/([^\/]*).pm$/;
@@ -751,14 +753,16 @@ sub scan_plugins {
}
}
}
foreach (@plugins) {
no strict 'refs';
/.*\/([^\/]*).pm$/;
my $modname = $1;
unless (defined(${"xCAT_plugin::".$modname."::"}{init_plugin})) {
next;
if ( ! $rescan ) {
foreach (@plugins) {
no strict 'refs';
/.*\/([^\/]*).pm$/;
my $modname = $1;
unless (defined(${"xCAT_plugin::".$modname."::"}{init_plugin})) {
next;
}
${"xCAT_plugin::".$modname."::"}{init_plugin}->(\&do_request);
}
${"xCAT_plugin::".$modname."::"}{init_plugin}->(\&do_request);
}
if ($serialdest) { store_fd(\%cmd_handlers,$serialdest); }; #print $serialdest freeze(\%cmd_handlers); };
}
@@ -928,6 +932,17 @@ xCAT::NotifHandler::setup($$, $dbmaster);
#start the monitoring process
xCAT_monitoring::monitorctrl::start($$);
# Set up communication pipe to have subcommand process be able to reload the
# cmd_handlers hash and pass it back to this parent when rescanplugins requested
my $chreadpipe;
my $chwritepipe;
if ( !(socketpair($chreadpipe, $chwritepipe,AF_UNIX,SOCK_STREAM,PF_UNSPEC)) ) {
xCAT::MsgUtils->message("S", "socketpair failed: $!");
}
my $chrselect = new IO::Select;
$chrselect->add($chreadpipe);
my $peername;
my $ssltimeout;
my $retry=1;
@@ -1026,6 +1041,14 @@ until ($quit) {
$listenwatcher->can_read(0.1); #when next connection tries to come in or a tenth of a second, whichever comes first
next; #just keep pulling things off listen queue onto our own
}
# before we fork, check to see if rescanplugins was previously processed and
# we now have a new cmd_handlers hash to refresh
my @chdata;
if (@chdata = $chrselect->can_read(0)) {
foreach my $chd (@chdata) {
%cmd_handlers = %{fd_retrieve($chd)};
}
}
#we have a pending connection and we are under the threshold, grab one from the list and process it...
my $cnnection=shift @pendingconnections;
my $connection;
@@ -1366,7 +1389,13 @@ sub plugin_command {
dispatch_request($req,$callback,$modname);
} else {
$SIG{CHLD}='DEFAULT';
${"xCAT_plugin::".$modname."::"}{process_request}->($req,$callback,\&do_request);
# Call the plugin to process the command request
# rescanplugins request gets handled directly here in xcatd
if ($req->{command}->[0] eq 'rescanplugins') {
scan_plugins($chwritepipe,'1');
} else {
${"xCAT_plugin::".$modname."::"}{process_request}->($req,$callback,\&do_request);
}
}
$$progname=$oldprogname;
}; #REMOVEEVALFORDEBUG
@@ -1454,7 +1483,13 @@ sub plugin_command {
dispatch_request($req,$callback,$modname);
} else {
$SIG{CHLD}='DEFAULT';
${"xCAT_plugin::".$modname."::"}{process_request}->($req,$callback,\&do_request);
# Call the plugin to process the command request
# rescanplugins request gets handled directly here in xcatd
if ($req->{command}->[0] eq 'rescanplugins') {
scan_plugins($chwritepipe,'1');
} else {
${"xCAT_plugin::".$modname."::"}{process_request}->($req,$callback,\&do_request);
}
}
$$progname=$oldprogname;
$parent_fd = $org_parent_fd;
@@ -1679,7 +1714,13 @@ sub dispatch_request {
if ($onlyone and not ($_->{'_xcatdest'} and xCAT::NetworkUtils->thishostisnot($_->{'_xcatdest'}))) {
$SIG{CHLD}='DEFAULT';
if ($_->{'_xcatdelay'} and not ref $_->{'_xcatdelay'}) { sleep $_->{'_xcatdelay'}; }
${"xCAT_plugin::".$modname."::"}{process_request}->($_,$dispatch_cb,\&do_request);
# Call the plugin to process the command request
# rescanplugins request gets handled directly here in xcatd
if ($_->{command}->[0] eq 'rescanplugins') {
scan_plugins($chwritepipe,'1');
} else {
${"xCAT_plugin::".$modname."::"}{process_request}->($_,$dispatch_cb,\&do_request);
}
return;
}
@@ -1762,7 +1803,13 @@ sub dispatch_request {
} else {
$$progname.=": locally executing";
$SIG{CHLD}='DEFAULT';
${"xCAT_plugin::".$modname."::"}{process_request}->($_,\&dispatch_callback,\&do_request);
# Call the plugin to process the command request
# rescanplugins request gets handled directly here in xcatd
if ($_->{command}->[0] eq 'rescanplugins') {
scan_plugins($chwritepipe,'1');
} else {
${"xCAT_plugin::".$modname."::"}{process_request}->($_,\&dispatch_callback,\&do_request);
}
last;
}
}
@@ -1796,6 +1843,7 @@ sub do_request {
}
}
#my $sock = shift; #If no sock, will return a response hash
if ($cmd_handlers{$req->{command}->[0]}) {
return plugin_command($req,$sock,$rsphandler);
@@ -0,0 +1,13 @@
#Please make sure there is a space between @ and group name
wget
ntp
nfs-utils
net-snmp
rsync
yp-tools
openssh-server
util-linux-ng
net-tools
libvirt
screen
qemu-kvm
@@ -0,0 +1,154 @@
#
#cmdline
lang en_US
#KICKSTARTNET#
#
# Where's the source?
# nfs --server hostname.of.server or IP --dir /path/to/RH/CD/image
#
#nfs --server #XCATVAR:INSTALL_NFS# --dir #XCATVAR:INSTALL_SRC_DIR#
%include /tmp/repos
#device ethernet e100
keyboard "us"
#
# Clear the MBR
#
zerombr
#
# Wipe out the disk
#
clearpart --all --initlabel
#clearpart --linux
#key --skip
#
# Customize to fit your needs
#
#XCAT_PARTITION_START#
#No RAID
#/boot really significant for this sort of setup nowadays?
#part /boot --size 50 --fstype ext3
%include /tmp/partitioning
#part swap --size 1024
#part / --size 1 --grow --fstype ext4
#XCAT_PARTITION_END#
#RAID 0 /scr for performance
#part / --size 1024 --ondisk sda
#part swap --size 512 --ondisk sda
#part /var --size 1024 --ondisk sdb
#part swap --size 512 --ondisk sdb
#part raid.01 --size 1 --grow --ondisk sda
#part raid.02 --size 1 --grow --ondisk sdb
#raid /scr --level 0 --device md0 raid.01 raid.02
#Full RAID 1 Sample
#part raid.01 --size 50 --ondisk sda
#part raid.02 --size 50 --ondisk sdb
#raid /boot --level 1 --device md0 raid.01 raid.02
#
#part raid.11 --size 1024 --ondisk sda
#part raid.12 --size 1024 --ondisk sdb
#raid / --level 1 --device md1 raid.11 raid.12
#
#part raid.21 --size 1024 --ondisk sda
#part raid.22 --size 1024 --ondisk sdb
#raid /var --level 1 --device md2 raid.21 raid.22
#
#part raid.31 --size 1024 --ondisk sda
#part raid.32 --size 1024 --ondisk sdb
#raid swap --level 1 --device md3 raid.31 raid.32
#
#part raid.41 --size 1 --grow --ondisk sda
#part raid.42 --size 1 --grow --ondisk sdb
#raid /scr --level 1 --device md4 raid.41 raid.42
#
# bootloader config
# --append <args>
# --useLilo
# --md5pass <crypted MD5 password for GRUB>
#
bootloader
#
# install or upgrade
#
install
#
# text mode install (default is graphical)
#
text
#
# firewall
#
firewall --disabled
#
# Select a zone
# Add the --utc switch if your hardware clock is set to GMT
#
#timezone US/Hawaii
#timezone US/Pacific
#timezone US/Mountain
#timezone US/Central
#timezone US/Eastern
timezone --utc "#TABLE:site:key=timezone:value#"
#
# Don't do X
#
skipx
#
# To generate an encrypted root password use:
#
# perl -e 'print crypt("blah","Xa") . "\n";'p
# openssl passwd -apr1 -salt xxxxxxxx password
#
# where "blah" is your root password.
#
#rootpw --iscrypted XaLGAVe1C41x2
#rootpw XaLGAVe1C41x2 --iscrypted
rootpw --iscrypted #CRYPT:passwd:key=system,username=root:password#
#
# NIS setup: auth --enablenis --nisdomain sensenet
# --nisserver neptune --useshadow --enablemd5
#
# OR
auth --useshadow --enablemd5
#
# SE Linux
#
selinux --disabled
#
# Reboot after installation
#
reboot
#
#end of section
#
%packages
#INCLUDE_DEFAULT_PKGLIST#
%end
%pre
#INCLUDE:#ENV:XCATROOT#/share/xcat/install/scripts/pre.rh.rhel7#
%end
%post
#INCLUDE:#ENV:XCATROOT#/share/xcat/install/scripts/post.xcat#
%end
@@ -35,3 +35,4 @@ mysql-connector-odbc
perl-DBD-Pg
wget
util-linux-ng
net-tools
@@ -26,3 +26,4 @@ mysql-connector-odbc
perl-DBD-Pg
wget
util-linux-ng
net-tools
@@ -94,7 +94,7 @@ cd /xcatpost
export PATH=$PATH:/xcatpost
# use the run_ps subroutine to run the postscripts
TMP=`sed "/postscripts-start-here/,/postscripts-end-here/ s/\(.*\)/run_ps \1/;s/run_ps\s*#/#/;s/run_ps\s*$//" /xcatpost/mypostscript`
TMP=`sed "/^#\s*postscripts-start-here/,/^#\s*postscripts-end-here/ s/\(.*\)/run_ps \1/;s/run_ps\s*#/#/;s/run_ps\s*$//" /xcatpost/mypostscript`
echo "
# global value to store the running status of the postbootscripts,the value is non-zero if one postbootscript failed
return_value=0
@@ -125,12 +125,12 @@ run_ps () {
" > /xcatpost/mypostscript
echo "$TMP" >> /xcatpost/mypostscript
TMP=`sed "/postbootscripts-start-here/,/postbootscripts-end-here/ s/\(.*\)/run_ps \1/;s/run_ps\s*#/#/;s/run_ps\s*$//" /xcatpost/mypostscript`
TMP=`sed "/^#\s*postbootscripts-start-here/,/^#\s*postbootscripts-end-here/ s/\(.*\)/run_ps \1/;s/run_ps\s*#/#/;s/run_ps\s*$//" /xcatpost/mypostscript`
echo "$TMP" > /xcatpost/mypostscript
#save the postboot scripts to /xcatpost/mypostscript.post
TMP=`sed "/postscripts-start-here/,/postscripts-end-here/ d" /xcatpost/mypostscript`
TMP=`sed "/^#\s*postscripts-start-here/,/^#\s*postscripts-end-here/ d" /xcatpost/mypostscript`
echo "$TMP" > /xcatpost/mypostscript.post
chmod 755 /xcatpost/mypostscript.post
@@ -173,7 +173,7 @@ EOF
chmod 755 /opt/xcat/xcatdsklspost
#only run the prebooot scripts here
TMP=`sed "/postbootscripts-start-here/,/postbootscripts-end-here/ d" /xcatpost/mypostscript`
TMP=`sed "/^#\s*postbootscripts-start-here/,/^#\s*postbootscripts-end-here/ d" /xcatpost/mypostscript`
echo "$TMP" > /xcatpost/mypostscript
export NODE=#TABLE:nodelist:THISNODE:node#
@@ -1 +0,0 @@
../rh/dracut
-1
View File
@@ -1 +0,0 @@
../rh/dracut
@@ -20,6 +20,6 @@ e2fsprogs
bc
lsvpd
irqbalance
procps
procps-ng
parted
net-tools
@@ -9,7 +9,7 @@ openssh-clients
iputils
bc
irqbalance
procps
procps-ng
wget
vim-minimal
ntp
@@ -0,0 +1,14 @@
bash
nfs-common
openssl
isc-dhcp-client
linux-image-server
openssh-server
openssh-client
wget
vim
ntp
rsyslog
rsync
busybox-static
gawk
+106
View File
@@ -68,6 +68,7 @@ my @apigroups = (
my %formathdl = (
text => \&outtext,
wiki => \&outwiki,
mediawiki => \&outmediawiki,
);
@@ -150,11 +151,109 @@ sub outtext {
}
}
# The subroutine is used to generate restapi doc in sourceforage markdown wiki
sub outwiki {
my $def = shift;
my $opt = shift;
my $res = shift;
if ($res) {
if (defined ($res->{'desc'})) {
# add \ for [ and ]
$res->{'desc'} =~ s/\[/\\\[/;
$res->{'desc'} =~ s/\]/\\\]/;
print "##$res->{'desc'}##\n";
}
foreach (1..10) {
if (defined ($res->{'desc'.$_})) {
print $res->{'desc'.$_}."\n\n";
}
}
}
my $postfix = "?userName=root&password=cluster&pretty=1";
if (defined ($def->{desc})) {
print "###$opt - $def->{desc}###\n";
}
foreach (1..10) {
if (defined ($def->{'desc'.$_})) {
print $def->{'desc'.$_}."\n\n";
}
}
if (defined ($def->{cmd})) {
my $manpath = search_manpage($def->{cmd});
$manpath =~ s/\.gz//;
if ($manpath) {
print "Refer to the man page:[$def->{cmd}](http://xcat.sourceforge.net".$manpath.".html).\n\n";
} else {
print "Refer to the man page of ".$def->{cmd}." command.\n\n";
}
}
if (defined ($def->{usage})) {
$def->{usage} =~ s/\[/\\\[/;
$def->{usage} =~ s/\]/\\\]/;
my @parts = split ('\|', $def->{usage});
if ($parts[1]) {
print "**Parameters:**\n\n* $parts[1]\n\n";
}
if ($parts[2]) {
print "**Returns:**\n\n* $parts[2]\n\n";
}
}
my @example_array = ();
if (defined($def->{example})) {
push @example_array, $def->{example};
} else {
foreach (1..10) {
if (defined($def->{'example'.$_})) {
push @example_array, $def->{'example'.$_};
}
}
}
if (@example_array) {
foreach my $line (@example_array) {
my @parts = split ('\|', $line);
print "**Example:**\n";
if ($parts[1]) {
print "$parts[1]\n";
} else {
push @errmsg, "Error format for:[".$def->{desc}."]\n";
}
if ($parts[2] && $parts[3] && ($parts[4] || $opt ne "GET")) {
my ($uri, $data);
if ($parts[3] =~ /\s+/) {
($uri, $data) = split(/ /, $parts[3]);
print "\n #curl -X $parts[2] -k \'https://127.0.0.1/xcatws$uri$postfix\' -H Content-Type:application/json --data \'$data\'\n";
} else {
print "\n #curl -X $parts[2] -k \'https://127.0.0.1/xcatws$parts[3]$postfix\'\n";
}
$parts[4] =~ s/\n/\n /g;
print " $parts[4]\n\n---\n";
} else {
push @errmsg, "Error format for:[".$def->{desc}."]\n";
}
}
} else {
push @errmsg, "Error format for:[".$def->{desc}."]\n";
}
}
# outmediawiki is the backup subroutine to generate restapi doc for mediawiki which has been obsoleted from sourceforge
sub outmediawiki {
my $def = shift;
my $opt = shift;
my $res = shift;
if ($res) {
if (defined ($res->{'desc'})) {
print "===$res->{'desc'}===\n";
@@ -264,6 +363,9 @@ sub gendoc {
$format = "text";
}
if ($format eq "wiki") {
print "\n[TOC]\n";
}
foreach my $group (@apigroups) {
my $groupname = $group->{'groupname'};
@@ -275,6 +377,10 @@ sub gendoc {
print $group->{'desc'}."\n";
print "############################################\n";
} elsif ($format eq "wiki") {
print "#".$group->{'header'}."#\n";
print $group->{'desc'}."\n";
print "\n\n---\n\n---\n";
} elsif ($format eq "mediawiki") {
print "==".$group->{'header'}."==\n";
print $group->{'desc'}."\n";
}
+25 -6
View File
@@ -201,11 +201,31 @@ sub setupSSH
$msg = "aixremoteshell: Could not get ssh_host_rsa_key file.\n";
`logger -t xcat -p local4.err $msg`;
}
if ( $nodetype eq "service") {
# is there is a ecdsa host key on the node, then get the one from the MN/SN
my $filename = "/etc/ssh/ssh_host_ecdsa_key";
if (-e $filename) {
my $response=&getresponse("ssh_ecdsa_hostkey");
if (defined ($response) ) {
my $fd;
&runcmd("mkdir -p /etc/ssh");
open($fd, '>',$filename);
print $fd $response;
close($fd);
# set the permissions
my $cmd = "chmod 600 $filename > /dev/null 2>&1";
&runcmd($cmd);
}
else {
$msg = "aixremoteshell: Could not get ssh_host_ecdsa_key file.\n";
`logger -t xcat -p local4.err $msg`;
}
}
if ( $nodetype eq "service") {
&runcmd("mkdir -p /etc/xcat/hostkeys; cp /etc/ssh/ssh* /etc/xcat/hostkeys/. > /dev/null 2>&1");
}
# Decide whether to enable ssh between the nodes
if ($enablesshbetweennodes eq "YES") {
# Decide whether to enable passwordless ssh between the nodes
if ($enablesshbetweennodes eq "YES") {
my $response=&getresponse("ssh_root_key");
if (defined ($response) ) {
my $fd;
@@ -216,7 +236,6 @@ sub setupSSH
close($fd);
# set the permissions
#TODO - what perms are needed???
my $cmd = "chmod 600 $filename > /dev/null 2>&1";
&runcmd($cmd);
@@ -227,8 +246,8 @@ sub setupSSH
else {
$msg = "aixremoteshell: Could not get id_rsa file.\n";
`logger -t xcat -p local4.err $msg`;
}
}
}
}
return 0;
}
+4 -3
View File
@@ -3,9 +3,10 @@
str_dir_name=`dirname $0`
. $str_dir_name/xcatlib.sh
if [ "$(uname -s|tr 'A-Z' 'a-z')" = "linux" ];then
str_dir_name=`dirname $0`
. $str_dir_name/xcatlib.sh
fi
#-------------------------------------------------------------------------------
+5 -3
View File
@@ -34,9 +34,11 @@
# NETWORKS_LINE2=netname=10_0_2_0-255_255_255_0||net=10.0.2.0||mask=255.255.255.0||mgtifname=eth0||gateway=10.0.2.2||dhcpserver=||tftpserver=10.0.2.15||nameservers=||ntpservers=||logservers=||dynamicrange=||staticrange=||staticrangeincrement=||nodehostname=||ddnsdomain=||vlanid=||domain=||disable=||comments=
# locd library for network caculation
str_dir_name=`dirname $0`
. $str_dir_name/xcatlib.sh
# load library for network caculation
if [ "$(uname -s|tr 'A-Z' 'a-z')" = "linux" ];then
str_dir_name=`dirname $0`
. $str_dir_name/xcatlib.sh
fi
# Subroutine to display message and pass it to syslog
# Usage: showmsg "message to putput" ["error"]
+8 -3
View File
@@ -1,7 +1,12 @@
#!/bin/bash
str_dir_name=`dirname $0`
# IBM(c) 2014 EPL license http://www.eclipse.org/legal/epl-v10.html
# Internal script used by confignics only.
# It configs the Ethernet adpaters on the node
. $str_dir_name/xcatlib.sh
if [ "$(uname -s|tr 'A-Z' 'a-z')" = "linux" ];then
str_dir_name=`dirname $0`
. $str_dir_name/xcatlib.sh
fi
function configipv4(){
str_if_name=$1
@@ -623,7 +628,7 @@ else
str_nic_status='down'
str_his_file=${str_cfg_dir}xcat_history_important
str_history=`ip addr show dev $str_nic_name | grep inet | grep -iv dynamic | grep -iv link | awk '{print $2}'`
str_history=`ip addr show dev $str_nic_name | grep inet | grep -iv dynamic | grep -iv link | grep $str_nic_name | awk '{print $2}'`
old_ifs=$IFS
IFS=$'\n'
array_ip_old_temp=($str_history)
+46 -6
View File
@@ -73,6 +73,48 @@ if ($::opt_ports)
if (-f "/etc/redhat-release")
{
#From Redhat7, firewalld is used as the default firewall service,
#however, it does not support complex firewall rules.
#So we'd better disable firewalld and use iptables service
#iptables service is shiped in iptables-services package in rhels7 iso,
#which is not installed by default, it should be installed
if ( -f "/usr/lib/systemd/system/firewalld.service" ){
if (system("systemctl is-active firewalld > /dev/null 2>&1") == 0){
print "firewalld is running, stopping firewalld service \n";
if(system ("service firewalld stop") ==0 )
{
print "\n[success]\n";
}
else
{
print "\n[failed]\n";
exit 1
}
}
if (system("systemctl is-enabled firewalld > /dev/null 2>&1") == 0){
print "disabling firewalld service \n";
if( system("systemctl disable firewalld") ==0)
{
print "\n[success]\n";
}
else
{
print "\n[failed]\n";
exit 1
}
}
}
if ( (! -f "/usr/lib/systemd/system/iptables.service") && (! -f "/etc/init.d/iptables")){
print "please install iptables-services (for redhat 7) or iptables package first by running:\n";
print "on redhat7:\tyum install iptables-services\n";
print " others:\tyum install iptables\n";
exit 1
}
if($::opt_private && $::opt_public)
{
&setup_ip_forwarding();
@@ -93,12 +135,12 @@ if (-f "/etc/redhat-release")
# restart iptables
#$cmd = "service iptables restart";
#system($cmd);
xCAT::Utils->restartservice("firewall");
xCAT::Utils->restartservice("iptables");
# iptables should be stared on reboot
#$cmd = "chkconfig iptables on";
#system($cmd);
xCAT::Utils->enableservice("firewall");
xCAT::Utils->enableservice("iptables");
}
elsif (-f "/etc/SuSE-release")
{
@@ -141,16 +183,14 @@ elsif (-f "/etc/SuSE-release")
# restart firewall
#my $cmd = "service SuSEfirewall2_setup restart";
#system($cmd);
xCAT::Utils->restartservice("SuSEfirewall2_setup");
xCAT::Utils->restartservice("firewall");
# SuSEfirewall2_setup should be stared on reboot
#$cmd = "chkconfig SuSEfirewall2_init on";
#system($cmd);
#$cmd = "chkconfig SuSEfirewall2_setup on";
#system($cmd);
xCAT::Utils->enableservice("SuSEfirewall2_init");
xCAT::Utils->enableservice("SuSEfirewall2_setup");
xCAT::Utils->enableservice("firewall");
}
else
{
+6 -6
View File
@@ -1,7 +1,7 @@
#!/bin/sh
# IBM(c) 2013 EPL license http://www.eclipse.org/legal/epl-v10.html
# xCAT post script for configuring ib adaptors.
# Internal script used by confignics only
# xCAT post script for configuring ib adapters.
# Work for both IPv4 and IPv6
# The following are a sample of the env used:
# NIC_IBNICS=ib0,ib1
@@ -17,10 +17,10 @@
# NETWORKS_LINE2='netname=ib1||net=15.0.1.0||mask=255.255.255.0||mgtifname=||gateway=15.0.1.254||dhcpserver=||tftpserver=||nameservers=||ntpservers=||logservers=||dynamicrange=||staticrange=||staticrangeincrement=||nodehostname=||ddnsdomain=||vlanid=||domain=||disable=||comments='
# NETWORKS_LINE3='netname=ib3||net=15.0.3.0||mask=255.255.255.0||mgtifname=||gateway=||dhcpserver=||tftpserver=||nameservers=||ntpservers=||logservers=||dynamicrange=||staticrange=||staticrangeincrement=||nodehostname=||ddnsdomain=||vlanid=||domain=||disable=||comments='
str_dir_name=`dirname $0`
. $str_dir_name/xcatlib.sh
if [ "$(uname -s|tr 'A-Z' 'a-z')" = "linux" ];then
str_dir_name=`dirname $0`
. $str_dir_name/xcatlib.sh
fi
#This is the number of ports for each ib adpator.
portnum=1
+20 -4
View File
@@ -1,7 +1,23 @@
#!/bin/bash
# IBM(c) 2014 EPL license http://www.eclipse.org/legal/epl-v10.html
str_dir_name=`dirname $0`
. $str_dir_name/xcatlib.sh
#-------------------------------------------------------------------------------
#=head1 confignics
#=head2 Used on Linux only. Config the Ethernet or InfiniBand adapters on the nodes
#
# You can run the following commands on MN:
# updatenode noderange confignics
# updatenode noderange "confignics -s" (this one configures the installation nic also)
#
#
#=cut
#-------------------------------------------------------------------------------
if [ "$(uname -s|tr 'A-Z' 'a-z')" = "linux" ];then
str_dir_name=`dirname $0`
. $str_dir_name/xcatlib.sh
fi
#the nics' information contain:
#1. ip address
@@ -106,7 +122,7 @@ function checknetwork(){
echo "$str_networkname"
return
fi
str_ret="${str_ret}${str_networkname},"
str_ret="${str_ret}${str_networkname}|"
num_index=$((num_index+1))
done
@@ -284,7 +300,7 @@ do
echo "confignics on $NODE: processing custom scripts: ${array_temp[1]} for interface $key"
${array_temp[1]}
else
if [ `echo $key | grep -E 'e(n|th)[0-9a-z]+'` ];then
if [ `echo $key | grep -E 'e(n|th|m)[0-9a-z]+'` ];then
str_nic_type="ethernet"
elif [ `echo $key | grep -E 'ib[0-9]+'` ];then
str_nic_type="infiniband"
+5
View File
@@ -0,0 +1,5 @@
#/bin/sh
#modify the grub.cfg to prevent nic consistent network renameing
grep -E -q "net.ifnames=0" /etc/sysconfig/grub || sed -i '/^GRUB_CMDLINE_LINUX=.*/{s/"$/ net.ifnames=0"/}' /etc/sysconfig/grub
grep -E -q "net.ifnames=0" /etc/default/grub || sed -i '/^GRUB_CMDLINE_LINUX=.*/{s/"$/ net.ifnames=0"/}' /etc/default/grub
grub2-mkconfig -o /boot/grub2/grub.cfg
+14 -3
View File
@@ -4,9 +4,11 @@
#
str_dir_name=`dirname $0`
if [ "$(uname -s|tr 'A-Z' 'a-z')" = "linux" ];then
str_dir_name=`dirname $0`
. $str_dir_name/xcatlib.sh
fi
. $str_dir_name/xcatlib.sh
# create /etc/sysconfig/network-scripts/
pmatch ()
@@ -211,7 +213,16 @@ EOF
mv ${oldremount}.bak $oldremount
fi
else
if (pmatch $OSVER "fedora*") || (pmatch $OSVER "rhel6*") || (pmatch $OSVER "rhels6*") || [ -f /etc/fedora-release ] || [ -f /etc/redhat-release ];then
if (pmatch $OSVER "rhel7*") || (pmatch $OSVER "rhels7*");then
/bin/mount -o nolock $KDIP:$KDPATH $MOUNTPATH
[ -d $MOUNTPATH/var/crash ] || mkdir -p $MOUNTPATH/var/crash
echo "nfs $KDIP:$KDPATH" > /etc/kdump.conf
echo "default shell" >> /etc/kdump.conf
sed -i 's/KDUMP_COMMANDLINE_APPEND="/KDUMP_COMMANDLINE_APPEND="nonodestatus /' /etc/sysconfig/kdump
[ -f /etc/dracut.conf ] && mv /etc/dracut.conf /tmp/dracut.conf
restartservice kdump
[ -f /tmp/dracut.conf ] && mv /tmp/dracut.conf /etc/dracut.conf
elif (pmatch $OSVER "fedora*") || (pmatch $OSVER "rhel6*") || (pmatch $OSVER "rhels6*") || [ -f /etc/fedora-release ] || [ -f /etc/redhat-release ];then
/bin/mount -o nolock $KDIP:$KDPATH $MOUNTPATH
echo "net $KDIP:$KDPATH" > /etc/kdump.conf
echo "link_delay 180" >> /etc/kdump.conf
+4 -3
View File
@@ -2,9 +2,10 @@
# IBM(c) 2013 EPL license http://www.eclipse.org/legal/epl-v10.html
str_dir_name=`dirname $0`
. $str_dir_name/xcatlib.sh
if [ "$(uname -s|tr 'A-Z' 'a-z')" = "linux" ];then
str_dir_name=`dirname $0`
. $str_dir_name/xcatlib.sh
fi
#-------------------------------------------------------------------------------
#=head1 install_puppet_server
+11 -3
View File
@@ -10,11 +10,19 @@
# And do whatever is necessary on ubuntu.
if [[ -f /sbin/dracut ]]; then
# redhat/centos
# redhat6.x/centos6.x
echo "Running dracut to regenerate the initrd with the drivers needed by this node:"
dracut --force
else
# suse/sles
# suse/sles and redhat5.x/centos5.x
echo "Running mkinitrd to regenerate the initrd with the drivers needed by this node:"
mkinitrd
osvers=`cat /etc/*release|sed -e 's/.*\([0-9]\{1,\}\.[0-9]\{1,\}\).*/\1/'`
if [[ $osvers == 5\.* ]];then
initrdfile=`find /boot -name "initrd-*.img"`
kernelversion=`echo $initrdfile |sed -e 's:/boot/initrd-\(.*\)\.img:\1:g'`
mv $initrdfile $initrdfile.org
mkinitrd $initrdfile $kernelversion
else
mkinitrd
fi
fi
+77 -4
View File
@@ -4,7 +4,7 @@
# This script adds xCAT specific setup to the /etc/ssh/sshd_config and ssh_config file
# It calls getcredentials.awk to get from the xcatmaster ssh host keys from the
# /etc/xcat/hostkeys directory and puts in /etc/ssh on the node the following keys
# ssh_host_dsa_key,ssh_host_rsa_key
# ssh_host_dsa_key,ssh_host_rsa_key, ssh_host_ecdsa_key (if supported)
# It calls getcredentials.awk to get from the xcatmaster root ssh keys from the
# ~/.ssh directory on the xcatmaster and put in ~/.ssh on the node the following keys:
# If site.enablesshbetweennodes is yes
@@ -13,9 +13,10 @@
# if on the Management Node, exit
str_dir_name=`dirname $0`
. $str_dir_name/xcatlib.sh
if [ "$(uname -s|tr 'A-Z' 'a-z')" = "linux" ];then
str_dir_name=`dirname $0`
. $str_dir_name/xcatlib.sh
fi
if [ -e /etc/xCATMN ]; then
logger -t xcat -p local4.info "remoteshell:Running on the Management Node , exiting "
@@ -87,6 +88,7 @@ allowcred.awk &
CREDPID=$!
sleep 1
#download the ssh host dsa private keys
if [ $useflowcontrol = "1" ]; then
#first contact daemon xcatflowrequest <server> 3001
logger -t xCAT -p local4.info "remoteshell: sending xcatflowrequest $master 3001"
@@ -153,6 +155,7 @@ else
fi
rm /tmp/ssh_dsa_hostkey
# download the host rsa key
if [ $useflowcontrol = "1" ]; then
#first contact daemon xcatflowrequest <server> 3001
logger -t xCAT -p local4.info "remoteshell: sending xcatflowrequest $master 3001"
@@ -164,6 +167,7 @@ if [ $useflowcontrol = "1" ]; then
useflowcontrol=0
fi
fi
getcredentials.awk ssh_rsa_hostkey | grep -E -v '</{0,1}xcatresponse>|</{0,1}serverdone>' | sed -e 's/&lt;/</' -e 's/&gt;/>/' -e 's/&amp;/&/' -e 's/&quot/"/' -e "s/&apos;/'/" > /tmp/ssh_rsa_hostkey
#check whether the message is an error or not
@@ -217,6 +221,75 @@ else
fi
rm /tmp/ssh_rsa_hostkey
# if there is a ecdsa host key on the node then download the replacement from the MN/SN
if [ -f /etc/ssh/ssh_host_ecdsa_key ]; then
# download the host ecdsa key
if [ $useflowcontrol = "1" ]; then
#first contact daemon xcatflowrequest <server> 3001
logger -t xCAT -p local4.info "remoteshell: sending xcatflowrequest $master 3001"
/$xcatpost/xcatflowrequest $master 3001
rc=$?
logger -t xCAT -p local4.info "remoteshell:xcatflowrequest return=$rc"
if [ $rc -ne 0 ]; then
logger -t xCAT -p local4.info "remoteshell: error from xcatflowrequest, will not use flow control"
useflowcontrol=0
fi
fi
getcredentials.awk ssh_ecdsa_hostkey | grep -E -v '</{0,1}xcatresponse>|</{0,1}serverdone>' | sed -e 's/&lt;/</' -e 's/&gt;/>/' -e 's/&amp;/&/' -e 's/&quot/"/' -e "s/&apos;/'/" > /tmp/ssh_ecdsa_hostkey
#check whether the message is an error or not
grep -E '<error>' /tmp/ssh_ecdsa_hostkey
if [ $? -ne 0 ]; then
#the message received is the data we request
cat /tmp/ssh_ecdsa_hostkey | grep -E -v '</{0,1}errorcode>|/{0,1}data>|</{0,1}content>|</{0,1}desc>' >/etc/ssh/ssh_host_ecdsa_key
logger -t xCAT -p local4.info ssh_ecdsa_hostkey
MYCONT=`cat /etc/ssh/ssh_host_ecdsa_key`
MAX_RETRIES=10
RETRY=0
while [ -z "$MYCONT" ]; do
# not using flow control , need to sleep
if [ $useflowcontrol = "0" ]; then
let SLI=$RANDOM%10
let SLI=SLI+10
sleep $SLI
fi
RETRY=$(($RETRY+1))
if [ $RETRY -eq $MAX_RETRIES ]
then
break
fi
if [ $useflowcontrol = "1" ]; then
#first contact daemon xcatflowrequest <server> 3001
logger -t xCAT -p local4.info "remoteshell: sending xcatflowrequest $master 3001"
/$xcatpost/xcatflowrequest $master 3001
rc=$?
logger -t xCAT -p local4.info "remoteshell:xcatflowrequest return=$rc"
if [ $rc -ne 0 ]; then
logger -t xCAT -p local4.info "remoteshell: error from xcatflowrequest, will not use flow control"
useflowcontrol=0
fi
fi
getcredentials.awk ssh_ecdsa_hostkey | grep -v '<'|sed -e 's/&lt;/</' -e 's/&gt;/>/' -e 's/&amp;/&/' -e 's/&quot/"/' -e "s/&apos;/'/" > /etc/ssh/ssh_host_ecdsa_key
MYCONT=`cat /etc/ssh/ssh_host_ecdsa_key`
done
chmod 600 /etc/ssh/ssh_host_ecdsa_key
if ! grep "PRIVATE KEY" /etc/ssh/ssh_host_ecdsa_key > /dev/null 2>&1 ; then
rm /etc/ssh/ssh_host_ecdsa_key
else
ssh-keygen -y -f /etc/ssh/ssh_host_ecdsa_key > /etc/ssh/ssh_host_ecdsa_key.pub
chmod 644 /etc/ssh/ssh_host_ecdsa_key.pub
chown root /etc/ssh/ssh_host_ecdsa_key.pub
fi
else
#This is an error message
ERR_MSG=`sed -n 's%.*<error>\(.*\)</error>.*%\1%p' /tmp/ssh_ecdsa_hostkey`
logger -t xCAT -p local4.err Error: $ERR_MSG
fi
rm /tmp/ssh_ecdsa_hostkey
fi
if [[ $NTYPE = service ]]; then
mkdir -p /etc/xcat/hostkeys
cp /etc/ssh/ssh* /etc/xcat/hostkeys/.
+9 -4
View File
@@ -11,8 +11,8 @@
# routeop replace net mask gateway ifname #NOTE: it only works for sles so far
# net - IP of net like 192.168.1.0. The keyword
# 'default' is used to set the default route.
# mask - The length of the netmask (CIDR) like 8,16,24
# dotted-decimal format like 255.255.0.0 is not supported.
# mask - The length of the netmask (CIDR) like 8,16,24 OR
# the dotted-decimal format like 255.255.0.0
# gateway - The next hop. It could be set to 0.0.0.0 for omitting
# ifname - The interface to route to the next hop
#=head3 example
@@ -23,6 +23,12 @@
#=cut
#-------------------------------------------------------------------------------
if [ "$(uname -s|tr 'A-Z' 'a-z')" = "linux" ];then
str_dir_name=`dirname $0`
. $str_dir_name/xcatlib.sh
fi
op=$1
net=$2
@@ -881,8 +887,7 @@ elif [ "$op" = "delete" ]; then
rm_persistent_route $net $mask $gw $ifname
elif [ "$op" = "replace" ]; then
if [ $nummask -ne 1 ]; then
echo "Error: [routeop replace] only supports the CIDR formatted netmask like 16, 24."
exit 1
mask=$(v4mask2prefix $mask)
fi
if echo $net | grep : 2>&1 1>/dev/null

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