RequestSpec.ignore_hosts from resize is reused in subsequent evacuate

Bug #1669054 reported by Chris Friesen
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
Matt Riedemann
Ocata
Fix Committed
Medium
Matt Riedemann
Pike
Fix Committed
Medium
Matt Riedemann
Queens
Fix Committed
Medium
Matt Riedemann
Rocky
Fix Committed
Medium
Matt Riedemann
Stein
Fix Committed
Medium
Matt Riedemann

Bug Description

When doing a resize, if CONF.allow_resize_to_same_host is False, then we set RequestSpec.ignore_hosts and then save the RequestSpec.

When we go to use the same RequestSpec on a subsequent rebuild/evacuate, ignore_hosts is still set from the previous resize.

In RequestSpec.reset_forced_destinations() we reset force_hosts and force_nodes, it might make sense to also reset ignore_hosts.

We may also want to change other things...for example in ConductorManager.rebuild_instance() we set request_spec.ignore_hosts to itself if it's set...that makes no sense if we're just going to reset it to nothing immediately afterwards.

Chris Friesen (cbf123)
description: updated
description: updated
Revision history for this message
Sean Dague (sdague) wrote :

This is really a note to self. Moving to Opinion as there are a lot of mights here. :)

tags: added: note-to-self
Changed in nova:
status: New → Opinion
Revision history for this message
Chris Friesen (cbf123) wrote :

I don't think this is opinion, since if CONF.allow_resize_to_same_host is False and we do a resize then a subsequent rebuild/evacuate, it *will* continue to ignore the original host.

The only uncertainty is around where exactly to do the fix.

coolias (coolias-lj)
Changed in nova:
status: Opinion → Confirmed
Revision history for this message
Matt Riedemann (mriedem) wrote :

Heh yeah same thing I noticed here:

https://review.openstack.org/#/c/638791/1/nova/conductor/tasks/migrate.py@355

It's a similar issue to bug 1797580 with the requested_destination field, we really just shouldn't persist those types of things that are per-operation.

Changed in nova:
importance: Undecided → Medium
tags: added: requestspec resize
removed: note-to-self
Revision history for this message
Matt Riedemann (mriedem) wrote :
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to nova (master)

Related fix proposed to branch: master
Review: https://review.openstack.org/646006

Matt Riedemann (mriedem)
Changed in nova:
status: Confirmed → In Progress
assignee: nobody → Matt Riedemann (mriedem)
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/647512

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

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

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on nova (master)

Change abandoned by Matt Riedemann (<email address hidden>) on branch: master
Review: https://review.openstack.org/647513
Reason: Squashed into https://review.openstack.org/#/c/647512/.

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

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

commit 556cf103b22ab6bebecc9d824d6f918cda38fe3e
Author: Matt Riedemann <email address hidden>
Date: Sat Mar 23 12:01:42 2019 -0400

    Add functional regression test for bug 1669054

    Change Ic3968721d257a167f3f946e5387cd227a7eeec6c in Newton
    started setting the RequestSpec.ignore_hosts field to the
    source instance.host during resize/cold migrate if
    allow_resize_to_same_host=False in config, which it is by
    default.

    Change I8abdf58a6537dd5e15a012ea37a7b48abd726579 also in
    Newton persists changes to the RequestSpec in conductor
    in order to save the RequestSpec.flavor for the new flavor.
    This inadvertently persists the ignore_hosts field as well.

    Later if you try to evacuate or unshelve the server it will ignore
    the original source host because of the persisted ignore_hosts value.
    This is obviously a problem in a small deployment with only a few
    compute nodes (like an edge deployment). As a result, an evacuation
    can fail if the only available host is the one being ignored.

    This adds a functional regression recreate test for the bug.

    Change-Id: I6ce2d6b1baf47796f867aede1acf292ec9739d6d
    Related-Bug: #1669054

Changed in nova:
assignee: Matt Riedemann (mriedem) → Eric Fried (efried)
Eric Fried (efried)
Changed in nova:
assignee: Eric Fried (efried) → Matt Riedemann (mriedem)
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/649319

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/649320

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/649325

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/649326

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

Related fix proposed to branch: stable/queens
Review: https://review.openstack.org/649362

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

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

Related fix proposed to branch: stable/pike
Review: https://review.openstack.org/649386

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

Fix proposed to branch: stable/pike
Review: https://review.openstack.org/649387

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

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

commit e4c998e57390c15891131205f7443fee98dde4ee
Author: Matt Riedemann <email address hidden>
Date: Mon Mar 25 11:27:57 2019 -0400

    Do not persist RequestSpec.ignore_hosts

    Change Ic3968721d257a167f3f946e5387cd227a7eeec6c in Newton
    started setting the RequestSpec.ignore_hosts field to the
    source instance.host during resize/cold migrate if
    allow_resize_to_same_host=False in config, which it is by
    default.

    Change I8abdf58a6537dd5e15a012ea37a7b48abd726579 also in
    Newton persists changes to the RequestSpec in conductor
    in order to save the RequestSpec.flavor for the new flavor.
    This inadvertently persists the ignore_hosts field as well.

    Later if you try to evacuate or unshelve the server it will ignore
    the original source host because of the persisted ignore_hosts
    value. This is obviously a problem in a small deployment with only
    a few compute nodes (like an edge deployment). As a result, an
    evacuation can fail if the only available host is the one being
    ignored.

    This change does two things:

    1. In order to deal with existing corrupted RequestSpecs in the DB,
       this change simply makes conductor overwrite RequestSpec.ignore_hosts
       rather than append during evacuate before calling the scheduler so
       the current instance host (which is down) is filtered out.

       This evacuate code dealing with ignore_hosts goes back to Mitaka:

         I7fe694175bb47f53d281bd62ac200f1c8416682b

       The test_rebuild_instance_with_request_spec unit test is updated
       and renamed to actually be doing an evacuate which is what it was
       intended for, i.e. the host would not change during rebuild.

    2. This change makes the RequestSpec no longer persist the ignore_hosts
       field like several other per-operation fields in the RequestSpec.
       The only operations that use ignore_hosts are resize (if
       allow_resize_to_same_host=False), evacuate and live migration, and
       the field gets reset in each case to ignore the source instance.host.

    The related functional recreate test is also updated to show the
    bug is fixed. Note that as part of that, the confirm_migration method
    in the fake virt driver needed to be implemented otherwise trying to
    evacuate back to the source host fails with an InstanceExists error since
    the confirmResize operation did not remove the guest from the source host.

    Change-Id: I3f488be6f3c399f23ccf2b9ee0d76cd000da0e3e
    Closes-Bug: #1669054

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

Related fix proposed to branch: stable/ocata
Review: https://review.openstack.org/649419

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

Fix proposed to branch: stable/ocata
Review: https://review.openstack.org/649420

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

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

commit 20c1414945db633ed00c1f19f1f0d163028454d9
Author: Matt Riedemann <email address hidden>
Date: Sat Mar 23 12:01:42 2019 -0400

    Add functional regression test for bug 1669054

    Change Ic3968721d257a167f3f946e5387cd227a7eeec6c in Newton
    started setting the RequestSpec.ignore_hosts field to the
    source instance.host during resize/cold migrate if
    allow_resize_to_same_host=False in config, which it is by
    default.

    Change I8abdf58a6537dd5e15a012ea37a7b48abd726579 also in
    Newton persists changes to the RequestSpec in conductor
    in order to save the RequestSpec.flavor for the new flavor.
    This inadvertently persists the ignore_hosts field as well.

    Later if you try to evacuate or unshelve the server it will ignore
    the original source host because of the persisted ignore_hosts value.
    This is obviously a problem in a small deployment with only a few
    compute nodes (like an edge deployment). As a result, an evacuation
    can fail if the only available host is the one being ignored.

    This adds a functional regression recreate test for the bug.

    Change-Id: I6ce2d6b1baf47796f867aede1acf292ec9739d6d
    Related-Bug: #1669054
    (cherry picked from commit 556cf103b22ab6bebecc9d824d6f918cda38fe3e)

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/649320
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=76dfb9d0b6cee1bbb553d3ec11139ca99a6f9474
Submitter: Zuul
Branch: stable/stein

commit 76dfb9d0b6cee1bbb553d3ec11139ca99a6f9474
Author: Matt Riedemann <email address hidden>
Date: Mon Mar 25 11:27:57 2019 -0400

    Do not persist RequestSpec.ignore_hosts

    Change Ic3968721d257a167f3f946e5387cd227a7eeec6c in Newton
    started setting the RequestSpec.ignore_hosts field to the
    source instance.host during resize/cold migrate if
    allow_resize_to_same_host=False in config, which it is by
    default.

    Change I8abdf58a6537dd5e15a012ea37a7b48abd726579 also in
    Newton persists changes to the RequestSpec in conductor
    in order to save the RequestSpec.flavor for the new flavor.
    This inadvertently persists the ignore_hosts field as well.

    Later if you try to evacuate or unshelve the server it will ignore
    the original source host because of the persisted ignore_hosts
    value. This is obviously a problem in a small deployment with only
    a few compute nodes (like an edge deployment). As a result, an
    evacuation can fail if the only available host is the one being
    ignored.

    This change does two things:

    1. In order to deal with existing corrupted RequestSpecs in the DB,
       this change simply makes conductor overwrite RequestSpec.ignore_hosts
       rather than append during evacuate before calling the scheduler so
       the current instance host (which is down) is filtered out.

       This evacuate code dealing with ignore_hosts goes back to Mitaka:

         I7fe694175bb47f53d281bd62ac200f1c8416682b

       The test_rebuild_instance_with_request_spec unit test is updated
       and renamed to actually be doing an evacuate which is what it was
       intended for, i.e. the host would not change during rebuild.

    2. This change makes the RequestSpec no longer persist the ignore_hosts
       field like several other per-operation fields in the RequestSpec.
       The only operations that use ignore_hosts are resize (if
       allow_resize_to_same_host=False), evacuate and live migration, and
       the field gets reset in each case to ignore the source instance.host.

    The related functional recreate test is also updated to show the
    bug is fixed. Note that as part of that, the confirm_migration method
    in the fake virt driver needed to be implemented otherwise trying to
    evacuate back to the source host fails with an InstanceExists error since
    the confirmResize operation did not remove the guest from the source host.

    Change-Id: I3f488be6f3c399f23ccf2b9ee0d76cd000da0e3e
    Closes-Bug: #1669054
    (cherry picked from commit e4c998e57390c15891131205f7443fee98dde4ee)

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

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

commit 77164128bf5eef53b49547658be2ef902c020207
Author: Matt Riedemann <email address hidden>
Date: Sat Mar 23 12:01:42 2019 -0400

    Add functional regression test for bug 1669054

    Change Ic3968721d257a167f3f946e5387cd227a7eeec6c in Newton
    started setting the RequestSpec.ignore_hosts field to the
    source instance.host during resize/cold migrate if
    allow_resize_to_same_host=False in config, which it is by
    default.

    Change I8abdf58a6537dd5e15a012ea37a7b48abd726579 also in
    Newton persists changes to the RequestSpec in conductor
    in order to save the RequestSpec.flavor for the new flavor.
    This inadvertently persists the ignore_hosts field as well.

    Later if you try to evacuate or unshelve the server it will ignore
    the original source host because of the persisted ignore_hosts value.
    This is obviously a problem in a small deployment with only a few
    compute nodes (like an edge deployment). As a result, an evacuation
    can fail if the only available host is the one being ignored.

    This adds a functional regression recreate test for the bug.

    Change-Id: I6ce2d6b1baf47796f867aede1acf292ec9739d6d
    Related-Bug: #1669054
    (cherry picked from commit 556cf103b22ab6bebecc9d824d6f918cda38fe3e)
    (cherry picked from commit 20c1414945db633ed00c1f19f1f0d163028454d9)

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

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

commit 31c08d0c7dc73bb2eefc69fa0f014b6478f3d149
Author: Matt Riedemann <email address hidden>
Date: Mon Mar 25 11:27:57 2019 -0400

    Do not persist RequestSpec.ignore_hosts

    Change Ic3968721d257a167f3f946e5387cd227a7eeec6c in Newton
    started setting the RequestSpec.ignore_hosts field to the
    source instance.host during resize/cold migrate if
    allow_resize_to_same_host=False in config, which it is by
    default.

    Change I8abdf58a6537dd5e15a012ea37a7b48abd726579 also in
    Newton persists changes to the RequestSpec in conductor
    in order to save the RequestSpec.flavor for the new flavor.
    This inadvertently persists the ignore_hosts field as well.

    Later if you try to evacuate or unshelve the server it will ignore
    the original source host because of the persisted ignore_hosts
    value. This is obviously a problem in a small deployment with only
    a few compute nodes (like an edge deployment). As a result, an
    evacuation can fail if the only available host is the one being
    ignored.

    This change does two things:

    1. In order to deal with existing corrupted RequestSpecs in the DB,
       this change simply makes conductor overwrite RequestSpec.ignore_hosts
       rather than append during evacuate before calling the scheduler so
       the current instance host (which is down) is filtered out.

       This evacuate code dealing with ignore_hosts goes back to Mitaka:

         I7fe694175bb47f53d281bd62ac200f1c8416682b

       The test_rebuild_instance_with_request_spec unit test is updated
       and renamed to actually be doing an evacuate which is what it was
       intended for, i.e. the host would not change during rebuild.

    2. This change makes the RequestSpec no longer persist the ignore_hosts
       field like several other per-operation fields in the RequestSpec.
       The only operations that use ignore_hosts are resize (if
       allow_resize_to_same_host=False), evacuate and live migration, and
       the field gets reset in each case to ignore the source instance.host.

    The related functional recreate test is also updated to show the
    bug is fixed. Note that as part of that, the confirm_migration method
    in the fake virt driver needed to be implemented otherwise trying to
    evacuate back to the source host fails with an InstanceExists error since
    the confirmResize operation did not remove the guest from the source host.

    Conflicts:
          nova/objects/request_spec.py
          nova/tests/unit/objects/test_request_spec.py

    NOTE(mriedem): The conflict is due to not having change
    I53e5debcffd6de2b3a2ff838e7f5da33fa1a82b8 in Rocky which added
    the requested_resources field to the RequestSpec object.

    Change-Id: I3f488be6f3c399f23ccf2b9ee0d76cd000da0e3e
    Closes-Bug: #1669054
    (cherry picked from commit e4c998e57390c15891131205f7443fee98dde4ee)
    (cherry picked from commit 76dfb9d0b6cee1bbb553...

Read more...

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

Reviewed: https://review.openstack.org/649362
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=9fd4082d7c076146ec314b86e0e4772d0a021712
Submitter: Zuul
Branch: stable/queens

commit 9fd4082d7c076146ec314b86e0e4772d0a021712
Author: Matt Riedemann <email address hidden>
Date: Sat Mar 23 12:01:42 2019 -0400

    Add functional regression test for bug 1669054

    Change Ic3968721d257a167f3f946e5387cd227a7eeec6c in Newton
    started setting the RequestSpec.ignore_hosts field to the
    source instance.host during resize/cold migrate if
    allow_resize_to_same_host=False in config, which it is by
    default.

    Change I8abdf58a6537dd5e15a012ea37a7b48abd726579 also in
    Newton persists changes to the RequestSpec in conductor
    in order to save the RequestSpec.flavor for the new flavor.
    This inadvertently persists the ignore_hosts field as well.

    Later if you try to evacuate or unshelve the server it will ignore
    the original source host because of the persisted ignore_hosts value.
    This is obviously a problem in a small deployment with only a few
    compute nodes (like an edge deployment). As a result, an evacuation
    can fail if the only available host is the one being ignored.

    This adds a functional regression recreate test for the bug.

    NOTE(mriedem): This backport differs slightly in that the test setup
    calls set_stub_network_methods because change
    I1dbccc2be6ba79bf267edac9208c80e187e6256a is not in Queens.

    Change-Id: I6ce2d6b1baf47796f867aede1acf292ec9739d6d
    Related-Bug: #1669054
    (cherry picked from commit 556cf103b22ab6bebecc9d824d6f918cda38fe3e)
    (cherry picked from commit 20c1414945db633ed00c1f19f1f0d163028454d9)
    (cherry picked from commit 77164128bf5eef53b49547658be2ef902c020207)

tags: added: in-stable-queens
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (stable/queens)
Download full text (3.5 KiB)

Reviewed: https://review.openstack.org/649363
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=8f1773a7af273e2739843a804fb4fe718c0a242d
Submitter: Zuul
Branch: stable/queens

commit 8f1773a7af273e2739843a804fb4fe718c0a242d
Author: Matt Riedemann <email address hidden>
Date: Mon Mar 25 11:27:57 2019 -0400

    Do not persist RequestSpec.ignore_hosts

    Change Ic3968721d257a167f3f946e5387cd227a7eeec6c in Newton
    started setting the RequestSpec.ignore_hosts field to the
    source instance.host during resize/cold migrate if
    allow_resize_to_same_host=False in config, which it is by
    default.

    Change I8abdf58a6537dd5e15a012ea37a7b48abd726579 also in
    Newton persists changes to the RequestSpec in conductor
    in order to save the RequestSpec.flavor for the new flavor.
    This inadvertently persists the ignore_hosts field as well.

    Later if you try to evacuate or unshelve the server it will ignore
    the original source host because of the persisted ignore_hosts
    value. This is obviously a problem in a small deployment with only
    a few compute nodes (like an edge deployment). As a result, an
    evacuation can fail if the only available host is the one being
    ignored.

    This change does two things:

    1. In order to deal with existing corrupted RequestSpecs in the DB,
       this change simply makes conductor overwrite RequestSpec.ignore_hosts
       rather than append during evacuate before calling the scheduler so
       the current instance host (which is down) is filtered out.

       This evacuate code dealing with ignore_hosts goes back to Mitaka:

         I7fe694175bb47f53d281bd62ac200f1c8416682b

       The test_rebuild_instance_with_request_spec unit test is updated
       and renamed to actually be doing an evacuate which is what it was
       intended for, i.e. the host would not change during rebuild.

    2. This change makes the RequestSpec no longer persist the ignore_hosts
       field like several other per-operation fields in the RequestSpec.
       The only operations that use ignore_hosts are resize (if
       allow_resize_to_same_host=False), evacuate and live migration, and
       the field gets reset in each case to ignore the source instance.host.

    The related functional recreate test is also updated to show the
    bug is fixed. Note that as part of that, the confirm_migration method
    in the fake virt driver needed to be implemented otherwise trying to
    evacuate back to the source host fails with an InstanceExists error since
    the confirmResize operation did not remove the guest from the source host.

    Conflicts:
          nova/objects/request_spec.py
          nova/tests/unit/conductor/test_conductor.py
          nova/tests/unit/objects/test_request_spec.py

    NOTE(mriedem): The (test_)request_spec.py conflicts are due to not
    having change I2131558f0edfe603ee1e8d8bae66a3caf5182a58 in Queens.
    test_save_does_not_persist_requested_fields from that change is
    ported and modified here to just deal with the ignore_hosts field.
    The test_conductor.py conflict is due to not having change
...

Read more...

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

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

commit fcd718dcdd3cb7ba46f16ff97ecee068d55c8801
Author: Matt Riedemann <email address hidden>
Date: Sat Mar 23 12:01:42 2019 -0400

    Add functional regression test for bug 1669054

    Change Ic3968721d257a167f3f946e5387cd227a7eeec6c in Newton
    started setting the RequestSpec.ignore_hosts field to the
    source instance.host during resize/cold migrate if
    allow_resize_to_same_host=False in config, which it is by
    default.

    Change I8abdf58a6537dd5e15a012ea37a7b48abd726579 also in
    Newton persists changes to the RequestSpec in conductor
    in order to save the RequestSpec.flavor for the new flavor.
    This inadvertently persists the ignore_hosts field as well.

    Later if you try to evacuate or unshelve the server it will ignore
    the original source host because of the persisted ignore_hosts value.
    This is obviously a problem in a small deployment with only a few
    compute nodes (like an edge deployment). As a result, an evacuation
    can fail if the only available host is the one being ignored.

    This adds a functional regression recreate test for the bug.

    NOTE(mriedem): This backport differs slightly in that 204 is added
    to the default check_response_status POST call which was added in
    Queens change I6a51542216340299d250576714e303f74e0ceb0f.

    Change-Id: I6ce2d6b1baf47796f867aede1acf292ec9739d6d
    Related-Bug: #1669054
    (cherry picked from commit 556cf103b22ab6bebecc9d824d6f918cda38fe3e)
    (cherry picked from commit 20c1414945db633ed00c1f19f1f0d163028454d9)
    (cherry picked from commit 77164128bf5eef53b49547658be2ef902c020207)
    (cherry picked from commit 9fd4082d7c076146ec314b86e0e4772d0a021712)

tags: added: in-stable-pike
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (stable/pike)
Download full text (3.6 KiB)

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

commit efab235f88ac040ef9654c782236b83ffcb473e3
Author: Matt Riedemann <email address hidden>
Date: Mon Mar 25 11:27:57 2019 -0400

    Do not persist RequestSpec.ignore_hosts

    Change Ic3968721d257a167f3f946e5387cd227a7eeec6c in Newton
    started setting the RequestSpec.ignore_hosts field to the
    source instance.host during resize/cold migrate if
    allow_resize_to_same_host=False in config, which it is by
    default.

    Change I8abdf58a6537dd5e15a012ea37a7b48abd726579 also in
    Newton persists changes to the RequestSpec in conductor
    in order to save the RequestSpec.flavor for the new flavor.
    This inadvertently persists the ignore_hosts field as well.

    Later if you try to evacuate or unshelve the server it will ignore
    the original source host because of the persisted ignore_hosts
    value. This is obviously a problem in a small deployment with only
    a few compute nodes (like an edge deployment). As a result, an
    evacuation can fail if the only available host is the one being
    ignored.

    This change does two things:

    1. In order to deal with existing corrupted RequestSpecs in the DB,
       this change simply makes conductor overwrite RequestSpec.ignore_hosts
       rather than append during evacuate before calling the scheduler so
       the current instance host (which is down) is filtered out.

       This evacuate code dealing with ignore_hosts goes back to Mitaka:

         I7fe694175bb47f53d281bd62ac200f1c8416682b

       The test_rebuild_instance_with_request_spec unit test is updated
       and renamed to actually be doing an evacuate which is what it was
       intended for, i.e. the host would not change during rebuild.

    2. This change makes the RequestSpec no longer persist the ignore_hosts
       field like several other per-operation fields in the RequestSpec.
       The only operations that use ignore_hosts are resize (if
       allow_resize_to_same_host=False), evacuate and live migration, and
       the field gets reset in each case to ignore the source instance.host.

    The related functional recreate test is also updated to show the
    bug is fixed. Note that as part of that, the confirm_migration method
    in the fake virt driver needed to be implemented otherwise trying to
    evacuate back to the source host fails with an InstanceExists error since
    the confirmResize operation did not remove the guest from the source host.

    Conflicts:
          nova/objects/request_spec.py
          nova/tests/unit/conductor/test_conductor.py
          nova/tests/unit/objects/test_request_spec.py

    NOTE(mriedem): The (test_)request_spec.py conflicts are due to not
    having change I2a78f0754c63381c57e7e1c610d0938b6df0f537 in Pike.
    The test_conductor.py conflict is due to not having change
    I70b11dd489d222be3d70733355bfe7966df556aa in Pike.

    NOTE(mriedem): The functional test is adjusted slightly to pass
    a string ra...

Read more...

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

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

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

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

Reviewed: https://review.opendev.org/649419
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=730e0e99d274a60f73e0892e9fc41dfb132d9a99
Submitter: Zuul
Branch: stable/ocata

commit 730e0e99d274a60f73e0892e9fc41dfb132d9a99
Author: Matt Riedemann <email address hidden>
Date: Sat Mar 23 12:01:42 2019 -0400

    Add functional regression test for bug 1669054

    Change Ic3968721d257a167f3f946e5387cd227a7eeec6c in Newton
    started setting the RequestSpec.ignore_hosts field to the
    source instance.host during resize/cold migrate if
    allow_resize_to_same_host=False in config, which it is by
    default.

    Change I8abdf58a6537dd5e15a012ea37a7b48abd726579 also in
    Newton persists changes to the RequestSpec in conductor
    in order to save the RequestSpec.flavor for the new flavor.
    This inadvertently persists the ignore_hosts field as well.

    Later if you try to evacuate or unshelve the server it will ignore
    the original source host because of the persisted ignore_hosts value.
    This is obviously a problem in a small deployment with only a few
    compute nodes (like an edge deployment). As a result, an evacuation
    can fail if the only available host is the one being ignored.

    This adds a functional regression recreate test for the bug.

    Conflicts:
          nova/tests/functional/api/client.py

    NOTE(mriedem): The conflict is due to not having change
    I71e9d8dae55653ad3ee70f708a6d92c98ed20c1c in Ocata which
    added the 201 value to the check_response_status default.

    NOTE(mriedem): This backport differs slightly in that
    (a) REQUIRES_LOCKING is removed and NeutronFixture is
    used explicitly since change I9b35ed7497db8bd1eb74f4bb89631aabbcfeec0d
    is not in Ocata and (b) kwargs are passed through post_server_action
    because change If7b02bcd8d77e94c7fb42b721792c1391bc0e3b7 is not in
    Ocata.

    Change-Id: I6ce2d6b1baf47796f867aede1acf292ec9739d6d
    Related-Bug: #1669054
    (cherry picked from commit 556cf103b22ab6bebecc9d824d6f918cda38fe3e)
    (cherry picked from commit 20c1414945db633ed00c1f19f1f0d163028454d9)
    (cherry picked from commit 77164128bf5eef53b49547658be2ef902c020207)
    (cherry picked from commit 9fd4082d7c076146ec314b86e0e4772d0a021712)
    (cherry picked from commit fcd718dcdd3cb7ba46f16ff97ecee068d55c8801)

tags: added: in-stable-ocata
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (stable/ocata)
Download full text (3.2 KiB)

Reviewed: https://review.opendev.org/649420
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=4b4484f78d967ff6de5c61d0ac66ef62d0a89a89
Submitter: Zuul
Branch: stable/ocata

commit 4b4484f78d967ff6de5c61d0ac66ef62d0a89a89
Author: Matt Riedemann <email address hidden>
Date: Mon Mar 25 11:27:57 2019 -0400

    Do not persist RequestSpec.ignore_hosts

    Change Ic3968721d257a167f3f946e5387cd227a7eeec6c in Newton
    started setting the RequestSpec.ignore_hosts field to the
    source instance.host during resize/cold migrate if
    allow_resize_to_same_host=False in config, which it is by
    default.

    Change I8abdf58a6537dd5e15a012ea37a7b48abd726579 also in
    Newton persists changes to the RequestSpec in conductor
    in order to save the RequestSpec.flavor for the new flavor.
    This inadvertently persists the ignore_hosts field as well.

    Later if you try to evacuate or unshelve the server it will ignore
    the original source host because of the persisted ignore_hosts
    value. This is obviously a problem in a small deployment with only
    a few compute nodes (like an edge deployment). As a result, an
    evacuation can fail if the only available host is the one being
    ignored.

    This change does two things:

    1. In order to deal with existing corrupted RequestSpecs in the DB,
       this change simply makes conductor overwrite RequestSpec.ignore_hosts
       rather than append during evacuate before calling the scheduler so
       the current instance host (which is down) is filtered out.

       This evacuate code dealing with ignore_hosts goes back to Mitaka:

         I7fe694175bb47f53d281bd62ac200f1c8416682b

       The test_rebuild_instance_with_request_spec unit test is updated
       and renamed to actually be doing an evacuate which is what it was
       intended for, i.e. the host would not change during rebuild.

    2. This change makes the RequestSpec no longer persist the ignore_hosts
       field like several other per-operation fields in the RequestSpec.
       The only operations that use ignore_hosts are resize (if
       allow_resize_to_same_host=False), evacuate and live migration, and
       the field gets reset in each case to ignore the source instance.host.

    The related functional recreate test is also updated to show the
    bug is fixed. Note that as part of that, the confirm_migration method
    in the fake virt driver needed to be implemented otherwise trying to
    evacuate back to the source host fails with an InstanceExists error since
    the confirmResize operation did not remove the guest from the source host.

    Conflicts:
          nova/tests/unit/conductor/test_conductor.py

    NOTE(mriedem): The conflict is due to not having change
    I434af8e4ad991ac114dd67d66797a562d16bafe2 in Ocata.

    Change-Id: I3f488be6f3c399f23ccf2b9ee0d76cd000da0e3e
    Closes-Bug: #1669054
    (cherry picked from commit e4c998e57390c15891131205f7443fee98dde4ee)
    (cherry picked from commit 76dfb9d0b6cee1bbb553d3ec11139ca99a6f9474)
    (cherry picked from commit 31c08d0c7dc73bb2eefc69fa0f014b6478f3d149)
    (cherry picked ...

Read more...

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

This issue was fixed in the openstack/nova ocata-eol 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.