[Phase 2] Define Infrahub Schema for EVPN-VXLAN Fabric #51

Merged
Damien merged 58 commits from feature/41-infrahub-schema into main 2026-02-13 19:36:27 +00:00
Owner

Summary

This PR introduces the complete Infrahub schema definition for modeling an Arista EVPN-VXLAN fabric, based on the overlaid.net reference topology (2 spines, 8 leafs in 4 MLAG pairs).

Changes

Schema files (schemas/)

  • base.yml — Core infrastructure: InfraDevice, InfraInterface (generic), InterfaceEthernet, InterfaceLoopback, InterfaceVlan, InterfaceVxlan, InterfacePortChannel, InfraIPAddress
  • bgp.yml — BGP stack: InfraBGPRouterConfig, InfraBGPPeerGroup, InfraBGPSession, InfraBGPAddressFamily
  • vlan_vxlan.yml — VLAN/VXLAN overlay: InfraVLAN, InfraVTEP, InfraVlanVniMapping, InfraEVPNInstance
  • vrf.yml — VRF/L3VNI: InfraVRFConfig, InfraRouteTarget
  • mlag.yml — MLAG domains: InfraMLAGDomain, InfraMLAGPeerConfig
  • extensions.yml — Topology helpers: InfraUnderlayLink, InfraFabric, InfraAutonomousSystem

Configuration

  • .infrahub.yml — Schema loading + menus
  • menus/fabric-menu.yml — UI navigation structure

Documentation

  • schemas/README.md — Complete ER diagram, node inventory, and topology mapping

Topology Coverage

The schema can model the complete reference topology:

  • 2 spines (AS 65000) + 8 leafs (AS 65001-65004)
  • 4 MLAG pairs with peer-link, iBGP, and dual-active detection
  • Underlay eBGP (point-to-point) + overlay EVPN (loopback-to-loopback)
  • L2VXLAN (VLAN-to-VNI) + L3VXLAN (VRF-to-VNI)
  • Anycast gateway with virtual-router addresses

Known Issues (tracked separately)

Les issues suivantes ont été identifiées et seront traitées dans des PRs ultérieures :

  • #43human_friendly_id non-unique sur BGPPeerGroup/BGPSession (🔴 critique)
  • #44 — Duplication InterfaceVxlan vs VTEP (🔴 critique)
  • #45 — Contrainte unique manquante sur InfraVLAN.vlan_id (🔴 critique)
  • #46 — Anycast gateway + autostate manquants sur InterfaceVlan (🟠)
  • #47 — UnderlayLink avec IPs dupliquées (🟠)
  • #48 — router_id redondant + distances BGP manquantes (🟠)
  • #49 — trunk_groups + stp_enabled manquants sur InfraVLAN (🟡)
  • #50 — BGP sessions en contexte VRF (🟠)

Next Step

L'étape suivante est de créer les object files (.yml) pour charger les données de la topologie de référence via l'entrée objects du .infrahub.yml, en se basant sur les configs du repo arista-evpn-vxlan-clab.

Refs

## Summary This PR introduces the complete Infrahub schema definition for modeling an Arista EVPN-VXLAN fabric, based on the overlaid.net reference topology (2 spines, 8 leafs in 4 MLAG pairs). ## Changes ### Schema files (`schemas/`) - **base.yml** — Core infrastructure: `InfraDevice`, `InfraInterface` (generic), `InterfaceEthernet`, `InterfaceLoopback`, `InterfaceVlan`, `InterfaceVxlan`, `InterfacePortChannel`, `InfraIPAddress` - **bgp.yml** — BGP stack: `InfraBGPRouterConfig`, `InfraBGPPeerGroup`, `InfraBGPSession`, `InfraBGPAddressFamily` - **vlan_vxlan.yml** — VLAN/VXLAN overlay: `InfraVLAN`, `InfraVTEP`, `InfraVlanVniMapping`, `InfraEVPNInstance` - **vrf.yml** — VRF/L3VNI: `InfraVRFConfig`, `InfraRouteTarget` - **mlag.yml** — MLAG domains: `InfraMLAGDomain`, `InfraMLAGPeerConfig` - **extensions.yml** — Topology helpers: `InfraUnderlayLink`, `InfraFabric`, `InfraAutonomousSystem` ### Configuration - `.infrahub.yml` — Schema loading + menus - `menus/fabric-menu.yml` — UI navigation structure ### Documentation - `schemas/README.md` — Complete ER diagram, node inventory, and topology mapping ## Topology Coverage The schema can model the complete reference topology: - 2 spines (AS 65000) + 8 leafs (AS 65001-65004) - 4 MLAG pairs with peer-link, iBGP, and dual-active detection - Underlay eBGP (point-to-point) + overlay EVPN (loopback-to-loopback) - L2VXLAN (VLAN-to-VNI) + L3VXLAN (VRF-to-VNI) - Anycast gateway with virtual-router addresses ## Known Issues (tracked separately) Les issues suivantes ont été identifiées et seront traitées dans des PRs ultérieures : - #43 — `human_friendly_id` non-unique sur BGPPeerGroup/BGPSession (🔴 critique) - #44 — Duplication InterfaceVxlan vs VTEP (🔴 critique) - #45 — Contrainte unique manquante sur InfraVLAN.vlan_id (🔴 critique) - #46 — Anycast gateway + autostate manquants sur InterfaceVlan (🟠) - #47 — UnderlayLink avec IPs dupliquées (🟠) - #48 — router_id redondant + distances BGP manquantes (🟠) - #49 — trunk_groups + stp_enabled manquants sur InfraVLAN (🟡) - #50 — BGP sessions en contexte VRF (🟠) ## Next Step L'étape suivante est de créer les **object files** (`.yml`) pour charger les données de la topologie de référence via l'entrée `objects` du `.infrahub.yml`, en se basant sur les configs du repo [arista-evpn-vxlan-clab](https://gitea.arnodo.fr/Damien/arista-evpn-vxlan-clab). ## Refs - Closes #41 - Source: [overlaid.net EVPN Configuration Example](https://overlaid.net/2019/01/27/arista-bgp-evpn-configuration-example/) - Lab: https://gitea.arnodo.fr/Damien/arista-evpn-vxlan-clab
Damien added 58 commits 2026-02-13 19:25:37 +00:00
Add core infrastructure models for Device, Interface, IPAddress,
and Platform based on the arista-evpn-vxlan-clab topology.

Ref: #41
Add models for VLAN, VNI, VTEP, VLAN-VNI mappings, and EVPN instances.
Supports L2VNI and L3VNI types for EVPN-VXLAN fabric.

Ref: #41
Add models for VRF, Route Target, and VRF-Device assignments.
Supports L3VNI association for symmetric IRB routing.

Ref: #41
Add models for Autonomous System, BGP Router Config, Peer Groups,
BGP Sessions, and Address Families. Supports underlay and EVPN overlay.

Ref: #41
Add models for MLAG Domain, Peer Config, and MLAG Interfaces.
Supports dual-primary detection and heartbeat configuration.

Ref: #41
Add Fabric, Underlay Link, and Host Connection models
for fabric-wide configuration and topology documentation.

Ref: #41
Document all schema files, entity relationships, and mapping
to the reference arista-evpn-vxlan-clab topology.

Ref: #41
Update Markdown tables including InfraHub comparison, Prefect benefits, and project progress phases to use consistent column padding. This improves the visual alignment and readability when viewing the raw source file.
Infrahub requires attribute names to have at least 3 characters.

Ref: #41
Infrahub requires attribute names to have at least 3 characters.

Ref: #41
Infrahub requires unique identifiers when multiple relationships
point to the same peer type with the same direction.

Ref: #41
Use outbound direction to avoid bidirectional relationship conflicts
when multiple relationships point to the same peer type.

Ref: #41
Add identifier and direction: outbound for peer_vlan and ibgp_vlan
to avoid bidirectional relationship conflicts.

Ref: #41
Add identifier and direction: outbound for import/export targets
in VRF and VRFDeviceAssignment to avoid bidirectional conflicts.

Ref: #41
InterfaceEthernet.connected_interface is a self-reference that requires
direction: outbound to avoid bidirectional conflicts per Infrahub docs.

Ref: #41
Parent relationships cannot be optional in Infrahub. Since an IP address
can exist without being assigned to an interface (reserved, planned),
we use kind: Attribute instead of kind: Parent.

Also change InfraInterface.ip_addresses from Component to Generic
since Component requires a matching Parent on the other side.

Both sides now use explicit identifier: interface__ip_addresses
for proper bidirectional linking.
Replaces deprecated display_labels list format and bare display_label
strings with the new Jinja2 template format as required by Infrahub.

Refs #41
Refs #41
Refs #41
Refs #41
Refs #41
Also enriched VRFDeviceAssignment display_label to show device + VRF.

Refs #41
Organize 22+ schema nodes into logical categories:
- Fabric Topology (Fabric, Site, Device, Platform, Underlay Links)
- Interfaces (Ethernet, Loopback, VLAN SVI, LAG, VXLAN)
- IP Addressing
- Layer 2 / VXLAN (VLAN, VNI, VTEP, Mappings, EVPN)
- Routing / BGP (AS, Router Config, Peer Groups, Sessions, AFI)
- VRF (VRF, Route Targets, Assignments)
- MLAG (Domain, Peer Config, Interface)
- Host Connectivity
Menu is now controlled by custom menus/fabric-menu.yml
Infrahub namespaces must match ^[A-Z][a-z0-9]+$
- VRF → Vrf
- MLAG → Mlag
Damien merged commit 7fd83b8c3f into main 2026-02-13 19:36:27 +00:00
Damien deleted branch feature/41-infrahub-schema 2026-02-13 19:36:30 +00:00
Sign in to join this conversation.