Ejemplo n.º 1
0
def install_node(orig_id, seed_id, node_ids, isolated=False, networks=None):
    if orig_id == seed_id:
        raise Exception("Original and seed environments have the same ID: %s", orig_id)

    orig_env = environment_obj.Environment(orig_id)
    seed_env = environment_obj.Environment(seed_id)
    check_networks(orig_env, seed_env, networks)

    nodes = [node_obj.Node(node_id) for node_id in node_ids]
    orig_node = env_util.get_one_controller(orig_env)
    seed_env.assign(nodes, orig_node.data["roles"])
    for node in nodes:
        disk_info_fixture = orig_node.get_attribute("disks")
        nic_info_fixture = orig_node.get_attribute("interfaces")
        update_node_settings(node, disk_info_fixture, nic_info_fixture)

    if networks:
        env_util.clone_ips(orig_id, networks)

    LOG.info("Nodes reboot in progress. Please wait...")
    node_util.reboot_nodes(nodes, timeout=180 * 60)
    node_util.wait_for_mcollective_start(nodes)
    env_util.provision_nodes(seed_env, nodes)

    env_util.update_deployment_info(seed_env, isolated)

    if isolated and len(nodes) > 1:
        isolate(nodes, seed_env)

    env_util.deploy_changes(seed_env, nodes)

    for node in nodes:
        controller_upgrade.ControllerUpgrade(node, seed_env, isolated=isolated).postdeploy()
Ejemplo n.º 2
0
def install_node(orig_id, seed_id, node_ids, isolated=False, networks=None):
    if orig_id == seed_id:
        raise Exception("Original and seed environments have the same ID: %s",
                        orig_id)

    orig_env = environment_obj.Environment(orig_id)
    seed_env = environment_obj.Environment(seed_id)
    check_networks(orig_env, seed_env, networks)

    nodes = [node_obj.Node(node_id) for node_id in node_ids]
    orig_node = env_util.get_one_controller(orig_env)
    seed_env.assign(nodes, orig_node.data['roles'])
    for node in nodes:
        disk_info_fixture = orig_node.get_attribute('disks')
        nic_info_fixture = orig_node.get_attribute('interfaces')
        update_node_settings(node, disk_info_fixture, nic_info_fixture)

    if networks:
        env_util.clone_ips(orig_id, networks)

    env_util.provision_nodes(seed_env, nodes)

    for node in nodes:
        # FIXME: properly call all handlers all over the place
        controller_upgrade.ControllerUpgrade(
            node, seed_env, isolated=isolated).predeploy()
    if len(nodes) > 1:
        isolate(nodes, seed_env)

    env_util.deploy_changes(seed_env, nodes)

    for node in nodes:
        controller_upgrade.ControllerUpgrade(
            node, seed_env, isolated=isolated).postdeploy()
Ejemplo n.º 3
0
def install_node(orig_id, seed_id, node_ids, isolated=False, networks=None):
    if orig_id == seed_id:
        raise Exception("Original and seed environments have the same ID: %s",
                        orig_id)

    orig_env = environment_obj.Environment(orig_id)
    seed_env = environment_obj.Environment(seed_id)
    check_networks(orig_env, seed_env, networks)

    nodes = [node_obj.Node(node_id) for node_id in node_ids]
    orig_node = env_util.get_one_controller(orig_env)
    seed_env.assign(nodes, orig_node.data['roles'])
    for node in nodes:
        disk_info_fixture = orig_node.get_attribute('disks')
        nic_info_fixture = orig_node.get_attribute('interfaces')
        update_node_settings(node, disk_info_fixture, nic_info_fixture)

    if networks:
        env_util.clone_ips(orig_id, networks)

    LOG.info("Nodes reboot in progress. Please wait...")
    node_util.reboot_nodes(nodes, timeout=180 * 60)
    node_util.wait_for_mcollective_start(nodes)
    env_util.provision_nodes(seed_env, nodes)

    env_util.update_deployment_info(seed_env, isolated)

    if isolated and len(nodes) > 1:
        isolate(nodes, seed_env)

    env_util.deploy_changes(seed_env, nodes)

    for node in nodes:
        controller_upgrade.ControllerUpgrade(node, seed_env,
                                             isolated=isolated).postdeploy()
Ejemplo n.º 4
0
def install_node(orig_id, seed_id, node_ids, isolated=False, networks=None):
    if orig_id == seed_id:
        raise Exception("Original and seed environments have the same ID: %s",
                        orig_id)

    orig_env = environment_obj.Environment(orig_id)
    seed_env = environment_obj.Environment(seed_id)
    check_networks(orig_env, seed_env, networks)

    nodes = [node_obj.Node(node_id) for node_id in node_ids]
    orig_node = env_util.get_one_controller(orig_env)
    seed_env.assign(nodes, orig_node.data['roles'])
    for node in nodes:
        disk_info_fixture = orig_node.get_attribute('disks')
        nic_info_fixture = orig_node.get_attribute('interfaces')
        update_node_settings(node, disk_info_fixture, nic_info_fixture)

    if networks:
        env_util.clone_ips(orig_id, networks)

    env_util.provision_nodes(seed_env, nodes)

    for node in nodes:
        # FIXME: properly call all handlers all over the place
        controller_upgrade.ControllerUpgrade(node, seed_env,
                                             isolated=isolated).predeploy()
    if len(nodes) > 1:
        isolate(nodes, seed_env)

    env_util.deploy_changes(seed_env, nodes)

    for node in nodes:
        controller_upgrade.ControllerUpgrade(node, seed_env,
                                             isolated=isolated).postdeploy()