Whamcloud - gitweb
Another slightly less rough cut at XML based configuration. There
authorbehlendo <behlendo>
Wed, 26 Jun 2002 22:09:28 +0000 (22:09 +0000)
committerbehlendo <behlendo>
Wed, 26 Jun 2002 22:09:28 +0000 (22:09 +0000)
is still a large reliance on the existing scripts for loopback
support, portals config, and module loading.  I'll try and resolve
some of these things after some consultation about what the best
way to do that is.

- Several minor changes were made to the DTD, we're still not
  validating against it but it should be consistent with the example.
- Simple code added for ldlm, mds, obd, ost, osc, and mdc configuration.
- Other misc support and fixes.

A local filesystem should be mountable with the net-local.xml config:

~/tests/llxmlsetup.sh net-local.xml

lustre/tests/llxmlsetup.sh [new file with mode: 0755]
lustre/tests/net-local.xml [new file with mode: 0644]
lustre/utils/lustre.dtd
lustre/utils/parser.h

diff --git a/lustre/tests/llxmlsetup.sh b/lustre/tests/llxmlsetup.sh
new file mode 100755 (executable)
index 0000000..4076445
--- /dev/null
@@ -0,0 +1,35 @@
+SRCDIR="`dirname $0`/"
+. $SRCDIR/common.sh
+
+# Setup the portals and lustre RPC bits.  For now
+# that means we need to set 4 additional variables
+# here for ptlctl to use during its config.  There
+# should be some XML aware solution soon.  Also
+# the code to load only the nessisary modules 
+# should go in to obdctl.
+
+NETWORK=tcp
+LOCALHOST=localhost
+SERVER=localhost
+PORT=1234
+
+setup_portals || exit $?
+setup_lustre || exit $?
+
+# Loopback devices are still only supported in the
+# scripts so we're borrowing that functionality.
+new_fs ext3 /tmp/mds 25000
+new_fs ext3 /tmp/ost 10000
+
+# Configure the node based on the XML provided.
+$OBDCTL --xml $1 || exit $?
+
+export DEBUG_WAIT=no
+
+# The mountpoint information in the XML is currently
+# neglected so this needs to be done here.
+
+echo
+echo "To mount the filesystem:"
+echo "mount -t lustre_lite -o ost=`$OBDCTL name2dev OSCDEV`,mds=`$OBDCTL name2dev MDCDEV` none /mnt/lustre"
+
diff --git a/lustre/tests/net-local.xml b/lustre/tests/net-local.xml
new file mode 100644 (file)
index 0000000..9d08af5
--- /dev/null
@@ -0,0 +1,58 @@
+<?xml version="1.0"?>
+<!DOCTYPE lustre SYSTEM "lustre.dtd">
+
+<lustre>
+  <node id="local" uuid="local-UUID">
+    <profile_id num="1" id="local-profile" uuid="local-profile-UUID"></profile_id>
+  </node>
+
+  <profile id="local-profile" uuid="local-profile-UUID">
+    <service_id num="1" id="ldlm-srv" uuid="ldlm-srv-UUID"></service_id>
+    <service_id num="2" id="mds-srv" uuid="mds-srv-UUID"></service_id>
+    <service_id num="3" id="obd-srv" uuid="obd-srv-UUID"></service_id>
+    <service_id num="4" id="ost-srv" uuid="ost-srv-UUID"></service_id>
+    <service_id num="5" id="osc-srv" uuid="osc-srv-UUID"></service_id>
+    <service_id num="6" id="mdc-srv" uuid="mdc-srv-UUID"></service_id>
+    <mountpoint_id num="1" id="lustre-mnt" uuid="lustre-mnt-UUID"></mountpoint_id>
+  </profile>
+
+  <ldlm id="ldlm-srv" uuid="ldlm-srv-UUID"></ldlm>
+
+  <mds id="mds-srv" uuid="mds-srv-UUID">
+    <fstype>extN</fstype>
+    <device>/dev/loop0</device>
+    <server_id num="1" id="local" uuid="local-UUID"></server_id>
+    <failover_id num="1" id="local" uuid="local-UUID"></failover_id>
+  </mds>
+
+  <obd id="obd-srv" uuid="obd-srv-UUID" type="obdfilter">
+    <fstype>extN</fstype>
+    <device>/dev/loop1</device>
+    <autoformat>no</autoformat>
+  </obd>
+
+  <ost id="ost-srv" uuid="ost-srv-UUID">
+    <server_id num="1" id="local" uuid="local-UUID"></server_id>
+    <failover_id num="1" id="local" uuid="local-UUID"></failover_id>
+  </ost>
+
+  <osc id="osc-srv" uuid="osc-srv-UUID">
+    <network type="tcp">
+      <server>localhost</server>
+      <port>1234</port>
+    </network>
+  </osc>
+
+  <mdc id="mdc-srv" uuid="mdc-srv-UUID">
+    <network type="tcp">
+      <server>localhost</server>
+      <port>1234</port>
+    </network>
+  </mdc>
+
+  <mountpoint id="lustre-mnt" uuid="lustre-mnt-UUID">
+    <path>/mnt/lustre</path>
+    <fileset>dev</fileset>
+    <mds_id num="1" id="mds-srv" uuid="mds-srv-UUID"></mds_id>
+  </mountpoint>
+</lustre>
index ba4af32..d76dc27 100644 (file)
 <!ELEMENT profile (mountpoint_id, service_id)>\r
 <!ATTLIST profile id #CDATA #REQUIRED uuid #CDATA #REQUIRED>\r
 \r
-<!ELEMENT mountpoint (mntpt, fileset, mds_id, lov_id)>\r
+<!ELEMENT mountpoint (path, fileset, mds_id, lov_id)>\r
 <!ATTLIST mountpoint id #CDATA #REQUIRED uuid #CDATA #REQUIRED>\r
 \r
 <!ELEMENT node (profile_id)>\r
 <!ATTLIST node id #CDATA #REQUIRED uuid #CDATA #REQUIRED>\r
 \r
+<!ELEMENT ldlm ()*>\r
+<!ATTLIST ldlm id #CDATA #REQUIRED uuid #CDATA #REQUIRED>\r
+\r
 <!ELEMENT mds (fstype | device | server_id | failover_id)*>\r
 <!ATTLIST mds id #CDATA #REQUIRED uuid #CDATA #REQUIRED>\r
 \r
@@ -30,6 +33,9 @@
 <!ELEMENT osc (network)*>\r
 <!ATTLIST osc id #CDATA #REQUIRED uuid #CDATA #REQUIRED>\r
 \r
+<!ELEMENT mdc (network)*>\r
+<!ATTLIST mdc id #CDATA #REQUIRED uuid #CDATA #REQUIRED>\r
+\r
 <!ELEMENT lov (osc_id | obd_id | mdc_id)*>\r
 <!ATTLIST lov id #CDATA #REQUIRED uuid #CDATA #REQUIRED>\r
 \r
 \r
 <!-- basic elements -->\r
 <!ELEMENT network (%basic.content;)*>\r
-<!ATTLIST network type (ip | elan | myrinet) 'ip'\r
-                  address #CDATA 'localhost'>\r
+<!ATTLIST network type (tcp | elan | myrinet) 'tcp'>\r
 \r
 <!ELEMENT fstype        (%basic.content;)*>\r
 <!ELEMENT device        (%basic.content;)*>\r
 <!ELEMENT server        (%basic.content;)*>\r
 <!ELEMENT autoformat    (%basic.content;)*>\r
-<!ELEMENT mntpt         (%basic.content;)*>\r
+<!ELEMENT path          (%basic.content;)*>\r
 <!ELEMENT fileset       (%basic.content;)*>\r
 \r
 <!ELEMENT profile_id    (%basic.content;)*>\r
 <!ATTLIST profile_id    (%id.content;)* #CDATA #IMPLIED>\r
+<!ELEMENT ldlm_id       (%basic.content;)*>\r
+<!ATTLIST ldlm_id       (%id.content;)* #CDATA #IMPLIED>\r
 <!ELEMENT mds_id        (%basic.content;)*>\r
 <!ATTLIST mds_id        (%id.content;)* #CDATA #IMPLIED>\r
 <!ELEMENT obd_id        (%basic.content;)*>\r
index 036a651..65dedaa 100644 (file)
@@ -17,6 +17,12 @@ typedef struct argcmd {
        char     *ac_help;
 } argcmd_t;
 
+typedef struct network {
+       char    *type;
+       char    *server;
+       int     port;
+} network_t;
+
 int  Parser_quit(int argc, char **argv);
 void Parser_init(char *, command_t *); /* Set prompt and load command list */
 int Parser_commands(void);                     /* Start the command parser */