Migrate to Cluster-wide VLAN Trunking
Purpose
We want to define VLAN IDs that will be trunked from vmbr0 up to the physical managed switch connecting the Proxmox VE node(s).
Configuring in SDN allows us to define the trunked VLANs in one central location instead of having to manually create the VLANs on every PVE node in the cluster.
Old Workflow
- Log into Proxmox VE
- Select PVE node
- Click Network > Create > OVS IntPort (or Linux VLAN if using Linux Bridge)
- Set the OVS Bridge (or Linux Bridge)
- Set the VLAN tag
- Then, repeat this process on each Proxmox VE node
New Workflow
- Log into Proxmox VE
- Select "Datacenter"
- Select SDN
- Zones
- Add VLAN
- Give it a descriptive ID (e.g. trunkbr0, limited character length)
- Select bridge where this VLAN will be used (e.g. vmbr0)
- All other settings default
- Give it a descriptive ID (e.g. trunkbr0, limited character length)
- Add VLAN
- Zones
- Select VNets
- Create VNet
- Select zone: trunk
- Set tag: VLAN tag to trunk up to managed switch
- Set Name (e.g. websrv, limited character length)
- Set Alias (e.g. web_servers_vlan_25)
- Repeat this for each VLAN that will be trunked to vmbr0
- Create VNet
- Click SDN and click Apply
Migration
Make a Backup
- Open PVE shell on each node
- Run this command to make a copy of the current networking configuration on each node
cp /etc/network/interfaces /etc/network/interfaces.bak
Source in SDN
# Adds the line "source /etc/network/interfaces.d/*" to /etc/network/interfaces
# If grep does not find the line already exists
grep 'source /etc/network/interfaces.d/sdn' /etc/network/interfaces > /dev/null ||
grep 'source /etc/network/interfaces.d/\*' /etc/network/interfaces > /dev/null ||
echo -e '\nsource /etc/network/interfaces.d/*' >> /etc/network/interfaces
Migrate VLAN Configurations
- Follow the New Workflow section above
- Create the Zone
- Create the VNet for each VLAN
- Apply the SDN configuration
- Ideally, pick a PVE node where you can test with the least disruption
- Go to Network
- Remove a test VLAN
- Apply
- Find a VM configured with your test VLAN you just deleted
- Log into the VM and restart the network adapter (or reboot the VM entirely)
- See if it receives a DHCP lease on the target VLAN
- IF so, remove the rest of the VLANs and ensure your VMs get DHCP leases on the target VLAN
If anything goes wrong, run cp /etc/network/interfaces.bak /etc/network/interfaces and ifreload -a to restore your backed up configuration