Skip to content

Commit 1ccb364

Browse files
committed
M #-: Support for in-network vxlan configuration
1 parent 1a347de commit 1ccb364

File tree

4 files changed

+19
-4
lines changed

4 files changed

+19
-4
lines changed

share/etc/oned.conf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1071,6 +1071,9 @@ INHERIT_VNET_ATTR = "IP_LINK_CONF"
10711071
INHERIT_VNET_ATTR = "EXTERNAL"
10721072
INHERIT_VNET_ATTR = "AWS_ALLOCATION_ID"
10731073
INHERIT_VNET_ATTR = "GATEWAY"
1074+
INHERIT_VNET_ATTR = "VXLAN_MODE"
1075+
INHERIT_VNET_ATTR = "VXLAN_TEP"
1076+
INHERIT_VNET_ATTR = "VXLAN_MC"
10741077

10751078
INHERIT_VNET_ATTR = "VCENTER_NET_REF"
10761079
INHERIT_VNET_ATTR = "VCENTER_SWITCH_NAME"

share/oneprovision/provisions/hybrid+/provisions/aws.d/networks.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,7 @@ vntemplates:
3434
phydev: 'eth0'
3535
automatic_vlan_id: 'yes'
3636
netrole: 'private'
37+
vxlan_mode: 'evpn'
38+
vxlan_tep: 'dev'
39+
ip_link_conf: 'nolearning='
3740
cluster_ids: "${cluster.0.id}"

share/oneprovision/provisions/hybrid+/provisions/packet.d/networks.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,7 @@ vntemplates:
3434
phydev: 'bond0'
3535
automatic_vlan_id: 'yes'
3636
netrole: 'private'
37+
vxlan_mode: 'evpn'
38+
vxlan_tep: 'dev'
39+
ip_link_conf: 'nolearning='
3740
cluster_ids: "${cluster.0.id}"

src/vnm_mad/remotes/vxlan/vxlan.rb

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ module VXLAN
2424
# This function creates and activate a VLAN device
2525
############################################################################
2626
def create_vlan_dev
27-
vxlan_mode = @nic[:conf][:vxlan_mode] || 'multicast'
27+
vxlan_mode = conf_attribute(@nic, :vxlan_mode, 'multicast')
2828
group = ""
2929

3030
if vxlan_mode.downcase == 'evpn'
31-
vxlan_tep = @nic[:conf][:vxlan_tep] || 'dev'
31+
vxlan_tep = conf_attribute(@nic, :vxlan_tep, 'dev')
3232

3333
if vxlan_tep.downcase == 'dev'
3434
tep = "dev #{@nic[:phydev]}"
@@ -37,9 +37,9 @@ def create_vlan_dev
3737
end
3838
else
3939
begin
40-
ipaddr = IPAddr.new @nic[:conf][:vxlan_mc]
40+
ipaddr = IPAddr.new conf_attribute(@nic, :vxlan_mc, '239.0.0.0')
4141
rescue
42-
ipaddr = IPAddr.new "239.0.0.0"
42+
ipaddr = IPAddr.new '239.0.0.0'
4343
end
4444

4545
mc = ipaddr.to_i + @nic[@attr_vlan_id].to_i
@@ -105,4 +105,10 @@ def get_interface_first_ip(name)
105105
end
106106
return nil
107107
end
108+
109+
def conf_attribute(nic, name, default)
110+
return nic[name] unless nic[name].nil?
111+
112+
nic[:conf][name] || default
113+
end
108114
end

0 commit comments

Comments
 (0)