From 1e43e5b08f9d324e910cf1842d566d2372e5aeff Mon Sep 17 00:00:00 2001 From: Numan Siddique Date: Wed, 8 Nov 2017 09:23:08 +0530 Subject: [PATCH] OVN: Provide the option to define NeutronBridgeMappings as a role parameter In order for a node to provide external connectivity to tenant traffic, ovn-bridge-mappings should be defined which is read by ovn-controller service. This value comes from the T-H-T param 'NeutronBridgeMappings'. Presently this param is defined with the default value "datacentre:br-ex" and is configured on every node where ovn-controller service is enabled. This would cause problems if some of the hosts do not provide external connectvity. To solve this problem, this patch adds 'NeutronBridgeMappings' as a role parameter so that it can set to empty string if the role doesn't provide external connectivity. In the OVN environment template files, this param is set to empty for Compute role. Since NeutronBridgeMappings is also used by neutron-ovs-agent service, this patch also modifies puppet/services/neutron-ovs-agent.yaml to define NeutronBridgeMappings as a role parameter. Change-Id: I6a00b8dc1ff387cc5e1e62b4d9d7da5e1239ee31 Closes-bug: #1730711 --- environments/neutron-ml2-ovn-ha.yaml | 3 ++ environments/neutron-ml2-ovn.yaml | 3 ++ .../services-docker/neutron-ovn-ha.yaml | 3 ++ environments/services-docker/neutron-ovn.yaml | 3 ++ puppet/services/neutron-ovs-agent.yaml | 16 ++++++- puppet/services/ovn-controller.yaml | 42 +++++++++++++------ 6 files changed, 56 insertions(+), 14 deletions(-) diff --git a/environments/neutron-ml2-ovn-ha.yaml b/environments/neutron-ml2-ovn-ha.yaml index 3e332ad191..433ba6658d 100644 --- a/environments/neutron-ml2-ovn-ha.yaml +++ b/environments/neutron-ml2-ovn-ha.yaml @@ -23,3 +23,6 @@ parameter_defaults: NeutronNetworkType: 'geneve' NeutronServicePlugins: 'qos,ovn-router,trunk' NeutronVniRanges: ['1:65536', ] + + ComputeParameters: + NeutronBridgeMappings: "" diff --git a/environments/neutron-ml2-ovn.yaml b/environments/neutron-ml2-ovn.yaml index f484c50549..c754efc5dd 100644 --- a/environments/neutron-ml2-ovn.yaml +++ b/environments/neutron-ml2-ovn.yaml @@ -23,3 +23,6 @@ parameter_defaults: NeutronNetworkType: 'geneve' NeutronServicePlugins: 'qos,ovn-router,trunk' NeutronVniRanges: ['1:65536', ] + + ComputeParameters: + NeutronBridgeMappings: "" diff --git a/environments/services-docker/neutron-ovn-ha.yaml b/environments/services-docker/neutron-ovn-ha.yaml index 6d2289b9df..53b60e541b 100644 --- a/environments/services-docker/neutron-ovn-ha.yaml +++ b/environments/services-docker/neutron-ovn-ha.yaml @@ -23,3 +23,6 @@ parameter_defaults: NeutronNetworkType: 'geneve' NeutronServicePlugins: 'qos,ovn-router,trunk' NeutronVniRanges: ['1:65536', ] + + ComputeParameters: + NeutronBridgeMappings: "" diff --git a/environments/services-docker/neutron-ovn.yaml b/environments/services-docker/neutron-ovn.yaml index 6f63ba2c8c..62b3a9d0c2 100644 --- a/environments/services-docker/neutron-ovn.yaml +++ b/environments/services-docker/neutron-ovn.yaml @@ -23,3 +23,6 @@ parameter_defaults: NeutronNetworkType: 'geneve' NeutronServicePlugins: 'qos,ovn-router,trunk' NeutronVniRanges: ['1:65536', ] + + ComputeParameters: + NeutronBridgeMappings: "" diff --git a/puppet/services/neutron-ovs-agent.yaml b/puppet/services/neutron-ovs-agent.yaml index a2f82a5845..9f9aa86d55 100644 --- a/puppet/services/neutron-ovs-agent.yaml +++ b/puppet/services/neutron-ovs-agent.yaml @@ -101,6 +101,20 @@ resources: DefaultPasswords: {get_param: DefaultPasswords} EndpointMap: {get_param: EndpointMap} + # Merging role-specific parameters (RoleParameters) with the default parameters. + # RoleParameters will have the precedence over the default parameters. + RoleParametersValue: + type: OS::Heat::Value + properties: + type: json + value: + map_replace: + - map_replace: + - neutron::agents::ml2::ovs::bridge_mappings: NeutronBridgeMappings + - values: {get_param: [RoleParameters]} + - values: + NeutronBridgeMappings: {get_param: NeutronBridgeMappings} + outputs: role_data: description: Role data for the Neutron OVS agent service. @@ -113,10 +127,10 @@ outputs: config_settings: map_merge: - get_attr: [NeutronBase, role_data, config_settings] + - get_attr: [RoleParametersValue, value] - neutron::agents::ml2::ovs::l2_population: {get_param: NeutronEnableL2Pop} neutron::agents::ml2::ovs::enable_distributed_routing: {get_param: NeutronEnableDVR} neutron::agents::ml2::ovs::arp_responder: {get_param: NeutronEnableARPResponder} - neutron::agents::ml2::ovs::bridge_mappings: {get_param: NeutronBridgeMappings} neutron::agents::ml2::ovs::tunnel_types: {get_param: NeutronTunnelTypes} neutron::agents::ml2::ovs::extensions: {get_param: NeutronAgentExtensions} # NOTE: bind IP is found in Heat replacing the network name with the diff --git a/puppet/services/ovn-controller.yaml b/puppet/services/ovn-controller.yaml index d8d53594b4..65102adcdb 100644 --- a/puppet/services/ovn-controller.yaml +++ b/puppet/services/ovn-controller.yaml @@ -55,25 +55,41 @@ parameters: default: "br-int" +resources: + # Merging role-specific parameters (RoleParameters) with the default parameters. + # RoleParameters will have the precedence over the default parameters. + RoleParametersValue: + type: OS::Heat::Value + properties: + type: json + value: + map_replace: + - map_replace: + - ovn::controller::ovn_bridge_mappings: NeutronBridgeMappings + - values: {get_param: [RoleParameters]} + - values: + NeutronBridgeMappings: {get_param: NeutronBridgeMappings} + outputs: role_data: description: Role data for the OVN Controller agent value: service_name: ovn_controller config_settings: - ovn::southbound::port: {get_param: OVNSouthboundServerPort} - ovn::controller::ovn_encap_type: {get_param: OVNTunnelEncapType} - ovn::controller::ovn_encap_ip: {get_param: [ServiceNetMap, NeutronTenantNetwork]} - ovn::controller::ovn_bridge_mappings: {get_param: NeutronBridgeMappings} - ovn::controller::ovn_bridge: {get_param: OVNIntegrationBridge} - nova::compute::force_config_drive: true - tripleo.ovn_controller.firewall_rules: - '118 neutron vxlan networks': - proto: 'udp' - dport: 4789 - '119 neutron geneve networks': - proto: 'udp' - dport: 6081 + map_merge: + - get_attr: [RoleParametersValue, value] + - ovn::southbound::port: {get_param: OVNSouthboundServerPort} + ovn::controller::ovn_encap_type: {get_param: OVNTunnelEncapType} + ovn::controller::ovn_encap_ip: {get_param: [ServiceNetMap, NeutronTenantNetwork]} + ovn::controller::ovn_bridge: {get_param: OVNIntegrationBridge} + nova::compute::force_config_drive: true + tripleo.ovn_controller.firewall_rules: + '118 neutron vxlan networks': + proto: 'udp' + dport: 4789 + '119 neutron geneve networks': + proto: 'udp' + dport: 6081 step_config: | include ::tripleo::profile::base::neutron::agents::ovn upgrade_tasks: