← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1768927] Re: Unable to hard reboot an instance that is pausing

 

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

commit 3437baedf646c7cd3da43440368edc194a880db8
Author: Matt Riedemann <mriedem.os@xxxxxxxxx>
Date:   Thu May 3 15:00:02 2018 -0400

    Fix being able to hard reboot a pausing instance
    
    The allowed task states for a hard reboot include 'pausing'
    but the instance.save(expected_task_states) doesn't include
    'pausing', so if you try to hard reboot a pausing instance
    it will fail with UnexpectedTaskStateError.
    
    This makes the expected_task_states passed to Instance.save
    use the same list of allowed task states that we use in the
    check_instance_state decorator, and re-writes the unit test
    to use an actual database to verify the Instance.save()
    behavior and task state check in the DB API.
    
    While we're at it, the API reference is updated to indicate
    the allowed states for each type of reboot.
    
    Change-Id: I5a21350e48a637e581d269fb567bb96c1899e174
    Closes-Bug: #1768927


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

Title:
  Unable to hard reboot an instance that is pausing

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

Bug description:
  If you look at the allowed task_states for hard reboot in the API
  here:

  https://github.com/openstack/nova/blob/644ac5ec37903b0a08891cc403c8b3b63fc2a91c/nova/compute/api.py#L2963

  it allows these values:

  https://github.com/openstack/nova/blob/644ac5ec37903b0a08891cc403c8b3b63fc2a91c/nova/compute/task_states.py#L120

  ALLOW_REBOOT = [None, REBOOTING, REBOOT_PENDING, REBOOT_STARTED, RESUMING,
                  REBOOTING_HARD, UNPAUSING, PAUSING, SUSPENDING]

  But when changing the task_state on the instance, if it's currently
  'pausing' it will fail because that's not one of the
  expected_task_states:

  https://github.com/openstack/nova/blob/644ac5ec37903b0a08891cc403c8b3b63fc2a91c/nova/compute/api.py#L2966

          expected_task_state = [None,
                                 task_states.REBOOTING,
                                 task_states.REBOOT_PENDING,
                                 task_states.REBOOT_STARTED,
                                 task_states.REBOOTING_HARD,
                                 task_states.RESUMING,
                                 task_states.UNPAUSING,
                                 task_states.SUSPENDING]
          instance.save(expected_task_state = expected_task_state)

  It looks like this is just a very old latent problem, see:
  https://review.openstack.org/#/c/127427/

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


References