Commit c63cd75c authored by Mike Hibler's avatar Mike Hibler

Avoid races with tearing down SAN lans while the client is still active.

Add a swapout-time triggered program agent that does a "rc.storage fullreset"
to ensure that the client has unmounted and detached from SAN volumes.
Eventsys shutdown (which triggers the swapout event sequence) is done before
VLAN teardown so this works.
parent 01da65ba
......@@ -322,6 +322,23 @@ Blockstore instproc finalize {} {
perror "A remote blockstore must be connected to one, and only one, link/lan: $self"
return -1
}
#
# For the lanlink we are connected to, find all the non-blockstore
# nodes that are attached and schedule a program-agent to do an
# rc.storage fullreset.
#
set link [lindex [$node set portlist] 0]
set nlist [$link set nodelist]
foreach pair $nlist {
set lnode [lindex $pair 0]
if {[$lnode set type] != "blockstore"} {
if {[$lnode set bstore_agent] == 0} {
$lnode set bstore_agent 1
set pa [$lnode program-agent -command "sudo /usr/local/etc/emulab/rc/rc.storage fullreset"]
$sim at "swapout" "$pa run"
}
}
}
}
#
......
# -*- 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
#
......@@ -143,6 +143,9 @@ Node instproc init {s} {
# This is a mote thing.
$self set numeric_id {}
# This is a blockstore thing.
$self set bstore_agent 0
}
Bridge instproc init {s} {
......@@ -707,7 +710,7 @@ Node instproc get-desire {desire} {
}
#
# Add a key/value pair to the nide.
# Add a key/value pair to the node.
#
Node instproc add-attribute {key val} {
$self instvar attributes
......
......@@ -1003,8 +1003,8 @@ Simulator instproc at {time eventstring} {
} else {
set ptime [::GLOBALS::reltime-to-secs $time]
if {$ptime == -1} {
u perror "Invalid time spec: $time"
return
perror "Invalid time spec: $time"
return
}
set time $ptime
}
......
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