Example #1
0
def evacuate(name_config=None, debug=False, iteration=False):
    if debug:
        utils.configure_logging("DEBUG")

    try:
        iteration = int(iteration)
    except ValueError:
        LOG.error("Invalid value provided as 'iteration' argument, it must be "
                  "integer")
        return
    cfglib.collector_configs_plugins()
    cfglib.init_config(name_config)
    utils.init_singletones(cfglib.CONF)
    env.key_filename = cfglib.CONF.migrate.key_filename
    cloud = cloud_ferry.CloudFerry(cfglib.CONF)
    LOG.info("running evacuation")
    evacuation_chain.process_chain(cloud, iteration)

    freed_nodes = get_freed_nodes(iteration)

    if not freed_nodes:
        LOG.warning("Evacuation cannot be completed, because there are no "
                    "available compute nodes, that should be freed")
        return

    LOG.info(
        "Following nodes will be freed once in-cloud migration finishes, "
        "and can be moved from source to destination: %s", freed_nodes)
Example #2
0
def evacuate(name_config=None, debug=False, iteration=False):
    if debug:
        utils.configure_logging("DEBUG")

    try:
        iteration = int(iteration)
    except ValueError:
        LOG.error("Invalid value provided as 'iteration' argument, it must be "
                  "integer")
        return
    cfglib.collector_configs_plugins()
    cfglib.init_config(name_config)
    utils.init_singletones(cfglib.CONF)
    env.key_filename = cfglib.CONF.migrate.key_filename
    cloud = cloud_ferry.CloudFerry(cfglib.CONF)
    LOG.info("running evacuation")
    evacuation_chain.process_chain(cloud, iteration)

    freed_nodes = get_freed_nodes(iteration)

    if not freed_nodes:
        LOG.warning("Evacuation cannot be completed, because there are no "
                    "available compute nodes, that should be freed")
        return

    LOG.info("Following nodes will be freed once in-cloud migration finishes, "
             "and can be moved from source to destination: %s", freed_nodes)
Example #3
0
def migrate(name_config=None, name_instance=None):
    """
        :name_config - name of config yaml-file, example 'config.yaml'
    """
    cfglib.collector_configs_plugins()
    cfglib.init_config(name_config)
    utils.init_singletones(cfglib.CONF)
    env.key_filename = cfglib.CONF.migrate.key_filename
    cloud = cloud_ferry.CloudFerry(cfglib.CONF)
    cloud.migrate()
Example #4
0
def migrate(name_config=None, name_instance=None):
    """
        :name_config - name of config yaml-file, example 'config.yaml'
    """
    cfglib.collector_configs_plugins()
    cfglib.init_config(name_config)
    utils.init_singletones(cfglib.CONF)
    env.key_filename = cfglib.CONF.migrate.key_filename
    cloud = cloud_ferry.CloudFerry(cfglib.CONF)
    cloud.migrate(Scenario())
Example #5
0
def migrate(name_config=None, name_instance=None, debug=False):
    """
        :name_config - name of config yaml-file, example 'config.yaml'
    """
    if debug:
        utl.configure_logging("DEBUG")
    cfglib.collector_configs_plugins()
    cfglib.init_config(name_config)
    utils.init_singletones(cfglib.CONF)
    env.key_filename = cfglib.CONF.migrate.key_filename
    cloud = cloud_ferry.CloudFerry(cfglib.CONF)
    cloud.migrate(Scenario())
Example #6
0
def migrate(name_config=None, name_instance=None, debug=False):
    """
        :name_config - name of config yaml-file, example 'config.yaml'
    """
    if debug:
        utils.configure_logging("DEBUG")
    cfglib.collector_configs_plugins()
    cfglib.init_config(name_config)
    utils.init_singletones(cfglib.CONF)
    env.key_filename = cfglib.CONF.migrate.key_filename
    cloud = cloud_ferry.CloudFerry(cfglib.CONF)
    cloud.migrate(Scenario(path_scenario=cfglib.CONF.migrate.scenario,
                           path_tasks=cfglib.CONF.migrate.tasks_mapping))
Example #7
0
def init(name_config=None, debug=None):
    try:
        cfglib.init_config(name_config)
    except oslo_config.cfg.Error:
        traceback.print_exc()
        sys.exit(ERROR_INVALID_CONFIGURATION)

    utils.init_singletones(cfglib.CONF)
    if cfglib.CONF.migrate.hide_ssl_warnings:
        warnings.simplefilter("ignore")
    if debug is not None:
        value = oslo_config.types.Boolean()(debug)
        cfglib.CONF.set_override("debug", value, "migrate")
    log.configure_logging()
Example #8
0
def init(name_config=None, debug=None):
    try:
        cfglib.init_config(name_config)
    except oslo_config.cfg.Error:
        traceback.print_exc()
        sys.exit(ERROR_INVALID_CONFIGURATION)

    utils.init_singletones(cfglib.CONF)
    if cfglib.CONF.migrate.hide_ssl_warnings:
        warnings.simplefilter("ignore")
    if debug is not None:
        value = oslo_config.types.Boolean()(debug)
        cfglib.CONF.set_override('debug', value, 'migrate')
    log.configure_logging()
Example #9
0
def migrate(name_config=None, name_instance=None, debug=False):
    """
        :name_config - name of config yaml-file, example 'config.yaml'
    """
    if debug:
        utils.configure_logging("DEBUG")
    cfglib.collector_configs_plugins()
    cfglib.init_config(name_config)
    utils.init_singletones(cfglib.CONF)
    env.key_filename = cfglib.CONF.migrate.key_filename
    env.connection_attempts = cfglib.CONF.migrate.ssh_connection_attempts
    cloud = cloud_ferry.CloudFerry(cfglib.CONF)
    cloud.migrate(
        Scenario(path_scenario=cfglib.CONF.migrate.scenario,
                 path_tasks=cfglib.CONF.migrate.tasks_mapping))
Example #10
0
def load_config(name_config):
    cfglib.collector_configs_plugins()
    cfglib.init_config(name_config)
    utils.init_singletones(cfglib.CONF)
    if cfglib.CONF.migrate.hide_ssl_warnings:
        warnings.simplefilter("ignore")