From 7091e7713faba8de82ec432240eacbe43cee68f6 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Fri, 5 May 2017 09:37:26 -0400 Subject: [PATCH 001/455] Add rsync as an xCAT dependency --- xCAT/xCAT.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/xCAT/xCAT.spec b/xCAT/xCAT.spec index 5842d6664..d293339d2 100644 --- a/xCAT/xCAT.spec +++ b/xCAT/xCAT.spec @@ -31,6 +31,7 @@ Requires: xCAT-server = 4:%{version}-%{release} Requires: xCAT-probe = 4:%{version}-%{release} Requires: xCAT-genesis-scripts-x86_64 = 1:%{version}-%{release} Requires: xCAT-genesis-scripts-ppc64 = 1:%{version}-%{release} +Requires: rsync %define pcm %(if [ "$pcm" = "1" ];then echo 1; else echo 0; fi) %define notpcm %(if [ "$pcm" = "1" ];then echo 0; else echo 1; fi) From 7067220128d4ff4fdb39ada7401921959b260a19 Mon Sep 17 00:00:00 2001 From: Kilian Cavalotti Date: Wed, 24 May 2017 15:38:31 -0700 Subject: [PATCH 002/455] Enhance MTM detection from FRU pages For systems that don't provide "Product Name", try to use "Product Part Number" instead. Supermicro does this, for instance: # ipmitool fru print 0 Chassis Type : Other Chassis Part Number : CSE-118GQETS-R2K03P Chassis Serial : [...] Board Mfg Date : Sun Dec 31 16:00:00 1995 Board Mfg : Supermicro Board Serial : [...] Board Part Number : X10DGQ Product Manufacturer : Supermicro Product Part Number : SYS-1028GQ-TR Product Serial : [...] --- xCAT-genesis-scripts/bin/dodiscovery | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/xCAT-genesis-scripts/bin/dodiscovery b/xCAT-genesis-scripts/bin/dodiscovery index f33ef9c3d..338f13c42 100755 --- a/xCAT-genesis-scripts/bin/dodiscovery +++ b/xCAT-genesis-scripts/bin/dodiscovery @@ -75,13 +75,17 @@ if [ -r /sys/devices/virtual/dmi/id/product_name ]; then #x86 if [ -z "$MTM" ]; then FRU=`ipmitool fru print 0` if [ $? -eq 0 ]; then - MTM=`echo "$FRU" | awk -F': ' '/Product Manufacturer/ {m=$2} /Product Name/ {n=$2} END {print m":"n}'` + m=`echo "$FRU" | awk -F': ' '/Product Manufacturer/ {print $2}'` + n=`echo "$FRU" | awk -F': ' '/Product Name/ {print $2}'` + if [ -z "$n" ]; then + n=`echo "$FRU" | awk -F': ' '/Product Part Number/ {print $2}'` + fi else logger -s -t $log_label -p local4.warning "Couldn't find MTM information in FRU, falling back to DMI (MTMS-based discovery may fail)" m=`cat /sys/devices/virtual/dmi/id/sys_vendor` n=`cat /sys/devices/virtual/dmi/id/product_name` - MTM="$m:$n" fi + MTM="$m:$n" fi SERIAL=`cat /sys/devices/virtual/dmi/id/product_serial` fi From b7676f7448df6b29a05fba4a2e84605f2d3b9156 Mon Sep 17 00:00:00 2001 From: Kilian Cavalotti Date: Thu, 25 May 2017 17:24:23 -0700 Subject: [PATCH 003/455] MTM: some systems have FRU entries, but set to "NONE" --- xCAT-genesis-scripts/bin/dodiscovery | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-genesis-scripts/bin/dodiscovery b/xCAT-genesis-scripts/bin/dodiscovery index 338f13c42..0ac4b9bd2 100755 --- a/xCAT-genesis-scripts/bin/dodiscovery +++ b/xCAT-genesis-scripts/bin/dodiscovery @@ -77,7 +77,7 @@ if [ -r /sys/devices/virtual/dmi/id/product_name ]; then #x86 if [ $? -eq 0 ]; then m=`echo "$FRU" | awk -F': ' '/Product Manufacturer/ {print $2}'` n=`echo "$FRU" | awk -F': ' '/Product Name/ {print $2}'` - if [ -z "$n" ]; then + if [ -z "$n" -o "$n" == "NONE" ]; then n=`echo "$FRU" | awk -F': ' '/Product Part Number/ {print $2}'` fi else From b7f8af5e34f4cdfceccd6568a39d681ea5fbcf98 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Mon, 5 Jun 2017 14:09:37 -0400 Subject: [PATCH 004/455] When go-xcat prompts the user to continue, prompt until y or n is specified before aborting. --- xCAT-server/share/xcat/tools/go-xcat | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/xCAT-server/share/xcat/tools/go-xcat b/xCAT-server/share/xcat/tools/go-xcat index b09adea6d..673bc20b4 100755 --- a/xCAT-server/share/xcat/tools/go-xcat +++ b/xCAT-server/share/xcat/tools/go-xcat @@ -1567,14 +1567,22 @@ case "${GO_XCAT_ACTION}" in then echo echo "xCAT is going to be ${GO_XCAT_ACTION/%e/}ed." - read -r -p "Continue? [y/n] " - case "${REPLY}" in - "Y"*|"y"*) - ;; - *) - echo "Aborting ..." - exit 0 - esac + while true; do + + read -r -p "Continue? [y/n] " + case "${REPLY}" in + "Y"*|"y"*) + break + ;; + "N"*|"n"*) + echo "Good-bye!" + exit 0 + ;; + *) + echo "Invalid response!" + ;; + esac + done fi # Use `-y' here. Since the STDOUT is redirect to tee. # `yum' does not display the prompt message properly when From 65615ce7e9d7d73b3537710041fb845258ffc751 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Mon, 5 Jun 2017 14:18:30 -0400 Subject: [PATCH 005/455] Remove the quotes around the source command --- xCAT-server/share/xcat/tools/go-xcat | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/xCAT-server/share/xcat/tools/go-xcat b/xCAT-server/share/xcat/tools/go-xcat index 673bc20b4..3787ed9d4 100755 --- a/xCAT-server/share/xcat/tools/go-xcat +++ b/xCAT-server/share/xcat/tools/go-xcat @@ -1653,10 +1653,11 @@ case "${GO_XCAT_ACTION}" in If this is the very first time xCAT has been installed, run the following commands to set environment variables into your PATH: - for sh, - \`source /etc/profile.d/xcat.sh' - or csh, - \`source /etc/profile.d/xcat.csh' + For sh: + source /etc/profile.d/xcat.sh + + For csh: + source /etc/profile.d/xcat.csh EOF ;; "update") From ad71fc9336133cd55d1e128d0add0ef544de7edc Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Tue, 27 Jun 2017 13:47:03 -0400 Subject: [PATCH 006/455] Initial pass for clusterstatus xcat probe --- xCAT-probe/subcmds/clusterstatus | 134 +++++++++++++++++++++++++++++++ 1 file changed, 134 insertions(+) create mode 100755 xCAT-probe/subcmds/clusterstatus diff --git a/xCAT-probe/subcmds/clusterstatus b/xCAT-probe/subcmds/clusterstatus new file mode 100755 index 000000000..23b542cd1 --- /dev/null +++ b/xCAT-probe/subcmds/clusterstatus @@ -0,0 +1,134 @@ +#! /usr/bin/perl +# IBM(c) 2016 EPL license http://www.eclipse.org/legal/epl-v10.html + +BEGIN { $::XCATROOT = $ENV{'XCATROOT'} ? $ENV{'XCATROOT'} : -d '/opt/xcat' ? '/opt/xcat' : '/usr'; } + +use lib "$::XCATROOT/probe/lib/perl"; +use probe_utils; +use File::Basename; +use Net::Ping; +use Getopt::Long qw(:config no_ignore_case); + +use Data::Dumper; +use warnings; + +my $program_name = basename("$0"); +my $help; +my $noderange = "compute"; +my $test; +my $output = "stdout"; +my $verbose = 0; +my $rst = 0; + +$::USAGE = "Usage: + $program_name -h + $program_name {-d|-g} [-n noderange] [-V|--verbose] + +Description: + Use this command to get a summary of the cluster. + +Options: + -h : Get usage information of $program_name + -n : Range of nodes to check. Default is \"compute\". + -d : Discovery. Display count of discovered nodes. + -g : Group count. Display count of nodes in each group. + -V : To print additional debug information. +"; + +#------------------------------------- +# main process +#------------------------------------- +if ( + !GetOptions("--help|h" => \$help, + "T" => \$test, + "V|verbose" => \$VERBOSE, + "d|discovery" => \$DISCOVERY, + "g|groupcount" => \$GROUPCOUNT, + "n=s" => \$noderange)) +{ + probe_utils->send_msg("$output", "f", "Invalid parameter for $program_name"); + probe_utils->send_msg("$output", "d", "$::USAGE"); + exit 1; +} + +if ($help) { + if ($output ne "stdout") { + probe_utils->send_msg("$output", "d", "$::USAGE"); + } else { + print "$::USAGE"; + } + exit 0; +} + +if ($test) { + probe_utils->send_msg("$output", "o", "Use this command to get node summary in the cluster."); + exit 0; +} + +if ((!$DISCOVERY) and (!$GROUPCOUNT)) { + probe_utils->send_msg("$output", "f", "Discovery or groupcount option is required for $program_name"); + probe_utils->send_msg("$output", "d", "$::USAGE"); + exit 1; +} + +if (scalar(@ARGV) >= 1) { + + # After processing all the expected flags and arguments, + # there is still left over stuff on the command line + probe_utils->send_msg("$output", "f", "Invalid flag or parameter: @ARGV"); + probe_utils->send_msg("$output", "d", "$::USAGE"); + exit 1; +} + +check_for_discovered_nodes() if ($DISCOVERY); +groupcount_nodes() if ($GROUPCOUNT); + +# Check for node definitions with MAC address defined +sub check_for_discovered_nodes { + my $na = "N/A"; + my $rc = 0; + + my $all_nodes_mac = `lsdef -i mac -c $noderange 2> /dev/null`; + chomp($all_nodes_mac); + my @all_nodes_mac_lines = split("[\n\r]", $all_nodes_mac); + + if ($all_nodes_mac =~ /Usage:/) { + + # lsdef command displayed a Usage message. Must be some noderange formatting problem. + # Issue a warning and exit. + probe_utils->send_msg("$output", "w", "Can not get a list of nodes from specified noderange."); + return 1; + } + + if (scalar(@all_nodes_mac_lines) <= 0) { + + # There were no nodes matching the noderange. Issue a warning and exit. + probe_utils->send_msg("$output", "w", "No nodes matching the noderange were found."); + return 1; + } + + # Go through the list of nodes and count how many have mac value + my $mac_counter=0; + foreach (@all_nodes_mac_lines) { + # probe_utils->send_msg("$output", "d", "Processing $_.") if ($VERBOSE); + my ($node_name, $value) = split ":", $_; + my ($mac_name, $mac_value) = split "=", $value; + if ($mac_value) { + # mac if set for the node + $mac_counter++; + probe_utils->send_msg("$output", "d", "($mac_counter) $_") if ($VERBOSE); + } + } + my $percent = sprintf("%.2f", (($mac_counter / scalar(@all_nodes_mac_lines)) * 100)); + + probe_utils->send_msg("$output", "o", "$mac_counter out of " . scalar(@all_nodes_mac_lines) . " in the noderange \"$noderange\" have been discovered ($percent/%)"); + return $rc; +} + +sub groupcount_nodes { + my $na = "N/A"; + my $rc = 0; + + probe_utils->send_msg("$output", "w", "Group count function is not yet implemented."); + return $rc; +} From a770ed67269a063d71d86b4e638b5547cd96d110 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Tue, 27 Jun 2017 15:09:24 -0400 Subject: [PATCH 007/455] bump up the version of go-xcat --- xCAT-server/share/xcat/tools/go-xcat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xCAT-server/share/xcat/tools/go-xcat b/xCAT-server/share/xcat/tools/go-xcat index 3787ed9d4..d9d12e3b5 100755 --- a/xCAT-server/share/xcat/tools/go-xcat +++ b/xCAT-server/share/xcat/tools/go-xcat @@ -2,7 +2,7 @@ # # go-xcat - Install xCAT automatically. # -# Version 1.0.19 +# Version 1.0.20 # # Copyright (C) 2016 International Business Machines # Eclipse Public License, Version 1.0 (EPL-1.0) From 2f963800e8ac8b1b3865f1ff7c64b8e6f9a83fd0 Mon Sep 17 00:00:00 2001 From: Casandra Qiu Date: Wed, 28 Jun 2017 16:55:15 -0400 Subject: [PATCH 008/455] Add Vlan and MTU to switch_macmap output --- perl-xCAT/xCAT/MacMap.pm | 22 +++++++++++++++++++++ xCAT-server/lib/xcat/plugins/switch.pm | 27 +++++++++++++++++++++----- 2 files changed, 44 insertions(+), 5 deletions(-) diff --git a/perl-xCAT/xCAT/MacMap.pm b/perl-xCAT/xCAT/MacMap.pm index 54edb1824..f95d01091 100644 --- a/perl-xCAT/xCAT/MacMap.pm +++ b/perl-xCAT/xCAT/MacMap.pm @@ -356,6 +356,8 @@ sub dump_mac_info { } } @{ $ret{$switch}->{$snmpportname}->{MACaddress} } = @{ $self->{macinfo}->{$switch}->{$snmpportname} }; + @{ $ret{$switch}->{$snmpportname}->{Vlanid} } = @{ $self->{vlaninfo}->{$switch}->{$snmpportname} }; + @{ $ret{$switch}->{$snmpportname}->{Mtu} } = @{ $self->{mtuinfo}->{$switch}->{$snmpportname} }; } } } @@ -720,6 +722,12 @@ sub refresh_switch { return; } + # get mtu + my $iftomtumap = walkoid($session, '.1.3.6.1.2.1.2.2.1.4', silentfail => 1, verbose => $self->{show_verbose_info}, switch => $switch, callback => $self->{callback}); + unless (defined($iftomtumap)) { + xCAT::MsgUtils->message("I", "MTU information is not availabe for this switch $switch"); + } + #Above is valid without community string indexing, on cisco, we need it on the next one and onward my $iftovlanmap = walkoid($session, '.1.3.6.1.4.1.9.9.68.1.2.2.1.2', silentfail => 1, verbose => $self->{show_verbose_info}, switch => $switch, callback => $self->{callback}); #use cisco vlan membership mib to ascertain vlan my $trunktovlanmap = walkoid($session, '.1.3.6.1.4.1.9.9.46.1.6.1.1.5', silentfail => 1, verbose => $self->{show_verbose_info}, switch => $switch, callback => $self->{callback}); #for trunk ports, we are interested in the native vlan, so we need cisco vtp mib too @@ -783,24 +791,38 @@ sub refresh_switch { xCAT::MsgUtils->message("S", "Error communicating with " . $session->{DestHost} . ": Unable to get MAC entries via either BRIDGE or Q-BRIDE MIB"); return; } + if (defined($self->{collect_mac_info})) { my %index_to_mac = (); + my %index_to_vlan = (); foreach (keys %$mactoindexmap) { my $index = $mactoindexmap->{$_}; my @tmp = split /\./, $_; + my $vlan = @tmp[0]; my @mac = @tmp[ -6 .. -1 ]; my $macstring = sprintf("%02x:%02x:%02x:%02x:%02x:%02x", @mac); push @{ $index_to_mac{$index} }, $macstring; + push @{ $index_to_vlan{$index} }, $vlan; } foreach my $boid (keys %$bridgetoifmap) { my $port_index = $boid; my $port_name = $namemap->{ $bridgetoifmap->{$port_index} }; + my $mtu = $iftomtumap->{ $bridgetoifmap->{$port_index} }; if (defined($index_to_mac{$port_index})) { push @{ $self->{macinfo}->{$switch}->{$port_name} }, @{ $index_to_mac{$port_index} }; } else { $self->{macinfo}->{$switch}->{$port_name}->[0] = ''; } + + if (defined($index_to_vlan{$port_index})) { + push @{ $self->{vlaninfo}->{$switch}->{$port_name} }, @{ $index_to_vlan{$port_index} }; + } + else { + $self->{vlaninfo}->{$switch}->{$port_name}->[0] = ''; + } + push @{ $self->{mtuinfo}->{$switch}->{$port_name} } , $mtu; + } return; } diff --git a/xCAT-server/lib/xcat/plugins/switch.pm b/xCAT-server/lib/xcat/plugins/switch.pm index 61dbce696..f4330a883 100644 --- a/xCAT-server/lib/xcat/plugins/switch.pm +++ b/xCAT-server/lib/xcat/plugins/switch.pm @@ -230,12 +230,12 @@ sub process_request { } } } - my $format = "%-" . $switch_name_length . "s %-" . $port_name_length . "s %-18s %s"; + my $format = "%-" . $switch_name_length . "s %-" . $port_name_length . "s %-18s %-20s %-7s %s"; my %failed_switches = (); - my $header = sprintf($format, "Switch", "Port", "MAC address", "Node"); + my $header = sprintf($format, "Switch", "Port", "MAC address", "Node", "Vlan", "MTU"); if (!defined($req->{opt}->{check}) and $port_name_length) { $cb->({ data => $header }); - $cb->({ data => "------------------------------------------------------------------" }) + $cb->({ data => "--------------------------------------------------------------------------------------" }) } foreach my $switch (keys %$macinfo) { if (defined($macinfo->{$switch}->{ErrorStr})) { @@ -251,17 +251,34 @@ sub process_request { $cb->({ node => [ { name => $switch, data => ["PASS"] } ] }); next; } + foreach my $port (sort keys %{ $macinfo->{$switch} }) { my $node = ''; if (defined($macinfo->{$switch}->{$port}->{Node})) { $node = $macinfo->{$switch}->{$port}->{Node}; } + + my $mtu = ''; + my @mtuarray = (); + if (defined($macinfo->{$switch}->{$port}->{Mtu})) { + @mtuarray = @{ $macinfo->{$switch}->{$port}->{Mtu} }; + } + my $vlanid = ''; + my @vlans = (); + if (defined($macinfo->{$switch}->{$port}->{Vlanid})) { + @vlans = @{ $macinfo->{$switch}->{$port}->{Vlanid} }; + } + my @macarrary = (); if (defined($macinfo->{$switch}->{$port}->{MACaddress})) { @macarray = @{ $macinfo->{$switch}->{$port}->{MACaddress} }; + my $ind = 0; foreach (@macarray) { - my $data = sprintf($format, $switch, $port, ($_ ne '') ? $_ : ' N/A', $node); + $vlanid = $vlans[$ind]; + $mtu = $mtuarray[$ind]; + my $data = sprintf($format, $switch, $port, ($_ ne '') ? $_ : ' N/A', $node,$vlanid,$mtu); $cb->({ data => $data }); + $ind++; #$cb->({node=>[{name=>$switch,data=>$data}]}); } @@ -269,7 +286,7 @@ sub process_request { } } if (!defined($req->{opt}->{check}) and $port_name_length) { - $cb->({ data => "------------------------------------------------------------------" }) + $cb->({ data => "--------------------------------------------------------------------------------------" }) } foreach (keys %failed_switches) { $cb->({ node => [ { name => $_, error => [ $failed_switches{$_} ], errorcode => 1 } ] }); From 2d497a0d8c396bc673e04ca80200c389d4fa2ce3 Mon Sep 17 00:00:00 2001 From: yangsong Date: Wed, 28 Jun 2017 22:36:23 -0500 Subject: [PATCH 009/455] documentation for ZTP based ONIE switch setup (#3362) --- .../advanced/networks/onie_switches/index.rst | 1 + .../networks/onie_switches/os_cumulus/ztp.rst | 91 +++++++++++++++++++ 2 files changed, 92 insertions(+) create mode 100644 docs/source/advanced/networks/onie_switches/os_cumulus/ztp.rst diff --git a/docs/source/advanced/networks/onie_switches/index.rst b/docs/source/advanced/networks/onie_switches/index.rst index 1539acb9b..8c59c6c46 100644 --- a/docs/source/advanced/networks/onie_switches/index.rst +++ b/docs/source/advanced/networks/onie_switches/index.rst @@ -7,6 +7,7 @@ The Open Network Install Environment, or "ONIE" [1]_. is an open source project :maxdepth: 2 os_cumulus/index.rst + os_cumulus/ztp.rst .. [1] Open Network Install Environment: Created by Cumulus Networks, Inc. in 2012, the Open Network Install Environment (ONIE) Project is a small operating system, pre-installed as firmware on bare metal network switches, that provides an environment for automated operating system provisioning. diff --git a/docs/source/advanced/networks/onie_switches/os_cumulus/ztp.rst b/docs/source/advanced/networks/onie_switches/os_cumulus/ztp.rst new file mode 100644 index 000000000..b620683e0 --- /dev/null +++ b/docs/source/advanced/networks/onie_switches/os_cumulus/ztp.rst @@ -0,0 +1,91 @@ +Setup ONIE switches with ZTP in large cluster +============================================= + +Zero Touch Provisioning (ZTP) is a feature shipped in many network devices to enable them to be quickly deployed in large-scale environments. In Cumulus OS on ONIE switches with ZTP enabled, the URL of an user provided script can be specified in the DHCP response for the DHCP request trigged by one of the following events: + + * Booting the switch + * Plugging a cable into or unplugging it from the eth0 port + * Disconnecting then reconnecting the switch's power cord. + +the script will be then downloaded and executed on the network device. + +Leveraging the ZTP mechanism, xCAT provides the capability to setup ONIE switches from white-box without touching anything, including Cumulus OS installation, discovery and configuration. Please follow the steps below to setup ONIE switches in the cluster: + +1. Ensure that xCAT is configured with an DHCP open range to detect when new switches request DHCP IPs + + (1). Make sure the network in which the management interface of the ONIE switches are connected has been defined in ``networks`` table :: + + # tabdump networks + #netname,net,mask,mgtifname,gateway,dhcpserver,tftpserver,nameservers,ntpservers,logservers,dynamicrange,staticrange,staticrangeincrement,nodehostname,ddnsdomain,vlanid,domain,mtu,comments,disable + "172_21_0_0-255_255_0_0","172.21.0.0","255.255.0.0","enP3p3s0d1","","172.21.253.27","172.21.253.27",,,,"172.21.253.100-172.21.253.200",,,,,,,,, + + (2). Prepare the DHCP configuration for ONIE switches setup + + Add the management node's NIC facing the ONIE switches' management interface to the ``site.dhcpinterfaces`` :: + + chdef -t site -p dhcpinterfaces=enP3p3s0d1 + + Add dynamic range for the temporary IP addresses used in the OS provision and discovery of ONIE switches :: + + chdef -t network 172_21_0_0-255_255_0_0 dynamicrange="172.21.253.100-172.21.253.200" + + Update DHCP configuration file :: + + makedhcp -n + +2. Predefine ONIE switches according to the network plan :: + + mkdef mid05tor10 --template onieswitch ip=172.21.205.10 switch=mgmtsw01 switchport=10 + + ``ip`` is the IP address of the management interface of the ONIE switch + + ``switch`` is the core switch to which the management interface of ONIE switch is connected. + + ``switchport`` is the port on the core switch to which the management interface of ONIE switch is connected. + +3. Add the predefined switches into ``/etc/hosts`` :: + + makehosts mid05tor10 + +4. [If the Cumulus OS have been installed on the ONIE switches, please skip this step] Prepare the Cumulus installation image, ``/install/onie/onie-installer`` is the hard-coded path of the Cumulus installation image, or the link to the Cumulus installation image on the management node :: + + mkdir -p /install/onie/ + cp /install/custom/sw_os/cumulus/cumulus-linux-3.1.0-bcm-armel.bin /install/onie/ + ln -s /install/onie/cumulus-linux-3.1.0-bcm-armel.bin /install/onie/onie-installer + +5. Plug the ONIE switches into the cluster according to the network plan and power on them. + + For the white-box ONIE switches, the Cumulus OS will be installed, then the switches will be discovered and configured automaticaly, the whole process will take about 1 hour. + + For the ONIE switches already with Cumulus OS installed, please make sure the ZTP have been enabled and none of the following manual configuration have been made: + + * Password changes + * Users and groups changes + * Packages changes + * Interfaces changes + * The presence of an installed license + + Otherwise, please run ``ztp -R`` on the switches to reset the ZTP state before switch boot up for setup. The whole setup process will take about 1-2 minutes. + +6. The switch definition in xCAT will be updated when the switch is configured :: + + # lsdef mid05tor10 + Object name: mid05tor10 + arch=armv7l + groups=switch + ip=172.21.205.10 + mac=xx:xx:xx:xx:xx:xx + mgt=switch + netboot=onie + nodetype=switch + postbootscripts=otherpkgs + postscripts=syslog,remoteshell,syncfiles + serial=11S01FT690YA50YD73EACH + status=configured + statustime=06-22-2017 23:14:14 + supportedarchs=armv7l + switch=mgmtsw01 + switchport=10 + switchtype=Edgecore Networks Switch + + ``status=configured`` indicates that the switch has been discovered and configured. From f7f8096afbc9b9b81336f8bb801095edd56d487d Mon Sep 17 00:00:00 2001 From: GONG Jie Date: Thu, 29 Jun 2017 13:22:20 +0800 Subject: [PATCH 010/455] [go-xcat] When xcat version is specified, look different place for xcat-dep repository --- xCAT-server/share/xcat/tools/go-xcat | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/xCAT-server/share/xcat/tools/go-xcat b/xCAT-server/share/xcat/tools/go-xcat index d9d12e3b5..5960262b0 100755 --- a/xCAT-server/share/xcat/tools/go-xcat +++ b/xCAT-server/share/xcat/tools/go-xcat @@ -2,7 +2,7 @@ # # go-xcat - Install xCAT automatically. # -# Version 1.0.20 +# Version 1.0.21 # # Copyright (C) 2016 International Business Machines # Eclipse Public License, Version 1.0 (EPL-1.0) @@ -1051,6 +1051,8 @@ function add_xcat_dep_repo_yum_or_zypper() local -a yes=() [[ "$1" = "-y" ]] && yes=("-y") && shift local url="$1" + local ver="$2" + [[ -z "${ver}" ]] && ver="latest" local tmp="" local install_path="${GO_XCAT_DEFAULT_INSTALL_PATH}" local distro="${GO_XCAT_LINUX_DISTRO}${GO_XCAT_LINUX_VERSION%%.*}" @@ -1064,7 +1066,7 @@ function add_xcat_dep_repo_yum_or_zypper() *) warn_if_bad 1 "${distro}: unsupported Linux distro" || return 1 esac [[ -z "${url}" ]] && - url="${GO_XCAT_DEFAULT_BASE_URL}/yum/xcat-dep/${distro}/${GO_XCAT_ARCH}/xCAT-dep.repo" + url="${GO_XCAT_DEFAULT_BASE_URL}/yum/${ver}/xcat-dep" case "${url##*.}" in "repo") # local repo file add_repo_by_url_yum_or_zypper "${url}" "xcat-dep" @@ -1083,7 +1085,7 @@ function add_xcat_dep_repo_yum_or_zypper() url="${tmp}" ;; *) - url="${url}/${distro}/${GO_XCAT_ARCH}/xCAT-dep.repo" + url="${url}/${distro}/${GO_XCAT_ARCH}" add_repo_by_url_yum_or_zypper "${url}" "xcat-dep" return "$?" ;; @@ -1117,8 +1119,10 @@ function add_xcat_dep_repo_apt() local -a yes=() [[ "$1" = "-y" ]] && yes=("-y") && shift local url="$1" + local ver="$2" + [[ -z "${ver}" ]] && ver="latest" [[ -z "${url}" ]] && - url="${GO_XCAT_DEFAULT_BASE_URL}/apt/xcat-dep" + url="${GO_XCAT_DEFAULT_BASE_URL}/apt/${ver}/xcat-dep" add_repo_by_url_apt "${url}" "xcat-dep" } @@ -1538,7 +1542,7 @@ show_progress_meters ERR_MSG="$({ if add_xcat_core_repo -y "${GO_XCAT_CORE_URL}" "${GO_XCAT_VERSION}" then - if add_xcat_dep_repo -y "${GO_XCAT_DEP_URL}" + if add_xcat_dep_repo -y "${GO_XCAT_DEP_URL}" "${GO_XCAT_VERSION}" then update_repo && exit 0 remove_repo "xcat-dep" From c95b277a4adb1ddb2499e9313017fc66c900e067 Mon Sep 17 00:00:00 2001 From: Bin Xu Date: Thu, 29 Jun 2017 16:51:31 +0800 Subject: [PATCH 011/455] Fix 3368, "noboot" is not working for mknb when multiple interfaces, and it is caused by something wrong in "get_nic_ip" (#3371) --- perl-xCAT/xCAT/NetworkUtils.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/perl-xCAT/xCAT/NetworkUtils.pm b/perl-xCAT/xCAT/NetworkUtils.pm index 0c62fb7a0..d54bf253b 100755 --- a/perl-xCAT/xCAT/NetworkUtils.pm +++ b/perl-xCAT/xCAT/NetworkUtils.pm @@ -736,7 +736,7 @@ sub get_nic_ip my %iphash; my $mode = "MULTICAST"; my $payingattention = 0; - my $interface; + my $interface = ""; my $keepcurrentiface; @@ -793,6 +793,7 @@ sub get_nic_ip delete $iphash{$interface}; } $keepcurrentiface = 0; + $interface = ""; if (!($line =~ /LOOPBACK/) and $line =~ /UP( |,|>)/ and $line =~ /$mode/) { From 662dc2a6dec2a8f907b180282c0b4cdb232c5484 Mon Sep 17 00:00:00 2001 From: Mark Gurevich Date: Thu, 29 Jun 2017 15:43:40 -0400 Subject: [PATCH 012/455] Copy ssh keys to BMC with rspconfig command --- .../references/man1/rspconfig.1.rst | 11 +++- xCAT-client/pods/man1/rspconfig.1.pod | 9 ++- xCAT-server/lib/xcat/plugins/openbmc.pm | 66 +++++++++++++++++++ 3 files changed, 80 insertions(+), 6 deletions(-) diff --git a/docs/source/guides/admin-guides/references/man1/rspconfig.1.rst b/docs/source/guides/admin-guides/references/man1/rspconfig.1.rst index c2165234b..c2a4d365c 100644 --- a/docs/source/guides/admin-guides/references/man1/rspconfig.1.rst +++ b/docs/source/guides/admin-guides/references/man1/rspconfig.1.rst @@ -47,7 +47,7 @@ OpenBMC specific: ================= -\ **rspconfig**\ \ *noderange*\ {\ **ip | netmask | gateway | vlan**\ } +\ **rspconfig**\ \ *noderange*\ {\ **ip | netmask | gateway | vlan | sshcfg**\ } MPA specific: @@ -251,8 +251,7 @@ DESCRIPTION *********** -\ **rspconfig**\ configures various settings in the nodes' service processors. If only a keyword is -specified, without the \ **=**\ , it displays the current value. +\ **rspconfig**\ configures various settings in the nodes' service processors. For options \ **autopower | iocap | decfg | memdecfg | procdecfg | time | date | spdump | sysdump | network**\ , user need to use \ *chdef -t site enableASMI=yes*\ to enable ASMI first. @@ -526,6 +525,12 @@ OPTIONS +\ **sshcfg**\ + + Copy SSH keys. + + + \ **swnet**\ ={[\ *ip*\ ],[\ *gateway*\ ],[\ *netmask*\ ]} Set the Switch network parameters. diff --git a/xCAT-client/pods/man1/rspconfig.1.pod b/xCAT-client/pods/man1/rspconfig.1.pod index aba5fcd5a..972aa649b 100644 --- a/xCAT-client/pods/man1/rspconfig.1.pod +++ b/xCAT-client/pods/man1/rspconfig.1.pod @@ -24,7 +24,7 @@ B I B=I