How nautobot/nautobot-app-device-onboarding works
Purpose and Host Integration
This is a Python Nautobot App that onboards network devices from minimal operator input (typically management IP and Location), then can synchronize discovered network data into Nautobot. It runs inside the Nautobot/Django process rather than as a standalone web application.
• App package and registration: nautobot_device_onboarding/__init__.py
• Nautobot Job entry points: nautobot_device_onboarding/jobs.py
• Optional app URL integration: nautobot_device_onboarding/urls.py
Job-Orchestrated Onboarding
Nautobot Jobs accept manual or CSV-driven device requests, validate options, and drive the onboarding workflow. The central onboarding service encapsulates the business process: connect, identify device properties, create/update Nautobot records, and report task results.
• Job definitions: nautobot_device_onboarding/jobs.py
• Core workflow: nautobot_device_onboarding/onboarding/onboarding.py
• Shared domain choices/constants: nautobot_device_onboarding/choices.py, nautobot_device_onboarding/constants.py
Network Collection Boundary
Network I/O is isolated in the Nornir play layer. It creates an ephemeral inventory from onboarding inputs, selects commands by platform, executes collection, processes results, and formats normalized structures for downstream persistence. Netmiko and NAPALM are the material device-access dependencies.
• Inventory construction: nautobot_device_onboarding/nornir_plays/inventory_creator.py
• Command execution/collection: nautobot_device_onboarding/nornir_plays/command_getter.py
• Processing pipeline: nautobot_device_onboarding/nornir_plays/processor.py
Platform-Specific Extraction
Platform command mappers are declarative YAML assets for supported network operating systems. They determine what commands are collected and how raw outputs are extracted. TTP templates handle specialized parsing where generic collection is insufficient.
• Mapper corpus: nautobot_device_onboarding/command_mappers/
• Example Cisco mapper: nautobot_device_onboarding/command_mappers/cisco_ios.yml
• TTP parsers: nautobot_device_onboarding/parsers/ttp/
Transformation and Extension Point
Collected command data passes through transformation and formatting stages before becoming onboarding or synchronization models. Vendor-/organization-specific behavior can be added through onboarding extensions, separating custom device logic from the core workflow.
• Data transformation: nautobot_device_onboarding/nornir_plays/transform.py
• Result formatting: nautobot_device_onboarding/nornir_plays/formatter.py
• Extension implementation example: nautobot_device_onboarding/onboarding_extensions/ios.py
Nautobot Persistence and Synchronization
The app has two persistence modes: direct onboarding-oriented Nautobot interaction and DiffSync-based reconciliation of discovered devices/network data. DiffSync adapters/models establish the boundary between normalized network facts and Nautobot objects, supporting device, interface, IP, VLAN/VRF, software, and related data synchronization.
• Direct Nautobot interaction: nautobot_device_onboarding/nautobot_keeper.py
• Device synchronization adapter: nautobot_device_onboarding/diffsync/adapters/sync_devices_adapters.py
• Network-data synchronization adapter: nautobot_device_onboarding/diffsync/adapters/sync_network_data_adapters.py
Runtime, State, and Infrastructure
The runtime is Python within Nautobot/Django, with Django migrations defining app-owned persistent state. Development is containerized and supports Nautobot plus selectable PostgreSQL/MySQL and Redis services. Credentials are handled through a dedicated utility boundary rather than embedded in command mappings.
• Database schema evolution: nautobot_device_onboarding/migrations/
• Credential handling: nautobot_device_onboarding/utils/credentials.py
• Development service composition: development/docker-compose.base.yml, development/docker-compose.postgres.yml, development/docker-compose.redis.yml
Main entry points: onboarding.py Onboarding service · formatter.py Result formatter · command_getter.py Command collection · __init__.py App registration
Components 19
Nautobot Host
Runs the app inside Nautobot/Django.
- App registration
nautobot_device_onboarding/__init__.py - Optional URLs
nautobot_device_onboarding/urls.py - Development services · Nautobot development stack with selectable database and Redis services.
development/docker-compose.base.yml
Onboarding Workflow
- Nautobot Jobs · Accepts manual or CSV onboarding requests.
nautobot_device_onboarding/jobs.py - Domain choices
nautobot_device_onboarding/choices.py - Onboarding service · Coordinates discovery, record creation, and task reporting.
nautobot_device_onboarding/onboarding/onboarding.py - Credential handling
nautobot_device_onboarding/utils/credentials.py - IOS extension · Example vendor-specific customization point.
nautobot_device_onboarding/onboarding_extensions/ios.py
Network Collection
- Ephemeral inventory · Builds device inventory from onboarding inputs.
nautobot_device_onboarding/nornir_plays/inventory_creator.py - Command collection · Selects platform commands and executes device collection.
nautobot_device_onboarding/nornir_plays/command_getter.py - Command mappers · Defines commands and extraction rules per network OS.
- TTP parsers
- Result processor · Processes raw Nornir results into downstream structures.
nautobot_device_onboarding/nornir_plays/processor.py - Data transformation
nautobot_device_onboarding/nornir_plays/transform.py - Result formatter
nautobot_device_onboarding/nornir_plays/formatter.py
Persistence & Sync
- Direct Nautobot interaction
nautobot_device_onboarding/nautobot_keeper.py - Device sync adapter · Reconciles discovered devices with Nautobot objects.
nautobot_device_onboarding/diffsync/adapters/sync_devices_adapters.py - Network-data sync adapter · Synchronizes interfaces, IPs, VLANs, VRFs, software, and related data.
nautobot_device_onboarding/diffsync/adapters/sync_network_data_adapters.py - App schema migrations · Defines app-owned persistent state.
Connections 19
- App registration → Nautobot Jobs: registers
- App registration → Optional URLs: integrates
- Nautobot Jobs → Onboarding service: starts
- Domain choices → Nautobot Jobs: validates options
- Onboarding service → Credential handling: obtains access
- Onboarding service → Ephemeral inventory: builds inventory
- Ephemeral inventory → Command collection: supplies targets
- Credential handling → Command collection: supplies credentials
- Command mappers → Command collection: selects commands
- Command collection → Result processor: raw command results
- TTP parsers → Result processor: specialized parsing
- Result processor → Data transformation: processed facts
- Data transformation → Result formatter: normalized data
- IOS extension → Onboarding service: customizes
- Result formatter → Direct Nautobot interaction: direct onboarding
- Result formatter → Device sync adapter: device reconciliation
- Result formatter → Network-data sync adapter: network reconciliation
- Onboarding service → Direct Nautobot interaction: creates or updates records
- Development services → App registration: development runtime