Region name isn't respected when configuring ironic

Bug #1825583 reported by Erik Olof Gunnar Andersson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
Erik Olof Gunnar Andersson
Queens
Fix Committed
Medium
Eric Fried
Rocky
Fix Committed
Medium
Eric Fried
Stein
Fix Committed
Medium
Eric Fried

Bug Description

When you configure a region_name for Ironic, an endpoint isn't properly passed on to the ironic client. This means that the region_name won't be respected.

The current workaround is to provide an api_endpoint (or endpoint_override) for Ironic.

tags: added: ironic
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.opendev.org/654457

Changed in nova:
assignee: nobody → Eric Fried (efried)
status: New → In Progress
Changed in nova:
assignee: Eric Fried (efried) → Erik Olof Gunnar Andersson (eandersson)
Matt Riedemann (mriedem)
Changed in nova:
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.opendev.org/654457
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=13278be9f265e237fc68ee60acfacaa1df68522e
Submitter: Zuul
Branch: master

commit 13278be9f265e237fc68ee60acfacaa1df68522e
Author: Eric Fried <email address hidden>
Date: Fri Apr 19 15:35:21 2019 -0500

    Fix {min|max}_version in ironic Adapter setup

    Change If625411f40be0ba642baeb02950f568f43673655 introduced
    nova.utils.get_ksa_adapter, which accepts min_version and max_version
    kwargs to be passed through to the ksa Adapter constructor. These are
    supposed to represent minimum and maximum *major* API versions,
    min_version was erroneously set to *microversions* when setting up the
    Adapter for ironicclient. This commit changes it to a major version.
    (Microversion negotiation is done within ironicclient itself.)

    Also, this bug went latent for several releases because a) it only seems
    to be triggered when region_name is given in the conf; but also b)
    ironicclient has code to discover a reasonable endpoint if passed None.
    So this change also adds a warning log if we try and fail to discover
    the endpoint via ksa.

    Change-Id: I34a3f8d4a496217eb01790e2d124111625bf5f85
    Closes-Bug: #1825583

Changed in nova:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (stable/stein)

Fix proposed to branch: stable/stein
Review: https://review.opendev.org/655429

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (stable/stein)

Reviewed: https://review.opendev.org/655429
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=e6ca3838d940dea417cdeffe22c656d222737a7e
Submitter: Zuul
Branch: stable/stein

commit e6ca3838d940dea417cdeffe22c656d222737a7e
Author: Eric Fried <email address hidden>
Date: Fri Apr 19 15:35:21 2019 -0500

    Fix {min|max}_version in ironic Adapter setup

    Change If625411f40be0ba642baeb02950f568f43673655 introduced
    nova.utils.get_ksa_adapter, which accepts min_version and max_version
    kwargs to be passed through to the ksa Adapter constructor. These are
    supposed to represent minimum and maximum *major* API versions,
    min_version was erroneously set to *microversions* when setting up the
    Adapter for ironicclient. This commit changes it to a major version.
    (Microversion negotiation is done within ironicclient itself.)

    Also, this bug went latent for several releases because a) it only seems
    to be triggered when region_name is given in the conf; but also b)
    ironicclient has code to discover a reasonable endpoint if passed None.
    So this change also adds a warning log if we try and fail to discover
    the endpoint via ksa.

    Change-Id: I34a3f8d4a496217eb01790e2d124111625bf5f85
    Closes-Bug: #1825583
    (cherry picked from commit 13278be9f265e237fc68ee60acfacaa1df68522e)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (stable/rocky)

Fix proposed to branch: stable/rocky
Review: https://review.opendev.org/655693

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

Reviewed: https://review.opendev.org/654692
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=6eaa6db0ee01ee5a7b56bc3176914d85e697b96a
Submitter: Zuul
Branch: master

commit 6eaa6db0ee01ee5a7b56bc3176914d85e697b96a
Author: Erik Olof Gunnar Andersson <email address hidden>
Date: Mon Apr 22 21:12:07 2019 -0700

    Pass on region when we don't have a valid ironic endpoint

    If for some reason we don't have a valid endpoint to provide the
    Ironic client, we should at the very least provide the information
    it needs to make an informed decision.

    Change-Id: I31fa1c6fb0b224fbb02f9ebf68abc6a3728e9389
    Partial-Bug: #1825583

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (stable/stein)

Fix proposed to branch: stable/stein
Review: https://review.opendev.org/656096

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (stable/stein)

Reviewed: https://review.opendev.org/656096
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=222f462444b72368cd5f22d4b0ac9baf0bbe8e0c
Submitter: Zuul
Branch: stable/stein

commit 222f462444b72368cd5f22d4b0ac9baf0bbe8e0c
Author: Erik Olof Gunnar Andersson <email address hidden>
Date: Mon Apr 22 21:12:07 2019 -0700

    Pass on region when we don't have a valid ironic endpoint

    If for some reason we don't have a valid endpoint to provide the
    Ironic client, we should at the very least provide the information
    it needs to make an informed decision.

    Change-Id: I31fa1c6fb0b224fbb02f9ebf68abc6a3728e9389
    Partial-Bug: #1825583
    (cherry picked from commit 6eaa6db0ee01ee5a7b56bc3176914d85e697b96a)

tags: added: in-stable-stein
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (stable/rocky)

Reviewed: https://review.opendev.org/655693
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=35bda4ec385e4c2b3d4cee07467f5077b13b1dd9
Submitter: Zuul
Branch: stable/rocky

commit 35bda4ec385e4c2b3d4cee07467f5077b13b1dd9
Author: Eric Fried <email address hidden>
Date: Fri Apr 19 15:35:21 2019 -0500

    Fix {min|max}_version in ironic Adapter setup

    Change If625411f40be0ba642baeb02950f568f43673655 introduced
    nova.utils.get_ksa_adapter, which accepts min_version and max_version
    kwargs to be passed through to the ksa Adapter constructor. These are
    supposed to represent minimum and maximum *major* API versions,
    min_version was erroneously set to *microversions* when setting up the
    Adapter for ironicclient. This commit changes it to a major version.
    (Microversion negotiation is done within ironicclient itself.)

    Also, this bug went latent for several releases because a) it only seems
    to be triggered when region_name is given in the conf; but also b)
    ironicclient has code to discover a reasonable endpoint if passed None.
    So this change also adds a warning log if we try and fail to discover
    the endpoint via ksa.

    Conflicts:
     nova/tests/unit/virt/ironic/test_client_wrapper.py
    This was just because the old microversion was 1.38 instead of 1.46. The
    patch still changes it to 1.0.

    Change-Id: I34a3f8d4a496217eb01790e2d124111625bf5f85
    Closes-Bug: #1825583
    (cherry picked from commit 13278be9f265e237fc68ee60acfacaa1df68522e)
    (cherry picked from commit e6ca3838d940dea417cdeffe22c656d222737a7e)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (stable/queens)

Fix proposed to branch: stable/queens
Review: https://review.opendev.org/656523

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (stable/rocky)

Fix proposed to branch: stable/rocky
Review: https://review.opendev.org/656525

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (stable/rocky)

Reviewed: https://review.opendev.org/656525
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=d2ab3cef4eb05e5811d39d740274fdbdd1027a5b
Submitter: Zuul
Branch: stable/rocky

commit d2ab3cef4eb05e5811d39d740274fdbdd1027a5b
Author: Erik Olof Gunnar Andersson <email address hidden>
Date: Mon Apr 22 21:12:07 2019 -0700

    Pass on region when we don't have a valid ironic endpoint

    If for some reason we don't have a valid endpoint to provide the
    Ironic client, we should at the very least provide the information
    it needs to make an informed decision.

    Conflicts:
     nova/tests/unit/virt/ironic/test_client_wrapper.py
    The conflict here is twofold:
    - Each release has a different value for the latest/previous
      os_ironic_api_version kwarg. This fix doesn't change that value, so it
      needs to be "left alone" in the tests.
    - The 'ironic_url' kwarg was renamed to 'endpoint' in the stein release
      [1]; it needs to be left as 'ironic_url' in rocky and prior.

    [1] I1b3ce1955622c40b780c0b15ec7e09be3e8ace72

    Change-Id: I31fa1c6fb0b224fbb02f9ebf68abc6a3728e9389
    Partial-Bug: #1825583
    (cherry picked from commit 6eaa6db0ee01ee5a7b56bc3176914d85e697b96a)
    (cherry picked from commit 222f462444b72368cd5f22d4b0ac9baf0bbe8e0c)

tags: added: in-stable-rocky
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/nova 19.0.1

This issue was fixed in the openstack/nova 19.0.1 release.

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

This issue was fixed in the openstack/nova 18.2.1 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (stable/queens)

Reviewed: https://review.opendev.org/656523
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=ba3ad2d65af20332e768a6df0e2c2d64292f9e2c
Submitter: Zuul
Branch: stable/queens

commit ba3ad2d65af20332e768a6df0e2c2d64292f9e2c
Author: Eric Fried <email address hidden>
Date: Fri Apr 19 15:35:21 2019 -0500

    Fix {min|max}_version in ironic Adapter setup

    Change If625411f40be0ba642baeb02950f568f43673655 introduced
    nova.utils.get_ksa_adapter, which accepts min_version and max_version
    kwargs to be passed through to the ksa Adapter constructor. These are
    supposed to represent minimum and maximum *major* API versions,
    min_version was erroneously set to *microversions* when setting up the
    Adapter for ironicclient. This commit changes it to a major version.
    (Microversion negotiation is done within ironicclient itself.)

    Also, this bug went latent for several releases because a) it only seems
    to be triggered when region_name is given in the conf; but also b)
    ironicclient has code to discover a reasonable endpoint if passed None.
    So this change also adds a warning log if we try and fail to discover
    the endpoint via ksa.

    Conflicts:
     nova/tests/unit/virt/ironic/test_client_wrapper.py
    This was just because the old microversion was 1.37 instead of 1.38. The
    patch still changes it to 1.0.

    Change-Id: I34a3f8d4a496217eb01790e2d124111625bf5f85
    Closes-Bug: #1825583
    (cherry picked from commit 13278be9f265e237fc68ee60acfacaa1df68522e)
    (cherry picked from commit 35bda4ec385e4c2b3d4cee07467f5077b13b1dd9)

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

This issue was fixed in the openstack/nova 17.0.11 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/nova 20.0.0.0rc1

This issue was fixed in the openstack/nova 20.0.0.0rc1 release candidate.

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.