← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1669054] Re: RequestSpec.ignore_hosts from resize is reused in subsequent evacuate

 

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 <mriedem.os@xxxxxxxxx>
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

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1669054

Title:
  RequestSpec.ignore_hosts from resize is reused in subsequent evacuate

Status in OpenStack Compute (nova):
  Fix Released
Status in OpenStack Compute (nova) ocata series:
  In Progress
Status in OpenStack Compute (nova) pike series:
  In Progress
Status in OpenStack Compute (nova) queens series:
  In Progress
Status in OpenStack Compute (nova) rocky series:
  In Progress
Status in OpenStack Compute (nova) stein series:
  In Progress

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.

To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1669054/+subscriptions


References