-
Notifications
You must be signed in to change notification settings - Fork 29
nova server details always return hard coded flavor id '1' #98
Comments
With storing the flavor id in the userData of VS. I can show the flavor properly: +-----------------------------+-------------------------------------------------------------+ |
@ajiang38740 This looks like an acceptable solution to me. Of course, this won't handle virtual servers created before this change or virtual servers not created by Jumpgate but that can be handled a bit later. +1, this is a nice short term approach |
You got a good point. For the virtual servers created before this change or not by jumpgate, as long as it fits the hardcoded flavor list, I can update the VS instance's metadata to put in the flavor id if nova show is called(for the first time). There is one problem with this above approach: Here is another thought about how to handle flavor id for jumpgate. For openstack, flavor id is a string: (nova.db.sqlalchemy.models.InstanceTypes)
What we can do is to define the flavor id in this form CCCCMMMMDDDD If you like this idea, i can put this together and submit for review. |
Actually, there is a private core vs non private and need to deal with local vs san disks. Here is the refined version of this flavorid P-C-M-A-D , P private core or not. C is number of cores, M is GB of memory, A attachment('l' for local, 's' for san) and D is the GB of first disks. For a flavor that has 4 private cores 64 GB memory and 100GB san attached disk, the flavor will be Another example: n-2-16-l-25 This will be a non-private 2 core 16GB memory with 25G local disk flavor. |
The '-' dash is just easy for python split(). |
So when nova flavor-list is called, the flavor code will generate the full list of permutation based on Of course this approach is based on the assumption CCI instance cpu/memory/disk is always a limited list of predefined choices. |
You should re-read the discussion that was had between Boden and I in issue #27. We were led down this path and I believe the preferred conclusion was to have a base-64 encoded parsable string which represents each option (CPU, memory, disk size/type, etc). The only hitch with that plan is that some OpenStack projects (like trove) treat flavor ids as integers. I believe that to be a bug in those projects, since the type returned for flavor ids are strings. |
Thanks for point that out. I think my idea is the same as what you have planned in #27. And Trove
That self.flavor is a dict got from nova client by looking up the nova flavor id. Any non-predefined openstack flavor may break this Trove flavor function. Unfortunately that I think there is a way out of this by still use the original idea. I will expand on my idea to bitmap based flavor encoding since we have limited options for cpus memory and disks. 0xCCMMDDDD This is a 32-bits flavor id which still fits into the 32bit integer. So it won't break For a flavor that has 4 private cores 64 GB memory and 100GB san attached disk The binary format will be 0x84 40 8064 and the flavor id in decimal will be 2218819684 |
In order to do nova flavor-list, just need to predefine the list of possible choices of cpus , memory and disks and generate permutation on the fly. |
@ajiang38740 It's become clear to me that (API-exposed) flavor ids are strings and should be able to be treated as such and that other projects who use nova that can't work with them as strings treat them as bugs. I'd prefer that the flavors not be serialized into an integer due to the limited amount of space for future augmentations of flavors that nova can/is doing. |
Saw issue #87 and #27 regarding flavor discussion.
I am not sure how this problem fits into those 2 problems. The issue I ran into
is nova boot with --flavor-id will create a CCI VS with some flavor. But when you show
the server details, it is always return flavor 1, which is hardcoded.
What I have done is to save the flavor id in the userData json structure that is
passed to the create_instance() and retrieve back when show the server details.
At least this way, it can show the used flavor properly.
I am not sure whether using userData is a desired approach from SL CCI point of view.
Please let me know whether I should submit such patch.
Alan
The text was updated successfully, but these errors were encountered: