Thursday, 2022-12-08

opendevreviewGrzegorz Grasza proposed openstack/keystoneauth master: Remove six  https://review.opendev.org/c/openstack/keystoneauth/+/81667111:55
eesti am trying to create a server in openstack using block storage, i have gotten it to work by calling conn.compute.create_server() with a block_device_mapping_v2 list with the same content as is constructed in https://github.com/openstack/openstacksdk/blob/17fde652ada983d6a04dc98b90913f8066187dc3/openstack/cloud/_compute.py#L999-L1006 now to my issue: is there a way to point out what specific "volume 12:50
eesttype" you want? if i run "openstack volume type list" i see there are more than one volume type and currently i get one of them, but i am not sure how i would pick a specific one12:50
eestif i just try suppling an "volume_type" field i get a "Additional properties are not allowed (u'volume_type' was unexpected)" error12:52
fricklereest: seems like support for this is still missing. stephenfin ^^ do you have a list of nova gaps?13:13
stephenfineest: '--volume' is a helper option that allows you to attach a volume using the most common configuration. If you want to configure additional things like volume type, you will need to use '--block-device'. See https://review.opendev.org/c/openstack/python-openstackclient/+/866325 for more context13:18
stephenfineest: You'll note there that we're currently unable to use '--block-device' for the boot volume though. There's a fix proposed but it hasn't been included in a release yet. If you need a boot volume, you'll have to use the legacy '--block-device-mapping' option13:19
eesthmm, just to be clear i am not trying to create the server using the openstack CLI, i only used it to show how i proved there were multiple volume types to chose from13:21
stephenfinoh, sorry, you're using SDK13:22
eesti am right now calling the compute.create_server() function from code, and passing it block_device_mapping_v2 basically filled in the same way the code i linked on github does13:22
stephenfineest: https://docs.openstack.org/api-ref/compute/?expanded=create-server-detail#id1113:23
stephenfinLook for "block_device_mapping_v2 (Optional)"13:23
stephenfinYou'll see under that all the possible keys and values for each (JSON) object in the block_device_mapping_v2 (JSON) list field13:24
eestfound it, so it seems there is no way to pass in the "type" then?13:24
stephenfinblock_device_mapping_v2.volume_type (Optional)13:24
stephenfinThe device volume_type. This can be used to specify the type of volume which the compute service will create and attach to the server. If not specified, the block storage service will provide a default volume type. See the block storage volume types API for more details.13:25
fricklerstephenfin: but it seems the sdk rejects that option?13:25
fricklereest: can you share the code you are invoking so we can doublecheck? use paste.opendev.org13:26
eestyes, hold on13:26
stephenfinI'd be surprised if it did. That seems to be mapped correctly in openstack/compute/v2/server.py13:27
eesthttps://paste.opendev.org/show/bztGgATTQcwKdam5UwVl/13:28
eestresults in "Additional properties are not allowed (u'volume_type' was unexpected)"13:29
eestit is possible i should not supply it in the dict?13:30
stephenfinthat's a nova error, not openstacksdk. You're using the wrong microversion. You need 2.67 or greater13:31
eesthmm, is that something supplied to create_server() or something else?13:31
stephenfinyes, you should be able to pass microversion to create_server13:33
stephenfinIf you enable debugging you will see the X-Openstack-API-Version header you're sending nova as well as the error messages coming back13:34
stephenfinopenstack.enable_logging(debug=True)13:35
eesti dont seem to be setting that header in the request13:41
fricklereest: what version of openstacksdk are you using?13:41
frickleralso which version is your openstack cloud?13:42
eestthe RESP includes x-openstack-nova-api-version: 2.113:42
frickleryour example works just fine for me, with both 0.61.0 and 0.103.013:45
eestopenstacksdk           0.101.013:49
eesthmm, ok...13:50
fricklerdo you set up your cloud from clouds.yaml or by explicit auth parameters?13:52
eestclouds.yaml13:52
eestis there a way to request a specifc microversion in that? tried looking earlier and came up emtpy13:53
fricklereest: set "compute_api_version: 2.90"13:58
eesti am just doing: conn = openstack.connect(cloud="openstack")13:58
eestso it is very opaque13:58
fricklersame here13:58
eestwill try to add your thing to the file13:59
fricklerif I set "compute_api_version: 2.1" I get the same error as you13:59
fricklerbut without anything specified the sdk should use the latest available version13:59
eestwith your addition i see -H "X-OpenStack-Nova-API-Version: 2.9" in the debug request, so seems like it is being picked up, still the same error14:03
eestthe resp does echo x-openstack-nova-api-version: 2.9, not sure that means it was accepted server side or just echoing what i sent to it14:05
eest(of course, interesting that it strips the trailing zero, i have verifed it is not missing in the config)14:09
eestthis is interesting, i tried changing it to 2.79 just since this seemed to work with openstack CLI earlier, and now a call to conn.compute.find_image(image_name) earlier in the code fails with a "The resource could not be found."14:14
fricklereest: 2.9 is too old, I wrote 2.9014:16
fricklerah, wait, you may need to quota that, so it becomes a string14:17
eestright, yes, quoting it is one step better, now it fails: "Version 2.90 is not supported by the API. Minimum is 2.1 and maximum is 2.79"14:18
eestone step closer!14:18
fricklero.k., then 2.79 is the correct value for you, that's train. pretty old but still should work14:19
fricklerbut you should not use conn.compute.find_image, use conn.image.find_image()14:22
eestthat code is based on teh create_server example at https://docs.openstack.org/openstacksdk/latest/user/guides/compute.html14:24
eestso i get image and flavor via the compute call14:24
eestis the example outdated?14:24
fricklereest: it seems so, yes14:28
eestroger, ill change it and see what happens14:30
eestoh shit, i just might have worked14:31
eestyeah, trying to create it with a nonexistant type name also fails as expected now: "Volume type fastt could not be found."14:35
eestso it seems to do what it is supposed to14:35
eestim curious if it is a separate issue that my openstacksdk did not automatically go for the later available compute api version14:35
eestbut thanks a lot for helping me with this, not sure how long it would have taken to figure this out myself14:36
eeststephenfin: also, thanks for your review on https://review.opendev.org/c/openstack/openstacksdk/+/86566714:36
stephenfinnw14:37
eestfrickler: is the automatic api version detection described anywhere? it seems it is not happening for me at least15:20
fricklereest: I'm not sure, I'll have to dig a bit tomorrow15:40
eestthe only version related setting i had in my file was identity_api_version, i tried commenting out that in case it somehow influenced something but the result was the same15:43
stephenfineest: an automatic microversion is taken from the _max_microversion variable in a given resource. For 'create_server' that would 'Server' in openstack.compute.v2.server16:04
stephenfineest: However, that can be overridden by user-level configuration, by either providing a 'microversion' parameter to various methods or setting '{service}_api_version' in clouds.yaml16:06
stephenfinOSC also supports configuration via command line options of environment variables but you'd need to do some wiring up to support that in pure SDK16:06
*** ministry is now known as __ministry16:07
stephenfingtema: can you look at https://review.opendev.org/c/openstack/openstacksdk/+/864029 to unblock some OSC work I've been workingo n?16:09
stephenfin*working on16:09
opendevreviewStephen Finucane proposed openstack/openstacksdk master: image: Add missing image import options  https://review.opendev.org/c/openstack/openstacksdk/+/86402918:46
opendevreviewStephen Finucane proposed openstack/openstacksdk master: image: Reformat proxy modules  https://review.opendev.org/c/openstack/openstacksdk/+/86704018:46
opendevreviewStephen Finucane proposed openstack/openstacksdk master: image: Remove _base_proxy module  https://review.opendev.org/c/openstack/openstacksdk/+/86704118:46
opendevreviewStephen Finucane proposed openstack/openstacksdk master: image: Remove unnecessary abstractions  https://review.opendev.org/c/openstack/openstacksdk/+/86704218:46
opendevreviewStephen Finucane proposed openstack/openstacksdk master: image: Modify signatures of various image methods  https://review.opendev.org/c/openstack/openstacksdk/+/86704318:46
opendevreviewStephen Finucane proposed openstack/openstacksdk master: image: Remove unsupported parameters from v1 proxy  https://review.opendev.org/c/openstack/openstacksdk/+/86704418:46
opendevreviewStephen Finucane proposed openstack/openstacksdk master: image: Prevent passing conflicts args to stage_image  https://review.opendev.org/c/openstack/openstacksdk/+/86704518:46

Generated by irclog2html.py 2.17.3 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!