Commit 77a696ae authored by Leigh B Stoller's avatar Leigh B Stoller
Browse files

Merge branch 'master' of git-public.flux.utah.edu:/flux/git/emulab-devel

parents 0a3ccf1f a389ec9a
......@@ -2607,6 +2607,22 @@ sub OSSelect($$$$)
"where node_id='$nodeid'")
or return -1;
return -1
if ($self->ResetNextOpMode($debug) < 0);
return Refresh($self);
}
sub ResetNextOpMode($$)
{
my ($self,$debug) = @_;
my $nodeid = $self->node_id();
my $curmode = $self->op_mode();
# Why? When will this happen?
return 0
if (!$curmode);
#
# Determine what osid the node will now boot. We need to know this so we
# can set the next opmode. This call has to return *something* or we are
......@@ -2633,7 +2649,7 @@ sub OSSelect($$$$)
"where node_id='$nodeid'")
or return -1;
return Refresh($self);
return 0;
}
#
......
......@@ -102,8 +102,8 @@ my @PIDONLYTABLES = ("os_info");
my $q = DBQueryFatal("select pid_idx from projects ".
"where pid='$TBOPSPID'");
my ($npid) = $q->fetchrow_array();
my $q = DBQueryFatal("select gid_idx from groups ".
"where pid='$TBOPSPID' and gid=pid");
$q = DBQueryFatal("select gid_idx from groups ".
"where pid='$TBOPSPID' and gid=pid");
my ($ngid) = $q->fetchrow_array();
foreach my $table (@PIDGIDTABLES) {
......
......@@ -192,6 +192,11 @@ sub fetchhash($)
my $ref = $self->fetchrow_hashref();
return ($ref ? %$ref : ());
}
sub as_string($)
{
my ($self) = @_;
$self->dump_results();
}
# Not supported so generate an error.
sub dataseek($$)
......
......@@ -2,7 +2,7 @@
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2002, 2005 University of Utah and the Flux Group.
# Copyright (c) 2000-2011 University of Utah and the Flux Group.
# All rights reserved.
#
use Getopt::Std;
......@@ -61,6 +61,12 @@ while (my $arg = shift @ARGV) {
&debug("Node is $node");
&debug("Card is $card") if (defined $card);
printf("\n%9s %5s%s%s %9s %5s %5s %5s %3s %7s %7s\n",
"nodeid1", "card1",
$opt{I} ? " IP" : "",
$opt{m} ? " MAC" : "",
"nodeid2", "card2", "port2", "cable", "len", "wtype", "ntype");
my $query;
if ($opt{m} || $opt{I}) {
$query = "SELECT w.node_id1,w.card1,";
......@@ -96,7 +102,17 @@ while (my $arg = shift @ARGV) {
"$row[5] (length $row[6], color $wireinfo)\n";
}
} else {
print $result->as_string;
while (my @row = $result->fetchrow) {
my $i = 0;
printf("%9s %5d", $row[$i++], $row[$i++]);
printf("%16s", $row[$i++])
if ($opt{I});
printf(" %12s", $row[$i++])
if ($opt{m});
printf(" %9s %5d %5d %5d %3d %7s %7s\n",
$row[$i++], $row[$i++], $row[$i++], $row[$i++],
$row[$i++],$row[$i++],$row[$i++]);
}
}
}
......
#
# For building the client-side at Utah.
# Make sure we do not use ELVIN_COMPAT, we should never build images that
# way any more.
#
. defs-default
ELVIN_COMPAT=0
......@@ -25,13 +25,7 @@
<xs:attribute name="generated" type="xs:dateTime"/>
<xs:attribute name="generated_by"/>
<xs:attribute name="expires" type="xs:dateTime"/>
<xs:attribute name="type" use="required">
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="request"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="type" use="required" type="rspec:RspecTypeContents"/>
</xs:complexType>
<xs:element name="node" type="rspec:NodeContents"/>
<xs:element name="link" type="rspec:LinkContents"/>
......@@ -56,6 +50,7 @@
</xs:complexType>
</xs:element>
</xs:choice>
<xs:element ref="rspec:host"/>
</xs:choice>
<xs:attributeGroup ref="rspec:AnyExtension"/>
<xs:attribute name="client_id" use="required"/>
......@@ -71,6 +66,11 @@
<xs:element name="services" type="rspec:ServiceContents"/>
<xs:element name="interface" type="rspec:InterfaceContents"/>
<xs:element name="disk_image" type="rspec:DiskImageContents"/>
<xs:element name="host">
<xs:complexType>
<xs:attribute name="name" use="required"/>
</xs:complexType>
</xs:element>
<xs:complexType name="ServiceContents">
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:choice>
......@@ -88,13 +88,21 @@
<xs:element name="install" type="rspec:InstallServiceContents"/>
<xs:element name="execute" type="rspec:ExecuteServiceContents"/>
<xs:complexType name="LoginServiceContents">
<xs:group ref="rspec:AnyExtension"/>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:group ref="rspec:AnyExtension"/>
<xs:element ref="rspec:user"/>
</xs:choice>
<xs:attributeGroup ref="rspec:AnyExtension"/>
<xs:attribute name="authentication" use="required"/>
<xs:attribute name="hostname"/>
<xs:attribute name="port"/>
<xs:attribute name="username"/>
</xs:complexType>
<xs:element name="user">
<xs:complexType>
<xs:attribute name="name" use="required"/>
</xs:complexType>
</xs:element>
<xs:complexType name="RelationContents">
<xs:group ref="rspec:AnyExtension"/>
<xs:attributeGroup ref="rspec:AnyExtension"/>
......@@ -110,8 +118,11 @@
</xs:complexType>
<xs:complexType name="InterfaceContents">
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:group ref="rspec:AnyExtension"/>
<xs:element ref="rspec:ip"/>
<xs:choice>
<xs:group ref="rspec:AnyExtension"/>
<xs:element ref="rspec:ip"/>
</xs:choice>
<xs:element ref="rspec:host"/>
</xs:choice>
<xs:attributeGroup ref="rspec:AnyExtension"/>
<xs:attribute name="component_id"/>
......@@ -142,6 +153,7 @@
<xs:attributeGroup ref="rspec:AnyExtension"/>
<xs:attribute name="client_id" use="required"/>
<xs:attribute name="sliver_id" use="required"/>
<xs:attribute name="vlantag" use="required"/>
</xs:complexType>
<xs:element name="property" type="rspec:LinkPropertyContents"/>
<xs:element name="component_hop" type="rspec:ComponentHopContents"/>
......
......@@ -30,6 +30,12 @@
<!-- The LinkMapping will only be available after an assignment -->
<!-- The ComponentInterfaceDeclName will only be available after an assignment -->
<!-- The ComponentInterfaceRefName will only be available after an assignment -->
<xs:simpleType name="RspecTypeContents">
<xs:restriction base="xs:token">
<xs:enumeration value="request"/>
<xs:enumeration value="manifest"/>
</xs:restriction>
</xs:simpleType>
<!--
A request link is mapped to an arbitrary topology which represents
the virtual LAN/link which embodies it. Note that nodes do not
......
......@@ -11,7 +11,11 @@
include "request.rnc"
NodeContents &=
attribute sliver_id { text }
attribute sliver_id { text } &
# List of all hostnames that can be used to access the node on the
# control network. These may be accessible only by other nodes local
# to the same CM.
element host { attribute name { text } }*
LinkContents &=
attribute sliver_id { text } &
......@@ -19,7 +23,17 @@ LinkContents &=
attribute vlantag { text }
InterfaceContents &=
attribute mac_address { text } ?
attribute mac_address { text } ? &
# List of all hostnames associated with a particular
# interface. These may be names associated with an experimental
# interface that can be used to transit experimental traffic.
element host { attribute name { text } }*
LoginServiceContents &=
attribute username { text }?
# Default username. Used when there is only one username or one
# username should be used by default.
attribute username { text }? &
# List of all usernames that can be used to log into the node.
element user { attribute name { text } }*
RspecTypeContents |= "manifest"
......@@ -25,13 +25,7 @@
<xs:attribute name="generated" type="xs:dateTime"/>
<xs:attribute name="generated_by"/>
<xs:attribute name="expires" type="xs:dateTime"/>
<xs:attribute name="type" use="required">
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="request"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="type" use="required" type="rspec:RspecTypeContents"/>
</xs:complexType>
<xs:element name="node" type="rspec:NodeContents"/>
<xs:element name="link" type="rspec:LinkContents"/>
......
......@@ -71,7 +71,9 @@ InterfaceRefContents &=
attribute client_id { text }
RSpecContents &=
attribute type { "request" }
attribute type { RspecTypeContents }
RspecTypeContents = "request"
# A request link is mapped to an arbitrary topology which represents
# the virtual LAN/link which embodies it. Note that nodes do not
......
......@@ -30,6 +30,11 @@
<!-- The LinkMapping will only be available after an assignment -->
<!-- The ComponentInterfaceDeclName will only be available after an assignment -->
<!-- The ComponentInterfaceRefName will only be available after an assignment -->
<xs:simpleType name="RspecTypeContents">
<xs:restriction base="xs:token">
<xs:enumeration value="request"/>
</xs:restriction>
</xs:simpleType>
<!--
A request link is mapped to an arbitrary topology which represents
the virtual LAN/link which embodies it. Note that nodes do not
......
......@@ -88,7 +88,9 @@ LIB_STUFF = libtbsetup.pm exitonwarn.pm libtestbed.pm snmpit_intel.pm \
power_mail.pm power_whol.pm Template.pm power_rmcp.pm \
power_ilo.pm libvtop.pm libptop.pm libossetup.pm \
power_ipmi.pm libosload_new.pm libosload_switch.pm \
libossetup_switch.pm power_icebox.pm
libossetup_switch.pm power_icebox.pm \
libvtop_stable.pm libvtop_test.pm
# These scripts installed setuid, with sudo.
SETUID_BIN_SCRIPTS = node_reboot eventsys_control tarfiles_setup savelogs \
......
#!/usr/bin/perl -wT
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2010 University of Utah and the Flux Group.
# Copyright (c) 2000-2011 University of Utah and the Flux Group.
# All rights reserved.
#
use English;
......@@ -254,6 +254,7 @@ while ($row = $nodes_result->fetchrow_hashref) {
# Shared local nodes get toplevel mounts.
#
push(@dirlist, "$projdir");
push(@dirlist, "$groupdir");
push(@dirlist, "$scratchdir")
if ($scratchdir && -d "$SCRATCHROOT");
push(@dirlist, "$usersdir");
......
......@@ -685,7 +685,26 @@ sub Reload($$)
if (!((defined($self->nodeflag($nodeobject,'force'))
&& $self->nodeflag($nodeobject,'force'))
|| $self->nodeflag($nodeobject,'reconfig'))) {
$self->dprint(0,"Reload($node_id): no reload or reconfig to do, exiting!");
tbinfo "$self Reload($node_id): no reload or reconfig to do, simulating reloaddone instead!\n";
#
# BUT -- we need to simulate it from stated's perspective so that
# the reloads table is cleared.
#
TBSetNodeNextOpMode($node_id,TBDB_NODEOPMODE_RELOADPUSH);
TBSetNodeEventState($node_id,TBDB_NODESTATE_SHUTDOWN);
# give stated time to change op modes
sleep(4);
TBSetNodeEventState($node_id,TBDB_NODESTATE_RELOADSETUP);
TBSetNodeEventState($node_id,TBDB_NODESTATE_RELOADING);
TBSetNodeEventState($node_id,TBDB_NODESTATE_RELOADDONE);
# reset to teh op mode of the loaded image.
$nodeobject->Refresh();
$nodeobject->ResetNextOpMode($self->debug());
TBSetNodeEventState($node_id,TBDB_NODESTATE_SHUTDOWN);
TBSetNodeEventState($node_id,TBDB_NODESTATE_BOOTING);
TBSetNodeEventState($node_id,TBDB_NODESTATE_ISUP);
return 0;
}
......@@ -706,7 +725,26 @@ sub Reload($$)
if (!defined($self->nodeflag($nodeobject,'force'))
|| !$self->nodeflag($nodeobject,'force')) {
if ($self->nodeflag($nodeobject,'reconfig')) {
$self->dprint(1,"Reload($node_id): jumping straight to Reconfigure");
tbinfo "$self Reload($node_id): jumping straight to Reconfigure after simulating unnecessary reload\n";
#
# BUT -- we need to simulate it from stated's perspective so that
# the reloads table is cleared.
#
TBSetNodeNextOpMode($node_id,TBDB_NODEOPMODE_RELOADPUSH);
TBSetNodeEventState($node_id,TBDB_NODESTATE_SHUTDOWN);
# give stated time to change op modes
sleep(4);
TBSetNodeEventState($node_id,TBDB_NODESTATE_RELOADSETUP);
TBSetNodeEventState($node_id,TBDB_NODESTATE_RELOADING);
TBSetNodeEventState($node_id,TBDB_NODESTATE_RELOADDONE);
# reset to teh op mode of the loaded image.
$nodeobject->Refresh();
$nodeobject->ResetNextOpMode($self->debug());
TBSetNodeEventState($node_id,TBDB_NODESTATE_SHUTDOWN);
TBSetNodeEventState($node_id,TBDB_NODESTATE_BOOTING);
TBSetNodeEventState($node_id,TBDB_NODESTATE_ISUP);
$rc = $self->Reconfigure($nodeobject);
goto done;
}
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
#!/usr/bin/perl -w
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2010 University of Utah and the Flux Group.
# Copyright (c) 2000-2011 University of Utah and the Flux Group.
# All rights reserved.
#
use strict;
......@@ -226,6 +226,8 @@ my $newassign =
EmulabFeatures->FeatureEnabled("NewAssign",
$this_user,
$experiment->GetGroup(), $experiment);
libvtop::Init($this_user, $experiment->GetGroup(), $experiment);
#
# These are the flags to the vtop creation code.
......
......@@ -9,16 +9,6 @@
use English;
use Getopt::Std;
#
# This should run as root to make sure that it has permission to reboot nodes
# (since only root is allowed to power cycle nodes at any time - it's time-
# limited for anyone else)
#
if ($UID != 0) {
die("*** $0:\n".
" Only root can run this script!\n");
}
#
# Look for nodes to reload.
#
......@@ -75,7 +65,7 @@ sub fatal($);
sub notify($);
sub freefromreloading($);
my $os_load = "$TB/bin/os_load -s";
my $os_load = "$TB/bin/os_load -s -R";
my $sched_reload= "$TB/sbin/sched_reload";
my $reboot = "$TB/bin/node_reboot";
my $tbrsync = "$TB/bin/tbrsync";
......@@ -126,6 +116,16 @@ if (defined($options{"t"})) {
$logfile = "$logfile-$tag";
}
#
# This should run as root to make sure that it has permission to reboot nodes
# (since only root is allowed to power cycle nodes at any time - it's time-
# limited for anyone else)
#
if ($UID != 0 && !defined($tag)) {
die("*** $0:\n".
" Only root can run this script!\n");
}
#
# Only one please (for the default reload_daemon). If you specified
# a tag, it's your problem.
......
......@@ -164,7 +164,7 @@ sub doaction($@)
next
if (!-x "$BINDIR/rc/$script");
runbootscript(\%manifest,"$BINDIR/rc",$script,$what,"$optarg $bargs");
runbootscript(\%manifest,"$BINDIR/rc",$script,$what,"$optarg $bargs $what");
}
}
......
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