The Discovery feature in Catalyst Center scans your network to identify devices and add them to the inventory. It can also work with the Device Controllability feature to configure necessary network settings on discovered devices.
You have four options for discovering devices:
- Cisco Discovery Protocol (CDP): Provide a seed IP address and Catalyst Center will use CDP to discover neighboring devices.
- IP Address Range: Specify a range of IP addresses to scan. (Maximum range: 4096 devices)
- Link Layer Discovery Protocol (LLDP): Similar to CDP, provide a seed IP address for LLDP-based discovery.
- Classless Inter-Domain Routing (CIDR): Provide a seed IP address and a CIDR notation to define the network range to scan.
Before running the Discovery feature, ensure you have:
- Configured at least one SNMP credential on your devices.
- Set up SSH credentials to allow Catalyst Center to manage devices.
- Network Access: Ensure Catalyst Center has appropriate network access to reach the devices you want to discover.
- Device Support: Verify that your devices support the chosen discovery protocol (CDP or LLDP).
- Credentials: If Device Controllability is enabled, ensure Catalyst Center has the correct credentials to access and configure discovered devices.
- Catalyst Center Configuration:
- Regardless of the method used, you must be able to reach the device from Catalyst Center.
- Configure specific credentials and protocols in Catalyst Center user device_credentials workflow.
catalyst_center_hosts:
hosts:
catalyst_center220:
catalystcenter_host: xx.xx.xx.xx.
catalystcenter_password: XXXXXXXX
catalystcenter_port: 443
dnac_timeout: 60
catalystcenter_username: admin
catalystcenter_verify: false
catalystcenter_version: 2.3.7.6
catalystcenter_debug: true
catalystcenter_log_level: INFO
catalystcenter_log: trueRefer to the official documentation for detailed information on defining workflows: https://galaxy.ansible.com/ui/repo/published/cisco/dnac/content/module/discovery_workflow_manager
You will need to configure various types of credentials based on the devices you want to discover:
- Network Devices: Use CLI and SNMP credentials.
- Compute Devices: Use CLI, SNMP, and HTTP(S) credentials.
You can save commonly used credentials in Catalyst Center for easier access across multiple discovery jobs.
- When you perform the discovery, ensure:
- Only ping-reachable devices are included in the list for IP address range discovery.
- Devices that respond to CDP, CIDR, and LLDP protocols will be included even if they are ping-unreachable.
- Your SNMP read-only community string is correctly configured, as it is necessary for discovery.
- Use the device's loopback IP address for management if reachable.
- If you only want to discover new devices, select the option to discover new devices only to avoid updating existing device information.
discovery_details:
single:
- ip_address_list:
- 204.101.16.1
devices_list: []
discovery_type: SINGLE
protocol_order: ssh
discovery_name: Single IP Discovery11
- ip_address_list:
- 204.101.16.2
devices_list: []
discovery_type: SINGLE
protocol_order: ssh
discovery_name: Single IP Discovery11discovery_details:
range:
- ip_address_list:
- 204.101.16.2-204.101.16.20
discovery_type: RANGE
protocol_order: ssh
discovery_name: Range IP Discovery11discovery_details:
multi_range:
- ip_address_list:
- 204.101.16.2-204.101.16.3
- 204.101.16.4-204.101.16.4
discovery_type: MULTI RANGE
protocol_order: ssh
discovery_name: Multi Range Discovery 11discovery_details:
- ip_address_list:
- 204.101.16.1
devices_list: []
discovery_type: CDP
protocol_order: ssh
discovery_name: CDP Based Discovery1
discovery_specific_credentials:
net_conf_port: "830"
retry: 2discovery_details:
- ip_address_list:
- 204.101.16.1
discovery_type: LLDP
protocol_order: ssh
discovery_name: LLDP Discovery
discovery_specific_credentials:
net_conf_port: "830"
retry: 2discovery_details:
- ip_address_list:
- 204.101.16.1/24
discovery_type: CIDR
protocol_order: ssh
discovery_name: CIDR Discovery
discovery_specific_credentials:
net_conf_port: "830"
retry: 2- Validate Your Input:
yamale -s workflows/device_discovery/schema/device_discovery_schema.yml workflows/device_discovery/vars/device_discovery_vars.yml- Execute the Playbook
ansible-playbook -i host_inventory_dnac1/hosts.yml workflows/device_discovery/playbook/device_discovery_playbook.yml --e VARS_FILE_PATH=../vars/device_discovery_vars.ymlansible-playbook -i host_inventory_dnac1/hosts.yml workflows/device_discovery/playbook/delete_device_discovery.yml --e VARS_FILE_PATH=../vars/device_discovery_vars.yml ansible: 9.9.0
ansible-core: 2.16.10
ansible-runner: 2.4.0
catalystcentersdk: 2.8.3
cisco.catalystcenter: 6.29.0
ansible.utils: 5.1.2Refer to the Catalyst Center documentation for detailed instructions on configuring discovery parameters and using the Ansible playbooks.
Consider backing up your configuration before running the playbooks, especially the delete playbook.
If you encounter any issues, review the Ansible playbook output for error messages and consult the Catalyst Center documentation or support resources.
flowchart TD
A[Start] --> B[Step 1: Create virtual env and install dependencies]
B --> C[Step 2: Provide workflow inputs]
C --> D{Choose input location}
D -->|Option A| E[Update inventory hosts.yaml]
D -->|Option B| F[Update vars input file]
E --> G[Step 3: Export env vars]
F --> G
G --> H[Run ansible-playbook]
H --> I[Review playbook summary output]
I --> J[Done]
- Create and activate a Python virtual environment, then install dependencies.
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
ansible-galaxy collection install cisco.catalystcenter --force-
Provide workflow inputs in either inventory (
inventory/demo_lab/hosts.yaml) or the workflowvars/file. -
Export Catalyst Center environment variables and run the playbook.
export HOSTIP=<catalyst-center-ip-or-fqdn>
export CATALYST_CENTER_USERNAME=<username>
export CATALYST_CENTER_PASSWORD='<password>'
ansible-playbook -i ./inventory/demo_lab/hosts.yaml ./workflows/device_discovery/playbook/device_discovery_playbook.yml -vvvv




