Trove does not support flavor UUIDs

Bug #1333852 reported by Longgeek on 2014-06-24
84
This bug affects 16 people
Affects Status Importance Assigned to Milestone
OpenStack DBaaS (Trove)
Medium
Adam Gandelman
tempest
Undecided
Unassigned

Bug Description

Trove does not support flavor UUID!

trove-api:

2014-06-25 01:39:02.420 14071 ERROR trove.common.wsgi [-] 7f1eb3f3-7b7e-4a71-ac90-0f4f85ea2023: invalid literal for int() with base 10: 'ee344d23-a1ff-4c85-9be6-41020e36c49e'
2014-06-25 01:39:02.420 14071 TRACE trove.common.wsgi Traceback (most recent call last):
2014-06-25 01:39:02.420 14071 TRACE trove.common.wsgi File "/livestack/sources/trove/trove/common/wsgi.py", line 251, in execute_action
2014-06-25 01:39:02.420 14071 TRACE trove.common.wsgi **action_args)
2014-06-25 01:39:02.420 14071 TRACE trove.common.wsgi File "/livestack/sources/trove/trove/openstack/common/wsgi.py", line 395, in execute_action
2014-06-25 01:39:02.420 14071 TRACE trove.common.wsgi return self.dispatch(self.controller, action, request, **action_args)
2014-06-25 01:39:02.420 14071 TRACE trove.common.wsgi File "/livestack/sources/trove/trove/openstack/common/wsgi.py", line 404, in dispatch
2014-06-25 01:39:02.420 14071 TRACE trove.common.wsgi return method(*args, **kwargs)
2014-06-25 01:39:02.420 14071 TRACE trove.common.wsgi File "/livestack/sources/trove/trove/flavor/service.py", line 38, in index
2014-06-25 01:39:02.420 14071 TRACE trove.common.wsgi return wsgi.Result(views.FlavorsView(flavors, req).data(), 200)
2014-06-25 01:39:02.420 14071 TRACE trove.common.wsgi File "/livestack/sources/trove/trove/flavor/views.py", line 57, in data
2014-06-25 01:39:02.420 14071 TRACE trove.common.wsgi data.append(self.view(flavor, req=self.req).data()['flavor'])
2014-06-25 01:39:02.420 14071 TRACE trove.common.wsgi File "/livestack/sources/trove/trove/flavor/views.py", line 32, in data
2014-06-25 01:39:02.420 14071 TRACE trove.common.wsgi 'id': int(self.flavor.id),
2014-06-25 01:39:02.420 14071 TRACE trove.common.wsgi ValueError: invalid literal for int() with base 10: 'ee344d23-a1ff-4c85-9be6-41020e36c49e'
2014-06-25 01:39:02.420 14071 TRACE trove.common.wsgi
2014-06-25 01:39:02.421 14071 INFO eventlet.wsgi [-] 127.0.0.1 - - [25/Jun/2014 01:39:02] "GET /v1.0/a09ab64caa524095ac8fdf8e45af1712/flavors HTTP/1.1" 500 310 0.036725

root@test-S5500BC:~# nova flavor-list
+--------------------------------------+-----------+-----------+------+-----------+---------+-------+-------------+-----------+
| ID | Name | Memory_MB | Disk | Ephemeral | Swap_MB | 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 |
| 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 |
| ee344d23-a1ff-4c85-9be6-41020e36c49e | trove | 1025 | 10 | 0 | | 1 | 1.0 | True |
+--------------------------------------+-----------+-----------+------+-----------+---------+-------+-------------+-----------+

Longgeek (longgeek) on 2014-06-24
Changed in trove:
assignee: nobody → THSTACK inc. (thstack)
status: New → In Progress

Fix proposed to branch: master
Review: https://review.openstack.org/102301

Changed in trove:
assignee: THSTACK inc. (thstack) → Longgeek (longgeek)

Change abandoned by Longgeek (<email address hidden>) on branch: master
Review: https://review.openstack.org/102301

summary: - ValueError: invalid literal for int() with base 10:
+ Trove does not support flavor UUIDs
Changed in trove:
importance: Undecided → Medium
milestone: none → ongoing
Adam Gandelman (gandelman-a) wrote :

Adding Tempest. If the trove tempest tests are run against a cloud with a single flavor keyed by UUID, the trove tests fail:

ft81.1: tempest.api.database.flavors.test_flavors.DatabaseFlavorsTest.test_compare_db_flavors_with_os[gate,smoke]_StringException: Empty attachments:
  stderr
  stdout

pythonlogging:'': {{{
2014-07-17 01:27:38,724 32325 INFO [tempest.common.rest_client] Request (DatabaseFlavorsTest:test_compare_db_flavors_with_os): 200 POST http://127.0.0.1:5000/v2.0/tokens
2014-07-17 01:27:39,084 32325 INFO [tempest.common.rest_client] Request (DatabaseFlavorsTest:test_compare_db_flavors_with_os): 500 GET http://127.0.0.1:8779/v1.0/a941a1d7d4cc41749149edeeb3697162/flavors 0.359s
}}}

Traceback (most recent call last):
  File "tempest/api/database/flavors/test_flavors.py", line 59, in test_compare_db_flavors_with_os
    resp, db_flavors = self.client.list_db_flavors()
  File "tempest/services/database/json/flavors_client.py", line 35, in list_db_flavors
    resp, body = self.get(url)
  File "tempest/common/rest_client.py", line 221, in get
    return self.request('GET', url, extra_headers, headers)
  File "tempest/common/rest_client.py", line 430, in request
    resp, resp_body)
  File "tempest/common/rest_client.py", line 526, in _error_checker
    raise exceptions.ServerFault(message)
ServerFault: Got server fault
Details: Internal Server Error. Please keep this ID to help us figure out what went wrong: (5f779fbc-d194-4b03-b42c-0e38b9d3311b).

tags: added: ironic-tempest
Adam Gandelman (gandelman-a) wrote :

Can we please reconsider the severity of this bug? This makes trove integration into existing clouds with non-integer flavor IDs impossible, and this happens to be the case in some cases when deploying Trove + Ironic via Devstack causing Tempest breakage.

Tim Simpson (tim-simpson) wrote :

Ugh... this is kind of crazy. Though many of us have been working with OpenStack for years I guess no one on the project has been exposed to UUIDs for Flavors yet.

As others have stated, changing the ID from an int to a string will break the API and will cause complaints from the users of existing deployments. This would be a kludge, but I think for now we need to return "uuid" in addition to the ID and make that one a string. We should also return None for the ID if it can't be coerced into an integer. This way people can use UUIDs today before we start on V2 of the API.

Amrith Kumar (amrith) wrote :

At Trove meeting today we decided to take a shot at this proposal.

1. add a uuid.
2. return uuid always (as a string).
3. if uuid converts to an integer, return it in the current id field.
4. if uuid won't convert, don't return id.

The consensus is that this *should* work but we would defer judgement till we actually tried it out.

Sylvain Boily (sboily-f) wrote :

Hello,

If you change the flavor with horizon you have the same problem because horizon change the id into an uuid.

Changed in tempest:
status: New → Invalid
Chris Hoge (hoge) wrote :

This is a critical bug for deployers. The tiny flavor is not large enough for guests, the small is too large, and creating a trove-appropriate flavor in a standard OpenStack deployment makes the flavor unusable.

Changed in trove:
importance: Medium → Critical
milestone: ongoing → kilo-1
importance: Critical → High
Nikhil Manchanda (slicknik) wrote :

Chris, agreed. This does seem painful if your deployment uses flavor UUIDs -- I've upped the importance of the bug. The reason why the fix has not seem much traction upstream is because it has API compatibility implications, and there have been plenty of comments and discussion around this. I think we've made some good progress towards a design that will work, and hopefully we can get this fixed in early Kilo.

Amrith Kumar (amrith) wrote :

TYPO in #11 above: Updating importance to "Medium" (bugscrub, 2014-10-23)

Changed in trove:
importance: High → Medium
Changed in trove:
milestone: kilo-1 → kilo-2
Changed in trove:
assignee: Longgeek (longgeek) → Andreas Jaeger (jaegerandi)

Reviewed: https://review.openstack.org/115811
Committed: https://git.openstack.org/cgit/openstack/trove/commit/?id=21fee8c3c554ba158c2bbe977131522a204c22cc
Submitter: Jenkins
Branch: master

commit 21fee8c3c554ba158c2bbe977131522a204c22cc
Author: Adam Gandelman <email address hidden>
Date: Wed Aug 20 15:09:59 2014 -0700

    Support string flavor IDs

    This allows operating on Nova flavors with non-integer ids
    by adding a new str_id field to the view that always contains the
    unicode flavor id. The current id field will now contain a value
    only when the flavor's id can be cast to int, otherwise it will be
    None. Validation of flavor id when querying a flavor or creating an
    instance has been updated to include non-empty strings in addition to
    integers.

    This will require a patch to python-troveclient to properly fallback
    to str_id in absence of the integer id:

        https://review.openstack.org/#/c/123301/

    Change-Id: Ie9cfefc6127bc76783cdf9668636342d7590b308
    Closes-bug: #1333852

Changed in trove:
status: In Progress → Fix Committed
Changed in trove:
assignee: Andreas Jaeger (jaegerandi) → Adam Gandelman (gandelman-a)
Thierry Carrez (ttx) on 2015-02-03
Changed in trove:
status: Fix Committed → Fix Released
Kevin Fox (kevpn) wrote :

Is this backportable to juno?

Amrith Kumar (amrith) wrote :

Kevin, I'll take a quick look.

Amrith Kumar (amrith) wrote :

A quick look at this change indicates that it would not be a good candidate for backport to juno. It does not meet at least two of the criteria for a merge to stable branch.

Just for the record, I'll post a note to the mailing list with this.

Thierry Carrez (ttx) on 2015-04-30
Changed in trove:
milestone: kilo-2 → 2015.1.0
Michal Jura (mjura) wrote :

Hi,

I would like to introduce patches for stable/juno. I hit this bug in stable/juno and I was able to backport them there.

Because branch stable/juno doesn't exist in https://github.com/openstack/python-troveclient, I'm attaching raw patch to this bug

Change abandoned by Michal Jura (<email address hidden>) on branch: stable/juno
Review: https://review.openstack.org/193499

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers