Create Infrahub Transforms for VRF configuration including L3VNI mapping for symmetric IRB in EVPN-VXLAN.
Context
VRFs provide Layer 3 multi-tenancy in the fabric. Each VRF is associated with an L3VNI for inter-VXLAN routing (Type-5 routes). Infrahub schema will store VRF intent with relationships to VNIs and interfaces.
Tasks
Define Infrahub schema for VRF objects (or leverage schema-library)
{% for vrf in data.InfraVRF.edges %}
{% set v = vrf.node %}
{
"path": "/network-instances/network-instance[name={{ v.name.value }}]",
"value": {
"config": {
"name": "{{ v.name.value }}",
"type": "L3VRF",
"enabled": true
}
}
}{% if not loop.last %},{% endif %}
{% endfor %}
Jinja2 Transform (vrf_vxlan_yang.j2)
{% for vrf in data.InfraVRF.edges %}
{% set v = vrf.node %}
{% if v.l3vni %}
{
"path": "/interfaces/interface[name=Vxlan1]/arista-exp-eos-vxlan:arista-vxlan/config/vrf-to-vni-v2/vrf-to-vni[vrf={{ v.name.value }}]",
"value": {
"vrf": "{{ v.name.value }}",
"vni": {{ v.l3vni.value }}
}
}{% if not loop.last %},{% endif %}
{% endif %}
{% endfor %}
.infrahub.yml Addition
jinja2_transforms:- name:vrf_instance_yang_transformdescription:"Generate YANG payload for VRF instances"query:vrf_instance_intenttemplate_path:transforms/vrf_instance_yang.j2- name:vrf_vxlan_yang_transformdescription:"Generate YANG payload for VRF-to-VNI mapping"query:vrf_instance_intenttemplate_path:transforms/vrf_vxlan_yang.j2- name:vrf_bgp_yang_transformdescription:"Generate YANG payload for BGP VRF config"query:vrf_bgp_intenttemplate_path:transforms/vrf_bgp_yang.j2queries:- name:vrf_instance_intentfile_path:queries/vrf_instance_intent.gql- name:vrf_interfaces_intentfile_path:queries/vrf_interfaces_intent.gql- name:vrf_bgp_intentfile_path:queries/vrf_bgp_intent.gql
Branch feat/infrahub-transforms-vrf-l3vni created from main for this issue.
Note: This branch should be rebased on feat/infrahub-transforms-vlan-interfaces-vxlan (issue #20) once that PR is merged, as it depends on the transforms infrastructure created there.
Branch `feat/infrahub-transforms-vrf-l3vni` created from `main` for this issue.
Note: This branch should be rebased on `feat/infrahub-transforms-vlan-interfaces-vxlan` (issue #20) once that PR is merged, as it depends on the transforms infrastructure created there.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Description
Create Infrahub Transforms for VRF configuration including L3VNI mapping for symmetric IRB in EVPN-VXLAN.
Context
VRFs provide Layer 3 multi-tenancy in the fabric. Each VRF is associated with an L3VNI for inter-VXLAN routing (Type-5 routes). Infrahub schema will store VRF intent with relationships to VNIs and interfaces.
Tasks
vrf_instance_intent.gql- VRF config with L3VNIvrf_interfaces_intent.gql- SVIs in VRFvrf_bgp_intent.gql- BGP VRF address-familyvrf_instance_yang.j2- VRF creationvrf_vxlan_yang.j2- VRF-to-VNI mappingvrf_bgp_yang.j2- BGP VRF config with RTsVRF Configuration Scope
Infrahub Schema (proposed)
Example Implementation
GraphQL Query (
vrf_instance_intent.gql)Jinja2 Transform (
vrf_instance_yang.j2)Jinja2 Transform (
vrf_vxlan_yang.j2).infrahub.ymlAdditionOutput Files
Acceptance Criteria
Migration Notes (from NetBox)
InfraVRFschema with relationshipsl3vnicustom fieldl3vniattributeVrfMapperclassvrf_*_yang_transformRelated
Branch
feat/infrahub-transforms-vrf-l3vnicreated frommainfor this issue.Note: This branch should be rebased on
feat/infrahub-transforms-vlan-interfaces-vxlan(issue #20) once that PR is merged, as it depends on the transforms infrastructure created there.