Resize STOPPED instance on same host is in ACTIVE state after resize

Bug #1177811 reported by Matt Riedemann
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
Matt Riedemann

Bug Description

Testing on stable/grizzly, if you have an instance in STOPPED state and then resize it to the same host, the resized instance is in ACTIVE state even though it's still powered off in the hypervisor.

The resize/migrate operations allow starting from STOPPED or ACTIVE state:

https://github.com/openstack/nova/blob/stable/grizzly/nova/compute/api.py#L1951

However, when the resize is confirmed, it updates the instance to ACTIVE state (even though it was originally in STOPPED state):

https://github.com/openstack/nova/blob/stable/grizzly/nova/compute/api.py#L1862

Eventually the power states are synched between the database and the hypervisor and the instance is set back to STOPPED state:

https://github.com/openstack/nova/blob/stable/grizzly/nova/compute/manager.py#L3680

But the code should be keeping track of the original state of the instance before the resize and make sure it's in that state once the operation is verified.

Tiago Mello (timello)
Changed in nova:
assignee: nobody → Tiago Rodrigues de Mello (timello)
Dan Smith (danms)
Changed in nova:
importance: Undecided → Medium
status: New → Triaged
Tiago Mello (timello)
Changed in nova:
assignee: Tiago Rodrigues de Mello (timello) → nobody
Revision history for this message
Joe Cropper (jwcroppe) wrote : AUTO: Joseph W Cropper is out of the office. (returning 05/13/2013)

I am out of the office until 05/13/2013.

I am out of the office and will respond to your message as soon as I
return.

For PowerVC scheduler questions, please contact Andrew L Hanson/Rochester.

Note: This is an automated response to your message "[Bug 1177811] Re:
Resize STOPPED instance on same host is in ACTIVE state after resize"
sent on 05/10/2013 9:40:02 AM.

This is the only notification you will receive while this person is away.

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

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

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

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

Reviewed: https://review.openstack.org/30501
Committed: http://github.com/openstack/nova/commit/1690a1ae8f2fdddebfb8ae50a8492aedf466b8e3
Submitter: Jenkins
Branch: master

commit 1690a1ae8f2fdddebfb8ae50a8492aedf466b8e3
Author: Matt Riedemann <email address hidden>
Date: Wed May 29 21:12:04 2013 -0700

    Add power_on flag to virt driver finish/revert migration methods

    This patch adds a boolean power_on flag to the virt driver
    finish_migration and finish_revert_migration methods to indicate whether
    or not to power on the instance as part of the resize/migrate operation.
    The default is to power on the instance.

    Related to bug 1177811

    Change-Id: I76c7d6912eda2c333554855a8956bd0fbb1e8b6d

Changed in nova:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Reviewed: https://review.openstack.org/29005
Committed: http://github.com/openstack/nova/commit/32372a62a89614d4ddc7f2bdc96f41c4d49bd131
Submitter: Jenkins
Branch: master

commit 32372a62a89614d4ddc7f2bdc96f41c4d49bd131
Author: Matt Riedemann <email address hidden>
Date: Mon May 13 10:06:11 2013 -0700

    Set resized instance back to original vm_state

    You can resize an instance when it's in the ACTIVE or STOPPED state but
    the code currently always finishes the resize (either confirmed or
    rejected) by putting the instance into ACTIVE state. This change
    saves the original vm_state and uses it to restore the state on the
    instance after the resize is confirmed or rejected.

    With this change, the resize flow will never automatically power on an
    instance that is originally shutoff. The user, however, can manually
    power on the resized instance to test it before confirming or rejecting
    the resize. If the user powered on the instance and confirmed the
    resize, then this change will leave the instance active. If the user
    powered on the instance and then rejected the resize, this change will
    stop the instance when it finishes the revert operation.

    Related to bug 1177811

    Change-Id: I19fa61d467edd5a7572040d084824972569ef65a

Thierry Carrez (ttx)
Changed in nova:
milestone: none → havana-2
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: havana-2 → 2013.2
Alan Pevec (apevec)
tags: removed: grizzly-backport-potential
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.