The value of "num_instances" is not correct , which is in "stats" field of "compute_nodes" table in "nova" database.

Bug #1381303 reported by Charlotte Han
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Invalid
Undecided
Pranali Deore
Icehouse
Fix Released
High
Unassigned

Bug Description

There is one instances on a host named "opencos114-93".

Looking at "nova" database's "compute_nodes" table, the value of "running_vms" is 1, the value of "num_instances" in "stats" field is 1 too. The database status log is http://paste.openstack.org/show/121405/

Then delete the last instance, there are none instnaces running on "opencos114-93" host.

Looking at "nova" database's "compute_nodes" table, the value of "running_vms" is 0, and the value of "num_instances" in "stats" field is still 1. The database status log is http://paste.openstack.org/show/121406/

I think it's a bug, the value of "num_instances" should be 0, it should be equal to "running_vms".

Charlotte Han (hanrong)
summary: - the value of num_instances in field "stats" which in compute_nodes talbe
+ the value of "num_instances" is not correct , which is in "stats" field
+ of "compute_nodes" table in "nova" database.
summary: - the value of "num_instances" is not correct , which is in "stats" field
+ The value of "num_instances" is not correct , which is in "stats" field
of "compute_nodes" table in "nova" database.
Charlotte Han (hanrong)
description: updated
Revision history for this message
Charlotte Han (hanrong) wrote :

The version of nova is icehouse 2014.1.2.

Revision history for this message
Joe Gordon (jogo) wrote :

Can you attach the logs via paste.openstack.org or something like it, as its hard to read the logs as is.

Revision history for this message
Joe Gordon (jogo) wrote :

Once this is done, please move this out of incomplete and back into new.

Changed in nova:
status: New → Incomplete
Charlotte Han (hanrong)
description: updated
Changed in nova:
status: Incomplete → New
Charlotte Han (hanrong)
description: updated
Tracy Jones (tjones-i)
tags: added: db
Revision history for this message
Numan Siddique (numansiddique) wrote :

I tested in latest nova master and I do not see this issue.

Charlotte Han (hanrong)
tags: added: in-stable-icehouse
Revision history for this message
Charlotte Han (hanrong) wrote :

The issue occurs in latest nova icehouse.

Changed in nova:
assignee: nobody → Pranali Deore (pranali-deore)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (stable/icehouse)

Fix proposed to branch: stable/icehouse
Review: https://review.openstack.org/136495

Sean Dague (sdague)
Changed in nova:
status: New → Invalid
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (stable/icehouse)

Reviewed: https://review.openstack.org/136495
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=33be7d724b2d6125cd9a8144fa213fba0d5d1edb
Submitter: Jenkins
Branch: stable/icehouse

commit 33be7d724b2d6125cd9a8144fa213fba0d5d1edb
Author: pranali <email address hidden>
Date: Fri Nov 21 04:55:44 2014 -0800

    Update "num_instance" during delete instance

    The value of "num_instance" is not updated after deleting the
    instance because update_usage() method of resource tracker where
    "num_instance" gets updated is not called after deleting instance.

    Called update_usage() method of resource tracker after instance
    is deleted from that host.

    In this patch, I have copied required changes from commit
    174b784159183450335cb5572be5b8b892a80a4b and
    3085aa183d9602c3725ca699b7f1a92a4a4a5226.

    Change-Id: I6a29c6b239af0d1675bc028e1d0a07c5335e1d87
    Closes-Bug:1381303

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.