- Created device schema with attributes for hostname, role, platform, and management IP. - Added interface schema with various types, MTU, speed, and switchport modes. - Introduced VLAN and VRF schemas with relationships to devices and interfaces. - Implemented BGP configuration, peer groups, and neighbors with detailed attributes. - Established MLAG domain and interface schemas for multi-chassis link aggregation. - Developed EVPN and VXLAN schemas for overlay networking. - Created routing policy schemas including route maps and prefix lists. - Added DCI switch and connection schemas for inter-datacenter connectivity.
211 lines
6.0 KiB
YAML
211 lines
6.0 KiB
YAML
# yaml-language-server: $schema=https://schema.infrahub.app/infrahub/schema/latest.json
|
|
---
|
|
version: "1.0"
|
|
|
|
nodes:
|
|
- name: Datacenter
|
|
namespace: Infra
|
|
label: "Datacenter"
|
|
icon: "mdi:server-network"
|
|
include_in_menu: true
|
|
menu_placement: "LocationSite"
|
|
human_friendly_id: ["name__value"]
|
|
display_label: "{{ ' - '.join(filter(None, [record.name__value, record.dc_id__value])) }}"
|
|
order_by:
|
|
- dc_id__value
|
|
generate_template: false
|
|
description: "Datacenter - Generator object that creates fabric topology"
|
|
attributes:
|
|
- name: name
|
|
kind: Text
|
|
unique: true
|
|
optional: false
|
|
description: "Datacenter name (e.g., DC1, DC2)"
|
|
- name: dc_id
|
|
kind: Number
|
|
unique: true
|
|
optional: false
|
|
description: "Numeric datacenter ID for IP addressing (e.g., 1, 2)"
|
|
- name: description
|
|
kind: Text
|
|
optional: true
|
|
description: "Datacenter description"
|
|
|
|
- name: parent_subnet
|
|
kind: IPNetwork
|
|
optional: false
|
|
description: "Address space allocation"
|
|
|
|
# Topology Configuration
|
|
- name: number_of_bays
|
|
kind: Number
|
|
optional: false
|
|
default_value: 2
|
|
description: "Number of bays/racks (determines leaf count)"
|
|
- name: spine_count
|
|
kind: Number
|
|
optional: false
|
|
default_value: 3
|
|
description: "Number of spine switches"
|
|
- name: border_leaf_count
|
|
kind: Number
|
|
optional: false
|
|
default_value: 2
|
|
description: "Number of border leaf switches for DCI (0 if has_border_leafs=false)"
|
|
|
|
# BGP Configuration
|
|
- name: bgp_base_asn
|
|
kind: Number
|
|
optional: false
|
|
default_value: 65000
|
|
description: "Base ASN for BGP (e.g., 65000)"
|
|
- name: spine_asn
|
|
kind: Number
|
|
optional: true
|
|
description: "Spine ASN (auto-calculated: base + dc_id * 100)"
|
|
|
|
# MLAG Configuration
|
|
- name: mlag_domain_id
|
|
kind: Text
|
|
optional: false
|
|
default_value: "MLAG"
|
|
description: "MLAG domain identifier"
|
|
|
|
# Interface Configuration
|
|
- name: mtu
|
|
kind: Number
|
|
optional: false
|
|
default_value: 9214
|
|
description: "Default MTU for fabric interfaces"
|
|
|
|
# DCI Configuration (Optional)
|
|
- name: dci_enabled
|
|
kind: Boolean
|
|
optional: false
|
|
default_value: false
|
|
description: "Enable DCI connectivity (activates border leaf eth12). Default: false (eth12 shutdown)"
|
|
- name: dci_remote_dc_id
|
|
kind: Number
|
|
optional: true
|
|
description: "Remote datacenter ID for DCI peering (required when dci_enabled=true)"
|
|
- name: has_border_leafs
|
|
kind: Boolean
|
|
optional: false
|
|
default_value: true
|
|
description: "Include border leaf switches (set false if no DCI capability needed)"
|
|
|
|
# Computed/Derived Attributes (read-only, set by generator)
|
|
- name: leaf_pair_count
|
|
kind: Number
|
|
optional: true
|
|
read_only: true
|
|
description: "Computed: ceil(number_of_bays / 2)"
|
|
- name: total_leaf_count
|
|
kind: Number
|
|
optional: true
|
|
read_only: true
|
|
description: "Computed: leaf_pair_count * 2"
|
|
- name: total_access_count
|
|
kind: Number
|
|
optional: true
|
|
read_only: true
|
|
description: "Computed: number_of_bays"
|
|
|
|
# Status
|
|
- name: status
|
|
kind: Dropdown
|
|
optional: false
|
|
default_value: "planned"
|
|
choices:
|
|
- name: planned
|
|
label: Planned
|
|
color: "#ffd966"
|
|
- name: active
|
|
label: Active
|
|
color: "#7fbf7f"
|
|
- name: maintenance
|
|
label: Maintenance
|
|
color: "#ff9999"
|
|
|
|
relationships:
|
|
- name: site
|
|
peer: LocationSite
|
|
optional: false
|
|
cardinality: one
|
|
kind: Attribute
|
|
description: "Parent site"
|
|
|
|
- name: devices
|
|
peer: NetworkDevice
|
|
optional: true
|
|
cardinality: many
|
|
kind: Component
|
|
description: "All devices in this datacenter (generated)"
|
|
|
|
- name: ip_prefixes
|
|
peer: IpamIPPrefix
|
|
optional: true
|
|
cardinality: many
|
|
kind: Generic
|
|
description: "IP prefixes for this datacenter (generated)"
|
|
|
|
- name: mlag_pairs
|
|
peer: NetworkMLAGDomain
|
|
optional: true
|
|
cardinality: many
|
|
kind: Generic
|
|
description: "MLAG pairs in this datacenter (generated)"
|
|
|
|
- name: Bay
|
|
namespace: Infra
|
|
label: "Bay/Rack"
|
|
icon: "mdi:server-outline"
|
|
include_in_menu: true
|
|
menu_placement: "InfraDatacenter"
|
|
human_friendly_id: ["name__value"]
|
|
display_label: "{{ record.name__value }}"
|
|
order_by:
|
|
- bay_id__value
|
|
attributes:
|
|
- name: name
|
|
kind: Text
|
|
unique: true
|
|
optional: false
|
|
description: "Bay name (e.g., Bay-1-DC1)"
|
|
- name: bay_id
|
|
kind: Number
|
|
optional: false
|
|
description: "Bay numeric ID"
|
|
- name: location
|
|
kind: Text
|
|
optional: true
|
|
description: "Physical location in datacenter"
|
|
- name: rack_units
|
|
kind: Number
|
|
optional: false
|
|
default_value: 42
|
|
description: "Available rack units (U)"
|
|
relationships:
|
|
- name: datacenter
|
|
peer: InfraDatacenter
|
|
optional: false
|
|
cardinality: one
|
|
kind: Parent
|
|
- name: access_switch
|
|
peer: NetworkDevice
|
|
optional: true
|
|
cardinality: one
|
|
kind: Attribute
|
|
description: "Access switch for this bay"
|
|
- name: leaf_pair
|
|
peer: NetworkMLAGDomain
|
|
optional: true
|
|
cardinality: one
|
|
kind: Attribute
|
|
description: "Leaf pair serving this bay"
|
|
- name: hosts
|
|
peer: NetworkDevice
|
|
optional: true
|
|
cardinality: many
|
|
kind: Generic
|
|
description: "Host devices in this bay" |