← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1271541] [NEW] Quota usage data wrong after instance resized by admin

 

Public bug reported:

If the instance of a normal user is resized by admin, the user_id for
quota usage will be changed to admin.

Reproduce:
We have two user 'admin' and 'test1' which is a normal user. 
1. Create an instance by 'test1', the quota_usage table should be like:
mysql> select * from quota_usages;
+---------------------+---------------------+------------+----+----------------------------------+-----------+--------+----------+---------------+---------+----------------------------------+
| created_at          | updated_at          | deleted_at | id | project_id                       | resource  | in_use | reserved | until_refresh | deleted | user_id                          |
+---------------------+---------------------+------------+----+----------------------------------+-----------+--------+----------+---------------+---------+----------------------------------+
| 2014-01-13 08:31:28 | 2014-01-13 08:31:28 | NULL       |  7 | 6a47816024ef4860b1a218510a1658a9 | instances |      1 |        0 |          NULL |       0 | ea75fd9954244be9b92c2aec99305f63 |
| 2014-01-13 08:31:28 | 2014-01-13 08:31:28 | NULL       |  8 | 6a47816024ef4860b1a218510a1658a9 | ram       |    512 |        0 |          NULL |       0 | ea75fd9954244be9b92c2aec99305f63 |
| 2014-01-13 08:31:28 | 2014-01-13 08:31:28 | NULL       |  9 | 6a47816024ef4860b1a218510a1658a9 | cores     |      1 |        0 |          NULL |       0 | ea75fd9954244be9b92c2aec99305f63 |
+---------------------+---------------------+------------+----+----------------------------------+-----------+--------+----------+---------------+---------+----------------------------------+


2. Resize the instance by admin:
# nova list --all-tenants
+--------------------------------------+------+--------+------------+-------------+-----------------+
| ID                                   | Name | Status | Task State | Power State | Networks        |
+--------------------------------------+------+--------+------------+-------------+-----------------+
| a05f62b8-3f14-473c-9d64-b950b4dbfc9e | test | ACTIVE | None       | Running     | test=10.10.10.2 |
+--------------------------------------+------+--------+------------+-------------+-----------------+

# nova flavor-list
+--------------------------------------+-----------+-----------+------+-----------+------+-------+-------------+-----------+
| ID                                   | Name      | Memory_MB | Disk | Ephemeral | Swap | VCPUs | RXTX_Factor | Is_Public |
+--------------------------------------+-----------+-----------+------+-----------+------+-------+-------------+-----------+
| 1                                    | m1.tiny   | 512       | 1    | 0         |      | 1     | 1.0         | True      |
| 2                                    | m1.small  | 2048      | 20   | 0         |      | 1     | 1.0         | True      |
| 2ee75e0f-37e1-4561-a5e2-43b8fd677547 | m2.tiny   | 512       | 0    | 0         |      | 2     | 1.0         | True      |
| 3                                    | m1.medium | 4096      | 40   | 0         |      | 2     | 1.0         | True      |
| 4                                    | m1.large  | 8192      | 80   | 0         |      | 4     | 1.0         | True      |
| 5                                    | m1.xlarge | 16384     | 160  | 0         |      | 8     | 1.0         | True      |
+--------------------------------------+-----------+-----------+------+-----------+------+-------+-------------+-----------+

# nova resize a05f62b8-3f14-473c-9d64-b950b4dbfc9e 2ee75e0f-
37e1-4561-a5e2-43b8fd677547

quota_usage table would create new records with the user_id for the admin.
mysql> select * from quota_usages;
+---------------------+---------------------+------------+----+----------------------------------+-----------+--------+----------+---------------+---------+----------------------------------+
| created_at          | updated_at          | deleted_at | id | project_id                       | resource  | in_use | reserved | until_refresh | deleted | user_id                          |
+---------------------+---------------------+------------+----+----------------------------------+-----------+--------+----------+---------------+---------+----------------------------------+
| 2014-01-13 08:31:28 | 2014-01-13 08:31:28 | NULL       |  7 | 6a47816024ef4860b1a218510a1658a9 | instances |      1 |        0 |          NULL |       0 | ea75fd9954244be9b92c2aec99305f63 |
| 2014-01-13 08:31:28 | 2014-01-13 08:31:28 | NULL       |  8 | 6a47816024ef4860b1a218510a1658a9 | ram       |    512 |        0 |          NULL |       0 | ea75fd9954244be9b92c2aec99305f63 |
| 2014-01-13 08:31:28 | 2014-01-13 08:31:28 | NULL       |  9 | 6a47816024ef4860b1a218510a1658a9 | cores     |      1 |        0 |          NULL |       0 | ea75fd9954244be9b92c2aec99305f63 |
| 2014-01-13 08:39:28 | 2014-01-13 08:39:28 | NULL       | 10 | 6a47816024ef4860b1a218510a1658a9 | cores     |      0 |        1 |          NULL |       0 | ad99c3d4311b4940b083b52fbf73789c |
| 2014-01-13 08:39:28 | 2014-01-13 08:39:28 | NULL       | 11 | 6a47816024ef4860b1a218510a1658a9 | instances |      0 |        0 |          NULL |       0 | ad99c3d4311b4940b083b52fbf73789c |
| 2014-01-13 08:39:28 | 2014-01-13 08:39:28 | NULL       | 12 | 6a47816024ef4860b1a218510a1658a9 | ram       |      0 |        0 |          NULL |       0 | ad99c3d4311b4940b083b52fbf73789c |
+---------------------+---------------------+------------+----+----------------------------------+-----------+--------+----------+---------------+---------+----------------------------------+

** Affects: nova
     Importance: Undecided
     Assignee: Liyingjun (liyingjun)
         Status: New

** Changed in: nova
     Assignee: (unassigned) => Liyingjun (liyingjun)

-- 
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/1271541

Title:
  Quota usage data wrong after instance resized by admin

Status in OpenStack Compute (Nova):
  New

Bug description:
  If the instance of a normal user is resized by admin, the user_id for
  quota usage will be changed to admin.

  Reproduce:
  We have two user 'admin' and 'test1' which is a normal user. 
  1. Create an instance by 'test1', the quota_usage table should be like:
  mysql> select * from quota_usages;
  +---------------------+---------------------+------------+----+----------------------------------+-----------+--------+----------+---------------+---------+----------------------------------+
  | created_at          | updated_at          | deleted_at | id | project_id                       | resource  | in_use | reserved | until_refresh | deleted | user_id                          |
  +---------------------+---------------------+------------+----+----------------------------------+-----------+--------+----------+---------------+---------+----------------------------------+
  | 2014-01-13 08:31:28 | 2014-01-13 08:31:28 | NULL       |  7 | 6a47816024ef4860b1a218510a1658a9 | instances |      1 |        0 |          NULL |       0 | ea75fd9954244be9b92c2aec99305f63 |
  | 2014-01-13 08:31:28 | 2014-01-13 08:31:28 | NULL       |  8 | 6a47816024ef4860b1a218510a1658a9 | ram       |    512 |        0 |          NULL |       0 | ea75fd9954244be9b92c2aec99305f63 |
  | 2014-01-13 08:31:28 | 2014-01-13 08:31:28 | NULL       |  9 | 6a47816024ef4860b1a218510a1658a9 | cores     |      1 |        0 |          NULL |       0 | ea75fd9954244be9b92c2aec99305f63 |
  +---------------------+---------------------+------------+----+----------------------------------+-----------+--------+----------+---------------+---------+----------------------------------+

  
  2. Resize the instance by admin:
  # nova list --all-tenants
  +--------------------------------------+------+--------+------------+-------------+-----------------+
  | ID                                   | Name | Status | Task State | Power State | Networks        |
  +--------------------------------------+------+--------+------------+-------------+-----------------+
  | a05f62b8-3f14-473c-9d64-b950b4dbfc9e | test | ACTIVE | None       | Running     | test=10.10.10.2 |
  +--------------------------------------+------+--------+------------+-------------+-----------------+

  # nova flavor-list
  +--------------------------------------+-----------+-----------+------+-----------+------+-------+-------------+-----------+
  | ID                                   | Name      | Memory_MB | Disk | Ephemeral | Swap | VCPUs | RXTX_Factor | Is_Public |
  +--------------------------------------+-----------+-----------+------+-----------+------+-------+-------------+-----------+
  | 1                                    | m1.tiny   | 512       | 1    | 0         |      | 1     | 1.0         | True      |
  | 2                                    | m1.small  | 2048      | 20   | 0         |      | 1     | 1.0         | True      |
  | 2ee75e0f-37e1-4561-a5e2-43b8fd677547 | m2.tiny   | 512       | 0    | 0         |      | 2     | 1.0         | True      |
  | 3                                    | m1.medium | 4096      | 40   | 0         |      | 2     | 1.0         | True      |
  | 4                                    | m1.large  | 8192      | 80   | 0         |      | 4     | 1.0         | True      |
  | 5                                    | m1.xlarge | 16384     | 160  | 0         |      | 8     | 1.0         | True      |
  +--------------------------------------+-----------+-----------+------+-----------+------+-------+-------------+-----------+

  # nova resize a05f62b8-3f14-473c-9d64-b950b4dbfc9e 2ee75e0f-
  37e1-4561-a5e2-43b8fd677547

  quota_usage table would create new records with the user_id for the admin.
  mysql> select * from quota_usages;
  +---------------------+---------------------+------------+----+----------------------------------+-----------+--------+----------+---------------+---------+----------------------------------+
  | created_at          | updated_at          | deleted_at | id | project_id                       | resource  | in_use | reserved | until_refresh | deleted | user_id                          |
  +---------------------+---------------------+------------+----+----------------------------------+-----------+--------+----------+---------------+---------+----------------------------------+
  | 2014-01-13 08:31:28 | 2014-01-13 08:31:28 | NULL       |  7 | 6a47816024ef4860b1a218510a1658a9 | instances |      1 |        0 |          NULL |       0 | ea75fd9954244be9b92c2aec99305f63 |
  | 2014-01-13 08:31:28 | 2014-01-13 08:31:28 | NULL       |  8 | 6a47816024ef4860b1a218510a1658a9 | ram       |    512 |        0 |          NULL |       0 | ea75fd9954244be9b92c2aec99305f63 |
  | 2014-01-13 08:31:28 | 2014-01-13 08:31:28 | NULL       |  9 | 6a47816024ef4860b1a218510a1658a9 | cores     |      1 |        0 |          NULL |       0 | ea75fd9954244be9b92c2aec99305f63 |
  | 2014-01-13 08:39:28 | 2014-01-13 08:39:28 | NULL       | 10 | 6a47816024ef4860b1a218510a1658a9 | cores     |      0 |        1 |          NULL |       0 | ad99c3d4311b4940b083b52fbf73789c |
  | 2014-01-13 08:39:28 | 2014-01-13 08:39:28 | NULL       | 11 | 6a47816024ef4860b1a218510a1658a9 | instances |      0 |        0 |          NULL |       0 | ad99c3d4311b4940b083b52fbf73789c |
  | 2014-01-13 08:39:28 | 2014-01-13 08:39:28 | NULL       | 12 | 6a47816024ef4860b1a218510a1658a9 | ram       |      0 |        0 |          NULL |       0 | ad99c3d4311b4940b083b52fbf73789c |
  +---------------------+---------------------+------------+----+----------------------------------+-----------+--------+----------+---------------+---------+----------------------------------+

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


Follow ups

References