← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1819963] Re: Reverting a resize does not update the instance.availability_zone value to the source az

 

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

commit 40f6672f53794b563f4c7e27ede7b59a1d63c14a
Author: Matt Riedemann <mriedem.os@xxxxxxxxx>
Date:   Wed Mar 13 16:20:47 2019 -0400

    Update instance.availability_zone on revertResize
    
    When resizing a server that was not created in an explicit
    zone, the scheduler can pick a host in another zone and
    conductor will update the instance.availability_zone value
    for the new dest host zone.
    
    The problem is when reverting the resize, the server goes
    back to the original source host/zone but the
    instance.availability_zone value in the database is not
    updated which can lead to incorrect results when listing
    servers and filtering by zone.
    
    This fixes the bug by updating the instance.availability_zone
    value in the API (where we have access to the aggregates
    table in the API DB) before casting to nova-compute to
    complete the revert. As noted in the comment within, this
    is not fail-safe in case the revert fails before the
    instance.host is updated in finish_revert_resize, but we
    don't have a lot of great backportable options here that
    don't involve "up-calls" from the compute to the API DB.
    
    Change-Id: I8dc862b90d398b693b259abd3583616d07d8d206
    Closes-Bug: #1819963


** 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/1819963

Title:
  Reverting a resize does not update the instance.availability_zone
  value to the source az

Status in OpenStack Compute (nova):
  Fix Released
Status in OpenStack Compute (nova) pike series:
  Confirmed
Status in OpenStack Compute (nova) queens series:
  Confirmed
Status in OpenStack Compute (nova) rocky series:
  Confirmed

Bug description:
  With this change in pike: https://review.openstack.org/#/c/446053/ -
  when resizing a server the instance.availability_zone is changed to
  whatever zone the destination host is in.

  For a server that is created with an explicit AZ, the resize is
  restricted to the same AZ via the AvailabilityZoneFilter. For a server
  that is not created with an explicit AZ and
  https://docs.openstack.org/nova/latest/configuration/config.html#DEFAULT.default_schedule_zone
  is None (the default), the server is free to "move" between zones.

  The bug is that when a server is resized and moves from zone 1 to zone
  2, if the resize is reverted, nothing updates the
  instance.availability_zone value back to the original zone even though
  the server is on the original source host in the initial zone.

  Note that the API hides this a bit when showing the instance AZ:

  https://github.com/openstack/nova/blob/482f4fed654f384e8fb277c504a14a6407ba2e7b/nova/availability_zones.py#L179-L194

  If the instance.availability_zone value in the database does not match
  the cached zone that the instance.host is in, the API will return the
  zone for the host rather than the instance.availability_zone value.
  But the instance.availability_zone value in the database is still
  incorrect.

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


References