+def add_default_lov(gen, lustre, mds_name, lov_name):
+ """ create a default lov """
+
+ stripe_sz = DEFAULT_STRIPE_SZ
+ stripe_cnt = DEFAULT_STRIPE_CNT
+ pattern = DEFAULT_STRIPE_PATTERN
+ uuid = new_uuid(lov_name)
+
+ ret = findByName(lustre, lov_name, "lov")
+ if ret:
+ error("LOV: ", lov_name, " already exists.")
+
+ mds_uuid = name2uuid(lustre, mds_name, 'mds')
+ lov = gen.lov(lov_name, uuid, mds_uuid, stripe_sz, stripe_cnt, pattern)
+ lustre.appendChild(lov)
+
+ # add an lovconfig entry to the active mdsdev profile
+ lovconfig_name = new_name('LVCFG_' + lov_name)
+ lovconfig_uuid = new_uuid(lovconfig_name)
+ mds = findByName(lustre, mds_name)
+ mds.appendChild(gen.ref("lovconfig", lovconfig_uuid))
+ lovconfig = gen.lovconfig(lovconfig_name, lovconfig_uuid, uuid)
+ lustre.appendChild(lovconfig)
+