Commit 4da7262a authored by Austin Clements's avatar Austin Clements

Added knowledge of Plab nodes. The correct ssh port is now given when

appropriate.  The node status information now reports SSHD port
separately; doesn't report IP port ranges for Plab nodes; does report
RPM's for virtual nodes; only reports BIOS version if it's specified
in the DB; and, if a control net IP isn't found for a node (the case
with virtnodes), it reports the control net IP of the physical node.
parent 07715d69
......@@ -135,14 +135,15 @@ if (($state eq EXPTSTATE_ACTIVE) ||
($state eq EXPTSTATE_TESTING)) {
my $query_result =
DBQueryFatal("select r.vname,r.node_id,n.type,n.phys_nodeid,o.osname,".
" n.sshdport,n.jailflag,nt.isremotenode ".
" n.sshdport,n.jailflag,nt.isremotenode,".
" nt.isplabdslice ".
" from reserved as r ".
"left join nodes as n on r.node_id=n.node_id ".
"left join os_info as o on o.osid=n.def_boot_osid ".
"left join node_types as nt on nt.type=n.type ".
"where r.pid='$pid' and r.eid='$eid' order by vname");
while (($v,$p,$t,$m,$o,$s,$j,$r) = $query_result->fetchrow_array()) {
while (($v,$p,$t,$m,$o,$s,$j,$r,$d) = $query_result->fetchrow_array()) {
if (!$v) {
$v = $p;
}
......@@ -154,6 +155,7 @@ if (($state eq EXPTSTATE_ACTIVE) ||
SSHDPORT => $s,
JAILED => $j,
ISREMOTE => $r,
PLAB => $d,
};
}
}
......@@ -244,7 +246,8 @@ if ($showmap &&
my $s = $v2pmap{$v}->{SSHDPORT};
my $m = $v2pmap{$v}->{VVP};
my $q = "$v.$eid.$pid.$DOMAIN";
if ($v2pmap{$v}->{JAILED} && $v2pmap{$v}->{ISREMOTE}) {
if (($v2pmap{$v}->{JAILED} || $v2pmap{$v}->{PLAB}) &&
$v2pmap{$v}->{ISREMOTE}) {
printf "%-15s %-10s %-20s", $v, $s, "ssh -p $s $q";
print "\n";
}
......
......@@ -28,7 +28,7 @@ if (!isset($node_id) ||
$query_result =
DBQueryFatal("select n.jailflag,n.jailip,n.sshdport, ".
" r.vname,r.pid,r.eid, ".
" t.isvirtnode,t.isremotenode ".
" t.isvirtnode,t.isremotenode,t.isplabdslice ".
" from nodes as n ".
"left join reserved as r on n.node_id=r.node_id ".
"left join node_types as t on t.type=n.type ".
......@@ -47,6 +47,7 @@ $pid = $row[pid];
$eid = $row[eid];
$isvirt = $row[isvirtnode];
$isremote = $row[isremotenode];
$isplab = $row[isplabdslice];
if (!isset($pid)) {
USERERROR("$node_id is not allocated to an experiment!", 1);
......@@ -66,7 +67,7 @@ if ($isvirt) {
# Remote nodes run sshd on another port since they so not
# have per-jail IPs. Of course, might not even be jailed!
#
if ($jailflag) {
if ($jailflag || $isplab) {
echo "port: $sshdport\n";
}
}
......
......@@ -1510,13 +1510,16 @@ function SHOWNODE($node_id) {
DBQueryFatal("select n.*,na.*,r.vname,r.pid,r.eid,i.IP, ".
"greatest(last_tty_act,last_net_act,last_cpu_act,".
"last_ext_act) as last_act, ".
" t.isvirtnode,t.isremotenode,r.erole as rsrvrole ".
" t.isvirtnode,t.isremotenode,t.isplabdslice, ".
" r.erole as rsrvrole, pi.IP as phys_IP ".
" from nodes as n ".
"left join reserved as r on n.node_id=r.node_id ".
"left join node_activity as na on n.node_id=na.node_id ".
"left join node_types as t on t.type=n.type ".
"left join interfaces as i on i.card=t.control_net ".
" and i.node_id=n.node_id ".
"left join interfaces as pi on pi.card=t.control_net ".
" and pi.node_id=n.phys_nodeid ".
"where n.node_id='$node_id'");
if (mysql_num_rows($query_result) == 0) {
......@@ -1550,9 +1553,11 @@ function SHOWNODE($node_id) {
$IP = $row[IP];
$isvirtnode = $row[isvirtnode];
$isremotenode = $row[isremotenode];
$isplabdslice = $row[isplabdslice];
$ipport_low = $row[ipport_low];
$ipport_next = $row[ipport_next];
$ipport_high = $row[ipport_high];
$sshdport = $row[sshdport];
$last_act = $row[last_act];
$last_tty_act = $row[last_tty_act];
$last_net_act = $row[last_net_act];
......@@ -1560,6 +1565,7 @@ function SHOWNODE($node_id) {
$last_ext_act = $row[last_ext_act];
$last_report = $row[last_report];
$rsrvrole = $row[rsrvrole];
$phys_IP = $row[phys_IP];
if (!$def_boot_cmd_line)
$def_boot_cmd_line = "&nbsp";
......@@ -1575,8 +1581,6 @@ function SHOWNODE($node_id) {
$tarballs = "&nbsp";
if (!$startupcmd)
$startupcmd = "&nbsp";
if (!$bios)
$bios = "&nbsp";
echo "<table border=2 cellpadding=0 cellspacing=2
align=center>\n";
......@@ -1742,19 +1746,26 @@ function SHOWNODE($node_id) {
</tr>\n";
}
elseif ($isvirtnode) {
echo "<tr>
<td>IP Port Low:</td>
<td class=left>$ipport_low (sshd port)</td>
</tr>\n";
echo "<tr>
<td>IP Port Next:</td>
<td class=left>$ipport_next</td>
</tr>\n";
if (!$isplabdslice) {
echo "<tr>
<td>IP Port Low:</td>
<td class=left>$ipport_low</td>
</tr>\n";
echo "<tr>
<td>IP Port Next:</td>
<td class=left>$ipport_next</td>
</tr>\n";
echo "<tr>
<td>IP Port High:</td>
<td class=left>$ipport_high</td>
</tr>\n";
}
echo "<tr>
<td>IP Port High:</td>
<td class=left>$ipport_high</td>
<td>SSHD Port:</td>
<td class=left>$sshdport</td>
</tr>\n";
}
......@@ -1768,7 +1779,7 @@ function SHOWNODE($node_id) {
<td class=left>$tarballs</td>
</tr>\n";
if (!$isvirtnode && !$isremotenode) {
if (!$isremotenode) {
echo "<tr>
<td>RPMs:</td>
<td class=left>$rpms</td>
......@@ -1782,10 +1793,18 @@ function SHOWNODE($node_id) {
</tr>\n";
}
echo "<tr>
<td>Control Net IP:</td>
<td class=left>$IP</td>
</tr>\n";
if ($IP) {
echo "<tr>
<td>Control Net IP:</td>
<td class=left>$IP</td>
</tr>\n";
}
elseif ($phys_IP) {
echo "<tr>
<td>Physical IP:</td>
<td class=left>$phys_IP</td>
</tr>\n";
}
if ($rsrvrole) {
echo "<tr>
......@@ -1794,10 +1813,12 @@ function SHOWNODE($node_id) {
</tr>\n";
}
echo "<tr>
<td>Bios Version:</td>
<td class=left>$bios</td>
</tr>\n";
if ($bios) {
echo "<tr>
<td>Bios Version:</td>
<td class=left>$bios</td>
</tr>\n";
}
if ($isremotenode) {
if ($isvirtnode) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment