binding:profile is None breaks migration

Bug #1717365 reported by Eric M Gonzalez on 2017-09-14
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
High
Matt Riedemann
Newton
High
Matt Riedemann
Ocata
High
Matt Riedemann
Pike
High
Matt Riedemann

Bug Description

Nova Newton (commit: d8b30c3772 as pulled in with OSA 14.2.7)

During a live-migration, setup_networks_at_host tries to lookup some information from the network port.

at https://review.openstack.org/#/c/275073/45/nova/network/neutronv2/api.py@289

If the port has None assigned to "binding:profile" further code breaks with a TypeError assigning to NoneType.

mriedem suggested catching this with an extended .get():

16:27 < mriedem> since the port_profile should default to {}, UNLESS the port has binding:profile=None...
16:27 < mriedem> it should be: port_profile = p.get(BINDING_PROFILE, {}) or {}

Eric M Gonzalez (egrh3) wrote :
Matt Riedemann (mriedem) on 2017-09-14
tags: added: live-migration neutron
Changed in nova:
status: New → Triaged
importance: Undecided → Medium

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

Changed in nova:
assignee: nobody → Matt Riedemann (mriedem)
status: Triaged → In Progress

Reviewed: https://review.openstack.org/504260
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=8ac7be36bedaf0dd3467efc5b5bffdb365b8231b
Submitter: Jenkins
Branch: master

commit 8ac7be36bedaf0dd3467efc5b5bffdb365b8231b
Author: Matt Riedemann <email address hidden>
Date: Thu Sep 14 18:04:20 2017 -0400

    neutron: handle binding:profile=None during migration

    The port binding:profile handling in _setup_migration_port_profile
    and _update_port_binding_for_instance is not handling when the
    binding:profile is set on the port but the value is None, which
    results in a NoneType error. Neutron API does not define a format
    for this field, or whether or not it will be specified on the port,
    and if so, if it's an empty dict or None, so let's be safe and
    make sure we handle None.

    Because of how many places we access the binding:profile on
    a port, this adds a common helper utility.

    Co-Authored-By: Eric M Gonzalez <email address hidden>

    Change-Id: I564bac88fad6cc47ccbf7425b1ab39899fdc1c2e
    Closes-Bug: #1717365

Changed in nova:
status: In Progress → Fix Released
Matt Riedemann (mriedem) on 2017-09-21
Changed in nova:
importance: Medium → High
Matt Riedemann (mriedem) wrote :

Changing the severity to high since this breaks live migration.

Reviewed: https://review.openstack.org/506323
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=2d76ed6e8a98f995e3693450cc788e70080691d5
Submitter: Zuul
Branch: stable/newton

commit 2d76ed6e8a98f995e3693450cc788e70080691d5
Author: Matt Riedemann <email address hidden>
Date: Thu Sep 14 18:04:20 2017 -0400

    neutron: handle binding:profile=None during migration

    The port binding:profile handling in _setup_migration_port_profile
    and _update_port_binding_for_instance is not handling when the
    binding:profile is set on the port but the value is None, which
    results in a NoneType error. Neutron API does not define a format
    for this field, or whether or not it will be specified on the port,
    and if so, if it's an empty dict or None, so let's be safe and
    make sure we handle None.

    Because of how many places we access the binding:profile on
    a port, this adds a common helper utility.

    Co-Authored-By: Eric M Gonzalez <email address hidden>

    Conflicts:
          nova/network/neutronv2/api.py
          nova/tests/unit/network/test_neutronv2.py

    NOTE(mriedem): Conflicts are caused by not having change
    a67af1f110f160861f5cbbff987766c46d60198a and change
    ecc8de8d6cccb06d7f4c8ecc144d37612ae1e9cc in Newton.

    Change-Id: I564bac88fad6cc47ccbf7425b1ab39899fdc1c2e
    Closes-Bug: #1717365
    (cherry picked from commit 8ac7be36bedaf0dd3467efc5b5bffdb365b8231b)
    (cherry picked from commit c393e490751416f408432ec20e2b1afc1af88af0)
    (cherry picked from commit b2577207203167d7b8610531bedf0f480a9b7865)

Reviewed: https://review.openstack.org/506319
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=c393e490751416f408432ec20e2b1afc1af88af0
Submitter: Zuul
Branch: stable/pike

commit c393e490751416f408432ec20e2b1afc1af88af0
Author: Matt Riedemann <email address hidden>
Date: Thu Sep 14 18:04:20 2017 -0400

    neutron: handle binding:profile=None during migration

    The port binding:profile handling in _setup_migration_port_profile
    and _update_port_binding_for_instance is not handling when the
    binding:profile is set on the port but the value is None, which
    results in a NoneType error. Neutron API does not define a format
    for this field, or whether or not it will be specified on the port,
    and if so, if it's an empty dict or None, so let's be safe and
    make sure we handle None.

    Because of how many places we access the binding:profile on
    a port, this adds a common helper utility.

    Co-Authored-By: Eric M Gonzalez <email address hidden>

    Conflicts:
          nova/network/neutronv2/api.py

    NOTE(mriedem): The conflict is due to not having change
    2f67b97577fa28f7e6ab23971e7d6f259889c992 in Pike.

    Change-Id: I564bac88fad6cc47ccbf7425b1ab39899fdc1c2e
    Closes-Bug: #1717365
    (cherry picked from commit 8ac7be36bedaf0dd3467efc5b5bffdb365b8231b)

Reviewed: https://review.openstack.org/506320
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=b2577207203167d7b8610531bedf0f480a9b7865
Submitter: Zuul
Branch: stable/ocata

commit b2577207203167d7b8610531bedf0f480a9b7865
Author: Matt Riedemann <email address hidden>
Date: Thu Sep 14 18:04:20 2017 -0400

    neutron: handle binding:profile=None during migration

    The port binding:profile handling in _setup_migration_port_profile
    and _update_port_binding_for_instance is not handling when the
    binding:profile is set on the port but the value is None, which
    results in a NoneType error. Neutron API does not define a format
    for this field, or whether or not it will be specified on the port,
    and if so, if it's an empty dict or None, so let's be safe and
    make sure we handle None.

    Because of how many places we access the binding:profile on
    a port, this adds a common helper utility.

    Co-Authored-By: Eric M Gonzalez <email address hidden>

    Change-Id: I564bac88fad6cc47ccbf7425b1ab39899fdc1c2e
    Closes-Bug: #1717365
    (cherry picked from commit 8ac7be36bedaf0dd3467efc5b5bffdb365b8231b)
    (cherry picked from commit c393e490751416f408432ec20e2b1afc1af88af0)

This issue was fixed in the openstack/nova 17.0.0.0b1 development milestone.

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

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

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

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

Other bug subscribers