Update quota with long type value (10000000000) fails with Internal Server Error (HTTP 500). If we update quota with multiple values in one request where one of the value is of long type, update quota fails because of DBError but few of the quota values are updated in database.
Steps to reproduce:
1. Check current quotas
$ cinder quota-show 880cd5150d8a46a09c32b51f3d0d9a7c
+-----------------------+-------+
| Property | Value |
+-----------------------+-------+
| gigabytes | 52 |
| gigabytes_lvmdriver-1 | -1 |
| snapshots | 50 |
| snapshots_lvmdriver-1 | -1 |
| volumes | 50 |
| volumes_lvmdriver-1 | -1 |
+-----------------------+-------+
2. Update quotas with multi-value where value of --volumes is of long type
$ cinder quota-update 880cd5150d8a46a09c32b51f3d0d9a7c --volumes 10000000000 --gigabytes 62 --snapshots 62
you will see following error on terminal
ERROR: Internal Server Error (HTTP 500) (Request-ID: req-e00a068a-a0d4-4665-b213-176f7ba1191e)
3. Check quotas now and you will find updated gigabytes value in quotas.
$ cinder quota-show 880cd5150d8a46a09c32b51f3d0d9a7c
+-----------------------+-------+
| Property | Value |
+-----------------------+-------+
| gigabytes | 62 |
| gigabytes_lvmdriver-1 | -1 |
| snapshots | 50 |
| snapshots_lvmdriver-1 | -1 |
| volumes | 50 |
| volumes_lvmdriver-1 | -1 |
+-----------------------+-------+
This will cause a DBError:
2015-03-17 20:20:44.861 TRACE nova.api.openstack DBError: (DataError) (1264, "Out of range value for column 'hard_limit' at row 1") 'INSERT INTO quotas (created_at, updated_at, deleted_at, deleted, project_id, resource, hard_limit) VALUES (%s, %s, %s, %s, %s, %s, %s)' (datetime. datetime( 2015, 3, 17, 12, 20, 44, 849766), None, None, 0, '97f2ce5b140346 e09e68141df141a 857', 'instances', 10000000000)