nova usage-list doesn't show all instance

Bug #1436643 reported by Eli Qiao
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Confirmed
Low
Nalini Varshney

Bug Description

nova usage-list (os-simple-tenant-usage) will query a period instance

it will return 2 kinds of instances:

    query = query.filter(or_(models.Instance.terminated_at == null(),
                             models.Instance.terminated_at > begin))

in my devstack environment, query from db I see there are some instance which

mysql> select count(*) from instances where launched_at is NULL;
+----------+
| count(*) |
+----------+
| 3 |
+----------+
1 row in set (0.00 sec)

mysql> select count(*) from instances ;
+----------+
| count(*) |
+----------+
| 22 |
+----------+

but usage-list doesn't show 22, it doesn't count the instance which launched_at is NULL
(I don't know why they are NULL , maybe live-migration failed)

Usage from 2015-02-26 to 2015-03-27:
+----------------------------------+---------+--------------+-----------+---------------+
| Tenant ID | Servers | RAM MB-Hours | CPU Hours | Disk GB-Hours |
+----------------------------------+---------+--------------+-----------+---------------+
| 0d028ada663f41cd869acc5cdb488ad6 | 19 | 229321.36 | 447.89 | 447.89 |
+----------------------------------+---------+--------------+-----------+---------------+

do we need to count launched_at instances ?

Eli Qiao (taget-9)
Changed in nova:
assignee: nobody → Eli Qiao (taget-9)
Changed in nova:
importance: Undecided → Low
Changed in nova:
status: New → Confirmed
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/168232

Changed in nova:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on nova (master)

Change abandoned by Eli Qiao (<email address hidden>) on branch: master
Review: https://review.openstack.org/168232
Reason: I will find a use case , for now, abandon this due to sean's comment

Changed in nova:
assignee: Eli Qiao (taget-9) → Abhishek Talwar (abhishek-talwar)
Changed in nova:
assignee: Abhishek Talwar (abhishek-talwar) → nobody
status: In Progress → Confirmed
Changed in nova:
assignee: nobody → Abhishek Talwar (abhishek-talwar)
status: Confirmed → In Progress
Revision history for this message
Markus Zoeller (markus_z) (mzoeller) wrote :

@Abhishek Talwar: Are you still working on this?

Changed in nova:
status: In Progress → Confirmed
assignee: Abhishek Talwar (abhishek-talwar) → nobody
Revision history for this message
Anusha Unnam (anusha-unnam) wrote :

@Abhishek Talwar: If you wish to work on this bug, please reassign yourself and push a review for it.

Changed in nova:
assignee: nobody → puja (pujachowdhary)
Sean Dague (sdague)
Changed in nova:
assignee: PujaChowdhary (pujachowdhary) → nobody
Changed in nova:
assignee: nobody → Nalini Varshney (varshneyg)
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.