From 633ab23f887ab68951cce4bee8cb71e77a28d461 Mon Sep 17 00:00:00 2001 From: Peng Liu Date: Tue, 14 Mar 2017 14:39:35 +0800 Subject: Add l2gw neutron agent support L2 Gateway (L2GW) is an API framework for OpenStack that offers bridging two or more networks together to make them look at a single broadcast domain. This patch implements the l2gw agent which is one of the backend of the l2 gateway service plugin. Change-Id: I1ae8132ceff9410be7bd82caddf0d14251e720bf Depends-On: If1501c153b1b170b9550cb7e5a23be463fba1fe9 Partially-Implements: blueprint l2gw-service-integration Signed-off-by: Peng Liu --- capabilities-map.yaml | 2 +- environments/neutron-l2gw-api.yaml | 20 ---- environments/neutron-l2gw.yaml | 27 ++++++ overcloud-resource-registry-puppet.j2.yaml | 1 + puppet/services/neutron-l2gw-agent.yaml | 106 +++++++++++++++++++++ .../notes/add-l2gw-agent-1a2f14a6ceefe362.yaml | 3 + roles_data.yaml | 1 + 7 files changed, 139 insertions(+), 21 deletions(-) delete mode 100644 environments/neutron-l2gw-api.yaml create mode 100644 environments/neutron-l2gw.yaml create mode 100644 puppet/services/neutron-l2gw-agent.yaml create mode 100644 releasenotes/notes/add-l2gw-agent-1a2f14a6ceefe362.yaml diff --git a/capabilities-map.yaml b/capabilities-map.yaml index 9afe1cdc..1fe7790d 100644 --- a/capabilities-map.yaml +++ b/capabilities-map.yaml @@ -369,7 +369,7 @@ topics: - overcloud-resource-registry-puppet.yaml - file: environments/neutron-l2gw.yaml title: Neutron L2 gateway Service Plugin - description: Enables Neutron L2 gateway Service Plugin + description: Enables Neutron L2 gateway Service Plugin and Agent requires: - overcloud-resource-registry-puppet.yaml diff --git a/environments/neutron-l2gw-api.yaml b/environments/neutron-l2gw-api.yaml deleted file mode 100644 index 09894671..00000000 --- a/environments/neutron-l2gw-api.yaml +++ /dev/null @@ -1,20 +0,0 @@ -# A Heat environment file that can be used to deploy Neutron L2 Gateway service -# -# Currently there are only two service provider for Neutron L2 Gateway -# The default option is a dummy driver that allows to enable the API. -# In order to enable other backend, replace the content of L2gwServiceProvider -# -# - L2 gateway agent: L2GW:l2gw:networking_l2gw.services.l2gateway.service_drivers.rpc_l2gw.L2gwRpcDriver:default -# - OpenDaylight: L2GW:OpenDaylight:networking_odl.l2gateway.driver.OpenDaylightL2gwDriver:default -resource_registry: - OS::TripleO::Services::NeutronL2gwApi: ../puppet/services/neutron-l2gw-api.yaml - -parameter_defaults: - NeutronServicePlugins: "networking_l2gw.services.l2gateway.plugin.L2GatewayPlugin" - L2gwServiceProvider: ["L2GW:l2gw:networking_l2gw.services.l2gateway.service_drivers.L2gwDriver:default"] - - # Optional - # L2gwServiceDefaultInterfaceName: - # L2gwServiceDefaultDeviceName: - # L2gwServiceQuotaL2Gateway: - # L2gwServicePeriodicMonitoringInterval: diff --git a/environments/neutron-l2gw.yaml b/environments/neutron-l2gw.yaml new file mode 100644 index 00000000..bba0968a --- /dev/null +++ b/environments/neutron-l2gw.yaml @@ -0,0 +1,27 @@ +# A Heat environment file that can be used to deploy Neutron L2 Gateway service +# +# Currently there are only two service provider for Neutron L2 Gateway +# The default option is a dummy driver that allows to enable the API. +# In order to enable other backend, replace the content of L2gwServiceProvider +# +# - L2 gateway agent: L2GW:l2gw:networking_l2gw.services.l2gateway.service_drivers.rpc_l2gw.L2gwRpcDriver:default +# - OpenDaylight: L2GW:OpenDaylight:networking_odl.l2gateway.driver.OpenDaylightL2gwDriver:default +resource_registry: + OS::TripleO::Services::NeutronL2gwApi: ../puppet/services/neutron-l2gw-api.yaml + OS::TripleO::Services::NeutronL2gwAgent: ../puppet/services/neutron-l2gw-agent.yaml + +parameter_defaults: + NeutronServicePlugins: "networking_l2gw.services.l2gateway.plugin.L2GatewayPlugin" + L2gwServiceProvider: ['L2GW:l2gw:networking_l2gw.services.l2gateway.service_drivers.L2gwDriver:default'] + + # Optional + # L2gwServiceDefaultInterfaceName: "FortyGigE1/0/1" + # L2gwServiceDefaultDeviceName: "Switch1" + # L2gwServiceQuotaL2Gateway: 10 + # L2gwServicePeriodicMonitoringInterval: 5 + # L2gwAgentOvsdbHosts: ["ovsdb1:127.0.0.1:6632"] + # L2gwAgentEnableManager: False + # L2gwAgentManagerTableListeningPort: "6633" + # L2gwAgentPeriodicInterval: 20 + # L2gwAgentMaxConnectionRetries: 10 + # L2gwAgentSocketTimeout: 30 diff --git a/overcloud-resource-registry-puppet.j2.yaml b/overcloud-resource-registry-puppet.j2.yaml index 450e6116..7b8fe234 100644 --- a/overcloud-resource-registry-puppet.j2.yaml +++ b/overcloud-resource-registry-puppet.j2.yaml @@ -135,6 +135,7 @@ resource_registry: OS::TripleO::Services::NeutronDhcpAgent: puppet/services/neutron-dhcp.yaml OS::TripleO::Services::NeutronL2gwApi: OS::Heat::None OS::TripleO::Services::NeutronL3Agent: puppet/services/neutron-l3.yaml + OS::TripleO::Services::NeutronL2gwAgent: OS::Heat::None OS::TripleO::Services::NeutronMetadataAgent: puppet/services/neutron-metadata.yaml # FIXME(shardy) the duplicate NeutronServer line can be removed when we've updated # the multinode job ControllerServices after this patch merges diff --git a/puppet/services/neutron-l2gw-agent.yaml b/puppet/services/neutron-l2gw-agent.yaml new file mode 100644 index 00000000..39c443f7 --- /dev/null +++ b/puppet/services/neutron-l2gw-agent.yaml @@ -0,0 +1,106 @@ +heat_template_version: pike + +description: > + L2 Gateway agent configured with Puppet +parameters: + ServiceNetMap: + default: {} + description: Mapping of service_name -> network name. Typically set + via parameter_defaults in the resource registry. This + mapping overrides those in ServiceNetMapDefaults. + type: json + DefaultPasswords: + default: {} + type: json + RoleName: + default: '' + description: Role name on which the service is applied + type: string + RoleParameters: + default: {} + description: Parameters specific to the role + type: json + EndpointMap: + default: {} + description: Mapping of service endpoint -> protocol. Typically set + via parameter_defaults in the resource registry. + type: json + L2gwAgentOvsdbHosts: + default: '' + description: L2 gateway agent OVSDB server list. + type: comma_delimited_list + L2gwAgentEnableManager: + default: false + description: Connection can be initiated by the ovsdb server. + type: boolean + L2gwAgentManagerTableListeningPort: + default: 6632 + description: port number for L2 gateway agent, so that it can listen + type: number + L2gwAgentPeriodicInterval: + default: 20 + description: The L2 gateway agent checks connection state with the OVSDB + servers. The interval is number of seconds between attempts. + type: number + L2gwAgentMaxConnectionRetries: + default: 10 + description: The L2 gateway agent retries to connect to the OVSDB server + type: number + L2gwAgentSocketTimeout: + default: 30 + description: socket timeout + type: number + MonitoringSubscriptionNeutronL2gwAgent: + default: 'overcloud-neutron-l2gw-agent' + type: string + NeutronL2gwAgentLoggingSource: + type: json + default: + tag: openstack.neutron.agent.l2gw + path: /var/log/neutron/l2gw-agent.log + +conditions: + internal_manager_enabled: {equals: [{get_param: L2gwAgentEnableManager}, True]} + +outputs: + role_data: + description: Role data for the L2 Gateway role. + value: + service_name: neutron_l2gw_agent + monitoring_subscription: {get_param: MonitoringSubscriptionNeutronL2gwAgent} + logging_source: {get_param: NeutronL2gwAgentLoggingSource} + logging_groups: + - neutron + config_settings: + map_merge: + - neutron::agents::l2gw::ovsdb_hosts: {get_param: L2gwAgentOvsdbHosts} + neutron::agents::l2gw::enable_manager: {get_param: L2gwAgentEnableManager} + neutron::agents::l2gw::manager_table_listening_port: {get_param: L2gwAgentManagerTableListeningPort} + neutron::agents::l2gw::periodic_interval: {get_param: L2gwAgentPeriodicInterval} + neutron::agents::l2gw::max_connection_retries: {get_param: L2gwAgentMaxConnectionRetries} + neutron::agents::l2gw::socket_timeout: {get_param: L2gwAgentSocketTimeout} + - + if: + - internal_manager_enabled + - tripleo.neutron_l2gw_agent.firewall_rules: + '142 neutron l2gw agent input': + proto: 'tcp' + dport: {get_param: L2gwAgentManagerTableListeningPort} + - null + + step_config: | + include tripleo::profile::base::neutron::agents::l2gw + upgrade_tasks: + - name: Check if neutron_l2gw_agent is deployed + command: systemctl is-enabled neutron-l2gw-agent + tags: common + ignore_errors: True + register: neutron_l2gw_agent_enabled + - name: "PreUpgrade step0,validation: Check service neutron-l2gw-agent is running" + shell: /usr/bin/systemctl show 'neutron-l2gw-agent' --property ActiveState | grep '\bactive\b' + when: neutron_l2gw_agent_enabled.rc == 0 + tags: step0,validation + - name: Stop neutron_l2gw_agent service + tags: step1 + when: neutron_l2gw_agent_enabled.rc == 0 + service: name=neutron-l2gw-agent state=stopped diff --git a/releasenotes/notes/add-l2gw-agent-1a2f14a6ceefe362.yaml b/releasenotes/notes/add-l2gw-agent-1a2f14a6ceefe362.yaml new file mode 100644 index 00000000..7f88e269 --- /dev/null +++ b/releasenotes/notes/add-l2gw-agent-1a2f14a6ceefe362.yaml @@ -0,0 +1,3 @@ +--- +features: + - Add support for L2 Gateway Neutron agent diff --git a/roles_data.yaml b/roles_data.yaml index e0867cbc..3e0ef752 100644 --- a/roles_data.yaml +++ b/roles_data.yaml @@ -74,6 +74,7 @@ - OS::TripleO::Services::NeutronApi - OS::TripleO::Services::NeutronCorePlugin - OS::TripleO::Services::NeutronOvsAgent + - OS::TripleO::Services::NeutronL2gwAgent - OS::TripleO::Services::RabbitMQ - OS::TripleO::Services::HAproxy - OS::TripleO::Services::Keepalived -- cgit 1.2.3-korg