Forbidden traits in flavor properties don't work

Bug #1821824 reported by Magnus Bergman
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
High
Magnus Bergman
Rocky
Fix Committed
High
Eric Fried
Stein
Fix Committed
High
Eric Fried

Bug Description

Due to an error when implementing forbidden traits they are stripped off in the _clean_empties function in nova/scheduler/utils.py which only takes required_traits into account.

This means that forbidden traits won't be acted upon and an instance started with a flavor with a forbidden trait still can end up on a resource provider with that trait set.

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

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

Changed in nova:
assignee: nobody → Magnus Bergman (magnusbe)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

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

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

Reviewed: https://review.openstack.org/647957
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=13e661792d73c27bcc7616b6bf612b5784e994e3
Submitter: Zuul
Branch: master

commit 13e661792d73c27bcc7616b6bf612b5784e994e3
Author: mb <email address hidden>
Date: Wed Mar 27 01:48:29 2019 +0100

    Adding tests to demonstrate bug #1821824

    Fixed functional test test_flavor_traits_based_scheduling as it
    would pass 50% of the times even if the required trait was not
    taken into account by adding a new part that disables the compute
    host that has the required trait and retries, expecting a no valid
    host error.

    Added functional test test_flavor_forbidden_traits_based_scheduling
    to test that forbidden traits are taken into account.

    The second test temporarily passes where it should not until the
    next commit where the bug is actually fixed.

    Change-Id: I1c7e2d5ff2e7b5158f8f2c4b2ebce5c20e99a984
    Related-Bug: #1821824

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

Reviewed: https://review.openstack.org/648653
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=c088856c8c08f0ab0746db7c120da494c9dd42d4
Submitter: Zuul
Branch: master

commit c088856c8c08f0ab0746db7c120da494c9dd42d4
Author: mb <email address hidden>
Date: Fri Mar 29 10:20:58 2019 +0100

    Fix bug preventing forbidden traits from working

    Modifies _clean_empties function to take forbidden traits into account
    in addition to required traits.

    Added unit test test_resources_from_request_spec_flavor_forbidden_trait
    to test that a single forbidden trait doesn't get lost in the
    resources_from_request_spec function.

    Also updated the functional test
    test_flavor_forbidden_traits_based_scheduling to do the right thing.

    Change-Id: I491b10c9c202baae4a37034848147f910a50eebf
    Closes-Bug: #1821824

Changed in nova:
status: In Progress → Fix Released
Matt Riedemann (mriedem)
Changed in nova:
importance: Undecided → High
Matt Riedemann (mriedem)
tags: added: placement scheduling traits
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to nova (stable/stein)

Related fix proposed to branch: stable/stein
Review: https://review.openstack.org/649600

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.openstack.org/649601

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

Related fix proposed to branch: stable/rocky
Review: https://review.openstack.org/649602

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.openstack.org/649603

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

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

commit c97466456f9a8525074ef78def44ecb491bfb793
Author: mb <email address hidden>
Date: Wed Mar 27 01:48:29 2019 +0100

    Adding tests to demonstrate bug #1821824

    Fixed functional test test_flavor_traits_based_scheduling as it
    would pass 50% of the times even if the required trait was not
    taken into account by adding a new part that disables the compute
    host that has the required trait and retries, expecting a no valid
    host error.

    Added functional test test_flavor_forbidden_traits_based_scheduling
    to test that forbidden traits are taken into account.

    The second test temporarily passes where it should not until the
    next commit where the bug is actually fixed.

    Change-Id: I1c7e2d5ff2e7b5158f8f2c4b2ebce5c20e99a984
    Related-Bug: #1821824
    (cherry picked from commit 13e661792d73c27bcc7616b6bf612b5784e994e3)

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

Reviewed: https://review.openstack.org/649601
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=6a5be4ae250b9ff1b8e48947ab80a65827460513
Submitter: Zuul
Branch: stable/stein

commit 6a5be4ae250b9ff1b8e48947ab80a65827460513
Author: mb <email address hidden>
Date: Fri Mar 29 10:20:58 2019 +0100

    Fix bug preventing forbidden traits from working

    Modifies _clean_empties function to take forbidden traits into account
    in addition to required traits.

    Added unit test test_resources_from_request_spec_flavor_forbidden_trait
    to test that a single forbidden trait doesn't get lost in the
    resources_from_request_spec function.

    Also updated the functional test
    test_flavor_forbidden_traits_based_scheduling to do the right thing.

    Change-Id: I491b10c9c202baae4a37034848147f910a50eebf
    Closes-Bug: #1821824
    (cherry picked from commit c088856c8c08f0ab0746db7c120da494c9dd42d4)

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

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

commit a40bce7f80fc002b1a4d774b1f9394adb747016e
Author: mb <email address hidden>
Date: Wed Mar 27 01:48:29 2019 +0100

    Adding tests to demonstrate bug #1821824

    Fixed functional test test_flavor_traits_based_scheduling as it
    would pass 50% of the times even if the required trait was not
    taken into account by adding a new part that disables the compute
    host that has the required trait and retries, expecting a no valid
    host error.

    Added functional test test_flavor_forbidden_traits_based_scheduling
    to test that forbidden traits are taken into account.

    The second test temporarily passes where it should not until the
    next commit where the bug is actually fixed.

    Change-Id: I1c7e2d5ff2e7b5158f8f2c4b2ebce5c20e99a984
    Related-Bug: #1821824
    (cherry picked from commit 13e661792d73c27bcc7616b6bf612b5784e994e3)
    (cherry picked from commit c97466456f9a8525074ef78def44ecb491bfb793)

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

Reviewed: https://review.openstack.org/649603
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=6f07f769020bdbe5328b3991fc5e9bc89815a970
Submitter: Zuul
Branch: stable/rocky

commit 6f07f769020bdbe5328b3991fc5e9bc89815a970
Author: mb <email address hidden>
Date: Fri Mar 29 10:20:58 2019 +0100

    Fix bug preventing forbidden traits from working

    Modifies _clean_empties function to take forbidden traits into account
    in addition to required traits.

    Added unit test test_resources_from_request_spec_flavor_forbidden_trait
    to test that a single forbidden trait doesn't get lost in the
    resources_from_request_spec function.

    Also updated the functional test
    test_flavor_forbidden_traits_based_scheduling to do the right thing.

    NOTE: test_utils needed a tweak in this (rocky) cherry-pick to reference
    RequestGroup from placement/lib since objects.RequestGroup wasn't
    introduced until stein [1].

    [1] I46c97d2641d9685ef59771314665a17a5236097d

    Change-Id: I491b10c9c202baae4a37034848147f910a50eebf
    Closes-Bug: #1821824
    (cherry picked from commit c088856c8c08f0ab0746db7c120da494c9dd42d4)
    (cherry picked from commit 6a5be4ae250b9ff1b8e48947ab80a65827460513)

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 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.