#na_ontap_rest_info lldp neighbor information

1 messages · Page 1 of 1 (latest)

midnight sail
#

I am looking for a way to gather information about lldp neighbors on our cluster nodes, so that I can take this information and populate our DCIM database with port to switch connections.

I don't see any obvious items under "gather_subset", but I might be missing something. Has anyone tried this before?

Thanks,
Pete

stable vector
#

@midnight sail could you mention -option-name that you're looking for here?

pastel storm
#

network/ethernet/ports should include the data in the discovered_devices subtree.

midnight sail
#

So I am using this task:

- name: Gather Netapp port information
  netapp.ontap.na_ontap_rest_info:
    gather_subset:
      - network/ethernet/ports
    fields:
      - "**"
    hostname: "{{ netapp_hostname }}"
    username: "{{ netapp_username }}"
    password: "{{ netapp_password }}"
    https: "{{ netapp_use_https }}"
    validate_certs: "{{ netapp_validate_certs }}"
    use_rest: "{{ netapp_use_rest }}"
  delegate_to: localhost
  register: netapp_rest_info_network_ethernet_ports

- name: print Netapp port information
  debug:
    var: netapp_rest_info_network_ethernet_ports['ontap_info']['network/ethernet/ports']['records']

(more to follow)

#

I was expecting to see the anc0202 e0a section from this command run directly from the cluster

dc1-anc02::> network device-discovery show -protocol lldp 
Node/       Local  Discovered
Protocol    Port   Device (LLDP: ChassisID)  Interface         Platform
----------- ------ ------------------------- ----------------  ----------------
dc1-anc0201/lldp
 e0M    dc1-tor-cab1u7.example.com (mac-removed)
                                             Ethernet47 
 e0a    dc1-tor-cab1u40.example.com (mac-removed)
                                             Ethernet37 
 e0b    dc1-tor-cab1u35.example.com (mac-removed)
                                             Ethernet37 
 e0c    dc1-tor-cab1u40.example.com (mac-removed)
                                             Ethernet38 
 e0d    dc1-tor-cab1u35.example.com (mac-removed)
                                             Ethernet38 
 e0e    dc1-tor-cab1u40.example.com (mac-removed)
                                             Ethernet39 
 e0f    dc1-tor-cab1u35.example.com (mac-removed)
                                             Ethernet39 
dc1-anc0202/lldp
 e0M    dc1-tor-cab1u7.example.com (mac-removed)
                                             Ethernet48 
 e0a    dc1-tor-cab1u40.example.com (mac-removed)    <<<---- This one
                                             Ethernet40 
 e0b    dc1-tor-cab1u35.example.com (mac-removed)
                                             Ethernet40 
 e0c    dc1-tor-cab1u40.example.com (mac-removed)
                                             Ethernet41  
 e0d    dc1-tor-cab1u35.example.com (mac-removed)
                                             Ethernet41 
 e0e    dc1-tor-cab1u40.example.com (mac-removed)
                                             Ethernet42 
 e0f    dc1-tor-cab1u35.example.com (mac-removed)
                                             Ethernet42 
14 entries were displayed.

I had to snip some whitespace to make it fit, apologies for misalignment

lost vector
#

Are the one missing SVM manage LIFS?

midnight sail
#

Apologies if I am misunderstanding the question - but I'm directing this ansible task at the cluster management interface rather than at a specific SVM. Would it be useful if I generate any better/different debug information?

pastel storm
#

Here is a tested example play

` - name: Gather network port information
netapp.ontap.na_ontap_rest_info:
gather_subset:
- network/ethernet/ports
fields:
- discovered_devices
hal_linking: false
use_python_keys: true
parameters:
name: e0a
register: netapp_rest_info_network_ethernet_ports

  • debug:
    msg: "{{ netapp_rest_info_network_ethernet_ports.ontap_info.network_ethernet_ports.records }}"
    `
midnight sail
#

Thank you very much I'll give that a try shortly!

midnight sail
#

Apologies, I think I must be missing something very basic, as it's saying discovered_devices is not a valid field. I'm running this against the cluster management SVM, but I also tried it against node1 and node2 of the cluster directly with the same message:

TASK [netapp_netbox_update : Gather Netapp port information] **********************************************************************************************************************************************************************************
fatal: [dc1-anc02.it.graphcore.ai -> localhost]: FAILED! => {
    "changed": false,
    "invocation": {
        "module_args": {
            "cert_filepath": null,
            "feature_flags": null,
            "fields": [
                "discovered_devices"
            ],
            "force_ontap_version": null,
            "gather_subset": [
                "network/ethernet/ports"
            ],
            "hal_linking": false,
            "hostname": "dc1-anc02.it.graphcore.ai",
            "http_port": null,
            "https": true,
            "ignore_api_errors": null,
            "key_filepath": null,
            "max_records": 1024,
            "ontapi": null,
            "owning_resource": null,
            "parameters": {
                "name": "e0a"
            },
            "password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
            "state": null,
            "use_python_keys": true,
            "use_rest": "always",
            "username": "admin",
            "validate_certs": false
        }
    },
    "msg": {
        "code": "262197",
        "message": "The value \"discovered_devices\" is invalid for field \"fields\" (<field,...>)",
        "target": "fields"
    }
}

I just upgraded to 22.11.0 to see if that helps, but to no avail. I'm on 9.10.1P12, I suppose that could be too old to support that field?

pastel storm
#

According to the REST API documentation discovered_devices was introduced in 9.11 😦

midnight sail
#

Ah that's good information, thanks. It's a dev system, so I will try upgrading it and report back 🙂

pastel storm
#

You could use rest_cli as alternative
` - name: Gather network port information
netapp.ontap.na_ontap_rest_cli:
command: 'network/device-discovery'
verb: GET
params:
port: e0a
register: netapp_rest_info_network_ethernet_ports

  • debug:
    msg: "{{ netapp_rest_info_network_ethernet_ports.msg.records }}"`
midnight sail
#

Thanks - I'll make a note of that too!