specifies the node to modify.
--net hostname nettype [port, recv_buf, send_buf]
- Nettype is either tcp, elan, or gm.
+ Nettype is either tcp, toe, elan, or gm.
Requires --node
--route net gw lo [hi]
def warning(*args):
msg = string.join(map(str,args))
print "Warning: ", msg
-
+
#
# manage names and uuids
# need to initialize this by walking tree to ensure
def osc(self, name, uuid, obd_uuid, net_uuid):
osc = self.newService("osc", name, uuid)
- osc.appendChild(self.ref("network", net_uuid))
+ osc.appendChild(self.ref("ost", net_uuid))
osc.appendChild(self.ref("obd", obd_uuid))
return osc
mds.appendChild(self.ref("failover", failover_uuid))
return mds
- def mdc(self, name, uuid, mds_uuid, net_uuid):
- mdc = self.newService("mdc",name,uuid)
- mdc.appendChild(self.ref("mds",mds_uuid))
- mdc.appendChild(self.ref("network",net_uuid))
- return mdc
-
- def mountpoint(self, name, uuid, mdc_uuid, osc_uuid, path):
+ def mountpoint(self, name, uuid, mds_uuid, osc_uuid, path):
mtpt = self.newService("mountpoint", name, uuid)
- mtpt.appendChild(self.ref("mdc", mdc_uuid))
+ mtpt.appendChild(self.ref("mds", mds_uuid))
mtpt.appendChild(self.ref("osc", osc_uuid))
self.addElement(mtpt, "path", path)
return mtpt
+ def echo_client(self, name, uuid, osc_uuid):
+ ec = self.newService("echo_client", name, uuid)
+ ec.appendChild(self.ref("osc", osc_uuid))
+ return ec
+
############################################################
# Utilities to query a DOM tree
# Using this functions we can treat use config information
port = 0
tcpbuf = 0
- if net_type == 'tcp':
+ if net_type in ('tcp', 'toe'):
if len(args) > 2:
port = int(args[2])
else:
def add_mds(gen, lustre, options, args):
+ fstype = 'extN'
+
if len(args) < 1:
usage()
else:
error("--mds requires a --node argument")
+ if options.has_key('fstype'):
+ fstype = options['fstype']
+
mds_name = new_name(options['mds'])
if mds_name != options['mds']:
warning("name:", options['mds'], "already used. using:", mds_name)
if not net_uuid:
error("NODE: ", node_name, "not found")
-
- mds = gen.mds(mds_name, mds_uuid, "extN", devname, get_format_flag(options),
+ mds = gen.mds(mds_name, mds_uuid, fstype, devname, get_format_flag(options),
net_uuid, node_uuid, dev_size=size)
lustre.appendChild(mds)
if options.has_key('obdtype'):
obdtype = options['obdtype']
-
+ if options.has_key('fstype'):
+ fstype = options['fstype']
if obdtype == 'obdecho':
fstype = ''
else:
obd = gen.obd(obdname, obd_uuid, fstype, obdtype, devname, get_format_flag(options), size)
ost = gen.ost(ostname, ost_uuid, obd_uuid, net_uuid)
- osc = gen.osc(oscname, osc_uuid, obd_uuid, net_uuid)
+ osc = gen.osc(oscname, osc_uuid, obd_uuid, ost_uuid)
if lovname:
lov = findByName(lustre, lovname, "lov")
node_add_profile(gen, node, 'osc', osc_uuid)
+#ditto
+def add_echo_client(gen, lustre, options, args):
+ """ add an echo client to the profile for this node. """
+ if len(args) < 1:
+ usage()
+ lov_name = args[0]
+ if options.has_key('node'):
+ node_name = options['node']
+ else:
+ error("--echo_client requires a --node argument")
+ node = findByName(lustre, node_name, "node")
+
+ echoname = new_name('ECHO_'+ node_name)
+ echo_uuid = new_uuid(echoname)
+ node_add_profile(gen, node, 'echo_client', echo_uuid)
+
+ lov_uuid = name2uuid(lustre, lov_name, tag='lov', fatal=0)
+ if not lov_uuid:
+ lov_uuid = name2uuid(lustre, lov_name, tag='osc', fatal=1)
+
+ echo = gen.echo_client(echoname, echo_uuid, lov_uuid)
+ lustre.appendChild(echo)
+
+
def add_lov(gen, lustre, options, args):
""" create a lov """
if len(args) < 4:
lov_uuid = name2uuid(lustre, lov_name, tag='osc', fatal=1)
uuid = new_uuid(name)
- mdc_name = new_name('MDC_'+mds_name)
- mdc_uuid = new_uuid(mdc_name)
- lovnode = lookup(lustre,lov_uuid)
-
-
- mdsnode = lookup(lustre,mds_uuid)
- ref = mdsnode.getElementsByTagName('network_ref')
- net_uuid = ref[0].getAttribute('uuidref')
-
- mdc = gen.mdc(mdc_name,mdc_uuid,mds_uuid,net_uuid)
- lustre.appendChild(mdc)
-
-
- lovnode.appendChild(gen.ref("mdc",mdc_uuid))
-
-
- mtpt = gen.mountpoint(name, uuid, mdc_uuid, lov_uuid, path)
-
+ mtpt = gen.mountpoint(name, uuid, mds_uuid, lov_uuid, path)
node = findByName(lustre, node_name, "node")
if not node:
error('node:', node_name, "not found.")
#
def parse_cmdline(argv):
short_opts = "ho:i:m:"
- long_opts = ["ost", "osc", "mtpt", "lov=", "node=", "mds=", "net", "tcpbuf=",
+ long_opts = ["ost", "osc", "mtpt", "lov=", "node=", "mds=", "net",
+ "echo_client", "tcpbuf=",
"route", "router", "merge=", "format", "reformat", "output=",
- "obdtype=", "obduuid=", "in=", "help", "batch="]
+ "obdtype=", "fstype=", "obduuid=", "in=", "help", "batch="]
opts = []
args = []
options = {}
options['ost'] = 1
if o == "--osc":
options['osc'] = 1
+ if o == "--echo_client":
+ options['echo_client'] = 1
if o == "--mds":
options['mds'] = a
if o == "--net":
# Options for commands
if o == "--obdtype":
options['obdtype'] = a
+ if o == "--fstype":
+ options['fstype'] = a
if o == "--obduuid":
options['obduuid'] = a
if o == "--tcpbuf":
add_ost(gen, lustre, options, args)
elif options.has_key('osc'):
add_osc(gen, lustre, options, args)
+ elif options.has_key('echo_client'):
+ add_echo_client(gen, lustre, options, args)
elif options.has_key('mtpt'):
add_mtpt(gen, lustre, options, args)
elif options.has_key('mds'):