Enable netvirt configs when netvirt is enabled

- Enable the netvirt related configurations by checking if the netvirt features
  are enabled instead of looking for whether bgpvpn is.
- Add an enable_netvirt option in environment_config.yaml
- Enforce having to enable netvirt for bgpvpn features

Change-Id: I7979b646b46a6fe489de7892e21e469ff6adde61
Signed-off-by: Romanos Skiadas <rski@intracom-telecom.com>
This commit is contained in:
Romanos Skiadas 2016-11-18 09:46:38 +02:00
parent 0574e57f39
commit 72e8ec9226
6 changed files with 24 additions and 9 deletions

View File

@ -104,7 +104,7 @@ if $segmentation_type == 'vlan' {
$net_role_property = 'neutron/mesh'
$tunneling_ip = get_network_role_property($net_role_property, 'ipaddr')
if $odl['enable_bgpvpn'] {
if $odl['enable_netvirt'] {
exec { 'ovs-set-provider-mapping':
command => "ovs-vsctl set Open_vSwitch $(ovs-vsctl show | head -n 1) other_config:provider_mappings=physnet1:br-floating",
path => '/usr/bin',

View File

@ -52,7 +52,7 @@ module Puppet::Parser::Functions
# override neutron_config/quantum_settings
neutron_config['L2']['mechanism_drivers'] = 'opendaylight'
neutron_config['L2']['phys_nets']['physnet1']['bridge'] = odl['enable_bgpvpn'] ? 'br-ex' : 'br-int'
neutron_config['L2']['phys_nets']['physnet1']['bridge'] = odl['enable_netvirt'] ? 'br-ex' : 'br-int'
hiera_overrides['neutron_config'] = neutron_config
hiera_overrides['quantum_settings'] = neutron_config

View File

@ -7,8 +7,8 @@ module Puppet::Parser::Functions
enabled_features << features_set['default']
enabled_features << features_set['odl-default']
# only enable the new netvirt features when bgpvpn is enabled
enabled_features << features_set['ovsdb'] unless odl_settings['enable_bgpvpn']
enabled_features << features_set['netvirt'] if odl_settings['enable_bgpvpn']
enabled_features << features_set['ovsdb'] unless odl_settings['enable_netvirt']
enabled_features << features_set['netvirt'] if odl_settings['enable_netvirt']
enabled_features << features_set['sfc'] if odl_settings['enable_sfc']
enabled_features << features_set[odl_settings['sfc_class']] if odl_settings['enable_sfc']

View File

@ -5,7 +5,7 @@ module Puppet::Parser::Functions
bridges are used and both of them should be created on OVS.
input:
<boolean> bgpvpn enabled or not
<boolean> netvirt enabled or not
<hash> original network scheme
output: overridden network scheme
@ -13,7 +13,7 @@ module Puppet::Parser::Functions
ENDHEREDOC
) do |args|
odl_bgpvpn_enabled, network_scheme = args
odl_netvirt_enabled, network_scheme = args
# get original network scheme
orig_endpoints = network_scheme['endpoints']
@ -25,7 +25,6 @@ module Puppet::Parser::Functions
roles = {}
transformations = []
# If bgpvpn extensions are enabled br-floating is not needed
delete_bridges = ['br-prv']
delete_bridges.each do |bridge|
@ -51,7 +50,7 @@ module Puppet::Parser::Functions
end
end
if not odl_bgpvpn_enabled
if not odl_netvirt_enabled
Puppet.debug 'Changing network_scheme for the non bgpvpn case'
BRIDGE_MAPPING = {

View File

@ -4,7 +4,7 @@ class opendaylight::hiera_override {
# override network scheme
$orig_network_scheme = hiera_hash('network_scheme')
$network_scheme = odl_network_scheme($opendaylight::odl_settings['enable_bgpvpn'], $orig_network_scheme)
$network_scheme = odl_network_scheme($opendaylight::odl_settings['enable_netvirt'], $orig_network_scheme)
odl_hiera_overrides(
$override_file,

View File

@ -29,6 +29,19 @@ attributes:
restrictions:
- condition: "settings:opendaylight.enable_sfc.value == false"
action: "hide"
enable_netvirt:
weight: 25
type: "checkbox"
value: false
label: "Use the new OpenDaylight netvirt features"
description:
>
OpenDaylight provides the odl-netvirt-openstack feature that integrates
it with OpenStack. This is incompatible with ovsdb features, on which
some other features depend, such as SFC. NetVirt is a requirement for
features such as BGPVPN.
restrictions:
- settings:opendaylight.enable_sfc.value == true: SFC features cannot be enabled.
enable_bgpvpn:
weight: 40
type: "checkbox"
@ -53,6 +66,9 @@ attributes:
- condition: "settings:opendaylight.enable_l3_odl.value == false"
strict: false
message: "OpenDayLight must be acting as the L3 controller for the bgpvpn features to be enabled."
- condition: "settings:opendaylight.enable_netvirt.value == false"
strict: false
message: "This feature requires NetVirt to be enabled."
odl_v2:
weight: 60
type: "checkbox"