← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1220727] Re: Inconsistent usage data for fixed_ip and floating_ip

 

** Changed in: nova
       Status: Fix Committed => Fix Released

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1220727

Title:
  Inconsistent usage data for fixed_ip and floating_ip

Status in OpenStack Compute (Nova):
  Fix Released

Bug description:
  If a normal user created a fixed_ip/floating_ip, a usage record with
  column `in_use=1` will be created in the quota_usages table, and if an
  admin user deleted the resource, a new record with column `in_use=-1`
  will be created..

  Reproduce:
  # keystone tenant-list
  | 21f7a02dbfd94979b83b3b551c78e380 |        admin        |   True  |
  | 846576498dc24660943784e25e2b5b1a |         test        |   True  |
  # keystone user-list --tenant-id 846576498dc24660943784e25e2b5b1a
  | 6a120d1a6034481fa7e905d422dceb76 |  test  |   True  |  test@xxxxxxxx  |

  1. create an instance with user 'test', the quota_usages table should be like this:
  +---------------------+---------------------+------------+----+----------------------------------+-----------+--------+----------+---------------+---------+----------------------------------+
  | created_at          | updated_at          | deleted_at | id | project_id                       | resource  | in_use | reserved | until_refresh | deleted | user_id                          |
  +---------------------+---------------------+------------+----+----------------------------------+-----------+--------+----------+---------------+---------+----------------------------------+
  | 2013-09-04 13:27:37 | 2013-09-04 13:31:49 | NULL       | 30 | 846576498dc24660943784e25e2b5b1a | instances |      1 |        0 |          NULL |       0 | 6a120d1a6034481fa7e905d422dceb76 |
  | 2013-09-04 13:27:37 | 2013-09-04 13:31:49 | NULL       | 31 | 846576498dc24660943784e25e2b5b1a | ram       |    512 |        0 |          NULL |       0 | 6a120d1a6034481fa7e905d422dceb76 |
  | 2013-09-04 13:27:37 | 2013-09-04 13:31:49 | NULL       | 32 | 846576498dc24660943784e25e2b5b1a | cores     |      1 |        0 |          NULL |       0 | 6a120d1a6034481fa7e905d422dceb76 |
  | 2013-09-04 13:31:51 | 2013-09-04 13:31:51 | NULL       | 33 | 846576498dc24660943784e25e2b5b1a | fixed_ips |      1 |        0 |          NULL |       0 | NULL                             |
  +---------------------+---------------------+------------+----+----------------------------------+-----------+--------+----------+---------------+---------+----------------------------------+

  2. delete the instance by user 'admin', following is the new table, which is obviously a bug:
  +---------------------+---------------------+------------+----+----------------------------------+-----------+--------+----------+---------------+---------+----------------------------------+
  | created_at          | updated_at          | deleted_at | id | project_id                       | resource  | in_use | reserved | until_refresh | deleted | user_id                          |
  +---------------------+---------------------+------------+----+----------------------------------+-----------+--------+----------+---------------+---------+----------------------------------+
  | 2013-09-04 13:27:37 | 2013-09-04 13:31:49 | NULL       | 30 | 846576498dc24660943784e25e2b5b1a | instances |      0 |        0 |          NULL |       0 | 6a120d1a6034481fa7e905d422dceb76 |
  | 2013-09-04 13:27:37 | 2013-09-04 13:31:49 | NULL       | 31 | 846576498dc24660943784e25e2b5b1a | ram       |    0 |        0 |          NULL |       0 | 6a120d1a6034481fa7e905d422dceb76 |
  | 2013-09-04 13:27:37 | 2013-09-04 13:31:49 | NULL       | 32 | 846576498dc24660943784e25e2b5b1a | cores     |      0 |        0 |          NULL |       0 | 6a120d1a6034481fa7e905d422dceb76 |
  | 2013-09-04 13:31:51 | 2013-09-04 13:31:51 | NULL       | 33 | 846576498dc24660943784e25e2b5b1a | fixed_ips |      1 |        0 |          NULL |       0 | NULL                             |
  | 2013-09-04 13:42:45 | 2013-09-04 13:42:45 | NULL       | 34 | 21f7a02dbfd94979b83b3b551c78e380 | fixed_ips |      -1 |        0 |          NULL |       0 | NULL                             |
  +---------------------+---------------------+------------+----+----------------------------------+-----------+--------+----------+---------------+---------+----------------------------------+

To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1220727/+subscriptions