fix: add human_friendly_id to 4 schemas for idempotent Repository sync

Add local_identifier attribute (kind: Text) + uniqueness_constraints +
human_friendly_id to InfraVlanVniMapping, InfraEVPNInstance,
InfraMlagInterface and InfraUnderlayLink so Infrahub can perform
upserts during Repository backend sync instead of duplicating objects
on every import.

Schema changes (following the InfraBGPPeerGroup/BGPSession pattern):
- infrahub/schemas/vlan_vxlan.yml: VlanVniMapping + EVPNInstance
- infrahub/schemas/mlag.yml: MlagInterface
- infrahub/schemas/extensions.yml: UnderlayLink

Object file updates:
- 06-vlans-vxlan.yml: local_identifier added to all VlanVniMapping and
  EVPNInstance entries (format: leaf1__vlan40__vni110040 / leaf1__vlan40)
- 12-mlag.yml: InfraMlagInterface section added for all 4 MLAG pairs
  (format: mlag1__leaf1-leaf2)
- 14-fabric-links.yml: InfraUnderlayLink section added for all 16
  spine↔leaf P2P links (format: spine1-eth1__leaf1-eth11)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Damien
2026-03-03 17:19:30 +01:00
parent 370782da62
commit 37b3261416
6 changed files with 262 additions and 8 deletions

View File

@@ -132,3 +132,49 @@ spec:
heartbeat_peer_ip: "172.16.0.31"
local_interface: ["leaf8", "Vlan4090"]
peer_link: ["leaf8", "Port-Channel999"]
---
apiVersion: infrahub.app/v1
kind: Object
spec:
kind: InfraMlagInterface
data:
# MLAG interface 1 on leaf1/leaf2 pair (Port-Channel1 → host1)
- local_identifier: mlag1__leaf1-leaf2
mlag_id: 1
description: "MLAG interface 1 for leaf1/leaf2 pair (host1)"
lacp_fallback_timeout: 5
lacp_fallback_individual: true
mlag_domain: ["leafs-1-2"]
lag_interfaces:
- ["leaf1", "Port-Channel1"]
- ["leaf2", "Port-Channel1"]
# MLAG interface 1 on leaf3/leaf4 pair (Port-Channel1 → host2)
- local_identifier: mlag1__leaf3-leaf4
mlag_id: 1
description: "MLAG interface 1 for leaf3/leaf4 pair (host2)"
lacp_fallback_timeout: 5
lacp_fallback_individual: true
mlag_domain: ["leafs-3-4"]
lag_interfaces:
- ["leaf3", "Port-Channel1"]
- ["leaf4", "Port-Channel1"]
# MLAG interface 1 on leaf5/leaf6 pair (Port-Channel1 → host3)
- local_identifier: mlag1__leaf5-leaf6
mlag_id: 1
description: "MLAG interface 1 for leaf5/leaf6 pair (host3)"
lacp_fallback_timeout: 5
lacp_fallback_individual: true
mlag_domain: ["leafs-5-6"]
lag_interfaces:
- ["leaf5", "Port-Channel1"]
- ["leaf6", "Port-Channel1"]
# MLAG interface 1 on leaf7/leaf8 pair (Port-Channel1 → host4)
- local_identifier: mlag1__leaf7-leaf8
mlag_id: 1
description: "MLAG interface 1 for leaf7/leaf8 pair (host4)"
lacp_fallback_timeout: 5
lacp_fallback_individual: true
mlag_domain: ["leafs-7-8"]
lag_interfaces:
- ["leaf7", "Port-Channel1"]
- ["leaf8", "Port-Channel1"]