1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-01-08 21:17:43 +03:00

M #-: Support for in-network vxlan configuration

This commit is contained in:
Ruben S. Montero 2021-01-20 15:02:53 +01:00
parent 1a347de855
commit 1ccb3642d6
No known key found for this signature in database
GPG Key ID: A0CEA6FA880A1D87
4 changed files with 19 additions and 4 deletions

View File

@ -1071,6 +1071,9 @@ INHERIT_VNET_ATTR = "IP_LINK_CONF"
INHERIT_VNET_ATTR = "EXTERNAL"
INHERIT_VNET_ATTR = "AWS_ALLOCATION_ID"
INHERIT_VNET_ATTR = "GATEWAY"
INHERIT_VNET_ATTR = "VXLAN_MODE"
INHERIT_VNET_ATTR = "VXLAN_TEP"
INHERIT_VNET_ATTR = "VXLAN_MC"
INHERIT_VNET_ATTR = "VCENTER_NET_REF"
INHERIT_VNET_ATTR = "VCENTER_SWITCH_NAME"

View File

@ -34,4 +34,7 @@ vntemplates:
phydev: 'eth0'
automatic_vlan_id: 'yes'
netrole: 'private'
vxlan_mode: 'evpn'
vxlan_tep: 'dev'
ip_link_conf: 'nolearning='
cluster_ids: "${cluster.0.id}"

View File

@ -34,4 +34,7 @@ vntemplates:
phydev: 'bond0'
automatic_vlan_id: 'yes'
netrole: 'private'
vxlan_mode: 'evpn'
vxlan_tep: 'dev'
ip_link_conf: 'nolearning='
cluster_ids: "${cluster.0.id}"

View File

@ -24,11 +24,11 @@ module VXLAN
# This function creates and activate a VLAN device
############################################################################
def create_vlan_dev
vxlan_mode = @nic[:conf][:vxlan_mode] || 'multicast'
vxlan_mode = conf_attribute(@nic, :vxlan_mode, 'multicast')
group = ""
if vxlan_mode.downcase == 'evpn'
vxlan_tep = @nic[:conf][:vxlan_tep] || 'dev'
vxlan_tep = conf_attribute(@nic, :vxlan_tep, 'dev')
if vxlan_tep.downcase == 'dev'
tep = "dev #{@nic[:phydev]}"
@ -37,9 +37,9 @@ module VXLAN
end
else
begin
ipaddr = IPAddr.new @nic[:conf][:vxlan_mc]
ipaddr = IPAddr.new conf_attribute(@nic, :vxlan_mc, '239.0.0.0')
rescue
ipaddr = IPAddr.new "239.0.0.0"
ipaddr = IPAddr.new '239.0.0.0'
end
mc = ipaddr.to_i + @nic[@attr_vlan_id].to_i
@ -105,4 +105,10 @@ module VXLAN
end
return nil
end
def conf_attribute(nic, name, default)
return nic[name] unless nic[name].nil?
nic[:conf][name] || default
end
end