<!ELEMENT profile (ldlm_ref | ptlrpc_ref | network_ref | routetbl_ref |
osd_ref | mdsdev_ref | lovconfig_ref|
- echoclient_ref | mountpoint_ref | mgmt_ref)*>
+ echoclient_ref | mountpoint_ref)*>
<!ATTLIST profile %object.attr;>
<!ELEMENT mountpoint path #REQUIRED
<!ELEMENT ldlm EMPTY>
<!ATTLIST ldlm %object.attr;>
-<!ELEMENT mgmt (active_ref)*>
-<!ATTLIST mgmt %object.attr;>
-
<!ELEMENT ptlrpc EMPTY>
<!ATTLIST ptlrpc %object.attr;>
failover ( 1 | 0 ) #IMPLIED>
<!ELEMENT filesystem mds_ref #REQUIRED
- obd_ref #REQUIRED
- (mgmt_ref)* >
+ obd_ref #REQUIRED>
<!ATTLIST filesystem %object.attr;>
<!ELEMENT mds (active_ref | lovconfig_ref | group)*>
<!ATTLIST lov_ref %objref.attr;>
<!ELEMENT lovconfig_ref %objref.content;>
<!ATTLIST lovconfig_ref %objref.attr;>
-<!ELEMENT mgmt_ref %objref.content;>
-<!ATTLIST mgmt_ref %objref.attr;>
<!ELEMENT mountpoint_ref %objref.content;>
<!ATTLIST mountpoint_ref %objref.attr;>
<!ELEMENT filesystem_ref %objref.content;>
\end_deeper
\layout Description
---add\SpecialChar ~
-mgmt Management/monitoring service.
-\begin_deeper
-\layout Description
-
---node\SpecialChar ~
-nodename
-\emph on
-
-\emph default
-Node on which the mgmt service resides.
-\layout Description
-
\end_deeper
\layout List
\labelwidthstring 00.00.0000
endif
EXTRA_DIST = lprocfs_status.h lustre_debug.h lustre_ha.h lustre_lib.h \
- lustre_mgmt.h obd_cache.h obd_lov.h lustre_dlm.h lustre_handles.h \
+ obd_cache.h obd_lov.h lustre_dlm.h lustre_handles.h \
lustre_net.h obd_class.h obd_ost.h obd_support.h lustre_commit_confd.h \
lustre_export.h lustre_log.h obd_echo.h \
lustre_compat25.h lustre_fsfilt.h lustre_import.h lustre_mds.h obd.h \
+++ /dev/null
-/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
- * vim:expandtab:shiftwidth=8:tabstop=8:
- */
-
-#ifndef LUSTRE_MGMT_H
-#define LUSTRE_MGMT_H
-
-#define LUSTRE_MGMTCLI_NAME "mgmt_cli"
-
-/* For the convenience and type-safety of inter_module_getters. */
-
-struct obd_device;
-struct obd_uuid;
-
-/*
- * The caller is responsible for ensuring that relevant_uuid -- if non-NULL --
- * points to valid memory until deregister is called. If relevant_uuid is NULL,
- * all management events will be propagated to the registrant. Notice that
- * deregister doesn't take a relevant_uuid-matching parameter; I should probably
- * fix that at some point.
- */
-typedef int (*mgmtcli_register_for_events_t)(struct obd_device *mgmt_obd,
- struct obd_device *notify_obd,
- struct obd_uuid *relevant_uuid);
-
-typedef int (*mgmtcli_deregister_for_events_t)(struct obd_device *mgmt_obd,
- struct obd_device *notify_obd);
-
-#endif /* LUSTRE_MGMT_H */
//struct llog_canceld_ctxt *cl_llcd; /* it's included by obd_llog_ctxt */
void *cl_llcd_offset;
- struct obd_device *cl_mgmtcli_obd;
-
/* the grant values are protected by loi_list_lock below */
long cl_dirty; /* all _dirty_ in bytes */
long cl_dirty_max; /* allowed w/o rpc */
struct ptlrpc_request_pool *cl_rq_pool; /* emergency pool of requests */
};
-/* Like a client, with some hangers-on. Keep mc_client_obd first so that we
- * can reuse the various client setup/connect functions. */
-struct mgmtcli_obd {
- struct client_obd mc_client_obd; /* nested */
- struct ptlrpc_thread *mc_ping_thread;
- struct obd_export *mc_ping_exp; /* XXX single-target */
- struct list_head mc_registered;
- void *mc_hammer;
-};
-
-#define mc_import mc_client_obd.cl_import
-
struct mds_obd {
struct ptlrpc_service *mds_service;
struct ptlrpc_service *mds_setattr_service;
struct lov_obd lov;
struct cache_obd cobd;
struct ptlbd_obd ptlbd;
- struct mgmtcli_obd mgmtcli;
} u;
/* Fields used by LProcFS */
unsigned int obd_cntr_base;
#include <linux/obd.h>
#include <linux/obd_ost.h> /* for LUSTRE_OSC_NAME */
#include <linux/lustre_mds.h> /* for LUSTRE_MDC_NAME */
-#include <linux/lustre_mgmt.h>
#include <linux/lustre_dlm.h>
#include <linux/lustre_net.h>
struct obd_uuid server_uuid;
int rq_portal, rp_portal, connect_op;
char *name = obddev->obd_type->typ_name;
- char *mgmt_name = NULL;
int rc;
- struct obd_device *mgmt_obd;
- mgmtcli_register_for_events_t register_f;
ENTRY;
/* In a more perfect world, we would hang a ptlrpc_client off of
rq_portal = MDS_REQUEST_PORTAL;
rp_portal = MDC_REPLY_PORTAL;
connect_op = MDS_CONNECT;
- } else if (!strcmp(name, LUSTRE_MGMTCLI_NAME)) {
- rq_portal = MGMT_REQUEST_PORTAL;
- rp_portal = MGMT_REPLY_PORTAL;
- connect_op = MGMT_CONNECT;
} else {
CERROR("unknown client OBD type \"%s\", can't setup\n",
name);
name, obddev->obd_name,
imp->imp_target_uuid.uuid);
imp->imp_invalid = 1;
-
- if (LUSTRE_CFG_BUFLEN(lcfg, 4) > 0)
- mgmt_name = lustre_cfg_string(lcfg, 4);
- } else {
- mgmt_name = lustre_cfg_string(lcfg, 3);
- }
- }
-
- if (mgmt_name != NULL) {
- /* Register with management client if we need to. */
- CDEBUG(D_HA, "%s registering with %s for events about %s\n",
- obddev->obd_name, mgmt_name, server_uuid.uuid);
-
- mgmt_obd = class_name2obd(mgmt_name);
- if (!mgmt_obd) {
- CERROR("can't find mgmtcli %s to register\n",
- mgmt_name);
- GOTO(err_import, rc = -ENOSYS);
}
-
- register_f = PORTAL_SYMBOL_GET(mgmtcli_register_for_events);
- if (!register_f) {
- CERROR("can't i_m_g mgmtcli_register_for_events\n");
- GOTO(err_import, rc = -ENOSYS);
- }
-
- rc = register_f(mgmt_obd, obddev, &imp->imp_target_uuid);
- PORTAL_SYMBOL_PUT(mgmtcli_register_for_events);
-
- if (!rc)
- cli->cl_mgmtcli_obd = mgmt_obd;
}
spin_lock_init(&cli->cl_qchk_lock);
if (!cli->cl_import)
RETURN(-EINVAL);
- if (cli->cl_mgmtcli_obd) {
- mgmtcli_deregister_for_events_t dereg_f;
-
- dereg_f = PORTAL_SYMBOL_GET(mgmtcli_deregister_for_events);
- dereg_f(cli->cl_mgmtcli_obd, obddev);
- PORTAL_SYMBOL_PUT(mgmtcli_deregister_for_events);
- }
class_destroy_import(cli->cl_import);
cli->cl_import = NULL;
+++ /dev/null
-.Xrefs
-config.log
-config.status
-configure
-Makefile
-.deps
-tags
-TAGS
-autoMakefile.in
-autoMakefile
-*.ko
-*.mod.c
"log" : (1 << 6),
"llite" : (1 << 7),
"rpc" : (1 << 8),
- "mgmt" : (1 << 9),
"portals" : (1 << 10),
"nal" : (1 << 11),
"pinger" : (1 << 12),
e.dump()
cleanup_error(e.rc)
-class Management(Module):
- def __init__(self, db):
- Module.__init__(self, 'MGMT', db)
- self.add_lustre_module('lvfs', 'lvfs')
- self.add_lustre_module('obdclass', 'obdclass')
- self.add_lustre_module('ptlrpc', 'ptlrpc')
- self.add_lustre_module('mgmt', 'mgmt_svc')
-
- def prepare(self):
- if is_prepared(self.name):
- return
- self.info()
- lctl.newdev("mgmt", self.name, self.uuid)
-
- def safe_to_clean(self):
- return 1
-
- def cleanup(self):
- if is_prepared(self.name):
- Module.cleanup(self)
-
# This is only needed to load the modules; the LDLM device
# is now created automatically.
class LDLM(Module):
if not self.osdtype == 'obdecho':
clean_loop(self.devpath)
-def mgmt_uuid_for_fs(mtpt_name):
- if not mtpt_name:
- return ''
- mtpt_db = toplustreDB.lookup_name(mtpt_name)
- fs_uuid = mtpt_db.get_first_ref('filesystem')
- fs = toplustreDB.lookup(fs_uuid)
- if not fs:
- return ''
- return fs.get_first_ref('mgmt')
-
# Generic client module, used by OSC and MDC
class Client(Module):
def __init__(self, tgtdb, uuid, module, fs_name, self_name=None,
self.uuid = uuid
self.lookup_server(self.tgt_dev_uuid)
self.lookup_backup_targets()
- mgmt_uuid = mgmt_uuid_for_fs(fs_name)
- if mgmt_uuid:
- self.mgmt_name = mgmtcli_name_for_uuid(mgmt_uuid)
- else:
- self.mgmt_name = ''
self.fs_name = fs_name
if not module_dir:
module_dir = module
debug("%s active" % self.target_uuid)
inactive_p = ""
lctl.newdev(self.module, self.name, self.uuid,
- setup ="%s %s %s %s" % (self.target_uuid, srv.nid_uuid,
- inactive_p, self.mgmt_name))
+ setup ="%s %s %s" % (self.target_uuid, srv.nid_uuid,
+ inactive_p))
else:
panic("Unable to create OSC for ", self.target_uuid)
def permits_inactive(self):
return 1
-def mgmtcli_name_for_uuid(uuid):
- return 'MGMTCLI_%s' % uuid
-
-class ManagementClient(Client):
- def __init__(self, db, uuid):
- Client.__init__(self, db, uuid, 'mgmt_cli', '',
- self_name = mgmtcli_name_for_uuid(db.getUUID()),
- module_dir = 'mgmt')
-
class COBD(Module):
def __init__(self, db):
Module.__init__(self, 'COBD', db)
fs = self.db.lookup(self.fs_uuid)
self.mds_uuid = fs.get_first_ref('mds')
self.obd_uuid = fs.get_first_ref('obd')
- self.mgmt_uuid = fs.get_first_ref('mgmt')
obd = self.db.lookup(self.obd_uuid)
client_uuid = generate_client_uuid(self.name)
self.vosc = VOSC(obd, client_uuid, self.name)
self.add_lustre_module('mdc', 'mdc')
self.add_lustre_module('llite', 'llite')
- if self.mgmt_uuid:
- self.mgmtcli = ManagementClient(db.lookup(self.mgmt_uuid),
- client_uuid)
- else:
- self.mgmtcli = None
def prepare(self):
if fs_is_mounted(self.path):
log(self.path, "already mounted.")
return
run_acceptors()
- if self.mgmtcli:
- self.mgmtcli.prepare()
self.vosc.prepare()
self.mdc.prepare()
mdc_name = self.mdc.name
self.mdc.cleanup()
self.vosc.cleanup()
- if self.mgmtcli:
- self.mgmtcli.cleanup()
def load_module(self):
- if self.mgmtcli:
- self.mgmtcli.load_module()
self.vosc.load_module()
Module.load_module(self)
def cleanup_module(self):
Module.cleanup_module(self)
self.vosc.cleanup_module()
- if self.mgmtcli:
- self.mgmtcli.cleanup_module()
# ============================================================
ret = 6
elif type in ('ldlm',):
ret = 20
- elif type in ('mgmt',):
- ret = 25
elif type in ('osd', 'cobd'):
ret = 30
elif type in ('mdsdev',):
n = Mountpoint(db)
elif type == 'echoclient':
n = ECHO_CLIENT(db)
- elif type == 'mgmt':
- n = Management(db)
else:
panic("unknown service type:", type)
return n
def validate_upcall(upcall):
import os
- if upcall in ('DEFAULT',):
+ if upcall in ('DEFAULT','NONE'):
pass
elif os.path.exists(upcall):
if not os.access(upcall, os.X_OK):
('make_service_scripts', "Create per-service symlinks for use with clumanager"),
# Client recovery options
('recover', "Recover a device"),
- ('group', "The group of devices to configure or cleanup", PARAM),
+ ('group,g', "The group of devices to configure or cleanup", PARAM),
('tgt_uuid', "The failed target (required for recovery)", PARAM),
('client_uuid', "The failed client (required for recovery)", PARAM),
('conn_uuid', "The failed connection (required for recovery)", PARAM),
--add echo_client
--node nodename
-
---add mgmt - Management/monitoring service
- --node node_name
- --mgmt mgmt_service_name
"""
PARAM = Lustre.Options.PARAM
# cobd
('real_obd', "Specify the real device for the cache obd system.", PARAM),
('cache_obd', "Specify the cache device for the cache obd system.", PARAM),
-
- ('mgmt', "Specify management/monitoring service name.", PARAM, ""),
]
def error(*args):
mdd.appendChild(self.ref("target", mds_uuid))
return mdd
- def mgmt(self, mgmt_name, mgmt_uuid, node_uuid):
- mgmt = self.newService("mgmt", mgmt_name, mgmt_uuid)
- mgmt.appendChild(self.ref("node", node_uuid))
- # Placeholder until mgmt-service failover.
- mgmt.appendChild(self.ref("active", mgmt_uuid))
- return mgmt
-
def mountpoint(self, name, uuid, fs_uuid, path, clientoptions):
mtpt = self.newService("mountpoint", name, uuid)
mtpt.appendChild(self.ref("filesystem", fs_uuid))
self.addElement(mtpt, "clientoptions", clientoptions)
return mtpt
- def filesystem(self, name, uuid, mds_uuid, obd_uuid, mgmt_uuid):
+ def filesystem(self, name, uuid, mds_uuid, obd_uuid):
fs = self.newService("filesystem", name, uuid)
fs.appendChild(self.ref("mds", mds_uuid))
fs.appendChild(self.ref("obd", obd_uuid))
- if mgmt_uuid:
- fs.appendChild(self.ref("mgmt", mgmt_uuid))
return fs
def echo_client(self, name, uuid, osc_uuid):
lustre.appendChild(mdd)
-def add_mgmt(gen, lustre, options):
- node_name = get_option(options, 'node')
- node_uuid = name2uuid(lustre, node_name, 'node')
- mgmt_name = get_option(options, 'mgmt')
- if not mgmt_name:
- mgmt_name = new_name('MGMT_' + node_name)
- mgmt_uuid = name2uuid(lustre, mgmt_name, 'mgmt', fatal=0)
- if not mgmt_uuid:
- mgmt_uuid = new_uuid(mgmt_name)
- mgmt = gen.mgmt(mgmt_name, mgmt_uuid, node_uuid)
- lustre.appendChild(mgmt)
- else:
- mgmt = lookup(lustre, mgmt_uuid)
-
- node = findByName(lustre, node_name, "node")
- node_add_profile(gen, node, 'mgmt', mgmt_uuid)
-
def add_ost(gen, lustre, options):
node_name = get_option(options, 'node')
lovname = get_option(options, 'lov')
lovconfig = gen.lovconfig(lovconfig_name, lovconfig_uuid, uuid)
lustre.appendChild(lovconfig)
-def new_filesystem(gen, lustre, mds_uuid, obd_uuid, mgmt_uuid):
+def new_filesystem(gen, lustre, mds_uuid, obd_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))
- fs = gen.filesystem(fs_name, fs_uuid, mds_uuid, obd_uuid, mgmt_uuid)
+ fs = gen.filesystem(fs_name, fs_uuid, mds_uuid, obd_uuid)
lustre.appendChild(fs)
return fs_uuid
-def get_fs_uuid(gen, lustre, mds_name, obd_name, mgmt_name):
+def get_fs_uuid(gen, lustre, mds_name, obd_name):
mds_uuid = name2uuid(lustre, mds_name, tag='mds')
obd_uuid = name2uuid(lustre, obd_name, tag='lov', fatal=0)
- if mgmt_name:
- mgmt_uuid = name2uuid(lustre, mgmt_name, tag='mgmt', fatal=1)
- else:
- mgmt_uuid = ''
fs_uuid = lookup_filesystem(lustre, mds_uuid, obd_uuid)
if not fs_uuid:
- fs_uuid = new_filesystem(gen, lustre, mds_uuid, obd_uuid, mgmt_uuid)
+ fs_uuid = new_filesystem(gen, lustre, mds_uuid, obd_uuid)
return fs_uuid
def add_mtpt(gen, lustre, options):
lov_add_obd(gen, lov, ost_uuid)
if fs_name == '':
- mgmt_name = get_option(options, 'mgmt')
- fs_uuid = get_fs_uuid(gen, lustre, mds_name, lov_name, mgmt_name)
+ fs_uuid = get_fs_uuid(gen, lustre, mds_name, lov_name)
else:
fs_uuid = name2uuid(lustre, fs_name, tag='filesystem')
add_echo_client(gen, lustre, options)
elif devtype == 'cobd':
add_cobd(gen, lustre, options)
- elif devtype == 'mgmt':
- add_mgmt(gen, lustre, options)
else:
error("unknown device type:", devtype)