## Summary
- Add `local_identifier` attribute + `uniqueness_constraints` + `human_friendly_id` to **InfraVlanVniMapping**, **InfraEVPNInstance**, **InfraMlagInterface**, and **InfraUnderlayLink**, following the same pattern already used for `InfraBGPPeerGroup` and `InfraBGPSession`
- Populate `local_identifier` in all corresponding object YAML files with deterministic composite keys so Infrahub can upsert objects during Repository backend sync instead of creating duplicates
## Schema changes
| Schema file | Model | human_friendly_id |
|---|---|---|
| `infrahub/schemas/vlan_vxlan.yml` | `InfraVlanVniMapping` | `local_identifier__value` |
| `infrahub/schemas/vlan_vxlan.yml` | `InfraEVPNInstance` | `local_identifier__value` |
| `infrahub/schemas/mlag.yml` | `InfraMlagInterface` | `local_identifier__value` |
| `infrahub/schemas/extensions.yml` | `InfraUnderlayLink` | `local_identifier__value` |
## Object file changes
| Object file | Kind | Key format | Example |
|---|---|---|---|
| `infrahub/objects/06-vlans-vxlan.yml` | `InfraVlanVniMapping` | `{device}__vlan{vlan_id}__vni{vni_id}` | `leaf1__vlan40__vni110040` |
| `infrahub/objects/06-vlans-vxlan.yml` | `InfraEVPNInstance` | `{device}__vlan{vlan_id}` | `leaf1__vlan40` |
| `infrahub/objects/12-mlag.yml` | `InfraMlagInterface` | `mlag{id}__{device1}-{device2}` | `mlag1__leaf1-leaf2` |
| `infrahub/objects/14-fabric-links.yml` | `InfraUnderlayLink` | `{local_dev}-{local_intf}__{remote_dev}-{remote_intf}` | `spine1-eth1__leaf1-eth11` |
Note: `InfraMlagInterface` objects (4 entries, one per MLAG pair) and `InfraUnderlayLink` objects (16 entries, all spine↔leaf P2P links) are new additions to their respective files.
## Test plan
- [x] `infrahubctl schema load infrahub/schemas/*.yml` succeeds without errors
- [x] `infrahubctl object load infrahub/objects/06-vlans-vxlan.yml` succeeds
- [x] `infrahubctl object load infrahub/objects/12-mlag.yml` succeeds
- [x] `infrahubctl object load infrahub/objects/14-fabric-links.yml` succeeds
- [x] Re-running the same load is idempotent (no duplicate objects created)
- [x] Gitea Repository backend sync completes without import errors
211 lines
7.3 KiB
YAML
211 lines
7.3 KiB
YAML
# Fabric-to-Device links
|
|
# Depends on: 02-devices, 03-fabric
|
|
---
|
|
apiVersion: infrahub.app/v1
|
|
kind: Object
|
|
spec:
|
|
kind: InfraDevice
|
|
data:
|
|
- name: spine1
|
|
role: spine
|
|
fabric: "evpn-lab"
|
|
- name: spine2
|
|
role: spine
|
|
fabric: "evpn-lab"
|
|
- name: leaf1
|
|
role: leaf
|
|
fabric: "evpn-lab"
|
|
- name: leaf2
|
|
role: leaf
|
|
fabric: "evpn-lab"
|
|
- name: leaf3
|
|
role: leaf
|
|
fabric: "evpn-lab"
|
|
- name: leaf4
|
|
role: leaf
|
|
fabric: "evpn-lab"
|
|
- name: leaf5
|
|
role: leaf
|
|
fabric: "evpn-lab"
|
|
- name: leaf6
|
|
role: leaf
|
|
fabric: "evpn-lab"
|
|
- name: leaf7
|
|
role: leaf
|
|
fabric: "evpn-lab"
|
|
- name: leaf8
|
|
role: leaf
|
|
fabric: "evpn-lab"
|
|
---
|
|
apiVersion: infrahub.app/v1
|
|
kind: Object
|
|
spec:
|
|
kind: InfraUnderlayLink
|
|
data:
|
|
# ============================================================
|
|
# Spine1 P2P underlay links (Ethernet1-8 → leaf1-8:Ethernet11)
|
|
# ============================================================
|
|
- local_identifier: spine1-eth1__leaf1-eth11
|
|
description: "spine1:Ethernet1 <-> leaf1:Ethernet11"
|
|
mtu: 9214
|
|
fabric: ["evpn-lab"]
|
|
local_device: ["spine1"]
|
|
local_interface: ["spine1", "Ethernet1"]
|
|
local_ip_address: ["10.0.1.0/31"]
|
|
remote_device: ["leaf1"]
|
|
remote_interface: ["leaf1", "Ethernet11"]
|
|
remote_ip_address: ["10.0.1.1/31"]
|
|
- local_identifier: spine1-eth2__leaf2-eth11
|
|
description: "spine1:Ethernet2 <-> leaf2:Ethernet11"
|
|
mtu: 9214
|
|
fabric: ["evpn-lab"]
|
|
local_device: ["spine1"]
|
|
local_interface: ["spine1", "Ethernet2"]
|
|
local_ip_address: ["10.0.1.2/31"]
|
|
remote_device: ["leaf2"]
|
|
remote_interface: ["leaf2", "Ethernet11"]
|
|
remote_ip_address: ["10.0.1.3/31"]
|
|
- local_identifier: spine1-eth3__leaf3-eth11
|
|
description: "spine1:Ethernet3 <-> leaf3:Ethernet11"
|
|
mtu: 9214
|
|
fabric: ["evpn-lab"]
|
|
local_device: ["spine1"]
|
|
local_interface: ["spine1", "Ethernet3"]
|
|
local_ip_address: ["10.0.1.4/31"]
|
|
remote_device: ["leaf3"]
|
|
remote_interface: ["leaf3", "Ethernet11"]
|
|
remote_ip_address: ["10.0.1.5/31"]
|
|
- local_identifier: spine1-eth4__leaf4-eth11
|
|
description: "spine1:Ethernet4 <-> leaf4:Ethernet11"
|
|
mtu: 9214
|
|
fabric: ["evpn-lab"]
|
|
local_device: ["spine1"]
|
|
local_interface: ["spine1", "Ethernet4"]
|
|
local_ip_address: ["10.0.1.6/31"]
|
|
remote_device: ["leaf4"]
|
|
remote_interface: ["leaf4", "Ethernet11"]
|
|
remote_ip_address: ["10.0.1.7/31"]
|
|
- local_identifier: spine1-eth5__leaf5-eth11
|
|
description: "spine1:Ethernet5 <-> leaf5:Ethernet11"
|
|
mtu: 9214
|
|
fabric: ["evpn-lab"]
|
|
local_device: ["spine1"]
|
|
local_interface: ["spine1", "Ethernet5"]
|
|
local_ip_address: ["10.0.1.8/31"]
|
|
remote_device: ["leaf5"]
|
|
remote_interface: ["leaf5", "Ethernet11"]
|
|
remote_ip_address: ["10.0.1.9/31"]
|
|
- local_identifier: spine1-eth6__leaf6-eth11
|
|
description: "spine1:Ethernet6 <-> leaf6:Ethernet11"
|
|
mtu: 9214
|
|
fabric: ["evpn-lab"]
|
|
local_device: ["spine1"]
|
|
local_interface: ["spine1", "Ethernet6"]
|
|
local_ip_address: ["10.0.1.10/31"]
|
|
remote_device: ["leaf6"]
|
|
remote_interface: ["leaf6", "Ethernet11"]
|
|
remote_ip_address: ["10.0.1.11/31"]
|
|
- local_identifier: spine1-eth7__leaf7-eth11
|
|
description: "spine1:Ethernet7 <-> leaf7:Ethernet11"
|
|
mtu: 9214
|
|
fabric: ["evpn-lab"]
|
|
local_device: ["spine1"]
|
|
local_interface: ["spine1", "Ethernet7"]
|
|
local_ip_address: ["10.0.1.12/31"]
|
|
remote_device: ["leaf7"]
|
|
remote_interface: ["leaf7", "Ethernet11"]
|
|
remote_ip_address: ["10.0.1.13/31"]
|
|
- local_identifier: spine1-eth8__leaf8-eth11
|
|
description: "spine1:Ethernet8 <-> leaf8:Ethernet11"
|
|
mtu: 9214
|
|
fabric: ["evpn-lab"]
|
|
local_device: ["spine1"]
|
|
local_interface: ["spine1", "Ethernet8"]
|
|
local_ip_address: ["10.0.1.14/31"]
|
|
remote_device: ["leaf8"]
|
|
remote_interface: ["leaf8", "Ethernet11"]
|
|
remote_ip_address: ["10.0.1.15/31"]
|
|
# ============================================================
|
|
# Spine2 P2P underlay links (Ethernet1-8 → leaf1-8:Ethernet12)
|
|
# ============================================================
|
|
- local_identifier: spine2-eth1__leaf1-eth12
|
|
description: "spine2:Ethernet1 <-> leaf1:Ethernet12"
|
|
mtu: 9214
|
|
fabric: ["evpn-lab"]
|
|
local_device: ["spine2"]
|
|
local_interface: ["spine2", "Ethernet1"]
|
|
local_ip_address: ["10.0.2.0/31"]
|
|
remote_device: ["leaf1"]
|
|
remote_interface: ["leaf1", "Ethernet12"]
|
|
remote_ip_address: ["10.0.2.1/31"]
|
|
- local_identifier: spine2-eth2__leaf2-eth12
|
|
description: "spine2:Ethernet2 <-> leaf2:Ethernet12"
|
|
mtu: 9214
|
|
fabric: ["evpn-lab"]
|
|
local_device: ["spine2"]
|
|
local_interface: ["spine2", "Ethernet2"]
|
|
local_ip_address: ["10.0.2.2/31"]
|
|
remote_device: ["leaf2"]
|
|
remote_interface: ["leaf2", "Ethernet12"]
|
|
remote_ip_address: ["10.0.2.3/31"]
|
|
- local_identifier: spine2-eth3__leaf3-eth12
|
|
description: "spine2:Ethernet3 <-> leaf3:Ethernet12"
|
|
mtu: 9214
|
|
fabric: ["evpn-lab"]
|
|
local_device: ["spine2"]
|
|
local_interface: ["spine2", "Ethernet3"]
|
|
local_ip_address: ["10.0.2.4/31"]
|
|
remote_device: ["leaf3"]
|
|
remote_interface: ["leaf3", "Ethernet12"]
|
|
remote_ip_address: ["10.0.2.5/31"]
|
|
- local_identifier: spine2-eth4__leaf4-eth12
|
|
description: "spine2:Ethernet4 <-> leaf4:Ethernet12"
|
|
mtu: 9214
|
|
fabric: ["evpn-lab"]
|
|
local_device: ["spine2"]
|
|
local_interface: ["spine2", "Ethernet4"]
|
|
local_ip_address: ["10.0.2.6/31"]
|
|
remote_device: ["leaf4"]
|
|
remote_interface: ["leaf4", "Ethernet12"]
|
|
remote_ip_address: ["10.0.2.7/31"]
|
|
- local_identifier: spine2-eth5__leaf5-eth12
|
|
description: "spine2:Ethernet5 <-> leaf5:Ethernet12"
|
|
mtu: 9214
|
|
fabric: ["evpn-lab"]
|
|
local_device: ["spine2"]
|
|
local_interface: ["spine2", "Ethernet5"]
|
|
local_ip_address: ["10.0.2.8/31"]
|
|
remote_device: ["leaf5"]
|
|
remote_interface: ["leaf5", "Ethernet12"]
|
|
remote_ip_address: ["10.0.2.9/31"]
|
|
- local_identifier: spine2-eth6__leaf6-eth12
|
|
description: "spine2:Ethernet6 <-> leaf6:Ethernet12"
|
|
mtu: 9214
|
|
fabric: ["evpn-lab"]
|
|
local_device: ["spine2"]
|
|
local_interface: ["spine2", "Ethernet6"]
|
|
local_ip_address: ["10.0.2.10/31"]
|
|
remote_device: ["leaf6"]
|
|
remote_interface: ["leaf6", "Ethernet12"]
|
|
remote_ip_address: ["10.0.2.11/31"]
|
|
- local_identifier: spine2-eth7__leaf7-eth12
|
|
description: "spine2:Ethernet7 <-> leaf7:Ethernet12"
|
|
mtu: 9214
|
|
fabric: ["evpn-lab"]
|
|
local_device: ["spine2"]
|
|
local_interface: ["spine2", "Ethernet7"]
|
|
local_ip_address: ["10.0.2.12/31"]
|
|
remote_device: ["leaf7"]
|
|
remote_interface: ["leaf7", "Ethernet12"]
|
|
remote_ip_address: ["10.0.2.13/31"]
|
|
- local_identifier: spine2-eth8__leaf8-eth12
|
|
description: "spine2:Ethernet8 <-> leaf8:Ethernet12"
|
|
mtu: 9214
|
|
fabric: ["evpn-lab"]
|
|
local_device: ["spine2"]
|
|
local_interface: ["spine2", "Ethernet8"]
|
|
local_ip_address: ["10.0.2.14/31"]
|
|
remote_device: ["leaf8"]
|
|
remote_interface: ["leaf8", "Ethernet12"]
|
|
remote_ip_address: ["10.0.2.15/31"]
|