Add ability to move neutron services around the environment

Bug #1510202 reported by Logan V
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack-Ansible
Fix Released
Low
Logan V
Liberty
Fix Released
Low
Logan V
Trunk
Fix Released
Low
Logan V

Bug Description

In order to deploy projectcalico in openstack, I no longer need neutron agents containers as the compute nodes handle their own networking. On the compute node the only neutron service I need is neutron_dhcp_agent. So I made the obvious change to env.d:
     belongs_to:
       - compute_containers
     contains:
- - neutron_linuxbridge_agent
+ - neutron_dhcp_agent
+ - nova_api_metadata
       - nova_compute
     properties:
       is_metal: true

This did not result in a neutron_dhcp_agent service being configured in the compute node, because the tasks are set up in a way that every neutron service besides neutron_linuxbridge_agent must be deployed inside the neutron_agents container.

The following change I am testing allows neutron services to be deployed whereever the environment determines they must be.

diff --git a/playbooks/roles/os_neutron/tasks/neutron_post_install.yml b/playbooks/roles/os_neutron/tasks/neutron_post_install.yml
index 381fa0b..efa8b15 100644
--- a/playbooks/roles/os_neutron/tasks/neutron_post_install.yml
+++ b/playbooks/roles/os_neutron/tasks/neutron_post_install.yml
@@ -60,7 +60,7 @@
   notify:
     - Restart neutron services
   when: >
- inventory_hostname in groups['neutron_agents_container']
+ inventory_hostname in groups['neutron_dhcp_agent']
   tags:
     - neutron-config

@@ -79,7 +79,7 @@
   when:
        - item.value.service_en | bool
        - item.value.service_conf is defined
- - inventory_hostname in groups['neutron_agents_container']
+ - inventory_hostname in "{{ groups[ item.value.service_name|replace('-', '_') ]}}"
   tags:
     - neutron-config

diff --git a/playbooks/roles/os_neutron/tasks/neutron_upstart_init.yml b/playbooks/roles/os_neutron/tasks/neutron_upstart_init.yml
index da27dda..68df14f 100644
--- a/playbooks/roles/os_neutron/tasks/neutron_upstart_init.yml
+++ b/playbooks/roles/os_neutron/tasks/neutron_upstart_init.yml
@@ -36,7 +36,7 @@
     system_group: "{{ neutron_system_group_name }}"
     service_home: "{{ neutron_system_home_folder }}"
   when:
- - inventory_hostname in groups['neutron_agent']
+ - inventory_hostname in groups['neutron_dhcp_agent']
     - neutron_services['neutron-dhcp-agent'].service_en | bool
   tags:
     - upstart-init
@@ -50,7 +50,7 @@
     system_group: "{{ neutron_system_group_name }}"
     service_home: "{{ neutron_system_home_folder }}"
   when:
- - inventory_hostname in groups['neutron_agent']
+ - inventory_hostname in groups['neutron_l3_agent']
     - neutron_services['neutron-l3-agent'].service_en | bool
   tags:
     - upstart-init
@@ -78,7 +78,7 @@
     system_group: "{{ neutron_system_group_name }}"
     service_home: "{{ neutron_system_home_folder }}"
   when:
- - inventory_hostname in groups['neutron_agent']
+ - inventory_hostname in groups['neutron_metadata_agent']
     - neutron_services['neutron-metadata-agent'].service_en | bool
   tags:
     - upstart-init
@@ -92,7 +92,7 @@
     system_group: "{{ neutron_system_group_name }}"
     service_home: "{{ neutron_system_home_folder }}"
   when:
- - inventory_hostname in groups['neutron_agent']
+ - inventory_hostname in groups['neutron_metering_agent']
     - neutron_services['neutron-metering-agent'].service_en | bool
   tags:
     - upstart-init

After making this change I have a neutron_dhcp_agent deploying to my compute node as expected.

Tags: in-liberty
Revision history for this message
Kevin Carter (kevin-carter) wrote :

Hi @Logan,

The change you have in the diff looks sensible for general consumption. Might you have an change to post that up for review so that we get some core reviewer eyes on it and potentially in upstream?

If you need help getting started with the general OpenStack commit process let us know in the channel we'd be happy to help. In the meantime, thank you for the diff (patch) and I look forward to seeing it as a review in the future.

Changed in openstack-ansible:
status: New → Confirmed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to openstack-ansible (liberty)

Fix proposed to branch: liberty
Review: https://review.openstack.org/272871

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to openstack-ansible (master)

Reviewed: https://review.openstack.org/248271
Committed: https://git.openstack.org/cgit/openstack/openstack-ansible/commit/?id=929a172be98985c9e1d95d4fd3c823be83dbee86
Submitter: Jenkins
Branch: master

commit 929a172be98985c9e1d95d4fd3c823be83dbee86
Author: Logan V <email address hidden>
Date: Fri Nov 20 16:22:06 2015 -0600

    Allow neutron services to move around environment

    Enable neutron services to be moved around the environment by
    addressing the service groups directly in neutron tasks instead of
    assuming everything lives on the neutron_agents containers.

    Change-Id: I631226d695ae5e916d74be51a126896e45589610
    Closes-Bug: #1510202

Changed in openstack-ansible:
status: Confirmed → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to openstack-ansible (liberty)

Reviewed: https://review.openstack.org/272871
Committed: https://git.openstack.org/cgit/openstack/openstack-ansible/commit/?id=f1db8ad17a9527d0d0402b35b4d98931d88cacee
Submitter: Jenkins
Branch: liberty

commit f1db8ad17a9527d0d0402b35b4d98931d88cacee
Author: Logan V <email address hidden>
Date: Fri Nov 20 16:22:06 2015 -0600

    Allow neutron services to move around environment

    Enable neutron services to be moved around the environment by
    addressing the service groups directly in neutron tasks instead of
    assuming everything lives on the neutron_agents containers.

    Change-Id: I631226d695ae5e916d74be51a126896e45589610
    Closes-Bug: #1510202
    (cherry picked from commit 929a172be98985c9e1d95d4fd3c823be83dbee86)

tags: added: in-liberty
Revision history for this message
Doug Hellmann (doug-hellmann) wrote : Fix included in openstack/openstack-ansible 12.0.8

This issue was fixed in the openstack/openstack-ansible 12.0.8 release.

Revision history for this message
Doug Hellmann (doug-hellmann) wrote : Fix included in openstack/openstack-ansible 12.0.9

This issue was fixed in the openstack/openstack-ansible 12.0.9 release.

Revision history for this message
Doug Hellmann (doug-hellmann) wrote : Fix included in openstack/openstack-ansible 13.0.0

This issue was fixed in the openstack/openstack-ansible 13.0.0 release.

Revision history for this message
Davanum Srinivas (DIMS) (dims-v) wrote :

This issue was fixed in the openstack/openstack-ansible 13.0.0 release.

Revision history for this message
Davanum Srinivas (DIMS) (dims-v) wrote : Fix included in openstack/openstack-ansible 12.0.11

This issue was fixed in the openstack/openstack-ansible 12.0.11 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/openstack-ansible 12.0.8

This issue was fixed in the openstack/openstack-ansible 12.0.8 release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.