Commit d59ad976 authored by Jonathon Duerig's avatar Jonathon Duerig

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

parents 274ecd5e 8f3eae23
...@@ -584,8 +584,8 @@ bool populate_links(DOMElement *root, tb_pgraph &pg, tb_sgraph &sg, ...@@ -584,8 +584,8 @@ bool populate_links(DOMElement *root, tb_pgraph &pg, tb_sgraph &sg,
tb_plink *phys_link = tb_plink *phys_link =
new tb_plink(componentId.c_str(), new tb_plink(componentId.c_str(),
tb_plink::PLINK_NORMAL, str_first_type.c_str(), tb_plink::PLINK_NORMAL, str_first_type.c_str(),
srcMac.c_str(), dstMac.c_str(), src_pnode->name, srcMac.c_str(), shortNames[src_iface],
shortNames[src_iface], shortNames[dst_iface]); dst_pnode->name, dstMac.c_str(), shortNames[dst_iface]);
phys_link->delay_info.bandwidth = bandwidth; phys_link->delay_info.bandwidth = bandwidth;
phys_link->delay_info.delay = latency; phys_link->delay_info.delay = latency;
......
...@@ -269,8 +269,8 @@ int parse_ptop(tb_pgraph &pg, tb_sgraph &sg, istream& input) ...@@ -269,8 +269,8 @@ int parse_ptop(tb_pgraph &pg, tb_sgraph &sg, istream& input)
for (int cur = 0;cur<num;++cur) { for (int cur = 0;cur<num;++cur) {
pedge pe = (add_edge(srcv,dstv,pg)).first; pedge pe = (add_edge(srcv,dstv,pg)).first;
tb_plink *pl = new tb_plink *pl = new
tb_plink(name,tb_plink::PLINK_NORMAL,link_type,srcmac,dstmac, tb_plink(name,tb_plink::PLINK_NORMAL,link_type,srcnode->name,srcmac,
srciface,dstiface); srciface,dstnode->name,dstmac,dstiface);
put(pedge_pmap,pe,pl); put(pedge_pmap,pe,pl);
pl->delay_info.bandwidth = ibw; pl->delay_info.bandwidth = ibw;
pl->delay_info.delay = idelay; pl->delay_info.delay = idelay;
......
...@@ -407,8 +407,9 @@ bool populate_links(DOMElement *root, tb_pgraph &pg, tb_sgraph &sg) { ...@@ -407,8 +407,9 @@ bool populate_links(DOMElement *root, tb_pgraph &pg, tb_sgraph &sg) {
// other stuff if I remove them... bummer! // other stuff if I remove them... bummer!
tb_plink *phys_link = tb_plink *phys_link =
new tb_plink(name.c(), tb_plink::PLINK_NORMAL, str_first_type, new tb_plink(name.c(), tb_plink::PLINK_NORMAL, str_first_type,
"(null)", "(null)", src_iface.c(), dst_iface.c()); src_pnode->name, "(null)", src_iface.c(),
dst_pnode->name, "(null)", dst_iface.c());
phys_link->delay_info.bandwidth = bandwidth.i(); phys_link->delay_info.bandwidth = bandwidth.i();
phys_link->delay_info.delay = latency.i(); phys_link->delay_info.delay = latency.i();
phys_link->delay_info.loss = packet_loss.d(); phys_link->delay_info.loss = packet_loss.d();
......
...@@ -360,10 +360,11 @@ public: ...@@ -360,10 +360,11 @@ public:
typedef enum {PLINK_NORMAL,PLINK_INTERSWITCH,PLINK_LAN} plinkType; typedef enum {PLINK_NORMAL,PLINK_INTERSWITCH,PLINK_LAN} plinkType;
typedef hash_set<fstring> type_set; typedef hash_set<fstring> type_set;
tb_plink(fstring _name, plinkType _is_type, fstring _type, fstring _srcmac, fstring tb_plink(fstring _name, plinkType _is_type, fstring _type, fstring _srcnode, fstring _srcmac,
_dstmac, fstring _srciface, fstring _dstiface) fstring _srciface, fstring _dstnode, fstring _dstmac, fstring _dstiface)
: name(_name), srcmac(_srcmac), dstmac(_dstmac), is_type(_is_type), : name(_name), srcmac(_srcmac), dstmac(_dstmac), is_type(_is_type),
srciface(_srciface), dstiface(_dstiface), srciface(_srciface), dstiface(_dstiface),
srcnode(_srcnode), dstnode(_dstnode),
delay_info(), bw_used(0), emulated(0), nonemulated(0), delay_info(), bw_used(0), emulated(0), nonemulated(0),
penalty(0.0), fixends(false), current_endpoints(), current_count(0), penalty(0.0), fixends(false), current_endpoints(), current_count(0),
vedge_counts() { vedge_counts() {
...@@ -371,6 +372,7 @@ public: ...@@ -371,6 +372,7 @@ public:
} }
fstring name; // the name fstring name; // the name
fstring srcnode,dstnode; // source and destination node names
fstring srcmac,dstmac; // source and destination MAC addresses. fstring srcmac,dstmac; // source and destination MAC addresses.
fstring srciface, dstiface; // source and destination interface names fstring srciface, dstiface; // source and destination interface names
......
...@@ -60,7 +60,7 @@ extern tb_sgraph SG; // switch fabric ...@@ -60,7 +60,7 @@ extern tb_sgraph SG; // switch fabric
void score_link(pedge pe,vedge ve,tb_pnode *src_pnode,tb_pnode *dst_pnode); void score_link(pedge pe,vedge ve,tb_pnode *src_pnode,tb_pnode *dst_pnode);
void unscore_link(pedge pe,vedge ve,tb_pnode *src_pnode,tb_pnode *dst_pnode); void unscore_link(pedge pe,vedge ve,tb_pnode *src_pnode,tb_pnode *dst_pnode);
bool find_best_link(pvertex pv,pvertex switch_pv,tb_vlink *vlink, bool find_best_link(pvertex pv,pvertex switch_pv,tb_vlink *vlink,
pedge &out_edge, bool flipped, bool check_src_iface, pedge &out_edge, bool check_src_iface,
bool check_dst_iface); bool check_dst_iface);
int find_interswitch_path(pvertex src_pv,pvertex dest_pv, int find_interswitch_path(pvertex src_pv,pvertex dest_pv,
int bandwidth,pedge_path &out_path, int bandwidth,pedge_path &out_path,
...@@ -250,13 +250,25 @@ float find_link_resolutions(resolution_vector &resolutions, pvertex pv, ...@@ -250,13 +250,25 @@ float find_link_resolutions(resolution_vector &resolutions, pvertex pv,
pedge pe; pedge pe;
// Direct link (have to check both interfaces if they are fixed) // Direct link (have to check both interfaces if they are fixed)
if (find_best_link(dest_pv,pv,vlink,pe,flipped,true,true)) { if (find_best_link(dest_pv,pv,vlink,pe,true,true)) {
tb_link_info info(tb_link_info::LINK_DIRECT); tb_link_info info(tb_link_info::LINK_DIRECT);
info.plinks.push_back(pe); info.plinks.push_back(pe);
resolutions.push_back(info); resolutions.push_back(info);
total_weight += LINK_RESOLVE_DIRECT; total_weight += LINK_RESOLVE_DIRECT;
SDEBUG(cerr << " added a direct_link " << pe << endl); SDEBUG(cerr << " added a direct_link " << pe << endl);
} }
/*
* IMPORTANT NOTE ABOUT find_best_link -
*
* We have to tell it whether it is supposed to check the source of the
* vlink, the dest of the vlink, or both, for fixed interfaces. Of course, we
* only want to check the 'node' side, not the switch side, of interswitch
* and intraswitch paths. Of course, which end we're looking at depends on
* the order we're traversing the vlink - the flipped variable. This is why
* you see 'flipped' and '!flipped' passed to find_best_link() below.
*/
// Intraswitch link // Intraswitch link
pedge first,second; pedge first,second;
for (pvertex_set::iterator switch_it = pnode->switches.begin(); for (pvertex_set::iterator switch_it = pnode->switches.begin();
...@@ -291,9 +303,8 @@ float find_link_resolutions(resolution_vector &resolutions, pvertex pv, ...@@ -291,9 +303,8 @@ float find_link_resolutions(resolution_vector &resolutions, pvertex pv,
if (first_link) { if (first_link) {
SDEBUG(cerr << " intraswitch: finding first link" << endl;) SDEBUG(cerr << " intraswitch: finding first link" << endl;)
// Check only whether the source interface is fixed - this is the // See note above
// first link in a multi-hop path if (!find_best_link(pv,*switch_it,vlink,first,!flipped,flipped)) {
if (!find_best_link(pv,*switch_it,vlink,first,flipped,true,false)) {
SDEBUG(cerr << " intraswitch failed - no link first" << SDEBUG(cerr << " intraswitch failed - no link first" <<
endl;) endl;)
// No link to this switch // No link to this switch
...@@ -302,11 +313,9 @@ float find_link_resolutions(resolution_vector &resolutions, pvertex pv, ...@@ -302,11 +313,9 @@ float find_link_resolutions(resolution_vector &resolutions, pvertex pv,
} }
if (second_link) { if (second_link) {
// Check only whether the dest interface is fixed - this is the
// last link in a multi-hop path
SDEBUG(cerr << " intraswitch: finding second link (" << ")" << endl;) SDEBUG(cerr << " intraswitch: finding second link (" << ")" << endl;)
if (!find_best_link(dest_pv,*switch_it,vlink,second,!flipped, // See note above
false,true)) { if (!find_best_link(dest_pv,*switch_it,vlink,second,flipped,!flipped)) {
// No link to this switch // No link to this switch
SDEBUG(cerr << " intraswitch failed - no link second" << SDEBUG(cerr << " intraswitch failed - no link second" <<
endl;) endl;)
...@@ -375,10 +384,8 @@ float find_link_resolutions(resolution_vector &resolutions, pvertex pv, ...@@ -375,10 +384,8 @@ float find_link_resolutions(resolution_vector &resolutions, pvertex pv,
// Get link objects // Get link objects
if (first_link) { if (first_link) {
// Check only whether the source interface is fixed - this is the // See note above
// first link in a multi-hop path if (!find_best_link(pv,*source_switch_it,vlink,first,!flipped,flipped)) {
if (!find_best_link(pv,*source_switch_it,vlink,first,flipped,
true,false)) {
// No link to this switch // No link to this switch
SDEBUG(cerr << " interswitch failed - no first link" SDEBUG(cerr << " interswitch failed - no first link"
<< endl;) << endl;)
...@@ -387,11 +394,9 @@ float find_link_resolutions(resolution_vector &resolutions, pvertex pv, ...@@ -387,11 +394,9 @@ float find_link_resolutions(resolution_vector &resolutions, pvertex pv,
} }
if (second_link) { if (second_link) {
// Check only whether the dest interface is fixed - this is the // See note above
// last link in a multi-hop path if (!find_best_link(dest_pv,*dest_switch_it,vlink,second,flipped,!flipped)) {
if (!find_best_link(dest_pv,*dest_switch_it,vlink,second,!flipped, // No link to this switch
false,true)) {
// No link to tshis switch
SDEBUG(cerr << " interswitch failed - no second link" << endl;) SDEBUG(cerr << " interswitch failed - no second link" << endl;)
continue; continue;
} }
...@@ -1483,8 +1488,19 @@ int add_node(vvertex vv,pvertex pv, bool deterministic, bool is_fixed, bool skip ...@@ -1483,8 +1488,19 @@ int add_node(vvertex vv,pvertex pv, bool deterministic, bool is_fixed, bool skip
return 0; return 0;
} }
/*
* Find the best link between two physical nodes, making sure it matches the
* requirements of the given vlink. Returns results in the out_edge parameter
* NOTE: assumes the caller has done enough bookkeeping to know whether the
* source and dest interfaces need to be checked for fixed interfaces - that
* is: check_src_iface should be set if:
* this is a direct link OR
* we're mapping the end of an inter or intra switch link that connects to
* the 'source' vnode in the vlink structure
* Similar rules apply to check_dst_iface
*/
bool find_best_link(pvertex pv,pvertex switch_pv,tb_vlink *vlink, bool find_best_link(pvertex pv,pvertex switch_pv,tb_vlink *vlink,
pedge &out_edge, bool flipped, bool check_src_iface, pedge &out_edge, bool check_src_iface,
bool check_dst_iface) bool check_dst_iface)
{ {
pvertex dest_pv; pvertex dest_pv;
...@@ -1507,58 +1523,62 @@ bool find_best_link(pvertex pv,pvertex switch_pv,tb_vlink *vlink, ...@@ -1507,58 +1523,62 @@ bool find_best_link(pvertex pv,pvertex switch_pv,tb_vlink *vlink,
continue; continue;
} }
// XXX: Not 100% sure it's better to do this inside find_best_link rather
// than in the caller
if (flipped) {
// If the endpoints are flipped, then we need to flip our notion of
// which ones need to be compared.
bool tmp = check_src_iface;
check_src_iface = check_dst_iface;
check_dst_iface = tmp;
SDEBUG(cerr << " find_best_link: flipping interface comparisons" << endl;)
}
SDEBUG(cerr << " find_best_link: fix_src_iface = " << SDEBUG(cerr << " find_best_link: fix_src_iface = " <<
vlink->fix_src_iface << " check_src_iface = " << check_src_iface vlink->fix_src_iface << " check_src_iface = " << check_src_iface
<< " fix_dst_iface = " << vlink->fix_dst_iface << " fix_dst_iface = " << vlink->fix_dst_iface
<< " check_dst_iface = " << check_dst_iface << " check_dst_iface = " << check_dst_iface << endl;)
<< " flipped = " << flipped << endl);
// Whether we check the 'source' or 'destination' on the vlink against
// the phyisical link's source interface depends on whether the
// interface order in the in the pedge matches the interface order in
// the vlink
bool plink_order_reversed;
tb_vnode *src_vnode = get(vvertex_pmap,vlink->src);
tb_pnode *src_pnode = get(pvertex_pmap,src_vnode->assignment);
if (src_pnode->name != plink->srcnode) {
SDEBUG(cerr << " find_best_link: plink and vlink in " <<
"different order (" << src_pnode->name << " != " <<
plink->srcnode << ")" << endl;)
plink_order_reversed = true;
} else {
SDEBUG(cerr << " find_best_link: plink and vlink in " <<
"same order (" << src_pnode->name << " == " <<
plink->srcnode << ")" << endl;)
plink_order_reversed = false;
}
// If the vlink has a fixed source interface, and it doesn't match // If the vlink has a fixed source interface, and it doesn't match
// this plink, skip it // this plink, skip it
if (vlink->fix_src_iface && check_src_iface) { if (vlink->fix_src_iface && check_src_iface) {
// Whether we check the 'source' or 'destination' on the vlink against // The interface name we compare to on the plink depends on wether it
// the phyisical link's source interface depends on whether we're // goes in the same 'direction' as the vlink
// traversing the link if forward or reverse (flipped) order fstring compare_iface = (plink_order_reversed? plink->dstiface : plink->srciface);
// fstring compare_iface = vlink->src_iface; if (vlink->src_iface != compare_iface) {
fstring compare_iface = (flipped? vlink->dst_iface : vlink->src_iface);
if (plink->srciface != compare_iface) {
SDEBUG(cerr << " find_best_link (" << vlink->name << SDEBUG(cerr << " find_best_link (" << vlink->name <<
"): Fix source: " << plink->srciface << " != " << "): Fix source: " << vlink->src_iface << " != " <<
compare_iface << endl); compare_iface << endl);
continue; continue;
} else { } else {
SDEBUG(cerr << " find_best_link (" << vlink->name << SDEBUG(cerr << " find_best_link (" << vlink->name <<
"): Fix source: " << plink->srciface << " == " << "): Fix source: " << vlink->src_iface << " == " <<
compare_iface << endl); compare_iface << endl);
} }
} }
// Same for destination // Same for destination
// Yes, this really is srciface
// XXX: This only works because we always have the node as the 'source'
// of a plink! Shouldn't depend on this!
if (vlink->fix_dst_iface && check_dst_iface) { if (vlink->fix_dst_iface && check_dst_iface) {
// fstring compare_iface = vlink->dst_iface; // The interface name we compare to on the plink depends on wether it
fstring compare_iface = (flipped? vlink->src_iface : vlink->dst_iface); // goes in the same 'direction' as the vlink
if (plink->srciface != compare_iface) { fstring compare_iface = (plink_order_reversed? plink->srciface : plink->dstiface);
if (vlink->dst_iface != compare_iface) {
SDEBUG(cerr << " find_best_link (" << vlink->name << SDEBUG(cerr << " find_best_link (" << vlink->name <<
"): Fix dst: " << plink->srciface << " != " << "): Fix dst: " << vlink->dst_iface << " != " <<
compare_iface << endl); compare_iface << endl);
continue; continue;
} else { } else {
SDEBUG(cerr << " find_best_link (" << vlink->name << SDEBUG(cerr << " find_best_link (" << vlink->name <<
"): Fix dst: " << plink->srciface << " == " << "): Fix dst: " << vlink->dst_iface << " == " <<
compare_iface << endl); compare_iface << endl);
} }
} }
......
...@@ -51,6 +51,7 @@ use libdb; ...@@ -51,6 +51,7 @@ use libdb;
use libtestbed; use libtestbed;
use User; use User;
use Project; use Project;
use OSinfo;
use Image; use Image;
use Node; use Node;
......
...@@ -52,6 +52,7 @@ use libtestbed; ...@@ -52,6 +52,7 @@ use libtestbed;
use User; use User;
use Project; use Project;
use Image; use Image;
use OSinfo;
use Node; use Node;
# Protos # Protos
......
...@@ -274,22 +274,22 @@ sub TB_NODEACCESS_LOADIMAGE() { 3; } ...@@ -274,22 +274,22 @@ sub TB_NODEACCESS_LOADIMAGE() { 3; }
sub TB_NODEACCESS_REBOOT() { 4; } sub TB_NODEACCESS_REBOOT() { 4; }
sub TB_NODEACCESS_POWERCYCLE() { 5; } sub TB_NODEACCESS_POWERCYCLE() { 5; }
sub TB_NODEACCESS_MODIFYVLANS() { 6; } sub TB_NODEACCESS_MODIFYVLANS() { 6; }
sub TB_NODEACCESS_MIN() { TB_NODEACCESS_READINFO; } sub TB_NODEACCESS_MIN() { TB_NODEACCESS_READINFO(); }
sub TB_NODEACCESS_MAX() { TB_NODEACCESS_MODIFYVLANS; } sub TB_NODEACCESS_MAX() { TB_NODEACCESS_MODIFYVLANS(); }
# User Info (modinfo web page, etc). # User Info (modinfo web page, etc).
sub TB_USERINFO_READINFO() { 1; } sub TB_USERINFO_READINFO() { 1; }
sub TB_USERINFO_MODIFYINFO() { 2; } sub TB_USERINFO_MODIFYINFO() { 2; }
sub TB_USERINFO_MIN() { TB_USERINFO_READINFO; } sub TB_USERINFO_MIN() { TB_USERINFO_READINFO(); }
sub TB_USERINFO_MAX() { TB_USERINFO_MODIFYINFO; } sub TB_USERINFO_MAX() { TB_USERINFO_MODIFYINFO(); }
# Experiments. # Experiments.
sub TB_EXPT_READINFO() { 1; } sub TB_EXPT_READINFO() { 1; }
sub TB_EXPT_MODIFY() { 2; } sub TB_EXPT_MODIFY() { 2; }
sub TB_EXPT_DESTROY() { 3; } sub TB_EXPT_DESTROY() { 3; }
sub TB_EXPT_UPDATE() { 4; } sub TB_EXPT_UPDATE() { 4; }
sub TB_EXPT_MIN() { TB_EXPT_READINFO; } sub TB_EXPT_MIN() { TB_EXPT_READINFO(); }
sub TB_EXPT_MAX() { TB_EXPT_UPDATE; } sub TB_EXPT_MAX() { TB_EXPT_UPDATE(); }
# Projects. # Projects.
sub TB_PROJECT_READINFO() { 1; } sub TB_PROJECT_READINFO() { 1; }
...@@ -306,15 +306,15 @@ sub TB_PROJECT_DELOSID() { 11; } ...@@ -306,15 +306,15 @@ sub TB_PROJECT_DELOSID() { 11; }
sub TB_PROJECT_MAKEIMAGEID() { 12; } sub TB_PROJECT_MAKEIMAGEID() { 12; }
sub TB_PROJECT_DELIMAGEID() { 13; } sub TB_PROJECT_DELIMAGEID() { 13; }
sub TB_PROJECT_CREATEEXPT() { 14; } sub TB_PROJECT_CREATEEXPT() { 14; }
sub TB_PROJECT_MIN() { TB_PROJECT_READINFO; } sub TB_PROJECT_MIN() { TB_PROJECT_READINFO(); }
sub TB_PROJECT_MAX() { TB_PROJECT_CREATEEXPT; } sub TB_PROJECT_MAX() { TB_PROJECT_CREATEEXPT(); }
# OSIDs # OSIDs
sub TB_OSID_READINFO() { 1; } sub TB_OSID_READINFO() { 1; }
sub TB_OSID_CREATE() { 2; } sub TB_OSID_CREATE() { 2; }
sub TB_OSID_DESTROY() { 3; } sub TB_OSID_DESTROY() { 3; }
sub TB_OSID_MIN() { TB_OSID_READINFO; } sub TB_OSID_MIN() { TB_OSID_READINFO(); }
sub TB_OSID_MAX() { TB_OSID_DESTROY; } sub TB_OSID_MAX() { TB_OSID_DESTROY(); }
sub TB_OSID_OSIDLEN() { 35; } sub TB_OSID_OSIDLEN() { 35; }
sub TB_OSID_OSNAMELEN() { 20; } sub TB_OSID_OSNAMELEN() { 20; }
sub TB_OSID_VERSLEN() { 12; } sub TB_OSID_VERSLEN() { 12; }
...@@ -337,15 +337,15 @@ sub TB_IMAGEID_MODIFYINFO() { 2; } ...@@ -337,15 +337,15 @@ sub TB_IMAGEID_MODIFYINFO() { 2; }
sub TB_IMAGEID_CREATE() { 3; } sub TB_IMAGEID_CREATE() { 3; }
sub TB_IMAGEID_DESTROY() { 4; } sub TB_IMAGEID_DESTROY() { 4; }
sub TB_IMAGEID_ACCESS() { 5; } sub TB_IMAGEID_ACCESS() { 5; }
sub TB_IMAGEID_MIN() { TB_IMAGEID_READINFO; } sub TB_IMAGEID_MIN() { TB_IMAGEID_READINFO(); }
sub TB_IMAGEID_MAX() { TB_IMAGEID_ACCESS; } sub TB_IMAGEID_MAX() { TB_IMAGEID_ACCESS(); }
sub TB_IMAGEID_IMAGEIDLEN() { 45; } sub TB_IMAGEID_IMAGEIDLEN() { 45; }
sub TB_IMAGEID_IMAGENAMELEN() { 30; } sub TB_IMAGEID_IMAGENAMELEN() { 30; }
# Node Log Types # Node Log Types
sub TB_NODELOGTYPE_MISC { "misc"; } sub TB_NODELOGTYPE_MISC { "misc"; }
sub TB_NODELOGTYPES() { ( TB_NODELOGTYPE_MISC ) ; } sub TB_NODELOGTYPES() { ( TB_NODELOGTYPE_MISC() ) ; }
sub TB_DEFAULT_NODELOGTYPE() { TB_NODELOGTYPE_MISC; } sub TB_DEFAULT_NODELOGTYPE() { TB_NODELOGTYPE_MISC(); }
# Node History Stuff. # Node History Stuff.
sub TB_NODEHISTORY_OP_FREE { "free"; } sub TB_NODEHISTORY_OP_FREE { "free"; }
...@@ -355,7 +355,7 @@ sub TB_NODEHISTORY_OP_MOVE { "move"; } ...@@ -355,7 +355,7 @@ sub TB_NODEHISTORY_OP_MOVE { "move"; }
# Reload Types. # Reload Types.
sub TB_RELOADTYPE_NETDISK() { "netdisk"; } sub TB_RELOADTYPE_NETDISK() { "netdisk"; }
sub TB_RELOADTYPE_FRISBEE() { "frisbee"; } sub TB_RELOADTYPE_FRISBEE() { "frisbee"; }
sub TB_DEFAULT_RELOADTYPE() { TB_RELOADTYPE_FRISBEE; } sub TB_DEFAULT_RELOADTYPE() { TB_RELOADTYPE_FRISBEE(); }
# Experiment priorities. # Experiment priorities.
sub TB_EXPTPRIORITY_LOW() { 0; } sub TB_EXPTPRIORITY_LOW() { 0; }
...@@ -532,7 +532,7 @@ sub TBDB_SECLEVEL_ORANGE() { 3; } ...@@ -532,7 +532,7 @@ sub TBDB_SECLEVEL_ORANGE() { 3; }
sub TBDB_SECLEVEL_RED() { 4; } sub TBDB_SECLEVEL_RED() { 4; }
# This is the level at which we get extremely cautious when swapping out # This is the level at which we get extremely cautious when swapping out
sub TBDB_SECLEVEL_ZAPDISK() { TBDB_SECLEVEL_YELLOW; } sub TBDB_SECLEVEL_ZAPDISK() { TBDB_SECLEVEL_YELLOW(); }
# #
# A hash of all tables that contain information about physical nodes - the # A hash of all tables that contain information about physical nodes - the
......
...@@ -186,11 +186,11 @@ sub mysystem($) ...@@ -186,11 +186,11 @@ sub mysystem($)
{ {
my ($command) = @_; my ($command) = @_;
my $cwd; if (0) {
chomp($cwd = `/bin/pwd`); my $cwd;
chomp($cwd = `/bin/pwd`);
print STDERR "Running '$command' in $cwd\n" print STDERR "Running '$command' in $cwd\n";
if (0); }
return system($command); return system($command);
} }
...@@ -1437,7 +1437,7 @@ sub GetProject($) ...@@ -1437,7 +1437,7 @@ sub GetProject($)
my $project = Project->Lookup($self->pid_idx()); my $project = Project->Lookup($self->pid_idx());
if (! defined($project)) { if (! defined($project)) {
print("*** WARNING: Could not lookup project object for $self!", 1); print("*** WARNING: Could not lookup project object for $self!\n");
return undef; return undef;
} }
return $project; return $project;
......
...@@ -416,8 +416,16 @@ sub Create($$$$) ...@@ -416,8 +416,16 @@ sub Create($$$$)
my $hostname = $argref->{'hostname'}; my $hostname = $argref->{'hostname'};
my $external = $argref->{'external_node_id'}; my $external = $argref->{'external_node_id'};
my $IP = $argref->{'IP'}; my $IP = $argref->{'IP'};
if (!DBQueryWarn("replace into widearea_nodeinfo ". # Hmm, wanodecreate already does this.
my $wa_result =
DBQueryWarn("select node_id from widearea_nodeinfo ".
"where node_id='$node_id'");
goto bad
if (!$wa_result);
if ($wa_result->numrows == 0 &&
!DBQueryWarn("replace into widearea_nodeinfo ".
" (node_id, contact_uid, contact_idx, hostname," . " (node_id, contact_uid, contact_idx, hostname," .
" external_node_id, IP) ". " external_node_id, IP) ".
" values ('$node_id', 'nobody', '0', ". " values ('$node_id', 'nobody', '0', ".
...@@ -1667,9 +1675,9 @@ sub SetEventState($$) ...@@ -1667,9 +1675,9 @@ sub SetEventState($$)
# be used when creating the new node(s). A list of the node names is # be used when creating the new node(s). A list of the node names is
# returned. # returned.
# #
sub CreateVnodes($$) sub CreateVnodes($$$)
{ {
my ($rptr, $options) = @_; my ($class, $rptr, $options) = @_;
my @created = (); my @created = ();
my @tocreate = (); my @tocreate = ();
require Interface; require Interface;
......
...@@ -139,7 +139,7 @@ client-install: client ...@@ -139,7 +139,7 @@ client-install: client
fi fi
$(INSTALL_PROGRAM) $(DAEMON) $(DESTDIR)$(CLIENT_BINDIR)/$(DAEMON) $(INSTALL_PROGRAM) $(DAEMON) $(DESTDIR)$(CLIENT_BINDIR)/$(DAEMON)
$(INSTALL_PROGRAM) $(LTEVENT) $(DESTDIR)$(CLIENT_BINDIR)/$(LTEVENT) $(INSTALL_PROGRAM) $(LTEVENT) $(DESTDIR)$(CLIENT_BINDIR)/$(LTEVENT)
$(INSTALL_PROGRAM) $(SCRIPT) $(DESTDIR)$(CLIENT_BINDIR)/$(SCRIPT) $(INSTALL_PROGRAM) $(SRCDIR)/$(SCRIPT) $(DESTDIR)$(CLIENT_BINDIR)/$(SCRIPT)
$(INSTALL_PROGRAM) $(SCRIPT_ELAB) $(DESTDIR)$(CLIENT_BINDIR)/$(SCRIPT_ELAB) $(INSTALL_PROGRAM) $(SCRIPT_ELAB) $(DESTDIR)$(CLIENT_BINDIR)/$(SCRIPT_ELAB)
$(INSTALL_PROGRAM) $(SCRIPT_RUN) $(DESTDIR)$(CLIENT_BINDIR)/$(SCRIPT_RUN) $(INSTALL_PROGRAM) $(SCRIPT_RUN) $(DESTDIR)$(CLIENT_BINDIR)/$(SCRIPT_RUN)
$(MAKE) -C iperf client-install $(MAKE) -C iperf client-install
......
#!/usr/bin/perl -w -T #!/usr/bin/perl -w -T
# #
# EMULAB-COPYRIGHT # EMULAB-COPYRIGHT
# Copyright (c) 2000-2007 University of Utah and the Flux Group. # Copyright (c) 2000-2010 University of Utah and the Flux Group.
# All rights reserved. # All rights reserved.
# #
...@@ -2493,6 +2493,7 @@ sub sim_event { ...@@ -2493,6 +2493,7 @@ sub sim_event {
system($PATH_TEVC, system($PATH_TEVC,
"-e", "$proj_id/$exp_id", "-e", "$proj_id/$exp_id",
"-k", $PATH_KEYFILE,
"now", "now",
$simname, $simname,
"$event", "$event",
...@@ -2511,6 +2512,7 @@ sub sim_event2 { ...@@ -2511,6 +2512,7 @@ sub sim_event2 {
system($PATH_TEVC, system($PATH_TEVC,
"-e", "$proj_id/$exp_id", "-e", "$proj_id/$exp_id",
"-k", $PATH_KEYFILE,
"now", "now",
$simname, $simname,
"$event", "$event",
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
# Start the network.... # Start the network....
# #
udhcpc_opts="-q" udhcpc_opts="-q -O staticroutes"
if [ -f /etc/emulab/paths.sh ]; then if [ -f /etc/emulab/paths.sh ]; then
. /etc/emulab/paths.sh . /etc/emulab/paths.sh
...@@ -22,6 +22,7 @@ parse_cached_pxe_lease() { ...@@ -22,6 +22,7 @@ parse_cached_pxe_lease() {
local routers="" local routers=""
local nameservers="" local nameservers=""
local hostname="" local hostname=""
local classless_routes=""
local mac="" local mac=""
local iface="" local iface=""
local ifcfg_opts="" local ifcfg_opts=""
...@@ -35,6 +36,8 @@ parse_cached_pxe_lease() { ...@@ -35,6 +36,8 @@ parse_cached_pxe_lease() {
case $key in case $key in
OPT_BROADCAST_ADDRESS) OPT_BROADCAST_ADDRESS)
broadcast="$value"; ;; broadcast="$value"; ;;
OPT_CLASSLESS_ROUTES)
classless_routes="$value"; ;;
OPT_SUBNET_MASK) OPT_SUBNET_MASK)
netmask="$value"; ;; netmask="$value"; ;;
OPT_HOST_NAME) OPT_HOST_NAME)
...@@ -89,6 +92,16 @@ parse_cached_pxe_lease() { ...@@ -89,6 +92,16 @@ parse_cached_pxe_lease() {
echo "adding default route via $gw" echo "adding default route via $gw"
/sbin/route add default gw $gw dev $iface /sbin/route add default gw $gw dev $iface
done done