From cd57082417deff052c5b8bccd0472934399ece02 Mon Sep 17 00:00:00 2001 From: linggao Date: Fri, 17 Oct 2008 13:41:14 +0000 Subject: [PATCH] rmc monitoring scaling enhancement, reduced time for configuring 130 nodes from 8m to 2m, deconfigring 130 nodes from 6m to 40s git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@2356 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-rmc/plugin/rmcmon.pm | 54 ++++++++++++++++++---------------- xCAT-rmc/scripts/configrmcnode | 4 +++ 2 files changed, 32 insertions(+), 26 deletions(-) diff --git a/xCAT-rmc/plugin/rmcmon.pm b/xCAT-rmc/plugin/rmcmon.pm index ca15feacf..c1d1e26d2 100644 --- a/xCAT-rmc/plugin/rmcmon.pm +++ b/xCAT-rmc/plugin/rmcmon.pm @@ -934,6 +934,7 @@ sub addNodes { my $mn_ipaddresses; my $result; my $first_time=1; + my @normal_nodes=(); foreach my $node(@mon_nodes) { my $mn_node_id_found=0; @@ -1010,26 +1011,20 @@ sub addNodes { } } } else { #normal nodes - #get info for the node - if (!$mn_node_id_found) { - ($mn_node_id, $mn_ipaddresses)=getNodeInfo($node, $flag); - if ($mn_node_id == -1) { - reportError($mn_ipaddresses, $callback); - next; - } - } - $result=`XCATBYPASS=Y $::XCATROOT/bin/xdcp $node $::XCATROOT/sbin/rmcmon/configrmcnode /tmp 2>&1`; - if ($?) { - my $error="cannot copy the file configrmcnode to node $node"; - reportError("cannot copy the file configrmcnode to node $node.\n$result", $callback); - next; - } - $result=`XCATBYPASS=Y $::XCATROOT/bin/xdsh $node NODE=$node NODEID=$mn_node_id MONMASTER=$master MS_NODEID=$ms_node_id /tmp/configrmcnode 1 2>&1`; - if ($?) { reportError($result, $callback);} + push(@normal_nodes, $node); } } } + #let updatenode command to handle the normal nodes as a bulk + if (@normal_nodes>0) { + my $nr=join(',',@normal_nodes); + $result=`XCATBYPASS=Y $::XCATROOT/bin/updatenode $nr configrmcnode 2>&1`; + if ($?) { + reportError($result, $callback); + } + } + return (0, "ok"); } @@ -1070,6 +1065,7 @@ sub removeNodes { my $ms_ipaddresses; my $result; my $first_time=1; + my @normal_nodes=(); #find in active nodes my $inactive_nodes=[]; @@ -1137,18 +1133,24 @@ sub removeNodes { $result=`XCATBYPASS=Y $::XCATROOT/bin/xdsh $node -l hscroot "rmrsrc-api -s IBM.MCP::\\\"NodeID=0x$ms_node_id\\\" 2>&1"`; if ($?) { reportError($result, $callback); } } else { #normal nodes - #copy the configuration script and run it locally - $result=`XCATBYPASS=Y $::XCATROOT/bin/xdcp $node $::XCATROOT/sbin/rmcmon/configrmcnode /tmp 2>&1 `; - if ($?) { - reportError("rmcmon:removeNodes: cannot copy the file configrmcnode to node $node.", $callback); - next; - } - - $result=`XCATBYPASS=Y $::XCATROOT/bin/xdsh $node NODE=$node MS_NODEID=$ms_node_id /tmp/configrmcnode -1 2>&1`; - if ($?) { reportError($result, $callback); } + push(@normal_nodes, $node); } } - } + } + + #let updatenode command to handle the normal nodes as a bulk + if (@normal_nodes>0) { + my $nr=join(',',@normal_nodes); + #copy the configuration script and run it locally + $result=`XCATBYPASS=Y $::XCATROOT/bin/xdcp $nr $::XCATROOT/sbin/rmcmon/configrmcnode /tmp 2>&1 `; + if ($?) { + reportError("rmcmon:removeNodes: cannot copy the file configrmcnode to nodes $nr:\$result", $callback); + next; + } + + $result=`XCATBYPASS=Y $::XCATROOT/bin/xdsh $nr MS_NODEID=$ms_node_id /tmp/configrmcnode -1 2>&1`; + if ($?) { reportError($result, $callback); } + } return (0, "ok"); } diff --git a/xCAT-rmc/scripts/configrmcnode b/xCAT-rmc/scripts/configrmcnode index 79bc6f5e1..7e1dcf7eb 100755 --- a/xCAT-rmc/scripts/configrmcnode +++ b/xCAT-rmc/scripts/configrmcnode @@ -18,6 +18,10 @@ else ADD=1 fi +if [ -z "$NODE" ]; then + NODE=`hostname` +fi + logger xCAT "configrmcnode: ADD=$ADD, NODE=$NODE, NODEID=$NODEID MONMASTER=$MONMASTER,MS_NODEID=$MS_NODEID" #check if rsct is installed and running