def main(): priv_context.init(root_helper=shlex.split(utils.get_root_helper())) zun_service.prepare_service(sys.argv) config.parse_args(sys.argv) # Initialize o.vo registry. os_vif.initialize() service.CNIDaemonServiceManager().run()
def get_volume_connector_properties(): """Wrapper to automatically set root_helper in brick calls. :param multipath: A boolean indicating whether the connector can support multipath. :param enforce_multipath: If True, it raises exception when multipath=True is specified but multipathd is not running. If False, it falls back to multipath=False when multipathd is not running. """ root_helper = utils.get_root_helper() return brick_connector.get_connector_properties(root_helper, CONF.my_block_storage_ip, CONF.volume.use_multipath, enforce_multipath=True, host=CONF.host)
def main(): priv_context.init(root_helper=shlex.split(utils.get_root_helper())) zun_service.prepare_service(sys.argv) LOG.info('Starting server in PID %s', os.getpid()) CONF.log_opt_values(LOG, logging.DEBUG) CONF.import_opt('topic', 'zun.conf.compute', group='compute') from zun.compute import manager as compute_manager endpoints = [ compute_manager.Manager(), ] server = rpc_service.Service.create(CONF.compute.topic, CONF.host, endpoints, binary='zun-compute') launcher = service.launch(CONF, server, restart_method='mutate') launcher.wait()
def main(): priv_context.init(root_helper=shlex.split(utils.get_root_helper())) zun_service.prepare_service(sys.argv) LOG.info('Starting server in PID %s', os.getpid()) CONF.log_opt_values(LOG, logging.DEBUG) CONF.import_opt('topic', 'zun.conf.compute', group='compute') endpoints = [ compute_manager.Manager(), ] server = rpc_service.Service.create(CONF.compute.topic, CONF.host, endpoints, binary='zun-compute') launcher = service.launch(CONF, server) launcher.wait()
def get_volume_connector(protocol, driver=None, use_multipath=False, device_scan_attempts=3, *args, **kwargs): """Wrapper to get a brick connector object. This automatically populates the required protocol as well as the root_helper needed to execute commands. """ root_helper = utils.get_root_helper() if protocol.upper() == "RBD": kwargs['do_local_attach'] = True return brick_connector.InitiatorConnector.factory( protocol, root_helper, driver=driver, use_multipath=use_multipath, device_scan_attempts=device_scan_attempts, *args, **kwargs)