def _create_ip_to_node_map(meta_map):
    """
    Create IP to NodeId mapping from meta_map

    """

    ip_to_node = {}
    if not meta_map or not isinstance(meta_map, dict):
        return ip_to_node

    for node in meta_map:
        if not meta_map[node] or not 'ip' in meta_map[node]:
            continue

        ip_to_node[meta_map[node]['ip']] = node

    return ip_to_node