Description of problem: CFME should not assign flavor id in OSP provider. Currently, CFME has following code -- gems/fog-openstack-0.1.25/lib/fog/compute/openstack/requests/create_flavor.rb ~~~ 1 module Fog 2 module Compute 3 class OpenStack 4 class Real 5 # PARAMETERS # 6 # name = Name of flavor 7 # ram = Memory in MB 8 # vcpus = Number of VCPUs 9 # disk = Size of local disk in GB 10 # swap = Swap space in MB 11 # rxtx_factor = RX/TX factor 12 def create_flavor(attributes) 13 # Get last flavor id 14 flavor_ids = [] 15 flavors = list_flavors_detail.body['flavors'] + list_flavors_detail(:is_public => false).body['flavors'] 16 flavors.each do |flavor| 17 flavor_ids << flavor['id'].to_i 18 end 19 20 # Set flavor id 21 attributes[:flavor_id] = attributes[:flavor_id] || (!flavor_ids.empty? ? flavor_ids.sort.last + 1 : 1) 22 23 data = { 24 'flavor' => { 25 'name' => attributes[:name], 26 'ram' => attributes[:ram], 27 'vcpus' => attributes[:vcpus], 28 'disk' => attributes[:disk], 29 'id' => attributes[:flavor_id], 30 'swap' => attributes[:swap], 31 'OS-FLV-EXT-DATA:ephemeral' => attributes[:ephemeral], 32 'os-flavor-access:is_public' => attributes[:is_public], 33 'rxtx_factor' => attributes[:rxtx_factor] 34 } 35 } 36 ~~~ In this code, the new flavor ID is calculated as the largest number plus 1. On the other hand, in OpenStack, flavor id is optional parameter. If it is not specified, OpenStack will use a UUID for its id. The implementation difference in CFME and OpenStack causes following situation. ~~~ # openstack flavor list +--------------------------------------+--------------+-------+------+-----------+-------+-----------+ | ID | Name | RAM | Disk | Ephemeral | VCPUs | Is Public | +--------------------------------------+--------------+-------+------+-----------+-------+-----------+ | 00a6caa6-70b4-4843-955a-e2b144c85fbc | test_flavor | 1024 | 10 | 0 | 1 | True | | 1 | m1.tiny | 512 | 1 | 0 | 1 | True | | 2 | m1.small | 2048 | 20 | 0 | 1 | True | | 3 | m1.medium | 4096 | 40 | 0 | 2 | True | | 4 | m1.large | 8192 | 80 | 0 | 4 | True | | 5 | m1.xlarge | 16384 | 160 | 0 | 8 | True | | 6 | cfme_flavor | 1024 | 20 | 0 | 2 | True | | 669fa648-1596-4327-9aae-85d6e5814216 | test2_flavor | 10240 | 100 | 50 | 10 | True | | 670 | cfme_flavor2 | 4096 | 30 | 0 | 6 | True | +--------------------------------------+--------------+-------+------+-----------+-------+-----------+ ~~~ In this case, test2_flavor was created with 'openstack' command. After that, cfme_flavor2 was created from the latest CFME. Current implementation in CFME assumes that the flavor id is always decimal number. But, UUID is used in actual usecase. In OpenStack side, flavor id is not mandatory option in creating flavor. CFME should not assign flavor id by itself. OpenStack should handle it. Version-Release number of selected component (if applicable): CFME-5.9.3.4 How reproducible: Everytime Steps to Reproduce: 1. Setup OSP provider 2. Create a flavor in RHOSP whose id is UUID. 3. Create a flavor from CFME. Actual results: CFME always generate numeric ID. Expected results: CFME doesn't send a flavor id at creating flavor to OpenStack.
https://github.com/fog/fog-openstack/pull/411
Once the Fog PR is merged we'll still have to wait for a new release of Fog and an update to the gemspec in the openstack provider repo before this can go to POST.
Hello Sam, Do we have any updates on this bugzilla? Best Regards, Keigo Noha
Fog has been updated, setting this to POST.
Verified on 5.10.0.24