def main(): objects.register_all() CONF(sys.argv[1:], project='cinder', version=version.version_string()) logging.setup(CONF, "cinder") utils.monkey_patch() gmr.TextGuruMeditation.setup_autorun(version) launcher = service.get_launcher() if CONF.enabled_backends: for backend in CONF.enabled_backends: CONF.register_opt(host_opt, group=backend) backend_host = getattr(CONF, backend).backend_host host = "%s@%s" % (backend_host or CONF.host, backend) server = service.Service.create(host=host, service_name=backend, binary='cinder-volume') # Dispose of the whole DB connection pool here before # starting another process. Otherwise we run into cases where # child processes share DB connections which results in errors. session.dispose_engine() launcher.launch_service(server) else: server = service.Service.create(binary='cinder-volume') launcher.launch_service(server) launcher.wait()
def main(): objects.register_all() gmr_opts.set_defaults(CONF) CONF(sys.argv[1:], project="cinder", version=version.version_string()) config.set_middleware_defaults() logging.setup(CONF, "cinder") LOG = logging.getLogger("cinder.all") versionutils.report_deprecated_feature(LOG, _("cinder-all is deprecated in Newton and will be removed in Ocata.")) utils.monkey_patch() gmr.TextGuruMeditation.setup_autorun(version, conf=CONF) rpc.init(CONF) launcher = service.process_launcher() # cinder-api try: server = service.WSGIService("osapi_volume") launcher.launch_service(server, workers=server.workers or 1) except (Exception, SystemExit): LOG.exception(_LE("Failed to load osapi_volume")) for binary in ["cinder-scheduler", "cinder-backup"]: try: launcher.launch_service(service.Service.create(binary=binary)) except (Exception, SystemExit): LOG.exception(_LE("Failed to load %s"), binary) # cinder-volume try: if CONF.enabled_backends: for backend in CONF.enabled_backends: CONF.register_opt(volume_cmd.host_opt, group=backend) backend_host = getattr(CONF, backend).backend_host host = "%s@%s" % (backend_host or CONF.host, backend) server = service.Service.create( host=host, service_name=backend, binary="cinder-volume", coordination=True ) # Dispose of the whole DB connection pool here before # starting another process. Otherwise we run into cases # where child processes share DB connections which results # in errors. session.dispose_engine() launcher.launch_service(server) else: LOG.warning( _LW( "Configuration for cinder-volume does not specify " '"enabled_backends", using DEFAULT as backend. ' "Support for DEFAULT section to configure drivers " "will be removed in the next release." ) ) server = service.Service.create(binary="cinder-volume", coordination=True) launcher.launch_service(server) except (Exception, SystemExit): LOG.exception(_LE("Failed to load cinder-volume")) launcher.wait()
def main(): objects.register_all() gmr_opts.set_defaults(CONF) CONF(sys.argv[1:], project='cinder', version=version.version_string()) logging.setup(CONF, "cinder") python_logging.captureWarnings(True) priv_context.init(root_helper=shlex.split(utils.get_root_helper())) utils.monkey_patch() gmr.TextGuruMeditation.setup_autorun(version, conf=CONF) launcher = service.get_launcher() LOG = logging.getLogger(__name__) service_started = False if CONF.enabled_backends: for backend in filter(None, CONF.enabled_backends): CONF.register_opt(host_opt, group=backend) backend_host = getattr(CONF, backend).backend_host host = "%s@%s" % (backend_host or CONF.host, backend) # We also want to set cluster to None on empty strings, and we # ignore leading and trailing spaces. cluster = CONF.cluster and CONF.cluster.strip() cluster = (cluster or None) and '%s@%s' % (cluster, backend) try: server = service.Service.create(host=host, service_name=backend, binary='cinder-volume', coordination=True, cluster=cluster) except Exception: msg = _('Volume service %s failed to start.') % host LOG.exception(msg) else: # Dispose of the whole DB connection pool here before # starting another process. Otherwise we run into cases where # child processes share DB connections which results in errors. session.dispose_engine() launcher.launch_service(server) service_started = True else: LOG.warning(_LW('Configuration for cinder-volume does not specify ' '"enabled_backends", using DEFAULT as backend. ' 'Support for DEFAULT section to configure drivers ' 'will be removed in the next release.')) server = service.Service.create(binary='cinder-volume', coordination=True, cluster=CONF.cluster) launcher.launch_service(server) service_started = True if not service_started: msg = _('No volume service(s) started successfully, terminating.') LOG.error(msg) sys.exit(1) launcher.wait()
def main(): objects.register_all() gmr_opts.set_defaults(CONF) CONF(sys.argv[1:], project='cinder', version=version.version_string()) config.set_middleware_defaults() logging.setup(CONF, "cinder") LOG = logging.getLogger('cinder.all') versionutils.report_deprecated_feature(LOG, _( 'cinder-all is deprecated in Newton and will be removed in Ocata.')) utils.monkey_patch() gmr.TextGuruMeditation.setup_autorun(version, conf=CONF) rpc.init(CONF) launcher = service.process_launcher() # cinder-api try: server = service.WSGIService('osapi_volume') launcher.launch_service(server, workers=server.workers or 1) except (Exception, SystemExit): LOG.exception(_LE('Failed to load osapi_volume')) for binary in ['cinder-scheduler', 'cinder-backup']: try: launcher.launch_service(service.Service.create(binary=binary)) except (Exception, SystemExit): LOG.exception(_LE('Failed to load %s'), binary) # cinder-volume try: if CONF.enabled_backends: for backend in CONF.enabled_backends: CONF.register_opt(volume_cmd.host_opt, group=backend) backend_host = getattr(CONF, backend).backend_host host = "%s@%s" % (backend_host or CONF.host, backend) server = service.Service.create(host=host, service_name=backend, binary='cinder-volume') # Dispose of the whole DB connection pool here before # starting another process. Otherwise we run into cases # where child processes share DB connections which results # in errors. session.dispose_engine() launcher.launch_service(server) else: server = service.Service.create(binary='cinder-volume') launcher.launch_service(server) except (Exception, SystemExit): LOG.exception(_LE('Failed to load cinder-volume')) launcher.wait()
def main(): objects.register_all() gmr_opts.set_defaults(CONF) CONF(sys.argv[1:], project='cinder', version=version.version_string()) config.set_middleware_defaults() logging.setup(CONF, "cinder") LOG = logging.getLogger('cinder.all') versionutils.report_deprecated_feature(LOG, _( 'cinder-all is deprecated in Newton and will be removed in Ocata.')) utils.monkey_patch() gmr.TextGuruMeditation.setup_autorun(version, conf=CONF) rpc.init(CONF) launcher = service.process_launcher() # cinder-api try: server = service.WSGIService('osapi_volume') launcher.launch_service(server, workers=server.workers or 1) except (Exception, SystemExit): LOG.exception(_LE('Failed to load osapi_volume')) for binary in ['cinder-scheduler', 'cinder-backup']: try: launcher.launch_service(service.Service.create(binary=binary)) except (Exception, SystemExit): LOG.exception(_LE('Failed to load %s'), binary) # cinder-volume try: if CONF.enabled_backends: for backend in CONF.enabled_backends: CONF.register_opt(volume_cmd.host_opt, group=backend) backend_host = getattr(CONF, backend).backend_host host = "%s@%s" % (backend_host or CONF.host, backend) server = service.Service.create(host=host, service_name=backend, binary='cinder-volume') # Dispose of the whole DB connection pool here before # starting another process. Otherwise we run into cases # where child processes share DB connections which results # in errors. session.dispose_engine() launcher.launch_service(server) else: server = service.Service.create(binary='cinder-volume') launcher.launch_service(server) except (Exception, SystemExit): LOG.exception(_LE('Failed to load conder-volume')) launcher.wait()
def _launch_backup_process(launcher, num_process): try: server = service.Service.create(binary='cinder-backup', coordination=True, process_number=num_process) except Exception: LOG.exception('Backup service %s failed to start.', CONF.host) sys.exit(1) else: # Dispose of the whole DB connection pool here before # starting another process. Otherwise we run into cases where # child processes share DB connections which results in errors. session.dispose_engine() launcher.launch_service(server)
def _launch_backup_process(launcher, num_process): try: server = service.Service.create(binary='cinder-backup', coordination=True, process_number=num_process + 1) except Exception: LOG.exception('Backup service %s failed to start.', CONF.host) sys.exit(1) else: # Dispose of the whole DB connection pool here before # starting another process. Otherwise we run into cases where # child processes share DB connections which results in errors. session.dispose_engine() launcher.launch_service(server)
def main(): objects.register_all() gmr_opts.set_defaults(CONF) CONF(sys.argv[1:], project='cinder', version=version.version_string()) logging.setup(CONF, "cinder") python_logging.captureWarnings(True) utils.monkey_patch() gmr.TextGuruMeditation.setup_autorun(version, conf=CONF) launcher = service.get_launcher() LOG = logging.getLogger(__name__) service_started = False if CONF.enabled_backends: for backend in CONF.enabled_backends: CONF.register_opt(host_opt, group=backend) backend_host = getattr(CONF, backend).backend_host host = "%s@%s" % (backend_host or CONF.host, backend) try: server = service.Service.create(host=host, service_name=backend, binary='cinder-volume', coordination=True) except Exception: msg = _('Volume service %s failed to start.') % host LOG.exception(msg) else: # Dispose of the whole DB connection pool here before # starting another process. Otherwise we run into cases where # child processes share DB connections which results in errors. session.dispose_engine() launcher.launch_service(server) service_started = True else: server = service.Service.create(binary='cinder-volume', coordination=True) launcher.launch_service(server) service_started = True if not service_started: msg = _('No volume service(s) started successfully, terminating.') LOG.error(msg) sys.exit(1) launcher.wait()
def _launch_service(launcher, backend): CONF.register_opt(host_opt, group=backend) backend_host = getattr(CONF, backend).backend_host host = "%s@%s" % (backend_host or CONF.host, backend) # We also want to set cluster to None on empty strings, and we # ignore leading and trailing spaces. cluster = CONF.cluster and CONF.cluster.strip() cluster = (cluster or None) and '%s@%s' % (cluster, backend) try: server = service.Service.create(host=host, service_name=backend, binary=constants.VOLUME_BINARY, coordination=True, cluster=cluster) except Exception: LOG.exception('Volume service %s failed to start.', host) else: # Dispose of the whole DB connection pool here before # starting another process. Otherwise we run into cases where # child processes share DB connections which results in errors. session.dispose_engine() launcher.launch_service(server) _notify_service_started()
CONF.register_opt(host_opt, group=backend) backend_host = getattr(CONF, backend).backend_host host = "%s@%s" % (backend_host or CONF.host, backend) <<<<<<< HEAD try: server = service.Service.create(host=host, service_name=backend, binary='cinder-volume') except Exception: msg = _('Volume service %s failed to start.') % host LOG.exception(msg) else: # Dispose of the whole DB connection pool here before # starting another process. Otherwise we run into cases where # child processes share DB connections which results in errors. session.dispose_engine() launcher.launch_service(server) service_started = True ======= server = service.Service.create(host=host, service_name=backend, binary='cinder-volume') # Dispose of the whole DB connection pool here before # starting another process. Otherwise we run into cases where # child processes share DB connections which results in errors. session.dispose_engine() launcher.launch_service(server) >>>>>>> refs/remotes/openstack/stable/kilo else: server = service.Service.create(binary='cinder-volume') launcher.launch_service(server)