[Pvfs2-cvs] commit by robl in pvfs2-1/test/common/pav: README configfile.sample.in pav_init pav_uninit

CVS commit program cvs at parl.clemson.edu
Tue Apr 24 18:07:31 EDT 2007


Update of /projects/cvsroot/pvfs2-1/test/common/pav
In directory parlweb1:/tmp/cvs-serv772

Modified Files:
	README configfile.sample.in pav_init pav_uninit 
Log Message:
a new PAV feature:  mount PVFS on compute nodes


Index: README
===================================================================
RCS file: /projects/cvsroot/pvfs2-1/test/common/pav/README,v
diff -u -w -p -u -r1.10 -r1.11
--- README	5 Dec 2006 00:01:54 -0000	1.10
+++ README	24 Apr 2007 22:07:31 -0000	1.11
@@ -25,6 +25,11 @@ servers run on the io nodes while the ap
 nodes.  This split keeps the application nodes from perturbing the io
 nodes and should yield more consistent results.
 
+PAV can also mount PVFS, but only if you have a way of obtaining root
+without a passowrd.  Without speaking to the security implications, you
+could achieve this with ssh keys or sudo configurations.   See the
+config options below for how you would enable this optional feature.
+
 Using pav:
 
 To use the system (after installation), one must follow these steps:
@@ -94,6 +99,19 @@ TROVEMETHOD="<desired Trove method>" Thi
 
 COMPUTENODES_LAST=<1 = default.  Choose compute nodes from end of host list,
                    0 = Choose compute nodes from beginning of host list>
+
+MOUNT_FS=<0 = default. don't bother with the VFS interface
+          1 = load the kernel module, start the helper apps, and mount
+	      the fs>
+
+PVFS_KMOD="<path to kernel module>"  Be sure to specify a kernel module
+                                     built for the compute nodes
+PVFS_CLIENT="<path to pvfs2-client>" The helper app
+
+RCMDPROG_ROOT="<mechanism for gaining remote root>"  Could be anything
+						     really.  "ssh -l
+						     root" is the one
+						     we've tested most.
 
 3.) execute pav_start -c <configfile>.  You will see the pav system
 setting up a PVFS volume for you.

Index: configfile.sample.in
===================================================================
RCS file: /projects/cvsroot/pvfs2-1/test/common/pav/configfile.sample.in,v
diff -u -w -p -u -r1.11 -r1.12
--- configfile.sample.in	5 Dec 2006 00:01:54 -0000	1.11
+++ configfile.sample.in	24 Apr 2007 22:07:31 -0000	1.12
@@ -86,6 +86,19 @@ TROVESYNC=1
 # fs.conf).  Defaults to 'dbpf'.  'alt-aio' is another good one
 # TROVEMETHOD=dbpf
 
+# set MOUNT_FS if you want PAV to load the kernel module, start
+# pvfs2-client, and mount the file system.  If you set MOUNT_FS, you
+# will also need the path to the kernel module and kernel helper
+# utilities...
+MOUNT_FS=0
+KERNEL_KVER=2.6.20-15-generic
+PVFS_KMOD=/home/robl/soft/pvfs2/lib/modules/$KERNEL_KVER/kernel/fs/pvfs2/pvfs2.ko
+PVFS_CLIENT=$PVFS/sbin/pvfs2-client
+
+#    ... and you will need a way to get root (sudo, ssh with keys, etc):
+#    set this to the apropriate mechansim, e.g.
+# RCMDPROG_ROOT="ssh -l root"
+RCMDPROG_ROOT=$RCMDPROG
 
 # set this to 0 if you would rather have compute nodes come before server
 # nodes in the list of hosts pav uses

Index: pav_init
===================================================================
RCS file: /projects/cvsroot/pvfs2-1/test/common/pav/pav_init,v
diff -u -w -p -u -r1.4 -r1.5
--- pav_init	1 Oct 2003 15:50:34 -0000	1.4
+++ pav_init	24 Apr 2007 22:07:31 -0000	1.5
@@ -22,6 +22,14 @@ if ($rc) {
     exit($rc);
 }
 
+if ($config{'MOUNT_FS'} == 1) {
+    $rc = do_fs_mount(\%config);
+    if ($rc) {
+    	print STDERR "WARNING: failed to mount FS on remote node $rc\n";
+	exit(-1);
+    }
+}
+
 exit(0);
 
 sub start_servers{
@@ -45,13 +53,44 @@ sub start_servers{
 
     # once to make the storage space, then a second time to run the servers
     my $cmd = "%node $binary  -f $serverconf $localconf-%node";
-
     $rc = do_remote_command($href->{'RCMDPROG'}, 8, 30, $cmd, undef, undef, @nodes);
 
     $cmd = "%node $binary $serverconf $localconf-%node";
     $rc = do_remote_command($href->{'RCMDPROG'}, 8, 30, $cmd, undef, undef, @nodes);
     return($rc);
 }
+
+sub do_fs_mount{
+    my $href = shift;
+
+    my @nodes = ();
+    my $rc = 0;
+
+    @nodes = @{$href->{'COMPNODES'}};
+
+    my $cmd = "%node mkdir $href->{'MOUNTPOINT'}";
+    $rc = do_remote_command($href->{'RCMDPROG_ROOT'}, 8, 30, $cmd, undef, undef, @nodes);
+
+    my $kmod = $href->{'PVFS_KMOD'};
+    $cmd = "%node /sbin/insmod $kmod";
+    $rc = do_remote_command($href->{'RCMDPROG_ROOT'}, 8, 30, $cmd, undef, undef, @nodes);
+
+    my $pvfs2_client = $href->{'PVFS_CLIENT'};
+    $cmd = "%node $pvfs2_client";
+    $rc = do_remote_command($href->{'RCMDPROG_ROOT'}, 8, 30, $cmd, undef, undef, @nodes);
+
+    my @metas = @{$href->{'MGR'}};
+    # from create_pvfs2tab:
+    my $big = $href->{'PROTOCOL'};
+    $big =~ y/a-z/A-Z/;
+    my $var = "PVFS" . $big . "PORT"; # PVFSGMPORT, PVFSIBPORT, etc
+
+    # mount -t pvfs2 gm://pmeta0:5/pvfs2-fs /mnt/pvfs2
+    $cmd = "%node /bin/mount -t pvfs2 " . $href->{'PROTOCOL'} . "://" . $metas[0] . ":" . $href->{$var} . "/pvfs2-fs " . $href->{'MOUNTPOINT'}; 
+    $rc = do_remote_command($href->{'RCMDPROG_ROOT'}, 8, 30, $cmd, undef, undef, @nodes);
+
+    return($rc);
+} 
 
 sub usage {
 

Index: pav_uninit
===================================================================
RCS file: /projects/cvsroot/pvfs2-1/test/common/pav/pav_uninit,v
diff -u -w -p -u -r1.2 -r1.3
--- pav_uninit	29 Sep 2004 20:29:17 -0000	1.2
+++ pav_uninit	24 Apr 2007 22:07:31 -0000	1.3
@@ -13,6 +13,13 @@ if (init()) {
     exit 1;
 }
 
+if ($config{'MOUNT_FS'} == 1) {
+	$rc = stop_fs_mount(\%config);
+	if ($rc) {
+		print STDERR "WARNING: mount cleanup failed...$rc\n";
+	}
+}
+
 #stop iods
 $rc = stop_servers(\%config);
 if ($rc) {
@@ -20,6 +27,27 @@ if ($rc) {
 }
 
 exit(0);
+
+sub stop_fs_mount {
+    my $href = shift;
+
+    my @nodes = ();
+    my $rc = 0;
+
+    @nodes = @{$href->{'COMPNODES'}};
+
+    my $cmd = "%node umount $href->{'MOUNTPOINT'}";
+    $rc = do_remote_command($href->{'RCMDPROG_ROOT'}, 8, 30, $cmd, undef, undef, @nodes);
+
+    $cmd = "%node killall pvfs2-client\\\; sleep 5\\\; killall -9 pvfs2-client";
+    $rc = do_remote_command($href->{'RCMDPROG_ROOT'}, 8, 30, $cmd, undef, undef, @nodes);
+
+    $cmd = "%node /sbin/rmmod $href->{'PVFS_KMOD'}";
+    $rc = do_remote_command($href->{'RCMDPROG_ROOT'}, 8, 30, $cmd, undef, undef, @nodes);
+
+    return ($rc);
+}
+
 
 sub stop_servers {
     my $href = shift;



More information about the Pvfs2-cvs mailing list