From 02ba5bb75b30d0998232c420499b8bf93518a747 Mon Sep 17 00:00:00 2001
From: rread <rread>
Date: Wed, 7 Aug 2002 23:38:29 +0000
Subject: [PATCH] - add --mdc option

---
 lustre/utils/lmc | 37 +++++++++++++++++++++++++++++++++++--
 1 file changed, 35 insertions(+), 2 deletions(-)

diff --git a/lustre/utils/lmc b/lustre/utils/lmc
index 072012b3ce..b708734f9a 100755
--- a/lustre/utils/lmc
+++ b/lustre/utils/lmc
@@ -27,9 +27,13 @@ lmc - lustre configurtion data  manager
 ./lmc --output config.xml --node server --net server1 tcp 
 ./lmc --merge config.xml  --node client --net client1 tcp
 
+
 # configure server
 ./lmc --merge config.xml  --node server --mds /tmp/mds1 50000
-./lmc --merge config.xml  --lov lov1 MDC_server 111 222 333
+./lmc --merge config.xml  --node server --mdc MDC_server
+
+# create lov
+./lmc --merge config.xml  --lov lov1 MDC_server 65536 0 0
 ./lmc --merge config.xml  --node server --lov lov1 --ost /tmp/ost1 100000
 ./lmc --merge config.xml  --node server --lov lov1 --ost /tmp/ost2 100000
 
@@ -64,6 +68,10 @@ Commands:
    Create a MDS using the device
    Requires --node 
 
+--mdc mdc_name
+   Configures a MDC for a node.
+   Requires --node 
+
 --ost device [size]
    Creates an OBD/OST/OSC configuration triplet for a new device.
    When used on "host", the device will be initialized and the OST
@@ -434,6 +442,27 @@ def add_mtpt(gen, lustre, options, args):
     node_add_profile(gen, node, "lov", lov_uuid)
     lustre.appendChild(mtpt)
 
+def add_mdc(gen, lustre, options, args):
+    """ create mtpt on a node """
+    if len(args) < 1:
+        usage()
+
+    if options.has_key('node'):
+        node_name = options['node']
+    else:
+        error("--mdc requires a --node argument")
+
+    mdc_name = args[0]
+
+    ret = findByName(lustre, mdc_name, "mdc")
+    if not ret:
+        error("MDC: ", mdc_name, "not found.")
+    mdc_uuid = ret.getAttribute("uuid")
+
+    node = findByName(lustre, node_name, "node")
+    if not node:
+            error('node:',  node_name, "not found.")
+    node_add_profile(gen, node, "mdc", mdc_uuid)
 
 def add_mds(gen, lustre, options, args):
     if len(args) < 1:
@@ -478,7 +507,7 @@ def add_mds(gen, lustre, options, args):
 def parse_cmdline(argv):
     short_opts = "ho:i:m:"
     long_opts = ["ost", "mtpt", "lov=", "node=", "mds", "net",
-                 "merge=", "format", "reformat", "output=",
+                 "mdc", "merge=", "format", "reformat", "output=",
                  "in=", "help"]
     opts = []
     args = []
@@ -498,6 +527,8 @@ def parse_cmdline(argv):
             options['ost'] = 1
         if o == "--mds":
             options['mds'] = 1
+        if o == "--mdc":
+            options['mdc'] = 1
         if o == "--net":
             options['net'] = 1
         if o == "--mtpt":
@@ -546,6 +577,8 @@ def main():
         add_mtpt(gen, lustre, options, args)
     elif options.has_key('mds'):
         add_mds(gen, lustre, options, args)
+    elif options.has_key('mdc'):
+        add_mdc(gen, lustre, options, args)
     elif options.has_key('net'):
         add_net(gen, lustre, options, args)
     elif options.has_key('lov'):
-- 
GitLab