Page MenuHomePhabricator

Include vlans with defined IRB int in device vlans even if no port present
Open, LowPublic

Description

It's been a bit of a pain when rolling out new racks in the routed / evpn switch setup as currently Homer only configured vlans on a switch if there are ports (access or trunk) configured as members of those vlans at layer-2.

The issue this causes is that prior to the first host being added to a given vlan the config for that vlan is missing on the switch, and the sre.network.configure-switch-interfaces cookbook does not add them. Instead, when it tries to configure the given vlan on the port connecting the new host we hit an error, and Homer needs to be used instead to add all the required config.

It was previously suggested to configure vlans based on location in advance, but this is somewhat tricky (relying on naming conventions), so I think a simpler way is just to also parse any interfaces starting with "irb." defined in Netbox. In the new design we always have a local IRB int acting as gateway for the per-rack vlans, so this should work good. It should be doable with a small patch to Homer if people are agreed.

Event Timeline

cmooney created this task.

Change #1037773 had a related patch set uploaded (by Cathal Mooney; author: Cathal Mooney):

[operations/software/homer@master] Include vlans with an IRB int in device vlans even if not on L2 port

https://gerrit.wikimedia.org/r/1037773

Diff with this patch applied on one of the new codfw switches:

cmooney@wikilap:~$ homer lsw1-d2-codfw* diff
INFO:homer.devices:Initialized 99 devices
INFO:homer:Generating diff for query lsw1-d2-codfw*
INFO:homer:Gathering global Netbox data
INFO:homer.devices:Matched 1 device(s) for query 'lsw1-d2-codfw*'
INFO:homer:Generating configuration for lsw1-d2-codfw.mgmt.codfw.wmnet
INFO:homer.transports.junos:Running commit check on lsw1-d2-codfw.mgmt.codfw.wmnet
Changes for 1 devices: ['lsw1-d2-codfw.mgmt.codfw.wmnet']

[edit policy-options policy-statement Evpn_rt_import]
     term static_type1_rt { ... }
+    term l2vni {
+        from community VNI2002044;
+        then accept;
+    }
     term l3vni { ... }
[edit policy-options]
+   community VNI2002044 members target:64811:2044;
[edit protocols evpn]
+    vni-options {
+        vni 2002044 {
+            vrf-target target:64811:2044;
+        }
+    }
[edit]
+  vlans {
+      private1-d2-codfw {
+          vlan-id 2044;
+          l3-interface irb.2044;
+          vxlan {
+              vni 2002044;
+          }
+      }
+  }

---------------
INFO:homer:Homer run completed successfully on 1 devices: ['lsw1-d2-codfw.mgmt.codfw.wmnet']

Change #1040154 had a related patch set uploaded (by Cathal Mooney; author: Cathal Mooney):

[operations/software/netbox-extras@master] Validate IRB interface names correspond to vlan and refactor

https://gerrit.wikimedia.org/r/1040154

Change #1037773 merged by jenkins-bot:

[operations/software/homer@master] Include vlans with an IRB int in device vlans even if not on L2 port

https://gerrit.wikimedia.org/r/1037773