Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ca7cc188a0 |
@@ -1,4 +1,14 @@
|
||||
xCAT - eXtreme Cloud Administration Toolkit
|
||||
|
||||
xCAT 2.8.5.1 is for Intel Haswell support for IBM m5 server.
|
||||
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
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
+3
-4
@@ -44,11 +44,10 @@ 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 and xCATsn have PCM specific configuration - conserver-xcat, syslinux-xcat
|
||||
# xCAT has PCM specific configuration - conserver-xcat, syslinux-xcat
|
||||
# xCAT-server has PCM specific configuration - RESTAPI(perl-JSON)
|
||||
# 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"
|
||||
PCMBUILD="xCAT xCAT-server"
|
||||
PCMLINK="perl-xCAT xCAT-client 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=""
|
||||
|
||||
@@ -4036,7 +4036,7 @@ sub parse_and_run_dsh
|
||||
{ # from sinv, discard this name
|
||||
undef @$nodes;
|
||||
}
|
||||
if (@$nodes[0])
|
||||
if (@$nodes)
|
||||
{
|
||||
my $rsp = {};
|
||||
$rsp->{error}->[0] =
|
||||
@@ -4407,14 +4407,6 @@ 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
|
||||
@@ -4513,7 +4505,7 @@ sub parse_and_run_dcp
|
||||
#
|
||||
# build list of nodes
|
||||
my @nodelist;
|
||||
if (@$nodes[0])
|
||||
if (@$nodes)
|
||||
{ # there are nodes
|
||||
@nodelist = @$nodes;
|
||||
$options{'nodes'} = join(',', @nodelist);
|
||||
|
||||
+29
-71
@@ -52,10 +52,10 @@ my @query_array = ();
|
||||
my %param_list_map = (
|
||||
'vmcpus' => 'part_get_lpar_processing',
|
||||
'vmmemory' => 'part_get_lpar_memory',
|
||||
'add_physlots' => 'part_get_all_io_bus_info',
|
||||
'vmphyslots' => 'part_get_all_io_bus_info',
|
||||
'del_physlots' => 'part_get_all_io_bus_info',
|
||||
'add_vmnics' => 'part_get_all_vio_info',
|
||||
'add_vmstorage' => 'part_get_all_vio_info',
|
||||
'vmnics' => 'part_get_all_vio_info',
|
||||
'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 add_physlots vmothersetting add_vmstorage add_vmnics del_vadapter del_physlots);
|
||||
my @support_ops = qw(vmcpus vmmemory vmphyslots vmothersetting vmstorage 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 "add_vmstorage") {
|
||||
} elsif ($cmd eq "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 "add_physlots") {
|
||||
} elsif ($cmd eq "vmphyslots") {
|
||||
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 "add_vmnics") {
|
||||
} elsif ($cmd eq "vmnics") {
|
||||
my @tmp_array = split ",", $value;
|
||||
foreach (@tmp_array) {
|
||||
unless (/^vlan\d+$/i) {
|
||||
@@ -801,27 +801,14 @@ 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 "add_physlots" or $op eq "del_physlots") {
|
||||
} elsif ($op eq "vmphyslots" or $op eq "del_physlots") {
|
||||
$action = "set_io_slot_owner_uber";
|
||||
} elsif ($op eq "del_vadapter") {
|
||||
$action = "part_clear_vslot_config";
|
||||
} elsif ($op eq "add_vmnics") {
|
||||
} elsif ($op eq "vmnics") {
|
||||
my @vlans = split /,/,$param;
|
||||
foreach (@vlans) {
|
||||
if (/vlan(\d+)/i) {
|
||||
@@ -840,7 +827,7 @@ sub do_op_extra_cmds {
|
||||
}
|
||||
}
|
||||
next;
|
||||
} elsif ($op eq "add_vmstorage") {
|
||||
} elsif ($op eq "vmstorage") {
|
||||
foreach my $v_info (@$param) {
|
||||
if ($v_info =~ /(\d+),([\w_-]*):(\d+)/) {
|
||||
my $vios = &find_lpar_id($request, @$d[3], $2);
|
||||
@@ -891,11 +878,7 @@ 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") {
|
||||
if (@$ret[2]) {
|
||||
return ([[@$ret]]);
|
||||
} else {
|
||||
push @values, $ret;
|
||||
}
|
||||
return ([[@$ret]]);
|
||||
}
|
||||
$param = $memhash->{memory};
|
||||
$action = "part_set_lpar_pending_mem";
|
||||
@@ -1695,7 +1678,7 @@ sub xCATdB {
|
||||
$profile,
|
||||
$parent );
|
||||
|
||||
return( xCAT::PPCdb::add_ppc( $hwtype, [$values],'','',"FSP" ));
|
||||
return( xCAT::PPCdb::add_ppc( $hwtype, [$values] ));
|
||||
}
|
||||
return undef;
|
||||
}
|
||||
@@ -2077,12 +2060,9 @@ 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_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]);
|
||||
}
|
||||
if ($cur > $cur_avail) {
|
||||
my $new_cur = $cur_avail;
|
||||
$lparhash->{memory} = "$min/$new_cur/$max";
|
||||
}
|
||||
} else {
|
||||
return ([$name, "Failed to get hypervisor reserved memory regions.", 1]);
|
||||
@@ -2120,7 +2100,6 @@ 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);
|
||||
@@ -2133,7 +2112,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");
|
||||
@@ -2144,7 +2123,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})) {
|
||||
@@ -2160,7 +2139,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]]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2170,7 +2149,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]]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2201,23 +2180,19 @@ 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") {
|
||||
if (@$values[2]) {
|
||||
&set_lpar_undefined($request, $name, $d);
|
||||
return ([[@$values]]);
|
||||
} else {
|
||||
push @ret, $values;
|
||||
}
|
||||
&set_lpar_undefined($request, $name, $d);
|
||||
return ([@$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");
|
||||
@@ -2232,11 +2207,9 @@ 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]]);
|
||||
}
|
||||
push @ret, [$name, "Done", 0];
|
||||
#return ([$name, "Done", 0]);
|
||||
return \@ret;
|
||||
return ([$name, "Done", 0]);
|
||||
}
|
||||
|
||||
sub mkspeclpar {
|
||||
@@ -2259,12 +2232,11 @@ 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})) {
|
||||
@@ -2300,23 +2272,11 @@ 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;
|
||||
@@ -2423,7 +2383,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;
|
||||
@@ -2466,17 +2426,15 @@ 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;
|
||||
}
|
||||
|
||||
Executable → Regular
+1
-11
@@ -217,17 +217,7 @@ sub is_me
|
||||
#my ($b1, $b2, $b3, $b4) = split /\./, $nameIP;
|
||||
|
||||
# get all the possible IPs for the node I'm running on
|
||||
# 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 $ipcmd = "ip addr | grep 'inet'";
|
||||
my $result = xCAT::Utils->runcmd($ipcmd, -1, 1);
|
||||
if ($::RUNCMD_RC != 0)
|
||||
{
|
||||
|
||||
Executable → Regular
+1
-1
@@ -2634,7 +2634,7 @@ sub lparnetbootexp
|
||||
sub {
|
||||
$rc = 2;
|
||||
$rconsole->clear_accum();
|
||||
nc_msg(1, "Please make sure rcons $node works.\n");
|
||||
nc_msg($verbose, "Please make sure rcons $node works.\n");
|
||||
}
|
||||
],
|
||||
);
|
||||
|
||||
@@ -21,6 +21,7 @@ sub parse_args {
|
||||
my %opt = ();
|
||||
my $cmd = $request->{command};
|
||||
my $args = $request->{arg};
|
||||
my @VERSION = qw( 2.1 );
|
||||
|
||||
#############################################
|
||||
# Responds with usage statement
|
||||
@@ -59,8 +60,7 @@ sub parse_args {
|
||||
# Option -v for version
|
||||
####################################
|
||||
if ( exists( $opt{v} )) {
|
||||
my $version = xCAT::Utils->Version();
|
||||
return ([$version]);
|
||||
return( \@VERSION );
|
||||
}
|
||||
|
||||
if ( exists( $opt{s} ) ){
|
||||
@@ -350,27 +350,6 @@ 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;
|
||||
}
|
||||
|
||||
|
||||
@@ -75,7 +75,6 @@ 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 = ();
|
||||
###################################
|
||||
@@ -120,12 +119,7 @@ sub add_ppc {
|
||||
|
||||
# Specify CEC and Frame's mgt as fsp and bpa
|
||||
if ( $type =~ /^cec$/) {
|
||||
if ( $callfile eq "PPC" ) {
|
||||
$mgt = "hmc";
|
||||
}
|
||||
if ( $callfile eq "FSP" ) {
|
||||
$mgt = "fsp";
|
||||
}
|
||||
$mgt = "fsp";
|
||||
}
|
||||
if ( $type =~ /^frame$/) {
|
||||
$mgt = "bpa";
|
||||
@@ -326,7 +320,7 @@ sub update_lpar {
|
||||
}
|
||||
}
|
||||
if (defined($write)) {
|
||||
&add_ppc($hwtype, \@write_list,'','',"FSP");
|
||||
&add_ppc($hwtype, \@write_list);
|
||||
return ([@update_list,@write_list]);
|
||||
} else {
|
||||
foreach ( @tabs ) {
|
||||
|
||||
+19
-14
@@ -296,37 +296,42 @@ 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 $node;
|
||||
my $node1;
|
||||
my $msg1;
|
||||
while (<NMAP>) {
|
||||
#print "$_\n";
|
||||
if (/Host (.*) \((.*)\) appears to be up/) {
|
||||
$node=$2;
|
||||
unless ($deadnodes{$node}) {
|
||||
$node1=$2;
|
||||
unless ($deadnodes{$node1}) {
|
||||
foreach (keys %deadnodes) {
|
||||
if ($node =~ /^$_\./) {
|
||||
$node = $_;
|
||||
if ($node1 =~ /^$_\./) {
|
||||
$node1 = $_;
|
||||
last;
|
||||
}
|
||||
}
|
||||
}
|
||||
delete $deadnodes{$node};
|
||||
delete $deadnodes{$node1};
|
||||
if ($verbose) {
|
||||
push @return_msg, [$node, $_, 0];
|
||||
}
|
||||
push(@pingable_hcp, $node);
|
||||
} elsif (/Nmap scan report for ([^ ]*)/) {
|
||||
$node=$1;
|
||||
push(@pingable_hcp, $node1);
|
||||
} elsif (/Nmap scan report for ([^ ]*) \((.*)\)/) {
|
||||
$node1=$2;
|
||||
$msg1=$_;
|
||||
} elsif (/Host is up./) {
|
||||
unless ($deadnodes{$node}) {
|
||||
unless ($deadnodes{$node1}) {
|
||||
foreach (keys %deadnodes) {
|
||||
if ($node =~ /^$_\./) {
|
||||
$node = $_;
|
||||
if ($node1 =~ /^$_\./) {
|
||||
$node1 = $_;
|
||||
last;
|
||||
}
|
||||
}
|
||||
}
|
||||
delete $deadnodes{$node};
|
||||
push(@pingable_hcp, $node);
|
||||
delete $deadnodes{$node1};
|
||||
if ($verbose) {
|
||||
push @return_msg, [$node, "$msg1$_", 0];
|
||||
}
|
||||
push(@pingable_hcp, $node1);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -144,16 +144,12 @@ 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};
|
||||
# }
|
||||
#}
|
||||
$server = xCAT::NetworkUtils::getNodeIPaddress( $server );
|
||||
unless ($server) {
|
||||
return( "Unable to get IP address for $server" );
|
||||
my $hosttab = xCAT::Table->new( 'hosts' );
|
||||
if ( $hosttab) {
|
||||
my $hostshash = $hosttab->getNodeAttribs( $server, [qw(ip otherinterfaces)]);
|
||||
if ( $hostshash ) {
|
||||
$server = $hostshash->{ip};
|
||||
}
|
||||
}
|
||||
# my $serverip = inet_ntoa(inet_aton($server));
|
||||
my $url = "https://$server/cgi-bin/cgi?form=2";
|
||||
|
||||
@@ -411,7 +411,7 @@ sub format_output {
|
||||
# Strip errors for results
|
||||
#######################################
|
||||
my @val = grep( !/^#.*: ERROR /, @$values );
|
||||
xCAT::PPCdb::add_ppc( $hwtype, \@val,'','',"PPC" );
|
||||
xCAT::PPCdb::add_ppc( $hwtype, \@val );
|
||||
}
|
||||
|
||||
###########################################
|
||||
|
||||
@@ -1913,7 +1913,7 @@ sub xCATdB {
|
||||
$profile,
|
||||
$parent );
|
||||
|
||||
return( xCAT::PPCdb::add_ppc( $hwtype, [$values],'','',"PPC" ));
|
||||
return( xCAT::PPCdb::add_ppc( $hwtype, [$values] ));
|
||||
}
|
||||
return undef;
|
||||
}
|
||||
|
||||
@@ -655,38 +655,6 @@ 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
|
||||
@@ -722,7 +690,6 @@ sub get_nodes_profiles
|
||||
{
|
||||
my $class = shift;
|
||||
my $nodelistref = shift;
|
||||
my $groupnamemode = shift;
|
||||
my %profile_dict;
|
||||
|
||||
my $nodelisttab = xCAT::Table->new('nodelist');
|
||||
@@ -742,12 +709,8 @@ sub get_nodes_profiles
|
||||
if ( $idx == 2 ){
|
||||
# The group string will like @NetworkProfile_<profile name>
|
||||
# So, index should +3, 2 for '__', 1 for _.
|
||||
if ($groupnamemode) {
|
||||
$profile_dict{$_}{$profile} = $group;
|
||||
} else{
|
||||
my $append_index = length($profile) + 3;
|
||||
$profile_dict{$_}{$profile} = substr $group, $append_index;
|
||||
}
|
||||
my $append_index = length($profile) + 3;
|
||||
$profile_dict{$_}{$profile} = substr $group, $append_index;
|
||||
last;
|
||||
}
|
||||
}
|
||||
@@ -776,7 +739,7 @@ sub get_imageprofile_prov_method
|
||||
|
||||
my $nodetypestab = xCAT::Table->new('nodetype');
|
||||
my $entry = ($nodetypestab->getAllAttribsWhere("node = '$imgprofilename'", 'ALL' ))[0];
|
||||
return $entry->{'provmethod'};
|
||||
my $osimgname = $entry->{'provmethod'};
|
||||
|
||||
#my $osimgtab = xCAT::Table->new('osimage');
|
||||
#my $osimgentry = ($osimgtab->getAllAttribsWhere("imagename = '$osimgname'", 'ALL' ))[0];
|
||||
@@ -837,10 +800,13 @@ 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, ['os','arch']);
|
||||
my $os = $nodetypeentry->{'os'};
|
||||
my $nodetypeentry = $nodetypetab->getNodeAttribs($imageprofile, ['arch']);
|
||||
my $arch = $nodetypeentry->{'arch'};
|
||||
$nodetypetab->close();
|
||||
|
||||
@@ -881,13 +847,6 @@ 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."
|
||||
@@ -901,11 +860,6 @@ 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' ) {
|
||||
@@ -1185,70 +1139,3 @@ 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);
|
||||
}
|
||||
|
||||
@@ -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'}, peername=>$peername, callback=>$args{reqcallback});
|
||||
my $result = process_slp_packet(packet=>$slpkg,sockaddr=>$pkg,'socket'=>$args{'socket'});
|
||||
if ($result) {
|
||||
if ($peername =~ /\./) { #ipv4
|
||||
$peername =~ s/::ffff://;
|
||||
@@ -371,10 +371,9 @@ 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} && 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
|
||||
if ($parsedpacket->{attributes}) { #service reply had ext
|
||||
|
||||
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);
|
||||
|
||||
+10
-68
@@ -650,8 +650,7 @@ sub decode_spd {
|
||||
8 => "DDR2 SDRAM",
|
||||
9 => "DDR2 SDRAM FB-DIMM",
|
||||
10 => "DDR2 SDRAM FB-DIMM PROBE",
|
||||
11 => "DDR3 SDRAM",
|
||||
12 => "DDR4 SDRAM",
|
||||
11 => "DDR3 SDRAM"
|
||||
);
|
||||
|
||||
my %modtypes = (
|
||||
@@ -669,35 +668,33 @@ sub decode_spd {
|
||||
1333 => 10600,
|
||||
1600 => 12800,
|
||||
1867 => 14900,
|
||||
2132 => 17000,
|
||||
2133 => 17000,
|
||||
2134 => 17000,
|
||||
);
|
||||
|
||||
my %ddrmodcap = (
|
||||
my %ddr3modcap = (
|
||||
0 => 256,
|
||||
1 => 512,
|
||||
2 => 1024,
|
||||
3 => 2048,
|
||||
4 => 4096,
|
||||
5 => 8192,
|
||||
6 => 16384,
|
||||
7 => 32768,
|
||||
6 => 16384
|
||||
);
|
||||
|
||||
my %ddrdevwidth = (
|
||||
my %ddr3devwidth = (
|
||||
0 => 4,
|
||||
1 => 8,
|
||||
2 => 16,
|
||||
3 => 32
|
||||
);
|
||||
my %ddrranks = (
|
||||
my %ddr3ranks = (
|
||||
0 => 1,
|
||||
1 => 2,
|
||||
2 => 3,
|
||||
3 => 4
|
||||
);
|
||||
my %ddrbuswidth = (
|
||||
my %ddr3buswidth = (
|
||||
0 => 8,
|
||||
1 => 16,
|
||||
2 => 32,
|
||||
@@ -731,10 +728,10 @@ sub decode_spd {
|
||||
$rethash->{product}->{name} .= " ECC";
|
||||
}
|
||||
$rethash->{product}->{name}.=" ".$modtypes{$spd[3]&0x0f};
|
||||
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 $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 $capacity = $sdramcap/8*$buswidth/$sdramwidth*$ranks;
|
||||
@@ -772,61 +769,6 @@ 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";
|
||||
}
|
||||
|
||||
@@ -571,7 +571,7 @@ nodegroup => {
|
||||
},
|
||||
},
|
||||
nodehm => {
|
||||
cols => [qw(node power mgt cons termserver termport conserver serialport serialspeed serialflow getmac cmdmapping consoleondemand comments disable)],
|
||||
cols => [qw(node power mgt cons termserver termport conserver serialport serialspeed serialflow getmac cmdmapping 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,7 +588,6 @@ 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.",
|
||||
},
|
||||
@@ -1156,9 +1155,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. The default is no.\n".
|
||||
" xcatd, and retry. On a new install of xcat, this value will be set to yes.\n".
|
||||
" See the following document for details:\n".
|
||||
" Hints_and_Tips_for_Large_Scale_Clusters\n\n".
|
||||
" https://sourceforge.net/apps/mediawiki/xcat/index.php?title=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".
|
||||
@@ -1973,10 +1972,6 @@ 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 #
|
||||
|
||||
+8
-12
@@ -18,9 +18,8 @@ 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 [-h|--help|-v|--version]
|
||||
zVM specific:
|
||||
rnetboot <noderange> [ipl= address]",
|
||||
rnetboot <noderange> [ipl= address]
|
||||
rnetboot [-h|--help|-v|--version]",
|
||||
"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]
|
||||
@@ -28,12 +27,10 @@ my %usage = (
|
||||
rpower <noderange> [boot] [ -c <path to iso> ]
|
||||
PPC (with IVM or HMC) specific:
|
||||
rpower <noderange> [--nodeps] [of] [-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]
|
||||
PPC (HMC) specific:
|
||||
rpower <noderange> [onstandby] [-V|--verbose]
|
||||
CEC(using Direct FSP Management) specific:
|
||||
rpower <noderange> [on|onstandby|off|stat|state|resetsp]
|
||||
rpower <noderange> [on|onstandby|off|stat|state|lowpower|resetsp]
|
||||
Frame(using Direct FSP Management) specific:
|
||||
rpower <noderange> [stat|state|rackstandby|exit_rackstandby|resetsp]
|
||||
LPAR(using Direct FSP Management) specific:
|
||||
@@ -134,7 +131,7 @@ my %usage = (
|
||||
textid=<*>|
|
||||
frame=<*>|
|
||||
ntp=<[ntp],[ip],[frequency],[v3]>
|
||||
FSP/CEC (using ASM Interface) Specific:
|
||||
FSP/BPA Common:
|
||||
rspconfig <noderange> [autopower|iocap|decfg|memdecfg|procdecfg|time|date|spdump|sysdump|network|hostname]
|
||||
rspconfig <noderange> autopower=<enable|disable>|
|
||||
iocap=<enable|disable>|
|
||||
@@ -244,9 +241,8 @@ 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]
|
||||
[vmothersetting=hugepage:N,bsr:N]
|
||||
[add_physlots=drc_index1,drc_index2...]
|
||||
[add_vmnics=vlan1,vlan2] [add_vmstorage=<N|viosnode:slotid>] [--vios]
|
||||
[vmphyslots=drc_index1,drc_index2...] [vmothersetting=hugepage:N,bsr:N]
|
||||
[vmnics=vlan1,vlan2] [vmstorage=<N|viosnode:slotid>] [--vios]
|
||||
chvm <noderange> [del_physlots=drc_index1,drc_index2...]
|
||||
chvm <noderange> [del_vadapter=slotid]
|
||||
VMware specific:
|
||||
|
||||
Executable → Regular
+2
-165
@@ -2521,12 +2521,6 @@ 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";
|
||||
@@ -3542,98 +3536,6 @@ 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};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#--------------------------------------------------------------------------------
|
||||
|
||||
@@ -3674,19 +3576,12 @@ 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","ufw"],
|
||||
"firewall" => ["iptables","firewalld","SuSEfirewall2_setup","ufw"],
|
||||
"http" => ["apache2","httpd"],
|
||||
"ntpserver" =>["ntpd","ntp"],
|
||||
"mysql" => ["mysqld","mysql"],
|
||||
@@ -3700,7 +3595,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";
|
||||
@@ -3753,13 +3648,6 @@ sub startservice{
|
||||
$svcname=shift;
|
||||
}
|
||||
|
||||
my $retval=0;
|
||||
$retval=specialservicemgr($svcname,"start");
|
||||
if($retval != 127)
|
||||
{
|
||||
return $retval;
|
||||
}
|
||||
|
||||
my $cmd="";
|
||||
#for Systemd
|
||||
my $svcunit=undef;
|
||||
@@ -3824,16 +3712,6 @@ sub stopservice{
|
||||
$svcname=shift;
|
||||
}
|
||||
|
||||
|
||||
my $retval=0;
|
||||
$retval=specialservicemgr($svcname,"stop");
|
||||
if($retval != 127)
|
||||
{
|
||||
return $retval;
|
||||
}
|
||||
|
||||
|
||||
|
||||
my $cmd="";
|
||||
my $svcunit=undef;
|
||||
my $svcd=undef;
|
||||
@@ -3896,14 +3774,6 @@ sub restartservice{
|
||||
$svcname=shift;
|
||||
}
|
||||
|
||||
|
||||
my $retval=0;
|
||||
$retval=specialservicemgr($svcname,"restart");
|
||||
if($retval != 127)
|
||||
{
|
||||
return $retval;
|
||||
}
|
||||
|
||||
my $cmd="";
|
||||
my $svcunit=undef;
|
||||
my $svcd=undef;
|
||||
@@ -3974,18 +3844,6 @@ 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;
|
||||
@@ -4079,16 +3937,6 @@ sub enableservice{
|
||||
$svcname=shift;
|
||||
|
||||
}
|
||||
|
||||
my $retval=0;
|
||||
$retval=specialservicemgr($svcname,"enable");
|
||||
if($retval != 127)
|
||||
{
|
||||
return $retval;
|
||||
}
|
||||
|
||||
|
||||
|
||||
my $cmd="";
|
||||
my $svcunit=undef;
|
||||
my $svcd=undef;
|
||||
@@ -4155,17 +4003,6 @@ sub disableservice{
|
||||
$svcname=shift;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
my $retval=0;
|
||||
$retval=specialservicemgr($svcname,"disable");
|
||||
if($retval != 127)
|
||||
{
|
||||
return $retval;
|
||||
}
|
||||
|
||||
|
||||
my $cmd="";
|
||||
my $svcunit=undef;
|
||||
my $svcjob=undef;
|
||||
|
||||
@@ -18,7 +18,6 @@ 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",
|
||||
@@ -92,9 +91,8 @@ 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
|
||||
"1390839789.062069" => "SL6.5", #x86_64 DVD ISO Install
|
||||
"1273608367.051780" => "SL5.5", #x86_64 DVD ISO
|
||||
"1299104542.844706" => "SL6", #x86_64 DVD ISO
|
||||
);
|
||||
my %numdiscs = (
|
||||
"1156364963.862322" => 4,
|
||||
|
||||
@@ -1,88 +1,38 @@
|
||||
Eclipse Public License - v 1.0
|
||||
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
|
||||
Upstream-Name: xcat-openstack-baremetal
|
||||
Source: <url://example.com>
|
||||
|
||||
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.
|
||||
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>
|
||||
|
||||
1. DEFINITIONS
|
||||
# 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".
|
||||
|
||||
"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.
|
||||
|
||||
|
||||
# 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.
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -176,8 +176,7 @@ if ((!$imagename) && (!$os)){
|
||||
my @dircontents = `ls $installdir`;
|
||||
chomp(@dircontents);
|
||||
foreach (@dircontents) {
|
||||
# SL matches Scientific Linux, sl matches sles amd sled
|
||||
if($_ =~ /(rhel|fedora|SL|centos|sl|suse)/){
|
||||
if($_ =~ /(rhel|fedora|sl|centos|suse)/){
|
||||
push @oses,$_;
|
||||
}
|
||||
}
|
||||
|
||||
+164
-188
@@ -1,214 +1,190 @@
|
||||
#!/usr/bin/perl
|
||||
# IBM(c) 2007 EPL license http://www.eclipse.org/legal/epl-v10.html
|
||||
|
||||
|
||||
# Downloads/converts the xCAT docs on the sourceforge Allura wiki to local HTML and PDF.
|
||||
# Downloads/converts the xCAT docs on the sourceforge 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
|
||||
# curl, pandoc, and latex installed. See: http://sourceforge.net/p/xcat/wiki/Editing_and_Downloading_xCAT_Documentation/#converting-wiki-pages-to-html-and-pdfs
|
||||
|
||||
# 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 .
|
||||
|
||||
# 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:
|
||||
my $UPLOADUSER = 'mellor';
|
||||
# You also need to set $UPLOADUSER to your sourceforge user.
|
||||
|
||||
#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 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');
|
||||
#use Data::Dumper;
|
||||
|
||||
# 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 $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);
|
||||
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;
|
||||
}
|
||||
|
||||
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: $! $?";
|
||||
}
|
||||
|
||||
@@ -888,14 +888,15 @@ sub mysqlstart
|
||||
|
||||
} else { # it is mysql
|
||||
|
||||
if ($::linuxos =~ /rh.*/)
|
||||
{
|
||||
$ret=xCAT::Utils->startservice("mysqld");
|
||||
}
|
||||
else
|
||||
{ # sles
|
||||
$ret=xCAT::Utils->startservice("mysql");
|
||||
}
|
||||
#if ($::linuxos =~ /rh.*/)
|
||||
#{
|
||||
# $cmd = "service mysqld start";
|
||||
#}
|
||||
#else
|
||||
#{ # sles
|
||||
# $cmd = "service mysql start";
|
||||
#}
|
||||
$ret=xCAT::Utils->startservice("mysql");
|
||||
}
|
||||
}
|
||||
if ($ret != 0)
|
||||
@@ -1787,7 +1788,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
|
||||
|
||||
@@ -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
|
||||
|
||||
+9
-12
@@ -13,7 +13,7 @@ if [ "$os" == "AIX" ]; then
|
||||
export HOME
|
||||
fi
|
||||
|
||||
if [ -z "$1" ] || [ "$1" = "-h" ] || [ "$1" = "-help" ] || [ "$1" = "--help" ]; then
|
||||
if [ -z "$1" ] || [ "$1" = "-h" ]; then
|
||||
echo "rcons - remotely accesses the serial console of a node"
|
||||
echo "rcons <singlenode> [conserver] [-f]"
|
||||
echo "rcons <singlenode> [conserver] [-s]"
|
||||
@@ -66,17 +66,14 @@ 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
|
||||
# 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
|
||||
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
|
||||
else
|
||||
# ssl is not enabled, comment out the ssl settings in .consolerc
|
||||
if [ -f $HOME/.consolerc ]; then
|
||||
|
||||
@@ -23,9 +23,8 @@ 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<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<vmphyslots=drc_index1,drc_index2...>] [B<vmothersetting=hugepage:N,bsr:N>]
|
||||
[B<vmnics=vlan1[,vlan2..]]> [B<vmstorage=<N|viosnode:slotid>>] [B<--vios>]
|
||||
[B<del_physlots=drc_index1,drc_index2...>]
|
||||
[B<del_vadapter=slotid>]
|
||||
|
||||
@@ -115,7 +114,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<add_physlots>, I<vmothersetting>, I<add_vmnics> and/or I<add_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<vmphyslots>, I<vmothersetting>, I<vmnics> and/or I<vmstorage>. If nothing specified, nothing will be returned.
|
||||
|
||||
=head2 VMware/KVM specific:
|
||||
|
||||
@@ -199,11 +198,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<add_physlots=value> B<vmothersetting=value>
|
||||
=item B<vmcpus=value> B<vmmemory=value> B<vmphyslots=value> B<vmothersetting=value>
|
||||
|
||||
To specify the parameters that will be modified.
|
||||
|
||||
=item B<add_vmnics=value> B<add_vmstorage=value> [B<--vios>]
|
||||
=item B<vmnics=value> B<vmstorage=value> [B<--vios>]
|
||||
|
||||
To create new virtual adapter for the specified node.
|
||||
|
||||
@@ -510,7 +509,7 @@ The output is similar to:
|
||||
|
||||
To modify the resource assignment:
|
||||
|
||||
chvm lpar1 vmcpus=1/2/16 vmmemory=1G/8G/32G add_physlots=0x21010202
|
||||
chvm lpar1 vmcpus=1/2/16 vmmemory=1G/8G/32G vmphyslots=0x21010202
|
||||
|
||||
The output is similar to:
|
||||
|
||||
@@ -532,7 +531,7 @@ The resource information after modification is similar to:
|
||||
lpar1: 1/2/2
|
||||
lpar1: 128.
|
||||
|
||||
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>.
|
||||
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>.
|
||||
|
||||
=head2 VMware/KVM specific:
|
||||
|
||||
|
||||
@@ -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 the following doc:
|
||||
XCAT_NeXtScale_Clusters
|
||||
For more information on xCAT support of NeXtScale and configfpc see:
|
||||
https://sourceforge.net/apps/mediawiki/xcat/index.php?title=XCAT_NeXtScale_Clusters
|
||||
|
||||
=head1 OPTIONS
|
||||
|
||||
|
||||
@@ -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 the following doc: Setting_Up_DB2_as_the_xCAT_DB.
|
||||
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.
|
||||
|
||||
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.
|
||||
|
||||
@@ -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: Using_Linux_Driver_Update_Disk
|
||||
Refer to the doc: https://sourceforge.net/apps/mediawiki/xcat/index.php?title=Using_Linux_Driver_Update_Disk
|
||||
|
||||
=back
|
||||
|
||||
|
||||
@@ -26,14 +26,10 @@ 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 (using Direct FSP Management) specific:
|
||||
For PPC (without HMC, 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.
|
||||
|
||||
@@ -4,23 +4,19 @@ B<getxcatdocs> - downloads the xCAT documentation and converts to HTML and PDF
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
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>]
|
||||
B<getxcatdocs> [B<-?> | B<-h> | B<--help> | B<-v> | B<--version>] [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 http://sourceforge.net/p/xcat/wiki/XCAT_Documentation.
|
||||
download/convert the entire xCAT wiki - only the "official" xCAT documentation linked from https://sourceforge.net/apps/mediawiki/xcat/index.php?title=XCAT_Documentation .
|
||||
|
||||
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).
|
||||
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 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
|
||||
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 .
|
||||
|
||||
=head2 Limitations:
|
||||
|
||||
@@ -30,24 +26,24 @@ http://sourceforge.net/p/xcat/wiki/Editing_and_Downloading_xCAT_Documentation/#c
|
||||
|
||||
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|--verbose>
|
||||
=item B<-v|--version>
|
||||
|
||||
Run the command in verbose mode.
|
||||
Command Version.
|
||||
|
||||
=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
|
||||
|
||||
@@ -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 following doc:
|
||||
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 link below.
|
||||
https://sourceforge.net/apps/mediawiki/xcat/index.php?title=XCAT_Power_775_Hardware_Management
|
||||
|
||||
=head2 For KVM and Vmware
|
||||
|
||||
|
||||
@@ -68,13 +68,13 @@ To display all information:
|
||||
|
||||
Output is similar to:
|
||||
|
||||
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
|
||||
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
|
||||
|
||||
|
||||
=back
|
||||
|
||||
@@ -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
|
||||
Setting_Up_MySQL_as_the_xCAT_DB
|
||||
https://sourceforge.net/apps/mediawiki/xcat/index.php?title=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
|
||||
Setting_Up_MySQL_as_the_xCAT_DB
|
||||
https://sourceforge.net/apps/mediawiki/xcat/index.php?title=Setting_Up_MySQL_as_the_xCAT_DB
|
||||
|
||||
=item B<-L|--LL>
|
||||
|
||||
Additional database configuration specifically for the LoadLeveler product.
|
||||
See "Add ODBC Support" in
|
||||
Setting_Up_MySQL_as_the_xCAT_DB
|
||||
https://sourceforge.net/apps/mediawiki/xcat/index.php?title=Setting_Up_MySQL_as_the_xCAT_DB
|
||||
|
||||
=back
|
||||
|
||||
|
||||
@@ -128,11 +128,6 @@ 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:
|
||||
@@ -157,10 +152,6 @@ 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.
|
||||
|
||||
@@ -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 the following documentation: Setting_Up_PostgreSQL_as_the_xCAT_DB
|
||||
For more documentation see:https://sourceforge.net/apps/mediawiki/xcat/index.php?title=Setting_Up_PostgreSQL_as_the_xCAT_DB
|
||||
|
||||
=item B<-N|--nostart>
|
||||
|
||||
|
||||
@@ -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 following documentation to get more details:
|
||||
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 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
|
||||
|
||||
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:
|
||||
XCAT_Power_775_Hardware_Management
|
||||
https://sourceforge.net/apps/mediawiki/xcat/index.php?title=XCAT_Power_775_Hardware_Management#Updating_the_BPA_and_FSP_firmware_using_xCAT_DFM
|
||||
|
||||
=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 doc to get more details:
|
||||
XCAT_NeXtScale_Clusters
|
||||
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
|
||||
|
||||
|
||||
=head1 B<Options>
|
||||
|
||||
@@ -96,7 +96,7 @@ Retrieves deconfigured resources. Deconfigured resources are hw components (cpus
|
||||
|
||||
=item B<-x>
|
||||
|
||||
To output the raw information of deconfigured resources for CEC.
|
||||
To output the information of deconfigured resources in XML format.
|
||||
|
||||
=item B<asset>
|
||||
|
||||
@@ -223,7 +223,7 @@ To retrieve all information available from blade node4, enter:
|
||||
|
||||
=item *
|
||||
|
||||
To output the raw information of deconfigured resources for CEC cec01, enter:
|
||||
To output the information of deconfigured resources in XML format for CEC cec01, enter:
|
||||
|
||||
rinv cec01 deconfig -x
|
||||
|
||||
|
||||
@@ -8,8 +8,6 @@ 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>]
|
||||
|
||||
|
||||
|
||||
@@ -16,19 +16,17 @@ 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 CEC (with HMC) specific:
|
||||
=head2 PPC (with HMC) specific:
|
||||
|
||||
B<rpower> I<noderange> [B<on>|B<off>|B<reset>|B<boot>|B<onstandby>]
|
||||
B<rpower> I<noderange> [B<onstandby>]
|
||||
|
||||
=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>]
|
||||
B<rpower> I<noderange> [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<resetsp>]
|
||||
B<rpower> I<noderange> [B<on>|B<off>|B<lowpower>|B<resetsp>]
|
||||
|
||||
=head2 Frame (using Direct FSP Management) specific:
|
||||
|
||||
@@ -66,6 +64,10 @@ 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.
|
||||
|
||||
@@ -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
|
||||
the following doc: Using_Updatenode.
|
||||
https://sourceforge.net/apps/mediawiki/xcat/index.php?title=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:
|
||||
|
||||
Sync-ing_Config_Files_to_Nodes
|
||||
http://sourceforge.net/apps/mediawiki/xcat/index.php?title=Sync-ing_Config_Files_to_Nodes
|
||||
|
||||
|
||||
=head3 Run updatenode to synchronize the files
|
||||
@@ -111,7 +111,7 @@ Sync-ing_Config_Files_to_Nodes
|
||||
=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:
|
||||
Install_Additional_Packages
|
||||
https://sourceforge.net/apps/mediawiki/xcat/index.php?title=Install_Additional_Packages
|
||||
|
||||
To install/update the packages, run:
|
||||
|
||||
@@ -136,14 +136,11 @@ 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:
|
||||
XCAT_AIX_RTE_Diskfull_Nodes
|
||||
https://sourceforge.net/apps/mediawiki/xcat/index.php?title=XCAT_AIX_RTE_Diskfull_Nodes
|
||||
For diskless installs, read:
|
||||
XCAT_AIX_Diskless_Nodes
|
||||
https://sourceforge.net/apps/mediawiki/xcat/index.php?title=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
|
||||
@@ -345,8 +342,7 @@ 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.
|
||||
You must be running updatenode as root to use the -k flag.
|
||||
Update the ca and credentials to the service nodes. Never run this command to the Management Node, it will take down xcatd.
|
||||
|
||||
=item B<-l>|B<--user> I<user_ID>
|
||||
|
||||
@@ -366,7 +362,7 @@ be run during install. You should use updatenode <noderange> -F instead.
|
||||
|
||||
=item B<-S|--sw>
|
||||
|
||||
Specifies that node software should be updated. In Sysclone environment, specifies pushing the delta changes to target nodes.
|
||||
Specifies that node software should be updated.
|
||||
|
||||
=item B<-s|--sn>
|
||||
|
||||
@@ -571,12 +567,6 @@ 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
|
||||
|
||||
|
||||
@@ -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 Sync-ing_Config_Files_to_Nodes
|
||||
For more information on syncing files to node, read https://sourceforge.net/apps/mediawiki/xcat/index.php?title=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.
|
||||
|
||||
|
||||
@@ -91,16 +91,6 @@ 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
|
||||
|
||||
@@ -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>] [I<noderange>]
|
||||
B<makeconservercf> [B<-V|--verbose>] [B<-l|--local>]
|
||||
|
||||
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>
|
||||
|
||||
|
||||
@@ -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:
|
||||
read the following doc:Cluster_Name_Resolution
|
||||
https://sourceforge.net/apps/mediawiki/xcat/index.php?title=Cluster_Name_Resolution
|
||||
|
||||
=head1 OPTIONS
|
||||
|
||||
|
||||
@@ -13,8 +13,6 @@ 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
|
||||
@@ -117,14 +115,6 @@ 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
|
||||
|
||||
@@ -617,9 +617,4 @@ 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 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
|
||||
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
|
||||
|
||||
@@ -5,7 +5,3 @@ 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
|
||||
|
||||
@@ -53,10 +53,7 @@ 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}
|
||||
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
|
||||
mknb %{tarch}
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
@@ -41,4 +41,4 @@ cd -
|
||||
%Files
|
||||
%defattr(-,root,root)
|
||||
%doc LICENSE.html
|
||||
/opt/xcat/share/xcat/netboot/genesis/builder
|
||||
/
|
||||
|
||||
@@ -1,88 +1,36 @@
|
||||
Eclipse Public License - v 1.0
|
||||
Format: http://dep.debian.net/deps/dep5
|
||||
Upstream-Name: xcat-genesis-scripts
|
||||
Source: <url://example.com>
|
||||
|
||||
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.
|
||||
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>
|
||||
|
||||
1. DEFINITIONS
|
||||
# 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".
|
||||
|
||||
"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.
|
||||
|
||||
|
||||
# Please also look if there are files or directories which have a
|
||||
# different copyright/license attached and list them here.
|
||||
|
||||
@@ -67,7 +67,6 @@ 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
|
||||
|
||||
|
||||
@@ -1237,7 +1237,7 @@ sub resolve {
|
||||
#############################
|
||||
# Find MTMS in vpd database
|
||||
#############################
|
||||
if ( $att->{parent}) {
|
||||
if ( exists( $att->{parent} )) {
|
||||
my @attrs = qw(mtm serial);
|
||||
my ($vpd) = $tabs->{vpd}->getNodeAttribs($att->{parent},\@attrs);
|
||||
|
||||
@@ -2195,10 +2195,9 @@ sub process_request {
|
||||
#if( $request->{hwtype} ne 'hmc' ) {
|
||||
if( $request->{hwtype} !~ /hmc|ivm/ ) {
|
||||
$request->{fsp_api} = 1;
|
||||
#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') {
|
||||
#For using rspconfig to disable/enable dev/celogin1 through ASMI
|
||||
my $arg = $request->{arg};
|
||||
if($request->{command} eq "rspconfig" and grep(/^(dev|celogin1)/, @$arg)) {
|
||||
$request->{fsp_api} = 0;
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -1866,39 +1866,6 @@ 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;
|
||||
}
|
||||
|
||||
Executable → Regular
-17
@@ -53,7 +53,6 @@ sub getNodesetStates
|
||||
my @pxenodes = ();
|
||||
my @yabootnodes = ();
|
||||
my @xnbanodes= ();
|
||||
my @grub2nodes = ();
|
||||
my $tabdata = $tab->getNodesAttribs(\@nodes, ['node', 'netboot']);
|
||||
foreach my $node (@nodes)
|
||||
{
|
||||
@@ -76,10 +75,6 @@ sub getNodesetStates
|
||||
{
|
||||
push(@aixnodes, $node);
|
||||
}
|
||||
elsif ($nb eq "grub2")
|
||||
{
|
||||
push(@grub2nodes, $node);
|
||||
}
|
||||
}
|
||||
|
||||
my @retarray;
|
||||
@@ -136,18 +131,6 @@ 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, "");
|
||||
}
|
||||
|
||||
@@ -205,18 +205,23 @@ sub subvars {
|
||||
my $source_in_pre;
|
||||
my $c = 0;
|
||||
foreach my $pkgdir(@pkgdirs) {
|
||||
my $http = "http://#TABLE:noderes:\$NODE:nfsserver#$pkgdir";
|
||||
my $http2 = "http://'\$nextserver'$pkgdir";
|
||||
if ( $pkgdir =~ /^http/ ) {
|
||||
$http = $pkgdir;
|
||||
$http2 = $pkgdir;
|
||||
}
|
||||
if( $platform =~ /^(rh|SL|centos|fedora)$/ ) {
|
||||
if ( $c == 0 ) {
|
||||
# After some tests, if we put the repo in pre scripts in the kickstart like for rhels6.x
|
||||
# the rhels5.9 will not be installed successfully. So put in kickstart directly.
|
||||
$source_in_pre .= "echo 'url --url http://'\$nextserver'/$pkgdir' >> /tmp/repos";
|
||||
$source .= "url --url http://#TABLE:noderes:\$NODE:nfsserver#/$pkgdir\n"; #For rhels5.9
|
||||
$source_in_pre .= "echo 'url --url $http2 >> /tmp/repos";
|
||||
$source .= "url --url $http\n"; #For rhels5.9
|
||||
} else {
|
||||
$source_in_pre .= "\necho 'repo --name=pkg$c --baseurl=http://'\$nextserver'/$pkgdir' >> /tmp/repos";
|
||||
$source .= "repo --name=pkg$c --baseurl=http://#TABLE:noderes:\$NODE:nfsserver#/$pkgdir\n"; #for rhels5.9
|
||||
$source_in_pre .= "\necho 'repo --name=pkg$c --baseurl=$http2' >> /tmp/repos";
|
||||
$source .= "repo --name=pkg$c --baseurl=$http\n"; #for rhels5.9
|
||||
}
|
||||
} elsif ($platform =~ /^(sles|suse)/) {
|
||||
my $http = "http://#TABLE:noderes:\$NODE:nfsserver#$pkgdir";
|
||||
$source .= " <listentry>
|
||||
<media_url>$http</media_url>
|
||||
<product>SuSE-Linux-pkg$c</product>
|
||||
@@ -224,7 +229,7 @@ sub subvars {
|
||||
<ask_on_error config:type=\"boolean\">false</ask_on_error> <!-- available since openSUSE 11.0 -->
|
||||
<name>SuSE-Linux-pkg$c</name> <!-- available since openSUSE 11.1/SLES11 (bnc#433981) -->
|
||||
</listentry>";
|
||||
$source_in_pre .="<listentry><media_url>http://'\$nextserver'$pkgdir</media_url><product>SuSE-Linux-pkg$c</product><product_dir>/</product_dir><ask_on_error config:type=\"boolean\">false</ask_on_error><name>SuSE-Linux-pkg$c</name></listentry>";
|
||||
$source_in_pre .="<listentry><media_url>$http2</media_url><product>SuSE-Linux-pkg$c</product><product_dir>/</product_dir><ask_on_error config:type=\"boolean\">false</ask_on_error><name>SuSE-Linux-pkg$c</name></listentry>";
|
||||
}
|
||||
$c++;
|
||||
}
|
||||
@@ -671,9 +676,9 @@ sub kickstartnetwork {
|
||||
my $line = "network --onboot=yes --bootproto=";
|
||||
my $hoststab;
|
||||
my $mactab = xCAT::Table->new('mac',-create=>0);
|
||||
unless ($mactab) { $tmplerr ="mac table should always exist prior to template processing when doing autoula"; return;}
|
||||
unless ($mactab) { die "mac table should always exist prior to template processing when doing autoula"; }
|
||||
my $ent = $mactab->getNodeAttribs($node,['mac'],prefetchcache=>1);
|
||||
unless ($ent and $ent->{mac}) { $tmplerr ="missing mac data for $node"; return;}
|
||||
unless ($ent and $ent->{mac}) { die "missing mac data for $node"; }
|
||||
my $suffix = $ent->{mac};
|
||||
$suffix = lc($suffix);
|
||||
if ($::XCATSITEVALS{managedaddressmode} eq "autoula") {
|
||||
|
||||
@@ -2586,7 +2586,7 @@ sub setFINALattrs
|
||||
|
||||
# special case for the nic* attributes
|
||||
# merge nic*.eth0, nic*.eth1
|
||||
if (($::FILEATTRS{$objname}{objtype} eq 'node') || ($::FILEATTRS{$objname}{objtype} eq 'group'))
|
||||
if ($::FILEATTRS{$objname}{objtype} eq 'node')
|
||||
{
|
||||
xCAT::DBobjUtils->collapsenicsattr($::FILEATTRS{$objname}, $objname);
|
||||
}
|
||||
@@ -2647,7 +2647,7 @@ sub setFINALattrs
|
||||
unless(exists($::CLIATTRS{$objname})) {
|
||||
next;
|
||||
}
|
||||
if (($::CLIATTRS{$objname}{objtype} eq 'node') || ($::CLIATTRS{$objname}{objtype} eq 'group'))
|
||||
if ($::CLIATTRS{$objname}{objtype} eq 'node')
|
||||
{
|
||||
# Even if only the nicips.eth0 is specified with CLI,
|
||||
# need to read the whole nicips attribute from the nics table,
|
||||
|
||||
@@ -2196,13 +2196,6 @@ sub copycd
|
||||
$distname = "rhels5";
|
||||
}
|
||||
}
|
||||
elsif ($desc =~ /^Scientific Linux (\d)\.(\d)/)
|
||||
{
|
||||
unless ($distname)
|
||||
{
|
||||
$distname = "SL$1.$2";
|
||||
}
|
||||
}
|
||||
elsif ($desc =~ /^LTS$/)
|
||||
{
|
||||
unless ($distname)
|
||||
@@ -2237,13 +2230,10 @@ sub copycd
|
||||
|
||||
if($inspection)
|
||||
{
|
||||
my $retinfo="DISTNAME:$distname\n"."ARCH:$arch\n";
|
||||
if($dno) {
|
||||
$retinfo=$retinfo."DISCNO:$dno\n";
|
||||
}
|
||||
$callback->(
|
||||
{
|
||||
info =>"$retinfo"
|
||||
info =>
|
||||
"DISTNAME:$distname\n"."ARCH:$arch\n"."DISCNO:$dno\n"
|
||||
}
|
||||
);
|
||||
return;
|
||||
|
||||
Executable → Regular
+8
-21
@@ -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 [-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]
|
||||
" makeconservercf [-d|--delete] noderange
|
||||
makeconservercf [-l|--local]
|
||||
makeconservercf [-c|--conserver]
|
||||
makeconservercf
|
||||
makeconservercf -h|--help
|
||||
makeconservercf -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,7 +28,6 @@ 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.";
|
||||
@@ -278,10 +277,6 @@ 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";
|
||||
@@ -328,7 +323,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','consoleondemand']);
|
||||
@cfgents1 = $hmtab->getNodesAttribs($nodes,['node','cons','serialport','mgt','conserver','termserver','termport']);
|
||||
# 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)
|
||||
@@ -341,7 +336,7 @@ sub makeconservercf {
|
||||
@cfgents1 = @tmpcfgents1
|
||||
|
||||
} else {
|
||||
@cfgents1 = $hmtab->getAllNodeAttribs(['cons','serialport','mgt','conserver','termserver','termport','consoleondemand']);
|
||||
@cfgents1 = $hmtab->getAllNodeAttribs(['cons','serialport','mgt','conserver','termserver','termport']);
|
||||
}
|
||||
|
||||
|
||||
@@ -544,14 +539,6 @@ 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,17 +198,6 @@ 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") {
|
||||
|
||||
@@ -7,7 +7,6 @@ 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;
|
||||
|
||||
Executable → Regular
+1
@@ -397,6 +397,7 @@ 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]});
|
||||
|
||||
@@ -248,7 +248,7 @@ sub setstate {
|
||||
}
|
||||
|
||||
if ($nodemac =~ /:/) {
|
||||
my $tmp = lc($nodemac);
|
||||
my $tmp = $nodemac;
|
||||
$tmp =~ s/(..):(..):(..):(..):(..):(..)/$1-$2-$3-$4-$5-$6/g;
|
||||
my $pname = "grub.cfg-01-" . $tmp;
|
||||
unlink($tftpdir."/boot/grub2/".$pname);
|
||||
|
||||
@@ -1411,8 +1411,7 @@ sub addkit
|
||||
|
||||
if ( $hasplugin ) {
|
||||
# Issue xcatd reload to load the new plugins
|
||||
#system("/etc/init.d/xcatd restart");
|
||||
system("XCATRELOAD=yes xcatd -p /var/run/xcatd.pid");
|
||||
system("/etc/init.d/xcatd restart");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1732,8 +1731,7 @@ sub rmkit
|
||||
|
||||
if ( $hasplugin ) {
|
||||
# Issue xcatd reload to load the new plugins
|
||||
#system("/etc/init.d/xcatd restart");
|
||||
system("XCATRELOAD=yes xcatd -p /var/run/xcatd.pid");
|
||||
system("/etc/init.d/xcatd restart");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1090,30 +1090,6 @@ 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");
|
||||
@@ -1570,9 +1546,6 @@ 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 );
|
||||
|
||||
@@ -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,13 +246,6 @@ 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;
|
||||
@@ -446,8 +439,6 @@ 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);
|
||||
}
|
||||
|
||||
@@ -33,7 +33,6 @@ my %allhostnames;
|
||||
my %allbmcips;
|
||||
my %allmacs;
|
||||
my %allcecs;
|
||||
my %alllparids;
|
||||
my %allmacsupper;
|
||||
my %allips;
|
||||
my %allinstallips;
|
||||
@@ -426,10 +425,6 @@ 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);
|
||||
@@ -496,16 +491,6 @@ 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);
|
||||
@@ -550,75 +535,6 @@ 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);
|
||||
@@ -809,55 +725,38 @@ 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($networkprofile){
|
||||
$profile_groups .= $networkprofile . ",";
|
||||
if ($networkprofile ne $nodeoldprofiles{'networkprofile'}){
|
||||
if(exists $args_dict{'networkprofile'}){
|
||||
$profile_groups .= $args_dict{'networkprofile'}.",";
|
||||
if ($args_dict{'networkprofile'} ne $nodeoldprofiles{'networkprofile'}){
|
||||
$changeflag = 1;
|
||||
}else{
|
||||
xCAT::MsgUtils->message('S', "Specified networkprofile is same with current value, ignore.");
|
||||
$networkprofile = undef;
|
||||
delete($args_dict{'networkprofile'});
|
||||
}
|
||||
}
|
||||
if($hardwareprofile){
|
||||
$profile_groups .= $hardwareprofile . ",";
|
||||
if ($hardwareprofile ne $nodeoldprofiles{'hardwareprofile'}){
|
||||
if(exists $args_dict{'hardwareprofile'}){
|
||||
$profile_groups .= $args_dict{'hardwareprofile'}.",";
|
||||
if ($args_dict{'hardwareprofile'} ne $nodeoldprofiles{'hardwareprofile'}){
|
||||
$profile_status = 'defined';
|
||||
$changeflag = 1;
|
||||
}else{
|
||||
xCAT::MsgUtils->message('S', "Specified hardwareprofile is same with current value, ignore.");
|
||||
$hardwareprofile = undef;
|
||||
delete($args_dict{'hardwareprofile'});
|
||||
}
|
||||
}
|
||||
if($imageprofile){
|
||||
$profile_groups .= $imageprofile . ",";
|
||||
if ($imageprofile ne $nodeoldprofiles{'imageprofile'}){
|
||||
if(exists $args_dict{'imageprofile'}){
|
||||
$profile_groups .= $args_dict{'imageprofile'}.",";
|
||||
if ($args_dict{'imageprofile'} ne $nodeoldprofiles{'imageprofile'}){
|
||||
$profile_status = 'defined';
|
||||
$changeflag = 1;
|
||||
}else{
|
||||
xCAT::MsgUtils->message('S', "Specified imageprofile is same with current value, ignore.");
|
||||
$imageprofile = undef;
|
||||
delete($args_dict{'imageprofile'});
|
||||
}
|
||||
}
|
||||
# make sure there are something changed, otherwise we should quit without any changes.
|
||||
@@ -884,107 +783,48 @@ 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($networkprofile){
|
||||
my $newNetProfileName = $networkprofile;
|
||||
# As new design, ignore BMC/FSP NIC while reinstall nodes
|
||||
if(exists $args_dict{'networkprofile'}){
|
||||
my $newNetProfileName = $args_dict{'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", "reservenics=$reserveNics"], sequential=>[1]}, $request_command, 0, 2);
|
||||
$retref = xCAT::Utils->runxcmd({command=>["noderegenips"], node=>$nodes, arg=>["nics=$updateNics"], 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);
|
||||
}
|
||||
@@ -1011,7 +851,7 @@ Usage:
|
||||
setrsp_infostr($helpmsg);
|
||||
return;
|
||||
}
|
||||
my @enabledparams = ('nics', 'reservenics');
|
||||
my @enabledparams = ('nics');
|
||||
my $ret = validate_args($helpmsg, \@enabledparams);
|
||||
if (! $ret){
|
||||
return;
|
||||
@@ -1019,7 +859,6 @@ Usage:
|
||||
|
||||
my @updateNics = ();
|
||||
my @removedNics = ();
|
||||
my @reserveNics = ();
|
||||
my $netProfileName = '';
|
||||
my $netProfileNicsRef;
|
||||
my %freeIPsHash = ();
|
||||
@@ -1053,9 +892,6 @@ 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.
|
||||
@@ -1144,14 +980,6 @@ 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.",";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1181,6 +1009,65 @@ 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);
|
||||
}
|
||||
@@ -1321,59 +1208,20 @@ 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();
|
||||
|
||||
# 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.
|
||||
# Call Plugins.
|
||||
setrsp_progress("Configuring nodes...");
|
||||
my $retref = {};
|
||||
setrsp_progress("Updating DNS entries");
|
||||
$retref = xCAT::Utils->runxcmd({command=>["makedns"], node=>[$hostname], arg=>['-d']}, $request_command, 0, 2);
|
||||
my $retref = xCAT::Utils->runxcmd({command=>["kitnodeupdate"], node=>[$hostname], sequential=>[1]}, $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);
|
||||
@@ -1907,15 +1755,6 @@ 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;
|
||||
@@ -2060,10 +1899,23 @@ sub gen_new_hostinfo_dict{
|
||||
my $hardwareprofile = $args_dict{'hardwareprofile'};
|
||||
my $chain = $chaintab->getNodeAttribs($hardwareprofile, ['chain']);
|
||||
|
||||
$hostinfo_dict{$item}{"chain"} = $chainstr;
|
||||
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";
|
||||
}
|
||||
|
||||
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"};
|
||||
@@ -2157,9 +2009,6 @@ 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;
|
||||
}
|
||||
@@ -2317,12 +2166,11 @@ 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, CEC or switch + port.
|
||||
# Must specify either MAC or switch + port.
|
||||
if (exists $node_entry{"mac"} ||
|
||||
exists $node_entry{"switches"} ||
|
||||
exists $node_entry{"cec"}){
|
||||
exists $node_entry{"switches"} ){
|
||||
} else{
|
||||
$errmsg .= "MAC address, cec, switches is not specified. You must specify the MAC address, CEC name or switches.\n";
|
||||
$errmsg .= "MAC address or switches is not specified. You must specify the MAC address or switches.\n";
|
||||
}
|
||||
|
||||
if (! xCAT::NetworkUtils->isValidHostname($node_name)){
|
||||
@@ -2456,20 +2304,10 @@ 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{$_};
|
||||
|
||||
@@ -1,194 +0,0 @@
|
||||
# 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;
|
||||
}
|
||||
@@ -1057,7 +1057,7 @@ sub updatenode
|
||||
my $installdir = xCAT::TableUtils->getInstallDir();
|
||||
|
||||
#if the postscripts directory exists then make sure it is
|
||||
# world readable by root
|
||||
# world readable and executable by root
|
||||
my $postscripts = "$installdir/postscripts";
|
||||
if (-e $postscripts)
|
||||
{
|
||||
|
||||
@@ -289,7 +289,7 @@ sub setstate {
|
||||
}
|
||||
}
|
||||
if ($nodemac =~ /:/) {
|
||||
my $tmp =lc($nodemac);
|
||||
my $tmp = $nodemac;
|
||||
$tmp =~ s/(..):(..):(..):(..):(..):(..)/$1-$2-$3-$4-$5-$6/g;
|
||||
my $pname = "yaboot.conf-" . $tmp;
|
||||
unlink($tftpdir."/".$pname);
|
||||
|
||||
+19
-46
@@ -31,6 +31,7 @@ use Socket;
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Main
|
||||
|
||||
$::progname = "xcatconfig";
|
||||
my $args = join ' ', @ARGV;
|
||||
$::command = "$0 $args";
|
||||
@@ -915,12 +916,10 @@ 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 to the other nodes and the MN or SN to be able to ssh to the node
|
||||
Without known_hosts warning messages.
|
||||
node to ssh without password node to node.
|
||||
They are store in /etc/xcat/hostkeys on the MN.
|
||||
The public key is also installed in /install/postscripts/hostkeys
|
||||
This also includes some migration to /install/postscripts/hostkeys
|
||||
for the install process
|
||||
The private key is downloaded by remoteshell postscript using the credentials.pm interface
|
||||
|
||||
=cut
|
||||
|
||||
@@ -957,7 +956,7 @@ sub genSSHNodeHostKey
|
||||
}
|
||||
}
|
||||
|
||||
# remove the old keys from the /intall/postscripts/hostkeys directroy
|
||||
# remove the old keys
|
||||
if (-r $hostkey)
|
||||
{
|
||||
my $cmd = "/bin/rm $::INSTALLDIR/postscripts/hostkeys/ssh_host*";
|
||||
@@ -971,7 +970,7 @@ sub genSSHNodeHostKey
|
||||
}
|
||||
}
|
||||
|
||||
# remove the old keys from the /etc/xcat/hostkeys directory
|
||||
# remove the old keys
|
||||
if (-r $hostkey2)
|
||||
{
|
||||
my $cmd = "/bin/rm /etc/xcat/hostkeys/ssh_host*";
|
||||
@@ -1015,18 +1014,6 @@ 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 =
|
||||
@@ -1868,36 +1855,22 @@ sub setupLinuxexports
|
||||
#-----------------------------------------------------------------------------
|
||||
sub mknb
|
||||
{
|
||||
# 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 ...");
|
||||
}
|
||||
# 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 ...");
|
||||
#my $outref = xCAT::Utils->runcmd("$cmd", 0);
|
||||
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.");
|
||||
}
|
||||
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.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
+11
-59
@@ -716,8 +716,6 @@ sleep 0.05;
|
||||
|
||||
sub scan_plugins {
|
||||
my $serialdest = shift;
|
||||
my $rescan = shift;
|
||||
%cmd_handlers=();
|
||||
my @plugins=glob($plugins_dir."/*.pm");
|
||||
foreach (@plugins) {
|
||||
/.*\/([^\/]*).pm$/;
|
||||
@@ -753,16 +751,14 @@ sub scan_plugins {
|
||||
}
|
||||
}
|
||||
}
|
||||
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);
|
||||
foreach (@plugins) {
|
||||
no strict 'refs';
|
||||
/.*\/([^\/]*).pm$/;
|
||||
my $modname = $1;
|
||||
unless (defined(${"xCAT_plugin::".$modname."::"}{init_plugin})) {
|
||||
next;
|
||||
}
|
||||
${"xCAT_plugin::".$modname."::"}{init_plugin}->(\&do_request);
|
||||
}
|
||||
if ($serialdest) { store_fd(\%cmd_handlers,$serialdest); }; #print $serialdest freeze(\%cmd_handlers); };
|
||||
}
|
||||
@@ -932,17 +928,6 @@ 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;
|
||||
@@ -1041,14 +1026,6 @@ 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;
|
||||
@@ -1389,13 +1366,7 @@ sub plugin_command {
|
||||
dispatch_request($req,$callback,$modname);
|
||||
} else {
|
||||
$SIG{CHLD}='DEFAULT';
|
||||
# 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);
|
||||
}
|
||||
${"xCAT_plugin::".$modname."::"}{process_request}->($req,$callback,\&do_request);
|
||||
}
|
||||
$$progname=$oldprogname;
|
||||
}; #REMOVEEVALFORDEBUG
|
||||
@@ -1483,13 +1454,7 @@ sub plugin_command {
|
||||
dispatch_request($req,$callback,$modname);
|
||||
} else {
|
||||
$SIG{CHLD}='DEFAULT';
|
||||
# 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);
|
||||
}
|
||||
${"xCAT_plugin::".$modname."::"}{process_request}->($req,$callback,\&do_request);
|
||||
}
|
||||
$$progname=$oldprogname;
|
||||
$parent_fd = $org_parent_fd;
|
||||
@@ -1714,13 +1679,7 @@ sub dispatch_request {
|
||||
if ($onlyone and not ($_->{'_xcatdest'} and xCAT::NetworkUtils->thishostisnot($_->{'_xcatdest'}))) {
|
||||
$SIG{CHLD}='DEFAULT';
|
||||
if ($_->{'_xcatdelay'} and not ref $_->{'_xcatdelay'}) { sleep $_->{'_xcatdelay'}; }
|
||||
# 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);
|
||||
}
|
||||
${"xCAT_plugin::".$modname."::"}{process_request}->($_,$dispatch_cb,\&do_request);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1803,13 +1762,7 @@ sub dispatch_request {
|
||||
} else {
|
||||
$$progname.=": locally executing";
|
||||
$SIG{CHLD}='DEFAULT';
|
||||
# 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);
|
||||
}
|
||||
${"xCAT_plugin::".$modname."::"}{process_request}->($_,\&dispatch_callback,\&do_request);
|
||||
last;
|
||||
}
|
||||
}
|
||||
@@ -1843,7 +1796,6 @@ 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);
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
#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
|
||||
@@ -1,154 +0,0 @@
|
||||
#
|
||||
#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,4 +35,3 @@ mysql-connector-odbc
|
||||
perl-DBD-Pg
|
||||
wget
|
||||
util-linux-ng
|
||||
net-tools
|
||||
|
||||
@@ -26,4 +26,3 @@ 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 "/^#\s*postscripts-start-here/,/^#\s*postscripts-end-here/ s/\(.*\)/run_ps \1/;s/run_ps\s*#/#/;s/run_ps\s*$//" /xcatpost/mypostscript`
|
||||
TMP=`sed "/postscripts-start-here/,/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 "/^#\s*postbootscripts-start-here/,/^#\s*postbootscripts-end-here/ s/\(.*\)/run_ps \1/;s/run_ps\s*#/#/;s/run_ps\s*$//" /xcatpost/mypostscript`
|
||||
TMP=`sed "/postbootscripts-start-here/,/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 "/^#\s*postscripts-start-here/,/^#\s*postscripts-end-here/ d" /xcatpost/mypostscript`
|
||||
TMP=`sed "/postscripts-start-here/,/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 "/^#\s*postbootscripts-start-here/,/^#\s*postbootscripts-end-here/ d" /xcatpost/mypostscript`
|
||||
TMP=`sed "/postbootscripts-start-here/,/postbootscripts-end-here/ d" /xcatpost/mypostscript`
|
||||
echo "$TMP" > /xcatpost/mypostscript
|
||||
|
||||
export NODE=#TABLE:nodelist:THISNODE:node#
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
../rh/dracut
|
||||
@@ -0,0 +1 @@
|
||||
../rh/dracut
|
||||
@@ -20,6 +20,6 @@ e2fsprogs
|
||||
bc
|
||||
lsvpd
|
||||
irqbalance
|
||||
procps-ng
|
||||
procps
|
||||
parted
|
||||
net-tools
|
||||
|
||||
@@ -9,7 +9,7 @@ openssh-clients
|
||||
iputils
|
||||
bc
|
||||
irqbalance
|
||||
procps-ng
|
||||
procps
|
||||
wget
|
||||
vim-minimal
|
||||
ntp
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
bash
|
||||
nfs-common
|
||||
openssl
|
||||
isc-dhcp-client
|
||||
linux-image-server
|
||||
openssh-server
|
||||
openssh-client
|
||||
wget
|
||||
vim
|
||||
ntp
|
||||
rsyslog
|
||||
rsync
|
||||
busybox-static
|
||||
gawk
|
||||
@@ -68,7 +68,6 @@ my @apigroups = (
|
||||
my %formathdl = (
|
||||
text => \&outtext,
|
||||
wiki => \&outwiki,
|
||||
mediawiki => \&outmediawiki,
|
||||
);
|
||||
|
||||
|
||||
@@ -151,109 +150,11 @@ 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";
|
||||
@@ -363,9 +264,6 @@ sub gendoc {
|
||||
$format = "text";
|
||||
}
|
||||
|
||||
if ($format eq "wiki") {
|
||||
print "\n[TOC]\n";
|
||||
}
|
||||
|
||||
foreach my $group (@apigroups) {
|
||||
my $groupname = $group->{'groupname'};
|
||||
@@ -377,10 +275,6 @@ 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";
|
||||
}
|
||||
|
||||
@@ -201,31 +201,11 @@ sub setupSSH
|
||||
$msg = "aixremoteshell: Could not get ssh_host_rsa_key file.\n";
|
||||
`logger -t xcat -p local4.err $msg`;
|
||||
}
|
||||
# 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") {
|
||||
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 passwordless ssh between the nodes
|
||||
if ($enablesshbetweennodes eq "YES") {
|
||||
# Decide whether to enable ssh between the nodes
|
||||
if ($enablesshbetweennodes eq "YES") {
|
||||
my $response=&getresponse("ssh_root_key");
|
||||
if (defined ($response) ) {
|
||||
my $fd;
|
||||
@@ -236,6 +216,7 @@ sub setupSSH
|
||||
close($fd);
|
||||
|
||||
# set the permissions
|
||||
#TODO - what perms are needed???
|
||||
my $cmd = "chmod 600 $filename > /dev/null 2>&1";
|
||||
&runcmd($cmd);
|
||||
|
||||
@@ -246,8 +227,8 @@ sub setupSSH
|
||||
else {
|
||||
$msg = "aixremoteshell: Could not get id_rsa file.\n";
|
||||
`logger -t xcat -p local4.err $msg`;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -3,10 +3,9 @@
|
||||
|
||||
|
||||
|
||||
if [ "$(uname -s|tr 'A-Z' 'a-z')" = "linux" ];then
|
||||
str_dir_name=`dirname $0`
|
||||
. $str_dir_name/xcatlib.sh
|
||||
fi
|
||||
str_dir_name=`dirname $0`
|
||||
|
||||
. $str_dir_name/xcatlib.sh
|
||||
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
@@ -34,11 +34,9 @@
|
||||
# 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=
|
||||
|
||||
|
||||
# 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
|
||||
# locd library for network caculation
|
||||
str_dir_name=`dirname $0`
|
||||
. $str_dir_name/xcatlib.sh
|
||||
|
||||
# Subroutine to display message and pass it to syslog
|
||||
# Usage: showmsg "message to putput" ["error"]
|
||||
|
||||
@@ -1,12 +1,7 @@
|
||||
#!/bin/bash
|
||||
# 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=`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
|
||||
|
||||
function configipv4(){
|
||||
str_if_name=$1
|
||||
@@ -628,7 +623,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 | grep $str_nic_name | awk '{print $2}'`
|
||||
str_history=`ip addr show dev $str_nic_name | grep inet | grep -iv dynamic | grep -iv link | awk '{print $2}'`
|
||||
old_ifs=$IFS
|
||||
IFS=$'\n'
|
||||
array_ip_old_temp=($str_history)
|
||||
|
||||
@@ -73,48 +73,6 @@ 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();
|
||||
@@ -135,12 +93,12 @@ if (-f "/etc/redhat-release")
|
||||
# restart iptables
|
||||
#$cmd = "service iptables restart";
|
||||
#system($cmd);
|
||||
xCAT::Utils->restartservice("iptables");
|
||||
xCAT::Utils->restartservice("firewall");
|
||||
|
||||
# iptables should be stared on reboot
|
||||
#$cmd = "chkconfig iptables on";
|
||||
#system($cmd);
|
||||
xCAT::Utils->enableservice("iptables");
|
||||
xCAT::Utils->enableservice("firewall");
|
||||
}
|
||||
elsif (-f "/etc/SuSE-release")
|
||||
{
|
||||
@@ -183,14 +141,16 @@ elsif (-f "/etc/SuSE-release")
|
||||
# restart firewall
|
||||
#my $cmd = "service SuSEfirewall2_setup restart";
|
||||
#system($cmd);
|
||||
xCAT::Utils->restartservice("firewall");
|
||||
xCAT::Utils->restartservice("SuSEfirewall2_setup");
|
||||
|
||||
# SuSEfirewall2_setup should be stared on reboot
|
||||
#$cmd = "chkconfig SuSEfirewall2_init on";
|
||||
#system($cmd);
|
||||
#$cmd = "chkconfig SuSEfirewall2_setup on";
|
||||
#system($cmd);
|
||||
xCAT::Utils->enableservice("firewall");
|
||||
xCAT::Utils->enableservice("SuSEfirewall2_init");
|
||||
xCAT::Utils->enableservice("SuSEfirewall2_setup");
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/bin/sh
|
||||
# IBM(c) 2013 EPL license http://www.eclipse.org/legal/epl-v10.html
|
||||
# Internal script used by confignics only
|
||||
# xCAT post script for configuring ib adapters.
|
||||
|
||||
# xCAT post script for configuring ib adaptors.
|
||||
# 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='
|
||||
|
||||
if [ "$(uname -s|tr 'A-Z' 'a-z')" = "linux" ];then
|
||||
str_dir_name=`dirname $0`
|
||||
. $str_dir_name/xcatlib.sh
|
||||
fi
|
||||
|
||||
str_dir_name=`dirname $0`
|
||||
|
||||
. $str_dir_name/xcatlib.sh
|
||||
|
||||
#This is the number of ports for each ib adpator.
|
||||
portnum=1
|
||||
|
||||
@@ -1,23 +1,7 @@
|
||||
#!/bin/bash
|
||||
# IBM(c) 2014 EPL license http://www.eclipse.org/legal/epl-v10.html
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
#=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
|
||||
str_dir_name=`dirname $0`
|
||||
. $str_dir_name/xcatlib.sh
|
||||
|
||||
#the nics' information contain:
|
||||
#1. ip address
|
||||
@@ -122,7 +106,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
|
||||
@@ -300,7 +284,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|m)[0-9a-z]+'` ];then
|
||||
if [ `echo $key | grep -E 'e(n|th)[0-9a-z]+'` ];then
|
||||
str_nic_type="ethernet"
|
||||
elif [ `echo $key | grep -E 'ib[0-9]+'` ];then
|
||||
str_nic_type="infiniband"
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
#/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
|
||||
@@ -4,11 +4,9 @@
|
||||
#
|
||||
|
||||
|
||||
if [ "$(uname -s|tr 'A-Z' 'a-z')" = "linux" ];then
|
||||
str_dir_name=`dirname $0`
|
||||
. $str_dir_name/xcatlib.sh
|
||||
fi
|
||||
str_dir_name=`dirname $0`
|
||||
|
||||
. $str_dir_name/xcatlib.sh
|
||||
|
||||
# create /etc/sysconfig/network-scripts/
|
||||
pmatch ()
|
||||
@@ -213,16 +211,7 @@ EOF
|
||||
mv ${oldremount}.bak $oldremount
|
||||
fi
|
||||
else
|
||||
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
|
||||
if (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
|
||||
|
||||
@@ -2,10 +2,9 @@
|
||||
# IBM(c) 2013 EPL license http://www.eclipse.org/legal/epl-v10.html
|
||||
|
||||
|
||||
if [ "$(uname -s|tr 'A-Z' 'a-z')" = "linux" ];then
|
||||
str_dir_name=`dirname $0`
|
||||
. $str_dir_name/xcatlib.sh
|
||||
fi
|
||||
str_dir_name=`dirname $0`
|
||||
|
||||
. $str_dir_name/xcatlib.sh
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
#=head1 install_puppet_server
|
||||
|
||||
@@ -10,19 +10,11 @@
|
||||
# And do whatever is necessary on ubuntu.
|
||||
|
||||
if [[ -f /sbin/dracut ]]; then
|
||||
# redhat6.x/centos6.x
|
||||
# redhat/centos
|
||||
echo "Running dracut to regenerate the initrd with the drivers needed by this node:"
|
||||
dracut --force
|
||||
else
|
||||
# suse/sles and redhat5.x/centos5.x
|
||||
# suse/sles
|
||||
echo "Running mkinitrd to regenerate the initrd with the drivers needed by this node:"
|
||||
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
|
||||
mkinitrd
|
||||
fi
|
||||
|
||||
@@ -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_ecdsa_key (if supported)
|
||||
# ssh_host_dsa_key,ssh_host_rsa_key
|
||||
# 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,10 +13,9 @@
|
||||
# if on the Management Node, exit
|
||||
|
||||
|
||||
if [ "$(uname -s|tr 'A-Z' 'a-z')" = "linux" ];then
|
||||
str_dir_name=`dirname $0`
|
||||
. $str_dir_name/xcatlib.sh
|
||||
fi
|
||||
str_dir_name=`dirname $0`
|
||||
|
||||
. $str_dir_name/xcatlib.sh
|
||||
|
||||
if [ -e /etc/xCATMN ]; then
|
||||
logger -t xcat -p local4.info "remoteshell:Running on the Management Node , exiting "
|
||||
@@ -88,7 +87,6 @@ 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"
|
||||
@@ -155,7 +153,6 @@ 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"
|
||||
@@ -167,7 +164,6 @@ 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/</</' -e 's/>/>/' -e 's/&/&/' -e 's/"/"/' -e "s/'/'/" > /tmp/ssh_rsa_hostkey
|
||||
|
||||
#check whether the message is an error or not
|
||||
@@ -221,75 +217,6 @@ 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/</</' -e 's/>/>/' -e 's/&/&/' -e 's/"/"/' -e "s/'/'/" > /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/</</' -e 's/>/>/' -e 's/&/&/' -e 's/"/"/' -e "s/'/'/" > /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/.
|
||||
|
||||
@@ -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 OR
|
||||
# the dotted-decimal format like 255.255.0.0
|
||||
# mask - The length of the netmask (CIDR) like 8,16,24
|
||||
# dotted-decimal format like 255.255.0.0 is not supported.
|
||||
# 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,12 +23,6 @@
|
||||
#=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
|
||||
@@ -887,7 +881,8 @@ elif [ "$op" = "delete" ]; then
|
||||
rm_persistent_route $net $mask $gw $ifname
|
||||
elif [ "$op" = "replace" ]; then
|
||||
if [ $nummask -ne 1 ]; then
|
||||
mask=$(v4mask2prefix $mask)
|
||||
echo "Error: [routeop replace] only supports the CIDR formatted netmask like 16, 24."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if echo $net | grep : 2>&1 1>/dev/null
|
||||
|
||||
@@ -2,11 +2,9 @@
|
||||
# example on how to set up ESX. We setup ssh and also add a basic
|
||||
# VLAN configuration
|
||||
|
||||
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
|
||||
|
||||
logger -t xcat -p local4.info setupesx
|
||||
# Enable SSH access to root and exchange keys
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user