Whamcloud - gitweb
Branch: HEAD
authorwangdi <wangdi>
Mon, 6 Jun 2005 16:12:09 +0000 (16:12 +0000)
committerwangdi <wangdi>
Mon, 6 Jun 2005 16:12:09 +0000 (16:12 +0000)
some fix in lmc and lconf for WB cache test
1)add more options for single oss with cache and master lmv
2)some fixes for WB cache test script

lustre/cobd/cache_obd.c
lustre/tests/cmobd.sh
lustre/utils/lconf
lustre/utils/lmc

index bca2a8c..d13f85f 100644 (file)
@@ -783,7 +783,7 @@ static int cobd_iocontrol(unsigned int cmd, struct obd_export *exp,
 
                         rc = client_obd_disconnect(obd, cobd->master_real_exp, 0);
                         rc = client_obd_connect(obd, cobd->cache_exp, &conn,
-                                                NULL, 0);
+                                                NULL, OBD_OPT_REAL_CLIENT);
                         if (rc)
                                 GOTO(out, rc);
                         cobd->cache_real_exp = class_conn2export(&conn);
@@ -803,7 +803,7 @@ static int cobd_iocontrol(unsigned int cmd, struct obd_export *exp,
                         
                         rc = client_obd_disconnect(obd, cobd->cache_real_exp, 0);
                         rc = client_obd_connect(obd, cobd->master_exp, &conn,
-                                                NULL, 0);
+                                                NULL, OBD_OPT_REAL_CLIENT);
                         if (rc)
                                 GOTO(out, rc);
                         cobd->master_real_exp = class_conn2export(&conn);
index 109c588..807fde1 100644 (file)
@@ -9,7 +9,6 @@ TMP=${TMP:-/tmp}
 COBD_MDS=${COBD_MDS:-"cobd_mds"}
 COBD_OST=${COBD_OST:-"cobd_ost"}
 CMOBD_MDS=${CMOBD_MDS:-"cmobd-mds"}
-CMOBD_MDS2=${CMOBD_MDS2:-"cmobd-mds2"}
 
 MASTER_LMV=${MASTER_LMV1:-master-lmv1}
 CACHE_LMV=${MASTER_LMV1:-cache-lmv1}
@@ -86,23 +85,18 @@ ${LMC} -m $config --add mds --node $NODE --mds $MASTER_MDS2 \
 --fstype $BACK_FSTYPE --dev $MDS2_MASTER_DEV --size $MDSSIZE \
 --lmv $MASTER_LMV --format || exit 10
 
-${LMC} -m $config --add lov --lov $MASTER_LOV --lmv $CACHE_LMV \
+${LMC} -m $config --add lov --lov $CACHE_LOV  --cachelmv $CACHE_LMV --masterlmv $MASTER_LMV \
 --stripe_sz $STRIPE_SIZE --stripe_cnt $STRIPECNT --stripe_pattern 0 || exit 20
 
-${LMC} -m $config --add lov --lov $CACHE_LOV --lmv $MASTER_LMV \
---stripe_sz $STRIPE_SIZE --stripe_cnt $STRIPECNT --stripe_pattern 0 || exit 20
-
-${LMC} -m $config --add ost --ost $MASTER_OST --node $NODE --lov $MASTER_LOV \
---fstype $BACK_FSTYPE --dev $OST_MASTER_DEV --size $OSTSIZE  || exit 21
-
 ${LMC} -m $config --add ost --ost $CACHE_OST --node $NODE --lov $CACHE_LOV \
 --fstype $BACK_FSTYPE --dev $OST_CACHE_DEV --size $OSTSIZE  || exit 21
 
 ${LMC} -m $config --add cobd --node $NODE --cobd $COBD_MDS \
 --master_obd $MASTER_LMV --cache_obd $CACHE_LMV || exit 22
 
-${LMC} -m $config --add cobd --node $NODE --cobd $COBD_OST \
---master_obd $MASTER_LOV --cache_obd $CACHE_LOV || exit 22
-
 ${LMC} -m $config --add mtpt --node $NODE --path /mnt/lustre \
---lmv $COBD_MDS --lov $COBD_OST || exit 30
+--lmv $COBD_MDS --lov $CACHE_LOV || exit 30
+
+${LMC} -m $config --add cmobd --node $NODE --cmobd $CMOBD_MDS \
+--master_obd $MASTER_LMV --cache_obd $CACHE_MDS1 || exit 23
+
index d03d215..64fe8a4 100755 (executable)
@@ -2525,7 +2525,8 @@ class CMOBD(Module):
         elif master_class == 'mds':
            self.master = get_mdc(db, self.name, self.master_uuid) 
         elif master_class == 'lmv':
-           client_uuid = "%s_lmv_master_UUID" % (self.name)
+           #tmp fix: cobd and cmobd will use same uuid, so use const name here
+           client_uuid = "%s_lmv_master_UUID" % "master" 
             self.master = LMV(master_obd, client_uuid, self.name);
        else:
            panic("unknown master obd class '%s'" %(master_class))
@@ -2536,7 +2537,7 @@ class CMOBD(Module):
         elif cache_class == 'mds':
            self.cache = get_mdc(db, self.name, self.cache_uuid)
         elif cache_class == 'lmv':
-           client_uuid = "%s_lmv_cache_UUID" % (self.name)
+           client_uuid = "%s_lmv_cache_UUID" % (self.name) 
             self.cache = LMV(cache_obd, client_uuid, self.name);
        else:
            panic("unknown cache obd class '%s'" %(cache_class))
@@ -2603,7 +2604,8 @@ class COBD(Module):
         elif master_class == 'mds':
             self.master = get_mdc(db, name, self.master_uuid) 
         elif master_class == 'lmv':
-           client_uuid = "%s_lmv_master_UUID" % (self.name)
+           #tmp fix: cobd and cmobd will use same uuid, so use const name here
+           client_uuid = "%s_lmv_master_UUID" % "master" 
             self.master = LMV(master_obd, client_uuid, self.name);
        else:
            panic("unknown master obd class '%s'" %(master_class))
@@ -2614,7 +2616,7 @@ class COBD(Module):
         elif cache_class == 'mds':
             self.cache = get_mdc(db, name, self.cache_uuid)
         elif cache_class == 'lmv':
-           client_uuid = "%s_lmv_cache_UUID" % (self.name)
+           client_uuid = "%s_lmv_cache_UUID" % "cache" 
             self.cache = LMV(cache_obd, client_uuid, self.name);
        else:
            panic("unknown cache obd class '%s'" %(cache_class))
@@ -2873,10 +2875,10 @@ def getServiceLevel(self):
         ret = 40
     elif type in ('lmv',):
         ret = 45
-    elif type in ('cmobd',):
-        ret = 50
     elif type in ('mountpoint', 'echoclient'):
-        ret = 70
+        ret = 60
+    elif type in ('cmobd',):
+        ret = 70 
     else:
         panic("Unknown type: ", type)
 
index 35b78be..31f9210 100755 (executable)
@@ -258,6 +258,8 @@ lmc_options = [
     ('master_obd', "Specify the real device for the cache obd system.", PARAM),
     ('cache_obd', "Specify the cache device for the cache obd system.", PARAM),
     ('cobd', "Specify COBD name", PARAM),
+    ('cachelmv', "Specify cache lmv name", PARAM, ""),
+    ('masterlmv', "Specify master lmv name", PARAM, ""),
 
     # cmobd
     ('master_obd', "Specify the master device for the cmobd system.", PARAM),
@@ -1301,13 +1303,15 @@ def add_lov(gen, lustre, options):
     """ create a lov """
 
     lmv_name = get_option(options, 'lmv')
+    cache_lmv_name = get_option(options, 'cachelmv')
+    master_lmv_name = get_option(options, 'masterlmv')
     lov_orig = get_option(options, 'lov')
     name = new_name(lov_orig)
     if name != lov_orig:
         warning("name:", lov_orig, "already used. using:", name)
 
     mds_name = get_option(options, 'mds')
-    if not mds_name and not lmv_name:
+    if not mds_name and not lmv_name and not cache_lmv_name and not master_lmv_name:
         error("LOV: MDS or LMV must be specified.");
 
     stripe_sz = get_option_int(options, 'stripe_sz')
@@ -1339,6 +1343,17 @@ def add_lov(gen, lustre, options):
         lmv = findByName(lustre, lmv_name, "lmv")
         lmv.appendChild(gen.ref("lovconfig", lovconfig_uuid))
         lmv.appendChild(gen.ref("client", uuid))
+       
+
+    if cache_lmv_name:
+        lmv = findByName(lustre, cache_lmv_name, "lmv")
+        lmv.appendChild(gen.ref("lovconfig", lovconfig_uuid))
+        lmv.appendChild(gen.ref("client", uuid))
+    
+    if master_lmv_name:
+        lmv = findByName(lustre, master_lmv_name, "lmv")
+        lmv.appendChild(gen.ref("lovconfig", lovconfig_uuid))
+        lmv.appendChild(gen.ref("client", uuid))
 
     lovconfig = gen.lovconfig(lovconfig_name, lovconfig_uuid, uuid)
     lustre.appendChild(lovconfig)