import Lustre
DEFAULT_PORT = 988
-DEFAULT_STRIPE_SZ = 65536
+DEFAULT_STRIPE_SZ = 1048576
DEFAULT_STRIPE_CNT = 1
DEFAULT_STRIPE_PATTERN = 0
UUID_MAX_LENGTH = 31
--node node_name
--nid nid
--cluster_id
- --nettype tcp|elan|gm|scimac
+ --nettype tcp|elan|gm
--hostaddr addr
--port port
--tcpbuf size
--add mds
--node node_name
--mds mds_name
+ --failover
--dev path
- --fstype extN|ext3
+ --backdev path
+ --fstype ldiskfs|ext3
+ --backfstype ldiskfs|ext3|tmpfs
--size size
--nspath
--journal_size size
--inode_size size
--lmv lmv_name
--master
+ --mkfsoptions options
+ --mountfsoptions options
--add lov
--lov lov_name
--add ost
--node node_name
--ost ost_name
+ --failover
--lov lov_name
--dev path
+ --backdev path
--size size
- --fstype extN|ext3
+ --fstype ldiskfs|ext3
+ --backfstype ldiskfs|ext3|tmpfs
--journal_size size
--inode_size size
- --obdtype obdecho|obdfilter
+ --osdtype obdecho|obdfilter
--ostuuid uuid
+ --mkfsoptions options
+ --mountfsoptions options
+ --nspath
--add mtpt - Mountpoint
--node node_name
--add route
--node nodename
+ --router
--gw nid
- --tgt nid
+ --gateway_cluster_id nid
+ --target_cluster_id nid
--lo nid
--hi nid
--add lmv
--lmv lmv_name
+--add cobd
+ --node node_name
+ --real_obd obd_name
+ --cache_obd obd_name
"""
PARAM = Lustre.Options.PARAM
('subsystem', "Specify which Lustre subsystems have debug output recorded in the log", PARAM),
# network
- ('nettype', "Specify the network type. This can be tcp/elan/gm/scimac.", PARAM),
+ ('nettype', "Specify the network type. This can be tcp/elan/gm.", PARAM),
('nid', "Give the network ID, e.g ElanID/IP Address as used by portals.", PARAM),
('tcpbuf', "Optional argument to specify the TCP buffer size.", PARAM, "0"),
('port', "Optional argument to specify the TCP port number.", PARAM, DEFAULT_PORT),
('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"),
+ ('journal_size', "Specify new journal size for underlying file system.", PARAM,"0"),
+ ('inode_size', "Specify new inode size for underlying 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', ""),
('stripe_pattern', "Specify the stripe pattern. RAID 0 is the only one currently supported.", PARAM, 0),
# cobd
- ('real_obd', "", PARAM),
- ('cache_obd', "", PARAM),
+
+ ('real_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),
('mgmt', "Specify management/monitoring service name.", PARAM, ""),
ldlm = self.newService("ldlm", name, uuid)
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=""):
+ def osd(self, name, uuid, fstype, osdtype, devname, format, ost_uuid,
+ node_uuid, dev_size=0, journal_size=0, inode_size=0, nspath="",
+ mkfsoptions="", mountfsoptions="", backfstype="", 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 fstype:
+ self.addElement(osd, "fstype", fstype)
+ if backfstype:
+ self.addElement(osd, "backfstype", backfstype)
+ if backdevname:
+ self.addElement(osd, "backdevpath", backdevname)
if devname:
dev = self.addElement(osd, "devpath", devname)
self.addElement(osd, "autoformat", format)
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
lmv.appendChild(self.ref("active", uuid))
return mds
- def mdsdev(self, name, uuid, fs, devname, format, node_uuid,
+ def mdsdev(self, name, uuid, fstype, devname, format, node_uuid,
mds_uuid, dev_size=0, journal_size=0, inode_size=256,
- nspath="", mkfsoptions="", lmv_uuid=""):
+ nspath="", mkfsoptions="", mountfsoptions="", backfstype="",
+ backdevname="", lmv_uuid=""):
mdd = self.newService("mdsdev", name, uuid)
- self.addElement(mdd, "fstype", fs)
+ self.addElement(mdd, "fstype", fstype)
+ if backfstype:
+ self.addElement(mdd, "backfstype", backfstype)
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))
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))
if lmv_uuid:
port = get_option_int(options, 'port')
tcpbuf = get_option_int(options, 'tcpbuf')
irq_aff = get_option_int(options, 'irq_affinity')
- elif net_type in ('elan', 'gm', 'scimac'):
+ elif net_type in ('elan', 'gm'):
port = 0
tcpbuf = 0
irq_aff = 0
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')
mdd = gen.mdsdev(mdd_name, mdd_uuid, fstype, devname,
get_format_flag(options), node_uuid, mds_uuid,
- size, journal_size, inode_size, nspath, mkfsoptions,
- lmv_uuid)
+ size, journal_size, inode_size, nspath, mkfsoptions,
+ mountfsoptions, backfstype, backdevname, lmv_uuid)
lustre.appendChild(mdd)
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')
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")
def add_cobd(gen, lustre, options):
node_name = get_option(options, 'node')
- name = new_name('COBD_' + node_name)
+ name = get_option(options, 'cobd')
uuid = new_uuid(name)
real_name = get_option(options, 'real_obd')
cache_name = get_option(options, 'cache_obd')
- real_uuid = name2uuid(lustre, real_name, tag='obd')
- cache_uuid = name2uuid(lustre, cache_name, tag='obd')
+ real_uuid = name2uuid(lustre, real_name, tag='lov', fatal=0)
+ cache_uuid = name2uuid(lustre, cache_name, tag='lov', fatal=0)
+
+ if real_uuid:
+ node = lookup(lustre, real_uuid)
+ rets = node.getElementsByTagName('obd_ref')
+ for ret in rets:
+ ost_uuid = ret.getAttribute('uuidref')
+ ost_node = lookup(lustre, ost_uuid)
+ ret = ost_node.getElementsByTagName('active_ref')
+ if ret:
+ osd_uuid = ret[0].getAttribute('uuidref')
+ osd_node = lookup(lustre, osd_uuid)
+ gen.addElement(osd_node, 'cachetype', 'master')
+
+ if cache_uuid:
+ node = lookup(lustre, cache_uuid)
+ rets = node.getElementsByTagName('obd_ref')
+ for ret in rets:
+ ost_uuid = ret.getAttribute('uuidref')
+ ost_node = lookup(lustre, ost_uuid)
+ ret = ost_node.getElementsByTagName('active_ref')
+ if ret:
+ osd_uuid = ret[0].getAttribute('uuidref')
+ osd_node = lookup(lustre, osd_uuid)
+ gen.addElement(osd_node, 'cachetype', 'cache')
+
+ if not real_uuid or not cache_uuid:
+ real_uuid = name2uuid(lustre,real_name, tag='mds')
+ cache_uuid = name2uuid(lustre,cache_name, tag='mds')
+ if real_uuid:
+ mds_node = lookup(lustre, real_uuid)
+ ret = mds_node.getElementsByTagName('active_ref')
+ if ret:
+ mdsdev_uuid = ret[0].getAttribute('uuidref')
+ mdsdev_node = lookup(lustre, mdsdev_uuid)
+ gen.addElement(mdsdev_node, 'cachetype', 'master')
+ if cache_uuid:
+ mds_node = lookup(lustre, cache_uuid)
+ ret = mds_node.getElementsByTagName('active_ref')
+ if ret:
+ mdsdev_uuid = ret[0].getAttribute('uuidref')
+ mdsdev_node = lookup(lustre, mdsdev_uuid)
+ gen.addElement(mdsdev_node, 'cachetype', 'cache')
node = findByName(lustre, node_name, "node")
- node_add_profile(gen, node, "cobd", uuid)
cobd = gen.cobd(name, uuid, real_uuid, cache_uuid)
lustre.appendChild(cobd)
def add_lov(gen, lustre, options):
""" create a lov """
+ lmv_name = get_option(options, 'lmv')
lov_orig = get_option(options, 'lov')
name = new_name(lov_orig)
if name != lov_orig:
mds_name = get_option(options, 'mds')
if not mds_name:
- lmv_name = get_option(options, 'lmv')
if not lmv_name:
error("LOV: MDS or LMV must be specified.");
def new_filesystem(gen, lustre, mds_uuid, obd_uuid, mgmt_uuid):
fs_name = new_name("FS_fsname")
fs_uuid = new_uuid(fs_name)
- mds = lookup(lustre, mds_uuid)
- mds.appendChild(gen.ref("filesystem", fs_uuid))
+ cobd = lookup(lustre, mds_uuid)
+ #SHOULD appendChild filesystem to real mds not cobd
+ ret = cobd.getElementsByTagName("cacheobd_ref")
+ if ret:
+ cacheobd_uuid = ret[0].getAttribute('uuidref')
+ cacheobd = lookup(lustre, cacheobd_uuid)
+ cacheobd.appendChild(gen.ref("filesystem", fs_uuid))
+ ret = cobd.getElementsByTagName("realobd_ref")
+ if ret:
+ realobd_uuid = ret[0].getAttribute('uuidref')
+ realobd = lookup(lustre, realobd_uuid)
+ realobd.appendChild(gen.ref("filesystem", fs_uuid))
+ else:
+ cobd.appendChild(gen.ref("filesystem", fs_uuid))
fs = gen.filesystem(fs_name, fs_uuid, mds_uuid, obd_uuid, mgmt_uuid)
lustre.appendChild(fs)
return fs_uuid
def get_fs_uuid(gen, lustre, mds_name, obd_name, mgmt_name):
mds_uuid = name2uuid(lustre, mds_name, tag='mds', fatal=0)
if not mds_uuid:
- mds_uuid = name2uuid(lustre, mds_name, tag='lmv', fatal=1)
+ mds_uuid = name2uuid(lustre, mds_name, tag='lmv', fatal=0)
+ if not mds_uuid:
+ mds_uuid = name2uuid(lustre, mds_name, tag='cobd', fatal=1)
obd_uuid = name2uuid(lustre, obd_name, tag='lov', fatal=0)
+ if obd_uuid == '':
+ obd_uuid = name2uuid(lustre, obd_name, tag='cobd')
if mgmt_name:
mgmt_uuid = name2uuid(lustre, mgmt_name, tag='mgmt', fatal=1)
else: