From 53c5e0f54d5c324b0d9cb4b819756fa0af130331 Mon Sep 17 00:00:00 2001 From: Wido den Hollander Date: Tue, 5 May 2026 23:08:50 +0200 Subject: [PATCH 1/2] 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. --- .../java/com/cloud/agent/properties/AgentProperties.java | 9 +++++++++ .../cloud/hypervisor/kvm/resource/BridgeVifDriver.java | 6 ++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/agent/src/main/java/com/cloud/agent/properties/AgentProperties.java b/agent/src/main/java/com/cloud/agent/properties/AgentProperties.java index e69a7efdc9c7..875c8d6042d9 100644 --- a/agent/src/main/java/com/cloud/agent/properties/AgentProperties.java +++ b/agent/src/main/java/com/cloud/agent/properties/AgentProperties.java @@ -304,6 +304,15 @@ public class AgentProperties{ */ public static final Property NETWORK_BRIDGE_TYPE = new Property<>("network.bridge.type", "native"); + /** + * Sets the VXLAN networking mode used by the BridgeVifDriver.
+ * Possible values: multicast | evpn
+ * When set to evpn, the driver will use modifyvxlan-evpn.sh instead of modifyvxlan.sh.
+ * Data type: String.
+ * Default value: multicast + */ + public static final Property NETWORK_VXLAN_MODE = new Property<>("network.vxlan.mode", "multicast"); + /** * Sets the driver used to plug and unplug NICs from the bridges.
* A sensible default value will be selected based on the network.bridge.type but can be overridden here.
diff --git a/plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/BridgeVifDriver.java b/plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/BridgeVifDriver.java index e19c3437ba56..d6fc0479faf1 100644 --- a/plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/BridgeVifDriver.java +++ b/plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/BridgeVifDriver.java @@ -76,9 +76,11 @@ public void configure(Map params) throws ConfigurationException 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"); From 0ee09b3c221818124201022ed5a1d8b67cc3f025 Mon Sep 17 00:00:00 2001 From: Wido den Hollander Date: Wed, 6 May 2026 08:22:20 +0200 Subject: [PATCH 2/2] 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 --- agent/conf/agent.properties | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/agent/conf/agent.properties b/agent/conf/agent.properties index ba4a3874664a..57fc7b1eb88f 100644 --- a/agent/conf/agent.properties +++ b/agent/conf/agent.properties @@ -364,6 +364,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