nova sync_power_states broken when db is stopped, but VM is running

Bug #1226965 reported by hill
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
High
Russell Bryant

Bug Description

the Nova has the logic to synchronize the state of virtual machine with the record in database, when the state is stopped but
the virtual machine is in running state, it will try to stop the virtual machine with compute api call. But the compute api
call has the check that only allow to execute the call when VM in ACTIVE,RESCUED, ERROR state. So the sync logic is broken here.

option 1:
   allow to run stop API when VM in stopped state

option 2:
   add another method in API such as force_stop , and sync_power_states will use this api to stop the VM.

option 3:
    sync_power_states to call the rpcapi to stop the VM

Tags: compute
tags: added: compute
Changed in nova:
status: New → Confirmed
importance: Undecided → High
milestone: none → havana-rc1
Changed in nova:
assignee: nobody → Russell Bryant (russellb)
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/47487

Changed in nova:
status: Confirmed → In Progress
Revision history for this message
GuoHui Liu (guohliu) wrote :

Could you please give more detail about this issue, like what happened after you stop the vm, something must be happened to prevent the vm being stop.

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

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

commit 6dc290a88a3240b9f454d5140ab14d499d9ab1b2
Author: Russell Bryant <email address hidden>
Date: Thu Sep 19 17:34:38 2013 -0400

    Fix stopping instance in sync_power_states

    When an instance is marked as stopped in the DB but is actually running,
    the sync_power_states periodic task will try to stop it. It does this
    using the compute API. The compute API checks the vm state before
    proceeding. The STOPPED state is treated as invalid. This patch allows
    the caller to bypass the state check and makes use of that in this
    periodic task.

    Change-Id: I447b6dbd1da72ed33067659708e1755bf8c933d0
    Closes-bug: #1226965

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: havana-rc1 → 2013.2
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.