Whamcloud - gitweb
landing smfs.
[fs/lustre-release.git] / lustre / utils / lmc
index 567689e..37cfab7 100755 (executable)
@@ -85,7 +85,9 @@ Object creation command summary:
   --node node_name
   --mds mds_name
   --dev path
+  --backdev path
   --fstype extN|ext3
+  --backfstype ext3|tmpfs
   --size size
   --nspath
   --journal_size size
@@ -103,8 +105,10 @@ Object creation command summary:
   --ost ost_name 
   --lov lov_name 
   --dev path
+  --backdev path
   --size size
   --fstype extN|ext3
+  --backfstype ext3|tmpfs
   --journal_size size
   --inode_size size
   --obdtype obdecho|obdfilter
@@ -178,11 +182,14 @@ lmc_options = [
     ('failover', "Enable failover support on OSTs or MDS?"),
     ('group', "", PARAM),
     ('dev', "Path of the device on local system.", PARAM,""),
+    ('backdev', "Path of the device for backing storage on local system.", PARAM,""),
     ('size', "Specify the size of the device if needed.", PARAM,"0"),
     ('journal_size', "Specify new journal size for underlying ext3 file system.", PARAM,"0"),
     ('inode_size', "Specify new inode size for underlying ext3 file system.", PARAM,"0"),
     ('fstype', "Optional argument to specify the filesystem type.", PARAM, "ext3"),
+    ('backfstype', "Optional argument to specify the backing filesystem type.", PARAM, "ext3"),
     ('mkfsoptions', "Optional argument to mkfs.", PARAM, ""),
+    ('mountfsoptions', "Optional argument to mount fs.", PARAM, ""),
     ('ostuuid', "", PARAM,""),
     ('nspath', "Local mount point of server namespace.", PARAM,""),
     ('format', ""),
@@ -367,13 +374,18 @@ class GenConfig:
         return ldlm
 
     def osd(self, name, uuid, fs, osdtype, devname, format, ost_uuid,
-            node_uuid, dev_size=0, journal_size=0, inode_size=0, nspath="", mkfsoptions=""):
+            node_uuid, dev_size=0, journal_size=0, inode_size=0, nspath="", 
+            mkfsoptions="", mountfsoptions="", backfs="", backdevname=""):
         osd = self.newService("osd", name, uuid)
         osd.setAttribute('osdtype', osdtype)
         osd.appendChild(self.ref("target", ost_uuid))
         osd.appendChild(self.ref("node", node_uuid))
         if fs:
             self.addElement(osd, "fstype", fs)
+        if backfs:
+            self.addElement(osd, "backfstype", backfs)
+        if backdevname:
+            self.addElement(osd, "backdevpath", backdevname)
         if devname:
             dev = self.addElement(osd, "devpath", devname)
             self.addElement(osd, "autoformat", format)
@@ -385,6 +397,8 @@ class GenConfig:
                 self.addElement(osd, "inodesize", "%s" % (inode_size))
             if mkfsoptions:
                 self.addElement(osd, "mkfsoptions", mkfsoptions)
+            if mountfsoptions:
+                self.addElement(osd, "mountfsoptions", mountfsoptions)
         if nspath:
             self.addElement(osd, "nspath", nspath)
         return osd
@@ -428,10 +442,15 @@ class GenConfig:
 
     def mdsdev(self, name, uuid, fs, devname, format, node_uuid,
                mds_uuid, dev_size=0, journal_size=0, inode_size=256,
-               nspath="", mkfsoptions=""):
+               nspath="", mkfsoptions="", mountfsoptions="", backfs="", 
+               backdevname=""):
         mdd = self.newService("mdsdev", name, uuid)
         self.addElement(mdd, "fstype", fs)
+        if backfs:
+                self.addElement(mdd, "backfstype", backfs)
         dev = self.addElement(mdd, "devpath", devname)
+        if backdevname:
+            self.addElement(mdd, "backdevpath", backdevname)
         self.addElement(mdd, "autoformat", format)
         if dev_size:
                 self.addElement(mdd, "devsize", "%s" % (dev_size))
@@ -443,6 +462,9 @@ class GenConfig:
             self.addElement(mdd, "nspath", nspath)
         if mkfsoptions:
             self.addElement(mdd, "mkfsoptions", mkfsoptions)
+        if mountfsoptions:
+            self.addElement(mdd, "mountfsoptions", mountfsoptions)
+
         mdd.appendChild(self.ref("node", node_uuid))
         mdd.appendChild(self.ref("target", mds_uuid))
         return mdd
@@ -706,12 +728,15 @@ def add_mds(gen, lustre, options):
         mds.setAttribute('failover', "1")
 
     devname = get_option(options, 'dev')
+    backdevname = get_option(options, 'backdev')
     size = get_option(options, 'size')
     fstype = get_option(options, 'fstype')
+    backfstype = get_option(options, 'backfstype')
     journal_size = get_option(options, 'journal_size')
     inode_size = get_option(options, 'inode_size')
     nspath = get_option(options, 'nspath')
     mkfsoptions = get_option(options, 'mkfsoptions')
+    mountfsoptions = get_option(options, 'mountfsoptions')
 
     node_uuid = name2uuid(lustre, node_name, 'node')
 
@@ -723,7 +748,8 @@ def add_mds(gen, lustre, options):
 
     mdd = gen.mdsdev(mdd_name, mdd_uuid, fstype, devname,
                      get_format_flag(options), node_uuid, mds_uuid,
-                     size, journal_size, inode_size, nspath, mkfsoptions)
+                     size, journal_size, inode_size, nspath, mkfsoptions, 
+                     mountfsoptions, backfstype, backdevname)
     lustre.appendChild(mdd)
                    
 
@@ -753,19 +779,25 @@ def add_ost(gen, lustre, options):
 
     if osdtype == 'obdecho':
         fstype = ''
+        backfstype = ''
         devname = ''
+        backdevname = ''
         size = 0
         fstype = ''
         journal_size = ''
         inode_size = ''
         mkfsoptions = ''
+        mountfsoptions = ''
     else:
         devname = get_option(options, 'dev') # can be unset for bluearcs
+        backdevname = get_option(options, 'backdev')
         size = get_option(options, 'size')
         fstype = get_option(options, 'fstype')
+        backfstype = get_option(options, 'backfstype')
         journal_size = get_option(options, 'journal_size')
         inode_size = get_option(options, 'inode_size')
         mkfsoptions = get_option(options, 'mkfsoptions')
+        mountfsoptions = get_option(options, 'mountfsoptions')
         
     nspath = get_option(options, 'nspath')
 
@@ -801,7 +833,8 @@ def add_ost(gen, lustre, options):
 
     osd = gen.osd(osdname, osd_uuid, fstype, osdtype, devname,
                   get_format_flag(options), ost_uuid, node_uuid, size,
-                  journal_size, inode_size, nspath, mkfsoptions)
+                  journal_size, inode_size, nspath, mkfsoptions, 
+                  mountfsoptions, backfstype, backdevname)
 
     node = findByName(lustre, node_name, "node")