Beispiel #1
0
def main():
    objects.register_all()
    CONF(sys.argv[1:], project='guts',
         version=version.version_string())
    logging.setup(CONF, "guts")
    LOG = logging.getLogger('guts.all')

    utils.monkey_patch()

    gmr.TextGuruMeditation.setup_autorun(version)

    rpc.init(CONF)

    launcher = service.process_launcher()
    # guts-api
    try:
        server = service.WSGIService('osapi_migration')
        launcher.launch_service(server, workers=server.workers or 1)
    except (Exception, SystemExit):
        LOG.exception(_LE('Failed to load osapi_migration'))

    # guts-migration
    try:
        launcher.launch_service(
            service.Service.create(binary='guts-migration'))
    except (Exception, SystemExit):
        LOG.exception(_LE('Failed to load guts-migration'))

    launcher.wait()
def main():
    objects.register_all()
    CONF(sys.argv[1:], project='guts', version=version.version_string())
    logging.setup(CONF, "guts")
    utils.monkey_patch()
    server = service.Service.create(binary='guts-migration')
    service.serve(server)
    service.wait()
Beispiel #3
0
def main():
    objects.register_all()
    CONF(sys.argv[1:], project='guts', version=version.version_string())
    logging.setup(CONF, "guts")
    python_logging.captureWarnings(True)
    utils.monkey_patch()
    server = service.Service.create(binary='guts-scheduler')
    service.serve(server)
    service.wait()
Beispiel #4
0
def main():
    objects.register_all()
    CONF(sys.argv[1:], project='guts',
         version=version.version_string())
    logging.setup(CONF, "guts")
    utils.monkey_patch()
    server = service.Service.create(binary='guts-migration')
    service.serve(server)
    service.wait()
Beispiel #5
0
def main():
    objects.register_all()
    CONF(sys.argv[1:], project='guts',
         version=version.version_string())
    logging.setup(CONF, "guts")
    python_logging.captureWarnings(True)
    utils.monkey_patch()
    server = service.Service.create(binary='guts-scheduler')
    service.serve(server)
    service.wait()
Beispiel #6
0
def main():
    objects.register_all()
    CONF(sys.argv[1:], project='guts', version=version.version_string())
    logging.setup(CONF, "guts")
    utils.monkey_patch()

    rpc.init(CONF)
    launcher = service.process_launcher()
    server = service.WSGIService('osapi_migration')
    launcher.launch_service(server, workers=server.workers)
    launcher.wait()
Beispiel #7
0
def main():
    objects.register_all()
    CONF(sys.argv[1:], project="guts", version=version.version_string())
    logging.setup(CONF, "guts")
    utils.monkey_patch()

    rpc.init(CONF)
    launcher = service.process_launcher()
    server = service.WSGIService("osapi_migration")
    launcher.launch_service(server, workers=server.workers)
    launcher.wait()
Beispiel #8
0
def main():
    objects.register_all()
    CONF(sys.argv[1:], project='guts',
         version=version.version_string())
    logging.setup(CONF, "guts")
    utils.monkey_patch()
    launcher = service.get_launcher()
    LOG = logging.getLogger(__name__)
    source_service_started = False
    destination_service_started = False

    if CONF.enabled_source_hypervisors:
        for source in CONF.enabled_source_hypervisors:
            host = "%s@%s" % (CONF.host, source)
            try:
                server = service.Service.create(host=host,
                                                service_name=source,
                                                binary="guts-source")
            except Exception:
                msg = _('Source service %s failed to start.') % (host)
                LOG.exception(msg)
            else:
                launcher.launch_service(server)
                source_service_started = True

    if CONF.enabled_destination_hypervisors:
        for dest in CONF.enabled_destination_hypervisors:
            host = "%s@%s" % (CONF.host, dest)
            try:
                server = service.Service.create(host=host,
                                                service_name=dest,
                                                binary="guts-destination")
            except Exception:
                msg = _('Destination service %s failed to start.') % (host)
                LOG.exception(msg)
            else:
                launcher.launch_service(server)
                destination_service_started = True

    if not (source_service_started or destination_service_started):
        msg = _('No migration service(s) started successfully, terminating.')
        LOG.error(msg)
        sys.exit(1)

    launcher.wait()
Beispiel #9
0
def main():
    objects.register_all()
    CONF(sys.argv[1:], project='guts', version=version.version_string())
    logging.setup(CONF, "guts")
    utils.monkey_patch()
    launcher = service.get_launcher()
    LOG = logging.getLogger(__name__)
    source_service_started = False
    destination_service_started = False

    if CONF.enabled_source_hypervisors:
        for source in CONF.enabled_source_hypervisors:
            host = "%s@%s" % (CONF.host, source)
            try:
                server = service.Service.create(host=host,
                                                service_name=source,
                                                binary="guts-source")
            except Exception:
                msg = _('Source service %s failed to start.') % (host)
                LOG.exception(msg)
            else:
                launcher.launch_service(server)
                source_service_started = True

    if CONF.enabled_destination_hypervisors:
        for dest in CONF.enabled_destination_hypervisors:
            host = "%s@%s" % (CONF.host, dest)
            try:
                server = service.Service.create(host=host,
                                                service_name=dest,
                                                binary="guts-destination")
            except Exception:
                msg = _('Destination service %s failed to start.') % (host)
                LOG.exception(msg)
            else:
                launcher.launch_service(server)
                destination_service_started = True

    if not (source_service_started or destination_service_started):
        msg = _('No migration service(s) started successfully, terminating.')
        LOG.error(msg)
        sys.exit(1)

    launcher.wait()