Exemplo n.º 1
0
def create_nodes(conf, inventory, osp_cred, run_id, instances_name=None):
    log.info("Destroying existing osp instances")
    cleanup_ceph_nodes(osp_cred, instances_name)
    ceph_cluster_dict = {}
    log.info("Creating osp instances")
    for cluster in conf.get("globals"):
        ceph_vmnodes = create_ceph_nodes(
            cluster, inventory, osp_cred, run_id, instances_name
        )
        ceph_nodes = []
        clients = []
        for node in ceph_vmnodes.values():
            if node.role == "win-iscsi-clients":
                clients.append(
                    WinNode(
                        ip_address=node.ip_address, private_ip=node.get_private_ip()
                    )
                )
            else:
                ceph = CephNode(
                    username="******",
                    password="******",
                    root_password="******",
                    root_login=node.root_login,
                    role=node.role,
                    no_of_volumes=node.no_of_volumes,
                    ip_address=node.ip_address,
                    private_ip=node.get_private_ip(),
                    hostname=node.hostname,
                    ceph_vmnode=node,
                )
                ceph_nodes.append(ceph)
        cluster_name = cluster.get("ceph-cluster").get("name", "ceph")
        ceph_cluster_dict[cluster_name] = Ceph(cluster_name, ceph_nodes)
    # TODO: refactor cluster dict to cluster list
    log.info("Done creating osp instances")
    log.info("Waiting for Floating IPs to be available")
    log.info("Sleeping 15 Seconds")
    time.sleep(15)
    for cluster_name, cluster in ceph_cluster_dict.items():
        for instance in cluster:
            instance.connect()
    return ceph_cluster_dict, clients
Exemplo n.º 2
0
def get_cluster_object(external_rhcs_info):
    """
    Build a external_ceph.ceph object with all node and role
    info

    Args:
        external_rhcs_info (dict):

    Returns:
        external_ceph.ceph object

    """
    # List of CephNode objects
    node_list = []
    for node, node_info in external_rhcs_info.items():
        node_info["username"] = ocsci_config.EXTERNAL_MODE["login"]["username"]
        node_info["password"] = ocsci_config.EXTERNAL_MODE["login"]["password"]
        node_info["no_of_volumes"] = ""

        log.info(node_info)
        node_list.append(CephNode(**node_info))

    return Ceph(node_list=node_list)
Exemplo n.º 3
0
def get_iso_file_url(base_url):
    return Ceph.get_iso_file_url(base_url)
Exemplo n.º 4
0
def generate_repo_file(base_url, repos):
    return Ceph.generate_repository_file(base_url, repos)