Quota usage data wrong after instance resized by admin
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Fix Released
|
High
|
Liyingjun | ||
Icehouse |
Fix Released
|
Undecided
|
Unassigned |
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 | 6a47816024ef486
| 2014-01-13 08:31:28 | 2014-01-13 08:31:28 | NULL | 8 | 6a47816024ef486
| 2014-01-13 08:31:28 | 2014-01-13 08:31:28 | NULL | 9 | 6a47816024ef486
+------
2. Resize the instance by admin:
# nova list --all-tenants
+------
| ID | Name | Status | Task State | Power State | Networks |
+------
| a05f62b8-
+------
# 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-
| 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-
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 | 6a47816024ef486
| 2014-01-13 08:31:28 | 2014-01-13 08:31:28 | NULL | 8 | 6a47816024ef486
| 2014-01-13 08:31:28 | 2014-01-13 08:31:28 | NULL | 9 | 6a47816024ef486
| 2014-01-13 08:39:28 | 2014-01-13 08:39:28 | NULL | 10 | 6a47816024ef486
| 2014-01-13 08:39:28 | 2014-01-13 08:39:28 | NULL | 11 | 6a47816024ef486
| 2014-01-13 08:39:28 | 2014-01-13 08:39:28 | NULL | 12 | 6a47816024ef486
+------
Changed in nova: | |
assignee: | nobody → Liyingjun (liyingjun) |
tags: | added: icehouse-rc-potential |
Changed in nova: | |
importance: | Undecided → Medium |
importance: | Medium → High |
tags: |
added: icehouse-backport-potential removed: icehouse-rc-potential |
Changed in nova: | |
milestone: | none → juno-1 |
status: | Fix Committed → Fix Released |
tags: | removed: icehouse-backport-potential |
Changed in nova: | |
milestone: | juno-1 → 2014.2 |
Fix proposed to branch: master /review. openstack. org/68391
Review: https:/