vm_state and task_state were not updated after deleting vm

Bug #1212496 reported by Zhikun Liu
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Undecided
Sudarshan Acharya

Bug Description

Before deleting:
$ nova list
+--------------------------------------+------+--------+------------+-------------+------------------+
| ID | Name | Status | Task State | Power State | Networks |
+--------------------------------------+------+--------+------------+-------------+------------------+
| bbb92836-0e73-49b0-99cd-268b3bad05ea | vm | ACTIVE | None | Running | private=10.0.0.3 |
+--------------------------------------+------+--------+------------+-------------+------------------+

mysql> select id,vm_state,task_state,deleted from instances;
+----+----------+------------+---------+
| id | vm_state | task_state | deleted |
+----+----------+------------+---------+
| 1 | active | NULL | 0 |
+----+----------+------------+---------+
1 row in set (0.00 sec)

After deleting:
hacker@ubuntu-devstack:~/devstack$ nova delete vm
hacker@ubuntu-devstack:~/devstack$ nova list
+----+------+--------+------------+-------------+----------+
| ID | Name | Status | Task State | Power State | Networks |
+----+------+--------+------------+-------------+----------+
+----+------+--------+------------+-------------+----------+

mysql> select id,vm_state,task_state,deleted from instances;
+----+----------+------------+---------+
| id | vm_state | task_state | deleted |
+----+----------+------------+---------+
| 1 | active | deleting | 1 |
+----+----------+------------+---------+
1 row in set (0.00 sec)

vm_state should be 'deleted', task_state should be 'NULL'

Tags: compute
Matt Riedemann (mriedem)
tags: added: compute
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/42450

Changed in nova:
assignee: nobody → Sudarshan Acharya (sudarshan.acharya)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

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

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

Reviewed: https://review.openstack.org/42534
Committed: http://github.com/openstack/nova/commit/9378dbcf75bc110a31687ce4c44f399ecbc10691
Submitter: Jenkins
Branch: master

commit 9378dbcf75bc110a31687ce4c44f399ecbc10691
Author: Sudarshan Acharya <email address hidden>
Date: Sun Aug 18 20:45:32 2013 +0000

    vm_state and task_state not updated during instance delete

    This bug was recently introduced during conversion of the
    terminate_instance to the new object models.
    https://review.openstack.org/#/c/36363
    Fixed by calling the save method of the new model.
    Also updated tests to use primitive instance so it is
    converted to new object model by object_compat decorator
    in the compute manager.

    Related to: blueprint compute-api-objects
    Fixes: bug #1212496
    Change-Id: I4f4e45160008d3eb57f4f0935f13e22b6a561430

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