From 82d7c034a01cede90f8cb9e43b9fa87f27d2a3dc Mon Sep 17 00:00:00 2001 From: Dmitriy Rabotyagov Date: Thu, 24 Jun 2021 20:54:27 +0300 Subject: [PATCH] Split neutron server and neutron agent hosts It is very common usecase when neutron-api is intended to run on infra hosts (inside lxc containers), while neutron-agents are to run on independent network nodes. That was not possible by default, so env.d overrides has to be placed to fix this behaviour. This patch brings option to do this natively without extra override. In the meanwhile it shouldn't break any existing depoyments as leaves previous groups naming as is. Change-Id: Ie9fa464561c81b503d6946a7afe4870b92790cee --- .../openstack_user_config.yml.example | 22 +++++++++++++++++++ .../openstack_user_config.yml.prod.example | 13 +++++++++-- inventory/env.d/neutron.yml | 14 ++++++++++++ ...neutron_agents_split-b3acd7c52d3976df.yaml | 8 +++++++ tests/test_inventory.py | 4 ++++ 5 files changed, 59 insertions(+), 2 deletions(-) create mode 100644 releasenotes/notes/neutron_agents_split-b3acd7c52d3976df.yaml diff --git a/etc/openstack_deploy/openstack_user_config.yml.example b/etc/openstack_deploy/openstack_user_config.yml.example index cb7b4875d2..ba2a6e67ab 100644 --- a/etc/openstack_deploy/openstack_user_config.yml.example +++ b/etc/openstack_deploy/openstack_user_config.yml.example @@ -422,6 +422,28 @@ # infra3: # ip: 172.29.236.103 # +# If you want to deploy neutron agents to different set of hosts (net nodes) +# rather then neutron API, you should define 'network-infra_hosts' and +# 'network-agent_hosts' instead. +# +# Example: +# +# network-infra_hosts: +# infra1: +# ip: 172.29.236.101 +# infra2: +# ip: 172.29.236.102 +# infra3: +# ip: 172.29.236.103 +# +# network-agent_hosts: +# net1: +# ip: 172.29.236.201 +# net2: +# ip: 172.29.236.202 +# net3: +# ip: 172.29.236.203 +# # -------- # # Level: compute_hosts (optional) diff --git a/etc/openstack_deploy/openstack_user_config.yml.prod.example b/etc/openstack_deploy/openstack_user_config.yml.prod.example index 8a2e279aa5..6592b11681 100644 --- a/etc/openstack_deploy/openstack_user_config.yml.prod.example +++ b/etc/openstack_deploy/openstack_user_config.yml.prod.example @@ -204,8 +204,8 @@ dashboard_hosts: infra3: ip: 172.29.236.13 -# neutron server, agents (L3, etc) -network_hosts: +# neutron api +network-infra_hosts: infra1: ip: 172.29.236.11 infra2: @@ -213,6 +213,15 @@ network_hosts: infra3: ip: 172.29.236.13 +# neutron agents (L3, DHCP, etc) +network-agent_hosts: + net1: + ip: 172.29.236.21 + net2: + ip: 172.29.236.22 + net3: + ip: 172.29.236.23 + # ceilometer (telemetry data collection) metering-infra_hosts: infra1: diff --git a/inventory/env.d/neutron.yml b/inventory/env.d/neutron.yml index cd8c20e0ca..d79533ad39 100644 --- a/inventory/env.d/neutron.yml +++ b/inventory/env.d/neutron.yml @@ -52,6 +52,7 @@ container_skel: neutron_agents_container: belongs_to: - network_containers + - network-agent_containers contains: - neutron_agent - neutron_bgp_dragent @@ -67,6 +68,7 @@ container_skel: neutron_server_container: belongs_to: - network_containers + - network-infra_containers contains: - neutron_server - opendaylight @@ -78,3 +80,15 @@ physical_skel: network_hosts: belongs_to: - hosts + network-agent_containers: + belongs_to: + - all_containers + network-agent_hosts: + belongs_to: + - hosts + network-infra_containers: + belongs_to: + - all_containers + network-infra_hosts: + belongs_to: + - hosts diff --git a/releasenotes/notes/neutron_agents_split-b3acd7c52d3976df.yaml b/releasenotes/notes/neutron_agents_split-b3acd7c52d3976df.yaml new file mode 100644 index 0000000000..56346406ce --- /dev/null +++ b/releasenotes/notes/neutron_agents_split-b3acd7c52d3976df.yaml @@ -0,0 +1,8 @@ +--- +features: + - | + In order to use dedicated net nodes, override of env.d is no longer + required. + Deployers can set ``network-infra_hosts`` to their infra (LXC) hosts + and ``network-agent_hosts`` to their net nodes inside their + openstack_user_config.yml or conf.d files. diff --git a/tests/test_inventory.py b/tests/test_inventory.py index 39e04924f9..37c3d75237 100644 --- a/tests/test_inventory.py +++ b/tests/test_inventory.py @@ -394,6 +394,10 @@ class TestAnsibleInventoryFormatConstraints(unittest.TestCase): 'network_all', 'network_containers', 'network_hosts', + 'network-agent_containers', + 'network-agent_hosts', + 'network-infra_containers', + 'network-infra_hosts', 'neutron_agent', 'neutron_agents_container', 'neutron_all',