From 1349f56ea3a34bcf286d093403673cdeecc22266 Mon Sep 17 00:00:00 2001 From: Pete Crocker Date: Sat, 16 Nov 2024 19:36:21 +0000 Subject: [PATCH 1/3] add azure and infiniband --- experimental/azure/README.md | 16 + experimental/azure/azure.yml | 129 ++++++ experimental/infiniband/README.md | 20 + experimental/infiniband/infiniband.yml | 564 +++++++++++++++++++++++++ extensions/compute/compute.yml | 2 +- 5 files changed, 730 insertions(+), 1 deletion(-) create mode 100644 experimental/azure/README.md create mode 100644 experimental/azure/azure.yml create mode 100644 experimental/infiniband/README.md create mode 100644 experimental/infiniband/infiniband.yml diff --git a/experimental/azure/README.md b/experimental/azure/README.md new file mode 100644 index 0000000..4b4684c --- /dev/null +++ b/experimental/azure/README.md @@ -0,0 +1,16 @@ +# 🧩 Tenancy + +This schema extension introduces cloud support for Microsoft Azure. + +## Nodes + +- Azure Location +- Azure Tenant +- Azure Subscription +- Azure Resource Group +- Azure Virtual Network +- Azure Virtual Network Subnet + +## Dependencies + +- Base diff --git a/experimental/azure/azure.yml b/experimental/azure/azure.yml new file mode 100644 index 0000000..29c7161 --- /dev/null +++ b/experimental/azure/azure.yml @@ -0,0 +1,129 @@ +# yaml-language-server: $schema=https://schema.infrahub.app/infrahub/schema/latest.json +--- +version: "1.0" + +generics: + - name: Resource + namespace: Azure + label: Azure + include_in_menu: true + attributes: + - name: name + kind: Text + relationships: + - name: location + cardinality: one + kind: Attribute + peer: AzureLocation + - name: resourcegroup + cardinality: one + peer: AzureResourceGroup + kind: Parent + optional: false + +nodes: + - name: Location + namespace: Azure + menu_placement: AzureResource + display_labels: + - name__value + attributes: + - name: name + kind: Text + + - name: Tenant + namespace: Azure + menu_placement: AzureResource + display_labels: + - name__value + - tenant_id__value + attributes: + - name: name + kind: Text + - name: tenant_id + kind: Text + relationships: + - name: subscriptions + cardinality: many + peer: AzureSubscription + kind: Component + + - name: Subscription + namespace: Azure + menu_placement: AzureResource + display_labels: + - name__value + - subscription_id__value + attributes: + - name: name + kind: Text + - name: subscription_id + kind: Text + relationships: + - name: tenant + cardinality: one + peer: AzureTenant + kind: Parent + optional: false + - name: resourcegroups + cardinality: many + peer: AzureResourceGroup + kind: Component + + - name: ResourceGroup + namespace: Azure + menu_placement: AzureResource + display_labels: + - name__value + attributes: + - name: name + kind: Text + relationships: + - name: location + cardinality: one + kind: Attribute + peer: AzureLocation + - name: subscription + cardinality: one + peer: AzureSubscription + kind: Parent + optional: false + + - name: VirtualNetwork + label: "Virtual Networks" + namespace: Azure + menu_placement: AzureResource + display_labels: + - name__value + inherit_from: + - AzureResource + relationships: + - name: address_space + cardinality: many + kind: Attribute + peer: BuiltinIPPrefix + - name: subnets + cardinality: many + kind: Component + peer: AzureVirtualNetworkSubnet + + - name: VirtualNetworkSubnet + label: "Subnets" + namespace: Azure + menu_placement: AzureResource + include_in_menu: true + display_labels: + - name__value + attributes: + - name: name + kind: Text + relationships: + - name: virtualnetwork + cardinality: one + peer: AzureVirtualNetwork + kind: Parent + optional: false + - name: address_prefixes + cardinality: many + kind: Attribute + peer: BuiltinIPPrefix \ No newline at end of file diff --git a/experimental/infiniband/README.md b/experimental/infiniband/README.md new file mode 100644 index 0000000..c83c43b --- /dev/null +++ b/experimental/infiniband/README.md @@ -0,0 +1,20 @@ +# 🧩 Tenancy + +This schema extension adds support for InfiniBand switches. + +## Nodes + +- InfiniBand Switch +- InfiniBand Switch Interface +- InfiniBandSwitchMgmtInterface +- InfiniBandSwitchIntfSpeedOptions +- RSU +- Fabric +- Hall +- Pod +- Cabinet + +## Dependencies + +- Base +- Compute diff --git a/experimental/infiniband/infiniband.yml b/experimental/infiniband/infiniband.yml new file mode 100644 index 0000000..0bf82fc --- /dev/null +++ b/experimental/infiniband/infiniband.yml @@ -0,0 +1,564 @@ +# yaml-language-server: $schema=https://schema.infrahub.app/infrahub/schema/latest.json +--- +version: "1.0" +nodes: + # ------------ Switch ------------ + - name: Switch + namespace: Infiniband + description: "InfiniBand Switch" + label: "InfiniBand Switch" + icon: "mdi:server" + inherit_from: + - "CoreArtifactTarget" + order_by: + - name__value + display_labels: + - name__value + attributes: + - name: name + kind: Text + unique: true + order_weight: 1000 + - name: description + kind: Text + optional: true + order_weight: 2000 + - name: os_version + kind: Text + optional: true + order_weight: 2200 + - name: rsu_rail_id + kind: Number + label: "RSU Rail ID" + description: "InfiniBand RSU Rail ID (numeric) assigned to the switch" + optional: true + - name: aaa_authentication_model + kind: Dropdown + label: "AAA Authentication Model" + description: "AAA authentication model to be used by the switch" + optional: false + default_value: "local" + choices: + - name: tacacs + label: TACACS+ + description: "Default AAA authentication will use TACACS+ server" + color: "#7fbf71" + - name: local + label: local + description: "Default AAA authentication will use local AAA configuration" + color: "#7fbf72" + - name: aaa_accounting_model + kind: Dropdown + label: "AAA Accounting Model" + description: "AAA accounting model to be used by the switch" + default_value: "local" + optional: false + choices: + - name: tacacs + label: TACACS+ + description: "Default AAA accounting will use TACACS+ server" + color: "#7fbf71" + - name: local + label: local + description: "Default AAA accounting will use local AAA configuration" + color: "#ffff7f" + - name: role + kind: Dropdown + label: "Switch Role" + description: "Role of the switch in the InfiniBand network" + choices: + - name: spine + label: Spine + description: "Spine Switch" + color: "#7fbf7f" + - name: leaf + label: Leaf + description: "Leaf Switch" + color: "#ffff7f" + - name: split_ready + kind: Boolean + label: "Split Ready" + description: "Enable Split-Ready profile for switch" + default_value: false + - name: ipv6_enable + kind: Boolean + label: "IPv6 Enable" + description: "Enable IPv6 on the switch" + default_value: false + - name: cli_prefix_modes + kind: Boolean + label: "CLI Prefix Modes" + description: "Enable CLI prefix modes" + default_value: true + - name: xml_gateway + kind: Boolean + label: "XML Gateway" + description: "Enable XML Gateway" + default_value: false + - name: ssh_server_security_strict + kind: Boolean + label: "SSH Server Security Strict" + description: "Enable SSH Server Security Strict" + default_value: false + - name: banner + kind: Text + label: "Banner" + description: "Banner to be displayed on login" + default_value: "NVIDIA MLNX-OS Switch Management" + - name: password_hardening + kind: Boolean + label: "Password Hardening" + description: "Enable Password Hardening" + default_value: false + relationships: + - name: interfaces + kind: Component + cardinality: many + peer: InfinibandSwitchInterface + optional: true + - name: mgmt_interface + kind: Component + cardinality: one + peer: InfinibandSwitchMgmtInterface + optional: true + - name: rsu + peer: InfinibandRSU + optional: true + cardinality: one + kind: Attribute + + # ------------ SwitchInterface ------------ + - name: SwitchInterface + namespace: Infiniband + description: "InfiniBand Switch Interface" + label: "InfiniBand Switch Interface" + icon: "mdi:ethernet" + human_friendly_id: ["switch__name__value", "name__value"] + order_by: + - name__value + display_labels: + - name__value + uniqueness_constraints: + - ["switch", "name__value"] + attributes: + - name: name + kind: Text + order_weight: 1000 + - name: description + kind: Text + optional: true + order_weight: 1100 + - name: speed + kind: Number + order_weight: 1400 + - name: enabled + kind: Boolean + default_value: true + order_weight: 1200 + - name: width + kind: Number + label: "Width" + description: "Width value sets supported lane options for the interface" + optional: true + default_value: 7 + enum: + - 1 + - 3 + - 5 + - 7 + - name: port_type + kind: Number + label: "Port Type: Split" + description: "Enable interface to be split X times (requires Split-Ready profile to be enabled on the switch)" + optional: true + enum: + - 2 + - name: port_type_force + kind: Boolean + label: "Port Type Force" + description: "Force the configured port type setting; use in conjunction with Port Type" + default_value: false + - name: operational_virtual_lanes + kind: Number + label: "Operational Virtual Lanes" + description: "Number of operational virtual lanes for an interface" + default_value: 8 + enum: + - 1 + - 2 + - 4 + - 8 + - name: mtu + kind: Number + label: "MTU (bytes)" + description: "Maximum Transmission Unit (bytes)" + enum: + - 256 + - 512 + - 1024 + - 2048 + - 4096 + - name: speed_forced + kind: Boolean + label: "Speed Forced" + description: "Force the configured speed setting(s); use in conjunction with Speed options" + default_value: false + - name: sfp_type + kind: Text + label: "SFP Type" + description: "Type of SFP module used in the interface" + optional: true + - name: role + kind: Dropdown + label: "Interface Role" + description: "Role of the interface in the InfiniBand network" + optional: true + choices: + - name: endhost + label: "Network Device Endhost Port" + description: "InfiniBand Switch Interface <> Server HCA" + color: "#98b2d1" + - name: uplink + label: Uplink + description: "InfiniBand Switch Interface <> InfiniBand Switch Interface" + color: "#93e9be" + - name: reserved + label: Reserved + description: "Reserved for future use" + color: "#d3d3d3" + relationships: + - name: speed_option + peer: InfinibandSwitchIntfSpeedOptions + optional: true + cardinality: many + kind: Attribute + max_count: 6 + - name: switch + peer: InfinibandSwitch + optional: false + cardinality: one + kind: Parent + + # ------------ SwitchMgmtInterface ------------ + - name: SwitchMgmtInterface + namespace: Infiniband + description: "InfiniBand Switch Management Interface" + label: "InfiniBand Mgmt Interface" + icon: "mdi:ethernet" + human_friendly_id: ["switch__name__value", "name__value"] + order_by: + - name__value + display_labels: + - name__value + uniqueness_constraints: + - ["switch", "name__value"] + attributes: + - name: name + kind: Text + order_weight: 1000 + - name: description + kind: Text + optional: true + order_weight: 1100 + - name: speed + kind: Number + order_weight: 1400 + - name: mtu + label: MTU + default_value: 1500 + kind: Number + order_weight: 1500 + - name: enabled + kind: Boolean + default_value: true + order_weight: 1200 + - name: dhcp + kind: Boolean + label: "DHCP" + description: "Enable DHCP for the management interface" + default_value: true + relationships: + - name: switch + peer: InfinibandSwitch + optional: false + cardinality: one + kind: Parent + - name: ipv4_address + peer: IpamIPAddress # Adjusted to match existing schema + optional: true + cardinality: one + + # ------------ SwitchIntfSpeedOptions ------------ + - name: SwitchIntfSpeedOptions + namespace: Infiniband + description: "InfiniBand Interface Speed Options" + label: "InfiniBand Interface Speed Options" + icon: "mdi:ethernet" + human_friendly_id: ["description__value"] + order_by: + - speed__value + display_labels: + - speed__value + attributes: + - name: speed + kind: Dropdown + label: "Speed" + description: "Speed of the interface" + choices: + - name: SDR + label: SDR + - name: NDR + label: NDR + - name: QDR + label: QDR + - name: FDR + label: FDR + - name: EDR + label: EDR + - name: HDR + label: HDR + - name: description + kind: Text + label: Description + description: "Description of the speed option (must be unique)" + unique: true + relationships: + - name: switch + peer: InfinibandSwitchInterface + optional: false + cardinality: one + kind: Parent + + # ------------ RSU ------------ + - name: RSU + namespace: Infiniband + description: "InfiniBand Rail-Optimised Scalable Unit" + label: "InfiniBand RSU" + icon: "mdi:network" + order_by: + - identifier__value + display_labels: + - identifier__value + uniqueness_constraints: + - ["hall", "identifier__value"] + - ['identifier__value'] + attributes: + - name: identifier + kind: Text + label: "Identifier" + description: "InfiniBand RSU Identifier (A-Z: a character string unique to a data hall)" + regex: "[A-Z]" + - name: size + kind: Number + label: "Size" + description: "Number of InfiniBand Leaf Switches (Rails) in the RSU" + optional: true + relationships: + - name: switches + peer: InfinibandSwitch + optional: true + cardinality: many + kind: Attribute + - name: interfaces + peer: InfinibandSwitchInterface + optional: true + cardinality: many + kind: Attribute + - name: hall + peer: InfraHall + optional: false + cardinality: one + kind: Attribute + + # ------------ Fabric ------------ + - name: Fabric + namespace: Infiniband + description: "InfiniBand Network Fabric" + label: "InfiniBand Network Fabric" + human_friendly_id: ["name__value"] + icon: "mdi:network" + inherit_from: + - "CoreArtifactTarget" + order_by: + - name__value + display_labels: + - name__value + attributes: + - name: name + kind: Text + label: "Name" + description: "InfiniBand Network Fabric Name" + unique: true + relationships: + - name: pod + peer: InfraPod + optional: false + cardinality: many + kind: Attribute + # ------------ Hall ------------ + - name: Hall + namespace: Infra + description: "Data Hall" + label: "Data Hall" + human_friendly_id: ["identifier__value"] + order_by: + - name__value + display_labels: + - name__value + uniqueness_constraints: + - ["name__value"] + - ["identifier__value"] + include_in_menu: true + attributes: + - name: name + kind: Text + label: "Hall Name" + description: "Name of the data hall" + unique: false + optional: false + - name: identifier + kind: Text + label: "Hall Identifier" + description: "Identifier for the data hall" + unique: true + optional: false + - name: description + kind: Text + label: "Description" + description: "Description of the data hall" + unique: false + optional: true + relationships: + - name: pods + peer: InfraPod + cardinality: many + kind: Attribute + optional: true + - name: rsu + peer: InfinibandRSU + cardinality: many + kind: Attribute + optional: true + + # ------------ Pod ------------ + - name: Pod + namespace: Infra + description: "Data Hall Pod" + label: "Pod" + order_by: + - name__value + display_labels: + - name__value + human_friendly_id: + - "identifier__value" + uniqueness_constraints: + - ["hall", "name__value"] + - ['identifier__value'] + include_in_menu: true + attributes: + - name: identifier + kind: Text + label: "Pod Identifier" + description: "Identifier for the pod" + unique: true + optional: false + - name: name + kind: Text + label: "Pod Name" + description: "Name of the pod" + unique: false + optional: false + - name: pod_number + kind: Number + label: "Pod Number" + description: "Number of the pod" + unique: false + optional: false + - name: description + kind: Text + label: "Description" + description: "Description of the pod" + unique: false + optional: true + relationships: + - name: hall + peer: InfraHall + cardinality: one + kind: Parent + optional: false + - name: cabinets + peer: InfraCabinet + cardinality: many + kind: Attribute + optional: true + - name: ip_prefix + peer: BuiltinIPPrefix # Adjusted to match existing schema + optional: true + cardinality: one + - name: infiniband_fabrics + peer: InfinibandFabric + optional: true + cardinality: one + kind: Attribute + + # ------------ Cabinet ------------ + - name: Cabinet + namespace: Infra + description: "Cabinet" + label: "Cabinet" + order_by: + - name__value + display_labels: + - name__value + human_friendly_id: + - "identifier__value" + uniqueness_constraints: + - ["pod", "name__value"] + - ["identifier__value"] + include_in_menu: true + attributes: + - name: identifier + kind: Text + label: "Cabinet Identifier" + description: "Identifier for the cabinet" + unique: true + optional: false + - name: name + kind: Text + label: "Cabinet Name" + description: "Name of the cabinet" + unique: false + optional: false + - name: description + kind: Text + label: "Description" + description: "Description of the cabinet" + unique: false + optional: false + - name: type + kind: Dropdown + label: "Cabinet Type" + description: "Type of cabinet" + unique: false + optional: true + choices: + - name: "Network Cabinet" + label: "Network Cabinet" + - name: "Infiniband GPU Cabinet" + label: "Infiniband GPU Cabinet" + relationships: + - name: pod + peer: InfraPod + cardinality: one + kind: Parent + optional: false + - name: devices + peer: DcimGenericDevice # Adjusted to match existing schema + cardinality: many + kind: Component + optional: true + - name: servers + peer: ComputePhysicalServer + cardinality: many + kind: Component + optional: true diff --git a/extensions/compute/compute.yml b/extensions/compute/compute.yml index 0231e2e..25fa8ce 100644 --- a/extensions/compute/compute.yml +++ b/extensions/compute/compute.yml @@ -10,7 +10,7 @@ generics: - name: HostVirtualMachine namespace: Virtualization - description: A generic unut that can host VM + description: A generic unit that can host VM include_in_menu: false relationships: - name: virtual_machines From 940c9e98927dcc6a1c3cd59ea1fb395bfed5ae30 Mon Sep 17 00:00:00 2001 From: Pete Crocker Date: Sat, 16 Nov 2024 21:26:22 +0000 Subject: [PATCH 2/3] linting --- experimental/azure/azure.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/experimental/azure/azure.yml b/experimental/azure/azure.yml index 29c7161..1f7660d 100644 --- a/experimental/azure/azure.yml +++ b/experimental/azure/azure.yml @@ -126,4 +126,4 @@ nodes: - name: address_prefixes cardinality: many kind: Attribute - peer: BuiltinIPPrefix \ No newline at end of file + peer: BuiltinIPPrefix From f38090cd21caa4f7ec61d29fb607ee89397d1035 Mon Sep 17 00:00:00 2001 From: Pete Crocker Date: Mon, 18 Nov 2024 04:57:38 -0700 Subject: [PATCH 3/3] Cleanup --- experimental/azure/README.md | 2 +- experimental/infiniband/README.md | 2 +- experimental/infiniband/infiniband.yml | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/experimental/azure/README.md b/experimental/azure/README.md index 4b4684c..255a3e7 100644 --- a/experimental/azure/README.md +++ b/experimental/azure/README.md @@ -1,4 +1,4 @@ -# 🧩 Tenancy +# 🧩 Azure This schema extension introduces cloud support for Microsoft Azure. diff --git a/experimental/infiniband/README.md b/experimental/infiniband/README.md index c83c43b..24ac40a 100644 --- a/experimental/infiniband/README.md +++ b/experimental/infiniband/README.md @@ -1,4 +1,4 @@ -# 🧩 Tenancy +# 🧩 Infiniband This schema extension adds support for InfiniBand switches. diff --git a/experimental/infiniband/infiniband.yml b/experimental/infiniband/infiniband.yml index 0bf82fc..73bc8fd 100644 --- a/experimental/infiniband/infiniband.yml +++ b/experimental/infiniband/infiniband.yml @@ -284,7 +284,7 @@ nodes: cardinality: one kind: Parent - name: ipv4_address - peer: IpamIPAddress # Adjusted to match existing schema + peer: IpamIPAddress optional: true cardinality: one @@ -332,7 +332,7 @@ nodes: # ------------ RSU ------------ - name: RSU namespace: Infiniband - description: "InfiniBand Rail-Optimised Scalable Unit" + description: "InfiniBand Rail-Optimized Scalable Unit" label: "InfiniBand RSU" icon: "mdi:network" order_by: @@ -492,7 +492,7 @@ nodes: kind: Attribute optional: true - name: ip_prefix - peer: BuiltinIPPrefix # Adjusted to match existing schema + peer: BuiltinIPPrefix optional: true cardinality: one - name: infiniband_fabrics @@ -553,7 +553,7 @@ nodes: kind: Parent optional: false - name: devices - peer: DcimGenericDevice # Adjusted to match existing schema + peer: DcimGenericDevice cardinality: many kind: Component optional: true