nova fails to deploy on hosts without container_networks set

Bug #1508517 reported by Logan V
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack-Ansible
Fix Released
Medium
Kevin Carter
Kilo
Fix Released
Medium
Kevin Carter
Liberty
Fix Released
Medium
Kevin Carter
Trunk
Fix Released
Medium
Kevin Carter

Bug Description

I have a compute host that looks like this:
    "_meta": {
        "hostvars": {
            "lsn-d3277": {
                "ansible_ssh_host": "10.10.9.103",
                "component": "nova_compute",
                "container_address": "10.10.9.103",
                "container_name": "lsn-d3277",
                "container_networks": {},
                "container_types": "lsn-d3277_containers",
                "is_metal": true,
                "physical_host": "lsn-d3277",
                "physical_host_group": "compute_hosts",
                "properties": {
                    "container_release": "trusty",
                    "is_metal": true,
                    "service_name": "nova"
                }
            },

The host fails to deploy because:
TASK: [Set nova management bridge (is_metal)] *********************************
skipping: [lsn-d3277]

TASK: [Set nova management address (is_metal)] ********************************
fatal: [lsn-d3277] => One or more undefined variables: 'dict object' has no attribute u'br-mgmt'

It looks like the bug is here:
    - name: Set nova management bridge (is_metal)
      set_fact:
        management_bridge: "{{ 'ansible_' + hostvars[inventory_hostname]['container_networks']['container_address']['bridge'] | replace('-', '_') }}"
      when:
        - hostvars[inventory_hostname]['container_networks']['container_address']['bridge'] is defined
        - is_metal | bool
      tags:
        - nova-config
    - name: Set nova management address (is_metal)
      set_fact:
        management_address: "{{ hostvars[inventory_hostname][management_bridge]['ipv4']['address'] }}"
      when:
        - is_metal | bool
      tags:
        - nova-config
    - name: Set nova management bridge (is_metal no container network)
      set_fact:
        management_address: "{{ ansible_ssh_host }}"
      when:
        - hostvars[inventory_hostname]['container_networks']['container_address']['bridge'] is undefined
        - is_metal | bool
      tags:
        - nova-config

Looking at the flow here I don't see how I could configure to reach "Set nova management bridge (is_metal no container network)", which is the appropriate task for my environment. There should be more filtering on "Set nova management address (is_metal)" .

When I add the below "when" to "Set nova management address (is_metal)" everything works as expected.
- hostvars[inventory_hostname]['container_networks']['container_address']['bridge'] is defined

This is maybe not the best filter to implement for the fix but it works great for me to bypass the failure and use the correct rule.

Revision history for this message
Logan V (loganv) wrote :
Revision history for this message
Byron McCollum (byron-mccollum) wrote :

I can confirm I am seeing the same failures.

TASK: [Set nova management address (is_metal)] ********************************
fatal: [f96c5805-compute1] => One or more undefined variables: 'dict object' has no attribute u'br-mgmt'

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

Fix proposed to branch: master
Review: https://review.openstack.org/241293

Changed in openstack-ansible:
status: Confirmed → In Progress
Revision history for this message
Jesse Pretorius (jesse-pretorius) wrote :

@Logan & Byron - please can you test the proposed patch and provide feedback regarding whether it resolves the problem.

Revision history for this message
Logan V (loganv) wrote :

tested & working for me.

Revision history for this message
Byron McCollum (byron-mccollum) wrote :

@jesse Confirmed patch applied to RPC r11.0.3 (openstack-ansible@770e02d) resolves problem in Kilo.

Revision history for this message
Byron McCollum (byron-mccollum) wrote :

I meant openstack-ansible@87a9e35

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

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

commit aef4e7a891fac8c54bb0996aab825b48eb095f26
Author: Kevin Carter <email address hidden>
Date: Tue Nov 3 10:46:59 2015 -0600

    Deployment fix when container_networks are not set

    The change updates the logic within nova such to it will
    now correctly set the management interface when using
    a dynamic inventory without the container_networks options
    within it.

    This also updates the container create play so that it too
    will properly skip a host that also may not have the container
    networks entries within it's inventory configs.

    Change-Id: I157a6ecd0ad99000369d786a649c7b40d791d917
    Closes-Bug: #1508517
    Signed-off-by: Kevin Carter <email address hidden>

Changed in openstack-ansible:
status: In Progress → Fix Committed
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/244423

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

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

commit 4119a1eed2121f84de5cbdc13f7652b5e4d668bb
Author: Kevin Carter <email address hidden>
Date: Tue Nov 3 10:46:59 2015 -0600

    Deployment fix when container_networks are not set

    The change updates the logic within nova such to it will
    now correctly set the management interface when using
    a dynamic inventory without the container_networks options
    within it.

    This also updates the container create play so that it too
    will properly skip a host that also may not have the container
    networks entries within it's inventory configs.

    Change-Id: I157a6ecd0ad99000369d786a649c7b40d791d917
    Closes-Bug: #1508517
    Signed-off-by: Kevin Carter <email address hidden>
    (cherry picked from commit aef4e7a891fac8c54bb0996aab825b48eb095f26)

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

Reviewed: https://review.openstack.org/244424
Committed: https://git.openstack.org/cgit/openstack/openstack-ansible/commit/?id=3621b1bd2e355f29e2096b9cdec4794ab49808a3
Submitter: Jenkins
Branch: kilo

commit 3621b1bd2e355f29e2096b9cdec4794ab49808a3
Author: Kevin Carter <email address hidden>
Date: Tue Nov 3 10:46:59 2015 -0600

    Deployment fix when container_networks are not set

    The change updates the logic within nova such to it will
    now correctly set the management interface when using
    a dynamic inventory without the container_networks options
    within it.

    This also updates the container create play so that it too
    will properly skip a host that also may not have the container
    networks entries within it's inventory configs.

    Change-Id: I157a6ecd0ad99000369d786a649c7b40d791d917
    Closes-Bug: #1508517
    Signed-off-by: Kevin Carter <email address hidden>
    (cherry picked from commit aef4e7a891fac8c54bb0996aab825b48eb095f26)

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

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

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 11.2.12

This issue was fixed in the openstack/openstack-ansible 11.2.12 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
Davanum Srinivas (DIMS) (dims-v) wrote : Fix included in openstack/openstack-ansible 11.2.14

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

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

This issue was fixed in the openstack/openstack-ansible 11.2.15 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.