AVD pipeline overview
If you want to use the system to produce configs, start with Quick Start.
The Arista Validated Design (AVD) pipeline transforms Infrahub's network data model into PyAVD-compatible input data, then renders Arista EOS configurations and human-readable documentation from it.
PyAVD version​
The integration targets pyavd >= 6.3.0, < 6.4.0 (pinned in pyproject.toml).
The following sections are version-sensitive — review them when upgrading PyAVD:
- Hostvars Reference — the PyAVD input schema.
- Role Mapping — AVD device type names (for example,
l3leaf,super-spine). - Transforms — the PyAVD functions the transforms call (
validate_inputs,get_avd_facts,get_device_structured_config,get_device_config,get_fabric_documentation).
The two-phase pipeline​
Phase 1 — Hostvars​
Generator: generate-avd-device-hostvar
Target: each DcimDevice in the avd_devices group (one task per device).
For each device the generator:
- Extracts device attributes — name, role, BGP ASN, node ID, loopback, management IP.
- Determines the uplink role based on the device's role:
spine → super_spineinterfaces,leafandborder_leaf → spineinterfaces,l2leaf → leafinterfaces,super_spine →no uplinks. - Extracts connected endpoints (servers) from interfaces with
role = "server", including tagged/untagged VLANs. - For leaves, extracts the MLAG peer information, then the virtual router MAC.
- For leaves and spines, queries EVPN tenants, VRFs, SVIs, and L2 VLANs associated with the fabric (skipped entirely for
l2leaf). - For Border Leafs, evaluates
NetworkLinkobjects withrole=dciin the fabric and emits valid links as profile-free PyAVDl3_edge.p2p_linksentries. DCI addressing resolves fromNetworkFabric.fabric_ip_poolsroledcifirst, falls back to the legacyNetworkFabric.dci_pool, and then uses deterministic Fabric Supernet fallback when the required DCI prefix-pool role is missing. - Builds a complete PyAVD
hostvarsdict (see Hostvars Reference). - Serialises to JSON, computes a SHA256 checksum, and compares against the previous content. If changed (or absent), writes a new
AvdHostvarFileas a child of the device'sAvdArtifactnode.
Phase 2 — structured config​
Generator: generate-avd-device-structured-config
Target: each NetworkFabric in the fabrics group (one task per fabric).
For the fabric the generator:
- Walks the fabric hierarchy (
fabric → pods → devices,fabric → pods → racks → devices) to collect every device. - Verifies each device has a hostvar artifact; fails fast if any is missing (meaning Phase 1 didn't complete for that device).
- Fetches the hostvars JSON for every device.
- Calls
pyavd.validate_inputs()across all hostvars. - Calls
pyavd.get_avd_facts()once for the fabric to derive shared facts (routed-uplink allocations, VLAN assignments, etc.). - For each device, calls
pyavd.get_device_structured_config(hostvars, facts)and gets a dict of structured AVD config. - Serialises to JSON, computes a SHA256 checksum, and compares against the previous content. If changed (or absent), writes a new
AvdStructuredConfigFileas a child of the device'sAvdArtifact.
Transforms — on demand​
When an operator opens an AVD artifact in the Infrahub UI, the matching transform runs:
avd_eos_config— readsstructured_config_file, callspyavd.get_device_config(), returnstext/plain.avd_device_doc— readsstructured_config_file, calls the PyAVD device documentation function, returnstext/markdown.avd_fabric_doc— reads hostvars and structured configs for all devices in the fabric, callspyavd.get_fabric_documentation(), returnstext/markdown.
See Transforms for the full transform-by-transform reference.
Components at a glance​
| Generator / Transform | Target | File |
|---|---|---|
generate-avd-device-hostvar | per device | generators/generate_avd_device_hostvar.py |
generate-avd-device-structured-config | per fabric | generators/generate_avd_device_structured_config.py |
avd_eos_config | per device | transforms/avd_eos_config.py |
avd_device_doc | per device | transforms/avd_device_doc.py |
avd_fabric_doc | per fabric | transforms/avd_fabric_doc.py |
Related pages​
- Hostvars Reference — the exact PyAVD input structure built per role.
- AvdArtifact & File Storage — schema, relationships, and how Phase 1 and Phase 2 share data.
- Role Mapping — Infrahub roles → AVD device types.
- Transforms — detailed transform-by-transform breakdown.
- Extending the Pipeline — worked examples for adding roles, transform outputs, or hostvar fields.
- Debugging the Pipeline — object-store inspection, forced regeneration, single-generator re-runs.