kvm: Add a configuration setting to switch between multicast and evpn VXLAN modes

Using the 'network.vxlan.mode' setting you can switch between the multicast (default) and evpn VXLAN modes on a KVM Agent.

When nothing is configured CloudStack will default to multicast by using the modifyvxlan.sh script in the background.
If this setting is set to 'evpn' the KVM Agent will execute the 'modifyvxlan-evpn.sh' script which will configure the VXLAN
devices for EVPN (usually with FRRouting with BGP) mode.

This removes the need to manually replace a shell script on the hypervisor to switch modes.

Existing environments are not touched by this and it is safe to add this setting a an environment already using EVPN for the
VXLAN deployment.
This commit is contained in:
Wido den Hollander 2026-05-05 23:08:50 +02:00
parent 1e512ab9c6
commit 53c5e0f54d
2 changed files with 13 additions and 2 deletions

View File

@ -304,6 +304,15 @@ public class AgentProperties{
*/
public static final Property<String> NETWORK_BRIDGE_TYPE = new Property<>("network.bridge.type", "native");
/**
* Sets the VXLAN networking mode used by the BridgeVifDriver.<br>
* Possible values: multicast | evpn <br>
* When set to <code>evpn</code>, the driver will use modifyvxlan-evpn.sh instead of modifyvxlan.sh.<br>
* Data type: String.<br>
* Default value: <code>multicast</code>
*/
public static final Property<String> NETWORK_VXLAN_MODE = new Property<>("network.vxlan.mode", "multicast");
/**
* Sets the driver used to plug and unplug NICs from the bridges.<br>
* A sensible default value will be selected based on the network.bridge.type but can be overridden here.<br>

View File

@ -76,9 +76,11 @@ public class BridgeVifDriver extends VifDriverBase {
if (_modifyVlanPath == null) {
throw new ConfigurationException("Unable to find modifyvlan.sh");
}
_modifyVxlanPath = Script.findScript(networkScriptsDir, "modifyvxlan.sh");
String vxlanMode = AgentPropertiesFileHandler.getPropertyValue(AgentProperties.NETWORK_VXLAN_MODE);
String vxlanScript = "evpn".equalsIgnoreCase(vxlanMode) ? "modifyvxlan-evpn.sh" : "modifyvxlan.sh";
_modifyVxlanPath = Script.findScript(networkScriptsDir, vxlanScript);
if (_modifyVxlanPath == null) {
throw new ConfigurationException("Unable to find modifyvxlan.sh");
throw new ConfigurationException("Unable to find " + vxlanScript);
}
libvirtVersion = (Long) params.get("libvirtVersion");