volumes quota_usages in_use properties does not change when delete volume snapshots

Bug #1180629 reported by Leo Liang
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Invalid
Undecided
Unassigned

Bug Description

When user create one volume's snapshot ,then delete it , the quota_usages tables 'in_use' fileds is not changed.
thus , if tenant defaut quaota is 10, when user create 10 volumes ,then delete it ,user cannot create new volume or snapshot ,
it returns "Volumes quota exceed."

Tags: grizzly
Leo Liang (11315889-a)
tags: added: grizzly
Revision history for this message
Vincent Hou (houshengbo) wrote :

Shawn, please elaborate more about how you produce this issue.
I tested both under current code and grizzly. They both worked fine.

The in-use value changes when creating or deleting vol/snapshot.

mysql> select * from quota_usages;
+---------------------+---------------------+------------+---------+----+----------------------------------+-----------+--------+----------+---------------+
| created_at | updated_at | deleted_at | deleted | id | project_id | resource | in_use | reserved | until_refresh |
+---------------------+---------------------+------------+---------+----+----------------------------------+-----------+--------+----------+---------------+
| 2013-05-16 13:02:30 | 2013-05-16 13:04:50 | NULL | 0 | 1 | c6e1e8fc952943368840d5dd516acb33 | gigabytes | 10 | 0 | NULL |
| 2013-05-16 13:02:30 | 2013-05-16 13:04:50 | NULL | 0 | 2 | c6e1e8fc952943368840d5dd516acb33 | volumes | 10 | 0 | NULL |
+---------------------+---------------------+------------+---------+----+----------------------------------+-----------+--------+----------+---------------+
2 rows in set (0.00 sec)

After I delete one volume.

mysql> select * from quota_usages;
+---------------------+---------------------+------------+---------+----+----------------------------------+-----------+--------+----------+---------------+
| created_at | updated_at | deleted_at | deleted | id | project_id | resource | in_use | reserved | until_refresh |
+---------------------+---------------------+------------+---------+----+----------------------------------+-----------+--------+----------+---------------+
| 2013-05-16 13:02:30 | 2013-05-16 13:06:14 | NULL | 0 | 1 | c6e1e8fc952943368840d5dd516acb33 | gigabytes | 9 | 0 | NULL |
| 2013-05-16 13:02:30 | 2013-05-16 13:06:14 | NULL | 0 | 2 | c6e1e8fc952943368840d5dd516acb33 | volumes | 9 | 0 | NULL |
+---------------------+---------------------+------------+---------+----+----------------------------------+-----------+--------+----------+---------------+
2 rows in set (0.00 sec)

Changed in cinder:
status: New → Incomplete
Revision history for this message
Leo Liang (11315889-a) wrote :

Sorry, I made a little mistake in the fields name, i test just now ,

that is snapshot's bug ,please notice the snapshot fields ,after create snapshot and delete it .

mysql> select * from quota_usages where project_id='30387eb46b624012bce5172ac77ab407';
+---------------------+---------------------+------------+---------+----+----------------------------------+-----------+--------+----------+---------------+
| created_at | updated_at | deleted_at | deleted | id | project_id | resource | in_use | reserved | until_refresh |
+---------------------+---------------------+------------+---------+----+----------------------------------+-----------+--------+----------+---------------+

| 2013-05-06 03:12:43 | 2013-05-17 09:06:12 | NULL | 0 | 6 | 30387eb46b624012bce5172ac77ab407 | snapshots | 6 | 0 | NULL |
+---------------------+---------------------+------------+---------+----+----------------------------------+-----------+--------+----------+---------------+
3 rows in set (0.00 sec)

summary: volumes quota_usages in_use properties does not change when delete
- voluems
+ voluem snapshots
Leo Liang (11315889-a)
Changed in cinder:
assignee: nobody → Shawn Liang (11315889-a)
assignee: Shawn Liang (11315889-a) → nobody
description: updated
Leo Liang (11315889-a)
summary: volumes quota_usages in_use properties does not change when delete
- voluem snapshots
+ volume snapshots
Revision history for this message
Cian O'Driscoll (dricco) wrote :
Download full text (4.6 KiB)

Also tests on master and stable/grizzly head and cannot repo.

output form stable/grizzly head testing

mysql> select * from quota_usages;
+---------------------+---------------------+------------+---------+----+----------------------------------+-----------+--------+----------+---------------+
| created_at | updated_at | deleted_at | deleted | id | project_id | resource | in_use | reserved | until_refresh |
+---------------------+---------------------+------------+---------+----+----------------------------------+-----------+--------+----------+---------------+
| 2013-05-30 09:27:24 | 2013-05-30 09:29:12 | NULL | 0 | 1 | 51365a6f2fb0462fae664903e982a88b | gigabytes | 2 | 0 | NULL |
| 2013-05-30 09:27:24 | 2013-05-30 09:27:24 | NULL | 0 | 2 | 51365a6f2fb0462fae664903e982a88b | volumes | 1 | 0 | NULL |
| 2013-05-30 09:27:45 | 2013-05-30 09:29:12 | NULL | 0 | 3 | 51365a6f2fb0462fae664903e982a88b | snapshots | 1 | 0 | NULL |
+---------------------+---------------------+------------+---------+----+----------------------------------+-----------+--------+----------+---------------+
3 rows in set (0.00 sec)

mysql>
mysql>
mysql> select * from quota_usages;
+---------------------+---------------------+------------+---------+----+----------------------------------+-----------+--------+----------+---------------+
| created_at | updated_at | deleted_at | deleted | id | project_id | resource | in_use | reserved | until_refresh |
+---------------------+---------------------+------------+---------+----+----------------------------------+-----------+--------+----------+---------------+
| 2013-05-30 09:27:24 | 2013-05-30 09:42:18 | NULL | 0 | 1 | 51365a6f2fb0462fae664903e982a88b | gigabytes | 3 | 0 | NULL |
| 2013-05-30 09:27:24 | 2013-05-30 09:27:24 | NULL | 0 | 2 | 51365a6f2fb0462fae664903e982a88b | volumes | 1 | 0 | NULL |
| 2013-05-30 09:27:45 | 2013-05-30 09:42:18 | NULL | 0 | 3 | 51365a6f2fb0462fae664903e982a88b | snapshots | 2 | 0 | NULL |
+---------------------+---------------------+------------+---------+----+----------------------------------+-----------+--------+----------+---------------+
3 rows in set (0.00 sec)

mysql>
mysql> select * from quota_usages;
+---------------------+---------------------+------------+---------+----+----------------------------------+-----------+--------+----------+---------------+
| created_at | updated_at | deleted_at | deleted | id | project_id | resource | in_use | reserved | until_refresh |
+---------------------+---------------------+------------+---------+----+----------------------------------+-----------+--------+----------+---------------+
| 2013-05-30 09:27:24 | 2013-05-30 09:42:54 | NULL | 0 | 1 | 51365a6f2fb0462fae664903e982a88b | gigabytes | 4 | 0 | NULL |
| 2013-05-30 09:27:24 | 2013-05-30 09:27:24 | NULL | 0 | 2 | 51365a6f2f...

Read more...

Revision history for this message
Sean McGinnis (sean-mcginnis) wrote : Cleanup

Closing stale bug. If this is still an issue please reopen.

Changed in cinder:
status: Incomplete → Invalid
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.