From 8ad7e70aea3008d8c37c3066ca759148f226a49f Mon Sep 17 00:00:00 2001 From: ertaozh Date: Thu, 14 Sep 2017 04:25:23 -0400 Subject: [PATCH 01/17] Modify the ip/bmc ip setting mistakes in mtm based discovery document --- .../mtms/discovery_using_defined.rst | 22 ++++++++-------- .../discovery/mtms/discovery_using_dhcp.rst | 25 +++++++++---------- 2 files changed, 23 insertions(+), 24 deletions(-) diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms/discovery_using_defined.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms/discovery_using_defined.rst index f12aa1354..9ea41fc17 100644 --- a/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms/discovery_using_defined.rst +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms/discovery_using_defined.rst @@ -12,7 +12,7 @@ The following example outlines the MTMS based hardware discovery for a single IP +------------------------------+------------+ | Hostname | cn01 | +------------------------------+------------+ -| IP address | 10.1.2.1 | +| IP address | 10.0.101.1 | +------------------------------+------------+ The BMC IP address is obtained by the open range dhcp server and the plan in this scenario is to change the IP address for the BMC to a static IP address in a different subnet than the open range addresses. The static IP address in this example is in the same subnet as the open range to simplify the networking configuration on the xCAT management node. @@ -20,9 +20,9 @@ The BMC IP address is obtained by the open range dhcp server and the plan in thi +------------------------------+------------+ | BMC Information | Value | +==============================+============+ -| IP address - dhcp | 172.30.0.1 | +| IP address - dhcp | 50.0.100.1 | +------------------------------+------------+ -| IP address - static | 172.20.2.1 | +| IP address - static | 50.0.101.1 | +------------------------------+------------+ #. Detect the BMCs and add the node definitions into xCAT. @@ -44,9 +44,9 @@ The BMC IP address is obtained by the open range dhcp server and the plan in thi Use the ``bmcdiscover`` command to help discover the nodes over an IP range and easily create a starting file to define the compute nodes into xCAT. - To discover the compute nodes for the BMCs with an IP address of 172.30.0.1, use the command: :: + To discover the compute nodes for the BMCs with an IP address of 50.0.100.1, use the command: :: - bmcdiscover --range 172.30.0.1 -z > predefined.stanzas + bmcdiscover --range 50.0.100.1 -z > predefined.stanzas The discovered nodes have the naming convention: node-<*model-type*>-<*serial-number*> :: @@ -54,7 +54,7 @@ The BMC IP address is obtained by the open range dhcp server and the plan in thi node-8247-22l-10112ca: objtype=node groups=all - bmc=172.30.0.1 + bmc=50.0.100.1 cons=ipmi mgt=ipmi mtm=8247-22L @@ -73,7 +73,7 @@ The BMC IP address is obtained by the open range dhcp server and the plan in thi #. Add a ``ip`` attribute and give it the compute node IP address: :: - ip=10.1.2.1 + ip=10.0.101.1 #. Remove ``nodetype`` and ``hwtype`` if defined in the ``predefined.stanza``. @@ -86,12 +86,12 @@ The BMC IP address is obtained by the open range dhcp server and the plan in thi cn01: objtype=node groups=all - bmc=172.30.0.1 + bmc=50.0.100.1 cons=ipmi mgt=ipmi mtm=8247-22L serial=10112CA - ip=10.1.2.1 + ip=10.0.101.1 #. Define the compute nodes into xCAT: :: @@ -109,9 +109,9 @@ The BMC IP address is obtained by the open range dhcp server and the plan in thi Set the BMC IP address to a different value for the **predefined** compute node definitions. - To change the dhcp obtained IP address of 172.30.0.1 to a static IP address of 172.20.2.1, run the following command: :: + To change the dhcp obtained IP address of 50.0.100.1 to a static IP address of 50.0.101.1, run the following command: :: - chdef cn01 bmc=172.20.2.1 + chdef cn01 bmc=50.0.101.1 #. Add the compute node IP information to ``/etc/hosts``: :: diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms/discovery_using_dhcp.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms/discovery_using_dhcp.rst index 3634c067b..5b22af650 100644 --- a/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms/discovery_using_dhcp.rst +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/discovery/mtms/discovery_using_dhcp.rst @@ -12,7 +12,7 @@ The following example outlines the MTMS based hardware discovery for a single IP +------------------------------+------------+ | Hostname | cn01 | +------------------------------+------------+ -| IP address | 10.1.2.1 | +| IP address | 10.0.101.1 | +------------------------------+------------+ The BMC IP address is obtained by the open range dhcp server and the plan is to leave the IP address the same, except we want to change the IP address to be static in the BMC. @@ -20,9 +20,9 @@ The BMC IP address is obtained by the open range dhcp server and the plan is to +------------------------------+------------+ | BMC Information | Value | +==============================+============+ -| IP address - dhcp | 172.30.0.1 | +| IP address - dhcp | 50.0.100.1 | +------------------------------+------------+ -| IP address - static | 172.30.0.1 | +| IP address - static | 50.0.100.1 | +------------------------------+------------+ @@ -30,9 +30,9 @@ The BMC IP address is obtained by the open range dhcp server and the plan is to Use the ``bmcdiscover`` command to help discover the nodes over an IP range and easily create a starting file to define the compute nodes into xCAT. - To discover the compute nodes for the BMCs with an IP address of 172.30.0.1, use the command: :: + To discover the compute nodes for the BMCs with an IP address of 50.0.100.1, use the command: :: - bmcdiscover --range 172.30.0.1 -z > predefined.stanzas + bmcdiscover --range 50.0.100.1 -z > predefined.stanzas The discovered nodes have the naming convention: node-<*model-type*>-<*serial-number*> :: @@ -40,7 +40,7 @@ The BMC IP address is obtained by the open range dhcp server and the plan is to node-8247-22l-10112ca: objtype=node groups=all - bmc=172.30.0.1 + bmc=50.0.100.1 cons=ipmi mgt=ipmi mtm=8247-22L @@ -59,7 +59,7 @@ The BMC IP address is obtained by the open range dhcp server and the plan is to #. Add a ``ip`` attribute and give it the compute node IP address: :: - ip=10.1.2.1 + ip=10.0.101.1 #. Repeat for additional nodes in the ``predefined.stanza`` file based on the MTMS mapping. @@ -70,13 +70,16 @@ The BMC IP address is obtained by the open range dhcp server and the plan is to cn01: objtype=node groups=all - bmc=172.30.0.1 + bmc=50.0.100.1 cons=ipmi mgt=ipmi mtm=8247-22L serial=10112CA - ip=10.1.2.1 + ip=10.0.101.1 +#. Define the compute nodes into xCAT: :: + + cat predefined.stanzas | mkdef -z #. Set the chain table to run the ``bmcsetup`` script, this will set the BMC IP to static. :: @@ -86,10 +89,6 @@ The BMC IP address is obtained by the open range dhcp server and the plan is to chdef cn01 -p chain="osimage=" -#. Define the compute nodes into xCAT: :: - - cat predefined.stanzas | mkdef -z - #. Add the compute node IP information to ``/etc/hosts``: :: makehosts cn01 From bf9a96014018de6827798cd69f8ef1a1f75175c6 Mon Sep 17 00:00:00 2001 From: Samveen Gulati Date: Mon, 18 Sep 2017 12:24:59 +0000 Subject: [PATCH 02/17] xHRM: fix minor code bug --- xCAT-server/share/xcat/scripts/xHRM | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-server/share/xcat/scripts/xHRM b/xCAT-server/share/xcat/scripts/xHRM index a4cb41592..d85549cdb 100755 --- a/xCAT-server/share/xcat/scripts/xHRM +++ b/xCAT-server/share/xcat/scripts/xHRM @@ -265,7 +265,7 @@ elif [ "bridgeprereq" = "$1" ]; then nwdir="/etc/network/interfaces.d" isDebian=1 getcap /usr/bin/qemu-system-x86_64 | grep cap_net_admin - if [ $? ne 0 ];then + if [ $? -ne 0 ];then setcap cap_net_admin=ei /usr/bin/qemu-system-x86_64 fi else From 553cdd59d0e2bad6ead0e464fc80373392243aa8 Mon Sep 17 00:00:00 2001 From: XuWei Date: Wed, 20 Sep 2017 01:24:05 -0400 Subject: [PATCH 03/17] reventlog clear for OpenBMC --- xCAT-server/lib/xcat/plugins/openbmc.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index dfcd11a89..5676a28d0 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -138,8 +138,8 @@ my %status_info = ( }, REVENTLOG_CLEAR_REQUEST => { method => "POST", - init_url => "$openbmc_project_url/logging//action/delete", - data => '{ "data": [] }', + init_url => "$openbmc_project_url/logging/action/deleteAll", + data => "[]", }, REVENTLOG_CLEAR_RESPONSE => { process => \&reventlog_response, @@ -788,8 +788,6 @@ sub parse_command_status { if ($subcommand eq "clear") { $next_status{LOGIN_RESPONSE} = "REVENTLOG_CLEAR_REQUEST"; $next_status{REVENTLOG_CLEAR_REQUEST} = "REVENTLOG_CLEAR_RESPONSE"; - xCAT::SvrUtils::sendmsg("Command $command is not available now!", $callback); - return 1; } else { $next_status{LOGIN_RESPONSE} = "REVENTLOG_REQUEST"; $next_status{REVENTLOG_REQUEST} = "REVENTLOG_RESPONSE"; @@ -1631,12 +1629,14 @@ sub reventlog_response { my $count = 0; if ($option_s) { + xCAT::SvrUtils::sendmsg("$::NO_ATTRIBUTES_RETURNED", $callback, $node) if (!%output); foreach my $key ( sort { $b <=> $a } keys %output) { xCAT::MsgUtils->message("I", { data => ["$node: $output{$key}"] }, $callback) if ($output{$key}); $count++; last if ($entry_string ne "all" and $count >= $entry_num); } } else { + xCAT::SvrUtils::sendmsg("$::NO_ATTRIBUTES_RETURNED", $callback, $node) if (!%output); foreach my $key (sort keys %output) { xCAT::MsgUtils->message("I", { data => ["$node: $output{$key}"] }, $callback) if ($output{$key}); $count++; From 570daf3fa47e6c43e942245bba522844b5b5ebbd Mon Sep 17 00:00:00 2001 From: hu-weihua Date: Wed, 20 Sep 2017 01:37:21 -0400 Subject: [PATCH 04/17] Fix typo in test case --- xCAT-test/autotest/testcase/rpower/cases0 | 7 ++++++- xCAT-test/xcattest | 4 ++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/xCAT-test/autotest/testcase/rpower/cases0 b/xCAT-test/autotest/testcase/rpower/cases0 index 94fde2054..de57555fa 100644 --- a/xCAT-test/autotest/testcase/rpower/cases0 +++ b/xCAT-test/autotest/testcase/rpower/cases0 @@ -145,7 +145,8 @@ cmd:rpower $$CN onstandby cmd:a=0;while ! `rpower $$CN stat|grep "standby\|Standby" >/dev/null`; do sleep 5;((a++));if [ $a -gt 11 ];then break;fi done check:ouptut=~standby|Standby end -start:rpower__wrongpasswd + +start:rpower_wrongpasswd description:rpower ipmi and openbmc using wrong passwd Attribute: $$CN-The operation object of rpower command cmd:/opt/xcat/share/xcat/tools/autotest/testcase/rpower/rpower_wrongpasswd_test.sh -pt $$CN $$rightbmcpasswd $$rightbmcusername @@ -157,21 +158,25 @@ check:rc==0 cmd:/opt/xcat/share/xcat/tools/autotest/testcase/rpower/rpower_wrongpasswd_test.sh -c $$CN check:rc==0 end + start:rpower_suspend_OpenpowerBmc cmd:rpower $$CN suspend check:output=~Error: unsupported command rpower suspend for OpenPOWER check:rc==1 end + start:rpower_softoff_OpenpowerBmc cmd:rpower $$CN softoff check:output=~Error: unsupported command rpower softoff for OpenPOWER check:rc==1 end + start:rpower_wake_OpenpowerBmc cmd:rpower $$CN wake check:output=~Error: unsupported command rpower wake for OpenPOWER check:rc==1 end + start:rpower_errorcommand_OpenpowerBmc cmd:rpower $$CN ddd check:output=~Unsupported command: diff --git a/xCAT-test/xcattest b/xCAT-test/xcattest index f7e1f7450..5bb76bb13 100755 --- a/xCAT-test/xcattest +++ b/xCAT-test/xcattest @@ -1182,18 +1182,18 @@ sub run_case { #to run single line command + log_this($running_log_fd, "RUN:$cmd->[0] [$runstartstr]"); $cmd->[0] = getfunc($cmd->[0]); @output = &runcmd($cmd->[0]); $rc = $::RUNCMD_RC; - log_this($running_log_fd, "RUN:$cmd->[0] [$runstartstr]"); push(@caselog, "RUN:$cmd->[0] [$runstartstr]"); } else { #to run multiple lines command + log_this($running_log_fd, "RUN: [$runstartstr]", @{$cmd}); @output = runscript($cmd); $rc = $::RUNCMD_RC; - log_this($running_log_fd, "RUN: [$runstartstr]", @{$cmd}); push(@caselog, ("RUN: [$runstartstr]", @{$cmd})); } From 46ebe37f182a3f3f09b2384a6dc37d53edf86f97 Mon Sep 17 00:00:00 2001 From: XuWei Date: Wed, 20 Sep 2017 02:50:19 -0400 Subject: [PATCH 05/17] modify rpower reset to hard reset for OpenBMC --- xCAT-server/lib/xcat/plugins/openbmc.pm | 72 +++++++++++++++---------- 1 file changed, 45 insertions(+), 27 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index dfcd11a89..7c2ccca17 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -240,11 +240,6 @@ my %status_info = ( init_url => "$openbmc_project_url/state/host0/attr/RequestedHostTransition", data => "xyz.openbmc_project.State.Host.Transition.Off", }, - RPOWER_RESET_REQUEST => { - method => "PUT", - init_url => "$openbmc_project_url/state/host0/attr/RequestedHostTransition", - data => "xyz.openbmc_project.State.Host.Transition.Reboot", - }, RPOWER_RESET_RESPONSE => { process => \&rpower_response, }, @@ -703,19 +698,24 @@ sub parse_command_status { $next_status{LOGIN_RESPONSE} = "RPOWER_SOFTOFF_REQUEST"; $next_status{RPOWER_SOFTOFF_REQUEST} = "RPOWER_OFF_RESPONSE"; } elsif ($subcommand eq "reset") { - $next_status{LOGIN_RESPONSE} = "RPOWER_RESET_REQUEST"; - $next_status{RPOWER_RESET_REQUEST} = "RPOWER_RESET_RESPONSE"; + $next_status{LOGIN_RESPONSE} = "RPOWER_STATUS_REQUEST"; + $next_status{RPOWER_STATUS_REQUEST} = "RPOWER_STATUS_RESPONSE"; + $next_status{RPOWER_STATUS_RESPONSE}{OFF} = "DO_NOTHING"; + $next_status{RPOWER_STATUS_RESPONSE}{ON} = "RPOWER_OFF_REQUEST"; + $next_status{RPOWER_OFF_REQUEST} = "RPOWER_OFF_RESPONSE"; + $next_status{RPOWER_OFF_RESPONSE} = "RPOWER_ON_REQUEST"; + $next_status{RPOWER_ON_REQUEST} = "RPOWER_ON_RESPONSE"; + $status_info{RPOWER_ON_RESPONSE}{argv} = "$subcommand"; } elsif ($subcommand =~ /^bmcstate$|^status$|^state$|^stat$/) { $next_status{LOGIN_RESPONSE} = "RPOWER_STATUS_REQUEST"; $next_status{RPOWER_STATUS_REQUEST} = "RPOWER_STATUS_RESPONSE"; $status_info{RPOWER_STATUS_RESPONSE}{argv} = "$subcommand"; } elsif ($subcommand eq "boot") { - $next_status{LOGIN_RESPONSE} = "RPOWER_STATUS_REQUEST"; - $next_status{RPOWER_STATUS_REQUEST} = "RPOWER_STATUS_RESPONSE"; - $next_status{RPOWER_STATUS_RESPONSE}{OFF} = "RPOWER_ON_REQUEST"; + $next_status{LOGIN_RESPONSE} = "RPOWER_OFF_REQUEST"; + $next_status{RPOWER_OFF_REQUEST} = "RPOWER_OFF_RESPONSE"; + $next_status{RPOWER_OFF_RESPONSE} = "RPOWER_ON_REQUEST"; $next_status{RPOWER_ON_REQUEST} = "RPOWER_ON_RESPONSE"; - $next_status{RPOWER_STATUS_RESPONSE}{ON} = "RPOWER_RESET_REQUEST"; - $next_status{RPOWER_RESET_REQUEST} = "RPOWER_RESET_RESPONSE"; + $status_info{RPOWER_ON_RESPONSE}{argv} = "$subcommand"; } elsif ($subcommand eq "bmcreboot") { $next_status{LOGIN_RESPONSE} = "RPOWER_BMCREBOOT_REQUEST"; $next_status{RPOWER_BMCREBOOT_REQUEST} = "RPOWER_RESET_RESPONSE"; @@ -1247,14 +1247,18 @@ sub rpower_response { if ($node_info{$node}{cur_status} eq "RPOWER_ON_RESPONSE") { if ($response_info->{'message'} eq $::RESPONSE_OK) { - xCAT::SvrUtils::sendmsg("$::POWER_STATE_ON", $callback, $node); + if ($status_info{RPOWER_ON_RESPONSE}{argv}) { + xCAT::SvrUtils::sendmsg("$::POWER_STATE_RESET", $callback, $node); + } else { + xCAT::SvrUtils::sendmsg("$::POWER_STATE_ON", $callback, $node); + } $new_status{$::STATUS_POWERING_ON} = [$node]; } } if ($node_info{$node}{cur_status} eq "RPOWER_OFF_RESPONSE") { if ($response_info->{'message'} eq $::RESPONSE_OK) { - xCAT::SvrUtils::sendmsg("$::POWER_STATE_OFF", $callback, $node); + xCAT::SvrUtils::sendmsg("$::POWER_STATE_OFF", $callback, $node) if (!$next_status{ $node_info{$node}{cur_status} }); $new_status{$::STATUS_POWERING_OFF} = [$node]; } } @@ -1263,8 +1267,6 @@ sub rpower_response { if ($response_info->{'message'} eq $::RESPONSE_OK) { if (defined $status_info{RPOWER_RESET_RESPONSE}{argv} and $status_info{RPOWER_RESET_RESPONSE}{argv} =~ /bmcreboot$/) { xCAT::SvrUtils::sendmsg("BMC $::POWER_STATE_REBOOT", $callback, $node); - } else { - xCAT::SvrUtils::sendmsg("$::POWER_STATE_RESET", $callback, $node); } $new_status{$::STATUS_POWERING_ON} = [$node]; } @@ -1272,7 +1274,8 @@ sub rpower_response { xCAT_monitoring::monitorctrl::setNodeStatusAttributes(\%new_status, 1) if (%new_status); - if ($node_info{$node}{cur_status} eq "RPOWER_STATUS_RESPONSE" and !$next_status{ $node_info{$node}{cur_status} }) { + my $all_status; + if ($node_info{$node}{cur_status} eq "RPOWER_STATUS_RESPONSE") { my $bmc_state = ""; my $bmc_transition_state = ""; my $chassis_state = ""; @@ -1299,41 +1302,56 @@ sub rpower_response { xCAT::SvrUtils::sendmsg("BMC $bmc_short_state", $callback, $node); } else { if ($chassis_state =~ /Off$/) { - xCAT::SvrUtils::sendmsg("$::POWER_STATE_OFF", $callback, $node); + xCAT::SvrUtils::sendmsg("$::POWER_STATE_OFF", $callback, $node) if (!$next_status{ $node_info{$node}{cur_status} }); + $all_status = $::POWER_STATE_OFF; } elsif ($chassis_state =~ /On$/) { if ($host_state =~ /Off$/) { # State is off, but check if it is transitioning if ($host_transition_state =~ /On$/) { #xCAT::SvrUtils::sendmsg("$::POWER_STATE_POWERING_ON", $callback, $node); # ignore transition state until get stable firmware - xCAT::SvrUtils::sendmsg("$::POWER_STATE_OFF", $callback, $node); + xCAT::SvrUtils::sendmsg("$::POWER_STATE_OFF", $callback, $node) if (!$next_status{ $node_info{$node}{cur_status} }); + $all_status = $::POWER_STATE_OFF; } else { - xCAT::SvrUtils::sendmsg("$::POWER_STATE_OFF", $callback, $node); + xCAT::SvrUtils::sendmsg("$::POWER_STATE_OFF", $callback, $node) if (!$next_status{ $node_info{$node}{cur_status} }); + $all_status = $::POWER_STATE_OFF; } } elsif ($host_state =~ /Quiesced$/) { - xCAT::SvrUtils::sendmsg("$::POWER_STATE_QUIESCED", $callback, $node); + xCAT::SvrUtils::sendmsg("$::POWER_STATE_QUIESCED", $callback, $node) if (!$next_status{ $node_info{$node}{cur_status} }); + $all_status = $::POWER_STATE_ON; } elsif ($host_state =~ /Running$/) { # State is on, but check if it is transitioning if ($host_transition_state =~ /Off$/) { #xCAT::SvrUtils::sendmsg("$::POWER_STATE_POWERING_OFF", $callback, $node); # ignore transition state until get stable firmware - xCAT::SvrUtils::sendmsg("$::POWER_STATE_ON", $callback, $node); + xCAT::SvrUtils::sendmsg("$::POWER_STATE_ON", $callback, $node) if (!$next_status{ $node_info{$node}{cur_status} }); + $all_status = $::POWER_STATE_ON; } else { - xCAT::SvrUtils::sendmsg("$::POWER_STATE_ON", $callback, $node); + xCAT::SvrUtils::sendmsg("$::POWER_STATE_ON", $callback, $node) if (!$next_status{ $node_info{$node}{cur_status} }); + $all_status = $::POWER_STATE_ON; } } else { - xCAT::SvrUtils::sendmsg("Unexpected host state=$host_state", $callback, $node); + xCAT::SvrUtils::sendmsg("Unexpected host state=$host_state", $callback, $node) if (!$next_status{ $node_info{$node}{cur_status} }); + $all_status = $::POWER_STATE_ON; } } else { - xCAT::SvrUtils::sendmsg("Unexpected chassis state=$chassis_state", $callback, $node); + xCAT::SvrUtils::sendmsg("Unexpected chassis state=$chassis_state", $callback, $node) if (!$next_status{ $node_info{$node}{cur_status} }); + $all_status = $::POWER_STATE_ON; } } } if ($next_status{ $node_info{$node}{cur_status} }) { if ($node_info{$node}{cur_status} eq "RPOWER_STATUS_RESPONSE") { - if ($response_info->{'data'}->{CurrentHostState} =~ /Off$/) { - $node_info{$node}{cur_status} = $next_status{ $node_info{$node}{cur_status} }{OFF}; + if ($all_status eq "$::POWER_STATE_OFF") { + if ($next_status{ $node_info{$node}{cur_status} }{OFF} eq "DO_NOTHING") { + xCAT::SvrUtils::sendmsg("$::POWER_STATE_RESET", $callback, $node); + $node_info{$node}{cur_status} = ""; + $wait_node_num--; + return; + } else { + $node_info{$node}{cur_status} = $next_status{ $node_info{$node}{cur_status} }{OFF}; + } } else { $node_info{$node}{cur_status} = $next_status{ $node_info{$node}{cur_status} }{ON}; } From 4410d4e282d792590737b514f25041db3af9c7c7 Mon Sep 17 00:00:00 2001 From: ertaozh Date: Wed, 20 Sep 2017 02:51:02 -0400 Subject: [PATCH 06/17] enhance switchdiscover to deal with finding nodes hash --- .../lib/xcat/plugins/switchdiscover.pm | 72 ++++--------------- 1 file changed, 13 insertions(+), 59 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/switchdiscover.pm b/xCAT-server/lib/xcat/plugins/switchdiscover.pm index c3a16ea61..46588cf74 100644 --- a/xCAT-server/lib/xcat/plugins/switchdiscover.pm +++ b/xCAT-server/lib/xcat/plugins/switchdiscover.pm @@ -339,74 +339,28 @@ sub process_request { @scan_types = @{$globalopt{scan_types}}; } - my $all_result; + my %username_hash = (); + $result = undef; foreach my $st (@scan_types) { no strict; my $fn = $global_scan_type{$st}; my $tmp_result = &$fn(\%request, $callback); if (ref($tmp_result) eq 'HASH') { - $all_result->{$st} = $tmp_result; - } - } - - #consolidate the results by merging the swithes with the same ip or same mac - my $result; - my $merged; - my $counter=0; - foreach my $st (keys %$all_result) { - my $tmp_result = $all_result->{$st}; - #send_msg( \%request, 1, Dumper($tmp_result)); - foreach my $old_mac (keys %$tmp_result) { - $same = 0; - foreach my $new_mac (keys %$result) { - my $old_ip = $tmp_result->{$old_mac}->{ip}; - my $old_name = $tmp_result->{$old_mac}->{name}; - my $old_vendor = $tmp_result->{$old_mac}->{vendor}; - my $new_ip = $result->{$new_mac}->{ip}; - my $new_name = $result->{$new_mac}->{name}; - my $new_vendor = $result->{$new_mac}->{vendor}; - my $key =$new_mac; - - if (($old_mac eq $new_mac) || - ($old_ip && ($old_ip eq $new_ip))) { - $same = 1; - if ($new_mac =~ /nomac/) { - if ($old_mac =~ /nomac/) { - $key = "nomac_$counter"; - $counter++; - } else { - $key = $old_mac; - } - } - if ($old_ip) { - $result->{$key}->{ip} = $old_ip; - } - $result->{$key}->{vendor} = $new_vendor; - if ($old_vendor) { - if ($old_vendor ne $new_vendor) { - $result->{$key}->{vendor} .= " " . $old_vendor; - } else { - $result->{$key}->{vendor} = $old_vendor; - } - } - - if ($key ne $new_mac) { - delete $result->{$new_mac}; - } - } - if ( $old_name && ($old_name eq $new_name)) { - #appending mac address to end of hostname - my $mac_str = lc($old_mac); + foreach (keys %$tmp_result) { + $result->{$_} = $tmp_result->{$_}; + #appending mac address to end of hostname + my $name = $result->{$_}->{name}; + if (exists $username_hash{$name}) { + my $mac_str = lc($_); $mac_str =~ s/\://g; - $result->{$key}->{name} = "$old_name-$mac_str"; + $result->{$_}->{name} = "$name-$mac_str"; + } else { + $username_hash{$name} = 1; } - } - if (!$same) { - $result->{$old_mac} = $tmp_result->{$old_mac}; - } + } } } - + if (!($result)) { send_msg( \%request, 0, " No $device found "); return; From 5c532433a8e3bf30c6a8036120bbe883c072f6c0 Mon Sep 17 00:00:00 2001 From: chenglch Date: Wed, 20 Sep 2017 19:11:31 +0800 Subject: [PATCH 07/17] Do not check the directory if pUpdate is not used fix-issue: #3972 --- xCAT-server/lib/xcat/plugins/ipmi.pm | 44 ++++++++++++---------------- 1 file changed, 19 insertions(+), 25 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/ipmi.pm b/xCAT-server/lib/xcat/plugins/ipmi.pm index 5bf64ea70..77cfdab7e 100644 --- a/xCAT-server/lib/xcat/plugins/ipmi.pm +++ b/xCAT-server/lib/xcat/plugins/ipmi.pm @@ -1970,24 +1970,6 @@ sub do_firmware_update { } } } - - if (defined $directory_name) { - unless (File::Spec->file_name_is_absolute($directory_name)) { - # Directory name was passed in as relative path, prepend current working dir - $directory_name = xCAT::Utils->full_path($directory_name, $::cwd); - } - # directory was passed in, verify it is valid - if (-d $directory_name) { - # Passed in directory name exists - $pUpdate_directory = $directory_name; - } - else { - $exit_with_error_func->($sessdata->{node}, $callback, "Can not access data directory $directory_name"); - } - } - else { - $exit_with_error_func->($sessdata->{node}, $callback, "Data directory must be specified."); - } } # For IBM Power S822LC for Big Data (Supermicro) machines such as @@ -1996,11 +1978,23 @@ sub do_firmware_update { # specified data directory along with the update files .bin for BMC or .pnor for Host if ($output =~ /8001-22C|9006-22C|5104-22C|9006-12C/) { # Verify valid data directory was specified - unless ($pUpdate_directory) { - $exit_with_error_func->($sessdata->{node}, $callback, - "Directory name is required to update Boston or Briggs machines."); + if (defined $directory_name) { + unless (File::Spec->file_name_is_absolute($directory_name)) { + # Directory name was passed in as relative path, prepend current working dir + $directory_name = xCAT::Utils->full_path($directory_name, $::cwd); + } + # directory was passed in, verify it is valid + if (-d $directory_name) { + # Passed in directory name exists + $pUpdate_directory = $directory_name; + } + else { + $exit_with_error_func->($sessdata->{node}, $callback, "Can not access data directory $directory_name"); + } + } + else { + $exit_with_error_func->($sessdata->{node}, $callback, "Directory name is required to update IBM Power S822LC for Big Data machines."); } - # Verify specified directory contains pUpdate utility unless (-e "$pUpdate_directory/pUpdate") { $exit_with_error_func->($sessdata->{node}, $callback, @@ -2126,7 +2120,7 @@ sub do_firmware_update { $exit_with_error_func->($sessdata->{node}, $callback, "Running ipmitool command $cmd failed: $output"); } - my $grs_version = $output =~ /OP8_v(\d*\.\d*_\d*\.\d*)/; + my $grs_version = $output =~ /OP8_.*v(\d*\.\d*_\d*\.\d*)/; if ($grs_version =~ /\d\.(\d+)_(\d+\.\d+)/) { my $prim_grs_version = $1; my $sec_grs_version = $2; @@ -2148,7 +2142,7 @@ sub do_firmware_update { "Running ipmitool command $cmd failed: $output"); } # Check what firmware version is currently running on the machine - if ($output =~ /OP8_v\d\.\d+_(\d+)\.\d+/) { + if ($output =~ /OP8_.*v\d\.\d+_(\d+)\.\d+/) { my $frs_version = $1; if ($frs_version == 1) { $firestone_update_version = "810"; @@ -2189,7 +2183,7 @@ sub do_firmware_update { } } - if ($is_firestone and + if ($is_firestone and $firestone_update_version and (($firestone_update_version eq "820" and $htm_update_version eq "810") or ($firestone_update_version eq "810" and $htm_update_version eq "820")) ) { From b02df90e023c8498b3781bbbb43f1a85b915bcbe Mon Sep 17 00:00:00 2001 From: ertaozh Date: Wed, 20 Sep 2017 21:52:53 -0400 Subject: [PATCH 08/17] set nodename as pdu or switch incase no name get by snmp or nmap --- xCAT-server/lib/xcat/plugins/switchdiscover.pm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/xCAT-server/lib/xcat/plugins/switchdiscover.pm b/xCAT-server/lib/xcat/plugins/switchdiscover.pm index 46588cf74..bf3ca0a76 100644 --- a/xCAT-server/lib/xcat/plugins/switchdiscover.pm +++ b/xCAT-server/lib/xcat/plugins/switchdiscover.pm @@ -351,6 +351,9 @@ sub process_request { #appending mac address to end of hostname my $name = $result->{$_}->{name}; if (exists $username_hash{$name}) { + if ($name eq '') { + $name = "$device"; + } my $mac_str = lc($_); $mac_str =~ s/\://g; $result->{$_}->{name} = "$name-$mac_str"; From 105d472fe6394b48df148dcc94110a35e8318a3d Mon Sep 17 00:00:00 2001 From: hu-weihua Date: Thu, 21 Sep 2017 00:49:56 -0400 Subject: [PATCH 09/17] Use unified attribute in rpower_wrongpasswd test case --- xCAT-test/autotest/testcase/rpower/cases0 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xCAT-test/autotest/testcase/rpower/cases0 b/xCAT-test/autotest/testcase/rpower/cases0 index de57555fa..485758810 100644 --- a/xCAT-test/autotest/testcase/rpower/cases0 +++ b/xCAT-test/autotest/testcase/rpower/cases0 @@ -149,11 +149,11 @@ end start:rpower_wrongpasswd description:rpower ipmi and openbmc using wrong passwd Attribute: $$CN-The operation object of rpower command -cmd:/opt/xcat/share/xcat/tools/autotest/testcase/rpower/rpower_wrongpasswd_test.sh -pt $$CN $$rightbmcpasswd $$rightbmcusername +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/rpower/rpower_wrongpasswd_test.sh -pt $$CN $$bmcpasswd $$bmcusername check:rc==0 cmd:/opt/xcat/share/xcat/tools/autotest/testcase/rpower/rpower_wrongpasswd_test.sh -c $$CN check:rc==0 -cmd:/opt/xcat/share/xcat/tools/autotest/testcase/rpower/rpower_wrongpasswd_test.sh -apt $$CN $$rightbmcpasswd $$rightbmcusername +cmd:/opt/xcat/share/xcat/tools/autotest/testcase/rpower/rpower_wrongpasswd_test.sh -apt $$CN $$bmcpasswd $$bmcusername check:rc==0 cmd:/opt/xcat/share/xcat/tools/autotest/testcase/rpower/rpower_wrongpasswd_test.sh -c $$CN check:rc==0 From 23bab5d402225be666bef25a6059935aad46d91c Mon Sep 17 00:00:00 2001 From: XuWei Date: Thu, 21 Sep 2017 01:46:25 -0400 Subject: [PATCH 10/17] modify rsetboot url based on new interface for 1738 --- xCAT-server/lib/xcat/plugins/openbmc.pm | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index 7c2ccca17..a8fd9ddae 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -253,7 +253,7 @@ my %status_info = ( RSETBOOT_SET_REQUEST => { method => "PUT", - init_url => "$openbmc_project_url/control/host0/boot_source/attr/BootSource", + init_url => "$openbmc_project_url/control/host0/boot/attr/BootSource", data => "xyz.openbmc_project.Control.Boot.Source.Sources.", }, RSETBOOT_SET_RESPONSE => { @@ -261,7 +261,7 @@ my %status_info = ( }, RSETBOOT_STATUS_REQUEST => { method => "GET", - init_url => "$openbmc_project_url/control/host0/boot_source", + init_url => "$openbmc_project_url/control/host0/boot", }, RSETBOOT_STATUS_RESPONSE => { process => \&rsetboot_response, @@ -529,7 +529,7 @@ sub parse_args { return ([ 1, "Error parsing arguments." ]) if ($option !~ /V|verbose/); } - if (scalar(@ARGV) >= 2 and ($command =~ /rpower|rinv|rsetboot|rvitals/)) { + if (scalar(@ARGV) >= 2 and ($command =~ /rpower|rinv|rvitals/)) { return ([ 1, "Only one option is supported at the same time for $command" ]); } elsif (scalar(@ARGV) == 0 and $command =~ /rpower|rspconfig|rflash/) { return ([ 1, "No option specified for $command" ]); @@ -747,6 +747,12 @@ sub parse_command_status { } if ($command eq "rsetboot") { + if ($$subcommands[-1] and $$subcommands[-1] eq "-o") { + pop(@$subcommands); + $status_info{RSETBOOT_SET_REQUEST}{init_url} = "$openbmc_project_url/control/host0/boot_source/attr/BootSource"; + $status_info{RSETBOOT_STATUS_REQUEST}{init_url} = "$openbmc_project_url/control/host0/boot_source"; + } + if (defined($$subcommands[0])) { $subcommand = $$subcommands[0]; } else { From 6572e3f59581175945027be9c8a646dc76dd0231 Mon Sep 17 00:00:00 2001 From: XuWei Date: Thu, 21 Sep 2017 03:03:19 -0400 Subject: [PATCH 11/17] Fix issue 3979, do not set next status if command is getopenbmccons --- xCAT-server/lib/xcat/plugins/openbmc.pm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index 7c2ccca17..b13333755 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -666,6 +666,8 @@ sub parse_command_status { my $subcommands = shift; my $subcommand; + return if ($command eq "getopenbmccons"); + if ($$subcommands[-1] and $$subcommands[-1] =~ /V|verbose/) { $::VERBOSE = 1; pop(@$subcommands); From af33fbe1312663ad363eb00edfd8be93dd432dcf Mon Sep 17 00:00:00 2001 From: XuWei Date: Wed, 20 Sep 2017 22:10:29 -0400 Subject: [PATCH 12/17] disable rpower reset and boot command for OpenBMC --- xCAT-server/lib/xcat/plugins/openbmc.pm | 7 +++++++ xCAT-server/lib/xcat/plugins/rinstall.pm | 5 ----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/openbmc.pm b/xCAT-server/lib/xcat/plugins/openbmc.pm index 7c2ccca17..36fe74dee 100644 --- a/xCAT-server/lib/xcat/plugins/openbmc.pm +++ b/xCAT-server/lib/xcat/plugins/openbmc.pm @@ -545,6 +545,13 @@ sub parse_args { unless ($subcommand =~ /^on$|^off$|^softoff$|^reset$|^boot$|^bmcreboot$|^bmcstate$|^status$|^stat$|^state$/) { return ([ 1, "Unsupported command: $command $subcommand" ]); } + if ($subcommand =~ /^reset$|^boot$/) { + $check = unsupported($callback); + if (ref($check) eq "ARRAY") { + @$check[1] = "Command $command $subcommand is not supported now.\nPlease run 'rpower off' and then 'rpower on' instead."; + return $check; + } + } } elsif ($command eq "rinv") { $subcommand = "all" if (!defined($ARGV[0])); unless ($subcommand =~ /^model$|^serial$|^firm$|^cpu$|^dimm$|^all$/) { diff --git a/xCAT-server/lib/xcat/plugins/rinstall.pm b/xCAT-server/lib/xcat/plugins/rinstall.pm index 003ef2507..735ed9bca 100644 --- a/xCAT-server/lib/xcat/plugins/rinstall.pm +++ b/xCAT-server/lib/xcat/plugins/rinstall.pm @@ -548,11 +548,6 @@ sub rinstall { arg => \@rpowerarg ); - #TODO: When OPENBMC support is finished, this line should be removed - if($hmkey =~ /^openbmc$/){ - $req{environment}{XCAT_OPENBMC_DEVEL} = "YES"; - } - my $res = xCAT::Utils->runxcmd( \%req, From d8fdfaccb536bcd568947e91be39ff7c40f7d5d7 Mon Sep 17 00:00:00 2001 From: hu-weihua Date: Thu, 21 Sep 2017 04:23:36 -0400 Subject: [PATCH 13/17] reorder reventlog test case --- xCAT-test/autotest/bundle/hdctrl_general.bundle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-test/autotest/bundle/hdctrl_general.bundle b/xCAT-test/autotest/bundle/hdctrl_general.bundle index 4e77d1625..adeaa7857 100644 --- a/xCAT-test/autotest/bundle/hdctrl_general.bundle +++ b/xCAT-test/autotest/bundle/hdctrl_general.bundle @@ -27,5 +27,5 @@ rvitals_all rvitals_noderange_err reventlog_null reventlog_all -reventlog_clear reventlog_numofentries +reventlog_clear From bb87df4f941eb666ec818ba13875dbcb0863b97a Mon Sep 17 00:00:00 2001 From: Bin Xu Date: Thu, 21 Sep 2017 16:26:08 +0800 Subject: [PATCH 14/17] Add the localdisk document also available diskless osimage (#3971) * Not return directly for nodeset when hit one node failure * Add document to enable localdisk option for diskless * Revert "Not return directly for nodeset when hit one node failure" This reverts commit e5d88570541b308671cbbd2cc081610deb13113a. --- .../common/deployment/enable_localdisk.rst | 85 ++++++++++++++++++ .../diskless/customize_image/index.rst | 1 + .../diskless/customize_image/localdisk.rst | 1 + .../ppc64le/diskless/localdisk.rst | 6 ++ .../ppc64le/statelite/advanced_features.rst | 86 +------------------ 5 files changed, 94 insertions(+), 85 deletions(-) create mode 100644 docs/source/guides/admin-guides/manage_clusters/common/deployment/enable_localdisk.rst create mode 100644 docs/source/guides/admin-guides/manage_clusters/ppc64le/diskless/customize_image/localdisk.rst create mode 100644 docs/source/guides/admin-guides/manage_clusters/ppc64le/diskless/localdisk.rst diff --git a/docs/source/guides/admin-guides/manage_clusters/common/deployment/enable_localdisk.rst b/docs/source/guides/admin-guides/manage_clusters/common/deployment/enable_localdisk.rst new file mode 100644 index 000000000..5608abe72 --- /dev/null +++ b/docs/source/guides/admin-guides/manage_clusters/common/deployment/enable_localdisk.rst @@ -0,0 +1,85 @@ +Enabling the localdisk Option +----------------------------- + +``Note``: You can skip this section if not using the ``localdisk`` option in your litefile table. + +Several things need to be done to enable the 'localdisk' support: + +Define how to partition the local disk +`````````````````````````````````````` + +When a node is deployed, the local hard disk needs to be partitioned and formatted before it can be used. This section explains how provide a configuration file that tells xCAT to partition a local disk and make it ready to use for the directories listed in the litefile table with the ``localdisk`` option. + +The configuration file needs to be specified in the ``partitionfile`` attribute of the osimage definition. The configuration file includes several parts: + + * Global parameters to control enabling or disabling the function + * [disk] part to control the partitioning of the disk + * [localspace] part to control which partition will be used to store the localdisk directories listed in the litefile table + * [swapspace] part to control the enablement of the swap space for the node. + +An example localdisk configuration file: :: + + enable=yes + enablepart=no + + [disk] + dev=/dev/sdb + clear=yes + parts=100M-200M,1G-2G + + [disk] + dev=/dev/sda + clear=yes + parts=10,20,30 + + [disk] + dev=/dev/sdc + clear=yes + parts=10,20,30 + + [localspace] + dev=/dev/sda1 + fstype=ext3 + + [swapspace] + dev=/dev/sda2 + +The two global parameters ``enable`` and ``enablepart`` can be used to control the enabling/disabling of the functions: + + * enable: The localdisk feature only works when ``enable`` is set to *yes*. If it is set to *no*, the localdisk configuration will not be run. + * enablepart: The partition action (refer to the ``[disk]`` section) will be run only when ``enablepart=yes``. + +The ``[disk]`` section is used to configure how to partition a hard disk: + + * dev: The path of the device file. + * clear: If set to ``yes`` it will clear all the existing partitions on this disk. + * fstype: The file system type for the new created partitions. ``ext3`` is the default value if not set. + * parts: A comma separated list of space ranges, one for each partition that will be created on the device. The valid format for each space range is ``-`` or ````. For example, you could set it to ``100M-10G`` or ``50``. If you set it to ``50``, that means 50% of the disk space will be assigned to that partition. + +The ``[localspace]`` section is used to specify which partition will be used as local storage for the node. + + * dev: The path of the partition. + * fstype: The file system type on the partition. + +the ``[swapspace]`` section is used to configure the swap space for the statelite node. + + * dev: The path of the partition file which will be used as the swap space. + +To enable the local disk capability, create the configuration file (for example in ``/install/custom``) and set the path in the partitionfile attribute for the osimage: :: + + chdef -t osimage partitionfile=/install/custom/cfglocaldisk + +Now all nodes that use this osimage (i.e. have their provmethod attribute set to this osimage definition name), will have its local disk configured. + +Configure the files in the litefile table +````````````````````````````````````````` + +For the files/directories that you would like xCAT to store on the local disk, add an entry in the litefile table like this: :: + + "ALL","/tmp/","localdisk",, + +``Note``: you do not need to specify the swap space in the litefile table. Just putting it in the partitionfile config file is enough. + +Add an entry in policy table to permit the running of the ``getpartitioin`` command from the node :: + + chtab priority=7.1 policy.commands=getpartition policy.rule=allow diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/diskless/customize_image/index.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/diskless/customize_image/index.rst index 5d71d4223..7a9554d87 100644 --- a/docs/source/guides/admin-guides/manage_clusters/ppc64le/diskless/customize_image/index.rst +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/diskless/customize_image/index.rst @@ -15,3 +15,4 @@ Optional means all the subitems in this page are not necessary to finish an OS d install_new_kernel.rst acc_initrd_rootimg_gen_ppc64le.rst trim_diskless_rootimg.rst + localdisk.rst diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/diskless/customize_image/localdisk.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/diskless/customize_image/localdisk.rst new file mode 100644 index 000000000..52115d5ef --- /dev/null +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/diskless/customize_image/localdisk.rst @@ -0,0 +1 @@ +.. include:: ../../../common/deployment/enable_localdisk.rst diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/diskless/localdisk.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/diskless/localdisk.rst new file mode 100644 index 000000000..54922a50c --- /dev/null +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/diskless/localdisk.rst @@ -0,0 +1,6 @@ +.. include:: ../../../common/deployment/enable_localdisk.rst + +``Note``: + * `localdisk` feature won't syncronize the files/directories defined in `litefile` table from diskless image to local disk at the node boot time. It might casue issue to the application which depends on some of those directories. For example, the ``httpd`` service cannot be started if ``/var/log/`` is defined in `litefile` table. To work around this, you may copy the required contents to local disk and restart service manually at the first time. + + * To keep the contents on local disk after you use ``enablepart=yes`` to do partitioin, make sure to set ``enablepart=no`` in partitioin configuration file after the node is booted. \ No newline at end of file diff --git a/docs/source/guides/admin-guides/manage_clusters/ppc64le/statelite/advanced_features.rst b/docs/source/guides/admin-guides/manage_clusters/ppc64le/statelite/advanced_features.rst index cb5aca4e9..089b1f066 100644 --- a/docs/source/guides/admin-guides/manage_clusters/ppc64le/statelite/advanced_features.rst +++ b/docs/source/guides/admin-guides/manage_clusters/ppc64le/statelite/advanced_features.rst @@ -162,91 +162,7 @@ Obtain you new kernel and kernel modules on the MN, for example here we have a n uname -a -Enabling the localdisk Option ------------------------------ - -``Note``: You can skip this section if not using the ``localdisk`` option in your litefile table. - -Several things need to be done to enable the 'localdisk' support: - -Define how to partition the local disk -`````````````````````````````````````` - -When a node is deployed, the local hard disk needs to be partitioned and formatted before it can be used. This section explains how provide a configuration file that tells xCAT to partition a local disk and make it ready to use for the directories listed in the litefile table with the ``localdisk`` option. - -The configuration file needs to be specified in the ``partitionfile`` attribute of the osimage definition. The configuration file includes several parts: - - * Global parameters to control enabling or disabling the function - * [disk] part to control the partitioning of the disk - * [localspace] part to control which partition will be used to store the localdisk directories listed in the litefile table - * [swapspace] part to control the enablement of the swap space for the node. - -An example localdisk configuration file: :: - - enable=yes - enablepart=no - - [disk] - dev=/dev/sdb - clear=yes - parts=100M-200M,1G-2G - - [disk] - dev=/dev/sda - clear=yes - parts=10,20,30 - - [disk] - dev=/dev/sdc - clear=yes - parts=10,20,30 - - [localspace] - dev=/dev/sda1 - fstype=ext3 - - [swapspace] - dev=/dev/sda2 - -The two global parameters ``enable`` and ``enablepart`` can be used to control the enabling/disabling of the functions: - - * enable: The localdisk feature only works when ``enable`` is set to *yes*. If it is set to *no*, the localdisk configuration will not be run. - * enablepart: The partition action (refer to the ``[disk]`` section) will be run only when ``enablepart=yes``. - -The ``[disk]`` section is used to configure how to partition a hard disk: - - * dev: The path of the device file. - * clear: If set to ``yes`` it will clear all the existing partitions on this disk. - * fstype: The file system type for the new created partitions. ``ext3`` is the default value if not set. - * parts: A comma separated list of space ranges, one for each partition that will be created on the device. The valid format for each space range is ``-`` or ````. For example, you could set it to ``100M-10G`` or ``50``. If you set it to ``50``, that means 50% of the disk space will be assigned to that partition. - -The ``[localspace]`` section is used to specify which partition will be used as local storage for the node. - - * dev: The path of the partition. - * fstype: The file system type on the partition. - -the ``[swapspace]`` section is used to configure the swap space for the statelite node. - - * dev: The path of the partition file which will be used as the swap space. - -To enable the local disk capability, create the configuration file (for example in ``/install/custom``) and set the path in the partitionfile attribute for the osimage: :: - - chdef -t osimage partitionfile=/install/custom/cfglocaldisk - -Now all nodes that use this osimage (i.e. have their provmethod attribute set to this osimage definition name), will have its local disk configured. - -Configure the files in the litefile table -````````````````````````````````````````` - -For the files/directories that you would like xCAT to store on the local disk, add an entry in the litefile table like this: :: - - "ALL","/tmp/","localdisk",, - -``Note``: you do not need to specify the swap space in the litefile table. Just putting it in the partitionfile config file is enough. - -Add an entry in policy table to permit the running of the ``getpartitioin`` command from the node :: - - chtab priority=7.1 policy.commands=getpartition policy.rule=allow +.. include:: ../../common/deployment/enable_localdisk.rst If Using the RAMdisk-based Image ```````````````````````````````` From e0ec727564a13adea87be8e82988b42011007ef9 Mon Sep 17 00:00:00 2001 From: immarvin Date: Thu, 21 Sep 2017 04:30:15 -0400 Subject: [PATCH 15/17] fix issue switchtype didn't set for cumulus switch after discover #3976 --- xCAT-server/lib/xcat/plugins/nodediscover.pm | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/nodediscover.pm b/xCAT-server/lib/xcat/plugins/nodediscover.pm index fcb4e9db5..fcc2aa4a4 100644 --- a/xCAT-server/lib/xcat/plugins/nodediscover.pm +++ b/xCAT-server/lib/xcat/plugins/nodediscover.pm @@ -248,8 +248,16 @@ sub process_request { #for onie switch, lookup and set the switchtype via mac of mgt interface my $switchestab = xCAT::Table->new('switches'); if ($switchestab) { - my $switchtype=$xCAT::data::switchinfo::global_mac_identity{substr(lc($request->{_xcat_clientmac}->[0]),0,8)}; - if(defined $switchtype){ + my $switchtype; + my $switchvendor=$xCAT::data::switchinfo::global_mac_identity{substr(lc($request->{_xcat_clientmac}->[0]),0,8)}; + if(defined $switchvendor){ + my $search_string = join '|', keys(%xCAT::data::switchinfo::global_switch_type); + if ($switchvendor =~ /($search_string)/) { + $switchtype=$xCAT::data::switchinfo::global_switch_type{$1}; + } + } + + if($switchtype){ $switchestab->setNodeAttribs($node,{ switchtype => $switchtype }); } $switchestab->close(); From b65f6bca157d9d62e1e3d378a548e38561657414 Mon Sep 17 00:00:00 2001 From: Yuan Bai Date: Thu, 21 Sep 2017 17:30:45 +0800 Subject: [PATCH 16/17] enhance doc for tagged vlan hostname (#3986) --- .../common/deployment/network/cfg_network_bond_vlan.rst | 5 +++++ .../common/deployment/network/cfg_network_vlan.rst | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/docs/source/guides/admin-guides/manage_clusters/common/deployment/network/cfg_network_bond_vlan.rst b/docs/source/guides/admin-guides/manage_clusters/common/deployment/network/cfg_network_bond_vlan.rst index 84130a096..ba249126f 100644 --- a/docs/source/guides/admin-guides/manage_clusters/common/deployment/network/cfg_network_bond_vlan.rst +++ b/docs/source/guides/admin-guides/manage_clusters/common/deployment/network/cfg_network_bond_vlan.rst @@ -31,8 +31,13 @@ Define attributes in the ``nics`` table chdef cn1 nicips.bond0.1=40.0.0.1 nictypes.bond0.1=vlan #. Define ``nicnetworks`` for ``bond0.1`` :: + chdef cn1 nicnetworks.bond0.1=net40 +#. Define ``nichostnamesuffixes`` for ``bond0.1`` in case ``makehosts`` to update ``/etc/hosts``, since the value for ``nichostnamesuffixes`` cannot contain ".", other characters are recommended instead of ".", like following: :: + + chdef cn1 nichostnamesuffixes.bond0.1=-bond0-1 + Enable ``confignetwork`` to configure bridge ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/docs/source/guides/admin-guides/manage_clusters/common/deployment/network/cfg_network_vlan.rst b/docs/source/guides/admin-guides/manage_clusters/common/deployment/network/cfg_network_vlan.rst index 41ed6a0a9..65ee1de30 100644 --- a/docs/source/guides/admin-guides/manage_clusters/common/deployment/network/cfg_network_vlan.rst +++ b/docs/source/guides/admin-guides/manage_clusters/common/deployment/network/cfg_network_vlan.rst @@ -31,6 +31,10 @@ Define attributes in the ``nics`` table chdef cn1 nicnetworks.eth0.6=net60 nicnetworks.eth0.7=net70 +#. Define ``nichostnamesuffixes`` for ``eth0.6`` and ``eth0.7`` in case ``makehosts`` to update ``/etc/hosts``, since the value for ``nichostnamesuffixes`` cannot contain ".", other characters are recommended instead of ".", like following: :: + + chdef cn1 nichostnamesuffixes.eth0.6=-eth0-6 nichostnamesuffixes.eth0.7=-eth0-7 + Enable ``confignetwork`` to configure VLAN ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ From 86ced369febc9c8a5c28c8c63acb728c989e2d26 Mon Sep 17 00:00:00 2001 From: ertaozh Date: Thu, 21 Sep 2017 05:48:55 -0400 Subject: [PATCH 17/17] Modify release information for 2.13.7 --- docs/source/overview/xcat2_release.rst | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/docs/source/overview/xcat2_release.rst b/docs/source/overview/xcat2_release.rst index 7bec2cfde..b3391d6b6 100644 --- a/docs/source/overview/xcat2_release.rst +++ b/docs/source/overview/xcat2_release.rst @@ -14,14 +14,26 @@ xCAT 2.13.x |xCAT |New OS |New |New Feature | |Version | |Hardware | | +=================================+===============+=============+==================================+ -|| xCAT 2.13.6 |- RHEL 7.4 |-Boston |- OpenBMC support | -|| 2017/8/10 | | server | | +|| xCAT 2.13.7 | | |- OpenBMC support: | +|| 2017/9/22 | | | | +|| | | | rflash for OpenBMC and PNOR | +| `2.13.7 Release Notes `_ | | | | +| | | |- xcatprobe clusterstatus enhance | +| | | | | +| | | |- PDU support: discover, config | +| | | | | +| | | |- SRIOV support for VMs | ++---------------------------------+---------------+-------------+----------------------------------+ +|| xCAT 2.13.6 |- RHEL 7.4 |- Boston |- OpenBMC support | +|| 2017/8/10 | | server | | || | | | rsetboot net/hd/def | | `2.13.6 Release Notes `_ | | | /delete/check | | | | | | -| | | | rspconfig retrieve OpenBCM ip/ | +| | | | rspconfig retrieve OpenBMC ip/ | | | | | netmask/gateway information | | | | |- nodeset performance enhancement | | | | | (Phase 3) |