Commit e321b385 authored by Leigh Stoller's avatar Leigh Stoller

First cut at blockstore support. This example maps but does not

swap in yet:

set client [$ns node]
tb-set-node-os $client FEDORA15-STD

set d1 [$ns blockstore]
$d1 set-class "SAN"
$d1 set-protocol "iSCSI"
$d1 set-size 2GB

set san [$ns duplex-link $client $d1 10Kbps 0ms DropTail]
parent adb428d4
This diff is collapsed.
#!/usr/bin/perl -w
#
# Copyright (c) 2000-2012 University of Utah and the Flux Group.
# Copyright (c) 2000-2013 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......@@ -152,7 +152,7 @@ use vars qw(@ISA @EXPORT);
TBDB_FRISBEEMCBASEADDR
TBDB_RSRVROLE_NODE TBDB_RSRVROLE_VIRTHOST TBDB_RSRVROLE_DELAYNODE
TBDB_RSRVROLE_SIMHOST
TBDB_RSRVROLE_SIMHOST TBDB_RSRVROLE_STORAGEHOST
TBDB_EXPT_WORKDIR
TB_OSID_MBKERNEL
......@@ -544,6 +544,7 @@ sub TBDB_RSRVROLE_NODE() { "node"; }
sub TBDB_RSRVROLE_VIRTHOST() { "virthost"; }
sub TBDB_RSRVROLE_DELAYNODE() { "delaynode"; }
sub TBDB_RSRVROLE_SIMHOST() { "simhost"; }
sub TBDB_RSRVROLE_STORAGEHOST() { "storagehost"; }
# Interfaces roles.
sub TBDB_IFACEROLE_CONTROL() { "ctrl"; }
......
#
# Copyright (c) 2000-2012 University of Utah and the Flux Group.
# Copyright (c) 2000-2013 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......@@ -47,8 +47,8 @@ LIB_SCRIPTS = libdb.pm Node.pm libdb.py libadminctrl.pm Experiment.pm \
NodeType.pm Interface.pm User.pm Group.pm Project.pm \
Image.pm OSinfo.pm Archive.pm Logfile.pm Lan.pm emdbi.pm \
emdb.pm emutil.pm Firewall.pm VirtExperiment.pm libGeni.pm \
libEmulab.pm EmulabConstants.pm TraceUse.pm EmulabFeatures.pm \
Port.pm BlockstoreType.pm
libEmulab.pm EmulabConstants.pm TraceUse.pm \
EmulabFeatures.pm Port.pm BlockstoreType.pm Blockstore.pm
# Stuff installed on plastic.
USERSBINS = genelists.proxy dumperrorlog.proxy backup
......
#!/usr/bin/perl -wT
#
# Copyright (c) 2005-2012 University of Utah and the Flux Group.
# Copyright (c) 2005-2013 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......@@ -46,6 +46,7 @@ $JAILIPMASK = "@JAILIPMASK@";
use libdb;
use libtestbed;
use emutil;
use Blockstore;
use event;
use English;
use Socket;
......@@ -1748,6 +1749,29 @@ sub ReleaseSharedBandwidth($)
return 0;
}
#
# Relase the reserved blockstore, which requires updating the
# remaining_capacity on the underyling store. At the present
# time, one blockstore is mapped to one pcvm.
#
sub ReleaseBlockStore($)
{
my ($self) = @_;
# Must be a real reference.
return -1
if (! ref($self));
my $node_id = $self->node_id();
my $blockstore = Blockstore::Reservation->LookupByNodeid($node_id);
return 0
if (!defined($blockstore));
return -1
if (!ref($blockstore));
return $blockstore->Release();
}
#
# Look up all interfaces for a node, return list of objects.
#
......@@ -2129,8 +2153,7 @@ sub CreateVnodes($$$)
my $sharing_mode = $node->sharing_mode();
if (! ($impotent || $isfednode)) {
my $reservation = $node->Reservation();
if (!defined($reservation)) {
if (!$node->IsReserved()) {
print STDERR "*** CreateVnodes: no reservation for $node!\n";
DBQueryFatal("unlock tables");
return -1;
......@@ -2142,7 +2165,11 @@ sub CreateVnodes($$$)
# is on and the pnode is in sharedmode. Locking in nfree and in
# the pool daemon prevents the race.
#
if (!$experiment->SameExperiment($reservation)) {
# Cause of locking above, we need to make the comparison directly
# using the slot data in the node.
#
if (! ($experiment->pid() eq $node->pid() &&
$experiment->eid() eq $node->eid())) {
if (! ($sharedokay && $sharing_mode)) {
print STDERR "*** CreateVnodes: $node is not shared!\n";
DBQueryFatal("unlock tables");
......
#!/usr/bin/perl -w
#
# Copyright (c) 2000-2012 University of Utah and the Flux Group.
# Copyright (c) 2000-2013 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......@@ -450,7 +450,7 @@ foreach my $node (@freed_nodes) {
}
#
# If the node is virtual, release the shared bandwidth it had
# If the node is virtual, release the shared resources it had
# reserved on the physical node.
#
if ($isvirt) {
......@@ -459,6 +459,8 @@ foreach my $node (@freed_nodes) {
DBQueryWarn("delete from vinterfaces where vnode_id='$node_id'")
or $error++;
}
$node->ReleaseBlockStore() == 0
or $error++;
}
#
......
#!/usr/bin/perl -w
#
# Copyright (c) 2000-2012 University of Utah and the Flux Group.
# Copyright (c) 2000-2013 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......@@ -2009,4 +2009,41 @@ sub WaitDone($@)
return libossetup_virtnode::WaitDone($self, @nodelist);
}
#####################################################################
#
# Place holder for blockstore
#
package libossetup_blockstore;
use base qw(libossetup_subnode);
#
# A constructor for an object to handle all nodes of this type.
#
sub New($$) {
my ($class, $parent) = @_;
my $self = $class->SUPER::New("blockstore", $parent);
bless($self, $class);
return $self;
}
sub AddNode($$)
{
my ($self, $node) = @_;
print "Will skip blockstore $node ISUP wait.\n";
return $self->SUPER::AddNode($node);
}
#
# We do not currently do anything with blockstores; no waiting for ISUP.
#
sub Volunteers($)
{
my ($self) = @_;
return ();
}
1;
This diff is collapsed.
#!/usr/bin/perl -w
#
# Copyright (c) 2000-2012 University of Utah and the Flux Group.
# Copyright (c) 2000-2013 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......@@ -611,6 +611,8 @@ sub RunAssign($$)
if ($vtop->simnodecount());
$ptopargs .= "-h "
if ($vtop->sharednodecount());
$ptopargs .= "-b "
if ($vtop->bstorecount());
$ptopargs .= "-a "
if ($precheck || $allnodesfree);
$ptopargs .= "-c " . $experiment->delay_capacity() . " "
......
# -*- tcl -*-
#
# Copyright (c) 2012 University of Utah and the Flux Group.
# Copyright (c) 2012-2013 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......@@ -125,11 +125,10 @@ Blockstore instproc get_node {} {
}
# Allocate parent host and bind to it.
set hname "sanhost-${self}"
set hname "blockhost-${self}"
uplevel "#0" "set $hname [$sim node]"
$hname set subnodehost 1
$hname set subnodechild $self
set node $hname
$node set_hwtype "blockstore" 0 1 0
# Return parent node object.
return $hname
......
# -*- tcl -*-
#
# Copyright (c) 2000-2012 University of Utah and the Flux Group.
# Copyright (c) 2000-2013 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......@@ -960,6 +960,7 @@ Link instproc updatedb {DB} {
$self instvar bridge_links
$self instvar settings
$self instvar member_settings
$self instvar sanlan
set vindex 0
$sim spitxml_data "virt_lan_lans" [list "vname" "failureaction"] [list $self $failureaction]
......@@ -974,6 +975,13 @@ Link instproc updatedb {DB} {
$sim spitxml_data "virt_lan_settings" $fields $values
}
#
# If this is a SAN, then nullify shaping
#
if {$sanlan == 1} {
set nobwshaping 1
}
foreach nodeport $nodelist {
set node [lindex $nodeport 0]
if {$node == $src_node} {
......
# -*- tcl -*-
#
# Copyright (c) 2000-2012 University of Utah and the Flux Group.
# Copyright (c) 2000-2013 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......@@ -225,11 +225,11 @@ Simulator instproc duplex-link {n1 n2 bw delay type args} {
punsup "Arguments for duplex-link: $args"
}
set error 0
if {! [$n1 info class Node]} {
if {! [$n1 info class Node] && ! [$n1 info class Blockstore] } {
perror "\[duplex-link] $n1 is not a node."
set error 1
}
if {! [$n2 info class Node]} {
if {! [$n2 info class Node] && ! [$n2 info class Blockstore] } {
perror "\[duplex-link] $n2 is not a node."
set error 1
}
......@@ -572,8 +572,6 @@ Simulator instproc run {} {
if {[$child info class Node]} {
set childtype [$child set type]
$node add-desire "hosts-$childtype" 1.0
} elseif {[$child info class Blockstore]} {
$node add-desire "sanhost" 1.0
}
}
}
......@@ -666,6 +664,11 @@ Simulator instproc run {} {
$self spitxml_data "nseconfigs" [list "vname" "nseconfig" ] [list fullsim $nsecfg_script ]
}
# Make sure the blockstore parent nodes are created.
foreach blockstore [array names blockstore_list] {
set blockstore_node [$blockstore get_node]
}
# Update the DB
foreach node [lsort [array names node_list]] {
......
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