diff --git a/xCAT-client/pods/man1/nodeimport.1.pod b/xCAT-client/pods/man1/nodeimport.1.pod index 994c9bcd1..2dffc1847 100644 --- a/xCAT-client/pods/man1/nodeimport.1.pod +++ b/xCAT-client/pods/man1/nodeimport.1.pod @@ -120,8 +120,7 @@ To import nodes using a profile, follow the following steps: # hostinfo begin # This entry defines a blade. __hostname__: - switch=myswitch - switchport=9 + switches=eth0!switch1!1,eth0!switch2!1!eth1 Example of a node information file that specifies a CEC-based rack-mounted Power node that uses direct FSP management: # Node information file begins @@ -141,13 +140,9 @@ B> This is a mandatory item. Description: Specify the MAC address for the NIC used by the provisionging node, where is the NICs MAC address. -B> This is a mandatory item, when define a switch auto discovery node. +B> This is a mandatory item, when define switch, switchport and node nic name relationship. -Description: Specify switch name that the provisionging node is connected, where is the switch name. - -B> This is a mandatory item, when define a switch auto discovery node. - -Description: Specify switch port that the provisionging node is connected, where is the connected port. +Description: Specify nic name, switch name and switch port to define node and switch relationship. We can define multi nic-switch-port relations here, looks like: switches=eth0!switch1!1,eth1!switch1,2 B> This is a mandatory item while define a PureFlex node. diff --git a/xCAT-server/lib/xcat/plugins/profilednodes.pm b/xCAT-server/lib/xcat/plugins/profilednodes.pm index 6973d1e3d..9f25a3b7a 100644 --- a/xCAT-server/lib/xcat/plugins/profilednodes.pm +++ b/xCAT-server/lib/xcat/plugins/profilednodes.pm @@ -1779,9 +1779,9 @@ sub gen_new_hostinfo_dict{ my %keyshash = (); my %valueshash = (); $keyshash{'node'} = $item; - $keyshash{'switch'}= $spilist[0]; - $keyshash{'port'} = $spilist[1]; - $valueshash{'interface'} = $spilist[2]; + $valueshash{'interface'} = $spilist[0]; + $keyshash{'switch'}= $spilist[1]; + $keyshash{'port'} = $spilist[2]; push @switch_records, [\%keyshash, \%valueshash]; } } @@ -2225,17 +2225,17 @@ sub validate_node_entry{ next; } - if (! exists $allswitches{$spilist[0]}){ - $errmsg .= "Specified switch $spilist[0] is not defined\n"; + if (! exists $allswitches{$spilist[1]}){ + $errmsg .= "Specified switch $spilist[1] is not defined\n"; } # Not a valid number. - if (!($spilist[1] =~ /^\d+$/)){ - $errmsg .= "Specified port $spilist[1] is invalid\n"; + if (!($spilist[2] =~ /^\d+$/)){ + $errmsg .= "Specified port $spilist[2] is invalid\n"; } # now, we need to check "swith_switchport" string list to avoid duplicate config - my $switch_port = $spilist[0] . "_" . $spilist[1]; + my $switch_port = $spilist[1] . "_" . $spilist[2]; if (exists $all_switchports{$switch_port}){ - $errmsg .= "Specified switch $spilist[0] and port $spilist[1] already exists in the database or in the nodeinfo file. You must use a new switch port.\n"; + $errmsg .= "Specified switch $spilist[1] and port $spilist[2] already exists in the database or in the nodeinfo file. You must use a new switch port.\n"; }else{ # after checking, add this one into all_switchports $all_switchports{$switch_port} = 0;