kvm: Add a configuration setting to switch between multicast and evpn VXLAN modes (#13107)

* 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.

* Add network.vxlan.mode to agent.properties

Make sure there is an example in the agent.properties file so people
can easily discover this configuration setting exists
This commit is contained in:
Wido den Hollander 2026-07-01 10:49:18 +02:00 committed by GitHub
parent d2c8aa7dff
commit a97c510374
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 21 additions and 2 deletions

View File

@ -372,6 +372,14 @@ iscsi.session.cleanup.enabled=false
# to the directory "/usr/share/cloudstack-common/".
#network.scripts.dir=scripts/vm/network/vnet
# Sets the VXLAN networking mode used, either 'multicast' (default) or 'evpn'.
# The different modes lead to different scripts being executed by the Agent.
# multicast: modifyvxlan.sh
# evpn: modifyvxlan-evpn.sh
# Existing environments using VXLAN can safely switch to the 'evpn' mode as this
# will not break existing functionality.
#network.vxlan.mode=multicast
# Defines the location for storage scripts.
# The path defined in this property is relative.
# To locate the script, ACS first tries to concatenate

View File

@ -318,6 +318,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");