Commit 86d5e5ef authored by Leigh Stoller's avatar Leigh Stoller

Export VMs control addresses to SHAREDHOST nodes, so that XEN VMs

can mount the NFS filesystems. Only doing this for shared hosts
at this time, to avoid driving up the number of exports too much.
Might reconsider later.
parent e3d18936
......@@ -196,22 +196,19 @@ if ($WINSUPPORT) {
# Order by pid,gid,admin first so that they're all grouped together and we
# avoid extra db queries (see lastpid/lastgid/lastadmin).
#
# VIRTNODE HACK: Virtual nodes are special, so do not export. (isvirtnode).
#
$nodes_result =
DBQueryFatal("select r.node_id,r.pid,r.eid,e.gid,i.IP,u.admin, ".
" r.sharing_mode,r.erole ".
" r.sharing_mode,r.erole,nt.isvirtnode ".
"from reserved as r ".
"left join experiments as e on r.pid=e.pid and r.eid=e.eid ".
"left join nodes on r.node_id=nodes.node_id ".
"left join node_types on node_types.type=nodes.type ".
"left join node_types as nt on nt.type=nodes.type ".
"left join interfaces as i on r.node_id=i.node_id ".
"left join users as u on e.swapper_idx=u.uid_idx ".
" where i.IP!='NULL' and ".
" i.role='" . TBDB_IFACEROLE_CONTROL() . "' ".
" and nodes.role='testnode' ".
" and node_types.isvirtnode=0 ".
" and node_types.isremotenode=0 ".
" and (nodes.role='testnode' or nodes.role='virtnode')".
" and nt.isremotenode=0 ".
"order by r.pid,e.gid,r.eid,u.admin,nodes.priority");
my %ipgroups = ();
......@@ -240,7 +237,8 @@ while ($row = $nodes_result->fetchrow_hashref) {
my $gid = $row->{'gid'};
my $ip = $row->{'IP'};
my $admin = $row->{'admin'};
my $shared = $row->{'sharing_mode'};
my $isvirt = $row->{'isvirtnode'};
my $shared = (defined($row->{'sharing_mode'}) ? 1 : 0);
my $erole = $row->{'erole'};
my %fslist = ();
my @dirlist = ();
......@@ -254,6 +252,10 @@ while ($row = $nodes_result->fetchrow_hashref) {
print " $node_id\n" if defined($node_id);
next;
}
# Skip non-shared virtnode nodes; NFS mounts are handled differently.
next
if ($isvirt && !$shared);
if ($lastpid eq $pid && $lastgid eq $gid && $lasterole eq $erole &&
(!$ISOLATEADMIN || $lastadmin eq $admin)) {
......@@ -268,9 +270,9 @@ while ($row = $nodes_result->fetchrow_hashref) {
$lastadmin=$admin;
$lasterole=$erole;
if ($erole eq "sharedhost") {
if ($erole eq "sharedhost" && !$isvirt) {
#
# Shared local nodes get toplevel mounts.
# Shared local *physical* nodes get toplevel mounts.
#
push(@dirlist, "$projdir");
push(@dirlist, "$groupdir");
......
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