From ef4c143e53949596e63cdcc0717172398ea12f60 Mon Sep 17 00:00:00 2001 From: rread Date: Wed, 17 Jul 2002 00:57:48 +0000 Subject: [PATCH] - mountpoints are coded, but ost uuid is not found, at least for lov --- lustre/tests/lov.xml | 7 +++++++ lustre/utils/lconf | 34 ++++++++++++++++++++++++++-------- 2 files changed, 33 insertions(+), 8 deletions(-) diff --git a/lustre/tests/lov.xml b/lustre/tests/lov.xml index 04c931c..95756bb 100644 --- a/lustre/tests/lov.xml +++ b/lustre/tests/lov.xml @@ -12,6 +12,7 @@ + @@ -75,4 +76,10 @@ yes + + /mnt/lov1 + + + + diff --git a/lustre/utils/lconf b/lustre/utils/lconf index d9cca6c..bc9eaa1 100755 --- a/lustre/utils/lconf +++ b/lustre/utils/lconf @@ -316,7 +316,7 @@ def prepare_ldlm(node): def prepare_lov(node): (name, uuid, mdcuuid, stripe_cnt, strip_sz, pattern, devlist, mdsname) = getLOVInfo(node) - print 'LOV:', name, uuid + print 'LOV:', name, uuid, mdcuuid, stripe_cnt, strip_sz, pattern, devlist, mdsname lctl.lovconfig(uuid, mdsname, stripe_cnt, strip_sz, pattern, devlist) lctl.newdev(attach="lov %s %s" % (name, uuid), setup ="%s" % (mdcuuid)) @@ -370,8 +370,12 @@ def prepare_mdc(node): setup ="%s %s" %(mdsuuid, netuuid)) def prepare_mountpoint(node): - print 'MTPT:' - + name, uuid, oscuuid, mdsuuid, mtpt = getMTPTInfo(node) + print 'MTPT:', name, uuid, oscuuid, mdsuuid, mtpt + cmd = "mount -t lustre_lite -o ost=%s,mds=%s none %s" % \ + (oscuuid, mdsuuid, mtpt) + run("mkdir", mtpt) + run(cmd) # ============================================================ # Functions to cleanup the various objects @@ -384,10 +388,12 @@ def cleanup_ldlm(node): print "cleanup failed: ", name def cleanup_lov(node): - (name, uuid) = getNodeAttr(node) - print 'LOV:', name, uuid - - #lctl.cleanup(name, uuid) + (name, uuid, mdcuuid, stripe_cnt, strip_sz, pattern, devlist, mdsname) = getLOVInfo(node) + print 'LOV:', name, uuid, mdcuuid, stripe_cnt, strip_sz, pattern, devlist, mdsname + try: + lctl.cleanup(name, uuid) + except CommandError: + print "cleanup failed: ", name def cleanup_network(node): (name, uuid, type, nid, port) = getNetworkInfo(node) @@ -445,7 +451,9 @@ def cleanup_osc(node): print "cleanup failed: ", name def cleanup_mountpoint(node): - print 'MTPT:' + name, uuid, oscuuid, mdsuuid, mtpt = getMTPTInfo(node) + print 'MTPT:', name, uuid, oscuuid, mdsuuid, mtpt + run("umount", mtpt) # ============================================================ # XML processing and query @@ -541,6 +549,16 @@ def getOSCInfo(node): ostuuid = ref.getAttribute('uuidref') return (name, uuid, obduuid, ostuuid) +# extract device attributes for an obd +def getMTPTInfo(node): + name, uuid = getNodeAttr(node) + path = getText(node, 'path') + ref = node.getElementsByTagName('mds_ref')[0] + mdsuuid = ref.getAttribute('uuidref') + ref = node.getElementsByTagName('lov_ref')[0] + lovuuid = ref.getAttribute('uuidref') + return (name, uuid, mdsuuid, lovuuid, path) + # Get the text content from the first matching child def getText(node, tag, default=""): -- 1.8.3.1