diff --git a/docs/source/guides/admin-guides/references/man1/getadapter.1.rst b/docs/source/guides/admin-guides/references/man1/getadapter.1.rst index d1046d6ca..7bd216c97 100644 --- a/docs/source/guides/admin-guides/references/man1/getadapter.1.rst +++ b/docs/source/guides/admin-guides/references/man1/getadapter.1.rst @@ -33,12 +33,11 @@ Traditionally, network interfaces in Linux are enumerated as eth[0123...], but t \ **getadapter**\ use genesis to collect network adapters information, so that mean it need to restart the target node. -\ **getadapter**\ follows below scheme: +\ **getadapter**\ For each node within the , follows below scheme: -If the target node is scaned for the first time, \ **getadapter**\ will trigger genesis to collect information then save the information at local. -If the target node has ever been scaned, i.e. this node has network device information in local, \ **getadapter**\ use the local information first. -If user doesn't want to use local information, can use \ **-f**\ option to force to trigger new round scan process. -if part nodes of \ *noderange*\ don't have network device information in local and the rest have, \ **getadapter**\ only trigger real scan process for these nodes which don't have local information, the nodes have network device information in local, \ **getadapter**\ still use the local information first. +If the target node is scaned for the first time, \ **getadapter**\ will trigger genesis to collect information then save the information at the \ **nicsadapter**\ column of nics table. +If the target node has ever been scaned, \ **getadapter**\ will use the information from nics table first. +If user hopes to scan the adapter information for the node but these information already exist, \ **-f**\ option can be used to start rescan process. \ **getadapter**\ tries to collect more information for the target network device, but doesn't guarantee collect same much information for every network device. diff --git a/xCAT-client/pods/man1/getadapter.1.pod b/xCAT-client/pods/man1/getadapter.1.pod index 2fca0dac1..0c10af7a1 100644 --- a/xCAT-client/pods/man1/getadapter.1.pod +++ b/xCAT-client/pods/man1/getadapter.1.pod @@ -14,12 +14,11 @@ Traditionally, network interfaces in Linux are enumerated as eth[0123...], but t B use genesis to collect network adapters information, so that mean it need to restart the target node. -B follows below scheme: +B For each node within the , follows below scheme: -If the target node is scaned for the first time, B will trigger genesis to collect information then save the information at local. -If the target node has ever been scaned, i.e. this node has network device information in local, B use the local information first. -If user doesn't want to use local information, can use B<-f> option to force to trigger new round scan process. -if part nodes of I don't have network device information in local and the rest have, B only trigger real scan process for these nodes which don't have local information, the nodes have network device information in local, B still use the local information first. +If the target node is scaned for the first time, B will trigger genesis to collect information then save the information at the B column of nics table. +If the target node has ever been scaned, B will use the information from nics table first. +If user hopes to scan the adapter information for the node but these information already exist, B<-f> option can be used to start rescan process. B tries to collect more information for the target network device, but doesn't guarantee collect same much information for every network device. diff --git a/xCAT-server/lib/xcat/plugins/getadapter.pm b/xCAT-server/lib/xcat/plugins/getadapter.pm index ccacbad75..19edc1817 100644 --- a/xCAT-server/lib/xcat/plugins/getadapter.pm +++ b/xCAT-server/lib/xcat/plugins/getadapter.pm @@ -304,66 +304,16 @@ sub deploy_genesis { my ($node, $node_desc_ptr, $callback, $subreq) = @_; my $outref = xCAT::Utils->runxcmd( { - command => ['nodeset'], + command => ['rinstall'], node => ["$node"], arg => ['runcmd=getadapter'], }, $subreq, 0, 1); if ($::RUNCMD_RC != 0) { - $callback->({ error => "failed to run command: nodeset $node runcmd=getadapter", errorcode => 1 }); - return 1; - } - - # TODO: use rinstall to replace the following code when rinstall is ready. - if ($node_desc_ptr->{mgt} eq "ipmi") { - $outref = xCAT::Utils->runxcmd( - { - command => ["rsetboot"], - node => ["$node"], - arg => ['net'], - }, - $subreq, 0, 1); - if ($::RUNCMD_RC != 0) { - $callback->({ error => "failed to run command: rsetboot $node net", errorcode => 1 }); - return 1; + foreach my $out (@$outref) { + $callback->({data => "$out"}) } - $outref = xCAT::Utils->runxcmd( - { - command => ['rpower'], - node => ["$node"], - arg => ['reset'], - }, - $subreq, 0, 1); - if ($::RUNCMD_RC != 0) { - $callback->({ error => "failed to run command: rpower $node reset", errorcode => 1 }); - return 1; - } - } elsif ($node_desc_ptr->{mgt} eq "kvm") { - $outref = xCAT::Utils->runxcmd( - { - command => ['rpower'], - node => ["$node"], - arg => ['reset'], - }, - $subreq, 0, 1); - if ($::RUNCMD_RC != 0) { - $callback->({ error => "failed to run command: rpower $node reset", errorcode => 1 }); - return 1; - } - } elsif ($node_desc_ptr->{mgt} eq "hmc") { - $outref = xCAT::Utils->runxcmd( - { - command => ["rnetboot"], - node => ["$node"], - }, - $subreq, 0, 1); - if ($::RUNCMD_RC != 0) { - $callback->({ error => "failed to run command: rnetboot $node", errorcode => 1 }); - return 1; - } - } else { - $callback->({ error => "$node: The mgt configuration is not supported by getadapter.", - errorcode => 1 }); + $callback->({ error => "failed to run command: rinstall $node runcmd=getadapter", errorcode => 1 }); return 1; } $callback->({ data => "$node: Booting into genesis, this could take several minutes..." }); @@ -495,8 +445,8 @@ sub update_adapter_result { } $callback->({ data => "$output" }); if (!$has_nic) { - $callback->({ data => "$node: Couldn't find interface name information detected by udevadm," - . " the nics table will not be updated." }); + $callback->({ data => "$node: nics talbe will not be updated as not any ". + "useful information could be found with udevadm command." }); return 0; } my $nics_table = xCAT::Table->new('nics');