Example #1
0
    # FIXME
    if assign_method == 'hw_pin':
        should_be_nodes = len(lab_config['nodes'].keys())
    else:
        should_be_nodes = lab_config['roller']['controller']['count'] + \
                          lab_config['roller']['compute']['count']
    wait_free_nodes(lab_config, should_be_nodes)

    # add nodes to cluster
    LOG.info("StageX:START Assign nodes to cluster")
    if assign_method == 'hw_pin':
        while len(client.list_cluster_nodes(cluster_id)) < should_be_nodes:
            for node in client.list_nodes():
                node_new = strict_pin_node_to_cluster(node, lab_config)
                if node_new:
                    client.update_node(node['id'], node_new)
            # FIXME add at least timeout
            time.sleep(5)
    else:
        client.update_nodes(simple_pin_nodes_to_cluster(client.list_nodes(),
                                                        lab_config['roller']))
    LOG.info("StageX: END Assign nodes to cluster")

    # assign\create network role to nic per node
    LOG.info("StageX: Assign network role to nic per node")
    if assign_method == 'hw_pin':
        for node in client.list_cluster_nodes(cluster_id):
            upd_ifs = strict_pin_nw_to_node(node, client.get_node_interfaces(
                node['id']), lab_config)
            if upd_ifs:
                client.put_node_interfaces(