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(): CONF(sys.argv[1:], project='cinder', version=version.version_string()) logging.setup("cinder") utils.monkey_patch() rpc.init(CONF) launcher = service.process_launcher() server = service.WSGIService('osapi_volume') launcher.launch_service(server, workers=server.workers) 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 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) rpc.init(CONF) launcher = service.process_launcher() server = service.WSGIService('osapi_volume') launcher.launch_service(server, workers=server.workers) 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") python_logging.captureWarnings(True) utils.monkey_patch() gmr.TextGuruMeditation.setup_autorun(version, conf=CONF) rpc.init(CONF) launcher = service.process_launcher() server = service.WSGIService('osapi_volume') launcher.launch_service(server, workers=server.workers) 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") python_logging.captureWarnings(True) utils.monkey_patch() gmr.TextGuruMeditation.setup_autorun(version, conf=CONF) rpc.init(CONF) launcher = service.process_launcher() server = service.WSGIService("osapi_volume") launcher.launch_service(server, workers=server.workers) launcher.wait()
def main(): CONF(sys.argv[1:], project='cinder', version=version.version_string()) logging.setup(CONF, "cinder") LOG = logging.getLogger('cinder.all') utils.monkey_patch() 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-volume', 'cinder-scheduler', 'cinder-backup']: try: launcher.launch_service(service.Service.create(binary=binary)) except (Exception, SystemExit): LOG.exception(_LE('Failed to load %s'), binary) launcher.wait()
def main(): CONF(sys.argv[1:], project='cinder', version=version.version_string()) logging.setup("cinder") LOG = logging.getLogger('cinder.all') utils.monkey_patch() 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-volume', 'cinder-scheduler', 'cinder-backup']: try: launcher.launch_service(service.Service.create(binary=binary)) except (Exception, SystemExit): LOG.exception(_LE('Failed to load %s'), binary) launcher.wait()