SHUTOFF instance resize status does not match ACTIVE instance resize status

Bug #1247106 reported by ChangBo Guo(gcb)
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
ChangBo Guo(gcb)

Bug Description

OpenStack allows an instance to be resized in either a SHUTOFF or ACTIVE state. However, the resize behavior between the states is not consistent. In particular, resize of an ACTIVE instance will result in the instance's status to be mapped to RESIZE while a resize task is in progress. The same is not true of SHUTOFF

Before resize request:
| f13dd4a2-eb8f-4a8b-91a1-dafed08049ad | rtheis-migrate-test-1 | SHUTOFF | None | Shutdown | VLAN164=10.164.0.14 |
| 813e5a44-41ba-4ee7-8b7b-442d3fc017a7 | rtheis-sce-test-1 | ACTIVE | None | Running | VLAN164=10.164.0.16 |

During resize request:
| f13dd4a2-eb8f-4a8b-91a1-dafed08049ad | rtheis-migrate-test-1 | SHUTOFF | resize_finish | Shutdown | VLAN164=10.164.0.14 |
| 813e5a44-41ba-4ee7-8b7b-442d3fc017a7 | rtheis-sce-test-1 | RESIZE | resize_prep | Running | VLAN164=10.164.0.16 |

After resize and confirmation:
| f13dd4a2-eb8f-4a8b-91a1-dafed08049ad | rtheis-migrate-test-1 | SHUTOFF | None | Shutdown | VLAN164=10.164.0.14 |
| 813e5a44-41ba-4ee7-8b7b-442d3fc017a7 | rtheis-sce-test-1 | ACTIVE | None | Running | VLAN164=10.164.0.16 |

Tags: compute
Revision history for this message
ChangBo Guo(gcb) (glongwave) wrote :

in https://github.com/openstack/nova/blob/master/nova/api/openstack/common.py#L78

_STATE_MAP = {
    vm_states.ACTIVE: {
        'default': 'ACTIVE',
        task_states.REBOOTING: 'REBOOT',
        task_states.REBOOTING_HARD: 'HARD_REBOOT',
        task_states.UPDATING_PASSWORD: 'PASSWORD',
        task_states.REBUILDING: 'REBUILD',
        task_states.REBUILD_BLOCK_DEVICE_MAPPING: 'REBUILD',
        task_states.REBUILD_SPAWNING: 'REBUILD',
        task_states.MIGRATING: 'MIGRATING',
        task_states.RESIZE_PREP: 'RESIZE',
        task_states.RESIZE_MIGRATING: 'RESIZE',
        task_states.RESIZE_MIGRATED: 'RESIZE',
        task_states.RESIZE_FINISH: 'RESIZE',
    },
    vm_states.BUILDING: {
        'default': 'BUILD',
    },
    vm_states.STOPPED: {
        'default': 'SHUTOFF',
    },

when resize a instance , when execute "instance.task_state = task_states.RESIZE_PREP" in https://github.com/openstack/nova/blob/master/nova/compute/api.py#L2338
will search value for key "task_states.RESIZE_PREP", if the instance is ACTIVE, it can find the value is 'RESIZE', if the instance is SHUTOFF, it can not find the value and will use default value.

Revision history for this message
Matt Riedemann (mriedem) wrote :
Changed in nova:
status: New → In Progress
assignee: nobody → ChangBo Guo (guochbo)
importance: Undecided → Medium
tags: added: compute
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/54925
Committed: http://github.com/openstack/nova/commit/6e8a094c48dc77fdfe68c72c7a09b7819710d4b6
Submitter: Jenkins
Branch: master

commit 6e8a094c48dc77fdfe68c72c7a09b7819710d4b6
Author: chenxiao <email address hidden>
Date: Mon Nov 4 15:02:12 2013 +0800

    Add status mapping for shutoff instance when resize

    Current code always map instance's status into Shutoff when
    getting status of resizing instance with power_state shutoff.
    This isn't consistent with active instance, we should add
    status mapping for power-off resizing instance.

    Closes-Bug: #1247106
    Co-Authored-By: chenxiao <email address hidden>
    Change-Id: Id4bff71b2c46ec9dccea6d8ac36eba273e48ea5d

Changed in nova:
status: In Progress → Fix Committed
Changed in nova:
milestone: none → icehouse-1
Thierry Carrez (ttx)
Changed in nova:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: icehouse-1 → 2014.1
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.