From 81d139edc939c8842893b342ecb1a5795724518c Mon Sep 17 00:00:00 2001 From: Tim Rozet Date: Mon, 7 Nov 2016 13:33:37 -0500 Subject: [PATCH] Adds OpenDaylight local OVSDB listener With neutron switching OVSDB configuration to be done via the 'native' library, OVSDB needs to be listening on a port to accept RPCs. This adds a default listener on a non-common port and sets the URI for Neutron when using OpenDaylight so that agents may add ports to OVS. Change-Id: Ic651bc9d28f45491846b6ad1048fbc975b3e2141 Signed-off-by: Tim Rozet --- manifests/plugins/ml2/opendaylight.pp | 17 +++++++++++++---- manifests/plugins/ovs/opendaylight.pp | 9 +++++++-- .../fix_odl_ovsdb_config-57b96a76ed8f90ab.yaml | 12 ++++++++++++ .../neutron_plugins_ml2_opendaylight_spec.rb | 13 +++++++++---- .../neutron_plugins_ovs_opendaylight_spec.rb | 11 ++++++----- 5 files changed, 47 insertions(+), 15 deletions(-) create mode 100644 releasenotes/notes/fix_odl_ovsdb_config-57b96a76ed8f90ab.yaml diff --git a/manifests/plugins/ml2/opendaylight.pp b/manifests/plugins/ml2/opendaylight.pp index 0b7b369cd..a27c4d641 100644 --- a/manifests/plugins/ml2/opendaylight.pp +++ b/manifests/plugins/ml2/opendaylight.pp @@ -25,11 +25,16 @@ # Defaults to $::os_service_default # Example: 'http://127.0.0.1:8080/controller/nb/v2/neutron' # +# [*ovsdb_connection*] +# (optional) The URI used to connect to the local OVSDB server +# Defaults to 'tcp:127.0.0.1:6639' +# class neutron::plugins::ml2::opendaylight ( - $package_ensure = 'present', - $odl_username = $::os_service_default, - $odl_password = $::os_service_default, - $odl_url = $::os_service_default, + $package_ensure = 'present', + $odl_username = $::os_service_default, + $odl_password = $::os_service_default, + $odl_url = $::os_service_default, + $ovsdb_connection = 'tcp:127.0.0.1:6639', ) { include ::neutron::deps @@ -47,4 +52,8 @@ class neutron::plugins::ml2::opendaylight ( 'ml2_odl/password': value => $odl_password; 'ml2_odl/url': value => $odl_url; } + + neutron_config { + 'OVS/ovsdb_connection': value => $ovsdb_connection; + } } diff --git a/manifests/plugins/ovs/opendaylight.pp b/manifests/plugins/ovs/opendaylight.pp index 968148333..6edd3b23b 100644 --- a/manifests/plugins/ovs/opendaylight.pp +++ b/manifests/plugins/ovs/opendaylight.pp @@ -23,6 +23,10 @@ # (optional) The ODL southbound interface for OVSDB # Defaults to 'tcp:127.0.0.1:6640' # +# [*ovsdb_server_iface*] +# (optional) The interface for OVSDB local server to listen on +# Defaults to 'ptcp:6639:127.0.0.1' +# # [*provider_mappings*] # (optional) List of : # Required for VLAN provider networks. @@ -43,6 +47,7 @@ class neutron::plugins::ovs::opendaylight ( $odl_password = 'admin', $odl_check_url = 'http://127.0.0.1:8080/restconf/operational/network-topology:network-topology/topology/netvirt:1', $odl_ovsdb_iface = 'tcp:127.0.0.1:6640', + $ovsdb_server_iface = 'ptcp:6639:127.0.0.1', $provider_mappings = [], $retry_interval = 60, $retry_count = 20, @@ -61,8 +66,8 @@ class neutron::plugins::ovs::opendaylight ( } -> # OVS manager exec { 'Set OVS Manager to OpenDaylight': - command => "ovs-vsctl set-manager ${odl_ovsdb_iface}", - unless => "ovs-vsctl show | grep 'Manager \"${odl_ovsdb_iface}\"'", + command => "ovs-vsctl set-manager ${ovsdb_server_iface} ${odl_ovsdb_iface}", + unless => "ovs-vsctl show | grep 'Manager \"${ovsdb_server_iface} ${odl_ovsdb_iface}\"'", path => '/usr/sbin:/usr/bin:/sbin:/bin', } -> # local ip diff --git a/releasenotes/notes/fix_odl_ovsdb_config-57b96a76ed8f90ab.yaml b/releasenotes/notes/fix_odl_ovsdb_config-57b96a76ed8f90ab.yaml new file mode 100644 index 000000000..406cab276 --- /dev/null +++ b/releasenotes/notes/fix_odl_ovsdb_config-57b96a76ed8f90ab.yaml @@ -0,0 +1,12 @@ +--- +fixes: + - Neutron modified the way that Agents connect to OVSDB + server to configure OVS tap ports, etc by using the + OVSDB server URI rather than the ovs-vsctl client. + In ODL deployments, OVSDB server is never configured + to listen on a port and therefore Neutron Agent + configuration fails. This fixes that problem by + configuring multiple managers, including a local + listener by default on a non-standard port for OVSDB + server. This way Neutron Agents are able to talk to + OVSDB while OVS is also still connected to ODL. diff --git a/spec/classes/neutron_plugins_ml2_opendaylight_spec.rb b/spec/classes/neutron_plugins_ml2_opendaylight_spec.rb index fd4632729..8e629e06a 100644 --- a/spec/classes/neutron_plugins_ml2_opendaylight_spec.rb +++ b/spec/classes/neutron_plugins_ml2_opendaylight_spec.rb @@ -11,10 +11,11 @@ describe 'neutron::plugins::ml2::opendaylight' do let :default_params do { - :package_ensure => 'present', - :odl_username => '', - :odl_password => '', - :odl_url => '', + :package_ensure => 'present', + :odl_username => '', + :odl_password => '', + :odl_url => '', + :ovsdb_connection => 'tcp:127.0.0.1:6639' } end @@ -48,6 +49,10 @@ describe 'neutron::plugins::ml2::opendaylight' do is_expected.to contain_neutron_plugin_ml2('ml2_odl/username').with_value(params[:odl_username]) is_expected.to contain_neutron_plugin_ml2('ml2_odl/url').with_value(params[:odl_url]) end + + it 'configures neutron server settings' do + is_expected.to contain_neutron_config('OVS/ovsdb_connection').with_value(params[:ovsdb_connection]) + end end diff --git a/spec/classes/neutron_plugins_ovs_opendaylight_spec.rb b/spec/classes/neutron_plugins_ovs_opendaylight_spec.rb index 1405688d4..abac22fdb 100644 --- a/spec/classes/neutron_plugins_ovs_opendaylight_spec.rb +++ b/spec/classes/neutron_plugins_ovs_opendaylight_spec.rb @@ -11,11 +11,12 @@ describe 'neutron::plugins::ovs::opendaylight' do let :default_params do { - :odl_username => 'admin', - :odl_password => 'admin', - :odl_check_url => 'http://127.0.0.1:8080/restconf/operational/network-topology:network-topology/topology/netvirt:1', - :odl_ovsdb_iface => 'tcp:127.0.0.1:6640', - :provider_mappings => [], + :odl_username => 'admin', + :odl_password => 'admin', + :odl_check_url => 'http://127.0.0.1:8080/restconf/operational/network-topology:network-topology/topology/netvirt:1', + :odl_ovsdb_iface => 'tcp:127.0.0.1:6640', + :ovsdb_server_iface => 'ptcp:6639:127.0.0.1', + :provider_mappings => [], :retry_interval => 60, :retry_count => 20, }