"""
-import sys, os, getopt, string, exceptions
+import sys, os, getopt, string, exceptions, random
import xml.dom.minidom
from xml.dom.ext import PrettyPrint
--upcall path
--lustre_upcall path
--portals_upcall path
+ --ptldebug debug_level
+ --subsystem subsystem_name
--add net
--node node_name
--nid nid
--cluster_id
- --nettype tcp|elan|toe|gm|scimac
+ --nettype tcp|elan|gm|scimac
--hostaddr addr
--port port
--tcpbuf size
('upcall', "Set both lustre and portals upcall scripts.", PARAM),
('lustre_upcall', "Set location of lustre upcall script.", PARAM),
('portals_upcall', "Set location of portals upcall script.", PARAM),
+ ('ptldebug', "Set the portals debug level", 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),
return ret
def new_uuid(name):
- return "%s_UUID" % (name)
+ ret_uuid = '%05x_%.19s_%05x%05x' % (int(random.random() * 1048576),
+ name,
+ int(random.random() * 1048576),
+ int(random.random() * 1048576))
+ return ret_uuid[:36]
ldlm_name = 'ldlm'
ldlm_uuid = 'ldlm_UUID'
gen.addElement(node, 'portalsUpcall', options.portals_upcall)
else:
gen.addElement(node, 'portalsUpcall', default_upcall)
+ if options.ptldebug:
+ gen.addElement(node, "ptldebug", get_option(options, 'ptldebug'))
+ if options.subsystem:
+ gen.addElement(node, "subsystem", get_option(options, 'subsystem'))
return node
def do_add_node(gen, lustre, options, node_name):
hostaddr = get_option(options, 'hostaddr')
net_type = get_option(options, 'nettype')
- if net_type in ('tcp', 'toe'):
+ if net_type in ('tcp',):
port = get_option_int(options, 'port')
tcpbuf = get_option_int(options, 'tcpbuf')
irq_aff = get_option_int(options, 'irq_affinity')
gen = GenConfig(doc)
+ # the PRNG is normally seeded with time(), which is not so good for starting # time-synchronized clusters
+ input = open('/dev/urandom', 'r')
+ if not input:
+ print 'Unable to open /dev/urandom!'
+ sys.exit(1)
+ seed = input.read(32)
+ input.close()
+ random.seed(seed)
+
if options.batch:
fp = open(options.batch)
batchCommands = fp.readlines()