This task started life in reference only to cloud hosts, but we have additional server configurations which require similar manual work currently, so I've widened the scope to include those. The cloud use-case is most pressing, so will be addressed first.
Issue
Currently we have a variety of hosts which require manual changes in Netbox after the provision script has been run the create the Netbox link to top-of-rack switch. Typically these involve additional vlans being trunked on the switch side, and in some cases additional IP allocations and links being created.
Plan
This task will track progress to updating the provision script to allow for these type of hosts to be selected by DC-Ops at provision stage. The script should then ensure that switch ports are configured as type "trunk" from day one, and the required vlans are configured. Additionally the script should make any additional IP allocations, and create any secondary host-side interfaces as needed. This helps the effort to T347411: Drive host network config from Netbox, and move away from ifupdown, by reducing our current reliance on the PuppetDB import script to record these elements in Netbox.
The updated script should remove any need for manual changes in Netbox for these hosts, and ensure the process can be handled by DC-Ops alone.
Cloud Hosts
Cloud hosts need to have their network configured as described here.
It should be fairly straightforward to modify the provision script to allow for these different types.
Ganeti
We are currently investigating how to make Ganeti VMs function in routed mode (see T300152), which may mean we no longer need any custom switch configuration for those servers.
In the existing setup, however, Ganeti hosts need to have the local 'public' and 'analytics' vlans trunked to them, with the local 'private' network being untagged (native) vlan on the link. On the host-side the server's IP in the private vlan needs to be provisioned on a bridge called 'private', which the physical uplink is made a member of. Vlan sub-interfaces for the other vlans need to be created on the host, and made members of other bridges (named 'public' and 'analytics') respectively.
LVS
We are currently trialling a new L4LB (see T332027) that will only require connection to the local private vlan, so similar to Ganeti a non-standard switch config may not be needed for these long term. In the meantime LVS servers retain quite a few non-standard elements.
As the current LVS servers require multiple physical links to different switches, in a pattern that varys widely depending on datacenter, it is difficult to automatically assign these. Additionally it gets tricky to map more than one physical interface, i.e. PRIMARY, before the NIC layout is known, and ensure the physical cabling matches.
For now any new LVS servers will still need additional IPs reserved in Netbox manually, and their IP/vlan definitions built in puppet. The Netbox PuppetDB Import Script will continue to import this data back into netbox, assigning IPs to interfaces and the additional links.