Comment 7 for bug 1317515

Revision history for this message
Bruno Lago (teolupus) wrote :

Running OpenStack IceHouse on Ubuntu 14.04.

I can confirm that if I do:

nova quota-update --instances 0 [...--all other things 0...] my-tenant-name

nova quota-show my-tenant-name

+-----------------------------+-------+
| Quota | Limit |
+-----------------------------+-------+
[...]
+-----------------------------+-------+

You can see that the quota update apparently works and I can even query the quota for my-tenant-name and get back the right results.

However, when I query the TENANT_ID that matches my tenant name, I see:

nova quota-show --tenant $TENANT_ID

+-----------------------------+-------+
| Quota | Limit |
+-----------------------------+-------+
[...]
+-----------------------------+-------+

The same is shown on the dashboard, and as expected, I can launch instances.

Looking at the quotas table in the database, in particular the tenant-id, we can see that OpenStack inserted the tenant name (my-tenant-name), instead the tenant-id in the tenant-id column.

mysql> select * from quotas;

| 3015 | 2015-07-30 03:40:33 | 2015-07-30 04:26:04 | NULL | my-tenant-name | metadata_items | 1 | 0 |
| 3018 | 2015-07-30 03:40:33 | 2015-07-30 04:26:04 | NULL | my-tenant-name | injected_file_content_bytes | 1 | 0 |
| 3021 | 2015-07-30 03:40:33 | 2015-07-30 04:26:04 | NULL | my-tenant-name | ram | 1 | 0 |
| 3024 | 2015-07-30 03:40:33 | 2015-07-30 04:26:04 | NULL | my-tenant-name | floating_ips | 1 | 0 |
| 3027 | 2015-07-30 03:40:33 | 2015-07-30 04:26:04 | NULL | my-tenant-name | key_pairs | 1 | 0 |
| 3030 | 2015-07-30 03:40:33 | 2015-07-30 04:26:04 | NULL | my-tenant-name | instances | 1 | 0 |
| 3033 | 2015-07-30 03:40:33 | 2015-07-30 04:26:04 | NULL | my-tenant-name | injected_files | 1 | 0 |
| 3036 | 2015-07-30 03:40:33 | 2015-07-30 04:26:04 | NULL | my-tenant-name | cores | 1 | 0 |
| 3039 | 2015-07-30 03:40:33 | 2015-07-30 04:26:04 | NULL | my-tenant-name | fixed_ips | 1 | 0 |
| 3042 | 2015-07-30 03:40:33 | 2015-07-30 04:26:04 | NULL | my-tenant-name | injected_file_path_bytes | 1 | 0 |
| 3093 | 2015-07-30 03:43:28 | 2015-07-30 04:26:04 | NULL | my-tenant-name | security_group_rules | 1 | 0 |
| 3108 | 2015-07-30 03:43:28 | 2015-07-30 04:26:04 | NULL | my-tenant-name | security_groups | 1 | 0 |

The same applies to cinder and neutron.

In essence, the APIs and the command line tools should refuse to update quota for a tenant-id that does not exist, but are not doing so. As a result, you end up with some dodgy entries in the database and an apparently successful quota update that does not work.