From 14856756e3c588761056871700853209e0f46e7b Mon Sep 17 00:00:00 2001 From: bp-sawyers Date: Wed, 19 Nov 2008 21:26:43 +0000 Subject: [PATCH] - system p discovery done - rvitals done - frame view fixed git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@2511 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-web/config/change.php | 2 - xCAT-web/config/db.css | 9 + xCAT-web/config/db.js | 4 +- xCAT-web/config/db.php | 2 +- xCAT-web/config/edittab.php | 18 +- xCAT-web/images/p6-575-front-blue.jpg | Bin 0 -> 20557 bytes xCAT-web/lib/functions.php | 47 ++-- xCAT-web/lib/phpinfo.php | 45 +--- xCAT-web/lib/style.css | 1 + xCAT-web/lib/test.php | 21 +- xCAT-web/lib/wizard.css | 12 + xCAT-web/lib/wizard.js | 14 +- xCAT-web/lib/wizard.php | 44 +++- xCAT-web/machines/attributes.css | 2 + xCAT-web/machines/discover.php | 360 ++++++++++++++++---------- xCAT-web/machines/frames.css | 2 +- xCAT-web/machines/frames.php | 14 +- xCAT-web/machines/groups.css | 6 + xCAT-web/machines/groups.js | 1 + xCAT-web/machines/groups.php | 11 +- xCAT-web/machines/noderangetree.js | 3 + xCAT-web/machines/rvitals.js | 10 + xCAT-web/machines/rvitals.php | 31 ++- xCAT-web/xCAT-web.spec | 4 +- 24 files changed, 433 insertions(+), 230 deletions(-) create mode 100644 xCAT-web/images/p6-575-front-blue.jpg create mode 100644 xCAT-web/machines/rvitals.js diff --git a/xCAT-web/config/change.php b/xCAT-web/config/change.php index beff421fa..2fb43177f 100644 --- a/xCAT-web/config/change.php +++ b/xCAT-web/config/change.php @@ -29,9 +29,7 @@ else { $editable = & $_SESSION["editable-$tab"]; # Modify the array with the new value from the editable widget - //$oldValue = $editable[$theLine][$theField]; $editable[$theLine][$theField] = $value; - //$s = 's=' . $editable[$theLine][$theField] . '.'; // This value goes back to the javascript editable object in the browser echo "$value"; diff --git a/xCAT-web/config/db.css b/xCAT-web/config/db.css index edd6159bd..0457f1fe0 100644 --- a/xCAT-web/config/db.css +++ b/xCAT-web/config/db.css @@ -24,6 +24,15 @@ margin-right: 0.6em; } +#tableHeading { margin-top: 0px; margin-bottom: 0px; } + +#helpLinks { margin-top: 0px; } + +#helpLinks A { + margin-left: 2em; + margin-right: 2em; +} + .middlepane { /* float: left; */ padding: 5px; diff --git a/xCAT-web/config/db.js b/xCAT-web/config/db.js index 0db225664..18bad22b8 100644 --- a/xCAT-web/config/db.js +++ b/xCAT-web/config/db.js @@ -31,9 +31,9 @@ function makeEditable(table, cellclass, imgclass, linkclass) { // Form a table row to add to the table function formRow(linenum, numCells, ooe) { var newrow = ''; -for (var i=1; i<=numCells; i++) { +for (var i=0; i' + val + ''; } newrow += ''; diff --git a/xCAT-web/config/db.php b/xCAT-web/config/db.php index e219096d6..59ff07339 100644 --- a/xCAT-web/config/db.php +++ b/xCAT-web/config/db.php @@ -22,7 +22,7 @@ echo "\n\n"; if(isset($_REQUEST['tab'])) { $tab = $_REQUEST['tab']; } else { $tab = "nodelist"; } -$p = "edittab.php?tab=$tab"; +//$p = "edittab.php?tab=$tab"; echo "
Loading $tab ...
\n"; //echo "
\n"; diff --git a/xCAT-web/config/edittab.php b/xCAT-web/config/edittab.php index f405ac2bb..23434ef6c 100644 --- a/xCAT-web/config/edittab.php +++ b/xCAT-web/config/edittab.php @@ -23,10 +23,19 @@ if(isset($_REQUEST['save'])) { // Get table contents //$f = splitTableFields2('"node01","node02","5000","off",,'); echo '

'; foreach ($f as $k => $v) { echo "$k=$v
"; } echo "

\n"; +/* echo "

$tab Table

"; -echo "\n"; +echo "
", getTabDescription($tab), "
\n"; echo "\n"; echo "
", getTabDescription($tab), "Column Descriptions
Regular Expression Support
\n"; +*/ +echo "

$tab Table:

", getTabDescription($tab), "
\n"; +echo "\n"; + +insertButtons(array('label' => 'Save', 'id' => 'saveit'), + array('label' => 'Cancel', 'id' => 'reset') + ); // Display the column names $xml = docmd('tabdump','',array($tab)); @@ -69,10 +78,9 @@ echo "\n"; $_SESSION["editable-$tab"] = & $editable; // save the array so we can access it in the next call of this file or change.php //unset($_SESSION["editable-$tab"]); -insertButtons(array('label' => 'Add Row', 'id' => 'newrow'), - array('label' => 'Save', 'id' => 'saveit'), - array('label' => 'Cancel', 'id' => 'reset') - ); +echo "

"; +insertButtons(array('label' => 'Add Row', 'id' => 'newrow')); +echo "

\n"; ?> diff --git a/xCAT-web/images/p6-575-front-blue.jpg b/xCAT-web/images/p6-575-front-blue.jpg new file mode 100644 index 0000000000000000000000000000000000000000..577afefc7979ac21af7a2baef55503d7c09ba653 GIT binary patch literal 20557 zcmbrl1z1&0+b_P>PGE1kySux)K}sYfrAs=M#sEQDKpF`_0qGDVMNm>&x|C8%Dao^a zp6C7E_k8D^>pK7cnSITg-l1afCz(9Fqr^@aWG{uCKG{B0K}AkG8G8_t9*mO)c@c{4CeT! z4FrP)F?|UzWjiJdVK51%9L8i~$iL;dM8p1)vx=!_jrkiFV><vaY7Ko-Tv3-c5bI zn~JwI^>qKKQ4ul)crZ%*(c@pGzKx5AAD^!3ErtMLK4CFHNI*bTN;2MzDXd z3I>D8f42cKR>4wm{?f`6Qx8x1d#pPcj7<4kJ{%a;!}04ex;Mj0>yp#NZE zj7;*vf7#161Qa3v(isX=N`n7j5YSYGVDO*ykb`OeC&4lK&ulAW%0DaOKW11!Qc6HV zN<`v+TZd^1ATarl4S((!;XkFKp|YkX25YF^G*)HMzp1INs(Xv!k5q>LB>@o34+J59 z`h$Pn5y(GUApqz$T|Gr&ILPv`47;30sLyNs(HW&pebXB!gqVAV(H8cXPDlh?^e+_{1&Lr7 z4ZN9%;X;wgB!4vMx;eTp%woIZ6P2QDNNVRRa=?oCqX3dkw0jJrL=m~Ys*#wV!|H#j z@PF2T{og8F&jM)ZUt-+W3wuK zvaO6>jAiMj%RrZu>4Ocg`ohuzG@lIem@!(6`2 z(LkVNF*0Jb$xeuB%4}$9MV4Os8j#~@ve(V`!ii{p+x1|J7@&lNt>#r&6{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U<6`zE%3 z`iA^ouUiRLr8wF$X>X^bOtH9nQiGd{=F?vO^jGS9?eOpR_5HOz8~i=6@YaLzQ})OB zi{W_e_5B9oT~o&&7Cc?8UD$Yn?^eCl(^-1=^E-6Hc%_TAxlX#`)jCX4KM!Ek0ubor*+gH&a9zW$2{v-bYve&Br z0O_;#z^$szQ;)pcvP)jcuj}T{8gPUoDRQSK^={W~^4;y^d9(*L$wB1D9d~x_+ z;p><$;)43m#y=ALGo;^5_MsGa15CGj$z+n&%NHAj*!we+yf@A((yjbS@Qx)*n;(w< z00wVGygy}W7vhJ8Zfyf3n-)Uw&H&5?Bo0|l`4vKhWflD5>p$`x)xYc^sekE3#d=4C zzvNuK{{XI^`&&<}Xw{NV&t%^3qFQ=>M%auU7`RqS(wmBDbh^He<@vs+^l@e5KZbLe zq`mmn@U*{`9B|1u#D5Q#V;Y#CjoMqLBrH*)Dk1q%HlPZi4QBBd!}}xNNBX4y0I!ID_N{vbm;8NQf55-=h*wN2 z%_Q{y0EW}IN{{UUS zGk@vd#}ugRJ$pC$oVbicsZ^s)MKvjFd+B7hJa6_C_(|~BQU3sfbl&_+zVP;yCymp? zf3!!0u6$1(lb|`a@bg=Ej?pI9b*Z%1)#0|XwDEU{JlQ0_7B<>m>|1$XZCjs%d^bIp zhxGfM9>L_eva;9wR+f|K4Gg+O*7A6xSe_Xy<%Gi&fznlJo+yzT;LKDJf`3W>0APRl vM0do$`xZZG&;2m!mHBbtU-=fTKkNHl{{Yker(4fhr|I~j@gE!Yf1&@`YLT}= literal 0 HcmV?d00001 diff --git a/xCAT-web/lib/functions.php b/xCAT-web/lib/functions.php index 854754b67..59fa5df08 100644 --- a/xCAT-web/lib/functions.php +++ b/xCAT-web/lib/functions.php @@ -237,7 +237,9 @@ function insertMenuRow($current, $isTop, $items) { //----------------------------------------------------------------------------- // Inserts the html for each pages footer function insertFooter() { -echo ''; +//echo "\n"; +echo "\n"; +echo ''; } @@ -251,7 +253,20 @@ function doTabrestore($tab, & $data){ $usernode->addChild('password',getpassword()); foreach($data as $line){ foreach ($line as &$f) { if (!empty($f) && !preg_match('/^".*"$/', $f)) { $f = '"'.$f.'"'; } } + + // Combine the elements of the array, but have to handle sparse arrays + ksort($line, SORT_NUMERIC); + $keys = array_keys($line); + $maxindex = count($line)-1; + //echo "

"; print_r($line); echo "

"; + //trace("$maxindex, $keys[$maxindex]"); + if ($keys[$maxindex] != $maxindex) { // need to fill in some values + for ($i=0; $i<=$keys[$maxindex]; $i++) { if (!isset($line[$i])) {$line[$i]='';} } + ksort($line, SORT_NUMERIC); + } $linestr = implode(",",$line); + //trace($linestr); + $linestr = str_replace('"', '"',$linestr); //todo: should we use the htmlentities function? $linestr = str_replace("'", ''',$linestr); //echo "

addChild:$linestr.

\n"; @@ -677,11 +692,11 @@ $HWTypeInfo = array ( 'p5-595' => array ( 'image'=>'590.gif', 'rackimage'=>'p5-590-front', 'u'=>42, 'aliases'=>'' ), # 9119 # POWER 6 servers - '520' => array ( 'image'=>'520.gif', 'rackimage'=>'p5-520-front', 'u'=>4, 'aliases'=>'8203' ), - '550' => array ( 'image'=>'520.gif', 'rackimage'=>'p5-520-front', 'u'=>4, 'aliases'=>'8204' ), - '570' => array ( 'image'=>'520.gif', 'rackimage'=>'p5-520-front', 'u'=>4, 'aliases'=>'9117' ), - '575' => array ( 'image'=>'342.gif', 'rackimage'=>'x345-front', 'u'=>2, 'aliases'=>'9125' ), - '595' => array ( 'image'=>'590.gif', 'rackimage'=>'p5-590-front', 'u'=>42, 'aliases'=>'9119' ), + 'p6-520' => array ( 'image'=>'520.gif', 'rackimage'=>'p5-520-front', 'u'=>4, 'aliases'=>'8203,520' ), + 'p6-550' => array ( 'image'=>'520.gif', 'rackimage'=>'p5-520-front', 'u'=>4, 'aliases'=>'8204,550' ), + 'p6-570' => array ( 'image'=>'520.gif', 'rackimage'=>'p5-520-front', 'u'=>4, 'aliases'=>'9117,570' ), + 'p6-575' => array ( 'image'=>'342.gif', 'rackimage'=>'p6-575-front', 'u'=>2, 'aliases'=>'9125,575' ), + 'p6-595' => array ( 'image'=>'590.gif', 'rackimage'=>'p5-590-front', 'u'=>42, 'aliases'=>'9119,595' ), ); @@ -801,7 +816,7 @@ function getPref($key) { //----------------------------------------------------------------------------- // Returns a list of some or all of the nodes in the cluster and some of their attributes. // Pass in a node range (or NULL to get all nodes) and an array of attribute names (or NULL for none). -// Returns an array where each key is the node name and each value is an array of attr/value pairs. +// Returns an array where each key is the node name and each value is an array of attr/value pairs (unless only 1 attr was request, in which case it is just the attr value). // attrs is an array of attributes that should be returned. function getNodes($noderange, $attrs) { //my ($hostname, $type, $osname, $distro, $version, $mode, $status, $conport, $hcp, $nodeid, $pmethod, $location, $comment) = split(/:\|:/, $na); @@ -810,19 +825,21 @@ function getNodes($noderange, $attrs) { if (empty($noderange)) { $nodrange = '/.*'; } //$xml = docmd('nodels',$noderange,implode(' ',$attrs)); $xml = docmd('nodels',$noderange,$attrs); + //echo "

"; print_r($xml); echo "

\n"; foreach ($xml->children() as $response) foreach ($response->children() as $o) { $nodename = (string)$o->name; $data = & $o->data; $attrval = (string)$data->contents; if (empty($attrval)) { continue; } - $attrname = (string)$data->desc; - //echo "

$attrname = $attrval

\n"; - //echo "

"; print_r($nodename); echo "

\n"; - //echo "

"; print_r($o); echo "

\n"; - //$nodes[$nodename] = array('osversion' => $attr); - if (!array_key_exists($nodename,$nodes)) { $nodes[$nodename] = array(); } - $attributes = & $nodes[$nodename]; - $attributes[$attrname] = $attrval; + if (count($attrs) > 1) { // if more than 1 attr requested, the output will include the attr description (name) + $attrname = (string)$data->desc; + if (!array_key_exists($nodename,$nodes)) { $nodes[$nodename] = array(); } + $attributes = & $nodes[$nodename]; + $attributes[$attrname] = $attrval; + } + else { // only 1 attr, so no attr name + $nodes[$nodename] = $attrval; + } } return $nodes; } diff --git a/xCAT-web/lib/phpinfo.php b/xCAT-web/lib/phpinfo.php index b0defa554..d76f391b3 100644 --- a/xCAT-web/lib/phpinfo.php +++ b/xCAT-web/lib/phpinfo.php @@ -1,49 +1,18 @@ - - -phpinfo - - - - - - - - - -EOS1; - -echo << - -
-

First tab is active by default

-
-
-

Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.

-
- - - -EOS; +require_once "../lib/functions.php"; +echo ''; +echo "\n"; +echo "\n"; +echo "\n"; //insertLogin(); -/* dumpGlobals(); +/* $xml = docmd("authcheck","",NULL); echo "

authcheck:
\n"; foreach ($xml->children() as $response) foreach ($response->children() as $t) { echo (string) $t, "
\n"; } @@ -53,9 +22,9 @@ $xml = docmd('tabdump','',NULL); echo "

tabdump:
\n"; foreach ($xml->children() as $response) foreach ($response->children() as $t) { echo (string) $t, "
\n"; } echo "

\n"; +*/ phpinfo(); -*/ echo "\n"; ?> \ No newline at end of file diff --git a/xCAT-web/lib/style.css b/xCAT-web/lib/style.css index bf9898d1a..64a4c0d58 100644 --- a/xCAT-web/lib/style.css +++ b/xCAT-web/lib/style.css @@ -209,6 +209,7 @@ TEXTAREA {vertical-align : middle; font-size : 8pt; font-family : sans-serif; fo .Hidden { visibility : hidden ;} .Txtfld {font-size : 8pt; font-family : sans-serif; font-weight : bold;} .NotDone { font-weight: bold; font-size: 11pt; color: red; text-align: center; margin: 5px; } +.Emphasis { font-weight: bold; } /* diff --git a/xCAT-web/lib/test.php b/xCAT-web/lib/test.php index 3ca41647f..82a81395a 100644 --- a/xCAT-web/lib/test.php +++ b/xCAT-web/lib/test.php @@ -13,16 +13,31 @@ echo "\n"; */ echo "\n"; -echo "

adfasd asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf

\n"; -echo "\n"; + +$a = array('a', 'b', 'c'); +$b = array('d', 'e'); +$c = array_merge($a, $b); +echo "

"; print_r($c); echo "

\n"; + +$d = array('f'); +echo "

implode(a):", implode(',',$a), ".

\n"; +echo "

implode(d):", implode(',',$d), ".

\n"; + +$var2 = @$somevar; +echo "

unset var is:", $var2, ".

\n"; + +//echo ""; +//echo "

adfasd asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf

\n"; +//echo "\n"; //echo "\n"; echo "\n"; } else { -for ($i=1; $i<=5; $i++) { +for ($i=1; $i<=2; $i++) { sleep(1); echo "

Line $i adfasd asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf ads fasdf asdf asdf asdf asdf asdf asdf asfd asdf asdf asdf asdf asdf asdf asdf adsf asdf asdf asd ff asdf adsf asdf asdf asdf asdf asd f

\n"; ob_flush(); flush(); } +echo ""; } ?> \ No newline at end of file diff --git a/xCAT-web/lib/wizard.css b/xCAT-web/lib/wizard.css index 4ff98b409..2378af087 100644 --- a/xCAT-web/lib/wizard.css +++ b/xCAT-web/lib/wizard.css @@ -24,10 +24,16 @@ margin-bottom: 5px; } +.WizardInputSection { background-color: #EAEAFF; /* #E5E5FF; */ } + .NonCurrentSummaryItem {} .CurrentSummaryItem { background-color: yellow; } +.WizardInputTable { + margin-bottom: 20px; +} + .WizardProgressTable { margin: 10px 0px; /* text-align: left; */ @@ -44,6 +50,12 @@ .WizardProgressTable IMG { margin-right: 1em; margin-left: 1em; } +.WizardProgressTable P#output { margin-left: 35px; } + +.WizardProgressTable IFRAME#output { margin-left: 35px; width: 400px; } + +.WizardProgressOutput { margin: 0px; } + .WizardProgressCurrent { /* font-weight: bold; */ background-color: #D8E8FF; /* yellow; */ diff --git a/xCAT-web/lib/wizard.js b/xCAT-web/lib/wizard.js index 092b218f3..23de610b2 100644 --- a/xCAT-web/lib/wizard.js +++ b/xCAT-web/lib/wizard.js @@ -21,12 +21,11 @@ $("#wizardPane").load("?a=1", props); // Repeatedly make a json call to the server until it tells us there are no more steps -function wizardStep(step, done, error) { -//todo: handle errors +function wizardStep(step, done) { // Mark the previous step as complete if (step > 1) { var prevstep = step -1; - $(".WizardProgressTable #step"+prevstep).removeClass("WizardProgressCurrent"); + $(".WizardProgressTable #step"+prevstep+" #task").removeClass("WizardProgressCurrent"); $(".WizardProgressTable #step"+prevstep+" #chk").attr('src','../images/checked-box.gif'); //$(".WizardProgressTable #step"+prevstep+" #spinner").hide(); $(".WizardProgressTable #step"+prevstep+" #spinner").attr('src', '../images/invisible.gif'); @@ -36,7 +35,7 @@ if (done) { return; } //alert('here'); // Make the current item bold -$(".WizardProgressTable #step"+step).addClass("WizardProgressCurrent"); +$(".WizardProgressTable #step"+step+" #task").addClass("WizardProgressCurrent"); //$(".WizardProgressTable #step"+step).append(""); $(".WizardProgressTable #step"+step+" #spinner").attr('src', '../images/throbber.gif'); @@ -44,10 +43,15 @@ $(".WizardProgressTable #step"+step+" #spinner").attr('src', '../images/throbber var props = { page: window.currentPage, action: 'step', step: step }; //alert('props page:'+props.page+ ' action:'+props.action+' step:'+props.step); -//jQuery.getJSON('?page='+window.currentPage+'&action=step&step='+step, {}, function(json) { +/* jQuery.post('?a=1', props, function(json, textStatus) { wizardStep(json.step, json.done, json.error); }, 'json'); +*/ +// Decide if this task has a P or IFRAME for the output and invoke the function appropriately. +var output = $(".WizardProgressTable #step"+step+" #output"); +if (output.is('IFRAME')) { output.attr('src','?page='+props.page+'&action='+props.action+'&step='+props.step+'&output=1'); } +else { output.load("?a=1", props); } } diff --git a/xCAT-web/lib/wizard.php b/xCAT-web/lib/wizard.php index 74a38d78a..69ddf252c 100644 --- a/xCAT-web/lib/wizard.php +++ b/xCAT-web/lib/wizard.php @@ -43,6 +43,7 @@ if (isset($_REQUEST['page'])) { // navigate to another page in the wizard // Run the function for this page //dumpGlobals(); + if (isset($_REQUEST['output'])) { insertWizardOutputHeader(); } if ($action != 'step') configureButtons($k, $pages); $keys[$k]($action, $step); } @@ -102,12 +103,53 @@ echo "\n"; //----------------------------------------------------------------------------- +// Display a list of tasks to be done. function insertProgressTable($tasks) { global $TOPDIR; echo "
    \n"; foreach ($tasks as $k => $t) { - echo "
  • $t
  • \n"; + if (is_array($t)) { + $text = $t[0]; + $type = $t[1]; + } + else { + $text = $t; + $type = 'onlyerrors'; + } + if ($type == 'disabled') $cl = 'class=Disabled'; + else $cl = ''; + echo "
  • $text

    \n"; + if ($type == 'output') { + echo "
  • \n"; + } + else { echo "

    \n"; } } echo "
\n"; } + + +//----------------------------------------------------------------------------- +// Instruct the client-side to move on to the next step in this page. +function nextStep($step, $done) { +// Was using JSON, but that is more difficult with all the utilities that can directly display errors they encounter. +//echo json_encode(array('step' => (integer)++$step, 'done' => FALSE, 'error' => '')); + +$func = (isset($_REQUEST['output']) ? 'parent.wizardStep' : 'wizardStep'); +echo ""; +} + + +//----------------------------------------------------------------------------- +// Used for the html that we send to the iframe +function insertWizardOutputHeader() { +echo << + + + + + +EOS1; +} + ?> \ No newline at end of file diff --git a/xCAT-web/machines/attributes.css b/xCAT-web/machines/attributes.css index d4023d2a2..a294e2d85 100644 --- a/xCAT-web/machines/attributes.css +++ b/xCAT-web/machines/attributes.css @@ -10,6 +10,8 @@ #nodeAttrTable { background-color: #F9F9F9; } +#nodeAttrTable TD { white-space: nowrap; } + .colHeaders { font-weight: bold; text-align: center; diff --git a/xCAT-web/machines/discover.php b/xCAT-web/machines/discover.php index 213ec2092..b78060dae 100644 --- a/xCAT-web/machines/discover.php +++ b/xCAT-web/machines/discover.php @@ -49,6 +49,7 @@ function expandNR($nr) { // see pping as an example of the client/server for noderange expansion $a = array(); if (empty($nr)) return $a; +if (strpos($nr,'-')===FALSE) { $a[] = $nr; return $a; } // a single node list($begin, $end) = explode('-', $nr); $begParts = array(); if (!preg_match('/^(\D+)(\d+)$/', $begin, $begParts)) { msg('E',"Error in noderange syntax: $nr"); return NULL; } @@ -72,13 +73,34 @@ echo " Choose which type of hardware you want to discover, and then click Next.< echo "
    \n"; echo "
  • \n"; echo "
  • \n"; +echo "

     



    \n"; echo "
\n"; } //----------------------------------------------------------------------------- function patterns($action, $step) { -echo "
\n"; +echo "
\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; + +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; + +echo "\n"; +echo "\n"; +echo "\n"; + +echo "\n"; +echo "\n"; +echo "\n"; + +/* echo "\n"; echo "\n"; echo "\n"; @@ -96,6 +118,8 @@ echo "< echo "\n"; echo "\n"; echo "\n"; +*/ + echo "

Service LAN Switches

HMCs

Frames (BPAs)

Drawers (FSPs/CECs)

Switch Patterns

Drawer (FSP/CEC) Patterns

\n"; //todo: get HCP userids/pws from the user @@ -117,18 +141,19 @@ if (!$_SESSION['portsPerSwitch']) { $numswitches = 1; } else { $numswitches = (integer) ((($total-1) / $_SESSION['portsPerSwitch']) + 1); } //echo "

$numswitches

\n"; -echo "
\n"; +echo "
\n"; echo "\n"; $switches = expandNR($_SESSION['switchHostname']); //todo: if count($switches) != $numswitches, then we have a problem foreach ($switches as $k => $sw) { $num = $k + 1; - echo "\n"; + echo "\n"; } echo "\n"; -echo "\n"; +echo "\n"; +echo "

 

\n"; echo "

Switch Port Assignments

Discovery Information

\n"; } @@ -136,20 +161,20 @@ echo "\n"; //----------------------------------------------------------------------------- function patterns2($action, $step) { savePostVars(); -echo "
\n"; +echo "
\n"; // For now, many of the BB fields are disabled -echo "\n"; -echo "\n"; -echo ""; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; +echo "\n"; +echo "\n"; +echo ""; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; echo "\n"; -echo "\n"; +echo "\n"; echo "

Building Blocks

(Subnet address for nodes in each Building Block)

Building Blocks

(Subnet address for nodes in each Building Block)

LPAR Information

\n"; // do we need to get any info about the resources that should be in each lpar, or do we just divide them evenly? } @@ -160,17 +185,17 @@ global $TOPDIR; if ($step == 0) { savePostVars(); - insertProgressTable(array('Write xCAT switch table.', - 'Write xCAT hosts table.', - 'Define networks.', - 'Configure DHCP.', + insertProgressTable(array('Wrote xCAT switch table.', + 'Wrote xCAT hosts table.', + 'Defined networks.', + 'Configured DHCP.', )); - if ($action != 'back') { echo ""; } + if ($action != 'back') { nextStep(1,FALSE); } } elseif ($step == 1) { writeSwitchTable($step); } elseif ($step == 2) { writeHostsTable($step); } -elseif ($step == 3) { setDynRange($_SESSION["dynamicIP"], $step); } +elseif ($step == 3) { setDynRange(@$_SESSION["dynamicIP"], $step); } elseif ($step == 4) { makedhcp($step); } } @@ -196,11 +221,12 @@ foreach ($switches as $k => $sw) { if (preg_match('/^hmc$/i',$type)) $ar=&$hmcs; elseif (preg_match('/^bpa$/i',$type)) $ar=&$bpas; elseif (preg_match('/^fsp$/i',$type)) $ar=&$fsps; + elseif (preg_match('/^space$/i',$type)) {if ($num=='*') {break;} $port+=$num; if ($port>$numports) break; else continue;} else { msg('E', "Invalid HW control point type in $s"); return; } if ($num == '*') { $num = count($ar); } for ($i=1; $i<=$num; $i++) { $node = array_shift($ar); - $data[] = array($node,$sw,$port); + $data[] = array($node,$sw,@$_SESSION['portPrefix'].$port); /* $xml = docmd('nodeadd',NULL,array($node,'groups=all',"switch.node=$node","switch.switch=$sw","switch.port=$port")); if (getXmlErrors($xml,$errors)) { msg('E',"nodeadd failed: " . implode(' ',$errors)); return; } else { echo "Wrote: $node,$sw,$port
\n"; }*/ @@ -211,12 +237,9 @@ foreach ($switches as $k => $sw) { //echo "

\n"; ob_flush(); flush(); //array_unshift($data, array('#node,switch,port,vlan,interface,comments,disable')); $xml = doTabrestore('switch', $data); -//$errors = array(); -if (getXmlErrors($xml,$errors)) { msg('E',"tabrestore switch failed: " . implode(' ',$errors)); return; } +if (getXmlErrors($xml,$errors)) { msg('E',"tabrestore switch failed: " . implode(' ',$errors)); nextStep(++$step,TRUE); return; } -// Send JSON data back to the browser. Todo: handle the errors too. -echo json_encode(array('step' => (integer)++$step, 'done' => FALSE, 'error' => '')); -//echo ""; +nextStep(++$step,FALSE); } @@ -234,22 +257,26 @@ $data = array(array('#node,ip,hostnames,comments,disable')); foreach ($machines as $ip => $ar) { // this loop goes thru each type of hw foreach ($ar as $hostname) { // this loop goes thru each of the hostnames for that type of hw $data[] = array($hostname,$ip); - //echo "Wrote: $hostname,$ip
\n"; + //echo "

Wrote: $hostname,$ip

\n"; ob_flush(); flush(); + //sleep(1); // remove incrementIP($ip); } } //echo "

\n"; ob_flush(); flush(); $xml = doTabrestore('hosts', $data); -$errors = array(); -if (getXmlErrors($xml,$errors)) { msg('E',"tabrestore hosts failed: " . implode(' ',$errors)); return; } +if (getXmlErrors($xml,$errors)) { msg('E',"tabrestore hosts failed: " . implode(' ',$errors)); nextStep(++$step,TRUE); return; } -// Send JSON data back to the browser. Todo: handle the errors too. -echo json_encode(array('step' => (integer)++$step, 'done' => FALSE, 'error' => '')); +nextStep(++$step,FALSE); } //----------------------------------------------------------------------------- function incrementIP(& $ip) { + +//todo: hard coded for the percs demo cluster - remove +if ($ip == '192.168.200.233') { $ip='192.168.200.237'; return; } +if ($ip == '192.168.200.237') { $ip='192.168.200.239'; return; } + $parts = explode('.', $ip); $parts[3]++; if ($parts[3] >= 255) { @@ -263,38 +290,44 @@ $ip = implode('.', $parts); //----------------------------------------------------------------------------- //todo: we need a better way to change the networks table than tabdump/tabrestore. We can not use chtab because its not client/svr. We can not use chdef because there is no netname defined by makenetworks. function setDynRange($range, $step) { -// Get the whole table via tabdump -$xml = docmd('tabdump','',array('networks')); -$data = array(); -foreach ($xml->children() as $response) foreach ($response->children() as $line) { - $line = (string) $line; - if(ereg("^#", $line)) { // handle the header specially - $data[] = array($line); - continue; + +if (isset($range) && !empty($range)) { // only set the dyn range if they entered it, otherwise another machine may be providing dynamic ranges + // Get the whole table via tabdump + $xml = docmd('tabdump','',array('networks')); + if (getXmlErrors($xml,$errors)) { msg('E',"tabdump networks failed: " . implode(' ',$errors)); nextStep(++$step,TRUE); return; } + $data = array(); + foreach ($xml->children() as $response) foreach ($response->children() as $line) { + $line = (string) $line; + if(ereg("^#", $line)) { // handle the header specially + $data[] = array($line); + continue; + } + $values = splitTableFields($line); + //todo: only give the dynamic range to the network that has same ip as the dyn range + $values[8] = '"' . $range . '"'; // dynamicrange is the 9th field + $data[] = $values; } - $values = splitTableFields($line); - $values[8] = '"' . $range . '"'; // dynamicrange is the 9th field - $data[] = $values; + + // Now restore that data back into the networks table + $xml = doTabrestore('networks', $data); + if (getXmlErrors($xml,$errors)) { msg('E',"tabrestore networks failed: " . implode(' ',$errors)); nextStep(++$step,TRUE); return; } } -// Now restore that data back into the networks table -$xml = doTabrestore('networks', $data); -$errors = array(); -if (getXmlErrors($xml,$errors)) { msg('E',"tabrestore networks failed: " . implode(' ',$errors)); return; } - -// Send JSON data back to the browser. Todo: handle the errors too. -echo json_encode(array('step' => (integer)++$step, 'done' => FALSE, 'error' => '')); +nextStep(++$step,FALSE); } //----------------------------------------------------------------------------- function makedhcp($step) { -$xml = docmd('makedhcp',NULL,array('-n')); -$errors = array(); -if (getXmlErrors($xml,$errors)) { msg('E',"makedhcp failed: " . implode(' ',$errors)); return; } +//todo: remove this check because we should always be running makedhcp, but it is starting dhcpd, which we do not want on the demo system +if (isset($_SESSION["dynamicIP"]) && !empty($_SESSION["dynamicIP"])) { + $xml = docmd('makedhcp',NULL,array('-n')); + if (getXmlErrors($xml,$errors)) { msg('E',"makedhcp failed: " . implode(' ',$errors)); nextStep(++$step,TRUE); return; } + } -// Send JSON data back to the browser. Todo: handle the errors too. -echo json_encode(array('step' => (integer)++$step, 'done' => TRUE, 'error' => '')); +//todo: also need to restart makedhcp so the omapi config takes hold + +nextStep(++$step,TRUE); } @@ -305,6 +338,7 @@ echo "

Do the following manual steps now:

\n"; echo "
  1. Power on all of the HMCs.
  2. \n"; echo "
  3. Then power on all of frames.
  4. \n"; echo "
  5. Then click Next to discover the hardware on the service network.
  6. \n"; +echo "

     



    \n"; echo "
\n"; } @@ -313,8 +347,8 @@ echo "\n"; function discover($action, $step) { global $TOPDIR; if ($step == 0) { - insertProgressTable(array('Discover HMCs, BPAs, and FSPs.')); - if ($action != 'back') { echo ""; } + insertProgressTable(array(array('Discovered HMCs, BPAs, and FSPs.','output'))); + if ($action != 'back') { nextStep(1,FALSE); } } elseif ($step == 1) { lsslp($step); } @@ -324,24 +358,24 @@ elseif ($step == 1) { lsslp($step); } //----------------------------------------------------------------------------- //todo: we are just simulating lsslp right now function lsslp($step) { -/* todo: show this -echo "

"; -echo "Discovered HMCs: ", $_SESSION['hmcHostname'], "
\n"; -echo "Discovered BPAs: ", $_SESSION['bpaHostname'], "
\n"; -echo "Discovered FSPs: ", $_SESSION['fspHostname'], "
\n"; -echo "

\n"; -*/ -//$errors = array(); -$xml = docmd('nodeadd',NULL,array($_SESSION['hmcHostname'],'groups=hmc,all','nodetype.nodetype=hmc')); -if (getXmlErrors($xml,$errors)) { msg('E',"nodeadd hmc failed: " . implode(' ',$errors)); return; } +$xml = docmd('nodeadd',NULL,array($_SESSION['hmcHostname'],'groups=hmc,all','nodetype.nodetype=hmc','nodehm.mgt=hmc')); +if (getXmlErrors($xml,$errors)) { msg('E',"nodeadd hmc failed: " . implode(' ',$errors)); nextStep(++$step,TRUE); return; } +echo "

Discovered and defined ", $_SESSION['hmcHostname'], ".

\n"; ob_flush(); flush(); -$xml = docmd('nodeadd',NULL,array($_SESSION['bpaHostname'],'groups=bpa,all','nodetype.nodetype=bpa','nodehm.mgt=hmc','nodehm.power=hmc','ppc.comments=bpa','vpd.serial=|(\D+)(\d+)|($2)|','vpd.mtm=|(\D+)(\d+)|($1)|')); -if (getXmlErrors($xml,$errors)) { msg('E',"nodeadd bpa failed: " . implode(' ',$errors)); return; } +$xml = docmd('nodeadd',NULL,array($_SESSION['bpaHostname'],'groups=frame,all','nodetype.nodetype=bpa','nodehm.mgt=hmc','nodehm.power=hmc','ppc.comments=bpa','vpd.mtm=9A00-100' /* ,'vpd.serial=|(\D+)(\d+)|($2)|' */ )); +if (getXmlErrors($xml,$errors)) { msg('E',"nodeadd bpa failed: " . implode(' ',$errors)); nextStep(++$step,TRUE); return; } +echo "

Discovered and defined ", $_SESSION['bpaHostname'], ".

\n"; ob_flush(); flush(); -// We are assuming there are 4 fsps in each bpa -$xml = docmd('nodeadd',NULL,array($_SESSION['fspHostname'],'groups=fsp,all','nodetype.nodetype=fsp','nodehm.mgt=hmc','nodehm.power=hmc','ppc.id=|\D+(\d+)|((($1-1)%4)+1)|','ppc.parent=|(\D+)(\d+)|b((($2-1)/4)+1)|','vpd.serial=|(\D+)(\d+)|($2)|','vpd.mtm=|(\D+)(\d+)|($1)|')); -if (getXmlErrors($xml,$errors)) { msg('E',"nodeadd fsp failed: " . implode(' ',$errors)); return; } +$parts = array(); +preg_match('/^(\D+)/', $_SESSION['bpaHostname'], $parts); +$bpaprefix = $parts[1]; + +// We are assuming there are 5 fsps in each bpa +//todo: when we use the real lsslp, it probably will not set nodepos attrs +$xml = docmd('nodeadd',NULL,array($_SESSION['fspHostname'],'groups=cec,all','nodetype.nodetype=fsp','nodehm.mgt=hmc','nodehm.power=hmc','ppc.id=|\D+(\d+)|((((($1-1)%5)+1)*2)-1)|','ppc.parent=|\D+(\d+)|'.$bpaprefix.'((($1-1)/5)+1)|','nodepos.u=|\D+(\d+)|((((($1-1)%5)+1)*2)-1)|','nodepos.rack=|\D+(\d+)|((($1-1)/5)+1)|','vpd.mtm=9125-F2A' /* ,'vpd.serial=|(\D+)(\d+)|($2)|' */ )); +if (getXmlErrors($xml,$errors)) { msg('E',"nodeadd fsp failed: " . implode(' ',$errors)); nextStep(++$step,TRUE); return; } +echo "

Discovered and defined ", $_SESSION['fspHostname'], ".

\n"; ob_flush(); flush(); /* $xml = docmd('chdef',NULL,array('-t','group','bpa','serial=|(\D+)(\d+)|($2)|','mtm=|(\D+)(\d+)|($1)|')); @@ -350,8 +384,7 @@ $xml = docmd('chdef',NULL,array('-t','group','fsp','serial=|(\D+)(\d+)|($2)|','m if (getXmlErrors($xml,$errors)) { msg('E',"chdef fsp failed: " . implode(' ',$errors)); return; } */ -// Send JSON data back to the browser. Todo: handle the errors too. -echo json_encode(array('step' => (integer)++$step, 'done' => TRUE, 'error' => '')); +nextStep(++$step,TRUE); } @@ -359,49 +392,76 @@ echo json_encode(array('step' => (integer)++$step, 'done' => TRUE, 'error' => '' function updatedefs($action, $step) { global $TOPDIR; if ($step == 0) { - insertProgressTable(array('Determine which CECs each HMC should manage.', - 'Create HW control point node groups.', - 'Assign frame numbers.', - /* 'Assign supernode numbers and building block numbers.', - 'Assign building block subnets.', */ - 'Update name resolution.', + insertProgressTable(array('Assigned frame numbers.', + 'Determined which CECs/Frames each HMC should manage.', + 'Created HW control point node groups.', + /* 'Assigned supernode numbers and building block numbers.', + 'Assigned building block subnets.', */ + 'Updated name resolution.', )); - if ($action != 'back') { echo ""; } + if ($action != 'back') { nextStep(1,FALSE); } } -elseif ($step == 1) { assigncecs($step); } -elseif ($step == 2) { createhcpgroups($step); } -elseif ($step == 3) { assignframenums($step); } +elseif ($step == 1) { assignframenums($step); } +elseif ($step == 2) { assigncecs($step); } +elseif ($step == 3) { createhcpgroups($step); } elseif ($step == 4) { nameres($step); } } +//----------------------------------------------------------------------------- +// Give frame numbers to each bpa +function assignframenums($step) { +//todo: this just uses the number from the nodename of the frame. Should instead count from the beginning. +$xml = docmd('nodech','frame',array('ppc.id=|\D+(\d+)|($1)|')); +if (getXmlErrors($xml,$errors)) { msg('E',"nodech frame failed: " . implode(' ',$errors)); nextStep(++$step,TRUE); return; } + +nextStep(++$step,FALSE); +} + + //----------------------------------------------------------------------------- function assigncecs($step) { -$numCECs = $_SESSION['numCECs']; +$numFrames = $_SESSION['numFramesPerHMC']; $hmcs = expandNR($_SESSION['hmcHostname']); $bpas = expandNR($_SESSION['bpaHostname']); $fsps = expandNR($_SESSION['fspHostname']); + +// 1st query ppc.parent of all fsps and save in a hash, so we can assign the bpa and its fsps to the +// same hmc. +$fspparent = getNodes($_SESSION['fspHostname'], array('ppc.parent')); +$bpacecs = array(); +foreach ($fspparent as $fsp => $parent) { $bpacecs[$parent][] = $fsp; } + $h = 0; // start with the 1st hmc -$f = 0; -$errors = array(); -// Go thru the fsps taking groups of numCECs and assigning them to the next hmc +$b = 0; +// Go thru the bpas taking groups of numFrames and assigning them to the next hmc while (TRUE) { // Get the next group of fsps - $length = min($numCECs, count($fsps)-$f); - $fslice = array_slice($fsps, $f, $length); - $xml = docmd('nodech',implode(',',$fslice),array("ppc.hcp=$hmcs[$h]")); - if (getXmlErrors($xml,$errors)) { msg('E',"nodech fsp failed: " . implode(' ',$errors)); return; } + $length = min($numFrames, count($bpas)-$b); + $bslice = array_slice($bpas, $b, $length); - // Decide if we are all out of fsps + // Assign the bpa to the hmc + //trace("b=$b, numFrames=$numFrames, length=$length."); + //echo "

bpas:"; print_r($bpas); "

\n"; + //trace("nodech ".implode(',',$bslice)); + $xml = docmd('nodech',implode(',',$bslice),array("ppc.hcp=$hmcs[$h]","ppc.parent=$hmcs[$h]")); + if (getXmlErrors($xml,$errors)) { msg('E',"nodech bpa failed: " . implode(' ',$errors)); nextStep(++$step,TRUE); return; } + + // Collect the list of the fsps in these bpas + $fsprange = array(); + foreach ($bslice as $b2) { $fsprange = array_merge($fsprange, $bpacecs[$b2]); } + //trace("nodech ".implode(',',$fsprange)); + $xml = docmd('nodech',implode(',',$fsprange),array("ppc.hcp=$hmcs[$h]")); + if (getXmlErrors($xml,$errors)) { msg('E',"nodech fsp failed: " . implode(' ',$errors)); nextStep(++$step,TRUE); return; } + + // Decide if we are all out of bpas $h++; - $f += $length; - if ($h>=count($hmcs) || $f>=count($fsps)) break; + $b += $length; + if ($h>=count($hmcs) || $b>=count($bpas)) break; } -//todo: how do we decide what bpas to assign to which hmcs? -// Send JSON data back to the browser. Todo: handle the errors too. -echo json_encode(array('step' => (integer)++$step, 'done' => FALSE, 'error' => '')); +nextStep(++$step,FALSE); } @@ -409,34 +469,19 @@ echo json_encode(array('step' => (integer)++$step, 'done' => FALSE, 'error' => ' function createhcpgroups($step) { //todo: may need to do this once we are using the real lsslp -// Send JSON data back to the browser. Todo: handle the errors too. -echo json_encode(array('step' => (integer)++$step, 'done' => FALSE, 'error' => '')); -} - - -//----------------------------------------------------------------------------- -// Give frame numbers to each bpa -function assignframenums($step) { -$errors = array(); -$xml = docmd('nodech','bpa',array('ppc.id=|\D+(\d+)|($1)|')); -if (getXmlErrors($xml,$errors)) { msg('E',"nodech bpa failed: " . implode(' ',$errors)); return; } - -// Send JSON data back to the browser. Todo: handle the errors too. -echo json_encode(array('step' => (integer)++$step, 'done' => FALSE, 'error' => '')); +nextStep(++$step,FALSE); } //----------------------------------------------------------------------------- // Run makehosts and makedns function nameres($step) { -$errors = array(); $xml = docmd('makehosts',NULL,NULL); -if (getXmlErrors($xml,$errors)) { msg('E',"makehosts failed: " . implode(' ',$errors)); return; } +if (getXmlErrors($xml,$errors)) { msg('E',"makehosts failed: " . implode(' ',$errors)); nextStep(++$step,TRUE); return; } $xml = docmd('makedns',NULL,NULL); -if (getXmlErrors($xml,$errors)) { msg('E',"makedns failed: " . implode(' ',$errors)); return; } +if (getXmlErrors($xml,$errors)) { msg('E',"makedns failed: " . implode(' ',$errors)); nextStep(++$step,TRUE); return; } -// Send JSON data back to the browser. Todo: handle the errors too. -echo json_encode(array('step' => (integer)++$step, 'done' => TRUE, 'error' => '')); +nextStep(++$step,TRUE); } @@ -444,11 +489,11 @@ echo json_encode(array('step' => (integer)++$step, 'done' => TRUE, 'error' => '' function configurehcps($action, $step) { global $TOPDIR; if ($step == 0) { - insertProgressTable(array('Assign CECs to their HMC.', - 'Set frame numbers in BPAs.', - 'Power on CECs to Standby.', + insertProgressTable(array(array('Assigned CECs to their HMC.','disabled'), + array('Set frame numbers in BPAs.','disabled'), + array('Powered on CECs to Standby.','disabled'), )); - if ($action != 'back') { echo ""; } + if ($action != 'back') { nextStep(1,FALSE); } } elseif ($step == 1) { cecs2hmcs($step); } @@ -458,21 +503,21 @@ elseif ($step == 3) { cecs2standby($step); } //todo: set HCP userids/pws } -function cecs2hmcs($step) {echo json_encode(array('step' => (integer)++$step, 'done' => FALSE, 'error' => ''));} -function setframenum($step) {echo json_encode(array('step' => (integer)++$step, 'done' => FALSE, 'error' => ''));} -function cecs2standby($step) {echo json_encode(array('step' => (integer)++$step, 'done' => TRUE, 'error' => ''));} +function cecs2hmcs($step) {nextStep(++$step,FALSE);} +function setframenum($step) {nextStep(++$step,FALSE);} +function cecs2standby($step) {nextStep(++$step,TRUE);} //----------------------------------------------------------------------------- function createnodes($action, $step) { global $TOPDIR; -//todo: need to show progress for each CEC if ($step == 0) { - insertProgressTable(array('Create LPARs in each CEC and save node definitions in xCAT database.')); - if ($action != 'back') { echo ""; } + insertProgressTable(array(array('Created LPARs in each CEC and save node definitions in xCAT database.','output'))); + if ($action != 'back') { nextStep(1,FALSE); } } elseif ($step == 1) { createlpars($step); } +//todo: set up rcons for the lpars (makeconserver.cf) } @@ -481,34 +526,70 @@ function createlpars($step) { $numlpars = $_SESSION['numLPARs']; $fsps = expandNR($_SESSION['fspHostname']); $nodes = expandNR($_SESSION['computeNodename']); -$samplenode = ''; //todo: ??? -$errors = array(); $n = 0; // index into the nodes array +//$parts = array(); +//preg_match('/^(\D+)/', $_SESSION['fspHostname'], $parts); +//$fspprefix = $parts[1]; +$fspattrs = getNodes($_SESSION['fspHostname'], array('ppc.hcp','ppc.parent')); + +// Go thru each fsp and create/define the nodes that should be in that fsp foreach ($fsps as $f) { $length = min($numlpars, count($nodes)-$n); - $nslice = array_slice($nodes, $n, $length); - //todo: actually make the lpars - //$xml = docmd('mkvm',NULL,array($samplenode,'-i','1','-n',implode(',',$nslice))); - //if (getXmlErrors($xml,$errors)) { msg('E',"mkvm failed: " . implode(' ',$errors)); return; } + $hcp = $fspattrs[$f]['ppc.hcp']; + $bpa = $fspattrs[$f]['ppc.parent']; + + //todo: currently can not create the 1st lpar in the cec + $xml = docmd('nodeadd',NULL,array($nodes[$n],"groups=lpars-$f,lpars-$bpa,lpars-$hcp,lpar,all",'nodetype.nodetype=lpar,osi', + 'nodehm.mgt=hmc','nodehm.power=hmc','nodehm.cons=hmc','noderes.netboot=yaboot', + 'nodetype.arch=ppc64','ppc.id=3', + "ppc.parent=$f","ppc.hcp=$hcp",'ppc.pprofile=diskless2')); + if (getXmlErrors($xml,$errors)) { msg('E',"nodeadd nodes failed: " . implode(' ',$errors)); nextStep(++$step,TRUE); return; } + echo "

Created and defined $nodes[$n] in $f.

\n"; ob_flush(); flush(); + $length--; $n++; + + $nmax = $length + $n; + $numnodes = 5; // how many lpars to create before displaying some output + $n2 = $n; + + // Go thru $length nodes, $numnodes at a time, creating the lpars and defining the nodes in the db + while (TRUE) { + $length2 = min($numnodes, $nmax-$n2); + $nslice = array_slice($nodes, $n2, $length2); + $nstr = implode(',',$nslice); + + //todo: this assumes the lpar id starts at 3 for a cec + $xml = docmd('nodeadd',NULL,array($nstr,"groups=lpars-$f,lpars-$bpa,lpars-$hcp,lpar,all",'nodetype.nodetype=lpar,osi', + 'nodehm.mgt=hmc','nodehm.power=hmc','nodehm.cons=hmc','noderes.netboot=yaboot', + 'nodetype.arch=ppc64','ppc.id=|\D+(\d+)|((($1-1)%'.$numlpars.')+3)|', + "ppc.parent=$f","ppc.hcp=$hcp",'ppc.pprofile=diskless2')); + if (getXmlErrors($xml,$errors)) { msg('E',"nodeadd nodes failed: " . implode(' ',$errors)); nextStep(++$step,TRUE); return; } + // Actually make the lpar profiles. Todo: this is not actually creating the lpar, just a new profile for the existing lpars. + if ($_SERVER["SERVER_ADDR"] != '192.168.153.128') { //todo: remove this check + $xml = docmd('chvm',$nstr,array('-p','diskless2')); + if (getXmlErrors($xml,$errors)) { msg('E',"chvm failed for $nstr: " . implode(' ',$errors)); nextStep(++$step,TRUE); return; } + } + echo "

Created and defined $nstr in $f.

\n"; ob_flush(); flush(); + + $n2 += $length2; + if ($n2 >= $nmax) break; + } // Decide if we are all out of nodes $n += $length; if ($n >= count($nodes)) break; } -//todo: Change this when mkvm is creating the base node definition. // Also, the following assumes the node range starts with 1 and the fsp node range is simple. // Really need to do individual nodeadd for each node. -$parts = array(); -preg_match('/^(\D+)/', $_SESSION['fspHostname'], $parts); -$fsp = $parts[1]; +/* $xml = docmd('nodeadd',NULL,array($_SESSION['computeNodename'],'groups=lpar,all','nodetype.nodetype=lpar,osi', 'nodehm.mgt=hmc','nodehm.power=hmc','nodehm.cons=hmc','noderes.netboot=yaboot', 'nodetype.arch=ppc64','ppc.id=|\D+(\d+)|((($1-1)%'.$numlpars.')+1)|', - 'ppc.parent=|(\D+)(\d+)|'.$fsp.'((($2-1)/'.$numlpars.')+1)|')); -if (getXmlErrors($xml,$errors)) { msg('E',"nodeadd nodes failed: " . implode(' ',$errors)); return; } + 'ppc.parent=|(\D+)(\d+)|'.$fspprefix.'((($2-1)/'.$numlpars.')+1)|')); +if (getXmlErrors($xml,$errors)) { msg('E',"nodeadd nodes failed: " . implode(' ',$errors)); nextStep(++$step,TRUE); return; } +*/ -echo json_encode(array('step' => (integer)++$step, 'done' => TRUE, 'error' => '')); +nextStep(++$step,TRUE); } @@ -530,5 +611,6 @@ function done($action, $step) { global $TOPDIR; echo "

Cluster set up successfully completed!

\n"; echo "

You can now view your node definitions and start to deploy nodes.

\n"; +echo "

 



\n"; } ?> \ No newline at end of file diff --git a/xCAT-web/machines/frames.css b/xCAT-web/machines/frames.css index 7c8c217f1..d88ffcfde 100644 --- a/xCAT-web/machines/frames.css +++ b/xCAT-web/machines/frames.css @@ -13,7 +13,7 @@ font-size: 1px; } -.RackTable IMG { vertical-align: baseline; } +.RackTable IMG { vertical-align: middle; /*baseline;*/ } .RackEmptyCell { background-color: #999999; } diff --git a/xCAT-web/machines/frames.php b/xCAT-web/machines/frames.php index ff08d612c..431356e77 100644 --- a/xCAT-web/machines/frames.php +++ b/xCAT-web/machines/frames.php @@ -38,9 +38,7 @@ foreach ($nodes as $nodename => $attrs) { $isBlade=0; // Get the display info for this node (image, size, etc.) - $info = getHWInfo(array_key_exists('vpd.mtm',$attrs)?$attrs['vpd.mtm']:'', - array_key_exists('nodehm.power',$attrs)?$attrs['nodehm.power']:'', - array_key_exists('nodehm.mgt',$attrs)?$attrs['nodehm.mgt']:''); + $info = getHWInfo(@$attrs['vpd.mtm'], @$attrs['nodehm.power'], @$attrs['nodehm.mgt']); if (empty($info)) { continue; } $image = $info['rackimage']; $size = $info['u']; @@ -50,7 +48,7 @@ foreach ($nodes as $nodename => $attrs) { else { $isMM = 0; } // If this is a blade, have to get the position from its MM - if ($size == 7 && !$isMM) { # blade + if ((@$attrs['nodehm.mgt']=='blade' || @$attrs['nodehm.power']=='blade') && !$isMM) { # blade $isBlade = 1; if (!array_key_exists('mp.mpa',$attrs) || !array_key_exists('mp.id',$attrs)) { continue; } if (!array_key_exists($attrs['mp.mpa'],$nodes)) { continue; } @@ -103,14 +101,14 @@ echo "\n"; # xSeries frames are 78.7in H x 23.6in W (3.3 ratio). The server enclosure area is approx 71.4 x 19 (3.75 ratio). Each U is approx 1.725 ksort($frames, SORT_NUMERIC); -foreach ($frames as $fnum => $frame) { +foreach ($frames as $fnum => $frm) { echo "
Rack $fnum\n"; echo "\n"; // Go thru each u position and either draw the svr or fill in an empty slot for ($i=1; $i<=42;) { - if (array_key_exists($i,$frame)) { # this slot has a server in it - $u = & $frame[$i]; // $u is the machine info at that u # + if (array_key_exists($i,$frm)) { # this slot has a server in it + $u = & $frm[$i]; // $u is the machine info at that u # // $u has keys of (nodename, image, alt, size) for rack mounted and (nodename, chassis, size) for blades if (array_key_exists('chassis',$u)) { # this a bladecenter chassis $chassis = & $u['chassis']; # this is really a ref to an array of blades @@ -161,7 +159,7 @@ function getHWInfo($mtm, $powermethod, $mgt) { } # No matches yet. Use the power method to get a generic type. - if (!empty($powermethod)) { $powermethod = $powermethod; } + if (!empty($powermethod)) {} elseif (!empty($mgt)) { $powermethod = $mgt; } if (!empty($powermethod)) { return getHWTypeInfo($powermethod); } else { return NULL; } diff --git a/xCAT-web/machines/groups.css b/xCAT-web/machines/groups.css index 5f046cb71..a526768ed 100644 --- a/xCAT-web/machines/groups.css +++ b/xCAT-web/machines/groups.css @@ -14,6 +14,12 @@ padding: 0.5em 0.5em; } +#nodetabs-a-disabled { + font-size : 8pt; + padding: 0.5em 0.5em; + color: #BFBFBF; +} + /* #nodepane: { float: left; clear: left; } #nodetabs { float: left; } diff --git a/xCAT-web/machines/groups.js b/xCAT-web/machines/groups.js index 74a88c9b4..183a8a08c 100644 --- a/xCAT-web/machines/groups.js +++ b/xCAT-web/machines/groups.js @@ -4,6 +4,7 @@ $(document).ready(function(){ window.nodetabs = $("#nodetabs > ul").tabs( { cookie: { expires: 30, path: '/' }, show: function(e,ui) { if (ui.tab.href.search('#attributes-tab$') > -1) { loadAttrTab($(ui.panel)); } + if (ui.tab.href.search('#rvitals-tab$') > -1) { loadVitalsTab($(ui.panel)); } } }); // ends the properties passed to tabs() }); diff --git a/xCAT-web/machines/groups.php b/xCAT-web/machines/groups.php index afd9f9c86..db02704e1 100644 --- a/xCAT-web/machines/groups.php +++ b/xCAT-web/machines/groups.php @@ -7,7 +7,7 @@ require_once "$TOPDIR/lib/functions.php"; if (isAIX()) { $aixDisabled = 'disabled'; } insertHeader('xCAT Groups and Nodes', array("$TOPDIR/jq/jsTree/tree_component.css",'groups.css','attributes.css',"$TOPDIR/manage/dsh.css"), - array("$TOPDIR/jq/jsTree/css.js","$TOPDIR/jq/jsTree/jquery.listen.js","$TOPDIR/jq/jsTree/tree_component.js","$TOPDIR/jq/jquery.cookie.js",'noderangetree.js','groups.js','attributes.js'), + array("$TOPDIR/jq/jsTree/css.js","$TOPDIR/jq/jsTree/jquery.listen.js","$TOPDIR/jq/jsTree/tree_component.js","$TOPDIR/jq/jquery.cookie.js",'noderangetree.js','groups.js','attributes.js','rvitals.js'), array('machines','groups')); echo "
\n"; @@ -19,8 +19,9 @@ echo "
\n"; // nrtree is the place to put the node $tabs = array('Attributes' => '#attributes-tab', 'Run Cmd' => '../manage/dsh.php?intab=1', - 'Rpower' => 'rpower.php', - 'Rvitals/Rinv' => 'rvitals.php', + 'Rvitals' => '#rvitals-tab', + ); +$tabsDisabled = array('Rpower' => 'rpower.php', 'Ping' => 'ping.php', 'Copy' => 'copyfiles.php', 'SP Config' => 'spconfig.php', @@ -34,8 +35,12 @@ echo "
    \n"; foreach ($tabs as $key => $url) { echo "
  • $key
  • \n"; } +foreach ($tabsDisabled as $key2 => $url2) { + echo "
  • $key2
  • \n"; +} echo "
\n"; echo "
\n"; +echo "
\n"; echo "
\n"; diff --git a/xCAT-web/machines/noderangetree.js b/xCAT-web/machines/noderangetree.js index e90e21e07..1a499677d 100644 --- a/xCAT-web/machines/noderangetree.js +++ b/xCAT-web/machines/noderangetree.js @@ -15,6 +15,9 @@ function updatenoderange() { //window.nodetabs.tabs('select', index); // simulate selecting it, so it reloads. Did not work. loadAttrTab($('#attributes-tab')); } + if (index == 2) { + loadVitalsTab($('#rvitals-tab')); + } } } diff --git a/xCAT-web/machines/rvitals.js b/xCAT-web/machines/rvitals.js new file mode 100644 index 000000000..47b9cd65d --- /dev/null +++ b/xCAT-web/machines/rvitals.js @@ -0,0 +1,10 @@ +// Javascript functions for the Rvitals/rinv tab + +function loadVitalsTab(panel) { + //alert('showing vitals tab'); + var nr = ''; + if (window.noderange && window.noderange != "") { nr = window.noderange; } + panel.children().remove(); // get rid of previous content + panel.append('

Loading node vitals...

'); + panel.load('rvitals.php?noderange='+nr); +} \ No newline at end of file diff --git a/xCAT-web/machines/rvitals.php b/xCAT-web/machines/rvitals.php index 6e67ff2b6..3936fc3c1 100644 --- a/xCAT-web/machines/rvitals.php +++ b/xCAT-web/machines/rvitals.php @@ -6,12 +6,33 @@ require_once "$TOPDIR/lib/functions.php"; //echo "\n"; //echo "\n"; -echo "
\n"; +// Get the noderange +$noderange = @$_REQUEST['noderange']; +//echo "

noderange=$noderange.

\n"; +if (empty($noderange)) { echo "

Select one or more groups or nodes for rvitals.

\n"; exit; } -//insertButtons(array('label' => 'Show Attributes', 'id' => 'attrButton', 'onclick' => '')); +$xml = docmd('rvitals',$noderange,array('all')); +//echo "

"; print_r($xml); echo "

\n"; +if (getXmlErrors($xml,$errors)) { echo "

rvitals failed: ", implode(' ',$errors), "

\n"; exit; } +//echo "

"; print_r($xml); echo "

\n"; -echo "
\n"; -// +echo "

\n"; +foreach ($xml->children() as $response) foreach ($response->children() as $o) { + $nodename = (string)$o->name; + $data = & $o->data; + $contents = (string)$data->contents; + $desc = (string)$data->desc; + //echo "

"; print_r($data); echo "

\n"; + echo "$nodename: $desc: $contents
\n"; + } +echo "

\n"; -insertNotDoneYet(); + +//echo "
\n"; + + +//echo "
\n"; +//echo "\n"; + +//insertNotDoneYet(); ?> \ No newline at end of file diff --git a/xCAT-web/xCAT-web.spec b/xCAT-web/xCAT-web.spec index aca814ffc..bf697e60d 100644 --- a/xCAT-web/xCAT-web.spec +++ b/xCAT-web/xCAT-web.spec @@ -86,8 +86,8 @@ fi if [ "$1" = 1 ] || [ "$1" = 2 ] # initial install, or upgrade and this is the newer rpm then - #todo: can remove this after a few releases, unless we change xcat-web.conf again - /etc/init.d/$apachedaemon reload + # Uncomment this if we change xcat-web.conf again + #/etc/init.d/$apachedaemon reload true fi